diff --git a/plugins/multiview/config.py b/plugins/multiview/config.py index 826dde3..ebb78e6 100644 --- a/plugins/multiview/config.py +++ b/plugins/multiview/config.py @@ -519,27 +519,39 @@ def _build_warnings_fields(settings: dict) -> list: def _get_multiview_channel_ids() -> set: - """Return the set of Channel IDs that belong to the Dispatcharr Multiview M3U account.""" + """Return the set of Channel IDs backed by the Dispatcharr Multiview M3U account.""" try: from apps.m3u.models import M3UAccount from apps.channels.models import Channel acct = M3UAccount.objects.filter(name="Dispatcharr Multiview").first() if not acct: return set() - for field in ("m3u_account", "account", "m3u_account_id", "source"): - try: - ids = set(Channel.objects.filter(**{field: acct}).values_list("id", flat=True)) - return ids - except Exception: - continue + return set( + Channel.objects.filter(streams__m3u_account=acct) + .values_list("id", flat=True) + .distinct() + ) except Exception: - pass - return set() + return set() + + +def _get_streamless_channel_ids() -> set: + """Return the set of Channel IDs with no streams assigned.""" + try: + from django.db.models import Count + from apps.channels.models import Channel + return set( + Channel.objects.annotate(n_streams=Count("streams")) + .filter(n_streams=0) + .values_list("id", flat=True) + ) + except Exception: + return set() def _build_channel_options() -> list: """Return channel select options from the live DB, excluding multiview output channels.""" - excluded = _get_multiview_channel_ids() + excluded = _get_multiview_channel_ids() | _get_streamless_channel_ids() opts = [{"value": "_none", "label": "Select a channel"}] try: from apps.channels.models import Channel @@ -560,8 +572,10 @@ def _build_layout_channel_options(layout_id: str, settings: dict, ch_count: int, try: from apps.channels.models import Channel if selector_type == "regex" and regex_pattern: + excluded = _get_multiview_channel_ids() | _get_streamless_channel_ids() for ch in ( Channel.objects.filter(name__iregex=regex_pattern) + .exclude(id__in=excluded) .order_by("channel_number")[:ch_count] .values("id", "name", "channel_number") .distinct() diff --git a/plugins/multiview/dash/static/assets/index-CFcetVdh.js b/plugins/multiview/dash/static/assets/index-D909_1-I.js similarity index 74% rename from plugins/multiview/dash/static/assets/index-CFcetVdh.js rename to plugins/multiview/dash/static/assets/index-D909_1-I.js index 0dbc4f4..e102a96 100644 --- a/plugins/multiview/dash/static/assets/index-CFcetVdh.js +++ b/plugins/multiview/dash/static/assets/index-D909_1-I.js @@ -1,12 +1,12 @@ -function P2(e,o){for(var r=0;ra[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function r(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(l){if(l.ep)return;l.ep=!0;const c=r(l);fetch(l.href,c)}})();function Xp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wh={exports:{}},Wl={};var p0;function V2(){if(p0)return Wl;p0=1;var e=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function r(a,l,c){var u=null;if(c!==void 0&&(u=""+c),l.key!==void 0&&(u=""+l.key),"key"in l){c={};for(var f in l)f!=="key"&&(c[f]=l[f])}else c=l;return l=c.ref,{$$typeof:e,type:a,key:u,ref:l!==void 0?l:null,props:c}}return Wl.Fragment=o,Wl.jsx=r,Wl.jsxs=r,Wl}var m0;function Y2(){return m0||(m0=1,wh.exports=V2()),wh.exports}var y=Y2(),Ch={exports:{}},ze={};var g0;function G2(){if(g0)return ze;g0=1;var e=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),x=Symbol.iterator;function S(D){return D===null||typeof D!="object"?null:(D=x&&D[x]||D["@@iterator"],typeof D=="function"?D:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,R={};function T(D,O,q){this.props=D,this.context=O,this.refs=R,this.updater=q||E}T.prototype.isReactComponent={},T.prototype.setState=function(D,O){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,O,"setState")},T.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function z(){}z.prototype=T.prototype;function A(D,O,q){this.props=D,this.context=O,this.refs=R,this.updater=q||E}var N=A.prototype=new z;N.constructor=A,C(N,T.prototype),N.isPureReactComponent=!0;var B=Array.isArray;function M(){}var $={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function H(D,O,q){var W=q.ref;return{$$typeof:e,type:D,key:O,ref:W!==void 0?W:null,props:q}}function I(D,O){return H(D.type,O,D.props)}function Y(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function X(D){var O={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(q){return O[q]})}var ee=/\/+/g;function ne(D,O){return typeof D=="object"&&D!==null&&D.key!=null?X(""+D.key):O.toString(36)}function re(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(M,M):(D.status="pending",D.then(function(O){D.status==="pending"&&(D.status="fulfilled",D.value=O)},function(O){D.status==="pending"&&(D.status="rejected",D.reason=O)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function j(D,O,q,W,ie){var ue=typeof D;(ue==="undefined"||ue==="boolean")&&(D=null);var ve=!1;if(D===null)ve=!0;else switch(ue){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(D.$$typeof){case e:case o:ve=!0;break;case g:return ve=D._init,j(ve(D._payload),O,q,W,ie)}}if(ve)return ie=ie(D),ve=W===""?"."+ne(D,0):W,B(ie)?(q="",ve!=null&&(q=ve.replace(ee,"$&/")+"/"),j(ie,O,q,"",function(ye){return ye})):ie!=null&&(Y(ie)&&(ie=I(ie,q+(ie.key==null||D&&D.key===ie.key?"":(""+ie.key).replace(ee,"$&/")+"/")+ve)),O.push(ie)),1;ve=0;var fe=W===""?".":W+":";if(B(D))for(var be=0;be>>1,Z=j[P];if(0>>1;Pl(q,V))Wl(ie,q)?(j[P]=ie,j[W]=V,P=W):(j[P]=q,j[O]=V,P=O);else if(Wl(ie,V))j[P]=ie,j[W]=V,P=W;else break e}}return k}function l(j,k){var V=j.sortIndex-k.sortIndex;return V!==0?V:j.id-k.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var h=[],p=[],g=1,v=null,x=3,S=!1,E=!1,C=!1,R=!1,T=typeof setTimeout=="function"?setTimeout:null,z=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function N(j){for(var k=r(p);k!==null;){if(k.callback===null)a(p);else if(k.startTime<=j)a(p),k.sortIndex=k.expirationTime,o(h,k);else break;k=r(p)}}function B(j){if(C=!1,N(j),!E)if(r(h)!==null)E=!0,M||(M=!0,X());else{var k=r(p);k!==null&&re(B,k.startTime-j)}}var M=!1,$=-1,L=5,H=-1;function I(){return R?!0:!(e.unstable_now()-Hj&&I());){var P=v.callback;if(typeof P=="function"){v.callback=null,x=v.priorityLevel;var Z=P(v.expirationTime<=j);if(j=e.unstable_now(),typeof Z=="function"){v.callback=Z,N(j),k=!0;break t}v===r(h)&&a(h),N(j)}else a(h);v=r(h)}if(v!==null)k=!0;else{var D=r(p);D!==null&&re(B,D.startTime-j),k=!1}}break e}finally{v=null,x=V,S=!1}k=void 0}}finally{k?X():M=!1}}}var X;if(typeof A=="function")X=function(){A(Y)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,ne=ee.port2;ee.port1.onmessage=Y,X=function(){ne.postMessage(null)}}else X=function(){T(Y,0)};function re(j,k){$=T(function(){j(e.unstable_now())},k)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(j){j.callback=null},e.unstable_forceFrameRate=function(j){0>j||125P?(j.sortIndex=V,o(p,j),r(h)===null&&j===r(p)&&(C?(z($),$=-1):C=!0,re(B,V-P))):(j.sortIndex=Z,o(h,j),E||S||(E=!0,M||(M=!0,X()))),j},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(j){var k=x;return function(){var V=x;x=k;try{return j.apply(this,arguments)}finally{x=V}}}})(Th)),Th}var b0;function I2(){return b0||(b0=1,Rh.exports=q2()),Rh.exports}var _h={exports:{}},an={};var x0;function F2(){if(x0)return an;x0=1;var e=qp();function o(h){var p="https://react.dev/errors/"+h;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(o){console.error(o)}}return e(),_h.exports=F2(),_h.exports}var w0;function Z2(){if(w0)return Jl;w0=1;var e=I2(),o=qp(),r=ix();function a(t){var n="https://react.dev/errors/"+t;if(1Z||(t.current=P[Z],P[Z]=null,Z--)}function q(t,n){Z++,P[Z]=t.current,t.current=n}var W=D(null),ie=D(null),ue=D(null),ve=D(null);function fe(t,n){switch(q(ue,n),q(ie,t),q(W,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Lb(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Lb(n),t=kb(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}O(W),q(W,t)}function be(){O(W),O(ie),O(ue)}function ye(t){t.memoizedState!==null&&q(ve,t);var n=W.current,i=kb(n,t.type);n!==i&&(q(ie,t),q(W,i))}function Ge(t){ie.current===t&&(O(W),O(ie)),ve.current===t&&(O(ve),Fl._currentValue=V)}var Ne,Ke;function Be(t){if(Ne===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);Ne=n&&n[1]||"",Ke=-1a[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function r(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(l){if(l.ep)return;l.ep=!0;const c=r(l);fetch(l.href,c)}})();function Xp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wh={exports:{}},Kl={};var m0;function V2(){if(m0)return Kl;m0=1;var e=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function r(a,l,c){var u=null;if(c!==void 0&&(u=""+c),l.key!==void 0&&(u=""+l.key),"key"in l){c={};for(var f in l)f!=="key"&&(c[f]=l[f])}else c=l;return l=c.ref,{$$typeof:e,type:a,key:u,ref:l!==void 0?l:null,props:c}}return Kl.Fragment=o,Kl.jsx=r,Kl.jsxs=r,Kl}var g0;function Y2(){return g0||(g0=1,wh.exports=V2()),wh.exports}var y=Y2(),Ch={exports:{}},ze={};var v0;function G2(){if(v0)return ze;v0=1;var e=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),x=Symbol.iterator;function S(D){return D===null||typeof D!="object"?null:(D=x&&D[x]||D["@@iterator"],typeof D=="function"?D:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,R={};function T(D,O,q){this.props=D,this.context=O,this.refs=R,this.updater=q||E}T.prototype.isReactComponent={},T.prototype.setState=function(D,O){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,O,"setState")},T.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function z(){}z.prototype=T.prototype;function A(D,O,q){this.props=D,this.context=O,this.refs=R,this.updater=q||E}var N=A.prototype=new z;N.constructor=A,C(N,T.prototype),N.isPureReactComponent=!0;var B=Array.isArray;function M(){}var $={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function H(D,O,q){var W=q.ref;return{$$typeof:e,type:D,key:O,ref:W!==void 0?W:null,props:q}}function I(D,O){return H(D.type,O,D.props)}function Y(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function X(D){var O={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(q){return O[q]})}var ee=/\/+/g;function ne(D,O){return typeof D=="object"&&D!==null&&D.key!=null?X(""+D.key):O.toString(36)}function re(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(M,M):(D.status="pending",D.then(function(O){D.status==="pending"&&(D.status="fulfilled",D.value=O)},function(O){D.status==="pending"&&(D.status="rejected",D.reason=O)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function j(D,O,q,W,ie){var ue=typeof D;(ue==="undefined"||ue==="boolean")&&(D=null);var ve=!1;if(D===null)ve=!0;else switch(ue){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(D.$$typeof){case e:case o:ve=!0;break;case g:return ve=D._init,j(ve(D._payload),O,q,W,ie)}}if(ve)return ie=ie(D),ve=W===""?"."+ne(D,0):W,B(ie)?(q="",ve!=null&&(q=ve.replace(ee,"$&/")+"/"),j(ie,O,q,"",function(ye){return ye})):ie!=null&&(Y(ie)&&(ie=I(ie,q+(ie.key==null||D&&D.key===ie.key?"":(""+ie.key).replace(ee,"$&/")+"/")+ve)),O.push(ie)),1;ve=0;var fe=W===""?".":W+":";if(B(D))for(var be=0;be>>1,Z=j[P];if(0>>1;Pl(q,V))Wl(ie,q)?(j[P]=ie,j[W]=V,P=W):(j[P]=q,j[O]=V,P=O);else if(Wl(ie,V))j[P]=ie,j[W]=V,P=W;else break e}}return k}function l(j,k){var V=j.sortIndex-k.sortIndex;return V!==0?V:j.id-k.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var h=[],p=[],g=1,v=null,x=3,S=!1,E=!1,C=!1,R=!1,T=typeof setTimeout=="function"?setTimeout:null,z=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function N(j){for(var k=r(p);k!==null;){if(k.callback===null)a(p);else if(k.startTime<=j)a(p),k.sortIndex=k.expirationTime,o(h,k);else break;k=r(p)}}function B(j){if(C=!1,N(j),!E)if(r(h)!==null)E=!0,M||(M=!0,X());else{var k=r(p);k!==null&&re(B,k.startTime-j)}}var M=!1,$=-1,L=5,H=-1;function I(){return R?!0:!(e.unstable_now()-Hj&&I());){var P=v.callback;if(typeof P=="function"){v.callback=null,x=v.priorityLevel;var Z=P(v.expirationTime<=j);if(j=e.unstable_now(),typeof Z=="function"){v.callback=Z,N(j),k=!0;break t}v===r(h)&&a(h),N(j)}else a(h);v=r(h)}if(v!==null)k=!0;else{var D=r(p);D!==null&&re(B,D.startTime-j),k=!1}}break e}finally{v=null,x=V,S=!1}k=void 0}}finally{k?X():M=!1}}}var X;if(typeof A=="function")X=function(){A(Y)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,ne=ee.port2;ee.port1.onmessage=Y,X=function(){ne.postMessage(null)}}else X=function(){T(Y,0)};function re(j,k){$=T(function(){j(e.unstable_now())},k)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(j){j.callback=null},e.unstable_forceFrameRate=function(j){0>j||125P?(j.sortIndex=V,o(p,j),r(h)===null&&j===r(p)&&(C?(z($),$=-1):C=!0,re(B,V-P))):(j.sortIndex=Z,o(h,j),E||S||(E=!0,M||(M=!0,X()))),j},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(j){var k=x;return function(){var V=x;x=k;try{return j.apply(this,arguments)}finally{x=V}}}})(Th)),Th}var x0;function I2(){return x0||(x0=1,Rh.exports=q2()),Rh.exports}var _h={exports:{}},an={};var S0;function F2(){if(S0)return an;S0=1;var e=qp();function o(h){var p="https://react.dev/errors/"+h;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(o){console.error(o)}}return e(),_h.exports=F2(),_h.exports}var C0;function Z2(){if(C0)return Wl;C0=1;var e=I2(),o=qp(),r=lx();function a(t){var n="https://react.dev/errors/"+t;if(1Z||(t.current=P[Z],P[Z]=null,Z--)}function q(t,n){Z++,P[Z]=t.current,t.current=n}var W=D(null),ie=D(null),ue=D(null),ve=D(null);function fe(t,n){switch(q(ue,n),q(ie,t),q(W,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?kb(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=kb(n),t=Hb(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}O(W),q(W,t)}function be(){O(W),O(ie),O(ue)}function ye(t){t.memoizedState!==null&&q(ve,t);var n=W.current,i=Hb(n,t.type);n!==i&&(q(ie,t),q(W,i))}function Xe(t){ie.current===t&&(O(W),O(ie)),ve.current===t&&(O(ve),Il._currentValue=V)}var Ne,We;function Be(t){if(Ne===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);Ne=n&&n[1]||"",We=-1)":-1d||U[s]!==K[d]){var ae=` -`+U[s].replace(" at new "," at ");return t.displayName&&ae.includes("")&&(ae=ae.replace("",t.displayName)),ae}while(1<=s&&0<=d);break}}}finally{tt=!1,Error.prepareStackTrace=i}return(i=t?t.displayName||t.name:"")?Be(i):""}function pe(t,n){switch(t.tag){case 26:case 27:case 5:return Be(t.type);case 16:return Be("Lazy");case 13:return t.child!==n&&n!==null?Be("Suspense Fallback"):Be("Suspense");case 19:return Be("SuspenseList");case 0:case 15:return vt(t.type,!1);case 11:return vt(t.type.render,!1);case 1:return vt(t.type,!0);case 31:return Be("Activity");default:return""}}function me(t){try{var n="",i=null;do n+=pe(t,i),i=t,t=t.return;while(t);return n}catch(s){return` +`+U[s].replace(" at new "," at ");return t.displayName&&ae.includes("")&&(ae=ae.replace("",t.displayName)),ae}while(1<=s&&0<=d);break}}}finally{nt=!1,Error.prepareStackTrace=i}return(i=t?t.displayName||t.name:"")?Be(i):""}function pe(t,n){switch(t.tag){case 26:case 27:case 5:return Be(t.type);case 16:return Be("Lazy");case 13:return t.child!==n&&n!==null?Be("Suspense Fallback"):Be("Suspense");case 19:return Be("SuspenseList");case 0:case 15:return vt(t.type,!1);case 11:return vt(t.type.render,!1);case 1:return vt(t.type,!0);case 31:return Be("Activity");default:return""}}function me(t){try{var n="",i=null;do n+=pe(t,i),i=t,t=t.return;while(t);return n}catch(s){return` Error generating stack: `+s.message+` -`+s.stack}}var we=Object.prototype.hasOwnProperty,De=e.unstable_scheduleCallback,Ae=e.unstable_cancelCallback,xe=e.unstable_shouldYield,$e=e.unstable_requestPaint,de=e.unstable_now,Re=e.unstable_getCurrentPriorityLevel,dt=e.unstable_ImmediatePriority,nt=e.unstable_UserBlockingPriority,yt=e.unstable_NormalPriority,We=e.unstable_LowPriority,wt=e.unstable_IdlePriority,on=e.log,Qr=e.unstable_setDisableYieldValue,Oo=null,Gt=null;function st(t){if(typeof on=="function"&&Qr(t),Gt&&typeof Gt.setStrictMode=="function")try{Gt.setStrictMode(Oo,t)}catch{}}var Ct=Math.clz32?Math.clz32:df,Kr=Math.log,Ms=Math.LN2;function df(t){return t>>>=0,t===0?32:31-(Kr(t)/Ms|0)|0}var Ba=256,$a=262144,Et=4194304;function Rt(t){var n=t&42;if(n!==0)return n;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Xt(t,n,i){var s=t.pendingLanes;if(s===0)return 0;var d=0,m=t.suspendedLanes,w=t.pingedLanes;t=t.warmLanes;var _=s&134217727;return _!==0?(s=_&~m,s!==0?d=Rt(s):(w&=_,w!==0?d=Rt(w):i||(i=_&~t,i!==0&&(d=Rt(i))))):(_=s&~m,_!==0?d=Rt(_):w!==0?d=Rt(w):i||(i=s&~t,i!==0&&(d=Rt(i)))),d===0?0:n!==0&&n!==d&&(n&m)===0&&(m=d&-d,i=n&-n,m>=i||m===32&&(i&4194048)!==0)?n:d}function hn(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function pn(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function rn(){var t=Et;return Et<<=1,(Et&62914560)===0&&(Et=4194304),t}function mn(t){for(var n=[],i=0;31>i;i++)n.push(t);return n}function Ln(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Ht(t,n,i,s,d,m){var w=t.pendingLanes;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=i,t.entangledLanes&=i,t.errorRecoveryDisabledLanes&=i,t.shellSuspendCounter=0;var _=t.entanglements,U=t.expirationTimes,K=t.hiddenUpdates;for(i=w&~i;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var BC=/[\n"\\]/g;function Pn(t){return t.replace(BC,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function gf(t,n,i,s,d,m,w,_){t.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?t.type=w:t.removeAttribute("type"),n!=null?w==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Un(n)):t.value!==""+Un(n)&&(t.value=""+Un(n)):w!=="submit"&&w!=="reset"||t.removeAttribute("value"),n!=null?vf(t,w,Un(n)):i!=null?vf(t,w,Un(i)):s!=null&&t.removeAttribute("value"),d==null&&m!=null&&(t.defaultChecked=!!m),d!=null&&(t.checked=d&&typeof d!="function"&&typeof d!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?t.name=""+Un(_):t.removeAttribute("name")}function zg(t,n,i,s,d,m,w,_){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(t.type=m),n!=null||i!=null){if(!(m!=="submit"&&m!=="reset"||n!=null)){mf(t);return}i=i!=null?""+Un(i):"",n=n!=null?""+Un(n):i,_||n===t.value||(t.value=n),t.defaultValue=n}s=s??d,s=typeof s!="function"&&typeof s!="symbol"&&!!s,t.checked=_?t.checked:!!s,t.defaultChecked=!!s,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(t.name=w),mf(t)}function vf(t,n,i){n==="number"&&Bs(t.ownerDocument)===t||t.defaultValue===""+i||(t.defaultValue=""+i)}function Va(t,n,i,s){if(t=t.options,n){n={};for(var d=0;d"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wf=!1;if(ko)try{var dl={};Object.defineProperty(dl,"passive",{get:function(){wf=!0}}),window.addEventListener("test",dl,dl),window.removeEventListener("test",dl,dl)}catch{wf=!1}var pr=null,Cf=null,Ls=null;function kg(){if(Ls)return Ls;var t,n=Cf,i=n.length,s,d="value"in pr?pr.value:pr.textContent,m=d.length;for(t=0;t=ml),Gg=" ",Xg=!1;function qg(t,n){switch(t){case"keyup":return cE.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ig(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var qa=!1;function fE(t,n){switch(t){case"compositionend":return Ig(n);case"keypress":return n.which!==32?null:(Xg=!0,Gg);case"textInput":return t=n.data,t===Gg&&Xg?null:t;default:return null}}function dE(t,n){if(qa)return t==="compositionend"||!Df&&qg(t,n)?(t=kg(),Ls=Cf=pr=null,qa=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:i,offset:n-t};t=s}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=tv(i)}}function ov(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?ov(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function rv(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=Bs(t.document);n instanceof t.HTMLIFrameElement;){try{var i=typeof n.contentWindow.location.href=="string"}catch{i=!1}if(i)t=n.contentWindow;else break;n=Bs(t.document)}return n}function zf(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var xE=ko&&"documentMode"in document&&11>=document.documentMode,Ia=null,Mf=null,bl=null,Of=!1;function av(t,n,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Of||Ia==null||Ia!==Bs(s)||(s=Ia,"selectionStart"in s&&zf(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),bl&&yl(bl,s)||(bl=s,s=Ac(Mf,"onSelect"),0>=w,d-=w,bo=1<<32-Ct(n)+d|i<Oe?(Ue=Ce,Ce=null):Ue=Ce.sibling;var Ie=J(F,Ce,Q[Oe],le);if(Ie===null){Ce===null&&(Ce=Ue);break}t&&Ce&&Ie.alternate===null&&n(F,Ce),G=m(Ie,G,Oe),qe===null?Ee=Ie:qe.sibling=Ie,qe=Ie,Ce=Ue}if(Oe===Q.length)return i(F,Ce),Pe&&Uo(F,Oe),Ee;if(Ce===null){for(;OeOe?(Ue=Ce,Ce=null):Ue=Ce.sibling;var $r=J(F,Ce,Ie.value,le);if($r===null){Ce===null&&(Ce=Ue);break}t&&Ce&&$r.alternate===null&&n(F,Ce),G=m($r,G,Oe),qe===null?Ee=$r:qe.sibling=$r,qe=$r,Ce=Ue}if(Ie.done)return i(F,Ce),Pe&&Uo(F,Oe),Ee;if(Ce===null){for(;!Ie.done;Oe++,Ie=Q.next())Ie=se(F,Ie.value,le),Ie!==null&&(G=m(Ie,G,Oe),qe===null?Ee=Ie:qe.sibling=Ie,qe=Ie);return Pe&&Uo(F,Oe),Ee}for(Ce=s(Ce);!Ie.done;Oe++,Ie=Q.next())Ie=te(Ce,F,Oe,Ie.value,le),Ie!==null&&(t&&Ie.alternate!==null&&Ce.delete(Ie.key===null?Oe:Ie.key),G=m(Ie,G,Oe),qe===null?Ee=Ie:qe.sibling=Ie,qe=Ie);return t&&Ce.forEach(function(U2){return n(F,U2)}),Pe&&Uo(F,Oe),Ee}function at(F,G,Q,le){if(typeof Q=="object"&&Q!==null&&Q.type===C&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case S:e:{for(var Ee=Q.key;G!==null;){if(G.key===Ee){if(Ee=Q.type,Ee===C){if(G.tag===7){i(F,G.sibling),le=d(G,Q.props.children),le.return=F,F=le;break e}}else if(G.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===L&&sa(Ee)===G.type){i(F,G.sibling),le=d(G,Q.props),Rl(le,Q),le.return=F,F=le;break e}i(F,G);break}else n(F,G);G=G.sibling}Q.type===C?(le=oa(Q.props.children,F.mode,le,Q.key),le.return=F,F=le):(le=Is(Q.type,Q.key,Q.props,null,F.mode,le),Rl(le,Q),le.return=F,F=le)}return w(F);case E:e:{for(Ee=Q.key;G!==null;){if(G.key===Ee)if(G.tag===4&&G.stateNode.containerInfo===Q.containerInfo&&G.stateNode.implementation===Q.implementation){i(F,G.sibling),le=d(G,Q.children||[]),le.return=F,F=le;break e}else{i(F,G);break}else n(F,G);G=G.sibling}le=Uf(Q,F.mode,le),le.return=F,F=le}return w(F);case L:return Q=sa(Q),at(F,G,Q,le)}if(re(Q))return Se(F,G,Q,le);if(X(Q)){if(Ee=X(Q),typeof Ee!="function")throw Error(a(150));return Q=Ee.call(Q),Te(F,G,Q,le)}if(typeof Q.then=="function")return at(F,G,ec(Q),le);if(Q.$$typeof===A)return at(F,G,Qs(F,Q),le);tc(F,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,G!==null&&G.tag===6?(i(F,G.sibling),le=d(G,Q),le.return=F,F=le):(i(F,G),le=Hf(Q,F.mode,le),le.return=F,F=le),w(F)):i(F,G)}return function(F,G,Q,le){try{El=0;var Ee=at(F,G,Q,le);return ri=null,Ee}catch(Ce){if(Ce===oi||Ce===Ws)throw Ce;var qe=An(29,Ce,null,F.mode);return qe.lanes=le,qe.return=F,qe}}}var ua=Dv(!0),Nv=Dv(!1),br=!1;function Wf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jf(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function xr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Sr(t,n,i){var s=t.updateQueue;if(s===null)return null;if(s=s.shared,(Fe&2)!==0){var d=s.pending;return d===null?n.next=n:(n.next=d.next,d.next=n),s.pending=n,n=qs(t),dv(t,null,i),n}return Xs(t,s,n,i),qs(t)}function Tl(t,n,i){if(n=n.updateQueue,n!==null&&(n=n.shared,(i&4194048)!==0)){var s=n.lanes;s&=t.pendingLanes,i|=s,n.lanes=i,Dn(t,i)}}function ed(t,n){var i=t.updateQueue,s=t.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var d=null,m=null;if(i=i.firstBaseUpdate,i!==null){do{var w={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};m===null?d=m=w:m=m.next=w,i=i.next}while(i!==null);m===null?d=m=n:m=m.next=n}else d=m=n;i={baseState:s.baseState,firstBaseUpdate:d,lastBaseUpdate:m,shared:s.shared,callbacks:s.callbacks},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=n:t.next=n,i.lastBaseUpdate=n}var td=!1;function _l(){if(td){var t=ni;if(t!==null)throw t}}function Dl(t,n,i,s){td=!1;var d=t.updateQueue;br=!1;var m=d.firstBaseUpdate,w=d.lastBaseUpdate,_=d.shared.pending;if(_!==null){d.shared.pending=null;var U=_,K=U.next;U.next=null,w===null?m=K:w.next=K,w=U;var ae=t.alternate;ae!==null&&(ae=ae.updateQueue,_=ae.lastBaseUpdate,_!==w&&(_===null?ae.firstBaseUpdate=K:_.next=K,ae.lastBaseUpdate=U))}if(m!==null){var se=d.baseState;w=0,ae=K=U=null,_=m;do{var J=_.lane&-536870913,te=J!==_.lane;if(te?(He&J)===J:(s&J)===J){J!==0&&J===ti&&(td=!0),ae!==null&&(ae=ae.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var Se=t,Te=_;J=n;var at=i;switch(Te.tag){case 1:if(Se=Te.payload,typeof Se=="function"){se=Se.call(at,se,J);break e}se=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Te.payload,J=typeof Se=="function"?Se.call(at,se,J):Se,J==null)break e;se=v({},se,J);break e;case 2:br=!0}}J=_.callback,J!==null&&(t.flags|=64,te&&(t.flags|=8192),te=d.callbacks,te===null?d.callbacks=[J]:te.push(J))}else te={lane:J,tag:_.tag,payload:_.payload,callback:_.callback,next:null},ae===null?(K=ae=te,U=se):ae=ae.next=te,w|=J;if(_=_.next,_===null){if(_=d.shared.pending,_===null)break;te=_,_=te.next,te.next=null,d.lastBaseUpdate=te,d.shared.pending=null}}while(!0);ae===null&&(U=se),d.baseState=U,d.firstBaseUpdate=K,d.lastBaseUpdate=ae,m===null&&(d.shared.lanes=0),Tr|=w,t.lanes=w,t.memoizedState=se}}function Av(t,n){if(typeof t!="function")throw Error(a(191,t));t.call(n)}function zv(t,n){var i=t.callbacks;if(i!==null)for(t.callbacks=null,t=0;tm?m:8;var w=j.T,_={};j.T=_,xd(t,!1,n,i);try{var U=d(),K=j.S;if(K!==null&&K(_,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var ae=NE(U,s);zl(t,n,ae,Bn(t))}else zl(t,n,s,Bn(t))}catch(se){zl(t,n,{then:function(){},status:"rejected",reason:se},Bn())}finally{k.p=m,w!==null&&_.types!==null&&(w.types=_.types),j.T=w}}function BE(){}function yd(t,n,i,s){if(t.tag!==5)throw Error(a(476));var d=cy(t).queue;sy(t,d,n,V,i===null?BE:function(){return uy(t),i(s)})}function cy(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Go,lastRenderedState:V},next:null};var i={};return n.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Go,lastRenderedState:i},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function uy(t){var n=cy(t);n.next===null&&(n=t.alternate.memoizedState),zl(t,n.next.queue,{},Bn())}function bd(){return Jt(Fl)}function fy(){return _t().memoizedState}function dy(){return _t().memoizedState}function $E(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var i=Bn();t=xr(i);var s=Sr(n,t,i);s!==null&&(wn(s,n,i),Tl(s,n,i)),n={cache:Ff()},t.payload=n;return}n=n.return}}function LE(t,n,i){var s=Bn();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},fc(t)?py(n,i):(i=Lf(t,n,i,s),i!==null&&(wn(i,t,s),my(i,n,s)))}function hy(t,n,i){var s=Bn();zl(t,n,i,s)}function zl(t,n,i,s){var d={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(fc(t))py(n,d);else{var m=t.alternate;if(t.lanes===0&&(m===null||m.lanes===0)&&(m=n.lastRenderedReducer,m!==null))try{var w=n.lastRenderedState,_=m(w,i);if(d.hasEagerState=!0,d.eagerState=_,Nn(_,w))return Xs(t,n,d,0),ct===null&&Gs(),!1}catch{}if(i=Lf(t,n,d,s),i!==null)return wn(i,t,s),my(i,n,s),!0}return!1}function xd(t,n,i,s){if(s={lane:2,revertLane:Wd(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},fc(t)){if(n)throw Error(a(479))}else n=Lf(t,i,s,2),n!==null&&wn(n,t,2)}function fc(t){var n=t.alternate;return t===Me||n!==null&&n===Me}function py(t,n){ii=rc=!0;var i=t.pending;i===null?n.next=n:(n.next=i.next,i.next=n),t.pending=n}function my(t,n,i){if((i&4194048)!==0){var s=n.lanes;s&=t.pendingLanes,i|=s,n.lanes=i,Dn(t,i)}}var Ml={readContext:Jt,use:lc,useCallback:bt,useContext:bt,useEffect:bt,useImperativeHandle:bt,useLayoutEffect:bt,useInsertionEffect:bt,useMemo:bt,useReducer:bt,useRef:bt,useState:bt,useDebugValue:bt,useDeferredValue:bt,useTransition:bt,useSyncExternalStore:bt,useId:bt,useHostTransitionStatus:bt,useFormState:bt,useActionState:bt,useOptimistic:bt,useMemoCache:bt,useCacheRefresh:bt};Ml.useEffectEvent=bt;var gy={readContext:Jt,use:lc,useCallback:function(t,n){return fn().memoizedState=[t,n===void 0?null:n],t},useContext:Jt,useEffect:Jv,useImperativeHandle:function(t,n,i){i=i!=null?i.concat([t]):null,cc(4194308,4,oy.bind(null,n,t),i)},useLayoutEffect:function(t,n){return cc(4194308,4,t,n)},useInsertionEffect:function(t,n){cc(4,2,t,n)},useMemo:function(t,n){var i=fn();n=n===void 0?null:n;var s=t();if(fa){st(!0);try{t()}finally{st(!1)}}return i.memoizedState=[s,n],s},useReducer:function(t,n,i){var s=fn();if(i!==void 0){var d=i(n);if(fa){st(!0);try{i(n)}finally{st(!1)}}}else d=n;return s.memoizedState=s.baseState=d,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:d},s.queue=t,t=t.dispatch=LE.bind(null,Me,t),[s.memoizedState,t]},useRef:function(t){var n=fn();return t={current:t},n.memoizedState=t},useState:function(t){t=hd(t);var n=t.queue,i=hy.bind(null,Me,n);return n.dispatch=i,[t.memoizedState,i]},useDebugValue:gd,useDeferredValue:function(t,n){var i=fn();return vd(i,t,n)},useTransition:function(){var t=hd(!1);return t=sy.bind(null,Me,t.queue,!0,!1),fn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,i){var s=Me,d=fn();if(Pe){if(i===void 0)throw Error(a(407));i=i()}else{if(i=n(),ct===null)throw Error(a(349));(He&127)!==0||Lv(s,n,i)}d.memoizedState=i;var m={value:i,getSnapshot:n};return d.queue=m,Jv(Hv.bind(null,s,m,t),[t]),s.flags|=2048,si(9,{destroy:void 0},kv.bind(null,s,m,i,n),null),i},useId:function(){var t=fn(),n=ct.identifierPrefix;if(Pe){var i=xo,s=bo;i=(s&~(1<<32-Ct(s)-1)).toString(32)+i,n="_"+n+"R_"+i,i=ac++,0<\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof s.is=="string"?w.createElement("select",{is:s.is}):w.createElement("select"),s.multiple?m.multiple=!0:s.size&&(m.size=s.size);break;default:m=typeof s.is=="string"?w.createElement(d,{is:s.is}):w.createElement(d)}}m[Kt]=n,m[gn]=s;e:for(w=n.child;w!==null;){if(w.tag===5||w.tag===6)m.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===n)break e;for(;w.sibling===null;){if(w.return===null||w.return===n)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}n.stateNode=m;e:switch(tn(m,d,s),d){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&qo(n)}}return ft(n),jd(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,i),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==s&&qo(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(a(166));if(t=ue.current,Ja(n)){if(t=n.stateNode,i=n.memoizedProps,s=null,d=Wt,d!==null)switch(d.tag){case 27:case 5:s=d.memoizedProps}t[Kt]=n,t=!!(t.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||Bb(t.nodeValue,i)),t||vr(n,!0)}else t=zc(t).createTextNode(s),t[Kt]=n,n.stateNode=t}return ft(n),null;case 31:if(i=n.memoizedState,t===null||t.memoizedState!==null){if(s=Ja(n),i!==null){if(t===null){if(!s)throw Error(a(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(557));t[Kt]=n}else ra(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ft(n),t=!1}else i=Gf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),t=!0;if(!t)return n.flags&256?(Mn(n),n):(Mn(n),null);if((n.flags&128)!==0)throw Error(a(558))}return ft(n),null;case 13:if(s=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(d=Ja(n),s!==null&&s.dehydrated!==null){if(t===null){if(!d)throw Error(a(318));if(d=n.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(a(317));d[Kt]=n}else ra(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ft(n),d=!1}else d=Gf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=d),d=!0;if(!d)return n.flags&256?(Mn(n),n):(Mn(n),null)}return Mn(n),(n.flags&128)!==0?(n.lanes=i,n):(i=s!==null,t=t!==null&&t.memoizedState!==null,i&&(s=n.child,d=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(d=s.alternate.memoizedState.cachePool.pool),m=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(m=s.memoizedState.cachePool.pool),m!==d&&(s.flags|=2048)),i!==t&&i&&(n.child.flags|=8192),gc(n,n.updateQueue),ft(n),null);case 4:return be(),t===null&&nh(n.stateNode.containerInfo),ft(n),null;case 10:return Vo(n.type),ft(n),null;case 19:if(O(Tt),s=n.memoizedState,s===null)return ft(n),null;if(d=(n.flags&128)!==0,m=s.rendering,m===null)if(d)jl(s,!1);else{if(xt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(m=oc(t),m!==null){for(n.flags|=128,jl(s,!1),t=m.updateQueue,n.updateQueue=t,gc(n,t),n.subtreeFlags=0,t=i,i=n.child;i!==null;)hv(i,t),i=i.sibling;return q(Tt,Tt.current&1|2),Pe&&Uo(n,s.treeForkCount),n.child}t=t.sibling}s.tail!==null&&de()>Sc&&(n.flags|=128,d=!0,jl(s,!1),n.lanes=4194304)}else{if(!d)if(t=oc(m),t!==null){if(n.flags|=128,d=!0,t=t.updateQueue,n.updateQueue=t,gc(n,t),jl(s,!0),s.tail===null&&s.tailMode==="hidden"&&!m.alternate&&!Pe)return ft(n),null}else 2*de()-s.renderingStartTime>Sc&&i!==536870912&&(n.flags|=128,d=!0,jl(s,!1),n.lanes=4194304);s.isBackwards?(m.sibling=n.child,n.child=m):(t=s.last,t!==null?t.sibling=m:n.child=m,s.last=m)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=de(),t.sibling=null,i=Tt.current,q(Tt,d?i&1|2:i&1),Pe&&Uo(n,s.treeForkCount),t):(ft(n),null);case 22:case 23:return Mn(n),od(),s=n.memoizedState!==null,t!==null?t.memoizedState!==null!==s&&(n.flags|=8192):s&&(n.flags|=8192),s?(i&536870912)!==0&&(n.flags&128)===0&&(ft(n),n.subtreeFlags&6&&(n.flags|=8192)):ft(n),i=n.updateQueue,i!==null&&gc(n,i.retryQueue),i=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==i&&(n.flags|=2048),t!==null&&O(la),null;case 24:return i=null,t!==null&&(i=t.memoizedState.cache),n.memoizedState.cache!==i&&(n.flags|=2048),Vo(Ot),ft(n),null;case 25:return null;case 30:return null}throw Error(a(156,n.tag))}function VE(t,n){switch(Vf(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return Vo(Ot),be(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return Ge(n),null;case 31:if(n.memoizedState!==null){if(Mn(n),n.alternate===null)throw Error(a(340));ra()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(Mn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(a(340));ra()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return O(Tt),null;case 4:return be(),null;case 10:return Vo(n.type),null;case 22:case 23:return Mn(n),od(),t!==null&&O(la),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return Vo(Ot),null;case 25:return null;default:return null}}function Uy(t,n){switch(Vf(n),n.tag){case 3:Vo(Ot),be();break;case 26:case 27:case 5:Ge(n);break;case 4:be();break;case 31:n.memoizedState!==null&&Mn(n);break;case 13:Mn(n);break;case 19:O(Tt);break;case 10:Vo(n.type);break;case 22:case 23:Mn(n),od(),t!==null&&O(la);break;case 24:Vo(Ot)}}function Bl(t,n){try{var i=n.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var d=s.next;i=d;do{if((i.tag&t)===t){s=void 0;var m=i.create,w=i.inst;s=m(),w.destroy=s}i=i.next}while(i!==d)}}catch(_){et(n,n.return,_)}}function Er(t,n,i){try{var s=n.updateQueue,d=s!==null?s.lastEffect:null;if(d!==null){var m=d.next;s=m;do{if((s.tag&t)===t){var w=s.inst,_=w.destroy;if(_!==void 0){w.destroy=void 0,d=n;var U=i,K=_;try{K()}catch(ae){et(d,U,ae)}}}s=s.next}while(s!==m)}}catch(ae){et(n,n.return,ae)}}function Py(t){var n=t.updateQueue;if(n!==null){var i=t.stateNode;try{zv(n,i)}catch(s){et(t,t.return,s)}}}function Vy(t,n,i){i.props=da(t.type,t.memoizedProps),i.state=t.memoizedState;try{i.componentWillUnmount()}catch(s){et(t,n,s)}}function $l(t,n){try{var i=t.ref;if(i!==null){switch(t.tag){case 26:case 27:case 5:var s=t.stateNode;break;case 30:s=t.stateNode;break;default:s=t.stateNode}typeof i=="function"?t.refCleanup=i(s):i.current=s}}catch(d){et(t,n,d)}}function So(t,n){var i=t.ref,s=t.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(d){et(t,n,d)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(d){et(t,n,d)}else i.current=null}function Yy(t){var n=t.type,i=t.memoizedProps,s=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":i.autoFocus&&s.focus();break e;case"img":i.src?s.src=i.src:i.srcSet&&(s.srcset=i.srcSet)}}catch(d){et(t,t.return,d)}}function Bd(t,n,i){try{var s=t.stateNode;u2(s,t.type,i,n),s[gn]=n}catch(d){et(t,t.return,d)}}function Gy(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&zr(t.type)||t.tag===4}function $d(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Gy(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&zr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Ld(t,n,i){var s=t.tag;if(s===5||s===6)t=t.stateNode,n?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(t,n):(n=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,n.appendChild(t),i=i._reactRootContainer,i!=null||n.onclick!==null||(n.onclick=Lo));else if(s!==4&&(s===27&&zr(t.type)&&(i=t.stateNode,n=null),t=t.child,t!==null))for(Ld(t,n,i),t=t.sibling;t!==null;)Ld(t,n,i),t=t.sibling}function vc(t,n,i){var s=t.tag;if(s===5||s===6)t=t.stateNode,n?i.insertBefore(t,n):i.appendChild(t);else if(s!==4&&(s===27&&zr(t.type)&&(i=t.stateNode),t=t.child,t!==null))for(vc(t,n,i),t=t.sibling;t!==null;)vc(t,n,i),t=t.sibling}function Xy(t){var n=t.stateNode,i=t.memoizedProps;try{for(var s=t.type,d=n.attributes;d.length;)n.removeAttributeNode(d[0]);tn(n,s,i),n[Kt]=t,n[gn]=i}catch(m){et(t,t.return,m)}}var Io=!1,$t=!1,kd=!1,qy=typeof WeakSet=="function"?WeakSet:Set,It=null;function YE(t,n){if(t=t.containerInfo,ah=kc,t=rv(t),zf(t)){if("selectionStart"in t)var i={start:t.selectionStart,end:t.selectionEnd};else e:{i=(i=t.ownerDocument)&&i.defaultView||window;var s=i.getSelection&&i.getSelection();if(s&&s.rangeCount!==0){i=s.anchorNode;var d=s.anchorOffset,m=s.focusNode;s=s.focusOffset;try{i.nodeType,m.nodeType}catch{i=null;break e}var w=0,_=-1,U=-1,K=0,ae=0,se=t,J=null;t:for(;;){for(var te;se!==i||d!==0&&se.nodeType!==3||(_=w+d),se!==m||s!==0&&se.nodeType!==3||(U=w+s),se.nodeType===3&&(w+=se.nodeValue.length),(te=se.firstChild)!==null;)J=se,se=te;for(;;){if(se===t)break t;if(J===i&&++K===d&&(_=w),J===m&&++ae===s&&(U=w),(te=se.nextSibling)!==null)break;se=J,J=se.parentNode}se=te}i=_===-1||U===-1?null:{start:_,end:U}}else i=null}i=i||{start:0,end:0}}else i=null;for(ih={focusedElem:t,selectionRange:i},kc=!1,It=n;It!==null;)if(n=It,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,It=t;else for(;It!==null;){switch(n=It,m=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(i=0;i title"))),tn(m,s,i),m[Kt]=t,qt(m),s=m;break e;case"link":var w=Wb("link","href",d).get(s+(i.href||""));if(w){for(var _=0;_at&&(w=at,at=Te,Te=w);var F=nv(_,Te),G=nv(_,at);if(F&&G&&(te.rangeCount!==1||te.anchorNode!==F.node||te.anchorOffset!==F.offset||te.focusNode!==G.node||te.focusOffset!==G.offset)){var Q=se.createRange();Q.setStart(F.node,F.offset),te.removeAllRanges(),Te>at?(te.addRange(Q),te.extend(G.node,G.offset)):(Q.setEnd(G.node,G.offset),te.addRange(Q))}}}}for(se=[],te=_;te=te.parentNode;)te.nodeType===1&&se.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_i?32:i,j.T=null,i=Xd,Xd=null;var m=Dr,w=Wo;if(Ut=0,hi=Dr=null,Wo=0,(Fe&6)!==0)throw Error(a(331));var _=Fe;if(Fe|=4,ob(m.current),eb(m,m.current,w,i),Fe=_,Vl(0,!1),Gt&&typeof Gt.onPostCommitFiberRoot=="function")try{Gt.onPostCommitFiberRoot(Oo,m)}catch{}return!0}finally{k.p=d,j.T=s,Sb(t,n)}}function Cb(t,n,i){n=Yn(i,n),n=Ed(t.stateNode,n,2),t=Sr(t,n,2),t!==null&&(Ln(t,2),wo(t))}function et(t,n,i){if(t.tag===3)Cb(t,t,i);else for(;n!==null;){if(n.tag===3){Cb(n,t,i);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(_r===null||!_r.has(s))){t=Yn(i,t),i=Ey(2),s=Sr(n,i,2),s!==null&&(Ry(i,s,n,t),Ln(s,2),wo(s));break}}n=n.return}}function Zd(t,n,i){var s=t.pingCache;if(s===null){s=t.pingCache=new qE;var d=new Set;s.set(n,d)}else d=s.get(n),d===void 0&&(d=new Set,s.set(n,d));d.has(i)||(Pd=!0,d.add(i),t=KE.bind(null,t,n,i),n.then(t,t))}function KE(t,n,i){var s=t.pingCache;s!==null&&s.delete(n),t.pingedLanes|=t.suspendedLanes&i,t.warmLanes&=~i,ct===t&&(He&i)===i&&(xt===4||xt===3&&(He&62914560)===He&&300>de()-xc?(Fe&2)===0&&pi(t,0):Vd|=i,di===He&&(di=0)),wo(t)}function Eb(t,n){n===0&&(n=rn()),t=na(t,n),t!==null&&(Ln(t,n),wo(t))}function WE(t){var n=t.memoizedState,i=0;n!==null&&(i=n.retryLane),Eb(t,i)}function JE(t,n){var i=0;switch(t.tag){case 31:case 13:var s=t.stateNode,d=t.memoizedState;d!==null&&(i=d.retryLane);break;case 19:s=t.stateNode;break;case 22:s=t.stateNode._retryCache;break;default:throw Error(a(314))}s!==null&&s.delete(n),Eb(t,i)}function e2(t,n){return De(t,n)}var _c=null,gi=null,Qd=!1,Dc=!1,Kd=!1,Ar=0;function wo(t){t!==gi&&t.next===null&&(gi===null?_c=gi=t:gi=gi.next=t),Dc=!0,Qd||(Qd=!0,n2())}function Vl(t,n){if(!Kd&&Dc){Kd=!0;do for(var i=!1,s=_c;s!==null;){if(t!==0){var d=s.pendingLanes;if(d===0)var m=0;else{var w=s.suspendedLanes,_=s.pingedLanes;m=(1<<31-Ct(42|t)+1)-1,m&=d&~(w&~_),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(i=!0,Db(s,m))}else m=He,m=Xt(s,s===ct?m:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(m&3)===0||hn(s,m)||(i=!0,Db(s,m));s=s.next}while(i);Kd=!1}}function t2(){Rb()}function Rb(){Dc=Qd=!1;var t=0;Ar!==0&&d2()&&(t=Ar);for(var n=de(),i=null,s=_c;s!==null;){var d=s.next,m=Tb(s,n);m===0?(s.next=null,i===null?_c=d:i.next=d,d===null&&(gi=i)):(i=s,(t!==0||(m&3)!==0)&&(Dc=!0)),s=d}Ut!==0&&Ut!==5||Vl(t),Ar!==0&&(Ar=0)}function Tb(t,n){for(var i=t.suspendedLanes,s=t.pingedLanes,d=t.expirationTimes,m=t.pendingLanes&-62914561;0_)break;var ae=U.transferSize,se=U.initiatorType;ae&&$b(se)&&(U=U.responseEnd,w+=ae*(U<_?1:(_-K)/(U-K)))}if(--s,n+=8*(m+w)/(d.duration/1e3),t++,10"u"?null:document;function Fb(t,n,i){var s=vi;if(s&&typeof n=="string"&&n){var d=Pn(n);d='link[rel="'+t+'"][href="'+d+'"]',typeof i=="string"&&(d+='[crossorigin="'+i+'"]'),Ib.has(d)||(Ib.add(d),t={rel:t,crossOrigin:i,href:n},s.querySelector(d)===null&&(n=s.createElement("link"),tn(n,"link",t),qt(n),s.head.appendChild(n)))}}function S2(t){Jo.D(t),Fb("dns-prefetch",t,null)}function w2(t,n){Jo.C(t,n),Fb("preconnect",t,n)}function C2(t,n,i){Jo.L(t,n,i);var s=vi;if(s&&t&&n){var d='link[rel="preload"][as="'+Pn(n)+'"]';n==="image"&&i&&i.imageSrcSet?(d+='[imagesrcset="'+Pn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(d+='[imagesizes="'+Pn(i.imageSizes)+'"]')):d+='[href="'+Pn(t)+'"]';var m=d;switch(n){case"style":m=yi(t);break;case"script":m=bi(t)}Zn.has(m)||(t=v({rel:"preload",href:n==="image"&&i&&i.imageSrcSet?void 0:t,as:n},i),Zn.set(m,t),s.querySelector(d)!==null||n==="style"&&s.querySelector(ql(m))||n==="script"&&s.querySelector(Il(m))||(n=s.createElement("link"),tn(n,"link",t),qt(n),s.head.appendChild(n)))}}function E2(t,n){Jo.m(t,n);var i=vi;if(i&&t){var s=n&&typeof n.as=="string"?n.as:"script",d='link[rel="modulepreload"][as="'+Pn(s)+'"][href="'+Pn(t)+'"]',m=d;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=bi(t)}if(!Zn.has(m)&&(t=v({rel:"modulepreload",href:t},n),Zn.set(m,t),i.querySelector(d)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Il(m)))return}s=i.createElement("link"),tn(s,"link",t),qt(s),i.head.appendChild(s)}}}function R2(t,n,i){Jo.S(t,n,i);var s=vi;if(s&&t){var d=Ua(s).hoistableStyles,m=yi(t);n=n||"default";var w=d.get(m);if(!w){var _={loading:0,preload:null};if(w=s.querySelector(ql(m)))_.loading=5;else{t=v({rel:"stylesheet",href:t,"data-precedence":n},i),(i=Zn.get(m))&&hh(t,i);var U=w=s.createElement("link");qt(U),tn(U,"link",t),U._p=new Promise(function(K,ae){U.onload=K,U.onerror=ae}),U.addEventListener("load",function(){_.loading|=1}),U.addEventListener("error",function(){_.loading|=2}),_.loading|=4,Oc(w,n,s)}w={type:"stylesheet",instance:w,count:1,state:_},d.set(m,w)}}}function T2(t,n){Jo.X(t,n);var i=vi;if(i&&t){var s=Ua(i).hoistableScripts,d=bi(t),m=s.get(d);m||(m=i.querySelector(Il(d)),m||(t=v({src:t,async:!0},n),(n=Zn.get(d))&&ph(t,n),m=i.createElement("script"),qt(m),tn(m,"link",t),i.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},s.set(d,m))}}function _2(t,n){Jo.M(t,n);var i=vi;if(i&&t){var s=Ua(i).hoistableScripts,d=bi(t),m=s.get(d);m||(m=i.querySelector(Il(d)),m||(t=v({src:t,async:!0,type:"module"},n),(n=Zn.get(d))&&ph(t,n),m=i.createElement("script"),qt(m),tn(m,"link",t),i.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},s.set(d,m))}}function Zb(t,n,i,s){var d=(d=ue.current)?Mc(d):null;if(!d)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(n=yi(i.href),i=Ua(d).hoistableStyles,s=i.get(n),s||(s={type:"style",instance:null,count:0,state:null},i.set(n,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){t=yi(i.href);var m=Ua(d).hoistableStyles,w=m.get(t);if(w||(d=d.ownerDocument||d,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(t,w),(m=d.querySelector(ql(t)))&&!m._p&&(w.instance=m,w.state.loading=5),Zn.has(t)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Zn.set(t,i),m||D2(d,t,i,w.state))),n&&s===null)throw Error(a(528,""));return w}if(n&&s!==null)throw Error(a(529,""));return null;case"script":return n=i.async,i=i.src,typeof i=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=bi(i),i=Ua(d).hoistableScripts,s=i.get(n),s||(s={type:"script",instance:null,count:0,state:null},i.set(n,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,t))}}function yi(t){return'href="'+Pn(t)+'"'}function ql(t){return'link[rel="stylesheet"]['+t+"]"}function Qb(t){return v({},t,{"data-precedence":t.precedence,precedence:null})}function D2(t,n,i,s){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?s.loading=1:(n=t.createElement("link"),s.preload=n,n.addEventListener("load",function(){return s.loading|=1}),n.addEventListener("error",function(){return s.loading|=2}),tn(n,"link",i),qt(n),t.head.appendChild(n))}function bi(t){return'[src="'+Pn(t)+'"]'}function Il(t){return"script[async]"+t}function Kb(t,n,i){if(n.count++,n.instance===null)switch(n.type){case"style":var s=t.querySelector('style[data-href~="'+Pn(i.href)+'"]');if(s)return n.instance=s,qt(s),s;var d=v({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(t.ownerDocument||t).createElement("style"),qt(s),tn(s,"style",d),Oc(s,i.precedence,t),n.instance=s;case"stylesheet":d=yi(i.href);var m=t.querySelector(ql(d));if(m)return n.state.loading|=4,n.instance=m,qt(m),m;s=Qb(i),(d=Zn.get(d))&&hh(s,d),m=(t.ownerDocument||t).createElement("link"),qt(m);var w=m;return w._p=new Promise(function(_,U){w.onload=_,w.onerror=U}),tn(m,"link",s),n.state.loading|=4,Oc(m,i.precedence,t),n.instance=m;case"script":return m=bi(i.src),(d=t.querySelector(Il(m)))?(n.instance=d,qt(d),d):(s=i,(d=Zn.get(m))&&(s=v({},i),ph(s,d)),t=t.ownerDocument||t,d=t.createElement("script"),qt(d),tn(d,"link",s),t.head.appendChild(d),n.instance=d);case"void":return null;default:throw Error(a(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(s=n.instance,n.state.loading|=4,Oc(s,i.precedence,t));return n.instance}function Oc(t,n,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=s.length?s[s.length-1]:null,m=d,w=0;w title"):null)}function N2(t,n,i){if(i===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(t=n.disabled,typeof n.precedence=="string"&&t==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function e0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function A2(t,n,i,s){if(i.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var d=yi(s.href),m=n.querySelector(ql(d));if(m){n=m._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=Bc.bind(t),n.then(t,t)),i.state.loading|=4,i.instance=m,qt(m);return}m=n.ownerDocument||n,s=Qb(s),(d=Zn.get(d))&&hh(s,d),m=m.createElement("link"),qt(m);var w=m;w._p=new Promise(function(_,U){w.onload=_,w.onerror=U}),tn(m,"link",s),i.instance=m}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(i,n),(n=i.state.preload)&&(i.state.loading&3)===0&&(t.count++,i=Bc.bind(t),n.addEventListener("load",i),n.addEventListener("error",i))}}var mh=0;function z2(t,n){return t.stylesheets&&t.count===0&&Lc(t,t.stylesheets),0mh?50:800)+n);return t.unsuspend=i,function(){t.unsuspend=null,clearTimeout(s),clearTimeout(d)}}:null}function Bc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Lc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var $c=null;function Lc(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,$c=new Map,n.forEach(M2,t),$c=null,Bc.call(t))}function M2(t,n){if(!(n.state.loading&4)){var i=$c.get(t);if(i)var s=i.get(null);else{i=new Map,$c.set(t,i);for(var d=t.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(o){console.error(o)}}return e(),Eh.exports=Z2(),Eh.exports}var K2=Q2(),To=function(){return To=Object.assign||function(o){for(var r,a=1,l=arguments.length;a"u")return pR;var o=mR(e),r=document.documentElement.clientWidth,a=window.innerWidth;return{left:o[0],top:o[1],right:o[2],gap:Math.max(0,a-r+o[2]-o[0])}},vR=ux(),Mi="data-scroll-locked",yR=function(e,o,r,a){var l=e.left,c=e.top,u=e.right,f=e.gap;return r===void 0&&(r="margin"),` +`+s.stack}}var we=Object.prototype.hasOwnProperty,De=e.unstable_scheduleCallback,Ae=e.unstable_cancelCallback,xe=e.unstable_shouldYield,$e=e.unstable_requestPaint,de=e.unstable_now,Re=e.unstable_getCurrentPriorityLevel,dt=e.unstable_ImmediatePriority,ot=e.unstable_UserBlockingPriority,yt=e.unstable_NormalPriority,Je=e.unstable_LowPriority,wt=e.unstable_IdlePriority,on=e.log,Qr=e.unstable_setDisableYieldValue,jo=null,Gt=null;function st(t){if(typeof on=="function"&&Qr(t),Gt&&typeof Gt.setStrictMode=="function")try{Gt.setStrictMode(jo,t)}catch{}}var Ct=Math.clz32?Math.clz32:df,Kr=Math.log,Ms=Math.LN2;function df(t){return t>>>=0,t===0?32:31-(Kr(t)/Ms|0)|0}var Ba=256,$a=262144,Et=4194304;function Rt(t){var n=t&42;if(n!==0)return n;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Xt(t,n,i){var s=t.pendingLanes;if(s===0)return 0;var d=0,m=t.suspendedLanes,w=t.pingedLanes;t=t.warmLanes;var _=s&134217727;return _!==0?(s=_&~m,s!==0?d=Rt(s):(w&=_,w!==0?d=Rt(w):i||(i=_&~t,i!==0&&(d=Rt(i))))):(_=s&~m,_!==0?d=Rt(_):w!==0?d=Rt(w):i||(i=s&~t,i!==0&&(d=Rt(i)))),d===0?0:n!==0&&n!==d&&(n&m)===0&&(m=d&-d,i=n&-n,m>=i||m===32&&(i&4194048)!==0)?n:d}function hn(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function pn(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function rn(){var t=Et;return Et<<=1,(Et&62914560)===0&&(Et=4194304),t}function mn(t){for(var n=[],i=0;31>i;i++)n.push(t);return n}function Ln(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Ht(t,n,i,s,d,m){var w=t.pendingLanes;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=i,t.entangledLanes&=i,t.errorRecoveryDisabledLanes&=i,t.shellSuspendCounter=0;var _=t.entanglements,U=t.expirationTimes,K=t.hiddenUpdates;for(i=w&~i;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var BC=/[\n"\\]/g;function Pn(t){return t.replace(BC,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function gf(t,n,i,s,d,m,w,_){t.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?t.type=w:t.removeAttribute("type"),n!=null?w==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Un(n)):t.value!==""+Un(n)&&(t.value=""+Un(n)):w!=="submit"&&w!=="reset"||t.removeAttribute("value"),n!=null?vf(t,w,Un(n)):i!=null?vf(t,w,Un(i)):s!=null&&t.removeAttribute("value"),d==null&&m!=null&&(t.defaultChecked=!!m),d!=null&&(t.checked=d&&typeof d!="function"&&typeof d!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?t.name=""+Un(_):t.removeAttribute("name")}function Mg(t,n,i,s,d,m,w,_){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(t.type=m),n!=null||i!=null){if(!(m!=="submit"&&m!=="reset"||n!=null)){mf(t);return}i=i!=null?""+Un(i):"",n=n!=null?""+Un(n):i,_||n===t.value||(t.value=n),t.defaultValue=n}s=s??d,s=typeof s!="function"&&typeof s!="symbol"&&!!s,t.checked=_?t.checked:!!s,t.defaultChecked=!!s,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(t.name=w),mf(t)}function vf(t,n,i){n==="number"&&Bs(t.ownerDocument)===t||t.defaultValue===""+i||(t.defaultValue=""+i)}function Va(t,n,i,s){if(t=t.options,n){n={};for(var d=0;d"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wf=!1;if(Ho)try{var fl={};Object.defineProperty(fl,"passive",{get:function(){wf=!0}}),window.addEventListener("test",fl,fl),window.removeEventListener("test",fl,fl)}catch{wf=!1}var pr=null,Cf=null,Ls=null;function Hg(){if(Ls)return Ls;var t,n=Cf,i=n.length,s,d="value"in pr?pr.value:pr.textContent,m=d.length;for(t=0;t=pl),Xg=" ",qg=!1;function Ig(t,n){switch(t){case"keyup":return cE.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fg(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var qa=!1;function fE(t,n){switch(t){case"compositionend":return Fg(n);case"keypress":return n.which!==32?null:(qg=!0,Xg);case"textInput":return t=n.data,t===Xg&&qg?null:t;default:return null}}function dE(t,n){if(qa)return t==="compositionend"||!Df&&Ig(t,n)?(t=Hg(),Ls=Cf=pr=null,qa=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:i,offset:n-t};t=s}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=nv(i)}}function rv(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?rv(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function av(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=Bs(t.document);n instanceof t.HTMLIFrameElement;){try{var i=typeof n.contentWindow.location.href=="string"}catch{i=!1}if(i)t=n.contentWindow;else break;n=Bs(t.document)}return n}function zf(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var xE=Ho&&"documentMode"in document&&11>=document.documentMode,Ia=null,Mf=null,yl=null,Of=!1;function iv(t,n,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Of||Ia==null||Ia!==Bs(s)||(s=Ia,"selectionStart"in s&&zf(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),yl&&vl(yl,s)||(yl=s,s=Ac(Mf,"onSelect"),0>=w,d-=w,bo=1<<32-Ct(n)+d|i<Oe?(Ue=Ce,Ce=null):Ue=Ce.sibling;var Fe=J(F,Ce,Q[Oe],le);if(Fe===null){Ce===null&&(Ce=Ue);break}t&&Ce&&Fe.alternate===null&&n(F,Ce),G=m(Fe,G,Oe),Ie===null?Ee=Fe:Ie.sibling=Fe,Ie=Fe,Ce=Ue}if(Oe===Q.length)return i(F,Ce),Ve&&Po(F,Oe),Ee;if(Ce===null){for(;OeOe?(Ue=Ce,Ce=null):Ue=Ce.sibling;var $r=J(F,Ce,Fe.value,le);if($r===null){Ce===null&&(Ce=Ue);break}t&&Ce&&$r.alternate===null&&n(F,Ce),G=m($r,G,Oe),Ie===null?Ee=$r:Ie.sibling=$r,Ie=$r,Ce=Ue}if(Fe.done)return i(F,Ce),Ve&&Po(F,Oe),Ee;if(Ce===null){for(;!Fe.done;Oe++,Fe=Q.next())Fe=se(F,Fe.value,le),Fe!==null&&(G=m(Fe,G,Oe),Ie===null?Ee=Fe:Ie.sibling=Fe,Ie=Fe);return Ve&&Po(F,Oe),Ee}for(Ce=s(Ce);!Fe.done;Oe++,Fe=Q.next())Fe=te(Ce,F,Oe,Fe.value,le),Fe!==null&&(t&&Fe.alternate!==null&&Ce.delete(Fe.key===null?Oe:Fe.key),G=m(Fe,G,Oe),Ie===null?Ee=Fe:Ie.sibling=Fe,Ie=Fe);return t&&Ce.forEach(function(U2){return n(F,U2)}),Ve&&Po(F,Oe),Ee}function it(F,G,Q,le){if(typeof Q=="object"&&Q!==null&&Q.type===C&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case S:e:{for(var Ee=Q.key;G!==null;){if(G.key===Ee){if(Ee=Q.type,Ee===C){if(G.tag===7){i(F,G.sibling),le=d(G,Q.props.children),le.return=F,F=le;break e}}else if(G.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===L&&sa(Ee)===G.type){i(F,G.sibling),le=d(G,Q.props),El(le,Q),le.return=F,F=le;break e}i(F,G);break}else n(F,G);G=G.sibling}Q.type===C?(le=oa(Q.props.children,F.mode,le,Q.key),le.return=F,F=le):(le=Is(Q.type,Q.key,Q.props,null,F.mode,le),El(le,Q),le.return=F,F=le)}return w(F);case E:e:{for(Ee=Q.key;G!==null;){if(G.key===Ee)if(G.tag===4&&G.stateNode.containerInfo===Q.containerInfo&&G.stateNode.implementation===Q.implementation){i(F,G.sibling),le=d(G,Q.children||[]),le.return=F,F=le;break e}else{i(F,G);break}else n(F,G);G=G.sibling}le=Uf(Q,F.mode,le),le.return=F,F=le}return w(F);case L:return Q=sa(Q),it(F,G,Q,le)}if(re(Q))return Se(F,G,Q,le);if(X(Q)){if(Ee=X(Q),typeof Ee!="function")throw Error(a(150));return Q=Ee.call(Q),Te(F,G,Q,le)}if(typeof Q.then=="function")return it(F,G,ec(Q),le);if(Q.$$typeof===A)return it(F,G,Qs(F,Q),le);tc(F,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,G!==null&&G.tag===6?(i(F,G.sibling),le=d(G,Q),le.return=F,F=le):(i(F,G),le=Hf(Q,F.mode,le),le.return=F,F=le),w(F)):i(F,G)}return function(F,G,Q,le){try{Cl=0;var Ee=it(F,G,Q,le);return ri=null,Ee}catch(Ce){if(Ce===oi||Ce===Ws)throw Ce;var Ie=An(29,Ce,null,F.mode);return Ie.lanes=le,Ie.return=F,Ie}}}var ua=Nv(!0),Av=Nv(!1),br=!1;function Wf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jf(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function xr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Sr(t,n,i){var s=t.updateQueue;if(s===null)return null;if(s=s.shared,(Ze&2)!==0){var d=s.pending;return d===null?n.next=n:(n.next=d.next,d.next=n),s.pending=n,n=qs(t),hv(t,null,i),n}return Xs(t,s,n,i),qs(t)}function Rl(t,n,i){if(n=n.updateQueue,n!==null&&(n=n.shared,(i&4194048)!==0)){var s=n.lanes;s&=t.pendingLanes,i|=s,n.lanes=i,Dn(t,i)}}function ed(t,n){var i=t.updateQueue,s=t.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var d=null,m=null;if(i=i.firstBaseUpdate,i!==null){do{var w={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};m===null?d=m=w:m=m.next=w,i=i.next}while(i!==null);m===null?d=m=n:m=m.next=n}else d=m=n;i={baseState:s.baseState,firstBaseUpdate:d,lastBaseUpdate:m,shared:s.shared,callbacks:s.callbacks},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=n:t.next=n,i.lastBaseUpdate=n}var td=!1;function Tl(){if(td){var t=ni;if(t!==null)throw t}}function _l(t,n,i,s){td=!1;var d=t.updateQueue;br=!1;var m=d.firstBaseUpdate,w=d.lastBaseUpdate,_=d.shared.pending;if(_!==null){d.shared.pending=null;var U=_,K=U.next;U.next=null,w===null?m=K:w.next=K,w=U;var ae=t.alternate;ae!==null&&(ae=ae.updateQueue,_=ae.lastBaseUpdate,_!==w&&(_===null?ae.firstBaseUpdate=K:_.next=K,ae.lastBaseUpdate=U))}if(m!==null){var se=d.baseState;w=0,ae=K=U=null,_=m;do{var J=_.lane&-536870913,te=J!==_.lane;if(te?(He&J)===J:(s&J)===J){J!==0&&J===ti&&(td=!0),ae!==null&&(ae=ae.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var Se=t,Te=_;J=n;var it=i;switch(Te.tag){case 1:if(Se=Te.payload,typeof Se=="function"){se=Se.call(it,se,J);break e}se=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Te.payload,J=typeof Se=="function"?Se.call(it,se,J):Se,J==null)break e;se=v({},se,J);break e;case 2:br=!0}}J=_.callback,J!==null&&(t.flags|=64,te&&(t.flags|=8192),te=d.callbacks,te===null?d.callbacks=[J]:te.push(J))}else te={lane:J,tag:_.tag,payload:_.payload,callback:_.callback,next:null},ae===null?(K=ae=te,U=se):ae=ae.next=te,w|=J;if(_=_.next,_===null){if(_=d.shared.pending,_===null)break;te=_,_=te.next,te.next=null,d.lastBaseUpdate=te,d.shared.pending=null}}while(!0);ae===null&&(U=se),d.baseState=U,d.firstBaseUpdate=K,d.lastBaseUpdate=ae,m===null&&(d.shared.lanes=0),Tr|=w,t.lanes=w,t.memoizedState=se}}function zv(t,n){if(typeof t!="function")throw Error(a(191,t));t.call(n)}function Mv(t,n){var i=t.callbacks;if(i!==null)for(t.callbacks=null,t=0;tm?m:8;var w=j.T,_={};j.T=_,xd(t,!1,n,i);try{var U=d(),K=j.S;if(K!==null&&K(_,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var ae=NE(U,s);Al(t,n,ae,Bn(t))}else Al(t,n,s,Bn(t))}catch(se){Al(t,n,{then:function(){},status:"rejected",reason:se},Bn())}finally{k.p=m,w!==null&&_.types!==null&&(w.types=_.types),j.T=w}}function BE(){}function yd(t,n,i,s){if(t.tag!==5)throw Error(a(476));var d=uy(t).queue;cy(t,d,n,V,i===null?BE:function(){return fy(t),i(s)})}function uy(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xo,lastRenderedState:V},next:null};var i={};return n.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xo,lastRenderedState:i},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function fy(t){var n=uy(t);n.next===null&&(n=t.alternate.memoizedState),Al(t,n.next.queue,{},Bn())}function bd(){return Jt(Il)}function dy(){return _t().memoizedState}function hy(){return _t().memoizedState}function $E(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var i=Bn();t=xr(i);var s=Sr(n,t,i);s!==null&&(wn(s,n,i),Rl(s,n,i)),n={cache:Ff()},t.payload=n;return}n=n.return}}function LE(t,n,i){var s=Bn();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},fc(t)?my(n,i):(i=Lf(t,n,i,s),i!==null&&(wn(i,t,s),gy(i,n,s)))}function py(t,n,i){var s=Bn();Al(t,n,i,s)}function Al(t,n,i,s){var d={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(fc(t))my(n,d);else{var m=t.alternate;if(t.lanes===0&&(m===null||m.lanes===0)&&(m=n.lastRenderedReducer,m!==null))try{var w=n.lastRenderedState,_=m(w,i);if(d.hasEagerState=!0,d.eagerState=_,Nn(_,w))return Xs(t,n,d,0),ct===null&&Gs(),!1}catch{}if(i=Lf(t,n,d,s),i!==null)return wn(i,t,s),gy(i,n,s),!0}return!1}function xd(t,n,i,s){if(s={lane:2,revertLane:Wd(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},fc(t)){if(n)throw Error(a(479))}else n=Lf(t,i,s,2),n!==null&&wn(n,t,2)}function fc(t){var n=t.alternate;return t===Me||n!==null&&n===Me}function my(t,n){ii=rc=!0;var i=t.pending;i===null?n.next=n:(n.next=i.next,i.next=n),t.pending=n}function gy(t,n,i){if((i&4194048)!==0){var s=n.lanes;s&=t.pendingLanes,i|=s,n.lanes=i,Dn(t,i)}}var zl={readContext:Jt,use:lc,useCallback:bt,useContext:bt,useEffect:bt,useImperativeHandle:bt,useLayoutEffect:bt,useInsertionEffect:bt,useMemo:bt,useReducer:bt,useRef:bt,useState:bt,useDebugValue:bt,useDeferredValue:bt,useTransition:bt,useSyncExternalStore:bt,useId:bt,useHostTransitionStatus:bt,useFormState:bt,useActionState:bt,useOptimistic:bt,useMemoCache:bt,useCacheRefresh:bt};zl.useEffectEvent=bt;var vy={readContext:Jt,use:lc,useCallback:function(t,n){return fn().memoizedState=[t,n===void 0?null:n],t},useContext:Jt,useEffect:ey,useImperativeHandle:function(t,n,i){i=i!=null?i.concat([t]):null,cc(4194308,4,ry.bind(null,n,t),i)},useLayoutEffect:function(t,n){return cc(4194308,4,t,n)},useInsertionEffect:function(t,n){cc(4,2,t,n)},useMemo:function(t,n){var i=fn();n=n===void 0?null:n;var s=t();if(fa){st(!0);try{t()}finally{st(!1)}}return i.memoizedState=[s,n],s},useReducer:function(t,n,i){var s=fn();if(i!==void 0){var d=i(n);if(fa){st(!0);try{i(n)}finally{st(!1)}}}else d=n;return s.memoizedState=s.baseState=d,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:d},s.queue=t,t=t.dispatch=LE.bind(null,Me,t),[s.memoizedState,t]},useRef:function(t){var n=fn();return t={current:t},n.memoizedState=t},useState:function(t){t=hd(t);var n=t.queue,i=py.bind(null,Me,n);return n.dispatch=i,[t.memoizedState,i]},useDebugValue:gd,useDeferredValue:function(t,n){var i=fn();return vd(i,t,n)},useTransition:function(){var t=hd(!1);return t=cy.bind(null,Me,t.queue,!0,!1),fn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,i){var s=Me,d=fn();if(Ve){if(i===void 0)throw Error(a(407));i=i()}else{if(i=n(),ct===null)throw Error(a(349));(He&127)!==0||kv(s,n,i)}d.memoizedState=i;var m={value:i,getSnapshot:n};return d.queue=m,ey(Uv.bind(null,s,m,t),[t]),s.flags|=2048,si(9,{destroy:void 0},Hv.bind(null,s,m,i,n),null),i},useId:function(){var t=fn(),n=ct.identifierPrefix;if(Ve){var i=xo,s=bo;i=(s&~(1<<32-Ct(s)-1)).toString(32)+i,n="_"+n+"R_"+i,i=ac++,0<\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof s.is=="string"?w.createElement("select",{is:s.is}):w.createElement("select"),s.multiple?m.multiple=!0:s.size&&(m.size=s.size);break;default:m=typeof s.is=="string"?w.createElement(d,{is:s.is}):w.createElement(d)}}m[Kt]=n,m[gn]=s;e:for(w=n.child;w!==null;){if(w.tag===5||w.tag===6)m.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===n)break e;for(;w.sibling===null;){if(w.return===null||w.return===n)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}n.stateNode=m;e:switch(tn(m,d,s),d){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Io(n)}}return ft(n),jd(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,i),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==s&&Io(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(a(166));if(t=ue.current,Ja(n)){if(t=n.stateNode,i=n.memoizedProps,s=null,d=Wt,d!==null)switch(d.tag){case 27:case 5:s=d.memoizedProps}t[Kt]=n,t=!!(t.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||$b(t.nodeValue,i)),t||vr(n,!0)}else t=zc(t).createTextNode(s),t[Kt]=n,n.stateNode=t}return ft(n),null;case 31:if(i=n.memoizedState,t===null||t.memoizedState!==null){if(s=Ja(n),i!==null){if(t===null){if(!s)throw Error(a(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(557));t[Kt]=n}else ra(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ft(n),t=!1}else i=Gf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),t=!0;if(!t)return n.flags&256?(Mn(n),n):(Mn(n),null);if((n.flags&128)!==0)throw Error(a(558))}return ft(n),null;case 13:if(s=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(d=Ja(n),s!==null&&s.dehydrated!==null){if(t===null){if(!d)throw Error(a(318));if(d=n.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(a(317));d[Kt]=n}else ra(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ft(n),d=!1}else d=Gf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=d),d=!0;if(!d)return n.flags&256?(Mn(n),n):(Mn(n),null)}return Mn(n),(n.flags&128)!==0?(n.lanes=i,n):(i=s!==null,t=t!==null&&t.memoizedState!==null,i&&(s=n.child,d=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(d=s.alternate.memoizedState.cachePool.pool),m=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(m=s.memoizedState.cachePool.pool),m!==d&&(s.flags|=2048)),i!==t&&i&&(n.child.flags|=8192),gc(n,n.updateQueue),ft(n),null);case 4:return be(),t===null&&nh(n.stateNode.containerInfo),ft(n),null;case 10:return Yo(n.type),ft(n),null;case 19:if(O(Tt),s=n.memoizedState,s===null)return ft(n),null;if(d=(n.flags&128)!==0,m=s.rendering,m===null)if(d)Ol(s,!1);else{if(xt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(m=oc(t),m!==null){for(n.flags|=128,Ol(s,!1),t=m.updateQueue,n.updateQueue=t,gc(n,t),n.subtreeFlags=0,t=i,i=n.child;i!==null;)pv(i,t),i=i.sibling;return q(Tt,Tt.current&1|2),Ve&&Po(n,s.treeForkCount),n.child}t=t.sibling}s.tail!==null&&de()>Sc&&(n.flags|=128,d=!0,Ol(s,!1),n.lanes=4194304)}else{if(!d)if(t=oc(m),t!==null){if(n.flags|=128,d=!0,t=t.updateQueue,n.updateQueue=t,gc(n,t),Ol(s,!0),s.tail===null&&s.tailMode==="hidden"&&!m.alternate&&!Ve)return ft(n),null}else 2*de()-s.renderingStartTime>Sc&&i!==536870912&&(n.flags|=128,d=!0,Ol(s,!1),n.lanes=4194304);s.isBackwards?(m.sibling=n.child,n.child=m):(t=s.last,t!==null?t.sibling=m:n.child=m,s.last=m)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=de(),t.sibling=null,i=Tt.current,q(Tt,d?i&1|2:i&1),Ve&&Po(n,s.treeForkCount),t):(ft(n),null);case 22:case 23:return Mn(n),od(),s=n.memoizedState!==null,t!==null?t.memoizedState!==null!==s&&(n.flags|=8192):s&&(n.flags|=8192),s?(i&536870912)!==0&&(n.flags&128)===0&&(ft(n),n.subtreeFlags&6&&(n.flags|=8192)):ft(n),i=n.updateQueue,i!==null&&gc(n,i.retryQueue),i=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==i&&(n.flags|=2048),t!==null&&O(la),null;case 24:return i=null,t!==null&&(i=t.memoizedState.cache),n.memoizedState.cache!==i&&(n.flags|=2048),Yo(Ot),ft(n),null;case 25:return null;case 30:return null}throw Error(a(156,n.tag))}function VE(t,n){switch(Vf(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return Yo(Ot),be(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return Xe(n),null;case 31:if(n.memoizedState!==null){if(Mn(n),n.alternate===null)throw Error(a(340));ra()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(Mn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(a(340));ra()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return O(Tt),null;case 4:return be(),null;case 10:return Yo(n.type),null;case 22:case 23:return Mn(n),od(),t!==null&&O(la),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return Yo(Ot),null;case 25:return null;default:return null}}function Py(t,n){switch(Vf(n),n.tag){case 3:Yo(Ot),be();break;case 26:case 27:case 5:Xe(n);break;case 4:be();break;case 31:n.memoizedState!==null&&Mn(n);break;case 13:Mn(n);break;case 19:O(Tt);break;case 10:Yo(n.type);break;case 22:case 23:Mn(n),od(),t!==null&&O(la);break;case 24:Yo(Ot)}}function jl(t,n){try{var i=n.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var d=s.next;i=d;do{if((i.tag&t)===t){s=void 0;var m=i.create,w=i.inst;s=m(),w.destroy=s}i=i.next}while(i!==d)}}catch(_){tt(n,n.return,_)}}function Er(t,n,i){try{var s=n.updateQueue,d=s!==null?s.lastEffect:null;if(d!==null){var m=d.next;s=m;do{if((s.tag&t)===t){var w=s.inst,_=w.destroy;if(_!==void 0){w.destroy=void 0,d=n;var U=i,K=_;try{K()}catch(ae){tt(d,U,ae)}}}s=s.next}while(s!==m)}}catch(ae){tt(n,n.return,ae)}}function Vy(t){var n=t.updateQueue;if(n!==null){var i=t.stateNode;try{Mv(n,i)}catch(s){tt(t,t.return,s)}}}function Yy(t,n,i){i.props=da(t.type,t.memoizedProps),i.state=t.memoizedState;try{i.componentWillUnmount()}catch(s){tt(t,n,s)}}function Bl(t,n){try{var i=t.ref;if(i!==null){switch(t.tag){case 26:case 27:case 5:var s=t.stateNode;break;case 30:s=t.stateNode;break;default:s=t.stateNode}typeof i=="function"?t.refCleanup=i(s):i.current=s}}catch(d){tt(t,n,d)}}function So(t,n){var i=t.ref,s=t.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(d){tt(t,n,d)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(d){tt(t,n,d)}else i.current=null}function Gy(t){var n=t.type,i=t.memoizedProps,s=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":i.autoFocus&&s.focus();break e;case"img":i.src?s.src=i.src:i.srcSet&&(s.srcset=i.srcSet)}}catch(d){tt(t,t.return,d)}}function Bd(t,n,i){try{var s=t.stateNode;u2(s,t.type,i,n),s[gn]=n}catch(d){tt(t,t.return,d)}}function Xy(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&zr(t.type)||t.tag===4}function $d(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Xy(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&zr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Ld(t,n,i){var s=t.tag;if(s===5||s===6)t=t.stateNode,n?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(t,n):(n=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,n.appendChild(t),i=i._reactRootContainer,i!=null||n.onclick!==null||(n.onclick=ko));else if(s!==4&&(s===27&&zr(t.type)&&(i=t.stateNode,n=null),t=t.child,t!==null))for(Ld(t,n,i),t=t.sibling;t!==null;)Ld(t,n,i),t=t.sibling}function vc(t,n,i){var s=t.tag;if(s===5||s===6)t=t.stateNode,n?i.insertBefore(t,n):i.appendChild(t);else if(s!==4&&(s===27&&zr(t.type)&&(i=t.stateNode),t=t.child,t!==null))for(vc(t,n,i),t=t.sibling;t!==null;)vc(t,n,i),t=t.sibling}function qy(t){var n=t.stateNode,i=t.memoizedProps;try{for(var s=t.type,d=n.attributes;d.length;)n.removeAttributeNode(d[0]);tn(n,s,i),n[Kt]=t,n[gn]=i}catch(m){tt(t,t.return,m)}}var Fo=!1,$t=!1,kd=!1,Iy=typeof WeakSet=="function"?WeakSet:Set,It=null;function YE(t,n){if(t=t.containerInfo,ah=kc,t=av(t),zf(t)){if("selectionStart"in t)var i={start:t.selectionStart,end:t.selectionEnd};else e:{i=(i=t.ownerDocument)&&i.defaultView||window;var s=i.getSelection&&i.getSelection();if(s&&s.rangeCount!==0){i=s.anchorNode;var d=s.anchorOffset,m=s.focusNode;s=s.focusOffset;try{i.nodeType,m.nodeType}catch{i=null;break e}var w=0,_=-1,U=-1,K=0,ae=0,se=t,J=null;t:for(;;){for(var te;se!==i||d!==0&&se.nodeType!==3||(_=w+d),se!==m||s!==0&&se.nodeType!==3||(U=w+s),se.nodeType===3&&(w+=se.nodeValue.length),(te=se.firstChild)!==null;)J=se,se=te;for(;;){if(se===t)break t;if(J===i&&++K===d&&(_=w),J===m&&++ae===s&&(U=w),(te=se.nextSibling)!==null)break;se=J,J=se.parentNode}se=te}i=_===-1||U===-1?null:{start:_,end:U}}else i=null}i=i||{start:0,end:0}}else i=null;for(ih={focusedElem:t,selectionRange:i},kc=!1,It=n;It!==null;)if(n=It,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,It=t;else for(;It!==null;){switch(n=It,m=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(i=0;i title"))),tn(m,s,i),m[Kt]=t,qt(m),s=m;break e;case"link":var w=Jb("link","href",d).get(s+(i.href||""));if(w){for(var _=0;_it&&(w=it,it=Te,Te=w);var F=ov(_,Te),G=ov(_,it);if(F&&G&&(te.rangeCount!==1||te.anchorNode!==F.node||te.anchorOffset!==F.offset||te.focusNode!==G.node||te.focusOffset!==G.offset)){var Q=se.createRange();Q.setStart(F.node,F.offset),te.removeAllRanges(),Te>it?(te.addRange(Q),te.extend(G.node,G.offset)):(Q.setEnd(G.node,G.offset),te.addRange(Q))}}}}for(se=[],te=_;te=te.parentNode;)te.nodeType===1&&se.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_i?32:i,j.T=null,i=Xd,Xd=null;var m=Dr,w=Jo;if(Ut=0,hi=Dr=null,Jo=0,(Ze&6)!==0)throw Error(a(331));var _=Ze;if(Ze|=4,rb(m.current),tb(m,m.current,w,i),Ze=_,Pl(0,!1),Gt&&typeof Gt.onPostCommitFiberRoot=="function")try{Gt.onPostCommitFiberRoot(jo,m)}catch{}return!0}finally{k.p=d,j.T=s,wb(t,n)}}function Eb(t,n,i){n=Yn(i,n),n=Ed(t.stateNode,n,2),t=Sr(t,n,2),t!==null&&(Ln(t,2),wo(t))}function tt(t,n,i){if(t.tag===3)Eb(t,t,i);else for(;n!==null;){if(n.tag===3){Eb(n,t,i);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(_r===null||!_r.has(s))){t=Yn(i,t),i=Ry(2),s=Sr(n,i,2),s!==null&&(Ty(i,s,n,t),Ln(s,2),wo(s));break}}n=n.return}}function Zd(t,n,i){var s=t.pingCache;if(s===null){s=t.pingCache=new qE;var d=new Set;s.set(n,d)}else d=s.get(n),d===void 0&&(d=new Set,s.set(n,d));d.has(i)||(Pd=!0,d.add(i),t=KE.bind(null,t,n,i),n.then(t,t))}function KE(t,n,i){var s=t.pingCache;s!==null&&s.delete(n),t.pingedLanes|=t.suspendedLanes&i,t.warmLanes&=~i,ct===t&&(He&i)===i&&(xt===4||xt===3&&(He&62914560)===He&&300>de()-xc?(Ze&2)===0&&pi(t,0):Vd|=i,di===He&&(di=0)),wo(t)}function Rb(t,n){n===0&&(n=rn()),t=na(t,n),t!==null&&(Ln(t,n),wo(t))}function WE(t){var n=t.memoizedState,i=0;n!==null&&(i=n.retryLane),Rb(t,i)}function JE(t,n){var i=0;switch(t.tag){case 31:case 13:var s=t.stateNode,d=t.memoizedState;d!==null&&(i=d.retryLane);break;case 19:s=t.stateNode;break;case 22:s=t.stateNode._retryCache;break;default:throw Error(a(314))}s!==null&&s.delete(n),Rb(t,i)}function e2(t,n){return De(t,n)}var _c=null,gi=null,Qd=!1,Dc=!1,Kd=!1,Ar=0;function wo(t){t!==gi&&t.next===null&&(gi===null?_c=gi=t:gi=gi.next=t),Dc=!0,Qd||(Qd=!0,n2())}function Pl(t,n){if(!Kd&&Dc){Kd=!0;do for(var i=!1,s=_c;s!==null;){if(t!==0){var d=s.pendingLanes;if(d===0)var m=0;else{var w=s.suspendedLanes,_=s.pingedLanes;m=(1<<31-Ct(42|t)+1)-1,m&=d&~(w&~_),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(i=!0,Nb(s,m))}else m=He,m=Xt(s,s===ct?m:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(m&3)===0||hn(s,m)||(i=!0,Nb(s,m));s=s.next}while(i);Kd=!1}}function t2(){Tb()}function Tb(){Dc=Qd=!1;var t=0;Ar!==0&&d2()&&(t=Ar);for(var n=de(),i=null,s=_c;s!==null;){var d=s.next,m=_b(s,n);m===0?(s.next=null,i===null?_c=d:i.next=d,d===null&&(gi=i)):(i=s,(t!==0||(m&3)!==0)&&(Dc=!0)),s=d}Ut!==0&&Ut!==5||Pl(t),Ar!==0&&(Ar=0)}function _b(t,n){for(var i=t.suspendedLanes,s=t.pingedLanes,d=t.expirationTimes,m=t.pendingLanes&-62914561;0_)break;var ae=U.transferSize,se=U.initiatorType;ae&&Lb(se)&&(U=U.responseEnd,w+=ae*(U<_?1:(_-K)/(U-K)))}if(--s,n+=8*(m+w)/(d.duration/1e3),t++,10"u"?null:document;function Zb(t,n,i){var s=vi;if(s&&typeof n=="string"&&n){var d=Pn(n);d='link[rel="'+t+'"][href="'+d+'"]',typeof i=="string"&&(d+='[crossorigin="'+i+'"]'),Fb.has(d)||(Fb.add(d),t={rel:t,crossOrigin:i,href:n},s.querySelector(d)===null&&(n=s.createElement("link"),tn(n,"link",t),qt(n),s.head.appendChild(n)))}}function S2(t){er.D(t),Zb("dns-prefetch",t,null)}function w2(t,n){er.C(t,n),Zb("preconnect",t,n)}function C2(t,n,i){er.L(t,n,i);var s=vi;if(s&&t&&n){var d='link[rel="preload"][as="'+Pn(n)+'"]';n==="image"&&i&&i.imageSrcSet?(d+='[imagesrcset="'+Pn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(d+='[imagesizes="'+Pn(i.imageSizes)+'"]')):d+='[href="'+Pn(t)+'"]';var m=d;switch(n){case"style":m=yi(t);break;case"script":m=bi(t)}Zn.has(m)||(t=v({rel:"preload",href:n==="image"&&i&&i.imageSrcSet?void 0:t,as:n},i),Zn.set(m,t),s.querySelector(d)!==null||n==="style"&&s.querySelector(Xl(m))||n==="script"&&s.querySelector(ql(m))||(n=s.createElement("link"),tn(n,"link",t),qt(n),s.head.appendChild(n)))}}function E2(t,n){er.m(t,n);var i=vi;if(i&&t){var s=n&&typeof n.as=="string"?n.as:"script",d='link[rel="modulepreload"][as="'+Pn(s)+'"][href="'+Pn(t)+'"]',m=d;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=bi(t)}if(!Zn.has(m)&&(t=v({rel:"modulepreload",href:t},n),Zn.set(m,t),i.querySelector(d)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(ql(m)))return}s=i.createElement("link"),tn(s,"link",t),qt(s),i.head.appendChild(s)}}}function R2(t,n,i){er.S(t,n,i);var s=vi;if(s&&t){var d=Ua(s).hoistableStyles,m=yi(t);n=n||"default";var w=d.get(m);if(!w){var _={loading:0,preload:null};if(w=s.querySelector(Xl(m)))_.loading=5;else{t=v({rel:"stylesheet",href:t,"data-precedence":n},i),(i=Zn.get(m))&&hh(t,i);var U=w=s.createElement("link");qt(U),tn(U,"link",t),U._p=new Promise(function(K,ae){U.onload=K,U.onerror=ae}),U.addEventListener("load",function(){_.loading|=1}),U.addEventListener("error",function(){_.loading|=2}),_.loading|=4,Oc(w,n,s)}w={type:"stylesheet",instance:w,count:1,state:_},d.set(m,w)}}}function T2(t,n){er.X(t,n);var i=vi;if(i&&t){var s=Ua(i).hoistableScripts,d=bi(t),m=s.get(d);m||(m=i.querySelector(ql(d)),m||(t=v({src:t,async:!0},n),(n=Zn.get(d))&&ph(t,n),m=i.createElement("script"),qt(m),tn(m,"link",t),i.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},s.set(d,m))}}function _2(t,n){er.M(t,n);var i=vi;if(i&&t){var s=Ua(i).hoistableScripts,d=bi(t),m=s.get(d);m||(m=i.querySelector(ql(d)),m||(t=v({src:t,async:!0,type:"module"},n),(n=Zn.get(d))&&ph(t,n),m=i.createElement("script"),qt(m),tn(m,"link",t),i.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},s.set(d,m))}}function Qb(t,n,i,s){var d=(d=ue.current)?Mc(d):null;if(!d)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(n=yi(i.href),i=Ua(d).hoistableStyles,s=i.get(n),s||(s={type:"style",instance:null,count:0,state:null},i.set(n,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){t=yi(i.href);var m=Ua(d).hoistableStyles,w=m.get(t);if(w||(d=d.ownerDocument||d,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(t,w),(m=d.querySelector(Xl(t)))&&!m._p&&(w.instance=m,w.state.loading=5),Zn.has(t)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Zn.set(t,i),m||D2(d,t,i,w.state))),n&&s===null)throw Error(a(528,""));return w}if(n&&s!==null)throw Error(a(529,""));return null;case"script":return n=i.async,i=i.src,typeof i=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=bi(i),i=Ua(d).hoistableScripts,s=i.get(n),s||(s={type:"script",instance:null,count:0,state:null},i.set(n,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,t))}}function yi(t){return'href="'+Pn(t)+'"'}function Xl(t){return'link[rel="stylesheet"]['+t+"]"}function Kb(t){return v({},t,{"data-precedence":t.precedence,precedence:null})}function D2(t,n,i,s){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?s.loading=1:(n=t.createElement("link"),s.preload=n,n.addEventListener("load",function(){return s.loading|=1}),n.addEventListener("error",function(){return s.loading|=2}),tn(n,"link",i),qt(n),t.head.appendChild(n))}function bi(t){return'[src="'+Pn(t)+'"]'}function ql(t){return"script[async]"+t}function Wb(t,n,i){if(n.count++,n.instance===null)switch(n.type){case"style":var s=t.querySelector('style[data-href~="'+Pn(i.href)+'"]');if(s)return n.instance=s,qt(s),s;var d=v({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(t.ownerDocument||t).createElement("style"),qt(s),tn(s,"style",d),Oc(s,i.precedence,t),n.instance=s;case"stylesheet":d=yi(i.href);var m=t.querySelector(Xl(d));if(m)return n.state.loading|=4,n.instance=m,qt(m),m;s=Kb(i),(d=Zn.get(d))&&hh(s,d),m=(t.ownerDocument||t).createElement("link"),qt(m);var w=m;return w._p=new Promise(function(_,U){w.onload=_,w.onerror=U}),tn(m,"link",s),n.state.loading|=4,Oc(m,i.precedence,t),n.instance=m;case"script":return m=bi(i.src),(d=t.querySelector(ql(m)))?(n.instance=d,qt(d),d):(s=i,(d=Zn.get(m))&&(s=v({},i),ph(s,d)),t=t.ownerDocument||t,d=t.createElement("script"),qt(d),tn(d,"link",s),t.head.appendChild(d),n.instance=d);case"void":return null;default:throw Error(a(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(s=n.instance,n.state.loading|=4,Oc(s,i.precedence,t));return n.instance}function Oc(t,n,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=s.length?s[s.length-1]:null,m=d,w=0;w title"):null)}function N2(t,n,i){if(i===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(t=n.disabled,typeof n.precedence=="string"&&t==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function t0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function A2(t,n,i,s){if(i.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var d=yi(s.href),m=n.querySelector(Xl(d));if(m){n=m._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=Bc.bind(t),n.then(t,t)),i.state.loading|=4,i.instance=m,qt(m);return}m=n.ownerDocument||n,s=Kb(s),(d=Zn.get(d))&&hh(s,d),m=m.createElement("link"),qt(m);var w=m;w._p=new Promise(function(_,U){w.onload=_,w.onerror=U}),tn(m,"link",s),i.instance=m}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(i,n),(n=i.state.preload)&&(i.state.loading&3)===0&&(t.count++,i=Bc.bind(t),n.addEventListener("load",i),n.addEventListener("error",i))}}var mh=0;function z2(t,n){return t.stylesheets&&t.count===0&&Lc(t,t.stylesheets),0mh?50:800)+n);return t.unsuspend=i,function(){t.unsuspend=null,clearTimeout(s),clearTimeout(d)}}:null}function Bc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Lc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var $c=null;function Lc(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,$c=new Map,n.forEach(M2,t),$c=null,Bc.call(t))}function M2(t,n){if(!(n.state.loading&4)){var i=$c.get(t);if(i)var s=i.get(null);else{i=new Map,$c.set(t,i);for(var d=t.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(o){console.error(o)}}return e(),Eh.exports=Z2(),Eh.exports}var K2=Q2(),To=function(){return To=Object.assign||function(o){for(var r,a=1,l=arguments.length;a"u")return pR;var o=mR(e),r=document.documentElement.clientWidth,a=window.innerWidth;return{left:o[0],top:o[1],right:o[2],gap:Math.max(0,a-r+o[2]-o[0])}},vR=fx(),Mi="data-scroll-locked",yR=function(e,o,r,a){var l=e.left,c=e.top,u=e.right,f=e.gap;return r===void 0&&(r="margin"),` .`.concat(J2,` { overflow: hidden `).concat(a,`; padding-right: `).concat(f,"px ").concat(a,`; @@ -43,13 +43,13 @@ Error generating stack: `+s.message+` body[`).concat(Mi,`] { `).concat(eR,": ").concat(f,`px; } -`)},R0=function(){var e=parseInt(document.body.getAttribute(Mi)||"0",10);return isFinite(e)?e:0},bR=function(){b.useEffect(function(){return document.body.setAttribute(Mi,(R0()+1).toString()),function(){var e=R0()-1;e<=0?document.body.removeAttribute(Mi):document.body.setAttribute(Mi,e.toString())}},[])},xR=function(e){var o=e.noRelative,r=e.noImportant,a=e.gapMode,l=a===void 0?"margin":a;bR();var c=b.useMemo(function(){return gR(l)},[l]);return b.createElement(vR,{styles:yR(c,!o,l,r?"":"!important")})},dp=!1;if(typeof window<"u")try{var Xc=Object.defineProperty({},"passive",{get:function(){return dp=!0,!0}});window.addEventListener("test",Xc,Xc),window.removeEventListener("test",Xc,Xc)}catch{dp=!1}var Si=dp?{passive:!1}:!1,SR=function(e){return e.tagName==="TEXTAREA"},fx=function(e,o){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[o]!=="hidden"&&!(r.overflowY===r.overflowX&&!SR(e)&&r[o]==="visible")},wR=function(e){return fx(e,"overflowY")},CR=function(e){return fx(e,"overflowX")},T0=function(e,o){var r=o.ownerDocument,a=o;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var l=dx(e,a);if(l){var c=hx(e,a),u=c[1],f=c[2];if(u>f)return!0}a=a.parentNode}while(a&&a!==r.body);return!1},ER=function(e){var o=e.scrollTop,r=e.scrollHeight,a=e.clientHeight;return[o,r,a]},RR=function(e){var o=e.scrollLeft,r=e.scrollWidth,a=e.clientWidth;return[o,r,a]},dx=function(e,o){return e==="v"?wR(o):CR(o)},hx=function(e,o){return e==="v"?ER(o):RR(o)},TR=function(e,o){return e==="h"&&o==="rtl"?-1:1},_R=function(e,o,r,a,l){var c=TR(e,window.getComputedStyle(o).direction),u=c*a,f=r.target,h=o.contains(f),p=!1,g=u>0,v=0,x=0;do{if(!f)break;var S=hx(e,f),E=S[0],C=S[1],R=S[2],T=C-R-c*E;(E||T)&&dx(e,f)&&(v+=T,x+=E);var z=f.parentNode;f=z&&z.nodeType===Node.DOCUMENT_FRAGMENT_NODE?z.host:z}while(!h&&f!==document.body||h&&(o.contains(f)||o===f));return(g&&Math.abs(v)<1||!g&&Math.abs(x)<1)&&(p=!0),p},qc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},_0=function(e){return[e.deltaX,e.deltaY]},D0=function(e){return e&&"current"in e?e.current:e},DR=function(e,o){return e[0]===o[0]&&e[1]===o[1]},NR=function(e){return` +`)},T0=function(){var e=parseInt(document.body.getAttribute(Mi)||"0",10);return isFinite(e)?e:0},bR=function(){b.useEffect(function(){return document.body.setAttribute(Mi,(T0()+1).toString()),function(){var e=T0()-1;e<=0?document.body.removeAttribute(Mi):document.body.setAttribute(Mi,e.toString())}},[])},xR=function(e){var o=e.noRelative,r=e.noImportant,a=e.gapMode,l=a===void 0?"margin":a;bR();var c=b.useMemo(function(){return gR(l)},[l]);return b.createElement(vR,{styles:yR(c,!o,l,r?"":"!important")})},dp=!1;if(typeof window<"u")try{var Xc=Object.defineProperty({},"passive",{get:function(){return dp=!0,!0}});window.addEventListener("test",Xc,Xc),window.removeEventListener("test",Xc,Xc)}catch{dp=!1}var Si=dp?{passive:!1}:!1,SR=function(e){return e.tagName==="TEXTAREA"},dx=function(e,o){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[o]!=="hidden"&&!(r.overflowY===r.overflowX&&!SR(e)&&r[o]==="visible")},wR=function(e){return dx(e,"overflowY")},CR=function(e){return dx(e,"overflowX")},_0=function(e,o){var r=o.ownerDocument,a=o;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var l=hx(e,a);if(l){var c=px(e,a),u=c[1],f=c[2];if(u>f)return!0}a=a.parentNode}while(a&&a!==r.body);return!1},ER=function(e){var o=e.scrollTop,r=e.scrollHeight,a=e.clientHeight;return[o,r,a]},RR=function(e){var o=e.scrollLeft,r=e.scrollWidth,a=e.clientWidth;return[o,r,a]},hx=function(e,o){return e==="v"?wR(o):CR(o)},px=function(e,o){return e==="v"?ER(o):RR(o)},TR=function(e,o){return e==="h"&&o==="rtl"?-1:1},_R=function(e,o,r,a,l){var c=TR(e,window.getComputedStyle(o).direction),u=c*a,f=r.target,h=o.contains(f),p=!1,g=u>0,v=0,x=0;do{if(!f)break;var S=px(e,f),E=S[0],C=S[1],R=S[2],T=C-R-c*E;(E||T)&&hx(e,f)&&(v+=T,x+=E);var z=f.parentNode;f=z&&z.nodeType===Node.DOCUMENT_FRAGMENT_NODE?z.host:z}while(!h&&f!==document.body||h&&(o.contains(f)||o===f));return(g&&Math.abs(v)<1||!g&&Math.abs(x)<1)&&(p=!0),p},qc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},D0=function(e){return[e.deltaX,e.deltaY]},N0=function(e){return e&&"current"in e?e.current:e},DR=function(e,o){return e[0]===o[0]&&e[1]===o[1]},NR=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},AR=0,wi=[];function zR(e){var o=b.useRef([]),r=b.useRef([0,0]),a=b.useRef(),l=b.useState(AR++)[0],c=b.useState(ux)[0],u=b.useRef(e);b.useEffect(function(){u.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var C=W2([e.lockRef.current],(e.shards||[]).map(D0),!0).filter(Boolean);return C.forEach(function(R){return R.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),C.forEach(function(R){return R.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var f=b.useCallback(function(C,R){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!u.current.allowPinchZoom;var T=qc(C),z=r.current,A="deltaX"in C?C.deltaX:z[0]-T[0],N="deltaY"in C?C.deltaY:z[1]-T[1],B,M=C.target,$=Math.abs(A)>Math.abs(N)?"h":"v";if("touches"in C&&$==="h"&&M.type==="range")return!1;var L=window.getSelection(),H=L&&L.anchorNode,I=H?H===M||H.contains(M):!1;if(I)return!1;var Y=T0($,M);if(!Y)return!0;if(Y?B=$:(B=$==="v"?"h":"v",Y=T0($,M)),!Y)return!1;if(!a.current&&"changedTouches"in C&&(A||N)&&(a.current=B),!B)return!0;var X=a.current||B;return _R(X,R,C,X==="h"?A:N)},[]),h=b.useCallback(function(C){var R=C;if(!(!wi.length||wi[wi.length-1]!==c)){var T="deltaY"in R?_0(R):qc(R),z=o.current.filter(function(B){return B.name===R.type&&(B.target===R.target||R.target===B.shadowParent)&&DR(B.delta,T)})[0];if(z&&z.should){R.cancelable&&R.preventDefault();return}if(!z){var A=(u.current.shards||[]).map(D0).filter(Boolean).filter(function(B){return B.contains(R.target)}),N=A.length>0?f(R,A[0]):!u.current.noIsolation;N&&R.cancelable&&R.preventDefault()}}},[]),p=b.useCallback(function(C,R,T,z){var A={name:C,delta:R,target:T,should:z,shadowParent:MR(T)};o.current.push(A),setTimeout(function(){o.current=o.current.filter(function(N){return N!==A})},1)},[]),g=b.useCallback(function(C){r.current=qc(C),a.current=void 0},[]),v=b.useCallback(function(C){p(C.type,_0(C),C.target,f(C,e.lockRef.current))},[]),x=b.useCallback(function(C){p(C.type,qc(C),C.target,f(C,e.lockRef.current))},[]);b.useEffect(function(){return wi.push(c),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:x}),document.addEventListener("wheel",h,Si),document.addEventListener("touchmove",h,Si),document.addEventListener("touchstart",g,Si),function(){wi=wi.filter(function(C){return C!==c}),document.removeEventListener("wheel",h,Si),document.removeEventListener("touchmove",h,Si),document.removeEventListener("touchstart",g,Si)}},[]);var S=e.removeScrollBar,E=e.inert;return b.createElement(b.Fragment,null,E?b.createElement(c,{styles:NR(l)}):null,S?b.createElement(xR,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function MR(e){for(var o=null;e!==null;)e instanceof ShadowRoot&&(o=e.host,e=e.host),e=e.parentNode;return o}const OR=lR(cx,zR);var ki=b.forwardRef(function(e,o){return b.createElement(_u,To({},e,{ref:o,sideCar:OR}))});ki.classNames=_u.classNames;function At(e){return Object.keys(e)}function zh(e){return e&&typeof e=="object"&&!Array.isArray(e)}function Ip(e,o){const r={...e},a=o;return zh(e)&&zh(o)&&Object.keys(o).forEach(l=>{zh(a[l])&&l in e?r[l]=Ip(r[l],a[l]):r[l]=a[l]}),r}function jR(e){return e.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`)}function BR(e){return typeof e!="string"||!e.includes("var(--mantine-scale)")?e:e.match(/^calc\((.*?)\)$/)?.[1].split("*")[0].trim()}function fs(e){const o=BR(e);return typeof o=="number"?o:typeof o=="string"?o.includes("calc")||o.includes("var")?o:o.includes("px")?Number(o.replace("px","")):o.includes("rem")?Number(o.replace("rem",""))*16:o.includes("em")?Number(o.replace("em",""))*16:Number(o):NaN}function N0(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function px(e,{shouldScale:o=!1}={}){function r(a){if(a===0||a==="0")return`0${e}`;if(typeof a=="number"){const l=`${a/16}${e}`;return o?N0(l):l}if(typeof a=="string"){if(a===""||a.startsWith("calc(")||a.startsWith("clamp(")||a.includes("rgba("))return a;if(a.includes(","))return a.split(",").map(c=>r(c)).join(",");if(a.includes(" "))return a.split(" ").map(c=>r(c)).join(" ");const l=a.replace("px","");if(!Number.isNaN(Number(l))){const c=`${Number(l)/16}${e}`;return o?N0(c):c}}return a}return r}const oe=px("rem",{shouldScale:!0}),du=px("em");function xs(e){return Object.keys(e).reduce((o,r)=>(e[r]!==void 0&&(o[r]=e[r]),o),{})}function mx(e){if(typeof e=="number")return!0;if(typeof e=="string"){if(e.startsWith("calc(")||e.startsWith("var(")||e.includes(" ")&&e.trim()!=="")return!0;const o=/^[+-]?[0-9]+(\.[0-9]+)?(px|em|rem|ex|ch|lh|rlh|vw|vh|vmin|vmax|vb|vi|svw|svh|lvw|lvh|dvw|dvh|cm|mm|in|pt|pc|q|cqw|cqh|cqi|cqb|cqmin|cqmax|%)?$/;return e.trim().split(/\s+/).every(a=>o.test(a))}return!1}function rr(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==b.Fragment:!1}function zo(e){const o=b.createContext(null);return[({children:l,value:c})=>y.jsx(o.Provider,{value:c,children:l}),()=>{const l=b.useContext(o);if(l===null)throw new Error(e);return l}]}function Ss(e=null){const o=b.createContext(e);return[({children:l,value:c})=>y.jsx(o.Provider,{value:c,children:l}),()=>b.useContext(o)]}function hu(e,o){let r=e;for(;(r=r.parentElement)&&!r.matches(o););return r}function $R(e,o,r){for(let a=e-1;a>=0;a-=1)if(!o[a].disabled)return a;if(r){for(let a=o.length-1;a>-1;a-=1)if(!o[a].disabled)return a}return e}function LR(e,o,r){for(let a=e+1;a{r?.(f);const h=Array.from(hu(f.currentTarget,e)?.querySelectorAll(o)||[]).filter(x=>kR(f.currentTarget,x,e)),p=h.findIndex(x=>f.currentTarget===x),g=LR(p,h,a),v=$R(p,h,a);switch(f.key){case"ArrowRight":break;case"ArrowLeft":break;case"ArrowUp":{f.stopPropagation(),f.preventDefault(),h[v].focus(),l&&h[v].click();break}case"ArrowDown":{f.stopPropagation(),f.preventDefault(),h[g].focus(),l&&h[g].click();break}case"Home":{f.stopPropagation(),f.preventDefault(),!h[0].disabled&&h[0].focus();break}case"End":{f.stopPropagation(),f.preventDefault();const x=h.length-1;!h[x].disabled&&h[x].focus();break}}}}const HR={app:100,modal:200,popover:300,overlay:400,max:9999};function vo(e){return HR[e]}const hp=()=>{};function UR(e,o={active:!0}){return typeof e!="function"||!o.active?o.onKeyDown||hp:r=>{r.key==="Escape"&&(e(r),o.onTrigger?.())}}function Xe(e,o="size",r=!0){if(e!==void 0)return mx(e)?r?oe(e):e:`var(--${o}-${e})`}function sn(e){return Xe(e,"mantine-spacing")}function kt(e){return e===void 0?"var(--mantine-radius-default)":Xe(e,"mantine-radius")}function nn(e){return Xe(e,"mantine-font-size")}function PR(e){return Xe(e,"mantine-line-height",!1)}function Fp(e){if(e)return Xe(e,"mantine-shadow",!1)}function Cn(e,o){return r=>{e?.(r),o?.(r)}}function Zp(e,o){return e in o?fs(o[e]):fs(e)}function pp(e,o){const r=e.map(a=>({value:a,px:Zp(a,o)}));return r.sort((a,l)=>a.px-l.px),r}function Oi(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function VR(e,o,r){return r?Array.from(hu(r,o)?.querySelectorAll(e)||[]).findIndex(a=>a===r):null}function lu(e,o,r){return o===void 0&&r===void 0?e:o!==void 0&&r===void 0?Math.max(e,o):Math.min(o===void 0&&r!==void 0?e:Math.max(e,o),r)}function pu(e="mantine-"){return`${e}${Math.random().toString(36).slice(2,11)}`}function YR(e,o){if(e===o||Number.isNaN(e)&&Number.isNaN(o))return!0;if(!(e instanceof Object)||!(o instanceof Object))return!1;const r=Object.keys(e),{length:a}=r;if(a!==Object.keys(o).length)return!1;for(let l=0;l{o.current=e}),b.useMemo(()=>(...r)=>o.current?.(...r),[])}function Du(e,o){const r=typeof o=="number"?o:o.delay,a=typeof o=="number"?!1:o.flushOnUnmount,l=typeof o=="number"?!1:o.leading,c=ba(e),u=b.useRef(0),f=b.useRef(()=>{}),h=b.useRef(l),p=Object.assign(b.useCallback((...g)=>{if(window.clearTimeout(u.current),l&&h.current){h.current=!1,c(...g);return}const v=()=>{u.current!==0&&(u.current=0,h.current=!0,c(...g))};f.current=v,p.flush=v,u.current=window.setTimeout(v,r),h.current=!1},[c,r,l]),{flush:f.current});return b.useEffect(()=>()=>{window.clearTimeout(u.current),a&&p.flush()},[p,a]),p}const A0=["mousedown","touchstart"];function GR(e,o,r){const a=b.useRef(null);return b.useEffect(()=>{const l=c=>{const{target:u}=c??{};if(Array.isArray(r)){const f=u?.hasAttribute("data-ignore-outside-clicks")||!document.body.contains(u)&&u.tagName!=="HTML";r.every(p=>!!p&&!c.composedPath().includes(p))&&!f&&e()}else a.current&&!a.current.contains(u)&&e()};return(o||A0).forEach(c=>document.addEventListener(c,l)),()=>{(o||A0).forEach(c=>document.removeEventListener(c,l))}},[a,e,r]),a}function XR(e,o){try{return e.addEventListener("change",o),()=>e.removeEventListener("change",o)}catch{return e.addListener(o),()=>e.removeListener(o)}}function qR(e,o){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function Qp(e,o,{getInitialValueInEffect:r}={getInitialValueInEffect:!0}){const[a,l]=b.useState(r?o:qR(e)),c=b.useRef(null);return b.useEffect(()=>{if("matchMedia"in window)return c.current=window.matchMedia(e),l(c.current.matches),XR(c.current,u=>l(u.matches))},[e]),a}const Gi=typeof document<"u"?b.useLayoutEffect:b.useEffect;function or(e,o){const r=b.useRef(!1);b.useEffect(()=>()=>{r.current=!1},[]),b.useEffect(()=>{if(r.current)return e();r.current=!0},o)}function vx({opened:e,shouldReturnFocus:o=!0}){const r=b.useRef(null),a=()=>{r.current&&"focus"in r.current&&typeof r.current.focus=="function"&&r.current?.focus({preventScroll:!0})};return or(()=>{let l=-1;const c=u=>{u.key==="Tab"&&window.clearTimeout(l)};return document.addEventListener("keydown",c),e?r.current=document.activeElement:o&&(l=window.setTimeout(a,10)),()=>{window.clearTimeout(l),document.removeEventListener("keydown",c)}},[e,o]),a}const IR=/input|select|textarea|button|object/,yx="a, input, select, textarea, button, object, [tabindex]";function FR(e){return e.style.display==="none"}function ZR(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let r=e;for(;r&&!(r===document.body||r.nodeType===11);){if(FR(r))return!1;r=r.parentNode}return!0}function bx(e){let o=e.getAttribute("tabindex");return o===null&&(o=void 0),parseInt(o,10)}function mp(e){const o=e.nodeName.toLowerCase(),r=!Number.isNaN(bx(e));return(IR.test(o)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||r)&&ZR(e)}function xx(e){const o=bx(e);return(Number.isNaN(o)||o>=0)&&mp(e)}function QR(e){return Array.from(e.querySelectorAll(yx)).filter(xx)}function KR(e,o){const r=QR(e);if(!r.length){o.preventDefault();return}const a=r[o.shiftKey?0:r.length-1],l=e.getRootNode();let c=a===l.activeElement||e===l.activeElement;const u=l.activeElement;if(u.tagName==="INPUT"&&u.getAttribute("type")==="radio"&&(c=r.filter(g=>g.getAttribute("type")==="radio"&&g.getAttribute("name")===u.getAttribute("name")).includes(a)),!c)return;o.preventDefault();const h=r[o.shiftKey?r.length-1:0];h&&h.focus()}function WR(e=!0){const o=b.useRef(null),r=l=>{let c=l.querySelector("[data-autofocus]");if(!c){const u=Array.from(l.querySelectorAll(yx));c=u.find(xx)||u.find(mp)||null,!c&&mp(l)&&(c=l)}c&&c.focus({preventScroll:!0})},a=b.useCallback(l=>{e&&l!==null&&o.current!==l&&(l?(setTimeout(()=>{l.getRootNode()&&r(l)}),o.current=l):o.current=null)},[e]);return b.useEffect(()=>{if(!e)return;o.current&&setTimeout(()=>r(o.current));const l=c=>{c.key==="Tab"&&o.current&&KR(o.current,c)};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[e]),a}const JR=e=>(e+1)%1e6;function eT(){const[,e]=b.useReducer(JR,0);return e}const tT=Ye.useId||(()=>{});function nT(){const e=tT();return e?`mantine-${e.replace(/:/g,"")}`:""}function Jn(e){const o=nT(),[r,a]=b.useState(o);return Gi(()=>{a(pu())},[]),typeof e=="string"?e:typeof window>"u"?o:r}function Sx(e,o,r){b.useEffect(()=>(window.addEventListener(e,o,r),()=>window.removeEventListener(e,o,r)),[e,o])}function mu(e,o){if(typeof e=="function")return e(o);typeof e=="object"&&e!==null&&"current"in e&&(e.current=o)}function wx(...e){const o=new Map;return r=>{if(e.forEach(a=>{const l=mu(a,r);l&&o.set(a,l)}),o.size>0)return()=>{e.forEach(a=>{const l=o.get(a);l?l():mu(a,null)}),o.clear()}}}function Mt(...e){return b.useCallback(wx(...e),e)}function Wn({value:e,defaultValue:o,finalValue:r,onChange:a=()=>{}}){const[l,c]=b.useState(o!==void 0?o:r),u=(f,...h)=>{c(f),a?.(f,...h)};return e!==void 0?[e,a,!0]:[l,u,!1]}function Nu(e,o){return Qp("(prefers-reduced-motion: reduce)",e,o)}function oT(e,o){if(!e||!o)return!1;if(e===o)return!0;if(e.length!==o.length)return!1;for(let r=0;r{c(p=>p||(r?.(),!0))},[r]),f=b.useCallback(()=>{c(p=>p&&(a?.(),!1))},[a]),h=b.useCallback(()=>{l?f():u()},[f,u,l]);return[l,{open:u,close:f,toggle:h}]}function lT(e,o,r={autoInvoke:!1}){const a=b.useRef(null),l=b.useCallback((...u)=>{a.current||(a.current=window.setTimeout(()=>{e(u),a.current=null},o))},[o]),c=b.useCallback(()=>{a.current&&(window.clearTimeout(a.current),a.current=null)},[]);return b.useEffect(()=>(r.autoInvoke&&l(),c),[c,l]),{start:l,clear:c}}function sT(e){const o=b.useRef(void 0);return b.useEffect(()=>{o.current=e},[e]),o.current}function cT(e,o,r){const a=b.useRef(null),l=b.useRef(null);return b.useEffect(()=>{const c=typeof r=="function"?r():r;return(c||l.current)&&(a.current=new MutationObserver(e),a.current.observe(c||l.current,o)),()=>{a.current?.disconnect()}},[e,o]),l}function uT(){const[e,o]=b.useState(!1);return b.useEffect(()=>o(!0),[]),e}var fT={};function dT(){return typeof process<"u"&&fT?"production":"development"}function Au(e){const o=Ye.version;return typeof Ye.version!="string"||o.startsWith("18.")?e?.ref:e?.props?.ref}function Cx(e){var o,r,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(o=0;o{Object.entries(r).forEach(([a,l])=>{o[a]?o[a]=zt(o[a],l):o[a]=l})}),o}function zu({theme:e,classNames:o,props:r,stylesCtx:a}){const c=(Array.isArray(o)?o:[o]).map(u=>typeof u=="function"?u(e,r,a):u||hT);return pT(c)}function gu({theme:e,styles:o,props:r,stylesCtx:a}){return(Array.isArray(o)?o:[o]).reduce((c,u)=>typeof u=="function"?{...c,...u(e,r,a)}:{...c,...u},{})}const Ex=b.createContext(null);function ar(){const e=b.useContext(Ex);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function mT(){return ar().cssVariablesResolver}function gT(){return ar().classNamesPrefix}function Kp(){return ar().getStyleNonce}function vT(){return ar().withStaticClasses}function yT(){return ar().headless}function bT(){return ar().stylesTransform?.sx}function xT(){return ar().stylesTransform?.styles}function Wp(){return ar().env||"default"}function ST(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function wT(e){let o=e.replace("#","");if(o.length===3){const u=o.split("");o=[u[0],u[0],u[1],u[1],u[2],u[2]].join("")}if(o.length===8){const u=parseInt(o.slice(6,8),16)/255;return{r:parseInt(o.slice(0,2),16),g:parseInt(o.slice(2,4),16),b:parseInt(o.slice(4,6),16),a:u}}const r=parseInt(o,16),a=r>>16&255,l=r>>8&255,c=r&255;return{r:a,g:l,b:c,a:1}}function CT(e){const[o,r,a,l]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:o,g:r,b:a,a:l||1}}function ET(e){const o=/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i,r=e.match(o);if(!r)return{r:0,g:0,b:0,a:1};const a=parseInt(r[1],10),l=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100,u=r[5]?parseFloat(r[5]):void 0,f=(1-Math.abs(2*c-1))*l,h=a/60,p=f*(1-Math.abs(h%2-1)),g=c-f/2;let v,x,S;return h>=0&&h<1?(v=f,x=p,S=0):h>=1&&h<2?(v=p,x=f,S=0):h>=2&&h<3?(v=0,x=f,S=p):h>=3&&h<4?(v=0,x=p,S=f):h>=4&&h<5?(v=p,x=0,S=f):(v=f,x=0,S=p),{r:Math.round((v+g)*255),g:Math.round((x+g)*255),b:Math.round((S+g)*255),a:u||1}}function Jp(e){return ST(e)?wT(e):e.startsWith("rgb")?CT(e):e.startsWith("hsl")?ET(e):{r:0,g:0,b:0,a:1}}function Ic(e,o){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${o*100}%)`;const{r,g:a,b:l,a:c}=Jp(e),u=1-o,f=h=>Math.round(h*u);return`rgba(${f(r)}, ${f(a)}, ${f(l)}, ${c})`}function ds(e,o){return typeof e.primaryShade=="number"?e.primaryShade:o==="dark"?e.primaryShade.dark:e.primaryShade.light}function Mh(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function RT(e){const o=e.match(/oklch\((.*?)%\s/);return o?parseFloat(o[1]):null}function TT(e){if(e.startsWith("oklch("))return(RT(e)||0)/100;const{r:o,g:r,b:a}=Jp(e),l=o/255,c=r/255,u=a/255,f=Mh(l),h=Mh(c),p=Mh(u);return .2126*f+.7152*h+.0722*p}function es(e,o=.179){return e.startsWith("var(")?!1:TT(e)>o}function ir({color:e,theme:o,colorScheme:r}){if(typeof e!="string")throw new Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof e}`);if(e==="bright")return{color:e,value:r==="dark"?o.white:o.black,shade:void 0,isThemeColor:!1,isLight:es(r==="dark"?o.white:o.black,o.luminanceThreshold),variable:"--mantine-color-bright"};if(e==="dimmed")return{color:e,value:r==="dark"?o.colors.dark[2]:o.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:es(r==="dark"?o.colors.dark[2]:o.colors.gray[6],o.luminanceThreshold),variable:"--mantine-color-dimmed"};if(e==="white"||e==="black")return{color:e,value:e==="white"?o.white:o.black,shade:void 0,isThemeColor:!1,isLight:es(e==="white"?o.white:o.black,o.luminanceThreshold),variable:`--mantine-color-${e}`};const[a,l]=e.split("."),c=l?Number(l):void 0,u=a in o.colors;if(u){const f=c!==void 0?o.colors[a][c]:o.colors[a][ds(o,r||"light")];return{color:a,value:f,shade:c,isThemeColor:u,isLight:es(f,o.luminanceThreshold),variable:l?`--mantine-color-${a}-${c}`:`--mantine-color-${a}-filled`}}return{color:e,value:e,isThemeColor:u,isLight:es(e,o.luminanceThreshold),shade:c,variable:void 0}}function Zt(e,o){const r=ir({color:e||o.primaryColor,theme:o});return r.variable?`var(${r.variable})`:e}function gp(e,o){const r={from:e?.from||o.defaultGradient.from,to:e?.to||o.defaultGradient.to,deg:e?.deg??o.defaultGradient.deg??0},a=Zt(r.from,o),l=Zt(r.to,o);return`linear-gradient(${r.deg}deg, ${a} 0%, ${l} 100%)`}function Co(e,o){if(typeof e!="string"||o>1||o<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(")){const c=(1-o)*100;return`color-mix(in srgb, ${e}, transparent ${c}%)`}if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${o})`):e.replace(")",` / ${o})`);const{r,g:a,b:l}=Jp(e);return`rgba(${r}, ${a}, ${l}, ${o})`}const Ci=Co,_T=({color:e,theme:o,variant:r,gradient:a,autoContrast:l})=>{const c=ir({color:e,theme:o}),u=typeof l=="boolean"?l:o.autoContrast;if(r==="none")return{background:"transparent",hover:"transparent",color:"inherit",border:"none"};if(r==="filled"){const f=u&&c.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return c.isThemeColor?c.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:f,border:`${oe(1)} solid transparent`}:{background:`var(--mantine-color-${c.color}-${c.shade})`,hover:`var(--mantine-color-${c.color}-${c.shade===9?8:c.shade+1})`,color:f,border:`${oe(1)} solid transparent`}:{background:e,hover:Ic(e,.1),color:f,border:`${oe(1)} solid transparent`}}if(r==="light"){if(c.isThemeColor){if(c.shade===void 0)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${oe(1)} solid transparent`};const f=o.colors[c.color][c.shade];return{background:Co(f,.1),hover:Co(f,.12),color:`var(--mantine-color-${c.color}-${Math.min(c.shade,6)})`,border:`${oe(1)} solid transparent`}}return{background:Co(e,.1),hover:Co(e,.12),color:e,border:`${oe(1)} solid transparent`}}if(r==="outline")return c.isThemeColor?c.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${oe(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:Co(o.colors[c.color][c.shade],.05),color:`var(--mantine-color-${c.color}-${c.shade})`,border:`${oe(1)} solid var(--mantine-color-${c.color}-${c.shade})`}:{background:"transparent",hover:Co(e,.05),color:e,border:`${oe(1)} solid ${e}`};if(r==="subtle"){if(c.isThemeColor){if(c.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${oe(1)} solid transparent`};const f=o.colors[c.color][c.shade];return{background:"transparent",hover:Co(f,.12),color:`var(--mantine-color-${c.color}-${Math.min(c.shade,6)})`,border:`${oe(1)} solid transparent`}}return{background:"transparent",hover:Co(e,.12),color:e,border:`${oe(1)} solid transparent`}}return r==="transparent"?c.isThemeColor?c.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${oe(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${c.color}-${Math.min(c.shade,6)})`,border:`${oe(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${oe(1)} solid transparent`}:r==="white"?c.isThemeColor?c.shade===void 0?{background:"var(--mantine-color-white)",hover:Ic(o.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${oe(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Ic(o.white,.01),color:`var(--mantine-color-${c.color}-${c.shade})`,border:`${oe(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Ic(o.white,.01),color:e,border:`${oe(1)} solid transparent`}:r==="gradient"?{background:gp(a,o),hover:gp(a,o),color:"var(--mantine-color-white)",border:"none"}:r==="default"?{background:"var(--mantine-color-default)",hover:"var(--mantine-color-default-hover)",color:"var(--mantine-color-default-color)",border:`${oe(1)} solid var(--mantine-color-default-border)`}:{}},DT={dark:["#C9C9C9","#b8b8b8","#828282","#696969","#424242","#3b3b3b","#2e2e2e","#242424","#1f1f1f","#141414"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},z0="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",em={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:DT,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:_T,autoContrast:!1,luminanceThreshold:.3,fontFamily:z0,fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",respectReducedMotion:!1,cursorType:"default",defaultGradient:{from:"blue",to:"cyan",deg:45},defaultRadius:"sm",activeClassName:"mantine-active",focusClassName:"",headings:{fontFamily:z0,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:oe(34),lineHeight:"1.3"},h2:{fontSize:oe(26),lineHeight:"1.35"},h3:{fontSize:oe(22),lineHeight:"1.4"},h4:{fontSize:oe(18),lineHeight:"1.45"},h5:{fontSize:oe(16),lineHeight:"1.5"},h6:{fontSize:oe(14),lineHeight:"1.5"}}},fontSizes:{xs:oe(12),sm:oe(14),md:oe(16),lg:oe(18),xl:oe(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:oe(2),sm:oe(4),md:oe(8),lg:oe(16),xl:oe(32)},spacing:{xs:oe(10),sm:oe(12),md:oe(16),lg:oe(20),xl:oe(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${oe(1)} ${oe(3)} rgba(0, 0, 0, 0.05), 0 ${oe(1)} ${oe(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${oe(1)} ${oe(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${oe(10)} ${oe(15)} ${oe(-5)}, rgba(0, 0, 0, 0.04) 0 ${oe(7)} ${oe(7)} ${oe(-5)}`,md:`0 ${oe(1)} ${oe(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${oe(20)} ${oe(25)} ${oe(-5)}, rgba(0, 0, 0, 0.04) 0 ${oe(10)} ${oe(10)} ${oe(-5)}`,lg:`0 ${oe(1)} ${oe(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${oe(28)} ${oe(23)} ${oe(-7)}, rgba(0, 0, 0, 0.04) 0 ${oe(12)} ${oe(12)} ${oe(-7)}`,xl:`0 ${oe(1)} ${oe(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${oe(36)} ${oe(28)} ${oe(-7)}, rgba(0, 0, 0, 0.04) 0 ${oe(17)} ${oe(17)} ${oe(-7)}`},other:{},components:{}};function M0(e){return e==="auto"||e==="dark"||e==="light"}function NT({key:e="mantine-color-scheme-value"}={}){let o;return{get:r=>{if(typeof window>"u")return r;try{const a=window.localStorage.getItem(e);return M0(a)?a:r}catch{return r}},set:r=>{try{window.localStorage.setItem(e,r)}catch(a){console.warn("[@mantine/core] Local storage color scheme manager was unable to save color scheme.",a)}},subscribe:r=>{o=a=>{a.storageArea===window.localStorage&&a.key===e&&M0(a.newValue)&&r(a.newValue)},window.addEventListener("storage",o)},unsubscribe:()=>{window.removeEventListener("storage",o)},clear:()=>{window.localStorage.removeItem(e)}}}const AT="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",O0="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function Oh(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function j0(e){if(!(e.primaryColor in e.colors))throw new Error(AT);if(typeof e.primaryShade=="object"&&(!Oh(e.primaryShade.dark)||!Oh(e.primaryShade.light)))throw new Error(O0);if(typeof e.primaryShade=="number"&&!Oh(e.primaryShade))throw new Error(O0)}function zT(e,o){if(!o)return j0(e),e;const r=Ip(e,o);return o.fontFamily&&!o.headings?.fontFamily&&(r.headings.fontFamily=o.fontFamily),j0(r),r}const tm=b.createContext(null),MT=()=>b.useContext(tm)||em;function cn(){const e=b.useContext(tm);if(!e)throw new Error("@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app");return e}function Rx({theme:e,children:o,inherit:r=!0}){const a=MT(),l=b.useMemo(()=>zT(r?a:em,e),[e,a,r]);return y.jsx(tm.Provider,{value:l,children:o})}Rx.displayName="@mantine/core/MantineThemeProvider";function OT(){const e=cn(),o=Kp(),r=At(e.breakpoints).reduce((a,l)=>{const c=e.breakpoints[l].includes("px"),u=fs(e.breakpoints[l]),f=c?`${u-.1}px`:du(u-.1),h=c?`${u}px`:du(u);return`${a}@media (max-width: ${f}) {.mantine-visible-from-${l} {display: none !important;}}@media (min-width: ${h}) {.mantine-hidden-from-${l} {display: none !important;}}`},"");return y.jsx("style",{"data-mantine-styles":"classes",nonce:o?.(),dangerouslySetInnerHTML:{__html:r}})}function jh(e){return Object.entries(e).map(([o,r])=>`${o}: ${r};`).join("")}function ts(e,o){return(Array.isArray(e)?e:[e]).reduce((a,l)=>`${l}{${a}}`,o)}function jT(e,o){const r=jh(e.variables),a=r?ts(o,r):"",l=jh(e.dark),c=jh(e.light),u=l?ts(o===":host"?`${o}([data-mantine-color-scheme="dark"])`:`${o}[data-mantine-color-scheme="dark"]`,l):"",f=c?ts(o===":host"?`${o}([data-mantine-color-scheme="light"])`:`${o}[data-mantine-color-scheme="light"]`,c):"";return`${a}${u}${f}`}function Mu({color:e,theme:o,autoContrast:r}){return(typeof r=="boolean"?r:o.autoContrast)&&ir({color:e||o.primaryColor,theme:o}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function B0(e,o){return Mu({color:e.colors[e.primaryColor][ds(e,o)],theme:e,autoContrast:null})}function Fc({theme:e,color:o,colorScheme:r,name:a=o,withColorValues:l=!0}){if(!e.colors[o])return{};if(r==="light"){const f=ds(e,"light"),h={[`--mantine-color-${a}-text`]:`var(--mantine-color-${a}-filled)`,[`--mantine-color-${a}-filled`]:`var(--mantine-color-${a}-${f})`,[`--mantine-color-${a}-filled-hover`]:`var(--mantine-color-${a}-${f===9?8:f+1})`,[`--mantine-color-${a}-light`]:Ci(e.colors[o][f],.1),[`--mantine-color-${a}-light-hover`]:Ci(e.colors[o][f],.12),[`--mantine-color-${a}-light-color`]:`var(--mantine-color-${a}-${f})`,[`--mantine-color-${a}-outline`]:`var(--mantine-color-${a}-${f})`,[`--mantine-color-${a}-outline-hover`]:Ci(e.colors[o][f],.05)};return l?{[`--mantine-color-${a}-0`]:e.colors[o][0],[`--mantine-color-${a}-1`]:e.colors[o][1],[`--mantine-color-${a}-2`]:e.colors[o][2],[`--mantine-color-${a}-3`]:e.colors[o][3],[`--mantine-color-${a}-4`]:e.colors[o][4],[`--mantine-color-${a}-5`]:e.colors[o][5],[`--mantine-color-${a}-6`]:e.colors[o][6],[`--mantine-color-${a}-7`]:e.colors[o][7],[`--mantine-color-${a}-8`]:e.colors[o][8],[`--mantine-color-${a}-9`]:e.colors[o][9],...h}:h}const c=ds(e,"dark"),u={[`--mantine-color-${a}-text`]:`var(--mantine-color-${a}-4)`,[`--mantine-color-${a}-filled`]:`var(--mantine-color-${a}-${c})`,[`--mantine-color-${a}-filled-hover`]:`var(--mantine-color-${a}-${c===9?8:c+1})`,[`--mantine-color-${a}-light`]:Ci(e.colors[o][Math.max(0,c-2)],.15),[`--mantine-color-${a}-light-hover`]:Ci(e.colors[o][Math.max(0,c-2)],.2),[`--mantine-color-${a}-light-color`]:`var(--mantine-color-${a}-${Math.max(c-5,0)})`,[`--mantine-color-${a}-outline`]:`var(--mantine-color-${a}-${Math.max(c-4,0)})`,[`--mantine-color-${a}-outline-hover`]:Ci(e.colors[o][Math.max(c-4,0)],.05)};return l?{[`--mantine-color-${a}-0`]:e.colors[o][0],[`--mantine-color-${a}-1`]:e.colors[o][1],[`--mantine-color-${a}-2`]:e.colors[o][2],[`--mantine-color-${a}-3`]:e.colors[o][3],[`--mantine-color-${a}-4`]:e.colors[o][4],[`--mantine-color-${a}-5`]:e.colors[o][5],[`--mantine-color-${a}-6`]:e.colors[o][6],[`--mantine-color-${a}-7`]:e.colors[o][7],[`--mantine-color-${a}-8`]:e.colors[o][8],[`--mantine-color-${a}-9`]:e.colors[o][9],...u}:u}function BT(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function Ei(e,o,r){At(o).forEach(a=>Object.assign(e,{[`--mantine-${r}-${a}`]:o[a]}))}const Tx=e=>{const o=ds(e,"light"),r=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:oe(e.defaultRadius),a={variables:{"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-color-scheme":"light dark","--mantine-webkit-font-smoothing":e.fontSmoothing?"antialiased":"unset","--mantine-moz-font-smoothing":e.fontSmoothing?"grayscale":"unset","--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":r,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-primary-color-contrast":B0(e,"light"),"--mantine-color-bright":"var(--mantine-color-black)","--mantine-color-text":e.black,"--mantine-color-body":e.white,"--mantine-color-error":"var(--mantine-color-red-6)","--mantine-color-placeholder":"var(--mantine-color-gray-5)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-${o})`,"--mantine-color-default":"var(--mantine-color-white)","--mantine-color-default-hover":"var(--mantine-color-gray-0)","--mantine-color-default-color":"var(--mantine-color-black)","--mantine-color-default-border":"var(--mantine-color-gray-4)","--mantine-color-dimmed":"var(--mantine-color-gray-6)","--mantine-color-disabled":"var(--mantine-color-gray-2)","--mantine-color-disabled-color":"var(--mantine-color-gray-5)","--mantine-color-disabled-border":"var(--mantine-color-gray-3)"},dark:{"--mantine-primary-color-contrast":B0(e,"dark"),"--mantine-color-bright":"var(--mantine-color-white)","--mantine-color-text":"var(--mantine-color-dark-0)","--mantine-color-body":"var(--mantine-color-dark-7)","--mantine-color-error":"var(--mantine-color-red-8)","--mantine-color-placeholder":"var(--mantine-color-dark-3)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-4)`,"--mantine-color-default":"var(--mantine-color-dark-6)","--mantine-color-default-hover":"var(--mantine-color-dark-5)","--mantine-color-default-color":"var(--mantine-color-white)","--mantine-color-default-border":"var(--mantine-color-dark-4)","--mantine-color-dimmed":"var(--mantine-color-dark-2)","--mantine-color-disabled":"var(--mantine-color-dark-6)","--mantine-color-disabled-color":"var(--mantine-color-dark-3)","--mantine-color-disabled-border":"var(--mantine-color-gray-6)"}};Ei(a.variables,e.breakpoints,"breakpoint"),Ei(a.variables,e.spacing,"spacing"),Ei(a.variables,e.fontSizes,"font-size"),Ei(a.variables,e.lineHeights,"line-height"),Ei(a.variables,e.shadows,"shadow"),Ei(a.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((c,u)=>{a.variables[`--mantine-primary-color-${u}`]=`var(--mantine-color-${e.primaryColor}-${u})`}),At(e.colors).forEach(c=>{const u=e.colors[c];if(BT(u)){Object.assign(a.light,Fc({theme:e,name:u.name,color:u.light,colorScheme:"light",withColorValues:!0})),Object.assign(a.dark,Fc({theme:e,name:u.name,color:u.dark,colorScheme:"dark",withColorValues:!0}));return}u.forEach((f,h)=>{a.variables[`--mantine-color-${c}-${h}`]=f}),Object.assign(a.light,Fc({theme:e,color:c,colorScheme:"light",withColorValues:!1})),Object.assign(a.dark,Fc({theme:e,color:c,colorScheme:"dark",withColorValues:!1}))});const l=e.headings.sizes;return At(l).forEach(c=>{a.variables[`--mantine-${c}-font-size`]=l[c].fontSize,a.variables[`--mantine-${c}-line-height`]=l[c].lineHeight,a.variables[`--mantine-${c}-font-weight`]=l[c].fontWeight||e.headings.fontWeight}),a};function $T({theme:e,generator:o}){const r=Tx(e),a=o?.(e);return a?Ip(r,a):r}const Bh=Tx(em);function LT(e){const o={variables:{},light:{},dark:{}};return At(e.variables).forEach(r=>{Bh.variables[r]!==e.variables[r]&&(o.variables[r]=e.variables[r])}),At(e.light).forEach(r=>{Bh.light[r]!==e.light[r]&&(o.light[r]=e.light[r])}),At(e.dark).forEach(r=>{Bh.dark[r]!==e.dark[r]&&(o.dark[r]=e.dark[r])}),o}function kT(e){return` +`)},AR=0,wi=[];function zR(e){var o=b.useRef([]),r=b.useRef([0,0]),a=b.useRef(),l=b.useState(AR++)[0],c=b.useState(fx)[0],u=b.useRef(e);b.useEffect(function(){u.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var C=W2([e.lockRef.current],(e.shards||[]).map(N0),!0).filter(Boolean);return C.forEach(function(R){return R.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),C.forEach(function(R){return R.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var f=b.useCallback(function(C,R){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!u.current.allowPinchZoom;var T=qc(C),z=r.current,A="deltaX"in C?C.deltaX:z[0]-T[0],N="deltaY"in C?C.deltaY:z[1]-T[1],B,M=C.target,$=Math.abs(A)>Math.abs(N)?"h":"v";if("touches"in C&&$==="h"&&M.type==="range")return!1;var L=window.getSelection(),H=L&&L.anchorNode,I=H?H===M||H.contains(M):!1;if(I)return!1;var Y=_0($,M);if(!Y)return!0;if(Y?B=$:(B=$==="v"?"h":"v",Y=_0($,M)),!Y)return!1;if(!a.current&&"changedTouches"in C&&(A||N)&&(a.current=B),!B)return!0;var X=a.current||B;return _R(X,R,C,X==="h"?A:N)},[]),h=b.useCallback(function(C){var R=C;if(!(!wi.length||wi[wi.length-1]!==c)){var T="deltaY"in R?D0(R):qc(R),z=o.current.filter(function(B){return B.name===R.type&&(B.target===R.target||R.target===B.shadowParent)&&DR(B.delta,T)})[0];if(z&&z.should){R.cancelable&&R.preventDefault();return}if(!z){var A=(u.current.shards||[]).map(N0).filter(Boolean).filter(function(B){return B.contains(R.target)}),N=A.length>0?f(R,A[0]):!u.current.noIsolation;N&&R.cancelable&&R.preventDefault()}}},[]),p=b.useCallback(function(C,R,T,z){var A={name:C,delta:R,target:T,should:z,shadowParent:MR(T)};o.current.push(A),setTimeout(function(){o.current=o.current.filter(function(N){return N!==A})},1)},[]),g=b.useCallback(function(C){r.current=qc(C),a.current=void 0},[]),v=b.useCallback(function(C){p(C.type,D0(C),C.target,f(C,e.lockRef.current))},[]),x=b.useCallback(function(C){p(C.type,qc(C),C.target,f(C,e.lockRef.current))},[]);b.useEffect(function(){return wi.push(c),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:x}),document.addEventListener("wheel",h,Si),document.addEventListener("touchmove",h,Si),document.addEventListener("touchstart",g,Si),function(){wi=wi.filter(function(C){return C!==c}),document.removeEventListener("wheel",h,Si),document.removeEventListener("touchmove",h,Si),document.removeEventListener("touchstart",g,Si)}},[]);var S=e.removeScrollBar,E=e.inert;return b.createElement(b.Fragment,null,E?b.createElement(c,{styles:NR(l)}):null,S?b.createElement(xR,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function MR(e){for(var o=null;e!==null;)e instanceof ShadowRoot&&(o=e.host,e=e.host),e=e.parentNode;return o}const OR=lR(ux,zR);var ki=b.forwardRef(function(e,o){return b.createElement(_u,To({},e,{ref:o,sideCar:OR}))});ki.classNames=_u.classNames;function At(e){return Object.keys(e)}function zh(e){return e&&typeof e=="object"&&!Array.isArray(e)}function Ip(e,o){const r={...e},a=o;return zh(e)&&zh(o)&&Object.keys(o).forEach(l=>{zh(a[l])&&l in e?r[l]=Ip(r[l],a[l]):r[l]=a[l]}),r}function jR(e){return e.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`)}function BR(e){return typeof e!="string"||!e.includes("var(--mantine-scale)")?e:e.match(/^calc\((.*?)\)$/)?.[1].split("*")[0].trim()}function us(e){const o=BR(e);return typeof o=="number"?o:typeof o=="string"?o.includes("calc")||o.includes("var")?o:o.includes("px")?Number(o.replace("px","")):o.includes("rem")?Number(o.replace("rem",""))*16:o.includes("em")?Number(o.replace("em",""))*16:Number(o):NaN}function A0(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function mx(e,{shouldScale:o=!1}={}){function r(a){if(a===0||a==="0")return`0${e}`;if(typeof a=="number"){const l=`${a/16}${e}`;return o?A0(l):l}if(typeof a=="string"){if(a===""||a.startsWith("calc(")||a.startsWith("clamp(")||a.includes("rgba("))return a;if(a.includes(","))return a.split(",").map(c=>r(c)).join(",");if(a.includes(" "))return a.split(" ").map(c=>r(c)).join(" ");const l=a.replace("px","");if(!Number.isNaN(Number(l))){const c=`${Number(l)/16}${e}`;return o?A0(c):c}}return a}return r}const oe=mx("rem",{shouldScale:!0}),du=mx("em");function xs(e){return Object.keys(e).reduce((o,r)=>(e[r]!==void 0&&(o[r]=e[r]),o),{})}function gx(e){if(typeof e=="number")return!0;if(typeof e=="string"){if(e.startsWith("calc(")||e.startsWith("var(")||e.includes(" ")&&e.trim()!=="")return!0;const o=/^[+-]?[0-9]+(\.[0-9]+)?(px|em|rem|ex|ch|lh|rlh|vw|vh|vmin|vmax|vb|vi|svw|svh|lvw|lvh|dvw|dvh|cm|mm|in|pt|pc|q|cqw|cqh|cqi|cqb|cqmin|cqmax|%)?$/;return e.trim().split(/\s+/).every(a=>o.test(a))}return!1}function ar(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==b.Fragment:!1}function zo(e){const o=b.createContext(null);return[({children:l,value:c})=>y.jsx(o.Provider,{value:c,children:l}),()=>{const l=b.useContext(o);if(l===null)throw new Error(e);return l}]}function Ss(e=null){const o=b.createContext(e);return[({children:l,value:c})=>y.jsx(o.Provider,{value:c,children:l}),()=>b.useContext(o)]}function hu(e,o){let r=e;for(;(r=r.parentElement)&&!r.matches(o););return r}function $R(e,o,r){for(let a=e-1;a>=0;a-=1)if(!o[a].disabled)return a;if(r){for(let a=o.length-1;a>-1;a-=1)if(!o[a].disabled)return a}return e}function LR(e,o,r){for(let a=e+1;a{r?.(f);const h=Array.from(hu(f.currentTarget,e)?.querySelectorAll(o)||[]).filter(x=>kR(f.currentTarget,x,e)),p=h.findIndex(x=>f.currentTarget===x),g=LR(p,h,a),v=$R(p,h,a);switch(f.key){case"ArrowRight":break;case"ArrowLeft":break;case"ArrowUp":{f.stopPropagation(),f.preventDefault(),h[v].focus(),l&&h[v].click();break}case"ArrowDown":{f.stopPropagation(),f.preventDefault(),h[g].focus(),l&&h[g].click();break}case"Home":{f.stopPropagation(),f.preventDefault(),!h[0].disabled&&h[0].focus();break}case"End":{f.stopPropagation(),f.preventDefault();const x=h.length-1;!h[x].disabled&&h[x].focus();break}}}}const HR={app:100,modal:200,popover:300,overlay:400,max:9999};function vo(e){return HR[e]}const hp=()=>{};function UR(e,o={active:!0}){return typeof e!="function"||!o.active?o.onKeyDown||hp:r=>{r.key==="Escape"&&(e(r),o.onTrigger?.())}}function qe(e,o="size",r=!0){if(e!==void 0)return gx(e)?r?oe(e):e:`var(--${o}-${e})`}function sn(e){return qe(e,"mantine-spacing")}function kt(e){return e===void 0?"var(--mantine-radius-default)":qe(e,"mantine-radius")}function nn(e){return qe(e,"mantine-font-size")}function PR(e){return qe(e,"mantine-line-height",!1)}function Fp(e){if(e)return qe(e,"mantine-shadow",!1)}function Cn(e,o){return r=>{e?.(r),o?.(r)}}function Zp(e,o){return e in o?us(o[e]):us(e)}function pp(e,o){const r=e.map(a=>({value:a,px:Zp(a,o)}));return r.sort((a,l)=>a.px-l.px),r}function Oi(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function VR(e,o,r){return r?Array.from(hu(r,o)?.querySelectorAll(e)||[]).findIndex(a=>a===r):null}function lu(e,o,r){return o===void 0&&r===void 0?e:o!==void 0&&r===void 0?Math.max(e,o):Math.min(o===void 0&&r!==void 0?e:Math.max(e,o),r)}function pu(e="mantine-"){return`${e}${Math.random().toString(36).slice(2,11)}`}function YR(e,o){if(e===o||Number.isNaN(e)&&Number.isNaN(o))return!0;if(!(e instanceof Object)||!(o instanceof Object))return!1;const r=Object.keys(e),{length:a}=r;if(a!==Object.keys(o).length)return!1;for(let l=0;l{o.current=e}),b.useMemo(()=>(...r)=>o.current?.(...r),[])}function Du(e,o){const r=typeof o=="number"?o:o.delay,a=typeof o=="number"?!1:o.flushOnUnmount,l=typeof o=="number"?!1:o.leading,c=ba(e),u=b.useRef(0),f=b.useRef(()=>{}),h=b.useRef(l),p=Object.assign(b.useCallback((...g)=>{if(window.clearTimeout(u.current),l&&h.current){h.current=!1,c(...g);return}const v=()=>{u.current!==0&&(u.current=0,h.current=!0,c(...g))};f.current=v,p.flush=v,u.current=window.setTimeout(v,r),h.current=!1},[c,r,l]),{flush:f.current});return b.useEffect(()=>()=>{window.clearTimeout(u.current),a&&p.flush()},[p,a]),p}const z0=["mousedown","touchstart"];function GR(e,o,r){const a=b.useRef(null);return b.useEffect(()=>{const l=c=>{const{target:u}=c??{};if(Array.isArray(r)){const f=u?.hasAttribute("data-ignore-outside-clicks")||!document.body.contains(u)&&u.tagName!=="HTML";r.every(p=>!!p&&!c.composedPath().includes(p))&&!f&&e()}else a.current&&!a.current.contains(u)&&e()};return(o||z0).forEach(c=>document.addEventListener(c,l)),()=>{(o||z0).forEach(c=>document.removeEventListener(c,l))}},[a,e,r]),a}function XR(e,o){try{return e.addEventListener("change",o),()=>e.removeEventListener("change",o)}catch{return e.addListener(o),()=>e.removeListener(o)}}function qR(e,o){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function Qp(e,o,{getInitialValueInEffect:r}={getInitialValueInEffect:!0}){const[a,l]=b.useState(r?o:qR(e)),c=b.useRef(null);return b.useEffect(()=>{if("matchMedia"in window)return c.current=window.matchMedia(e),l(c.current.matches),XR(c.current,u=>l(u.matches))},[e]),a}const Yi=typeof document<"u"?b.useLayoutEffect:b.useEffect;function rr(e,o){const r=b.useRef(!1);b.useEffect(()=>()=>{r.current=!1},[]),b.useEffect(()=>{if(r.current)return e();r.current=!0},o)}function yx({opened:e,shouldReturnFocus:o=!0}){const r=b.useRef(null),a=()=>{r.current&&"focus"in r.current&&typeof r.current.focus=="function"&&r.current?.focus({preventScroll:!0})};return rr(()=>{let l=-1;const c=u=>{u.key==="Tab"&&window.clearTimeout(l)};return document.addEventListener("keydown",c),e?r.current=document.activeElement:o&&(l=window.setTimeout(a,10)),()=>{window.clearTimeout(l),document.removeEventListener("keydown",c)}},[e,o]),a}const IR=/input|select|textarea|button|object/,bx="a, input, select, textarea, button, object, [tabindex]";function FR(e){return e.style.display==="none"}function ZR(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let r=e;for(;r&&!(r===document.body||r.nodeType===11);){if(FR(r))return!1;r=r.parentNode}return!0}function xx(e){let o=e.getAttribute("tabindex");return o===null&&(o=void 0),parseInt(o,10)}function mp(e){const o=e.nodeName.toLowerCase(),r=!Number.isNaN(xx(e));return(IR.test(o)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||r)&&ZR(e)}function Sx(e){const o=xx(e);return(Number.isNaN(o)||o>=0)&&mp(e)}function QR(e){return Array.from(e.querySelectorAll(bx)).filter(Sx)}function KR(e,o){const r=QR(e);if(!r.length){o.preventDefault();return}const a=r[o.shiftKey?0:r.length-1],l=e.getRootNode();let c=a===l.activeElement||e===l.activeElement;const u=l.activeElement;if(u.tagName==="INPUT"&&u.getAttribute("type")==="radio"&&(c=r.filter(g=>g.getAttribute("type")==="radio"&&g.getAttribute("name")===u.getAttribute("name")).includes(a)),!c)return;o.preventDefault();const h=r[o.shiftKey?r.length-1:0];h&&h.focus()}function WR(e=!0){const o=b.useRef(null),r=l=>{let c=l.querySelector("[data-autofocus]");if(!c){const u=Array.from(l.querySelectorAll(bx));c=u.find(Sx)||u.find(mp)||null,!c&&mp(l)&&(c=l)}c&&c.focus({preventScroll:!0})},a=b.useCallback(l=>{e&&l!==null&&o.current!==l&&(l?(setTimeout(()=>{l.getRootNode()&&r(l)}),o.current=l):o.current=null)},[e]);return b.useEffect(()=>{if(!e)return;o.current&&setTimeout(()=>r(o.current));const l=c=>{c.key==="Tab"&&o.current&&KR(o.current,c)};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[e]),a}const JR=e=>(e+1)%1e6;function eT(){const[,e]=b.useReducer(JR,0);return e}const tT=Ge.useId||(()=>{});function nT(){const e=tT();return e?`mantine-${e.replace(/:/g,"")}`:""}function Jn(e){const o=nT(),[r,a]=b.useState(o);return Yi(()=>{a(pu())},[]),typeof e=="string"?e:typeof window>"u"?o:r}function wx(e,o,r){b.useEffect(()=>(window.addEventListener(e,o,r),()=>window.removeEventListener(e,o,r)),[e,o])}function mu(e,o){if(typeof e=="function")return e(o);typeof e=="object"&&e!==null&&"current"in e&&(e.current=o)}function Cx(...e){const o=new Map;return r=>{if(e.forEach(a=>{const l=mu(a,r);l&&o.set(a,l)}),o.size>0)return()=>{e.forEach(a=>{const l=o.get(a);l?l():mu(a,null)}),o.clear()}}}function Mt(...e){return b.useCallback(Cx(...e),e)}function Wn({value:e,defaultValue:o,finalValue:r,onChange:a=()=>{}}){const[l,c]=b.useState(o!==void 0?o:r),u=(f,...h)=>{c(f),a?.(f,...h)};return e!==void 0?[e,a,!0]:[l,u,!1]}function Nu(e,o){return Qp("(prefers-reduced-motion: reduce)",e,o)}function oT(e,o){if(!e||!o)return!1;if(e===o)return!0;if(e.length!==o.length)return!1;for(let r=0;r{c(p=>p||(r?.(),!0))},[r]),f=b.useCallback(()=>{c(p=>p&&(a?.(),!1))},[a]),h=b.useCallback(()=>{l?f():u()},[f,u,l]);return[l,{open:u,close:f,toggle:h}]}function lT(e,o,r={autoInvoke:!1}){const a=b.useRef(null),l=b.useCallback((...u)=>{a.current||(a.current=window.setTimeout(()=>{e(u),a.current=null},o))},[o]),c=b.useCallback(()=>{a.current&&(window.clearTimeout(a.current),a.current=null)},[]);return b.useEffect(()=>(r.autoInvoke&&l(),c),[c,l]),{start:l,clear:c}}function sT(e){const o=b.useRef(void 0);return b.useEffect(()=>{o.current=e},[e]),o.current}function cT(e,o,r){const a=b.useRef(null),l=b.useRef(null);return b.useEffect(()=>{const c=typeof r=="function"?r():r;return(c||l.current)&&(a.current=new MutationObserver(e),a.current.observe(c||l.current,o)),()=>{a.current?.disconnect()}},[e,o]),l}function uT(){const[e,o]=b.useState(!1);return b.useEffect(()=>o(!0),[]),e}var fT={};function dT(){return typeof process<"u"&&fT?"production":"development"}function Au(e){const o=Ge.version;return typeof Ge.version!="string"||o.startsWith("18.")?e?.ref:e?.props?.ref}function Ex(e){var o,r,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(o=0;o{Object.entries(r).forEach(([a,l])=>{o[a]?o[a]=zt(o[a],l):o[a]=l})}),o}function zu({theme:e,classNames:o,props:r,stylesCtx:a}){const c=(Array.isArray(o)?o:[o]).map(u=>typeof u=="function"?u(e,r,a):u||hT);return pT(c)}function gu({theme:e,styles:o,props:r,stylesCtx:a}){return(Array.isArray(o)?o:[o]).reduce((c,u)=>typeof u=="function"?{...c,...u(e,r,a)}:{...c,...u},{})}const Rx=b.createContext(null);function ir(){const e=b.useContext(Rx);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function mT(){return ir().cssVariablesResolver}function gT(){return ir().classNamesPrefix}function Kp(){return ir().getStyleNonce}function vT(){return ir().withStaticClasses}function yT(){return ir().headless}function bT(){return ir().stylesTransform?.sx}function xT(){return ir().stylesTransform?.styles}function Wp(){return ir().env||"default"}function ST(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function wT(e){let o=e.replace("#","");if(o.length===3){const u=o.split("");o=[u[0],u[0],u[1],u[1],u[2],u[2]].join("")}if(o.length===8){const u=parseInt(o.slice(6,8),16)/255;return{r:parseInt(o.slice(0,2),16),g:parseInt(o.slice(2,4),16),b:parseInt(o.slice(4,6),16),a:u}}const r=parseInt(o,16),a=r>>16&255,l=r>>8&255,c=r&255;return{r:a,g:l,b:c,a:1}}function CT(e){const[o,r,a,l]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:o,g:r,b:a,a:l||1}}function ET(e){const o=/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i,r=e.match(o);if(!r)return{r:0,g:0,b:0,a:1};const a=parseInt(r[1],10),l=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100,u=r[5]?parseFloat(r[5]):void 0,f=(1-Math.abs(2*c-1))*l,h=a/60,p=f*(1-Math.abs(h%2-1)),g=c-f/2;let v,x,S;return h>=0&&h<1?(v=f,x=p,S=0):h>=1&&h<2?(v=p,x=f,S=0):h>=2&&h<3?(v=0,x=f,S=p):h>=3&&h<4?(v=0,x=p,S=f):h>=4&&h<5?(v=p,x=0,S=f):(v=f,x=0,S=p),{r:Math.round((v+g)*255),g:Math.round((x+g)*255),b:Math.round((S+g)*255),a:u||1}}function Jp(e){return ST(e)?wT(e):e.startsWith("rgb")?CT(e):e.startsWith("hsl")?ET(e):{r:0,g:0,b:0,a:1}}function Ic(e,o){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${o*100}%)`;const{r,g:a,b:l,a:c}=Jp(e),u=1-o,f=h=>Math.round(h*u);return`rgba(${f(r)}, ${f(a)}, ${f(l)}, ${c})`}function fs(e,o){return typeof e.primaryShade=="number"?e.primaryShade:o==="dark"?e.primaryShade.dark:e.primaryShade.light}function Mh(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function RT(e){const o=e.match(/oklch\((.*?)%\s/);return o?parseFloat(o[1]):null}function TT(e){if(e.startsWith("oklch("))return(RT(e)||0)/100;const{r:o,g:r,b:a}=Jp(e),l=o/255,c=r/255,u=a/255,f=Mh(l),h=Mh(c),p=Mh(u);return .2126*f+.7152*h+.0722*p}function Jl(e,o=.179){return e.startsWith("var(")?!1:TT(e)>o}function lr({color:e,theme:o,colorScheme:r}){if(typeof e!="string")throw new Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof e}`);if(e==="bright")return{color:e,value:r==="dark"?o.white:o.black,shade:void 0,isThemeColor:!1,isLight:Jl(r==="dark"?o.white:o.black,o.luminanceThreshold),variable:"--mantine-color-bright"};if(e==="dimmed")return{color:e,value:r==="dark"?o.colors.dark[2]:o.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:Jl(r==="dark"?o.colors.dark[2]:o.colors.gray[6],o.luminanceThreshold),variable:"--mantine-color-dimmed"};if(e==="white"||e==="black")return{color:e,value:e==="white"?o.white:o.black,shade:void 0,isThemeColor:!1,isLight:Jl(e==="white"?o.white:o.black,o.luminanceThreshold),variable:`--mantine-color-${e}`};const[a,l]=e.split("."),c=l?Number(l):void 0,u=a in o.colors;if(u){const f=c!==void 0?o.colors[a][c]:o.colors[a][fs(o,r||"light")];return{color:a,value:f,shade:c,isThemeColor:u,isLight:Jl(f,o.luminanceThreshold),variable:l?`--mantine-color-${a}-${c}`:`--mantine-color-${a}-filled`}}return{color:e,value:e,isThemeColor:u,isLight:Jl(e,o.luminanceThreshold),shade:c,variable:void 0}}function Zt(e,o){const r=lr({color:e||o.primaryColor,theme:o});return r.variable?`var(${r.variable})`:e}function gp(e,o){const r={from:e?.from||o.defaultGradient.from,to:e?.to||o.defaultGradient.to,deg:e?.deg??o.defaultGradient.deg??0},a=Zt(r.from,o),l=Zt(r.to,o);return`linear-gradient(${r.deg}deg, ${a} 0%, ${l} 100%)`}function Co(e,o){if(typeof e!="string"||o>1||o<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(")){const c=(1-o)*100;return`color-mix(in srgb, ${e}, transparent ${c}%)`}if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${o})`):e.replace(")",` / ${o})`);const{r,g:a,b:l}=Jp(e);return`rgba(${r}, ${a}, ${l}, ${o})`}const Ci=Co,_T=({color:e,theme:o,variant:r,gradient:a,autoContrast:l})=>{const c=lr({color:e,theme:o}),u=typeof l=="boolean"?l:o.autoContrast;if(r==="none")return{background:"transparent",hover:"transparent",color:"inherit",border:"none"};if(r==="filled"){const f=u&&c.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return c.isThemeColor?c.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:f,border:`${oe(1)} solid transparent`}:{background:`var(--mantine-color-${c.color}-${c.shade})`,hover:`var(--mantine-color-${c.color}-${c.shade===9?8:c.shade+1})`,color:f,border:`${oe(1)} solid transparent`}:{background:e,hover:Ic(e,.1),color:f,border:`${oe(1)} solid transparent`}}if(r==="light"){if(c.isThemeColor){if(c.shade===void 0)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${oe(1)} solid transparent`};const f=o.colors[c.color][c.shade];return{background:Co(f,.1),hover:Co(f,.12),color:`var(--mantine-color-${c.color}-${Math.min(c.shade,6)})`,border:`${oe(1)} solid transparent`}}return{background:Co(e,.1),hover:Co(e,.12),color:e,border:`${oe(1)} solid transparent`}}if(r==="outline")return c.isThemeColor?c.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${oe(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:Co(o.colors[c.color][c.shade],.05),color:`var(--mantine-color-${c.color}-${c.shade})`,border:`${oe(1)} solid var(--mantine-color-${c.color}-${c.shade})`}:{background:"transparent",hover:Co(e,.05),color:e,border:`${oe(1)} solid ${e}`};if(r==="subtle"){if(c.isThemeColor){if(c.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${oe(1)} solid transparent`};const f=o.colors[c.color][c.shade];return{background:"transparent",hover:Co(f,.12),color:`var(--mantine-color-${c.color}-${Math.min(c.shade,6)})`,border:`${oe(1)} solid transparent`}}return{background:"transparent",hover:Co(e,.12),color:e,border:`${oe(1)} solid transparent`}}return r==="transparent"?c.isThemeColor?c.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${oe(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${c.color}-${Math.min(c.shade,6)})`,border:`${oe(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${oe(1)} solid transparent`}:r==="white"?c.isThemeColor?c.shade===void 0?{background:"var(--mantine-color-white)",hover:Ic(o.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${oe(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Ic(o.white,.01),color:`var(--mantine-color-${c.color}-${c.shade})`,border:`${oe(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Ic(o.white,.01),color:e,border:`${oe(1)} solid transparent`}:r==="gradient"?{background:gp(a,o),hover:gp(a,o),color:"var(--mantine-color-white)",border:"none"}:r==="default"?{background:"var(--mantine-color-default)",hover:"var(--mantine-color-default-hover)",color:"var(--mantine-color-default-color)",border:`${oe(1)} solid var(--mantine-color-default-border)`}:{}},DT={dark:["#C9C9C9","#b8b8b8","#828282","#696969","#424242","#3b3b3b","#2e2e2e","#242424","#1f1f1f","#141414"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},M0="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",em={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:DT,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:_T,autoContrast:!1,luminanceThreshold:.3,fontFamily:M0,fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",respectReducedMotion:!1,cursorType:"default",defaultGradient:{from:"blue",to:"cyan",deg:45},defaultRadius:"sm",activeClassName:"mantine-active",focusClassName:"",headings:{fontFamily:M0,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:oe(34),lineHeight:"1.3"},h2:{fontSize:oe(26),lineHeight:"1.35"},h3:{fontSize:oe(22),lineHeight:"1.4"},h4:{fontSize:oe(18),lineHeight:"1.45"},h5:{fontSize:oe(16),lineHeight:"1.5"},h6:{fontSize:oe(14),lineHeight:"1.5"}}},fontSizes:{xs:oe(12),sm:oe(14),md:oe(16),lg:oe(18),xl:oe(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:oe(2),sm:oe(4),md:oe(8),lg:oe(16),xl:oe(32)},spacing:{xs:oe(10),sm:oe(12),md:oe(16),lg:oe(20),xl:oe(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${oe(1)} ${oe(3)} rgba(0, 0, 0, 0.05), 0 ${oe(1)} ${oe(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${oe(1)} ${oe(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${oe(10)} ${oe(15)} ${oe(-5)}, rgba(0, 0, 0, 0.04) 0 ${oe(7)} ${oe(7)} ${oe(-5)}`,md:`0 ${oe(1)} ${oe(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${oe(20)} ${oe(25)} ${oe(-5)}, rgba(0, 0, 0, 0.04) 0 ${oe(10)} ${oe(10)} ${oe(-5)}`,lg:`0 ${oe(1)} ${oe(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${oe(28)} ${oe(23)} ${oe(-7)}, rgba(0, 0, 0, 0.04) 0 ${oe(12)} ${oe(12)} ${oe(-7)}`,xl:`0 ${oe(1)} ${oe(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${oe(36)} ${oe(28)} ${oe(-7)}, rgba(0, 0, 0, 0.04) 0 ${oe(17)} ${oe(17)} ${oe(-7)}`},other:{},components:{}};function O0(e){return e==="auto"||e==="dark"||e==="light"}function NT({key:e="mantine-color-scheme-value"}={}){let o;return{get:r=>{if(typeof window>"u")return r;try{const a=window.localStorage.getItem(e);return O0(a)?a:r}catch{return r}},set:r=>{try{window.localStorage.setItem(e,r)}catch(a){console.warn("[@mantine/core] Local storage color scheme manager was unable to save color scheme.",a)}},subscribe:r=>{o=a=>{a.storageArea===window.localStorage&&a.key===e&&O0(a.newValue)&&r(a.newValue)},window.addEventListener("storage",o)},unsubscribe:()=>{window.removeEventListener("storage",o)},clear:()=>{window.localStorage.removeItem(e)}}}const AT="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",j0="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function Oh(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function B0(e){if(!(e.primaryColor in e.colors))throw new Error(AT);if(typeof e.primaryShade=="object"&&(!Oh(e.primaryShade.dark)||!Oh(e.primaryShade.light)))throw new Error(j0);if(typeof e.primaryShade=="number"&&!Oh(e.primaryShade))throw new Error(j0)}function zT(e,o){if(!o)return B0(e),e;const r=Ip(e,o);return o.fontFamily&&!o.headings?.fontFamily&&(r.headings.fontFamily=o.fontFamily),B0(r),r}const tm=b.createContext(null),MT=()=>b.useContext(tm)||em;function cn(){const e=b.useContext(tm);if(!e)throw new Error("@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app");return e}function Tx({theme:e,children:o,inherit:r=!0}){const a=MT(),l=b.useMemo(()=>zT(r?a:em,e),[e,a,r]);return y.jsx(tm.Provider,{value:l,children:o})}Tx.displayName="@mantine/core/MantineThemeProvider";function OT(){const e=cn(),o=Kp(),r=At(e.breakpoints).reduce((a,l)=>{const c=e.breakpoints[l].includes("px"),u=us(e.breakpoints[l]),f=c?`${u-.1}px`:du(u-.1),h=c?`${u}px`:du(u);return`${a}@media (max-width: ${f}) {.mantine-visible-from-${l} {display: none !important;}}@media (min-width: ${h}) {.mantine-hidden-from-${l} {display: none !important;}}`},"");return y.jsx("style",{"data-mantine-styles":"classes",nonce:o?.(),dangerouslySetInnerHTML:{__html:r}})}function jh(e){return Object.entries(e).map(([o,r])=>`${o}: ${r};`).join("")}function es(e,o){return(Array.isArray(e)?e:[e]).reduce((a,l)=>`${l}{${a}}`,o)}function jT(e,o){const r=jh(e.variables),a=r?es(o,r):"",l=jh(e.dark),c=jh(e.light),u=l?es(o===":host"?`${o}([data-mantine-color-scheme="dark"])`:`${o}[data-mantine-color-scheme="dark"]`,l):"",f=c?es(o===":host"?`${o}([data-mantine-color-scheme="light"])`:`${o}[data-mantine-color-scheme="light"]`,c):"";return`${a}${u}${f}`}function Mu({color:e,theme:o,autoContrast:r}){return(typeof r=="boolean"?r:o.autoContrast)&&lr({color:e||o.primaryColor,theme:o}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function $0(e,o){return Mu({color:e.colors[e.primaryColor][fs(e,o)],theme:e,autoContrast:null})}function Fc({theme:e,color:o,colorScheme:r,name:a=o,withColorValues:l=!0}){if(!e.colors[o])return{};if(r==="light"){const f=fs(e,"light"),h={[`--mantine-color-${a}-text`]:`var(--mantine-color-${a}-filled)`,[`--mantine-color-${a}-filled`]:`var(--mantine-color-${a}-${f})`,[`--mantine-color-${a}-filled-hover`]:`var(--mantine-color-${a}-${f===9?8:f+1})`,[`--mantine-color-${a}-light`]:Ci(e.colors[o][f],.1),[`--mantine-color-${a}-light-hover`]:Ci(e.colors[o][f],.12),[`--mantine-color-${a}-light-color`]:`var(--mantine-color-${a}-${f})`,[`--mantine-color-${a}-outline`]:`var(--mantine-color-${a}-${f})`,[`--mantine-color-${a}-outline-hover`]:Ci(e.colors[o][f],.05)};return l?{[`--mantine-color-${a}-0`]:e.colors[o][0],[`--mantine-color-${a}-1`]:e.colors[o][1],[`--mantine-color-${a}-2`]:e.colors[o][2],[`--mantine-color-${a}-3`]:e.colors[o][3],[`--mantine-color-${a}-4`]:e.colors[o][4],[`--mantine-color-${a}-5`]:e.colors[o][5],[`--mantine-color-${a}-6`]:e.colors[o][6],[`--mantine-color-${a}-7`]:e.colors[o][7],[`--mantine-color-${a}-8`]:e.colors[o][8],[`--mantine-color-${a}-9`]:e.colors[o][9],...h}:h}const c=fs(e,"dark"),u={[`--mantine-color-${a}-text`]:`var(--mantine-color-${a}-4)`,[`--mantine-color-${a}-filled`]:`var(--mantine-color-${a}-${c})`,[`--mantine-color-${a}-filled-hover`]:`var(--mantine-color-${a}-${c===9?8:c+1})`,[`--mantine-color-${a}-light`]:Ci(e.colors[o][Math.max(0,c-2)],.15),[`--mantine-color-${a}-light-hover`]:Ci(e.colors[o][Math.max(0,c-2)],.2),[`--mantine-color-${a}-light-color`]:`var(--mantine-color-${a}-${Math.max(c-5,0)})`,[`--mantine-color-${a}-outline`]:`var(--mantine-color-${a}-${Math.max(c-4,0)})`,[`--mantine-color-${a}-outline-hover`]:Ci(e.colors[o][Math.max(c-4,0)],.05)};return l?{[`--mantine-color-${a}-0`]:e.colors[o][0],[`--mantine-color-${a}-1`]:e.colors[o][1],[`--mantine-color-${a}-2`]:e.colors[o][2],[`--mantine-color-${a}-3`]:e.colors[o][3],[`--mantine-color-${a}-4`]:e.colors[o][4],[`--mantine-color-${a}-5`]:e.colors[o][5],[`--mantine-color-${a}-6`]:e.colors[o][6],[`--mantine-color-${a}-7`]:e.colors[o][7],[`--mantine-color-${a}-8`]:e.colors[o][8],[`--mantine-color-${a}-9`]:e.colors[o][9],...u}:u}function BT(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function Ei(e,o,r){At(o).forEach(a=>Object.assign(e,{[`--mantine-${r}-${a}`]:o[a]}))}const _x=e=>{const o=fs(e,"light"),r=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:oe(e.defaultRadius),a={variables:{"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-color-scheme":"light dark","--mantine-webkit-font-smoothing":e.fontSmoothing?"antialiased":"unset","--mantine-moz-font-smoothing":e.fontSmoothing?"grayscale":"unset","--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":r,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-primary-color-contrast":$0(e,"light"),"--mantine-color-bright":"var(--mantine-color-black)","--mantine-color-text":e.black,"--mantine-color-body":e.white,"--mantine-color-error":"var(--mantine-color-red-6)","--mantine-color-placeholder":"var(--mantine-color-gray-5)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-${o})`,"--mantine-color-default":"var(--mantine-color-white)","--mantine-color-default-hover":"var(--mantine-color-gray-0)","--mantine-color-default-color":"var(--mantine-color-black)","--mantine-color-default-border":"var(--mantine-color-gray-4)","--mantine-color-dimmed":"var(--mantine-color-gray-6)","--mantine-color-disabled":"var(--mantine-color-gray-2)","--mantine-color-disabled-color":"var(--mantine-color-gray-5)","--mantine-color-disabled-border":"var(--mantine-color-gray-3)"},dark:{"--mantine-primary-color-contrast":$0(e,"dark"),"--mantine-color-bright":"var(--mantine-color-white)","--mantine-color-text":"var(--mantine-color-dark-0)","--mantine-color-body":"var(--mantine-color-dark-7)","--mantine-color-error":"var(--mantine-color-red-8)","--mantine-color-placeholder":"var(--mantine-color-dark-3)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-4)`,"--mantine-color-default":"var(--mantine-color-dark-6)","--mantine-color-default-hover":"var(--mantine-color-dark-5)","--mantine-color-default-color":"var(--mantine-color-white)","--mantine-color-default-border":"var(--mantine-color-dark-4)","--mantine-color-dimmed":"var(--mantine-color-dark-2)","--mantine-color-disabled":"var(--mantine-color-dark-6)","--mantine-color-disabled-color":"var(--mantine-color-dark-3)","--mantine-color-disabled-border":"var(--mantine-color-gray-6)"}};Ei(a.variables,e.breakpoints,"breakpoint"),Ei(a.variables,e.spacing,"spacing"),Ei(a.variables,e.fontSizes,"font-size"),Ei(a.variables,e.lineHeights,"line-height"),Ei(a.variables,e.shadows,"shadow"),Ei(a.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((c,u)=>{a.variables[`--mantine-primary-color-${u}`]=`var(--mantine-color-${e.primaryColor}-${u})`}),At(e.colors).forEach(c=>{const u=e.colors[c];if(BT(u)){Object.assign(a.light,Fc({theme:e,name:u.name,color:u.light,colorScheme:"light",withColorValues:!0})),Object.assign(a.dark,Fc({theme:e,name:u.name,color:u.dark,colorScheme:"dark",withColorValues:!0}));return}u.forEach((f,h)=>{a.variables[`--mantine-color-${c}-${h}`]=f}),Object.assign(a.light,Fc({theme:e,color:c,colorScheme:"light",withColorValues:!1})),Object.assign(a.dark,Fc({theme:e,color:c,colorScheme:"dark",withColorValues:!1}))});const l=e.headings.sizes;return At(l).forEach(c=>{a.variables[`--mantine-${c}-font-size`]=l[c].fontSize,a.variables[`--mantine-${c}-line-height`]=l[c].lineHeight,a.variables[`--mantine-${c}-font-weight`]=l[c].fontWeight||e.headings.fontWeight}),a};function $T({theme:e,generator:o}){const r=_x(e),a=o?.(e);return a?Ip(r,a):r}const Bh=_x(em);function LT(e){const o={variables:{},light:{},dark:{}};return At(e.variables).forEach(r=>{Bh.variables[r]!==e.variables[r]&&(o.variables[r]=e.variables[r])}),At(e.light).forEach(r=>{Bh.light[r]!==e.light[r]&&(o.light[r]=e.light[r])}),At(e.dark).forEach(r=>{Bh.dark[r]!==e.dark[r]&&(o.dark[r]=e.dark[r])}),o}function kT(e){return` ${e}[data-mantine-color-scheme="dark"] { --mantine-color-scheme: dark; } ${e}[data-mantine-color-scheme="light"] { --mantine-color-scheme: light; } -`}function _x({cssVariablesSelector:e,deduplicateCssVariables:o}){const r=cn(),a=Kp(),l=mT(),c=$T({theme:r,generator:l}),u=e===":root"&&o,f=u?LT(c):c,h=jT(f,e);return h?y.jsx("style",{"data-mantine-styles":!0,nonce:a?.(),dangerouslySetInnerHTML:{__html:`${h}${u?"":kT(e)}`}}):null}_x.displayName="@mantine/CssVariables";function Ri(e,o){const r=typeof window<"u"&&"matchMedia"in window&&window.matchMedia("(prefers-color-scheme: dark)")?.matches,a=e!=="auto"?e:r?"dark":"light";o()?.setAttribute("data-mantine-color-scheme",a)}function HT({manager:e,defaultColorScheme:o,getRootElement:r,forceColorScheme:a}){const l=b.useRef(null),[c,u]=b.useState(()=>e.get(o)),f=a||c,h=b.useCallback(g=>{a||(Ri(g,r),u(g),e.set(g))},[e.set,f,a]),p=b.useCallback(()=>{u(o),Ri(o,r),e.clear()},[e.clear,o]);return b.useEffect(()=>(e.subscribe(h),e.unsubscribe),[e.subscribe,e.unsubscribe]),Gi(()=>{Ri(e.get(o),r)},[]),b.useEffect(()=>{if(a)return Ri(a,r),()=>{};a===void 0&&Ri(c,r),typeof window<"u"&&"matchMedia"in window&&(l.current=window.matchMedia("(prefers-color-scheme: dark)"));const g=v=>{c==="auto"&&Ri(v.matches?"dark":"light",r)};return l.current?.addEventListener("change",g),()=>l.current?.removeEventListener("change",g)},[c,a]),{colorScheme:f,setColorScheme:h,clearColorScheme:p}}function UT({respectReducedMotion:e,getRootElement:o}){Gi(()=>{e&&o()?.setAttribute("data-respect-reduced-motion","true")},[e])}function Dx({theme:e,children:o,getStyleNonce:r,withStaticClasses:a=!0,withGlobalClasses:l=!0,deduplicateCssVariables:c=!0,withCssVariables:u=!0,cssVariablesSelector:f=":root",classNamesPrefix:h="mantine",colorSchemeManager:p=NT(),defaultColorScheme:g="light",getRootElement:v=()=>document.documentElement,cssVariablesResolver:x,forceColorScheme:S,stylesTransform:E,env:C}){const{colorScheme:R,setColorScheme:T,clearColorScheme:z}=HT({defaultColorScheme:g,forceColorScheme:S,manager:p,getRootElement:v});return UT({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:v}),y.jsx(Ex.Provider,{value:{colorScheme:R,setColorScheme:T,clearColorScheme:z,getRootElement:v,classNamesPrefix:h,getStyleNonce:r,cssVariablesResolver:x,cssVariablesSelector:f,withStaticClasses:a,stylesTransform:E,env:C},children:y.jsxs(Rx,{theme:e,children:[u&&y.jsx(_x,{cssVariablesSelector:f,deduplicateCssVariables:c}),l&&y.jsx(OT,{}),o]})})}Dx.displayName="@mantine/core/MantineProvider";function Xi({classNames:e,styles:o,props:r,stylesCtx:a}){const l=cn();return{resolvedClassNames:zu({theme:l,classNames:e,props:r,stylesCtx:a||void 0}),resolvedStyles:gu({theme:l,styles:o,props:r,stylesCtx:a||void 0})}}const PT={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function VT({theme:e,options:o,unstyled:r}){return zt(o?.focusable&&!r&&(e.focusClassName||PT[e.focusRing]),o?.active&&!r&&e.activeClassName)}function YT({selector:e,stylesCtx:o,options:r,props:a,theme:l}){return zu({theme:l,classNames:r?.classNames,props:r?.props||a,stylesCtx:o})[e]}function $0({selector:e,stylesCtx:o,theme:r,classNames:a,props:l}){return zu({theme:r,classNames:a,props:l,stylesCtx:o})[e]}function GT({rootSelector:e,selector:o,className:r}){return e===o?r:void 0}function XT({selector:e,classes:o,unstyled:r}){return r?void 0:o[e]}function qT({themeName:e,classNamesPrefix:o,selector:r,withStaticClass:a}){return a===!1?[]:e.map(l=>`${o}-${l}-${r}`)}function IT({themeName:e,theme:o,selector:r,props:a,stylesCtx:l}){return e.map(c=>zu({theme:o,classNames:o.components[c]?.classNames,props:a,stylesCtx:l})?.[r])}function FT({options:e,classes:o,selector:r,unstyled:a}){return e?.variant&&!a?o[`${r}--${e.variant}`]:void 0}function ZT({theme:e,options:o,themeName:r,selector:a,classNamesPrefix:l,classNames:c,classes:u,unstyled:f,className:h,rootSelector:p,props:g,stylesCtx:v,withStaticClasses:x,headless:S,transformedStyles:E}){return zt(VT({theme:e,options:o,unstyled:f||S}),IT({theme:e,themeName:r,selector:a,props:g,stylesCtx:v}),FT({options:o,classes:u,selector:a,unstyled:f}),$0({selector:a,stylesCtx:v,theme:e,classNames:c,props:g}),$0({selector:a,stylesCtx:v,theme:e,classNames:E,props:g}),YT({selector:a,stylesCtx:v,options:o,props:g,theme:e}),GT({rootSelector:p,selector:a,className:h}),XT({selector:a,classes:u,unstyled:f||S}),x&&!S&&qT({themeName:r,classNamesPrefix:l,selector:a,withStaticClass:o?.withStaticClass}),o?.className)}function QT({theme:e,themeName:o,props:r,stylesCtx:a,selector:l}){return o.map(c=>gu({theme:e,styles:e.components[c]?.styles,props:r,stylesCtx:a})[l]).reduce((c,u)=>({...c,...u}),{})}function vp({style:e,theme:o}){return Array.isArray(e)?[...e].reduce((r,a)=>({...r,...vp({style:a,theme:o})}),{}):typeof e=="function"?e(o):e??{}}function KT(e){return e.reduce((o,r)=>(r&&Object.keys(r).forEach(a=>{o[a]={...o[a],...xs(r[a])}}),o),{})}function WT({vars:e,varsResolver:o,theme:r,props:a,stylesCtx:l,selector:c,themeName:u,headless:f}){return KT([f?{}:o?.(r,a,l),...u.map(h=>r.components?.[h]?.vars?.(r,a,l)),e?.(r,a,l)])?.[c]}function JT({theme:e,themeName:o,selector:r,options:a,props:l,stylesCtx:c,rootSelector:u,styles:f,style:h,vars:p,varsResolver:g,headless:v,withStylesTransform:x}){return{...!x&&QT({theme:e,themeName:o,props:l,stylesCtx:c,selector:r}),...!x&&gu({theme:e,styles:f,props:l,stylesCtx:c})[r],...!x&&gu({theme:e,styles:a?.styles,props:a?.props||l,stylesCtx:c})[r],...WT({theme:e,props:l,stylesCtx:c,vars:p,varsResolver:g,selector:r,themeName:o,headless:v}),...u===r?vp({style:h,theme:e}):null,...vp({style:a?.style,theme:e})}}function e_({props:e,stylesCtx:o,themeName:r}){const a=cn(),l=xT()?.();return{getTransformedStyles:u=>l?[...u.map(h=>l(h,{props:e,theme:a,ctx:o})),...r.map(h=>l(a.components[h]?.styles,{props:e,theme:a,ctx:o}))].filter(Boolean):[],withStylesTransform:!!l}}function _e({name:e,classes:o,props:r,stylesCtx:a,className:l,style:c,rootSelector:u="root",unstyled:f,classNames:h,styles:p,vars:g,varsResolver:v}){const x=cn(),S=gT(),E=vT(),C=yT(),R=(Array.isArray(e)?e:[e]).filter(A=>A),{withStylesTransform:T,getTransformedStyles:z}=e_({props:r,stylesCtx:a,themeName:R});return(A,N)=>({className:ZT({theme:x,options:N,themeName:R,selector:A,classNamesPrefix:S,classNames:h,classes:o,unstyled:f,className:l,rootSelector:u,props:r,stylesCtx:a,withStaticClasses:E,headless:C,transformedStyles:z([N?.styles,p])}),style:JT({theme:x,themeName:R,selector:A,options:N,props:r,stylesCtx:a,rootSelector:u,styles:p,style:c,vars:g,varsResolver:v,headless:C,withStylesTransform:T})})}function Nx(e,o){return typeof e=="boolean"?e:o.autoContrast}function ce(e,o,r){const a=cn(),l=a.components[e]?.defaultProps,c=typeof l=="function"?l(a):l;return{...o,...c,...xs(r)}}function $h(e){return At(e).reduce((o,r)=>e[r]!==void 0?`${o}${jR(r)}:${e[r]};`:o,"").trim()}function t_({selector:e,styles:o,media:r,container:a}){const l=o?$h(o):"",c=Array.isArray(r)?r.map(f=>`@media${f.query}{${e}{${$h(f.styles)}}}`):[],u=Array.isArray(a)?a.map(f=>`@container ${f.query}{${e}{${$h(f.styles)}}}`):[];return`${l?`${e}{${l}}`:""}${c.join("")}${u.join("")}`.trim()}function Ou(e){const o=Kp();return y.jsx("style",{"data-mantine-styles":"inline",nonce:o?.(),dangerouslySetInnerHTML:{__html:t_(e)}})}function qi(e){const{m:o,mx:r,my:a,mt:l,mb:c,ml:u,mr:f,me:h,ms:p,p:g,px:v,py:x,pt:S,pb:E,pl:C,pr:R,pe:T,ps:z,bd:A,bg:N,c:B,opacity:M,ff:$,fz:L,fw:H,lts:I,ta:Y,lh:X,fs:ee,tt:ne,td:re,w:j,miw:k,maw:V,h:P,mih:Z,mah:D,bgsz:O,bgp:q,bgr:W,bga:ie,pos:ue,top:ve,left:fe,bottom:be,right:ye,inset:Ge,display:Ne,flex:Ke,hiddenFrom:Be,visibleFrom:tt,lightHidden:vt,darkHidden:pe,sx:me,...we}=e;return{styleProps:xs({m:o,mx:r,my:a,mt:l,mb:c,ml:u,mr:f,me:h,ms:p,p:g,px:v,py:x,pt:S,pb:E,pl:C,pr:R,pe:T,ps:z,bd:A,bg:N,c:B,opacity:M,ff:$,fz:L,fw:H,lts:I,ta:Y,lh:X,fs:ee,tt:ne,td:re,w:j,miw:k,maw:V,h:P,mih:Z,mah:D,bgsz:O,bgp:q,bgr:W,bga:ie,pos:ue,top:ve,left:fe,bottom:be,right:ye,inset:Ge,display:Ne,flex:Ke,hiddenFrom:Be,visibleFrom:tt,lightHidden:vt,darkHidden:pe,sx:me}),rest:we}}const n_={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},ms:{type:"spacing",property:"marginInlineStart"},me:{type:"spacing",property:"marginInlineEnd"},mx:{type:"spacing",property:"marginInline"},my:{type:"spacing",property:"marginBlock"},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},ps:{type:"spacing",property:"paddingInlineStart"},pe:{type:"spacing",property:"paddingInlineEnd"},px:{type:"spacing",property:"paddingInline"},py:{type:"spacing",property:"paddingBlock"},bd:{type:"border",property:"border"},bg:{type:"color",property:"background"},c:{type:"textColor",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"fontFamily",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"lineHeight",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"size",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"},flex:{type:"identity",property:"flex"}};function nm(e,o){const r=ir({color:e,theme:o});return r.color==="dimmed"?"var(--mantine-color-dimmed)":r.color==="bright"?"var(--mantine-color-bright)":r.variable?`var(${r.variable})`:r.color}function o_(e,o){const r=ir({color:e,theme:o});return r.isThemeColor&&r.shade===void 0?`var(--mantine-color-${r.color}-text)`:nm(e,o)}function r_(e,o){if(typeof e=="number")return oe(e);if(typeof e=="string"){const[r,a,...l]=e.split(" ").filter(u=>u.trim()!=="");let c=`${oe(r)}`;return a&&(c+=` ${a}`),l.length>0&&(c+=` ${nm(l.join(" "),o)}`),c.trim()}return e}const L0={text:"var(--mantine-font-family)",mono:"var(--mantine-font-family-monospace)",monospace:"var(--mantine-font-family-monospace)",heading:"var(--mantine-font-family-headings)",headings:"var(--mantine-font-family-headings)"};function a_(e){return typeof e=="string"&&e in L0?L0[e]:e}const i_=["h1","h2","h3","h4","h5","h6"];function l_(e,o){return typeof e=="string"&&e in o.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&i_.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?oe(e):e}function s_(e){return e}const c_=["h1","h2","h3","h4","h5","h6"];function u_(e,o){return typeof e=="string"&&e in o.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&c_.includes(e)?`var(--mantine-${e}-line-height)`:e}function f_(e){return typeof e=="number"?oe(e):e}function d_(e,o){if(typeof e=="number")return oe(e);if(typeof e=="string"){const r=e.replace("-","");if(!(r in o.spacing))return oe(e);const a=`--mantine-spacing-${r}`;return e.startsWith("-")?`calc(var(${a}) * -1)`:`var(${a})`}return e}const Lh={color:nm,textColor:o_,fontSize:l_,spacing:d_,identity:s_,size:f_,lineHeight:u_,fontFamily:a_,border:r_};function k0(e){return e.replace("(min-width: ","").replace("em)","")}function h_({media:e,...o}){const a=Object.keys(e).sort((l,c)=>Number(k0(l))-Number(k0(c))).map(l=>({query:l,styles:e[l]}));return{...o,media:a}}function p_(e){if(typeof e!="object"||e===null)return!1;const o=Object.keys(e);return!(o.length===1&&o[0]==="base")}function m_(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function g_(e){return typeof e=="object"&&e!==null?At(e).filter(o=>o!=="base"):[]}function v_(e,o){return typeof e=="object"&&e!==null&&o in e?e[o]:e}function y_({styleProps:e,data:o,theme:r}){return h_(At(e).reduce((a,l)=>{if(l==="hiddenFrom"||l==="visibleFrom"||l==="sx")return a;const c=o[l],u=Array.isArray(c.property)?c.property:[c.property],f=m_(e[l]);if(!p_(e[l]))return u.forEach(p=>{a.inlineStyles[p]=Lh[c.type](f,r)}),a;a.hasResponsiveStyles=!0;const h=g_(e[l]);return u.forEach(p=>{f&&(a.styles[p]=Lh[c.type](f,r)),h.forEach(g=>{const v=`(min-width: ${r.breakpoints[g]})`;a.media[v]={...a.media[v],[p]:Lh[c.type](v_(e[l],g),r)}})}),a},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function Ax(){return`__m__-${b.useId().replace(/:/g,"")}`}function om(e,o){return Array.isArray(e)?[...e].reduce((r,a)=>({...r,...om(a,o)}),{}):typeof e=="function"?e(o):e??{}}function zx(e){return e.startsWith("data-")?e:`data-${e}`}function b_(e){return Object.keys(e).reduce((o,r)=>{const a=e[r];return a===void 0||a===""||a===!1||a===null||(o[zx(r)]=e[r]),o},{})}function Mx(e){return e?typeof e=="string"?{[zx(e)]:!0}:Array.isArray(e)?[...e].reduce((o,r)=>({...o,...Mx(r)}),{}):b_(e):null}function yp(e,o){return Array.isArray(e)?[...e].reduce((r,a)=>({...r,...yp(a,o)}),{}):typeof e=="function"?e(o):e??{}}function x_({theme:e,style:o,vars:r,styleProps:a}){const l=yp(o,e),c=yp(r,e);return{...l,...c,...a}}const Ox=b.forwardRef(({component:e,style:o,__vars:r,className:a,variant:l,mod:c,size:u,hiddenFrom:f,visibleFrom:h,lightHidden:p,darkHidden:g,renderRoot:v,__size:x,...S},E)=>{const C=cn(),R=e||"div",{styleProps:T,rest:z}=qi(S),N=bT()?.()?.(T.sx),B=Ax(),M=y_({styleProps:T,theme:C,data:n_}),$={ref:E,style:x_({theme:C,style:o,vars:r,styleProps:M.inlineStyles}),className:zt(a,N,{[B]:M.hasResponsiveStyles,"mantine-light-hidden":p,"mantine-dark-hidden":g,[`mantine-hidden-from-${f}`]:f,[`mantine-visible-from-${h}`]:h}),"data-variant":l,"data-size":mx(u)?void 0:u||void 0,size:x,...Mx(c),...z};return y.jsxs(y.Fragment,{children:[M.hasResponsiveStyles&&y.jsx(Ou,{selector:`.${B}`,styles:M.styles,media:M.media}),typeof v=="function"?v($):y.jsx(R,{...$})]})});Ox.displayName="@mantine/core/Box";const he=Ox;function jx(e){return e}function S_(e){const o=e;return r=>{const a=b.forwardRef((l,c)=>y.jsx(o,{...r,...l,ref:c}));return a.extend=o.extend,a.displayName=`WithProps(${o.displayName})`,a}}function ge(e){const o=b.forwardRef(e);return o.extend=jx,o.withProps=r=>{const a=b.forwardRef((l,c)=>y.jsx(o,{...r,...l,ref:c}));return a.extend=o.extend,a.displayName=`WithProps(${o.displayName})`,a},o}function un(e){const o=b.forwardRef(e);return o.withProps=r=>{const a=b.forwardRef((l,c)=>y.jsx(o,{...r,...l,ref:c}));return a.extend=o.extend,a.displayName=`WithProps(${o.displayName})`,a},o.extend=jx,o}const w_=b.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function Ii(){return b.useContext(w_)}var co=ix();const Sa=Xp(co);function C_(e){if(!e||typeof e=="string")return 0;const o=e/36;return Math.round((4+15*o**.25+o/5)*10)}function kh(e){return e?.current?e.current.scrollHeight:"auto"}const ns=typeof window<"u"&&window.requestAnimationFrame;function E_({transitionDuration:e,transitionTimingFunction:o="ease",onTransitionEnd:r=()=>{},opened:a}){const l=b.useRef(null),c=0,u={height:0,overflow:"hidden"},[f,h]=b.useState(a?{}:u),p=E=>{co.flushSync(()=>h(E))},g=E=>{p(C=>({...C,...E}))};function v(E){const C=e||C_(E);return{transition:`height ${C}ms ${o}, opacity ${C}ms ${o}`}}or(()=>{typeof ns=="function"&&ns(a?()=>{g({willChange:"height",display:"block",overflow:"hidden"}),ns(()=>{const E=kh(l);g({...v(E),height:E})})}:()=>{const E=kh(l);g({...v(E),willChange:"height",height:E}),ns(()=>g({height:c,overflow:"hidden"}))})},[a]);const x=E=>{if(!(E.target!==l.current||E.propertyName!=="height"))if(a){const C=kh(l);C===f.height?p({}):g({height:C}),r()}else f.height===c&&(p(u),r())};function S({style:E={},refKey:C="ref",...R}={}){const T=R[C],z={"aria-hidden":!a,inert:!a,...R,[C]:wx(l,T),onTransitionEnd:x,style:{boxSizing:"border-box",...E,...f}};return Ye.version.startsWith("18")||(z.inert=!a),z}return S}const R_={transitionDuration:200,transitionTimingFunction:"ease",animateOpacity:!0},rm=ge((e,o)=>{const{children:r,in:a,transitionDuration:l,transitionTimingFunction:c,style:u,onTransitionEnd:f,animateOpacity:h,...p}=ce("Collapse",R_,e),g=cn(),v=Nu(),S=(g.respectReducedMotion?v:!1)?0:l,E=E_({opened:a,transitionDuration:S,transitionTimingFunction:c,onTransitionEnd:f});return S===0?a?y.jsx(he,{...p,children:r}):null:y.jsx(he,{...E({style:{opacity:a||!h?1:0,transition:h?`opacity ${S}ms ${c}`:"none",...om(u,g)},ref:o,...p}),children:r})});rm.displayName="@mantine/core/Collapse";function ju(){return typeof window<"u"}function Fi(e){return Bx(e)?(e.nodeName||"").toLowerCase():"#document"}function dn(e){var o;return(e==null||(o=e.ownerDocument)==null?void 0:o.defaultView)||window}function lr(e){var o;return(o=(Bx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:o.documentElement}function Bx(e){return ju()?e instanceof Node||e instanceof dn(e).Node:!1}function pt(e){return ju()?e instanceof Element||e instanceof dn(e).Element:!1}function yo(e){return ju()?e instanceof HTMLElement||e instanceof dn(e).HTMLElement:!1}function bp(e){return!ju()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof dn(e).ShadowRoot}function Bu(e){const{overflow:o,overflowX:r,overflowY:a,display:l}=ho(e);return/auto|scroll|overlay|hidden|clip/.test(o+a+r)&&l!=="inline"&&l!=="contents"}function T_(e){return/^(table|td|th)$/.test(Fi(e))}function $u(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const __=/transform|translate|scale|rotate|perspective|filter/,D_=/paint|layout|strict|content/,ma=e=>!!e&&e!=="none";let Hh;function am(e){const o=pt(e)?ho(e):e;return ma(o.transform)||ma(o.translate)||ma(o.scale)||ma(o.rotate)||ma(o.perspective)||!Lu()&&(ma(o.backdropFilter)||ma(o.filter))||__.test(o.willChange||"")||D_.test(o.contain||"")}function N_(e){let o=Xr(e);for(;yo(o)&&!_a(o);){if(am(o))return o;if($u(o))return null;o=Xr(o)}return null}function Lu(){return Hh==null&&(Hh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Hh}function _a(e){return/^(html|body|#document)$/.test(Fi(e))}function ho(e){return dn(e).getComputedStyle(e)}function ku(e){return pt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Xr(e){if(Fi(e)==="html")return e;const o=e.assignedSlot||e.parentNode||bp(e)&&e.host||lr(e);return bp(o)?o.host:o}function $x(e){const o=Xr(e);return _a(o)?(e.ownerDocument||e).body:yo(o)&&Bu(o)?o:$x(o)}function tr(e,o,r){var a;o===void 0&&(o=[]),r===void 0&&(r=!0);const l=$x(e),c=l===((a=e.ownerDocument)==null?void 0:a.body),u=dn(l);if(c){const f=xp(u);return o.concat(u,u.visualViewport||[],Bu(l)?l:[],f&&r?tr(f):[])}else return o.concat(l,tr(l,[],r))}function xp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function H0(e){let o=e.activeElement;for(;((r=o)==null||(r=r.shadowRoot)==null?void 0:r.activeElement)!=null;){var r;o=o.shadowRoot.activeElement}return o}function hs(e,o){if(!e||!o)return!1;const r=o.getRootNode==null?void 0:o.getRootNode();if(e.contains(o))return!0;if(r&&bp(r)){let a=o;for(;a;){if(e===a)return!0;a=a.parentNode||a.host}}return!1}function Lx(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function kx(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(o=>{let{brand:r,version:a}=o;return r+"/"+a}).join(" "):navigator.userAgent}function A_(e){return O_()?!1:!U0()&&e.width===0&&e.height===0||U0()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function z_(){return/apple/i.test(navigator.vendor)}function U0(){const e=/android/i;return e.test(Lx())||e.test(kx())}function M_(){return Lx().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function O_(){return kx().includes("jsdom/")}function Sp(e,o){const r=["mouse","pen"];return r.push("",void 0),r.includes(e)}function j_(e){return"nativeEvent"in e}function B_(e){return e.matches("html,body")}function wa(e){return e?.ownerDocument||document}function Uh(e,o){if(o==null)return!1;if("composedPath"in e)return e.composedPath().includes(o);const r=e;return r.target!=null&&o.contains(r.target)}function Ni(e){return"composedPath"in e?e.composedPath()[0]:e.target}const $_="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function L_(e){return yo(e)&&e.matches($_)}const k_=["top","right","bottom","left"],po=Math.min,Kn=Math.max,vu=Math.round,Zc=Math.floor,nr=e=>({x:e,y:e}),H_={left:"right",right:"left",bottom:"top",top:"bottom"};function Hx(e,o,r){return Kn(e,po(o,r))}function Do(e,o){return typeof e=="function"?e(o):e}function No(e){return e.split("-")[0]}function Zi(e){return e.split("-")[1]}function im(e){return e==="x"?"y":"x"}function lm(e){return e==="y"?"height":"width"}function uo(e){const o=e[0];return o==="t"||o==="b"?"y":"x"}function sm(e){return im(uo(e))}function U_(e,o,r){r===void 0&&(r=!1);const a=Zi(e),l=sm(e),c=lm(l);let u=l==="x"?a===(r?"end":"start")?"right":"left":a==="start"?"bottom":"top";return o.reference[c]>o.floating[c]&&(u=yu(u)),[u,yu(u)]}function P_(e){const o=yu(e);return[wp(e),o,wp(o)]}function wp(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const P0=["left","right"],V0=["right","left"],V_=["top","bottom"],Y_=["bottom","top"];function G_(e,o,r){switch(e){case"top":case"bottom":return r?o?V0:P0:o?P0:V0;case"left":case"right":return o?V_:Y_;default:return[]}}function X_(e,o,r,a){const l=Zi(e);let c=G_(No(e),r==="start",a);return l&&(c=c.map(u=>u+"-"+l),o&&(c=c.concat(c.map(wp)))),c}function yu(e){const o=No(e);return H_[o]+e.slice(o.length)}function q_(e){var o,r,a,l;return{top:(o=e.top)!=null?o:0,right:(r=e.right)!=null?r:0,bottom:(a=e.bottom)!=null?a:0,left:(l=e.left)!=null?l:0}}function cm(e){return typeof e!="number"?q_(e):{top:e,right:e,bottom:e,left:e}}function Gr(e){const{x:o,y:r,width:a,height:l}=e;return{width:a,height:l,top:r,left:o,right:o+a,bottom:r+l,x:o,y:r}}function Y0(e,o,r){let{reference:a,floating:l}=e;const c=uo(o),u=sm(o),f=lm(u),h=No(o),p=c==="y",g=a.x+a.width/2-l.width/2,v=a.y+a.height/2-l.height/2,x=a[f]/2-l[f]/2;let S;switch(h){case"top":S={x:g,y:a.y-l.height};break;case"bottom":S={x:g,y:a.y+a.height};break;case"right":S={x:a.x+a.width,y:v};break;case"left":S={x:a.x-l.width,y:v};break;default:S={x:a.x,y:a.y}}const E=Zi(o);return E&&(S[u]+=x*(E==="end"?1:-1)*(r&&p?-1:1)),S}async function I_(e,o){var r;o===void 0&&(o={});const{x:a,y:l,platform:c,rects:u,elements:f,strategy:h}=e,{boundary:p="clippingAncestors",rootBoundary:g="viewport",elementContext:v="floating",altBoundary:x=!1,padding:S=0}=Do(o,e),E=cm(S),R=f[x?v==="floating"?"reference":"floating":v],T=Gr(await c.getClippingRect({element:(r=await(c.isElement==null?void 0:c.isElement(R)))==null||r?R:R.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(f.floating)),boundary:p,rootBoundary:g,strategy:h})),z=v==="floating"?{x:a,y:l,width:u.floating.width,height:u.floating.height}:u.reference,A=await(c.getOffsetParent==null?void 0:c.getOffsetParent(f.floating)),N=await(c.isElement==null?void 0:c.isElement(A))&&await(c.getScale==null?void 0:c.getScale(A))||{x:1,y:1},B=Gr(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:z,offsetParent:A,strategy:h}):z);return{top:(T.top-B.top+E.top)/N.y,bottom:(B.bottom-T.bottom+E.bottom)/N.y,left:(T.left-B.left+E.left)/N.x,right:(B.right-T.right+E.right)/N.x}}const F_=50,Z_=async(e,o,r)=>{const{placement:a="bottom",strategy:l="absolute",middleware:c=[],platform:u}=r,f=u.detectOverflow?u:{...u,detectOverflow:I_},h=await(u.isRTL==null?void 0:u.isRTL(o));let p=await u.getElementRects({reference:e,floating:o,strategy:l}),{x:g,y:v}=Y0(p,a,h),x=a,S=0;const E={};for(let C=0;C({name:"arrow",options:e,async fn(o){const{x:r,y:a,placement:l,rects:c,platform:u,elements:f,middlewareData:h}=o,{element:p,padding:g=0}=Do(e,o)||{};if(p==null)return{};const v=cm(g),x={x:r,y:a},S=sm(l),E=lm(S),C=await u.getDimensions(p),R=S==="y",T=R?"top":"left",z=R?"bottom":"right",A=R?"clientHeight":"clientWidth",N=c.reference[E]+c.reference[S]-x[S]-c.floating[E],B=x[S]-c.reference[S],M=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p));let $=M?M[A]:0;(!$||!await(u.isElement==null?void 0:u.isElement(M)))&&($=f.floating[A]||c.floating[E]);const L=N/2-B/2,H=$/2-C[E]/2-1,I=po(v[T],H),Y=po(v[z],H),X=$-C[E]-Y,ee=$/2-C[E]/2+L,ne=Hx(I,ee,X),re=!h.arrow&&Zi(l)!=null&&ee!==ne&&c.reference[E]/2-(eene<=0)){var Y,X;const ne=(((Y=c.flip)==null?void 0:Y.index)||0)+1,re=$[ne];if(re&&(!(v==="alignment"?z!==uo(re):!1)||I.every(V=>uo(V.placement)===z?V.overflows[0]>0:!0)))return{data:{index:ne,overflows:I},reset:{placement:re}};let j=(X=I.filter(k=>k.overflows[0]<=0).sort((k,V)=>k.overflows[1]-V.overflows[1])[0])==null?void 0:X.placement;if(!j)switch(S){case"bestFit":{var ee;const k=(ee=I.filter(V=>{if(M){const P=uo(V.placement);return P===z||P==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(P=>P>0).reduce((P,Z)=>P+Z,0)]).sort((V,P)=>V[1]-P[1])[0])==null?void 0:ee[0];k&&(j=k);break}case"initialPlacement":j=f;break}if(l!==j)return{reset:{placement:j}}}return{}}}};function G0(e,o){return{top:e.top-o.height,right:e.right-o.width,bottom:e.bottom-o.height,left:e.left-o.width}}function X0(e){return k_.some(o=>e[o]>=0)}const W_=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(o){const{rects:r,platform:a}=o,{strategy:l="referenceHidden",...c}=Do(e,o);switch(l){case"referenceHidden":{const u=await a.detectOverflow(o,{...c,elementContext:"reference"}),f=G0(u,r.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:X0(f)}}}case"escaped":{const u=await a.detectOverflow(o,{...c,altBoundary:!0}),f=G0(u,r.floating);return{data:{escapedOffsets:f,escaped:X0(f)}}}default:return{}}}}};function Ux(e){const o=po(...e.map(c=>c.left)),r=po(...e.map(c=>c.top)),a=Kn(...e.map(c=>c.right)),l=Kn(...e.map(c=>c.bottom));return{x:o,y:r,width:a-o,height:l-r}}function J_(e){const o=e.slice().sort((l,c)=>l.y-c.y),r=[];let a=null;for(let l=0;la.height/2?r.push([c]):r[r.length-1].push(c),a=c}return r.map(l=>Gr(Ux(l)))}const eD=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(o){const{placement:r,elements:a,rects:l,platform:c,strategy:u}=o,{padding:f=2,x:h,y:p}=Do(e,o),g=Array.from(await(c.getClientRects==null?void 0:c.getClientRects(a.reference))||[]);if(!g.length)return{};const v=J_(g),x=Gr(Ux(g)),S=cm(f);function E(){if(v.length===2&&(v[0].left>v[1].right||v[1].left>v[0].right)&&h!=null&&p!=null)return v.find(R=>h>R.left-S.left&&hR.top-S.top&&p=2){if(uo(r)==="y"){const M=v[0],$=v[v.length-1],L=No(r)==="top",H=M.top,I=$.bottom,Y=L?M.left:$.left,X=L?M.right:$.right;return Gr({x:Y,y:H,width:X-Y,height:I-H})}const R=No(r)==="left",T=Kn(...v.map(M=>M.right)),z=po(...v.map(M=>M.left)),A=v.filter(M=>R?M.left===z:M.right===T),N=A[0].top,B=A[A.length-1].bottom;return Gr({x:z,y:N,width:T-z,height:B-N})}return x}const C=await c.getElementRects({reference:{getBoundingClientRect:E},floating:a.floating,strategy:u});return l.reference.x!==C.reference.x||l.reference.y!==C.reference.y||l.reference.width!==C.reference.width||l.reference.height!==C.reference.height?{reset:{rects:C}}:{}}}},Px=new Set(["left","top"]);async function tD(e,o){const{placement:r,platform:a,elements:l}=e,c=await(a.isRTL==null?void 0:a.isRTL(l.floating)),u=No(r),f=Zi(r),h=uo(r)==="y",p=Px.has(u)?-1:1,g=c&&h?-1:1,v=Do(o,e);let{mainAxis:x,crossAxis:S,alignmentAxis:E}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return f&&typeof E=="number"&&(S=f==="end"?E*-1:E),h?{x:S*g,y:x*p}:{x:x*p,y:S*g}}const nD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(o){var r,a;const{x:l,y:c,placement:u,middlewareData:f}=o,h=await tD(o,e);return u===((r=f.offset)==null?void 0:r.placement)&&(a=f.arrow)!=null&&a.alignmentOffset?{}:{x:l+h.x,y:c+h.y,data:{...h,placement:u}}}}},oD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(o){const{x:r,y:a,placement:l,platform:c}=o,{mainAxis:u=!0,crossAxis:f=!1,limiter:h={fn:z=>{let{x:A,y:N}=z;return{x:A,y:N}}},...p}=Do(e,o),g={x:r,y:a},v=await c.detectOverflow(o,p),x=uo(l),S=im(x);let E=g[S],C=g[x];const R=(z,A)=>Hx(A+v[z==="y"?"top":"left"],A,A-v[z==="y"?"bottom":"right"]);u&&(E=R(S,E)),f&&(C=R(x,C));const T=h.fn({...o,[S]:E,[x]:C});return{...T,data:{x:T.x-r,y:T.y-a,enabled:{[S]:u,[x]:f}}}}}},rD=function(e){return e===void 0&&(e={}),{options:e,fn(o){var r,a;const{x:l,y:c,placement:u,rects:f,middlewareData:h}=o,{offset:p=0,mainAxis:g=!0,crossAxis:v=!0}=Do(e,o),x={x:l,y:c},S=uo(u),E=im(S);let C=x[E],R=x[S];const T=Do(p,o),z=typeof T=="number"?{mainAxis:T,crossAxis:0}:{mainAxis:(r=T.mainAxis)!=null?r:0,crossAxis:(a=T.crossAxis)!=null?a:0};if(g){const B=E==="y"?"height":"width",M=f.reference[E]-f.floating[B]+z.mainAxis,$=f.reference[E]+f.reference[B]-z.mainAxis;C$&&(C=$)}if(v){var A,N;const B=E==="y"?"width":"height",M=Px.has(No(u)),$=f.reference[S]-f.floating[B]+(M&&((A=h.offset)==null?void 0:A[S])||0)+(M?0:z.crossAxis),L=f.reference[S]+f.reference[B]+(M?0:((N=h.offset)==null?void 0:N[S])||0)-(M?z.crossAxis:0);R<$?R=$:R>L&&(R=L)}return{[E]:C,[S]:R}}}},aD=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(o){const{placement:r,rects:a,platform:l,elements:c}=o,{apply:u=()=>{},...f}=Do(e,o),h=await l.detectOverflow(o,f),p=No(r),g=Zi(r),v=uo(r)==="y",{width:x,height:S}=a.floating;let E,C;p==="top"||p==="bottom"?(E=p,C=g===(await(l.isRTL==null?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(C=p,E=g==="end"?"top":"bottom");const R=S-h.top-h.bottom,T=x-h.left-h.right,z=po(S-h[E],R),A=po(x-h[C],T),N=o.middlewareData.shift,B=!N;let M=z,$=A;N!=null&&N.enabled.x&&($=T),N!=null&&N.enabled.y&&(M=R),B&&!g&&(v?$=x-2*Kn(h.left,h.right):M=S-2*Kn(h.top,h.bottom)),await u({...o,availableWidth:$,availableHeight:M});const L=await l.getDimensions(c.floating);return x!==L.width||S!==L.height?{reset:{rects:!0}}:{}}}};function Vx(e){const o=ho(e);let r=parseFloat(o.width)||0,a=parseFloat(o.height)||0;const l=yo(e),c=l?e.offsetWidth:r,u=l?e.offsetHeight:a,f=vu(r)!==c||vu(a)!==u;return f&&(r=c,a=u),{width:r,height:a,$:f}}function um(e){return pt(e)?e:e.contextElement}function ji(e){const o=um(e);if(!yo(o))return nr(1);const r=o.getBoundingClientRect(),{width:a,height:l,$:c}=Vx(o);let u=(c?vu(r.width):r.width)/a,f=(c?vu(r.height):r.height)/l;return(!u||!Number.isFinite(u))&&(u=1),(!f||!Number.isFinite(f))&&(f=1),{x:u,y:f}}const iD=nr(0);function Yx(e){const o=dn(e);return!Lu()||!o.visualViewport?iD:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function lD(e,o,r){return o===void 0&&(o=!1),!!r&&o&&r===dn(e)}function Da(e,o,r,a){o===void 0&&(o=!1),r===void 0&&(r=!1);const l=e.getBoundingClientRect(),c=um(e);let u=nr(1);o&&(a?pt(a)&&(u=ji(a)):u=ji(e));const f=lD(c,r,a)?Yx(c):nr(0);let h=(l.left+f.x)/u.x,p=(l.top+f.y)/u.y,g=l.width/u.x,v=l.height/u.y;if(c&&a){const x=dn(c),S=pt(a)?dn(a):a;let E=x,C=xp(E);for(;C&&S!==E;){const R=ji(C),T=C.getBoundingClientRect(),z=ho(C),A=T.left+(C.clientLeft+parseFloat(z.paddingLeft))*R.x,N=T.top+(C.clientTop+parseFloat(z.paddingTop))*R.y;h*=R.x,p*=R.y,g*=R.x,v*=R.y,h+=A,p+=N,E=dn(C),C=xp(E)}}return Gr({width:g,height:v,x:h,y:p})}function Hu(e,o){const r=ku(e).scrollLeft;return o?o.left+r:Da(lr(e)).left+r}function Gx(e,o){const r=e.getBoundingClientRect(),a=r.left+o.scrollLeft-Hu(e,r),l=r.top+o.scrollTop;return{x:a,y:l}}function sD(e){let{elements:o,rect:r,offsetParent:a,strategy:l}=e;const c=l==="fixed",u=lr(a),f=o?$u(o.floating):!1;if(a===u||f&&c)return r;let h={scrollLeft:0,scrollTop:0},p=nr(1);const g=nr(0),v=yo(a);if((v||!c)&&((Fi(a)!=="body"||Bu(u))&&(h=ku(a)),v)){const S=Da(a);p=ji(a),g.x=S.x+a.clientLeft,g.y=S.y+a.clientTop}const x=u&&!v&&!c?Gx(u,h):nr(0);return{width:r.width*p.x,height:r.height*p.y,x:r.x*p.x-h.scrollLeft*p.x+g.x+x.x,y:r.y*p.y-h.scrollTop*p.y+g.y+x.y}}function cD(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function uD(e){const o=ku(e),r=e.ownerDocument.body,a=Kn(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),l=Kn(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let c=-o.scrollLeft+Hu(e);const u=-o.scrollTop;return ho(r).direction==="rtl"&&(c+=Kn(e.clientWidth,r.clientWidth)-a),{width:a,height:l,x:c,y:u}}const fD=25;function dD(e,o,r){r===void 0&&(r="viewport");const a=r==="layoutViewport",l=dn(e),c=lr(e),u=l.visualViewport;let f=c.clientWidth,h=c.clientHeight,p=0,g=0;if(u){const x=!Lu()||o==="fixed";a?x||(p=-u.offsetLeft,g=-u.offsetTop):(f=u.width,h=u.height,x&&(p=u.offsetLeft,g=u.offsetTop))}if(Hu(c)<=0){const x=c.ownerDocument,S=x.body,E=getComputedStyle(S),C=x.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,R=Math.abs(c.clientWidth-S.clientWidth-C),T=getComputedStyle(c).scrollbarGutter==="stable both-edges"?R/2:R;T<=fD&&(f-=T)}return{width:f,height:h,x:p,y:g}}function hD(e,o){const r=Da(e,!0,o==="fixed"),a=r.top+e.clientTop,l=r.left+e.clientLeft,c=ji(e),u=e.clientWidth*c.x,f=e.clientHeight*c.y,h=l*c.x,p=a*c.y;return{width:u,height:f,x:h,y:p}}function q0(e,o,r){let a;if(o==="viewport"||o==="layoutViewport")a=dD(e,r,o);else if(o==="document")a=uD(lr(e));else if(pt(o))a=hD(o,r);else{const l=Yx(e);a={x:o.x-l.x,y:o.y-l.y,width:o.width,height:o.height}}return Gr(a)}function pD(e,o){const r=o.get(e);if(r)return r;let a=tr(e,[],!1).filter(f=>pt(f)&&Fi(f)!=="body"),l=null;const c=ho(e).position==="fixed";let u=c?Xr(e):e;for(;pt(u)&&!_a(u);){const f=ho(u),h=am(u),p=l?l.position:c?"fixed":"";!h&&(p==="fixed"||p==="absolute"&&f.position==="static")?a=a.filter(v=>v!==u):l=f,u=Xr(u)}return o.set(e,a),a}function mD(e){let{element:o,boundary:r,rootBoundary:a,strategy:l}=e;const u=[...r==="clippingAncestors"?$u(o)?[]:pD(o,this._c):[].concat(r),a],f=q0(o,u[0],l);let h=f.top,p=f.right,g=f.bottom,v=f.left;for(let x=1;x{f(!1,1e-7)},1e3)}$=!1}try{a=new IntersectionObserver(L,{...M,root:c.ownerDocument})}catch{a=new IntersectionObserver(L,M)}a.observe(e)}const h=dn(e),p=()=>f(r);return h.addEventListener("resize",p),f(!0),()=>{h.removeEventListener("resize",p),u()}}function wD(e,o,r,a){a===void 0&&(a={});const{ancestorScroll:l=!0,ancestorResize:c=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:h=!1}=a,p=um(e),g=l||c?[...p?tr(p):[],...o?tr(o):[]]:[];g.forEach(T=>{l&&T.addEventListener("scroll",r),c&&T.addEventListener("resize",r)});const v=p&&f?SD(p,r,c):null;let x=-1,S=null;u&&(S=new ResizeObserver(T=>{let[z]=T;z&&z.target===p&&S&&o&&(S.unobserve(o),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var A;(A=S)==null||A.observe(o)})),r()}),p&&!h&&S.observe(p),o&&S.observe(o));let E,C=h?Da(e):null;h&&R();function R(){const T=Da(e);C&&!qx(C,T)&&r(),C=T,E=requestAnimationFrame(R)}return r(),()=>{var T;g.forEach(z=>{l&&z.removeEventListener("scroll",r),c&&z.removeEventListener("resize",r)}),v?.(),(T=S)==null||T.disconnect(),S=null,h&&cancelAnimationFrame(E)}}const CD=nD,ED=oD,RD=K_,TD=aD,_D=W_,F0=Q_,DD=eD,ND=rD,AD=(e,o,r)=>{const a=new Map,l=r??{},c={...xD,...l.platform,_c:a};return Z_(e,o,{...l,platform:c})};var zD=typeof document<"u",MD=function(){},su=zD?b.useLayoutEffect:MD;function bu(e,o){if(e===o)return!0;if(typeof e!=typeof o)return!1;if(typeof e=="function"&&e.toString()===o.toString())return!0;let r,a,l;if(e&&o&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==o.length)return!1;for(a=r;a--!==0;)if(!bu(e[a],o[a]))return!1;return!0}if(l=Object.keys(e),r=l.length,r!==Object.keys(o).length)return!1;for(a=r;a--!==0;)if(!{}.hasOwnProperty.call(o,l[a]))return!1;for(a=r;a--!==0;){const c=l[a];if(!(c==="_owner"&&e.$$typeof)&&!bu(e[c],o[c]))return!1}return!0}return e!==e&&o!==o}function Ix(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Z0(e,o){const r=Ix(e);return Math.round(o*r)/r}function Vh(e){const o=b.useRef(e);return su(()=>{o.current=e}),o}function OD(e){e===void 0&&(e={});const{placement:o="bottom",strategy:r="absolute",middleware:a=[],platform:l,elements:{reference:c,floating:u}={},transform:f=!0,whileElementsMounted:h,open:p}=e,[g,v]=b.useState({x:0,y:0,strategy:r,placement:o,middlewareData:{},isPositioned:!1}),[x,S]=b.useState(a);bu(x,a)||S(a);const[E,C]=b.useState(null),[R,T]=b.useState(null),z=b.useCallback(V=>{V!==M.current&&(M.current=V,C(V))},[]),A=b.useCallback(V=>{V!==$.current&&($.current=V,T(V))},[]),N=c||E,B=u||R,M=b.useRef(null),$=b.useRef(null),L=b.useRef(g),H=h!=null,I=Vh(h),Y=Vh(l),X=Vh(p),ee=b.useCallback(()=>{if(!M.current||!$.current)return;const V={placement:o,strategy:r,middleware:x};Y.current&&(V.platform=Y.current),AD(M.current,$.current,V).then(P=>{const Z={...P,isPositioned:X.current!==!1};ne.current&&!bu(L.current,Z)&&(L.current=Z,co.flushSync(()=>{v(Z)}))})},[x,o,r,Y,X]);su(()=>{p===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,v(V=>({...V,isPositioned:!1})))},[p]);const ne=b.useRef(!1);su(()=>(ne.current=!0,()=>{ne.current=!1}),[]),su(()=>{if(N&&(M.current=N),B&&($.current=B),N&&B){if(I.current)return I.current(N,B,ee);ee()}},[N,B,ee,I,H]);const re=b.useMemo(()=>({reference:M,floating:$,setReference:z,setFloating:A}),[z,A]),j=b.useMemo(()=>({reference:N,floating:B}),[N,B]),k=b.useMemo(()=>{const V={position:r,left:0,top:0};if(!j.floating)return V;const P=Z0(j.floating,g.x),Z=Z0(j.floating,g.y);return f?{...V,transform:"translate("+P+"px, "+Z+"px)",...Ix(j.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:P,top:Z}},[r,f,j.floating,g.x,g.y]);return b.useMemo(()=>({...g,update:ee,refs:re,elements:j,floatingStyles:k}),[g,ee,re,j,k])}const jD=e=>{function o(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:a,padding:l}=typeof e=="function"?e(r):e;return a&&o(a)?a.current!=null?F0({element:a.current,padding:l}).fn(r):{}:a?F0({element:a,padding:l}).fn(r):{}}}},Fx=(e,o)=>{const r=CD(e);return{name:r.name,fn:r.fn,options:[e,o]}},fm=(e,o)=>{const r=ED(e);return{name:r.name,fn:r.fn,options:[e,o]}},Q0=(e,o)=>({fn:ND(e).fn,options:[e,o]}),xu=(e,o)=>{const r=RD(e);return{name:r.name,fn:r.fn,options:[e,o]}},BD=(e,o)=>{const r=TD(e);return{name:r.name,fn:r.fn,options:[e,o]}},$D=(e,o)=>{const r=_D(e);return{name:r.name,fn:r.fn,options:[e,o]}},is=(e,o)=>{const r=DD(e);return{name:r.name,fn:r.fn,options:[e,o]}},Zx=(e,o)=>{const r=jD(e);return{name:r.name,fn:r.fn,options:[e,o]}};function LD(e){return b.useMemo(()=>e.every(o=>o==null)?null:o=>{e.forEach(r=>{typeof r=="function"?r(o):r!=null&&(r.current=o)})},e)}const Qx={...X2},kD=Qx.useInsertionEffect,HD=kD||(e=>e());function er(e){const o=b.useRef(()=>{});return HD(()=>{o.current=e}),b.useCallback(function(){for(var r=arguments.length,a=new Array(r),l=0;l"floating-ui-"+Math.random().toString(36).slice(2,6)+UD++;function PD(){const[e,o]=b.useState(()=>K0?W0():void 0);return _o(()=>{e==null&&o(W0())},[]),b.useEffect(()=>{K0=!0},[]),e}const VD=Qx.useId,Kx=VD||PD;function YD(){const e=new Map;return{emit(o,r){var a;(a=e.get(o))==null||a.forEach(l=>l(r))},on(o,r){e.set(o,[...e.get(o)||[],r])},off(o,r){var a;e.set(o,((a=e.get(o))==null?void 0:a.filter(l=>l!==r))||[])}}}const GD=b.createContext(null),XD=b.createContext(null),dm=()=>{var e;return((e=b.useContext(GD))==null?void 0:e.id)||null},hm=()=>b.useContext(XD);function pm(e){return"data-floating-ui-"+e}function Yh(e){const o=b.useRef(e);return _o(()=>{o.current=e}),o}const J0=pm("safe-polygon");function cu(e,o,r){return r&&!Sp(r)?0:typeof e=="number"?e:e?.[o]}function qD(e,o){o===void 0&&(o={});const{open:r,onOpenChange:a,dataRef:l,events:c,elements:u}=e,{enabled:f=!0,delay:h=0,handleClose:p=null,mouseOnly:g=!1,restMs:v=0,move:x=!0}=o,S=hm(),E=dm(),C=Yh(p),R=Yh(h),T=Yh(r),z=b.useRef(),A=b.useRef(-1),N=b.useRef(),B=b.useRef(-1),M=b.useRef(!0),$=b.useRef(!1),L=b.useRef(()=>{}),H=b.useRef(!1),I=b.useCallback(()=>{var k;const V=(k=l.current.openEvent)==null?void 0:k.type;return V?.includes("mouse")&&V!=="mousedown"},[l]);b.useEffect(()=>{if(!f)return;function k(V){let{open:P}=V;P||(clearTimeout(A.current),clearTimeout(B.current),M.current=!0,H.current=!1)}return c.on("openchange",k),()=>{c.off("openchange",k)}},[f,c]),b.useEffect(()=>{if(!f||!C.current||!r)return;function k(P){I()&&a(!1,P,"hover")}const V=wa(u.floating).documentElement;return V.addEventListener("mouseleave",k),()=>{V.removeEventListener("mouseleave",k)}},[u.floating,r,a,f,C,I]);const Y=b.useCallback(function(k,V,P){V===void 0&&(V=!0),P===void 0&&(P="hover");const Z=cu(R.current,"close",z.current);Z&&!N.current?(clearTimeout(A.current),A.current=window.setTimeout(()=>a(!1,k,P),Z)):V&&(clearTimeout(A.current),a(!1,k,P))},[R,a]),X=er(()=>{L.current(),N.current=void 0}),ee=er(()=>{if($.current){const k=wa(u.floating).body;k.style.pointerEvents="",k.removeAttribute(J0),$.current=!1}}),ne=er(()=>l.current.openEvent?["click","mousedown"].includes(l.current.openEvent.type):!1);b.useEffect(()=>{if(!f)return;function k(D){if(clearTimeout(A.current),M.current=!1,g&&!Sp(z.current)||v>0&&!cu(R.current,"open"))return;const O=cu(R.current,"open",z.current);O?A.current=window.setTimeout(()=>{T.current||a(!0,D,"hover")},O):r||a(!0,D,"hover")}function V(D){if(ne())return;L.current();const O=wa(u.floating);if(clearTimeout(B.current),H.current=!1,C.current&&l.current.floatingContext){r||clearTimeout(A.current),N.current=C.current({...l.current.floatingContext,tree:S,x:D.clientX,y:D.clientY,onClose(){ee(),X(),ne()||Y(D,!0,"safe-polygon")}});const W=N.current;O.addEventListener("mousemove",W),L.current=()=>{O.removeEventListener("mousemove",W)};return}(z.current!=="touch"||!hs(u.floating,D.relatedTarget))&&Y(D)}function P(D){ne()||l.current.floatingContext&&(C.current==null||C.current({...l.current.floatingContext,tree:S,x:D.clientX,y:D.clientY,onClose(){ee(),X(),ne()||Y(D)}})(D))}if(pt(u.domReference)){var Z;const D=u.domReference;return r&&D.addEventListener("mouseleave",P),(Z=u.floating)==null||Z.addEventListener("mouseleave",P),x&&D.addEventListener("mousemove",k,{once:!0}),D.addEventListener("mouseenter",k),D.addEventListener("mouseleave",V),()=>{var O;r&&D.removeEventListener("mouseleave",P),(O=u.floating)==null||O.removeEventListener("mouseleave",P),x&&D.removeEventListener("mousemove",k),D.removeEventListener("mouseenter",k),D.removeEventListener("mouseleave",V)}}},[u,f,e,g,v,x,Y,X,ee,a,r,T,S,R,C,l,ne]),_o(()=>{var k;if(f&&r&&(k=C.current)!=null&&k.__options.blockPointerEvents&&I()){$.current=!0;const P=u.floating;if(pt(u.domReference)&&P){var V;const Z=wa(u.floating).body;Z.setAttribute(J0,"");const D=u.domReference,O=S==null||(V=S.nodesRef.current.find(q=>q.id===E))==null||(V=V.context)==null?void 0:V.elements.floating;return O&&(O.style.pointerEvents=""),Z.style.pointerEvents="none",D.style.pointerEvents="auto",P.style.pointerEvents="auto",()=>{Z.style.pointerEvents="",D.style.pointerEvents="",P.style.pointerEvents=""}}}},[f,r,E,u,S,C,I]),_o(()=>{r||(z.current=void 0,H.current=!1,X(),ee())},[r,X,ee]),b.useEffect(()=>()=>{X(),clearTimeout(A.current),clearTimeout(B.current),ee()},[f,u.domReference,X,ee]);const re=b.useMemo(()=>{function k(V){z.current=V.pointerType}return{onPointerDown:k,onPointerEnter:k,onMouseMove(V){const{nativeEvent:P}=V;function Z(){!M.current&&!T.current&&a(!0,P,"hover")}g&&!Sp(z.current)||r||v===0||H.current&&V.movementX**2+V.movementY**2<2||(clearTimeout(B.current),z.current==="touch"?Z():(H.current=!0,B.current=window.setTimeout(Z,v)))}}},[g,a,r,T,v]),j=b.useMemo(()=>({onMouseEnter(){clearTimeout(A.current)},onMouseLeave(k){ne()||Y(k.nativeEvent,!1)}}),[Y,ne]);return b.useMemo(()=>f?{reference:re,floating:j}:{},[f,re,j])}const Cp=()=>{},Wx=b.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Cp,setState:Cp,isInstantPhase:!1}),ID=()=>b.useContext(Wx);function FD(e){const{children:o,delay:r,timeoutMs:a=0}=e,[l,c]=b.useReducer((h,p)=>({...h,...p}),{delay:r,timeoutMs:a,initialDelay:r,currentId:null,isInstantPhase:!1}),u=b.useRef(null),f=b.useCallback(h=>{c({currentId:h})},[]);return _o(()=>{l.currentId?u.current===null?u.current=l.currentId:l.isInstantPhase||c({isInstantPhase:!0}):(l.isInstantPhase&&c({isInstantPhase:!1}),u.current=null)},[l.currentId,l.isInstantPhase]),b.createElement(Wx.Provider,{value:b.useMemo(()=>({...l,setState:c,setCurrentId:f}),[l,f])},o)}function ZD(e,o){o===void 0&&(o={});const{open:r,onOpenChange:a,floatingId:l}=e,{id:c,enabled:u=!0}=o,f=c??l,h=ID(),{currentId:p,setCurrentId:g,initialDelay:v,setState:x,timeoutMs:S}=h;return _o(()=>{u&&p&&(x({delay:{open:1,close:cu(v,"close")}}),p!==f&&a(!1))},[u,f,a,x,p,v]),_o(()=>{function E(){a(!1),x({delay:v,currentId:null})}if(u&&p&&!r&&p===f){if(S){const C=window.setTimeout(E,S);return()=>{clearTimeout(C)}}E()}},[u,r,x,p,f,a,v,S]),_o(()=>{u&&(g===Cp||!r||g(f))},[u,r,g,f]),h}function Gh(e,o){let r=e.filter(l=>{var c;return l.parentId===o&&((c=l.context)==null?void 0:c.open)}),a=r;for(;a.length;)a=e.filter(l=>{var c;return(c=a)==null?void 0:c.some(u=>{var f;return l.parentId===u.id&&((f=l.context)==null?void 0:f.open)})}),r=r.concat(a);return r}const QD="data-floating-ui-focusable",KD={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},WD={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},e1=e=>{var o,r;return{escapeKey:typeof e=="boolean"?e:(o=e?.escapeKey)!=null?o:!1,outsidePress:typeof e=="boolean"?e:(r=e?.outsidePress)!=null?r:!0}};function JD(e,o){o===void 0&&(o={});const{open:r,onOpenChange:a,elements:l,dataRef:c}=e,{enabled:u=!0,escapeKey:f=!0,outsidePress:h=!0,outsidePressEvent:p="pointerdown",referencePress:g=!1,referencePressEvent:v="pointerdown",ancestorScroll:x=!1,bubbles:S,capture:E}=o,C=hm(),R=er(typeof h=="function"?h:()=>!1),T=typeof h=="function"?R:h,z=b.useRef(!1),A=b.useRef(!1),{escapeKey:N,outsidePress:B}=e1(S),{escapeKey:M,outsidePress:$}=e1(E),L=b.useRef(!1),H=er(re=>{var j;if(!r||!u||!f||re.key!=="Escape"||L.current)return;const k=(j=c.current.floatingContext)==null?void 0:j.nodeId,V=C?Gh(C.nodesRef.current,k):[];if(!N&&(re.stopPropagation(),V.length>0)){let P=!0;if(V.forEach(Z=>{var D;if((D=Z.context)!=null&&D.open&&!Z.context.dataRef.current.__escapeKeyBubbles){P=!1;return}}),!P)return}a(!1,j_(re)?re.nativeEvent:re,"escape-key")}),I=er(re=>{var j;const k=()=>{var V;H(re),(V=Ni(re))==null||V.removeEventListener("keydown",k)};(j=Ni(re))==null||j.addEventListener("keydown",k)}),Y=er(re=>{var j;const k=z.current;z.current=!1;const V=A.current;if(A.current=!1,p==="click"&&V||k||typeof T=="function"&&!T(re))return;const P=Ni(re),Z="["+pm("inert")+"]",D=wa(l.floating).querySelectorAll(Z);let O=pt(P)?P:null;for(;O&&!_a(O);){const ue=Xr(O);if(_a(ue)||!pt(ue))break;O=ue}if(D.length&&pt(P)&&!B_(P)&&!hs(P,l.floating)&&Array.from(D).every(ue=>!hs(O,ue)))return;if(yo(P)&&ne){const ue=P.clientWidth>0&&P.scrollWidth>P.clientWidth,ve=P.clientHeight>0&&P.scrollHeight>P.clientHeight;let fe=ve&&re.offsetX>P.clientWidth;if(ve&&ho(P).direction==="rtl"&&(fe=re.offsetX<=P.offsetWidth-P.clientWidth),fe||ue&&re.offsetY>P.clientHeight)return}const q=(j=c.current.floatingContext)==null?void 0:j.nodeId,W=C&&Gh(C.nodesRef.current,q).some(ue=>{var ve;return Uh(re,(ve=ue.context)==null?void 0:ve.elements.floating)});if(Uh(re,l.floating)||Uh(re,l.domReference)||W)return;const ie=C?Gh(C.nodesRef.current,q):[];if(ie.length>0){let ue=!0;if(ie.forEach(ve=>{var fe;if((fe=ve.context)!=null&&fe.open&&!ve.context.dataRef.current.__outsidePressBubbles){ue=!1;return}}),!ue)return}a(!1,re,"outside-press")}),X=er(re=>{var j;const k=()=>{var V;Y(re),(V=Ni(re))==null||V.removeEventListener(p,k)};(j=Ni(re))==null||j.addEventListener(p,k)});b.useEffect(()=>{if(!r||!u)return;c.current.__escapeKeyBubbles=N,c.current.__outsidePressBubbles=B;let re=-1;function j(D){a(!1,D,"ancestor-scroll")}function k(){window.clearTimeout(re),L.current=!0}function V(){re=window.setTimeout(()=>{L.current=!1},Lu()?5:0)}const P=wa(l.floating);f&&(P.addEventListener("keydown",M?I:H,M),P.addEventListener("compositionstart",k),P.addEventListener("compositionend",V)),T&&P.addEventListener(p,$?X:Y,$);let Z=[];return x&&(pt(l.domReference)&&(Z=tr(l.domReference)),pt(l.floating)&&(Z=Z.concat(tr(l.floating))),!pt(l.reference)&&l.reference&&l.reference.contextElement&&(Z=Z.concat(tr(l.reference.contextElement)))),Z=Z.filter(D=>{var O;return D!==((O=P.defaultView)==null?void 0:O.visualViewport)}),Z.forEach(D=>{D.addEventListener("scroll",j,{passive:!0})}),()=>{f&&(P.removeEventListener("keydown",M?I:H,M),P.removeEventListener("compositionstart",k),P.removeEventListener("compositionend",V)),T&&P.removeEventListener(p,$?X:Y,$),Z.forEach(D=>{D.removeEventListener("scroll",j)}),window.clearTimeout(re)}},[c,l,f,T,p,r,a,x,u,N,B,H,M,I,Y,$,X]),b.useEffect(()=>{z.current=!1},[T,p]);const ee=b.useMemo(()=>({onKeyDown:H,[KD[v]]:re=>{g&&a(!1,re.nativeEvent,"reference-press")}}),[H,a,g,v]),ne=b.useMemo(()=>({onKeyDown:H,onMouseDown(){A.current=!0},onMouseUp(){A.current=!0},[WD[p]]:()=>{z.current=!0}}),[H,p]);return b.useMemo(()=>u?{reference:ee,floating:ne}:{},[u,ee,ne])}function e3(e){const{open:o=!1,onOpenChange:r,elements:a}=e,l=Kx(),c=b.useRef({}),[u]=b.useState(()=>YD()),f=dm()!=null,[h,p]=b.useState(a.reference),g=er((S,E,C)=>{c.current.openEvent=S?E:void 0,u.emit("openchange",{open:S,event:E,reason:C,nested:f}),r?.(S,E,C)}),v=b.useMemo(()=>({setPositionReference:p}),[]),x=b.useMemo(()=>({reference:h||a.reference||null,floating:a.floating||null,domReference:a.reference}),[h,a.reference,a.floating]);return b.useMemo(()=>({dataRef:c,open:o,onOpenChange:g,elements:x,events:u,floatingId:l,refs:v}),[o,g,x,u,l,v])}function mm(e){e===void 0&&(e={});const{nodeId:o}=e,r=e3({...e,elements:{reference:null,floating:null,...e.elements}}),a=e.rootContext||r,l=a.elements,[c,u]=b.useState(null),[f,h]=b.useState(null),g=l?.domReference||c,v=b.useRef(null),x=hm();_o(()=>{g&&(v.current=g)},[g]);const S=OD({...e,elements:{...l,...f&&{reference:f}}}),E=b.useCallback(A=>{const N=pt(A)?{getBoundingClientRect:()=>A.getBoundingClientRect(),contextElement:A}:A;h(N),S.refs.setReference(N)},[S.refs]),C=b.useCallback(A=>{(pt(A)||A===null)&&(v.current=A,u(A)),(pt(S.refs.reference.current)||S.refs.reference.current===null||A!==null&&!pt(A))&&S.refs.setReference(A)},[S.refs]),R=b.useMemo(()=>({...S.refs,setReference:C,setPositionReference:E,domReference:v}),[S.refs,C,E]),T=b.useMemo(()=>({...S.elements,domReference:g}),[S.elements,g]),z=b.useMemo(()=>({...S,...a,refs:R,elements:T,nodeId:o}),[S,R,T,o,a]);return _o(()=>{a.dataRef.current.floatingContext=z;const A=x?.nodesRef.current.find(N=>N.id===o);A&&(A.context=z)}),b.useMemo(()=>({...S,context:z,refs:R,elements:T}),[S,R,T,z])}function t3(e,o){o===void 0&&(o={});const{open:r,onOpenChange:a,events:l,dataRef:c,elements:u}=e,{enabled:f=!0,visibleOnly:h=!0}=o,p=b.useRef(!1),g=b.useRef(),v=b.useRef(!0);b.useEffect(()=>{if(!f)return;const S=dn(u.domReference);function E(){!r&&yo(u.domReference)&&u.domReference===H0(wa(u.domReference))&&(p.current=!0)}function C(){v.current=!0}return S.addEventListener("blur",E),S.addEventListener("keydown",C,!0),()=>{S.removeEventListener("blur",E),S.removeEventListener("keydown",C,!0)}},[u.domReference,r,f]),b.useEffect(()=>{if(!f)return;function S(E){let{reason:C}=E;(C==="reference-press"||C==="escape-key")&&(p.current=!0)}return l.on("openchange",S),()=>{l.off("openchange",S)}},[l,f]),b.useEffect(()=>()=>{clearTimeout(g.current)},[]);const x=b.useMemo(()=>({onPointerDown(S){A_(S.nativeEvent)||(v.current=!1)},onMouseLeave(){p.current=!1},onFocus(S){if(p.current)return;const E=Ni(S.nativeEvent);if(h&&pt(E))try{if(z_()&&M_())throw Error();if(!E.matches(":focus-visible"))return}catch{if(!v.current&&!L_(E))return}a(!0,S.nativeEvent,"focus")},onBlur(S){p.current=!1;const E=S.relatedTarget,C=S.nativeEvent,R=pt(E)&&E.hasAttribute(pm("focus-guard"))&&E.getAttribute("data-type")==="outside";g.current=window.setTimeout(()=>{var T;const z=H0(u.domReference?u.domReference.ownerDocument:document);!E&&z===u.domReference||hs((T=c.current.floatingContext)==null?void 0:T.refs.floating.current,z)||hs(u.domReference,z)||R||a(!1,C,"focus")})}}),[c,u.domReference,a,h]);return b.useMemo(()=>f?{reference:x}:{},[f,x])}const t1="active",n1="selected";function Xh(e,o,r){const a=new Map,l=r==="item";let c=e;if(l&&e){const{[t1]:u,[n1]:f,...h}=e;c=h}return{...r==="floating"&&{tabIndex:-1,[QD]:""},...c,...o.map(u=>{const f=u?u[r]:null;return typeof f=="function"?e?f(e):null:f}).concat(e).reduce((u,f)=>(f&&Object.entries(f).forEach(h=>{let[p,g]=h;if(!(l&&[t1,n1].includes(p)))if(p.indexOf("on")===0){if(a.has(p)||a.set(p,[]),typeof g=="function"){var v;(v=a.get(p))==null||v.push(g),u[p]=function(){for(var x,S=arguments.length,E=new Array(S),C=0;CR(...E)).find(R=>R!==void 0)}}}else u[p]=g}),u),{})}}function n3(e){e===void 0&&(e=[]);const o=e.map(f=>f?.reference),r=e.map(f=>f?.floating),a=e.map(f=>f?.item),l=b.useCallback(f=>Xh(f,e,"reference"),o),c=b.useCallback(f=>Xh(f,e,"floating"),r),u=b.useCallback(f=>Xh(f,e,"item"),a);return b.useMemo(()=>({getReferenceProps:l,getFloatingProps:c,getItemProps:u}),[l,c,u])}const o3=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function r3(e,o){var r;o===void 0&&(o={});const{open:a,floatingId:l}=e,{enabled:c=!0,role:u="dialog"}=o,f=(r=o3.get(u))!=null?r:u,h=Kx(),g=dm()!=null,v=b.useMemo(()=>f==="tooltip"||u==="label"?{["aria-"+(u==="label"?"labelledby":"describedby")]:a?l:void 0}:{"aria-expanded":a?"true":"false","aria-haspopup":f==="alertdialog"?"dialog":f,"aria-controls":a?l:void 0,...f==="listbox"&&{role:"combobox"},...f==="menu"&&{id:h},...f==="menu"&&g&&{role:"menuitem"},...u==="select"&&{"aria-autocomplete":"none"},...u==="combobox"&&{"aria-autocomplete":"list"}},[f,l,g,a,h,u]),x=b.useMemo(()=>{const E={id:l,...f&&{role:f}};return f==="tooltip"||u==="label"?E:{...E,...f==="menu"&&{"aria-labelledby":h}}},[f,l,h,u]),S=b.useCallback(E=>{let{active:C,selected:R}=E;const T={role:"option",...C&&{id:l+"-option"}};switch(u){case"select":return{...T,"aria-selected":C&&R};case"combobox":return{...T,...C&&{"aria-selected":!0}}}return{}},[l,u]);return b.useMemo(()=>c?{reference:v,floating:x,item:S}:{},[c,v,x,S])}const[a3,eo]=zo("ScrollArea.Root component was not found in tree");function Hi(e,o){const r=ba(o);Gi(()=>{let a=0;if(e){const l=new ResizeObserver(()=>{cancelAnimationFrame(a),a=window.requestAnimationFrame(r)});return l.observe(e),()=>{window.cancelAnimationFrame(a),l.unobserve(e)}}},[e,r])}const i3=b.forwardRef((e,o)=>{const{style:r,...a}=e,l=eo(),[c,u]=b.useState(0),[f,h]=b.useState(0),p=!!(c&&f);return Hi(l.scrollbarX,()=>{const g=l.scrollbarX?.offsetHeight||0;l.onCornerHeightChange(g),h(g)}),Hi(l.scrollbarY,()=>{const g=l.scrollbarY?.offsetWidth||0;l.onCornerWidthChange(g),u(g)}),p?y.jsx("div",{...a,ref:o,style:{...r,width:c,height:f}}):null}),l3=b.forwardRef((e,o)=>{const r=eo(),a=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&a?y.jsx(i3,{...e,ref:o}):null}),s3={scrollHideDelay:1e3,type:"hover"},Jx=b.forwardRef((e,o)=>{const{type:r,scrollHideDelay:a,scrollbars:l,getStyles:c,...u}=ce("ScrollAreaRoot",s3,e),[f,h]=b.useState(null),[p,g]=b.useState(null),[v,x]=b.useState(null),[S,E]=b.useState(null),[C,R]=b.useState(null),[T,z]=b.useState(0),[A,N]=b.useState(0),[B,M]=b.useState(!1),[$,L]=b.useState(!1),H=Mt(o,I=>h(I));return y.jsx(a3,{value:{type:r,scrollHideDelay:a,scrollArea:f,viewport:p,onViewportChange:g,content:v,onContentChange:x,scrollbarX:S,onScrollbarXChange:E,scrollbarXEnabled:B,onScrollbarXEnabledChange:M,scrollbarY:C,onScrollbarYChange:R,scrollbarYEnabled:$,onScrollbarYEnabledChange:L,onCornerWidthChange:z,onCornerHeightChange:N,getStyles:c},children:y.jsx(he,{...u,ref:H,__vars:{"--sa-corner-width":l!=="xy"?"0px":`${T}px`,"--sa-corner-height":l!=="xy"?"0px":`${A}px`}})})});Jx.displayName="@mantine/core/ScrollAreaRoot";function eS(e,o){const r=e/o;return Number.isNaN(r)?0:r}function Uu(e){const o=eS(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=(e.scrollbar.size-r)*o;return Math.max(a,18)}function tS(e,o){return r=>{if(e[0]===e[1]||o[0]===o[1])return o[0];const a=(o[1]-o[0])/(e[1]-e[0]);return o[0]+a*(r-e[0])}}function c3(e,[o,r]){return Math.min(r,Math.max(o,e))}function o1(e,o,r="ltr"){const a=Uu(o),l=o.scrollbar.paddingStart+o.scrollbar.paddingEnd,c=o.scrollbar.size-l,u=o.content-o.viewport,f=c-a,h=r==="ltr"?[0,u]:[u*-1,0],p=c3(e,h);return tS([0,u],[0,f])(p)}function u3(e,o,r,a="ltr"){const l=Uu(r),c=l/2,u=o||c,f=l-u,h=r.scrollbar.paddingStart+u,p=r.scrollbar.size-r.scrollbar.paddingEnd-f,g=r.content-r.viewport,v=a==="ltr"?[0,g]:[g*-1,0];return tS([h,p],v)(e)}function nS(e,o){return e>0&&e{e?.(a),(r===!1||!a.defaultPrevented)&&o?.(a)}}const[f3,oS]=zo("ScrollAreaScrollbar was not found in tree"),rS=b.forwardRef((e,o)=>{const{sizes:r,hasThumb:a,onThumbChange:l,onThumbPointerUp:c,onThumbPointerDown:u,onThumbPositionChange:f,onDragScroll:h,onWheelScroll:p,onResize:g,...v}=e,x=eo(),[S,E]=b.useState(null),C=Mt(o,L=>E(L)),R=b.useRef(null),T=b.useRef(""),{viewport:z}=x,A=r.content-r.viewport,N=ba(p),B=ba(f),M=Du(g,10),$=L=>{if(R.current){const H=L.clientX-R.current.left,I=L.clientY-R.current.top;h({x:H,y:I})}};return b.useEffect(()=>{const L=H=>{const I=H.target;S?.contains(I)&&N(H,A)};return document.addEventListener("wheel",L,{passive:!1}),()=>document.removeEventListener("wheel",L,{passive:!1})},[z,S,A,N]),b.useEffect(B,[r,B]),Hi(S,M),Hi(x.content,M),y.jsx(f3,{value:{scrollbar:S,hasThumb:a,onThumbChange:ba(l),onThumbPointerUp:ba(c),onThumbPositionChange:B,onThumbPointerDown:ba(u)},children:y.jsx("div",{...v,ref:C,"data-mantine-scrollbar":!0,style:{position:"absolute",...v.style},onPointerDown:Ra(e.onPointerDown,L=>{L.preventDefault(),L.button===0&&(L.target.setPointerCapture(L.pointerId),R.current=S.getBoundingClientRect(),T.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",$(L))}),onPointerMove:Ra(e.onPointerMove,$),onPointerUp:Ra(e.onPointerUp,L=>{const H=L.target;H.hasPointerCapture(L.pointerId)&&(L.preventDefault(),H.releasePointerCapture(L.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=T.current,R.current=null}})})}),aS=b.forwardRef((e,o)=>{const{sizes:r,onSizesChange:a,style:l,...c}=e,u=eo(),[f,h]=b.useState(),p=b.useRef(null),g=Mt(o,p,u.onScrollbarXChange);return b.useEffect(()=>{p.current&&h(getComputedStyle(p.current))},[p]),y.jsx(rS,{"data-orientation":"horizontal",...c,ref:g,sizes:r,style:{...l,"--sa-thumb-width":`${Uu(r)}px`},onThumbPointerDown:v=>e.onThumbPointerDown(v.x),onDragScroll:v=>e.onDragScroll(v.x),onWheelScroll:(v,x)=>{if(u.viewport){const S=u.viewport.scrollLeft+v.deltaX;e.onWheelScroll(S),nS(S,x)&&v.preventDefault()}},onResize:()=>{p.current&&u.viewport&&f&&a({content:u.viewport.scrollWidth,viewport:u.viewport.offsetWidth,scrollbar:{size:p.current.clientWidth,paddingStart:Vr(f.paddingLeft),paddingEnd:Vr(f.paddingRight)}})}})});aS.displayName="@mantine/core/ScrollAreaScrollbarX";const iS=b.forwardRef((e,o)=>{const{sizes:r,onSizesChange:a,style:l,...c}=e,u=eo(),[f,h]=b.useState(),p=b.useRef(null),g=Mt(o,p,u.onScrollbarYChange);return b.useEffect(()=>{p.current&&h(window.getComputedStyle(p.current))},[]),y.jsx(rS,{...c,"data-orientation":"vertical",ref:g,sizes:r,style:{"--sa-thumb-height":`${Uu(r)}px`,...l},onThumbPointerDown:v=>e.onThumbPointerDown(v.y),onDragScroll:v=>e.onDragScroll(v.y),onWheelScroll:(v,x)=>{if(u.viewport){const S=u.viewport.scrollTop+v.deltaY;e.onWheelScroll(S),nS(S,x)&&v.preventDefault()}},onResize:()=>{p.current&&u.viewport&&f&&a({content:u.viewport.scrollHeight,viewport:u.viewport.offsetHeight,scrollbar:{size:p.current.clientHeight,paddingStart:Vr(f.paddingTop),paddingEnd:Vr(f.paddingBottom)}})}})});iS.displayName="@mantine/core/ScrollAreaScrollbarY";const Pu=b.forwardRef((e,o)=>{const{orientation:r="vertical",...a}=e,{dir:l}=Ii(),c=eo(),u=b.useRef(null),f=b.useRef(0),[h,p]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),g=eS(h.viewport,h.content),v={...a,sizes:h,onSizesChange:p,hasThumb:g>0&&g<1,onThumbChange:S=>{u.current=S},onThumbPointerUp:()=>{f.current=0},onThumbPointerDown:S=>{f.current=S}},x=(S,E)=>u3(S,f.current,h,E);return r==="horizontal"?y.jsx(aS,{...v,ref:o,onThumbPositionChange:()=>{if(c.viewport&&u.current){const S=c.viewport.scrollLeft,E=o1(S,h,l);u.current.style.transform=`translate3d(${E}px, 0, 0)`}},onWheelScroll:S=>{c.viewport&&(c.viewport.scrollLeft=S)},onDragScroll:S=>{c.viewport&&(c.viewport.scrollLeft=x(S,l))}}):r==="vertical"?y.jsx(iS,{...v,ref:o,onThumbPositionChange:()=>{if(c.viewport&&u.current){const S=c.viewport.scrollTop,E=o1(S,h);h.scrollbar.size===0?u.current.style.setProperty("--thumb-opacity","0"):u.current.style.setProperty("--thumb-opacity","1"),u.current.style.transform=`translate3d(0, ${E}px, 0)`}},onWheelScroll:S=>{c.viewport&&(c.viewport.scrollTop=S)},onDragScroll:S=>{c.viewport&&(c.viewport.scrollTop=x(S))}}):null});Pu.displayName="@mantine/core/ScrollAreaScrollbarVisible";const gm=b.forwardRef((e,o)=>{const r=eo(),{forceMount:a,...l}=e,[c,u]=b.useState(!1),f=e.orientation==="horizontal",h=Du(()=>{if(r.viewport){const p=r.viewport.offsetWidth{const{forceMount:r,...a}=e,l=eo(),[c,u]=b.useState(!1);return b.useEffect(()=>{const{scrollArea:f}=l;let h=0;if(f){const p=()=>{window.clearTimeout(h),u(!0)},g=()=>{h=window.setTimeout(()=>u(!1),l.scrollHideDelay)};return f.addEventListener("pointerenter",p),f.addEventListener("pointerleave",g),()=>{window.clearTimeout(h),f.removeEventListener("pointerenter",p),f.removeEventListener("pointerleave",g)}}},[l.scrollArea,l.scrollHideDelay]),r||c?y.jsx(gm,{"data-state":c?"visible":"hidden",...a,ref:o}):null});lS.displayName="@mantine/core/ScrollAreaScrollbarHover";const d3=b.forwardRef((e,o)=>{const{forceMount:r,...a}=e,l=eo(),c=e.orientation==="horizontal",[u,f]=b.useState("hidden"),h=Du(()=>f("idle"),100);return b.useEffect(()=>{if(u==="idle"){const p=window.setTimeout(()=>f("hidden"),l.scrollHideDelay);return()=>window.clearTimeout(p)}},[u,l.scrollHideDelay]),b.useEffect(()=>{const{viewport:p}=l,g=c?"scrollLeft":"scrollTop";if(p){let v=p[g];const x=()=>{const S=p[g];v!==S&&(f("scrolling"),h()),v=S};return p.addEventListener("scroll",x),()=>p.removeEventListener("scroll",x)}},[l.viewport,c,h]),r||u!=="hidden"?y.jsx(Pu,{"data-state":u==="hidden"?"hidden":"visible",...a,ref:o,onPointerEnter:Ra(e.onPointerEnter,()=>f("interacting")),onPointerLeave:Ra(e.onPointerLeave,()=>f("idle"))}):null}),Ep=b.forwardRef((e,o)=>{const{forceMount:r,...a}=e,l=eo(),{onScrollbarXEnabledChange:c,onScrollbarYEnabledChange:u}=l,f=e.orientation==="horizontal";return b.useEffect(()=>(f?c(!0):u(!0),()=>{f?c(!1):u(!1)}),[f,c,u]),l.type==="hover"?y.jsx(lS,{...a,ref:o,forceMount:r}):l.type==="scroll"?y.jsx(d3,{...a,ref:o,forceMount:r}):l.type==="auto"?y.jsx(gm,{...a,ref:o,forceMount:r}):l.type==="always"?y.jsx(Pu,{...a,ref:o}):null});Ep.displayName="@mantine/core/ScrollAreaScrollbar";function h3(e,o=()=>{}){let r={left:e.scrollLeft,top:e.scrollTop},a=0;return(function l(){const c={left:e.scrollLeft,top:e.scrollTop},u=r.left!==c.left,f=r.top!==c.top;(u||f)&&o(),r=c,a=window.requestAnimationFrame(l)})(),()=>window.cancelAnimationFrame(a)}const sS=b.forwardRef((e,o)=>{const{style:r,...a}=e,l=eo(),c=oS(),{onThumbPositionChange:u}=c,f=Mt(o,g=>c.onThumbChange(g)),h=b.useRef(void 0),p=Du(()=>{h.current&&(h.current(),h.current=void 0)},100);return b.useEffect(()=>{const{viewport:g}=l;if(g){const v=()=>{if(p(),!h.current){const x=h3(g,u);h.current=x,u()}};return u(),g.addEventListener("scroll",v),()=>g.removeEventListener("scroll",v)}},[l.viewport,p,u]),y.jsx("div",{"data-state":c.hasThumb?"visible":"hidden",...a,ref:f,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...r},onPointerDownCapture:Ra(e.onPointerDownCapture,g=>{const x=g.target.getBoundingClientRect(),S=g.clientX-x.left,E=g.clientY-x.top;c.onThumbPointerDown({x:S,y:E})}),onPointerUp:Ra(e.onPointerUp,c.onThumbPointerUp)})});sS.displayName="@mantine/core/ScrollAreaThumb";const Rp=b.forwardRef((e,o)=>{const{forceMount:r,...a}=e,l=oS();return r||l.hasThumb?y.jsx(sS,{ref:o,...a}):null});Rp.displayName="@mantine/core/ScrollAreaThumb";const cS=b.forwardRef(({children:e,style:o,...r},a)=>{const l=eo(),c=Mt(a,l.onViewportChange);return y.jsx(he,{...r,ref:c,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...o},children:y.jsx("div",{...l.getStyles("content"),ref:l.onContentChange,children:e})})});cS.displayName="@mantine/core/ScrollAreaViewport";var vm={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268",content:"m_b1336c6"};const uS={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},p3=(e,{scrollbarSize:o,overscrollBehavior:r})=>({root:{"--scrollarea-scrollbar-size":oe(o),"--scrollarea-over-scroll-behavior":r}}),Aa=ge((e,o)=>{const r=ce("ScrollArea",uS,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,scrollbarSize:h,vars:p,type:g,scrollHideDelay:v,viewportProps:x,viewportRef:S,onScrollPositionChange:E,children:C,offsetScrollbars:R,scrollbars:T,onBottomReached:z,onTopReached:A,overscrollBehavior:N,...B}=r,[M,$]=b.useState(!1),[L,H]=b.useState(!1),[I,Y]=b.useState(!1),X=_e({name:"ScrollArea",props:r,classes:vm,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:p,varsResolver:p3}),ee=b.useRef(null),ne=LD([S,ee]);return b.useEffect(()=>{if(!ee.current||R!=="present")return;const re=ee.current,j=new ResizeObserver(()=>{const{scrollHeight:k,clientHeight:V,scrollWidth:P,clientWidth:Z}=re;H(k>V),Y(P>Z)});return j.observe(re),()=>j.disconnect()},[ee,R]),y.jsxs(Jx,{getStyles:X,type:g==="never"?"always":g,scrollHideDelay:v,ref:o,scrollbars:T,...X("root"),...B,children:[y.jsx(cS,{...x,...X("viewport",{style:x?.style}),ref:ne,"data-offset-scrollbars":R===!0?"xy":R||void 0,"data-scrollbars":T||void 0,"data-horizontal-hidden":R==="present"&&!I?"true":void 0,"data-vertical-hidden":R==="present"&&!L?"true":void 0,onScroll:re=>{x?.onScroll?.(re),E?.({x:re.currentTarget.scrollLeft,y:re.currentTarget.scrollTop});const{scrollTop:j,scrollHeight:k,clientHeight:V}=re.currentTarget;j-(k-V)>=-.6&&z?.(),j===0&&A?.()},children:C}),(T==="xy"||T==="x")&&y.jsx(Ep,{...X("scrollbar"),orientation:"horizontal","data-hidden":g==="never"||R==="present"&&!I?!0:void 0,forceMount:!0,onMouseEnter:()=>$(!0),onMouseLeave:()=>$(!1),children:y.jsx(Rp,{...X("thumb")})}),(T==="xy"||T==="y")&&y.jsx(Ep,{...X("scrollbar"),orientation:"vertical","data-hidden":g==="never"||R==="present"&&!L?!0:void 0,forceMount:!0,onMouseEnter:()=>$(!0),onMouseLeave:()=>$(!1),children:y.jsx(Rp,{...X("thumb")})}),y.jsx(l3,{...X("corner"),"data-hovered":M||void 0,"data-hidden":g==="never"||void 0})]})});Aa.displayName="@mantine/core/ScrollArea";const ym=ge((e,o)=>{const{children:r,classNames:a,styles:l,scrollbarSize:c,scrollHideDelay:u,type:f,dir:h,offsetScrollbars:p,viewportRef:g,onScrollPositionChange:v,unstyled:x,variant:S,viewportProps:E,scrollbars:C,style:R,vars:T,onBottomReached:z,onTopReached:A,...N}=ce("ScrollAreaAutosize",uS,e);return y.jsx(he,{...N,ref:o,style:[{display:"flex",overflow:"auto"},R],children:y.jsx(he,{style:{display:"flex",flexDirection:"column",flex:1},children:y.jsx(Aa,{classNames:a,styles:l,scrollHideDelay:u,scrollbarSize:c,type:f,dir:h,offsetScrollbars:p,viewportRef:g,onScrollPositionChange:v,unstyled:x,variant:S,viewportProps:E,vars:T,scrollbars:C,onBottomReached:z,onTopReached:A,children:r})})})});Aa.classes=vm;ym.displayName="@mantine/core/ScrollAreaAutosize";ym.classes=vm;Aa.Autosize=ym;var fS={root:"m_87cf2631"};const m3={__staticSelector:"UnstyledButton"},$n=un((e,o)=>{const r=ce("UnstyledButton",m3,e),{className:a,component:l="button",__staticSelector:c,unstyled:u,classNames:f,styles:h,style:p,...g}=r,v=_e({name:c,props:r,classes:fS,className:a,style:p,classNames:f,styles:h,unstyled:u});return y.jsx(he,{...v("root",{focusable:!0}),component:l,ref:o,type:l==="button"?"button":void 0,...g})});$n.classes=fS;$n.displayName="@mantine/core/UnstyledButton";var dS={root:"m_515a97f8"};const g3={},bm=ge((e,o)=>{const r=ce("VisuallyHidden",g3,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,...p}=r,g=_e({name:"VisuallyHidden",classes:dS,props:r,className:l,style:c,classNames:a,styles:u,unstyled:f});return y.jsx(he,{component:"span",ref:o,...g("root"),...p})});bm.classes=dS;bm.displayName="@mantine/core/VisuallyHidden";var hS={root:"m_1b7284a3"};const v3={},y3=(e,{radius:o,shadow:r})=>({root:{"--paper-radius":o===void 0?void 0:kt(o),"--paper-shadow":Fp(r)}}),Qi=un((e,o)=>{const r=ce("Paper",v3,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,withBorder:h,vars:p,radius:g,shadow:v,variant:x,mod:S,...E}=r,C=_e({name:"Paper",props:r,classes:hS,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:p,varsResolver:y3});return y.jsx(he,{ref:o,mod:[{"data-with-border":h},S],...C("root"),variant:x,...E})});Qi.classes=hS;Qi.displayName="@mantine/core/Paper";function pS(e,o){if(e==="rtl"&&(o.includes("right")||o.includes("left"))){const[r,a]=o.split("-"),l=r==="right"?"left":"right";return a===void 0?l:`${l}-${a}`}return o}function r1(e,o,r,a){return e==="center"||a==="center"?{top:o}:e==="end"?{bottom:r}:e==="start"?{top:r}:{}}function a1(e,o,r,a,l){return e==="center"||a==="center"?{left:o}:e==="end"?{[l==="ltr"?"right":"left"]:r}:e==="start"?{[l==="ltr"?"left":"right"]:r}:{}}const b3={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function x3({position:e,arrowSize:o,arrowOffset:r,arrowRadius:a,arrowPosition:l,arrowX:c,arrowY:u,dir:f}){const[h,p="center"]=e.split("-"),g={width:o,height:o,transform:"rotate(45deg)",position:"absolute",[b3[h]]:a},v=-o/2;return h==="left"?{...g,...r1(p,u,r,l),right:v,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:h==="right"?{...g,...r1(p,u,r,l),left:v,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:h==="top"?{...g,...a1(p,c,r,l,f),bottom:v,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:h==="bottom"?{...g,...a1(p,c,r,l,f),top:v,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}const xm=b.forwardRef(({position:e,arrowSize:o,arrowOffset:r,arrowRadius:a,arrowPosition:l,visible:c,arrowX:u,arrowY:f,style:h,...p},g)=>{const{dir:v}=Ii();return c?y.jsx("div",{...p,ref:g,style:{...h,...x3({position:e,arrowSize:o,arrowOffset:r,arrowRadius:a,arrowPosition:l,dir:v,arrowX:u,arrowY:f})}}):null});xm.displayName="@mantine/core/FloatingArrow";var mS={root:"m_9814e45f"};const S3={zIndex:vo("modal")},w3=(e,{gradient:o,color:r,backgroundOpacity:a,blur:l,radius:c,zIndex:u})=>({root:{"--overlay-bg":o||(r!==void 0||a!==void 0)&&Co(r||"#000",a??.6)||void 0,"--overlay-filter":l?`blur(${oe(l)})`:void 0,"--overlay-radius":c===void 0?void 0:kt(c),"--overlay-z-index":u?.toString()}}),Vu=un((e,o)=>{const r=ce("Overlay",S3,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,fixed:p,center:g,children:v,radius:x,zIndex:S,gradient:E,blur:C,color:R,backgroundOpacity:T,mod:z,...A}=r,N=_e({name:"Overlay",props:r,classes:mS,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:w3});return y.jsx(he,{ref:o,...N("root"),mod:[{center:g,fixed:p},z],...A,children:v})});Vu.classes=mS;Vu.displayName="@mantine/core/Overlay";function qh(e){const o=document.createElement("div");return o.setAttribute("data-portal","true"),typeof e.className=="string"&&o.classList.add(...e.className.split(" ").filter(Boolean)),typeof e.style=="object"&&Object.assign(o.style,e.style),typeof e.id=="string"&&o.setAttribute("id",e.id),o}function C3({target:e,reuseTargetNode:o,...r}){if(e)return typeof e=="string"?document.querySelector(e)||qh(r):e;if(o){const a=document.querySelector("[data-mantine-shared-portal-node]");if(a)return a;const l=qh(r);return l.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(l),l}return qh(r)}const E3={reuseTargetNode:!0},gS=ge((e,o)=>{const{children:r,target:a,reuseTargetNode:l,...c}=ce("Portal",E3,e),[u,f]=b.useState(!1),h=b.useRef(null);return Gi(()=>(f(!0),h.current=C3({target:a,reuseTargetNode:l,...c}),mu(o,h.current),!a&&!l&&h.current&&document.body.appendChild(h.current),()=>{!a&&!l&&h.current&&document.body.removeChild(h.current)}),[a]),!u||!h.current?null:co.createPortal(y.jsx(y.Fragment,{children:r}),h.current)});gS.displayName="@mantine/core/Portal";const za=ge(({withinPortal:e=!0,children:o,...r},a)=>Wp()==="test"||!e?y.jsx(y.Fragment,{children:o}):y.jsx(gS,{ref:a,...r,children:o}));za.displayName="@mantine/core/OptionalPortal";const os=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${e==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),Qc={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(30px)"},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-30px)"},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(30px)"},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-30px)"},transitionProperty:"opacity, transform"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(-20px) skew(-10deg, -5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(20px) skew(-10deg, -5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(-5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:{...os("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...os("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...os("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...os("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...os("top"),common:{transformOrigin:"top right"}}},i1={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function R3({transition:e,state:o,duration:r,timingFunction:a}){const l={WebkitBackfaceVisibility:"hidden",willChange:"transform, opacity",transitionDuration:`${r}ms`,transitionTimingFunction:a};return typeof e=="string"?e in Qc?{transitionProperty:Qc[e].transitionProperty,...l,...Qc[e].common,...Qc[e][i1[o]]}:{}:{transitionProperty:e.transitionProperty,...l,...e.common,...e[i1[o]]}}function T3({duration:e,exitDuration:o,timingFunction:r,mounted:a,onEnter:l,onExit:c,onEntered:u,onExited:f,enterDelay:h,exitDelay:p}){const g=cn(),v=Nu(),x=g.respectReducedMotion?v:!1,[S,E]=b.useState(x?0:e),[C,R]=b.useState(a?"entered":"exited"),T=b.useRef(-1),z=b.useRef(-1),A=b.useRef(-1);function N(){window.clearTimeout(T.current),window.clearTimeout(z.current),cancelAnimationFrame(A.current)}const B=$=>{N();const L=$?l:c,H=$?u:f,I=x?0:$?e:o;E(I),I===0?(typeof L=="function"&&L(),typeof H=="function"&&H(),R($?"entered":"exited")):A.current=requestAnimationFrame(()=>{Sa.flushSync(()=>{R($?"pre-entering":"pre-exiting")}),A.current=requestAnimationFrame(()=>{typeof L=="function"&&L(),R($?"entering":"exiting"),T.current=window.setTimeout(()=>{typeof H=="function"&&H(),R($?"entered":"exited")},I)})})},M=$=>{if(N(),typeof($?h:p)!="number"){B($);return}z.current=window.setTimeout(()=>{B($)},$?h:p)};return or(()=>{M(a)},[a]),b.useEffect(()=>()=>{N()},[]),{transitionDuration:S,transitionStatus:C,transitionTimingFunction:r||"ease"}}function qr({keepMounted:e,transition:o="fade",duration:r=250,exitDuration:a=r,mounted:l,children:c,timingFunction:u="ease",onExit:f,onEntered:h,onEnter:p,onExited:g,enterDelay:v,exitDelay:x}){const S=Wp(),{transitionDuration:E,transitionStatus:C,transitionTimingFunction:R}=T3({mounted:l,exitDuration:a,duration:r,timingFunction:u,onExit:f,onEntered:h,onEnter:p,onExited:g,enterDelay:v,exitDelay:x});return E===0||S==="test"?l?y.jsx(y.Fragment,{children:c({})}):e?c({display:"none"}):null:C==="exited"?e?c({display:"none"}):null:y.jsx(y.Fragment,{children:c(R3({transition:o,duration:E,state:C,timingFunction:R}))})}qr.displayName="@mantine/core/Transition";const[_3,vS]=zo("Popover component was not found in the tree");function Yu({children:e,active:o=!0,refProp:r="ref",innerRef:a}){const l=WR(o),c=Mt(l,a);return rr(e)?b.cloneElement(e,{[r]:c}):e}function yS(e){return y.jsx(bm,{tabIndex:-1,"data-autofocus":!0,...e})}Yu.displayName="@mantine/core/FocusTrap";yS.displayName="@mantine/core/FocusTrapInitialFocus";Yu.InitialFocus=yS;var bS={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};const D3={},Sm=ge((e,o)=>{const r=ce("PopoverDropdown",D3,e),{className:a,style:l,vars:c,children:u,onKeyDownCapture:f,variant:h,classNames:p,styles:g,...v}=r,x=vS(),S=vx({opened:x.opened,shouldReturnFocus:x.returnFocus}),E=x.withRoles?{"aria-labelledby":x.getTargetId(),id:x.getDropdownId(),role:"dialog",tabIndex:-1}:{},C=Mt(o,x.floating);return x.disabled?null:y.jsx(za,{...x.portalProps,withinPortal:x.withinPortal,children:y.jsx(qr,{mounted:x.opened,...x.transitionProps,transition:x.transitionProps?.transition||"fade",duration:x.transitionProps?.duration??150,keepMounted:x.keepMounted,exitDuration:typeof x.transitionProps?.exitDuration=="number"?x.transitionProps.exitDuration:x.transitionProps?.duration,children:R=>y.jsx(Yu,{active:x.trapFocus&&x.opened,innerRef:C,children:y.jsxs(he,{...E,...v,variant:h,onKeyDownCapture:UR(()=>{x.onClose?.(),x.onDismiss?.()},{active:x.closeOnEscape,onTrigger:S,onKeyDown:f}),"data-position":x.placement,"data-fixed":x.floatingStrategy==="fixed"||void 0,...x.getStyles("dropdown",{className:a,props:r,classNames:p,styles:g,style:[{...R,zIndex:x.zIndex,top:x.y??0,left:x.x??0,width:x.width==="target"?void 0:oe(x.width),...x.referenceHidden?{display:"none"}:null},x.resolvedStyles.dropdown,g?.dropdown,l]}),children:[u,y.jsx(xm,{ref:x.arrowRef,arrowX:x.arrowX,arrowY:x.arrowY,visible:x.withArrow,position:x.placement,arrowSize:x.arrowSize,arrowRadius:x.arrowRadius,arrowOffset:x.arrowOffset,arrowPosition:x.arrowPosition,...x.getStyles("arrow",{props:r,classNames:p,styles:g})})]})})})})});Sm.classes=bS;Sm.displayName="@mantine/core/PopoverDropdown";const N3={refProp:"ref",popupType:"dialog"},xS=ge((e,o)=>{const{children:r,refProp:a,popupType:l,...c}=ce("PopoverTarget",N3,e);if(!rr(r))throw new Error("Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const u=c,f=vS(),h=Mt(f.reference,Au(r),o),p=f.withRoles?{"aria-haspopup":l,"aria-expanded":f.opened,"aria-controls":f.getDropdownId(),id:f.getTargetId()}:{};return b.cloneElement(r,{...u,...p,...f.targetProps,className:zt(f.targetProps.className,u.className,r.props.className),[a]:h,...f.controlled?null:{onClick:f.onToggle}})});xS.displayName="@mantine/core/PopoverTarget";function SS({opened:e,floating:o,position:r,positionDependencies:a}){const[l,c]=b.useState(0);b.useEffect(()=>{if(o.refs.reference.current&&o.refs.floating.current&&e)return wD(o.refs.reference.current,o.refs.floating.current,o.update)},[o.refs.reference.current,o.refs.floating.current,e,l,r]),or(()=>{o.update()},a),or(()=>{c(u=>u+1)},[e])}function A3(e){if(e===void 0)return{shift:!0,flip:!0};const o={...e};return e.shift===void 0&&(o.shift=!0),e.flip===void 0&&(o.flip=!0),o}function z3(e,o){const r=A3(e.middlewares),a=[Fx(e.offset),$D()];return r.shift&&a.push(fm(typeof r.shift=="boolean"?{limiter:Q0(),padding:5}:{limiter:Q0(),padding:5,...r.shift})),r.flip&&a.push(typeof r.flip=="boolean"?xu():xu(r.flip)),r.inline&&a.push(typeof r.inline=="boolean"?is():is(r.inline)),a.push(Zx({element:e.arrowRef,padding:e.arrowOffset})),(r.size||e.width==="target")&&a.push(BD({...typeof r.size=="boolean"?{}:r.size,apply({rects:l,availableWidth:c,availableHeight:u,...f}){const p=o().refs.floating.current?.style??{};r.size&&(typeof r.size=="object"&&r.size.apply?r.size.apply({rects:l,availableWidth:c,availableHeight:u,...f}):Object.assign(p,{maxWidth:`${c}px`,maxHeight:`${u}px`})),e.width==="target"&&Object.assign(p,{width:`${l.reference.width}px`})}})),a}function M3(e){const[o,r]=Wn({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),a=b.useRef(o),l=()=>{o&&!e.disabled&&r(!1)},c=()=>!e.disabled&&r(!o),u=mm({strategy:e.strategy,placement:e.position,middleware:z3(e,()=>u)});return SS({opened:o,position:e.position,positionDependencies:e.positionDependencies||[],floating:u}),or(()=>{e.onPositionChange?.(u.placement)},[u.placement]),or(()=>{o!==a.current&&(o?e.onOpen?.():e.onClose?.()),a.current=o},[o,e.onClose,e.onOpen]),{floating:u,controlled:typeof e.opened=="boolean",opened:o,onClose:l,onToggle:c}}const O3={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,hideDetached:!0,clickOutsideEvents:["mousedown","touchstart"],zIndex:vo("popover"),__staticSelector:"Popover",width:"max-content"},j3=(e,{radius:o,shadow:r})=>({dropdown:{"--popover-radius":o===void 0?void 0:kt(o),"--popover-shadow":Fp(r)}});function Rn(e){const o=ce("Popover",O3,e),{children:r,position:a,offset:l,onPositionChange:c,positionDependencies:u,opened:f,transitionProps:h,onExitTransitionEnd:p,onEnterTransitionEnd:g,width:v,middlewares:x,withArrow:S,arrowSize:E,arrowOffset:C,arrowRadius:R,arrowPosition:T,unstyled:z,classNames:A,styles:N,closeOnClickOutside:B,withinPortal:M,portalProps:$,closeOnEscape:L,clickOutsideEvents:H,trapFocus:I,onClose:Y,onDismiss:X,onOpen:ee,onChange:ne,zIndex:re,radius:j,shadow:k,id:V,defaultOpened:P,__staticSelector:Z,withRoles:D,disabled:O,returnFocus:q,variant:W,keepMounted:ie,vars:ue,floatingStrategy:ve,withOverlay:fe,overlayProps:be,hideDetached:ye,...Ge}=o,Ne=_e({name:Z,props:o,classes:bS,classNames:A,styles:N,unstyled:z,rootSelector:"dropdown",vars:ue,varsResolver:j3}),{resolvedStyles:Ke}=Xi({classNames:A,styles:N,props:o}),Be=b.useRef(null),[tt,vt]=b.useState(null),[pe,me]=b.useState(null),{dir:we}=Ii(),De=Wp(),Ae=Jn(V),xe=M3({middlewares:x,width:v,position:pS(we,a),offset:typeof l=="number"?l+(S?E/2:0):l,arrowRef:Be,arrowOffset:C,onPositionChange:c,positionDependencies:u,opened:f,defaultOpened:P,onChange:ne,onOpen:ee,onClose:Y,onDismiss:X,strategy:ve,disabled:O});GR(()=>{B&&(xe.onClose(),X?.())},H,[tt,pe]);const $e=b.useCallback(nt=>{vt(nt),xe.floating.refs.setReference(nt)},[xe.floating.refs.setReference]),de=b.useCallback(nt=>{me(nt),xe.floating.refs.setFloating(nt)},[xe.floating.refs.setFloating]),Re=b.useCallback(()=>{h?.onExited?.(),p?.()},[h?.onExited,p]),dt=b.useCallback(()=>{h?.onEntered?.(),g?.()},[h?.onEntered,g]);return y.jsxs(_3,{value:{returnFocus:q,disabled:O,controlled:xe.controlled,reference:$e,floating:de,x:xe.floating.x,y:xe.floating.y,arrowX:xe.floating?.middlewareData?.arrow?.x,arrowY:xe.floating?.middlewareData?.arrow?.y,opened:xe.opened,arrowRef:Be,transitionProps:{...h,onExited:Re,onEntered:dt},width:v,withArrow:S,arrowSize:E,arrowOffset:C,arrowRadius:R,arrowPosition:T,placement:xe.floating.placement,trapFocus:I,withinPortal:M,portalProps:$,zIndex:re,radius:j,shadow:k,closeOnEscape:L,onDismiss:X,onClose:xe.onClose,onToggle:xe.onToggle,getTargetId:()=>`${Ae}-target`,getDropdownId:()=>`${Ae}-dropdown`,withRoles:D,targetProps:Ge,__staticSelector:Z,classNames:A,styles:N,unstyled:z,variant:W,keepMounted:ie,getStyles:Ne,resolvedStyles:Ke,floatingStrategy:ve,referenceHidden:ye&&De!=="test"?xe.floating.middlewareData.hide?.referenceHidden:!1},children:[r,fe&&y.jsx(qr,{transition:"fade",mounted:xe.opened,duration:h?.duration||250,exitDuration:h?.exitDuration||250,children:nt=>y.jsx(za,{withinPortal:M,children:y.jsx(Vu,{...be,...Ne("overlay",{className:be?.className,style:[nt,be?.style]})})})})]})}Rn.Target=xS;Rn.Dropdown=Sm;Rn.displayName="@mantine/core/Popover";Rn.extend=e=>e;var fo={root:"m_5ae2e3c",barsLoader:"m_7a2bd4cd",bar:"m_870bb79","bars-loader-animation":"m_5d2b3b9d",dotsLoader:"m_4e3f22d7",dot:"m_870c4af","loader-dots-animation":"m_aac34a1",ovalLoader:"m_b34414df","oval-loader-animation":"m_f8e89c4b"};const wS=b.forwardRef(({className:e,...o},r)=>y.jsxs(he,{component:"span",className:zt(fo.barsLoader,e),...o,ref:r,children:[y.jsx("span",{className:fo.bar}),y.jsx("span",{className:fo.bar}),y.jsx("span",{className:fo.bar})]}));wS.displayName="@mantine/core/Bars";const CS=b.forwardRef(({className:e,...o},r)=>y.jsxs(he,{component:"span",className:zt(fo.dotsLoader,e),...o,ref:r,children:[y.jsx("span",{className:fo.dot}),y.jsx("span",{className:fo.dot}),y.jsx("span",{className:fo.dot})]}));CS.displayName="@mantine/core/Dots";const ES=b.forwardRef(({className:e,...o},r)=>y.jsx(he,{component:"span",className:zt(fo.ovalLoader,e),...o,ref:r}));ES.displayName="@mantine/core/Oval";const RS={bars:wS,oval:ES,dots:CS},B3={loaders:RS,type:"oval"},$3=(e,{size:o,color:r})=>({root:{"--loader-size":Xe(o,"loader-size"),"--loader-color":r?Zt(r,e):void 0}}),Ma=ge((e,o)=>{const r=ce("Loader",B3,e),{size:a,color:l,type:c,vars:u,className:f,style:h,classNames:p,styles:g,unstyled:v,loaders:x,variant:S,children:E,...C}=r,R=_e({name:"Loader",props:r,classes:fo,className:f,style:h,classNames:p,styles:g,unstyled:v,vars:u,varsResolver:$3});return E?y.jsx(he,{...R("root"),ref:o,...C,children:E}):y.jsx(he,{...R("root"),ref:o,component:x[c],variant:S,size:a,...C})});Ma.defaultLoaders=RS;Ma.classes=fo;Ma.displayName="@mantine/core/Loader";var Ki={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const l1={orientation:"horizontal"},L3=(e,{borderWidth:o})=>({group:{"--ai-border-width":oe(o)}}),wm=ge((e,o)=>{const r=ce("ActionIconGroup",l1,e),{className:a,style:l,classNames:c,styles:u,unstyled:f,orientation:h,vars:p,borderWidth:g,variant:v,mod:x,...S}=ce("ActionIconGroup",l1,e),E=_e({name:"ActionIconGroup",props:r,classes:Ki,className:a,style:l,classNames:c,styles:u,unstyled:f,vars:p,varsResolver:L3,rootSelector:"group"});return y.jsx(he,{...E("group"),ref:o,variant:v,mod:[{"data-orientation":h},x],role:"group",...S})});wm.classes=Ki;wm.displayName="@mantine/core/ActionIconGroup";const s1={},k3=(e,{radius:o,color:r,gradient:a,variant:l,autoContrast:c,size:u})=>{const f=e.variantColorResolver({color:r||e.primaryColor,theme:e,gradient:a,variant:l||"filled",autoContrast:c});return{groupSection:{"--section-height":Xe(u,"section-height"),"--section-padding-x":Xe(u,"section-padding-x"),"--section-fz":nn(u),"--section-radius":o===void 0?void 0:kt(o),"--section-bg":r||l?f.background:void 0,"--section-color":f.color,"--section-bd":r||l?f.border:void 0}}},Cm=ge((e,o)=>{const r=ce("ActionIconGroupSection",s1,e),{className:a,style:l,classNames:c,styles:u,unstyled:f,vars:h,variant:p,gradient:g,radius:v,autoContrast:x,...S}=ce("ActionIconGroupSection",s1,e),E=_e({name:"ActionIconGroupSection",props:r,classes:Ki,className:a,style:l,classNames:c,styles:u,unstyled:f,vars:h,varsResolver:k3,rootSelector:"groupSection"});return y.jsx(he,{...E("groupSection"),ref:o,variant:p,...S})});Cm.classes=Ki;Cm.displayName="@mantine/core/ActionIconGroupSection";const H3={},U3=(e,{size:o,radius:r,variant:a,gradient:l,color:c,autoContrast:u})=>{const f=e.variantColorResolver({color:c||e.primaryColor,theme:e,gradient:l,variant:a||"filled",autoContrast:u});return{root:{"--ai-size":Xe(o,"ai-size"),"--ai-radius":r===void 0?void 0:kt(r),"--ai-bg":c||a?f.background:void 0,"--ai-hover":c||a?f.hover:void 0,"--ai-hover-color":c||a?f.hoverColor:void 0,"--ai-color":f.color,"--ai-bd":c||a?f.border:void 0}}},Yt=un((e,o)=>{const r=ce("ActionIcon",H3,e),{className:a,unstyled:l,variant:c,classNames:u,styles:f,style:h,loading:p,loaderProps:g,size:v,color:x,radius:S,__staticSelector:E,gradient:C,vars:R,children:T,disabled:z,"data-disabled":A,autoContrast:N,mod:B,...M}=r,$=_e({name:["ActionIcon",E],props:r,className:a,style:h,classes:Ki,classNames:u,styles:f,unstyled:l,vars:R,varsResolver:U3});return y.jsxs($n,{...$("root",{active:!z&&!p&&!A}),...M,unstyled:l,variant:c,size:v,disabled:z||p,ref:o,mod:[{loading:p,disabled:z||A},B],children:[y.jsx(qr,{mounted:!!p,transition:"slide-down",duration:150,children:L=>y.jsx(he,{component:"span",...$("loader",{style:L}),"aria-hidden":!0,children:y.jsx(Ma,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...g})})}),y.jsx(he,{component:"span",mod:{loading:p},...$("icon"),children:T})]})});Yt.classes=Ki;Yt.displayName="@mantine/core/ActionIcon";Yt.Group=wm;Yt.GroupSection=Cm;const TS=b.forwardRef(({size:e="var(--cb-icon-size, 70%)",style:o,...r},a)=>y.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...o,width:e,height:e},ref:a,...r,children:y.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}));TS.displayName="@mantine/core/CloseIcon";var _S={root:"m_86a44da5","root--subtle":"m_220c80f2"};const P3={variant:"subtle"},V3=(e,{size:o,radius:r,iconSize:a})=>({root:{"--cb-size":Xe(o,"cb-size"),"--cb-radius":r===void 0?void 0:kt(r),"--cb-icon-size":oe(a)}}),Wi=un((e,o)=>{const r=ce("CloseButton",P3,e),{iconSize:a,children:l,vars:c,radius:u,className:f,classNames:h,style:p,styles:g,unstyled:v,"data-disabled":x,disabled:S,variant:E,icon:C,mod:R,__staticSelector:T,...z}=r,A=_e({name:T||"CloseButton",props:r,className:f,style:p,classes:_S,classNames:h,styles:g,unstyled:v,vars:c,varsResolver:V3});return y.jsxs($n,{ref:o,...z,unstyled:v,variant:E,disabled:S,mod:[{disabled:S||x},R],...A("root",{variant:E,active:!S&&!x}),children:[C||y.jsx(TS,{}),l]})});Wi.classes=_S;Wi.displayName="@mantine/core/CloseButton";function Y3(e){return b.Children.toArray(e).filter(Boolean)}var DS={root:"m_4081bf90"};const G3={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},X3=(e,{grow:o,preventGrowOverflow:r,gap:a,align:l,justify:c,wrap:u},{childWidth:f})=>({root:{"--group-child-width":o&&r?f:void 0,"--group-gap":sn(a),"--group-align":l,"--group-justify":c,"--group-wrap":u}}),mt=ge((e,o)=>{const r=ce("Group",G3,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,children:h,gap:p,align:g,justify:v,wrap:x,grow:S,preventGrowOverflow:E,vars:C,variant:R,__size:T,mod:z,...A}=r,N=Y3(h),B=N.length,M=sn(p??"md"),L={childWidth:`calc(${100/B}% - (${M} - ${M} / ${B}))`},H=_e({name:"Group",props:r,stylesCtx:L,className:l,style:c,classes:DS,classNames:a,styles:u,unstyled:f,vars:C,varsResolver:X3});return y.jsx(he,{...H("root"),ref:o,variant:R,mod:[{grow:S},z],size:T,...A,children:N})});mt.classes=DS;mt.displayName="@mantine/core/Group";const[q3,sr]=zo("ModalBase component was not found in tree");function I3({opened:e,transitionDuration:o}){const[r,a]=b.useState(e),l=b.useRef(-1),u=Nu()?0:o;return b.useEffect(()=>(e?(a(!0),window.clearTimeout(l.current)):u===0?a(!1):l.current=window.setTimeout(()=>a(!1),u),()=>window.clearTimeout(l.current)),[e,u]),r}function F3({id:e,transitionProps:o,opened:r,trapFocus:a,closeOnEscape:l,onClose:c,returnFocus:u}){const f=Jn(e),[h,p]=b.useState(!1),[g,v]=b.useState(!1),x=typeof o?.duration=="number"?o?.duration:200,S=I3({opened:r,transitionDuration:x});return Sx("keydown",E=>{E.key==="Escape"&&l&&!E.isComposing&&r&&E.target?.getAttribute("data-mantine-stop-propagation")!=="true"&&c()},{capture:!0}),vx({opened:r,shouldReturnFocus:a&&u}),{_id:f,titleMounted:h,bodyMounted:g,shouldLockScroll:S,setTitleMounted:p,setBodyMounted:v}}const NS=b.forwardRef(({keepMounted:e,opened:o,onClose:r,id:a,transitionProps:l,onExitTransitionEnd:c,onEnterTransitionEnd:u,trapFocus:f,closeOnEscape:h,returnFocus:p,closeOnClickOutside:g,withinPortal:v,portalProps:x,lockScroll:S,children:E,zIndex:C,shadow:R,padding:T,__vars:z,unstyled:A,removeScrollProps:N,...B},M)=>{const{_id:$,titleMounted:L,bodyMounted:H,shouldLockScroll:I,setTitleMounted:Y,setBodyMounted:X}=F3({id:a,transitionProps:l,opened:o,trapFocus:f,closeOnEscape:h,onClose:r,returnFocus:p}),{key:ee,...ne}=N||{};return y.jsx(za,{...x,withinPortal:v,children:y.jsx(q3,{value:{opened:o,onClose:r,closeOnClickOutside:g,onExitTransitionEnd:c,onEnterTransitionEnd:u,transitionProps:{...l,keepMounted:e},getTitleId:()=>`${$}-title`,getBodyId:()=>`${$}-body`,titleMounted:L,bodyMounted:H,setTitleMounted:Y,setBodyMounted:X,trapFocus:f,closeOnEscape:h,zIndex:C,unstyled:A},children:y.jsx(ki,{enabled:I&&S,...ne,children:y.jsx(he,{ref:M,...B,__vars:{...z,"--mb-z-index":(C||vo("modal")).toString(),"--mb-shadow":Fp(R),"--mb-padding":sn(T)},children:E})},ee)})})});NS.displayName="@mantine/core/ModalBase";function Z3(){const e=sr();return b.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var Ui={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const AS=b.forwardRef(({className:e,...o},r)=>{const a=Z3(),l=sr();return y.jsx(he,{ref:r,...o,id:a,className:zt({[Ui.body]:!l.unstyled},e)})});AS.displayName="@mantine/core/ModalBaseBody";const zS=b.forwardRef(({className:e,onClick:o,...r},a)=>{const l=sr();return y.jsx(Wi,{ref:a,...r,onClick:c=>{l.onClose(),o?.(c)},className:zt({[Ui.close]:!l.unstyled},e),unstyled:l.unstyled})});zS.displayName="@mantine/core/ModalBaseCloseButton";const MS=b.forwardRef(({transitionProps:e,className:o,innerProps:r,onKeyDown:a,style:l,...c},u)=>{const f=sr();return y.jsx(qr,{mounted:f.opened,transition:"pop",...f.transitionProps,onExited:()=>{f.onExitTransitionEnd?.(),f.transitionProps?.onExited?.()},onEntered:()=>{f.onEnterTransitionEnd?.(),f.transitionProps?.onEntered?.()},...e,children:h=>y.jsx("div",{...r,className:zt({[Ui.inner]:!f.unstyled},r.className),children:y.jsx(Yu,{active:f.opened&&f.trapFocus,innerRef:u,children:y.jsx(Qi,{...c,component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":f.bodyMounted?f.getBodyId():void 0,"aria-labelledby":f.titleMounted?f.getTitleId():void 0,style:[l,h],className:zt({[Ui.content]:!f.unstyled},o),unstyled:f.unstyled,children:c.children})})})})});MS.displayName="@mantine/core/ModalBaseContent";const OS=b.forwardRef(({className:e,...o},r)=>{const a=sr();return y.jsx(he,{component:"header",ref:r,className:zt({[Ui.header]:!a.unstyled},e),...o})});OS.displayName="@mantine/core/ModalBaseHeader";const Q3={duration:200,timingFunction:"ease",transition:"fade"};function K3(e){const o=sr();return{...Q3,...o.transitionProps,...e}}const jS=b.forwardRef(({onClick:e,transitionProps:o,style:r,visible:a,...l},c)=>{const u=sr(),f=K3(o);return y.jsx(qr,{mounted:a!==void 0?a:u.opened,...f,transition:"fade",children:h=>y.jsx(Vu,{ref:c,fixed:!0,style:[r,h],zIndex:u.zIndex,unstyled:u.unstyled,onClick:p=>{e?.(p),u.closeOnClickOutside&&u.onClose()},...l})})});jS.displayName="@mantine/core/ModalBaseOverlay";function W3(){const e=sr();return b.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const BS=b.forwardRef(({className:e,...o},r)=>{const a=W3(),l=sr();return y.jsx(he,{component:"h2",ref:r,className:zt({[Ui.title]:!l.unstyled},e),...o,id:a})});BS.displayName="@mantine/core/ModalBaseTitle";function J3({children:e}){return y.jsx(y.Fragment,{children:e})}const[eN,tN]=Ss({size:"sm"}),nN={},$S=ge((e,o)=>{const r=ce("InputClearButton",nN,e),{size:a,variant:l,vars:c,classNames:u,styles:f,...h}=r,p=tN(),{resolvedClassNames:g,resolvedStyles:v}=Xi({classNames:u,styles:f,props:r});return y.jsx(Wi,{variant:l||"transparent",ref:o,size:a||p?.size||"sm",classNames:g,styles:v,__staticSelector:"InputClearButton",...h})});$S.displayName="@mantine/core/InputClearButton";const[oN,ws]=Ss({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var to={wrapper:"m_6c018570",input:"m_8fb7ebe7",section:"m_82577fc2",placeholder:"m_88bacfd0",root:"m_46b77525",label:"m_8fdc1311",required:"m_78a94662",error:"m_8f816625",description:"m_fe47ce59"};const c1={},rN=(e,{size:o})=>({description:{"--input-description-size":o===void 0?void 0:`calc(${nn(o)} - ${oe(2)})`}}),Gu=ge((e,o)=>{const r=ce("InputDescription",c1,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,size:p,__staticSelector:g,__inheritStyles:v=!0,variant:x,...S}=ce("InputDescription",c1,r),E=ws(),C=_e({name:["InputWrapper",g],props:r,classes:to,className:l,style:c,classNames:a,styles:u,unstyled:f,rootSelector:"description",vars:h,varsResolver:rN}),R=v&&E?.getStyles||C;return y.jsx(he,{component:"p",ref:o,variant:x,size:p,...R("description",E?.getStyles?{className:l,style:c}:void 0),...S})});Gu.classes=to;Gu.displayName="@mantine/core/InputDescription";const aN={},iN=(e,{size:o})=>({error:{"--input-error-size":o===void 0?void 0:`calc(${nn(o)} - ${oe(2)})`}}),Xu=ge((e,o)=>{const r=ce("InputError",aN,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,size:p,__staticSelector:g,__inheritStyles:v=!0,variant:x,...S}=r,E=_e({name:["InputWrapper",g],props:r,classes:to,className:l,style:c,classNames:a,styles:u,unstyled:f,rootSelector:"error",vars:h,varsResolver:iN}),C=ws(),R=v&&C?.getStyles||E;return y.jsx(he,{component:"p",ref:o,variant:x,size:p,...R("error",C?.getStyles?{className:l,style:c}:void 0),...S})});Xu.classes=to;Xu.displayName="@mantine/core/InputError";const u1={labelElement:"label"},lN=(e,{size:o})=>({label:{"--input-label-size":nn(o),"--input-asterisk-color":void 0}}),qu=ge((e,o)=>{const r=ce("InputLabel",u1,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,labelElement:p,size:g,required:v,htmlFor:x,onMouseDown:S,children:E,__staticSelector:C,variant:R,mod:T,...z}=ce("InputLabel",u1,r),A=_e({name:["InputWrapper",C],props:r,classes:to,className:l,style:c,classNames:a,styles:u,unstyled:f,rootSelector:"label",vars:h,varsResolver:lN}),N=ws(),B=N?.getStyles||A;return y.jsxs(he,{...B("label",N?.getStyles?{className:l,style:c}:void 0),component:p,variant:R,size:g,ref:o,htmlFor:p==="label"?x:void 0,mod:[{required:v},T],onMouseDown:M=>{S?.(M),!M.defaultPrevented&&M.detail>1&&M.preventDefault()},...z,children:[E,v&&y.jsx("span",{...B("required"),"aria-hidden":!0,children:" *"})]})});qu.classes=to;qu.displayName="@mantine/core/InputLabel";const f1={},Em=ge((e,o)=>{const r=ce("InputPlaceholder",f1,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,__staticSelector:p,variant:g,error:v,mod:x,...S}=ce("InputPlaceholder",f1,r),E=_e({name:["InputPlaceholder",p],props:r,classes:to,className:l,style:c,classNames:a,styles:u,unstyled:f,rootSelector:"placeholder"});return y.jsx(he,{...E("placeholder"),mod:[{error:!!v},x],component:"span",variant:g,ref:o,...S})});Em.classes=to;Em.displayName="@mantine/core/InputPlaceholder";function sN(e,{hasDescription:o,hasError:r}){const a=e.findIndex(h=>h==="input"),l=e.slice(0,a),c=e.slice(a+1),u=o&&l.includes("description")||r&&l.includes("error");return{offsetBottom:o&&c.includes("description")||r&&c.includes("error"),offsetTop:u}}const cN={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},uN=(e,{size:o})=>({label:{"--input-label-size":nn(o),"--input-asterisk-color":void 0},error:{"--input-error-size":o===void 0?void 0:`calc(${nn(o)} - ${oe(2)})`},description:{"--input-description-size":o===void 0?void 0:`calc(${nn(o)} - ${oe(2)})`}}),Rm=ge((e,o)=>{const r=ce("InputWrapper",cN,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,size:p,variant:g,__staticSelector:v,inputContainer:x,inputWrapperOrder:S,label:E,error:C,description:R,labelProps:T,descriptionProps:z,errorProps:A,labelElement:N,children:B,withAsterisk:M,id:$,required:L,__stylesApiProps:H,mod:I,...Y}=r,X=_e({name:["InputWrapper",v],props:H||r,classes:to,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:uN}),ee={size:p,variant:g,__staticSelector:v},ne=Jn($),re=typeof M=="boolean"?M:L,j=A?.id||`${ne}-error`,k=z?.id||`${ne}-description`,V=ne,P=!!C&&typeof C!="boolean",Z=!!R,D=`${P?j:""} ${Z?k:""}`,O=D.trim().length>0?D.trim():void 0,q=T?.id||`${ne}-label`,W=E&&y.jsx(qu,{labelElement:N,id:q,htmlFor:V,required:re,...ee,...T,children:E},"label"),ie=Z&&y.jsx(Gu,{...z,...ee,size:z?.size||ee.size,id:z?.id||k,children:R},"description"),ue=y.jsx(b.Fragment,{children:x(B)},"input"),ve=P&&b.createElement(Xu,{...A,...ee,size:A?.size||ee.size,key:"error",id:A?.id||j},C),fe=S.map(be=>{switch(be){case"label":return W;case"input":return ue;case"description":return ie;case"error":return ve;default:return null}});return y.jsx(oN,{value:{getStyles:X,describedBy:O,inputId:V,labelId:q,...sN(S,{hasDescription:Z,hasError:P})},children:y.jsx(he,{ref:o,variant:g,size:p,mod:[{error:!!C},I],...X("root"),...Y,children:fe})})});Rm.classes=to;Rm.displayName="@mantine/core/InputWrapper";const fN={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},dN=(e,o,r)=>({wrapper:{"--input-margin-top":r.offsetTop?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-margin-bottom":r.offsetBottom?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-height":Xe(o.size,"input-height"),"--input-fz":nn(o.size),"--input-radius":o.radius===void 0?void 0:kt(o.radius),"--input-left-section-width":o.leftSectionWidth!==void 0?oe(o.leftSectionWidth):void 0,"--input-right-section-width":o.rightSectionWidth!==void 0?oe(o.rightSectionWidth):void 0,"--input-padding-y":o.multiline?Xe(o.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":o.leftSectionPointerEvents,"--input-right-section-pointer-events":o.rightSectionPointerEvents}}),St=un((e,o)=>{const r=ce("Input",fN,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,required:h,__staticSelector:p,__stylesApiProps:g,size:v,wrapperProps:x,error:S,disabled:E,leftSection:C,leftSectionProps:R,leftSectionWidth:T,rightSection:z,rightSectionProps:A,rightSectionWidth:N,rightSectionPointerEvents:B,leftSectionPointerEvents:M,variant:$,vars:L,pointer:H,multiline:I,radius:Y,id:X,withAria:ee,withErrorStyles:ne,mod:re,inputSize:j,__clearSection:k,__clearable:V,__defaultRightSection:P,...Z}=r,{styleProps:D,rest:O}=qi(Z),q=ws(),W={offsetBottom:q?.offsetBottom,offsetTop:q?.offsetTop},ie=_e({name:["Input",p],props:g||r,classes:to,className:l,style:c,classNames:a,styles:u,unstyled:f,stylesCtx:W,rootSelector:"wrapper",vars:L,varsResolver:dN}),ue=ee?{required:h,disabled:E,"aria-invalid":!!S,"aria-describedby":q?.describedBy,id:q?.inputId||X}:{},ve=z||V&&k||P;return y.jsx(eN,{value:{size:v||"sm"},children:y.jsxs(he,{...ie("wrapper"),...D,...x,mod:[{error:!!S&&ne,pointer:H,disabled:E,multiline:I,"data-with-right-section":!!ve,"data-with-left-section":!!C},re],variant:$,size:v,children:[C&&y.jsx("div",{...R,"data-position":"left",...ie("section",{className:R?.className,style:R?.style}),children:C}),y.jsx(he,{component:"input",...O,...ue,ref:o,required:h,mod:{disabled:E,error:!!S&&ne},variant:$,__size:j,...ie("input")}),ve&&y.jsx("div",{...A,"data-position":"right",...ie("section",{className:A?.className,style:A?.style}),children:ve})]})})});St.classes=to;St.Wrapper=Rm;St.Label=qu;St.Error=Xu;St.Description=Gu;St.Placeholder=Em;St.ClearButton=$S;St.displayName="@mantine/core/Input";function hN(e,o,r){const a=ce(e,o,r),{label:l,description:c,error:u,required:f,classNames:h,styles:p,className:g,unstyled:v,__staticSelector:x,__stylesApiProps:S,errorProps:E,labelProps:C,descriptionProps:R,wrapperProps:T,id:z,size:A,style:N,inputContainer:B,inputWrapperOrder:M,withAsterisk:$,variant:L,vars:H,mod:I,...Y}=a,{styleProps:X,rest:ee}=qi(Y),ne={label:l,description:c,error:u,required:f,classNames:h,className:g,__staticSelector:x,__stylesApiProps:S||a,errorProps:E,labelProps:C,descriptionProps:R,unstyled:v,styles:p,size:A,style:N,inputContainer:B,inputWrapperOrder:M,withAsterisk:$,variant:L,id:z,mod:I,...T};return{...ee,classNames:h,styles:p,unstyled:v,wrapperProps:{...ne,...X},inputProps:{required:f,classNames:h,styles:p,unstyled:v,size:A,__staticSelector:x,__stylesApiProps:S||a,error:u,variant:L,id:z}}}const pN={__staticSelector:"InputBase",withAria:!0},cr=un((e,o)=>{const{inputProps:r,wrapperProps:a,...l}=hN("InputBase",pN,e);return y.jsx(St.Wrapper,{...a,children:y.jsx(St,{...r,...l,ref:o})})});cr.classes={...St.classes,...St.Wrapper.classes};cr.displayName="@mantine/core/InputBase";function mN(e,o){if(!o||!e)return!1;let r=o.parentNode;for(;r!=null;){if(r===e)return!0;r=r.parentNode}return!1}function gN({target:e,parent:o,ref:r,displayAfterTransitionEnd:a}){const l=b.useRef(-1),[c,u]=b.useState(!1),[f,h]=b.useState(typeof a=="boolean"?a:!1),p=()=>{if(!e||!o||!r.current)return;const S=e.getBoundingClientRect(),E=o.getBoundingClientRect(),C=window.getComputedStyle(e),R=window.getComputedStyle(o),T=Vr(C.borderTopWidth)+Vr(R.borderTopWidth),z=Vr(C.borderLeftWidth)+Vr(R.borderLeftWidth),A={top:S.top-E.top-T,left:S.left-E.left-z,width:S.width,height:S.height};r.current.style.transform=`translateY(${A.top}px) translateX(${A.left}px)`,r.current.style.width=`${A.width}px`,r.current.style.height=`${A.height}px`},g=()=>{window.clearTimeout(l.current),r.current&&(r.current.style.transitionDuration="0ms"),p(),l.current=window.setTimeout(()=>{r.current&&(r.current.style.transitionDuration="")},30)},v=b.useRef(null),x=b.useRef(null);return b.useEffect(()=>{if(p(),e)return v.current=new ResizeObserver(g),v.current.observe(e),o&&(x.current=new ResizeObserver(g),x.current.observe(o)),()=>{v.current?.disconnect(),x.current?.disconnect()}},[o,e]),b.useEffect(()=>{if(o){const S=E=>{mN(E.target,o)&&(g(),h(!1))};return o.addEventListener("transitionend",S),()=>{o.removeEventListener("transitionend",S)}}},[o]),lT(()=>{dT()!=="test"&&u(!0)},20,{autoInvoke:!0}),cT(S=>{S.forEach(E=>{E.type==="attributes"&&E.attributeName==="dir"&&g()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:c,hidden:f}}var LS={root:"m_96b553a6"};const vN={},yN=(e,{transitionDuration:o})=>({root:{"--transition-duration":typeof o=="number"?`${o}ms`:o}}),Tm=ge((e,o)=>{const r=ce("FloatingIndicator",vN,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,target:p,parent:g,transitionDuration:v,mod:x,displayAfterTransitionEnd:S,...E}=r,C=_e({name:"FloatingIndicator",classes:LS,props:r,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:yN}),R=b.useRef(null),{initialized:T,hidden:z}=gN({target:p,parent:g,ref:R,displayAfterTransitionEnd:S}),A=Mt(o,R);return!p||!g?null:y.jsx(he,{ref:A,mod:[{initialized:T,hidden:z},x],...C("root"),...E})});Tm.displayName="@mantine/core/FloatingIndicator";Tm.classes=LS;function kS({style:e,size:o=16,...r}){return y.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...e,width:oe(o),height:oe(o),display:"block"},...r,children:y.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}kS.displayName="@mantine/core/AccordionChevron";var HS={root:"m_66836ed3",wrapper:"m_a5d60502",body:"m_667c2793",title:"m_6a03f287",label:"m_698f4f23",icon:"m_667f2a6a",message:"m_7fa78076",closeButton:"m_87f54839"};const bN={},xN=(e,{radius:o,color:r,variant:a,autoContrast:l})=>{const c=e.variantColorResolver({color:r||e.primaryColor,theme:e,variant:a||"light",autoContrast:l});return{root:{"--alert-radius":o===void 0?void 0:kt(o),"--alert-bg":r||a?c.background:void 0,"--alert-color":c.color,"--alert-bd":r||a?c.border:void 0}}},Iu=ge((e,o)=>{const r=ce("Alert",bN,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,radius:p,color:g,title:v,children:x,id:S,icon:E,withCloseButton:C,onClose:R,closeButtonLabel:T,variant:z,autoContrast:A,...N}=r,B=_e({name:"Alert",classes:HS,props:r,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:xN}),M=Jn(S),$=v&&`${M}-title`||void 0,L=`${M}-body`;return y.jsx(he,{id:M,...B("root",{variant:z}),variant:z,ref:o,...N,role:"alert","aria-describedby":L,"aria-labelledby":$,children:y.jsxs("div",{...B("wrapper"),children:[E&&y.jsx("div",{...B("icon"),children:E}),y.jsxs("div",{...B("body"),children:[v&&y.jsx("div",{...B("title"),"data-with-close-button":C||void 0,children:y.jsx("span",{id:$,...B("label"),children:v})}),x&&y.jsx("div",{id:L,...B("message"),"data-variant":z,children:x})]}),C&&y.jsx(Wi,{...B("closeButton"),onClick:R,variant:"transparent",size:16,iconSize:16,"aria-label":T,unstyled:f})]})})});Iu.classes=HS;Iu.displayName="@mantine/core/Alert";var US={root:"m_b6d8b162"};function SN(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const wN={inherit:!1},CN=(e,{variant:o,lineClamp:r,gradient:a,size:l,color:c})=>({root:{"--text-fz":nn(l),"--text-lh":PR(l),"--text-gradient":o==="gradient"?gp(a,e):void 0,"--text-line-clamp":typeof r=="number"?r.toString():void 0,"--text-color":c?Zt(c,e):void 0}}),Ve=un((e,o)=>{const r=ce("Text",wN,e),{lineClamp:a,truncate:l,inline:c,inherit:u,gradient:f,span:h,__staticSelector:p,vars:g,className:v,style:x,classNames:S,styles:E,unstyled:C,variant:R,mod:T,size:z,...A}=r,N=_e({name:["Text",p],props:r,classes:US,className:v,style:x,classNames:S,styles:E,unstyled:C,vars:g,varsResolver:CN});return y.jsx(he,{...N("root",{focusable:!0}),ref:o,component:h?"span":"p",variant:R,mod:[{"data-truncate":SN(l),"data-line-clamp":typeof a=="number","data-inline":c,"data-inherit":u},T],size:z,...A})});Ve.classes=US;Ve.displayName="@mantine/core/Text";const[EN,Ji]=zo("AppShell was not found in tree");var Ir={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const RN={},_m=ge((e,o)=>{const r=ce("AppShellAside",RN,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,withBorder:p,zIndex:g,mod:v,...x}=r,S=Ji();return S.disabled?null:y.jsx(he,{component:"aside",ref:o,mod:[{"with-border":p??S.withBorder},v],...S.getStyles("aside",{className:l,classNames:a,styles:u,style:c}),...x,__vars:{"--app-shell-aside-z-index":`calc(${g??S.zIndex} + 1)`}})});_m.classes=Ir;_m.displayName="@mantine/core/AppShellAside";const TN={},Dm=ge((e,o)=>{const r=ce("AppShellFooter",TN,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,withBorder:p,zIndex:g,mod:v,...x}=r,S=Ji();return S.disabled?null:y.jsx(he,{component:"footer",ref:o,mod:[{"with-border":p??S.withBorder},v],...S.getStyles("footer",{className:zt({[ki.classNames.zeroRight]:S.offsetScrollbars},l),classNames:a,styles:u,style:c}),...x,__vars:{"--app-shell-footer-z-index":(g??S.zIndex)?.toString()}})});Dm.classes=Ir;Dm.displayName="@mantine/core/AppShellFooter";const _N={},Nm=ge((e,o)=>{const r=ce("AppShellHeader",_N,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,withBorder:p,zIndex:g,mod:v,...x}=r,S=Ji();return S.disabled?null:y.jsx(he,{component:"header",ref:o,mod:[{"with-border":p??S.withBorder},v],...S.getStyles("header",{className:zt({[ki.classNames.zeroRight]:S.offsetScrollbars},l),classNames:a,styles:u,style:c}),...x,__vars:{"--app-shell-header-z-index":(g??S.zIndex)?.toString()}})});Nm.classes=Ir;Nm.displayName="@mantine/core/AppShellHeader";const DN={},Am=ge((e,o)=>{const r=ce("AppShellMain",DN,e),{classNames:a,className:l,style:c,styles:u,vars:f,...h}=r,p=Ji();return y.jsx(he,{component:"main",ref:o,...p.getStyles("main",{className:l,style:c,classNames:a,styles:u}),...h})});Am.classes=Ir;Am.displayName="@mantine/core/AppShellMain";function Cs(e){return typeof e=="object"?e.base:e}function Es(e){const o=typeof e=="object"&&e!==null&&typeof e.base<"u"&&Object.keys(e).length===1;return typeof e=="number"||typeof e=="string"||o}function Rs(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function NN({baseStyles:e,minMediaStyles:o,maxMediaStyles:r,aside:a,theme:l}){const c=a?.width,u="translateX(var(--app-shell-aside-width))",f="translateX(calc(var(--app-shell-aside-width) * -1))";if(a?.breakpoint&&!a?.collapsed?.mobile&&(r[a?.breakpoint]=r[a?.breakpoint]||{},r[a?.breakpoint]["--app-shell-aside-width"]="100%",r[a?.breakpoint]["--app-shell-aside-offset"]="0px"),Es(c)){const h=oe(Cs(c));e["--app-shell-aside-width"]=h,e["--app-shell-aside-offset"]=h}if(Rs(c)&&(typeof c.base<"u"&&(e["--app-shell-aside-width"]=oe(c.base),e["--app-shell-aside-offset"]=oe(c.base)),At(c).forEach(h=>{h!=="base"&&(o[h]=o[h]||{},o[h]["--app-shell-aside-width"]=oe(c[h]),o[h]["--app-shell-aside-offset"]=oe(c[h]))})),a?.collapsed?.desktop){const h=a.breakpoint;o[h]=o[h]||{},o[h]["--app-shell-aside-transform"]=u,o[h]["--app-shell-aside-transform-rtl"]=f,o[h]["--app-shell-aside-offset"]="0px !important"}if(a?.collapsed?.mobile){const h=Zp(a.breakpoint,l.breakpoints)-.1;r[h]=r[h]||{},r[h]["--app-shell-aside-width"]="100%",r[h]["--app-shell-aside-offset"]="0px",r[h]["--app-shell-aside-transform"]=u,r[h]["--app-shell-aside-transform-rtl"]=f}}function AN({baseStyles:e,minMediaStyles:o,footer:r}){const a=r?.height,l="translateY(var(--app-shell-footer-height))",c=r?.offset??!0;if(Es(a)){const u=oe(Cs(a));e["--app-shell-footer-height"]=u,c&&(e["--app-shell-footer-offset"]=u)}Rs(a)&&(typeof a.base<"u"&&(e["--app-shell-footer-height"]=oe(a.base),c&&(e["--app-shell-footer-offset"]=oe(a.base))),At(a).forEach(u=>{u!=="base"&&(o[u]=o[u]||{},o[u]["--app-shell-footer-height"]=oe(a[u]),c&&(o[u]["--app-shell-footer-offset"]=oe(a[u])))})),r?.collapsed&&(e["--app-shell-footer-transform"]=l,e["--app-shell-footer-offset"]="0px !important")}function zN({baseStyles:e,minMediaStyles:o,header:r}){const a=r?.height,l="translateY(calc(var(--app-shell-header-height) * -1))",c=r?.offset??!0;if(Es(a)){const u=oe(Cs(a));e["--app-shell-header-height"]=u,c&&(e["--app-shell-header-offset"]=u)}Rs(a)&&(typeof a.base<"u"&&(e["--app-shell-header-height"]=oe(a.base),c&&(e["--app-shell-header-offset"]=oe(a.base))),At(a).forEach(u=>{u!=="base"&&(o[u]=o[u]||{},o[u]["--app-shell-header-height"]=oe(a[u]),c&&(o[u]["--app-shell-header-offset"]=oe(a[u])))})),r?.collapsed&&(e["--app-shell-header-transform"]=l,e["--app-shell-header-offset"]="0px !important")}function MN({baseStyles:e,minMediaStyles:o,maxMediaStyles:r,navbar:a,theme:l}){const c=a?.width,u="translateX(calc(var(--app-shell-navbar-width) * -1))",f="translateX(var(--app-shell-navbar-width))";if(a?.breakpoint&&!a?.collapsed?.mobile&&(r[a?.breakpoint]=r[a?.breakpoint]||{},r[a?.breakpoint]["--app-shell-navbar-width"]="100%",r[a?.breakpoint]["--app-shell-navbar-offset"]="0px"),Es(c)){const h=oe(Cs(c));e["--app-shell-navbar-width"]=h,e["--app-shell-navbar-offset"]=h}if(Rs(c)&&(typeof c.base<"u"&&(e["--app-shell-navbar-width"]=oe(c.base),e["--app-shell-navbar-offset"]=oe(c.base)),At(c).forEach(h=>{h!=="base"&&(o[h]=o[h]||{},o[h]["--app-shell-navbar-width"]=oe(c[h]),o[h]["--app-shell-navbar-offset"]=oe(c[h]))})),a?.collapsed?.desktop){const h=a.breakpoint;o[h]=o[h]||{},o[h]["--app-shell-navbar-transform"]=u,o[h]["--app-shell-navbar-transform-rtl"]=f,o[h]["--app-shell-navbar-offset"]="0px !important"}if(a?.collapsed?.mobile){const h=Zp(a.breakpoint,l.breakpoints)-.1;r[h]=r[h]||{},r[h]["--app-shell-navbar-width"]="100%",r[h]["--app-shell-navbar-offset"]="0px",r[h]["--app-shell-navbar-transform"]=u,r[h]["--app-shell-navbar-transform-rtl"]=f}}function Ih(e){return Number(e)===0?"0px":sn(e)}function ON({padding:e,baseStyles:o,minMediaStyles:r}){Es(e)&&(o["--app-shell-padding"]=Ih(Cs(e))),Rs(e)&&(e.base&&(o["--app-shell-padding"]=Ih(e.base)),At(e).forEach(a=>{a!=="base"&&(r[a]=r[a]||{},r[a]["--app-shell-padding"]=Ih(e[a]))}))}function jN({navbar:e,header:o,footer:r,aside:a,padding:l,theme:c}){const u={},f={},h={};MN({baseStyles:h,minMediaStyles:u,maxMediaStyles:f,navbar:e,theme:c}),NN({baseStyles:h,minMediaStyles:u,maxMediaStyles:f,aside:a,theme:c}),zN({baseStyles:h,minMediaStyles:u,header:o}),AN({baseStyles:h,minMediaStyles:u,footer:r}),ON({baseStyles:h,minMediaStyles:u,padding:l});const p=pp(At(u),c.breakpoints).map(x=>({query:`(min-width: ${du(x.px)})`,styles:u[x.value]})),g=pp(At(f),c.breakpoints).map(x=>({query:`(max-width: ${du(x.px)})`,styles:f[x.value]})),v=[...p,...g];return{baseStyles:h,media:v}}function BN({navbar:e,header:o,aside:r,footer:a,padding:l}){const c=cn(),u=ar(),{media:f,baseStyles:h}=jN({navbar:e,header:o,footer:a,aside:r,padding:l,theme:c});return y.jsx(Ou,{media:f,styles:h,selector:u.cssVariablesSelector})}const $N={},zm=ge((e,o)=>{const r=ce("AppShellNavbar",$N,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,withBorder:p,zIndex:g,mod:v,...x}=r,S=Ji();return S.disabled?null:y.jsx(he,{component:"nav",ref:o,mod:[{"with-border":p??S.withBorder},v],...S.getStyles("navbar",{className:l,classNames:a,styles:u,style:c}),...x,__vars:{"--app-shell-navbar-z-index":`calc(${g??S.zIndex} + 1)`}})});zm.classes=Ir;zm.displayName="@mantine/core/AppShellNavbar";const LN={},Mm=un((e,o)=>{const r=ce("AppShellSection",LN,e),{classNames:a,className:l,style:c,styles:u,vars:f,grow:h,mod:p,...g}=r,v=Ji();return y.jsx(he,{ref:o,mod:[{grow:h},p],...v.getStyles("section",{className:l,style:c,classNames:a,styles:u}),...g})});Mm.classes=Ir;Mm.displayName="@mantine/core/AppShellSection";function kN({transitionDuration:e,disabled:o}){const[r,a]=b.useState(!0),l=b.useRef(-1),c=b.useRef(-1);return Sx("resize",()=>{a(!0),clearTimeout(l.current),l.current=window.setTimeout(()=>b.startTransition(()=>{a(!1)}),200)}),Gi(()=>{a(!0),clearTimeout(c.current),c.current=window.setTimeout(()=>b.startTransition(()=>{a(!1)}),e||0)},[o,e]),r}const HN={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:vo("app")},UN=(e,{transitionDuration:o,transitionTimingFunction:r})=>({root:{"--app-shell-transition-duration":`${o}ms`,"--app-shell-transition-timing-function":r}}),mo=ge((e,o)=>{const r=ce("AppShell",HN,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,navbar:p,withBorder:g,padding:v,transitionDuration:x,transitionTimingFunction:S,header:E,zIndex:C,layout:R,disabled:T,aside:z,footer:A,offsetScrollbars:N=R!=="alt",mod:B,...M}=r,$=_e({name:"AppShell",classes:Ir,props:r,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:UN}),L=kN({disabled:T,transitionDuration:x});return y.jsxs(EN,{value:{getStyles:$,withBorder:g,zIndex:C,disabled:T,offsetScrollbars:N},children:[y.jsx(BN,{navbar:p,header:E,aside:z,footer:A,padding:v}),y.jsx(he,{ref:o,...$("root"),mod:[{resizing:L,layout:R,disabled:T},B],...M})]})});mo.classes=Ir;mo.displayName="@mantine/core/AppShell";mo.Navbar=zm;mo.Header=Nm;mo.Main=Am;mo.Aside=_m;mo.Footer=Dm;mo.Section=Mm;function PS(e){return typeof e=="string"?{value:e,label:e}:"value"in e&&!("label"in e)?{value:e.value,label:e.value,disabled:e.disabled}:typeof e=="number"?{value:e.toString(),label:e.toString()}:"group"in e?{group:e.group,items:e.items.map(o=>PS(o))}:e}function PN(e){return e?e.map(o=>PS(o)):[]}function VS(e){return e.reduce((o,r)=>"group"in r?{...o,...VS(r.items)}:(o[r.value]=r,o),{})}var En={dropdown:"m_88b62a41",search:"m_985517d8",options:"m_b2821a6e",option:"m_92253aa5",empty:"m_2530cd1d",header:"m_858f94bd",footer:"m_82b967cb",group:"m_254f3e4f",groupLabel:"m_2bb2e9e5",chevron:"m_2943220b",optionsDropdownOption:"m_390b5f4",optionsDropdownCheckIcon:"m_8ee53fc2"};const VN={error:null},YN=(e,{size:o,color:r})=>({chevron:{"--combobox-chevron-size":Xe(o,"combobox-chevron-size"),"--combobox-chevron-color":r?Zt(r,e):void 0}}),Om=ge((e,o)=>{const r=ce("ComboboxChevron",VN,e),{size:a,error:l,style:c,className:u,classNames:f,styles:h,unstyled:p,vars:g,mod:v,...x}=r,S=_e({name:"ComboboxChevron",classes:En,props:r,style:c,className:u,classNames:f,styles:h,unstyled:p,vars:g,varsResolver:YN,rootSelector:"chevron"});return y.jsx(he,{component:"svg",...x,...S("chevron"),size:a,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:l},v],ref:o,children:y.jsx("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})});Om.classes=En;Om.displayName="@mantine/core/ComboboxChevron";const[GN,no]=zo("Combobox component was not found in tree"),YS=b.forwardRef(({size:e,onMouseDown:o,onClick:r,onClear:a,...l},c)=>y.jsx(St.ClearButton,{ref:c,tabIndex:-1,"aria-hidden":!0,...l,onMouseDown:u=>{u.preventDefault(),o?.(u)},onClick:u=>{a(),r?.(u)}}));YS.displayName="@mantine/core/ComboboxClearButton";const XN={},jm=ge((e,o)=>{const{classNames:r,styles:a,className:l,style:c,hidden:u,...f}=ce("ComboboxDropdown",XN,e),h=no();return y.jsx(Rn.Dropdown,{...f,ref:o,role:"presentation","data-hidden":u||void 0,...h.getStyles("dropdown",{className:l,style:c,classNames:r,styles:a})})});jm.classes=En;jm.displayName="@mantine/core/ComboboxDropdown";const qN={refProp:"ref"},GS=ge((e,o)=>{const{children:r,refProp:a}=ce("ComboboxDropdownTarget",qN,e);if(no(),!rr(r))throw new Error("Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return y.jsx(Rn.Target,{ref:o,refProp:a,children:r})});GS.displayName="@mantine/core/ComboboxDropdownTarget";const IN={},Bm=ge((e,o)=>{const{classNames:r,className:a,style:l,styles:c,vars:u,...f}=ce("ComboboxEmpty",IN,e),h=no();return y.jsx(he,{ref:o,...h.getStyles("empty",{className:a,classNames:r,styles:c,style:l}),...f})});Bm.classes=En;Bm.displayName="@mantine/core/ComboboxEmpty";function $m({onKeyDown:e,withKeyboardNavigation:o,withAriaAttributes:r,withExpandedAttribute:a,targetType:l,autoComplete:c}){const u=no(),[f,h]=b.useState(null),p=v=>{if(e?.(v),!u.readOnly&&o){if(v.nativeEvent.isComposing)return;if(v.nativeEvent.code==="ArrowDown"&&(v.preventDefault(),u.store.dropdownOpened?h(u.store.selectNextOption()):(u.store.openDropdown("keyboard"),h(u.store.selectActiveOption()),u.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),v.nativeEvent.code==="ArrowUp"&&(v.preventDefault(),u.store.dropdownOpened?h(u.store.selectPreviousOption()):(u.store.openDropdown("keyboard"),h(u.store.selectActiveOption()),u.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),v.nativeEvent.code==="Enter"||v.nativeEvent.code==="NumpadEnter"){if(v.nativeEvent.keyCode===229)return;const x=u.store.getSelectedOptionIndex();u.store.dropdownOpened&&x!==-1?(v.preventDefault(),u.store.clickSelectedOption()):l==="button"&&(v.preventDefault(),u.store.openDropdown("keyboard"))}v.key==="Escape"&&u.store.closeDropdown("keyboard"),v.nativeEvent.code==="Space"&&l==="button"&&(v.preventDefault(),u.store.toggleDropdown("keyboard"))}};return{...r?{"aria-haspopup":"listbox","aria-expanded":a&&!!(u.store.listId&&u.store.dropdownOpened)||void 0,"aria-controls":u.store.dropdownOpened?u.store.listId:void 0,"aria-activedescendant":u.store.dropdownOpened&&f||void 0,autoComplete:c,"data-expanded":u.store.dropdownOpened||void 0,"data-mantine-stop-propagation":u.store.dropdownOpened||void 0}:{},onKeyDown:p}}const FN={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},XS=ge((e,o)=>{const{children:r,refProp:a,withKeyboardNavigation:l,withAriaAttributes:c,withExpandedAttribute:u,targetType:f,autoComplete:h,...p}=ce("ComboboxEventsTarget",FN,e);if(!rr(r))throw new Error("Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const g=no(),v=$m({targetType:f,withAriaAttributes:c,withKeyboardNavigation:l,withExpandedAttribute:u,onKeyDown:r.props.onKeyDown,autoComplete:h});return b.cloneElement(r,{...v,...p,[a]:Mt(o,g.store.targetRef,Au(r))})});XS.displayName="@mantine/core/ComboboxEventsTarget";const ZN={},Lm=ge((e,o)=>{const{classNames:r,className:a,style:l,styles:c,vars:u,...f}=ce("ComboboxFooter",ZN,e),h=no();return y.jsx(he,{ref:o,...h.getStyles("footer",{className:a,classNames:r,style:l,styles:c}),...f,onMouseDown:p=>{p.preventDefault()}})});Lm.classes=En;Lm.displayName="@mantine/core/ComboboxFooter";const QN={},km=ge((e,o)=>{const{classNames:r,className:a,style:l,styles:c,vars:u,children:f,label:h,...p}=ce("ComboboxGroup",QN,e),g=no();return y.jsxs(he,{ref:o,...g.getStyles("group",{className:a,classNames:r,style:l,styles:c}),...p,children:[h&&y.jsx("div",{...g.getStyles("groupLabel",{classNames:r,styles:c}),children:h}),f]})});km.classes=En;km.displayName="@mantine/core/ComboboxGroup";const KN={},Hm=ge((e,o)=>{const{classNames:r,className:a,style:l,styles:c,vars:u,...f}=ce("ComboboxHeader",KN,e),h=no();return y.jsx(he,{ref:o,...h.getStyles("header",{className:a,classNames:r,style:l,styles:c}),...f,onMouseDown:p=>{p.preventDefault()}})});Hm.classes=En;Hm.displayName="@mantine/core/ComboboxHeader";function qS({value:e,valuesDivider:o=",",...r}){return y.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(o):e||"",...r})}qS.displayName="@mantine/core/ComboboxHiddenInput";const WN={},Um=ge((e,o)=>{const r=ce("ComboboxOption",WN,e),{classNames:a,className:l,style:c,styles:u,vars:f,onClick:h,id:p,active:g,onMouseDown:v,onMouseOver:x,disabled:S,selected:E,mod:C,...R}=r,T=no(),z=b.useId(),A=p||z;return y.jsx(he,{...T.getStyles("option",{className:l,classNames:a,styles:u,style:c}),...R,ref:o,id:A,mod:["combobox-option",{"combobox-active":g,"combobox-disabled":S,"combobox-selected":E},C],role:"option",onClick:N=>{S?N.preventDefault():(T.onOptionSubmit?.(r.value,r),h?.(N))},onMouseDown:N=>{N.preventDefault(),v?.(N)},onMouseOver:N=>{T.resetSelectionOnOptionHover&&T.store.resetSelectedOption(),x?.(N)}})});Um.classes=En;Um.displayName="@mantine/core/ComboboxOption";const JN={},Pm=ge((e,o)=>{const r=ce("ComboboxOptions",JN,e),{classNames:a,className:l,style:c,styles:u,id:f,onMouseDown:h,labelledBy:p,...g}=r,v=no(),x=Jn(f);return b.useEffect(()=>{v.store.setListId(x)},[x]),y.jsx(he,{ref:o,...v.getStyles("options",{className:l,style:c,classNames:a,styles:u}),...g,id:x,role:"listbox","aria-labelledby":p,onMouseDown:S=>{S.preventDefault(),h?.(S)}})});Pm.classes=En;Pm.displayName="@mantine/core/ComboboxOptions";const eA={withAriaAttributes:!0,withKeyboardNavigation:!0},Vm=ge((e,o)=>{const r=ce("ComboboxSearch",eA,e),{classNames:a,styles:l,unstyled:c,vars:u,withAriaAttributes:f,onKeyDown:h,withKeyboardNavigation:p,size:g,...v}=r,x=no(),S=x.getStyles("search"),E=$m({targetType:"input",withAriaAttributes:f,withKeyboardNavigation:p,withExpandedAttribute:!1,onKeyDown:h,autoComplete:"off"});return y.jsx(St,{ref:Mt(o,x.store.searchRef),classNames:[{input:S.className},a],styles:[{input:S.style},l],size:g||x.size,...E,...v,__staticSelector:"Combobox"})});Vm.classes=En;Vm.displayName="@mantine/core/ComboboxSearch";const tA={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},IS=ge((e,o)=>{const{children:r,refProp:a,withKeyboardNavigation:l,withAriaAttributes:c,withExpandedAttribute:u,targetType:f,autoComplete:h,...p}=ce("ComboboxTarget",tA,e);if(!rr(r))throw new Error("Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const g=no(),v=$m({targetType:f,withAriaAttributes:c,withKeyboardNavigation:l,withExpandedAttribute:u,onKeyDown:r.props.onKeyDown,autoComplete:h}),x=b.cloneElement(r,{...v,...p});return y.jsx(Rn.Target,{ref:Mt(o,g.store.targetRef),children:x})});IS.displayName="@mantine/core/ComboboxTarget";function nA(e,o,r){for(let a=e-1;a>=0;a-=1)if(!o[a].hasAttribute("data-combobox-disabled"))return a;if(r){for(let a=o.length-1;a>-1;a-=1)if(!o[a].hasAttribute("data-combobox-disabled"))return a}return e}function oA(e,o,r){for(let a=e+1;a{f||(h(!0),l?.(j))},[h,l,f]),T=b.useCallback((j="unknown")=>{f&&(h(!1),a?.(j))},[h,a,f]),z=b.useCallback((j="unknown")=>{f?T(j):R(j)},[T,R,f]),A=b.useCallback(()=>{const j=document.querySelector(`#${p.current} [data-combobox-selected]`);j?.removeAttribute("data-combobox-selected"),j?.removeAttribute("aria-selected")},[]),N=b.useCallback(j=>{const V=document.getElementById(p.current)?.querySelectorAll("[data-combobox-option]");if(!V)return null;const P=j>=V.length?0:j<0?V.length-1:j;return g.current=P,V?.[P]&&!V[P].hasAttribute("data-combobox-disabled")?(A(),V[P].setAttribute("data-combobox-selected","true"),V[P].setAttribute("aria-selected","true"),V[P].scrollIntoView({block:"nearest",behavior:u}),V[P].id):null},[u,A]),B=b.useCallback(()=>{const j=document.querySelector(`#${p.current} [data-combobox-active]`);if(j){const k=document.querySelectorAll(`#${p.current} [data-combobox-option]`),V=Array.from(k).findIndex(P=>P===j);return N(V)}return N(0)},[N]),M=b.useCallback(()=>N(oA(g.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),c)),[N,c]),$=b.useCallback(()=>N(nA(g.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),c)),[N,c]),L=b.useCallback(()=>N(rA(document.querySelectorAll(`#${p.current} [data-combobox-option]`))),[N]),H=b.useCallback((j="selected",k)=>{C.current=window.setTimeout(()=>{const V=document.querySelectorAll(`#${p.current} [data-combobox-option]`),P=Array.from(V).findIndex(Z=>Z.hasAttribute(`data-combobox-${j}`));g.current=P,k?.scrollIntoView&&V[P]?.scrollIntoView({block:"nearest",behavior:u})},0)},[]),I=b.useCallback(()=>{g.current=-1,A()},[A]),Y=b.useCallback(()=>{document.querySelectorAll(`#${p.current} [data-combobox-option]`)?.[g.current]?.click()},[]),X=b.useCallback(j=>{p.current=j},[]),ee=b.useCallback(()=>{S.current=window.setTimeout(()=>v.current.focus(),0)},[]),ne=b.useCallback(()=>{E.current=window.setTimeout(()=>x.current.focus(),0)},[]),re=b.useCallback(()=>g.current,[]);return b.useEffect(()=>()=>{window.clearTimeout(S.current),window.clearTimeout(E.current),window.clearTimeout(C.current)},[]),{dropdownOpened:f,openDropdown:R,closeDropdown:T,toggleDropdown:z,selectedOptionIndex:g.current,getSelectedOptionIndex:re,selectOption:N,selectFirstOption:L,selectActiveOption:B,selectNextOption:M,selectPreviousOption:$,resetSelectedOption:I,updateSelectedOptionIndex:H,listId:p.current,setListId:X,clickSelectedOption:Y,searchRef:v,focusSearchInput:ee,targetRef:x,focusTarget:ne}}const aA={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},iA=(e,{size:o,dropdownPadding:r})=>({options:{"--combobox-option-fz":nn(o),"--combobox-option-padding":Xe(o,"combobox-option-padding")},dropdown:{"--combobox-padding":r===void 0?void 0:oe(r),"--combobox-option-fz":nn(o),"--combobox-option-padding":Xe(o,"combobox-option-padding")}});function lt(e){const o=ce("Combobox",aA,e),{classNames:r,styles:a,unstyled:l,children:c,store:u,vars:f,onOptionSubmit:h,onClose:p,size:g,dropdownPadding:v,resetSelectionOnOptionHover:x,__staticSelector:S,readOnly:E,...C}=o,R=FS(),T=u||R,z=_e({name:S||"Combobox",classes:En,props:o,classNames:r,styles:a,unstyled:l,vars:f,varsResolver:iA}),A=()=>{p?.(),T.closeDropdown()};return y.jsx(GN,{value:{getStyles:z,store:T,onOptionSubmit:h,size:g,resetSelectionOnOptionHover:x,readOnly:E},children:y.jsx(Rn,{opened:T.dropdownOpened,...C,onChange:N=>!N&&A(),withRoles:!1,unstyled:l,children:c})})}const lA=e=>e;lt.extend=lA;lt.classes=En;lt.displayName="@mantine/core/Combobox";lt.Target=IS;lt.Dropdown=jm;lt.Options=Pm;lt.Option=Um;lt.Search=Vm;lt.Empty=Bm;lt.Chevron=Om;lt.Footer=Lm;lt.Header=Hm;lt.EventsTarget=XS;lt.DropdownTarget=GS;lt.Group=km;lt.ClearButton=YS;lt.HiddenInput=qS;var ZS={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const QS=ZS,Ym=b.forwardRef(({__staticSelector:e,__stylesApiProps:o,className:r,classNames:a,styles:l,unstyled:c,children:u,label:f,description:h,id:p,disabled:g,error:v,size:x,labelPosition:S="left",bodyElement:E="div",labelElement:C="label",variant:R,style:T,vars:z,mod:A,...N},B)=>{const M=_e({name:e,props:o,className:r,style:T,classes:ZS,classNames:a,styles:l,unstyled:c});return y.jsx(he,{...M("root"),ref:B,__vars:{"--label-fz":nn(x),"--label-lh":Xe(x,"label-lh")},mod:[{"label-position":S},A],variant:R,size:x,...N,children:y.jsxs(he,{component:E,htmlFor:E==="label"?p:void 0,...M("body"),children:[u,y.jsxs("div",{...M("labelWrapper"),"data-disabled":g||void 0,children:[f&&y.jsx(he,{component:C,htmlFor:C==="label"?p:void 0,...M("label"),"data-disabled":g||void 0,children:f}),h&&y.jsx(St.Description,{size:x,__inheritStyles:!1,...M("description"),children:h}),v&&typeof v!="boolean"&&y.jsx(St.Error,{size:x,__inheritStyles:!1,...M("error"),children:v})]})]})})});Ym.displayName="@mantine/core/InlineInput";const KS=b.createContext(null),sA=KS.Provider,WS=()=>b.useContext(KS),[cA,uA]=Ss();var JS={card:"m_26775b0a"};const fA={withBorder:!0},dA=(e,{radius:o})=>({card:{"--card-radius":kt(o)}}),Gm=ge((e,o)=>{const r=ce("CheckboxCard",fA,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,checked:p,mod:g,withBorder:v,value:x,onClick:S,defaultChecked:E,onChange:C,...R}=r,T=_e({name:"CheckboxCard",classes:JS,props:r,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:dA,rootSelector:"card"}),z=WS(),A=typeof p=="boolean"?p:z?z.value.includes(x||""):void 0,[N,B]=Wn({value:A,defaultValue:E,finalValue:!1,onChange:C});return y.jsx(cA,{value:{checked:N},children:y.jsx($n,{ref:o,mod:[{"with-border":v,checked:N},g],...T("card"),...R,role:"checkbox","aria-checked":N,onClick:M=>{S?.(M),z?.onChange(x||""),B(!N)}})})});Gm.displayName="@mantine/core/CheckboxCard";Gm.classes=JS;function ew({children:e,role:o}){const r=ws();return r?y.jsx("div",{role:o,"aria-labelledby":r.labelId,"aria-describedby":r.describedBy,children:e}):y.jsx(y.Fragment,{children:e})}const hA={},Xm=ge((e,o)=>{const{value:r,defaultValue:a,onChange:l,size:c,wrapperProps:u,children:f,readOnly:h,...p}=ce("CheckboxGroup",hA,e),[g,v]=Wn({value:r,defaultValue:a,finalValue:[],onChange:l}),x=S=>{const E=typeof S=="string"?S:S.currentTarget.value;!h&&v(g.includes(E)?g.filter(C=>C!==E):[...g,E])};return y.jsx(sA,{value:{value:g,onChange:x,size:c},children:y.jsx(St.Wrapper,{size:c,ref:o,...u,...p,labelElement:"div",__staticSelector:"CheckboxGroup",children:y.jsx(ew,{role:"group",children:f})})})});Xm.classes=St.Wrapper.classes;Xm.displayName="@mantine/core/CheckboxGroup";function tw({size:e,style:o,...r}){const a=e!==void 0?{width:oe(e),height:oe(e),...o}:o;return y.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:a,"aria-hidden":!0,...r,children:y.jsx("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function nw({indeterminate:e,...o}){return e?y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...o,children:y.jsx("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):y.jsx(tw,{...o})}var ow={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const pA={icon:nw},mA=(e,{radius:o,color:r,size:a,iconColor:l,variant:c,autoContrast:u})=>{const f=ir({color:r||e.primaryColor,theme:e}),h=f.isThemeColor&&f.shade===void 0?`var(--mantine-color-${f.color}-outline)`:f.color;return{indicator:{"--checkbox-size":Xe(a,"checkbox-size"),"--checkbox-radius":o===void 0?void 0:kt(o),"--checkbox-color":c==="outline"?h:Zt(r,e),"--checkbox-icon-color":l?Zt(l,e):Nx(u,e)?Mu({color:r,theme:e,autoContrast:u}):void 0}}},qm=ge((e,o)=>{const r=ce("CheckboxIndicator",pA,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,icon:p,indeterminate:g,radius:v,color:x,iconColor:S,autoContrast:E,checked:C,mod:R,variant:T,disabled:z,...A}=r,N=p,B=_e({name:"CheckboxIndicator",classes:ow,props:r,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:mA,rootSelector:"indicator"}),M=uA(),$=typeof C=="boolean"||typeof g=="boolean"?C||g:M?.checked||!1;return y.jsx(he,{ref:o,...B("indicator",{variant:T}),variant:T,mod:[{checked:$,disabled:z},R],...A,children:y.jsx(N,{indeterminate:g,...B("icon")})})});qm.displayName="@mantine/core/CheckboxIndicator";qm.classes=ow;var rw={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const gA={labelPosition:"right",icon:nw},vA=(e,{radius:o,color:r,size:a,iconColor:l,variant:c,autoContrast:u})=>{const f=ir({color:r||e.primaryColor,theme:e}),h=f.isThemeColor&&f.shade===void 0?`var(--mantine-color-${f.color}-outline)`:f.color;return{root:{"--checkbox-size":Xe(a,"checkbox-size"),"--checkbox-radius":o===void 0?void 0:kt(o),"--checkbox-color":c==="outline"?h:Zt(r,e),"--checkbox-icon-color":l?Zt(l,e):Nx(u,e)?Mu({color:r,theme:e,autoContrast:u}):void 0}}},el=ge((e,o)=>{const r=ce("Checkbox",gA,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,color:p,label:g,id:v,size:x,radius:S,wrapperProps:E,checked:C,labelPosition:R,description:T,error:z,disabled:A,variant:N,indeterminate:B,icon:M,rootRef:$,iconColor:L,onChange:H,autoContrast:I,mod:Y,...X}=r,ee=WS(),ne=x||ee?.size,re=M,j=_e({name:"Checkbox",props:r,classes:rw,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:vA}),{styleProps:k,rest:V}=qi(X),P=Jn(v),Z=ee?{checked:ee.value.includes(V.value),onChange:q=>{ee.onChange(q),H?.(q)}}:{},D=b.useRef(null),O=o||D;return b.useEffect(()=>{O&&"current"in O&&O.current&&(O.current.indeterminate=B||!1)},[B,O]),y.jsx(Ym,{...j("root"),__staticSelector:"Checkbox",__stylesApiProps:r,id:P,size:ne,labelPosition:R,label:g,description:T,error:z,disabled:A,classNames:a,styles:u,unstyled:f,"data-checked":Z.checked||C||void 0,variant:N,ref:$,mod:Y,...k,...E,children:y.jsxs(he,{...j("inner"),mod:{"data-label-position":R},children:[y.jsx(he,{component:"input",id:P,ref:O,checked:C,disabled:A,mod:{error:!!z,indeterminate:B},...j("input",{focusable:!0,variant:N}),onChange:H,...V,...Z,type:"checkbox"}),y.jsx(re,{indeterminate:B,...j("icon")})]})})});el.classes={...rw,...QS};el.displayName="@mantine/core/Checkbox";el.Group=Xm;el.Indicator=qm;el.Card=Gm;function ps(e){return"group"in e}function aw({options:e,search:o,limit:r}){const a=o.trim().toLowerCase(),l=[];for(let c=0;c0)return!1;return!0}function iw(e,o=new Set){if(Array.isArray(e))for(const r of e)if(ps(r))iw(r.items,o);else{if(typeof r.value>"u")throw new Error("[@mantine/core] Each option must have value property");if(typeof r.value!="string")throw new Error(`[@mantine/core] Option value must be a string, other data formats are not supported, got ${typeof r.value}`);if(o.has(r.value))throw new Error(`[@mantine/core] Duplicate options are not supported. Option with value "${r.value}" was provided more than once`);o.add(r.value)}}function bA(e,o){return Array.isArray(e)?e.includes(o):e===o}function lw({data:e,withCheckIcon:o,value:r,checkIconPosition:a,unstyled:l,renderOption:c}){if(!ps(e)){const f=bA(r,e.value),h=o&&f&&y.jsx(tw,{className:En.optionsDropdownCheckIcon}),p=y.jsxs(y.Fragment,{children:[a==="left"&&h,y.jsx("span",{children:e.label}),a==="right"&&h]});return y.jsx(lt.Option,{value:e.value,disabled:e.disabled,className:zt({[En.optionsDropdownOption]:!l}),"data-reverse":a==="right"||void 0,"data-checked":f||void 0,"aria-selected":f,active:f,children:typeof c=="function"?c({option:e,checked:f}):p})}const u=e.items.map(f=>y.jsx(lw,{data:f,value:r,unstyled:l,withCheckIcon:o,checkIconPosition:a,renderOption:c},f.value));return y.jsx(lt.Group,{label:e.group,children:u})}function xA({data:e,hidden:o,hiddenWhenEmpty:r,filter:a,search:l,limit:c,maxDropdownHeight:u,withScrollArea:f=!0,filterOptions:h=!0,withCheckIcon:p=!1,value:g,checkIconPosition:v,nothingFoundMessage:x,unstyled:S,labelId:E,renderOption:C,scrollAreaProps:R,"aria-label":T}){iw(e);const A=typeof l=="string"?(a||aw)({options:e,search:h?l:"",limit:c??1/0}):e,N=yA(A),B=A.map(M=>y.jsx(lw,{data:M,withCheckIcon:p,value:g,checkIconPosition:v,unstyled:S,renderOption:C},ps(M)?M.group:M.value));return y.jsx(lt.Dropdown,{hidden:o||r&&N,"data-composed":!0,children:y.jsxs(lt.Options,{labelledBy:E,"aria-label":T,children:[f?y.jsx(Aa.Autosize,{mah:u??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...R,children:B}):B,N&&x&&y.jsx(lt.Empty,{children:x})]})})}var tl={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const d1={orientation:"horizontal"},SA=(e,{borderWidth:o})=>({group:{"--button-border-width":oe(o)}}),Im=ge((e,o)=>{const r=ce("ButtonGroup",d1,e),{className:a,style:l,classNames:c,styles:u,unstyled:f,orientation:h,vars:p,borderWidth:g,variant:v,mod:x,...S}=ce("ButtonGroup",d1,e),E=_e({name:"ButtonGroup",props:r,classes:tl,className:a,style:l,classNames:c,styles:u,unstyled:f,vars:p,varsResolver:SA,rootSelector:"group"});return y.jsx(he,{...E("group"),ref:o,variant:v,mod:[{"data-orientation":h},x],role:"group",...S})});Im.classes=tl;Im.displayName="@mantine/core/ButtonGroup";const h1={},wA=(e,{radius:o,color:r,gradient:a,variant:l,autoContrast:c,size:u})=>{const f=e.variantColorResolver({color:r||e.primaryColor,theme:e,gradient:a,variant:l||"filled",autoContrast:c});return{groupSection:{"--section-height":Xe(u,"section-height"),"--section-padding-x":Xe(u,"section-padding-x"),"--section-fz":u?.includes("compact")?nn(u.replace("compact-","")):nn(u),"--section-radius":o===void 0?void 0:kt(o),"--section-bg":r||l?f.background:void 0,"--section-color":f.color,"--section-bd":r||l?f.border:void 0}}},Fm=ge((e,o)=>{const r=ce("ButtonGroupSection",h1,e),{className:a,style:l,classNames:c,styles:u,unstyled:f,vars:h,variant:p,gradient:g,radius:v,autoContrast:x,...S}=ce("ButtonGroupSection",h1,e),E=_e({name:"ButtonGroupSection",props:r,classes:tl,className:a,style:l,classNames:c,styles:u,unstyled:f,vars:h,varsResolver:wA,rootSelector:"groupSection"});return y.jsx(he,{...E("groupSection"),ref:o,variant:p,...S})});Fm.classes=tl;Fm.displayName="@mantine/core/ButtonGroupSection";const CA={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${oe(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},EA={},RA=(e,{radius:o,color:r,gradient:a,variant:l,size:c,justify:u,autoContrast:f})=>{const h=e.variantColorResolver({color:r||e.primaryColor,theme:e,gradient:a,variant:l||"filled",autoContrast:f});return{root:{"--button-justify":u,"--button-height":Xe(c,"button-height"),"--button-padding-x":Xe(c,"button-padding-x"),"--button-fz":c?.includes("compact")?nn(c.replace("compact-","")):nn(c),"--button-radius":o===void 0?void 0:kt(o),"--button-bg":r||l?h.background:void 0,"--button-hover":r||l?h.hover:void 0,"--button-color":h.color,"--button-bd":r||l?h.border:void 0,"--button-hover-color":r||l?h.hoverColor:void 0}}},Dt=un((e,o)=>{const r=ce("Button",EA,e),{style:a,vars:l,className:c,color:u,disabled:f,children:h,leftSection:p,rightSection:g,fullWidth:v,variant:x,radius:S,loading:E,loaderProps:C,gradient:R,classNames:T,styles:z,unstyled:A,"data-disabled":N,autoContrast:B,mod:M,...$}=r,L=_e({name:"Button",props:r,classes:tl,className:c,style:a,classNames:T,styles:z,unstyled:A,vars:l,varsResolver:RA}),H=!!p,I=!!g;return y.jsxs($n,{ref:o,...L("root",{active:!f&&!E&&!N}),unstyled:A,variant:x,disabled:f||E,mod:[{disabled:f||N,loading:E,block:v,"with-left-section":H,"with-right-section":I},M],...$,children:[y.jsx(qr,{mounted:!!E,transition:CA,duration:150,children:Y=>y.jsx(he,{component:"span",...L("loader",{style:Y}),"aria-hidden":!0,children:y.jsx(Ma,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...C})})}),y.jsxs("span",{...L("inner"),children:[p&&y.jsx(he,{component:"span",...L("section"),mod:{position:"left"},children:p}),y.jsx(he,{component:"span",mod:{loading:E},...L("label"),children:h}),g&&y.jsx(he,{component:"span",...L("section"),mod:{position:"right"},children:g})]})]})});Dt.classes=tl;Dt.displayName="@mantine/core/Button";Dt.Group=Im;Dt.GroupSection=Fm;const[TA,_A]=zo("Card component was not found in tree");var Zm={root:"m_e615b15f",section:"m_599a2148"};const DA={},Fu=un((e,o)=>{const r=ce("CardSection",DA,e),{classNames:a,className:l,style:c,styles:u,vars:f,withBorder:h,inheritPadding:p,mod:g,...v}=r,x=_A();return y.jsx(he,{ref:o,mod:[{"with-border":h,"inherit-padding":p},g],...x.getStyles("section",{className:l,style:c,styles:u,classNames:a}),...v})});Fu.classes=Zm;Fu.displayName="@mantine/core/CardSection";const NA={},AA=(e,{padding:o})=>({root:{"--card-padding":sn(o)}}),Zu=un((e,o)=>{const r=ce("Card",NA,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,children:p,padding:g,...v}=r,x=_e({name:"Card",props:r,classes:Zm,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:AA}),S=b.Children.toArray(p),E=S.map((C,R)=>typeof C=="object"&&C&&"type"in C&&C.type===Fu?b.cloneElement(C,{"data-first-section":R===0||void 0,"data-last-section":R===S.length-1||void 0}):C);return y.jsx(TA,{value:{getStyles:x},children:y.jsx(Qi,{ref:o,unstyled:f,...x("root"),...v,children:E})})});Zu.classes=Zm;Zu.displayName="@mantine/core/Card";Zu.Section=Fu;var sw={root:"m_4451eb3a"};const zA={},ms=un((e,o)=>{const r=ce("Center",zA,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,inline:p,mod:g,...v}=r,x=_e({name:"Center",props:r,classes:sw,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h});return y.jsx(he,{ref:o,mod:[{inline:p},g],...x("root"),...v})});ms.classes=sw;ms.displayName="@mantine/core/Center";var cw={root:"m_3eebeb36",label:"m_9e365f20"};const MA={orientation:"horizontal"},OA=(e,{color:o,variant:r,size:a})=>({root:{"--divider-color":o?Zt(o,e):void 0,"--divider-border-style":r,"--divider-size":Xe(a,"divider-size")}}),Su=ge((e,o)=>{const r=ce("Divider",MA,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,color:p,orientation:g,label:v,labelPosition:x,mod:S,...E}=r,C=_e({name:"Divider",classes:cw,props:r,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:OA});return y.jsx(he,{ref:o,mod:[{orientation:g,"with-label":!!v},S],...C("root"),...E,role:"separator",children:v&&y.jsx(he,{component:"span",mod:{position:x},...C("label"),children:v})})});Su.classes=cw;Su.displayName="@mantine/core/Divider";function uw({open:e,close:o,openDelay:r,closeDelay:a}){const l=b.useRef(-1),c=b.useRef(-1),u=()=>{window.clearTimeout(l.current),window.clearTimeout(c.current)},f=()=>{u(),r===0||r===void 0?e():l.current=window.setTimeout(e,r)},h=()=>{u(),a===0||a===void 0?o():c.current=window.setTimeout(o,a)};return b.useEffect(()=>u,[]),{openDropdown:f,closeDropdown:h}}var fw={root:"m_9e117634"};const jA={},BA=(e,{radius:o,fit:r})=>({root:{"--image-radius":o===void 0?void 0:kt(o),"--image-object-fit":r}}),Qm=un((e,o)=>{const r=ce("Image",jA,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,onError:p,src:g,radius:v,fit:x,fallbackSrc:S,mod:E,...C}=r,[R,T]=b.useState(!g);b.useEffect(()=>T(!g),[g]);const z=_e({name:"Image",classes:fw,props:r,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:BA});return R&&S?y.jsx(he,{component:"img",ref:o,src:S,...z("root"),onError:p,mod:["fallback",E],...C}):y.jsx(he,{component:"img",ref:o,...z("root"),src:g,onError:A=>{p?.(A),T(!0)},mod:E,...C})});Qm.classes=fw;Qm.displayName="@mantine/core/Image";function Tp(){return Tp=Object.assign?Object.assign.bind():function(e){for(var o=1;o{const{classNames:r,className:a,style:l,styles:c,vars:u,...f}=ce("MenuDivider",LA,e),h=Fr();return y.jsx(he,{ref:o,...h.getStyles("divider",{className:a,style:l,styles:c,classNames:r}),...f})});Km.classes=Zr;Km.displayName="@mantine/core/MenuDivider";const kA={},Wm=ge((e,o)=>{const{classNames:r,className:a,style:l,styles:c,vars:u,onMouseEnter:f,onMouseLeave:h,onKeyDown:p,children:g,...v}=ce("MenuDropdown",kA,e),x=b.useRef(null),S=Fr(),E=Cn(p,T=>{(T.key==="ArrowUp"||T.key==="ArrowDown")&&(T.preventDefault(),x.current?.querySelectorAll("[data-menu-item]:not(:disabled)")[0]?.focus())}),C=Cn(f,()=>(S.trigger==="hover"||S.trigger==="click-hover")&&S.openDropdown()),R=Cn(h,()=>(S.trigger==="hover"||S.trigger==="click-hover")&&S.closeDropdown());return y.jsxs(Rn.Dropdown,{...v,onMouseEnter:C,onMouseLeave:R,role:"menu","aria-orientation":"vertical",ref:Mt(o,x),...S.getStyles("dropdown",{className:a,style:l,styles:c,classNames:r,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:E,children:[S.withInitialFocusPlaceholder&&y.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),g]})});Wm.classes=Zr;Wm.displayName="@mantine/core/MenuDropdown";const[HA,Qu]=Ss(),UA={},Jm=un((e,o)=>{const{classNames:r,className:a,style:l,styles:c,vars:u,color:f,closeMenuOnClick:h,leftSection:p,rightSection:g,children:v,disabled:x,"data-disabled":S,...E}=ce("MenuItem",UA,e),C=Fr(),R=Qu(),T=cn(),{dir:z}=Ii(),A=b.useRef(null),N=E,B=Cn(N.onClick,()=>{S||(typeof h=="boolean"?h&&C.closeDropdownImmediately():C.closeOnItemClick&&C.closeDropdownImmediately())}),M=f?T.variantColorResolver({color:f,theme:T,variant:"light"}):void 0,$=f?ir({color:f,theme:T}):null,L=Cn(N.onKeyDown,H=>{H.key==="ArrowLeft"&&R&&(R.close(),R.focusParentItem())});return y.jsxs($n,{onMouseDown:H=>H.preventDefault(),...E,unstyled:C.unstyled,tabIndex:C.menuItemTabIndex,...C.getStyles("item",{className:a,style:l,styles:c,classNames:r}),ref:Mt(A,o),role:"menuitem",disabled:x,"data-menu-item":!0,"data-disabled":x||S||void 0,"data-mantine-stop-propagation":!0,onClick:B,onKeyDown:gx({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:C.loop,dir:z,orientation:"vertical",onKeyDown:L}),__vars:{"--menu-item-color":$?.isThemeColor&&$?.shade===void 0?`var(--mantine-color-${$.color}-6)`:M?.color,"--menu-item-hover":M?.hover},children:[p&&y.jsx("div",{...C.getStyles("itemSection",{styles:c,classNames:r}),"data-position":"left",children:p}),v&&y.jsx("div",{...C.getStyles("itemLabel",{styles:c,classNames:r}),children:v}),g&&y.jsx("div",{...C.getStyles("itemSection",{styles:c,classNames:r}),"data-position":"right",children:g})]})});Jm.classes=Zr;Jm.displayName="@mantine/core/MenuItem";const PA={},eg=ge((e,o)=>{const{classNames:r,className:a,style:l,styles:c,vars:u,...f}=ce("MenuLabel",PA,e),h=Fr();return y.jsx(he,{ref:o,...h.getStyles("label",{className:a,style:l,styles:c,classNames:r}),...f})});eg.classes=Zr;eg.displayName="@mantine/core/MenuLabel";const VA={},tg=ge((e,o)=>{const{classNames:r,className:a,style:l,styles:c,vars:u,onMouseEnter:f,onMouseLeave:h,onKeyDown:p,children:g,...v}=ce("MenuSubDropdown",VA,e),x=b.useRef(null),S=Fr(),E=Qu(),C=Cn(f,E?.open),R=Cn(h,E?.close);return y.jsx(Rn.Dropdown,{...v,onMouseEnter:C,onMouseLeave:R,role:"menu","aria-orientation":"vertical",ref:Mt(o,x),...S.getStyles("dropdown",{className:a,style:l,styles:c,classNames:r,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,children:g})});tg.classes=Zr;tg.displayName="@mantine/core/MenuSubDropdown";const YA={},ng=un((e,o)=>{const{classNames:r,className:a,style:l,styles:c,vars:u,color:f,leftSection:h,rightSection:p,children:g,disabled:v,"data-disabled":x,closeMenuOnClick:S,...E}=ce("MenuSubItem",YA,e),C=Fr(),R=Qu(),T=cn(),{dir:z}=Ii(),A=b.useRef(null),N=E,B=f?T.variantColorResolver({color:f,theme:T,variant:"light"}):void 0,M=f?ir({color:f,theme:T}):null,$=Cn(N.onKeyDown,Y=>{Y.key==="ArrowRight"&&(R?.open(),R?.focusFirstItem()),Y.key==="ArrowLeft"&&R?.parentContext&&(R.parentContext.close(),R.parentContext.focusParentItem())}),L=Cn(N.onClick,()=>{!x&&S&&C.closeDropdownImmediately()}),H=Cn(N.onMouseEnter,R?.open),I=Cn(N.onMouseLeave,R?.close);return y.jsxs($n,{onMouseDown:Y=>Y.preventDefault(),...E,unstyled:C.unstyled,tabIndex:C.menuItemTabIndex,...C.getStyles("item",{className:a,style:l,styles:c,classNames:r}),ref:Mt(A,o),role:"menuitem",disabled:v,"data-menu-item":!0,"data-sub-menu-item":!0,"data-disabled":v||x||void 0,"data-mantine-stop-propagation":!0,onMouseEnter:H,onMouseLeave:I,onClick:L,onKeyDown:gx({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:C.loop,dir:z,orientation:"vertical",onKeyDown:$}),__vars:{"--menu-item-color":M?.isThemeColor&&M?.shade===void 0?`var(--mantine-color-${M.color}-6)`:B?.color,"--menu-item-hover":B?.hover},children:[h&&y.jsx("div",{...C.getStyles("itemSection",{styles:c,classNames:r}),"data-position":"left",children:h}),g&&y.jsx("div",{...C.getStyles("itemLabel",{styles:c,classNames:r}),children:g}),y.jsx("div",{...C.getStyles("itemSection",{styles:c,classNames:r}),"data-position":"right",children:p||y.jsx(kS,{...C.getStyles("chevron"),size:14})})]})});ng.classes=Zr;ng.displayName="@mantine/core/MenuSubItem";function hw({children:e,refProp:o}){if(!rr(e))throw new Error("Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return Fr(),y.jsx(Rn.Target,{refProp:o,popupType:"menu",children:e})}hw.displayName="@mantine/core/MenuSubTarget";const GA={offset:0,position:"right-start",transitionProps:{duration:0}};function nl(e){const{children:o,closeDelay:r,...a}=ce("MenuSub",GA,e),l=Jn(),[c,{open:u,close:f}]=iT(!1),h=Qu(),{openDropdown:p,closeDropdown:g}=uw({open:u,close:f,closeDelay:r,openDelay:0}),v=()=>window.setTimeout(()=>{document.getElementById(`${l}-dropdown`)?.querySelectorAll("[data-menu-item]:not([data-disabled])")[0]?.focus()},16),x=()=>window.setTimeout(()=>{document.getElementById(`${l}-target`)?.focus()},16);return y.jsx(HA,{value:{opened:c,close:g,open:p,focusFirstItem:v,focusParentItem:x,parentContext:h},children:y.jsx(Rn,{opened:c,...a,withinPortal:!1,id:l,children:o})})}nl.extend=e=>e;nl.displayName="@mantine/core/MenuSub";nl.Target=hw;nl.Dropdown=tg;nl.Item=ng;const XA={refProp:"ref"},pw=b.forwardRef((e,o)=>{const{children:r,refProp:a,...l}=ce("MenuTarget",XA,e);if(!rr(r))throw new Error("Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const c=Fr(),u=r.props,f=Cn(u.onClick,()=>{c.trigger==="click"?c.toggleDropdown():c.trigger==="click-hover"&&(c.setOpenedViaClick(!0),c.opened||c.openDropdown())}),h=Cn(u.onMouseEnter,()=>(c.trigger==="hover"||c.trigger==="click-hover")&&c.openDropdown()),p=Cn(u.onMouseLeave,()=>{(c.trigger==="hover"||c.trigger==="click-hover"&&!c.openedViaClick)&&c.closeDropdown()});return y.jsx(Rn.Target,{refProp:a,popupType:"menu",ref:o,...l,children:b.cloneElement(r,{onClick:f,onMouseEnter:h,onMouseLeave:p,"data-expanded":c.opened?!0:void 0})})});pw.displayName="@mantine/core/MenuTarget";const qA={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function Nt(e){const o=ce("Menu",qA,e),{children:r,onOpen:a,onClose:l,opened:c,defaultOpened:u,trapFocus:f,onChange:h,closeOnItemClick:p,loop:g,closeOnEscape:v,trigger:x,openDelay:S,closeDelay:E,classNames:C,styles:R,unstyled:T,variant:z,vars:A,menuItemTabIndex:N,keepMounted:B,withInitialFocusPlaceholder:M,...$}=o,L=_e({name:"Menu",classes:Zr,props:o,classNames:C,styles:R,unstyled:T}),[H,I]=Wn({value:c,defaultValue:u,finalValue:!1,onChange:h}),[Y,X]=b.useState(!1),ee=()=>{I(!1),X(!1),H&&l?.()},ne=()=>{I(!0),!H&&a?.()},re=()=>{H?ee():ne()},{openDropdown:j,closeDropdown:k}=uw({open:ne,close:ee,closeDelay:E,openDelay:S}),V=D=>VR("[data-menu-item]","[data-menu-dropdown]",D),{resolvedClassNames:P,resolvedStyles:Z}=Xi({classNames:C,styles:R,props:o});return y.jsx($A,{value:{getStyles:L,opened:H,toggleDropdown:re,getItemIndex:V,openedViaClick:Y,setOpenedViaClick:X,closeOnItemClick:p,closeDropdown:x==="click"?ee:k,openDropdown:x==="click"?ne:j,closeDropdownImmediately:ee,loop:g,trigger:x,unstyled:T,menuItemTabIndex:N,withInitialFocusPlaceholder:M},children:y.jsx(Rn,{...$,opened:H,onChange:re,defaultOpened:u,trapFocus:B?!1:f,closeOnEscape:v,__staticSelector:"Menu",classNames:P,styles:Z,unstyled:T,variant:z,keepMounted:B,children:r})})}Nt.extend=e=>e;Nt.withProps=S_(Nt);Nt.classes=Zr;Nt.displayName="@mantine/core/Menu";Nt.Item=Jm;Nt.Label=eg;Nt.Dropdown=Wm;Nt.Target=pw;Nt.Divider=Km;Nt.Sub=nl;const[IA,ol]=zo("Modal component was not found in tree");var ur={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const FA={},Ku=ge((e,o)=>{const r=ce("ModalBody",FA,e),{classNames:a,className:l,style:c,styles:u,vars:f,...h}=r,p=ol();return y.jsx(AS,{ref:o,...p.getStyles("body",{classNames:a,style:c,styles:u,className:l}),...h})});Ku.classes=ur;Ku.displayName="@mantine/core/ModalBody";const ZA={},Wu=ge((e,o)=>{const r=ce("ModalCloseButton",ZA,e),{classNames:a,className:l,style:c,styles:u,vars:f,...h}=r,p=ol();return y.jsx(zS,{ref:o,...p.getStyles("close",{classNames:a,style:c,styles:u,className:l}),...h})});Wu.classes=ur;Wu.displayName="@mantine/core/ModalCloseButton";const QA={},Ju=ge((e,o)=>{const r=ce("ModalContent",QA,e),{classNames:a,className:l,style:c,styles:u,vars:f,children:h,__hidden:p,...g}=r,v=ol(),x=v.scrollAreaComponent||J3;return y.jsx(MS,{...v.getStyles("content",{className:l,style:c,styles:u,classNames:a}),innerProps:v.getStyles("inner",{className:l,style:c,styles:u,classNames:a}),"data-full-screen":v.fullScreen||void 0,"data-modal-content":!0,"data-hidden":p||void 0,ref:o,...g,children:y.jsx(x,{style:{maxHeight:v.fullScreen?"100dvh":`calc(100dvh - (${oe(v.yOffset)} * 2))`},children:h})})});Ju.classes=ur;Ju.displayName="@mantine/core/ModalContent";const KA={},ef=ge((e,o)=>{const r=ce("ModalHeader",KA,e),{classNames:a,className:l,style:c,styles:u,vars:f,...h}=r,p=ol();return y.jsx(OS,{ref:o,...p.getStyles("header",{classNames:a,style:c,styles:u,className:l}),...h})});ef.classes=ur;ef.displayName="@mantine/core/ModalHeader";const WA={},tf=ge((e,o)=>{const r=ce("ModalOverlay",WA,e),{classNames:a,className:l,style:c,styles:u,vars:f,...h}=r,p=ol();return y.jsx(jS,{ref:o,...p.getStyles("overlay",{classNames:a,style:c,styles:u,className:l}),...h})});tf.classes=ur;tf.displayName="@mantine/core/ModalOverlay";const JA={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:vo("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},ez=(e,{radius:o,size:r,yOffset:a,xOffset:l})=>({root:{"--modal-radius":o===void 0?void 0:kt(o),"--modal-size":Xe(r,"modal-size"),"--modal-y-offset":oe(a),"--modal-x-offset":oe(l)}}),nf=ge((e,o)=>{const r=ce("ModalRoot",JA,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,yOffset:p,scrollAreaComponent:g,radius:v,fullScreen:x,centered:S,xOffset:E,__staticSelector:C,...R}=r,T=_e({name:C,classes:ur,props:r,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:ez});return y.jsx(IA,{value:{yOffset:p,scrollAreaComponent:g,getStyles:T,fullScreen:x},children:y.jsx(NS,{ref:o,...T("root"),"data-full-screen":x||void 0,"data-centered":S||void 0,"data-offset-scrollbars":g===Aa.Autosize||void 0,unstyled:f,...R})})});nf.classes=ur;nf.displayName="@mantine/core/ModalRoot";const[tz,nz]=Ss();function mw({children:e}){const[o,r]=b.useState([]),[a,l]=b.useState(vo("modal"));return y.jsx(tz,{value:{stack:o,addModal:(c,u)=>{r(f=>[...new Set([...f,c])]),l(f=>typeof u=="number"&&typeof f=="number"?Math.max(f,u):f)},removeModal:c=>r(u=>u.filter(f=>f!==c)),getZIndex:c=>`calc(${a} + ${o.indexOf(c)} + 1)`,currentId:o[o.length-1],maxZIndex:a},children:e})}mw.displayName="@mantine/core/ModalStack";const oz={},of=ge((e,o)=>{const r=ce("ModalTitle",oz,e),{classNames:a,className:l,style:c,styles:u,vars:f,...h}=r,p=ol();return y.jsx(BS,{ref:o,...p.getStyles("title",{classNames:a,style:c,styles:u,className:l}),...h})});of.classes=ur;of.displayName="@mantine/core/ModalTitle";const rz={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:vo("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},Tn=ge((e,o)=>{const{title:r,withOverlay:a,overlayProps:l,withCloseButton:c,closeButtonProps:u,children:f,radius:h,opened:p,stackId:g,zIndex:v,...x}=ce("Modal",rz,e),S=nz(),E=!!r||c,C=S&&g?{closeOnEscape:S.currentId===g,trapFocus:S.currentId===g,zIndex:S.getZIndex(g)}:{},R=a===!1?!1:g&&S?S.currentId===g:p;return b.useEffect(()=>{S&&g&&(p?S.addModal(g,v||vo("modal")):S.removeModal(g))},[p,g,v]),y.jsxs(nf,{ref:o,radius:h,opened:p,zIndex:S&&g?S.getZIndex(g):v,...x,...C,children:[a&&y.jsx(tf,{visible:R,transitionProps:S&&g?{duration:0}:void 0,...l}),y.jsxs(Ju,{radius:h,__hidden:S&&g&&p?g!==S.currentId:!1,children:[E&&y.jsxs(ef,{children:[r&&y.jsx(of,{children:r}),c&&y.jsx(Wu,{...u})]}),y.jsx(Ku,{children:f})]})]})});Tn.classes=ur;Tn.displayName="@mantine/core/Modal";Tn.Root=nf;Tn.Overlay=tf;Tn.Content=Ju;Tn.Body=Ku;Tn.Header=ef;Tn.Title=of;Tn.CloseButton=Wu;Tn.Stack=mw;var gw={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const az={withCloseButton:!0},iz=(e,{radius:o,color:r})=>({root:{"--notification-radius":o===void 0?void 0:kt(o),"--notification-color":r?Zt(r,e):void 0}}),og=ge((e,o)=>{const r=ce("Notification",az,e),{className:a,color:l,radius:c,loading:u,withCloseButton:f,withBorder:h,title:p,icon:g,children:v,onClose:x,closeButtonProps:S,classNames:E,style:C,styles:R,unstyled:T,variant:z,vars:A,mod:N,loaderProps:B,role:M,...$}=r,L=_e({name:"Notification",classes:gw,props:r,className:a,style:C,classNames:E,styles:R,unstyled:T,vars:A,varsResolver:iz});return y.jsxs(he,{...L("root"),mod:[{"data-with-icon":!!g||u,"data-with-border":h},N],ref:o,variant:z,role:M||"alert",...$,children:[g&&!u&&y.jsx("div",{...L("icon"),children:g}),u&&y.jsx(Ma,{size:28,color:l,...B,...L("loader")}),y.jsxs("div",{...L("body"),children:[p&&y.jsx("div",{...L("title"),children:p}),y.jsx(he,{...L("description"),mod:{"data-with-title":!!p},children:v})]}),f&&y.jsx(Wi,{iconSize:16,color:"gray",...S,unstyled:T,onClick:x,...L("closeButton")})]})});og.classes=gw;og.displayName="@mantine/core/Notification";function vw(e,o){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&o.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(e);l=f?l=l+m1("0",u-f):l=(l.substring(0,u)||"0")+"."+l.substring(u),r+l}function g1(e,o,r){if(["","-"].indexOf(e)!==-1)return e;var a=(e.indexOf(".")!==-1||r)&&o,l=rg(e),c=l.beforeDecimal,u=l.afterDecimal,f=l.hasNegation,h=parseFloat("0."+(u||"0")),p=u.length<=o?"0."+u:h.toFixed(o),g=p.split("."),v=c;c&&Number(g[0])&&(v=c.split("").reverse().reduce(function(C,R,T){return C.length>T?(Number(C[0])+Number(R)).toString()+C.substring(1,C.length):R+C},g[0]));var x=xw(g[1]||"",o,r),S=f?"-":"",E=a?".":"";return""+S+v+E+x}function xa(e,o){if(e.value=e.value,e!==null){if(e.createTextRange){var r=e.createTextRange();return r.move("character",o),r.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(o,o),!0):(e.focus(),!1)}}var ww=lz(function(e,o){for(var r=0,a=0,l=e.length,c=o.length;e[r]===o[r]&&rr&&l-a>r;)a++;return{from:{start:r,end:l-a},to:{start:r,end:c-a}}}),dz=function(e,o){var r=Math.min(e.selectionStart,o);return{from:{start:r,end:e.selectionEnd},to:{start:r,end:o}}};function hz(e,o,r){return Math.min(Math.max(e,o),r)}function Fh(e){return Math.max(e.selectionStart,e.selectionEnd)}function pz(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function mz(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function gz(e){var o=e.currentValue,r=e.formattedValue,a=e.currentValueIndex,l=e.formattedValueIndex;return o[a]===r[l]}function vz(e,o,r,a,l,c,u){u===void 0&&(u=gz);var f=l.findIndex(function(N){return N}),h=e.slice(0,f);!o&&!r.startsWith(h)&&(o=h,r=h+r,a=a+h.length);for(var p=r.length,g=e.length,v={},x=new Array(p),S=0;S0&&x[T]===-1;)T--;var A=T===-1||x[T]===-1?0:x[T]+1;return A>z?z:a-A=0&&!r[o];)o--;o===-1&&(o=r.indexOf(!0))}else{for(;o<=l&&!r[o];)o++;o>l&&(o=r.lastIndexOf(!0))}return o===-1&&(o=l),o}function yz(e){for(var o=Array.from({length:e.length+1}).map(function(){return!0}),r=0,a=o.length;r$.length-u.length||MY||v>e.length-u.length)&&(I=v),e=e.substring(0,I),e=wz(A?"-"+e:e,l),e=(e.match(Cz(E))||[]).join("");var X=e.indexOf(E);e=e.replace(new RegExp(bw(E),"g"),function(k,V){return V===X?".":""});var ee=rg(e,l),ne=ee.beforeDecimal,re=ee.afterDecimal,j=ee.addNegation;return p.end-p.starte.get(o)),f=a||c,h=b.useCallback(g=>{a||(Ri(g,r),u(g),e.set(g))},[e.set,f,a]),p=b.useCallback(()=>{u(o),Ri(o,r),e.clear()},[e.clear,o]);return b.useEffect(()=>(e.subscribe(h),e.unsubscribe),[e.subscribe,e.unsubscribe]),Yi(()=>{Ri(e.get(o),r)},[]),b.useEffect(()=>{if(a)return Ri(a,r),()=>{};a===void 0&&Ri(c,r),typeof window<"u"&&"matchMedia"in window&&(l.current=window.matchMedia("(prefers-color-scheme: dark)"));const g=v=>{c==="auto"&&Ri(v.matches?"dark":"light",r)};return l.current?.addEventListener("change",g),()=>l.current?.removeEventListener("change",g)},[c,a]),{colorScheme:f,setColorScheme:h,clearColorScheme:p}}function UT({respectReducedMotion:e,getRootElement:o}){Yi(()=>{e&&o()?.setAttribute("data-respect-reduced-motion","true")},[e])}function Nx({theme:e,children:o,getStyleNonce:r,withStaticClasses:a=!0,withGlobalClasses:l=!0,deduplicateCssVariables:c=!0,withCssVariables:u=!0,cssVariablesSelector:f=":root",classNamesPrefix:h="mantine",colorSchemeManager:p=NT(),defaultColorScheme:g="light",getRootElement:v=()=>document.documentElement,cssVariablesResolver:x,forceColorScheme:S,stylesTransform:E,env:C}){const{colorScheme:R,setColorScheme:T,clearColorScheme:z}=HT({defaultColorScheme:g,forceColorScheme:S,manager:p,getRootElement:v});return UT({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:v}),y.jsx(Rx.Provider,{value:{colorScheme:R,setColorScheme:T,clearColorScheme:z,getRootElement:v,classNamesPrefix:h,getStyleNonce:r,cssVariablesResolver:x,cssVariablesSelector:f,withStaticClasses:a,stylesTransform:E,env:C},children:y.jsxs(Tx,{theme:e,children:[u&&y.jsx(Dx,{cssVariablesSelector:f,deduplicateCssVariables:c}),l&&y.jsx(OT,{}),o]})})}Nx.displayName="@mantine/core/MantineProvider";function Gi({classNames:e,styles:o,props:r,stylesCtx:a}){const l=cn();return{resolvedClassNames:zu({theme:l,classNames:e,props:r,stylesCtx:a||void 0}),resolvedStyles:gu({theme:l,styles:o,props:r,stylesCtx:a||void 0})}}const PT={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function VT({theme:e,options:o,unstyled:r}){return zt(o?.focusable&&!r&&(e.focusClassName||PT[e.focusRing]),o?.active&&!r&&e.activeClassName)}function YT({selector:e,stylesCtx:o,options:r,props:a,theme:l}){return zu({theme:l,classNames:r?.classNames,props:r?.props||a,stylesCtx:o})[e]}function L0({selector:e,stylesCtx:o,theme:r,classNames:a,props:l}){return zu({theme:r,classNames:a,props:l,stylesCtx:o})[e]}function GT({rootSelector:e,selector:o,className:r}){return e===o?r:void 0}function XT({selector:e,classes:o,unstyled:r}){return r?void 0:o[e]}function qT({themeName:e,classNamesPrefix:o,selector:r,withStaticClass:a}){return a===!1?[]:e.map(l=>`${o}-${l}-${r}`)}function IT({themeName:e,theme:o,selector:r,props:a,stylesCtx:l}){return e.map(c=>zu({theme:o,classNames:o.components[c]?.classNames,props:a,stylesCtx:l})?.[r])}function FT({options:e,classes:o,selector:r,unstyled:a}){return e?.variant&&!a?o[`${r}--${e.variant}`]:void 0}function ZT({theme:e,options:o,themeName:r,selector:a,classNamesPrefix:l,classNames:c,classes:u,unstyled:f,className:h,rootSelector:p,props:g,stylesCtx:v,withStaticClasses:x,headless:S,transformedStyles:E}){return zt(VT({theme:e,options:o,unstyled:f||S}),IT({theme:e,themeName:r,selector:a,props:g,stylesCtx:v}),FT({options:o,classes:u,selector:a,unstyled:f}),L0({selector:a,stylesCtx:v,theme:e,classNames:c,props:g}),L0({selector:a,stylesCtx:v,theme:e,classNames:E,props:g}),YT({selector:a,stylesCtx:v,options:o,props:g,theme:e}),GT({rootSelector:p,selector:a,className:h}),XT({selector:a,classes:u,unstyled:f||S}),x&&!S&&qT({themeName:r,classNamesPrefix:l,selector:a,withStaticClass:o?.withStaticClass}),o?.className)}function QT({theme:e,themeName:o,props:r,stylesCtx:a,selector:l}){return o.map(c=>gu({theme:e,styles:e.components[c]?.styles,props:r,stylesCtx:a})[l]).reduce((c,u)=>({...c,...u}),{})}function vp({style:e,theme:o}){return Array.isArray(e)?[...e].reduce((r,a)=>({...r,...vp({style:a,theme:o})}),{}):typeof e=="function"?e(o):e??{}}function KT(e){return e.reduce((o,r)=>(r&&Object.keys(r).forEach(a=>{o[a]={...o[a],...xs(r[a])}}),o),{})}function WT({vars:e,varsResolver:o,theme:r,props:a,stylesCtx:l,selector:c,themeName:u,headless:f}){return KT([f?{}:o?.(r,a,l),...u.map(h=>r.components?.[h]?.vars?.(r,a,l)),e?.(r,a,l)])?.[c]}function JT({theme:e,themeName:o,selector:r,options:a,props:l,stylesCtx:c,rootSelector:u,styles:f,style:h,vars:p,varsResolver:g,headless:v,withStylesTransform:x}){return{...!x&&QT({theme:e,themeName:o,props:l,stylesCtx:c,selector:r}),...!x&&gu({theme:e,styles:f,props:l,stylesCtx:c})[r],...!x&&gu({theme:e,styles:a?.styles,props:a?.props||l,stylesCtx:c})[r],...WT({theme:e,props:l,stylesCtx:c,vars:p,varsResolver:g,selector:r,themeName:o,headless:v}),...u===r?vp({style:h,theme:e}):null,...vp({style:a?.style,theme:e})}}function e_({props:e,stylesCtx:o,themeName:r}){const a=cn(),l=xT()?.();return{getTransformedStyles:u=>l?[...u.map(h=>l(h,{props:e,theme:a,ctx:o})),...r.map(h=>l(a.components[h]?.styles,{props:e,theme:a,ctx:o}))].filter(Boolean):[],withStylesTransform:!!l}}function _e({name:e,classes:o,props:r,stylesCtx:a,className:l,style:c,rootSelector:u="root",unstyled:f,classNames:h,styles:p,vars:g,varsResolver:v}){const x=cn(),S=gT(),E=vT(),C=yT(),R=(Array.isArray(e)?e:[e]).filter(A=>A),{withStylesTransform:T,getTransformedStyles:z}=e_({props:r,stylesCtx:a,themeName:R});return(A,N)=>({className:ZT({theme:x,options:N,themeName:R,selector:A,classNamesPrefix:S,classNames:h,classes:o,unstyled:f,className:l,rootSelector:u,props:r,stylesCtx:a,withStaticClasses:E,headless:C,transformedStyles:z([N?.styles,p])}),style:JT({theme:x,themeName:R,selector:A,options:N,props:r,stylesCtx:a,rootSelector:u,styles:p,style:c,vars:g,varsResolver:v,headless:C,withStylesTransform:T})})}function Ax(e,o){return typeof e=="boolean"?e:o.autoContrast}function ce(e,o,r){const a=cn(),l=a.components[e]?.defaultProps,c=typeof l=="function"?l(a):l;return{...o,...c,...xs(r)}}function $h(e){return At(e).reduce((o,r)=>e[r]!==void 0?`${o}${jR(r)}:${e[r]};`:o,"").trim()}function t_({selector:e,styles:o,media:r,container:a}){const l=o?$h(o):"",c=Array.isArray(r)?r.map(f=>`@media${f.query}{${e}{${$h(f.styles)}}}`):[],u=Array.isArray(a)?a.map(f=>`@container ${f.query}{${e}{${$h(f.styles)}}}`):[];return`${l?`${e}{${l}}`:""}${c.join("")}${u.join("")}`.trim()}function Ou(e){const o=Kp();return y.jsx("style",{"data-mantine-styles":"inline",nonce:o?.(),dangerouslySetInnerHTML:{__html:t_(e)}})}function Xi(e){const{m:o,mx:r,my:a,mt:l,mb:c,ml:u,mr:f,me:h,ms:p,p:g,px:v,py:x,pt:S,pb:E,pl:C,pr:R,pe:T,ps:z,bd:A,bg:N,c:B,opacity:M,ff:$,fz:L,fw:H,lts:I,ta:Y,lh:X,fs:ee,tt:ne,td:re,w:j,miw:k,maw:V,h:P,mih:Z,mah:D,bgsz:O,bgp:q,bgr:W,bga:ie,pos:ue,top:ve,left:fe,bottom:be,right:ye,inset:Xe,display:Ne,flex:We,hiddenFrom:Be,visibleFrom:nt,lightHidden:vt,darkHidden:pe,sx:me,...we}=e;return{styleProps:xs({m:o,mx:r,my:a,mt:l,mb:c,ml:u,mr:f,me:h,ms:p,p:g,px:v,py:x,pt:S,pb:E,pl:C,pr:R,pe:T,ps:z,bd:A,bg:N,c:B,opacity:M,ff:$,fz:L,fw:H,lts:I,ta:Y,lh:X,fs:ee,tt:ne,td:re,w:j,miw:k,maw:V,h:P,mih:Z,mah:D,bgsz:O,bgp:q,bgr:W,bga:ie,pos:ue,top:ve,left:fe,bottom:be,right:ye,inset:Xe,display:Ne,flex:We,hiddenFrom:Be,visibleFrom:nt,lightHidden:vt,darkHidden:pe,sx:me}),rest:we}}const n_={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},ms:{type:"spacing",property:"marginInlineStart"},me:{type:"spacing",property:"marginInlineEnd"},mx:{type:"spacing",property:"marginInline"},my:{type:"spacing",property:"marginBlock"},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},ps:{type:"spacing",property:"paddingInlineStart"},pe:{type:"spacing",property:"paddingInlineEnd"},px:{type:"spacing",property:"paddingInline"},py:{type:"spacing",property:"paddingBlock"},bd:{type:"border",property:"border"},bg:{type:"color",property:"background"},c:{type:"textColor",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"fontFamily",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"lineHeight",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"size",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"},flex:{type:"identity",property:"flex"}};function nm(e,o){const r=lr({color:e,theme:o});return r.color==="dimmed"?"var(--mantine-color-dimmed)":r.color==="bright"?"var(--mantine-color-bright)":r.variable?`var(${r.variable})`:r.color}function o_(e,o){const r=lr({color:e,theme:o});return r.isThemeColor&&r.shade===void 0?`var(--mantine-color-${r.color}-text)`:nm(e,o)}function r_(e,o){if(typeof e=="number")return oe(e);if(typeof e=="string"){const[r,a,...l]=e.split(" ").filter(u=>u.trim()!=="");let c=`${oe(r)}`;return a&&(c+=` ${a}`),l.length>0&&(c+=` ${nm(l.join(" "),o)}`),c.trim()}return e}const k0={text:"var(--mantine-font-family)",mono:"var(--mantine-font-family-monospace)",monospace:"var(--mantine-font-family-monospace)",heading:"var(--mantine-font-family-headings)",headings:"var(--mantine-font-family-headings)"};function a_(e){return typeof e=="string"&&e in k0?k0[e]:e}const i_=["h1","h2","h3","h4","h5","h6"];function l_(e,o){return typeof e=="string"&&e in o.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&i_.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?oe(e):e}function s_(e){return e}const c_=["h1","h2","h3","h4","h5","h6"];function u_(e,o){return typeof e=="string"&&e in o.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&c_.includes(e)?`var(--mantine-${e}-line-height)`:e}function f_(e){return typeof e=="number"?oe(e):e}function d_(e,o){if(typeof e=="number")return oe(e);if(typeof e=="string"){const r=e.replace("-","");if(!(r in o.spacing))return oe(e);const a=`--mantine-spacing-${r}`;return e.startsWith("-")?`calc(var(${a}) * -1)`:`var(${a})`}return e}const Lh={color:nm,textColor:o_,fontSize:l_,spacing:d_,identity:s_,size:f_,lineHeight:u_,fontFamily:a_,border:r_};function H0(e){return e.replace("(min-width: ","").replace("em)","")}function h_({media:e,...o}){const a=Object.keys(e).sort((l,c)=>Number(H0(l))-Number(H0(c))).map(l=>({query:l,styles:e[l]}));return{...o,media:a}}function p_(e){if(typeof e!="object"||e===null)return!1;const o=Object.keys(e);return!(o.length===1&&o[0]==="base")}function m_(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function g_(e){return typeof e=="object"&&e!==null?At(e).filter(o=>o!=="base"):[]}function v_(e,o){return typeof e=="object"&&e!==null&&o in e?e[o]:e}function y_({styleProps:e,data:o,theme:r}){return h_(At(e).reduce((a,l)=>{if(l==="hiddenFrom"||l==="visibleFrom"||l==="sx")return a;const c=o[l],u=Array.isArray(c.property)?c.property:[c.property],f=m_(e[l]);if(!p_(e[l]))return u.forEach(p=>{a.inlineStyles[p]=Lh[c.type](f,r)}),a;a.hasResponsiveStyles=!0;const h=g_(e[l]);return u.forEach(p=>{f&&(a.styles[p]=Lh[c.type](f,r)),h.forEach(g=>{const v=`(min-width: ${r.breakpoints[g]})`;a.media[v]={...a.media[v],[p]:Lh[c.type](v_(e[l],g),r)}})}),a},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function zx(){return`__m__-${b.useId().replace(/:/g,"")}`}function om(e,o){return Array.isArray(e)?[...e].reduce((r,a)=>({...r,...om(a,o)}),{}):typeof e=="function"?e(o):e??{}}function Mx(e){return e.startsWith("data-")?e:`data-${e}`}function b_(e){return Object.keys(e).reduce((o,r)=>{const a=e[r];return a===void 0||a===""||a===!1||a===null||(o[Mx(r)]=e[r]),o},{})}function Ox(e){return e?typeof e=="string"?{[Mx(e)]:!0}:Array.isArray(e)?[...e].reduce((o,r)=>({...o,...Ox(r)}),{}):b_(e):null}function yp(e,o){return Array.isArray(e)?[...e].reduce((r,a)=>({...r,...yp(a,o)}),{}):typeof e=="function"?e(o):e??{}}function x_({theme:e,style:o,vars:r,styleProps:a}){const l=yp(o,e),c=yp(r,e);return{...l,...c,...a}}const jx=b.forwardRef(({component:e,style:o,__vars:r,className:a,variant:l,mod:c,size:u,hiddenFrom:f,visibleFrom:h,lightHidden:p,darkHidden:g,renderRoot:v,__size:x,...S},E)=>{const C=cn(),R=e||"div",{styleProps:T,rest:z}=Xi(S),N=bT()?.()?.(T.sx),B=zx(),M=y_({styleProps:T,theme:C,data:n_}),$={ref:E,style:x_({theme:C,style:o,vars:r,styleProps:M.inlineStyles}),className:zt(a,N,{[B]:M.hasResponsiveStyles,"mantine-light-hidden":p,"mantine-dark-hidden":g,[`mantine-hidden-from-${f}`]:f,[`mantine-visible-from-${h}`]:h}),"data-variant":l,"data-size":gx(u)?void 0:u||void 0,size:x,...Ox(c),...z};return y.jsxs(y.Fragment,{children:[M.hasResponsiveStyles&&y.jsx(Ou,{selector:`.${B}`,styles:M.styles,media:M.media}),typeof v=="function"?v($):y.jsx(R,{...$})]})});jx.displayName="@mantine/core/Box";const he=jx;function Bx(e){return e}function S_(e){const o=e;return r=>{const a=b.forwardRef((l,c)=>y.jsx(o,{...r,...l,ref:c}));return a.extend=o.extend,a.displayName=`WithProps(${o.displayName})`,a}}function ge(e){const o=b.forwardRef(e);return o.extend=Bx,o.withProps=r=>{const a=b.forwardRef((l,c)=>y.jsx(o,{...r,...l,ref:c}));return a.extend=o.extend,a.displayName=`WithProps(${o.displayName})`,a},o}function un(e){const o=b.forwardRef(e);return o.withProps=r=>{const a=b.forwardRef((l,c)=>y.jsx(o,{...r,...l,ref:c}));return a.extend=o.extend,a.displayName=`WithProps(${o.displayName})`,a},o.extend=Bx,o}const w_=b.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function qi(){return b.useContext(w_)}var co=lx();const Sa=Xp(co);function C_(e){if(!e||typeof e=="string")return 0;const o=e/36;return Math.round((4+15*o**.25+o/5)*10)}function kh(e){return e?.current?e.current.scrollHeight:"auto"}const ts=typeof window<"u"&&window.requestAnimationFrame;function E_({transitionDuration:e,transitionTimingFunction:o="ease",onTransitionEnd:r=()=>{},opened:a}){const l=b.useRef(null),c=0,u={height:0,overflow:"hidden"},[f,h]=b.useState(a?{}:u),p=E=>{co.flushSync(()=>h(E))},g=E=>{p(C=>({...C,...E}))};function v(E){const C=e||C_(E);return{transition:`height ${C}ms ${o}, opacity ${C}ms ${o}`}}rr(()=>{typeof ts=="function"&&ts(a?()=>{g({willChange:"height",display:"block",overflow:"hidden"}),ts(()=>{const E=kh(l);g({...v(E),height:E})})}:()=>{const E=kh(l);g({...v(E),willChange:"height",height:E}),ts(()=>g({height:c,overflow:"hidden"}))})},[a]);const x=E=>{if(!(E.target!==l.current||E.propertyName!=="height"))if(a){const C=kh(l);C===f.height?p({}):g({height:C}),r()}else f.height===c&&(p(u),r())};function S({style:E={},refKey:C="ref",...R}={}){const T=R[C],z={"aria-hidden":!a,inert:!a,...R,[C]:Cx(l,T),onTransitionEnd:x,style:{boxSizing:"border-box",...E,...f}};return Ge.version.startsWith("18")||(z.inert=!a),z}return S}const R_={transitionDuration:200,transitionTimingFunction:"ease",animateOpacity:!0},rm=ge((e,o)=>{const{children:r,in:a,transitionDuration:l,transitionTimingFunction:c,style:u,onTransitionEnd:f,animateOpacity:h,...p}=ce("Collapse",R_,e),g=cn(),v=Nu(),S=(g.respectReducedMotion?v:!1)?0:l,E=E_({opened:a,transitionDuration:S,transitionTimingFunction:c,onTransitionEnd:f});return S===0?a?y.jsx(he,{...p,children:r}):null:y.jsx(he,{...E({style:{opacity:a||!h?1:0,transition:h?`opacity ${S}ms ${c}`:"none",...om(u,g)},ref:o,...p}),children:r})});rm.displayName="@mantine/core/Collapse";function ju(){return typeof window<"u"}function Ii(e){return $x(e)?(e.nodeName||"").toLowerCase():"#document"}function dn(e){var o;return(e==null||(o=e.ownerDocument)==null?void 0:o.defaultView)||window}function sr(e){var o;return(o=($x(e)?e.ownerDocument:e.document)||window.document)==null?void 0:o.documentElement}function $x(e){return ju()?e instanceof Node||e instanceof dn(e).Node:!1}function pt(e){return ju()?e instanceof Element||e instanceof dn(e).Element:!1}function yo(e){return ju()?e instanceof HTMLElement||e instanceof dn(e).HTMLElement:!1}function bp(e){return!ju()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof dn(e).ShadowRoot}function Bu(e){const{overflow:o,overflowX:r,overflowY:a,display:l}=ho(e);return/auto|scroll|overlay|hidden|clip/.test(o+a+r)&&l!=="inline"&&l!=="contents"}function T_(e){return/^(table|td|th)$/.test(Ii(e))}function $u(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const __=/transform|translate|scale|rotate|perspective|filter/,D_=/paint|layout|strict|content/,ma=e=>!!e&&e!=="none";let Hh;function am(e){const o=pt(e)?ho(e):e;return ma(o.transform)||ma(o.translate)||ma(o.scale)||ma(o.rotate)||ma(o.perspective)||!Lu()&&(ma(o.backdropFilter)||ma(o.filter))||__.test(o.willChange||"")||D_.test(o.contain||"")}function N_(e){let o=Xr(e);for(;yo(o)&&!_a(o);){if(am(o))return o;if($u(o))return null;o=Xr(o)}return null}function Lu(){return Hh==null&&(Hh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Hh}function _a(e){return/^(html|body|#document)$/.test(Ii(e))}function ho(e){return dn(e).getComputedStyle(e)}function ku(e){return pt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Xr(e){if(Ii(e)==="html")return e;const o=e.assignedSlot||e.parentNode||bp(e)&&e.host||sr(e);return bp(o)?o.host:o}function Lx(e){const o=Xr(e);return _a(o)?(e.ownerDocument||e).body:yo(o)&&Bu(o)?o:Lx(o)}function nr(e,o,r){var a;o===void 0&&(o=[]),r===void 0&&(r=!0);const l=Lx(e),c=l===((a=e.ownerDocument)==null?void 0:a.body),u=dn(l);if(c){const f=xp(u);return o.concat(u,u.visualViewport||[],Bu(l)?l:[],f&&r?nr(f):[])}else return o.concat(l,nr(l,[],r))}function xp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function U0(e){let o=e.activeElement;for(;((r=o)==null||(r=r.shadowRoot)==null?void 0:r.activeElement)!=null;){var r;o=o.shadowRoot.activeElement}return o}function ds(e,o){if(!e||!o)return!1;const r=o.getRootNode==null?void 0:o.getRootNode();if(e.contains(o))return!0;if(r&&bp(r)){let a=o;for(;a;){if(e===a)return!0;a=a.parentNode||a.host}}return!1}function kx(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Hx(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(o=>{let{brand:r,version:a}=o;return r+"/"+a}).join(" "):navigator.userAgent}function A_(e){return O_()?!1:!P0()&&e.width===0&&e.height===0||P0()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function z_(){return/apple/i.test(navigator.vendor)}function P0(){const e=/android/i;return e.test(kx())||e.test(Hx())}function M_(){return kx().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function O_(){return Hx().includes("jsdom/")}function Sp(e,o){const r=["mouse","pen"];return r.push("",void 0),r.includes(e)}function j_(e){return"nativeEvent"in e}function B_(e){return e.matches("html,body")}function wa(e){return e?.ownerDocument||document}function Uh(e,o){if(o==null)return!1;if("composedPath"in e)return e.composedPath().includes(o);const r=e;return r.target!=null&&o.contains(r.target)}function Ni(e){return"composedPath"in e?e.composedPath()[0]:e.target}const $_="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function L_(e){return yo(e)&&e.matches($_)}const k_=["top","right","bottom","left"],po=Math.min,Kn=Math.max,vu=Math.round,Zc=Math.floor,or=e=>({x:e,y:e}),H_={left:"right",right:"left",bottom:"top",top:"bottom"};function Ux(e,o,r){return Kn(e,po(o,r))}function Do(e,o){return typeof e=="function"?e(o):e}function No(e){return e.split("-")[0]}function Fi(e){return e.split("-")[1]}function im(e){return e==="x"?"y":"x"}function lm(e){return e==="y"?"height":"width"}function uo(e){const o=e[0];return o==="t"||o==="b"?"y":"x"}function sm(e){return im(uo(e))}function U_(e,o,r){r===void 0&&(r=!1);const a=Fi(e),l=sm(e),c=lm(l);let u=l==="x"?a===(r?"end":"start")?"right":"left":a==="start"?"bottom":"top";return o.reference[c]>o.floating[c]&&(u=yu(u)),[u,yu(u)]}function P_(e){const o=yu(e);return[wp(e),o,wp(o)]}function wp(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const V0=["left","right"],Y0=["right","left"],V_=["top","bottom"],Y_=["bottom","top"];function G_(e,o,r){switch(e){case"top":case"bottom":return r?o?Y0:V0:o?V0:Y0;case"left":case"right":return o?V_:Y_;default:return[]}}function X_(e,o,r,a){const l=Fi(e);let c=G_(No(e),r==="start",a);return l&&(c=c.map(u=>u+"-"+l),o&&(c=c.concat(c.map(wp)))),c}function yu(e){const o=No(e);return H_[o]+e.slice(o.length)}function q_(e){var o,r,a,l;return{top:(o=e.top)!=null?o:0,right:(r=e.right)!=null?r:0,bottom:(a=e.bottom)!=null?a:0,left:(l=e.left)!=null?l:0}}function cm(e){return typeof e!="number"?q_(e):{top:e,right:e,bottom:e,left:e}}function Gr(e){const{x:o,y:r,width:a,height:l}=e;return{width:a,height:l,top:r,left:o,right:o+a,bottom:r+l,x:o,y:r}}function G0(e,o,r){let{reference:a,floating:l}=e;const c=uo(o),u=sm(o),f=lm(u),h=No(o),p=c==="y",g=a.x+a.width/2-l.width/2,v=a.y+a.height/2-l.height/2,x=a[f]/2-l[f]/2;let S;switch(h){case"top":S={x:g,y:a.y-l.height};break;case"bottom":S={x:g,y:a.y+a.height};break;case"right":S={x:a.x+a.width,y:v};break;case"left":S={x:a.x-l.width,y:v};break;default:S={x:a.x,y:a.y}}const E=Fi(o);return E&&(S[u]+=x*(E==="end"?1:-1)*(r&&p?-1:1)),S}async function I_(e,o){var r;o===void 0&&(o={});const{x:a,y:l,platform:c,rects:u,elements:f,strategy:h}=e,{boundary:p="clippingAncestors",rootBoundary:g="viewport",elementContext:v="floating",altBoundary:x=!1,padding:S=0}=Do(o,e),E=cm(S),R=f[x?v==="floating"?"reference":"floating":v],T=Gr(await c.getClippingRect({element:(r=await(c.isElement==null?void 0:c.isElement(R)))==null||r?R:R.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(f.floating)),boundary:p,rootBoundary:g,strategy:h})),z=v==="floating"?{x:a,y:l,width:u.floating.width,height:u.floating.height}:u.reference,A=await(c.getOffsetParent==null?void 0:c.getOffsetParent(f.floating)),N=await(c.isElement==null?void 0:c.isElement(A))&&await(c.getScale==null?void 0:c.getScale(A))||{x:1,y:1},B=Gr(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:z,offsetParent:A,strategy:h}):z);return{top:(T.top-B.top+E.top)/N.y,bottom:(B.bottom-T.bottom+E.bottom)/N.y,left:(T.left-B.left+E.left)/N.x,right:(B.right-T.right+E.right)/N.x}}const F_=50,Z_=async(e,o,r)=>{const{placement:a="bottom",strategy:l="absolute",middleware:c=[],platform:u}=r,f=u.detectOverflow?u:{...u,detectOverflow:I_},h=await(u.isRTL==null?void 0:u.isRTL(o));let p=await u.getElementRects({reference:e,floating:o,strategy:l}),{x:g,y:v}=G0(p,a,h),x=a,S=0;const E={};for(let C=0;C({name:"arrow",options:e,async fn(o){const{x:r,y:a,placement:l,rects:c,platform:u,elements:f,middlewareData:h}=o,{element:p,padding:g=0}=Do(e,o)||{};if(p==null)return{};const v=cm(g),x={x:r,y:a},S=sm(l),E=lm(S),C=await u.getDimensions(p),R=S==="y",T=R?"top":"left",z=R?"bottom":"right",A=R?"clientHeight":"clientWidth",N=c.reference[E]+c.reference[S]-x[S]-c.floating[E],B=x[S]-c.reference[S],M=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p));let $=M?M[A]:0;(!$||!await(u.isElement==null?void 0:u.isElement(M)))&&($=f.floating[A]||c.floating[E]);const L=N/2-B/2,H=$/2-C[E]/2-1,I=po(v[T],H),Y=po(v[z],H),X=$-C[E]-Y,ee=$/2-C[E]/2+L,ne=Ux(I,ee,X),re=!h.arrow&&Fi(l)!=null&&ee!==ne&&c.reference[E]/2-(eene<=0)){var Y,X;const ne=(((Y=c.flip)==null?void 0:Y.index)||0)+1,re=$[ne];if(re&&(!(v==="alignment"?z!==uo(re):!1)||I.every(V=>uo(V.placement)===z?V.overflows[0]>0:!0)))return{data:{index:ne,overflows:I},reset:{placement:re}};let j=(X=I.filter(k=>k.overflows[0]<=0).sort((k,V)=>k.overflows[1]-V.overflows[1])[0])==null?void 0:X.placement;if(!j)switch(S){case"bestFit":{var ee;const k=(ee=I.filter(V=>{if(M){const P=uo(V.placement);return P===z||P==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(P=>P>0).reduce((P,Z)=>P+Z,0)]).sort((V,P)=>V[1]-P[1])[0])==null?void 0:ee[0];k&&(j=k);break}case"initialPlacement":j=f;break}if(l!==j)return{reset:{placement:j}}}return{}}}};function X0(e,o){return{top:e.top-o.height,right:e.right-o.width,bottom:e.bottom-o.height,left:e.left-o.width}}function q0(e){return k_.some(o=>e[o]>=0)}const W_=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(o){const{rects:r,platform:a}=o,{strategy:l="referenceHidden",...c}=Do(e,o);switch(l){case"referenceHidden":{const u=await a.detectOverflow(o,{...c,elementContext:"reference"}),f=X0(u,r.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:q0(f)}}}case"escaped":{const u=await a.detectOverflow(o,{...c,altBoundary:!0}),f=X0(u,r.floating);return{data:{escapedOffsets:f,escaped:q0(f)}}}default:return{}}}}};function Px(e){const o=po(...e.map(c=>c.left)),r=po(...e.map(c=>c.top)),a=Kn(...e.map(c=>c.right)),l=Kn(...e.map(c=>c.bottom));return{x:o,y:r,width:a-o,height:l-r}}function J_(e){const o=e.slice().sort((l,c)=>l.y-c.y),r=[];let a=null;for(let l=0;la.height/2?r.push([c]):r[r.length-1].push(c),a=c}return r.map(l=>Gr(Px(l)))}const eD=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(o){const{placement:r,elements:a,rects:l,platform:c,strategy:u}=o,{padding:f=2,x:h,y:p}=Do(e,o),g=Array.from(await(c.getClientRects==null?void 0:c.getClientRects(a.reference))||[]);if(!g.length)return{};const v=J_(g),x=Gr(Px(g)),S=cm(f);function E(){if(v.length===2&&(v[0].left>v[1].right||v[1].left>v[0].right)&&h!=null&&p!=null)return v.find(R=>h>R.left-S.left&&hR.top-S.top&&p=2){if(uo(r)==="y"){const M=v[0],$=v[v.length-1],L=No(r)==="top",H=M.top,I=$.bottom,Y=L?M.left:$.left,X=L?M.right:$.right;return Gr({x:Y,y:H,width:X-Y,height:I-H})}const R=No(r)==="left",T=Kn(...v.map(M=>M.right)),z=po(...v.map(M=>M.left)),A=v.filter(M=>R?M.left===z:M.right===T),N=A[0].top,B=A[A.length-1].bottom;return Gr({x:z,y:N,width:T-z,height:B-N})}return x}const C=await c.getElementRects({reference:{getBoundingClientRect:E},floating:a.floating,strategy:u});return l.reference.x!==C.reference.x||l.reference.y!==C.reference.y||l.reference.width!==C.reference.width||l.reference.height!==C.reference.height?{reset:{rects:C}}:{}}}},Vx=new Set(["left","top"]);async function tD(e,o){const{placement:r,platform:a,elements:l}=e,c=await(a.isRTL==null?void 0:a.isRTL(l.floating)),u=No(r),f=Fi(r),h=uo(r)==="y",p=Vx.has(u)?-1:1,g=c&&h?-1:1,v=Do(o,e);let{mainAxis:x,crossAxis:S,alignmentAxis:E}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return f&&typeof E=="number"&&(S=f==="end"?E*-1:E),h?{x:S*g,y:x*p}:{x:x*p,y:S*g}}const nD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(o){var r,a;const{x:l,y:c,placement:u,middlewareData:f}=o,h=await tD(o,e);return u===((r=f.offset)==null?void 0:r.placement)&&(a=f.arrow)!=null&&a.alignmentOffset?{}:{x:l+h.x,y:c+h.y,data:{...h,placement:u}}}}},oD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(o){const{x:r,y:a,placement:l,platform:c}=o,{mainAxis:u=!0,crossAxis:f=!1,limiter:h={fn:z=>{let{x:A,y:N}=z;return{x:A,y:N}}},...p}=Do(e,o),g={x:r,y:a},v=await c.detectOverflow(o,p),x=uo(l),S=im(x);let E=g[S],C=g[x];const R=(z,A)=>Ux(A+v[z==="y"?"top":"left"],A,A-v[z==="y"?"bottom":"right"]);u&&(E=R(S,E)),f&&(C=R(x,C));const T=h.fn({...o,[S]:E,[x]:C});return{...T,data:{x:T.x-r,y:T.y-a,enabled:{[S]:u,[x]:f}}}}}},rD=function(e){return e===void 0&&(e={}),{options:e,fn(o){var r,a;const{x:l,y:c,placement:u,rects:f,middlewareData:h}=o,{offset:p=0,mainAxis:g=!0,crossAxis:v=!0}=Do(e,o),x={x:l,y:c},S=uo(u),E=im(S);let C=x[E],R=x[S];const T=Do(p,o),z=typeof T=="number"?{mainAxis:T,crossAxis:0}:{mainAxis:(r=T.mainAxis)!=null?r:0,crossAxis:(a=T.crossAxis)!=null?a:0};if(g){const B=E==="y"?"height":"width",M=f.reference[E]-f.floating[B]+z.mainAxis,$=f.reference[E]+f.reference[B]-z.mainAxis;C$&&(C=$)}if(v){var A,N;const B=E==="y"?"width":"height",M=Vx.has(No(u)),$=f.reference[S]-f.floating[B]+(M&&((A=h.offset)==null?void 0:A[S])||0)+(M?0:z.crossAxis),L=f.reference[S]+f.reference[B]+(M?0:((N=h.offset)==null?void 0:N[S])||0)-(M?z.crossAxis:0);R<$?R=$:R>L&&(R=L)}return{[E]:C,[S]:R}}}},aD=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(o){const{placement:r,rects:a,platform:l,elements:c}=o,{apply:u=()=>{},...f}=Do(e,o),h=await l.detectOverflow(o,f),p=No(r),g=Fi(r),v=uo(r)==="y",{width:x,height:S}=a.floating;let E,C;p==="top"||p==="bottom"?(E=p,C=g===(await(l.isRTL==null?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(C=p,E=g==="end"?"top":"bottom");const R=S-h.top-h.bottom,T=x-h.left-h.right,z=po(S-h[E],R),A=po(x-h[C],T),N=o.middlewareData.shift,B=!N;let M=z,$=A;N!=null&&N.enabled.x&&($=T),N!=null&&N.enabled.y&&(M=R),B&&!g&&(v?$=x-2*Kn(h.left,h.right):M=S-2*Kn(h.top,h.bottom)),await u({...o,availableWidth:$,availableHeight:M});const L=await l.getDimensions(c.floating);return x!==L.width||S!==L.height?{reset:{rects:!0}}:{}}}};function Yx(e){const o=ho(e);let r=parseFloat(o.width)||0,a=parseFloat(o.height)||0;const l=yo(e),c=l?e.offsetWidth:r,u=l?e.offsetHeight:a,f=vu(r)!==c||vu(a)!==u;return f&&(r=c,a=u),{width:r,height:a,$:f}}function um(e){return pt(e)?e:e.contextElement}function ji(e){const o=um(e);if(!yo(o))return or(1);const r=o.getBoundingClientRect(),{width:a,height:l,$:c}=Yx(o);let u=(c?vu(r.width):r.width)/a,f=(c?vu(r.height):r.height)/l;return(!u||!Number.isFinite(u))&&(u=1),(!f||!Number.isFinite(f))&&(f=1),{x:u,y:f}}const iD=or(0);function Gx(e){const o=dn(e);return!Lu()||!o.visualViewport?iD:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function lD(e,o,r){return o===void 0&&(o=!1),!!r&&o&&r===dn(e)}function Da(e,o,r,a){o===void 0&&(o=!1),r===void 0&&(r=!1);const l=e.getBoundingClientRect(),c=um(e);let u=or(1);o&&(a?pt(a)&&(u=ji(a)):u=ji(e));const f=lD(c,r,a)?Gx(c):or(0);let h=(l.left+f.x)/u.x,p=(l.top+f.y)/u.y,g=l.width/u.x,v=l.height/u.y;if(c&&a){const x=dn(c),S=pt(a)?dn(a):a;let E=x,C=xp(E);for(;C&&S!==E;){const R=ji(C),T=C.getBoundingClientRect(),z=ho(C),A=T.left+(C.clientLeft+parseFloat(z.paddingLeft))*R.x,N=T.top+(C.clientTop+parseFloat(z.paddingTop))*R.y;h*=R.x,p*=R.y,g*=R.x,v*=R.y,h+=A,p+=N,E=dn(C),C=xp(E)}}return Gr({width:g,height:v,x:h,y:p})}function Hu(e,o){const r=ku(e).scrollLeft;return o?o.left+r:Da(sr(e)).left+r}function Xx(e,o){const r=e.getBoundingClientRect(),a=r.left+o.scrollLeft-Hu(e,r),l=r.top+o.scrollTop;return{x:a,y:l}}function sD(e){let{elements:o,rect:r,offsetParent:a,strategy:l}=e;const c=l==="fixed",u=sr(a),f=o?$u(o.floating):!1;if(a===u||f&&c)return r;let h={scrollLeft:0,scrollTop:0},p=or(1);const g=or(0),v=yo(a);if((v||!c)&&((Ii(a)!=="body"||Bu(u))&&(h=ku(a)),v)){const S=Da(a);p=ji(a),g.x=S.x+a.clientLeft,g.y=S.y+a.clientTop}const x=u&&!v&&!c?Xx(u,h):or(0);return{width:r.width*p.x,height:r.height*p.y,x:r.x*p.x-h.scrollLeft*p.x+g.x+x.x,y:r.y*p.y-h.scrollTop*p.y+g.y+x.y}}function cD(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function uD(e){const o=ku(e),r=e.ownerDocument.body,a=Kn(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),l=Kn(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let c=-o.scrollLeft+Hu(e);const u=-o.scrollTop;return ho(r).direction==="rtl"&&(c+=Kn(e.clientWidth,r.clientWidth)-a),{width:a,height:l,x:c,y:u}}const fD=25;function dD(e,o,r){r===void 0&&(r="viewport");const a=r==="layoutViewport",l=dn(e),c=sr(e),u=l.visualViewport;let f=c.clientWidth,h=c.clientHeight,p=0,g=0;if(u){const x=!Lu()||o==="fixed";a?x||(p=-u.offsetLeft,g=-u.offsetTop):(f=u.width,h=u.height,x&&(p=u.offsetLeft,g=u.offsetTop))}if(Hu(c)<=0){const x=c.ownerDocument,S=x.body,E=getComputedStyle(S),C=x.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,R=Math.abs(c.clientWidth-S.clientWidth-C),T=getComputedStyle(c).scrollbarGutter==="stable both-edges"?R/2:R;T<=fD&&(f-=T)}return{width:f,height:h,x:p,y:g}}function hD(e,o){const r=Da(e,!0,o==="fixed"),a=r.top+e.clientTop,l=r.left+e.clientLeft,c=ji(e),u=e.clientWidth*c.x,f=e.clientHeight*c.y,h=l*c.x,p=a*c.y;return{width:u,height:f,x:h,y:p}}function I0(e,o,r){let a;if(o==="viewport"||o==="layoutViewport")a=dD(e,r,o);else if(o==="document")a=uD(sr(e));else if(pt(o))a=hD(o,r);else{const l=Gx(e);a={x:o.x-l.x,y:o.y-l.y,width:o.width,height:o.height}}return Gr(a)}function pD(e,o){const r=o.get(e);if(r)return r;let a=nr(e,[],!1).filter(f=>pt(f)&&Ii(f)!=="body"),l=null;const c=ho(e).position==="fixed";let u=c?Xr(e):e;for(;pt(u)&&!_a(u);){const f=ho(u),h=am(u),p=l?l.position:c?"fixed":"";!h&&(p==="fixed"||p==="absolute"&&f.position==="static")?a=a.filter(v=>v!==u):l=f,u=Xr(u)}return o.set(e,a),a}function mD(e){let{element:o,boundary:r,rootBoundary:a,strategy:l}=e;const u=[...r==="clippingAncestors"?$u(o)?[]:pD(o,this._c):[].concat(r),a],f=I0(o,u[0],l);let h=f.top,p=f.right,g=f.bottom,v=f.left;for(let x=1;x{f(!1,1e-7)},1e3)}$=!1}try{a=new IntersectionObserver(L,{...M,root:c.ownerDocument})}catch{a=new IntersectionObserver(L,M)}a.observe(e)}const h=dn(e),p=()=>f(r);return h.addEventListener("resize",p),f(!0),()=>{h.removeEventListener("resize",p),u()}}function wD(e,o,r,a){a===void 0&&(a={});const{ancestorScroll:l=!0,ancestorResize:c=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:h=!1}=a,p=um(e),g=l||c?[...p?nr(p):[],...o?nr(o):[]]:[];g.forEach(T=>{l&&T.addEventListener("scroll",r),c&&T.addEventListener("resize",r)});const v=p&&f?SD(p,r,c):null;let x=-1,S=null;u&&(S=new ResizeObserver(T=>{let[z]=T;z&&z.target===p&&S&&o&&(S.unobserve(o),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var A;(A=S)==null||A.observe(o)})),r()}),p&&!h&&S.observe(p),o&&S.observe(o));let E,C=h?Da(e):null;h&&R();function R(){const T=Da(e);C&&!Ix(C,T)&&r(),C=T,E=requestAnimationFrame(R)}return r(),()=>{var T;g.forEach(z=>{l&&z.removeEventListener("scroll",r),c&&z.removeEventListener("resize",r)}),v?.(),(T=S)==null||T.disconnect(),S=null,h&&cancelAnimationFrame(E)}}const CD=nD,ED=oD,RD=K_,TD=aD,_D=W_,Z0=Q_,DD=eD,ND=rD,AD=(e,o,r)=>{const a=new Map,l=r??{},c={...xD,...l.platform,_c:a};return Z_(e,o,{...l,platform:c})};var zD=typeof document<"u",MD=function(){},su=zD?b.useLayoutEffect:MD;function bu(e,o){if(e===o)return!0;if(typeof e!=typeof o)return!1;if(typeof e=="function"&&e.toString()===o.toString())return!0;let r,a,l;if(e&&o&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==o.length)return!1;for(a=r;a--!==0;)if(!bu(e[a],o[a]))return!1;return!0}if(l=Object.keys(e),r=l.length,r!==Object.keys(o).length)return!1;for(a=r;a--!==0;)if(!{}.hasOwnProperty.call(o,l[a]))return!1;for(a=r;a--!==0;){const c=l[a];if(!(c==="_owner"&&e.$$typeof)&&!bu(e[c],o[c]))return!1}return!0}return e!==e&&o!==o}function Fx(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Q0(e,o){const r=Fx(e);return Math.round(o*r)/r}function Vh(e){const o=b.useRef(e);return su(()=>{o.current=e}),o}function OD(e){e===void 0&&(e={});const{placement:o="bottom",strategy:r="absolute",middleware:a=[],platform:l,elements:{reference:c,floating:u}={},transform:f=!0,whileElementsMounted:h,open:p}=e,[g,v]=b.useState({x:0,y:0,strategy:r,placement:o,middlewareData:{},isPositioned:!1}),[x,S]=b.useState(a);bu(x,a)||S(a);const[E,C]=b.useState(null),[R,T]=b.useState(null),z=b.useCallback(V=>{V!==M.current&&(M.current=V,C(V))},[]),A=b.useCallback(V=>{V!==$.current&&($.current=V,T(V))},[]),N=c||E,B=u||R,M=b.useRef(null),$=b.useRef(null),L=b.useRef(g),H=h!=null,I=Vh(h),Y=Vh(l),X=Vh(p),ee=b.useCallback(()=>{if(!M.current||!$.current)return;const V={placement:o,strategy:r,middleware:x};Y.current&&(V.platform=Y.current),AD(M.current,$.current,V).then(P=>{const Z={...P,isPositioned:X.current!==!1};ne.current&&!bu(L.current,Z)&&(L.current=Z,co.flushSync(()=>{v(Z)}))})},[x,o,r,Y,X]);su(()=>{p===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,v(V=>({...V,isPositioned:!1})))},[p]);const ne=b.useRef(!1);su(()=>(ne.current=!0,()=>{ne.current=!1}),[]),su(()=>{if(N&&(M.current=N),B&&($.current=B),N&&B){if(I.current)return I.current(N,B,ee);ee()}},[N,B,ee,I,H]);const re=b.useMemo(()=>({reference:M,floating:$,setReference:z,setFloating:A}),[z,A]),j=b.useMemo(()=>({reference:N,floating:B}),[N,B]),k=b.useMemo(()=>{const V={position:r,left:0,top:0};if(!j.floating)return V;const P=Q0(j.floating,g.x),Z=Q0(j.floating,g.y);return f?{...V,transform:"translate("+P+"px, "+Z+"px)",...Fx(j.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:P,top:Z}},[r,f,j.floating,g.x,g.y]);return b.useMemo(()=>({...g,update:ee,refs:re,elements:j,floatingStyles:k}),[g,ee,re,j,k])}const jD=e=>{function o(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:a,padding:l}=typeof e=="function"?e(r):e;return a&&o(a)?a.current!=null?Z0({element:a.current,padding:l}).fn(r):{}:a?Z0({element:a,padding:l}).fn(r):{}}}},Zx=(e,o)=>{const r=CD(e);return{name:r.name,fn:r.fn,options:[e,o]}},fm=(e,o)=>{const r=ED(e);return{name:r.name,fn:r.fn,options:[e,o]}},K0=(e,o)=>({fn:ND(e).fn,options:[e,o]}),xu=(e,o)=>{const r=RD(e);return{name:r.name,fn:r.fn,options:[e,o]}},BD=(e,o)=>{const r=TD(e);return{name:r.name,fn:r.fn,options:[e,o]}},$D=(e,o)=>{const r=_D(e);return{name:r.name,fn:r.fn,options:[e,o]}},as=(e,o)=>{const r=DD(e);return{name:r.name,fn:r.fn,options:[e,o]}},Qx=(e,o)=>{const r=jD(e);return{name:r.name,fn:r.fn,options:[e,o]}};function LD(e){return b.useMemo(()=>e.every(o=>o==null)?null:o=>{e.forEach(r=>{typeof r=="function"?r(o):r!=null&&(r.current=o)})},e)}const Kx={...X2},kD=Kx.useInsertionEffect,HD=kD||(e=>e());function tr(e){const o=b.useRef(()=>{});return HD(()=>{o.current=e}),b.useCallback(function(){for(var r=arguments.length,a=new Array(r),l=0;l"floating-ui-"+Math.random().toString(36).slice(2,6)+UD++;function PD(){const[e,o]=b.useState(()=>W0?J0():void 0);return _o(()=>{e==null&&o(J0())},[]),b.useEffect(()=>{W0=!0},[]),e}const VD=Kx.useId,Wx=VD||PD;function YD(){const e=new Map;return{emit(o,r){var a;(a=e.get(o))==null||a.forEach(l=>l(r))},on(o,r){e.set(o,[...e.get(o)||[],r])},off(o,r){var a;e.set(o,((a=e.get(o))==null?void 0:a.filter(l=>l!==r))||[])}}}const GD=b.createContext(null),XD=b.createContext(null),dm=()=>{var e;return((e=b.useContext(GD))==null?void 0:e.id)||null},hm=()=>b.useContext(XD);function pm(e){return"data-floating-ui-"+e}function Yh(e){const o=b.useRef(e);return _o(()=>{o.current=e}),o}const e1=pm("safe-polygon");function cu(e,o,r){return r&&!Sp(r)?0:typeof e=="number"?e:e?.[o]}function qD(e,o){o===void 0&&(o={});const{open:r,onOpenChange:a,dataRef:l,events:c,elements:u}=e,{enabled:f=!0,delay:h=0,handleClose:p=null,mouseOnly:g=!1,restMs:v=0,move:x=!0}=o,S=hm(),E=dm(),C=Yh(p),R=Yh(h),T=Yh(r),z=b.useRef(),A=b.useRef(-1),N=b.useRef(),B=b.useRef(-1),M=b.useRef(!0),$=b.useRef(!1),L=b.useRef(()=>{}),H=b.useRef(!1),I=b.useCallback(()=>{var k;const V=(k=l.current.openEvent)==null?void 0:k.type;return V?.includes("mouse")&&V!=="mousedown"},[l]);b.useEffect(()=>{if(!f)return;function k(V){let{open:P}=V;P||(clearTimeout(A.current),clearTimeout(B.current),M.current=!0,H.current=!1)}return c.on("openchange",k),()=>{c.off("openchange",k)}},[f,c]),b.useEffect(()=>{if(!f||!C.current||!r)return;function k(P){I()&&a(!1,P,"hover")}const V=wa(u.floating).documentElement;return V.addEventListener("mouseleave",k),()=>{V.removeEventListener("mouseleave",k)}},[u.floating,r,a,f,C,I]);const Y=b.useCallback(function(k,V,P){V===void 0&&(V=!0),P===void 0&&(P="hover");const Z=cu(R.current,"close",z.current);Z&&!N.current?(clearTimeout(A.current),A.current=window.setTimeout(()=>a(!1,k,P),Z)):V&&(clearTimeout(A.current),a(!1,k,P))},[R,a]),X=tr(()=>{L.current(),N.current=void 0}),ee=tr(()=>{if($.current){const k=wa(u.floating).body;k.style.pointerEvents="",k.removeAttribute(e1),$.current=!1}}),ne=tr(()=>l.current.openEvent?["click","mousedown"].includes(l.current.openEvent.type):!1);b.useEffect(()=>{if(!f)return;function k(D){if(clearTimeout(A.current),M.current=!1,g&&!Sp(z.current)||v>0&&!cu(R.current,"open"))return;const O=cu(R.current,"open",z.current);O?A.current=window.setTimeout(()=>{T.current||a(!0,D,"hover")},O):r||a(!0,D,"hover")}function V(D){if(ne())return;L.current();const O=wa(u.floating);if(clearTimeout(B.current),H.current=!1,C.current&&l.current.floatingContext){r||clearTimeout(A.current),N.current=C.current({...l.current.floatingContext,tree:S,x:D.clientX,y:D.clientY,onClose(){ee(),X(),ne()||Y(D,!0,"safe-polygon")}});const W=N.current;O.addEventListener("mousemove",W),L.current=()=>{O.removeEventListener("mousemove",W)};return}(z.current!=="touch"||!ds(u.floating,D.relatedTarget))&&Y(D)}function P(D){ne()||l.current.floatingContext&&(C.current==null||C.current({...l.current.floatingContext,tree:S,x:D.clientX,y:D.clientY,onClose(){ee(),X(),ne()||Y(D)}})(D))}if(pt(u.domReference)){var Z;const D=u.domReference;return r&&D.addEventListener("mouseleave",P),(Z=u.floating)==null||Z.addEventListener("mouseleave",P),x&&D.addEventListener("mousemove",k,{once:!0}),D.addEventListener("mouseenter",k),D.addEventListener("mouseleave",V),()=>{var O;r&&D.removeEventListener("mouseleave",P),(O=u.floating)==null||O.removeEventListener("mouseleave",P),x&&D.removeEventListener("mousemove",k),D.removeEventListener("mouseenter",k),D.removeEventListener("mouseleave",V)}}},[u,f,e,g,v,x,Y,X,ee,a,r,T,S,R,C,l,ne]),_o(()=>{var k;if(f&&r&&(k=C.current)!=null&&k.__options.blockPointerEvents&&I()){$.current=!0;const P=u.floating;if(pt(u.domReference)&&P){var V;const Z=wa(u.floating).body;Z.setAttribute(e1,"");const D=u.domReference,O=S==null||(V=S.nodesRef.current.find(q=>q.id===E))==null||(V=V.context)==null?void 0:V.elements.floating;return O&&(O.style.pointerEvents=""),Z.style.pointerEvents="none",D.style.pointerEvents="auto",P.style.pointerEvents="auto",()=>{Z.style.pointerEvents="",D.style.pointerEvents="",P.style.pointerEvents=""}}}},[f,r,E,u,S,C,I]),_o(()=>{r||(z.current=void 0,H.current=!1,X(),ee())},[r,X,ee]),b.useEffect(()=>()=>{X(),clearTimeout(A.current),clearTimeout(B.current),ee()},[f,u.domReference,X,ee]);const re=b.useMemo(()=>{function k(V){z.current=V.pointerType}return{onPointerDown:k,onPointerEnter:k,onMouseMove(V){const{nativeEvent:P}=V;function Z(){!M.current&&!T.current&&a(!0,P,"hover")}g&&!Sp(z.current)||r||v===0||H.current&&V.movementX**2+V.movementY**2<2||(clearTimeout(B.current),z.current==="touch"?Z():(H.current=!0,B.current=window.setTimeout(Z,v)))}}},[g,a,r,T,v]),j=b.useMemo(()=>({onMouseEnter(){clearTimeout(A.current)},onMouseLeave(k){ne()||Y(k.nativeEvent,!1)}}),[Y,ne]);return b.useMemo(()=>f?{reference:re,floating:j}:{},[f,re,j])}const Cp=()=>{},Jx=b.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Cp,setState:Cp,isInstantPhase:!1}),ID=()=>b.useContext(Jx);function FD(e){const{children:o,delay:r,timeoutMs:a=0}=e,[l,c]=b.useReducer((h,p)=>({...h,...p}),{delay:r,timeoutMs:a,initialDelay:r,currentId:null,isInstantPhase:!1}),u=b.useRef(null),f=b.useCallback(h=>{c({currentId:h})},[]);return _o(()=>{l.currentId?u.current===null?u.current=l.currentId:l.isInstantPhase||c({isInstantPhase:!0}):(l.isInstantPhase&&c({isInstantPhase:!1}),u.current=null)},[l.currentId,l.isInstantPhase]),b.createElement(Jx.Provider,{value:b.useMemo(()=>({...l,setState:c,setCurrentId:f}),[l,f])},o)}function ZD(e,o){o===void 0&&(o={});const{open:r,onOpenChange:a,floatingId:l}=e,{id:c,enabled:u=!0}=o,f=c??l,h=ID(),{currentId:p,setCurrentId:g,initialDelay:v,setState:x,timeoutMs:S}=h;return _o(()=>{u&&p&&(x({delay:{open:1,close:cu(v,"close")}}),p!==f&&a(!1))},[u,f,a,x,p,v]),_o(()=>{function E(){a(!1),x({delay:v,currentId:null})}if(u&&p&&!r&&p===f){if(S){const C=window.setTimeout(E,S);return()=>{clearTimeout(C)}}E()}},[u,r,x,p,f,a,v,S]),_o(()=>{u&&(g===Cp||!r||g(f))},[u,r,g,f]),h}function Gh(e,o){let r=e.filter(l=>{var c;return l.parentId===o&&((c=l.context)==null?void 0:c.open)}),a=r;for(;a.length;)a=e.filter(l=>{var c;return(c=a)==null?void 0:c.some(u=>{var f;return l.parentId===u.id&&((f=l.context)==null?void 0:f.open)})}),r=r.concat(a);return r}const QD="data-floating-ui-focusable",KD={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},WD={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},t1=e=>{var o,r;return{escapeKey:typeof e=="boolean"?e:(o=e?.escapeKey)!=null?o:!1,outsidePress:typeof e=="boolean"?e:(r=e?.outsidePress)!=null?r:!0}};function JD(e,o){o===void 0&&(o={});const{open:r,onOpenChange:a,elements:l,dataRef:c}=e,{enabled:u=!0,escapeKey:f=!0,outsidePress:h=!0,outsidePressEvent:p="pointerdown",referencePress:g=!1,referencePressEvent:v="pointerdown",ancestorScroll:x=!1,bubbles:S,capture:E}=o,C=hm(),R=tr(typeof h=="function"?h:()=>!1),T=typeof h=="function"?R:h,z=b.useRef(!1),A=b.useRef(!1),{escapeKey:N,outsidePress:B}=t1(S),{escapeKey:M,outsidePress:$}=t1(E),L=b.useRef(!1),H=tr(re=>{var j;if(!r||!u||!f||re.key!=="Escape"||L.current)return;const k=(j=c.current.floatingContext)==null?void 0:j.nodeId,V=C?Gh(C.nodesRef.current,k):[];if(!N&&(re.stopPropagation(),V.length>0)){let P=!0;if(V.forEach(Z=>{var D;if((D=Z.context)!=null&&D.open&&!Z.context.dataRef.current.__escapeKeyBubbles){P=!1;return}}),!P)return}a(!1,j_(re)?re.nativeEvent:re,"escape-key")}),I=tr(re=>{var j;const k=()=>{var V;H(re),(V=Ni(re))==null||V.removeEventListener("keydown",k)};(j=Ni(re))==null||j.addEventListener("keydown",k)}),Y=tr(re=>{var j;const k=z.current;z.current=!1;const V=A.current;if(A.current=!1,p==="click"&&V||k||typeof T=="function"&&!T(re))return;const P=Ni(re),Z="["+pm("inert")+"]",D=wa(l.floating).querySelectorAll(Z);let O=pt(P)?P:null;for(;O&&!_a(O);){const ue=Xr(O);if(_a(ue)||!pt(ue))break;O=ue}if(D.length&&pt(P)&&!B_(P)&&!ds(P,l.floating)&&Array.from(D).every(ue=>!ds(O,ue)))return;if(yo(P)&&ne){const ue=P.clientWidth>0&&P.scrollWidth>P.clientWidth,ve=P.clientHeight>0&&P.scrollHeight>P.clientHeight;let fe=ve&&re.offsetX>P.clientWidth;if(ve&&ho(P).direction==="rtl"&&(fe=re.offsetX<=P.offsetWidth-P.clientWidth),fe||ue&&re.offsetY>P.clientHeight)return}const q=(j=c.current.floatingContext)==null?void 0:j.nodeId,W=C&&Gh(C.nodesRef.current,q).some(ue=>{var ve;return Uh(re,(ve=ue.context)==null?void 0:ve.elements.floating)});if(Uh(re,l.floating)||Uh(re,l.domReference)||W)return;const ie=C?Gh(C.nodesRef.current,q):[];if(ie.length>0){let ue=!0;if(ie.forEach(ve=>{var fe;if((fe=ve.context)!=null&&fe.open&&!ve.context.dataRef.current.__outsidePressBubbles){ue=!1;return}}),!ue)return}a(!1,re,"outside-press")}),X=tr(re=>{var j;const k=()=>{var V;Y(re),(V=Ni(re))==null||V.removeEventListener(p,k)};(j=Ni(re))==null||j.addEventListener(p,k)});b.useEffect(()=>{if(!r||!u)return;c.current.__escapeKeyBubbles=N,c.current.__outsidePressBubbles=B;let re=-1;function j(D){a(!1,D,"ancestor-scroll")}function k(){window.clearTimeout(re),L.current=!0}function V(){re=window.setTimeout(()=>{L.current=!1},Lu()?5:0)}const P=wa(l.floating);f&&(P.addEventListener("keydown",M?I:H,M),P.addEventListener("compositionstart",k),P.addEventListener("compositionend",V)),T&&P.addEventListener(p,$?X:Y,$);let Z=[];return x&&(pt(l.domReference)&&(Z=nr(l.domReference)),pt(l.floating)&&(Z=Z.concat(nr(l.floating))),!pt(l.reference)&&l.reference&&l.reference.contextElement&&(Z=Z.concat(nr(l.reference.contextElement)))),Z=Z.filter(D=>{var O;return D!==((O=P.defaultView)==null?void 0:O.visualViewport)}),Z.forEach(D=>{D.addEventListener("scroll",j,{passive:!0})}),()=>{f&&(P.removeEventListener("keydown",M?I:H,M),P.removeEventListener("compositionstart",k),P.removeEventListener("compositionend",V)),T&&P.removeEventListener(p,$?X:Y,$),Z.forEach(D=>{D.removeEventListener("scroll",j)}),window.clearTimeout(re)}},[c,l,f,T,p,r,a,x,u,N,B,H,M,I,Y,$,X]),b.useEffect(()=>{z.current=!1},[T,p]);const ee=b.useMemo(()=>({onKeyDown:H,[KD[v]]:re=>{g&&a(!1,re.nativeEvent,"reference-press")}}),[H,a,g,v]),ne=b.useMemo(()=>({onKeyDown:H,onMouseDown(){A.current=!0},onMouseUp(){A.current=!0},[WD[p]]:()=>{z.current=!0}}),[H,p]);return b.useMemo(()=>u?{reference:ee,floating:ne}:{},[u,ee,ne])}function eN(e){const{open:o=!1,onOpenChange:r,elements:a}=e,l=Wx(),c=b.useRef({}),[u]=b.useState(()=>YD()),f=dm()!=null,[h,p]=b.useState(a.reference),g=tr((S,E,C)=>{c.current.openEvent=S?E:void 0,u.emit("openchange",{open:S,event:E,reason:C,nested:f}),r?.(S,E,C)}),v=b.useMemo(()=>({setPositionReference:p}),[]),x=b.useMemo(()=>({reference:h||a.reference||null,floating:a.floating||null,domReference:a.reference}),[h,a.reference,a.floating]);return b.useMemo(()=>({dataRef:c,open:o,onOpenChange:g,elements:x,events:u,floatingId:l,refs:v}),[o,g,x,u,l,v])}function mm(e){e===void 0&&(e={});const{nodeId:o}=e,r=eN({...e,elements:{reference:null,floating:null,...e.elements}}),a=e.rootContext||r,l=a.elements,[c,u]=b.useState(null),[f,h]=b.useState(null),g=l?.domReference||c,v=b.useRef(null),x=hm();_o(()=>{g&&(v.current=g)},[g]);const S=OD({...e,elements:{...l,...f&&{reference:f}}}),E=b.useCallback(A=>{const N=pt(A)?{getBoundingClientRect:()=>A.getBoundingClientRect(),contextElement:A}:A;h(N),S.refs.setReference(N)},[S.refs]),C=b.useCallback(A=>{(pt(A)||A===null)&&(v.current=A,u(A)),(pt(S.refs.reference.current)||S.refs.reference.current===null||A!==null&&!pt(A))&&S.refs.setReference(A)},[S.refs]),R=b.useMemo(()=>({...S.refs,setReference:C,setPositionReference:E,domReference:v}),[S.refs,C,E]),T=b.useMemo(()=>({...S.elements,domReference:g}),[S.elements,g]),z=b.useMemo(()=>({...S,...a,refs:R,elements:T,nodeId:o}),[S,R,T,o,a]);return _o(()=>{a.dataRef.current.floatingContext=z;const A=x?.nodesRef.current.find(N=>N.id===o);A&&(A.context=z)}),b.useMemo(()=>({...S,context:z,refs:R,elements:T}),[S,R,T,z])}function tN(e,o){o===void 0&&(o={});const{open:r,onOpenChange:a,events:l,dataRef:c,elements:u}=e,{enabled:f=!0,visibleOnly:h=!0}=o,p=b.useRef(!1),g=b.useRef(),v=b.useRef(!0);b.useEffect(()=>{if(!f)return;const S=dn(u.domReference);function E(){!r&&yo(u.domReference)&&u.domReference===U0(wa(u.domReference))&&(p.current=!0)}function C(){v.current=!0}return S.addEventListener("blur",E),S.addEventListener("keydown",C,!0),()=>{S.removeEventListener("blur",E),S.removeEventListener("keydown",C,!0)}},[u.domReference,r,f]),b.useEffect(()=>{if(!f)return;function S(E){let{reason:C}=E;(C==="reference-press"||C==="escape-key")&&(p.current=!0)}return l.on("openchange",S),()=>{l.off("openchange",S)}},[l,f]),b.useEffect(()=>()=>{clearTimeout(g.current)},[]);const x=b.useMemo(()=>({onPointerDown(S){A_(S.nativeEvent)||(v.current=!1)},onMouseLeave(){p.current=!1},onFocus(S){if(p.current)return;const E=Ni(S.nativeEvent);if(h&&pt(E))try{if(z_()&&M_())throw Error();if(!E.matches(":focus-visible"))return}catch{if(!v.current&&!L_(E))return}a(!0,S.nativeEvent,"focus")},onBlur(S){p.current=!1;const E=S.relatedTarget,C=S.nativeEvent,R=pt(E)&&E.hasAttribute(pm("focus-guard"))&&E.getAttribute("data-type")==="outside";g.current=window.setTimeout(()=>{var T;const z=U0(u.domReference?u.domReference.ownerDocument:document);!E&&z===u.domReference||ds((T=c.current.floatingContext)==null?void 0:T.refs.floating.current,z)||ds(u.domReference,z)||R||a(!1,C,"focus")})}}),[c,u.domReference,a,h]);return b.useMemo(()=>f?{reference:x}:{},[f,x])}const n1="active",o1="selected";function Xh(e,o,r){const a=new Map,l=r==="item";let c=e;if(l&&e){const{[n1]:u,[o1]:f,...h}=e;c=h}return{...r==="floating"&&{tabIndex:-1,[QD]:""},...c,...o.map(u=>{const f=u?u[r]:null;return typeof f=="function"?e?f(e):null:f}).concat(e).reduce((u,f)=>(f&&Object.entries(f).forEach(h=>{let[p,g]=h;if(!(l&&[n1,o1].includes(p)))if(p.indexOf("on")===0){if(a.has(p)||a.set(p,[]),typeof g=="function"){var v;(v=a.get(p))==null||v.push(g),u[p]=function(){for(var x,S=arguments.length,E=new Array(S),C=0;CR(...E)).find(R=>R!==void 0)}}}else u[p]=g}),u),{})}}function nN(e){e===void 0&&(e=[]);const o=e.map(f=>f?.reference),r=e.map(f=>f?.floating),a=e.map(f=>f?.item),l=b.useCallback(f=>Xh(f,e,"reference"),o),c=b.useCallback(f=>Xh(f,e,"floating"),r),u=b.useCallback(f=>Xh(f,e,"item"),a);return b.useMemo(()=>({getReferenceProps:l,getFloatingProps:c,getItemProps:u}),[l,c,u])}const oN=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function rN(e,o){var r;o===void 0&&(o={});const{open:a,floatingId:l}=e,{enabled:c=!0,role:u="dialog"}=o,f=(r=oN.get(u))!=null?r:u,h=Wx(),g=dm()!=null,v=b.useMemo(()=>f==="tooltip"||u==="label"?{["aria-"+(u==="label"?"labelledby":"describedby")]:a?l:void 0}:{"aria-expanded":a?"true":"false","aria-haspopup":f==="alertdialog"?"dialog":f,"aria-controls":a?l:void 0,...f==="listbox"&&{role:"combobox"},...f==="menu"&&{id:h},...f==="menu"&&g&&{role:"menuitem"},...u==="select"&&{"aria-autocomplete":"none"},...u==="combobox"&&{"aria-autocomplete":"list"}},[f,l,g,a,h,u]),x=b.useMemo(()=>{const E={id:l,...f&&{role:f}};return f==="tooltip"||u==="label"?E:{...E,...f==="menu"&&{"aria-labelledby":h}}},[f,l,h,u]),S=b.useCallback(E=>{let{active:C,selected:R}=E;const T={role:"option",...C&&{id:l+"-option"}};switch(u){case"select":return{...T,"aria-selected":C&&R};case"combobox":return{...T,...C&&{"aria-selected":!0}}}return{}},[l,u]);return b.useMemo(()=>c?{reference:v,floating:x,item:S}:{},[c,v,x,S])}const[aN,eo]=zo("ScrollArea.Root component was not found in tree");function Hi(e,o){const r=ba(o);Yi(()=>{let a=0;if(e){const l=new ResizeObserver(()=>{cancelAnimationFrame(a),a=window.requestAnimationFrame(r)});return l.observe(e),()=>{window.cancelAnimationFrame(a),l.unobserve(e)}}},[e,r])}const iN=b.forwardRef((e,o)=>{const{style:r,...a}=e,l=eo(),[c,u]=b.useState(0),[f,h]=b.useState(0),p=!!(c&&f);return Hi(l.scrollbarX,()=>{const g=l.scrollbarX?.offsetHeight||0;l.onCornerHeightChange(g),h(g)}),Hi(l.scrollbarY,()=>{const g=l.scrollbarY?.offsetWidth||0;l.onCornerWidthChange(g),u(g)}),p?y.jsx("div",{...a,ref:o,style:{...r,width:c,height:f}}):null}),lN=b.forwardRef((e,o)=>{const r=eo(),a=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&a?y.jsx(iN,{...e,ref:o}):null}),sN={scrollHideDelay:1e3,type:"hover"},eS=b.forwardRef((e,o)=>{const{type:r,scrollHideDelay:a,scrollbars:l,getStyles:c,...u}=ce("ScrollAreaRoot",sN,e),[f,h]=b.useState(null),[p,g]=b.useState(null),[v,x]=b.useState(null),[S,E]=b.useState(null),[C,R]=b.useState(null),[T,z]=b.useState(0),[A,N]=b.useState(0),[B,M]=b.useState(!1),[$,L]=b.useState(!1),H=Mt(o,I=>h(I));return y.jsx(aN,{value:{type:r,scrollHideDelay:a,scrollArea:f,viewport:p,onViewportChange:g,content:v,onContentChange:x,scrollbarX:S,onScrollbarXChange:E,scrollbarXEnabled:B,onScrollbarXEnabledChange:M,scrollbarY:C,onScrollbarYChange:R,scrollbarYEnabled:$,onScrollbarYEnabledChange:L,onCornerWidthChange:z,onCornerHeightChange:N,getStyles:c},children:y.jsx(he,{...u,ref:H,__vars:{"--sa-corner-width":l!=="xy"?"0px":`${T}px`,"--sa-corner-height":l!=="xy"?"0px":`${A}px`}})})});eS.displayName="@mantine/core/ScrollAreaRoot";function tS(e,o){const r=e/o;return Number.isNaN(r)?0:r}function Uu(e){const o=tS(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=(e.scrollbar.size-r)*o;return Math.max(a,18)}function nS(e,o){return r=>{if(e[0]===e[1]||o[0]===o[1])return o[0];const a=(o[1]-o[0])/(e[1]-e[0]);return o[0]+a*(r-e[0])}}function cN(e,[o,r]){return Math.min(r,Math.max(o,e))}function r1(e,o,r="ltr"){const a=Uu(o),l=o.scrollbar.paddingStart+o.scrollbar.paddingEnd,c=o.scrollbar.size-l,u=o.content-o.viewport,f=c-a,h=r==="ltr"?[0,u]:[u*-1,0],p=cN(e,h);return nS([0,u],[0,f])(p)}function uN(e,o,r,a="ltr"){const l=Uu(r),c=l/2,u=o||c,f=l-u,h=r.scrollbar.paddingStart+u,p=r.scrollbar.size-r.scrollbar.paddingEnd-f,g=r.content-r.viewport,v=a==="ltr"?[0,g]:[g*-1,0];return nS([h,p],v)(e)}function oS(e,o){return e>0&&e{e?.(a),(r===!1||!a.defaultPrevented)&&o?.(a)}}const[fN,rS]=zo("ScrollAreaScrollbar was not found in tree"),aS=b.forwardRef((e,o)=>{const{sizes:r,hasThumb:a,onThumbChange:l,onThumbPointerUp:c,onThumbPointerDown:u,onThumbPositionChange:f,onDragScroll:h,onWheelScroll:p,onResize:g,...v}=e,x=eo(),[S,E]=b.useState(null),C=Mt(o,L=>E(L)),R=b.useRef(null),T=b.useRef(""),{viewport:z}=x,A=r.content-r.viewport,N=ba(p),B=ba(f),M=Du(g,10),$=L=>{if(R.current){const H=L.clientX-R.current.left,I=L.clientY-R.current.top;h({x:H,y:I})}};return b.useEffect(()=>{const L=H=>{const I=H.target;S?.contains(I)&&N(H,A)};return document.addEventListener("wheel",L,{passive:!1}),()=>document.removeEventListener("wheel",L,{passive:!1})},[z,S,A,N]),b.useEffect(B,[r,B]),Hi(S,M),Hi(x.content,M),y.jsx(fN,{value:{scrollbar:S,hasThumb:a,onThumbChange:ba(l),onThumbPointerUp:ba(c),onThumbPositionChange:B,onThumbPointerDown:ba(u)},children:y.jsx("div",{...v,ref:C,"data-mantine-scrollbar":!0,style:{position:"absolute",...v.style},onPointerDown:Ra(e.onPointerDown,L=>{L.preventDefault(),L.button===0&&(L.target.setPointerCapture(L.pointerId),R.current=S.getBoundingClientRect(),T.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",$(L))}),onPointerMove:Ra(e.onPointerMove,$),onPointerUp:Ra(e.onPointerUp,L=>{const H=L.target;H.hasPointerCapture(L.pointerId)&&(L.preventDefault(),H.releasePointerCapture(L.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=T.current,R.current=null}})})}),iS=b.forwardRef((e,o)=>{const{sizes:r,onSizesChange:a,style:l,...c}=e,u=eo(),[f,h]=b.useState(),p=b.useRef(null),g=Mt(o,p,u.onScrollbarXChange);return b.useEffect(()=>{p.current&&h(getComputedStyle(p.current))},[p]),y.jsx(aS,{"data-orientation":"horizontal",...c,ref:g,sizes:r,style:{...l,"--sa-thumb-width":`${Uu(r)}px`},onThumbPointerDown:v=>e.onThumbPointerDown(v.x),onDragScroll:v=>e.onDragScroll(v.x),onWheelScroll:(v,x)=>{if(u.viewport){const S=u.viewport.scrollLeft+v.deltaX;e.onWheelScroll(S),oS(S,x)&&v.preventDefault()}},onResize:()=>{p.current&&u.viewport&&f&&a({content:u.viewport.scrollWidth,viewport:u.viewport.offsetWidth,scrollbar:{size:p.current.clientWidth,paddingStart:Vr(f.paddingLeft),paddingEnd:Vr(f.paddingRight)}})}})});iS.displayName="@mantine/core/ScrollAreaScrollbarX";const lS=b.forwardRef((e,o)=>{const{sizes:r,onSizesChange:a,style:l,...c}=e,u=eo(),[f,h]=b.useState(),p=b.useRef(null),g=Mt(o,p,u.onScrollbarYChange);return b.useEffect(()=>{p.current&&h(window.getComputedStyle(p.current))},[]),y.jsx(aS,{...c,"data-orientation":"vertical",ref:g,sizes:r,style:{"--sa-thumb-height":`${Uu(r)}px`,...l},onThumbPointerDown:v=>e.onThumbPointerDown(v.y),onDragScroll:v=>e.onDragScroll(v.y),onWheelScroll:(v,x)=>{if(u.viewport){const S=u.viewport.scrollTop+v.deltaY;e.onWheelScroll(S),oS(S,x)&&v.preventDefault()}},onResize:()=>{p.current&&u.viewport&&f&&a({content:u.viewport.scrollHeight,viewport:u.viewport.offsetHeight,scrollbar:{size:p.current.clientHeight,paddingStart:Vr(f.paddingTop),paddingEnd:Vr(f.paddingBottom)}})}})});lS.displayName="@mantine/core/ScrollAreaScrollbarY";const Pu=b.forwardRef((e,o)=>{const{orientation:r="vertical",...a}=e,{dir:l}=qi(),c=eo(),u=b.useRef(null),f=b.useRef(0),[h,p]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),g=tS(h.viewport,h.content),v={...a,sizes:h,onSizesChange:p,hasThumb:g>0&&g<1,onThumbChange:S=>{u.current=S},onThumbPointerUp:()=>{f.current=0},onThumbPointerDown:S=>{f.current=S}},x=(S,E)=>uN(S,f.current,h,E);return r==="horizontal"?y.jsx(iS,{...v,ref:o,onThumbPositionChange:()=>{if(c.viewport&&u.current){const S=c.viewport.scrollLeft,E=r1(S,h,l);u.current.style.transform=`translate3d(${E}px, 0, 0)`}},onWheelScroll:S=>{c.viewport&&(c.viewport.scrollLeft=S)},onDragScroll:S=>{c.viewport&&(c.viewport.scrollLeft=x(S,l))}}):r==="vertical"?y.jsx(lS,{...v,ref:o,onThumbPositionChange:()=>{if(c.viewport&&u.current){const S=c.viewport.scrollTop,E=r1(S,h);h.scrollbar.size===0?u.current.style.setProperty("--thumb-opacity","0"):u.current.style.setProperty("--thumb-opacity","1"),u.current.style.transform=`translate3d(0, ${E}px, 0)`}},onWheelScroll:S=>{c.viewport&&(c.viewport.scrollTop=S)},onDragScroll:S=>{c.viewport&&(c.viewport.scrollTop=x(S))}}):null});Pu.displayName="@mantine/core/ScrollAreaScrollbarVisible";const gm=b.forwardRef((e,o)=>{const r=eo(),{forceMount:a,...l}=e,[c,u]=b.useState(!1),f=e.orientation==="horizontal",h=Du(()=>{if(r.viewport){const p=r.viewport.offsetWidth{const{forceMount:r,...a}=e,l=eo(),[c,u]=b.useState(!1);return b.useEffect(()=>{const{scrollArea:f}=l;let h=0;if(f){const p=()=>{window.clearTimeout(h),u(!0)},g=()=>{h=window.setTimeout(()=>u(!1),l.scrollHideDelay)};return f.addEventListener("pointerenter",p),f.addEventListener("pointerleave",g),()=>{window.clearTimeout(h),f.removeEventListener("pointerenter",p),f.removeEventListener("pointerleave",g)}}},[l.scrollArea,l.scrollHideDelay]),r||c?y.jsx(gm,{"data-state":c?"visible":"hidden",...a,ref:o}):null});sS.displayName="@mantine/core/ScrollAreaScrollbarHover";const dN=b.forwardRef((e,o)=>{const{forceMount:r,...a}=e,l=eo(),c=e.orientation==="horizontal",[u,f]=b.useState("hidden"),h=Du(()=>f("idle"),100);return b.useEffect(()=>{if(u==="idle"){const p=window.setTimeout(()=>f("hidden"),l.scrollHideDelay);return()=>window.clearTimeout(p)}},[u,l.scrollHideDelay]),b.useEffect(()=>{const{viewport:p}=l,g=c?"scrollLeft":"scrollTop";if(p){let v=p[g];const x=()=>{const S=p[g];v!==S&&(f("scrolling"),h()),v=S};return p.addEventListener("scroll",x),()=>p.removeEventListener("scroll",x)}},[l.viewport,c,h]),r||u!=="hidden"?y.jsx(Pu,{"data-state":u==="hidden"?"hidden":"visible",...a,ref:o,onPointerEnter:Ra(e.onPointerEnter,()=>f("interacting")),onPointerLeave:Ra(e.onPointerLeave,()=>f("idle"))}):null}),Ep=b.forwardRef((e,o)=>{const{forceMount:r,...a}=e,l=eo(),{onScrollbarXEnabledChange:c,onScrollbarYEnabledChange:u}=l,f=e.orientation==="horizontal";return b.useEffect(()=>(f?c(!0):u(!0),()=>{f?c(!1):u(!1)}),[f,c,u]),l.type==="hover"?y.jsx(sS,{...a,ref:o,forceMount:r}):l.type==="scroll"?y.jsx(dN,{...a,ref:o,forceMount:r}):l.type==="auto"?y.jsx(gm,{...a,ref:o,forceMount:r}):l.type==="always"?y.jsx(Pu,{...a,ref:o}):null});Ep.displayName="@mantine/core/ScrollAreaScrollbar";function hN(e,o=()=>{}){let r={left:e.scrollLeft,top:e.scrollTop},a=0;return(function l(){const c={left:e.scrollLeft,top:e.scrollTop},u=r.left!==c.left,f=r.top!==c.top;(u||f)&&o(),r=c,a=window.requestAnimationFrame(l)})(),()=>window.cancelAnimationFrame(a)}const cS=b.forwardRef((e,o)=>{const{style:r,...a}=e,l=eo(),c=rS(),{onThumbPositionChange:u}=c,f=Mt(o,g=>c.onThumbChange(g)),h=b.useRef(void 0),p=Du(()=>{h.current&&(h.current(),h.current=void 0)},100);return b.useEffect(()=>{const{viewport:g}=l;if(g){const v=()=>{if(p(),!h.current){const x=hN(g,u);h.current=x,u()}};return u(),g.addEventListener("scroll",v),()=>g.removeEventListener("scroll",v)}},[l.viewport,p,u]),y.jsx("div",{"data-state":c.hasThumb?"visible":"hidden",...a,ref:f,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...r},onPointerDownCapture:Ra(e.onPointerDownCapture,g=>{const x=g.target.getBoundingClientRect(),S=g.clientX-x.left,E=g.clientY-x.top;c.onThumbPointerDown({x:S,y:E})}),onPointerUp:Ra(e.onPointerUp,c.onThumbPointerUp)})});cS.displayName="@mantine/core/ScrollAreaThumb";const Rp=b.forwardRef((e,o)=>{const{forceMount:r,...a}=e,l=rS();return r||l.hasThumb?y.jsx(cS,{ref:o,...a}):null});Rp.displayName="@mantine/core/ScrollAreaThumb";const uS=b.forwardRef(({children:e,style:o,...r},a)=>{const l=eo(),c=Mt(a,l.onViewportChange);return y.jsx(he,{...r,ref:c,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...o},children:y.jsx("div",{...l.getStyles("content"),ref:l.onContentChange,children:e})})});uS.displayName="@mantine/core/ScrollAreaViewport";var vm={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268",content:"m_b1336c6"};const fS={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},pN=(e,{scrollbarSize:o,overscrollBehavior:r})=>({root:{"--scrollarea-scrollbar-size":oe(o),"--scrollarea-over-scroll-behavior":r}}),Aa=ge((e,o)=>{const r=ce("ScrollArea",fS,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,scrollbarSize:h,vars:p,type:g,scrollHideDelay:v,viewportProps:x,viewportRef:S,onScrollPositionChange:E,children:C,offsetScrollbars:R,scrollbars:T,onBottomReached:z,onTopReached:A,overscrollBehavior:N,...B}=r,[M,$]=b.useState(!1),[L,H]=b.useState(!1),[I,Y]=b.useState(!1),X=_e({name:"ScrollArea",props:r,classes:vm,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:p,varsResolver:pN}),ee=b.useRef(null),ne=LD([S,ee]);return b.useEffect(()=>{if(!ee.current||R!=="present")return;const re=ee.current,j=new ResizeObserver(()=>{const{scrollHeight:k,clientHeight:V,scrollWidth:P,clientWidth:Z}=re;H(k>V),Y(P>Z)});return j.observe(re),()=>j.disconnect()},[ee,R]),y.jsxs(eS,{getStyles:X,type:g==="never"?"always":g,scrollHideDelay:v,ref:o,scrollbars:T,...X("root"),...B,children:[y.jsx(uS,{...x,...X("viewport",{style:x?.style}),ref:ne,"data-offset-scrollbars":R===!0?"xy":R||void 0,"data-scrollbars":T||void 0,"data-horizontal-hidden":R==="present"&&!I?"true":void 0,"data-vertical-hidden":R==="present"&&!L?"true":void 0,onScroll:re=>{x?.onScroll?.(re),E?.({x:re.currentTarget.scrollLeft,y:re.currentTarget.scrollTop});const{scrollTop:j,scrollHeight:k,clientHeight:V}=re.currentTarget;j-(k-V)>=-.6&&z?.(),j===0&&A?.()},children:C}),(T==="xy"||T==="x")&&y.jsx(Ep,{...X("scrollbar"),orientation:"horizontal","data-hidden":g==="never"||R==="present"&&!I?!0:void 0,forceMount:!0,onMouseEnter:()=>$(!0),onMouseLeave:()=>$(!1),children:y.jsx(Rp,{...X("thumb")})}),(T==="xy"||T==="y")&&y.jsx(Ep,{...X("scrollbar"),orientation:"vertical","data-hidden":g==="never"||R==="present"&&!L?!0:void 0,forceMount:!0,onMouseEnter:()=>$(!0),onMouseLeave:()=>$(!1),children:y.jsx(Rp,{...X("thumb")})}),y.jsx(lN,{...X("corner"),"data-hovered":M||void 0,"data-hidden":g==="never"||void 0})]})});Aa.displayName="@mantine/core/ScrollArea";const ym=ge((e,o)=>{const{children:r,classNames:a,styles:l,scrollbarSize:c,scrollHideDelay:u,type:f,dir:h,offsetScrollbars:p,viewportRef:g,onScrollPositionChange:v,unstyled:x,variant:S,viewportProps:E,scrollbars:C,style:R,vars:T,onBottomReached:z,onTopReached:A,...N}=ce("ScrollAreaAutosize",fS,e);return y.jsx(he,{...N,ref:o,style:[{display:"flex",overflow:"auto"},R],children:y.jsx(he,{style:{display:"flex",flexDirection:"column",flex:1},children:y.jsx(Aa,{classNames:a,styles:l,scrollHideDelay:u,scrollbarSize:c,type:f,dir:h,offsetScrollbars:p,viewportRef:g,onScrollPositionChange:v,unstyled:x,variant:S,viewportProps:E,vars:T,scrollbars:C,onBottomReached:z,onTopReached:A,children:r})})})});Aa.classes=vm;ym.displayName="@mantine/core/ScrollAreaAutosize";ym.classes=vm;Aa.Autosize=ym;var dS={root:"m_87cf2631"};const mN={__staticSelector:"UnstyledButton"},$n=un((e,o)=>{const r=ce("UnstyledButton",mN,e),{className:a,component:l="button",__staticSelector:c,unstyled:u,classNames:f,styles:h,style:p,...g}=r,v=_e({name:c,props:r,classes:dS,className:a,style:p,classNames:f,styles:h,unstyled:u});return y.jsx(he,{...v("root",{focusable:!0}),component:l,ref:o,type:l==="button"?"button":void 0,...g})});$n.classes=dS;$n.displayName="@mantine/core/UnstyledButton";var hS={root:"m_515a97f8"};const gN={},bm=ge((e,o)=>{const r=ce("VisuallyHidden",gN,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,...p}=r,g=_e({name:"VisuallyHidden",classes:hS,props:r,className:l,style:c,classNames:a,styles:u,unstyled:f});return y.jsx(he,{component:"span",ref:o,...g("root"),...p})});bm.classes=hS;bm.displayName="@mantine/core/VisuallyHidden";var pS={root:"m_1b7284a3"};const vN={},yN=(e,{radius:o,shadow:r})=>({root:{"--paper-radius":o===void 0?void 0:kt(o),"--paper-shadow":Fp(r)}}),Zi=un((e,o)=>{const r=ce("Paper",vN,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,withBorder:h,vars:p,radius:g,shadow:v,variant:x,mod:S,...E}=r,C=_e({name:"Paper",props:r,classes:pS,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:p,varsResolver:yN});return y.jsx(he,{ref:o,mod:[{"data-with-border":h},S],...C("root"),variant:x,...E})});Zi.classes=pS;Zi.displayName="@mantine/core/Paper";function mS(e,o){if(e==="rtl"&&(o.includes("right")||o.includes("left"))){const[r,a]=o.split("-"),l=r==="right"?"left":"right";return a===void 0?l:`${l}-${a}`}return o}function a1(e,o,r,a){return e==="center"||a==="center"?{top:o}:e==="end"?{bottom:r}:e==="start"?{top:r}:{}}function i1(e,o,r,a,l){return e==="center"||a==="center"?{left:o}:e==="end"?{[l==="ltr"?"right":"left"]:r}:e==="start"?{[l==="ltr"?"left":"right"]:r}:{}}const bN={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function xN({position:e,arrowSize:o,arrowOffset:r,arrowRadius:a,arrowPosition:l,arrowX:c,arrowY:u,dir:f}){const[h,p="center"]=e.split("-"),g={width:o,height:o,transform:"rotate(45deg)",position:"absolute",[bN[h]]:a},v=-o/2;return h==="left"?{...g,...a1(p,u,r,l),right:v,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:h==="right"?{...g,...a1(p,u,r,l),left:v,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:h==="top"?{...g,...i1(p,c,r,l,f),bottom:v,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:h==="bottom"?{...g,...i1(p,c,r,l,f),top:v,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}const xm=b.forwardRef(({position:e,arrowSize:o,arrowOffset:r,arrowRadius:a,arrowPosition:l,visible:c,arrowX:u,arrowY:f,style:h,...p},g)=>{const{dir:v}=qi();return c?y.jsx("div",{...p,ref:g,style:{...h,...xN({position:e,arrowSize:o,arrowOffset:r,arrowRadius:a,arrowPosition:l,dir:v,arrowX:u,arrowY:f})}}):null});xm.displayName="@mantine/core/FloatingArrow";var gS={root:"m_9814e45f"};const SN={zIndex:vo("modal")},wN=(e,{gradient:o,color:r,backgroundOpacity:a,blur:l,radius:c,zIndex:u})=>({root:{"--overlay-bg":o||(r!==void 0||a!==void 0)&&Co(r||"#000",a??.6)||void 0,"--overlay-filter":l?`blur(${oe(l)})`:void 0,"--overlay-radius":c===void 0?void 0:kt(c),"--overlay-z-index":u?.toString()}}),Vu=un((e,o)=>{const r=ce("Overlay",SN,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,fixed:p,center:g,children:v,radius:x,zIndex:S,gradient:E,blur:C,color:R,backgroundOpacity:T,mod:z,...A}=r,N=_e({name:"Overlay",props:r,classes:gS,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:wN});return y.jsx(he,{ref:o,...N("root"),mod:[{center:g,fixed:p},z],...A,children:v})});Vu.classes=gS;Vu.displayName="@mantine/core/Overlay";function qh(e){const o=document.createElement("div");return o.setAttribute("data-portal","true"),typeof e.className=="string"&&o.classList.add(...e.className.split(" ").filter(Boolean)),typeof e.style=="object"&&Object.assign(o.style,e.style),typeof e.id=="string"&&o.setAttribute("id",e.id),o}function CN({target:e,reuseTargetNode:o,...r}){if(e)return typeof e=="string"?document.querySelector(e)||qh(r):e;if(o){const a=document.querySelector("[data-mantine-shared-portal-node]");if(a)return a;const l=qh(r);return l.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(l),l}return qh(r)}const EN={reuseTargetNode:!0},vS=ge((e,o)=>{const{children:r,target:a,reuseTargetNode:l,...c}=ce("Portal",EN,e),[u,f]=b.useState(!1),h=b.useRef(null);return Yi(()=>(f(!0),h.current=CN({target:a,reuseTargetNode:l,...c}),mu(o,h.current),!a&&!l&&h.current&&document.body.appendChild(h.current),()=>{!a&&!l&&h.current&&document.body.removeChild(h.current)}),[a]),!u||!h.current?null:co.createPortal(y.jsx(y.Fragment,{children:r}),h.current)});vS.displayName="@mantine/core/Portal";const za=ge(({withinPortal:e=!0,children:o,...r},a)=>Wp()==="test"||!e?y.jsx(y.Fragment,{children:o}):y.jsx(vS,{ref:a,...r,children:o}));za.displayName="@mantine/core/OptionalPortal";const ns=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${e==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),Qc={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(30px)"},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-30px)"},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(30px)"},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-30px)"},transitionProperty:"opacity, transform"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(-20px) skew(-10deg, -5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(20px) skew(-10deg, -5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(-5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:{...ns("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...ns("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...ns("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...ns("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...ns("top"),common:{transformOrigin:"top right"}}},l1={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function RN({transition:e,state:o,duration:r,timingFunction:a}){const l={WebkitBackfaceVisibility:"hidden",willChange:"transform, opacity",transitionDuration:`${r}ms`,transitionTimingFunction:a};return typeof e=="string"?e in Qc?{transitionProperty:Qc[e].transitionProperty,...l,...Qc[e].common,...Qc[e][l1[o]]}:{}:{transitionProperty:e.transitionProperty,...l,...e.common,...e[l1[o]]}}function TN({duration:e,exitDuration:o,timingFunction:r,mounted:a,onEnter:l,onExit:c,onEntered:u,onExited:f,enterDelay:h,exitDelay:p}){const g=cn(),v=Nu(),x=g.respectReducedMotion?v:!1,[S,E]=b.useState(x?0:e),[C,R]=b.useState(a?"entered":"exited"),T=b.useRef(-1),z=b.useRef(-1),A=b.useRef(-1);function N(){window.clearTimeout(T.current),window.clearTimeout(z.current),cancelAnimationFrame(A.current)}const B=$=>{N();const L=$?l:c,H=$?u:f,I=x?0:$?e:o;E(I),I===0?(typeof L=="function"&&L(),typeof H=="function"&&H(),R($?"entered":"exited")):A.current=requestAnimationFrame(()=>{Sa.flushSync(()=>{R($?"pre-entering":"pre-exiting")}),A.current=requestAnimationFrame(()=>{typeof L=="function"&&L(),R($?"entering":"exiting"),T.current=window.setTimeout(()=>{typeof H=="function"&&H(),R($?"entered":"exited")},I)})})},M=$=>{if(N(),typeof($?h:p)!="number"){B($);return}z.current=window.setTimeout(()=>{B($)},$?h:p)};return rr(()=>{M(a)},[a]),b.useEffect(()=>()=>{N()},[]),{transitionDuration:S,transitionStatus:C,transitionTimingFunction:r||"ease"}}function qr({keepMounted:e,transition:o="fade",duration:r=250,exitDuration:a=r,mounted:l,children:c,timingFunction:u="ease",onExit:f,onEntered:h,onEnter:p,onExited:g,enterDelay:v,exitDelay:x}){const S=Wp(),{transitionDuration:E,transitionStatus:C,transitionTimingFunction:R}=TN({mounted:l,exitDuration:a,duration:r,timingFunction:u,onExit:f,onEntered:h,onEnter:p,onExited:g,enterDelay:v,exitDelay:x});return E===0||S==="test"?l?y.jsx(y.Fragment,{children:c({})}):e?c({display:"none"}):null:C==="exited"?e?c({display:"none"}):null:y.jsx(y.Fragment,{children:c(RN({transition:o,duration:E,state:C,timingFunction:R}))})}qr.displayName="@mantine/core/Transition";const[_N,yS]=zo("Popover component was not found in the tree");function Yu({children:e,active:o=!0,refProp:r="ref",innerRef:a}){const l=WR(o),c=Mt(l,a);return ar(e)?b.cloneElement(e,{[r]:c}):e}function bS(e){return y.jsx(bm,{tabIndex:-1,"data-autofocus":!0,...e})}Yu.displayName="@mantine/core/FocusTrap";bS.displayName="@mantine/core/FocusTrapInitialFocus";Yu.InitialFocus=bS;var xS={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};const DN={},Sm=ge((e,o)=>{const r=ce("PopoverDropdown",DN,e),{className:a,style:l,vars:c,children:u,onKeyDownCapture:f,variant:h,classNames:p,styles:g,...v}=r,x=yS(),S=yx({opened:x.opened,shouldReturnFocus:x.returnFocus}),E=x.withRoles?{"aria-labelledby":x.getTargetId(),id:x.getDropdownId(),role:"dialog",tabIndex:-1}:{},C=Mt(o,x.floating);return x.disabled?null:y.jsx(za,{...x.portalProps,withinPortal:x.withinPortal,children:y.jsx(qr,{mounted:x.opened,...x.transitionProps,transition:x.transitionProps?.transition||"fade",duration:x.transitionProps?.duration??150,keepMounted:x.keepMounted,exitDuration:typeof x.transitionProps?.exitDuration=="number"?x.transitionProps.exitDuration:x.transitionProps?.duration,children:R=>y.jsx(Yu,{active:x.trapFocus&&x.opened,innerRef:C,children:y.jsxs(he,{...E,...v,variant:h,onKeyDownCapture:UR(()=>{x.onClose?.(),x.onDismiss?.()},{active:x.closeOnEscape,onTrigger:S,onKeyDown:f}),"data-position":x.placement,"data-fixed":x.floatingStrategy==="fixed"||void 0,...x.getStyles("dropdown",{className:a,props:r,classNames:p,styles:g,style:[{...R,zIndex:x.zIndex,top:x.y??0,left:x.x??0,width:x.width==="target"?void 0:oe(x.width),...x.referenceHidden?{display:"none"}:null},x.resolvedStyles.dropdown,g?.dropdown,l]}),children:[u,y.jsx(xm,{ref:x.arrowRef,arrowX:x.arrowX,arrowY:x.arrowY,visible:x.withArrow,position:x.placement,arrowSize:x.arrowSize,arrowRadius:x.arrowRadius,arrowOffset:x.arrowOffset,arrowPosition:x.arrowPosition,...x.getStyles("arrow",{props:r,classNames:p,styles:g})})]})})})})});Sm.classes=xS;Sm.displayName="@mantine/core/PopoverDropdown";const NN={refProp:"ref",popupType:"dialog"},SS=ge((e,o)=>{const{children:r,refProp:a,popupType:l,...c}=ce("PopoverTarget",NN,e);if(!ar(r))throw new Error("Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const u=c,f=yS(),h=Mt(f.reference,Au(r),o),p=f.withRoles?{"aria-haspopup":l,"aria-expanded":f.opened,"aria-controls":f.getDropdownId(),id:f.getTargetId()}:{};return b.cloneElement(r,{...u,...p,...f.targetProps,className:zt(f.targetProps.className,u.className,r.props.className),[a]:h,...f.controlled?null:{onClick:f.onToggle}})});SS.displayName="@mantine/core/PopoverTarget";function wS({opened:e,floating:o,position:r,positionDependencies:a}){const[l,c]=b.useState(0);b.useEffect(()=>{if(o.refs.reference.current&&o.refs.floating.current&&e)return wD(o.refs.reference.current,o.refs.floating.current,o.update)},[o.refs.reference.current,o.refs.floating.current,e,l,r]),rr(()=>{o.update()},a),rr(()=>{c(u=>u+1)},[e])}function AN(e){if(e===void 0)return{shift:!0,flip:!0};const o={...e};return e.shift===void 0&&(o.shift=!0),e.flip===void 0&&(o.flip=!0),o}function zN(e,o){const r=AN(e.middlewares),a=[Zx(e.offset),$D()];return r.shift&&a.push(fm(typeof r.shift=="boolean"?{limiter:K0(),padding:5}:{limiter:K0(),padding:5,...r.shift})),r.flip&&a.push(typeof r.flip=="boolean"?xu():xu(r.flip)),r.inline&&a.push(typeof r.inline=="boolean"?as():as(r.inline)),a.push(Qx({element:e.arrowRef,padding:e.arrowOffset})),(r.size||e.width==="target")&&a.push(BD({...typeof r.size=="boolean"?{}:r.size,apply({rects:l,availableWidth:c,availableHeight:u,...f}){const p=o().refs.floating.current?.style??{};r.size&&(typeof r.size=="object"&&r.size.apply?r.size.apply({rects:l,availableWidth:c,availableHeight:u,...f}):Object.assign(p,{maxWidth:`${c}px`,maxHeight:`${u}px`})),e.width==="target"&&Object.assign(p,{width:`${l.reference.width}px`})}})),a}function MN(e){const[o,r]=Wn({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),a=b.useRef(o),l=()=>{o&&!e.disabled&&r(!1)},c=()=>!e.disabled&&r(!o),u=mm({strategy:e.strategy,placement:e.position,middleware:zN(e,()=>u)});return wS({opened:o,position:e.position,positionDependencies:e.positionDependencies||[],floating:u}),rr(()=>{e.onPositionChange?.(u.placement)},[u.placement]),rr(()=>{o!==a.current&&(o?e.onOpen?.():e.onClose?.()),a.current=o},[o,e.onClose,e.onOpen]),{floating:u,controlled:typeof e.opened=="boolean",opened:o,onClose:l,onToggle:c}}const ON={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,hideDetached:!0,clickOutsideEvents:["mousedown","touchstart"],zIndex:vo("popover"),__staticSelector:"Popover",width:"max-content"},jN=(e,{radius:o,shadow:r})=>({dropdown:{"--popover-radius":o===void 0?void 0:kt(o),"--popover-shadow":Fp(r)}});function Rn(e){const o=ce("Popover",ON,e),{children:r,position:a,offset:l,onPositionChange:c,positionDependencies:u,opened:f,transitionProps:h,onExitTransitionEnd:p,onEnterTransitionEnd:g,width:v,middlewares:x,withArrow:S,arrowSize:E,arrowOffset:C,arrowRadius:R,arrowPosition:T,unstyled:z,classNames:A,styles:N,closeOnClickOutside:B,withinPortal:M,portalProps:$,closeOnEscape:L,clickOutsideEvents:H,trapFocus:I,onClose:Y,onDismiss:X,onOpen:ee,onChange:ne,zIndex:re,radius:j,shadow:k,id:V,defaultOpened:P,__staticSelector:Z,withRoles:D,disabled:O,returnFocus:q,variant:W,keepMounted:ie,vars:ue,floatingStrategy:ve,withOverlay:fe,overlayProps:be,hideDetached:ye,...Xe}=o,Ne=_e({name:Z,props:o,classes:xS,classNames:A,styles:N,unstyled:z,rootSelector:"dropdown",vars:ue,varsResolver:jN}),{resolvedStyles:We}=Gi({classNames:A,styles:N,props:o}),Be=b.useRef(null),[nt,vt]=b.useState(null),[pe,me]=b.useState(null),{dir:we}=qi(),De=Wp(),Ae=Jn(V),xe=MN({middlewares:x,width:v,position:mS(we,a),offset:typeof l=="number"?l+(S?E/2:0):l,arrowRef:Be,arrowOffset:C,onPositionChange:c,positionDependencies:u,opened:f,defaultOpened:P,onChange:ne,onOpen:ee,onClose:Y,onDismiss:X,strategy:ve,disabled:O});GR(()=>{B&&(xe.onClose(),X?.())},H,[nt,pe]);const $e=b.useCallback(ot=>{vt(ot),xe.floating.refs.setReference(ot)},[xe.floating.refs.setReference]),de=b.useCallback(ot=>{me(ot),xe.floating.refs.setFloating(ot)},[xe.floating.refs.setFloating]),Re=b.useCallback(()=>{h?.onExited?.(),p?.()},[h?.onExited,p]),dt=b.useCallback(()=>{h?.onEntered?.(),g?.()},[h?.onEntered,g]);return y.jsxs(_N,{value:{returnFocus:q,disabled:O,controlled:xe.controlled,reference:$e,floating:de,x:xe.floating.x,y:xe.floating.y,arrowX:xe.floating?.middlewareData?.arrow?.x,arrowY:xe.floating?.middlewareData?.arrow?.y,opened:xe.opened,arrowRef:Be,transitionProps:{...h,onExited:Re,onEntered:dt},width:v,withArrow:S,arrowSize:E,arrowOffset:C,arrowRadius:R,arrowPosition:T,placement:xe.floating.placement,trapFocus:I,withinPortal:M,portalProps:$,zIndex:re,radius:j,shadow:k,closeOnEscape:L,onDismiss:X,onClose:xe.onClose,onToggle:xe.onToggle,getTargetId:()=>`${Ae}-target`,getDropdownId:()=>`${Ae}-dropdown`,withRoles:D,targetProps:Xe,__staticSelector:Z,classNames:A,styles:N,unstyled:z,variant:W,keepMounted:ie,getStyles:Ne,resolvedStyles:We,floatingStrategy:ve,referenceHidden:ye&&De!=="test"?xe.floating.middlewareData.hide?.referenceHidden:!1},children:[r,fe&&y.jsx(qr,{transition:"fade",mounted:xe.opened,duration:h?.duration||250,exitDuration:h?.exitDuration||250,children:ot=>y.jsx(za,{withinPortal:M,children:y.jsx(Vu,{...be,...Ne("overlay",{className:be?.className,style:[ot,be?.style]})})})})]})}Rn.Target=SS;Rn.Dropdown=Sm;Rn.displayName="@mantine/core/Popover";Rn.extend=e=>e;var fo={root:"m_5ae2e3c",barsLoader:"m_7a2bd4cd",bar:"m_870bb79","bars-loader-animation":"m_5d2b3b9d",dotsLoader:"m_4e3f22d7",dot:"m_870c4af","loader-dots-animation":"m_aac34a1",ovalLoader:"m_b34414df","oval-loader-animation":"m_f8e89c4b"};const CS=b.forwardRef(({className:e,...o},r)=>y.jsxs(he,{component:"span",className:zt(fo.barsLoader,e),...o,ref:r,children:[y.jsx("span",{className:fo.bar}),y.jsx("span",{className:fo.bar}),y.jsx("span",{className:fo.bar})]}));CS.displayName="@mantine/core/Bars";const ES=b.forwardRef(({className:e,...o},r)=>y.jsxs(he,{component:"span",className:zt(fo.dotsLoader,e),...o,ref:r,children:[y.jsx("span",{className:fo.dot}),y.jsx("span",{className:fo.dot}),y.jsx("span",{className:fo.dot})]}));ES.displayName="@mantine/core/Dots";const RS=b.forwardRef(({className:e,...o},r)=>y.jsx(he,{component:"span",className:zt(fo.ovalLoader,e),...o,ref:r}));RS.displayName="@mantine/core/Oval";const TS={bars:CS,oval:RS,dots:ES},BN={loaders:TS,type:"oval"},$N=(e,{size:o,color:r})=>({root:{"--loader-size":qe(o,"loader-size"),"--loader-color":r?Zt(r,e):void 0}}),Ma=ge((e,o)=>{const r=ce("Loader",BN,e),{size:a,color:l,type:c,vars:u,className:f,style:h,classNames:p,styles:g,unstyled:v,loaders:x,variant:S,children:E,...C}=r,R=_e({name:"Loader",props:r,classes:fo,className:f,style:h,classNames:p,styles:g,unstyled:v,vars:u,varsResolver:$N});return E?y.jsx(he,{...R("root"),ref:o,...C,children:E}):y.jsx(he,{...R("root"),ref:o,component:x[c],variant:S,size:a,...C})});Ma.defaultLoaders=TS;Ma.classes=fo;Ma.displayName="@mantine/core/Loader";var Qi={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const s1={orientation:"horizontal"},LN=(e,{borderWidth:o})=>({group:{"--ai-border-width":oe(o)}}),wm=ge((e,o)=>{const r=ce("ActionIconGroup",s1,e),{className:a,style:l,classNames:c,styles:u,unstyled:f,orientation:h,vars:p,borderWidth:g,variant:v,mod:x,...S}=ce("ActionIconGroup",s1,e),E=_e({name:"ActionIconGroup",props:r,classes:Qi,className:a,style:l,classNames:c,styles:u,unstyled:f,vars:p,varsResolver:LN,rootSelector:"group"});return y.jsx(he,{...E("group"),ref:o,variant:v,mod:[{"data-orientation":h},x],role:"group",...S})});wm.classes=Qi;wm.displayName="@mantine/core/ActionIconGroup";const c1={},kN=(e,{radius:o,color:r,gradient:a,variant:l,autoContrast:c,size:u})=>{const f=e.variantColorResolver({color:r||e.primaryColor,theme:e,gradient:a,variant:l||"filled",autoContrast:c});return{groupSection:{"--section-height":qe(u,"section-height"),"--section-padding-x":qe(u,"section-padding-x"),"--section-fz":nn(u),"--section-radius":o===void 0?void 0:kt(o),"--section-bg":r||l?f.background:void 0,"--section-color":f.color,"--section-bd":r||l?f.border:void 0}}},Cm=ge((e,o)=>{const r=ce("ActionIconGroupSection",c1,e),{className:a,style:l,classNames:c,styles:u,unstyled:f,vars:h,variant:p,gradient:g,radius:v,autoContrast:x,...S}=ce("ActionIconGroupSection",c1,e),E=_e({name:"ActionIconGroupSection",props:r,classes:Qi,className:a,style:l,classNames:c,styles:u,unstyled:f,vars:h,varsResolver:kN,rootSelector:"groupSection"});return y.jsx(he,{...E("groupSection"),ref:o,variant:p,...S})});Cm.classes=Qi;Cm.displayName="@mantine/core/ActionIconGroupSection";const HN={},UN=(e,{size:o,radius:r,variant:a,gradient:l,color:c,autoContrast:u})=>{const f=e.variantColorResolver({color:c||e.primaryColor,theme:e,gradient:l,variant:a||"filled",autoContrast:u});return{root:{"--ai-size":qe(o,"ai-size"),"--ai-radius":r===void 0?void 0:kt(r),"--ai-bg":c||a?f.background:void 0,"--ai-hover":c||a?f.hover:void 0,"--ai-hover-color":c||a?f.hoverColor:void 0,"--ai-color":f.color,"--ai-bd":c||a?f.border:void 0}}},Yt=un((e,o)=>{const r=ce("ActionIcon",HN,e),{className:a,unstyled:l,variant:c,classNames:u,styles:f,style:h,loading:p,loaderProps:g,size:v,color:x,radius:S,__staticSelector:E,gradient:C,vars:R,children:T,disabled:z,"data-disabled":A,autoContrast:N,mod:B,...M}=r,$=_e({name:["ActionIcon",E],props:r,className:a,style:h,classes:Qi,classNames:u,styles:f,unstyled:l,vars:R,varsResolver:UN});return y.jsxs($n,{...$("root",{active:!z&&!p&&!A}),...M,unstyled:l,variant:c,size:v,disabled:z||p,ref:o,mod:[{loading:p,disabled:z||A},B],children:[y.jsx(qr,{mounted:!!p,transition:"slide-down",duration:150,children:L=>y.jsx(he,{component:"span",...$("loader",{style:L}),"aria-hidden":!0,children:y.jsx(Ma,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...g})})}),y.jsx(he,{component:"span",mod:{loading:p},...$("icon"),children:T})]})});Yt.classes=Qi;Yt.displayName="@mantine/core/ActionIcon";Yt.Group=wm;Yt.GroupSection=Cm;const _S=b.forwardRef(({size:e="var(--cb-icon-size, 70%)",style:o,...r},a)=>y.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...o,width:e,height:e},ref:a,...r,children:y.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}));_S.displayName="@mantine/core/CloseIcon";var DS={root:"m_86a44da5","root--subtle":"m_220c80f2"};const PN={variant:"subtle"},VN=(e,{size:o,radius:r,iconSize:a})=>({root:{"--cb-size":qe(o,"cb-size"),"--cb-radius":r===void 0?void 0:kt(r),"--cb-icon-size":oe(a)}}),Ki=un((e,o)=>{const r=ce("CloseButton",PN,e),{iconSize:a,children:l,vars:c,radius:u,className:f,classNames:h,style:p,styles:g,unstyled:v,"data-disabled":x,disabled:S,variant:E,icon:C,mod:R,__staticSelector:T,...z}=r,A=_e({name:T||"CloseButton",props:r,className:f,style:p,classes:DS,classNames:h,styles:g,unstyled:v,vars:c,varsResolver:VN});return y.jsxs($n,{ref:o,...z,unstyled:v,variant:E,disabled:S,mod:[{disabled:S||x},R],...A("root",{variant:E,active:!S&&!x}),children:[C||y.jsx(_S,{}),l]})});Ki.classes=DS;Ki.displayName="@mantine/core/CloseButton";function YN(e){return b.Children.toArray(e).filter(Boolean)}var NS={root:"m_4081bf90"};const GN={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},XN=(e,{grow:o,preventGrowOverflow:r,gap:a,align:l,justify:c,wrap:u},{childWidth:f})=>({root:{"--group-child-width":o&&r?f:void 0,"--group-gap":sn(a),"--group-align":l,"--group-justify":c,"--group-wrap":u}}),mt=ge((e,o)=>{const r=ce("Group",GN,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,children:h,gap:p,align:g,justify:v,wrap:x,grow:S,preventGrowOverflow:E,vars:C,variant:R,__size:T,mod:z,...A}=r,N=YN(h),B=N.length,M=sn(p??"md"),L={childWidth:`calc(${100/B}% - (${M} - ${M} / ${B}))`},H=_e({name:"Group",props:r,stylesCtx:L,className:l,style:c,classes:NS,classNames:a,styles:u,unstyled:f,vars:C,varsResolver:XN});return y.jsx(he,{...H("root"),ref:o,variant:R,mod:[{grow:S},z],size:T,...A,children:N})});mt.classes=NS;mt.displayName="@mantine/core/Group";const[qN,cr]=zo("ModalBase component was not found in tree");function IN({opened:e,transitionDuration:o}){const[r,a]=b.useState(e),l=b.useRef(-1),u=Nu()?0:o;return b.useEffect(()=>(e?(a(!0),window.clearTimeout(l.current)):u===0?a(!1):l.current=window.setTimeout(()=>a(!1),u),()=>window.clearTimeout(l.current)),[e,u]),r}function FN({id:e,transitionProps:o,opened:r,trapFocus:a,closeOnEscape:l,onClose:c,returnFocus:u}){const f=Jn(e),[h,p]=b.useState(!1),[g,v]=b.useState(!1),x=typeof o?.duration=="number"?o?.duration:200,S=IN({opened:r,transitionDuration:x});return wx("keydown",E=>{E.key==="Escape"&&l&&!E.isComposing&&r&&E.target?.getAttribute("data-mantine-stop-propagation")!=="true"&&c()},{capture:!0}),yx({opened:r,shouldReturnFocus:a&&u}),{_id:f,titleMounted:h,bodyMounted:g,shouldLockScroll:S,setTitleMounted:p,setBodyMounted:v}}const AS=b.forwardRef(({keepMounted:e,opened:o,onClose:r,id:a,transitionProps:l,onExitTransitionEnd:c,onEnterTransitionEnd:u,trapFocus:f,closeOnEscape:h,returnFocus:p,closeOnClickOutside:g,withinPortal:v,portalProps:x,lockScroll:S,children:E,zIndex:C,shadow:R,padding:T,__vars:z,unstyled:A,removeScrollProps:N,...B},M)=>{const{_id:$,titleMounted:L,bodyMounted:H,shouldLockScroll:I,setTitleMounted:Y,setBodyMounted:X}=FN({id:a,transitionProps:l,opened:o,trapFocus:f,closeOnEscape:h,onClose:r,returnFocus:p}),{key:ee,...ne}=N||{};return y.jsx(za,{...x,withinPortal:v,children:y.jsx(qN,{value:{opened:o,onClose:r,closeOnClickOutside:g,onExitTransitionEnd:c,onEnterTransitionEnd:u,transitionProps:{...l,keepMounted:e},getTitleId:()=>`${$}-title`,getBodyId:()=>`${$}-body`,titleMounted:L,bodyMounted:H,setTitleMounted:Y,setBodyMounted:X,trapFocus:f,closeOnEscape:h,zIndex:C,unstyled:A},children:y.jsx(ki,{enabled:I&&S,...ne,children:y.jsx(he,{ref:M,...B,__vars:{...z,"--mb-z-index":(C||vo("modal")).toString(),"--mb-shadow":Fp(R),"--mb-padding":sn(T)},children:E})},ee)})})});AS.displayName="@mantine/core/ModalBase";function ZN(){const e=cr();return b.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var Ui={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const zS=b.forwardRef(({className:e,...o},r)=>{const a=ZN(),l=cr();return y.jsx(he,{ref:r,...o,id:a,className:zt({[Ui.body]:!l.unstyled},e)})});zS.displayName="@mantine/core/ModalBaseBody";const MS=b.forwardRef(({className:e,onClick:o,...r},a)=>{const l=cr();return y.jsx(Ki,{ref:a,...r,onClick:c=>{l.onClose(),o?.(c)},className:zt({[Ui.close]:!l.unstyled},e),unstyled:l.unstyled})});MS.displayName="@mantine/core/ModalBaseCloseButton";const OS=b.forwardRef(({transitionProps:e,className:o,innerProps:r,onKeyDown:a,style:l,...c},u)=>{const f=cr();return y.jsx(qr,{mounted:f.opened,transition:"pop",...f.transitionProps,onExited:()=>{f.onExitTransitionEnd?.(),f.transitionProps?.onExited?.()},onEntered:()=>{f.onEnterTransitionEnd?.(),f.transitionProps?.onEntered?.()},...e,children:h=>y.jsx("div",{...r,className:zt({[Ui.inner]:!f.unstyled},r.className),children:y.jsx(Yu,{active:f.opened&&f.trapFocus,innerRef:u,children:y.jsx(Zi,{...c,component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":f.bodyMounted?f.getBodyId():void 0,"aria-labelledby":f.titleMounted?f.getTitleId():void 0,style:[l,h],className:zt({[Ui.content]:!f.unstyled},o),unstyled:f.unstyled,children:c.children})})})})});OS.displayName="@mantine/core/ModalBaseContent";const jS=b.forwardRef(({className:e,...o},r)=>{const a=cr();return y.jsx(he,{component:"header",ref:r,className:zt({[Ui.header]:!a.unstyled},e),...o})});jS.displayName="@mantine/core/ModalBaseHeader";const QN={duration:200,timingFunction:"ease",transition:"fade"};function KN(e){const o=cr();return{...QN,...o.transitionProps,...e}}const BS=b.forwardRef(({onClick:e,transitionProps:o,style:r,visible:a,...l},c)=>{const u=cr(),f=KN(o);return y.jsx(qr,{mounted:a!==void 0?a:u.opened,...f,transition:"fade",children:h=>y.jsx(Vu,{ref:c,fixed:!0,style:[r,h],zIndex:u.zIndex,unstyled:u.unstyled,onClick:p=>{e?.(p),u.closeOnClickOutside&&u.onClose()},...l})})});BS.displayName="@mantine/core/ModalBaseOverlay";function WN(){const e=cr();return b.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const $S=b.forwardRef(({className:e,...o},r)=>{const a=WN(),l=cr();return y.jsx(he,{component:"h2",ref:r,className:zt({[Ui.title]:!l.unstyled},e),...o,id:a})});$S.displayName="@mantine/core/ModalBaseTitle";function JN({children:e}){return y.jsx(y.Fragment,{children:e})}const[e3,t3]=Ss({size:"sm"}),n3={},LS=ge((e,o)=>{const r=ce("InputClearButton",n3,e),{size:a,variant:l,vars:c,classNames:u,styles:f,...h}=r,p=t3(),{resolvedClassNames:g,resolvedStyles:v}=Gi({classNames:u,styles:f,props:r});return y.jsx(Ki,{variant:l||"transparent",ref:o,size:a||p?.size||"sm",classNames:g,styles:v,__staticSelector:"InputClearButton",...h})});LS.displayName="@mantine/core/InputClearButton";const[o3,ws]=Ss({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var to={wrapper:"m_6c018570",input:"m_8fb7ebe7",section:"m_82577fc2",placeholder:"m_88bacfd0",root:"m_46b77525",label:"m_8fdc1311",required:"m_78a94662",error:"m_8f816625",description:"m_fe47ce59"};const u1={},r3=(e,{size:o})=>({description:{"--input-description-size":o===void 0?void 0:`calc(${nn(o)} - ${oe(2)})`}}),Gu=ge((e,o)=>{const r=ce("InputDescription",u1,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,size:p,__staticSelector:g,__inheritStyles:v=!0,variant:x,...S}=ce("InputDescription",u1,r),E=ws(),C=_e({name:["InputWrapper",g],props:r,classes:to,className:l,style:c,classNames:a,styles:u,unstyled:f,rootSelector:"description",vars:h,varsResolver:r3}),R=v&&E?.getStyles||C;return y.jsx(he,{component:"p",ref:o,variant:x,size:p,...R("description",E?.getStyles?{className:l,style:c}:void 0),...S})});Gu.classes=to;Gu.displayName="@mantine/core/InputDescription";const a3={},i3=(e,{size:o})=>({error:{"--input-error-size":o===void 0?void 0:`calc(${nn(o)} - ${oe(2)})`}}),Xu=ge((e,o)=>{const r=ce("InputError",a3,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,size:p,__staticSelector:g,__inheritStyles:v=!0,variant:x,...S}=r,E=_e({name:["InputWrapper",g],props:r,classes:to,className:l,style:c,classNames:a,styles:u,unstyled:f,rootSelector:"error",vars:h,varsResolver:i3}),C=ws(),R=v&&C?.getStyles||E;return y.jsx(he,{component:"p",ref:o,variant:x,size:p,...R("error",C?.getStyles?{className:l,style:c}:void 0),...S})});Xu.classes=to;Xu.displayName="@mantine/core/InputError";const f1={labelElement:"label"},l3=(e,{size:o})=>({label:{"--input-label-size":nn(o),"--input-asterisk-color":void 0}}),qu=ge((e,o)=>{const r=ce("InputLabel",f1,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,labelElement:p,size:g,required:v,htmlFor:x,onMouseDown:S,children:E,__staticSelector:C,variant:R,mod:T,...z}=ce("InputLabel",f1,r),A=_e({name:["InputWrapper",C],props:r,classes:to,className:l,style:c,classNames:a,styles:u,unstyled:f,rootSelector:"label",vars:h,varsResolver:l3}),N=ws(),B=N?.getStyles||A;return y.jsxs(he,{...B("label",N?.getStyles?{className:l,style:c}:void 0),component:p,variant:R,size:g,ref:o,htmlFor:p==="label"?x:void 0,mod:[{required:v},T],onMouseDown:M=>{S?.(M),!M.defaultPrevented&&M.detail>1&&M.preventDefault()},...z,children:[E,v&&y.jsx("span",{...B("required"),"aria-hidden":!0,children:" *"})]})});qu.classes=to;qu.displayName="@mantine/core/InputLabel";const d1={},Em=ge((e,o)=>{const r=ce("InputPlaceholder",d1,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,__staticSelector:p,variant:g,error:v,mod:x,...S}=ce("InputPlaceholder",d1,r),E=_e({name:["InputPlaceholder",p],props:r,classes:to,className:l,style:c,classNames:a,styles:u,unstyled:f,rootSelector:"placeholder"});return y.jsx(he,{...E("placeholder"),mod:[{error:!!v},x],component:"span",variant:g,ref:o,...S})});Em.classes=to;Em.displayName="@mantine/core/InputPlaceholder";function s3(e,{hasDescription:o,hasError:r}){const a=e.findIndex(h=>h==="input"),l=e.slice(0,a),c=e.slice(a+1),u=o&&l.includes("description")||r&&l.includes("error");return{offsetBottom:o&&c.includes("description")||r&&c.includes("error"),offsetTop:u}}const c3={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},u3=(e,{size:o})=>({label:{"--input-label-size":nn(o),"--input-asterisk-color":void 0},error:{"--input-error-size":o===void 0?void 0:`calc(${nn(o)} - ${oe(2)})`},description:{"--input-description-size":o===void 0?void 0:`calc(${nn(o)} - ${oe(2)})`}}),Rm=ge((e,o)=>{const r=ce("InputWrapper",c3,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,size:p,variant:g,__staticSelector:v,inputContainer:x,inputWrapperOrder:S,label:E,error:C,description:R,labelProps:T,descriptionProps:z,errorProps:A,labelElement:N,children:B,withAsterisk:M,id:$,required:L,__stylesApiProps:H,mod:I,...Y}=r,X=_e({name:["InputWrapper",v],props:H||r,classes:to,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:u3}),ee={size:p,variant:g,__staticSelector:v},ne=Jn($),re=typeof M=="boolean"?M:L,j=A?.id||`${ne}-error`,k=z?.id||`${ne}-description`,V=ne,P=!!C&&typeof C!="boolean",Z=!!R,D=`${P?j:""} ${Z?k:""}`,O=D.trim().length>0?D.trim():void 0,q=T?.id||`${ne}-label`,W=E&&y.jsx(qu,{labelElement:N,id:q,htmlFor:V,required:re,...ee,...T,children:E},"label"),ie=Z&&y.jsx(Gu,{...z,...ee,size:z?.size||ee.size,id:z?.id||k,children:R},"description"),ue=y.jsx(b.Fragment,{children:x(B)},"input"),ve=P&&b.createElement(Xu,{...A,...ee,size:A?.size||ee.size,key:"error",id:A?.id||j},C),fe=S.map(be=>{switch(be){case"label":return W;case"input":return ue;case"description":return ie;case"error":return ve;default:return null}});return y.jsx(o3,{value:{getStyles:X,describedBy:O,inputId:V,labelId:q,...s3(S,{hasDescription:Z,hasError:P})},children:y.jsx(he,{ref:o,variant:g,size:p,mod:[{error:!!C},I],...X("root"),...Y,children:fe})})});Rm.classes=to;Rm.displayName="@mantine/core/InputWrapper";const f3={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},d3=(e,o,r)=>({wrapper:{"--input-margin-top":r.offsetTop?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-margin-bottom":r.offsetBottom?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-height":qe(o.size,"input-height"),"--input-fz":nn(o.size),"--input-radius":o.radius===void 0?void 0:kt(o.radius),"--input-left-section-width":o.leftSectionWidth!==void 0?oe(o.leftSectionWidth):void 0,"--input-right-section-width":o.rightSectionWidth!==void 0?oe(o.rightSectionWidth):void 0,"--input-padding-y":o.multiline?qe(o.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":o.leftSectionPointerEvents,"--input-right-section-pointer-events":o.rightSectionPointerEvents}}),St=un((e,o)=>{const r=ce("Input",f3,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,required:h,__staticSelector:p,__stylesApiProps:g,size:v,wrapperProps:x,error:S,disabled:E,leftSection:C,leftSectionProps:R,leftSectionWidth:T,rightSection:z,rightSectionProps:A,rightSectionWidth:N,rightSectionPointerEvents:B,leftSectionPointerEvents:M,variant:$,vars:L,pointer:H,multiline:I,radius:Y,id:X,withAria:ee,withErrorStyles:ne,mod:re,inputSize:j,__clearSection:k,__clearable:V,__defaultRightSection:P,...Z}=r,{styleProps:D,rest:O}=Xi(Z),q=ws(),W={offsetBottom:q?.offsetBottom,offsetTop:q?.offsetTop},ie=_e({name:["Input",p],props:g||r,classes:to,className:l,style:c,classNames:a,styles:u,unstyled:f,stylesCtx:W,rootSelector:"wrapper",vars:L,varsResolver:d3}),ue=ee?{required:h,disabled:E,"aria-invalid":!!S,"aria-describedby":q?.describedBy,id:q?.inputId||X}:{},ve=z||V&&k||P;return y.jsx(e3,{value:{size:v||"sm"},children:y.jsxs(he,{...ie("wrapper"),...D,...x,mod:[{error:!!S&&ne,pointer:H,disabled:E,multiline:I,"data-with-right-section":!!ve,"data-with-left-section":!!C},re],variant:$,size:v,children:[C&&y.jsx("div",{...R,"data-position":"left",...ie("section",{className:R?.className,style:R?.style}),children:C}),y.jsx(he,{component:"input",...O,...ue,ref:o,required:h,mod:{disabled:E,error:!!S&&ne},variant:$,__size:j,...ie("input")}),ve&&y.jsx("div",{...A,"data-position":"right",...ie("section",{className:A?.className,style:A?.style}),children:ve})]})})});St.classes=to;St.Wrapper=Rm;St.Label=qu;St.Error=Xu;St.Description=Gu;St.Placeholder=Em;St.ClearButton=LS;St.displayName="@mantine/core/Input";function h3(e,o,r){const a=ce(e,o,r),{label:l,description:c,error:u,required:f,classNames:h,styles:p,className:g,unstyled:v,__staticSelector:x,__stylesApiProps:S,errorProps:E,labelProps:C,descriptionProps:R,wrapperProps:T,id:z,size:A,style:N,inputContainer:B,inputWrapperOrder:M,withAsterisk:$,variant:L,vars:H,mod:I,...Y}=a,{styleProps:X,rest:ee}=Xi(Y),ne={label:l,description:c,error:u,required:f,classNames:h,className:g,__staticSelector:x,__stylesApiProps:S||a,errorProps:E,labelProps:C,descriptionProps:R,unstyled:v,styles:p,size:A,style:N,inputContainer:B,inputWrapperOrder:M,withAsterisk:$,variant:L,id:z,mod:I,...T};return{...ee,classNames:h,styles:p,unstyled:v,wrapperProps:{...ne,...X},inputProps:{required:f,classNames:h,styles:p,unstyled:v,size:A,__staticSelector:x,__stylesApiProps:S||a,error:u,variant:L,id:z}}}const p3={__staticSelector:"InputBase",withAria:!0},Mo=un((e,o)=>{const{inputProps:r,wrapperProps:a,...l}=h3("InputBase",p3,e);return y.jsx(St.Wrapper,{...a,children:y.jsx(St,{...r,...l,ref:o})})});Mo.classes={...St.classes,...St.Wrapper.classes};Mo.displayName="@mantine/core/InputBase";function m3(e,o){if(!o||!e)return!1;let r=o.parentNode;for(;r!=null;){if(r===e)return!0;r=r.parentNode}return!1}function g3({target:e,parent:o,ref:r,displayAfterTransitionEnd:a}){const l=b.useRef(-1),[c,u]=b.useState(!1),[f,h]=b.useState(typeof a=="boolean"?a:!1),p=()=>{if(!e||!o||!r.current)return;const S=e.getBoundingClientRect(),E=o.getBoundingClientRect(),C=window.getComputedStyle(e),R=window.getComputedStyle(o),T=Vr(C.borderTopWidth)+Vr(R.borderTopWidth),z=Vr(C.borderLeftWidth)+Vr(R.borderLeftWidth),A={top:S.top-E.top-T,left:S.left-E.left-z,width:S.width,height:S.height};r.current.style.transform=`translateY(${A.top}px) translateX(${A.left}px)`,r.current.style.width=`${A.width}px`,r.current.style.height=`${A.height}px`},g=()=>{window.clearTimeout(l.current),r.current&&(r.current.style.transitionDuration="0ms"),p(),l.current=window.setTimeout(()=>{r.current&&(r.current.style.transitionDuration="")},30)},v=b.useRef(null),x=b.useRef(null);return b.useEffect(()=>{if(p(),e)return v.current=new ResizeObserver(g),v.current.observe(e),o&&(x.current=new ResizeObserver(g),x.current.observe(o)),()=>{v.current?.disconnect(),x.current?.disconnect()}},[o,e]),b.useEffect(()=>{if(o){const S=E=>{m3(E.target,o)&&(g(),h(!1))};return o.addEventListener("transitionend",S),()=>{o.removeEventListener("transitionend",S)}}},[o]),lT(()=>{dT()!=="test"&&u(!0)},20,{autoInvoke:!0}),cT(S=>{S.forEach(E=>{E.type==="attributes"&&E.attributeName==="dir"&&g()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:c,hidden:f}}var kS={root:"m_96b553a6"};const v3={},y3=(e,{transitionDuration:o})=>({root:{"--transition-duration":typeof o=="number"?`${o}ms`:o}}),Tm=ge((e,o)=>{const r=ce("FloatingIndicator",v3,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,target:p,parent:g,transitionDuration:v,mod:x,displayAfterTransitionEnd:S,...E}=r,C=_e({name:"FloatingIndicator",classes:kS,props:r,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:y3}),R=b.useRef(null),{initialized:T,hidden:z}=g3({target:p,parent:g,ref:R,displayAfterTransitionEnd:S}),A=Mt(o,R);return!p||!g?null:y.jsx(he,{ref:A,mod:[{initialized:T,hidden:z},x],...C("root"),...E})});Tm.displayName="@mantine/core/FloatingIndicator";Tm.classes=kS;function HS({style:e,size:o=16,...r}){return y.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...e,width:oe(o),height:oe(o),display:"block"},...r,children:y.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}HS.displayName="@mantine/core/AccordionChevron";var US={root:"m_66836ed3",wrapper:"m_a5d60502",body:"m_667c2793",title:"m_6a03f287",label:"m_698f4f23",icon:"m_667f2a6a",message:"m_7fa78076",closeButton:"m_87f54839"};const b3={},x3=(e,{radius:o,color:r,variant:a,autoContrast:l})=>{const c=e.variantColorResolver({color:r||e.primaryColor,theme:e,variant:a||"light",autoContrast:l});return{root:{"--alert-radius":o===void 0?void 0:kt(o),"--alert-bg":r||a?c.background:void 0,"--alert-color":c.color,"--alert-bd":r||a?c.border:void 0}}},Iu=ge((e,o)=>{const r=ce("Alert",b3,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,radius:p,color:g,title:v,children:x,id:S,icon:E,withCloseButton:C,onClose:R,closeButtonLabel:T,variant:z,autoContrast:A,...N}=r,B=_e({name:"Alert",classes:US,props:r,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:x3}),M=Jn(S),$=v&&`${M}-title`||void 0,L=`${M}-body`;return y.jsx(he,{id:M,...B("root",{variant:z}),variant:z,ref:o,...N,role:"alert","aria-describedby":L,"aria-labelledby":$,children:y.jsxs("div",{...B("wrapper"),children:[E&&y.jsx("div",{...B("icon"),children:E}),y.jsxs("div",{...B("body"),children:[v&&y.jsx("div",{...B("title"),"data-with-close-button":C||void 0,children:y.jsx("span",{id:$,...B("label"),children:v})}),x&&y.jsx("div",{id:L,...B("message"),"data-variant":z,children:x})]}),C&&y.jsx(Ki,{...B("closeButton"),onClick:R,variant:"transparent",size:16,iconSize:16,"aria-label":T,unstyled:f})]})})});Iu.classes=US;Iu.displayName="@mantine/core/Alert";var PS={root:"m_b6d8b162"};function S3(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const w3={inherit:!1},C3=(e,{variant:o,lineClamp:r,gradient:a,size:l,color:c})=>({root:{"--text-fz":nn(l),"--text-lh":PR(l),"--text-gradient":o==="gradient"?gp(a,e):void 0,"--text-line-clamp":typeof r=="number"?r.toString():void 0,"--text-color":c?Zt(c,e):void 0}}),Ye=un((e,o)=>{const r=ce("Text",w3,e),{lineClamp:a,truncate:l,inline:c,inherit:u,gradient:f,span:h,__staticSelector:p,vars:g,className:v,style:x,classNames:S,styles:E,unstyled:C,variant:R,mod:T,size:z,...A}=r,N=_e({name:["Text",p],props:r,classes:PS,className:v,style:x,classNames:S,styles:E,unstyled:C,vars:g,varsResolver:C3});return y.jsx(he,{...N("root",{focusable:!0}),ref:o,component:h?"span":"p",variant:R,mod:[{"data-truncate":S3(l),"data-line-clamp":typeof a=="number","data-inline":c,"data-inherit":u},T],size:z,...A})});Ye.classes=PS;Ye.displayName="@mantine/core/Text";const[E3,Wi]=zo("AppShell was not found in tree");var Ir={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const R3={},_m=ge((e,o)=>{const r=ce("AppShellAside",R3,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,withBorder:p,zIndex:g,mod:v,...x}=r,S=Wi();return S.disabled?null:y.jsx(he,{component:"aside",ref:o,mod:[{"with-border":p??S.withBorder},v],...S.getStyles("aside",{className:l,classNames:a,styles:u,style:c}),...x,__vars:{"--app-shell-aside-z-index":`calc(${g??S.zIndex} + 1)`}})});_m.classes=Ir;_m.displayName="@mantine/core/AppShellAside";const T3={},Dm=ge((e,o)=>{const r=ce("AppShellFooter",T3,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,withBorder:p,zIndex:g,mod:v,...x}=r,S=Wi();return S.disabled?null:y.jsx(he,{component:"footer",ref:o,mod:[{"with-border":p??S.withBorder},v],...S.getStyles("footer",{className:zt({[ki.classNames.zeroRight]:S.offsetScrollbars},l),classNames:a,styles:u,style:c}),...x,__vars:{"--app-shell-footer-z-index":(g??S.zIndex)?.toString()}})});Dm.classes=Ir;Dm.displayName="@mantine/core/AppShellFooter";const _3={},Nm=ge((e,o)=>{const r=ce("AppShellHeader",_3,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,withBorder:p,zIndex:g,mod:v,...x}=r,S=Wi();return S.disabled?null:y.jsx(he,{component:"header",ref:o,mod:[{"with-border":p??S.withBorder},v],...S.getStyles("header",{className:zt({[ki.classNames.zeroRight]:S.offsetScrollbars},l),classNames:a,styles:u,style:c}),...x,__vars:{"--app-shell-header-z-index":(g??S.zIndex)?.toString()}})});Nm.classes=Ir;Nm.displayName="@mantine/core/AppShellHeader";const D3={},Am=ge((e,o)=>{const r=ce("AppShellMain",D3,e),{classNames:a,className:l,style:c,styles:u,vars:f,...h}=r,p=Wi();return y.jsx(he,{component:"main",ref:o,...p.getStyles("main",{className:l,style:c,classNames:a,styles:u}),...h})});Am.classes=Ir;Am.displayName="@mantine/core/AppShellMain";function Cs(e){return typeof e=="object"?e.base:e}function Es(e){const o=typeof e=="object"&&e!==null&&typeof e.base<"u"&&Object.keys(e).length===1;return typeof e=="number"||typeof e=="string"||o}function Rs(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function N3({baseStyles:e,minMediaStyles:o,maxMediaStyles:r,aside:a,theme:l}){const c=a?.width,u="translateX(var(--app-shell-aside-width))",f="translateX(calc(var(--app-shell-aside-width) * -1))";if(a?.breakpoint&&!a?.collapsed?.mobile&&(r[a?.breakpoint]=r[a?.breakpoint]||{},r[a?.breakpoint]["--app-shell-aside-width"]="100%",r[a?.breakpoint]["--app-shell-aside-offset"]="0px"),Es(c)){const h=oe(Cs(c));e["--app-shell-aside-width"]=h,e["--app-shell-aside-offset"]=h}if(Rs(c)&&(typeof c.base<"u"&&(e["--app-shell-aside-width"]=oe(c.base),e["--app-shell-aside-offset"]=oe(c.base)),At(c).forEach(h=>{h!=="base"&&(o[h]=o[h]||{},o[h]["--app-shell-aside-width"]=oe(c[h]),o[h]["--app-shell-aside-offset"]=oe(c[h]))})),a?.collapsed?.desktop){const h=a.breakpoint;o[h]=o[h]||{},o[h]["--app-shell-aside-transform"]=u,o[h]["--app-shell-aside-transform-rtl"]=f,o[h]["--app-shell-aside-offset"]="0px !important"}if(a?.collapsed?.mobile){const h=Zp(a.breakpoint,l.breakpoints)-.1;r[h]=r[h]||{},r[h]["--app-shell-aside-width"]="100%",r[h]["--app-shell-aside-offset"]="0px",r[h]["--app-shell-aside-transform"]=u,r[h]["--app-shell-aside-transform-rtl"]=f}}function A3({baseStyles:e,minMediaStyles:o,footer:r}){const a=r?.height,l="translateY(var(--app-shell-footer-height))",c=r?.offset??!0;if(Es(a)){const u=oe(Cs(a));e["--app-shell-footer-height"]=u,c&&(e["--app-shell-footer-offset"]=u)}Rs(a)&&(typeof a.base<"u"&&(e["--app-shell-footer-height"]=oe(a.base),c&&(e["--app-shell-footer-offset"]=oe(a.base))),At(a).forEach(u=>{u!=="base"&&(o[u]=o[u]||{},o[u]["--app-shell-footer-height"]=oe(a[u]),c&&(o[u]["--app-shell-footer-offset"]=oe(a[u])))})),r?.collapsed&&(e["--app-shell-footer-transform"]=l,e["--app-shell-footer-offset"]="0px !important")}function z3({baseStyles:e,minMediaStyles:o,header:r}){const a=r?.height,l="translateY(calc(var(--app-shell-header-height) * -1))",c=r?.offset??!0;if(Es(a)){const u=oe(Cs(a));e["--app-shell-header-height"]=u,c&&(e["--app-shell-header-offset"]=u)}Rs(a)&&(typeof a.base<"u"&&(e["--app-shell-header-height"]=oe(a.base),c&&(e["--app-shell-header-offset"]=oe(a.base))),At(a).forEach(u=>{u!=="base"&&(o[u]=o[u]||{},o[u]["--app-shell-header-height"]=oe(a[u]),c&&(o[u]["--app-shell-header-offset"]=oe(a[u])))})),r?.collapsed&&(e["--app-shell-header-transform"]=l,e["--app-shell-header-offset"]="0px !important")}function M3({baseStyles:e,minMediaStyles:o,maxMediaStyles:r,navbar:a,theme:l}){const c=a?.width,u="translateX(calc(var(--app-shell-navbar-width) * -1))",f="translateX(var(--app-shell-navbar-width))";if(a?.breakpoint&&!a?.collapsed?.mobile&&(r[a?.breakpoint]=r[a?.breakpoint]||{},r[a?.breakpoint]["--app-shell-navbar-width"]="100%",r[a?.breakpoint]["--app-shell-navbar-offset"]="0px"),Es(c)){const h=oe(Cs(c));e["--app-shell-navbar-width"]=h,e["--app-shell-navbar-offset"]=h}if(Rs(c)&&(typeof c.base<"u"&&(e["--app-shell-navbar-width"]=oe(c.base),e["--app-shell-navbar-offset"]=oe(c.base)),At(c).forEach(h=>{h!=="base"&&(o[h]=o[h]||{},o[h]["--app-shell-navbar-width"]=oe(c[h]),o[h]["--app-shell-navbar-offset"]=oe(c[h]))})),a?.collapsed?.desktop){const h=a.breakpoint;o[h]=o[h]||{},o[h]["--app-shell-navbar-transform"]=u,o[h]["--app-shell-navbar-transform-rtl"]=f,o[h]["--app-shell-navbar-offset"]="0px !important"}if(a?.collapsed?.mobile){const h=Zp(a.breakpoint,l.breakpoints)-.1;r[h]=r[h]||{},r[h]["--app-shell-navbar-width"]="100%",r[h]["--app-shell-navbar-offset"]="0px",r[h]["--app-shell-navbar-transform"]=u,r[h]["--app-shell-navbar-transform-rtl"]=f}}function Ih(e){return Number(e)===0?"0px":sn(e)}function O3({padding:e,baseStyles:o,minMediaStyles:r}){Es(e)&&(o["--app-shell-padding"]=Ih(Cs(e))),Rs(e)&&(e.base&&(o["--app-shell-padding"]=Ih(e.base)),At(e).forEach(a=>{a!=="base"&&(r[a]=r[a]||{},r[a]["--app-shell-padding"]=Ih(e[a]))}))}function j3({navbar:e,header:o,footer:r,aside:a,padding:l,theme:c}){const u={},f={},h={};M3({baseStyles:h,minMediaStyles:u,maxMediaStyles:f,navbar:e,theme:c}),N3({baseStyles:h,minMediaStyles:u,maxMediaStyles:f,aside:a,theme:c}),z3({baseStyles:h,minMediaStyles:u,header:o}),A3({baseStyles:h,minMediaStyles:u,footer:r}),O3({baseStyles:h,minMediaStyles:u,padding:l});const p=pp(At(u),c.breakpoints).map(x=>({query:`(min-width: ${du(x.px)})`,styles:u[x.value]})),g=pp(At(f),c.breakpoints).map(x=>({query:`(max-width: ${du(x.px)})`,styles:f[x.value]})),v=[...p,...g];return{baseStyles:h,media:v}}function B3({navbar:e,header:o,aside:r,footer:a,padding:l}){const c=cn(),u=ir(),{media:f,baseStyles:h}=j3({navbar:e,header:o,footer:a,aside:r,padding:l,theme:c});return y.jsx(Ou,{media:f,styles:h,selector:u.cssVariablesSelector})}const $3={},zm=ge((e,o)=>{const r=ce("AppShellNavbar",$3,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,withBorder:p,zIndex:g,mod:v,...x}=r,S=Wi();return S.disabled?null:y.jsx(he,{component:"nav",ref:o,mod:[{"with-border":p??S.withBorder},v],...S.getStyles("navbar",{className:l,classNames:a,styles:u,style:c}),...x,__vars:{"--app-shell-navbar-z-index":`calc(${g??S.zIndex} + 1)`}})});zm.classes=Ir;zm.displayName="@mantine/core/AppShellNavbar";const L3={},Mm=un((e,o)=>{const r=ce("AppShellSection",L3,e),{classNames:a,className:l,style:c,styles:u,vars:f,grow:h,mod:p,...g}=r,v=Wi();return y.jsx(he,{ref:o,mod:[{grow:h},p],...v.getStyles("section",{className:l,style:c,classNames:a,styles:u}),...g})});Mm.classes=Ir;Mm.displayName="@mantine/core/AppShellSection";function k3({transitionDuration:e,disabled:o}){const[r,a]=b.useState(!0),l=b.useRef(-1),c=b.useRef(-1);return wx("resize",()=>{a(!0),clearTimeout(l.current),l.current=window.setTimeout(()=>b.startTransition(()=>{a(!1)}),200)}),Yi(()=>{a(!0),clearTimeout(c.current),c.current=window.setTimeout(()=>b.startTransition(()=>{a(!1)}),e||0)},[o,e]),r}const H3={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:vo("app")},U3=(e,{transitionDuration:o,transitionTimingFunction:r})=>({root:{"--app-shell-transition-duration":`${o}ms`,"--app-shell-transition-timing-function":r}}),mo=ge((e,o)=>{const r=ce("AppShell",H3,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,navbar:p,withBorder:g,padding:v,transitionDuration:x,transitionTimingFunction:S,header:E,zIndex:C,layout:R,disabled:T,aside:z,footer:A,offsetScrollbars:N=R!=="alt",mod:B,...M}=r,$=_e({name:"AppShell",classes:Ir,props:r,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:U3}),L=k3({disabled:T,transitionDuration:x});return y.jsxs(E3,{value:{getStyles:$,withBorder:g,zIndex:C,disabled:T,offsetScrollbars:N},children:[y.jsx(B3,{navbar:p,header:E,aside:z,footer:A,padding:v}),y.jsx(he,{ref:o,...$("root"),mod:[{resizing:L,layout:R,disabled:T},B],...M})]})});mo.classes=Ir;mo.displayName="@mantine/core/AppShell";mo.Navbar=zm;mo.Header=Nm;mo.Main=Am;mo.Aside=_m;mo.Footer=Dm;mo.Section=Mm;function VS(e){return typeof e=="string"?{value:e,label:e}:"value"in e&&!("label"in e)?{value:e.value,label:e.value,disabled:e.disabled}:typeof e=="number"?{value:e.toString(),label:e.toString()}:"group"in e?{group:e.group,items:e.items.map(o=>VS(o))}:e}function P3(e){return e?e.map(o=>VS(o)):[]}function YS(e){return e.reduce((o,r)=>"group"in r?{...o,...YS(r.items)}:(o[r.value]=r,o),{})}var En={dropdown:"m_88b62a41",search:"m_985517d8",options:"m_b2821a6e",option:"m_92253aa5",empty:"m_2530cd1d",header:"m_858f94bd",footer:"m_82b967cb",group:"m_254f3e4f",groupLabel:"m_2bb2e9e5",chevron:"m_2943220b",optionsDropdownOption:"m_390b5f4",optionsDropdownCheckIcon:"m_8ee53fc2"};const V3={error:null},Y3=(e,{size:o,color:r})=>({chevron:{"--combobox-chevron-size":qe(o,"combobox-chevron-size"),"--combobox-chevron-color":r?Zt(r,e):void 0}}),Om=ge((e,o)=>{const r=ce("ComboboxChevron",V3,e),{size:a,error:l,style:c,className:u,classNames:f,styles:h,unstyled:p,vars:g,mod:v,...x}=r,S=_e({name:"ComboboxChevron",classes:En,props:r,style:c,className:u,classNames:f,styles:h,unstyled:p,vars:g,varsResolver:Y3,rootSelector:"chevron"});return y.jsx(he,{component:"svg",...x,...S("chevron"),size:a,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:l},v],ref:o,children:y.jsx("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})});Om.classes=En;Om.displayName="@mantine/core/ComboboxChevron";const[G3,no]=zo("Combobox component was not found in tree"),GS=b.forwardRef(({size:e,onMouseDown:o,onClick:r,onClear:a,...l},c)=>y.jsx(St.ClearButton,{ref:c,tabIndex:-1,"aria-hidden":!0,...l,onMouseDown:u=>{u.preventDefault(),o?.(u)},onClick:u=>{a(),r?.(u)}}));GS.displayName="@mantine/core/ComboboxClearButton";const X3={},jm=ge((e,o)=>{const{classNames:r,styles:a,className:l,style:c,hidden:u,...f}=ce("ComboboxDropdown",X3,e),h=no();return y.jsx(Rn.Dropdown,{...f,ref:o,role:"presentation","data-hidden":u||void 0,...h.getStyles("dropdown",{className:l,style:c,classNames:r,styles:a})})});jm.classes=En;jm.displayName="@mantine/core/ComboboxDropdown";const q3={refProp:"ref"},XS=ge((e,o)=>{const{children:r,refProp:a}=ce("ComboboxDropdownTarget",q3,e);if(no(),!ar(r))throw new Error("Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return y.jsx(Rn.Target,{ref:o,refProp:a,children:r})});XS.displayName="@mantine/core/ComboboxDropdownTarget";const I3={},Bm=ge((e,o)=>{const{classNames:r,className:a,style:l,styles:c,vars:u,...f}=ce("ComboboxEmpty",I3,e),h=no();return y.jsx(he,{ref:o,...h.getStyles("empty",{className:a,classNames:r,styles:c,style:l}),...f})});Bm.classes=En;Bm.displayName="@mantine/core/ComboboxEmpty";function $m({onKeyDown:e,withKeyboardNavigation:o,withAriaAttributes:r,withExpandedAttribute:a,targetType:l,autoComplete:c}){const u=no(),[f,h]=b.useState(null),p=v=>{if(e?.(v),!u.readOnly&&o){if(v.nativeEvent.isComposing)return;if(v.nativeEvent.code==="ArrowDown"&&(v.preventDefault(),u.store.dropdownOpened?h(u.store.selectNextOption()):(u.store.openDropdown("keyboard"),h(u.store.selectActiveOption()),u.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),v.nativeEvent.code==="ArrowUp"&&(v.preventDefault(),u.store.dropdownOpened?h(u.store.selectPreviousOption()):(u.store.openDropdown("keyboard"),h(u.store.selectActiveOption()),u.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),v.nativeEvent.code==="Enter"||v.nativeEvent.code==="NumpadEnter"){if(v.nativeEvent.keyCode===229)return;const x=u.store.getSelectedOptionIndex();u.store.dropdownOpened&&x!==-1?(v.preventDefault(),u.store.clickSelectedOption()):l==="button"&&(v.preventDefault(),u.store.openDropdown("keyboard"))}v.key==="Escape"&&u.store.closeDropdown("keyboard"),v.nativeEvent.code==="Space"&&l==="button"&&(v.preventDefault(),u.store.toggleDropdown("keyboard"))}};return{...r?{"aria-haspopup":"listbox","aria-expanded":a&&!!(u.store.listId&&u.store.dropdownOpened)||void 0,"aria-controls":u.store.dropdownOpened?u.store.listId:void 0,"aria-activedescendant":u.store.dropdownOpened&&f||void 0,autoComplete:c,"data-expanded":u.store.dropdownOpened||void 0,"data-mantine-stop-propagation":u.store.dropdownOpened||void 0}:{},onKeyDown:p}}const F3={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},qS=ge((e,o)=>{const{children:r,refProp:a,withKeyboardNavigation:l,withAriaAttributes:c,withExpandedAttribute:u,targetType:f,autoComplete:h,...p}=ce("ComboboxEventsTarget",F3,e);if(!ar(r))throw new Error("Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const g=no(),v=$m({targetType:f,withAriaAttributes:c,withKeyboardNavigation:l,withExpandedAttribute:u,onKeyDown:r.props.onKeyDown,autoComplete:h});return b.cloneElement(r,{...v,...p,[a]:Mt(o,g.store.targetRef,Au(r))})});qS.displayName="@mantine/core/ComboboxEventsTarget";const Z3={},Lm=ge((e,o)=>{const{classNames:r,className:a,style:l,styles:c,vars:u,...f}=ce("ComboboxFooter",Z3,e),h=no();return y.jsx(he,{ref:o,...h.getStyles("footer",{className:a,classNames:r,style:l,styles:c}),...f,onMouseDown:p=>{p.preventDefault()}})});Lm.classes=En;Lm.displayName="@mantine/core/ComboboxFooter";const Q3={},km=ge((e,o)=>{const{classNames:r,className:a,style:l,styles:c,vars:u,children:f,label:h,...p}=ce("ComboboxGroup",Q3,e),g=no();return y.jsxs(he,{ref:o,...g.getStyles("group",{className:a,classNames:r,style:l,styles:c}),...p,children:[h&&y.jsx("div",{...g.getStyles("groupLabel",{classNames:r,styles:c}),children:h}),f]})});km.classes=En;km.displayName="@mantine/core/ComboboxGroup";const K3={},Hm=ge((e,o)=>{const{classNames:r,className:a,style:l,styles:c,vars:u,...f}=ce("ComboboxHeader",K3,e),h=no();return y.jsx(he,{ref:o,...h.getStyles("header",{className:a,classNames:r,style:l,styles:c}),...f,onMouseDown:p=>{p.preventDefault()}})});Hm.classes=En;Hm.displayName="@mantine/core/ComboboxHeader";function IS({value:e,valuesDivider:o=",",...r}){return y.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(o):e||"",...r})}IS.displayName="@mantine/core/ComboboxHiddenInput";const W3={},Um=ge((e,o)=>{const r=ce("ComboboxOption",W3,e),{classNames:a,className:l,style:c,styles:u,vars:f,onClick:h,id:p,active:g,onMouseDown:v,onMouseOver:x,disabled:S,selected:E,mod:C,...R}=r,T=no(),z=b.useId(),A=p||z;return y.jsx(he,{...T.getStyles("option",{className:l,classNames:a,styles:u,style:c}),...R,ref:o,id:A,mod:["combobox-option",{"combobox-active":g,"combobox-disabled":S,"combobox-selected":E},C],role:"option",onClick:N=>{S?N.preventDefault():(T.onOptionSubmit?.(r.value,r),h?.(N))},onMouseDown:N=>{N.preventDefault(),v?.(N)},onMouseOver:N=>{T.resetSelectionOnOptionHover&&T.store.resetSelectedOption(),x?.(N)}})});Um.classes=En;Um.displayName="@mantine/core/ComboboxOption";const J3={},Pm=ge((e,o)=>{const r=ce("ComboboxOptions",J3,e),{classNames:a,className:l,style:c,styles:u,id:f,onMouseDown:h,labelledBy:p,...g}=r,v=no(),x=Jn(f);return b.useEffect(()=>{v.store.setListId(x)},[x]),y.jsx(he,{ref:o,...v.getStyles("options",{className:l,style:c,classNames:a,styles:u}),...g,id:x,role:"listbox","aria-labelledby":p,onMouseDown:S=>{S.preventDefault(),h?.(S)}})});Pm.classes=En;Pm.displayName="@mantine/core/ComboboxOptions";const eA={withAriaAttributes:!0,withKeyboardNavigation:!0},Vm=ge((e,o)=>{const r=ce("ComboboxSearch",eA,e),{classNames:a,styles:l,unstyled:c,vars:u,withAriaAttributes:f,onKeyDown:h,withKeyboardNavigation:p,size:g,...v}=r,x=no(),S=x.getStyles("search"),E=$m({targetType:"input",withAriaAttributes:f,withKeyboardNavigation:p,withExpandedAttribute:!1,onKeyDown:h,autoComplete:"off"});return y.jsx(St,{ref:Mt(o,x.store.searchRef),classNames:[{input:S.className},a],styles:[{input:S.style},l],size:g||x.size,...E,...v,__staticSelector:"Combobox"})});Vm.classes=En;Vm.displayName="@mantine/core/ComboboxSearch";const tA={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},FS=ge((e,o)=>{const{children:r,refProp:a,withKeyboardNavigation:l,withAriaAttributes:c,withExpandedAttribute:u,targetType:f,autoComplete:h,...p}=ce("ComboboxTarget",tA,e);if(!ar(r))throw new Error("Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const g=no(),v=$m({targetType:f,withAriaAttributes:c,withKeyboardNavigation:l,withExpandedAttribute:u,onKeyDown:r.props.onKeyDown,autoComplete:h}),x=b.cloneElement(r,{...v,...p});return y.jsx(Rn.Target,{ref:Mt(o,g.store.targetRef),children:x})});FS.displayName="@mantine/core/ComboboxTarget";function nA(e,o,r){for(let a=e-1;a>=0;a-=1)if(!o[a].hasAttribute("data-combobox-disabled"))return a;if(r){for(let a=o.length-1;a>-1;a-=1)if(!o[a].hasAttribute("data-combobox-disabled"))return a}return e}function oA(e,o,r){for(let a=e+1;a{f||(h(!0),l?.(j))},[h,l,f]),T=b.useCallback((j="unknown")=>{f&&(h(!1),a?.(j))},[h,a,f]),z=b.useCallback((j="unknown")=>{f?T(j):R(j)},[T,R,f]),A=b.useCallback(()=>{const j=document.querySelector(`#${p.current} [data-combobox-selected]`);j?.removeAttribute("data-combobox-selected"),j?.removeAttribute("aria-selected")},[]),N=b.useCallback(j=>{const V=document.getElementById(p.current)?.querySelectorAll("[data-combobox-option]");if(!V)return null;const P=j>=V.length?0:j<0?V.length-1:j;return g.current=P,V?.[P]&&!V[P].hasAttribute("data-combobox-disabled")?(A(),V[P].setAttribute("data-combobox-selected","true"),V[P].setAttribute("aria-selected","true"),V[P].scrollIntoView({block:"nearest",behavior:u}),V[P].id):null},[u,A]),B=b.useCallback(()=>{const j=document.querySelector(`#${p.current} [data-combobox-active]`);if(j){const k=document.querySelectorAll(`#${p.current} [data-combobox-option]`),V=Array.from(k).findIndex(P=>P===j);return N(V)}return N(0)},[N]),M=b.useCallback(()=>N(oA(g.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),c)),[N,c]),$=b.useCallback(()=>N(nA(g.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),c)),[N,c]),L=b.useCallback(()=>N(rA(document.querySelectorAll(`#${p.current} [data-combobox-option]`))),[N]),H=b.useCallback((j="selected",k)=>{C.current=window.setTimeout(()=>{const V=document.querySelectorAll(`#${p.current} [data-combobox-option]`),P=Array.from(V).findIndex(Z=>Z.hasAttribute(`data-combobox-${j}`));g.current=P,k?.scrollIntoView&&V[P]?.scrollIntoView({block:"nearest",behavior:u})},0)},[]),I=b.useCallback(()=>{g.current=-1,A()},[A]),Y=b.useCallback(()=>{document.querySelectorAll(`#${p.current} [data-combobox-option]`)?.[g.current]?.click()},[]),X=b.useCallback(j=>{p.current=j},[]),ee=b.useCallback(()=>{S.current=window.setTimeout(()=>v.current.focus(),0)},[]),ne=b.useCallback(()=>{E.current=window.setTimeout(()=>x.current.focus(),0)},[]),re=b.useCallback(()=>g.current,[]);return b.useEffect(()=>()=>{window.clearTimeout(S.current),window.clearTimeout(E.current),window.clearTimeout(C.current)},[]),{dropdownOpened:f,openDropdown:R,closeDropdown:T,toggleDropdown:z,selectedOptionIndex:g.current,getSelectedOptionIndex:re,selectOption:N,selectFirstOption:L,selectActiveOption:B,selectNextOption:M,selectPreviousOption:$,resetSelectedOption:I,updateSelectedOptionIndex:H,listId:p.current,setListId:X,clickSelectedOption:Y,searchRef:v,focusSearchInput:ee,targetRef:x,focusTarget:ne}}const aA={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},iA=(e,{size:o,dropdownPadding:r})=>({options:{"--combobox-option-fz":nn(o),"--combobox-option-padding":qe(o,"combobox-option-padding")},dropdown:{"--combobox-padding":r===void 0?void 0:oe(r),"--combobox-option-fz":nn(o),"--combobox-option-padding":qe(o,"combobox-option-padding")}});function Pe(e){const o=ce("Combobox",aA,e),{classNames:r,styles:a,unstyled:l,children:c,store:u,vars:f,onOptionSubmit:h,onClose:p,size:g,dropdownPadding:v,resetSelectionOnOptionHover:x,__staticSelector:S,readOnly:E,...C}=o,R=Ym(),T=u||R,z=_e({name:S||"Combobox",classes:En,props:o,classNames:r,styles:a,unstyled:l,vars:f,varsResolver:iA}),A=()=>{p?.(),T.closeDropdown()};return y.jsx(G3,{value:{getStyles:z,store:T,onOptionSubmit:h,size:g,resetSelectionOnOptionHover:x,readOnly:E},children:y.jsx(Rn,{opened:T.dropdownOpened,...C,onChange:N=>!N&&A(),withRoles:!1,unstyled:l,children:c})})}const lA=e=>e;Pe.extend=lA;Pe.classes=En;Pe.displayName="@mantine/core/Combobox";Pe.Target=FS;Pe.Dropdown=jm;Pe.Options=Pm;Pe.Option=Um;Pe.Search=Vm;Pe.Empty=Bm;Pe.Chevron=Om;Pe.Footer=Lm;Pe.Header=Hm;Pe.EventsTarget=qS;Pe.DropdownTarget=XS;Pe.Group=km;Pe.ClearButton=GS;Pe.HiddenInput=IS;var ZS={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const QS=ZS,Gm=b.forwardRef(({__staticSelector:e,__stylesApiProps:o,className:r,classNames:a,styles:l,unstyled:c,children:u,label:f,description:h,id:p,disabled:g,error:v,size:x,labelPosition:S="left",bodyElement:E="div",labelElement:C="label",variant:R,style:T,vars:z,mod:A,...N},B)=>{const M=_e({name:e,props:o,className:r,style:T,classes:ZS,classNames:a,styles:l,unstyled:c});return y.jsx(he,{...M("root"),ref:B,__vars:{"--label-fz":nn(x),"--label-lh":qe(x,"label-lh")},mod:[{"label-position":S},A],variant:R,size:x,...N,children:y.jsxs(he,{component:E,htmlFor:E==="label"?p:void 0,...M("body"),children:[u,y.jsxs("div",{...M("labelWrapper"),"data-disabled":g||void 0,children:[f&&y.jsx(he,{component:C,htmlFor:C==="label"?p:void 0,...M("label"),"data-disabled":g||void 0,children:f}),h&&y.jsx(St.Description,{size:x,__inheritStyles:!1,...M("description"),children:h}),v&&typeof v!="boolean"&&y.jsx(St.Error,{size:x,__inheritStyles:!1,...M("error"),children:v})]})]})})});Gm.displayName="@mantine/core/InlineInput";const KS=b.createContext(null),sA=KS.Provider,WS=()=>b.useContext(KS),[cA,uA]=Ss();var JS={card:"m_26775b0a"};const fA={withBorder:!0},dA=(e,{radius:o})=>({card:{"--card-radius":kt(o)}}),Xm=ge((e,o)=>{const r=ce("CheckboxCard",fA,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,checked:p,mod:g,withBorder:v,value:x,onClick:S,defaultChecked:E,onChange:C,...R}=r,T=_e({name:"CheckboxCard",classes:JS,props:r,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:dA,rootSelector:"card"}),z=WS(),A=typeof p=="boolean"?p:z?z.value.includes(x||""):void 0,[N,B]=Wn({value:A,defaultValue:E,finalValue:!1,onChange:C});return y.jsx(cA,{value:{checked:N},children:y.jsx($n,{ref:o,mod:[{"with-border":v,checked:N},g],...T("card"),...R,role:"checkbox","aria-checked":N,onClick:M=>{S?.(M),z?.onChange(x||""),B(!N)}})})});Xm.displayName="@mantine/core/CheckboxCard";Xm.classes=JS;function ew({children:e,role:o}){const r=ws();return r?y.jsx("div",{role:o,"aria-labelledby":r.labelId,"aria-describedby":r.describedBy,children:e}):y.jsx(y.Fragment,{children:e})}const hA={},qm=ge((e,o)=>{const{value:r,defaultValue:a,onChange:l,size:c,wrapperProps:u,children:f,readOnly:h,...p}=ce("CheckboxGroup",hA,e),[g,v]=Wn({value:r,defaultValue:a,finalValue:[],onChange:l}),x=S=>{const E=typeof S=="string"?S:S.currentTarget.value;!h&&v(g.includes(E)?g.filter(C=>C!==E):[...g,E])};return y.jsx(sA,{value:{value:g,onChange:x,size:c},children:y.jsx(St.Wrapper,{size:c,ref:o,...u,...p,labelElement:"div",__staticSelector:"CheckboxGroup",children:y.jsx(ew,{role:"group",children:f})})})});qm.classes=St.Wrapper.classes;qm.displayName="@mantine/core/CheckboxGroup";function tw({size:e,style:o,...r}){const a=e!==void 0?{width:oe(e),height:oe(e),...o}:o;return y.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:a,"aria-hidden":!0,...r,children:y.jsx("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function nw({indeterminate:e,...o}){return e?y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...o,children:y.jsx("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):y.jsx(tw,{...o})}var ow={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const pA={icon:nw},mA=(e,{radius:o,color:r,size:a,iconColor:l,variant:c,autoContrast:u})=>{const f=lr({color:r||e.primaryColor,theme:e}),h=f.isThemeColor&&f.shade===void 0?`var(--mantine-color-${f.color}-outline)`:f.color;return{indicator:{"--checkbox-size":qe(a,"checkbox-size"),"--checkbox-radius":o===void 0?void 0:kt(o),"--checkbox-color":c==="outline"?h:Zt(r,e),"--checkbox-icon-color":l?Zt(l,e):Ax(u,e)?Mu({color:r,theme:e,autoContrast:u}):void 0}}},Im=ge((e,o)=>{const r=ce("CheckboxIndicator",pA,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,icon:p,indeterminate:g,radius:v,color:x,iconColor:S,autoContrast:E,checked:C,mod:R,variant:T,disabled:z,...A}=r,N=p,B=_e({name:"CheckboxIndicator",classes:ow,props:r,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:mA,rootSelector:"indicator"}),M=uA(),$=typeof C=="boolean"||typeof g=="boolean"?C||g:M?.checked||!1;return y.jsx(he,{ref:o,...B("indicator",{variant:T}),variant:T,mod:[{checked:$,disabled:z},R],...A,children:y.jsx(N,{indeterminate:g,...B("icon")})})});Im.displayName="@mantine/core/CheckboxIndicator";Im.classes=ow;var rw={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const gA={labelPosition:"right",icon:nw},vA=(e,{radius:o,color:r,size:a,iconColor:l,variant:c,autoContrast:u})=>{const f=lr({color:r||e.primaryColor,theme:e}),h=f.isThemeColor&&f.shade===void 0?`var(--mantine-color-${f.color}-outline)`:f.color;return{root:{"--checkbox-size":qe(a,"checkbox-size"),"--checkbox-radius":o===void 0?void 0:kt(o),"--checkbox-color":c==="outline"?h:Zt(r,e),"--checkbox-icon-color":l?Zt(l,e):Ax(u,e)?Mu({color:r,theme:e,autoContrast:u}):void 0}}},Ji=ge((e,o)=>{const r=ce("Checkbox",gA,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,color:p,label:g,id:v,size:x,radius:S,wrapperProps:E,checked:C,labelPosition:R,description:T,error:z,disabled:A,variant:N,indeterminate:B,icon:M,rootRef:$,iconColor:L,onChange:H,autoContrast:I,mod:Y,...X}=r,ee=WS(),ne=x||ee?.size,re=M,j=_e({name:"Checkbox",props:r,classes:rw,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:vA}),{styleProps:k,rest:V}=Xi(X),P=Jn(v),Z=ee?{checked:ee.value.includes(V.value),onChange:q=>{ee.onChange(q),H?.(q)}}:{},D=b.useRef(null),O=o||D;return b.useEffect(()=>{O&&"current"in O&&O.current&&(O.current.indeterminate=B||!1)},[B,O]),y.jsx(Gm,{...j("root"),__staticSelector:"Checkbox",__stylesApiProps:r,id:P,size:ne,labelPosition:R,label:g,description:T,error:z,disabled:A,classNames:a,styles:u,unstyled:f,"data-checked":Z.checked||C||void 0,variant:N,ref:$,mod:Y,...k,...E,children:y.jsxs(he,{...j("inner"),mod:{"data-label-position":R},children:[y.jsx(he,{component:"input",id:P,ref:O,checked:C,disabled:A,mod:{error:!!z,indeterminate:B},...j("input",{focusable:!0,variant:N}),onChange:H,...V,...Z,type:"checkbox"}),y.jsx(re,{indeterminate:B,...j("icon")})]})})});Ji.classes={...rw,...QS};Ji.displayName="@mantine/core/Checkbox";Ji.Group=qm;Ji.Indicator=Im;Ji.Card=Xm;function hs(e){return"group"in e}function aw({options:e,search:o,limit:r}){const a=o.trim().toLowerCase(),l=[];for(let c=0;c0)return!1;return!0}function iw(e,o=new Set){if(Array.isArray(e))for(const r of e)if(hs(r))iw(r.items,o);else{if(typeof r.value>"u")throw new Error("[@mantine/core] Each option must have value property");if(typeof r.value!="string")throw new Error(`[@mantine/core] Option value must be a string, other data formats are not supported, got ${typeof r.value}`);if(o.has(r.value))throw new Error(`[@mantine/core] Duplicate options are not supported. Option with value "${r.value}" was provided more than once`);o.add(r.value)}}function bA(e,o){return Array.isArray(e)?e.includes(o):e===o}function lw({data:e,withCheckIcon:o,value:r,checkIconPosition:a,unstyled:l,renderOption:c}){if(!hs(e)){const f=bA(r,e.value),h=o&&f&&y.jsx(tw,{className:En.optionsDropdownCheckIcon}),p=y.jsxs(y.Fragment,{children:[a==="left"&&h,y.jsx("span",{children:e.label}),a==="right"&&h]});return y.jsx(Pe.Option,{value:e.value,disabled:e.disabled,className:zt({[En.optionsDropdownOption]:!l}),"data-reverse":a==="right"||void 0,"data-checked":f||void 0,"aria-selected":f,active:f,children:typeof c=="function"?c({option:e,checked:f}):p})}const u=e.items.map(f=>y.jsx(lw,{data:f,value:r,unstyled:l,withCheckIcon:o,checkIconPosition:a,renderOption:c},f.value));return y.jsx(Pe.Group,{label:e.group,children:u})}function xA({data:e,hidden:o,hiddenWhenEmpty:r,filter:a,search:l,limit:c,maxDropdownHeight:u,withScrollArea:f=!0,filterOptions:h=!0,withCheckIcon:p=!1,value:g,checkIconPosition:v,nothingFoundMessage:x,unstyled:S,labelId:E,renderOption:C,scrollAreaProps:R,"aria-label":T}){iw(e);const A=typeof l=="string"?(a||aw)({options:e,search:h?l:"",limit:c??1/0}):e,N=yA(A),B=A.map(M=>y.jsx(lw,{data:M,withCheckIcon:p,value:g,checkIconPosition:v,unstyled:S,renderOption:C},hs(M)?M.group:M.value));return y.jsx(Pe.Dropdown,{hidden:o||r&&N,"data-composed":!0,children:y.jsxs(Pe.Options,{labelledBy:E,"aria-label":T,children:[f?y.jsx(Aa.Autosize,{mah:u??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...R,children:B}):B,N&&x&&y.jsx(Pe.Empty,{children:x})]})})}var el={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const h1={orientation:"horizontal"},SA=(e,{borderWidth:o})=>({group:{"--button-border-width":oe(o)}}),Fm=ge((e,o)=>{const r=ce("ButtonGroup",h1,e),{className:a,style:l,classNames:c,styles:u,unstyled:f,orientation:h,vars:p,borderWidth:g,variant:v,mod:x,...S}=ce("ButtonGroup",h1,e),E=_e({name:"ButtonGroup",props:r,classes:el,className:a,style:l,classNames:c,styles:u,unstyled:f,vars:p,varsResolver:SA,rootSelector:"group"});return y.jsx(he,{...E("group"),ref:o,variant:v,mod:[{"data-orientation":h},x],role:"group",...S})});Fm.classes=el;Fm.displayName="@mantine/core/ButtonGroup";const p1={},wA=(e,{radius:o,color:r,gradient:a,variant:l,autoContrast:c,size:u})=>{const f=e.variantColorResolver({color:r||e.primaryColor,theme:e,gradient:a,variant:l||"filled",autoContrast:c});return{groupSection:{"--section-height":qe(u,"section-height"),"--section-padding-x":qe(u,"section-padding-x"),"--section-fz":u?.includes("compact")?nn(u.replace("compact-","")):nn(u),"--section-radius":o===void 0?void 0:kt(o),"--section-bg":r||l?f.background:void 0,"--section-color":f.color,"--section-bd":r||l?f.border:void 0}}},Zm=ge((e,o)=>{const r=ce("ButtonGroupSection",p1,e),{className:a,style:l,classNames:c,styles:u,unstyled:f,vars:h,variant:p,gradient:g,radius:v,autoContrast:x,...S}=ce("ButtonGroupSection",p1,e),E=_e({name:"ButtonGroupSection",props:r,classes:el,className:a,style:l,classNames:c,styles:u,unstyled:f,vars:h,varsResolver:wA,rootSelector:"groupSection"});return y.jsx(he,{...E("groupSection"),ref:o,variant:p,...S})});Zm.classes=el;Zm.displayName="@mantine/core/ButtonGroupSection";const CA={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${oe(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},EA={},RA=(e,{radius:o,color:r,gradient:a,variant:l,size:c,justify:u,autoContrast:f})=>{const h=e.variantColorResolver({color:r||e.primaryColor,theme:e,gradient:a,variant:l||"filled",autoContrast:f});return{root:{"--button-justify":u,"--button-height":qe(c,"button-height"),"--button-padding-x":qe(c,"button-padding-x"),"--button-fz":c?.includes("compact")?nn(c.replace("compact-","")):nn(c),"--button-radius":o===void 0?void 0:kt(o),"--button-bg":r||l?h.background:void 0,"--button-hover":r||l?h.hover:void 0,"--button-color":h.color,"--button-bd":r||l?h.border:void 0,"--button-hover-color":r||l?h.hoverColor:void 0}}},Dt=un((e,o)=>{const r=ce("Button",EA,e),{style:a,vars:l,className:c,color:u,disabled:f,children:h,leftSection:p,rightSection:g,fullWidth:v,variant:x,radius:S,loading:E,loaderProps:C,gradient:R,classNames:T,styles:z,unstyled:A,"data-disabled":N,autoContrast:B,mod:M,...$}=r,L=_e({name:"Button",props:r,classes:el,className:c,style:a,classNames:T,styles:z,unstyled:A,vars:l,varsResolver:RA}),H=!!p,I=!!g;return y.jsxs($n,{ref:o,...L("root",{active:!f&&!E&&!N}),unstyled:A,variant:x,disabled:f||E,mod:[{disabled:f||N,loading:E,block:v,"with-left-section":H,"with-right-section":I},M],...$,children:[y.jsx(qr,{mounted:!!E,transition:CA,duration:150,children:Y=>y.jsx(he,{component:"span",...L("loader",{style:Y}),"aria-hidden":!0,children:y.jsx(Ma,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...C})})}),y.jsxs("span",{...L("inner"),children:[p&&y.jsx(he,{component:"span",...L("section"),mod:{position:"left"},children:p}),y.jsx(he,{component:"span",mod:{loading:E},...L("label"),children:h}),g&&y.jsx(he,{component:"span",...L("section"),mod:{position:"right"},children:g})]})]})});Dt.classes=el;Dt.displayName="@mantine/core/Button";Dt.Group=Fm;Dt.GroupSection=Zm;const[TA,_A]=zo("Card component was not found in tree");var Qm={root:"m_e615b15f",section:"m_599a2148"};const DA={},Fu=un((e,o)=>{const r=ce("CardSection",DA,e),{classNames:a,className:l,style:c,styles:u,vars:f,withBorder:h,inheritPadding:p,mod:g,...v}=r,x=_A();return y.jsx(he,{ref:o,mod:[{"with-border":h,"inherit-padding":p},g],...x.getStyles("section",{className:l,style:c,styles:u,classNames:a}),...v})});Fu.classes=Qm;Fu.displayName="@mantine/core/CardSection";const NA={},AA=(e,{padding:o})=>({root:{"--card-padding":sn(o)}}),Zu=un((e,o)=>{const r=ce("Card",NA,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,children:p,padding:g,...v}=r,x=_e({name:"Card",props:r,classes:Qm,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:AA}),S=b.Children.toArray(p),E=S.map((C,R)=>typeof C=="object"&&C&&"type"in C&&C.type===Fu?b.cloneElement(C,{"data-first-section":R===0||void 0,"data-last-section":R===S.length-1||void 0}):C);return y.jsx(TA,{value:{getStyles:x},children:y.jsx(Zi,{ref:o,unstyled:f,...x("root"),...v,children:E})})});Zu.classes=Qm;Zu.displayName="@mantine/core/Card";Zu.Section=Fu;var sw={root:"m_4451eb3a"};const zA={},ps=un((e,o)=>{const r=ce("Center",zA,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,inline:p,mod:g,...v}=r,x=_e({name:"Center",props:r,classes:sw,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h});return y.jsx(he,{ref:o,mod:[{inline:p},g],...x("root"),...v})});ps.classes=sw;ps.displayName="@mantine/core/Center";var cw={root:"m_3eebeb36",label:"m_9e365f20"};const MA={orientation:"horizontal"},OA=(e,{color:o,variant:r,size:a})=>({root:{"--divider-color":o?Zt(o,e):void 0,"--divider-border-style":r,"--divider-size":qe(a,"divider-size")}}),Su=ge((e,o)=>{const r=ce("Divider",MA,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,color:p,orientation:g,label:v,labelPosition:x,mod:S,...E}=r,C=_e({name:"Divider",classes:cw,props:r,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:OA});return y.jsx(he,{ref:o,mod:[{orientation:g,"with-label":!!v},S],...C("root"),...E,role:"separator",children:v&&y.jsx(he,{component:"span",mod:{position:x},...C("label"),children:v})})});Su.classes=cw;Su.displayName="@mantine/core/Divider";function uw({open:e,close:o,openDelay:r,closeDelay:a}){const l=b.useRef(-1),c=b.useRef(-1),u=()=>{window.clearTimeout(l.current),window.clearTimeout(c.current)},f=()=>{u(),r===0||r===void 0?e():l.current=window.setTimeout(e,r)},h=()=>{u(),a===0||a===void 0?o():c.current=window.setTimeout(o,a)};return b.useEffect(()=>u,[]),{openDropdown:f,closeDropdown:h}}var fw={root:"m_9e117634"};const jA={},BA=(e,{radius:o,fit:r})=>({root:{"--image-radius":o===void 0?void 0:kt(o),"--image-object-fit":r}}),Km=un((e,o)=>{const r=ce("Image",jA,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,onError:p,src:g,radius:v,fit:x,fallbackSrc:S,mod:E,...C}=r,[R,T]=b.useState(!g);b.useEffect(()=>T(!g),[g]);const z=_e({name:"Image",classes:fw,props:r,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:BA});return R&&S?y.jsx(he,{component:"img",ref:o,src:S,...z("root"),onError:p,mod:["fallback",E],...C}):y.jsx(he,{component:"img",ref:o,...z("root"),src:g,onError:A=>{p?.(A),T(!0)},mod:E,...C})});Km.classes=fw;Km.displayName="@mantine/core/Image";function Tp(){return Tp=Object.assign?Object.assign.bind():function(e){for(var o=1;o{const{classNames:r,className:a,style:l,styles:c,vars:u,...f}=ce("MenuDivider",LA,e),h=Fr();return y.jsx(he,{ref:o,...h.getStyles("divider",{className:a,style:l,styles:c,classNames:r}),...f})});Wm.classes=Zr;Wm.displayName="@mantine/core/MenuDivider";const kA={},Jm=ge((e,o)=>{const{classNames:r,className:a,style:l,styles:c,vars:u,onMouseEnter:f,onMouseLeave:h,onKeyDown:p,children:g,...v}=ce("MenuDropdown",kA,e),x=b.useRef(null),S=Fr(),E=Cn(p,T=>{(T.key==="ArrowUp"||T.key==="ArrowDown")&&(T.preventDefault(),x.current?.querySelectorAll("[data-menu-item]:not(:disabled)")[0]?.focus())}),C=Cn(f,()=>(S.trigger==="hover"||S.trigger==="click-hover")&&S.openDropdown()),R=Cn(h,()=>(S.trigger==="hover"||S.trigger==="click-hover")&&S.closeDropdown());return y.jsxs(Rn.Dropdown,{...v,onMouseEnter:C,onMouseLeave:R,role:"menu","aria-orientation":"vertical",ref:Mt(o,x),...S.getStyles("dropdown",{className:a,style:l,styles:c,classNames:r,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:E,children:[S.withInitialFocusPlaceholder&&y.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),g]})});Jm.classes=Zr;Jm.displayName="@mantine/core/MenuDropdown";const[HA,Qu]=Ss(),UA={},eg=un((e,o)=>{const{classNames:r,className:a,style:l,styles:c,vars:u,color:f,closeMenuOnClick:h,leftSection:p,rightSection:g,children:v,disabled:x,"data-disabled":S,...E}=ce("MenuItem",UA,e),C=Fr(),R=Qu(),T=cn(),{dir:z}=qi(),A=b.useRef(null),N=E,B=Cn(N.onClick,()=>{S||(typeof h=="boolean"?h&&C.closeDropdownImmediately():C.closeOnItemClick&&C.closeDropdownImmediately())}),M=f?T.variantColorResolver({color:f,theme:T,variant:"light"}):void 0,$=f?lr({color:f,theme:T}):null,L=Cn(N.onKeyDown,H=>{H.key==="ArrowLeft"&&R&&(R.close(),R.focusParentItem())});return y.jsxs($n,{onMouseDown:H=>H.preventDefault(),...E,unstyled:C.unstyled,tabIndex:C.menuItemTabIndex,...C.getStyles("item",{className:a,style:l,styles:c,classNames:r}),ref:Mt(A,o),role:"menuitem",disabled:x,"data-menu-item":!0,"data-disabled":x||S||void 0,"data-mantine-stop-propagation":!0,onClick:B,onKeyDown:vx({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:C.loop,dir:z,orientation:"vertical",onKeyDown:L}),__vars:{"--menu-item-color":$?.isThemeColor&&$?.shade===void 0?`var(--mantine-color-${$.color}-6)`:M?.color,"--menu-item-hover":M?.hover},children:[p&&y.jsx("div",{...C.getStyles("itemSection",{styles:c,classNames:r}),"data-position":"left",children:p}),v&&y.jsx("div",{...C.getStyles("itemLabel",{styles:c,classNames:r}),children:v}),g&&y.jsx("div",{...C.getStyles("itemSection",{styles:c,classNames:r}),"data-position":"right",children:g})]})});eg.classes=Zr;eg.displayName="@mantine/core/MenuItem";const PA={},tg=ge((e,o)=>{const{classNames:r,className:a,style:l,styles:c,vars:u,...f}=ce("MenuLabel",PA,e),h=Fr();return y.jsx(he,{ref:o,...h.getStyles("label",{className:a,style:l,styles:c,classNames:r}),...f})});tg.classes=Zr;tg.displayName="@mantine/core/MenuLabel";const VA={},ng=ge((e,o)=>{const{classNames:r,className:a,style:l,styles:c,vars:u,onMouseEnter:f,onMouseLeave:h,onKeyDown:p,children:g,...v}=ce("MenuSubDropdown",VA,e),x=b.useRef(null),S=Fr(),E=Qu(),C=Cn(f,E?.open),R=Cn(h,E?.close);return y.jsx(Rn.Dropdown,{...v,onMouseEnter:C,onMouseLeave:R,role:"menu","aria-orientation":"vertical",ref:Mt(o,x),...S.getStyles("dropdown",{className:a,style:l,styles:c,classNames:r,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,children:g})});ng.classes=Zr;ng.displayName="@mantine/core/MenuSubDropdown";const YA={},og=un((e,o)=>{const{classNames:r,className:a,style:l,styles:c,vars:u,color:f,leftSection:h,rightSection:p,children:g,disabled:v,"data-disabled":x,closeMenuOnClick:S,...E}=ce("MenuSubItem",YA,e),C=Fr(),R=Qu(),T=cn(),{dir:z}=qi(),A=b.useRef(null),N=E,B=f?T.variantColorResolver({color:f,theme:T,variant:"light"}):void 0,M=f?lr({color:f,theme:T}):null,$=Cn(N.onKeyDown,Y=>{Y.key==="ArrowRight"&&(R?.open(),R?.focusFirstItem()),Y.key==="ArrowLeft"&&R?.parentContext&&(R.parentContext.close(),R.parentContext.focusParentItem())}),L=Cn(N.onClick,()=>{!x&&S&&C.closeDropdownImmediately()}),H=Cn(N.onMouseEnter,R?.open),I=Cn(N.onMouseLeave,R?.close);return y.jsxs($n,{onMouseDown:Y=>Y.preventDefault(),...E,unstyled:C.unstyled,tabIndex:C.menuItemTabIndex,...C.getStyles("item",{className:a,style:l,styles:c,classNames:r}),ref:Mt(A,o),role:"menuitem",disabled:v,"data-menu-item":!0,"data-sub-menu-item":!0,"data-disabled":v||x||void 0,"data-mantine-stop-propagation":!0,onMouseEnter:H,onMouseLeave:I,onClick:L,onKeyDown:vx({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:C.loop,dir:z,orientation:"vertical",onKeyDown:$}),__vars:{"--menu-item-color":M?.isThemeColor&&M?.shade===void 0?`var(--mantine-color-${M.color}-6)`:B?.color,"--menu-item-hover":B?.hover},children:[h&&y.jsx("div",{...C.getStyles("itemSection",{styles:c,classNames:r}),"data-position":"left",children:h}),g&&y.jsx("div",{...C.getStyles("itemLabel",{styles:c,classNames:r}),children:g}),y.jsx("div",{...C.getStyles("itemSection",{styles:c,classNames:r}),"data-position":"right",children:p||y.jsx(HS,{...C.getStyles("chevron"),size:14})})]})});og.classes=Zr;og.displayName="@mantine/core/MenuSubItem";function hw({children:e,refProp:o}){if(!ar(e))throw new Error("Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return Fr(),y.jsx(Rn.Target,{refProp:o,popupType:"menu",children:e})}hw.displayName="@mantine/core/MenuSubTarget";const GA={offset:0,position:"right-start",transitionProps:{duration:0}};function tl(e){const{children:o,closeDelay:r,...a}=ce("MenuSub",GA,e),l=Jn(),[c,{open:u,close:f}]=iT(!1),h=Qu(),{openDropdown:p,closeDropdown:g}=uw({open:u,close:f,closeDelay:r,openDelay:0}),v=()=>window.setTimeout(()=>{document.getElementById(`${l}-dropdown`)?.querySelectorAll("[data-menu-item]:not([data-disabled])")[0]?.focus()},16),x=()=>window.setTimeout(()=>{document.getElementById(`${l}-target`)?.focus()},16);return y.jsx(HA,{value:{opened:c,close:g,open:p,focusFirstItem:v,focusParentItem:x,parentContext:h},children:y.jsx(Rn,{opened:c,...a,withinPortal:!1,id:l,children:o})})}tl.extend=e=>e;tl.displayName="@mantine/core/MenuSub";tl.Target=hw;tl.Dropdown=ng;tl.Item=og;const XA={refProp:"ref"},pw=b.forwardRef((e,o)=>{const{children:r,refProp:a,...l}=ce("MenuTarget",XA,e);if(!ar(r))throw new Error("Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const c=Fr(),u=r.props,f=Cn(u.onClick,()=>{c.trigger==="click"?c.toggleDropdown():c.trigger==="click-hover"&&(c.setOpenedViaClick(!0),c.opened||c.openDropdown())}),h=Cn(u.onMouseEnter,()=>(c.trigger==="hover"||c.trigger==="click-hover")&&c.openDropdown()),p=Cn(u.onMouseLeave,()=>{(c.trigger==="hover"||c.trigger==="click-hover"&&!c.openedViaClick)&&c.closeDropdown()});return y.jsx(Rn.Target,{refProp:a,popupType:"menu",ref:o,...l,children:b.cloneElement(r,{onClick:f,onMouseEnter:h,onMouseLeave:p,"data-expanded":c.opened?!0:void 0})})});pw.displayName="@mantine/core/MenuTarget";const qA={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function Nt(e){const o=ce("Menu",qA,e),{children:r,onOpen:a,onClose:l,opened:c,defaultOpened:u,trapFocus:f,onChange:h,closeOnItemClick:p,loop:g,closeOnEscape:v,trigger:x,openDelay:S,closeDelay:E,classNames:C,styles:R,unstyled:T,variant:z,vars:A,menuItemTabIndex:N,keepMounted:B,withInitialFocusPlaceholder:M,...$}=o,L=_e({name:"Menu",classes:Zr,props:o,classNames:C,styles:R,unstyled:T}),[H,I]=Wn({value:c,defaultValue:u,finalValue:!1,onChange:h}),[Y,X]=b.useState(!1),ee=()=>{I(!1),X(!1),H&&l?.()},ne=()=>{I(!0),!H&&a?.()},re=()=>{H?ee():ne()},{openDropdown:j,closeDropdown:k}=uw({open:ne,close:ee,closeDelay:E,openDelay:S}),V=D=>VR("[data-menu-item]","[data-menu-dropdown]",D),{resolvedClassNames:P,resolvedStyles:Z}=Gi({classNames:C,styles:R,props:o});return y.jsx($A,{value:{getStyles:L,opened:H,toggleDropdown:re,getItemIndex:V,openedViaClick:Y,setOpenedViaClick:X,closeOnItemClick:p,closeDropdown:x==="click"?ee:k,openDropdown:x==="click"?ne:j,closeDropdownImmediately:ee,loop:g,trigger:x,unstyled:T,menuItemTabIndex:N,withInitialFocusPlaceholder:M},children:y.jsx(Rn,{...$,opened:H,onChange:re,defaultOpened:u,trapFocus:B?!1:f,closeOnEscape:v,__staticSelector:"Menu",classNames:P,styles:Z,unstyled:T,variant:z,keepMounted:B,children:r})})}Nt.extend=e=>e;Nt.withProps=S_(Nt);Nt.classes=Zr;Nt.displayName="@mantine/core/Menu";Nt.Item=eg;Nt.Label=tg;Nt.Dropdown=Jm;Nt.Target=pw;Nt.Divider=Wm;Nt.Sub=tl;const[IA,nl]=zo("Modal component was not found in tree");var ur={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const FA={},Ku=ge((e,o)=>{const r=ce("ModalBody",FA,e),{classNames:a,className:l,style:c,styles:u,vars:f,...h}=r,p=nl();return y.jsx(zS,{ref:o,...p.getStyles("body",{classNames:a,style:c,styles:u,className:l}),...h})});Ku.classes=ur;Ku.displayName="@mantine/core/ModalBody";const ZA={},Wu=ge((e,o)=>{const r=ce("ModalCloseButton",ZA,e),{classNames:a,className:l,style:c,styles:u,vars:f,...h}=r,p=nl();return y.jsx(MS,{ref:o,...p.getStyles("close",{classNames:a,style:c,styles:u,className:l}),...h})});Wu.classes=ur;Wu.displayName="@mantine/core/ModalCloseButton";const QA={},Ju=ge((e,o)=>{const r=ce("ModalContent",QA,e),{classNames:a,className:l,style:c,styles:u,vars:f,children:h,__hidden:p,...g}=r,v=nl(),x=v.scrollAreaComponent||JN;return y.jsx(OS,{...v.getStyles("content",{className:l,style:c,styles:u,classNames:a}),innerProps:v.getStyles("inner",{className:l,style:c,styles:u,classNames:a}),"data-full-screen":v.fullScreen||void 0,"data-modal-content":!0,"data-hidden":p||void 0,ref:o,...g,children:y.jsx(x,{style:{maxHeight:v.fullScreen?"100dvh":`calc(100dvh - (${oe(v.yOffset)} * 2))`},children:h})})});Ju.classes=ur;Ju.displayName="@mantine/core/ModalContent";const KA={},ef=ge((e,o)=>{const r=ce("ModalHeader",KA,e),{classNames:a,className:l,style:c,styles:u,vars:f,...h}=r,p=nl();return y.jsx(jS,{ref:o,...p.getStyles("header",{classNames:a,style:c,styles:u,className:l}),...h})});ef.classes=ur;ef.displayName="@mantine/core/ModalHeader";const WA={},tf=ge((e,o)=>{const r=ce("ModalOverlay",WA,e),{classNames:a,className:l,style:c,styles:u,vars:f,...h}=r,p=nl();return y.jsx(BS,{ref:o,...p.getStyles("overlay",{classNames:a,style:c,styles:u,className:l}),...h})});tf.classes=ur;tf.displayName="@mantine/core/ModalOverlay";const JA={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:vo("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},ez=(e,{radius:o,size:r,yOffset:a,xOffset:l})=>({root:{"--modal-radius":o===void 0?void 0:kt(o),"--modal-size":qe(r,"modal-size"),"--modal-y-offset":oe(a),"--modal-x-offset":oe(l)}}),nf=ge((e,o)=>{const r=ce("ModalRoot",JA,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,yOffset:p,scrollAreaComponent:g,radius:v,fullScreen:x,centered:S,xOffset:E,__staticSelector:C,...R}=r,T=_e({name:C,classes:ur,props:r,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:ez});return y.jsx(IA,{value:{yOffset:p,scrollAreaComponent:g,getStyles:T,fullScreen:x},children:y.jsx(AS,{ref:o,...T("root"),"data-full-screen":x||void 0,"data-centered":S||void 0,"data-offset-scrollbars":g===Aa.Autosize||void 0,unstyled:f,...R})})});nf.classes=ur;nf.displayName="@mantine/core/ModalRoot";const[tz,nz]=Ss();function mw({children:e}){const[o,r]=b.useState([]),[a,l]=b.useState(vo("modal"));return y.jsx(tz,{value:{stack:o,addModal:(c,u)=>{r(f=>[...new Set([...f,c])]),l(f=>typeof u=="number"&&typeof f=="number"?Math.max(f,u):f)},removeModal:c=>r(u=>u.filter(f=>f!==c)),getZIndex:c=>`calc(${a} + ${o.indexOf(c)} + 1)`,currentId:o[o.length-1],maxZIndex:a},children:e})}mw.displayName="@mantine/core/ModalStack";const oz={},of=ge((e,o)=>{const r=ce("ModalTitle",oz,e),{classNames:a,className:l,style:c,styles:u,vars:f,...h}=r,p=nl();return y.jsx($S,{ref:o,...p.getStyles("title",{classNames:a,style:c,styles:u,className:l}),...h})});of.classes=ur;of.displayName="@mantine/core/ModalTitle";const rz={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:vo("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},Tn=ge((e,o)=>{const{title:r,withOverlay:a,overlayProps:l,withCloseButton:c,closeButtonProps:u,children:f,radius:h,opened:p,stackId:g,zIndex:v,...x}=ce("Modal",rz,e),S=nz(),E=!!r||c,C=S&&g?{closeOnEscape:S.currentId===g,trapFocus:S.currentId===g,zIndex:S.getZIndex(g)}:{},R=a===!1?!1:g&&S?S.currentId===g:p;return b.useEffect(()=>{S&&g&&(p?S.addModal(g,v||vo("modal")):S.removeModal(g))},[p,g,v]),y.jsxs(nf,{ref:o,radius:h,opened:p,zIndex:S&&g?S.getZIndex(g):v,...x,...C,children:[a&&y.jsx(tf,{visible:R,transitionProps:S&&g?{duration:0}:void 0,...l}),y.jsxs(Ju,{radius:h,__hidden:S&&g&&p?g!==S.currentId:!1,children:[E&&y.jsxs(ef,{children:[r&&y.jsx(of,{children:r}),c&&y.jsx(Wu,{...u})]}),y.jsx(Ku,{children:f})]})]})});Tn.classes=ur;Tn.displayName="@mantine/core/Modal";Tn.Root=nf;Tn.Overlay=tf;Tn.Content=Ju;Tn.Body=Ku;Tn.Header=ef;Tn.Title=of;Tn.CloseButton=Wu;Tn.Stack=mw;var gw={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const az={withCloseButton:!0},iz=(e,{radius:o,color:r})=>({root:{"--notification-radius":o===void 0?void 0:kt(o),"--notification-color":r?Zt(r,e):void 0}}),rg=ge((e,o)=>{const r=ce("Notification",az,e),{className:a,color:l,radius:c,loading:u,withCloseButton:f,withBorder:h,title:p,icon:g,children:v,onClose:x,closeButtonProps:S,classNames:E,style:C,styles:R,unstyled:T,variant:z,vars:A,mod:N,loaderProps:B,role:M,...$}=r,L=_e({name:"Notification",classes:gw,props:r,className:a,style:C,classNames:E,styles:R,unstyled:T,vars:A,varsResolver:iz});return y.jsxs(he,{...L("root"),mod:[{"data-with-icon":!!g||u,"data-with-border":h},N],ref:o,variant:z,role:M||"alert",...$,children:[g&&!u&&y.jsx("div",{...L("icon"),children:g}),u&&y.jsx(Ma,{size:28,color:l,...B,...L("loader")}),y.jsxs("div",{...L("body"),children:[p&&y.jsx("div",{...L("title"),children:p}),y.jsx(he,{...L("description"),mod:{"data-with-title":!!p},children:v})]}),f&&y.jsx(Ki,{iconSize:16,color:"gray",...S,unstyled:T,onClick:x,...L("closeButton")})]})});rg.classes=gw;rg.displayName="@mantine/core/Notification";function vw(e,o){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&o.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(e);l=f?l=l+g1("0",u-f):l=(l.substring(0,u)||"0")+"."+l.substring(u),r+l}function v1(e,o,r){if(["","-"].indexOf(e)!==-1)return e;var a=(e.indexOf(".")!==-1||r)&&o,l=ag(e),c=l.beforeDecimal,u=l.afterDecimal,f=l.hasNegation,h=parseFloat("0."+(u||"0")),p=u.length<=o?"0."+u:h.toFixed(o),g=p.split("."),v=c;c&&Number(g[0])&&(v=c.split("").reverse().reduce(function(C,R,T){return C.length>T?(Number(C[0])+Number(R)).toString()+C.substring(1,C.length):R+C},g[0]));var x=xw(g[1]||"",o,r),S=f?"-":"",E=a?".":"";return""+S+v+E+x}function xa(e,o){if(e.value=e.value,e!==null){if(e.createTextRange){var r=e.createTextRange();return r.move("character",o),r.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(o,o),!0):(e.focus(),!1)}}var ww=lz(function(e,o){for(var r=0,a=0,l=e.length,c=o.length;e[r]===o[r]&&rr&&l-a>r;)a++;return{from:{start:r,end:l-a},to:{start:r,end:c-a}}}),dz=function(e,o){var r=Math.min(e.selectionStart,o);return{from:{start:r,end:e.selectionEnd},to:{start:r,end:o}}};function hz(e,o,r){return Math.min(Math.max(e,o),r)}function Fh(e){return Math.max(e.selectionStart,e.selectionEnd)}function pz(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function mz(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function gz(e){var o=e.currentValue,r=e.formattedValue,a=e.currentValueIndex,l=e.formattedValueIndex;return o[a]===r[l]}function vz(e,o,r,a,l,c,u){u===void 0&&(u=gz);var f=l.findIndex(function(N){return N}),h=e.slice(0,f);!o&&!r.startsWith(h)&&(o=h,r=h+r,a=a+h.length);for(var p=r.length,g=e.length,v={},x=new Array(p),S=0;S0&&x[T]===-1;)T--;var A=T===-1||x[T]===-1?0:x[T]+1;return A>z?z:a-A=0&&!r[o];)o--;o===-1&&(o=r.indexOf(!0))}else{for(;o<=l&&!r[o];)o++;o>l&&(o=r.lastIndexOf(!0))}return o===-1&&(o=l),o}function yz(e){for(var o=Array.from({length:e.length+1}).map(function(){return!0}),r=0,a=o.length;r$.length-u.length||MY||v>e.length-u.length)&&(I=v),e=e.substring(0,I),e=wz(A?"-"+e:e,l),e=(e.match(Cz(E))||[]).join("");var X=e.indexOf(E);e=e.replace(new RegExp(bw(E),"g"),function(k,V){return V===X?".":""});var ee=ag(e,l),ne=ee.beforeDecimal,re=ee.afterDecimal,j=ee.addNegation;return p.end-p.startD?!1:Z>=ie.start&&Z=o,l=r===void 0||e<=r;return a&&l}const jz={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0},Bz=(e,{size:o})=>({controls:{"--ni-chevron-size":Xe(o,"ni-chevron-size")}});function $z(e,o,r){const a=e.toString().replace(/^0+/,""),l=parseFloat(a);return Number.isNaN(l)?a:l>Number.MAX_SAFE_INTEGER?o!==void 0?String(o):a:lu(l,r,o)}const Ca=ge((e,o)=>{const r=ce("NumberInput",jz,e),{className:a,classNames:l,styles:c,unstyled:u,vars:f,onChange:h,onValueChange:p,value:g,defaultValue:v,max:x,min:S,step:E,hideControls:C,rightSection:R,isAllowed:T,clampBehavior:z,onBlur:A,allowDecimal:N,decimalScale:B,onKeyDown:M,onKeyDownCapture:$,handlersRef:L,startValue:H,disabled:I,rightSectionPointerEvents:Y,allowNegative:X,readOnly:ee,size:ne,rightSectionWidth:re,stepHoldInterval:j,stepHoldDelay:k,allowLeadingZeros:V,withKeyboardEvents:P,trimLeadingZeroesOnBlur:Z,...D}=r,O=_e({name:"NumberInput",classes:_p,props:r,classNames:l,styles:c,unstyled:u,vars:f,varsResolver:Bz}),{resolvedClassNames:q,resolvedStyles:W}=Xi({classNames:l,styles:c,props:r}),[ie,ue]=Wn({value:g,defaultValue:v,finalValue:"",onChange:h}),ve=k!==void 0&&j!==void 0,fe=b.useRef(null),be=b.useRef(null),ye=b.useRef(0),Ge=(de,Re)=>{Re.source==="event"&&ue(Oz(de.floatValue,de.value)&&!Az.test(de.value)&&!(V&&zz.test(de.value))?de.floatValue:de.value),p?.(de,Re)},Ne=de=>{const Re=String(de).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return Re?Math.max(0,(Re[1]?Re[1].length:0)-(Re[2]?+Re[2]:0)):0},Ke=de=>{fe.current&&typeof de<"u"&&fe.current.setSelectionRange(de,de)},Be=b.useRef(hp);Be.current=()=>{if(!Zh(ie))return;let de;const Re=Ne(ie),dt=Ne(E),nt=Math.max(Re,dt),yt=10**nt;if(!Dp(ie)&&(typeof ie!="number"||Number.isNaN(ie)))de=lu(H,S,x);else if(x!==void 0){const wt=(Math.round(Number(ie)*yt)+Math.round(E*yt))/yt;de=wt<=x?wt:x}else de=(Math.round(Number(ie)*yt)+Math.round(E*yt))/yt;const We=de.toFixed(nt);ue(parseFloat(We)),p?.({floatValue:parseFloat(We),formattedValue:We,value:We},{source:"increment"}),setTimeout(()=>Ke(fe.current?.value.length),0)};const tt=b.useRef(hp);tt.current=()=>{if(!Zh(ie))return;let de;const Re=S!==void 0?S:X?Number.MIN_SAFE_INTEGER:0,dt=Ne(ie),nt=Ne(E),yt=Math.max(dt,nt),We=10**yt;if(!Dp(ie)&&typeof ie!="number"||Number.isNaN(ie))de=lu(H,Re,x);else{const on=(Math.round(Number(ie)*We)-Math.round(E*We))/We;de=Re!==void 0&&onKe(fe.current?.value.length),0)};const vt=de=>{M?.(de),!(ee||!P)&&(de.key==="ArrowUp"&&(de.preventDefault(),Be.current()),de.key==="ArrowDown"&&(de.preventDefault(),tt.current()))},pe=de=>{if($?.(de),de.key==="Backspace"){const Re=fe.current;Re.selectionStart===0&&Re.selectionStart===Re.selectionEnd&&(de.preventDefault(),window.setTimeout(()=>Ke(0),0))}},me=de=>{let Re=ie;z==="blur"&&typeof Re=="number"&&(Re=lu(Re,S,x)),Z&&typeof Re=="string"&&Ne(Re)<15&&(Re=$z(Re,x,S)),ie!==Re&&ue(Re),A?.(de)};mu(L,{increment:Be.current,decrement:tt.current});const we=de=>{de?Be.current():tt.current(),ye.current+=1},De=de=>{if(we(de),ve){const Re=typeof j=="number"?j:j(ye.current);be.current=window.setTimeout(()=>De(de),Re)}},Ae=(de,Re)=>{de.preventDefault(),fe.current?.focus(),we(Re),ve&&(be.current=window.setTimeout(()=>De(Re),k))},xe=()=>{be.current&&window.clearTimeout(be.current),be.current=null,ye.current=0},$e=y.jsxs("div",{...O("controls"),children:[y.jsx($n,{...O("control"),tabIndex:-1,"aria-hidden":!0,disabled:I||typeof ie=="number"&&x!==void 0&&ie>=x,mod:{direction:"up"},onMouseDown:de=>de.preventDefault(),onPointerDown:de=>{Ae(de,!0)},onPointerUp:xe,onPointerLeave:xe,children:y.jsx(b1,{direction:"up"})}),y.jsx($n,{...O("control"),tabIndex:-1,"aria-hidden":!0,disabled:I||typeof ie=="number"&&S!==void 0&&ie<=S,mod:{direction:"down"},onMouseDown:de=>de.preventDefault(),onPointerDown:de=>{Ae(de,!1)},onPointerUp:xe,onPointerLeave:xe,children:y.jsx(b1,{direction:"down"})})]});return y.jsx(cr,{component:Nz,allowNegative:X,className:zt(_p.root,a),size:ne,...D,readOnly:ee,disabled:I,value:ie,getInputRef:Mt(o,fe),onValueChange:Ge,rightSection:C||ee||!Zh(ie)?R:R||$e,classNames:q,styles:W,unstyled:u,__staticSelector:"NumberInput",decimalScale:N?B:0,onKeyDown:vt,onKeyDownCapture:pe,rightSectionPointerEvents:Y??(I?"none":void 0),rightSectionWidth:re??`var(--ni-right-section-width-${ne||"sm"})`,allowLeadingZeros:V,onBlur:me,isAllowed:de=>z==="strict"?T?T(de)&&x1(de.floatValue,S,x):x1(de.floatValue,S,x):T?T(de):!0})});Ca.classes={...cr.classes,..._p};Ca.displayName="@mantine/core/NumberInput";const Lz=({reveal:e})=>y.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{width:"var(--psi-icon-size)",height:"var(--psi-icon-size)"},children:y.jsx("path",{d:e?"M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L10.6828 3.61012C9.70652 3.21671 8.63759 3 7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C0.902945 9.08812 2.02314 10.1861 3.36061 10.9323L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L4.31723 11.3899C5.29348 11.7833 6.36241 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C14.0971 5.9119 12.9769 4.81391 11.6394 4.06771L13.3536 2.35355ZM9.90428 4.38861C9.15332 4.1361 8.34759 4 7.5 4C4.80285 4 2.52952 5.37816 1.09622 7.50001C1.87284 8.6497 2.89609 9.58106 4.09974 10.1931L9.90428 4.38861ZM5.09572 10.6114L10.9003 4.80685C12.1039 5.41894 13.1272 6.35031 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11C6.65241 11 5.84668 10.8639 5.09572 10.6114Z":"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})});var Np={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const kz={visibilityToggleIcon:Lz},Hz=(e,{size:o})=>({root:{"--psi-icon-size":Xe(o,"psi-icon-size"),"--psi-button-size":Xe(o,"psi-button-size")}}),af=ge((e,o)=>{const r=ce("PasswordInput",kz,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,required:p,error:g,leftSection:v,disabled:x,id:S,variant:E,inputContainer:C,description:R,label:T,size:z,errorProps:A,descriptionProps:N,labelProps:B,withAsterisk:M,inputWrapperOrder:$,wrapperProps:L,radius:H,rightSection:I,rightSectionWidth:Y,rightSectionPointerEvents:X,leftSectionWidth:ee,visible:ne,defaultVisible:re,onVisibilityChange:j,visibilityToggleIcon:k,visibilityToggleButtonProps:V,rightSectionProps:P,leftSectionProps:Z,leftSectionPointerEvents:D,withErrorStyles:O,mod:q,...W}=r,ie=Jn(S),[ue,ve]=Wn({value:ne,defaultValue:re,finalValue:!1,onChange:j}),fe=()=>ve(!ue),be=_e({name:"PasswordInput",classes:Np,props:r,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:Hz}),{resolvedClassNames:ye,resolvedStyles:Ge}=Xi({classNames:a,styles:u,props:r}),{styleProps:Ne,rest:Ke}=qi(W),Be=k,tt=A?.id||`${ie}-error`,vt=N?.id||`${ie}-description`,we=`${!!g&&typeof g!="boolean"?tt:""} ${!!R?vt:""}`,De=we.trim().length>0?we.trim():void 0,Ae=y.jsx(Yt,{...be("visibilityToggle"),disabled:x,radius:H,"aria-hidden":!V,tabIndex:-1,...V,variant:V?.variant??"subtle",color:"gray",unstyled:f,onTouchEnd:xe=>{xe.preventDefault(),V?.onTouchEnd?.(xe),fe()},onMouseDown:xe=>{xe.preventDefault(),V?.onMouseDown?.(xe),fe()},onKeyDown:xe=>{V?.onKeyDown?.(xe),xe.key===" "&&(xe.preventDefault(),fe())},children:y.jsx(Be,{reveal:ue})});return y.jsx(St.Wrapper,{required:p,id:ie,label:T,error:g,description:R,size:z,classNames:ye,styles:Ge,__staticSelector:"PasswordInput",unstyled:f,withAsterisk:M,inputWrapperOrder:$,inputContainer:C,variant:E,labelProps:{...B,htmlFor:ie},descriptionProps:{...N,id:vt},errorProps:{...A,id:tt},mod:q,...be("root"),...Ne,...L,children:y.jsx(St,{component:"div",error:g,leftSection:v,size:z,classNames:{...ye,input:zt(Np.input,ye.input)},styles:Ge,radius:H,disabled:x,__staticSelector:"PasswordInput",rightSectionWidth:Y,rightSection:I??Ae,variant:E,unstyled:f,leftSectionWidth:ee,rightSectionPointerEvents:X||"all",rightSectionProps:P,leftSectionProps:Z,leftSectionPointerEvents:D,withAria:!1,withErrorStyles:O,children:y.jsx("input",{required:p,"data-invalid":!!g||void 0,"data-with-left-section":!!v||void 0,...be("innerInput"),disabled:x,id:ie,ref:o,...Ke,"aria-describedby":De,autoComplete:Ke.autoComplete||"off",type:ue?"text":"password"})})})});af.classes={...cr.classes,...Np};af.displayName="@mantine/core/PasswordInput";const Uz={duration:100,transition:"fade"};function Pz(e,o){return{...Uz,...o,...e}}function Vz({offset:e,position:o,defaultOpened:r}){const[a,l]=b.useState(r),c=b.useRef(null),{x:u,y:f,elements:h,refs:p,update:g,placement:v}=mm({placement:o,middleware:[fm({crossAxis:!0,padding:5,rootBoundary:"document"})]}),x=v.includes("right")?e:o.includes("left")?e*-1:0,S=v.includes("bottom")?e:o.includes("top")?e*-1:0,E=b.useCallback(({clientX:C,clientY:R})=>{p.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:C,y:R,left:C+x,top:R+S,right:C,bottom:R}}})},[h.reference]);return b.useEffect(()=>{if(p.floating.current){const C=c.current;C.addEventListener("mousemove",E);const R=tr(p.floating.current);return R.forEach(T=>{T.addEventListener("scroll",g)}),()=>{C.removeEventListener("mousemove",E),R.forEach(T=>{T.removeEventListener("scroll",g)})}}},[h.reference,p.floating.current,g,E,a]),{handleMouseMove:E,x:u,y:f,opened:a,setOpened:l,boundaryRef:c,floating:p.setFloating}}var lf={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const Yz={refProp:"ref",withinPortal:!0,offset:10,defaultOpened:!1,position:"right",zIndex:vo("popover")},Gz=(e,{radius:o,color:r})=>({tooltip:{"--tooltip-radius":o===void 0?void 0:kt(o),"--tooltip-bg":r?Zt(r,e):void 0,"--tooltip-color":r?"var(--mantine-color-white)":void 0}}),ag=ge((e,o)=>{const r=ce("TooltipFloating",Yz,e),{children:a,refProp:l,withinPortal:c,style:u,className:f,classNames:h,styles:p,unstyled:g,radius:v,color:x,label:S,offset:E,position:C,multiline:R,zIndex:T,disabled:z,defaultOpened:A,variant:N,vars:B,portalProps:M,...$}=r,L=cn(),H=_e({name:"TooltipFloating",props:r,classes:lf,className:f,style:u,classNames:h,styles:p,unstyled:g,rootSelector:"tooltip",vars:B,varsResolver:Gz}),{handleMouseMove:I,x:Y,y:X,opened:ee,boundaryRef:ne,floating:re,setOpened:j}=Vz({offset:E,position:C,defaultOpened:A});if(!rr(a))throw new Error("[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const k=Mt(ne,Au(a),o),V=a.props,P=D=>{V.onMouseEnter?.(D),I(D),j(!0)},Z=D=>{V.onMouseLeave?.(D),j(!1)};return y.jsxs(y.Fragment,{children:[y.jsx(za,{...M,withinPortal:c,children:y.jsx(he,{...$,...H("tooltip",{style:{...om(u,L),zIndex:T,display:!z&&ee?"block":"none",top:(X&&Math.round(X))??"",left:(Y&&Math.round(Y))??""}}),variant:N,ref:re,mod:{multiline:R},children:S})}),b.cloneElement(a,{...V,[l]:k,onMouseEnter:P,onMouseLeave:Z})]})});ag.classes=lf;ag.displayName="@mantine/core/TooltipFloating";const Ew=b.createContext(!1),Xz=Ew.Provider,qz=()=>b.useContext(Ew),Iz={openDelay:0,closeDelay:0};function ig(e){const{openDelay:o,closeDelay:r,children:a}=ce("TooltipGroup",Iz,e);return y.jsx(Xz,{value:!0,children:y.jsx(FD,{delay:{open:o,close:r},children:a})})}ig.displayName="@mantine/core/TooltipGroup";ig.extend=e=>e;function Fz(e){if(e===void 0)return{shift:!0,flip:!0};const o={...e};return e.shift===void 0&&(o.shift=!0),e.flip===void 0&&(o.flip=!0),o}function Zz(e){const o=Fz(e.middlewares),r=[Fx(e.offset)];return o.shift&&r.push(fm(typeof o.shift=="boolean"?{padding:8}:{padding:8,...o.shift})),o.flip&&r.push(typeof o.flip=="boolean"?xu():xu(o.flip)),r.push(Zx({element:e.arrowRef,padding:e.arrowOffset})),o.inline?r.push(typeof o.inline=="boolean"?is():is(o.inline)):e.inline&&r.push(is()),r}function Qz(e){const[o,r]=b.useState(e.defaultOpened),l=typeof e.opened=="boolean"?e.opened:o,c=qz(),u=Jn(),f=b.useCallback(M=>{r(M),M&&z(u)},[u]),{x:h,y:p,context:g,refs:v,update:x,placement:S,middlewareData:{arrow:{x:E,y:C}={}}}=mm({strategy:e.strategy,placement:e.position,open:l,onOpenChange:f,middleware:Zz(e)}),{delay:R,currentId:T,setCurrentId:z}=ZD(g,{id:u}),{getReferenceProps:A,getFloatingProps:N}=n3([qD(g,{enabled:e.events?.hover,delay:c?R:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events?.touch}),t3(g,{enabled:e.events?.focus,visibleOnly:!0}),r3(g,{role:"tooltip"}),JD(g,{enabled:typeof e.opened>"u"})]);SS({opened:l,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:v,update:x}}),or(()=>{e.onPositionChange?.(S)},[S]);const B=l&&T&&T!==u;return{x:h,y:p,arrowX:E,arrowY:C,reference:v.setReference,floating:v.setFloating,getFloatingProps:N,getReferenceProps:A,isGroupPhase:B,opened:l,placement:S}}const S1={position:"top",refProp:"ref",withinPortal:!0,inline:!1,defaultOpened:!1,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},events:{hover:!0,focus:!1,touch:!1},zIndex:vo("popover"),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},Kz=(e,{radius:o,color:r})=>({tooltip:{"--tooltip-radius":o===void 0?void 0:kt(o),"--tooltip-bg":r?Zt(r,e):void 0,"--tooltip-color":r?"var(--mantine-color-white)":void 0}}),Ts=ge((e,o)=>{const r=ce("Tooltip",S1,e),{children:a,position:l,refProp:c,label:u,openDelay:f,closeDelay:h,onPositionChange:p,opened:g,defaultOpened:v,withinPortal:x,radius:S,color:E,classNames:C,styles:R,unstyled:T,style:z,className:A,withArrow:N,arrowSize:B,arrowOffset:M,arrowRadius:$,arrowPosition:L,offset:H,transitionProps:I,multiline:Y,events:X,zIndex:ee,disabled:ne,positionDependencies:re,onClick:j,onMouseEnter:k,onMouseLeave:V,inline:P,variant:Z,keepMounted:D,vars:O,portalProps:q,mod:W,floatingStrategy:ie,middlewares:ue,...ve}=ce("Tooltip",S1,r),{dir:fe}=Ii(),be=b.useRef(null),ye=Qz({position:pS(fe,l),closeDelay:h,openDelay:f,onPositionChange:p,opened:g,defaultOpened:v,events:X,arrowRef:be,arrowOffset:M,offset:typeof H=="number"?H+(N?B/2:0):H,positionDependencies:[...re,a],inline:P,strategy:ie,middlewares:ue}),Ge=_e({name:"Tooltip",props:r,classes:lf,className:A,style:z,classNames:C,styles:R,unstyled:T,rootSelector:"tooltip",vars:O,varsResolver:Kz});if(!rr(a))throw new Error("[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const Ne=Mt(ye.reference,Au(a),o),Ke=Pz(I,{duration:100,transition:"fade"}),Be=a.props;return y.jsxs(y.Fragment,{children:[y.jsx(za,{...q,withinPortal:x,children:y.jsx(qr,{...Ke,keepMounted:D,mounted:!ne&&!!ye.opened,duration:ye.isGroupPhase?10:Ke.duration,children:tt=>y.jsxs(he,{...ve,"data-fixed":ie==="fixed"||void 0,variant:Z,mod:[{multiline:Y},W],...ye.getFloatingProps({ref:ye.floating,className:Ge("tooltip").className,style:{...Ge("tooltip").style,...tt,zIndex:ee,top:ye.y??0,left:ye.x??0}}),children:[u,y.jsx(xm,{ref:be,arrowX:ye.arrowX,arrowY:ye.arrowY,visible:N,position:ye.placement,arrowSize:B,arrowOffset:M,arrowRadius:$,arrowPosition:L,...Ge("arrow")})]})})}),b.cloneElement(a,ye.getReferenceProps({onClick:j,onMouseEnter:k,onMouseLeave:V,onMouseMove:r.onMouseMove,onPointerDown:r.onPointerDown,onPointerEnter:r.onPointerEnter,className:zt(A,Be.className),...Be,[c]:Ne}))]})});Ts.classes=lf;Ts.displayName="@mantine/core/Tooltip";Ts.Floating=ag;Ts.Group=ig;var Rw={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const Wz={withItemsBorders:!0},Jz=(e,{radius:o,color:r,transitionDuration:a,size:l,transitionTimingFunction:c})=>({root:{"--sc-radius":o===void 0?void 0:kt(o),"--sc-color":r?Zt(r,e):void 0,"--sc-shadow":r?void 0:"var(--mantine-shadow-xs)","--sc-transition-duration":a===void 0?void 0:`${a}ms`,"--sc-transition-timing-function":c,"--sc-padding":Xe(l,"sc-padding"),"--sc-font-size":nn(l)}}),lg=ge((e,o)=>{const r=ce("SegmentedControl",Wz,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,data:p,value:g,defaultValue:v,onChange:x,size:S,name:E,disabled:C,readOnly:R,fullWidth:T,orientation:z,radius:A,color:N,transitionDuration:B,transitionTimingFunction:M,variant:$,autoContrast:L,withItemsBorders:H,mod:I,...Y}=r,X=_e({name:"SegmentedControl",props:r,classes:Rw,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:Jz}),ee=cn(),ne=p.map(fe=>typeof fe=="string"?{label:fe,value:fe}:fe),re=uT(),[j,k]=b.useState(pu()),[V,P]=b.useState(null),[Z,D]=b.useState({}),O=(fe,be)=>{Z[be]=fe,D(Z)},[q,W]=Wn({value:g,defaultValue:v,finalValue:Array.isArray(p)?ne.find(fe=>!fe.disabled)?.value??p[0]?.value??null:null,onChange:x}),ie=Jn(E),ue=ne.map(fe=>b.createElement(he,{...X("control"),mod:{active:q===fe.value,orientation:z},key:fe.value},b.createElement("input",{...X("input"),disabled:C||fe.disabled,type:"radio",name:ie,value:fe.value,id:`${ie}-${fe.value}`,checked:q===fe.value,onChange:()=>!R&&W(fe.value),"data-focus-ring":ee.focusRing,key:`${fe.value}-input`}),b.createElement(he,{component:"label",...X("label"),mod:{active:q===fe.value&&!(C||fe.disabled),disabled:C||fe.disabled,"read-only":R},htmlFor:`${ie}-${fe.value}`,ref:be=>O(be,fe.value),__vars:{"--sc-label-color":N!==void 0?Mu({color:N,theme:ee,autoContrast:L}):void 0},key:`${fe.value}-label`},y.jsx("span",{...X("innerLabel"),children:fe.label})))),ve=Mt(o,fe=>P(fe));return aT(()=>{k(pu())},[p.length]),p.length===0?null:y.jsxs(he,{...X("root"),variant:$,size:S,ref:ve,mod:[{"full-width":T,orientation:z,initialized:re,"with-items-borders":H},I],...Y,role:"radiogroup","data-disabled":C,children:[typeof q=="string"&&y.jsx(Tm,{target:Z[q],parent:V,component:"span",transitionDuration:"var(--sc-transition-duration)",...X("indicator")},j),ue]})});lg.classes=Rw;lg.displayName="@mantine/core/SegmentedControl";const eM={searchable:!1,withCheckIcon:!0,allowDeselect:!0,checkIconPosition:"left"},Vi=ge((e,o)=>{const r=ce("Select",eM,e),{classNames:a,styles:l,unstyled:c,vars:u,dropdownOpened:f,defaultDropdownOpened:h,onDropdownClose:p,onDropdownOpen:g,onFocus:v,onBlur:x,onClick:S,onChange:E,data:C,value:R,defaultValue:T,selectFirstOptionOnChange:z,onOptionSubmit:A,comboboxProps:N,readOnly:B,disabled:M,filter:$,limit:L,withScrollArea:H,maxDropdownHeight:I,size:Y,searchable:X,rightSection:ee,checkIconPosition:ne,withCheckIcon:re,nothingFoundMessage:j,name:k,form:V,searchValue:P,defaultSearchValue:Z,onSearchChange:D,allowDeselect:O,error:q,rightSectionPointerEvents:W,id:ie,clearable:ue,clearButtonProps:ve,hiddenInputProps:fe,renderOption:be,onClear:ye,autoComplete:Ge,scrollAreaProps:Ne,__defaultRightSection:Ke,__clearSection:Be,__clearable:tt,chevronColor:vt,...pe}=r,me=b.useMemo(()=>PN(C),[C]),we=b.useMemo(()=>VS(me),[me]),De=Jn(ie),[Ae,xe,$e]=Wn({value:R,defaultValue:T,finalValue:null,onChange:E}),de=typeof Ae=="string"?we[Ae]:void 0,Re=sT(de),[dt,nt,yt]=Wn({value:P,defaultValue:Z,finalValue:de?de.label:"",onChange:D}),We=FS({opened:f,defaultOpened:h,onDropdownOpen:()=>{g?.(),We.updateSelectedOptionIndex("active",{scrollIntoView:!0})},onDropdownClose:()=>{p?.(),We.resetSelectedOption()}}),wt=st=>{nt(st),We.resetSelectedOption()},{resolvedClassNames:on,resolvedStyles:Qr}=Xi({props:r,styles:l,classNames:a});b.useEffect(()=>{z&&We.selectFirstOption()},[z,dt]),b.useEffect(()=>{R===null&&wt(""),typeof R=="string"&&de&&(Re?.value!==de.value||Re?.label!==de.label)&&wt(de.label)},[R,de]),b.useEffect(()=>{!$e&&!yt&&wt(typeof Ae=="string"&&we[Ae]?.label||"")},[C,Ae]);const Oo=y.jsx(lt.ClearButton,{...ve,onClear:()=>{xe(null,null),wt(""),ye?.()}}),Gt=ue&&!!Ae&&!M&&!B;return y.jsxs(y.Fragment,{children:[y.jsxs(lt,{store:We,__staticSelector:"Select",classNames:on,styles:Qr,unstyled:c,readOnly:B,onOptionSubmit:st=>{A?.(st);const Ct=O&&we[st].value===Ae?null:we[st],Kr=Ct?Ct.value:null;Kr!==Ae&&xe(Kr,Ct),!$e&&wt(typeof Kr=="string"&&Ct?.label||""),We.closeDropdown()},size:Y,...N,children:[y.jsx(lt.Target,{targetType:X?"input":"button",autoComplete:Ge,children:y.jsx(cr,{id:De,ref:o,__defaultRightSection:y.jsx(lt.Chevron,{size:Y,error:q,unstyled:c,color:vt}),__clearSection:Oo,__clearable:Gt,rightSection:ee,rightSectionPointerEvents:W||(Gt?"all":"none"),...pe,size:Y,__staticSelector:"Select",disabled:M,readOnly:B||!X,value:dt,onChange:st=>{wt(st.currentTarget.value),We.openDropdown(),z&&We.selectFirstOption()},onFocus:st=>{X&&We.openDropdown(),v?.(st)},onBlur:st=>{X&&We.closeDropdown(),wt(Ae!=null&&we[Ae]?.label||""),x?.(st)},onClick:st=>{X?We.openDropdown():We.toggleDropdown(),S?.(st)},classNames:on,styles:Qr,unstyled:c,pointer:!X,error:q})}),y.jsx(xA,{data:me,hidden:B||M,filter:$,search:dt,limit:L,hiddenWhenEmpty:!j,withScrollArea:H,maxDropdownHeight:I,filterOptions:X&&de?.label!==dt,value:Ae,checkIconPosition:ne,withCheckIcon:re,nothingFoundMessage:j,unstyled:c,labelId:pe.label?`${De}-label`:void 0,"aria-label":pe.label?void 0:pe["aria-label"],renderOption:be,scrollAreaProps:Ne})]}),y.jsx(lt.HiddenInput,{value:Ae,name:k,form:V,disabled:M,...fe})]})});Vi.classes={...cr.classes,...lt.classes};Vi.displayName="@mantine/core/Select";function tM({spacing:e,verticalSpacing:o,cols:r,selector:a}){const l=cn(),c=o===void 0?e:o,u=xs({"--sg-spacing-x":sn(Oi(e)),"--sg-spacing-y":sn(Oi(c)),"--sg-cols":Oi(r)?.toString()}),f=At(l.breakpoints).reduce((g,v)=>(g[v]||(g[v]={}),typeof e=="object"&&e[v]!==void 0&&(g[v]["--sg-spacing-x"]=sn(e[v])),typeof c=="object"&&c[v]!==void 0&&(g[v]["--sg-spacing-y"]=sn(c[v])),typeof r=="object"&&r[v]!==void 0&&(g[v]["--sg-cols"]=r[v]),g),{}),p=pp(At(f),l.breakpoints).filter(g=>At(f[g.value]).length>0).map(g=>({query:`(min-width: ${l.breakpoints[g.value]})`,styles:f[g.value]}));return y.jsx(Ou,{styles:u,media:p,selector:a})}function Qh(e){return typeof e=="object"&&e!==null?At(e):[]}function nM(e){return e.sort((o,r)=>fs(o)-fs(r))}function oM({spacing:e,verticalSpacing:o,cols:r}){const a=Array.from(new Set([...Qh(e),...Qh(o),...Qh(r)]));return nM(a)}function rM({spacing:e,verticalSpacing:o,cols:r,selector:a}){const l=o===void 0?e:o,c=xs({"--sg-spacing-x":sn(Oi(e)),"--sg-spacing-y":sn(Oi(l)),"--sg-cols":Oi(r)?.toString()}),u=oM({spacing:e,verticalSpacing:o,cols:r}),f=u.reduce((p,g)=>(p[g]||(p[g]={}),typeof e=="object"&&e[g]!==void 0&&(p[g]["--sg-spacing-x"]=sn(e[g])),typeof l=="object"&&l[g]!==void 0&&(p[g]["--sg-spacing-y"]=sn(l[g])),typeof r=="object"&&r[g]!==void 0&&(p[g]["--sg-cols"]=r[g]),p),{}),h=u.map(p=>({query:`simple-grid (min-width: ${p})`,styles:f[p]}));return y.jsx(Ou,{styles:c,container:h,selector:a})}var Tw={container:"m_925c2d2c",root:"m_2415a157"};const aM={cols:1,spacing:"md",type:"media"},sg=ge((e,o)=>{const r=ce("SimpleGrid",aM,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,cols:p,verticalSpacing:g,spacing:v,type:x,...S}=r,E=_e({name:"SimpleGrid",classes:Tw,props:r,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h}),C=Ax();return x==="container"?y.jsxs(y.Fragment,{children:[y.jsx(rM,{...r,selector:`.${C}`}),y.jsx("div",{...E("container"),children:y.jsx(he,{ref:o,...E("root",{className:C}),...S})})]}):y.jsxs(y.Fragment,{children:[y.jsx(tM,{...r,selector:`.${C}`}),y.jsx(he,{ref:o,...E("root",{className:C}),...S})]})});sg.classes=Tw;sg.displayName="@mantine/core/SimpleGrid";var _w={root:"m_6d731127"};const iM={gap:"md",align:"stretch",justify:"flex-start"},lM=(e,{gap:o,align:r,justify:a})=>({root:{"--stack-gap":sn(o),"--stack-align":r,"--stack-justify":a}}),Qt=ge((e,o)=>{const r=ce("Stack",iM,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,align:p,justify:g,gap:v,variant:x,...S}=r,E=_e({name:"Stack",props:r,classes:_w,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:lM});return y.jsx(he,{ref:o,...E("root"),variant:x,...S})});Qt.classes=_w;Qt.displayName="@mantine/core/Stack";const Dw=b.createContext(null),sM=Dw.Provider,cM=()=>b.useContext(Dw),uM={},cg=ge((e,o)=>{const{value:r,defaultValue:a,onChange:l,size:c,wrapperProps:u,children:f,readOnly:h,...p}=ce("SwitchGroup",uM,e),[g,v]=Wn({value:r,defaultValue:a,finalValue:[],onChange:l}),x=S=>{const E=S.currentTarget.value;!h&&v(g.includes(E)?g.filter(C=>C!==E):[...g,E])};return y.jsx(sM,{value:{value:g,onChange:x,size:c},children:y.jsx(St.Wrapper,{size:c,ref:o,...u,...p,labelElement:"div",__staticSelector:"SwitchGroup",children:y.jsx(ew,{role:"group",children:f})})})});cg.classes=St.Wrapper.classes;cg.displayName="@mantine/core/SwitchGroup";var Nw={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const fM={labelPosition:"right",withThumbIndicator:!0},dM=(e,{radius:o,color:r,size:a})=>({root:{"--switch-radius":o===void 0?void 0:kt(o),"--switch-height":Xe(a,"switch-height"),"--switch-width":Xe(a,"switch-width"),"--switch-thumb-size":Xe(a,"switch-thumb-size"),"--switch-label-font-size":Xe(a,"switch-label-font-size"),"--switch-track-label-padding":Xe(a,"switch-track-label-padding"),"--switch-color":r?Zt(r,e):void 0}}),Bi=ge((e,o)=>{const r=ce("Switch",fM,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,color:p,label:g,offLabel:v,onLabel:x,id:S,size:E,radius:C,wrapperProps:R,thumbIcon:T,checked:z,defaultChecked:A,onChange:N,labelPosition:B,description:M,error:$,disabled:L,variant:H,rootRef:I,mod:Y,withThumbIndicator:X,...ee}=r,ne=cM(),re=E||ne?.size,j=_e({name:"Switch",props:r,classes:Nw,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:dM}),{styleProps:k,rest:V}=qi(ee),P=Jn(S),Z=ne?{checked:ne.value.includes(V.value),onChange:ne.onChange}:{},[D,O]=Wn({value:Z.checked??z,defaultValue:A,finalValue:!1});return y.jsxs(Ym,{...j("root"),__staticSelector:"Switch",__stylesApiProps:r,id:P,size:re,labelPosition:B,label:g,description:M,error:$,disabled:L,bodyElement:"label",labelElement:"span",classNames:a,styles:u,unstyled:f,"data-checked":Z.checked||z||void 0,variant:H,ref:I,mod:Y,...k,...R,children:[y.jsx("input",{...V,disabled:L,checked:D,"data-checked":Z.checked||z||void 0,onChange:q=>{ne?Z.onChange?.(q):N?.(q),O(q.currentTarget.checked)},id:P,ref:o,type:"checkbox",role:"switch",...j("input")}),y.jsxs(he,{"aria-hidden":"true",component:"span",mod:{error:$,"label-position":B,"without-labels":!x&&!v},...j("track"),children:[y.jsx(he,{component:"span",mod:{"reduce-motion":!0,"with-thumb-indicator":X&&!T},...j("thumb"),children:T}),y.jsx("span",{...j("trackLabel"),children:D?x:v})]})]})});Bi.classes={...Nw,...QS};Bi.displayName="@mantine/core/Switch";Bi.Group=cg;const[hM,pM]=zo("Table component was not found in the tree");var _s={table:"m_b23fa0ef",th:"m_4e7aa4f3",tr:"m_4e7aa4fd",td:"m_4e7aa4ef",tbody:"m_b2404537",thead:"m_b242d975",caption:"m_9e5a3ac7",scrollContainer:"m_a100c15",scrollContainerInner:"m_62259741"};function mM(e,o){if(!o)return;const r={};return o.columnBorder&&e.withColumnBorders&&(r["data-with-column-border"]=!0),o.rowBorder&&e.withRowBorders&&(r["data-with-row-border"]=!0),o.striped&&e.striped&&(r["data-striped"]=e.striped),o.highlightOnHover&&e.highlightOnHover&&(r["data-hover"]=!0),o.captionSide&&e.captionSide&&(r["data-side"]=e.captionSide),o.stickyHeader&&e.stickyHeader&&(r["data-sticky"]=!0),r}function Oa(e,o){const r=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,a=ge((l,c)=>{const u=ce(r,{},l),{classNames:f,className:h,style:p,styles:g,...v}=u,x=pM();return y.jsx(he,{component:e,ref:c,...mM(x,o),...x.getStyles(e,{className:h,classNames:f,style:p,styles:g,props:u}),...v})});return a.displayName=`@mantine/core/${r}`,a.classes=_s,a}const Ap=Oa("th",{columnBorder:!0}),Aw=Oa("td",{columnBorder:!0}),uu=Oa("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),zw=Oa("thead",{stickyHeader:!0}),Mw=Oa("tbody"),Ow=Oa("tfoot"),jw=Oa("caption",{captionSide:!0});function ug({data:e}){return y.jsxs(y.Fragment,{children:[e.caption&&y.jsx(jw,{children:e.caption}),e.head&&y.jsx(zw,{children:y.jsx(uu,{children:e.head.map((o,r)=>y.jsx(Ap,{children:o},r))})}),e.body&&y.jsx(Mw,{children:e.body.map((o,r)=>y.jsx(uu,{children:o.map((a,l)=>y.jsx(Aw,{children:a},l))},r))}),e.foot&&y.jsx(Ow,{children:y.jsx(uu,{children:e.foot.map((o,r)=>y.jsx(Ap,{children:o},r))})})]})}ug.displayName="@mantine/core/TableDataRenderer";const gM={type:"scrollarea"},vM=(e,{minWidth:o,maxHeight:r,type:a})=>({scrollContainer:{"--table-min-width":oe(o),"--table-max-height":oe(r),"--table-overflow":a==="native"?"auto":void 0}}),fg=ge((e,o)=>{const r=ce("TableScrollContainer",gM,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,children:p,minWidth:g,maxHeight:v,type:x,scrollAreaProps:S,...E}=r,C=_e({name:"TableScrollContainer",classes:_s,props:r,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:vM,rootSelector:"scrollContainer"});return y.jsx(he,{component:x==="scrollarea"?Aa:"div",...x==="scrollarea"?v?{offsetScrollbars:"xy",...S}:{offsetScrollbars:"x",...S}:{},ref:o,...C("scrollContainer"),...E,children:y.jsx("div",{...C("scrollContainerInner"),children:p})})});fg.classes=_s;fg.displayName="@mantine/core/TableScrollContainer";const yM={withRowBorders:!0,verticalSpacing:7},bM=(e,{layout:o,captionSide:r,horizontalSpacing:a,verticalSpacing:l,borderColor:c,stripedColor:u,highlightOnHoverColor:f,striped:h,highlightOnHover:p,stickyHeaderOffset:g,stickyHeader:v})=>({table:{"--table-layout":o,"--table-caption-side":r,"--table-horizontal-spacing":sn(a),"--table-vertical-spacing":sn(l),"--table-border-color":c?Zt(c,e):void 0,"--table-striped-color":h&&u?Zt(u,e):void 0,"--table-highlight-on-hover-color":p&&f?Zt(f,e):void 0,"--table-sticky-header-offset":v?oe(g):void 0}}),it=ge((e,o)=>{const r=ce("Table",yM,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,horizontalSpacing:p,verticalSpacing:g,captionSide:v,stripedColor:x,highlightOnHoverColor:S,striped:E,highlightOnHover:C,withColumnBorders:R,withRowBorders:T,withTableBorder:z,borderColor:A,layout:N,variant:B,data:M,children:$,stickyHeader:L,stickyHeaderOffset:H,mod:I,tabularNums:Y,...X}=r,ee=_e({name:"Table",props:r,className:l,style:c,classes:_s,classNames:a,styles:u,unstyled:f,rootSelector:"table",vars:h,varsResolver:bM});return y.jsx(hM,{value:{getStyles:ee,stickyHeader:L,striped:E===!0?"odd":E||void 0,highlightOnHover:C,withColumnBorders:R,withRowBorders:T,captionSide:v||"bottom"},children:y.jsx(he,{component:"table",variant:B,ref:o,mod:[{"data-with-table-border":z,"data-tabular-nums":Y},I],...ee("table"),...X,children:$||!!M&&y.jsx(ug,{data:M})})})});it.classes=_s;it.displayName="@mantine/core/Table";it.Td=Aw;it.Th=Ap;it.Tr=uu;it.Thead=zw;it.Tbody=Mw;it.Tfoot=Ow;it.Caption=jw;it.ScrollContainer=fg;it.DataRenderer=ug;const xM={},Yi=ge((e,o)=>{const r=ce("TextInput",xM,e);return y.jsx(cr,{component:"input",ref:o,...r,__staticSelector:"TextInput"})});Yi.classes=cr.classes;Yi.displayName="@mantine/core/TextInput";function SM(e){let o=e,r=!1;const a=new Set;return{getState(){return o},updateState(l){o=typeof l=="function"?l(o):l},setState(l){this.updateState(l),a.forEach(c=>c(o))},initialize(l){r||(o=l,r=!0)},subscribe(l){return a.add(l),()=>a.delete(l)}}}function wM(e){return b.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}function CM(e,o,r){const a=[],l=[],c={};for(const u of e){const f=u.position||o;c[f]=c[f]||0,c[f]+=1,c[f]<=r?l.push(u):a.push(u)}return{notifications:l,queue:a}}const EM=()=>SM({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),ja=EM(),RM=(e=ja)=>wM(e);function rl(e,o){const r=e.getState(),a=o([...r.notifications,...r.queue]),l=CM(a,r.defaultPosition,r.limit);e.setState({notifications:l.notifications,queue:l.queue,limit:r.limit,defaultPosition:r.defaultPosition})}function TM(e,o=ja){const r=e.id||pu();return rl(o,a=>e.id&&a.some(l=>l.id===e.id)?a:[...a,{...e,id:r}]),r}function Bw(e,o=ja){return rl(o,r=>r.filter(a=>a.id===e?(a.onClose?.(a),!1):!0)),e}function _M(e,o=ja){return rl(o,r=>r.map(a=>a.id===e.id?{...a,...e}:a)),e.id}function DM(e=ja){rl(e,()=>[])}function NM(e=ja){rl(e,o=>o.slice(0,e.getState().limit))}const Ze={show:TM,hide:Bw,update:_M,clean:DM,cleanQueue:NM,updateState:rl};function zp(e,o){return zp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},zp(e,o)}function $w(e,o){e.prototype=Object.create(o.prototype),e.prototype.constructor=e,zp(e,o)}var Kh={exports:{}},Wh,w1;function AM(){if(w1)return Wh;w1=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Wh=e,Wh}var Jh,C1;function zM(){if(C1)return Jh;C1=1;var e=AM();function o(){}function r(){}return r.resetWarningCache=o,Jh=function(){function a(u,f,h,p,g,v){if(v!==e){var x=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw x.name="Invariant Violation",x}}a.isRequired=a;function l(){return a}var c={array:a,bigint:a,bool:a,func:a,number:a,object:a,string:a,symbol:a,any:a,arrayOf:l,element:a,elementType:a,instanceOf:l,node:a,objectOf:l,oneOf:l,oneOfType:l,shape:l,exact:l,checkPropTypes:r,resetWarningCache:o};return c.PropTypes=c,c},Jh}var E1;function MM(){return E1||(E1=1,Kh.exports=zM()()),Kh.exports}var OM=MM();const je=Xp(OM),R1={disabled:!1},wu=Ye.createContext(null);var jM=function(o){return o.scrollTop},rs="unmounted",va="exited",ya="entering",Ai="entered",Mp="exiting",fr=(function(e){$w(o,e);function o(a,l){var c;c=e.call(this,a,l)||this;var u=l,f=u&&!u.isMounting?a.enter:a.appear,h;return c.appearStatus=null,a.in?f?(h=va,c.appearStatus=ya):h=Ai:a.unmountOnExit||a.mountOnEnter?h=rs:h=va,c.state={status:h},c.nextCallback=null,c}o.getDerivedStateFromProps=function(l,c){var u=l.in;return u&&c.status===rs?{status:va}:null};var r=o.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(l){var c=null;if(l!==this.props){var u=this.state.status;this.props.in?u!==ya&&u!==Ai&&(c=ya):(u===ya||u===Ai)&&(c=Mp)}this.updateStatus(!1,c)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var l=this.props.timeout,c,u,f;return c=u=f=l,l!=null&&typeof l!="number"&&(c=l.exit,u=l.enter,f=l.appear!==void 0?l.appear:u),{exit:c,enter:u,appear:f}},r.updateStatus=function(l,c){if(l===void 0&&(l=!1),c!==null)if(this.cancelNextCallback(),c===ya){if(this.props.unmountOnExit||this.props.mountOnEnter){var u=this.props.nodeRef?this.props.nodeRef.current:Sa.findDOMNode(this);u&&jM(u)}this.performEnter(l)}else this.performExit();else this.props.unmountOnExit&&this.state.status===va&&this.setState({status:rs})},r.performEnter=function(l){var c=this,u=this.props.enter,f=this.context?this.context.isMounting:l,h=this.props.nodeRef?[f]:[Sa.findDOMNode(this),f],p=h[0],g=h[1],v=this.getTimeouts(),x=f?v.appear:v.enter;if(!l&&!u||R1.disabled){this.safeSetState({status:Ai},function(){c.props.onEntered(p)});return}this.props.onEnter(p,g),this.safeSetState({status:ya},function(){c.props.onEntering(p,g),c.onTransitionEnd(x,function(){c.safeSetState({status:Ai},function(){c.props.onEntered(p,g)})})})},r.performExit=function(){var l=this,c=this.props.exit,u=this.getTimeouts(),f=this.props.nodeRef?void 0:Sa.findDOMNode(this);if(!c||R1.disabled){this.safeSetState({status:va},function(){l.props.onExited(f)});return}this.props.onExit(f),this.safeSetState({status:Mp},function(){l.props.onExiting(f),l.onTransitionEnd(u.exit,function(){l.safeSetState({status:va},function(){l.props.onExited(f)})})})},r.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(l,c){c=this.setNextCallback(c),this.setState(l,c)},r.setNextCallback=function(l){var c=this,u=!0;return this.nextCallback=function(f){u&&(u=!1,c.nextCallback=null,l(f))},this.nextCallback.cancel=function(){u=!1},this.nextCallback},r.onTransitionEnd=function(l,c){this.setNextCallback(c);var u=this.props.nodeRef?this.props.nodeRef.current:Sa.findDOMNode(this),f=l==null&&!this.props.addEndListener;if(!u||f){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var h=this.props.nodeRef?[this.nextCallback]:[u,this.nextCallback],p=h[0],g=h[1];this.props.addEndListener(p,g)}l!=null&&setTimeout(this.nextCallback,l)},r.render=function(){var l=this.state.status;if(l===rs)return null;var c=this.props,u=c.children;c.in,c.mountOnEnter,c.unmountOnExit,c.appear,c.enter,c.exit,c.timeout,c.addEndListener,c.onEnter,c.onEntering,c.onEntered,c.onExit,c.onExiting,c.onExited,c.nodeRef;var f=dw(c,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Ye.createElement(wu.Provider,{value:null},typeof u=="function"?u(l,f):Ye.cloneElement(Ye.Children.only(u),f))},o})(Ye.Component);fr.contextType=wu;fr.propTypes={};function Ti(){}fr.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ti,onEntering:Ti,onEntered:Ti,onExit:Ti,onExiting:Ti,onExited:Ti};fr.UNMOUNTED=rs;fr.EXITED=va;fr.ENTERING=ya;fr.ENTERED=Ai;fr.EXITING=Mp;function BM(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dg(e,o){var r=function(c){return o&&b.isValidElement(c)?o(c):c},a=Object.create(null);return e&&b.Children.map(e,function(l){return l}).forEach(function(l){a[l.key]=r(l)}),a}function $M(e,o){e=e||{},o=o||{};function r(g){return g in o?o[g]:e[g]}var a=Object.create(null),l=[];for(var c in e)c in o?l.length&&(a[c]=l,l=[]):l.push(c);var u,f={};for(var h in o){if(a[h])for(u=0;u(r[a.position||o].push(a),r),Lw.reduce((r,a)=>(r[a]=[],r),{}))}const T1={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},VM={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function YM({state:e,maxHeight:o,position:r,transitionDuration:a}){const[l,c]=r.split("-"),u=c==="center"?`${l}-center`:c,f={opacity:0,maxHeight:o,transform:T1[u],transitionDuration:`${a}ms, ${a}ms, ${a}ms`,transitionTimingFunction:"cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",transitionProperty:"opacity, transform, max-height"},h={opacity:1,transform:VM[u]},p={opacity:0,maxHeight:0,transform:T1[u]};return{...f,...{entering:h,entered:h,exiting:p,exited:p}[e]}}function GM(e,o){return typeof o=="number"?o:o===!1||e===!1?!1:e}const kw=b.forwardRef(({data:e,onHide:o,autoClose:r,...a},l)=>{const{autoClose:c,message:u,...f}=e,h=GM(r,e.autoClose),p=b.useRef(-1),g=()=>window.clearTimeout(p.current),v=()=>{o(e.id),g()},x=()=>{typeof h=="number"&&(p.current=window.setTimeout(v,h))};return b.useEffect(()=>{e.onOpen?.(e)},[]),b.useEffect(()=>(x(),g),[h]),y.jsx(og,{...a,...f,onClose:v,ref:l,onMouseEnter:g,onMouseLeave:x,children:u})});kw.displayName="@mantine/notifications/NotificationContainer";var Hw={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const XM=fr,qM={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:vo("overlay"),store:ja,withinPortal:!0},IM=(e,{zIndex:o,containerWidth:r})=>({root:{"--notifications-z-index":o?.toString(),"--notifications-container-width":oe(r)}}),dr=ge((e,o)=>{const r=ce("Notifications",qM,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,position:p,autoClose:g,transitionDuration:v,containerWidth:x,notificationMaxHeight:S,limit:E,zIndex:C,store:R,portalProps:T,withinPortal:z,...A}=r,N=cn(),B=RM(R),M=eT(),$=Nu(),L=b.useRef({}),H=b.useRef(0),Y=(N.respectReducedMotion?$:!1)?1:v,X=_e({name:"Notifications",classes:Hw,props:r,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:IM});b.useEffect(()=>{R?.updateState(re=>({...re,limit:E||5,defaultPosition:p}))},[E,p]),or(()=>{B.notifications.length>H.current&&setTimeout(()=>M(),0),H.current=B.notifications.length},[B.notifications]);const ee=PM(B.notifications,p),ne=Lw.reduce((re,j)=>(re[j]=ee[j].map(({style:k,...V})=>y.jsx(XM,{timeout:Y,onEnter:()=>L.current[V.id].offsetHeight,nodeRef:{current:L.current[V.id]},children:P=>y.jsx(kw,{ref:Z=>{L.current[V.id]=Z},data:V,onHide:Z=>Bw(Z,R),autoClose:g,...X("notification",{style:{...YM({state:P,position:j,transitionDuration:Y,maxHeight:S}),...k}})})},V.id)),re),{});return y.jsxs(za,{withinPortal:z,...T,children:[y.jsx(he,{...X("root"),"data-position":"top-center",ref:o,...A,children:y.jsx(kr,{children:ne["top-center"]})}),y.jsx(he,{...X("root"),"data-position":"top-left",...A,children:y.jsx(kr,{children:ne["top-left"]})}),y.jsx(he,{...X("root",{className:ki.classNames.fullWidth}),"data-position":"top-right",...A,children:y.jsx(kr,{children:ne["top-right"]})}),y.jsx(he,{...X("root",{className:ki.classNames.fullWidth}),"data-position":"bottom-right",...A,children:y.jsx(kr,{children:ne["bottom-right"]})}),y.jsx(he,{...X("root"),"data-position":"bottom-left",...A,children:y.jsx(kr,{children:ne["bottom-left"]})}),y.jsx(he,{...X("root"),"data-position":"bottom-center",...A,children:y.jsx(kr,{children:ne["bottom-center"]})})]})});dr.classes=Hw;dr.displayName="@mantine/notifications/Notifications";dr.show=Ze.show;dr.hide=Ze.hide;dr.update=Ze.update;dr.clean=Ze.clean;dr.cleanQueue=Ze.cleanQueue;dr.updateState=Ze.updateState;var FM={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};const gt=(e,o,r,a)=>{const l=b.forwardRef(({color:c="currentColor",size:u=24,stroke:f=2,title:h,className:p,children:g,...v},x)=>b.createElement("svg",{ref:x,...FM[e],width:u,height:u,className:["tabler-icon",`tabler-icon-${o}`,p].join(" "),strokeWidth:f,stroke:c,...v},[h&&b.createElement("title",{key:"svg-title"},h),...a.map(([S,E])=>b.createElement(S,E)),...Array.isArray(g)?g:[g]]));return l.displayName=`${r}`,l};const ZM=[["path",{d:"M3 12h4l3 8l4 -16l3 8h4",key:"svg-0"}]],QM=gt("outline","activity","Activity",ZM);const KM=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 8v4",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]],Uw=gt("outline","alert-circle","AlertCircle",KM);const WM=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 13l-6 6",key:"svg-1"}],["path",{d:"M6 13l6 6",key:"svg-2"}]],JM=gt("outline","arrow-down","ArrowDown",WM);const e5=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]],t5=gt("outline","arrow-up","ArrowUp",e5);const n5=[["path",{d:"M9 19c-4.3 1.4 -4.3 -2.5 -6 -3m12 5v-3.5c0 -1 .1 -1.4 -.5 -2c2.8 -.3 5.5 -1.4 5.5 -6a4.6 4.6 0 0 0 -1.3 -3.2a4.2 4.2 0 0 0 -.1 -3.2s-1.1 -.3 -3.5 1.3a12.3 12.3 0 0 0 -6.2 0c-2.4 -1.6 -3.5 -1.3 -3.5 -1.3a4.2 4.2 0 0 0 -.1 3.2a4.6 4.6 0 0 0 -1.3 3.2c0 4.6 2.7 5.7 5.5 6c-.6 .6 -.6 1.2 -.5 2v3.5",key:"svg-0"}]],o5=gt("outline","brand-github","BrandGithub",n5);const r5=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],Pw=gt("outline","chevron-down","ChevronDown",r5);const a5=[["path",{d:"M9 6l6 6l-6 6",key:"svg-0"}]],i5=gt("outline","chevron-right","ChevronRight",a5);const l5=[["path",{d:"M6 15l6 -6l6 6",key:"svg-0"}]],s5=gt("outline","chevron-up","ChevronUp",l5);const c5=[["path",{d:"M3 14c.83 .642 2.077 1.017 3.5 1c1.423 .017 2.67 -.358 3.5 -1c.83 -.642 2.077 -1.017 3.5 -1c1.423 -.017 2.67 .358 3.5 1",key:"svg-0"}],["path",{d:"M8 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2",key:"svg-1"}],["path",{d:"M12 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2",key:"svg-2"}],["path",{d:"M3 10h14v5a6 6 0 0 1 -6 6h-2a6 6 0 0 1 -6 -6v-5",key:"svg-3"}],["path",{d:"M16.746 16.726a3 3 0 1 0 .252 -5.555",key:"svg-4"}]],u5=gt("outline","coffee","Coffee",c5);const f5=[["path",{d:"M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]],d5=gt("outline","copy","Copy",f5);const h5=[["path",{d:"M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2",key:"svg-0"}],["path",{d:"M10 14a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M14 4l0 4l-6 0l0 -4",key:"svg-2"}]],p5=gt("outline","device-floppy","DeviceFloppy",h5);const m5=[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 11l5 5l5 -5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]],Vw=gt("outline","download","Download",m5);const g5=[["path",{d:"M8 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M8 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M8 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}],["path",{d:"M14 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-3"}],["path",{d:"M14 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-4"}],["path",{d:"M14 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-5"}]],v5=gt("outline","grip-vertical","GripVertical",g5);const y5=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 9h.01",key:"svg-1"}],["path",{d:"M11 12h1v4h1",key:"svg-2"}]],b5=gt("outline","info-circle","InfoCircle",y5);const x5=[["path",{d:"M5 12l14 0",key:"svg-0"}]],S5=gt("outline","minus","Minus",x5);const w5=[["path",{d:"M12 21a9 9 0 0 1 0 -18c4.97 0 9 3.582 9 8c0 1.06 -.474 2.078 -1.318 2.828c-.844 .75 -1.989 1.172 -3.182 1.172h-2.5a2 2 0 0 0 -1 3.75a1.3 1.3 0 0 1 -1 2.25",key:"svg-0"}],["path",{d:"M7.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M11.5 7.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}],["path",{d:"M15.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-3"}]],C5=gt("outline","palette","Palette",w5);const E5=[["path",{d:"M15 8h.01",key:"svg-0"}],["path",{d:"M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12",key:"svg-1"}],["path",{d:"M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5",key:"svg-2"}],["path",{d:"M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3",key:"svg-3"}]],R5=gt("outline","photo","Photo",E5);const T5=[["path",{d:"M7 4v16l13 -8l-13 -8",key:"svg-0"}]],_1=gt("outline","player-play","PlayerPlay",T5);const _5=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]],ls=gt("outline","plus","Plus",_5);const D5=[["path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",key:"svg-0"}],["path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",key:"svg-1"}]],Yw=gt("outline","refresh","Refresh",D5);const N5=[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]],A5=gt("outline","settings","Settings",N5);const z5=[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]],hg=gt("outline","trash","Trash",z5);const M5=[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 9l5 -5l5 5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]],Gw=gt("outline","upload","Upload",M5);const O5=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],j5=gt("outline","x","X",O5),B5={};function $5({children:e,defaultColorScheme:o="dark",notificationsPosition:r="bottom-right"}){return y.jsxs(Dx,{theme:B5,defaultColorScheme:o,children:[y.jsx(dr,{position:r}),e]})}function D1(e){return e?{color:"teal",variant:"filled",styles:{root:{"--button-bg":"var(--mantine-color-teal-9)","--button-hover":"var(--mantine-color-teal-8)"}}}:{}}function L5({logoUrl:e,appName:o,version:r,actions:a=[],extra:l,onLogout:c,githubUrl:u,kofiUrl:f="https://ko-fi.com/sethwv",username:h}){const p=y.jsx(Qm,{src:e,h:32,w:"auto"}),g=!!(u||f);return y.jsx(mo.Header,{children:y.jsxs(mt,{h:"100%",px:"md",justify:"space-between",wrap:"nowrap",children:[y.jsxs(mt,{gap:"xs",wrap:"nowrap",style:{flexShrink:0},children:[g?y.jsxs(Nt,{shadow:"md",width:300,position:"bottom-start",children:[y.jsx(Nt.Target,{children:y.jsx($n,{style:{display:"flex",alignItems:"center"},"aria-label":"Plugin links",children:p})}),y.jsxs(Nt.Dropdown,{children:[u&&y.jsxs(Nt.Item,{component:"a",href:u,target:"_blank",rel:"noopener noreferrer",leftSection:y.jsx(o5,{size:16}),children:[o," on GitHub"]}),f&&y.jsx(Nt.Item,{component:"a",href:f,target:"_blank",rel:"noopener noreferrer",leftSection:y.jsx(u5,{size:16}),children:"Buy me a Coffee"})]})]}):p,y.jsxs(Qt,{gap:0,children:[o&&y.jsx(Ve,{size:"xs",lh:1,children:o}),r&&y.jsxs(Ve,{size:"xs",c:"dimmed",lh:1,children:["v",r]})]})]}),y.jsxs(mt,{gap:"xs",wrap:"nowrap",children:[a.map(({key:v,label:x,icon:S,onClick:E,loading:C,active:R,count:T,variant:z,color:A})=>y.jsxs(b.Fragment,{children:[y.jsxs(Dt,{size:"sm",variant:z,color:A,leftSection:y.jsx(S,{size:16}),loading:C,onClick:E,visibleFrom:"xs",...D1(R),children:[x,T>0?` (${T})`:""]}),y.jsx(Yt,{size:"lg",variant:"default",loading:C,hiddenFrom:"xs","aria-label":x,onClick:E,...D1(R),children:y.jsx(S,{size:18})})]},v)),l,c&&y.jsxs(Qt,{gap:0,align:"flex-end",children:[h&&y.jsx(Ve,{size:"xs",lh:1,children:h}),y.jsx($n,{onClick:c,children:y.jsx(Ve,{size:"xs",c:"dimmed",lh:1,children:"Logout"})})]})]})]})})}const ep="dispatch_ui_kit_last_username";function k5({logoUrl:e,appName:o,description:r,onLogin:a,onLoggedIn:l}){const c=localStorage.getItem(ep)??"",[u,f]=b.useState(c),[h,p]=b.useState(""),[g,v]=b.useState(!!c),[x,S]=b.useState(""),[E,C]=b.useState(!1);async function R(T){T.preventDefault(),C(!0),S("");try{await a(u,h),g?localStorage.setItem(ep,u):localStorage.removeItem(ep),l()}catch(z){S(z.message||"Login failed")}finally{C(!1)}}return y.jsx(ms,{mih:"100dvh",bg:"dark.8",children:y.jsxs(Qt,{align:"center",gap:"lg",w:340,px:"md",children:[y.jsx("img",{src:e,style:{height:40,width:"auto"},alt:o}),r&&y.jsx(Ve,{size:"sm",c:"dimmed",ta:"center",children:r}),y.jsx(Qi,{withBorder:!0,p:"xl",radius:"md",w:"100%",children:y.jsx("form",{onSubmit:R,children:y.jsxs(Qt,{gap:"sm",children:[x&&y.jsx(Iu,{icon:y.jsx(Uw,{size:16}),color:"red",variant:"light",py:"xs",children:x}),y.jsx(Yi,{label:"Username",autoComplete:"username",value:u,onChange:T=>f(T.currentTarget.value),required:!0}),y.jsx(af,{label:"Password",autoComplete:"current-password",value:h,onChange:T=>p(T.currentTarget.value),required:!0}),y.jsx(el,{label:"Remember me",checked:g,onChange:T=>v(T.currentTarget.checked)}),y.jsx(Dt,{type:"submit",loading:E,fullWidth:!0,mt:"xs",children:"Sign in"})]})})})]})})}function Xw({action:e,onClose:o}){return e?y.jsxs(Tn,{opened:!!e,onClose:o,title:e.title,size:"sm",centered:!0,children:[y.jsx(Ve,{size:"sm",children:e.message}),y.jsxs(mt,{mt:"md",justify:"flex-end",children:[y.jsx(Dt,{variant:"default",onClick:o,children:"Cancel"}),y.jsx(Dt,{color:e.color??"blue",loading:e.loading,onClick:()=>{o(),e.onConfirm()},children:e.confirmLabel??"Confirm"})]})]}):null}function H5({tokenKey:e,basePath:o,onUnauthorized:r,refreshTokenKey:a=`${e}_refresh`,refreshPath:l="/auth/refresh",usernameKey:c=`${e}_username`}={}){const u=o??(typeof window<"u"&&window.__BASE_PATH__||"/");function f(){return localStorage.getItem(e)}function h(N){N?localStorage.setItem(e,N):localStorage.removeItem(e)}function p(){return localStorage.getItem(a)}function g(N){N?localStorage.setItem(a,N):localStorage.removeItem(a)}function v(){return localStorage.getItem(c)}function x(N){N?localStorage.setItem(c,N):localStorage.removeItem(c)}async function S(N,B={}){const M=f(),$={"Content-Type":"application/json",...B.headers||{}};M&&($.Authorization=`Bearer ${M}`);const L=await fetch(`${u}api${N}`,{...B,headers:$});if(L.status===401){const H=new Error("Session expired, please log in again");throw H.status=401,H}if(!L.ok){let H=`Request failed (${L.status})`;try{H=(await L.json()).error||H}catch{}throw new Error(H)}return L.status===204?null:L.json()}let E=null;function C(){return E||(E=(async()=>{const N=p();if(!N)throw new Error("No refresh token");const B=await fetch(`${u}api${l}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refresh:N})});if(!B.ok)throw new Error("Refresh failed");const M=await B.json();h(M.access)})().finally(()=>{E=null})),E}async function R(N,B={}){try{return await S(N,B)}catch(M){if(M.status!==401)throw M;if(p())try{return await C(),await S(N,B)}catch{}throw h(null),g(null),x(null),r?.(M),M}}async function T(N,B,M="/auth/token"){const $=await S(M,{method:"POST",body:JSON.stringify({username:N,password:B})});return h($.access),$.refresh&&g($.refresh),x(N),$}function z(){h(null),g(null),x(null)}function A(){return!!f()}return{request:R,login:T,logout:z,isAuthenticated:A,getToken:f,getUsername:v,basePath:u}}function qw(e,{onOptimisticChange:o,shouldReload:r,onReload:a,onSaved:l,onError:c,delayMs:u=700}={}){const f=b.useRef({});return b.useCallback((h,p,g)=>{o?.({[h]:p});const v={[h]:p},x=async()=>{try{await e(v),l?.(v),r?.(h)&&await a?.()}catch(S){c?.(S)}};return clearTimeout(f.current[h]),g?x():(f.current[h]=setTimeout(x,u),Promise.resolve())},[e,o,r,a,l,c,u])}function U5({label:e,description:o}){return o?y.jsxs(mt,{gap:4,align:"center",wrap:"nowrap",children:[y.jsx("span",{children:e}),y.jsx(Ts,{label:o,multiline:!0,maw:260,withArrow:!0,position:"top-start",events:{hover:!0,focus:!0,touch:!0},children:y.jsx(Yt,{size:"xs",variant:"transparent",c:"dimmed",tabIndex:-1,style:{cursor:"default",flexShrink:0},children:y.jsx(b5,{size:13})})})]}):e}function Op({field:e,value:o,onChange:r}){const a={label:y.jsx(U5,{label:e.label,description:e.description})};switch(e.type){case"select":{const l=new Set,c=(e.options??[]).reduce((u,f)=>{const h=String(f.value);return l.has(h)||(l.add(h),u.push({value:h,label:f.label})),u},[]);return y.jsx(Vi,{...a,data:c,value:String(o??e.default??""),onChange:r,allowDeselect:!1})}case"number":return y.jsx(Ca,{...a,value:o??e.default??0,min:e.min,max:e.max,placeholder:e.placeholder,onChange:r});case"string":{const l=e.input_type==="password"?af:Yi;return y.jsx(l,{...a,value:o??e.default??"",placeholder:e.placeholder,onChange:c=>r(c.currentTarget.value)})}default:return null}}function Iw({title:e,defaultOpened:o=!1,trailingAction:r,as:a="Paper",children:l}){const[c,u]=b.useState(o);return y.jsxs(a==="Card"?Zu:Qi,{withBorder:!0,radius:"md",p:a==="Card"?0:void 0,children:[y.jsx($n,{w:"100%",p:"md",onClick:()=>u(f=>!f),children:y.jsxs(mt,{justify:"space-between",children:[y.jsxs(mt,{gap:"xs",children:[c?y.jsx(Pw,{size:16}):y.jsx(i5,{size:16}),y.jsx(Ve,{size:"sm",fw:600,children:e})]}),r]})}),y.jsx(rm,{in:c,children:l})]})}function P5({fields:e,warnings:o=[],values:r,onSave:a,onOptimisticChange:l,shouldReload:c,onReload:u,onSaved:f,onError:h,title:p="Global Settings"}){const g=qw(a,{onOptimisticChange:l,shouldReload:c,onReload:u,onSaved:f,onError:h});return y.jsxs(Qt,{gap:"xs",children:[o.map(v=>y.jsxs(Iu,{icon:y.jsx(Uw,{size:16}),color:"yellow",variant:"light",children:[y.jsx(Ve,{size:"sm",fw:500,children:v.label}),v.description&&y.jsx(Ve,{size:"xs",c:"dimmed",mt:2,children:v.description})]},v.id)),y.jsx(Iw,{title:p,children:y.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:"var(--mantine-spacing-sm)",padding:"var(--mantine-spacing-md)",paddingTop:0},children:e.map(v=>y.jsx(Op,{field:v,value:r[v.id],onChange:x=>g(v.id,x,v.type!=="string")},v.id))})})]})}function V5(){for(var e=arguments.length,o=new Array(e),r=0;ra=>{o.forEach(l=>l(a))},o)}const sf=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function al(e){const o=Object.prototype.toString.call(e);return o==="[object Window]"||o==="[object global]"}function pg(e){return"nodeType"in e}function _n(e){var o,r;return e?al(e)?e:pg(e)&&(o=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?o:window:window}function mg(e){const{Document:o}=_n(e);return e instanceof o}function Ds(e){return al(e)?!1:e instanceof _n(e).HTMLElement}function Fw(e){return e instanceof _n(e).SVGElement}function il(e){return e?al(e)?e.document:pg(e)?mg(e)?e:Ds(e)||Fw(e)?e.ownerDocument:document:document:document}const Ao=sf?b.useLayoutEffect:b.useEffect;function gg(e){const o=b.useRef(e);return Ao(()=>{o.current=e}),b.useCallback(function(){for(var r=arguments.length,a=new Array(r),l=0;l{e.current=setInterval(a,l)},[]),r=b.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[o,r]}function vs(e,o){o===void 0&&(o=[e]);const r=b.useRef(e);return Ao(()=>{r.current!==e&&(r.current=e)},o),r}function Ns(e,o){const r=b.useRef();return b.useMemo(()=>{const a=e(r.current);return r.current=a,a},[...o])}function Cu(e){const o=gg(e),r=b.useRef(null),a=b.useCallback(l=>{l!==r.current&&o?.(l,r.current),r.current=l},[]);return[r,a]}function jp(e){const o=b.useRef();return b.useEffect(()=>{o.current=e},[e]),o.current}let tp={};function As(e,o){return b.useMemo(()=>{if(o)return o;const r=tp[e]==null?0:tp[e]+1;return tp[e]=r,e+"-"+r},[e,o])}function Zw(e){return function(o){for(var r=arguments.length,a=new Array(r>1?r-1:0),l=1;l{const f=Object.entries(u);for(const[h,p]of f){const g=c[h];g!=null&&(c[h]=g+e*p)}return c},{...o})}}const $i=Zw(1),Eu=Zw(-1);function G5(e){return"clientX"in e&&"clientY"in e}function vg(e){if(!e)return!1;const{KeyboardEvent:o}=_n(e.target);return o&&e instanceof o}function X5(e){if(!e)return!1;const{TouchEvent:o}=_n(e.target);return o&&e instanceof o}function Bp(e){if(X5(e)){if(e.touches&&e.touches.length){const{clientX:o,clientY:r}=e.touches[0];return{x:o,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:o,clientY:r}=e.changedTouches[0];return{x:o,y:r}}}return G5(e)?{x:e.clientX,y:e.clientY}:null}const ys=Object.freeze({Translate:{toString(e){if(!e)return;const{x:o,y:r}=e;return"translate3d("+(o?Math.round(o):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:o,scaleY:r}=e;return"scaleX("+o+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[ys.Translate.toString(e),ys.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:o,duration:r,easing:a}=e;return o+" "+r+"ms "+a}}}),N1="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function q5(e){return e.matches(N1)?e:e.querySelector(N1)}const I5={display:"none"};function F5(e){let{id:o,value:r}=e;return Ye.createElement("div",{id:o,style:I5},r)}function Z5(e){let{id:o,announcement:r,ariaLiveType:a="assertive"}=e;const l={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Ye.createElement("div",{id:o,style:l,role:"status","aria-live":a,"aria-atomic":!0},r)}function Q5(){const[e,o]=b.useState("");return{announce:b.useCallback(a=>{a!=null&&o(a)},[]),announcement:e}}const Qw=b.createContext(null);function K5(e){const o=b.useContext(Qw);b.useEffect(()=>{if(!o)throw new Error("useDndMonitor must be used within a children of ");return o(e)},[e,o])}function W5(){const[e]=b.useState(()=>new Set),o=b.useCallback(a=>(e.add(a),()=>e.delete(a)),[e]);return[b.useCallback(a=>{let{type:l,event:c}=a;e.forEach(u=>{var f;return(f=u[l])==null?void 0:f.call(u,c)})},[e]),o]}const J5={draggable:` + `),c=!1),Object.assign(Object.assign({},e),{allowNegative:c})}function Dz(e){e=_z(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var o=e.suffix,r=e.allowNegative,a=e.allowLeadingZeros,l=e.onKeyDown;l===void 0&&(l=Pr);var c=e.onBlur;c===void 0&&(c=Pr);var u=e.thousandSeparator,f=e.decimalScale,h=e.fixedDecimalScale,p=e.prefix;p===void 0&&(p="");var g=e.defaultValue,v=e.value,x=e.valueIsNumericString,S=e.onValueChange,E=vw(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),C=rf(e),R=C.decimalSeparator,T=C.allowedDecimalSeparators,z=function(j){return b1(j,e)},A=function(j,k){return Rz(j,k,e)},N=Yr(v)?g:v,B=x??Ez(N,p,o);Yr(v)?Yr(g)||(B=B||typeof g=="number"):B=B||typeof v=="number";var M=function(j){return yw(j)?j:(typeof j=="number"&&(j=Sw(j)),B&&typeof f=="number"?v1(j,f,!!h):j)},$=Cw(M(v),M(g),!!B,z,A,S),L=$[0],H=L.numAsString,I=L.formattedValue,Y=$[1],X=function(j){var k=j.target,V=j.key,P=k.selectionStart,Z=k.selectionEnd,D=k.value;if(D===void 0&&(D=""),(V==="Backspace"||V==="Delete")&&ZD?!1:Z>=ie.start&&Z=o,l=r===void 0||e<=r;return a&&l}const jz={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0},Bz=(e,{size:o})=>({controls:{"--ni-chevron-size":qe(o,"ni-chevron-size")}});function $z(e,o,r){const a=e.toString().replace(/^0+/,""),l=parseFloat(a);return Number.isNaN(l)?a:l>Number.MAX_SAFE_INTEGER?o!==void 0?String(o):a:lu(l,r,o)}const Ca=ge((e,o)=>{const r=ce("NumberInput",jz,e),{className:a,classNames:l,styles:c,unstyled:u,vars:f,onChange:h,onValueChange:p,value:g,defaultValue:v,max:x,min:S,step:E,hideControls:C,rightSection:R,isAllowed:T,clampBehavior:z,onBlur:A,allowDecimal:N,decimalScale:B,onKeyDown:M,onKeyDownCapture:$,handlersRef:L,startValue:H,disabled:I,rightSectionPointerEvents:Y,allowNegative:X,readOnly:ee,size:ne,rightSectionWidth:re,stepHoldInterval:j,stepHoldDelay:k,allowLeadingZeros:V,withKeyboardEvents:P,trimLeadingZeroesOnBlur:Z,...D}=r,O=_e({name:"NumberInput",classes:_p,props:r,classNames:l,styles:c,unstyled:u,vars:f,varsResolver:Bz}),{resolvedClassNames:q,resolvedStyles:W}=Gi({classNames:l,styles:c,props:r}),[ie,ue]=Wn({value:g,defaultValue:v,finalValue:"",onChange:h}),ve=k!==void 0&&j!==void 0,fe=b.useRef(null),be=b.useRef(null),ye=b.useRef(0),Xe=(de,Re)=>{Re.source==="event"&&ue(Oz(de.floatValue,de.value)&&!Az.test(de.value)&&!(V&&zz.test(de.value))?de.floatValue:de.value),p?.(de,Re)},Ne=de=>{const Re=String(de).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return Re?Math.max(0,(Re[1]?Re[1].length:0)-(Re[2]?+Re[2]:0)):0},We=de=>{fe.current&&typeof de<"u"&&fe.current.setSelectionRange(de,de)},Be=b.useRef(hp);Be.current=()=>{if(!Zh(ie))return;let de;const Re=Ne(ie),dt=Ne(E),ot=Math.max(Re,dt),yt=10**ot;if(!Dp(ie)&&(typeof ie!="number"||Number.isNaN(ie)))de=lu(H,S,x);else if(x!==void 0){const wt=(Math.round(Number(ie)*yt)+Math.round(E*yt))/yt;de=wt<=x?wt:x}else de=(Math.round(Number(ie)*yt)+Math.round(E*yt))/yt;const Je=de.toFixed(ot);ue(parseFloat(Je)),p?.({floatValue:parseFloat(Je),formattedValue:Je,value:Je},{source:"increment"}),setTimeout(()=>We(fe.current?.value.length),0)};const nt=b.useRef(hp);nt.current=()=>{if(!Zh(ie))return;let de;const Re=S!==void 0?S:X?Number.MIN_SAFE_INTEGER:0,dt=Ne(ie),ot=Ne(E),yt=Math.max(dt,ot),Je=10**yt;if(!Dp(ie)&&typeof ie!="number"||Number.isNaN(ie))de=lu(H,Re,x);else{const on=(Math.round(Number(ie)*Je)-Math.round(E*Je))/Je;de=Re!==void 0&&onWe(fe.current?.value.length),0)};const vt=de=>{M?.(de),!(ee||!P)&&(de.key==="ArrowUp"&&(de.preventDefault(),Be.current()),de.key==="ArrowDown"&&(de.preventDefault(),nt.current()))},pe=de=>{if($?.(de),de.key==="Backspace"){const Re=fe.current;Re.selectionStart===0&&Re.selectionStart===Re.selectionEnd&&(de.preventDefault(),window.setTimeout(()=>We(0),0))}},me=de=>{let Re=ie;z==="blur"&&typeof Re=="number"&&(Re=lu(Re,S,x)),Z&&typeof Re=="string"&&Ne(Re)<15&&(Re=$z(Re,x,S)),ie!==Re&&ue(Re),A?.(de)};mu(L,{increment:Be.current,decrement:nt.current});const we=de=>{de?Be.current():nt.current(),ye.current+=1},De=de=>{if(we(de),ve){const Re=typeof j=="number"?j:j(ye.current);be.current=window.setTimeout(()=>De(de),Re)}},Ae=(de,Re)=>{de.preventDefault(),fe.current?.focus(),we(Re),ve&&(be.current=window.setTimeout(()=>De(Re),k))},xe=()=>{be.current&&window.clearTimeout(be.current),be.current=null,ye.current=0},$e=y.jsxs("div",{...O("controls"),children:[y.jsx($n,{...O("control"),tabIndex:-1,"aria-hidden":!0,disabled:I||typeof ie=="number"&&x!==void 0&&ie>=x,mod:{direction:"up"},onMouseDown:de=>de.preventDefault(),onPointerDown:de=>{Ae(de,!0)},onPointerUp:xe,onPointerLeave:xe,children:y.jsx(x1,{direction:"up"})}),y.jsx($n,{...O("control"),tabIndex:-1,"aria-hidden":!0,disabled:I||typeof ie=="number"&&S!==void 0&&ie<=S,mod:{direction:"down"},onMouseDown:de=>de.preventDefault(),onPointerDown:de=>{Ae(de,!1)},onPointerUp:xe,onPointerLeave:xe,children:y.jsx(x1,{direction:"down"})})]});return y.jsx(Mo,{component:Nz,allowNegative:X,className:zt(_p.root,a),size:ne,...D,readOnly:ee,disabled:I,value:ie,getInputRef:Mt(o,fe),onValueChange:Xe,rightSection:C||ee||!Zh(ie)?R:R||$e,classNames:q,styles:W,unstyled:u,__staticSelector:"NumberInput",decimalScale:N?B:0,onKeyDown:vt,onKeyDownCapture:pe,rightSectionPointerEvents:Y??(I?"none":void 0),rightSectionWidth:re??`var(--ni-right-section-width-${ne||"sm"})`,allowLeadingZeros:V,onBlur:me,isAllowed:de=>z==="strict"?T?T(de)&&S1(de.floatValue,S,x):S1(de.floatValue,S,x):T?T(de):!0})});Ca.classes={...Mo.classes,..._p};Ca.displayName="@mantine/core/NumberInput";const Lz=({reveal:e})=>y.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{width:"var(--psi-icon-size)",height:"var(--psi-icon-size)"},children:y.jsx("path",{d:e?"M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L10.6828 3.61012C9.70652 3.21671 8.63759 3 7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C0.902945 9.08812 2.02314 10.1861 3.36061 10.9323L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L4.31723 11.3899C5.29348 11.7833 6.36241 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C14.0971 5.9119 12.9769 4.81391 11.6394 4.06771L13.3536 2.35355ZM9.90428 4.38861C9.15332 4.1361 8.34759 4 7.5 4C4.80285 4 2.52952 5.37816 1.09622 7.50001C1.87284 8.6497 2.89609 9.58106 4.09974 10.1931L9.90428 4.38861ZM5.09572 10.6114L10.9003 4.80685C12.1039 5.41894 13.1272 6.35031 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11C6.65241 11 5.84668 10.8639 5.09572 10.6114Z":"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})});var Np={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const kz={visibilityToggleIcon:Lz},Hz=(e,{size:o})=>({root:{"--psi-icon-size":qe(o,"psi-icon-size"),"--psi-button-size":qe(o,"psi-button-size")}}),af=ge((e,o)=>{const r=ce("PasswordInput",kz,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,required:p,error:g,leftSection:v,disabled:x,id:S,variant:E,inputContainer:C,description:R,label:T,size:z,errorProps:A,descriptionProps:N,labelProps:B,withAsterisk:M,inputWrapperOrder:$,wrapperProps:L,radius:H,rightSection:I,rightSectionWidth:Y,rightSectionPointerEvents:X,leftSectionWidth:ee,visible:ne,defaultVisible:re,onVisibilityChange:j,visibilityToggleIcon:k,visibilityToggleButtonProps:V,rightSectionProps:P,leftSectionProps:Z,leftSectionPointerEvents:D,withErrorStyles:O,mod:q,...W}=r,ie=Jn(S),[ue,ve]=Wn({value:ne,defaultValue:re,finalValue:!1,onChange:j}),fe=()=>ve(!ue),be=_e({name:"PasswordInput",classes:Np,props:r,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:Hz}),{resolvedClassNames:ye,resolvedStyles:Xe}=Gi({classNames:a,styles:u,props:r}),{styleProps:Ne,rest:We}=Xi(W),Be=k,nt=A?.id||`${ie}-error`,vt=N?.id||`${ie}-description`,we=`${!!g&&typeof g!="boolean"?nt:""} ${!!R?vt:""}`,De=we.trim().length>0?we.trim():void 0,Ae=y.jsx(Yt,{...be("visibilityToggle"),disabled:x,radius:H,"aria-hidden":!V,tabIndex:-1,...V,variant:V?.variant??"subtle",color:"gray",unstyled:f,onTouchEnd:xe=>{xe.preventDefault(),V?.onTouchEnd?.(xe),fe()},onMouseDown:xe=>{xe.preventDefault(),V?.onMouseDown?.(xe),fe()},onKeyDown:xe=>{V?.onKeyDown?.(xe),xe.key===" "&&(xe.preventDefault(),fe())},children:y.jsx(Be,{reveal:ue})});return y.jsx(St.Wrapper,{required:p,id:ie,label:T,error:g,description:R,size:z,classNames:ye,styles:Xe,__staticSelector:"PasswordInput",unstyled:f,withAsterisk:M,inputWrapperOrder:$,inputContainer:C,variant:E,labelProps:{...B,htmlFor:ie},descriptionProps:{...N,id:vt},errorProps:{...A,id:nt},mod:q,...be("root"),...Ne,...L,children:y.jsx(St,{component:"div",error:g,leftSection:v,size:z,classNames:{...ye,input:zt(Np.input,ye.input)},styles:Xe,radius:H,disabled:x,__staticSelector:"PasswordInput",rightSectionWidth:Y,rightSection:I??Ae,variant:E,unstyled:f,leftSectionWidth:ee,rightSectionPointerEvents:X||"all",rightSectionProps:P,leftSectionProps:Z,leftSectionPointerEvents:D,withAria:!1,withErrorStyles:O,children:y.jsx("input",{required:p,"data-invalid":!!g||void 0,"data-with-left-section":!!v||void 0,...be("innerInput"),disabled:x,id:ie,ref:o,...We,"aria-describedby":De,autoComplete:We.autoComplete||"off",type:ue?"text":"password"})})})});af.classes={...Mo.classes,...Np};af.displayName="@mantine/core/PasswordInput";const Uz={duration:100,transition:"fade"};function Pz(e,o){return{...Uz,...o,...e}}function Vz({offset:e,position:o,defaultOpened:r}){const[a,l]=b.useState(r),c=b.useRef(null),{x:u,y:f,elements:h,refs:p,update:g,placement:v}=mm({placement:o,middleware:[fm({crossAxis:!0,padding:5,rootBoundary:"document"})]}),x=v.includes("right")?e:o.includes("left")?e*-1:0,S=v.includes("bottom")?e:o.includes("top")?e*-1:0,E=b.useCallback(({clientX:C,clientY:R})=>{p.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:C,y:R,left:C+x,top:R+S,right:C,bottom:R}}})},[h.reference]);return b.useEffect(()=>{if(p.floating.current){const C=c.current;C.addEventListener("mousemove",E);const R=nr(p.floating.current);return R.forEach(T=>{T.addEventListener("scroll",g)}),()=>{C.removeEventListener("mousemove",E),R.forEach(T=>{T.removeEventListener("scroll",g)})}}},[h.reference,p.floating.current,g,E,a]),{handleMouseMove:E,x:u,y:f,opened:a,setOpened:l,boundaryRef:c,floating:p.setFloating}}var lf={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const Yz={refProp:"ref",withinPortal:!0,offset:10,defaultOpened:!1,position:"right",zIndex:vo("popover")},Gz=(e,{radius:o,color:r})=>({tooltip:{"--tooltip-radius":o===void 0?void 0:kt(o),"--tooltip-bg":r?Zt(r,e):void 0,"--tooltip-color":r?"var(--mantine-color-white)":void 0}}),ig=ge((e,o)=>{const r=ce("TooltipFloating",Yz,e),{children:a,refProp:l,withinPortal:c,style:u,className:f,classNames:h,styles:p,unstyled:g,radius:v,color:x,label:S,offset:E,position:C,multiline:R,zIndex:T,disabled:z,defaultOpened:A,variant:N,vars:B,portalProps:M,...$}=r,L=cn(),H=_e({name:"TooltipFloating",props:r,classes:lf,className:f,style:u,classNames:h,styles:p,unstyled:g,rootSelector:"tooltip",vars:B,varsResolver:Gz}),{handleMouseMove:I,x:Y,y:X,opened:ee,boundaryRef:ne,floating:re,setOpened:j}=Vz({offset:E,position:C,defaultOpened:A});if(!ar(a))throw new Error("[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const k=Mt(ne,Au(a),o),V=a.props,P=D=>{V.onMouseEnter?.(D),I(D),j(!0)},Z=D=>{V.onMouseLeave?.(D),j(!1)};return y.jsxs(y.Fragment,{children:[y.jsx(za,{...M,withinPortal:c,children:y.jsx(he,{...$,...H("tooltip",{style:{...om(u,L),zIndex:T,display:!z&&ee?"block":"none",top:(X&&Math.round(X))??"",left:(Y&&Math.round(Y))??""}}),variant:N,ref:re,mod:{multiline:R},children:S})}),b.cloneElement(a,{...V,[l]:k,onMouseEnter:P,onMouseLeave:Z})]})});ig.classes=lf;ig.displayName="@mantine/core/TooltipFloating";const Ew=b.createContext(!1),Xz=Ew.Provider,qz=()=>b.useContext(Ew),Iz={openDelay:0,closeDelay:0};function lg(e){const{openDelay:o,closeDelay:r,children:a}=ce("TooltipGroup",Iz,e);return y.jsx(Xz,{value:!0,children:y.jsx(FD,{delay:{open:o,close:r},children:a})})}lg.displayName="@mantine/core/TooltipGroup";lg.extend=e=>e;function Fz(e){if(e===void 0)return{shift:!0,flip:!0};const o={...e};return e.shift===void 0&&(o.shift=!0),e.flip===void 0&&(o.flip=!0),o}function Zz(e){const o=Fz(e.middlewares),r=[Zx(e.offset)];return o.shift&&r.push(fm(typeof o.shift=="boolean"?{padding:8}:{padding:8,...o.shift})),o.flip&&r.push(typeof o.flip=="boolean"?xu():xu(o.flip)),r.push(Qx({element:e.arrowRef,padding:e.arrowOffset})),o.inline?r.push(typeof o.inline=="boolean"?as():as(o.inline)):e.inline&&r.push(as()),r}function Qz(e){const[o,r]=b.useState(e.defaultOpened),l=typeof e.opened=="boolean"?e.opened:o,c=qz(),u=Jn(),f=b.useCallback(M=>{r(M),M&&z(u)},[u]),{x:h,y:p,context:g,refs:v,update:x,placement:S,middlewareData:{arrow:{x:E,y:C}={}}}=mm({strategy:e.strategy,placement:e.position,open:l,onOpenChange:f,middleware:Zz(e)}),{delay:R,currentId:T,setCurrentId:z}=ZD(g,{id:u}),{getReferenceProps:A,getFloatingProps:N}=nN([qD(g,{enabled:e.events?.hover,delay:c?R:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events?.touch}),tN(g,{enabled:e.events?.focus,visibleOnly:!0}),rN(g,{role:"tooltip"}),JD(g,{enabled:typeof e.opened>"u"})]);wS({opened:l,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:v,update:x}}),rr(()=>{e.onPositionChange?.(S)},[S]);const B=l&&T&&T!==u;return{x:h,y:p,arrowX:E,arrowY:C,reference:v.setReference,floating:v.setFloating,getFloatingProps:N,getReferenceProps:A,isGroupPhase:B,opened:l,placement:S}}const w1={position:"top",refProp:"ref",withinPortal:!0,inline:!1,defaultOpened:!1,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},events:{hover:!0,focus:!1,touch:!1},zIndex:vo("popover"),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},Kz=(e,{radius:o,color:r})=>({tooltip:{"--tooltip-radius":o===void 0?void 0:kt(o),"--tooltip-bg":r?Zt(r,e):void 0,"--tooltip-color":r?"var(--mantine-color-white)":void 0}}),Ts=ge((e,o)=>{const r=ce("Tooltip",w1,e),{children:a,position:l,refProp:c,label:u,openDelay:f,closeDelay:h,onPositionChange:p,opened:g,defaultOpened:v,withinPortal:x,radius:S,color:E,classNames:C,styles:R,unstyled:T,style:z,className:A,withArrow:N,arrowSize:B,arrowOffset:M,arrowRadius:$,arrowPosition:L,offset:H,transitionProps:I,multiline:Y,events:X,zIndex:ee,disabled:ne,positionDependencies:re,onClick:j,onMouseEnter:k,onMouseLeave:V,inline:P,variant:Z,keepMounted:D,vars:O,portalProps:q,mod:W,floatingStrategy:ie,middlewares:ue,...ve}=ce("Tooltip",w1,r),{dir:fe}=qi(),be=b.useRef(null),ye=Qz({position:mS(fe,l),closeDelay:h,openDelay:f,onPositionChange:p,opened:g,defaultOpened:v,events:X,arrowRef:be,arrowOffset:M,offset:typeof H=="number"?H+(N?B/2:0):H,positionDependencies:[...re,a],inline:P,strategy:ie,middlewares:ue}),Xe=_e({name:"Tooltip",props:r,classes:lf,className:A,style:z,classNames:C,styles:R,unstyled:T,rootSelector:"tooltip",vars:O,varsResolver:Kz});if(!ar(a))throw new Error("[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const Ne=Mt(ye.reference,Au(a),o),We=Pz(I,{duration:100,transition:"fade"}),Be=a.props;return y.jsxs(y.Fragment,{children:[y.jsx(za,{...q,withinPortal:x,children:y.jsx(qr,{...We,keepMounted:D,mounted:!ne&&!!ye.opened,duration:ye.isGroupPhase?10:We.duration,children:nt=>y.jsxs(he,{...ve,"data-fixed":ie==="fixed"||void 0,variant:Z,mod:[{multiline:Y},W],...ye.getFloatingProps({ref:ye.floating,className:Xe("tooltip").className,style:{...Xe("tooltip").style,...nt,zIndex:ee,top:ye.y??0,left:ye.x??0}}),children:[u,y.jsx(xm,{ref:be,arrowX:ye.arrowX,arrowY:ye.arrowY,visible:N,position:ye.placement,arrowSize:B,arrowOffset:M,arrowRadius:$,arrowPosition:L,...Xe("arrow")})]})})}),b.cloneElement(a,ye.getReferenceProps({onClick:j,onMouseEnter:k,onMouseLeave:V,onMouseMove:r.onMouseMove,onPointerDown:r.onPointerDown,onPointerEnter:r.onPointerEnter,className:zt(A,Be.className),...Be,[c]:Ne}))]})});Ts.classes=lf;Ts.displayName="@mantine/core/Tooltip";Ts.Floating=ig;Ts.Group=lg;var Rw={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const Wz={withItemsBorders:!0},Jz=(e,{radius:o,color:r,transitionDuration:a,size:l,transitionTimingFunction:c})=>({root:{"--sc-radius":o===void 0?void 0:kt(o),"--sc-color":r?Zt(r,e):void 0,"--sc-shadow":r?void 0:"var(--mantine-shadow-xs)","--sc-transition-duration":a===void 0?void 0:`${a}ms`,"--sc-transition-timing-function":c,"--sc-padding":qe(l,"sc-padding"),"--sc-font-size":nn(l)}}),sg=ge((e,o)=>{const r=ce("SegmentedControl",Wz,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,data:p,value:g,defaultValue:v,onChange:x,size:S,name:E,disabled:C,readOnly:R,fullWidth:T,orientation:z,radius:A,color:N,transitionDuration:B,transitionTimingFunction:M,variant:$,autoContrast:L,withItemsBorders:H,mod:I,...Y}=r,X=_e({name:"SegmentedControl",props:r,classes:Rw,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:Jz}),ee=cn(),ne=p.map(fe=>typeof fe=="string"?{label:fe,value:fe}:fe),re=uT(),[j,k]=b.useState(pu()),[V,P]=b.useState(null),[Z,D]=b.useState({}),O=(fe,be)=>{Z[be]=fe,D(Z)},[q,W]=Wn({value:g,defaultValue:v,finalValue:Array.isArray(p)?ne.find(fe=>!fe.disabled)?.value??p[0]?.value??null:null,onChange:x}),ie=Jn(E),ue=ne.map(fe=>b.createElement(he,{...X("control"),mod:{active:q===fe.value,orientation:z},key:fe.value},b.createElement("input",{...X("input"),disabled:C||fe.disabled,type:"radio",name:ie,value:fe.value,id:`${ie}-${fe.value}`,checked:q===fe.value,onChange:()=>!R&&W(fe.value),"data-focus-ring":ee.focusRing,key:`${fe.value}-input`}),b.createElement(he,{component:"label",...X("label"),mod:{active:q===fe.value&&!(C||fe.disabled),disabled:C||fe.disabled,"read-only":R},htmlFor:`${ie}-${fe.value}`,ref:be=>O(be,fe.value),__vars:{"--sc-label-color":N!==void 0?Mu({color:N,theme:ee,autoContrast:L}):void 0},key:`${fe.value}-label`},y.jsx("span",{...X("innerLabel"),children:fe.label})))),ve=Mt(o,fe=>P(fe));return aT(()=>{k(pu())},[p.length]),p.length===0?null:y.jsxs(he,{...X("root"),variant:$,size:S,ref:ve,mod:[{"full-width":T,orientation:z,initialized:re,"with-items-borders":H},I],...Y,role:"radiogroup","data-disabled":C,children:[typeof q=="string"&&y.jsx(Tm,{target:Z[q],parent:V,component:"span",transitionDuration:"var(--sc-transition-duration)",...X("indicator")},j),ue]})});sg.classes=Rw;sg.displayName="@mantine/core/SegmentedControl";const eM={searchable:!1,withCheckIcon:!0,allowDeselect:!0,checkIconPosition:"left"},gs=ge((e,o)=>{const r=ce("Select",eM,e),{classNames:a,styles:l,unstyled:c,vars:u,dropdownOpened:f,defaultDropdownOpened:h,onDropdownClose:p,onDropdownOpen:g,onFocus:v,onBlur:x,onClick:S,onChange:E,data:C,value:R,defaultValue:T,selectFirstOptionOnChange:z,onOptionSubmit:A,comboboxProps:N,readOnly:B,disabled:M,filter:$,limit:L,withScrollArea:H,maxDropdownHeight:I,size:Y,searchable:X,rightSection:ee,checkIconPosition:ne,withCheckIcon:re,nothingFoundMessage:j,name:k,form:V,searchValue:P,defaultSearchValue:Z,onSearchChange:D,allowDeselect:O,error:q,rightSectionPointerEvents:W,id:ie,clearable:ue,clearButtonProps:ve,hiddenInputProps:fe,renderOption:be,onClear:ye,autoComplete:Xe,scrollAreaProps:Ne,__defaultRightSection:We,__clearSection:Be,__clearable:nt,chevronColor:vt,...pe}=r,me=b.useMemo(()=>P3(C),[C]),we=b.useMemo(()=>YS(me),[me]),De=Jn(ie),[Ae,xe,$e]=Wn({value:R,defaultValue:T,finalValue:null,onChange:E}),de=typeof Ae=="string"?we[Ae]:void 0,Re=sT(de),[dt,ot,yt]=Wn({value:P,defaultValue:Z,finalValue:de?de.label:"",onChange:D}),Je=Ym({opened:f,defaultOpened:h,onDropdownOpen:()=>{g?.(),Je.updateSelectedOptionIndex("active",{scrollIntoView:!0})},onDropdownClose:()=>{p?.(),Je.resetSelectedOption()}}),wt=st=>{ot(st),Je.resetSelectedOption()},{resolvedClassNames:on,resolvedStyles:Qr}=Gi({props:r,styles:l,classNames:a});b.useEffect(()=>{z&&Je.selectFirstOption()},[z,dt]),b.useEffect(()=>{R===null&&wt(""),typeof R=="string"&&de&&(Re?.value!==de.value||Re?.label!==de.label)&&wt(de.label)},[R,de]),b.useEffect(()=>{!$e&&!yt&&wt(typeof Ae=="string"&&we[Ae]?.label||"")},[C,Ae]);const jo=y.jsx(Pe.ClearButton,{...ve,onClear:()=>{xe(null,null),wt(""),ye?.()}}),Gt=ue&&!!Ae&&!M&&!B;return y.jsxs(y.Fragment,{children:[y.jsxs(Pe,{store:Je,__staticSelector:"Select",classNames:on,styles:Qr,unstyled:c,readOnly:B,onOptionSubmit:st=>{A?.(st);const Ct=O&&we[st].value===Ae?null:we[st],Kr=Ct?Ct.value:null;Kr!==Ae&&xe(Kr,Ct),!$e&&wt(typeof Kr=="string"&&Ct?.label||""),Je.closeDropdown()},size:Y,...N,children:[y.jsx(Pe.Target,{targetType:X?"input":"button",autoComplete:Xe,children:y.jsx(Mo,{id:De,ref:o,__defaultRightSection:y.jsx(Pe.Chevron,{size:Y,error:q,unstyled:c,color:vt}),__clearSection:jo,__clearable:Gt,rightSection:ee,rightSectionPointerEvents:W||(Gt?"all":"none"),...pe,size:Y,__staticSelector:"Select",disabled:M,readOnly:B||!X,value:dt,onChange:st=>{wt(st.currentTarget.value),Je.openDropdown(),z&&Je.selectFirstOption()},onFocus:st=>{X&&Je.openDropdown(),v?.(st)},onBlur:st=>{X&&Je.closeDropdown(),wt(Ae!=null&&we[Ae]?.label||""),x?.(st)},onClick:st=>{X?Je.openDropdown():Je.toggleDropdown(),S?.(st)},classNames:on,styles:Qr,unstyled:c,pointer:!X,error:q})}),y.jsx(xA,{data:me,hidden:B||M,filter:$,search:dt,limit:L,hiddenWhenEmpty:!j,withScrollArea:H,maxDropdownHeight:I,filterOptions:X&&de?.label!==dt,value:Ae,checkIconPosition:ne,withCheckIcon:re,nothingFoundMessage:j,unstyled:c,labelId:pe.label?`${De}-label`:void 0,"aria-label":pe.label?void 0:pe["aria-label"],renderOption:be,scrollAreaProps:Ne})]}),y.jsx(Pe.HiddenInput,{value:Ae,name:k,form:V,disabled:M,...fe})]})});gs.classes={...Mo.classes,...Pe.classes};gs.displayName="@mantine/core/Select";function tM({spacing:e,verticalSpacing:o,cols:r,selector:a}){const l=cn(),c=o===void 0?e:o,u=xs({"--sg-spacing-x":sn(Oi(e)),"--sg-spacing-y":sn(Oi(c)),"--sg-cols":Oi(r)?.toString()}),f=At(l.breakpoints).reduce((g,v)=>(g[v]||(g[v]={}),typeof e=="object"&&e[v]!==void 0&&(g[v]["--sg-spacing-x"]=sn(e[v])),typeof c=="object"&&c[v]!==void 0&&(g[v]["--sg-spacing-y"]=sn(c[v])),typeof r=="object"&&r[v]!==void 0&&(g[v]["--sg-cols"]=r[v]),g),{}),p=pp(At(f),l.breakpoints).filter(g=>At(f[g.value]).length>0).map(g=>({query:`(min-width: ${l.breakpoints[g.value]})`,styles:f[g.value]}));return y.jsx(Ou,{styles:u,media:p,selector:a})}function Qh(e){return typeof e=="object"&&e!==null?At(e):[]}function nM(e){return e.sort((o,r)=>us(o)-us(r))}function oM({spacing:e,verticalSpacing:o,cols:r}){const a=Array.from(new Set([...Qh(e),...Qh(o),...Qh(r)]));return nM(a)}function rM({spacing:e,verticalSpacing:o,cols:r,selector:a}){const l=o===void 0?e:o,c=xs({"--sg-spacing-x":sn(Oi(e)),"--sg-spacing-y":sn(Oi(l)),"--sg-cols":Oi(r)?.toString()}),u=oM({spacing:e,verticalSpacing:o,cols:r}),f=u.reduce((p,g)=>(p[g]||(p[g]={}),typeof e=="object"&&e[g]!==void 0&&(p[g]["--sg-spacing-x"]=sn(e[g])),typeof l=="object"&&l[g]!==void 0&&(p[g]["--sg-spacing-y"]=sn(l[g])),typeof r=="object"&&r[g]!==void 0&&(p[g]["--sg-cols"]=r[g]),p),{}),h=u.map(p=>({query:`simple-grid (min-width: ${p})`,styles:f[p]}));return y.jsx(Ou,{styles:c,container:h,selector:a})}var Tw={container:"m_925c2d2c",root:"m_2415a157"};const aM={cols:1,spacing:"md",type:"media"},cg=ge((e,o)=>{const r=ce("SimpleGrid",aM,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,cols:p,verticalSpacing:g,spacing:v,type:x,...S}=r,E=_e({name:"SimpleGrid",classes:Tw,props:r,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h}),C=zx();return x==="container"?y.jsxs(y.Fragment,{children:[y.jsx(rM,{...r,selector:`.${C}`}),y.jsx("div",{...E("container"),children:y.jsx(he,{ref:o,...E("root",{className:C}),...S})})]}):y.jsxs(y.Fragment,{children:[y.jsx(tM,{...r,selector:`.${C}`}),y.jsx(he,{ref:o,...E("root",{className:C}),...S})]})});cg.classes=Tw;cg.displayName="@mantine/core/SimpleGrid";var _w={root:"m_6d731127"};const iM={gap:"md",align:"stretch",justify:"flex-start"},lM=(e,{gap:o,align:r,justify:a})=>({root:{"--stack-gap":sn(o),"--stack-align":r,"--stack-justify":a}}),Qt=ge((e,o)=>{const r=ce("Stack",iM,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,align:p,justify:g,gap:v,variant:x,...S}=r,E=_e({name:"Stack",props:r,classes:_w,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:lM});return y.jsx(he,{ref:o,...E("root"),variant:x,...S})});Qt.classes=_w;Qt.displayName="@mantine/core/Stack";const Dw=b.createContext(null),sM=Dw.Provider,cM=()=>b.useContext(Dw),uM={},ug=ge((e,o)=>{const{value:r,defaultValue:a,onChange:l,size:c,wrapperProps:u,children:f,readOnly:h,...p}=ce("SwitchGroup",uM,e),[g,v]=Wn({value:r,defaultValue:a,finalValue:[],onChange:l}),x=S=>{const E=S.currentTarget.value;!h&&v(g.includes(E)?g.filter(C=>C!==E):[...g,E])};return y.jsx(sM,{value:{value:g,onChange:x,size:c},children:y.jsx(St.Wrapper,{size:c,ref:o,...u,...p,labelElement:"div",__staticSelector:"SwitchGroup",children:y.jsx(ew,{role:"group",children:f})})})});ug.classes=St.Wrapper.classes;ug.displayName="@mantine/core/SwitchGroup";var Nw={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const fM={labelPosition:"right",withThumbIndicator:!0},dM=(e,{radius:o,color:r,size:a})=>({root:{"--switch-radius":o===void 0?void 0:kt(o),"--switch-height":qe(a,"switch-height"),"--switch-width":qe(a,"switch-width"),"--switch-thumb-size":qe(a,"switch-thumb-size"),"--switch-label-font-size":qe(a,"switch-label-font-size"),"--switch-track-label-padding":qe(a,"switch-track-label-padding"),"--switch-color":r?Zt(r,e):void 0}}),Bi=ge((e,o)=>{const r=ce("Switch",fM,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,color:p,label:g,offLabel:v,onLabel:x,id:S,size:E,radius:C,wrapperProps:R,thumbIcon:T,checked:z,defaultChecked:A,onChange:N,labelPosition:B,description:M,error:$,disabled:L,variant:H,rootRef:I,mod:Y,withThumbIndicator:X,...ee}=r,ne=cM(),re=E||ne?.size,j=_e({name:"Switch",props:r,classes:Nw,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:dM}),{styleProps:k,rest:V}=Xi(ee),P=Jn(S),Z=ne?{checked:ne.value.includes(V.value),onChange:ne.onChange}:{},[D,O]=Wn({value:Z.checked??z,defaultValue:A,finalValue:!1});return y.jsxs(Gm,{...j("root"),__staticSelector:"Switch",__stylesApiProps:r,id:P,size:re,labelPosition:B,label:g,description:M,error:$,disabled:L,bodyElement:"label",labelElement:"span",classNames:a,styles:u,unstyled:f,"data-checked":Z.checked||z||void 0,variant:H,ref:I,mod:Y,...k,...R,children:[y.jsx("input",{...V,disabled:L,checked:D,"data-checked":Z.checked||z||void 0,onChange:q=>{ne?Z.onChange?.(q):N?.(q),O(q.currentTarget.checked)},id:P,ref:o,type:"checkbox",role:"switch",...j("input")}),y.jsxs(he,{"aria-hidden":"true",component:"span",mod:{error:$,"label-position":B,"without-labels":!x&&!v},...j("track"),children:[y.jsx(he,{component:"span",mod:{"reduce-motion":!0,"with-thumb-indicator":X&&!T},...j("thumb"),children:T}),y.jsx("span",{...j("trackLabel"),children:D?x:v})]})]})});Bi.classes={...Nw,...QS};Bi.displayName="@mantine/core/Switch";Bi.Group=ug;const[hM,pM]=zo("Table component was not found in the tree");var _s={table:"m_b23fa0ef",th:"m_4e7aa4f3",tr:"m_4e7aa4fd",td:"m_4e7aa4ef",tbody:"m_b2404537",thead:"m_b242d975",caption:"m_9e5a3ac7",scrollContainer:"m_a100c15",scrollContainerInner:"m_62259741"};function mM(e,o){if(!o)return;const r={};return o.columnBorder&&e.withColumnBorders&&(r["data-with-column-border"]=!0),o.rowBorder&&e.withRowBorders&&(r["data-with-row-border"]=!0),o.striped&&e.striped&&(r["data-striped"]=e.striped),o.highlightOnHover&&e.highlightOnHover&&(r["data-hover"]=!0),o.captionSide&&e.captionSide&&(r["data-side"]=e.captionSide),o.stickyHeader&&e.stickyHeader&&(r["data-sticky"]=!0),r}function Oa(e,o){const r=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,a=ge((l,c)=>{const u=ce(r,{},l),{classNames:f,className:h,style:p,styles:g,...v}=u,x=pM();return y.jsx(he,{component:e,ref:c,...mM(x,o),...x.getStyles(e,{className:h,classNames:f,style:p,styles:g,props:u}),...v})});return a.displayName=`@mantine/core/${r}`,a.classes=_s,a}const Ap=Oa("th",{columnBorder:!0}),Aw=Oa("td",{columnBorder:!0}),uu=Oa("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),zw=Oa("thead",{stickyHeader:!0}),Mw=Oa("tbody"),Ow=Oa("tfoot"),jw=Oa("caption",{captionSide:!0});function fg({data:e}){return y.jsxs(y.Fragment,{children:[e.caption&&y.jsx(jw,{children:e.caption}),e.head&&y.jsx(zw,{children:y.jsx(uu,{children:e.head.map((o,r)=>y.jsx(Ap,{children:o},r))})}),e.body&&y.jsx(Mw,{children:e.body.map((o,r)=>y.jsx(uu,{children:o.map((a,l)=>y.jsx(Aw,{children:a},l))},r))}),e.foot&&y.jsx(Ow,{children:y.jsx(uu,{children:e.foot.map((o,r)=>y.jsx(Ap,{children:o},r))})})]})}fg.displayName="@mantine/core/TableDataRenderer";const gM={type:"scrollarea"},vM=(e,{minWidth:o,maxHeight:r,type:a})=>({scrollContainer:{"--table-min-width":oe(o),"--table-max-height":oe(r),"--table-overflow":a==="native"?"auto":void 0}}),dg=ge((e,o)=>{const r=ce("TableScrollContainer",gM,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,children:p,minWidth:g,maxHeight:v,type:x,scrollAreaProps:S,...E}=r,C=_e({name:"TableScrollContainer",classes:_s,props:r,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:vM,rootSelector:"scrollContainer"});return y.jsx(he,{component:x==="scrollarea"?Aa:"div",...x==="scrollarea"?v?{offsetScrollbars:"xy",...S}:{offsetScrollbars:"x",...S}:{},ref:o,...C("scrollContainer"),...E,children:y.jsx("div",{...C("scrollContainerInner"),children:p})})});dg.classes=_s;dg.displayName="@mantine/core/TableScrollContainer";const yM={withRowBorders:!0,verticalSpacing:7},bM=(e,{layout:o,captionSide:r,horizontalSpacing:a,verticalSpacing:l,borderColor:c,stripedColor:u,highlightOnHoverColor:f,striped:h,highlightOnHover:p,stickyHeaderOffset:g,stickyHeader:v})=>({table:{"--table-layout":o,"--table-caption-side":r,"--table-horizontal-spacing":sn(a),"--table-vertical-spacing":sn(l),"--table-border-color":c?Zt(c,e):void 0,"--table-striped-color":h&&u?Zt(u,e):void 0,"--table-highlight-on-hover-color":p&&f?Zt(f,e):void 0,"--table-sticky-header-offset":v?oe(g):void 0}}),lt=ge((e,o)=>{const r=ce("Table",yM,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,horizontalSpacing:p,verticalSpacing:g,captionSide:v,stripedColor:x,highlightOnHoverColor:S,striped:E,highlightOnHover:C,withColumnBorders:R,withRowBorders:T,withTableBorder:z,borderColor:A,layout:N,variant:B,data:M,children:$,stickyHeader:L,stickyHeaderOffset:H,mod:I,tabularNums:Y,...X}=r,ee=_e({name:"Table",props:r,className:l,style:c,classes:_s,classNames:a,styles:u,unstyled:f,rootSelector:"table",vars:h,varsResolver:bM});return y.jsx(hM,{value:{getStyles:ee,stickyHeader:L,striped:E===!0?"odd":E||void 0,highlightOnHover:C,withColumnBorders:R,withRowBorders:T,captionSide:v||"bottom"},children:y.jsx(he,{component:"table",variant:B,ref:o,mod:[{"data-with-table-border":z,"data-tabular-nums":Y},I],...ee("table"),...X,children:$||!!M&&y.jsx(fg,{data:M})})})});lt.classes=_s;lt.displayName="@mantine/core/Table";lt.Td=Aw;lt.Th=Ap;lt.Tr=uu;lt.Thead=zw;lt.Tbody=Mw;lt.Tfoot=Ow;lt.Caption=jw;lt.ScrollContainer=dg;lt.DataRenderer=fg;const xM={},Vi=ge((e,o)=>{const r=ce("TextInput",xM,e);return y.jsx(Mo,{component:"input",ref:o,...r,__staticSelector:"TextInput"})});Vi.classes=Mo.classes;Vi.displayName="@mantine/core/TextInput";function SM(e){let o=e,r=!1;const a=new Set;return{getState(){return o},updateState(l){o=typeof l=="function"?l(o):l},setState(l){this.updateState(l),a.forEach(c=>c(o))},initialize(l){r||(o=l,r=!0)},subscribe(l){return a.add(l),()=>a.delete(l)}}}function wM(e){return b.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}function CM(e,o,r){const a=[],l=[],c={};for(const u of e){const f=u.position||o;c[f]=c[f]||0,c[f]+=1,c[f]<=r?l.push(u):a.push(u)}return{notifications:l,queue:a}}const EM=()=>SM({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),ja=EM(),RM=(e=ja)=>wM(e);function ol(e,o){const r=e.getState(),a=o([...r.notifications,...r.queue]),l=CM(a,r.defaultPosition,r.limit);e.setState({notifications:l.notifications,queue:l.queue,limit:r.limit,defaultPosition:r.defaultPosition})}function TM(e,o=ja){const r=e.id||pu();return ol(o,a=>e.id&&a.some(l=>l.id===e.id)?a:[...a,{...e,id:r}]),r}function Bw(e,o=ja){return ol(o,r=>r.filter(a=>a.id===e?(a.onClose?.(a),!1):!0)),e}function _M(e,o=ja){return ol(o,r=>r.map(a=>a.id===e.id?{...a,...e}:a)),e.id}function DM(e=ja){ol(e,()=>[])}function NM(e=ja){ol(e,o=>o.slice(0,e.getState().limit))}const Qe={show:TM,hide:Bw,update:_M,clean:DM,cleanQueue:NM,updateState:ol};function zp(e,o){return zp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},zp(e,o)}function $w(e,o){e.prototype=Object.create(o.prototype),e.prototype.constructor=e,zp(e,o)}var Kh={exports:{}},Wh,C1;function AM(){if(C1)return Wh;C1=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Wh=e,Wh}var Jh,E1;function zM(){if(E1)return Jh;E1=1;var e=AM();function o(){}function r(){}return r.resetWarningCache=o,Jh=function(){function a(u,f,h,p,g,v){if(v!==e){var x=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw x.name="Invariant Violation",x}}a.isRequired=a;function l(){return a}var c={array:a,bigint:a,bool:a,func:a,number:a,object:a,string:a,symbol:a,any:a,arrayOf:l,element:a,elementType:a,instanceOf:l,node:a,objectOf:l,oneOf:l,oneOfType:l,shape:l,exact:l,checkPropTypes:r,resetWarningCache:o};return c.PropTypes=c,c},Jh}var R1;function MM(){return R1||(R1=1,Kh.exports=zM()()),Kh.exports}var OM=MM();const je=Xp(OM),T1={disabled:!1},wu=Ge.createContext(null);var jM=function(o){return o.scrollTop},os="unmounted",va="exited",ya="entering",Ai="entered",Mp="exiting",fr=(function(e){$w(o,e);function o(a,l){var c;c=e.call(this,a,l)||this;var u=l,f=u&&!u.isMounting?a.enter:a.appear,h;return c.appearStatus=null,a.in?f?(h=va,c.appearStatus=ya):h=Ai:a.unmountOnExit||a.mountOnEnter?h=os:h=va,c.state={status:h},c.nextCallback=null,c}o.getDerivedStateFromProps=function(l,c){var u=l.in;return u&&c.status===os?{status:va}:null};var r=o.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(l){var c=null;if(l!==this.props){var u=this.state.status;this.props.in?u!==ya&&u!==Ai&&(c=ya):(u===ya||u===Ai)&&(c=Mp)}this.updateStatus(!1,c)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var l=this.props.timeout,c,u,f;return c=u=f=l,l!=null&&typeof l!="number"&&(c=l.exit,u=l.enter,f=l.appear!==void 0?l.appear:u),{exit:c,enter:u,appear:f}},r.updateStatus=function(l,c){if(l===void 0&&(l=!1),c!==null)if(this.cancelNextCallback(),c===ya){if(this.props.unmountOnExit||this.props.mountOnEnter){var u=this.props.nodeRef?this.props.nodeRef.current:Sa.findDOMNode(this);u&&jM(u)}this.performEnter(l)}else this.performExit();else this.props.unmountOnExit&&this.state.status===va&&this.setState({status:os})},r.performEnter=function(l){var c=this,u=this.props.enter,f=this.context?this.context.isMounting:l,h=this.props.nodeRef?[f]:[Sa.findDOMNode(this),f],p=h[0],g=h[1],v=this.getTimeouts(),x=f?v.appear:v.enter;if(!l&&!u||T1.disabled){this.safeSetState({status:Ai},function(){c.props.onEntered(p)});return}this.props.onEnter(p,g),this.safeSetState({status:ya},function(){c.props.onEntering(p,g),c.onTransitionEnd(x,function(){c.safeSetState({status:Ai},function(){c.props.onEntered(p,g)})})})},r.performExit=function(){var l=this,c=this.props.exit,u=this.getTimeouts(),f=this.props.nodeRef?void 0:Sa.findDOMNode(this);if(!c||T1.disabled){this.safeSetState({status:va},function(){l.props.onExited(f)});return}this.props.onExit(f),this.safeSetState({status:Mp},function(){l.props.onExiting(f),l.onTransitionEnd(u.exit,function(){l.safeSetState({status:va},function(){l.props.onExited(f)})})})},r.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(l,c){c=this.setNextCallback(c),this.setState(l,c)},r.setNextCallback=function(l){var c=this,u=!0;return this.nextCallback=function(f){u&&(u=!1,c.nextCallback=null,l(f))},this.nextCallback.cancel=function(){u=!1},this.nextCallback},r.onTransitionEnd=function(l,c){this.setNextCallback(c);var u=this.props.nodeRef?this.props.nodeRef.current:Sa.findDOMNode(this),f=l==null&&!this.props.addEndListener;if(!u||f){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var h=this.props.nodeRef?[this.nextCallback]:[u,this.nextCallback],p=h[0],g=h[1];this.props.addEndListener(p,g)}l!=null&&setTimeout(this.nextCallback,l)},r.render=function(){var l=this.state.status;if(l===os)return null;var c=this.props,u=c.children;c.in,c.mountOnEnter,c.unmountOnExit,c.appear,c.enter,c.exit,c.timeout,c.addEndListener,c.onEnter,c.onEntering,c.onEntered,c.onExit,c.onExiting,c.onExited,c.nodeRef;var f=dw(c,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Ge.createElement(wu.Provider,{value:null},typeof u=="function"?u(l,f):Ge.cloneElement(Ge.Children.only(u),f))},o})(Ge.Component);fr.contextType=wu;fr.propTypes={};function Ti(){}fr.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ti,onEntering:Ti,onEntered:Ti,onExit:Ti,onExiting:Ti,onExited:Ti};fr.UNMOUNTED=os;fr.EXITED=va;fr.ENTERING=ya;fr.ENTERED=Ai;fr.EXITING=Mp;function BM(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hg(e,o){var r=function(c){return o&&b.isValidElement(c)?o(c):c},a=Object.create(null);return e&&b.Children.map(e,function(l){return l}).forEach(function(l){a[l.key]=r(l)}),a}function $M(e,o){e=e||{},o=o||{};function r(g){return g in o?o[g]:e[g]}var a=Object.create(null),l=[];for(var c in e)c in o?l.length&&(a[c]=l,l=[]):l.push(c);var u,f={};for(var h in o){if(a[h])for(u=0;u(r[a.position||o].push(a),r),Lw.reduce((r,a)=>(r[a]=[],r),{}))}const _1={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},VM={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function YM({state:e,maxHeight:o,position:r,transitionDuration:a}){const[l,c]=r.split("-"),u=c==="center"?`${l}-center`:c,f={opacity:0,maxHeight:o,transform:_1[u],transitionDuration:`${a}ms, ${a}ms, ${a}ms`,transitionTimingFunction:"cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",transitionProperty:"opacity, transform, max-height"},h={opacity:1,transform:VM[u]},p={opacity:0,maxHeight:0,transform:_1[u]};return{...f,...{entering:h,entered:h,exiting:p,exited:p}[e]}}function GM(e,o){return typeof o=="number"?o:o===!1||e===!1?!1:e}const kw=b.forwardRef(({data:e,onHide:o,autoClose:r,...a},l)=>{const{autoClose:c,message:u,...f}=e,h=GM(r,e.autoClose),p=b.useRef(-1),g=()=>window.clearTimeout(p.current),v=()=>{o(e.id),g()},x=()=>{typeof h=="number"&&(p.current=window.setTimeout(v,h))};return b.useEffect(()=>{e.onOpen?.(e)},[]),b.useEffect(()=>(x(),g),[h]),y.jsx(rg,{...a,...f,onClose:v,ref:l,onMouseEnter:g,onMouseLeave:x,children:u})});kw.displayName="@mantine/notifications/NotificationContainer";var Hw={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const XM=fr,qM={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:vo("overlay"),store:ja,withinPortal:!0},IM=(e,{zIndex:o,containerWidth:r})=>({root:{"--notifications-z-index":o?.toString(),"--notifications-container-width":oe(r)}}),dr=ge((e,o)=>{const r=ce("Notifications",qM,e),{classNames:a,className:l,style:c,styles:u,unstyled:f,vars:h,position:p,autoClose:g,transitionDuration:v,containerWidth:x,notificationMaxHeight:S,limit:E,zIndex:C,store:R,portalProps:T,withinPortal:z,...A}=r,N=cn(),B=RM(R),M=eT(),$=Nu(),L=b.useRef({}),H=b.useRef(0),Y=(N.respectReducedMotion?$:!1)?1:v,X=_e({name:"Notifications",classes:Hw,props:r,className:l,style:c,classNames:a,styles:u,unstyled:f,vars:h,varsResolver:IM});b.useEffect(()=>{R?.updateState(re=>({...re,limit:E||5,defaultPosition:p}))},[E,p]),rr(()=>{B.notifications.length>H.current&&setTimeout(()=>M(),0),H.current=B.notifications.length},[B.notifications]);const ee=PM(B.notifications,p),ne=Lw.reduce((re,j)=>(re[j]=ee[j].map(({style:k,...V})=>y.jsx(XM,{timeout:Y,onEnter:()=>L.current[V.id].offsetHeight,nodeRef:{current:L.current[V.id]},children:P=>y.jsx(kw,{ref:Z=>{L.current[V.id]=Z},data:V,onHide:Z=>Bw(Z,R),autoClose:g,...X("notification",{style:{...YM({state:P,position:j,transitionDuration:Y,maxHeight:S}),...k}})})},V.id)),re),{});return y.jsxs(za,{withinPortal:z,...T,children:[y.jsx(he,{...X("root"),"data-position":"top-center",ref:o,...A,children:y.jsx(kr,{children:ne["top-center"]})}),y.jsx(he,{...X("root"),"data-position":"top-left",...A,children:y.jsx(kr,{children:ne["top-left"]})}),y.jsx(he,{...X("root",{className:ki.classNames.fullWidth}),"data-position":"top-right",...A,children:y.jsx(kr,{children:ne["top-right"]})}),y.jsx(he,{...X("root",{className:ki.classNames.fullWidth}),"data-position":"bottom-right",...A,children:y.jsx(kr,{children:ne["bottom-right"]})}),y.jsx(he,{...X("root"),"data-position":"bottom-left",...A,children:y.jsx(kr,{children:ne["bottom-left"]})}),y.jsx(he,{...X("root"),"data-position":"bottom-center",...A,children:y.jsx(kr,{children:ne["bottom-center"]})})]})});dr.classes=Hw;dr.displayName="@mantine/notifications/Notifications";dr.show=Qe.show;dr.hide=Qe.hide;dr.update=Qe.update;dr.clean=Qe.clean;dr.cleanQueue=Qe.cleanQueue;dr.updateState=Qe.updateState;var FM={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};const gt=(e,o,r,a)=>{const l=b.forwardRef(({color:c="currentColor",size:u=24,stroke:f=2,title:h,className:p,children:g,...v},x)=>b.createElement("svg",{ref:x,...FM[e],width:u,height:u,className:["tabler-icon",`tabler-icon-${o}`,p].join(" "),strokeWidth:f,stroke:c,...v},[h&&b.createElement("title",{key:"svg-title"},h),...a.map(([S,E])=>b.createElement(S,E)),...Array.isArray(g)?g:[g]]));return l.displayName=`${r}`,l};const ZM=[["path",{d:"M3 12h4l3 8l4 -16l3 8h4",key:"svg-0"}]],QM=gt("outline","activity","Activity",ZM);const KM=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 8v4",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]],Uw=gt("outline","alert-circle","AlertCircle",KM);const WM=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 13l-6 6",key:"svg-1"}],["path",{d:"M6 13l6 6",key:"svg-2"}]],JM=gt("outline","arrow-down","ArrowDown",WM);const e5=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]],t5=gt("outline","arrow-up","ArrowUp",e5);const n5=[["path",{d:"M9 19c-4.3 1.4 -4.3 -2.5 -6 -3m12 5v-3.5c0 -1 .1 -1.4 -.5 -2c2.8 -.3 5.5 -1.4 5.5 -6a4.6 4.6 0 0 0 -1.3 -3.2a4.2 4.2 0 0 0 -.1 -3.2s-1.1 -.3 -3.5 1.3a12.3 12.3 0 0 0 -6.2 0c-2.4 -1.6 -3.5 -1.3 -3.5 -1.3a4.2 4.2 0 0 0 -.1 3.2a4.6 4.6 0 0 0 -1.3 3.2c0 4.6 2.7 5.7 5.5 6c-.6 .6 -.6 1.2 -.5 2v3.5",key:"svg-0"}]],o5=gt("outline","brand-github","BrandGithub",n5);const r5=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],Pw=gt("outline","chevron-down","ChevronDown",r5);const a5=[["path",{d:"M9 6l6 6l-6 6",key:"svg-0"}]],i5=gt("outline","chevron-right","ChevronRight",a5);const l5=[["path",{d:"M6 15l6 -6l6 6",key:"svg-0"}]],s5=gt("outline","chevron-up","ChevronUp",l5);const c5=[["path",{d:"M3 14c.83 .642 2.077 1.017 3.5 1c1.423 .017 2.67 -.358 3.5 -1c.83 -.642 2.077 -1.017 3.5 -1c1.423 -.017 2.67 .358 3.5 1",key:"svg-0"}],["path",{d:"M8 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2",key:"svg-1"}],["path",{d:"M12 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2",key:"svg-2"}],["path",{d:"M3 10h14v5a6 6 0 0 1 -6 6h-2a6 6 0 0 1 -6 -6v-5",key:"svg-3"}],["path",{d:"M16.746 16.726a3 3 0 1 0 .252 -5.555",key:"svg-4"}]],u5=gt("outline","coffee","Coffee",c5);const f5=[["path",{d:"M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]],d5=gt("outline","copy","Copy",f5);const h5=[["path",{d:"M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2",key:"svg-0"}],["path",{d:"M10 14a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M14 4l0 4l-6 0l0 -4",key:"svg-2"}]],p5=gt("outline","device-floppy","DeviceFloppy",h5);const m5=[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 11l5 5l5 -5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]],Vw=gt("outline","download","Download",m5);const g5=[["path",{d:"M8 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M8 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M8 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}],["path",{d:"M14 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-3"}],["path",{d:"M14 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-4"}],["path",{d:"M14 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-5"}]],v5=gt("outline","grip-vertical","GripVertical",g5);const y5=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 9h.01",key:"svg-1"}],["path",{d:"M11 12h1v4h1",key:"svg-2"}]],b5=gt("outline","info-circle","InfoCircle",y5);const x5=[["path",{d:"M5 12l14 0",key:"svg-0"}]],S5=gt("outline","minus","Minus",x5);const w5=[["path",{d:"M12 21a9 9 0 0 1 0 -18c4.97 0 9 3.582 9 8c0 1.06 -.474 2.078 -1.318 2.828c-.844 .75 -1.989 1.172 -3.182 1.172h-2.5a2 2 0 0 0 -1 3.75a1.3 1.3 0 0 1 -1 2.25",key:"svg-0"}],["path",{d:"M7.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M11.5 7.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}],["path",{d:"M15.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-3"}]],C5=gt("outline","palette","Palette",w5);const E5=[["path",{d:"M15 8h.01",key:"svg-0"}],["path",{d:"M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12",key:"svg-1"}],["path",{d:"M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5",key:"svg-2"}],["path",{d:"M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3",key:"svg-3"}]],R5=gt("outline","photo","Photo",E5);const T5=[["path",{d:"M7 4v16l13 -8l-13 -8",key:"svg-0"}]],D1=gt("outline","player-play","PlayerPlay",T5);const _5=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]],is=gt("outline","plus","Plus",_5);const D5=[["path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",key:"svg-0"}],["path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",key:"svg-1"}]],Yw=gt("outline","refresh","Refresh",D5);const N5=[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]],A5=gt("outline","settings","Settings",N5);const z5=[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]],pg=gt("outline","trash","Trash",z5);const M5=[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 9l5 -5l5 5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]],Gw=gt("outline","upload","Upload",M5);const O5=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],j5=gt("outline","x","X",O5),B5={};function $5({children:e,defaultColorScheme:o="dark",notificationsPosition:r="bottom-right"}){return y.jsxs(Nx,{theme:B5,defaultColorScheme:o,children:[y.jsx(dr,{position:r}),e]})}function N1(e){return e?{color:"teal",variant:"filled",styles:{root:{"--button-bg":"var(--mantine-color-teal-9)","--button-hover":"var(--mantine-color-teal-8)"}}}:{}}function L5({logoUrl:e,appName:o,version:r,actions:a=[],extra:l,onLogout:c,githubUrl:u,kofiUrl:f="https://ko-fi.com/sethwv",username:h}){const p=y.jsx(Km,{src:e,h:32,w:"auto"}),g=!!(u||f);return y.jsx(mo.Header,{children:y.jsxs(mt,{h:"100%",px:"md",justify:"space-between",wrap:"nowrap",children:[y.jsxs(mt,{gap:"xs",wrap:"nowrap",style:{flexShrink:0},children:[g?y.jsxs(Nt,{shadow:"md",width:300,position:"bottom-start",children:[y.jsx(Nt.Target,{children:y.jsx($n,{style:{display:"flex",alignItems:"center"},"aria-label":"Plugin links",children:p})}),y.jsxs(Nt.Dropdown,{children:[u&&y.jsxs(Nt.Item,{component:"a",href:u,target:"_blank",rel:"noopener noreferrer",leftSection:y.jsx(o5,{size:16}),children:[o," on GitHub"]}),f&&y.jsx(Nt.Item,{component:"a",href:f,target:"_blank",rel:"noopener noreferrer",leftSection:y.jsx(u5,{size:16}),children:"Buy me a Coffee"})]})]}):p,y.jsxs(Qt,{gap:0,children:[o&&y.jsx(Ye,{size:"xs",lh:1,children:o}),r&&y.jsxs(Ye,{size:"xs",c:"dimmed",lh:1,children:["v",r]})]})]}),y.jsxs(mt,{gap:"xs",wrap:"nowrap",children:[a.map(({key:v,label:x,icon:S,onClick:E,loading:C,active:R,count:T,variant:z,color:A})=>y.jsxs(b.Fragment,{children:[y.jsxs(Dt,{size:"sm",variant:z,color:A,leftSection:y.jsx(S,{size:16}),loading:C,onClick:E,visibleFrom:"xs",...N1(R),children:[x,T>0?` (${T})`:""]}),y.jsx(Yt,{size:"lg",variant:"default",loading:C,hiddenFrom:"xs","aria-label":x,onClick:E,...N1(R),children:y.jsx(S,{size:18})})]},v)),l,c&&y.jsxs(Qt,{gap:0,align:"flex-end",children:[h&&y.jsx(Ye,{size:"xs",lh:1,children:h}),y.jsx($n,{onClick:c,children:y.jsx(Ye,{size:"xs",c:"dimmed",lh:1,children:"Logout"})})]})]})]})})}const ep="dispatch_ui_kit_last_username";function k5({logoUrl:e,appName:o,description:r,onLogin:a,onLoggedIn:l}){const c=localStorage.getItem(ep)??"",[u,f]=b.useState(c),[h,p]=b.useState(""),[g,v]=b.useState(!!c),[x,S]=b.useState(""),[E,C]=b.useState(!1);async function R(T){T.preventDefault(),C(!0),S("");try{await a(u,h),g?localStorage.setItem(ep,u):localStorage.removeItem(ep),l()}catch(z){S(z.message||"Login failed")}finally{C(!1)}}return y.jsx(ps,{mih:"100dvh",bg:"dark.8",children:y.jsxs(Qt,{align:"center",gap:"lg",w:340,px:"md",children:[y.jsx("img",{src:e,style:{height:40,width:"auto"},alt:o}),r&&y.jsx(Ye,{size:"sm",c:"dimmed",ta:"center",children:r}),y.jsx(Zi,{withBorder:!0,p:"xl",radius:"md",w:"100%",children:y.jsx("form",{onSubmit:R,children:y.jsxs(Qt,{gap:"sm",children:[x&&y.jsx(Iu,{icon:y.jsx(Uw,{size:16}),color:"red",variant:"light",py:"xs",children:x}),y.jsx(Vi,{label:"Username",autoComplete:"username",value:u,onChange:T=>f(T.currentTarget.value),required:!0}),y.jsx(af,{label:"Password",autoComplete:"current-password",value:h,onChange:T=>p(T.currentTarget.value),required:!0}),y.jsx(Ji,{label:"Remember me",checked:g,onChange:T=>v(T.currentTarget.checked)}),y.jsx(Dt,{type:"submit",loading:E,fullWidth:!0,mt:"xs",children:"Sign in"})]})})})]})})}function Xw({action:e,onClose:o}){return e?y.jsxs(Tn,{opened:!!e,onClose:o,title:e.title,size:"sm",centered:!0,children:[y.jsx(Ye,{size:"sm",children:e.message}),y.jsxs(mt,{mt:"md",justify:"flex-end",children:[y.jsx(Dt,{variant:"default",onClick:o,children:"Cancel"}),y.jsx(Dt,{color:e.color??"blue",loading:e.loading,onClick:()=>{o(),e.onConfirm()},children:e.confirmLabel??"Confirm"})]})]}):null}function H5({tokenKey:e,basePath:o,onUnauthorized:r,refreshTokenKey:a=`${e}_refresh`,refreshPath:l="/auth/refresh",usernameKey:c=`${e}_username`}={}){const u=o??(typeof window<"u"&&window.__BASE_PATH__||"/");function f(){return localStorage.getItem(e)}function h(N){N?localStorage.setItem(e,N):localStorage.removeItem(e)}function p(){return localStorage.getItem(a)}function g(N){N?localStorage.setItem(a,N):localStorage.removeItem(a)}function v(){return localStorage.getItem(c)}function x(N){N?localStorage.setItem(c,N):localStorage.removeItem(c)}async function S(N,B={}){const M=f(),$={"Content-Type":"application/json",...B.headers||{}};M&&($.Authorization=`Bearer ${M}`);const L=await fetch(`${u}api${N}`,{...B,headers:$});if(L.status===401){const H=new Error("Session expired, please log in again");throw H.status=401,H}if(!L.ok){let H=`Request failed (${L.status})`;try{H=(await L.json()).error||H}catch{}throw new Error(H)}return L.status===204?null:L.json()}let E=null;function C(){return E||(E=(async()=>{const N=p();if(!N)throw new Error("No refresh token");const B=await fetch(`${u}api${l}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refresh:N})});if(!B.ok)throw new Error("Refresh failed");const M=await B.json();h(M.access)})().finally(()=>{E=null})),E}async function R(N,B={}){try{return await S(N,B)}catch(M){if(M.status!==401)throw M;if(p())try{return await C(),await S(N,B)}catch{}throw h(null),g(null),x(null),r?.(M),M}}async function T(N,B,M="/auth/token"){const $=await S(M,{method:"POST",body:JSON.stringify({username:N,password:B})});return h($.access),$.refresh&&g($.refresh),x(N),$}function z(){h(null),g(null),x(null)}function A(){return!!f()}return{request:R,login:T,logout:z,isAuthenticated:A,getToken:f,getUsername:v,basePath:u}}function qw(e,{onOptimisticChange:o,shouldReload:r,onReload:a,onSaved:l,onError:c,delayMs:u=700}={}){const f=b.useRef({});return b.useCallback((h,p,g)=>{o?.({[h]:p});const v={[h]:p},x=async()=>{try{await e(v),l?.(v),r?.(h)&&await a?.()}catch(S){c?.(S)}};return clearTimeout(f.current[h]),g?x():(f.current[h]=setTimeout(x,u),Promise.resolve())},[e,o,r,a,l,c,u])}function U5({label:e,description:o}){return o?y.jsxs(mt,{gap:4,align:"center",wrap:"nowrap",children:[y.jsx("span",{children:e}),y.jsx(Ts,{label:o,multiline:!0,maw:260,withArrow:!0,position:"top-start",events:{hover:!0,focus:!0,touch:!0},children:y.jsx(Yt,{size:"xs",variant:"transparent",c:"dimmed",tabIndex:-1,style:{cursor:"default",flexShrink:0},children:y.jsx(b5,{size:13})})})]}):e}function Op({field:e,value:o,onChange:r}){const a={label:y.jsx(U5,{label:e.label,description:e.description})};switch(e.type){case"select":{const l=new Set,c=(e.options??[]).reduce((u,f)=>{const h=String(f.value);return l.has(h)||(l.add(h),u.push({value:h,label:f.label})),u},[]);return y.jsx(gs,{...a,data:c,value:String(o??e.default??""),onChange:r,allowDeselect:!1})}case"number":return y.jsx(Ca,{...a,value:o??e.default??0,min:e.min,max:e.max,placeholder:e.placeholder,onChange:r});case"string":{const l=e.input_type==="password"?af:Vi;return y.jsx(l,{...a,value:o??e.default??"",placeholder:e.placeholder,onChange:c=>r(c.currentTarget.value)})}default:return null}}function Iw({title:e,defaultOpened:o=!1,trailingAction:r,as:a="Paper",children:l}){const[c,u]=b.useState(o);return y.jsxs(a==="Card"?Zu:Zi,{withBorder:!0,radius:"md",p:a==="Card"?0:void 0,children:[y.jsx($n,{w:"100%",p:"md",onClick:()=>u(f=>!f),children:y.jsxs(mt,{justify:"space-between",children:[y.jsxs(mt,{gap:"xs",children:[c?y.jsx(Pw,{size:16}):y.jsx(i5,{size:16}),y.jsx(Ye,{size:"sm",fw:600,children:e})]}),r]})}),y.jsx(rm,{in:c,children:l})]})}function P5({fields:e,warnings:o=[],values:r,onSave:a,onOptimisticChange:l,shouldReload:c,onReload:u,onSaved:f,onError:h,title:p="Global Settings"}){const g=qw(a,{onOptimisticChange:l,shouldReload:c,onReload:u,onSaved:f,onError:h});return y.jsxs(Qt,{gap:"xs",children:[o.map(v=>y.jsxs(Iu,{icon:y.jsx(Uw,{size:16}),color:"yellow",variant:"light",children:[y.jsx(Ye,{size:"sm",fw:500,children:v.label}),v.description&&y.jsx(Ye,{size:"xs",c:"dimmed",mt:2,children:v.description})]},v.id)),y.jsx(Iw,{title:p,children:y.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:"var(--mantine-spacing-sm)",padding:"var(--mantine-spacing-md)",paddingTop:0},children:e.map(v=>y.jsx(Op,{field:v,value:r[v.id],onChange:x=>g(v.id,x,v.type!=="string")},v.id))})})]})}function V5(){for(var e=arguments.length,o=new Array(e),r=0;ra=>{o.forEach(l=>l(a))},o)}const sf=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function rl(e){const o=Object.prototype.toString.call(e);return o==="[object Window]"||o==="[object global]"}function mg(e){return"nodeType"in e}function _n(e){var o,r;return e?rl(e)?e:mg(e)&&(o=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?o:window:window}function gg(e){const{Document:o}=_n(e);return e instanceof o}function Ds(e){return rl(e)?!1:e instanceof _n(e).HTMLElement}function Fw(e){return e instanceof _n(e).SVGElement}function al(e){return e?rl(e)?e.document:mg(e)?gg(e)?e:Ds(e)||Fw(e)?e.ownerDocument:document:document:document}const Ao=sf?b.useLayoutEffect:b.useEffect;function vg(e){const o=b.useRef(e);return Ao(()=>{o.current=e}),b.useCallback(function(){for(var r=arguments.length,a=new Array(r),l=0;l{e.current=setInterval(a,l)},[]),r=b.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[o,r]}function vs(e,o){o===void 0&&(o=[e]);const r=b.useRef(e);return Ao(()=>{r.current!==e&&(r.current=e)},o),r}function Ns(e,o){const r=b.useRef();return b.useMemo(()=>{const a=e(r.current);return r.current=a,a},[...o])}function Cu(e){const o=vg(e),r=b.useRef(null),a=b.useCallback(l=>{l!==r.current&&o?.(l,r.current),r.current=l},[]);return[r,a]}function jp(e){const o=b.useRef();return b.useEffect(()=>{o.current=e},[e]),o.current}let tp={};function As(e,o){return b.useMemo(()=>{if(o)return o;const r=tp[e]==null?0:tp[e]+1;return tp[e]=r,e+"-"+r},[e,o])}function Zw(e){return function(o){for(var r=arguments.length,a=new Array(r>1?r-1:0),l=1;l{const f=Object.entries(u);for(const[h,p]of f){const g=c[h];g!=null&&(c[h]=g+e*p)}return c},{...o})}}const $i=Zw(1),Eu=Zw(-1);function G5(e){return"clientX"in e&&"clientY"in e}function yg(e){if(!e)return!1;const{KeyboardEvent:o}=_n(e.target);return o&&e instanceof o}function X5(e){if(!e)return!1;const{TouchEvent:o}=_n(e.target);return o&&e instanceof o}function Bp(e){if(X5(e)){if(e.touches&&e.touches.length){const{clientX:o,clientY:r}=e.touches[0];return{x:o,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:o,clientY:r}=e.changedTouches[0];return{x:o,y:r}}}return G5(e)?{x:e.clientX,y:e.clientY}:null}const ys=Object.freeze({Translate:{toString(e){if(!e)return;const{x:o,y:r}=e;return"translate3d("+(o?Math.round(o):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:o,scaleY:r}=e;return"scaleX("+o+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[ys.Translate.toString(e),ys.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:o,duration:r,easing:a}=e;return o+" "+r+"ms "+a}}}),A1="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function q5(e){return e.matches(A1)?e:e.querySelector(A1)}const I5={display:"none"};function F5(e){let{id:o,value:r}=e;return Ge.createElement("div",{id:o,style:I5},r)}function Z5(e){let{id:o,announcement:r,ariaLiveType:a="assertive"}=e;const l={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Ge.createElement("div",{id:o,style:l,role:"status","aria-live":a,"aria-atomic":!0},r)}function Q5(){const[e,o]=b.useState("");return{announce:b.useCallback(a=>{a!=null&&o(a)},[]),announcement:e}}const Qw=b.createContext(null);function K5(e){const o=b.useContext(Qw);b.useEffect(()=>{if(!o)throw new Error("useDndMonitor must be used within a children of ");return o(e)},[e,o])}function W5(){const[e]=b.useState(()=>new Set),o=b.useCallback(a=>(e.add(a),()=>e.delete(a)),[e]);return[b.useCallback(a=>{let{type:l,event:c}=a;e.forEach(u=>{var f;return(f=u[l])==null?void 0:f.call(u,c)})},[e]),o]}const J5={draggable:` To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel. - `},e6={onDragStart(e){let{active:o}=e;return"Picked up draggable item "+o.id+"."},onDragOver(e){let{active:o,over:r}=e;return r?"Draggable item "+o.id+" was moved over droppable area "+r.id+".":"Draggable item "+o.id+" is no longer over a droppable area."},onDragEnd(e){let{active:o,over:r}=e;return r?"Draggable item "+o.id+" was dropped over droppable area "+r.id:"Draggable item "+o.id+" was dropped."},onDragCancel(e){let{active:o}=e;return"Dragging was cancelled. Draggable item "+o.id+" was dropped."}};function t6(e){let{announcements:o=e6,container:r,hiddenTextDescribedById:a,screenReaderInstructions:l=J5}=e;const{announce:c,announcement:u}=Q5(),f=As("DndLiveRegion"),[h,p]=b.useState(!1);if(b.useEffect(()=>{p(!0)},[]),K5(b.useMemo(()=>({onDragStart(v){let{active:x}=v;c(o.onDragStart({active:x}))},onDragMove(v){let{active:x,over:S}=v;o.onDragMove&&c(o.onDragMove({active:x,over:S}))},onDragOver(v){let{active:x,over:S}=v;c(o.onDragOver({active:x,over:S}))},onDragEnd(v){let{active:x,over:S}=v;c(o.onDragEnd({active:x,over:S}))},onDragCancel(v){let{active:x,over:S}=v;c(o.onDragCancel({active:x,over:S}))}}),[c,o])),!h)return null;const g=Ye.createElement(Ye.Fragment,null,Ye.createElement(F5,{id:a,value:l.draggable}),Ye.createElement(Z5,{id:f,announcement:u}));return r?co.createPortal(g,r):g}var Vt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Vt||(Vt={}));function Ru(){}function n6(e,o){return b.useMemo(()=>({sensor:e,options:o??{}}),[e,o])}function o6(){for(var e=arguments.length,o=new Array(e),r=0;r[...o].filter(a=>a!=null),[...o])}const go=Object.freeze({x:0,y:0});function r6(e,o){return Math.sqrt(Math.pow(e.x-o.x,2)+Math.pow(e.y-o.y,2))}function a6(e,o){let{data:{value:r}}=e,{data:{value:a}}=o;return r-a}function i6(e,o){let{data:{value:r}}=e,{data:{value:a}}=o;return a-r}function l6(e,o){if(!e||e.length===0)return null;const[r]=e;return r[o]}function A1(e,o,r){return o===void 0&&(o=e.left),r===void 0&&(r=e.top),{x:o+e.width*.5,y:r+e.height*.5}}const s6=e=>{let{collisionRect:o,droppableRects:r,droppableContainers:a}=e;const l=A1(o,o.left,o.top),c=[];for(const u of a){const{id:f}=u,h=r.get(f);if(h){const p=r6(A1(h),l);c.push({id:f,data:{droppableContainer:u,value:p}})}}return c.sort(a6)};function c6(e,o){const r=Math.max(o.top,e.top),a=Math.max(o.left,e.left),l=Math.min(o.left+o.width,e.left+e.width),c=Math.min(o.top+o.height,e.top+e.height),u=l-a,f=c-r;if(a{let{collisionRect:o,droppableRects:r,droppableContainers:a}=e;const l=[];for(const c of a){const{id:u}=c,f=r.get(u);if(f){const h=c6(f,o);h>0&&l.push({id:u,data:{droppableContainer:c,value:h}})}}return l.sort(i6)};function f6(e,o,r){return{...e,scaleX:o&&r?o.width/r.width:1,scaleY:o&&r?o.height/r.height:1}}function Kw(e,o){return e&&o?{x:e.left-o.left,y:e.top-o.top}:go}function d6(e){return function(r){for(var a=arguments.length,l=new Array(a>1?a-1:0),c=1;c({...u,top:u.top+e*f.y,bottom:u.bottom+e*f.y,left:u.left+e*f.x,right:u.right+e*f.x}),{...r})}}const h6=d6(1);function p6(e){if(e.startsWith("matrix3d(")){const o=e.slice(9,-1).split(/, /);return{x:+o[12],y:+o[13],scaleX:+o[0],scaleY:+o[5]}}else if(e.startsWith("matrix(")){const o=e.slice(7,-1).split(/, /);return{x:+o[4],y:+o[5],scaleX:+o[0],scaleY:+o[3]}}return null}function m6(e,o,r){const a=p6(o);if(!a)return e;const{scaleX:l,scaleY:c,x:u,y:f}=a,h=e.left-u-(1-l)*parseFloat(r),p=e.top-f-(1-c)*parseFloat(r.slice(r.indexOf(" ")+1)),g=l?e.width/l:e.width,v=c?e.height/c:e.height;return{width:g,height:v,top:p,right:h+g,bottom:p+v,left:h}}const g6={ignoreTransform:!1};function ll(e,o){o===void 0&&(o=g6);let r=e.getBoundingClientRect();if(o.ignoreTransform){const{transform:p,transformOrigin:g}=_n(e).getComputedStyle(e);p&&(r=m6(r,p,g))}const{top:a,left:l,width:c,height:u,bottom:f,right:h}=r;return{top:a,left:l,width:c,height:u,bottom:f,right:h}}function z1(e){return ll(e,{ignoreTransform:!0})}function v6(e){const o=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:o,bottom:r,width:o,height:r}}function y6(e,o){return o===void 0&&(o=_n(e).getComputedStyle(e)),o.position==="fixed"}function b6(e,o){o===void 0&&(o=_n(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(l=>{const c=o[l];return typeof c=="string"?r.test(c):!1})}function yg(e,o){const r=[];function a(l){if(o!=null&&r.length>=o||!l)return r;if(mg(l)&&l.scrollingElement!=null&&!r.includes(l.scrollingElement))return r.push(l.scrollingElement),r;if(!Ds(l)||Fw(l)||r.includes(l))return r;const c=_n(e).getComputedStyle(l);return l!==e&&b6(l,c)&&r.push(l),y6(l,c)?r:a(l.parentNode)}return e?a(e):r}function Ww(e){const[o]=yg(e,1);return o??null}function np(e){return!sf||!e?null:al(e)?e:pg(e)?mg(e)||e===il(e).scrollingElement?window:Ds(e)?e:null:null}function Jw(e){return al(e)?e.scrollX:e.scrollLeft}function eC(e){return al(e)?e.scrollY:e.scrollTop}function $p(e){return{x:Jw(e),y:eC(e)}}var Ft;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Ft||(Ft={}));function tC(e){return!sf||!e?!1:e===document.scrollingElement}function nC(e){const o={x:0,y:0},r=tC(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},a={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},l=e.scrollTop<=o.y,c=e.scrollLeft<=o.x,u=e.scrollTop>=a.y,f=e.scrollLeft>=a.x;return{isTop:l,isLeft:c,isBottom:u,isRight:f,maxScroll:a,minScroll:o}}const x6={x:.2,y:.2};function S6(e,o,r,a,l){let{top:c,left:u,right:f,bottom:h}=r;a===void 0&&(a=10),l===void 0&&(l=x6);const{isTop:p,isBottom:g,isLeft:v,isRight:x}=nC(e),S={x:0,y:0},E={x:0,y:0},C={height:o.height*l.y,width:o.width*l.x};return!p&&c<=o.top+C.height?(S.y=Ft.Backward,E.y=a*Math.abs((o.top+C.height-c)/C.height)):!g&&h>=o.bottom-C.height&&(S.y=Ft.Forward,E.y=a*Math.abs((o.bottom-C.height-h)/C.height)),!x&&f>=o.right-C.width?(S.x=Ft.Forward,E.x=a*Math.abs((o.right-C.width-f)/C.width)):!v&&u<=o.left+C.width&&(S.x=Ft.Backward,E.x=a*Math.abs((o.left+C.width-u)/C.width)),{direction:S,speed:E}}function w6(e){if(e===document.scrollingElement){const{innerWidth:c,innerHeight:u}=window;return{top:0,left:0,right:c,bottom:u,width:c,height:u}}const{top:o,left:r,right:a,bottom:l}=e.getBoundingClientRect();return{top:o,left:r,right:a,bottom:l,width:e.clientWidth,height:e.clientHeight}}function oC(e){return e.reduce((o,r)=>$i(o,$p(r)),go)}function C6(e){return e.reduce((o,r)=>o+Jw(r),0)}function E6(e){return e.reduce((o,r)=>o+eC(r),0)}function R6(e,o){if(o===void 0&&(o=ll),!e)return;const{top:r,left:a,bottom:l,right:c}=o(e);Ww(e)&&(l<=0||c<=0||r>=window.innerHeight||a>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const T6=[["x",["left","right"],C6],["y",["top","bottom"],E6]];class bg{constructor(o,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const a=yg(r),l=oC(a);this.rect={...o},this.width=o.width,this.height=o.height;for(const[c,u,f]of T6)for(const h of u)Object.defineProperty(this,h,{get:()=>{const p=f(a),g=l[c]-p;return this.rect[h]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ss{constructor(o){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var a;return(a=this.target)==null?void 0:a.removeEventListener(...r)})},this.target=o}add(o,r,a){var l;(l=this.target)==null||l.addEventListener(o,r,a),this.listeners.push([o,r,a])}}function _6(e){const{EventTarget:o}=_n(e);return e instanceof o?e:il(e)}function op(e,o){const r=Math.abs(e.x),a=Math.abs(e.y);return typeof o=="number"?Math.sqrt(r**2+a**2)>o:"x"in o&&"y"in o?r>o.x&&a>o.y:"x"in o?r>o.x:"y"in o?a>o.y:!1}var Qn;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Qn||(Qn={}));function M1(e){e.preventDefault()}function D6(e){e.stopPropagation()}var Qe;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Qe||(Qe={}));const rC={start:[Qe.Space,Qe.Enter],cancel:[Qe.Esc],end:[Qe.Space,Qe.Enter,Qe.Tab]},N6=(e,o)=>{let{currentCoordinates:r}=o;switch(e.code){case Qe.Right:return{...r,x:r.x+25};case Qe.Left:return{...r,x:r.x-25};case Qe.Down:return{...r,y:r.y+25};case Qe.Up:return{...r,y:r.y-25}}};class aC{constructor(o){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=o;const{event:{target:r}}=o;this.props=o,this.listeners=new ss(il(r)),this.windowListeners=new ss(_n(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Qn.Resize,this.handleCancel),this.windowListeners.add(Qn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Qn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:o,onStart:r}=this.props,a=o.node.current;a&&R6(a),r(go)}handleKeyDown(o){if(vg(o)){const{active:r,context:a,options:l}=this.props,{keyboardCodes:c=rC,coordinateGetter:u=N6,scrollBehavior:f="smooth"}=l,{code:h}=o;if(c.end.includes(h)){this.handleEnd(o);return}if(c.cancel.includes(h)){this.handleCancel(o);return}const{collisionRect:p}=a.current,g=p?{x:p.left,y:p.top}:go;this.referenceCoordinates||(this.referenceCoordinates=g);const v=u(o,{active:r,context:a.current,currentCoordinates:g});if(v){const x=Eu(v,g),S={x:0,y:0},{scrollableAncestors:E}=a.current;for(const C of E){const R=o.code,{isTop:T,isRight:z,isLeft:A,isBottom:N,maxScroll:B,minScroll:M}=nC(C),$=w6(C),L={x:Math.min(R===Qe.Right?$.right-$.width/2:$.right,Math.max(R===Qe.Right?$.left:$.left+$.width/2,v.x)),y:Math.min(R===Qe.Down?$.bottom-$.height/2:$.bottom,Math.max(R===Qe.Down?$.top:$.top+$.height/2,v.y))},H=R===Qe.Right&&!z||R===Qe.Left&&!A,I=R===Qe.Down&&!N||R===Qe.Up&&!T;if(H&&L.x!==v.x){const Y=C.scrollLeft+x.x,X=R===Qe.Right&&Y<=B.x||R===Qe.Left&&Y>=M.x;if(X&&!x.y){C.scrollTo({left:Y,behavior:f});return}X?S.x=C.scrollLeft-Y:S.x=R===Qe.Right?C.scrollLeft-B.x:C.scrollLeft-M.x,S.x&&C.scrollBy({left:-S.x,behavior:f});break}else if(I&&L.y!==v.y){const Y=C.scrollTop+x.y,X=R===Qe.Down&&Y<=B.y||R===Qe.Up&&Y>=M.y;if(X&&!x.x){C.scrollTo({top:Y,behavior:f});return}X?S.y=C.scrollTop-Y:S.y=R===Qe.Down?C.scrollTop-B.y:C.scrollTop-M.y,S.y&&C.scrollBy({top:-S.y,behavior:f});break}}this.handleMove(o,$i(Eu(v,this.referenceCoordinates),S))}}}handleMove(o,r){const{onMove:a}=this.props;o.preventDefault(),a(r)}handleEnd(o){const{onEnd:r}=this.props;o.preventDefault(),this.detach(),r()}handleCancel(o){const{onCancel:r}=this.props;o.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}aC.activators=[{eventName:"onKeyDown",handler:(e,o,r)=>{let{keyboardCodes:a=rC,onActivation:l}=o,{active:c}=r;const{code:u}=e.nativeEvent;if(a.start.includes(u)){const f=c.activatorNode.current;return f&&e.target!==f?!1:(e.preventDefault(),l?.({event:e.nativeEvent}),!0)}return!1}}];function O1(e){return!!(e&&"distance"in e)}function j1(e){return!!(e&&"delay"in e)}class xg{constructor(o,r,a){var l;a===void 0&&(a=_6(o.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=o,this.events=r;const{event:c}=o,{target:u}=c;this.props=o,this.events=r,this.document=il(u),this.documentListeners=new ss(this.document),this.listeners=new ss(a),this.windowListeners=new ss(_n(u)),this.initialCoordinates=(l=Bp(c))!=null?l:go,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:o,props:{options:{activationConstraint:r,bypassActivationConstraint:a}}}=this;if(this.listeners.add(o.move.name,this.handleMove,{passive:!1}),this.listeners.add(o.end.name,this.handleEnd),o.cancel&&this.listeners.add(o.cancel.name,this.handleCancel),this.windowListeners.add(Qn.Resize,this.handleCancel),this.windowListeners.add(Qn.DragStart,M1),this.windowListeners.add(Qn.VisibilityChange,this.handleCancel),this.windowListeners.add(Qn.ContextMenu,M1),this.documentListeners.add(Qn.Keydown,this.handleKeydown),r){if(a!=null&&a({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(j1(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(O1(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(o,r){const{active:a,onPending:l}=this.props;l(a,o,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:o}=this,{onStart:r}=this.props;o&&(this.activated=!0,this.documentListeners.add(Qn.Click,D6,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Qn.SelectionChange,this.removeTextSelection),r(o))}handleMove(o){var r;const{activated:a,initialCoordinates:l,props:c}=this,{onMove:u,options:{activationConstraint:f}}=c;if(!l)return;const h=(r=Bp(o))!=null?r:go,p=Eu(l,h);if(!a&&f){if(O1(f)){if(f.tolerance!=null&&op(p,f.tolerance))return this.handleCancel();if(op(p,f.distance))return this.handleStart()}if(j1(f)&&op(p,f.tolerance))return this.handleCancel();this.handlePending(f,p);return}o.cancelable&&o.preventDefault(),u(h)}handleEnd(){const{onAbort:o,onEnd:r}=this.props;this.detach(),this.activated||o(this.props.active),r()}handleCancel(){const{onAbort:o,onCancel:r}=this.props;this.detach(),this.activated||o(this.props.active),r()}handleKeydown(o){o.code===Qe.Esc&&this.handleCancel()}removeTextSelection(){var o;(o=this.document.getSelection())==null||o.removeAllRanges()}}const A6={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Sg extends xg{constructor(o){const{event:r}=o,a=il(r.target);super(o,A6,a)}}Sg.activators=[{eventName:"onPointerDown",handler:(e,o)=>{let{nativeEvent:r}=e,{onActivation:a}=o;return!r.isPrimary||r.button!==0?!1:(a?.({event:r}),!0)}}];const z6={move:{name:"mousemove"},end:{name:"mouseup"}};var Lp;(function(e){e[e.RightClick=2]="RightClick"})(Lp||(Lp={}));class M6 extends xg{constructor(o){super(o,z6,il(o.event.target))}}M6.activators=[{eventName:"onMouseDown",handler:(e,o)=>{let{nativeEvent:r}=e,{onActivation:a}=o;return r.button===Lp.RightClick?!1:(a?.({event:r}),!0)}}];const rp={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class O6 extends xg{constructor(o){super(o,rp)}static setup(){return window.addEventListener(rp.move.name,o,{capture:!1,passive:!1}),function(){window.removeEventListener(rp.move.name,o)};function o(){}}}O6.activators=[{eventName:"onTouchStart",handler:(e,o)=>{let{nativeEvent:r}=e,{onActivation:a}=o;const{touches:l}=r;return l.length>1?!1:(a?.({event:r}),!0)}}];var cs;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(cs||(cs={}));var Tu;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Tu||(Tu={}));function j6(e){let{acceleration:o,activator:r=cs.Pointer,canScroll:a,draggingRect:l,enabled:c,interval:u=5,order:f=Tu.TreeOrder,pointerCoordinates:h,scrollableAncestors:p,scrollableAncestorRects:g,delta:v,threshold:x}=e;const S=$6({delta:v,disabled:!c}),[E,C]=Y5(),R=b.useRef({x:0,y:0}),T=b.useRef({x:0,y:0}),z=b.useMemo(()=>{switch(r){case cs.Pointer:return h?{top:h.y,bottom:h.y,left:h.x,right:h.x}:null;case cs.DraggableRect:return l}},[r,l,h]),A=b.useRef(null),N=b.useCallback(()=>{const M=A.current;if(!M)return;const $=R.current.x*T.current.x,L=R.current.y*T.current.y;M.scrollBy($,L)},[]),B=b.useMemo(()=>f===Tu.TreeOrder?[...p].reverse():p,[f,p]);b.useEffect(()=>{if(!c||!p.length||!z){C();return}for(const M of B){if(a?.(M)===!1)continue;const $=p.indexOf(M),L=g[$];if(!L)continue;const{direction:H,speed:I}=S6(M,L,z,o,x);for(const Y of["x","y"])S[Y][H[Y]]||(I[Y]=0,H[Y]=0);if(I.x>0||I.y>0){C(),A.current=M,E(N,u),R.current=I,T.current=H;return}}R.current={x:0,y:0},T.current={x:0,y:0},C()},[o,N,a,C,c,u,JSON.stringify(z),JSON.stringify(S),E,p,B,g,JSON.stringify(x)])}const B6={x:{[Ft.Backward]:!1,[Ft.Forward]:!1},y:{[Ft.Backward]:!1,[Ft.Forward]:!1}};function $6(e){let{delta:o,disabled:r}=e;const a=jp(o);return Ns(l=>{if(r||!a||!l)return B6;const c={x:Math.sign(o.x-a.x),y:Math.sign(o.y-a.y)};return{x:{[Ft.Backward]:l.x[Ft.Backward]||c.x===-1,[Ft.Forward]:l.x[Ft.Forward]||c.x===1},y:{[Ft.Backward]:l.y[Ft.Backward]||c.y===-1,[Ft.Forward]:l.y[Ft.Forward]||c.y===1}}},[r,o,a])}function L6(e,o){const r=o!=null?e.get(o):void 0,a=r?r.node.current:null;return Ns(l=>{var c;return o==null?null:(c=a??l)!=null?c:null},[a,o])}function k6(e,o){return b.useMemo(()=>e.reduce((r,a)=>{const{sensor:l}=a,c=l.activators.map(u=>({eventName:u.eventName,handler:o(u.handler,a)}));return[...r,...c]},[]),[e,o])}var bs;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(bs||(bs={}));var kp;(function(e){e.Optimized="optimized"})(kp||(kp={}));const B1=new Map;function H6(e,o){let{dragging:r,dependencies:a,config:l}=o;const[c,u]=b.useState(null),{frequency:f,measure:h,strategy:p}=l,g=b.useRef(e),v=R(),x=vs(v),S=b.useCallback(function(T){T===void 0&&(T=[]),!x.current&&u(z=>z===null?T:z.concat(T.filter(A=>!z.includes(A))))},[x]),E=b.useRef(null),C=Ns(T=>{if(v&&!r)return B1;if(!T||T===B1||g.current!==e||c!=null){const z=new Map;for(let A of e){if(!A)continue;if(c&&c.length>0&&!c.includes(A.id)&&A.rect.current){z.set(A.id,A.rect.current);continue}const N=A.node.current,B=N?new bg(h(N),N):null;A.rect.current=B,B&&z.set(A.id,B)}return z}return T},[e,c,r,v,h]);return b.useEffect(()=>{g.current=e},[e]),b.useEffect(()=>{v||S()},[r,v]),b.useEffect(()=>{c&&c.length>0&&u(null)},[JSON.stringify(c)]),b.useEffect(()=>{v||typeof f!="number"||E.current!==null||(E.current=setTimeout(()=>{S(),E.current=null},f))},[f,v,S,...a]),{droppableRects:C,measureDroppableContainers:S,measuringScheduled:c!=null};function R(){switch(p){case bs.Always:return!1;case bs.BeforeDragging:return r;default:return!r}}}function iC(e,o){return Ns(r=>e?r||(typeof o=="function"?o(e):e):null,[o,e])}function U6(e,o){return iC(e,o)}function P6(e){let{callback:o,disabled:r}=e;const a=gg(o),l=b.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:c}=window;return new c(a)},[a,r]);return b.useEffect(()=>()=>l?.disconnect(),[l]),l}function cf(e){let{callback:o,disabled:r}=e;const a=gg(o),l=b.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:c}=window;return new c(a)},[r]);return b.useEffect(()=>()=>l?.disconnect(),[l]),l}function V6(e){return new bg(ll(e),e)}function $1(e,o,r){o===void 0&&(o=V6);const[a,l]=b.useState(null);function c(){l(h=>{if(!e)return null;if(e.isConnected===!1){var p;return(p=h??r)!=null?p:null}const g=o(e);return JSON.stringify(h)===JSON.stringify(g)?h:g})}const u=P6({callback(h){if(e)for(const p of h){const{type:g,target:v}=p;if(g==="childList"&&v instanceof HTMLElement&&v.contains(e)){c();break}}}}),f=cf({callback:c});return Ao(()=>{c(),e?(f?.observe(e),u?.observe(document.body,{childList:!0,subtree:!0})):(f?.disconnect(),u?.disconnect())},[e]),a}function Y6(e){const o=iC(e);return Kw(e,o)}const L1=[];function G6(e){const o=b.useRef(e),r=Ns(a=>e?a&&a!==L1&&e&&o.current&&e.parentNode===o.current.parentNode?a:yg(e):L1,[e]);return b.useEffect(()=>{o.current=e},[e]),r}function X6(e){const[o,r]=b.useState(null),a=b.useRef(e),l=b.useCallback(c=>{const u=np(c.target);u&&r(f=>f?(f.set(u,$p(u)),new Map(f)):null)},[]);return b.useEffect(()=>{const c=a.current;if(e!==c){u(c);const f=e.map(h=>{const p=np(h);return p?(p.addEventListener("scroll",l,{passive:!0}),[p,$p(p)]):null}).filter(h=>h!=null);r(f.length?new Map(f):null),a.current=e}return()=>{u(e),u(c)};function u(f){f.forEach(h=>{const p=np(h);p?.removeEventListener("scroll",l)})}},[l,e]),b.useMemo(()=>e.length?o?Array.from(o.values()).reduce((c,u)=>$i(c,u),go):oC(e):go,[e,o])}function k1(e,o){o===void 0&&(o=[]);const r=b.useRef(null);return b.useEffect(()=>{r.current=null},o),b.useEffect(()=>{const a=e!==go;a&&!r.current&&(r.current=e),!a&&r.current&&(r.current=null)},[e]),r.current?Eu(e,r.current):go}function q6(e){b.useEffect(()=>{if(!sf)return;const o=e.map(r=>{let{sensor:a}=r;return a.setup==null?void 0:a.setup()});return()=>{for(const r of o)r?.()}},e.map(o=>{let{sensor:r}=o;return r}))}function I6(e,o){return b.useMemo(()=>e.reduce((r,a)=>{let{eventName:l,handler:c}=a;return r[l]=u=>{c(u,o)},r},{}),[e,o])}function lC(e){return b.useMemo(()=>e?v6(e):null,[e])}const H1=[];function F6(e,o){o===void 0&&(o=ll);const[r]=e,a=lC(r?_n(r):null),[l,c]=b.useState(H1);function u(){c(()=>e.length?e.map(h=>tC(h)?a:new bg(o(h),h)):H1)}const f=cf({callback:u});return Ao(()=>{f?.disconnect(),u(),e.forEach(h=>f?.observe(h))},[e]),l}function Z6(e){if(!e)return null;if(e.children.length>1)return e;const o=e.children[0];return Ds(o)?o:e}function Q6(e){let{measure:o}=e;const[r,a]=b.useState(null),l=b.useCallback(p=>{for(const{target:g}of p)if(Ds(g)){a(v=>{const x=o(g);return v?{...v,width:x.width,height:x.height}:x});break}},[o]),c=cf({callback:l}),u=b.useCallback(p=>{const g=Z6(p);c?.disconnect(),g&&c?.observe(g),a(g?o(g):null)},[o,c]),[f,h]=Cu(u);return b.useMemo(()=>({nodeRef:f,rect:r,setRef:h}),[r,f,h])}const K6=[{sensor:Sg,options:{}},{sensor:aC,options:{}}],W6={current:{}},fu={draggable:{measure:z1},droppable:{measure:z1,strategy:bs.WhileDragging,frequency:kp.Optimized},dragOverlay:{measure:ll}};class us extends Map{get(o){var r;return o!=null&&(r=super.get(o))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(o=>{let{disabled:r}=o;return!r})}getNodeFor(o){var r,a;return(r=(a=this.get(o))==null?void 0:a.node.current)!=null?r:void 0}}const J6={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new us,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ru},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:fu,measureDroppableContainers:Ru,windowRect:null,measuringScheduled:!1},e4={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ru,draggableNodes:new Map,over:null,measureDroppableContainers:Ru},uf=b.createContext(e4),sC=b.createContext(J6);function t4(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new us}}}function n4(e,o){switch(o.type){case Vt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:o.initialCoordinates,active:o.active}};case Vt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:o.coordinates.x-e.draggable.initialCoordinates.x,y:o.coordinates.y-e.draggable.initialCoordinates.y}}};case Vt.DragEnd:case Vt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Vt.RegisterDroppable:{const{element:r}=o,{id:a}=r,l=new us(e.droppable.containers);return l.set(a,r),{...e,droppable:{...e.droppable,containers:l}}}case Vt.SetDroppableDisabled:{const{id:r,key:a,disabled:l}=o,c=e.droppable.containers.get(r);if(!c||a!==c.key)return e;const u=new us(e.droppable.containers);return u.set(r,{...c,disabled:l}),{...e,droppable:{...e.droppable,containers:u}}}case Vt.UnregisterDroppable:{const{id:r,key:a}=o,l=e.droppable.containers.get(r);if(!l||a!==l.key)return e;const c=new us(e.droppable.containers);return c.delete(r),{...e,droppable:{...e.droppable,containers:c}}}default:return e}}function o4(e){let{disabled:o}=e;const{active:r,activatorEvent:a,draggableNodes:l}=b.useContext(uf),c=jp(a),u=jp(r?.id);return b.useEffect(()=>{if(!o&&!a&&c&&u!=null){if(!vg(c)||document.activeElement===c.target)return;const f=l.get(u);if(!f)return;const{activatorNode:h,node:p}=f;if(!h.current&&!p.current)return;requestAnimationFrame(()=>{for(const g of[h.current,p.current]){if(!g)continue;const v=q5(g);if(v){v.focus();break}}})}},[a,o,l,u,c]),null}function r4(e,o){let{transform:r,...a}=o;return e!=null&&e.length?e.reduce((l,c)=>c({transform:l,...a}),r):r}function a4(e){return b.useMemo(()=>({draggable:{...fu.draggable,...e?.draggable},droppable:{...fu.droppable,...e?.droppable},dragOverlay:{...fu.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function i4(e){let{activeNode:o,measure:r,initialRect:a,config:l=!0}=e;const c=b.useRef(!1),{x:u,y:f}=typeof l=="boolean"?{x:l,y:l}:l;Ao(()=>{if(!u&&!f||!o){c.current=!1;return}if(c.current||!a)return;const p=o?.node.current;if(!p||p.isConnected===!1)return;const g=r(p),v=Kw(g,a);if(u||(v.x=0),f||(v.y=0),c.current=!0,Math.abs(v.x)>0||Math.abs(v.y)>0){const x=Ww(p);x&&x.scrollBy({top:v.y,left:v.x})}},[o,u,f,a,r])}const cC=b.createContext({...go,scaleX:1,scaleY:1});var Hr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Hr||(Hr={}));const l4=b.memo(function(o){var r,a,l,c;let{id:u,accessibility:f,autoScroll:h=!0,children:p,sensors:g=K6,collisionDetection:v=u6,measuring:x,modifiers:S,...E}=o;const C=b.useReducer(n4,void 0,t4),[R,T]=C,[z,A]=W5(),[N,B]=b.useState(Hr.Uninitialized),M=N===Hr.Initialized,{draggable:{active:$,nodes:L,translate:H},droppable:{containers:I}}=R,Y=$!=null?L.get($):null,X=b.useRef({initial:null,translated:null}),ee=b.useMemo(()=>{var Et;return $!=null?{id:$,data:(Et=Y?.data)!=null?Et:W6,rect:X}:null},[$,Y]),ne=b.useRef(null),[re,j]=b.useState(null),[k,V]=b.useState(null),P=vs(E,Object.values(E)),Z=As("DndDescribedBy",u),D=b.useMemo(()=>I.getEnabled(),[I]),O=a4(x),{droppableRects:q,measureDroppableContainers:W,measuringScheduled:ie}=H6(D,{dragging:M,dependencies:[H.x,H.y],config:O.droppable}),ue=L6(L,$),ve=b.useMemo(()=>k?Bp(k):null,[k]),fe=$a(),be=U6(ue,O.draggable.measure);i4({activeNode:$!=null?L.get($):null,config:fe.layoutShiftCompensation,initialRect:be,measure:O.draggable.measure});const ye=$1(ue,O.draggable.measure,be),Ge=$1(ue?ue.parentElement:null),Ne=b.useRef({activatorEvent:null,active:null,activeNode:ue,collisionRect:null,collisions:null,droppableRects:q,draggableNodes:L,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ke=I.getNodeFor((r=Ne.current.over)==null?void 0:r.id),Be=Q6({measure:O.dragOverlay.measure}),tt=(a=Be.nodeRef.current)!=null?a:ue,vt=M?(l=Be.rect)!=null?l:ye:null,pe=!!(Be.nodeRef.current&&Be.rect),me=Y6(pe?null:ye),we=lC(tt?_n(tt):null),De=G6(M?Ke??ue:null),Ae=F6(De),xe=r4(S,{transform:{x:H.x-me.x,y:H.y-me.y,scaleX:1,scaleY:1},activatorEvent:k,active:ee,activeNodeRect:ye,containerNodeRect:Ge,draggingNodeRect:vt,over:Ne.current.over,overlayNodeRect:Be.rect,scrollableAncestors:De,scrollableAncestorRects:Ae,windowRect:we}),$e=ve?$i(ve,H):null,de=X6(De),Re=k1(de),dt=k1(de,[ye]),nt=$i(xe,Re),yt=vt?h6(vt,xe):null,We=ee&&yt?v({active:ee,collisionRect:yt,droppableRects:q,droppableContainers:D,pointerCoordinates:$e}):null,wt=l6(We,"id"),[on,Qr]=b.useState(null),Oo=pe?xe:$i(xe,dt),Gt=f6(Oo,(c=on?.rect)!=null?c:null,ye),st=b.useRef(null),Ct=b.useCallback((Et,Rt)=>{let{sensor:Xt,options:hn}=Rt;if(ne.current==null)return;const pn=L.get(ne.current);if(!pn)return;const rn=Et.nativeEvent,mn=new Xt({active:ne.current,activeNode:pn,event:rn,options:hn,context:Ne,onAbort(Ht){if(!L.get(Ht))return;const{onDragAbort:Dn}=P.current,kn={id:Ht};Dn?.(kn),z({type:"onDragAbort",event:kn})},onPending(Ht,oo,Dn,kn){if(!L.get(Ht))return;const{onDragPending:Bo}=P.current,ro={id:Ht,constraint:oo,initialCoordinates:Dn,offset:kn};Bo?.(ro),z({type:"onDragPending",event:ro})},onStart(Ht){const oo=ne.current;if(oo==null)return;const Dn=L.get(oo);if(!Dn)return;const{onDragStart:kn}=P.current,jo={activatorEvent:rn,active:{id:oo,data:Dn.data,rect:X}};co.unstable_batchedUpdates(()=>{kn?.(jo),B(Hr.Initializing),T({type:Vt.DragStart,initialCoordinates:Ht,active:oo}),z({type:"onDragStart",event:jo}),j(st.current),V(rn)})},onMove(Ht){T({type:Vt.DragMove,coordinates:Ht})},onEnd:Ln(Vt.DragEnd),onCancel:Ln(Vt.DragCancel)});st.current=mn;function Ln(Ht){return async function(){const{active:Dn,collisions:kn,over:jo,scrollAdjustedTranslate:Bo}=Ne.current;let ro=null;if(Dn&&Bo){const{cancelDrop:hr}=P.current;ro={activatorEvent:rn,active:Dn,collisions:kn,delta:Bo,over:jo},Ht===Vt.DragEnd&&typeof hr=="function"&&await Promise.resolve(hr(ro))&&(Ht=Vt.DragCancel)}ne.current=null,co.unstable_batchedUpdates(()=>{T({type:Ht}),B(Hr.Uninitialized),Qr(null),j(null),V(null),st.current=null;const hr=Ht===Vt.DragEnd?"onDragEnd":"onDragCancel";if(ro){const Hn=P.current[hr];Hn?.(ro),z({type:hr,event:ro})}})}}},[L]),Kr=b.useCallback((Et,Rt)=>(Xt,hn)=>{const pn=Xt.nativeEvent,rn=L.get(hn);if(ne.current!==null||!rn||pn.dndKit||pn.defaultPrevented)return;const mn={active:rn};Et(Xt,Rt.options,mn)===!0&&(pn.dndKit={capturedBy:Rt.sensor},ne.current=hn,Ct(Xt,Rt))},[L,Ct]),Ms=k6(g,Kr);q6(g),Ao(()=>{ye&&N===Hr.Initializing&&B(Hr.Initialized)},[ye,N]),b.useEffect(()=>{const{onDragMove:Et}=P.current,{active:Rt,activatorEvent:Xt,collisions:hn,over:pn}=Ne.current;if(!Rt||!Xt)return;const rn={active:Rt,activatorEvent:Xt,collisions:hn,delta:{x:nt.x,y:nt.y},over:pn};co.unstable_batchedUpdates(()=>{Et?.(rn),z({type:"onDragMove",event:rn})})},[nt.x,nt.y]),b.useEffect(()=>{const{active:Et,activatorEvent:Rt,collisions:Xt,droppableContainers:hn,scrollAdjustedTranslate:pn}=Ne.current;if(!Et||ne.current==null||!Rt||!pn)return;const{onDragOver:rn}=P.current,mn=hn.get(wt),Ln=mn&&mn.rect.current?{id:mn.id,rect:mn.rect.current,data:mn.data,disabled:mn.disabled}:null,Ht={active:Et,activatorEvent:Rt,collisions:Xt,delta:{x:pn.x,y:pn.y},over:Ln};co.unstable_batchedUpdates(()=>{Qr(Ln),rn?.(Ht),z({type:"onDragOver",event:Ht})})},[wt]),Ao(()=>{Ne.current={activatorEvent:k,active:ee,activeNode:ue,collisionRect:yt,collisions:We,droppableRects:q,draggableNodes:L,draggingNode:tt,draggingNodeRect:vt,droppableContainers:I,over:on,scrollableAncestors:De,scrollAdjustedTranslate:nt},X.current={initial:vt,translated:yt}},[ee,ue,We,yt,L,tt,vt,q,I,on,De,nt]),j6({...fe,delta:H,draggingRect:yt,pointerCoordinates:$e,scrollableAncestors:De,scrollableAncestorRects:Ae});const df=b.useMemo(()=>({active:ee,activeNode:ue,activeNodeRect:ye,activatorEvent:k,collisions:We,containerNodeRect:Ge,dragOverlay:Be,draggableNodes:L,droppableContainers:I,droppableRects:q,over:on,measureDroppableContainers:W,scrollableAncestors:De,scrollableAncestorRects:Ae,measuringConfiguration:O,measuringScheduled:ie,windowRect:we}),[ee,ue,ye,k,We,Ge,Be,L,I,q,on,W,De,Ae,O,ie,we]),Ba=b.useMemo(()=>({activatorEvent:k,activators:Ms,active:ee,activeNodeRect:ye,ariaDescribedById:{draggable:Z},dispatch:T,draggableNodes:L,over:on,measureDroppableContainers:W}),[k,Ms,ee,ye,T,Z,L,on,W]);return Ye.createElement(Qw.Provider,{value:A},Ye.createElement(uf.Provider,{value:Ba},Ye.createElement(sC.Provider,{value:df},Ye.createElement(cC.Provider,{value:Gt},p)),Ye.createElement(o4,{disabled:f?.restoreFocus===!1})),Ye.createElement(t6,{...f,hiddenTextDescribedById:Z}));function $a(){const Et=re?.autoScrollEnabled===!1,Rt=typeof h=="object"?h.enabled===!1:h===!1,Xt=M&&!Et&&!Rt;return typeof h=="object"?{...h,enabled:Xt}:{enabled:Xt}}}),s4=b.createContext(null),U1="button",c4="Draggable";function u4(e){let{id:o,data:r,disabled:a=!1,attributes:l}=e;const c=As(c4),{activators:u,activatorEvent:f,active:h,activeNodeRect:p,ariaDescribedById:g,draggableNodes:v,over:x}=b.useContext(uf),{role:S=U1,roleDescription:E="draggable",tabIndex:C=0}=l??{},R=h?.id===o,T=b.useContext(R?cC:s4),[z,A]=Cu(),[N,B]=Cu(),M=I6(u,o),$=vs(r);Ao(()=>(v.set(o,{id:o,key:c,node:z,activatorNode:N,data:$}),()=>{const H=v.get(o);H&&H.key===c&&v.delete(o)}),[v,o]);const L=b.useMemo(()=>({role:S,tabIndex:C,"aria-disabled":a,"aria-pressed":R&&S===U1?!0:void 0,"aria-roledescription":E,"aria-describedby":g.draggable}),[a,S,C,R,E,g.draggable]);return{active:h,activatorEvent:f,activeNodeRect:p,attributes:L,isDragging:R,listeners:a?void 0:M,node:z,over:x,setNodeRef:A,setActivatorNodeRef:B,transform:T}}function f4(){return b.useContext(sC)}const d4="Droppable",h4={timeout:25};function p4(e){let{data:o,disabled:r=!1,id:a,resizeObserverConfig:l}=e;const c=As(d4),{active:u,dispatch:f,over:h,measureDroppableContainers:p}=b.useContext(uf),g=b.useRef({disabled:r}),v=b.useRef(!1),x=b.useRef(null),S=b.useRef(null),{disabled:E,updateMeasurementsFor:C,timeout:R}={...h4,...l},T=vs(C??a),z=b.useCallback(()=>{if(!v.current){v.current=!0;return}S.current!=null&&clearTimeout(S.current),S.current=setTimeout(()=>{p(Array.isArray(T.current)?T.current:[T.current]),S.current=null},R)},[R]),A=cf({callback:z,disabled:E||!u}),N=b.useCallback((L,H)=>{A&&(H&&(A.unobserve(H),v.current=!1),L&&A.observe(L))},[A]),[B,M]=Cu(N),$=vs(o);return b.useEffect(()=>{!A||!B.current||(A.disconnect(),v.current=!1,A.observe(B.current))},[B,A]),b.useEffect(()=>(f({type:Vt.RegisterDroppable,element:{id:a,key:c,disabled:r,node:B,rect:x,data:$}}),()=>f({type:Vt.UnregisterDroppable,key:c,id:a})),[a]),b.useEffect(()=>{r!==g.current.disabled&&(f({type:Vt.SetDroppableDisabled,id:a,key:c,disabled:r}),g.current.disabled=r)},[a,c,r,f]),{active:u,rect:x,isOver:h?.id===a,node:B,over:h,setNodeRef:M}}function wg(e,o,r){const a=e.slice();return a.splice(r<0?a.length+r:r,0,a.splice(o,1)[0]),a}function m4(e,o){return e.reduce((r,a,l)=>{const c=o.get(a);return c&&(r[l]=c),r},Array(e.length))}function Kc(e){return e!==null&&e>=0}function g4(e,o){if(e===o)return!0;if(e.length!==o.length)return!1;for(let r=0;r{let{rects:o,activeIndex:r,overIndex:a,index:l}=e;const c=wg(o,a,r),u=o[l],f=c[l];return!f||!u?null:{x:f.left-u.left,y:f.top-u.top,scaleX:f.width/u.width,scaleY:f.height/u.height}},Wc={scaleX:1,scaleY:1},y4=e=>{var o;let{activeIndex:r,activeNodeRect:a,index:l,rects:c,overIndex:u}=e;const f=(o=c[r])!=null?o:a;if(!f)return null;if(l===r){const p=c[u];return p?{x:0,y:rr&&l<=u?{x:0,y:-f.height-h,...Wc}:l=u?{x:0,y:f.height+h,...Wc}:{x:0,y:0,...Wc}};function b4(e,o,r){const a=e[o],l=e[o-1],c=e[o+1];return a?ra.map(M=>typeof M=="object"&&"id"in M?M.id:M),[a]),E=u!=null,C=u?S.indexOf(u.id):-1,R=p?S.indexOf(p.id):-1,T=b.useRef(S),z=!g4(S,T.current),A=R!==-1&&C===-1||z,N=v4(c);Ao(()=>{z&&E&&g(S)},[z,S,E,g]),b.useEffect(()=>{T.current=S},[S]);const B=b.useMemo(()=>({activeIndex:C,containerId:v,disabled:N,disableTransforms:A,items:S,overIndex:R,useDragOverlay:x,sortedRects:m4(S,h),strategy:l}),[C,v,N.draggable,N.droppable,A,S,R,h,x,l]);return Ye.createElement(dC.Provider,{value:B},o)}const S4=e=>{let{id:o,items:r,activeIndex:a,overIndex:l}=e;return wg(r,a,l).indexOf(o)},w4=e=>{let{containerId:o,isSorting:r,wasDragging:a,index:l,items:c,newIndex:u,previousItems:f,previousContainerId:h,transition:p}=e;return!p||!a||f!==c&&l===u?!1:r?!0:u!==l&&o===h},C4={duration:200,easing:"ease"},hC="transform",E4=ys.Transition.toString({property:hC,duration:0,easing:"linear"}),R4={roleDescription:"sortable"};function T4(e){let{disabled:o,index:r,node:a,rect:l}=e;const[c,u]=b.useState(null),f=b.useRef(r);return Ao(()=>{if(!o&&r!==f.current&&a.current){const h=l.current;if(h){const p=ll(a.current,{ignoreTransform:!0}),g={x:h.left-p.left,y:h.top-p.top,scaleX:h.width/p.width,scaleY:h.height/p.height};(g.x||g.y)&&u(g)}}r!==f.current&&(f.current=r)},[o,r,a,l]),b.useEffect(()=>{c&&u(null)},[c]),c}function _4(e){let{animateLayoutChanges:o=w4,attributes:r,disabled:a,data:l,getNewIndex:c=S4,id:u,strategy:f,resizeObserverConfig:h,transition:p=C4}=e;const{items:g,containerId:v,activeIndex:x,disabled:S,disableTransforms:E,sortedRects:C,overIndex:R,useDragOverlay:T,strategy:z}=b.useContext(dC),A=D4(a,S),N=g.indexOf(u),B=b.useMemo(()=>({sortable:{containerId:v,index:N,items:g},...l}),[v,l,N,g]),M=b.useMemo(()=>g.slice(g.indexOf(u)),[g,u]),{rect:$,node:L,isOver:H,setNodeRef:I}=p4({id:u,data:B,disabled:A.droppable,resizeObserverConfig:{updateMeasurementsFor:M,...h}}),{active:Y,activatorEvent:X,activeNodeRect:ee,attributes:ne,setNodeRef:re,listeners:j,isDragging:k,over:V,setActivatorNodeRef:P,transform:Z}=u4({id:u,data:B,attributes:{...R4,...r},disabled:A.draggable}),D=V5(I,re),O=!!Y,q=O&&!E&&Kc(x)&&Kc(R),W=!T&&k,ie=W&&q?Z:null,ve=q?ie??(f??z)({rects:C,activeNodeRect:ee,activeIndex:x,overIndex:R,index:N}):null,fe=Kc(x)&&Kc(R)?c({id:u,items:g,activeIndex:x,overIndex:R}):N,be=Y?.id,ye=b.useRef({activeId:be,items:g,newIndex:fe,containerId:v}),Ge=g!==ye.current.items,Ne=o({active:Y,containerId:v,isDragging:k,isSorting:O,id:u,index:N,items:g,newIndex:ye.current.newIndex,previousItems:ye.current.items,previousContainerId:ye.current.containerId,transition:p,wasDragging:ye.current.activeId!=null}),Ke=T4({disabled:!Ne,index:N,node:L,rect:$});return b.useEffect(()=>{O&&ye.current.newIndex!==fe&&(ye.current.newIndex=fe),v!==ye.current.containerId&&(ye.current.containerId=v),g!==ye.current.items&&(ye.current.items=g)},[O,fe,v,g]),b.useEffect(()=>{if(be===ye.current.activeId)return;if(be!=null&&ye.current.activeId==null){ye.current.activeId=be;return}const tt=setTimeout(()=>{ye.current.activeId=be},50);return()=>clearTimeout(tt)},[be]),{active:Y,activeIndex:x,attributes:ne,data:B,rect:$,index:N,newIndex:fe,items:g,isOver:H,isSorting:O,isDragging:k,listeners:j,node:L,overIndex:R,over:V,setNodeRef:D,setActivatorNodeRef:P,setDroppableNodeRef:I,setDraggableNodeRef:re,transform:Ke??ve,transition:Be()};function Be(){if(Ke||Ge&&ye.current.newIndex===N)return E4;if(!(W&&!vg(X)||!p)&&(O||Ne))return ys.Transition.toString({...p,property:hC})}}function D4(e,o){var r,a;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e?.draggable)!=null?r:o.draggable,droppable:(a=e?.droppable)!=null?a:o.droppable}}Qe.Down,Qe.Right,Qe.Up,Qe.Left;const pC=""+new URL("../logo.png",import.meta.url).href;let mC=()=>{};function P1(e){mC=e}const zs=H5({tokenKey:"mv_token",onUnauthorized:e=>mC(e)}),N4=zs.login,A4=zs.logout,z4=zs.isAuthenticated,M4=zs.getUsername,{request:Mo}=zs,O4=()=>Mo("/fields"),V1=()=>Mo("/config"),j4=()=>Mo("/channels"),B4=(e,o)=>Mo(`/styles/preview?layout=${encodeURIComponent(e)}&channel_count=${o}`),Ur=e=>Mo("/config",{method:"PATCH",body:JSON.stringify(e)}),$4=()=>Mo("/refresh",{method:"POST"}),gC=()=>Mo("/streams"),Hp=e=>Mo("/streams/restart",{method:"POST",body:JSON.stringify(e!=null?{n:e}:{})}),L4=(e,o)=>Mo("/streams/restart",{method:"POST",body:JSON.stringify({n:e,channel_idx:o})}),vC=(e,o,r)=>Mo("/styles/background",{method:"POST",body:JSON.stringify({style_id:e,filename:o,data_base64:r})});async function yC(e){const o=localStorage.getItem("mv_token"),r=await fetch(`/api/styles/background?style_id=${encodeURIComponent(e)}`,{headers:o?{Authorization:`Bearer ${o}`}:{}});return r.ok?r.blob():null}const k4=/^(video_encoder|multiview_[0-9a-f]{8}_(selector_type|channel_count|epg_source_mode))$/,bC=e=>k4.test(e),H4=/^Layout\s+\d+[:\s]*/i,U4=e=>({...e,label:e.label.replace(H4,"")});function P4(e,o){const r=[],a=[],l=[];let c=null,u=null;for(const f of e){const h=f.id.replace(`multiview_${o}_`,"");["name","layout","selector_type"].includes(h)?r.push(f):h==="channel_count"?u=f:h==="audio_source"?c=f:h.startsWith("epg_")?l.push(f):a.push(f)}return{base:r,channels:a,epg:l,audioSource:c,channelCountField:u}}function Na(e=4){const o=new Uint8Array(e);return crypto.getRandomValues(o),Array.from(o,r=>r.toString(16).padStart(2,"0")).join("")}function xC(e,o){const r=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),a=URL.createObjectURL(r),l=document.createElement("a");l.href=a,l.download=o,document.body.appendChild(l),l.click(),l.remove(),URL.revokeObjectURL(a)}const Up=["center","top","bottom","left","right"];function Ta(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function V4(e,o){if(!Ta(e))throw new Error(`${o}: not an object`);if(!["static","row","grid"].includes(e.type))throw new Error(`${o}.type: invalid "${e.type}"`);for(const r of["x","y","w","h"])if(typeof e[r]!="number"||!Number.isFinite(e[r]))throw new Error(`${o}.${r}: must be a finite number`);if(e.name!=null&&typeof e.name!="string")throw new Error(`${o}.name: must be a string`);if(e.valign!=null&&!Up.includes(e.valign))throw new Error(`${o}.valign: invalid "${e.valign}"`);if(e.halign!=null&&!Up.includes(e.halign))throw new Error(`${o}.halign: invalid "${e.halign}"`);if(e.type==="row"&&e.direction!=null&&!["horizontal","vertical"].includes(e.direction))throw new Error(`${o}.direction: invalid "${e.direction}"`);if(e.max!=null&&(typeof e.max!="number"||!Number.isFinite(e.max)))throw new Error(`${o}.max: must be a number`);if(e.lockAspect!=null&&typeof e.lockAspect!="boolean")throw new Error(`${o}.lockAspect: must be a boolean`)}function Pp(e,o="style"){if(!Ta(e))throw new Error(`${o}: not an object`);if(e.name!=null&&typeof e.name!="string")throw new Error(`${o}.name: must be a string`);if(!Array.isArray(e.elements))throw new Error(`${o}.elements: must be an array`);if(e.elements.forEach((r,a)=>V4(r,`${o}.elements[${a}]`)),e.background_image_data!=null&&typeof e.background_image_data!="string")throw new Error(`${o}.background_image_data: must be a string`);if(e.background_image_filename!=null&&typeof e.background_image_filename!="string")throw new Error(`${o}.background_image_filename: must be a string`)}const Y4={name:"string",layout:"string",channel_count:"number",selector_type:"string",epg_source_mode:"string"};function G4(e,o){if(!Ta(e))throw new Error(`${o}: not an object`);for(const[r,a]of Object.entries(Y4))if(e[r]!=null&&typeof e[r]!==a)throw new Error(`${o}.${r}: must be a ${a}`);if(e.channels!=null){if(!Array.isArray(e.channels))throw new Error(`${o}.channels: must be an array`);e.channels.forEach((r,a)=>{if(r!=null&&typeof r!="string")throw new Error(`${o}.channels[${a}]: must be a string`)})}}function X4(e){if(!Ta(e))throw new Error("backup: not an object");if(!Array.isArray(e.layouts))throw new Error("backup.layouts: must be an array");if(e.layouts.forEach((o,r)=>G4(o,`backup.layouts[${r}]`)),e.global!=null&&!Ta(e.global))throw new Error("backup.global: must be an object");if(e.custom_styles!=null){if(!Ta(e.custom_styles))throw new Error("backup.custom_styles: must be an object");for(const[o,r]of Object.entries(e.custom_styles))Pp(r,`backup.custom_styles["${o}"]`)}}function q4(e){if(!Ta(e))throw new Error("backup: not an object");const o=e.multiview_order;if(!Array.isArray(o)||o.some(l=>typeof l!="string"))throw new Error("backup.multiview_order: must be an array of strings");const r=new Set(o),a=/^multiview_([0-9a-f]{8})_(.+)$/;for(const l of Object.keys(e)){const c=l.match(a);if(c&&!r.has(c[1]))throw new Error(`backup["${l}"]: id "${c[1]}" not present in multiview_order`)}}function I4({id:e,position:o,fields:r,settings:a,canRemove:l,hasActiveStream:c,dragHandleProps:u,onSettingsChange:f,onFieldsReload:h,onRemove:p,onChannelCountChange:g}){const[v,x]=b.useState(!1),S=qw(Ur,{onOptimisticChange:f,shouldReload:bC,onReload:h,onSaved:()=>Ze.show({message:"Saved",color:"green",autoClose:1500}),onError:I=>Ze.show({title:"Save failed",message:I.message,color:"red",autoClose:4e3})}),{base:E,channels:C,epg:R,audioSource:T,channelCountField:z}=P4(r.map(U4),e),A=a[`multiview_${e}_name`]||`Multiview ${o}`,N=a[`multiview_${e}_channel_count`]??z?.default??4,B=z?.min??2,M=z?.max??9;function $(I){return I.length?y.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:"var(--mantine-spacing-sm)"},children:I.map(Y=>y.jsx(Op,{field:Y,value:a[Y.id],onChange:X=>S(Y.id,X,Y.type!=="string")},Y.id))}):null}function L(I){return I.length?y.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:"var(--mantine-spacing-sm)"},children:I.map(Y=>{const X=new Set,ee=(Y.options??[]).reduce((ne,re)=>{const j=String(re.value);return X.has(j)||(X.add(j),ne.push({value:j,label:re.label})),ne},[]);return y.jsx(Vi,{label:Y.label,description:Y.description,data:ee,value:String(a[Y.id]??Y.default??""),onChange:ne=>S(Y.id,ne,!0),allowDeselect:!1,searchable:!0,limit:50},Y.id)})}):null}const H=y.jsxs(mt,{gap:4,wrap:"nowrap",children:[y.jsx(Yt,{size:"sm",variant:"subtle",color:"gray",style:{cursor:"grab",touchAction:"none"},onClick:I=>I.stopPropagation(),...u,children:y.jsx(v5,{size:16})}),y.jsx(Dt,{size:"xs",color:"red",variant:"subtle",leftSection:y.jsx(hg,{size:14}),style:{visibility:l?"visible":"hidden"},onClick:I=>{I.stopPropagation(),x(!0)},children:"Remove"})]});return y.jsxs(y.Fragment,{children:[y.jsx(Iw,{as:"Card",title:`Layout ${o}: ${A}`,trailingAction:H,children:y.jsxs(Qt,{gap:"md",p:"md",pt:0,children:[$(E),(C.length>0||z)&&y.jsxs(y.Fragment,{children:[y.jsx(Su,{label:y.jsxs(mt,{gap:4,align:"center",children:[y.jsx(Ve,{size:"xs",c:"dimmed",children:"Channels"}),y.jsx(Yt,{size:"xs",variant:"subtle",disabled:N<=B,onClick:()=>g(-1),children:y.jsx(S5,{size:10})}),y.jsx(Ve,{size:"xs",fw:600,w:14,ta:"center",children:N}),y.jsx(Yt,{size:"xs",variant:"subtle",disabled:N>=M,onClick:()=>g(1),children:y.jsx(ls,{size:10})})]}),labelPosition:"left"}),L(C)]}),T&&y.jsx(Op,{field:T,value:a[T.id],onChange:I=>S(T.id,I,!0)}),R.length>0&&y.jsxs(y.Fragment,{children:[y.jsx(Su,{label:"EPG",labelPosition:"left"}),$(R)]})]})}),y.jsxs(Tn,{opened:v,onClose:()=>x(!1),title:`Remove Layout ${o}`,size:"xs",centered:!0,children:[y.jsxs(Ve,{size:"sm",children:["Remove Layout ",o,": ",A,"? This cannot be undone."]}),c&&y.jsx(Ve,{size:"sm",c:"orange",mt:"xs",children:"This layout has an active stream — removing it will disconnect that viewer."}),y.jsxs(mt,{mt:"md",justify:"flex-end",children:[y.jsx(Dt,{variant:"default",onClick:()=>x(!1),children:"Cancel"}),y.jsx(Dt,{color:"red",onClick:()=>{x(!1),p()},children:"Remove"})]})]})]})}function F4({opened:e,onClose:o,settings:r}){const[a,l]=b.useState([]),[c,u]=b.useState({}),[f,h]=b.useState(null),p=b.useCallback(async()=>{try{const x=await gC();l(x.active??[])}catch{}},[]);b.useEffect(()=>{if(!e)return;p();const x=setInterval(p,4e3);return()=>clearInterval(x)},[e,p]);const g=async(x,S,E)=>{u(C=>({...C,[x]:!0}));try{await S(),Ze.show({message:E,color:"blue",autoClose:2e3}),await p()}catch(C){Ze.show({title:"Failed",message:C.message,color:"red",autoClose:4e3})}finally{u(C=>({...C,[x]:!1}))}},v=(x,S,E,C,R)=>h({title:x,message:S,confirmLabel:E,color:C,onConfirm:R});return y.jsxs(Tn,{opened:e,onClose:o,title:"Active Multiviews",size:"sm",centered:!0,children:[y.jsx(Xw,{action:f,onClose:()=>h(null)}),a.length===0?y.jsx(Ve,{size:"sm",c:"dimmed",children:"No multiviews currently active."}):y.jsx(Qt,{gap:"md",children:a.map(({n:x,channels:S})=>{const E=r[`multiview_${x}_name`]||`Multiview ${x}`;return y.jsxs("div",{children:[y.jsxs(mt,{justify:"space-between",mb:6,children:[y.jsx(Ve,{size:"sm",fw:600,children:E}),y.jsx(Dt,{size:"xs",color:"orange",variant:"subtle",leftSection:y.jsx(_1,{size:12}),loading:c[`${x}`],onClick:()=>v("Reload",`Reload ${E}? The compositor will restart and active players will reconnect. Some players may buffer, stutter, or require a manual refresh depending on how they handle stream interruptions.`,"Reload","orange",()=>g(`${x}`,()=>Hp(x),`${E} reloaded`)),children:"Reload"})]}),y.jsx(Qt,{gap:4,pl:"sm",children:(S??[]).map(({idx:C,name:R})=>y.jsxs(mt,{justify:"space-between",children:[y.jsx(Ve,{size:"xs",c:"dimmed",children:R}),y.jsx(Dt,{size:"xs",variant:"subtle",leftSection:y.jsx(Yw,{size:11}),loading:c[`${x}-${C}`],onClick:()=>v("Reconnect",`Reconnect ${R}?`,"Reconnect","blue",()=>g(`${x}-${C}`,()=>L4(x,C),`${R} reconnecting`)),children:"Reconnect"})]},C))})]},x)})}),a.length>1&&y.jsx(Dt,{fullWidth:!0,mt:"md",color:"orange",variant:"light",leftSection:y.jsx(_1,{size:14}),loading:c.all,onClick:()=>v("Reload All",`Reload all ${a.length} multiviews? All compositors will restart and active players will reconnect. Some players may buffer, stutter, or require a manual refresh depending on how they handle stream interruptions.`,"Reload All","orange",()=>g("all",()=>Hp(null),`${a.length} multiviews reloaded`)),children:"Reload All"})]})}var Z4={};function Vp(e,o){for(let r=0,a=e.length;r"u")return"";const a=(r=(o=window.document)==null?void 0:o.documentElement)==null?void 0:r.style;if(!a||e in a)return"";for(let l=0;lo===r.identifier)||e.changedTouches&&Vp(e.changedTouches,r=>o===r.identifier)}function sO(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function cO(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0}function uO(e,o){if(!e)return;let r=e.getElementById("react-draggable-style-el");if(!r){r=e.createElement("style"),r.type="text/css",r.id="react-draggable-style-el";const a=o??cO();a&&r.setAttribute("nonce",a),r.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} + `},e6={onDragStart(e){let{active:o}=e;return"Picked up draggable item "+o.id+"."},onDragOver(e){let{active:o,over:r}=e;return r?"Draggable item "+o.id+" was moved over droppable area "+r.id+".":"Draggable item "+o.id+" is no longer over a droppable area."},onDragEnd(e){let{active:o,over:r}=e;return r?"Draggable item "+o.id+" was dropped over droppable area "+r.id:"Draggable item "+o.id+" was dropped."},onDragCancel(e){let{active:o}=e;return"Dragging was cancelled. Draggable item "+o.id+" was dropped."}};function t6(e){let{announcements:o=e6,container:r,hiddenTextDescribedById:a,screenReaderInstructions:l=J5}=e;const{announce:c,announcement:u}=Q5(),f=As("DndLiveRegion"),[h,p]=b.useState(!1);if(b.useEffect(()=>{p(!0)},[]),K5(b.useMemo(()=>({onDragStart(v){let{active:x}=v;c(o.onDragStart({active:x}))},onDragMove(v){let{active:x,over:S}=v;o.onDragMove&&c(o.onDragMove({active:x,over:S}))},onDragOver(v){let{active:x,over:S}=v;c(o.onDragOver({active:x,over:S}))},onDragEnd(v){let{active:x,over:S}=v;c(o.onDragEnd({active:x,over:S}))},onDragCancel(v){let{active:x,over:S}=v;c(o.onDragCancel({active:x,over:S}))}}),[c,o])),!h)return null;const g=Ge.createElement(Ge.Fragment,null,Ge.createElement(F5,{id:a,value:l.draggable}),Ge.createElement(Z5,{id:f,announcement:u}));return r?co.createPortal(g,r):g}var Vt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Vt||(Vt={}));function Ru(){}function n6(e,o){return b.useMemo(()=>({sensor:e,options:o??{}}),[e,o])}function o6(){for(var e=arguments.length,o=new Array(e),r=0;r[...o].filter(a=>a!=null),[...o])}const go=Object.freeze({x:0,y:0});function r6(e,o){return Math.sqrt(Math.pow(e.x-o.x,2)+Math.pow(e.y-o.y,2))}function a6(e,o){let{data:{value:r}}=e,{data:{value:a}}=o;return r-a}function i6(e,o){let{data:{value:r}}=e,{data:{value:a}}=o;return a-r}function l6(e,o){if(!e||e.length===0)return null;const[r]=e;return r[o]}function z1(e,o,r){return o===void 0&&(o=e.left),r===void 0&&(r=e.top),{x:o+e.width*.5,y:r+e.height*.5}}const s6=e=>{let{collisionRect:o,droppableRects:r,droppableContainers:a}=e;const l=z1(o,o.left,o.top),c=[];for(const u of a){const{id:f}=u,h=r.get(f);if(h){const p=r6(z1(h),l);c.push({id:f,data:{droppableContainer:u,value:p}})}}return c.sort(a6)};function c6(e,o){const r=Math.max(o.top,e.top),a=Math.max(o.left,e.left),l=Math.min(o.left+o.width,e.left+e.width),c=Math.min(o.top+o.height,e.top+e.height),u=l-a,f=c-r;if(a{let{collisionRect:o,droppableRects:r,droppableContainers:a}=e;const l=[];for(const c of a){const{id:u}=c,f=r.get(u);if(f){const h=c6(f,o);h>0&&l.push({id:u,data:{droppableContainer:c,value:h}})}}return l.sort(i6)};function f6(e,o,r){return{...e,scaleX:o&&r?o.width/r.width:1,scaleY:o&&r?o.height/r.height:1}}function Kw(e,o){return e&&o?{x:e.left-o.left,y:e.top-o.top}:go}function d6(e){return function(r){for(var a=arguments.length,l=new Array(a>1?a-1:0),c=1;c({...u,top:u.top+e*f.y,bottom:u.bottom+e*f.y,left:u.left+e*f.x,right:u.right+e*f.x}),{...r})}}const h6=d6(1);function p6(e){if(e.startsWith("matrix3d(")){const o=e.slice(9,-1).split(/, /);return{x:+o[12],y:+o[13],scaleX:+o[0],scaleY:+o[5]}}else if(e.startsWith("matrix(")){const o=e.slice(7,-1).split(/, /);return{x:+o[4],y:+o[5],scaleX:+o[0],scaleY:+o[3]}}return null}function m6(e,o,r){const a=p6(o);if(!a)return e;const{scaleX:l,scaleY:c,x:u,y:f}=a,h=e.left-u-(1-l)*parseFloat(r),p=e.top-f-(1-c)*parseFloat(r.slice(r.indexOf(" ")+1)),g=l?e.width/l:e.width,v=c?e.height/c:e.height;return{width:g,height:v,top:p,right:h+g,bottom:p+v,left:h}}const g6={ignoreTransform:!1};function il(e,o){o===void 0&&(o=g6);let r=e.getBoundingClientRect();if(o.ignoreTransform){const{transform:p,transformOrigin:g}=_n(e).getComputedStyle(e);p&&(r=m6(r,p,g))}const{top:a,left:l,width:c,height:u,bottom:f,right:h}=r;return{top:a,left:l,width:c,height:u,bottom:f,right:h}}function M1(e){return il(e,{ignoreTransform:!0})}function v6(e){const o=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:o,bottom:r,width:o,height:r}}function y6(e,o){return o===void 0&&(o=_n(e).getComputedStyle(e)),o.position==="fixed"}function b6(e,o){o===void 0&&(o=_n(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(l=>{const c=o[l];return typeof c=="string"?r.test(c):!1})}function bg(e,o){const r=[];function a(l){if(o!=null&&r.length>=o||!l)return r;if(gg(l)&&l.scrollingElement!=null&&!r.includes(l.scrollingElement))return r.push(l.scrollingElement),r;if(!Ds(l)||Fw(l)||r.includes(l))return r;const c=_n(e).getComputedStyle(l);return l!==e&&b6(l,c)&&r.push(l),y6(l,c)?r:a(l.parentNode)}return e?a(e):r}function Ww(e){const[o]=bg(e,1);return o??null}function np(e){return!sf||!e?null:rl(e)?e:mg(e)?gg(e)||e===al(e).scrollingElement?window:Ds(e)?e:null:null}function Jw(e){return rl(e)?e.scrollX:e.scrollLeft}function eC(e){return rl(e)?e.scrollY:e.scrollTop}function $p(e){return{x:Jw(e),y:eC(e)}}var Ft;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Ft||(Ft={}));function tC(e){return!sf||!e?!1:e===document.scrollingElement}function nC(e){const o={x:0,y:0},r=tC(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},a={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},l=e.scrollTop<=o.y,c=e.scrollLeft<=o.x,u=e.scrollTop>=a.y,f=e.scrollLeft>=a.x;return{isTop:l,isLeft:c,isBottom:u,isRight:f,maxScroll:a,minScroll:o}}const x6={x:.2,y:.2};function S6(e,o,r,a,l){let{top:c,left:u,right:f,bottom:h}=r;a===void 0&&(a=10),l===void 0&&(l=x6);const{isTop:p,isBottom:g,isLeft:v,isRight:x}=nC(e),S={x:0,y:0},E={x:0,y:0},C={height:o.height*l.y,width:o.width*l.x};return!p&&c<=o.top+C.height?(S.y=Ft.Backward,E.y=a*Math.abs((o.top+C.height-c)/C.height)):!g&&h>=o.bottom-C.height&&(S.y=Ft.Forward,E.y=a*Math.abs((o.bottom-C.height-h)/C.height)),!x&&f>=o.right-C.width?(S.x=Ft.Forward,E.x=a*Math.abs((o.right-C.width-f)/C.width)):!v&&u<=o.left+C.width&&(S.x=Ft.Backward,E.x=a*Math.abs((o.left+C.width-u)/C.width)),{direction:S,speed:E}}function w6(e){if(e===document.scrollingElement){const{innerWidth:c,innerHeight:u}=window;return{top:0,left:0,right:c,bottom:u,width:c,height:u}}const{top:o,left:r,right:a,bottom:l}=e.getBoundingClientRect();return{top:o,left:r,right:a,bottom:l,width:e.clientWidth,height:e.clientHeight}}function oC(e){return e.reduce((o,r)=>$i(o,$p(r)),go)}function C6(e){return e.reduce((o,r)=>o+Jw(r),0)}function E6(e){return e.reduce((o,r)=>o+eC(r),0)}function R6(e,o){if(o===void 0&&(o=il),!e)return;const{top:r,left:a,bottom:l,right:c}=o(e);Ww(e)&&(l<=0||c<=0||r>=window.innerHeight||a>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const T6=[["x",["left","right"],C6],["y",["top","bottom"],E6]];class xg{constructor(o,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const a=bg(r),l=oC(a);this.rect={...o},this.width=o.width,this.height=o.height;for(const[c,u,f]of T6)for(const h of u)Object.defineProperty(this,h,{get:()=>{const p=f(a),g=l[c]-p;return this.rect[h]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ls{constructor(o){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var a;return(a=this.target)==null?void 0:a.removeEventListener(...r)})},this.target=o}add(o,r,a){var l;(l=this.target)==null||l.addEventListener(o,r,a),this.listeners.push([o,r,a])}}function _6(e){const{EventTarget:o}=_n(e);return e instanceof o?e:al(e)}function op(e,o){const r=Math.abs(e.x),a=Math.abs(e.y);return typeof o=="number"?Math.sqrt(r**2+a**2)>o:"x"in o&&"y"in o?r>o.x&&a>o.y:"x"in o?r>o.x:"y"in o?a>o.y:!1}var Qn;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Qn||(Qn={}));function O1(e){e.preventDefault()}function D6(e){e.stopPropagation()}var Ke;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Ke||(Ke={}));const rC={start:[Ke.Space,Ke.Enter],cancel:[Ke.Esc],end:[Ke.Space,Ke.Enter,Ke.Tab]},N6=(e,o)=>{let{currentCoordinates:r}=o;switch(e.code){case Ke.Right:return{...r,x:r.x+25};case Ke.Left:return{...r,x:r.x-25};case Ke.Down:return{...r,y:r.y+25};case Ke.Up:return{...r,y:r.y-25}}};class aC{constructor(o){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=o;const{event:{target:r}}=o;this.props=o,this.listeners=new ls(al(r)),this.windowListeners=new ls(_n(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Qn.Resize,this.handleCancel),this.windowListeners.add(Qn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Qn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:o,onStart:r}=this.props,a=o.node.current;a&&R6(a),r(go)}handleKeyDown(o){if(yg(o)){const{active:r,context:a,options:l}=this.props,{keyboardCodes:c=rC,coordinateGetter:u=N6,scrollBehavior:f="smooth"}=l,{code:h}=o;if(c.end.includes(h)){this.handleEnd(o);return}if(c.cancel.includes(h)){this.handleCancel(o);return}const{collisionRect:p}=a.current,g=p?{x:p.left,y:p.top}:go;this.referenceCoordinates||(this.referenceCoordinates=g);const v=u(o,{active:r,context:a.current,currentCoordinates:g});if(v){const x=Eu(v,g),S={x:0,y:0},{scrollableAncestors:E}=a.current;for(const C of E){const R=o.code,{isTop:T,isRight:z,isLeft:A,isBottom:N,maxScroll:B,minScroll:M}=nC(C),$=w6(C),L={x:Math.min(R===Ke.Right?$.right-$.width/2:$.right,Math.max(R===Ke.Right?$.left:$.left+$.width/2,v.x)),y:Math.min(R===Ke.Down?$.bottom-$.height/2:$.bottom,Math.max(R===Ke.Down?$.top:$.top+$.height/2,v.y))},H=R===Ke.Right&&!z||R===Ke.Left&&!A,I=R===Ke.Down&&!N||R===Ke.Up&&!T;if(H&&L.x!==v.x){const Y=C.scrollLeft+x.x,X=R===Ke.Right&&Y<=B.x||R===Ke.Left&&Y>=M.x;if(X&&!x.y){C.scrollTo({left:Y,behavior:f});return}X?S.x=C.scrollLeft-Y:S.x=R===Ke.Right?C.scrollLeft-B.x:C.scrollLeft-M.x,S.x&&C.scrollBy({left:-S.x,behavior:f});break}else if(I&&L.y!==v.y){const Y=C.scrollTop+x.y,X=R===Ke.Down&&Y<=B.y||R===Ke.Up&&Y>=M.y;if(X&&!x.x){C.scrollTo({top:Y,behavior:f});return}X?S.y=C.scrollTop-Y:S.y=R===Ke.Down?C.scrollTop-B.y:C.scrollTop-M.y,S.y&&C.scrollBy({top:-S.y,behavior:f});break}}this.handleMove(o,$i(Eu(v,this.referenceCoordinates),S))}}}handleMove(o,r){const{onMove:a}=this.props;o.preventDefault(),a(r)}handleEnd(o){const{onEnd:r}=this.props;o.preventDefault(),this.detach(),r()}handleCancel(o){const{onCancel:r}=this.props;o.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}aC.activators=[{eventName:"onKeyDown",handler:(e,o,r)=>{let{keyboardCodes:a=rC,onActivation:l}=o,{active:c}=r;const{code:u}=e.nativeEvent;if(a.start.includes(u)){const f=c.activatorNode.current;return f&&e.target!==f?!1:(e.preventDefault(),l?.({event:e.nativeEvent}),!0)}return!1}}];function j1(e){return!!(e&&"distance"in e)}function B1(e){return!!(e&&"delay"in e)}class Sg{constructor(o,r,a){var l;a===void 0&&(a=_6(o.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=o,this.events=r;const{event:c}=o,{target:u}=c;this.props=o,this.events=r,this.document=al(u),this.documentListeners=new ls(this.document),this.listeners=new ls(a),this.windowListeners=new ls(_n(u)),this.initialCoordinates=(l=Bp(c))!=null?l:go,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:o,props:{options:{activationConstraint:r,bypassActivationConstraint:a}}}=this;if(this.listeners.add(o.move.name,this.handleMove,{passive:!1}),this.listeners.add(o.end.name,this.handleEnd),o.cancel&&this.listeners.add(o.cancel.name,this.handleCancel),this.windowListeners.add(Qn.Resize,this.handleCancel),this.windowListeners.add(Qn.DragStart,O1),this.windowListeners.add(Qn.VisibilityChange,this.handleCancel),this.windowListeners.add(Qn.ContextMenu,O1),this.documentListeners.add(Qn.Keydown,this.handleKeydown),r){if(a!=null&&a({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(B1(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(j1(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(o,r){const{active:a,onPending:l}=this.props;l(a,o,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:o}=this,{onStart:r}=this.props;o&&(this.activated=!0,this.documentListeners.add(Qn.Click,D6,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Qn.SelectionChange,this.removeTextSelection),r(o))}handleMove(o){var r;const{activated:a,initialCoordinates:l,props:c}=this,{onMove:u,options:{activationConstraint:f}}=c;if(!l)return;const h=(r=Bp(o))!=null?r:go,p=Eu(l,h);if(!a&&f){if(j1(f)){if(f.tolerance!=null&&op(p,f.tolerance))return this.handleCancel();if(op(p,f.distance))return this.handleStart()}if(B1(f)&&op(p,f.tolerance))return this.handleCancel();this.handlePending(f,p);return}o.cancelable&&o.preventDefault(),u(h)}handleEnd(){const{onAbort:o,onEnd:r}=this.props;this.detach(),this.activated||o(this.props.active),r()}handleCancel(){const{onAbort:o,onCancel:r}=this.props;this.detach(),this.activated||o(this.props.active),r()}handleKeydown(o){o.code===Ke.Esc&&this.handleCancel()}removeTextSelection(){var o;(o=this.document.getSelection())==null||o.removeAllRanges()}}const A6={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class wg extends Sg{constructor(o){const{event:r}=o,a=al(r.target);super(o,A6,a)}}wg.activators=[{eventName:"onPointerDown",handler:(e,o)=>{let{nativeEvent:r}=e,{onActivation:a}=o;return!r.isPrimary||r.button!==0?!1:(a?.({event:r}),!0)}}];const z6={move:{name:"mousemove"},end:{name:"mouseup"}};var Lp;(function(e){e[e.RightClick=2]="RightClick"})(Lp||(Lp={}));class M6 extends Sg{constructor(o){super(o,z6,al(o.event.target))}}M6.activators=[{eventName:"onMouseDown",handler:(e,o)=>{let{nativeEvent:r}=e,{onActivation:a}=o;return r.button===Lp.RightClick?!1:(a?.({event:r}),!0)}}];const rp={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class O6 extends Sg{constructor(o){super(o,rp)}static setup(){return window.addEventListener(rp.move.name,o,{capture:!1,passive:!1}),function(){window.removeEventListener(rp.move.name,o)};function o(){}}}O6.activators=[{eventName:"onTouchStart",handler:(e,o)=>{let{nativeEvent:r}=e,{onActivation:a}=o;const{touches:l}=r;return l.length>1?!1:(a?.({event:r}),!0)}}];var ss;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(ss||(ss={}));var Tu;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Tu||(Tu={}));function j6(e){let{acceleration:o,activator:r=ss.Pointer,canScroll:a,draggingRect:l,enabled:c,interval:u=5,order:f=Tu.TreeOrder,pointerCoordinates:h,scrollableAncestors:p,scrollableAncestorRects:g,delta:v,threshold:x}=e;const S=$6({delta:v,disabled:!c}),[E,C]=Y5(),R=b.useRef({x:0,y:0}),T=b.useRef({x:0,y:0}),z=b.useMemo(()=>{switch(r){case ss.Pointer:return h?{top:h.y,bottom:h.y,left:h.x,right:h.x}:null;case ss.DraggableRect:return l}},[r,l,h]),A=b.useRef(null),N=b.useCallback(()=>{const M=A.current;if(!M)return;const $=R.current.x*T.current.x,L=R.current.y*T.current.y;M.scrollBy($,L)},[]),B=b.useMemo(()=>f===Tu.TreeOrder?[...p].reverse():p,[f,p]);b.useEffect(()=>{if(!c||!p.length||!z){C();return}for(const M of B){if(a?.(M)===!1)continue;const $=p.indexOf(M),L=g[$];if(!L)continue;const{direction:H,speed:I}=S6(M,L,z,o,x);for(const Y of["x","y"])S[Y][H[Y]]||(I[Y]=0,H[Y]=0);if(I.x>0||I.y>0){C(),A.current=M,E(N,u),R.current=I,T.current=H;return}}R.current={x:0,y:0},T.current={x:0,y:0},C()},[o,N,a,C,c,u,JSON.stringify(z),JSON.stringify(S),E,p,B,g,JSON.stringify(x)])}const B6={x:{[Ft.Backward]:!1,[Ft.Forward]:!1},y:{[Ft.Backward]:!1,[Ft.Forward]:!1}};function $6(e){let{delta:o,disabled:r}=e;const a=jp(o);return Ns(l=>{if(r||!a||!l)return B6;const c={x:Math.sign(o.x-a.x),y:Math.sign(o.y-a.y)};return{x:{[Ft.Backward]:l.x[Ft.Backward]||c.x===-1,[Ft.Forward]:l.x[Ft.Forward]||c.x===1},y:{[Ft.Backward]:l.y[Ft.Backward]||c.y===-1,[Ft.Forward]:l.y[Ft.Forward]||c.y===1}}},[r,o,a])}function L6(e,o){const r=o!=null?e.get(o):void 0,a=r?r.node.current:null;return Ns(l=>{var c;return o==null?null:(c=a??l)!=null?c:null},[a,o])}function k6(e,o){return b.useMemo(()=>e.reduce((r,a)=>{const{sensor:l}=a,c=l.activators.map(u=>({eventName:u.eventName,handler:o(u.handler,a)}));return[...r,...c]},[]),[e,o])}var bs;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(bs||(bs={}));var kp;(function(e){e.Optimized="optimized"})(kp||(kp={}));const $1=new Map;function H6(e,o){let{dragging:r,dependencies:a,config:l}=o;const[c,u]=b.useState(null),{frequency:f,measure:h,strategy:p}=l,g=b.useRef(e),v=R(),x=vs(v),S=b.useCallback(function(T){T===void 0&&(T=[]),!x.current&&u(z=>z===null?T:z.concat(T.filter(A=>!z.includes(A))))},[x]),E=b.useRef(null),C=Ns(T=>{if(v&&!r)return $1;if(!T||T===$1||g.current!==e||c!=null){const z=new Map;for(let A of e){if(!A)continue;if(c&&c.length>0&&!c.includes(A.id)&&A.rect.current){z.set(A.id,A.rect.current);continue}const N=A.node.current,B=N?new xg(h(N),N):null;A.rect.current=B,B&&z.set(A.id,B)}return z}return T},[e,c,r,v,h]);return b.useEffect(()=>{g.current=e},[e]),b.useEffect(()=>{v||S()},[r,v]),b.useEffect(()=>{c&&c.length>0&&u(null)},[JSON.stringify(c)]),b.useEffect(()=>{v||typeof f!="number"||E.current!==null||(E.current=setTimeout(()=>{S(),E.current=null},f))},[f,v,S,...a]),{droppableRects:C,measureDroppableContainers:S,measuringScheduled:c!=null};function R(){switch(p){case bs.Always:return!1;case bs.BeforeDragging:return r;default:return!r}}}function iC(e,o){return Ns(r=>e?r||(typeof o=="function"?o(e):e):null,[o,e])}function U6(e,o){return iC(e,o)}function P6(e){let{callback:o,disabled:r}=e;const a=vg(o),l=b.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:c}=window;return new c(a)},[a,r]);return b.useEffect(()=>()=>l?.disconnect(),[l]),l}function cf(e){let{callback:o,disabled:r}=e;const a=vg(o),l=b.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:c}=window;return new c(a)},[r]);return b.useEffect(()=>()=>l?.disconnect(),[l]),l}function V6(e){return new xg(il(e),e)}function L1(e,o,r){o===void 0&&(o=V6);const[a,l]=b.useState(null);function c(){l(h=>{if(!e)return null;if(e.isConnected===!1){var p;return(p=h??r)!=null?p:null}const g=o(e);return JSON.stringify(h)===JSON.stringify(g)?h:g})}const u=P6({callback(h){if(e)for(const p of h){const{type:g,target:v}=p;if(g==="childList"&&v instanceof HTMLElement&&v.contains(e)){c();break}}}}),f=cf({callback:c});return Ao(()=>{c(),e?(f?.observe(e),u?.observe(document.body,{childList:!0,subtree:!0})):(f?.disconnect(),u?.disconnect())},[e]),a}function Y6(e){const o=iC(e);return Kw(e,o)}const k1=[];function G6(e){const o=b.useRef(e),r=Ns(a=>e?a&&a!==k1&&e&&o.current&&e.parentNode===o.current.parentNode?a:bg(e):k1,[e]);return b.useEffect(()=>{o.current=e},[e]),r}function X6(e){const[o,r]=b.useState(null),a=b.useRef(e),l=b.useCallback(c=>{const u=np(c.target);u&&r(f=>f?(f.set(u,$p(u)),new Map(f)):null)},[]);return b.useEffect(()=>{const c=a.current;if(e!==c){u(c);const f=e.map(h=>{const p=np(h);return p?(p.addEventListener("scroll",l,{passive:!0}),[p,$p(p)]):null}).filter(h=>h!=null);r(f.length?new Map(f):null),a.current=e}return()=>{u(e),u(c)};function u(f){f.forEach(h=>{const p=np(h);p?.removeEventListener("scroll",l)})}},[l,e]),b.useMemo(()=>e.length?o?Array.from(o.values()).reduce((c,u)=>$i(c,u),go):oC(e):go,[e,o])}function H1(e,o){o===void 0&&(o=[]);const r=b.useRef(null);return b.useEffect(()=>{r.current=null},o),b.useEffect(()=>{const a=e!==go;a&&!r.current&&(r.current=e),!a&&r.current&&(r.current=null)},[e]),r.current?Eu(e,r.current):go}function q6(e){b.useEffect(()=>{if(!sf)return;const o=e.map(r=>{let{sensor:a}=r;return a.setup==null?void 0:a.setup()});return()=>{for(const r of o)r?.()}},e.map(o=>{let{sensor:r}=o;return r}))}function I6(e,o){return b.useMemo(()=>e.reduce((r,a)=>{let{eventName:l,handler:c}=a;return r[l]=u=>{c(u,o)},r},{}),[e,o])}function lC(e){return b.useMemo(()=>e?v6(e):null,[e])}const U1=[];function F6(e,o){o===void 0&&(o=il);const[r]=e,a=lC(r?_n(r):null),[l,c]=b.useState(U1);function u(){c(()=>e.length?e.map(h=>tC(h)?a:new xg(o(h),h)):U1)}const f=cf({callback:u});return Ao(()=>{f?.disconnect(),u(),e.forEach(h=>f?.observe(h))},[e]),l}function Z6(e){if(!e)return null;if(e.children.length>1)return e;const o=e.children[0];return Ds(o)?o:e}function Q6(e){let{measure:o}=e;const[r,a]=b.useState(null),l=b.useCallback(p=>{for(const{target:g}of p)if(Ds(g)){a(v=>{const x=o(g);return v?{...v,width:x.width,height:x.height}:x});break}},[o]),c=cf({callback:l}),u=b.useCallback(p=>{const g=Z6(p);c?.disconnect(),g&&c?.observe(g),a(g?o(g):null)},[o,c]),[f,h]=Cu(u);return b.useMemo(()=>({nodeRef:f,rect:r,setRef:h}),[r,f,h])}const K6=[{sensor:wg,options:{}},{sensor:aC,options:{}}],W6={current:{}},fu={draggable:{measure:M1},droppable:{measure:M1,strategy:bs.WhileDragging,frequency:kp.Optimized},dragOverlay:{measure:il}};class cs extends Map{get(o){var r;return o!=null&&(r=super.get(o))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(o=>{let{disabled:r}=o;return!r})}getNodeFor(o){var r,a;return(r=(a=this.get(o))==null?void 0:a.node.current)!=null?r:void 0}}const J6={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new cs,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ru},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:fu,measureDroppableContainers:Ru,windowRect:null,measuringScheduled:!1},e4={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ru,draggableNodes:new Map,over:null,measureDroppableContainers:Ru},uf=b.createContext(e4),sC=b.createContext(J6);function t4(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new cs}}}function n4(e,o){switch(o.type){case Vt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:o.initialCoordinates,active:o.active}};case Vt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:o.coordinates.x-e.draggable.initialCoordinates.x,y:o.coordinates.y-e.draggable.initialCoordinates.y}}};case Vt.DragEnd:case Vt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Vt.RegisterDroppable:{const{element:r}=o,{id:a}=r,l=new cs(e.droppable.containers);return l.set(a,r),{...e,droppable:{...e.droppable,containers:l}}}case Vt.SetDroppableDisabled:{const{id:r,key:a,disabled:l}=o,c=e.droppable.containers.get(r);if(!c||a!==c.key)return e;const u=new cs(e.droppable.containers);return u.set(r,{...c,disabled:l}),{...e,droppable:{...e.droppable,containers:u}}}case Vt.UnregisterDroppable:{const{id:r,key:a}=o,l=e.droppable.containers.get(r);if(!l||a!==l.key)return e;const c=new cs(e.droppable.containers);return c.delete(r),{...e,droppable:{...e.droppable,containers:c}}}default:return e}}function o4(e){let{disabled:o}=e;const{active:r,activatorEvent:a,draggableNodes:l}=b.useContext(uf),c=jp(a),u=jp(r?.id);return b.useEffect(()=>{if(!o&&!a&&c&&u!=null){if(!yg(c)||document.activeElement===c.target)return;const f=l.get(u);if(!f)return;const{activatorNode:h,node:p}=f;if(!h.current&&!p.current)return;requestAnimationFrame(()=>{for(const g of[h.current,p.current]){if(!g)continue;const v=q5(g);if(v){v.focus();break}}})}},[a,o,l,u,c]),null}function r4(e,o){let{transform:r,...a}=o;return e!=null&&e.length?e.reduce((l,c)=>c({transform:l,...a}),r):r}function a4(e){return b.useMemo(()=>({draggable:{...fu.draggable,...e?.draggable},droppable:{...fu.droppable,...e?.droppable},dragOverlay:{...fu.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function i4(e){let{activeNode:o,measure:r,initialRect:a,config:l=!0}=e;const c=b.useRef(!1),{x:u,y:f}=typeof l=="boolean"?{x:l,y:l}:l;Ao(()=>{if(!u&&!f||!o){c.current=!1;return}if(c.current||!a)return;const p=o?.node.current;if(!p||p.isConnected===!1)return;const g=r(p),v=Kw(g,a);if(u||(v.x=0),f||(v.y=0),c.current=!0,Math.abs(v.x)>0||Math.abs(v.y)>0){const x=Ww(p);x&&x.scrollBy({top:v.y,left:v.x})}},[o,u,f,a,r])}const cC=b.createContext({...go,scaleX:1,scaleY:1});var Hr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Hr||(Hr={}));const l4=b.memo(function(o){var r,a,l,c;let{id:u,accessibility:f,autoScroll:h=!0,children:p,sensors:g=K6,collisionDetection:v=u6,measuring:x,modifiers:S,...E}=o;const C=b.useReducer(n4,void 0,t4),[R,T]=C,[z,A]=W5(),[N,B]=b.useState(Hr.Uninitialized),M=N===Hr.Initialized,{draggable:{active:$,nodes:L,translate:H},droppable:{containers:I}}=R,Y=$!=null?L.get($):null,X=b.useRef({initial:null,translated:null}),ee=b.useMemo(()=>{var Et;return $!=null?{id:$,data:(Et=Y?.data)!=null?Et:W6,rect:X}:null},[$,Y]),ne=b.useRef(null),[re,j]=b.useState(null),[k,V]=b.useState(null),P=vs(E,Object.values(E)),Z=As("DndDescribedBy",u),D=b.useMemo(()=>I.getEnabled(),[I]),O=a4(x),{droppableRects:q,measureDroppableContainers:W,measuringScheduled:ie}=H6(D,{dragging:M,dependencies:[H.x,H.y],config:O.droppable}),ue=L6(L,$),ve=b.useMemo(()=>k?Bp(k):null,[k]),fe=$a(),be=U6(ue,O.draggable.measure);i4({activeNode:$!=null?L.get($):null,config:fe.layoutShiftCompensation,initialRect:be,measure:O.draggable.measure});const ye=L1(ue,O.draggable.measure,be),Xe=L1(ue?ue.parentElement:null),Ne=b.useRef({activatorEvent:null,active:null,activeNode:ue,collisionRect:null,collisions:null,droppableRects:q,draggableNodes:L,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),We=I.getNodeFor((r=Ne.current.over)==null?void 0:r.id),Be=Q6({measure:O.dragOverlay.measure}),nt=(a=Be.nodeRef.current)!=null?a:ue,vt=M?(l=Be.rect)!=null?l:ye:null,pe=!!(Be.nodeRef.current&&Be.rect),me=Y6(pe?null:ye),we=lC(nt?_n(nt):null),De=G6(M?We??ue:null),Ae=F6(De),xe=r4(S,{transform:{x:H.x-me.x,y:H.y-me.y,scaleX:1,scaleY:1},activatorEvent:k,active:ee,activeNodeRect:ye,containerNodeRect:Xe,draggingNodeRect:vt,over:Ne.current.over,overlayNodeRect:Be.rect,scrollableAncestors:De,scrollableAncestorRects:Ae,windowRect:we}),$e=ve?$i(ve,H):null,de=X6(De),Re=H1(de),dt=H1(de,[ye]),ot=$i(xe,Re),yt=vt?h6(vt,xe):null,Je=ee&&yt?v({active:ee,collisionRect:yt,droppableRects:q,droppableContainers:D,pointerCoordinates:$e}):null,wt=l6(Je,"id"),[on,Qr]=b.useState(null),jo=pe?xe:$i(xe,dt),Gt=f6(jo,(c=on?.rect)!=null?c:null,ye),st=b.useRef(null),Ct=b.useCallback((Et,Rt)=>{let{sensor:Xt,options:hn}=Rt;if(ne.current==null)return;const pn=L.get(ne.current);if(!pn)return;const rn=Et.nativeEvent,mn=new Xt({active:ne.current,activeNode:pn,event:rn,options:hn,context:Ne,onAbort(Ht){if(!L.get(Ht))return;const{onDragAbort:Dn}=P.current,kn={id:Ht};Dn?.(kn),z({type:"onDragAbort",event:kn})},onPending(Ht,oo,Dn,kn){if(!L.get(Ht))return;const{onDragPending:$o}=P.current,ro={id:Ht,constraint:oo,initialCoordinates:Dn,offset:kn};$o?.(ro),z({type:"onDragPending",event:ro})},onStart(Ht){const oo=ne.current;if(oo==null)return;const Dn=L.get(oo);if(!Dn)return;const{onDragStart:kn}=P.current,Bo={activatorEvent:rn,active:{id:oo,data:Dn.data,rect:X}};co.unstable_batchedUpdates(()=>{kn?.(Bo),B(Hr.Initializing),T({type:Vt.DragStart,initialCoordinates:Ht,active:oo}),z({type:"onDragStart",event:Bo}),j(st.current),V(rn)})},onMove(Ht){T({type:Vt.DragMove,coordinates:Ht})},onEnd:Ln(Vt.DragEnd),onCancel:Ln(Vt.DragCancel)});st.current=mn;function Ln(Ht){return async function(){const{active:Dn,collisions:kn,over:Bo,scrollAdjustedTranslate:$o}=Ne.current;let ro=null;if(Dn&&$o){const{cancelDrop:hr}=P.current;ro={activatorEvent:rn,active:Dn,collisions:kn,delta:$o,over:Bo},Ht===Vt.DragEnd&&typeof hr=="function"&&await Promise.resolve(hr(ro))&&(Ht=Vt.DragCancel)}ne.current=null,co.unstable_batchedUpdates(()=>{T({type:Ht}),B(Hr.Uninitialized),Qr(null),j(null),V(null),st.current=null;const hr=Ht===Vt.DragEnd?"onDragEnd":"onDragCancel";if(ro){const Hn=P.current[hr];Hn?.(ro),z({type:hr,event:ro})}})}}},[L]),Kr=b.useCallback((Et,Rt)=>(Xt,hn)=>{const pn=Xt.nativeEvent,rn=L.get(hn);if(ne.current!==null||!rn||pn.dndKit||pn.defaultPrevented)return;const mn={active:rn};Et(Xt,Rt.options,mn)===!0&&(pn.dndKit={capturedBy:Rt.sensor},ne.current=hn,Ct(Xt,Rt))},[L,Ct]),Ms=k6(g,Kr);q6(g),Ao(()=>{ye&&N===Hr.Initializing&&B(Hr.Initialized)},[ye,N]),b.useEffect(()=>{const{onDragMove:Et}=P.current,{active:Rt,activatorEvent:Xt,collisions:hn,over:pn}=Ne.current;if(!Rt||!Xt)return;const rn={active:Rt,activatorEvent:Xt,collisions:hn,delta:{x:ot.x,y:ot.y},over:pn};co.unstable_batchedUpdates(()=>{Et?.(rn),z({type:"onDragMove",event:rn})})},[ot.x,ot.y]),b.useEffect(()=>{const{active:Et,activatorEvent:Rt,collisions:Xt,droppableContainers:hn,scrollAdjustedTranslate:pn}=Ne.current;if(!Et||ne.current==null||!Rt||!pn)return;const{onDragOver:rn}=P.current,mn=hn.get(wt),Ln=mn&&mn.rect.current?{id:mn.id,rect:mn.rect.current,data:mn.data,disabled:mn.disabled}:null,Ht={active:Et,activatorEvent:Rt,collisions:Xt,delta:{x:pn.x,y:pn.y},over:Ln};co.unstable_batchedUpdates(()=>{Qr(Ln),rn?.(Ht),z({type:"onDragOver",event:Ht})})},[wt]),Ao(()=>{Ne.current={activatorEvent:k,active:ee,activeNode:ue,collisionRect:yt,collisions:Je,droppableRects:q,draggableNodes:L,draggingNode:nt,draggingNodeRect:vt,droppableContainers:I,over:on,scrollableAncestors:De,scrollAdjustedTranslate:ot},X.current={initial:vt,translated:yt}},[ee,ue,Je,yt,L,nt,vt,q,I,on,De,ot]),j6({...fe,delta:H,draggingRect:yt,pointerCoordinates:$e,scrollableAncestors:De,scrollableAncestorRects:Ae});const df=b.useMemo(()=>({active:ee,activeNode:ue,activeNodeRect:ye,activatorEvent:k,collisions:Je,containerNodeRect:Xe,dragOverlay:Be,draggableNodes:L,droppableContainers:I,droppableRects:q,over:on,measureDroppableContainers:W,scrollableAncestors:De,scrollableAncestorRects:Ae,measuringConfiguration:O,measuringScheduled:ie,windowRect:we}),[ee,ue,ye,k,Je,Xe,Be,L,I,q,on,W,De,Ae,O,ie,we]),Ba=b.useMemo(()=>({activatorEvent:k,activators:Ms,active:ee,activeNodeRect:ye,ariaDescribedById:{draggable:Z},dispatch:T,draggableNodes:L,over:on,measureDroppableContainers:W}),[k,Ms,ee,ye,T,Z,L,on,W]);return Ge.createElement(Qw.Provider,{value:A},Ge.createElement(uf.Provider,{value:Ba},Ge.createElement(sC.Provider,{value:df},Ge.createElement(cC.Provider,{value:Gt},p)),Ge.createElement(o4,{disabled:f?.restoreFocus===!1})),Ge.createElement(t6,{...f,hiddenTextDescribedById:Z}));function $a(){const Et=re?.autoScrollEnabled===!1,Rt=typeof h=="object"?h.enabled===!1:h===!1,Xt=M&&!Et&&!Rt;return typeof h=="object"?{...h,enabled:Xt}:{enabled:Xt}}}),s4=b.createContext(null),P1="button",c4="Draggable";function u4(e){let{id:o,data:r,disabled:a=!1,attributes:l}=e;const c=As(c4),{activators:u,activatorEvent:f,active:h,activeNodeRect:p,ariaDescribedById:g,draggableNodes:v,over:x}=b.useContext(uf),{role:S=P1,roleDescription:E="draggable",tabIndex:C=0}=l??{},R=h?.id===o,T=b.useContext(R?cC:s4),[z,A]=Cu(),[N,B]=Cu(),M=I6(u,o),$=vs(r);Ao(()=>(v.set(o,{id:o,key:c,node:z,activatorNode:N,data:$}),()=>{const H=v.get(o);H&&H.key===c&&v.delete(o)}),[v,o]);const L=b.useMemo(()=>({role:S,tabIndex:C,"aria-disabled":a,"aria-pressed":R&&S===P1?!0:void 0,"aria-roledescription":E,"aria-describedby":g.draggable}),[a,S,C,R,E,g.draggable]);return{active:h,activatorEvent:f,activeNodeRect:p,attributes:L,isDragging:R,listeners:a?void 0:M,node:z,over:x,setNodeRef:A,setActivatorNodeRef:B,transform:T}}function f4(){return b.useContext(sC)}const d4="Droppable",h4={timeout:25};function p4(e){let{data:o,disabled:r=!1,id:a,resizeObserverConfig:l}=e;const c=As(d4),{active:u,dispatch:f,over:h,measureDroppableContainers:p}=b.useContext(uf),g=b.useRef({disabled:r}),v=b.useRef(!1),x=b.useRef(null),S=b.useRef(null),{disabled:E,updateMeasurementsFor:C,timeout:R}={...h4,...l},T=vs(C??a),z=b.useCallback(()=>{if(!v.current){v.current=!0;return}S.current!=null&&clearTimeout(S.current),S.current=setTimeout(()=>{p(Array.isArray(T.current)?T.current:[T.current]),S.current=null},R)},[R]),A=cf({callback:z,disabled:E||!u}),N=b.useCallback((L,H)=>{A&&(H&&(A.unobserve(H),v.current=!1),L&&A.observe(L))},[A]),[B,M]=Cu(N),$=vs(o);return b.useEffect(()=>{!A||!B.current||(A.disconnect(),v.current=!1,A.observe(B.current))},[B,A]),b.useEffect(()=>(f({type:Vt.RegisterDroppable,element:{id:a,key:c,disabled:r,node:B,rect:x,data:$}}),()=>f({type:Vt.UnregisterDroppable,key:c,id:a})),[a]),b.useEffect(()=>{r!==g.current.disabled&&(f({type:Vt.SetDroppableDisabled,id:a,key:c,disabled:r}),g.current.disabled=r)},[a,c,r,f]),{active:u,rect:x,isOver:h?.id===a,node:B,over:h,setNodeRef:M}}function Cg(e,o,r){const a=e.slice();return a.splice(r<0?a.length+r:r,0,a.splice(o,1)[0]),a}function m4(e,o){return e.reduce((r,a,l)=>{const c=o.get(a);return c&&(r[l]=c),r},Array(e.length))}function Kc(e){return e!==null&&e>=0}function g4(e,o){if(e===o)return!0;if(e.length!==o.length)return!1;for(let r=0;r{let{rects:o,activeIndex:r,overIndex:a,index:l}=e;const c=Cg(o,a,r),u=o[l],f=c[l];return!f||!u?null:{x:f.left-u.left,y:f.top-u.top,scaleX:f.width/u.width,scaleY:f.height/u.height}},Wc={scaleX:1,scaleY:1},y4=e=>{var o;let{activeIndex:r,activeNodeRect:a,index:l,rects:c,overIndex:u}=e;const f=(o=c[r])!=null?o:a;if(!f)return null;if(l===r){const p=c[u];return p?{x:0,y:rr&&l<=u?{x:0,y:-f.height-h,...Wc}:l=u?{x:0,y:f.height+h,...Wc}:{x:0,y:0,...Wc}};function b4(e,o,r){const a=e[o],l=e[o-1],c=e[o+1];return a?ra.map(M=>typeof M=="object"&&"id"in M?M.id:M),[a]),E=u!=null,C=u?S.indexOf(u.id):-1,R=p?S.indexOf(p.id):-1,T=b.useRef(S),z=!g4(S,T.current),A=R!==-1&&C===-1||z,N=v4(c);Ao(()=>{z&&E&&g(S)},[z,S,E,g]),b.useEffect(()=>{T.current=S},[S]);const B=b.useMemo(()=>({activeIndex:C,containerId:v,disabled:N,disableTransforms:A,items:S,overIndex:R,useDragOverlay:x,sortedRects:m4(S,h),strategy:l}),[C,v,N.draggable,N.droppable,A,S,R,h,x,l]);return Ge.createElement(dC.Provider,{value:B},o)}const S4=e=>{let{id:o,items:r,activeIndex:a,overIndex:l}=e;return Cg(r,a,l).indexOf(o)},w4=e=>{let{containerId:o,isSorting:r,wasDragging:a,index:l,items:c,newIndex:u,previousItems:f,previousContainerId:h,transition:p}=e;return!p||!a||f!==c&&l===u?!1:r?!0:u!==l&&o===h},C4={duration:200,easing:"ease"},hC="transform",E4=ys.Transition.toString({property:hC,duration:0,easing:"linear"}),R4={roleDescription:"sortable"};function T4(e){let{disabled:o,index:r,node:a,rect:l}=e;const[c,u]=b.useState(null),f=b.useRef(r);return Ao(()=>{if(!o&&r!==f.current&&a.current){const h=l.current;if(h){const p=il(a.current,{ignoreTransform:!0}),g={x:h.left-p.left,y:h.top-p.top,scaleX:h.width/p.width,scaleY:h.height/p.height};(g.x||g.y)&&u(g)}}r!==f.current&&(f.current=r)},[o,r,a,l]),b.useEffect(()=>{c&&u(null)},[c]),c}function _4(e){let{animateLayoutChanges:o=w4,attributes:r,disabled:a,data:l,getNewIndex:c=S4,id:u,strategy:f,resizeObserverConfig:h,transition:p=C4}=e;const{items:g,containerId:v,activeIndex:x,disabled:S,disableTransforms:E,sortedRects:C,overIndex:R,useDragOverlay:T,strategy:z}=b.useContext(dC),A=D4(a,S),N=g.indexOf(u),B=b.useMemo(()=>({sortable:{containerId:v,index:N,items:g},...l}),[v,l,N,g]),M=b.useMemo(()=>g.slice(g.indexOf(u)),[g,u]),{rect:$,node:L,isOver:H,setNodeRef:I}=p4({id:u,data:B,disabled:A.droppable,resizeObserverConfig:{updateMeasurementsFor:M,...h}}),{active:Y,activatorEvent:X,activeNodeRect:ee,attributes:ne,setNodeRef:re,listeners:j,isDragging:k,over:V,setActivatorNodeRef:P,transform:Z}=u4({id:u,data:B,attributes:{...R4,...r},disabled:A.draggable}),D=V5(I,re),O=!!Y,q=O&&!E&&Kc(x)&&Kc(R),W=!T&&k,ie=W&&q?Z:null,ve=q?ie??(f??z)({rects:C,activeNodeRect:ee,activeIndex:x,overIndex:R,index:N}):null,fe=Kc(x)&&Kc(R)?c({id:u,items:g,activeIndex:x,overIndex:R}):N,be=Y?.id,ye=b.useRef({activeId:be,items:g,newIndex:fe,containerId:v}),Xe=g!==ye.current.items,Ne=o({active:Y,containerId:v,isDragging:k,isSorting:O,id:u,index:N,items:g,newIndex:ye.current.newIndex,previousItems:ye.current.items,previousContainerId:ye.current.containerId,transition:p,wasDragging:ye.current.activeId!=null}),We=T4({disabled:!Ne,index:N,node:L,rect:$});return b.useEffect(()=>{O&&ye.current.newIndex!==fe&&(ye.current.newIndex=fe),v!==ye.current.containerId&&(ye.current.containerId=v),g!==ye.current.items&&(ye.current.items=g)},[O,fe,v,g]),b.useEffect(()=>{if(be===ye.current.activeId)return;if(be!=null&&ye.current.activeId==null){ye.current.activeId=be;return}const nt=setTimeout(()=>{ye.current.activeId=be},50);return()=>clearTimeout(nt)},[be]),{active:Y,activeIndex:x,attributes:ne,data:B,rect:$,index:N,newIndex:fe,items:g,isOver:H,isSorting:O,isDragging:k,listeners:j,node:L,overIndex:R,over:V,setNodeRef:D,setActivatorNodeRef:P,setDroppableNodeRef:I,setDraggableNodeRef:re,transform:We??ve,transition:Be()};function Be(){if(We||Xe&&ye.current.newIndex===N)return E4;if(!(W&&!yg(X)||!p)&&(O||Ne))return ys.Transition.toString({...p,property:hC})}}function D4(e,o){var r,a;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e?.draggable)!=null?r:o.draggable,droppable:(a=e?.droppable)!=null?a:o.droppable}}Ke.Down,Ke.Right,Ke.Up,Ke.Left;const pC=""+new URL("../logo.png",import.meta.url).href;let mC=()=>{};function V1(e){mC=e}const zs=H5({tokenKey:"mv_token",onUnauthorized:e=>mC(e)}),N4=zs.login,A4=zs.logout,z4=zs.isAuthenticated,M4=zs.getUsername,{request:Oo}=zs,O4=()=>Oo("/fields"),Y1=()=>Oo("/config"),j4=()=>Oo("/channels"),B4=(e,o)=>Oo(`/styles/preview?layout=${encodeURIComponent(e)}&channel_count=${o}`),Ur=e=>Oo("/config",{method:"PATCH",body:JSON.stringify(e)}),$4=()=>Oo("/refresh",{method:"POST"}),gC=()=>Oo("/streams"),Hp=e=>Oo("/streams/restart",{method:"POST",body:JSON.stringify(e!=null?{n:e}:{})}),L4=(e,o)=>Oo("/streams/restart",{method:"POST",body:JSON.stringify({n:e,channel_idx:o})}),vC=(e,o,r)=>Oo("/styles/background",{method:"POST",body:JSON.stringify({style_id:e,filename:o,data_base64:r})});async function yC(e){const o=localStorage.getItem("mv_token"),r=await fetch(`/api/styles/background?style_id=${encodeURIComponent(e)}`,{headers:o?{Authorization:`Bearer ${o}`}:{}});return r.ok?r.blob():null}const k4=/^(video_encoder|multiview_[0-9a-f]{8}_(selector_type|channel_count|epg_source_mode))$/,bC=e=>k4.test(e),H4=/^Layout\s+\d+[:\s]*/i,U4=e=>({...e,label:e.label.replace(H4,"")});function P4(e,o){const r=[],a=[],l=[];let c=null,u=null;for(const f of e){const h=f.id.replace(`multiview_${o}_`,"");if(["name","layout","selector_type"].includes(h))r.push(f);else if(h==="channel_count")u=f;else if(h==="audio_source")c=f;else if(h.startsWith("epg_"))l.push(f);else{if(f.type==="info")continue;a.push(f)}}return{base:r,channels:a,epg:l,audioSource:c,channelCountField:u}}function Na(e=4){const o=new Uint8Array(e);return crypto.getRandomValues(o),Array.from(o,r=>r.toString(16).padStart(2,"0")).join("")}function xC(e,o){const r=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),a=URL.createObjectURL(r),l=document.createElement("a");l.href=a,l.download=o,document.body.appendChild(l),l.click(),l.remove(),URL.revokeObjectURL(a)}const Up=["center","top","bottom","left","right"];function Ta(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function V4(e,o){if(!Ta(e))throw new Error(`${o}: not an object`);if(!["static","row","grid"].includes(e.type))throw new Error(`${o}.type: invalid "${e.type}"`);for(const r of["x","y","w","h"])if(typeof e[r]!="number"||!Number.isFinite(e[r]))throw new Error(`${o}.${r}: must be a finite number`);if(e.name!=null&&typeof e.name!="string")throw new Error(`${o}.name: must be a string`);if(e.valign!=null&&!Up.includes(e.valign))throw new Error(`${o}.valign: invalid "${e.valign}"`);if(e.halign!=null&&!Up.includes(e.halign))throw new Error(`${o}.halign: invalid "${e.halign}"`);if(e.type==="row"&&e.direction!=null&&!["horizontal","vertical"].includes(e.direction))throw new Error(`${o}.direction: invalid "${e.direction}"`);if(e.max!=null&&(typeof e.max!="number"||!Number.isFinite(e.max)))throw new Error(`${o}.max: must be a number`);if(e.lockAspect!=null&&typeof e.lockAspect!="boolean")throw new Error(`${o}.lockAspect: must be a boolean`)}function Pp(e,o="style"){if(!Ta(e))throw new Error(`${o}: not an object`);if(e.name!=null&&typeof e.name!="string")throw new Error(`${o}.name: must be a string`);if(!Array.isArray(e.elements))throw new Error(`${o}.elements: must be an array`);if(e.elements.forEach((r,a)=>V4(r,`${o}.elements[${a}]`)),e.background_image_data!=null&&typeof e.background_image_data!="string")throw new Error(`${o}.background_image_data: must be a string`);if(e.background_image_filename!=null&&typeof e.background_image_filename!="string")throw new Error(`${o}.background_image_filename: must be a string`)}const Y4={name:"string",layout:"string",channel_count:"number",selector_type:"string",epg_source_mode:"string"};function G4(e,o){if(!Ta(e))throw new Error(`${o}: not an object`);for(const[r,a]of Object.entries(Y4))if(e[r]!=null&&typeof e[r]!==a)throw new Error(`${o}.${r}: must be a ${a}`);if(e.channels!=null){if(!Array.isArray(e.channels))throw new Error(`${o}.channels: must be an array`);e.channels.forEach((r,a)=>{if(r!=null&&typeof r!="string")throw new Error(`${o}.channels[${a}]: must be a string`)})}}function X4(e){if(!Ta(e))throw new Error("backup: not an object");if(!Array.isArray(e.layouts))throw new Error("backup.layouts: must be an array");if(e.layouts.forEach((o,r)=>G4(o,`backup.layouts[${r}]`)),e.global!=null&&!Ta(e.global))throw new Error("backup.global: must be an object");if(e.custom_styles!=null){if(!Ta(e.custom_styles))throw new Error("backup.custom_styles: must be an object");for(const[o,r]of Object.entries(e.custom_styles))Pp(r,`backup.custom_styles["${o}"]`)}}function q4(e){if(!Ta(e))throw new Error("backup: not an object");const o=e.multiview_order;if(!Array.isArray(o)||o.some(l=>typeof l!="string"))throw new Error("backup.multiview_order: must be an array of strings");const r=new Set(o),a=/^multiview_([0-9a-f]{8})_(.+)$/;for(const l of Object.keys(e)){const c=l.match(a);if(c&&!r.has(c[1]))throw new Error(`backup["${l}"]: id "${c[1]}" not present in multiview_order`)}}function I4({label:e,description:o,data:r,value:a,onChange:l}){const c=Ym({onDropdownClose:()=>c.resetSelectedOption()}),[u,f]=b.useState(""),h=r.find(g=>g.value===a),p=r.filter(g=>g.label.toLowerCase().includes(u.trim().toLowerCase()));return y.jsxs(Pe,{store:c,onOptionSubmit:g=>{l(g),f(""),c.closeDropdown()},children:[y.jsx(Pe.Target,{children:y.jsx(Mo,{label:e,description:o,component:"button",type:"button",pointer:!0,rightSection:y.jsx(Pe.Chevron,{}),onClick:()=>c.toggleDropdown(),children:h?.label??y.jsx(Ye,{component:"span",c:"dimmed",children:"Select channel"})})}),y.jsxs(Pe.Dropdown,{children:[y.jsx(Pe.Search,{value:u,onChange:g=>f(g.currentTarget.value),placeholder:"Search channels..."}),y.jsx(Pe.Options,{mah:260,style:{overflowY:"auto"},children:p.length===0?y.jsx(Pe.Empty,{children:"No channels found"}):p.map(g=>y.jsx(Pe.Option,{value:g.value,active:g.value===a,children:g.label},g.value))})]})]})}function F4({id:e,position:o,fields:r,settings:a,canRemove:l,hasActiveStream:c,dragHandleProps:u,onSettingsChange:f,onFieldsReload:h,onRemove:p,onChannelCountChange:g}){const[v,x]=b.useState(!1),S=qw(Ur,{onOptimisticChange:f,shouldReload:bC,onReload:h,onSaved:()=>Qe.show({message:"Saved",color:"green",autoClose:1500}),onError:I=>Qe.show({title:"Save failed",message:I.message,color:"red",autoClose:4e3})}),{base:E,channels:C,epg:R,audioSource:T,channelCountField:z}=P4(r.map(U4),e),A=a[`multiview_${e}_name`]||`Multiview ${o}`,N=a[`multiview_${e}_channel_count`]??z?.default??4,B=z?.min??2,M=z?.max??9;function $(I){return I.length?y.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:"var(--mantine-spacing-sm)"},children:I.map(Y=>y.jsx(Op,{field:Y,value:a[Y.id],onChange:X=>S(Y.id,X,Y.type!=="string")},Y.id))}):null}function L(I){return I.length?y.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:"var(--mantine-spacing-sm)"},children:I.map(Y=>{const X=new Set,ee=(Y.options??[]).reduce((ne,re)=>{const j=String(re.value);return X.has(j)||(X.add(j),ne.push({value:j,label:re.label})),ne},[]);return y.jsx(I4,{label:Y.label,description:Y.description,data:ee,value:String(a[Y.id]??Y.default??""),onChange:ne=>S(Y.id,ne,!0)},Y.id)})}):null}const H=y.jsxs(mt,{gap:4,wrap:"nowrap",children:[y.jsx(Yt,{size:"sm",variant:"subtle",color:"gray",style:{cursor:"grab",touchAction:"none"},onClick:I=>I.stopPropagation(),...u,children:y.jsx(v5,{size:16})}),y.jsx(Dt,{size:"xs",color:"red",variant:"subtle",leftSection:y.jsx(pg,{size:14}),style:{visibility:l?"visible":"hidden"},onClick:I=>{I.stopPropagation(),x(!0)},children:"Remove"})]});return y.jsxs(y.Fragment,{children:[y.jsx(Iw,{as:"Card",title:`Layout ${o}: ${A}`,trailingAction:H,children:y.jsxs(Qt,{gap:"md",p:"md",pt:0,children:[$(E),(C.length>0||z)&&y.jsxs(y.Fragment,{children:[y.jsx(Su,{label:y.jsxs(mt,{gap:4,align:"center",children:[y.jsx(Ye,{size:"xs",c:"dimmed",children:"Channels"}),y.jsx(Yt,{size:"xs",variant:"subtle",disabled:N<=B,onClick:()=>g(-1),children:y.jsx(S5,{size:10})}),y.jsx(Ye,{size:"xs",fw:600,w:14,ta:"center",children:N}),y.jsx(Yt,{size:"xs",variant:"subtle",disabled:N>=M,onClick:()=>g(1),children:y.jsx(is,{size:10})})]}),labelPosition:"left"}),L(C)]}),T&&y.jsx(Op,{field:T,value:a[T.id],onChange:I=>S(T.id,I,!0)}),R.length>0&&y.jsxs(y.Fragment,{children:[y.jsx(Su,{label:"EPG",labelPosition:"left"}),$(R)]})]})}),y.jsxs(Tn,{opened:v,onClose:()=>x(!1),title:`Remove Layout ${o}`,size:"xs",centered:!0,children:[y.jsxs(Ye,{size:"sm",children:["Remove Layout ",o,": ",A,"? This cannot be undone."]}),c&&y.jsx(Ye,{size:"sm",c:"orange",mt:"xs",children:"This layout has an active stream — removing it will disconnect that viewer."}),y.jsxs(mt,{mt:"md",justify:"flex-end",children:[y.jsx(Dt,{variant:"default",onClick:()=>x(!1),children:"Cancel"}),y.jsx(Dt,{color:"red",onClick:()=>{x(!1),p()},children:"Remove"})]})]})]})}function Z4({opened:e,onClose:o,settings:r}){const[a,l]=b.useState([]),[c,u]=b.useState({}),[f,h]=b.useState(null),p=b.useCallback(async()=>{try{const x=await gC();l(x.active??[])}catch{}},[]);b.useEffect(()=>{if(!e)return;p();const x=setInterval(p,4e3);return()=>clearInterval(x)},[e,p]);const g=async(x,S,E)=>{u(C=>({...C,[x]:!0}));try{await S(),Qe.show({message:E,color:"blue",autoClose:2e3}),await p()}catch(C){Qe.show({title:"Failed",message:C.message,color:"red",autoClose:4e3})}finally{u(C=>({...C,[x]:!1}))}},v=(x,S,E,C,R)=>h({title:x,message:S,confirmLabel:E,color:C,onConfirm:R});return y.jsxs(Tn,{opened:e,onClose:o,title:"Active Multiviews",size:"sm",centered:!0,children:[y.jsx(Xw,{action:f,onClose:()=>h(null)}),a.length===0?y.jsx(Ye,{size:"sm",c:"dimmed",children:"No multiviews currently active."}):y.jsx(Qt,{gap:"md",children:a.map(({n:x,channels:S})=>{const E=r[`multiview_${x}_name`]||`Multiview ${x}`;return y.jsxs("div",{children:[y.jsxs(mt,{justify:"space-between",mb:6,children:[y.jsx(Ye,{size:"sm",fw:600,children:E}),y.jsx(Dt,{size:"xs",color:"orange",variant:"subtle",leftSection:y.jsx(D1,{size:12}),loading:c[`${x}`],onClick:()=>v("Reload",`Reload ${E}? The compositor will restart and active players will reconnect. Some players may buffer, stutter, or require a manual refresh depending on how they handle stream interruptions.`,"Reload","orange",()=>g(`${x}`,()=>Hp(x),`${E} reloaded`)),children:"Reload"})]}),y.jsx(Qt,{gap:4,pl:"sm",children:(S??[]).map(({idx:C,name:R})=>y.jsxs(mt,{justify:"space-between",children:[y.jsx(Ye,{size:"xs",c:"dimmed",children:R}),y.jsx(Dt,{size:"xs",variant:"subtle",leftSection:y.jsx(Yw,{size:11}),loading:c[`${x}-${C}`],onClick:()=>v("Reconnect",`Reconnect ${R}?`,"Reconnect","blue",()=>g(`${x}-${C}`,()=>L4(x,C),`${R} reconnecting`)),children:"Reconnect"})]},C))})]},x)})}),a.length>1&&y.jsx(Dt,{fullWidth:!0,mt:"md",color:"orange",variant:"light",leftSection:y.jsx(D1,{size:14}),loading:c.all,onClick:()=>v("Reload All",`Reload all ${a.length} multiviews? All compositors will restart and active players will reconnect. Some players may buffer, stutter, or require a manual refresh depending on how they handle stream interruptions.`,"Reload All","orange",()=>g("all",()=>Hp(null),`${a.length} multiviews reloaded`)),children:"Reload All"})]})}var Q4={};function Vp(e,o){for(let r=0,a=e.length;r"u")return"";const a=(r=(o=window.document)==null?void 0:o.documentElement)==null?void 0:r.style;if(!a||e in a)return"";for(let l=0;lo===r.identifier)||e.changedTouches&&Vp(e.changedTouches,r=>o===r.identifier)}function cO(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function uO(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0}function fO(e,o){if(!e)return;let r=e.getElementById("react-draggable-style-el");if(!r){r=e.createElement("style"),r.type="text/css",r.id="react-draggable-style-el";const a=o??uO();a&&r.setAttribute("nonce",a),r.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} `,r.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} -`,e.getElementsByTagName("head")[0].appendChild(r)}e.body&&fO(e.body,"react-draggable-transparent-selection")}function X1(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{q1(e)}):q1(e)}function q1(e){if(e)try{e.body&&dO(e.body,"react-draggable-transparent-selection");const o=e.selection;if(o)o.empty();else{const r=(e.defaultView||window).getSelection();r&&r.type!=="Caret"&&r.removeAllRanges()}}catch{}}function fO(e,o){e.classList?e.classList.add(o):e.className.match(new RegExp(`(?:^|\\s)${o}(?!\\S)`))||(e.className+=` ${o}`)}function dO(e,o){e.classList?e.classList.remove(o):e.className=e.className.replace(new RegExp(`(?:^|\\s)${o}(?!\\S)`,"g"),"")}function hO(e,o,r){if(!e.props.bounds)return[o,r];let{bounds:a}=e.props;a=typeof a=="string"?a:gO(a);const l=Cg(e);if(typeof a=="string"){const{ownerDocument:c}=l,u=c.defaultView;if(!u)throw new Error("Cannot resolve the owner window of the draggable node.");let f;if(a==="parent"?f=l.parentNode:f=l.getRootNode().querySelector(a),!(f instanceof u.HTMLElement))throw new Error('Bounds selector "'+a+'" could not find an element.');const h=f,p=u.getComputedStyle(l),g=u.getComputedStyle(h);a={left:-l.offsetLeft+ln(g.paddingLeft)+ln(p.marginLeft),top:-l.offsetTop+ln(g.paddingTop)+ln(p.marginTop),right:oO(h)-tO(l)-l.offsetLeft+ln(g.paddingRight)-ln(p.marginRight),bottom:nO(h)-eO(l)-l.offsetTop+ln(g.paddingBottom)-ln(p.marginBottom)}}return as(a.right)&&(o=Math.min(o,a.right)),as(a.bottom)&&(r=Math.min(r,a.bottom)),as(a.left)&&(o=Math.max(o,a.left)),as(a.top)&&(r=Math.max(r,a.top)),[o,r]}function I1(e,o,r){const a=Math.round(o/e[0])*e[0],l=Math.round(r/e[1])*e[1];return[a,l]}function pO(e){return e.props.axis==="both"||e.props.axis==="x"}function mO(e){return e.props.axis==="both"||e.props.axis==="y"}function sp(e,o,r){const a=typeof o=="number"?lO(e,o):null;if(typeof o=="number"&&!a)return null;const l=Cg(r),c=r.props.offsetParent||l.offsetParent||l.ownerDocument.body;return rO(a||e,c,r.props.scale)}function cp(e,o,r){const a=!as(e.lastX),l=Cg(e);return a?{node:l,deltaX:0,deltaY:0,lastX:o,lastY:r,x:o,y:r}:{node:l,deltaX:o-e.lastX,deltaY:r-e.lastY,lastX:e.lastX,lastY:e.lastY,x:o,y:r}}function up(e,o){const r=e.props.scale;return{node:o.node,x:e.state.x+o.deltaX/r,y:e.state.y+o.deltaY/r,deltaX:o.deltaX/r,deltaY:o.deltaY/r,lastX:e.state.x,lastY:e.state.y}}function gO(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Cg(e){const o=e.findDOMNode();if(!o)throw new Error(": Unmounted during event!");return o}function Ro(...e){Z4.DRAGGABLE_DEBUG&&console.log(...e)}var so={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},Lr=so.mouse,sl=class extends b.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&(typeof e.button=="number"&&e.button!==0||e.ctrlKey))return!1;const o=this.findDOMNode();if(!o||!o.ownerDocument||!o.ownerDocument.body)throw new Error(" not mounted on DragStart!");const{ownerDocument:r}=o;if(this.props.disabled||!(e.target instanceof r.defaultView.Node)||this.props.handle&&!G1(e.target,this.props.handle,o)||this.props.cancel&&G1(e.target,this.props.cancel,o))return;e.type==="touchstart"&&!this.props.allowMobileScroll&&e.preventDefault();const a=sO(e);this.touchIdentifier=a;const l=sp(e,a,this);if(l==null)return;const{x:c,y:u}=l,f=cp(this,c,u);Ro("DraggableCore: handleDragStart: %j",f),Ro("calling",this.props.onStart),!(this.props.onStart(e,f)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&uO(r,this.props.nonce),this.dragging=!0,this.lastX=c,this.lastY=u,lp(r,Lr.move,this.handleDrag),lp(r,Lr.stop,this.handleDragStop))},this.handleDrag=e=>{const o=sp(e,this.touchIdentifier,this);if(o==null)return;let{x:r,y:a}=o;if(Array.isArray(this.props.grid)){let u=r-this.lastX,f=a-this.lastY;if([u,f]=I1(this.props.grid,u,f),!u&&!f)return;r=this.lastX+u,a=this.lastY+f}const l=cp(this,r,a);if(Ro("DraggableCore: handleDrag: %j",l),this.props.onDrag(e,l)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const u=document.createEvent("MouseEvents");u.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(u)}return}this.lastX=r,this.lastY=a},this.handleDragStop=e=>{if(!this.dragging)return;const o=sp(e,this.touchIdentifier,this);if(o==null)return;let{x:r,y:a}=o;if(Array.isArray(this.props.grid)){let f=r-this.lastX||0,h=a-this.lastY||0;[f,h]=I1(this.props.grid,f,h),r=this.lastX+f,a=this.lastY+h}const l=cp(this,r,a);if(this.props.onStop(e,l)===!1||this.mounted===!1)return!1;const u=this.findDOMNode();u&&this.props.enableUserSelectHack&&X1(u.ownerDocument),Ro("DraggableCore: handleDragStop: %j",l),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,u&&(Ro("DraggableCore: Removing handlers"),ga(u.ownerDocument,Lr.move,this.handleDrag),ga(u.ownerDocument,Lr.stop,this.handleDragStop))},this.onMouseDown=e=>(Lr=so.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(Lr=so.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(Lr=so.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(Lr=so.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&lp(e,so.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:o}=e;ga(o,so.mouse.move,this.handleDrag),ga(o,so.touch.move,this.handleDrag),ga(o,so.mouse.stop,this.handleDragStop),ga(o,so.touch.stop,this.handleDragStop),ga(e,so.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&X1(o)}}findDOMNode(){var e;if((e=this.props)!=null&&e.nodeRef)return this.props.nodeRef.current;const o=Sa;return typeof o.findDOMNode=="function"?o.findDOMNode(this):(Ro("react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef"),null)}render(){return b.cloneElement(b.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};sl.displayName="DraggableCore";sl.propTypes={allowAnyClick:je.bool,allowMobileScroll:je.bool,children:je.node.isRequired,disabled:je.bool,enableUserSelectHack:je.bool,offsetParent:function(e,o){if(e[o]&&e[o].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:je.arrayOf(je.number),handle:je.string,cancel:je.string,nodeRef:je.object,nonce:je.string,onStart:je.func,onDrag:je.func,onStop:je.func,onMouseDown:je.func,scale:je.number,className:Li,style:Li,transform:Li};sl.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var ff=class extends b.Component{constructor(e){super(e),this.onDragStart=(o,r)=>{if(Ro("Draggable: onDragStart: %j",r),this.props.onStart(o,up(this,r))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(o,r)=>{if(!this.state.dragging)return!1;Ro("Draggable: onDrag: %j",r);const a=up(this,r),l={x:a.x,y:a.y,slackX:0,slackY:0};if(this.props.bounds){const{x:u,y:f}=l;l.x+=this.state.slackX,l.y+=this.state.slackY;const[h,p]=hO(this,l.x,l.y);l.x=h,l.y=p,l.slackX=this.state.slackX+(u-l.x),l.slackY=this.state.slackY+(f-l.y),a.x=l.x,a.y=l.y,a.deltaX=l.x-this.state.x,a.deltaY=l.y-this.state.y}if(this.props.onDrag(o,a)===!1)return!1;this.setState(l)},this.onDragStop=(o,r)=>{if(!this.state.dragging||this.props.onStop(o,up(this,r))===!1)return!1;Ro("Draggable: onDragStop: %j",r);const l={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:u,y:f}=this.props.position;l.x=u,l.y=f}this.setState(l)},this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:e},{prevPropsPosition:o}){return e&&(!o||e.x!==o.x||e.y!==o.y)?(Ro("Draggable: getDerivedStateFromProps %j",{position:e,prevPropsPosition:o}),{x:e.x,y:e.y,prevPropsPosition:{...e}}):null}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){var e;if((e=this.props)!=null&&e.nodeRef)return this.props.nodeRef.current;const o=Sa;return typeof o.findDOMNode=="function"?o.findDOMNode(this):null}render(){const{axis:e,bounds:o,children:r,defaultPosition:a,defaultClassName:l,defaultClassNameDragging:c,defaultClassNameDragged:u,position:f,positionOffset:h,scale:p,...g}=this.props;let v={},x=null;const E=!!!f||this.state.dragging,C=f||a,R={x:pO(this)&&E?this.state.x:C.x,y:mO(this)&&E?this.state.y:C.y};this.state.isElementSVG?x=iO(R,h):v=aO(R,h);const T=b.Children.only(r),z=zt(T.props.className||"",l,{[c]:this.state.dragging,[u]:this.state.dragged});return b.createElement(sl,{...g,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},b.cloneElement(T,{className:z,style:{...T.props.style,...v},transform:x}))}};ff.displayName="Draggable";ff.propTypes={...sl.propTypes,axis:je.oneOf(["both","x","y","none"]),bounds:je.oneOfType([je.shape({left:je.number,right:je.number,top:je.number,bottom:je.number}),je.string,je.oneOf([!1])]),defaultClassName:je.string,defaultClassNameDragging:je.string,defaultClassNameDragged:je.string,defaultPosition:je.shape({x:je.number,y:je.number}),positionOffset:je.shape({x:je.oneOfType([je.number,je.string]),y:je.oneOfType([je.number,je.string])}),position:je.shape({x:je.number,y:je.number}),className:Li,style:Li,transform:Li};ff.defaultProps={...sl.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1};var vO=ff,Lt=function(){return Lt=Object.assign||function(e){for(var o,r=1,a=arguments.length;r"u"?void 0:Number(a),maxHeight:typeof l>"u"?void 0:Number(l),minWidth:typeof c>"u"?void 0:Number(c),minHeight:typeof u>"u"?void 0:Number(u)}},EO=function(e){return Array.isArray(e)?e:[e,e]},RO=["as","ref","style","className","grid","gridGap","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],W1="__resizable_base__",TO=(function(e){xO(o,e);function o(r){var a,l,c,u,f=e.call(this,r)||this;return f.ratio=1,f.resizable=null,f.parentLeft=0,f.parentTop=0,f.resizableLeft=0,f.resizableRight=0,f.resizableTop=0,f.resizableBottom=0,f.targetLeft=0,f.targetTop=0,f.delta={width:0,height:0},f.appendBase=function(){if(!f.resizable||!f.window)return null;var h=f.parentNode;if(!h)return null;var p=f.window.document.createElement("div");return p.style.width="100%",p.style.height="100%",p.style.position="absolute",p.style.transform="scale(0, 0)",p.style.left="0",p.style.flex="0 0 100%",p.classList?p.classList.add(W1):p.className+=W1,h.appendChild(p),p},f.removeBase=function(h){var p=f.parentNode;p&&p.removeChild(h)},f.state={isResizing:!1,width:(l=(a=f.propsSize)===null||a===void 0?void 0:a.width)!==null&&l!==void 0?l:"auto",height:(u=(c=f.propsSize)===null||c===void 0?void 0:c.height)!==null&&u!==void 0?u:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},f.onResizeStart=f.onResizeStart.bind(f),f.onMouseMove=f.onMouseMove.bind(f),f.onMouseUp=f.onMouseUp.bind(f),f}return Object.defineProperty(o.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||SO},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"size",{get:function(){var r=0,a=0;if(this.resizable&&this.window){var l=this.resizable.offsetWidth,c=this.resizable.offsetHeight,u=this.resizable.style.position;u!=="relative"&&(this.resizable.style.position="relative"),r=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:l,a=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:c,this.resizable.style.position=u}return{width:r,height:a}},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"sizeStyle",{get:function(){var r=this,a=this.props.size,l=function(f){var h;if(typeof r.state[f]>"u"||r.state[f]==="auto")return"auto";if(r.propsSize&&r.propsSize[f]&&(!((h=r.propsSize[f])===null||h===void 0)&&h.toString().endsWith("%"))){if(r.state[f].toString().endsWith("%"))return r.state[f].toString();var p=r.getParentSize(),g=Number(r.state[f].toString().replace("px","")),v=g/p[f]*100;return"".concat(v,"%")}return fp(r.state[f])},c=a&&typeof a.width<"u"&&!this.state.isResizing?fp(a.width):l("width"),u=a&&typeof a.height<"u"&&!this.state.isResizing?fp(a.height):l("height");return{width:c,height:u}},enumerable:!1,configurable:!0}),o.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var r=this.appendBase();if(!r)return{width:0,height:0};var a=!1,l=this.parentNode.style.flexWrap;l!=="wrap"&&(a=!0,this.parentNode.style.flexWrap="wrap"),r.style.position="relative",r.style.minWidth="100%",r.style.minHeight="100%";var c={width:r.offsetWidth,height:r.offsetHeight};return a&&(this.parentNode.style.flexWrap=l),this.removeBase(r),c},o.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},o.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},o.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var r=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:r.flexBasis!=="auto"?r.flexBasis:void 0})}},o.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},o.prototype.createSizeForCssProperty=function(r,a){var l=this.propsSize&&this.propsSize[a];return this.state[a]==="auto"&&this.state.original[a]===r&&(typeof l>"u"||l==="auto")?"auto":r},o.prototype.calculateNewMaxFromBoundary=function(r,a){var l=this.props.boundsByDirection,c=this.state.direction,u=l&&_i("left",c),f=l&&_i("top",c),h,p;if(this.props.bounds==="parent"){var g=this.parentNode;g&&(h=u?this.resizableRight-this.parentLeft:g.offsetWidth+(this.parentLeft-this.resizableLeft),p=f?this.resizableBottom-this.parentTop:g.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(h=u?this.resizableRight:this.window.innerWidth-this.resizableLeft,p=f?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(h=u?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),p=f?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return h&&Number.isFinite(h)&&(r=r&&r"u"?10:c.width,v=typeof l.width>"u"||l.width<0?r:l.width,x=typeof c.height>"u"?10:c.height,S=typeof l.height>"u"||l.height<0?a:l.height,E=h||0,C=p||0;if(f){var R=(x-E)*this.ratio+C,T=(S-E)*this.ratio+C,z=(g-C)/this.ratio+E,A=(v-C)/this.ratio+E,N=Math.max(g,R),B=Math.min(v,T),M=Math.max(x,z),$=Math.min(S,A);r=eu(r,N,B),a=eu(a,M,$)}else r=eu(r,g,v),a=eu(a,x,S);return{newWidth:r,newHeight:a}},o.prototype.setBoundingClientRect=function(){var r=1/(this.props.scale||1);if(this.props.bounds==="parent"){var a=this.parentNode;if(a){var l=a.getBoundingClientRect();this.parentLeft=l.left*r,this.parentTop=l.top*r}}if(this.props.bounds&&typeof this.props.bounds!="string"){var c=this.props.bounds.getBoundingClientRect();this.targetLeft=c.left*r,this.targetTop=c.top*r}if(this.resizable){var u=this.resizable.getBoundingClientRect(),f=u.left,h=u.top,p=u.right,g=u.bottom;this.resizableLeft=f*r,this.resizableRight=p*r,this.resizableTop=h*r,this.resizableBottom=g*r}},o.prototype.onResizeStart=function(r,a){if(!(!this.resizable||!this.window)){var l=0,c=0;if(r.nativeEvent&&wO(r.nativeEvent)?(l=r.nativeEvent.clientX,c=r.nativeEvent.clientY):r.nativeEvent&&tu(r.nativeEvent)&&(l=r.nativeEvent.touches[0].clientX,c=r.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var u=this.props.onResizeStart(r,a,this.resizable);if(u===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var f,h=this.window.getComputedStyle(this.resizable);if(h.flexBasis!=="auto"){var p=this.parentNode;if(p){var g=this.window.getComputedStyle(p).flexDirection;this.flexDir=g.startsWith("row")?"row":"column",f=h.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var v={original:{x:l,y:c,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Eo(Eo({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(r.target).cursor||"auto"}),direction:a,flexBasis:f};this.setState(v)}},o.prototype.onMouseMove=function(r){var a=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&tu(r))try{r.preventDefault(),r.stopPropagation()}catch{}var l=this.props,c=l.maxWidth,u=l.maxHeight,f=l.minWidth,h=l.minHeight,p=tu(r)?r.touches[0].clientX:r.clientX,g=tu(r)?r.touches[0].clientY:r.clientY,v=this.state,x=v.direction,S=v.original,E=v.width,C=v.height,R=this.getParentSize(),T=CO(R,this.window.innerWidth,this.window.innerHeight,c,u,f,h);c=T.maxWidth,u=T.maxHeight,f=T.minWidth,h=T.minHeight;var z=this.calculateNewSizeFromDirection(p,g),A=z.newHeight,N=z.newWidth,B=this.calculateNewMaxFromBoundary(c,u);this.props.snap&&this.props.snap.x&&(N=K1(N,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(A=K1(A,this.props.snap.y,this.props.snapGap));var M=this.calculateNewSizeFromAspectRatio(N,A,{width:B.maxWidth,height:B.maxHeight},{width:f,height:h});if(N=M.newWidth,A=M.newHeight,this.props.grid){var $=Q1(N,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),L=Q1(A,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),H=this.props.snapGap||0,I=H===0||Math.abs($-N)<=H?$:N,Y=H===0||Math.abs(L-A)<=H?L:A;N=I,A=Y}var X={width:N-S.width,height:A-S.height};if(this.delta=X,E&&typeof E=="string"){if(E.endsWith("%")){var ee=N/R.width*100;N="".concat(ee,"%")}else if(E.endsWith("vw")){var ne=N/this.window.innerWidth*100;N="".concat(ne,"vw")}else if(E.endsWith("vh")){var re=N/this.window.innerHeight*100;N="".concat(re,"vh")}}if(C&&typeof C=="string"){if(C.endsWith("%")){var ee=A/R.height*100;A="".concat(ee,"%")}else if(C.endsWith("vw")){var ne=A/this.window.innerWidth*100;A="".concat(ne,"vw")}else if(C.endsWith("vh")){var re=A/this.window.innerHeight*100;A="".concat(re,"vh")}}var j={width:this.createSizeForCssProperty(N,"width"),height:this.createSizeForCssProperty(A,"height")};this.flexDir==="row"?j.flexBasis=j.width:this.flexDir==="column"&&(j.flexBasis=j.height);var k=this.state.width!==j.width,V=this.state.height!==j.height,P=this.state.flexBasis!==j.flexBasis,Z=k||V||P;Z&&co.flushSync(function(){a.setState(j)}),this.props.onResize&&Z&&this.props.onResize(r,x,this.resizable,X)}},o.prototype.onMouseUp=function(r){var a,l,c=this.state,u=c.isResizing,f=c.direction;c.original,!(!u||!this.resizable)&&(this.props.onResizeStop&&this.props.onResizeStop(r,f,this.resizable,this.delta),this.props.size&&this.setState({width:(a=this.props.size.width)!==null&&a!==void 0?a:"auto",height:(l=this.props.size.height)!==null&&l!==void 0?l:"auto"}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Eo(Eo({},this.state.backgroundStyle),{cursor:"auto"})}))},o.prototype.updateSize=function(r){var a,l;this.setState({width:(a=r.width)!==null&&a!==void 0?a:"auto",height:(l=r.height)!==null&&l!==void 0?l:"auto"})},o.prototype.renderResizer=function(){var r=this,a=this.props,l=a.enable,c=a.handleStyles,u=a.handleClasses,f=a.handleWrapperStyle,h=a.handleWrapperClass,p=a.handleComponent;if(!l)return null;var g=Object.keys(l).map(function(v){return l[v]!==!1?y.jsx(bO,{direction:v,onResizeStart:r.onResizeStart,replaceStyles:c&&c[v],className:u&&u[v],children:p&&p[v]?p[v]:null},v):null});return y.jsx("div",{className:h,style:f,children:g})},o.prototype.render=function(){var r=this,a=Object.keys(this.props).reduce(function(u,f){return RO.indexOf(f)!==-1||(u[f]=r.props[f]),u},{}),l=Eo(Eo(Eo({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(l.flexBasis=this.state.flexBasis);var c=this.props.as||"div";return y.jsxs(c,Eo({style:l,className:this.props.className},a,{ref:function(u){u&&(r.resizable=u)},children:[this.state.isResizing&&y.jsx("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]}))},o.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},o})(b.PureComponent);var Yp=function(e,o){return Yp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var l in a)a.hasOwnProperty(l)&&(r[l]=a[l])},Yp(e,o)};function _O(e,o){Yp(e,o);function r(){this.constructor=e}e.prototype=o===null?Object.create(o):(r.prototype=o.prototype,new r)}var Pt=function(){return Pt=Object.assign||function(o){for(var r,a=1,l=arguments.length;a"u"?Number.MAX_SAFE_INTEGER:this.props.maxWidth,a=typeof this.props.maxHeight>"u"?Number.MAX_SAFE_INTEGER:this.props.maxHeight;return{maxWidth:r,maxHeight:a}},o.prototype.getSelfElement=function(){return this.resizable&&this.resizable.resizable},o.prototype.getOffsetHeight=function(r){var a=this.props.scale;switch(this.props.bounds){case"window":return window.innerHeight/a;case"body":return document.body.offsetHeight/a;default:return r.offsetHeight}},o.prototype.getOffsetWidth=function(r){var a=this.props.scale;switch(this.props.bounds){case"window":return window.innerWidth/a;case"body":return document.body.offsetWidth/a;default:return r.offsetWidth}},o.prototype.onDragStart=function(r,a){if(this.props.onDragStart&&this.props.onDragStart(r,a)===!1)return!1;var l=this.getDraggablePosition();if(this.originalPosition=l,!!this.props.bounds){var c=this.getParent(),u=this.props.scale,f;if(this.props.bounds==="parent")f=c;else if(this.props.bounds==="body"){var h=c.getBoundingClientRect(),p=h.left,g=h.top,v=document.body.getBoundingClientRect(),x=-(p-c.offsetLeft*u-v.left)/u,S=-(g-c.offsetTop*u-v.top)/u,E=(document.body.offsetWidth-this.resizable.size.width*u)/u+x,C=(document.body.offsetHeight-this.resizable.size.height*u)/u+S;return this.setState({bounds:{top:S,right:E,bottom:C,left:x}})}else if(this.props.bounds==="window"){if(!this.resizable)return;var R=c.getBoundingClientRect(),T=R.left,z=R.top,A=-(T-c.offsetLeft*u)/u,N=-(z-c.offsetTop*u)/u,E=(window.innerWidth-this.resizable.size.width*u)/u+A,C=(window.innerHeight-this.resizable.size.height*u)/u+N;return this.setState({bounds:{top:N,right:E,bottom:C,left:A}})}else typeof this.props.bounds=="string"?f=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(f=this.props.bounds);if(!(!(f instanceof HTMLElement)||!(c instanceof HTMLElement))){var B=f.getBoundingClientRect(),M=B.left,$=B.top,L=c.getBoundingClientRect(),H=L.left,I=L.top,Y=(M-H)/u,X=$-I;if(this.resizable){this.updateOffsetFromParent();var ee=this.offsetFromParent;this.setState({bounds:{top:X-ee.top,right:Y+(f.offsetWidth-this.resizable.size.width)-ee.left/u,bottom:X+(f.offsetHeight-this.resizable.size.height)-ee.top,left:Y-ee.left/u}})}}}},o.prototype.onDrag=function(r,a){if(this.props.onDrag){var l=this.offsetFromParent,c=l.left,u=l.top;if(!this.props.dragAxis||this.props.dragAxis==="both")return this.props.onDrag(r,Pt(Pt({},a),{x:a.x+c,y:a.y+u}));if(this.props.dragAxis==="x")return this.props.onDrag(r,Pt(Pt({},a),{x:a.x+c,y:this.originalPosition.y+u,deltaY:0}));if(this.props.dragAxis==="y")return this.props.onDrag(r,Pt(Pt({},a),{x:this.originalPosition.x+c,y:a.y+u,deltaX:0}))}},o.prototype.onDragStop=function(r,a){if(this.props.onDragStop){var l=this.offsetFromParent,c=l.left,u=l.top;if(!this.props.dragAxis||this.props.dragAxis==="both")return this.props.onDragStop(r,Pt(Pt({},a),{x:a.x+c,y:a.y+u}));if(this.props.dragAxis==="x")return this.props.onDragStop(r,Pt(Pt({},a),{x:a.x+c,y:this.originalPosition.y+u,deltaY:0}));if(this.props.dragAxis==="y")return this.props.onDragStop(r,Pt(Pt({},a),{x:this.originalPosition.x+c,y:a.y+u,deltaX:0}))}},o.prototype.onResizeStart=function(r,a,l){if(this.props.onResizeStart&&this.props.onResizeStart(r,a,l)===!1)return!1;r.stopPropagation(),this.setState({resizing:!0});var c=this.props.scale,u=this.offsetFromParent,f=this.getDraggablePosition();if(this.resizingPosition={x:f.x+u.left,y:f.y+u.top},this.originalPosition=f,this.props.bounds){var h=this.getParent(),p=void 0;this.props.bounds==="parent"?p=h:this.props.bounds==="body"?p=document.body:this.props.bounds==="window"?p=window:typeof this.props.bounds=="string"?p=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(p=this.props.bounds);var g=this.getSelfElement();if(g instanceof Element&&(p instanceof HTMLElement||p===window)&&h instanceof HTMLElement){var v=this.getMaxSizesFromProps(),x=v.maxWidth,S=v.maxHeight,E=this.getParentSize();if(x&&typeof x=="string")if(x.endsWith("%")){var C=Number(x.replace("%",""))/100;x=E.width*C}else x.endsWith("px")&&(x=Number(x.replace("px","")));if(S&&typeof S=="string")if(S.endsWith("%")){var C=Number(S.replace("%",""))/100;S=E.height*C}else S.endsWith("px")&&(S=Number(S.replace("px","")));var R=g.getBoundingClientRect(),T=R.left,z=R.top,A=this.props.bounds==="window"?{left:0,top:0}:p.getBoundingClientRect(),N=A.left,B=A.top,M=this.getOffsetWidth(p),$=this.getOffsetHeight(p),L=a.toLowerCase().endsWith("left"),H=a.toLowerCase().endsWith("right"),I=a.startsWith("top"),Y=a.startsWith("bottom");if((L||I)&&this.resizable){var X=(T-N)/c+this.resizable.size.width;this.setState({maxWidth:X>Number(x)?x:X})}if(H||this.props.lockAspectRatio&&!L&&!I){var X=M+(N-T)/c;this.setState({maxWidth:X>Number(x)?x:X})}if((I||L)&&this.resizable){var X=(z-B)/c+this.resizable.size.height;this.setState({maxHeight:X>Number(S)?S:X})}if(Y||this.props.lockAspectRatio&&!I&&!L){var X=$+(B-z)/c;this.setState({maxHeight:X>Number(S)?S:X})}}}else this.setState({maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight})},o.prototype.onResize=function(r,a,l,c){var u=this,f={x:this.originalPosition.x,y:this.originalPosition.y},h=-c.width,p=-c.height,g=["top","left","topLeft","bottomLeft","topRight"];g.includes(a)&&(a==="bottomLeft"?f.x+=h:(a==="topRight"||(f.x+=h),f.y+=p));var v=this.draggable.state;(f.x!==v.x||f.y!==v.y)&&co.flushSync(function(){u.draggable.setState(f)}),this.updateOffsetFromParent();var x=this.offsetFromParent,S=this.getDraggablePosition().x+x.left,E=this.getDraggablePosition().y+x.top;this.resizingPosition={x:S,y:E},this.props.onResize&&this.props.onResize(r,a,l,c,{x:S,y:E})},o.prototype.onResizeStop=function(r,a,l,c){this.setState({resizing:!1});var u=this.getMaxSizesFromProps(),f=u.maxWidth,h=u.maxHeight;this.setState({maxWidth:f,maxHeight:h}),this.props.onResizeStop&&this.props.onResizeStop(r,a,l,c,this.resizingPosition)},o.prototype.updateSize=function(r){this.resizable&&this.resizable.updateSize({width:r.width,height:r.height})},o.prototype.updatePosition=function(r){this.draggable.setState(r)},o.prototype.updateOffsetFromParent=function(){var r=this.props.scale,a=this.getParent(),l=this.getSelfElement();if(!a||l===null)return{top:0,left:0};var c=a.getBoundingClientRect(),u=c.left,f=c.top,h=l.getBoundingClientRect(),p=this.getDraggablePosition(),g=a.scrollLeft,v=a.scrollTop;this.offsetFromParent={left:h.left-u+g-p.x*r,top:h.top-f+v-p.y*r}},o.prototype.render=function(){var r=this,a=this.props,l=a.disableDragging,c=a.style,u=a.dragHandleClassName,f=a.position,h=a.onMouseDown,p=a.onMouseUp,g=a.dragAxis,v=a.dragGrid,x=a.bounds,S=a.enableUserSelectHack,E=a.cancel,C=a.children;a.onResizeStart,a.onResize,a.onResizeStop,a.onDragStart,a.onDrag,a.onDragStop;var R=a.resizeHandleStyles,T=a.resizeHandleClasses,z=a.resizeHandleComponent,A=a.enableResizing,N=a.resizeGrid,B=a.resizeHandleWrapperClass,M=a.resizeHandleWrapperStyle,$=a.scale,L=a.allowAnyClick,H=a.dragPositionOffset,I=DO(a,["disableDragging","style","dragHandleClassName","position","onMouseDown","onMouseUp","dragAxis","dragGrid","bounds","enableUserSelectHack","cancel","children","onResizeStart","onResize","onResizeStop","onDragStart","onDrag","onDragStop","resizeHandleStyles","resizeHandleClasses","resizeHandleComponent","enableResizing","resizeGrid","resizeHandleWrapperClass","resizeHandleWrapperStyle","scale","allowAnyClick","dragPositionOffset"]),Y=this.props.default?Pt({},this.props.default):void 0;delete I.default;var X=l||u?{cursor:"auto"}:{cursor:"move"},ee=Pt(Pt(Pt({},NO),X),c),ne=this.offsetFromParent,re=ne.left,j=ne.top,k;f&&(k={x:f.x-re,y:f.y-j});var V=this.state.resizing?void 0:k,P=this.state.resizing?"both":g;return b.createElement(vO,{ref:function(Z){Z&&(r.draggable=Z)},handle:u?".".concat(u):void 0,defaultPosition:Y,onMouseDown:h,onMouseUp:p,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,axis:P,disabled:l,grid:v,bounds:x?this.state.bounds:void 0,position:V,enableUserSelectHack:S,cancel:E,scale:$,allowAnyClick:L,nodeRef:this.resizableElement,positionOffset:H},b.createElement(TO,Pt({},I,{ref:function(Z){Z&&(r.resizable=Z,r.resizableElement.current=Z.resizable)},defaultSize:Y,size:this.props.size,enable:typeof A=="boolean"?AO(A):A,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,style:ee,minWidth:this.props.minWidth,minHeight:this.props.minHeight,maxWidth:this.state.resizing?this.state.maxWidth:this.props.maxWidth,maxHeight:this.state.resizing?this.state.maxHeight:this.props.maxHeight,grid:N,handleWrapperClass:B,handleWrapperStyle:M,lockAspectRatio:this.props.lockAspectRatio,lockAspectRatioExtraWidth:this.props.lockAspectRatioExtraWidth,lockAspectRatioExtraHeight:this.props.lockAspectRatioExtraHeight,handleStyles:R,handleClasses:T,handleComponent:z,scale:this.props.scale}),C))},o.defaultProps={maxWidth:Number.MAX_SAFE_INTEGER,maxHeight:Number.MAX_SAFE_INTEGER,scale:1,onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},onDragStart:function(){},onDrag:function(){},onDragStop:function(){}},o})(b.PureComponent);const CC=1920,EC=1080;function Di(e){const o=Math.round(e);return o-o%2}function RC(e,o,r=CC,a=EC){const{x:l,y:c,w:u,h:f,valign:h="center",halign:p="center"}=e,g=e.direction==="vertical",v=u*r,x=f*a,S=[];if(g){const E=Di(c*a),C=Di(Math.min(x/o,v*9/16)),R=C*o,T=x,z=Di(h==="top"?0:h==="bottom"?T-R:(T-R)/2),A=C/a;for(let N=0;N0?S*g/2:0,C=[];for(let R=0;R0,N=r+T*g+(A?E:0),B=a+z*v;C.push([N,B,g,v,u,f])}return C}function TC(e,o){const r=new Array(o.length).fill(0),a=o.map(u=>u.max!=null?u.max:null),l=new Set(o.map((u,f)=>f));let c=e;for(;c>0&&l.size>0;){const u=Math.floor(c/l.size);if(u===0){for(const h of[...l].sort((p,g)=>p-g).slice(0,c))r[h]+=1;break}let f=!1;for(const h of[...l]){const p=a[h],g=p!=null?p-r[h]:null,v=g!=null?Math.min(u,g):u;v>0&&(r[h]+=v,c-=v,f=!0),p!=null&&r[h]>=p&&l.delete(h)}if(!f)break}return r}function OO(e,o,r=CC,a=EC){const l=e.filter(v=>v.type==="static"),c=e.filter(v=>v.type==="row"||v.type==="grid"),u=Math.max(0,o-l.length);if(u>0&&c.length===0)return null;const f=TC(u,c),h=[];let p=0,g=0;for(const v of e){if(p>=o)break;if(v.type==="static")h.push([v.x,v.y,v.w,v.h,v.valign??"center",v.halign??"center"]),p+=1;else if(v.type==="row"||v.type==="grid"){const x=f[g];if(g+=1,x<=0)continue;h.push(...v.type==="row"?RC(v,x,r,a):MO(v,x)),p+=x}}return p({value:p,match:jO(p,r,a)})).filter(p=>p.match);if(!l.length)return{pos:e,guides:[]};const c=l.reduce((p,g)=>p.match.dist<=g.match.dist?p:g),u=c.match.target-c.value,f=e+u,h=[];for(const p of l)Math.abs(p.value+u-p.match.target)<=a&&h.push(p.match.target);return{pos:f,guides:h}}function BO(e,o,r,a=8){const{x:l,y:c,w:u,h:f}=e,h=[],p=J1(l,[l,l+u/2,l+u],o,a);for(const v of p.guides)h.push({axis:"x",pos:v});const g=J1(c,[c,c+f/2,c+f],r,a);for(const v of g.guides)h.push({axis:"y",pos:v});return{x:p.pos,y:g.pos,w:u,h:f,guides:h}}function $O({canvasW:e,canvasH:o,others:r,subdivisions:a,snapToCanvas:l,snapToElements:c}){const u=[],f=[];if(l&&(u.push(0,e/2,e),f.push(0,o/2,o)),c){for(const h of r)u.push(h.x,h.x+h.w/2,h.x+h.w),f.push(h.y,h.y+h.h/2,h.y+h.h);for(const h of a??[])h.axis==="x"?u.push(h.pos*e):f.push(h.pos*o)}return{targetsX:u,targetsY:f}}function _C(e){return new Promise((o,r)=>{const a=new FileReader;a.onload=()=>o(a.result.split(",")[1]),a.onerror=()=>r(new Error("Failed to read file")),a.readAsDataURL(e)})}const ex={static:"Static",row:"Auto Row",grid:"Auto Grid"},LO={static:{border:"1px solid var(--mantine-color-blue-5)",background:"rgba(51, 154, 240, 0.15)"},row:{border:"2px dashed var(--mantine-color-teal-5)",background:"rgba(18, 184, 134, 0.12)"},grid:{border:"2px dotted var(--mantine-color-orange-5)",background:"rgba(253, 126, 20, 0.12)"}},ou={background:"var(--mantine-color-yellow-5)",border:"1px solid rgba(0, 0, 0, 0.4)",borderRadius:"50%"},kO={topLeft:ou,topRight:ou,bottomLeft:ou,bottomRight:ou},ru=[{value:"auto",label:"Auto Grid"},{value:"featured",label:"Featured"},{value:"top_featured",label:"Top Featured"}],HO={auto:[{id:"b-grid",type:"grid",x:0,y:0,w:1,h:1,valign:"center",halign:"center"}],featured:[{id:"b-main",type:"static",x:0,y:0,w:.6,h:1,valign:"center",halign:"center"},{id:"b-side",type:"row",direction:"vertical",x:.6,y:0,w:.4,h:1,valign:"center",halign:"center"}],top_featured:[{id:"b-main",type:"static",x:0,y:0,w:1,h:.6,valign:"center",halign:"center"},{id:"b-bottom",type:"row",direction:"horizontal",x:0,y:.6,w:1,h:.4,valign:"center",halign:"center"}]},DC=4,tx=Up.map(e=>({value:e,label:e}));function nx(e,o){const r=e.filter(f=>f.type==="static"),a=e.filter(f=>f.type==="row"||f.type==="grid"),l=Math.max(0,o-r.length),c=TC(l,a),u=[];return a.forEach((f,h)=>{const p=c[h];if(p<=1)return;const g=f.x,v=f.y,x=f.x+f.w,S=f.y+f.h;if(f.type==="grid"){const M=Math.ceil(Math.sqrt(p)),$=Math.ceil(p/M);for(let L=1;LM-$),A=[...R].sort((M,$)=>M-$),N=z[0]??g,B=A[0]??v;for(const M of z)M>N+T&&u.push({axis:"x",pos:M,from:v,to:S});for(const M of A)M>B+T&&u.push({axis:"y",pos:M,from:g,to:x})}),u}function UO(){const[e,o]=b.useState(null),[r,a]=b.useState(null);return b.useEffect(()=>{if(!e)return;const l=new ResizeObserver(c=>{const{width:u,height:f}=c[0].contentRect;u>0&&f>0&&a({width:Math.round(u),height:Math.round(f)})});return l.observe(e),()=>l.disconnect()},[e]),[r,o]}function zi(e){return e<=.001?0:e>=1-.001?1:e}function ox({x:e,y:o,w:r,h:a}){return{x:zi(e),y:zi(o),w:zi(r),h:zi(a)}}function PO(e,o){const r=1.7777777777777777;let a=e,l=a/r;return l>o&&(l=o,a=l*r),{width:Math.round(a),height:Math.round(l)}}function NC({tiles:e}){return y.jsx("div",{style:{position:"relative",width:160,height:90,background:"var(--mantine-color-dark-6)",border:"1px solid var(--mantine-color-dark-4)",flexShrink:0},children:(e??[]).map((o,r)=>y.jsx("div",{style:{position:"absolute",left:`${o[0]*100}%`,top:`${o[1]*100}%`,width:`${o[2]*100}%`,height:`${o[3]*100}%`,border:"1px solid var(--mantine-color-blue-5)",background:"rgba(51, 154, 240, 0.15)",boxSizing:"border-box"}},r))})}function VO({elements:e,selectedIdx:o,onSelect:r,onElementChange:a,backgroundUrl:l,previewCountNum:c,snapToCanvas:u,snapToElements:f,canvasW:h,canvasH:p,isMobile:g,readOnly:v}){const[x,S]=b.useState([]),[E,C]=b.useState(null),R=E?e.map((B,M)=>M===E.idx?{...B,x:E.x,y:E.y,w:E.w,h:E.h}:B):e,T=nx(R,c);function z(B){return{x:B.x*h,y:B.y*p,w:B.w*h,h:B.h*p}}function A(B){return e.filter((M,$)=>$!==B).map(z)}function N(B,M){const $=nx(R.filter((I,Y)=>Y!==B),c),{targetsX:L,targetsY:H}=$O({canvasW:h,canvasH:p,others:A(B),subdivisions:$,snapToCanvas:u,snapToElements:f});return BO(M,L,H)}return y.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",background:"var(--mantine-color-dark-6)",border:"1px solid var(--mantine-color-dark-4)"},children:[l&&y.jsx("img",{src:l,alt:"",style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",pointerEvents:"none"}}),T.map((B,M)=>B.axis==="x"?y.jsx("div",{style:{position:"absolute",left:B.pos*h,top:B.from*p,width:1,height:(B.to-B.from)*p,background:"rgba(255, 255, 255, 0.3)",pointerEvents:"none"}},`sub-${M}`):y.jsx("div",{style:{position:"absolute",top:B.pos*p,left:B.from*h,height:1,width:(B.to-B.from)*h,background:"rgba(255, 255, 255, 0.3)",pointerEvents:"none"}},`sub-${M}`)),e.map((B,M)=>{const $=z(B),L=o===M;return y.jsx(zO,{bounds:"parent",size:{width:$.w,height:$.h},position:{x:$.x,y:$.y},minWidth:20,minHeight:20,lockAspectRatio:B.lockAspect?B.w*h/(B.h*p):!1,resizeHandleStyles:L&&g&&!v?kO:void 0,disableDragging:v,enableResizing:!v,onMouseDown:()=>r(M),onDrag:(H,I)=>{const Y=N(M,{x:I.x,y:I.y,w:$.w,h:$.h});S(Y.guides),C({idx:M,x:Y.x/h,y:Y.y/p,w:B.w,h:B.h})},onDragStop:(H,I)=>{const Y=N(M,{x:I.x,y:I.y,w:$.w,h:$.h});S([]),C(null),a(M,ox({x:Y.x/h,y:Y.y/p,w:B.w,h:B.h}))},onResize:(H,I,Y,X,ee)=>{const ne=N(M,{x:ee.x,y:ee.y,w:Y.offsetWidth,h:Y.offsetHeight});S(ne.guides),C({idx:M,x:ne.x/h,y:ne.y/p,w:ne.w/h,h:ne.h/p})},onResizeStop:(H,I,Y,X,ee)=>{const ne=N(M,{x:ee.x,y:ee.y,w:Y.offsetWidth,h:Y.offsetHeight});S([]),C(null),a(M,ox({x:ne.x/h,y:ne.y/p,w:ne.w/h,h:ne.h/p}))},style:{...LO[B.type],outline:L?"2px solid var(--mantine-color-yellow-5)":"none",outlineOffset:-2,display:"flex",alignItems:"center",justifyContent:"center"},children:y.jsx(Ve,{size:"xs",c:"dimmed",ta:"center",style:{userSelect:"none",pointerEvents:"none"},children:B.name||M+1})},B.id)}),x.map((B,M)=>B.axis==="x"?y.jsx("div",{style:{position:"absolute",left:B.pos,top:0,width:1,height:p,background:"var(--mantine-color-red-5)",pointerEvents:"none"}},`live-${M}`):y.jsx("div",{style:{position:"absolute",top:B.pos,left:0,height:1,width:h,background:"var(--mantine-color-red-5)",pointerEvents:"none"}},`live-${M}`))]})}function rx({style:e,styleId:o,onUpdate:r,readOnly:a=!1}){const[l,c]=b.useState(e),[u,f]=b.useState(!1);b.useEffect(()=>{c(e),f(!1)},[o]);const[h,p]=b.useState(4),[g,v]=b.useState(null),[x,S]=b.useState(null),[E,C]=b.useState(!1),[R,T]=b.useState(!1),[z,A]=b.useState(!0),[N,B]=b.useState(!0),M=b.useRef(null),[$,L]=UO(),H=Qp("(max-width: 48em)"),I=h||4,Y=l.elements??[],X=g!=null?Y[g]:null;b.useEffect(()=>{let O=!1,q=null;return l.background_image?yC(o).then(W=>{O||!W||(q=URL.createObjectURL(W),S(q))}):S(null),()=>{O=!0,q&&URL.revokeObjectURL(q)}},[o,l.background_image]);function ee(O){c(q=>({...q,elements:O})),f(!0)}async function ne(){T(!0);try{await r(l),f(!1)}finally{T(!1)}}async function re(O){const q=O.target.files?.[0];if(O.target.value="",!!q){C(!0);try{const W=await _C(q),ie=await vC(o,q.name,W);c(ue=>({...ue,background_image:ie.filename})),f(!0)}catch(W){Ze.show({title:"Upload failed",message:W.message,color:"red",autoClose:4e3})}finally{C(!1)}}}function j(){c(O=>({...O,background_image:null})),f(!0)}function k(O){const q={id:Na(),type:O,x:.1,y:.1,w:.3,h:.3,valign:"center",halign:"center"};O==="row"&&(q.direction="horizontal");const W=[...Y,q];ee(W),v(W.length-1)}function V(O){ee(Y.filter((q,W)=>W!==O)),g===O?v(null):g!=null&&g>O&&v(g-1)}function P(O){const q=Y[O],W={...q,id:Na(),x:zi(q.x+.02),y:zi(q.y+.02)},ie=[...Y.slice(0,O+1),W,...Y.slice(O+1)];ee(ie),v(O+1)}function Z(O,q){const W=O+q;if(W<0||W>=Y.length)return;const ie=[...Y];[ie[O],ie[W]]=[ie[W],ie[O]],ee(ie),g===O?v(W):g===W&&v(O)}function D(O,q){ee(Y.map((W,ie)=>ie===O?{...W,...q}:W))}return y.jsxs(Qt,{gap:"sm",style:{flex:1,minHeight:0},children:[y.jsxs(mt,{gap:"xs",align:"flex-end",wrap:"wrap",children:[y.jsx(Yi,{size:"xs",label:"Style name",value:l.name??"",onChange:O=>{c(q=>({...q,name:O.currentTarget.value})),f(!0)},placeholder:"Style name",disabled:a,style:{flex:H?"1 1 100%":"1 1 200px"}}),y.jsx(Ca,{size:"xs",label:"Preview channel count",min:2,max:9,value:h,onChange:O=>p(O||4),w:H?"100%":150}),y.jsx(Bi,{size:"xs",label:"Snap to elements",disabled:a,checked:z,onChange:O=>A(O.currentTarget.checked)}),y.jsx(Bi,{size:"xs",label:"Snap to canvas",disabled:a,checked:N,onChange:O=>B(O.currentTarget.checked)}),y.jsx(Dt,{size:"xs",leftSection:y.jsx(p5,{size:14}),disabled:a||!u,loading:R,color:u?"blue":"gray",variant:u?"filled":"default",onClick:ne,style:H?{flex:"1 1 100%"}:void 0,children:u?"Save":"Saved"})]}),y.jsxs(sg,{cols:H?2:4,spacing:"xs",children:[y.jsx(Dt,{size:"xs",variant:"default",leftSection:y.jsx(ls,{size:12}),disabled:a,onClick:()=>k("static"),children:"Static Position"}),y.jsx(Dt,{size:"xs",variant:"default",leftSection:y.jsx(ls,{size:12}),disabled:a,onClick:()=>k("row"),children:"Auto Row"}),y.jsx(Dt,{size:"xs",variant:"default",leftSection:y.jsx(ls,{size:12}),disabled:a,onClick:()=>k("grid"),children:"Auto Grid"}),y.jsxs(mt,{gap:4,wrap:"nowrap",children:[y.jsx(Dt,{size:"xs",variant:"default",leftSection:y.jsx(R5,{size:12}),loading:E,disabled:a,onClick:()=>M.current?.click(),style:{flex:1},children:l.background_image?"Change Background":"Background Image"}),y.jsx(Yt,{size:"sm",variant:"subtle",color:"red",disabled:a||!l.background_image,onClick:j,"aria-label":"Remove background",children:y.jsx(j5,{size:14})})]}),y.jsx("input",{ref:M,type:"file",accept:"image/png,image/jpeg",style:{display:"none"},onChange:re})]}),y.jsx(Ve,{size:"xs",c:"dimmed",children:a?Y.length===0?"This style has no representable elements at this channel count.":"Click a box or list row to inspect its properties.":Y.length===0?"Add a Static Position, Auto Row, or Auto Grid to get started.":"Drag a box to move it, drag its edge/corner to resize it. Click a box or list row to select it."}),y.jsxs(mt,{align:"stretch",gap:"sm",wrap:H?"wrap":"nowrap",style:{flex:1,minHeight:0},children:[y.jsxs(Qt,{gap:6,p:"sm",w:H?"100%":260,style:{flexShrink:0,minHeight:0,overflowY:"auto",border:"1px solid var(--mantine-color-dark-4)",borderRadius:6},children:[y.jsx(Ve,{size:"xs",fw:600,children:X?X.name||ex[X.type]:"No element selected"}),y.jsx(it,{withRowBorders:!1,verticalSpacing:4,horizontalSpacing:"xs",style:{tableLayout:"fixed",width:"100%"},children:y.jsxs(it.Tbody,{children:[y.jsxs(it.Tr,{children:[y.jsx(it.Td,{w:80,children:y.jsx(Ve,{size:"xs",c:"dimmed",children:"Direction"})}),y.jsx(it.Td,{children:y.jsx(lg,{size:"xs",fullWidth:!0,disabled:!X||a||X.type!=="row",data:[{label:"Horiz",value:"horizontal"},{label:"Vert",value:"vertical"}],value:X?.direction??"horizontal",onChange:O=>g!=null&&D(g,{direction:O})})})]}),y.jsxs(it.Tr,{children:[y.jsx(it.Td,{w:80,children:y.jsx(Ve,{size:"xs",c:"dimmed",children:"Max channels"})}),y.jsx(it.Td,{children:y.jsx(Ca,{size:"xs",placeholder:"Unlimited",disabled:!X||a||!["row","grid"].includes(X.type),min:1,value:X?.max??"",onChange:O=>g!=null&&D(g,{max:O===""?null:O})})})]}),y.jsxs(it.Tr,{children:[y.jsx(it.Td,{w:80,children:y.jsx(Ve,{size:"xs",c:"dimmed",children:"Anchor"})}),y.jsx(it.Td,{children:y.jsxs(mt,{grow:!0,gap:4,wrap:"nowrap",children:[y.jsx(Vi,{size:"xs",placeholder:"V anchor",disabled:!X||a,data:tx,value:X?.valign??null,onChange:O=>O&&g!=null&&D(g,{valign:O})}),y.jsx(Vi,{size:"xs",placeholder:"H anchor",disabled:!X||a,data:tx,value:X?.halign??null,onChange:O=>O&&g!=null&&D(g,{halign:O})})]})})]}),y.jsxs(it.Tr,{children:[y.jsx(it.Td,{w:80,children:y.jsx(Ve,{size:"xs",c:"dimmed",children:"Size"})}),y.jsx(it.Td,{children:y.jsxs(mt,{grow:!0,gap:4,wrap:"nowrap",children:[y.jsx(Ca,{size:"xs",label:"Width (px)",description:"of 1920",disabled:!X||a,min:1,value:X?Math.round(X.w*1920):"",onChange:O=>{if(!O||g==null)return;const q=O/1920;if(X.lockAspect){const W=X.w*1920/(X.h*1080);D(g,{w:q,h:O/W/1080})}else D(g,{w:q})}}),y.jsx(Ca,{size:"xs",label:"Height (px)",description:"of 1080",disabled:!X||a,min:1,value:X?Math.round(X.h*1080):"",onChange:O=>{if(!O||g==null)return;const q=O/1080;if(X.lockAspect){const W=X.w*1920/(X.h*1080);D(g,{w:O*W/1920,h:q})}else D(g,{h:q})}})]})})]}),y.jsxs(it.Tr,{children:[y.jsx(it.Td,{w:80,children:y.jsx(Ve,{size:"xs",c:"dimmed",children:"Lock aspect"})}),y.jsx(it.Td,{children:y.jsx(Bi,{size:"xs",disabled:!X||a,checked:!!X?.lockAspect,onChange:O=>g!=null&&D(g,{lockAspect:O.currentTarget.checked})})})]})]})})]}),y.jsx("div",{ref:L,style:H?{width:"100%",aspectRatio:"16 / 9"}:{flex:1,minWidth:0,minHeight:0,display:"flex",alignItems:"center",justifyContent:"center"},children:$&&(()=>{const O=PO($.width,$.height);return y.jsx("div",{style:{width:O.width,height:O.height},children:y.jsx(VO,{elements:Y,selectedIdx:g,onSelect:v,onElementChange:D,backgroundUrl:x,previewCountNum:I,snapToCanvas:N,snapToElements:z,canvasW:O.width,canvasH:O.height,isMobile:H,readOnly:a})})})()}),y.jsxs(Qt,{gap:6,p:"sm",w:H?"100%":220,style:{flexShrink:0,minHeight:0,overflowY:"auto",border:"1px solid var(--mantine-color-dark-4)",borderRadius:6},children:[y.jsx(Ve,{size:"xs",fw:600,c:"dimmed",children:"Elements"}),Y.map((O,q)=>y.jsxs(mt,{gap:4,wrap:"nowrap",onClick:()=>v(q),style:{cursor:"pointer",padding:4,borderRadius:4,background:g===q?"rgba(51, 154, 240, 0.18)":"transparent",borderLeft:g===q?"2px solid var(--mantine-color-blue-5)":"2px solid transparent"},children:[y.jsxs(Ve,{size:"xs",c:"dimmed",children:[q+1,"."]}),y.jsx(Yi,{size:"xs",variant:"unstyled",value:O.name??"",placeholder:ex[O.type],disabled:a,onChange:W=>D(q,{name:W.currentTarget.value}),onClick:W=>W.stopPropagation(),style:{flex:1,minWidth:0},styles:{input:{minHeight:"unset",height:"auto",padding:0}}}),y.jsx(Yt,{size:"xs",variant:"subtle",disabled:a,onClick:W=>{W.stopPropagation(),P(q)},"aria-label":"Duplicate element",children:y.jsx(d5,{size:12})}),y.jsx(Yt,{size:"xs",variant:"subtle",disabled:a||q===0,onClick:W=>{W.stopPropagation(),Z(q,-1)},children:y.jsx(t5,{size:12})}),y.jsx(Yt,{size:"xs",variant:"subtle",disabled:a||q===Y.length-1,onClick:W=>{W.stopPropagation(),Z(q,1)},children:y.jsx(JM,{size:12})}),y.jsx(Yt,{size:"xs",variant:"subtle",color:"red",disabled:a,onClick:W=>{W.stopPropagation(),V(q)},children:y.jsx(hg,{size:12})})]},O.id))]})]})]})}async function YO(e,o){const r={name:o.name,elements:o.elements??[]};if(o.background_image){const a=await yC(e);a&&(r.background_image_filename=o.background_image,r.background_image_data=await _C(a))}return r}async function ax(e){const o=Na(),r={name:e.name||"Imported Style",elements:e.elements??[]};if(e.background_image_data){const a=await vC(o,e.background_image_filename||"background.png",e.background_image_data);r.background_image=a.filename}return[o,r]}function GO(e){return e.some(r=>r.type==="row"||r.type==="grid")?DC:Math.max(e.length,1)}function XO({id:e,style:o,onOpen:r,onExport:a,onDelete:l}){const c=o.elements??[],u=OO(c,GO(c))??[];return y.jsxs(Qt,{gap:4,align:"center",style:{cursor:"pointer",flexShrink:0},onClick:()=>r(e),children:[y.jsx(NC,{tiles:u}),y.jsx(Ve,{size:"xs",children:o.name||"New Style"}),y.jsxs(mt,{gap:4,children:[y.jsx(Yt,{size:"xs",variant:"subtle",onClick:f=>{f.stopPropagation(),a(e,o)},"aria-label":"Export style",children:y.jsx(Vw,{size:12})}),y.jsx(Yt,{size:"xs",variant:"subtle",color:"red",onClick:f=>{f.stopPropagation(),l(e)},"aria-label":"Delete style",children:y.jsx(hg,{size:12})})]})]})}function qO({onClick:e}){return y.jsxs(Qt,{gap:4,align:"center",style:{cursor:"pointer",flexShrink:0},onClick:e,children:[y.jsx("div",{style:{width:160,height:90,display:"flex",alignItems:"center",justifyContent:"center",border:"1px dashed var(--mantine-color-dark-4)",color:"var(--mantine-color-dimmed)"},children:y.jsx(ls,{size:24})}),y.jsx(Ve,{size:"xs",c:"dimmed",children:"New Style"})]})}function IO({settings:e,onFieldsReload:o}){const r=e.multiview_custom_layouts??{},a=e.multiview_custom_layouts_order??Object.keys(r),[l,c]=b.useState({}),[u,f]=b.useState(null),[h,p]=b.useState(null),[g,v]=b.useState(!0),x=b.useRef(null),S=Qp("(max-width: 48em)");b.useEffect(()=>{(u||h)&&S&&v(!1)},[u,h]),b.useEffect(()=>{let H=!1;return Promise.all(ru.map(I=>B4(I.value,DC).catch(()=>null))).then(I=>{if(H)return;const Y={};ru.forEach((X,ee)=>{I[ee]&&(Y[X.value]=I[ee].tiles)}),c(Y)}),()=>{H=!0}},[]);async function E(H,I){try{await Ur({multiview_custom_layouts:H,multiview_custom_layouts_order:I}),await o()}catch(Y){Ze.show({title:"Save failed",message:Y.message,color:"red",autoClose:4e3})}}async function C(){try{const H=Na();await E({...r,[H]:{name:"New Style",elements:[]}},[...a,H]),f(H)}catch(H){Ze.show({title:"Failed",message:H.message,color:"red",autoClose:4e3})}}function R(H){const I={...r};delete I[H],E(I,a.filter(Y=>Y!==H)),u===H&&f(null)}function T(H,I){return E({...r,[H]:I},a)}async function z(H,I){try{const Y=await YO(H,I);xC(Y,`multiview-style-${(I.name||"style").trim().replace(/\s+/g,"-")||"style"}.json`)}catch(Y){Ze.show({title:"Export failed",message:Y.message,color:"red",autoClose:4e3})}}async function A(H){const I=H.target.files?.[0];if(H.target.value="",!!I)try{const Y=JSON.parse(await I.text());if(!Y||typeof Y!="object"||Array.isArray(Y))throw new Error("Not a valid style file");if(Array.isArray(Y.elements)){Pp(Y);const[X,ee]=await ax(Y);await E({...r,[X]:ee},[...a,X]),Ze.show({message:`Style "${ee.name}" imported`,color:"green",autoClose:2e3})}else{const X=Object.entries(Y);X.forEach(([re,j])=>Pp(j,`style "${re}"`));const ee={},ne=[];for(const[,re]of X){const[j,k]=await ax(re);ee[j]=k,ne.push(j)}await E({...r,...ee},[...a,...ne]),Ze.show({message:`Imported ${ne.length} style(s)`,color:"green",autoClose:2e3})}}catch(Y){Ze.show({title:"Import failed",message:Y.message,color:"red",autoClose:4e3})}}const N=a.filter(H=>r[H]).map(H=>[H,r[H]]),B=u?r[u]:null,M=h?{name:h.label,elements:HO[h.value]}:null;function $(H){p(null),f(H)}function L(H){f(null),p(H)}return b.useEffect(()=>{B||M||(N.length>0?(p(null),f(N[0][0])):(f(null),p(ru[0])))},[B,M,N]),y.jsxs(Qt,{gap:"xs",style:{flex:1,minHeight:0},children:[y.jsxs(mt,{justify:"space-between",gap:"xs",children:[y.jsxs(mt,{gap:4,children:[y.jsx(Ve,{size:"xs",c:"dimmed",children:"Click a built-in to preview it, or a custom style to edit it."}),S&&y.jsx(Yt,{size:"xs",variant:"subtle",onClick:()=>v(H=>!H),"aria-label":g?"Collapse styles":"Expand styles",children:g?y.jsx(s5,{size:12}):y.jsx(Pw,{size:12})})]}),y.jsx(Dt,{size:"xs",variant:"default",leftSection:y.jsx(Gw,{size:12}),onClick:()=>x.current?.click(),children:"Import"}),y.jsx("input",{ref:x,type:"file",accept:"application/json",style:{display:"none"},onChange:A})]}),y.jsx(rm,{in:!S||g,children:y.jsxs(mt,{align:"flex-start",gap:"md",wrap:"nowrap",style:{overflowX:"auto",paddingBottom:4},children:[ru.map(H=>y.jsxs(Qt,{gap:4,align:"center",style:{flexShrink:0,cursor:"pointer"},onClick:()=>L(H),children:[y.jsx(NC,{tiles:l[H.value]}),y.jsx(Ve,{size:"xs",children:H.label})]},H.value)),N.map(([H,I])=>y.jsx(XO,{id:H,style:I,onOpen:$,onExport:z,onDelete:R},H)),y.jsx(qO,{onClick:C})]})}),B?y.jsx(rx,{style:B,styleId:u,onUpdate:H=>T(u,H)}):M?y.jsx(rx,{style:M,styleId:`builtin:${h.value}`,onUpdate:()=>{},readOnly:!0}):null]})}const Gp=/^multiview_([0-9a-f]{8})_(.+)$/;function FO(e,o,r,a){const l=o.map(p=>{const g={id:p},v=[];for(const[x,S]of Object.entries(e)){const E=x.match(Gp);if(!E||E[1]!==p)continue;const C=E[2].match(/^channel_(\d+)$/);C?v[parseInt(C[1],10)-1]=S:g[E[2]]=S}return v.length&&(g.channels=v),g}),c={};for(const[p,g]of Object.entries(e))p==="multiview_order"||p==="multiview_count"||p==="multiview_custom_layouts"||p==="multiview_custom_layouts_order"||p==="multiview_pre_migration_backup"||p==="multiview_pre_reconcile_backup"||Gp.test(p)||(c[p]=g);const u=e.multiview_custom_layouts??{},f=e.multiview_custom_layouts_order??Object.keys(u),h={};for(const p of f)u[p]&&(h[p]=u[p]);return{global:c,layouts:l,custom_styles:h,plugin_version:r,dispatcharr_version:a}}function ZO(e){const o={},r=[];for(const a of e.layouts){const l=Na();r.push(l);for(const[c,u]of Object.entries(a))c!=="id"&&(c==="channels"?u.forEach((f,h)=>{o[`multiview_${l}_channel_${h+1}`]=f}):o[`multiview_${l}_${c}`]=u)}return Object.assign(o,e.global??{}),o.multiview_order=r,o.multiview_custom_layouts=e.custom_styles??{},o.multiview_custom_layouts_order=Object.keys(e.custom_styles??{}),o}function QO({id:e,...o}){const{attributes:r,listeners:a,setNodeRef:l,transform:c,transition:u,isDragging:f}=_4({id:e}),h={transform:ys.Transform.toString(c),transition:u,opacity:f?.5:1};return y.jsx("div",{ref:l,style:h,children:y.jsx(I4,{id:e,dragHandleProps:{...r,...a},...o})})}function KO({onLoggedOut:e}){const[o,r]=b.useState(null),[a,l]=b.useState({}),[c,u]=b.useState(""),[f,h]=b.useState(!1),[p,g]=b.useState(!1),[v,x]=b.useState(!1),[S,E]=b.useState(0),[C,R]=b.useState(()=>new Set),[T,z]=b.useState(null),A=b.useRef(null),N=b.useCallback(async()=>{try{const[P,Z]=await Promise.all([O4(),V1()]);r(P);const D=Z.settings??{},O=[...P.global??[],...(P.layouts??[]).flatMap(W=>W.fields)],q={...D};for(const W of O)!(W.id in q)&&W.default!==void 0&&(q[W.id]=W.default);l(q)}catch(P){P.status!==401&&u(P.message)}},[]);b.useEffect(()=>{N()},[N]),b.useEffect(()=>{const P=async()=>{try{const O=(await gC()).active??[];E(O.length),R(new Set(O.map(q=>q.n)))}catch{}};P();const Z=setInterval(P,5e3);return()=>clearInterval(Z)},[]),b.useEffect(()=>(P1(e),()=>P1(()=>{})),[e]);const B=b.useCallback(P=>l(Z=>({...Z,...P})),[]);function M(){return(o?.layouts??[]).map(P=>P.n)}async function $(P,Z){const D=`multiview_${P}_channel_count`,O=(a[D]??4)+Z;try{await Ur({[D]:O}),await N()}catch(q){Ze.show({title:"Failed",message:q.message,color:"red",autoClose:4e3})}}async function L(){try{const P=M(),Z=Na(),D=P.length+1,O={multiview_order:[...P,Z],[`multiview_${Z}_name`]:`Multiview ${D}`,[`multiview_${Z}_layout`]:"auto",[`multiview_${Z}_selector_type`]:"classic",[`multiview_${Z}_channel_count`]:4,[`multiview_${Z}_epg_source_mode`]:"dummy"};await Ur(O),await N(),Ze.show({message:`Layout ${D} added`,color:"green",autoClose:2e3})}catch(P){Ze.show({title:"Failed",message:P.message,color:"red",autoClose:4e3})}}async function H(P){const Z=M();if(Z.length<=1)return;const D={multiview_order:Z.filter(O=>O!==P)};for(const O of Object.keys(a))O.startsWith(`multiview_${P}_`)&&(D[O]=null);try{await Ur(D);try{await Hp(P)}catch{}await N(),Ze.show({message:"Layout removed",color:"green",autoClose:2e3})}catch(O){Ze.show({title:"Failed",message:O.message,color:"red",autoClose:4e3})}}const I=o6(n6(Sg,{activationConstraint:{distance:4}}));async function Y(P){const{active:Z,over:D}=P;if(!D||Z.id===D.id)return;const O=M(),q=O.indexOf(Z.id),W=O.indexOf(D.id);if(q===-1||W===-1)return;const ie=wg(O,q,W);try{await Ur({multiview_order:ie}),await N()}catch(ue){Ze.show({title:"Failed",message:ue.message,color:"red",autoClose:4e3})}}async function X(){h(!0);try{const P=await $4();Ze.show({message:P.message||"M3U & EPG refreshed",color:P.status==="success"?"green":"red",autoClose:3e3})}catch(P){Ze.show({title:"Refresh failed",message:P.message,color:"red",autoClose:4e3})}finally{h(!1)}}async function ee(){try{const P=await V1(),Z=M(),D=FO(P.settings??{},Z,P.plugin_version,P.dispatcharr_version);xC(D,`multiview-backup-${new Date().toISOString().slice(0,10)}.json`)}catch(P){Ze.show({title:"Export failed",message:P.message,color:"red",autoClose:4e3})}}async function ne(P){const Z=P.target.files?.[0];if(P.target.value="",!!Z)try{const D=JSON.parse(await Z.text());if(!D||typeof D!="object"||Array.isArray(D))throw new Error("Backup file is not a valid settings object");let O,q;if(Array.isArray(D.layouts))X4(D),O=ZO(D),q=O.multiview_order;else{q4(D);const fe=Array.isArray(D.multiview_order)?D.multiview_order:[],be=Object.fromEntries(fe.map(ye=>[ye,Na()]));q=fe.map(ye=>be[ye]),O={};for(const[ye,Ge]of Object.entries(D)){if(ye==="multiview_order")continue;const Ne=ye.match(Gp);Ne&&be[Ne[1]]?O[`multiview_${be[Ne[1]]}_${Ne[2]}`]=Ge:Ne||(O[ye]=Ge)}O.multiview_order=q}let W=new Set;try{const fe=await j4();W=new Set(fe.map(be=>String(be.id)))}catch{W=new Set}const ie=[];q.forEach((fe,be)=>{const ye=O[`multiview_${fe}_name`]||`Multiview ${be+1}`,Ge=`multiview_${fe}_`;for(const Ne of Object.keys(O)){if(!Ne.startsWith(Ge))continue;const Ke=Ne.slice(Ge.length);if(Ke!=="epg_forward_channel"&&!/^channel_\d+$/.test(Ke))continue;const Be=O[Ne];Be&&Be!=="_none"&&W.size>0&&!W.has(String(Be))&&(O[Ne]="_none",ie.push(`${ye} (${Ke})`))}});const ue={};for(const fe of Object.keys(a))fe.startsWith("multiview_")&&(ue[fe]=null);Object.assign(ue,O),ue.multiview_order=q;const ve=ie.length?` ${ie.length} channel selection(s) could not be matched and were cleared (reselect manually): ${ie.join(", ")}.`:"";z({title:"Restore Backup",confirmLabel:"Restore",color:"red",message:`Restore will replace all current layouts and settings with this backup (${q.length} layout(s)).${ve} Continue?`,onConfirm:async()=>{try{await Ur(ue),await N(),Ze.show({message:"Backup restored",color:"green",autoClose:2e3})}catch(fe){Ze.show({title:"Restore failed",message:fe.message,color:"red",autoClose:4e3})}}})}catch(D){Ze.show({title:"Import failed",message:D.message,color:"red",autoClose:4e3})}}if(c)return y.jsx(ms,{mih:"100dvh",children:y.jsx(Ve,{c:"red",children:c})});if(!o)return y.jsx(ms,{mih:"100dvh",children:y.jsx(Ma,{})});const{warnings:re=[],global:j=[],layouts:k=[],layout_count:V}=o;return y.jsxs(mo,{header:{height:56},children:[y.jsx(L5,{logoUrl:pC,appName:"Multiview",version:"0.4.0",githubUrl:"https://github.com/swvn-dispatch/dispatcharr-multiview",username:M4(),onLogout:e,actions:[{key:"streams",label:"Streams",icon:QM,onClick:()=>g(!0),active:S>0,count:S,variant:"default"},{key:"refresh",label:"Refresh M3U & EPG",icon:Yw,loading:f,variant:"default",onClick:()=>z({title:"Refresh M3U & EPG",confirmLabel:"Refresh",color:"blue",message:"Regenerate the M3U playlist and sync EPG data now?",onConfirm:X})},{key:"style-builder",label:"Style Builder",icon:C5,variant:"default",onClick:()=>x(!0)}],extra:y.jsxs(Nt,{shadow:"md",width:190,position:"bottom-end",children:[y.jsx(Nt.Target,{children:y.jsx(Yt,{size:"lg",variant:"default","aria-label":"More actions",children:y.jsx(A5,{size:18})})}),y.jsxs(Nt.Dropdown,{children:[y.jsx(Nt.Item,{leftSection:y.jsx(Vw,{size:14}),onClick:ee,children:"Download Backup"}),y.jsx(Nt.Item,{leftSection:y.jsx(Gw,{size:14}),onClick:()=>A.current?.click(),children:"Restore Backup"})]})]})}),y.jsx("input",{ref:A,type:"file",accept:"application/json",style:{display:"none"},onChange:ne}),y.jsx(Tn,{opened:v,onClose:()=>x(!1),title:"Style Builder",fullScreen:!0,styles:{content:{display:"flex",flexDirection:"column"},body:{flex:1,minHeight:0,display:"flex",flexDirection:"column",overflowY:"auto"}},children:y.jsx(IO,{settings:a,onFieldsReload:N})}),y.jsx(mo.Main,{children:y.jsxs(Qt,{p:"md",maw:860,mx:"auto",children:[y.jsx(P5,{fields:j,warnings:re,values:a,onSave:Ur,onOptimisticChange:B,shouldReload:bC,onReload:N,onSaved:()=>Ze.show({message:"Saved",color:"green",autoClose:1500}),onError:P=>Ze.show({title:"Save failed",message:P.message,color:"red",autoClose:4e3})}),y.jsx(Ve,{size:"xs",tt:"uppercase",fw:700,c:"dimmed",mt:"sm",children:"Layouts"}),y.jsx(l4,{sensors:I,collisionDetection:s6,onDragEnd:Y,children:y.jsx(x4,{items:M(),strategy:y4,children:k.map(({n:P,position:Z,fields:D})=>y.jsx(QO,{id:P,position:Z,fields:D,settings:a,canRemove:V>1,hasActiveStream:C.has(P),onSettingsChange:B,onFieldsReload:N,onRemove:()=>H(P),onChannelCountChange:O=>$(P,O)},P))})}),y.jsx(Dt,{variant:"default",onClick:L,children:"+ Add Layout"})]})}),y.jsx(F4,{opened:p,onClose:()=>g(!1),settings:a}),y.jsx(Xw,{action:T,onClose:()=>z(null)})]})}function WO(){const[e,o]=b.useState(z4());return e?y.jsx(KO,{onLoggedOut:()=>{A4(),o(!1)}}):y.jsx(k5,{logoUrl:pC,appName:"Multiview",description:"Sign in with your Dispatcharr credentials. The account must have permission to modify plugin settings.",onLogin:N4,onLoggedIn:()=>o(!0)})}K2.createRoot(document.getElementById("root")).render(y.jsx(b.StrictMode,{children:y.jsx($5,{children:y.jsx(WO,{})})})); +`,e.getElementsByTagName("head")[0].appendChild(r)}e.body&&dO(e.body,"react-draggable-transparent-selection")}function q1(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{I1(e)}):I1(e)}function I1(e){if(e)try{e.body&&hO(e.body,"react-draggable-transparent-selection");const o=e.selection;if(o)o.empty();else{const r=(e.defaultView||window).getSelection();r&&r.type!=="Caret"&&r.removeAllRanges()}}catch{}}function dO(e,o){e.classList?e.classList.add(o):e.className.match(new RegExp(`(?:^|\\s)${o}(?!\\S)`))||(e.className+=` ${o}`)}function hO(e,o){e.classList?e.classList.remove(o):e.className=e.className.replace(new RegExp(`(?:^|\\s)${o}(?!\\S)`,"g"),"")}function pO(e,o,r){if(!e.props.bounds)return[o,r];let{bounds:a}=e.props;a=typeof a=="string"?a:vO(a);const l=Eg(e);if(typeof a=="string"){const{ownerDocument:c}=l,u=c.defaultView;if(!u)throw new Error("Cannot resolve the owner window of the draggable node.");let f;if(a==="parent"?f=l.parentNode:f=l.getRootNode().querySelector(a),!(f instanceof u.HTMLElement))throw new Error('Bounds selector "'+a+'" could not find an element.');const h=f,p=u.getComputedStyle(l),g=u.getComputedStyle(h);a={left:-l.offsetLeft+ln(g.paddingLeft)+ln(p.marginLeft),top:-l.offsetTop+ln(g.paddingTop)+ln(p.marginTop),right:rO(h)-nO(l)-l.offsetLeft+ln(g.paddingRight)-ln(p.marginRight),bottom:oO(h)-tO(l)-l.offsetTop+ln(g.paddingBottom)-ln(p.marginBottom)}}return rs(a.right)&&(o=Math.min(o,a.right)),rs(a.bottom)&&(r=Math.min(r,a.bottom)),rs(a.left)&&(o=Math.max(o,a.left)),rs(a.top)&&(r=Math.max(r,a.top)),[o,r]}function F1(e,o,r){const a=Math.round(o/e[0])*e[0],l=Math.round(r/e[1])*e[1];return[a,l]}function mO(e){return e.props.axis==="both"||e.props.axis==="x"}function gO(e){return e.props.axis==="both"||e.props.axis==="y"}function sp(e,o,r){const a=typeof o=="number"?sO(e,o):null;if(typeof o=="number"&&!a)return null;const l=Eg(r),c=r.props.offsetParent||l.offsetParent||l.ownerDocument.body;return aO(a||e,c,r.props.scale)}function cp(e,o,r){const a=!rs(e.lastX),l=Eg(e);return a?{node:l,deltaX:0,deltaY:0,lastX:o,lastY:r,x:o,y:r}:{node:l,deltaX:o-e.lastX,deltaY:r-e.lastY,lastX:e.lastX,lastY:e.lastY,x:o,y:r}}function up(e,o){const r=e.props.scale;return{node:o.node,x:e.state.x+o.deltaX/r,y:e.state.y+o.deltaY/r,deltaX:o.deltaX/r,deltaY:o.deltaY/r,lastX:e.state.x,lastY:e.state.y}}function vO(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Eg(e){const o=e.findDOMNode();if(!o)throw new Error(": Unmounted during event!");return o}function Ro(...e){Q4.DRAGGABLE_DEBUG&&console.log(...e)}var so={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},Lr=so.mouse,ll=class extends b.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&(typeof e.button=="number"&&e.button!==0||e.ctrlKey))return!1;const o=this.findDOMNode();if(!o||!o.ownerDocument||!o.ownerDocument.body)throw new Error(" not mounted on DragStart!");const{ownerDocument:r}=o;if(this.props.disabled||!(e.target instanceof r.defaultView.Node)||this.props.handle&&!X1(e.target,this.props.handle,o)||this.props.cancel&&X1(e.target,this.props.cancel,o))return;e.type==="touchstart"&&!this.props.allowMobileScroll&&e.preventDefault();const a=cO(e);this.touchIdentifier=a;const l=sp(e,a,this);if(l==null)return;const{x:c,y:u}=l,f=cp(this,c,u);Ro("DraggableCore: handleDragStart: %j",f),Ro("calling",this.props.onStart),!(this.props.onStart(e,f)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&fO(r,this.props.nonce),this.dragging=!0,this.lastX=c,this.lastY=u,lp(r,Lr.move,this.handleDrag),lp(r,Lr.stop,this.handleDragStop))},this.handleDrag=e=>{const o=sp(e,this.touchIdentifier,this);if(o==null)return;let{x:r,y:a}=o;if(Array.isArray(this.props.grid)){let u=r-this.lastX,f=a-this.lastY;if([u,f]=F1(this.props.grid,u,f),!u&&!f)return;r=this.lastX+u,a=this.lastY+f}const l=cp(this,r,a);if(Ro("DraggableCore: handleDrag: %j",l),this.props.onDrag(e,l)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const u=document.createEvent("MouseEvents");u.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(u)}return}this.lastX=r,this.lastY=a},this.handleDragStop=e=>{if(!this.dragging)return;const o=sp(e,this.touchIdentifier,this);if(o==null)return;let{x:r,y:a}=o;if(Array.isArray(this.props.grid)){let f=r-this.lastX||0,h=a-this.lastY||0;[f,h]=F1(this.props.grid,f,h),r=this.lastX+f,a=this.lastY+h}const l=cp(this,r,a);if(this.props.onStop(e,l)===!1||this.mounted===!1)return!1;const u=this.findDOMNode();u&&this.props.enableUserSelectHack&&q1(u.ownerDocument),Ro("DraggableCore: handleDragStop: %j",l),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,u&&(Ro("DraggableCore: Removing handlers"),ga(u.ownerDocument,Lr.move,this.handleDrag),ga(u.ownerDocument,Lr.stop,this.handleDragStop))},this.onMouseDown=e=>(Lr=so.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(Lr=so.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(Lr=so.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(Lr=so.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&lp(e,so.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:o}=e;ga(o,so.mouse.move,this.handleDrag),ga(o,so.touch.move,this.handleDrag),ga(o,so.mouse.stop,this.handleDragStop),ga(o,so.touch.stop,this.handleDragStop),ga(e,so.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&q1(o)}}findDOMNode(){var e;if((e=this.props)!=null&&e.nodeRef)return this.props.nodeRef.current;const o=Sa;return typeof o.findDOMNode=="function"?o.findDOMNode(this):(Ro("react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef"),null)}render(){return b.cloneElement(b.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};ll.displayName="DraggableCore";ll.propTypes={allowAnyClick:je.bool,allowMobileScroll:je.bool,children:je.node.isRequired,disabled:je.bool,enableUserSelectHack:je.bool,offsetParent:function(e,o){if(e[o]&&e[o].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:je.arrayOf(je.number),handle:je.string,cancel:je.string,nodeRef:je.object,nonce:je.string,onStart:je.func,onDrag:je.func,onStop:je.func,onMouseDown:je.func,scale:je.number,className:Li,style:Li,transform:Li};ll.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var ff=class extends b.Component{constructor(e){super(e),this.onDragStart=(o,r)=>{if(Ro("Draggable: onDragStart: %j",r),this.props.onStart(o,up(this,r))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(o,r)=>{if(!this.state.dragging)return!1;Ro("Draggable: onDrag: %j",r);const a=up(this,r),l={x:a.x,y:a.y,slackX:0,slackY:0};if(this.props.bounds){const{x:u,y:f}=l;l.x+=this.state.slackX,l.y+=this.state.slackY;const[h,p]=pO(this,l.x,l.y);l.x=h,l.y=p,l.slackX=this.state.slackX+(u-l.x),l.slackY=this.state.slackY+(f-l.y),a.x=l.x,a.y=l.y,a.deltaX=l.x-this.state.x,a.deltaY=l.y-this.state.y}if(this.props.onDrag(o,a)===!1)return!1;this.setState(l)},this.onDragStop=(o,r)=>{if(!this.state.dragging||this.props.onStop(o,up(this,r))===!1)return!1;Ro("Draggable: onDragStop: %j",r);const l={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:u,y:f}=this.props.position;l.x=u,l.y=f}this.setState(l)},this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:e},{prevPropsPosition:o}){return e&&(!o||e.x!==o.x||e.y!==o.y)?(Ro("Draggable: getDerivedStateFromProps %j",{position:e,prevPropsPosition:o}),{x:e.x,y:e.y,prevPropsPosition:{...e}}):null}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){var e;if((e=this.props)!=null&&e.nodeRef)return this.props.nodeRef.current;const o=Sa;return typeof o.findDOMNode=="function"?o.findDOMNode(this):null}render(){const{axis:e,bounds:o,children:r,defaultPosition:a,defaultClassName:l,defaultClassNameDragging:c,defaultClassNameDragged:u,position:f,positionOffset:h,scale:p,...g}=this.props;let v={},x=null;const E=!!!f||this.state.dragging,C=f||a,R={x:mO(this)&&E?this.state.x:C.x,y:gO(this)&&E?this.state.y:C.y};this.state.isElementSVG?x=lO(R,h):v=iO(R,h);const T=b.Children.only(r),z=zt(T.props.className||"",l,{[c]:this.state.dragging,[u]:this.state.dragged});return b.createElement(ll,{...g,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},b.cloneElement(T,{className:z,style:{...T.props.style,...v},transform:x}))}};ff.displayName="Draggable";ff.propTypes={...ll.propTypes,axis:je.oneOf(["both","x","y","none"]),bounds:je.oneOfType([je.shape({left:je.number,right:je.number,top:je.number,bottom:je.number}),je.string,je.oneOf([!1])]),defaultClassName:je.string,defaultClassNameDragging:je.string,defaultClassNameDragged:je.string,defaultPosition:je.shape({x:je.number,y:je.number}),positionOffset:je.shape({x:je.oneOfType([je.number,je.string]),y:je.oneOfType([je.number,je.string])}),position:je.shape({x:je.number,y:je.number}),className:Li,style:Li,transform:Li};ff.defaultProps={...ll.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1};var yO=ff,Lt=function(){return Lt=Object.assign||function(e){for(var o,r=1,a=arguments.length;r"u"?void 0:Number(a),maxHeight:typeof l>"u"?void 0:Number(l),minWidth:typeof c>"u"?void 0:Number(c),minHeight:typeof u>"u"?void 0:Number(u)}},RO=function(e){return Array.isArray(e)?e:[e,e]},TO=["as","ref","style","className","grid","gridGap","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],J1="__resizable_base__",_O=(function(e){SO(o,e);function o(r){var a,l,c,u,f=e.call(this,r)||this;return f.ratio=1,f.resizable=null,f.parentLeft=0,f.parentTop=0,f.resizableLeft=0,f.resizableRight=0,f.resizableTop=0,f.resizableBottom=0,f.targetLeft=0,f.targetTop=0,f.delta={width:0,height:0},f.appendBase=function(){if(!f.resizable||!f.window)return null;var h=f.parentNode;if(!h)return null;var p=f.window.document.createElement("div");return p.style.width="100%",p.style.height="100%",p.style.position="absolute",p.style.transform="scale(0, 0)",p.style.left="0",p.style.flex="0 0 100%",p.classList?p.classList.add(J1):p.className+=J1,h.appendChild(p),p},f.removeBase=function(h){var p=f.parentNode;p&&p.removeChild(h)},f.state={isResizing:!1,width:(l=(a=f.propsSize)===null||a===void 0?void 0:a.width)!==null&&l!==void 0?l:"auto",height:(u=(c=f.propsSize)===null||c===void 0?void 0:c.height)!==null&&u!==void 0?u:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},f.onResizeStart=f.onResizeStart.bind(f),f.onMouseMove=f.onMouseMove.bind(f),f.onMouseUp=f.onMouseUp.bind(f),f}return Object.defineProperty(o.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||wO},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"size",{get:function(){var r=0,a=0;if(this.resizable&&this.window){var l=this.resizable.offsetWidth,c=this.resizable.offsetHeight,u=this.resizable.style.position;u!=="relative"&&(this.resizable.style.position="relative"),r=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:l,a=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:c,this.resizable.style.position=u}return{width:r,height:a}},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"sizeStyle",{get:function(){var r=this,a=this.props.size,l=function(f){var h;if(typeof r.state[f]>"u"||r.state[f]==="auto")return"auto";if(r.propsSize&&r.propsSize[f]&&(!((h=r.propsSize[f])===null||h===void 0)&&h.toString().endsWith("%"))){if(r.state[f].toString().endsWith("%"))return r.state[f].toString();var p=r.getParentSize(),g=Number(r.state[f].toString().replace("px","")),v=g/p[f]*100;return"".concat(v,"%")}return fp(r.state[f])},c=a&&typeof a.width<"u"&&!this.state.isResizing?fp(a.width):l("width"),u=a&&typeof a.height<"u"&&!this.state.isResizing?fp(a.height):l("height");return{width:c,height:u}},enumerable:!1,configurable:!0}),o.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var r=this.appendBase();if(!r)return{width:0,height:0};var a=!1,l=this.parentNode.style.flexWrap;l!=="wrap"&&(a=!0,this.parentNode.style.flexWrap="wrap"),r.style.position="relative",r.style.minWidth="100%",r.style.minHeight="100%";var c={width:r.offsetWidth,height:r.offsetHeight};return a&&(this.parentNode.style.flexWrap=l),this.removeBase(r),c},o.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},o.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},o.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var r=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:r.flexBasis!=="auto"?r.flexBasis:void 0})}},o.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},o.prototype.createSizeForCssProperty=function(r,a){var l=this.propsSize&&this.propsSize[a];return this.state[a]==="auto"&&this.state.original[a]===r&&(typeof l>"u"||l==="auto")?"auto":r},o.prototype.calculateNewMaxFromBoundary=function(r,a){var l=this.props.boundsByDirection,c=this.state.direction,u=l&&_i("left",c),f=l&&_i("top",c),h,p;if(this.props.bounds==="parent"){var g=this.parentNode;g&&(h=u?this.resizableRight-this.parentLeft:g.offsetWidth+(this.parentLeft-this.resizableLeft),p=f?this.resizableBottom-this.parentTop:g.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(h=u?this.resizableRight:this.window.innerWidth-this.resizableLeft,p=f?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(h=u?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),p=f?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return h&&Number.isFinite(h)&&(r=r&&r"u"?10:c.width,v=typeof l.width>"u"||l.width<0?r:l.width,x=typeof c.height>"u"?10:c.height,S=typeof l.height>"u"||l.height<0?a:l.height,E=h||0,C=p||0;if(f){var R=(x-E)*this.ratio+C,T=(S-E)*this.ratio+C,z=(g-C)/this.ratio+E,A=(v-C)/this.ratio+E,N=Math.max(g,R),B=Math.min(v,T),M=Math.max(x,z),$=Math.min(S,A);r=eu(r,N,B),a=eu(a,M,$)}else r=eu(r,g,v),a=eu(a,x,S);return{newWidth:r,newHeight:a}},o.prototype.setBoundingClientRect=function(){var r=1/(this.props.scale||1);if(this.props.bounds==="parent"){var a=this.parentNode;if(a){var l=a.getBoundingClientRect();this.parentLeft=l.left*r,this.parentTop=l.top*r}}if(this.props.bounds&&typeof this.props.bounds!="string"){var c=this.props.bounds.getBoundingClientRect();this.targetLeft=c.left*r,this.targetTop=c.top*r}if(this.resizable){var u=this.resizable.getBoundingClientRect(),f=u.left,h=u.top,p=u.right,g=u.bottom;this.resizableLeft=f*r,this.resizableRight=p*r,this.resizableTop=h*r,this.resizableBottom=g*r}},o.prototype.onResizeStart=function(r,a){if(!(!this.resizable||!this.window)){var l=0,c=0;if(r.nativeEvent&&CO(r.nativeEvent)?(l=r.nativeEvent.clientX,c=r.nativeEvent.clientY):r.nativeEvent&&tu(r.nativeEvent)&&(l=r.nativeEvent.touches[0].clientX,c=r.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var u=this.props.onResizeStart(r,a,this.resizable);if(u===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var f,h=this.window.getComputedStyle(this.resizable);if(h.flexBasis!=="auto"){var p=this.parentNode;if(p){var g=this.window.getComputedStyle(p).flexDirection;this.flexDir=g.startsWith("row")?"row":"column",f=h.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var v={original:{x:l,y:c,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Eo(Eo({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(r.target).cursor||"auto"}),direction:a,flexBasis:f};this.setState(v)}},o.prototype.onMouseMove=function(r){var a=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&tu(r))try{r.preventDefault(),r.stopPropagation()}catch{}var l=this.props,c=l.maxWidth,u=l.maxHeight,f=l.minWidth,h=l.minHeight,p=tu(r)?r.touches[0].clientX:r.clientX,g=tu(r)?r.touches[0].clientY:r.clientY,v=this.state,x=v.direction,S=v.original,E=v.width,C=v.height,R=this.getParentSize(),T=EO(R,this.window.innerWidth,this.window.innerHeight,c,u,f,h);c=T.maxWidth,u=T.maxHeight,f=T.minWidth,h=T.minHeight;var z=this.calculateNewSizeFromDirection(p,g),A=z.newHeight,N=z.newWidth,B=this.calculateNewMaxFromBoundary(c,u);this.props.snap&&this.props.snap.x&&(N=W1(N,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(A=W1(A,this.props.snap.y,this.props.snapGap));var M=this.calculateNewSizeFromAspectRatio(N,A,{width:B.maxWidth,height:B.maxHeight},{width:f,height:h});if(N=M.newWidth,A=M.newHeight,this.props.grid){var $=K1(N,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),L=K1(A,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),H=this.props.snapGap||0,I=H===0||Math.abs($-N)<=H?$:N,Y=H===0||Math.abs(L-A)<=H?L:A;N=I,A=Y}var X={width:N-S.width,height:A-S.height};if(this.delta=X,E&&typeof E=="string"){if(E.endsWith("%")){var ee=N/R.width*100;N="".concat(ee,"%")}else if(E.endsWith("vw")){var ne=N/this.window.innerWidth*100;N="".concat(ne,"vw")}else if(E.endsWith("vh")){var re=N/this.window.innerHeight*100;N="".concat(re,"vh")}}if(C&&typeof C=="string"){if(C.endsWith("%")){var ee=A/R.height*100;A="".concat(ee,"%")}else if(C.endsWith("vw")){var ne=A/this.window.innerWidth*100;A="".concat(ne,"vw")}else if(C.endsWith("vh")){var re=A/this.window.innerHeight*100;A="".concat(re,"vh")}}var j={width:this.createSizeForCssProperty(N,"width"),height:this.createSizeForCssProperty(A,"height")};this.flexDir==="row"?j.flexBasis=j.width:this.flexDir==="column"&&(j.flexBasis=j.height);var k=this.state.width!==j.width,V=this.state.height!==j.height,P=this.state.flexBasis!==j.flexBasis,Z=k||V||P;Z&&co.flushSync(function(){a.setState(j)}),this.props.onResize&&Z&&this.props.onResize(r,x,this.resizable,X)}},o.prototype.onMouseUp=function(r){var a,l,c=this.state,u=c.isResizing,f=c.direction;c.original,!(!u||!this.resizable)&&(this.props.onResizeStop&&this.props.onResizeStop(r,f,this.resizable,this.delta),this.props.size&&this.setState({width:(a=this.props.size.width)!==null&&a!==void 0?a:"auto",height:(l=this.props.size.height)!==null&&l!==void 0?l:"auto"}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Eo(Eo({},this.state.backgroundStyle),{cursor:"auto"})}))},o.prototype.updateSize=function(r){var a,l;this.setState({width:(a=r.width)!==null&&a!==void 0?a:"auto",height:(l=r.height)!==null&&l!==void 0?l:"auto"})},o.prototype.renderResizer=function(){var r=this,a=this.props,l=a.enable,c=a.handleStyles,u=a.handleClasses,f=a.handleWrapperStyle,h=a.handleWrapperClass,p=a.handleComponent;if(!l)return null;var g=Object.keys(l).map(function(v){return l[v]!==!1?y.jsx(xO,{direction:v,onResizeStart:r.onResizeStart,replaceStyles:c&&c[v],className:u&&u[v],children:p&&p[v]?p[v]:null},v):null});return y.jsx("div",{className:h,style:f,children:g})},o.prototype.render=function(){var r=this,a=Object.keys(this.props).reduce(function(u,f){return TO.indexOf(f)!==-1||(u[f]=r.props[f]),u},{}),l=Eo(Eo(Eo({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(l.flexBasis=this.state.flexBasis);var c=this.props.as||"div";return y.jsxs(c,Eo({style:l,className:this.props.className},a,{ref:function(u){u&&(r.resizable=u)},children:[this.state.isResizing&&y.jsx("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]}))},o.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},o})(b.PureComponent);var Yp=function(e,o){return Yp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var l in a)a.hasOwnProperty(l)&&(r[l]=a[l])},Yp(e,o)};function DO(e,o){Yp(e,o);function r(){this.constructor=e}e.prototype=o===null?Object.create(o):(r.prototype=o.prototype,new r)}var Pt=function(){return Pt=Object.assign||function(o){for(var r,a=1,l=arguments.length;a"u"?Number.MAX_SAFE_INTEGER:this.props.maxWidth,a=typeof this.props.maxHeight>"u"?Number.MAX_SAFE_INTEGER:this.props.maxHeight;return{maxWidth:r,maxHeight:a}},o.prototype.getSelfElement=function(){return this.resizable&&this.resizable.resizable},o.prototype.getOffsetHeight=function(r){var a=this.props.scale;switch(this.props.bounds){case"window":return window.innerHeight/a;case"body":return document.body.offsetHeight/a;default:return r.offsetHeight}},o.prototype.getOffsetWidth=function(r){var a=this.props.scale;switch(this.props.bounds){case"window":return window.innerWidth/a;case"body":return document.body.offsetWidth/a;default:return r.offsetWidth}},o.prototype.onDragStart=function(r,a){if(this.props.onDragStart&&this.props.onDragStart(r,a)===!1)return!1;var l=this.getDraggablePosition();if(this.originalPosition=l,!!this.props.bounds){var c=this.getParent(),u=this.props.scale,f;if(this.props.bounds==="parent")f=c;else if(this.props.bounds==="body"){var h=c.getBoundingClientRect(),p=h.left,g=h.top,v=document.body.getBoundingClientRect(),x=-(p-c.offsetLeft*u-v.left)/u,S=-(g-c.offsetTop*u-v.top)/u,E=(document.body.offsetWidth-this.resizable.size.width*u)/u+x,C=(document.body.offsetHeight-this.resizable.size.height*u)/u+S;return this.setState({bounds:{top:S,right:E,bottom:C,left:x}})}else if(this.props.bounds==="window"){if(!this.resizable)return;var R=c.getBoundingClientRect(),T=R.left,z=R.top,A=-(T-c.offsetLeft*u)/u,N=-(z-c.offsetTop*u)/u,E=(window.innerWidth-this.resizable.size.width*u)/u+A,C=(window.innerHeight-this.resizable.size.height*u)/u+N;return this.setState({bounds:{top:N,right:E,bottom:C,left:A}})}else typeof this.props.bounds=="string"?f=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(f=this.props.bounds);if(!(!(f instanceof HTMLElement)||!(c instanceof HTMLElement))){var B=f.getBoundingClientRect(),M=B.left,$=B.top,L=c.getBoundingClientRect(),H=L.left,I=L.top,Y=(M-H)/u,X=$-I;if(this.resizable){this.updateOffsetFromParent();var ee=this.offsetFromParent;this.setState({bounds:{top:X-ee.top,right:Y+(f.offsetWidth-this.resizable.size.width)-ee.left/u,bottom:X+(f.offsetHeight-this.resizable.size.height)-ee.top,left:Y-ee.left/u}})}}}},o.prototype.onDrag=function(r,a){if(this.props.onDrag){var l=this.offsetFromParent,c=l.left,u=l.top;if(!this.props.dragAxis||this.props.dragAxis==="both")return this.props.onDrag(r,Pt(Pt({},a),{x:a.x+c,y:a.y+u}));if(this.props.dragAxis==="x")return this.props.onDrag(r,Pt(Pt({},a),{x:a.x+c,y:this.originalPosition.y+u,deltaY:0}));if(this.props.dragAxis==="y")return this.props.onDrag(r,Pt(Pt({},a),{x:this.originalPosition.x+c,y:a.y+u,deltaX:0}))}},o.prototype.onDragStop=function(r,a){if(this.props.onDragStop){var l=this.offsetFromParent,c=l.left,u=l.top;if(!this.props.dragAxis||this.props.dragAxis==="both")return this.props.onDragStop(r,Pt(Pt({},a),{x:a.x+c,y:a.y+u}));if(this.props.dragAxis==="x")return this.props.onDragStop(r,Pt(Pt({},a),{x:a.x+c,y:this.originalPosition.y+u,deltaY:0}));if(this.props.dragAxis==="y")return this.props.onDragStop(r,Pt(Pt({},a),{x:this.originalPosition.x+c,y:a.y+u,deltaX:0}))}},o.prototype.onResizeStart=function(r,a,l){if(this.props.onResizeStart&&this.props.onResizeStart(r,a,l)===!1)return!1;r.stopPropagation(),this.setState({resizing:!0});var c=this.props.scale,u=this.offsetFromParent,f=this.getDraggablePosition();if(this.resizingPosition={x:f.x+u.left,y:f.y+u.top},this.originalPosition=f,this.props.bounds){var h=this.getParent(),p=void 0;this.props.bounds==="parent"?p=h:this.props.bounds==="body"?p=document.body:this.props.bounds==="window"?p=window:typeof this.props.bounds=="string"?p=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(p=this.props.bounds);var g=this.getSelfElement();if(g instanceof Element&&(p instanceof HTMLElement||p===window)&&h instanceof HTMLElement){var v=this.getMaxSizesFromProps(),x=v.maxWidth,S=v.maxHeight,E=this.getParentSize();if(x&&typeof x=="string")if(x.endsWith("%")){var C=Number(x.replace("%",""))/100;x=E.width*C}else x.endsWith("px")&&(x=Number(x.replace("px","")));if(S&&typeof S=="string")if(S.endsWith("%")){var C=Number(S.replace("%",""))/100;S=E.height*C}else S.endsWith("px")&&(S=Number(S.replace("px","")));var R=g.getBoundingClientRect(),T=R.left,z=R.top,A=this.props.bounds==="window"?{left:0,top:0}:p.getBoundingClientRect(),N=A.left,B=A.top,M=this.getOffsetWidth(p),$=this.getOffsetHeight(p),L=a.toLowerCase().endsWith("left"),H=a.toLowerCase().endsWith("right"),I=a.startsWith("top"),Y=a.startsWith("bottom");if((L||I)&&this.resizable){var X=(T-N)/c+this.resizable.size.width;this.setState({maxWidth:X>Number(x)?x:X})}if(H||this.props.lockAspectRatio&&!L&&!I){var X=M+(N-T)/c;this.setState({maxWidth:X>Number(x)?x:X})}if((I||L)&&this.resizable){var X=(z-B)/c+this.resizable.size.height;this.setState({maxHeight:X>Number(S)?S:X})}if(Y||this.props.lockAspectRatio&&!I&&!L){var X=$+(B-z)/c;this.setState({maxHeight:X>Number(S)?S:X})}}}else this.setState({maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight})},o.prototype.onResize=function(r,a,l,c){var u=this,f={x:this.originalPosition.x,y:this.originalPosition.y},h=-c.width,p=-c.height,g=["top","left","topLeft","bottomLeft","topRight"];g.includes(a)&&(a==="bottomLeft"?f.x+=h:(a==="topRight"||(f.x+=h),f.y+=p));var v=this.draggable.state;(f.x!==v.x||f.y!==v.y)&&co.flushSync(function(){u.draggable.setState(f)}),this.updateOffsetFromParent();var x=this.offsetFromParent,S=this.getDraggablePosition().x+x.left,E=this.getDraggablePosition().y+x.top;this.resizingPosition={x:S,y:E},this.props.onResize&&this.props.onResize(r,a,l,c,{x:S,y:E})},o.prototype.onResizeStop=function(r,a,l,c){this.setState({resizing:!1});var u=this.getMaxSizesFromProps(),f=u.maxWidth,h=u.maxHeight;this.setState({maxWidth:f,maxHeight:h}),this.props.onResizeStop&&this.props.onResizeStop(r,a,l,c,this.resizingPosition)},o.prototype.updateSize=function(r){this.resizable&&this.resizable.updateSize({width:r.width,height:r.height})},o.prototype.updatePosition=function(r){this.draggable.setState(r)},o.prototype.updateOffsetFromParent=function(){var r=this.props.scale,a=this.getParent(),l=this.getSelfElement();if(!a||l===null)return{top:0,left:0};var c=a.getBoundingClientRect(),u=c.left,f=c.top,h=l.getBoundingClientRect(),p=this.getDraggablePosition(),g=a.scrollLeft,v=a.scrollTop;this.offsetFromParent={left:h.left-u+g-p.x*r,top:h.top-f+v-p.y*r}},o.prototype.render=function(){var r=this,a=this.props,l=a.disableDragging,c=a.style,u=a.dragHandleClassName,f=a.position,h=a.onMouseDown,p=a.onMouseUp,g=a.dragAxis,v=a.dragGrid,x=a.bounds,S=a.enableUserSelectHack,E=a.cancel,C=a.children;a.onResizeStart,a.onResize,a.onResizeStop,a.onDragStart,a.onDrag,a.onDragStop;var R=a.resizeHandleStyles,T=a.resizeHandleClasses,z=a.resizeHandleComponent,A=a.enableResizing,N=a.resizeGrid,B=a.resizeHandleWrapperClass,M=a.resizeHandleWrapperStyle,$=a.scale,L=a.allowAnyClick,H=a.dragPositionOffset,I=NO(a,["disableDragging","style","dragHandleClassName","position","onMouseDown","onMouseUp","dragAxis","dragGrid","bounds","enableUserSelectHack","cancel","children","onResizeStart","onResize","onResizeStop","onDragStart","onDrag","onDragStop","resizeHandleStyles","resizeHandleClasses","resizeHandleComponent","enableResizing","resizeGrid","resizeHandleWrapperClass","resizeHandleWrapperStyle","scale","allowAnyClick","dragPositionOffset"]),Y=this.props.default?Pt({},this.props.default):void 0;delete I.default;var X=l||u?{cursor:"auto"}:{cursor:"move"},ee=Pt(Pt(Pt({},AO),X),c),ne=this.offsetFromParent,re=ne.left,j=ne.top,k;f&&(k={x:f.x-re,y:f.y-j});var V=this.state.resizing?void 0:k,P=this.state.resizing?"both":g;return b.createElement(yO,{ref:function(Z){Z&&(r.draggable=Z)},handle:u?".".concat(u):void 0,defaultPosition:Y,onMouseDown:h,onMouseUp:p,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,axis:P,disabled:l,grid:v,bounds:x?this.state.bounds:void 0,position:V,enableUserSelectHack:S,cancel:E,scale:$,allowAnyClick:L,nodeRef:this.resizableElement,positionOffset:H},b.createElement(_O,Pt({},I,{ref:function(Z){Z&&(r.resizable=Z,r.resizableElement.current=Z.resizable)},defaultSize:Y,size:this.props.size,enable:typeof A=="boolean"?zO(A):A,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,style:ee,minWidth:this.props.minWidth,minHeight:this.props.minHeight,maxWidth:this.state.resizing?this.state.maxWidth:this.props.maxWidth,maxHeight:this.state.resizing?this.state.maxHeight:this.props.maxHeight,grid:N,handleWrapperClass:B,handleWrapperStyle:M,lockAspectRatio:this.props.lockAspectRatio,lockAspectRatioExtraWidth:this.props.lockAspectRatioExtraWidth,lockAspectRatioExtraHeight:this.props.lockAspectRatioExtraHeight,handleStyles:R,handleClasses:T,handleComponent:z,scale:this.props.scale}),C))},o.defaultProps={maxWidth:Number.MAX_SAFE_INTEGER,maxHeight:Number.MAX_SAFE_INTEGER,scale:1,onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},onDragStart:function(){},onDrag:function(){},onDragStop:function(){}},o})(b.PureComponent);const CC=1920,EC=1080;function Di(e){const o=Math.round(e);return o-o%2}function RC(e,o,r=CC,a=EC){const{x:l,y:c,w:u,h:f,valign:h="center",halign:p="center"}=e,g=e.direction==="vertical",v=u*r,x=f*a,S=[];if(g){const E=Di(c*a),C=Di(Math.min(x/o,v*9/16)),R=C*o,T=x,z=Di(h==="top"?0:h==="bottom"?T-R:(T-R)/2),A=C/a;for(let N=0;N0?S*g/2:0,C=[];for(let R=0;R0,N=r+T*g+(A?E:0),B=a+z*v;C.push([N,B,g,v,u,f])}return C}function TC(e,o){const r=new Array(o.length).fill(0),a=o.map(u=>u.max!=null?u.max:null),l=new Set(o.map((u,f)=>f));let c=e;for(;c>0&&l.size>0;){const u=Math.floor(c/l.size);if(u===0){for(const h of[...l].sort((p,g)=>p-g).slice(0,c))r[h]+=1;break}let f=!1;for(const h of[...l]){const p=a[h],g=p!=null?p-r[h]:null,v=g!=null?Math.min(u,g):u;v>0&&(r[h]+=v,c-=v,f=!0),p!=null&&r[h]>=p&&l.delete(h)}if(!f)break}return r}function jO(e,o,r=CC,a=EC){const l=e.filter(v=>v.type==="static"),c=e.filter(v=>v.type==="row"||v.type==="grid"),u=Math.max(0,o-l.length);if(u>0&&c.length===0)return null;const f=TC(u,c),h=[];let p=0,g=0;for(const v of e){if(p>=o)break;if(v.type==="static")h.push([v.x,v.y,v.w,v.h,v.valign??"center",v.halign??"center"]),p+=1;else if(v.type==="row"||v.type==="grid"){const x=f[g];if(g+=1,x<=0)continue;h.push(...v.type==="row"?RC(v,x,r,a):OO(v,x)),p+=x}}return p({value:p,match:BO(p,r,a)})).filter(p=>p.match);if(!l.length)return{pos:e,guides:[]};const c=l.reduce((p,g)=>p.match.dist<=g.match.dist?p:g),u=c.match.target-c.value,f=e+u,h=[];for(const p of l)Math.abs(p.value+u-p.match.target)<=a&&h.push(p.match.target);return{pos:f,guides:h}}function $O(e,o,r,a=8){const{x:l,y:c,w:u,h:f}=e,h=[],p=ex(l,[l,l+u/2,l+u],o,a);for(const v of p.guides)h.push({axis:"x",pos:v});const g=ex(c,[c,c+f/2,c+f],r,a);for(const v of g.guides)h.push({axis:"y",pos:v});return{x:p.pos,y:g.pos,w:u,h:f,guides:h}}function LO({canvasW:e,canvasH:o,others:r,subdivisions:a,snapToCanvas:l,snapToElements:c}){const u=[],f=[];if(l&&(u.push(0,e/2,e),f.push(0,o/2,o)),c){for(const h of r)u.push(h.x,h.x+h.w/2,h.x+h.w),f.push(h.y,h.y+h.h/2,h.y+h.h);for(const h of a??[])h.axis==="x"?u.push(h.pos*e):f.push(h.pos*o)}return{targetsX:u,targetsY:f}}function _C(e){return new Promise((o,r)=>{const a=new FileReader;a.onload=()=>o(a.result.split(",")[1]),a.onerror=()=>r(new Error("Failed to read file")),a.readAsDataURL(e)})}const tx={static:"Static",row:"Auto Row",grid:"Auto Grid"},kO={static:{border:"1px solid var(--mantine-color-blue-5)",background:"rgba(51, 154, 240, 0.15)"},row:{border:"2px dashed var(--mantine-color-teal-5)",background:"rgba(18, 184, 134, 0.12)"},grid:{border:"2px dotted var(--mantine-color-orange-5)",background:"rgba(253, 126, 20, 0.12)"}},ou={background:"var(--mantine-color-yellow-5)",border:"1px solid rgba(0, 0, 0, 0.4)",borderRadius:"50%"},HO={topLeft:ou,topRight:ou,bottomLeft:ou,bottomRight:ou},ru=[{value:"auto",label:"Auto Grid"},{value:"featured",label:"Featured"},{value:"top_featured",label:"Top Featured"}],UO={auto:[{id:"b-grid",type:"grid",x:0,y:0,w:1,h:1,valign:"center",halign:"center"}],featured:[{id:"b-main",type:"static",x:0,y:0,w:.6,h:1,valign:"center",halign:"center"},{id:"b-side",type:"row",direction:"vertical",x:.6,y:0,w:.4,h:1,valign:"center",halign:"center"}],top_featured:[{id:"b-main",type:"static",x:0,y:0,w:1,h:.6,valign:"center",halign:"center"},{id:"b-bottom",type:"row",direction:"horizontal",x:0,y:.6,w:1,h:.4,valign:"center",halign:"center"}]},DC=4,nx=Up.map(e=>({value:e,label:e}));function ox(e,o){const r=e.filter(f=>f.type==="static"),a=e.filter(f=>f.type==="row"||f.type==="grid"),l=Math.max(0,o-r.length),c=TC(l,a),u=[];return a.forEach((f,h)=>{const p=c[h];if(p<=1)return;const g=f.x,v=f.y,x=f.x+f.w,S=f.y+f.h;if(f.type==="grid"){const M=Math.ceil(Math.sqrt(p)),$=Math.ceil(p/M);for(let L=1;LM-$),A=[...R].sort((M,$)=>M-$),N=z[0]??g,B=A[0]??v;for(const M of z)M>N+T&&u.push({axis:"x",pos:M,from:v,to:S});for(const M of A)M>B+T&&u.push({axis:"y",pos:M,from:g,to:x})}),u}function PO(){const[e,o]=b.useState(null),[r,a]=b.useState(null);return b.useEffect(()=>{if(!e)return;const l=new ResizeObserver(c=>{const{width:u,height:f}=c[0].contentRect;u>0&&f>0&&a({width:Math.round(u),height:Math.round(f)})});return l.observe(e),()=>l.disconnect()},[e]),[r,o]}function zi(e){return e<=.001?0:e>=1-.001?1:e}function rx({x:e,y:o,w:r,h:a}){return{x:zi(e),y:zi(o),w:zi(r),h:zi(a)}}function VO(e,o){const r=1.7777777777777777;let a=e,l=a/r;return l>o&&(l=o,a=l*r),{width:Math.round(a),height:Math.round(l)}}function NC({tiles:e}){return y.jsx("div",{style:{position:"relative",width:160,height:90,background:"var(--mantine-color-dark-6)",border:"1px solid var(--mantine-color-dark-4)",flexShrink:0},children:(e??[]).map((o,r)=>y.jsx("div",{style:{position:"absolute",left:`${o[0]*100}%`,top:`${o[1]*100}%`,width:`${o[2]*100}%`,height:`${o[3]*100}%`,border:"1px solid var(--mantine-color-blue-5)",background:"rgba(51, 154, 240, 0.15)",boxSizing:"border-box"}},r))})}function YO({elements:e,selectedIdx:o,onSelect:r,onElementChange:a,backgroundUrl:l,previewCountNum:c,snapToCanvas:u,snapToElements:f,canvasW:h,canvasH:p,isMobile:g,readOnly:v}){const[x,S]=b.useState([]),[E,C]=b.useState(null),R=E?e.map((B,M)=>M===E.idx?{...B,x:E.x,y:E.y,w:E.w,h:E.h}:B):e,T=ox(R,c);function z(B){return{x:B.x*h,y:B.y*p,w:B.w*h,h:B.h*p}}function A(B){return e.filter((M,$)=>$!==B).map(z)}function N(B,M){const $=ox(R.filter((I,Y)=>Y!==B),c),{targetsX:L,targetsY:H}=LO({canvasW:h,canvasH:p,others:A(B),subdivisions:$,snapToCanvas:u,snapToElements:f});return $O(M,L,H)}return y.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",background:"var(--mantine-color-dark-6)",border:"1px solid var(--mantine-color-dark-4)"},children:[l&&y.jsx("img",{src:l,alt:"",style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",pointerEvents:"none"}}),T.map((B,M)=>B.axis==="x"?y.jsx("div",{style:{position:"absolute",left:B.pos*h,top:B.from*p,width:1,height:(B.to-B.from)*p,background:"rgba(255, 255, 255, 0.3)",pointerEvents:"none"}},`sub-${M}`):y.jsx("div",{style:{position:"absolute",top:B.pos*p,left:B.from*h,height:1,width:(B.to-B.from)*h,background:"rgba(255, 255, 255, 0.3)",pointerEvents:"none"}},`sub-${M}`)),e.map((B,M)=>{const $=z(B),L=o===M;return y.jsx(MO,{bounds:"parent",size:{width:$.w,height:$.h},position:{x:$.x,y:$.y},minWidth:20,minHeight:20,lockAspectRatio:B.lockAspect?B.w*h/(B.h*p):!1,resizeHandleStyles:L&&g&&!v?HO:void 0,disableDragging:v,enableResizing:!v,onMouseDown:()=>r(M),onDrag:(H,I)=>{const Y=N(M,{x:I.x,y:I.y,w:$.w,h:$.h});S(Y.guides),C({idx:M,x:Y.x/h,y:Y.y/p,w:B.w,h:B.h})},onDragStop:(H,I)=>{const Y=N(M,{x:I.x,y:I.y,w:$.w,h:$.h});S([]),C(null),a(M,rx({x:Y.x/h,y:Y.y/p,w:B.w,h:B.h}))},onResize:(H,I,Y,X,ee)=>{const ne=N(M,{x:ee.x,y:ee.y,w:Y.offsetWidth,h:Y.offsetHeight});S(ne.guides),C({idx:M,x:ne.x/h,y:ne.y/p,w:ne.w/h,h:ne.h/p})},onResizeStop:(H,I,Y,X,ee)=>{const ne=N(M,{x:ee.x,y:ee.y,w:Y.offsetWidth,h:Y.offsetHeight});S([]),C(null),a(M,rx({x:ne.x/h,y:ne.y/p,w:ne.w/h,h:ne.h/p}))},style:{...kO[B.type],outline:L?"2px solid var(--mantine-color-yellow-5)":"none",outlineOffset:-2,display:"flex",alignItems:"center",justifyContent:"center"},children:y.jsx(Ye,{size:"xs",c:"dimmed",ta:"center",style:{userSelect:"none",pointerEvents:"none"},children:B.name||M+1})},B.id)}),x.map((B,M)=>B.axis==="x"?y.jsx("div",{style:{position:"absolute",left:B.pos,top:0,width:1,height:p,background:"var(--mantine-color-red-5)",pointerEvents:"none"}},`live-${M}`):y.jsx("div",{style:{position:"absolute",top:B.pos,left:0,height:1,width:h,background:"var(--mantine-color-red-5)",pointerEvents:"none"}},`live-${M}`))]})}function ax({style:e,styleId:o,onUpdate:r,readOnly:a=!1}){const[l,c]=b.useState(e),[u,f]=b.useState(!1);b.useEffect(()=>{c(e),f(!1)},[o]);const[h,p]=b.useState(4),[g,v]=b.useState(null),[x,S]=b.useState(null),[E,C]=b.useState(!1),[R,T]=b.useState(!1),[z,A]=b.useState(!0),[N,B]=b.useState(!0),M=b.useRef(null),[$,L]=PO(),H=Qp("(max-width: 48em)"),I=h||4,Y=l.elements??[],X=g!=null?Y[g]:null;b.useEffect(()=>{let O=!1,q=null;return l.background_image?yC(o).then(W=>{O||!W||(q=URL.createObjectURL(W),S(q))}):S(null),()=>{O=!0,q&&URL.revokeObjectURL(q)}},[o,l.background_image]);function ee(O){c(q=>({...q,elements:O})),f(!0)}async function ne(){T(!0);try{await r(l),f(!1)}finally{T(!1)}}async function re(O){const q=O.target.files?.[0];if(O.target.value="",!!q){C(!0);try{const W=await _C(q),ie=await vC(o,q.name,W);c(ue=>({...ue,background_image:ie.filename})),f(!0)}catch(W){Qe.show({title:"Upload failed",message:W.message,color:"red",autoClose:4e3})}finally{C(!1)}}}function j(){c(O=>({...O,background_image:null})),f(!0)}function k(O){const q={id:Na(),type:O,x:.1,y:.1,w:.3,h:.3,valign:"center",halign:"center"};O==="row"&&(q.direction="horizontal");const W=[...Y,q];ee(W),v(W.length-1)}function V(O){ee(Y.filter((q,W)=>W!==O)),g===O?v(null):g!=null&&g>O&&v(g-1)}function P(O){const q=Y[O],W={...q,id:Na(),x:zi(q.x+.02),y:zi(q.y+.02)},ie=[...Y.slice(0,O+1),W,...Y.slice(O+1)];ee(ie),v(O+1)}function Z(O,q){const W=O+q;if(W<0||W>=Y.length)return;const ie=[...Y];[ie[O],ie[W]]=[ie[W],ie[O]],ee(ie),g===O?v(W):g===W&&v(O)}function D(O,q){ee(Y.map((W,ie)=>ie===O?{...W,...q}:W))}return y.jsxs(Qt,{gap:"sm",style:{flex:1,minHeight:0},children:[y.jsxs(mt,{gap:"xs",align:"flex-end",wrap:"wrap",children:[y.jsx(Vi,{size:"xs",label:"Style name",value:l.name??"",onChange:O=>{c(q=>({...q,name:O.currentTarget.value})),f(!0)},placeholder:"Style name",disabled:a,style:{flex:H?"1 1 100%":"1 1 200px"}}),y.jsx(Ca,{size:"xs",label:"Preview channel count",min:2,max:9,value:h,onChange:O=>p(O||4),w:H?"100%":150}),y.jsx(Bi,{size:"xs",label:"Snap to elements",disabled:a,checked:z,onChange:O=>A(O.currentTarget.checked)}),y.jsx(Bi,{size:"xs",label:"Snap to canvas",disabled:a,checked:N,onChange:O=>B(O.currentTarget.checked)}),y.jsx(Dt,{size:"xs",leftSection:y.jsx(p5,{size:14}),disabled:a||!u,loading:R,color:u?"blue":"gray",variant:u?"filled":"default",onClick:ne,style:H?{flex:"1 1 100%"}:void 0,children:u?"Save":"Saved"})]}),y.jsxs(cg,{cols:H?2:4,spacing:"xs",children:[y.jsx(Dt,{size:"xs",variant:"default",leftSection:y.jsx(is,{size:12}),disabled:a,onClick:()=>k("static"),children:"Static Position"}),y.jsx(Dt,{size:"xs",variant:"default",leftSection:y.jsx(is,{size:12}),disabled:a,onClick:()=>k("row"),children:"Auto Row"}),y.jsx(Dt,{size:"xs",variant:"default",leftSection:y.jsx(is,{size:12}),disabled:a,onClick:()=>k("grid"),children:"Auto Grid"}),y.jsxs(mt,{gap:4,wrap:"nowrap",children:[y.jsx(Dt,{size:"xs",variant:"default",leftSection:y.jsx(R5,{size:12}),loading:E,disabled:a,onClick:()=>M.current?.click(),style:{flex:1},children:l.background_image?"Change Background":"Background Image"}),y.jsx(Yt,{size:"sm",variant:"subtle",color:"red",disabled:a||!l.background_image,onClick:j,"aria-label":"Remove background",children:y.jsx(j5,{size:14})})]}),y.jsx("input",{ref:M,type:"file",accept:"image/png,image/jpeg",style:{display:"none"},onChange:re})]}),y.jsx(Ye,{size:"xs",c:"dimmed",children:a?Y.length===0?"This style has no representable elements at this channel count.":"Click a box or list row to inspect its properties.":Y.length===0?"Add a Static Position, Auto Row, or Auto Grid to get started.":"Drag a box to move it, drag its edge/corner to resize it. Click a box or list row to select it."}),y.jsxs(mt,{align:"stretch",gap:"sm",wrap:H?"wrap":"nowrap",style:{flex:1,minHeight:0},children:[y.jsxs(Qt,{gap:6,p:"sm",w:H?"100%":260,style:{flexShrink:0,minHeight:0,overflowY:"auto",border:"1px solid var(--mantine-color-dark-4)",borderRadius:6},children:[y.jsx(Ye,{size:"xs",fw:600,children:X?X.name||tx[X.type]:"No element selected"}),y.jsx(lt,{withRowBorders:!1,verticalSpacing:4,horizontalSpacing:"xs",style:{tableLayout:"fixed",width:"100%"},children:y.jsxs(lt.Tbody,{children:[y.jsxs(lt.Tr,{children:[y.jsx(lt.Td,{w:80,children:y.jsx(Ye,{size:"xs",c:"dimmed",children:"Direction"})}),y.jsx(lt.Td,{children:y.jsx(sg,{size:"xs",fullWidth:!0,disabled:!X||a||X.type!=="row",data:[{label:"Horiz",value:"horizontal"},{label:"Vert",value:"vertical"}],value:X?.direction??"horizontal",onChange:O=>g!=null&&D(g,{direction:O})})})]}),y.jsxs(lt.Tr,{children:[y.jsx(lt.Td,{w:80,children:y.jsx(Ye,{size:"xs",c:"dimmed",children:"Max channels"})}),y.jsx(lt.Td,{children:y.jsx(Ca,{size:"xs",placeholder:"Unlimited",disabled:!X||a||!["row","grid"].includes(X.type),min:1,value:X?.max??"",onChange:O=>g!=null&&D(g,{max:O===""?null:O})})})]}),y.jsxs(lt.Tr,{children:[y.jsx(lt.Td,{w:80,children:y.jsx(Ye,{size:"xs",c:"dimmed",children:"Anchor"})}),y.jsx(lt.Td,{children:y.jsxs(mt,{grow:!0,gap:4,wrap:"nowrap",children:[y.jsx(gs,{size:"xs",placeholder:"V anchor",disabled:!X||a,data:nx,value:X?.valign??null,onChange:O=>O&&g!=null&&D(g,{valign:O})}),y.jsx(gs,{size:"xs",placeholder:"H anchor",disabled:!X||a,data:nx,value:X?.halign??null,onChange:O=>O&&g!=null&&D(g,{halign:O})})]})})]}),y.jsxs(lt.Tr,{children:[y.jsx(lt.Td,{w:80,children:y.jsx(Ye,{size:"xs",c:"dimmed",children:"Size"})}),y.jsx(lt.Td,{children:y.jsxs(mt,{grow:!0,gap:4,wrap:"nowrap",children:[y.jsx(Ca,{size:"xs",label:"Width (px)",description:"of 1920",disabled:!X||a,min:1,value:X?Math.round(X.w*1920):"",onChange:O=>{if(!O||g==null)return;const q=O/1920;if(X.lockAspect){const W=X.w*1920/(X.h*1080);D(g,{w:q,h:O/W/1080})}else D(g,{w:q})}}),y.jsx(Ca,{size:"xs",label:"Height (px)",description:"of 1080",disabled:!X||a,min:1,value:X?Math.round(X.h*1080):"",onChange:O=>{if(!O||g==null)return;const q=O/1080;if(X.lockAspect){const W=X.w*1920/(X.h*1080);D(g,{w:O*W/1920,h:q})}else D(g,{h:q})}})]})})]}),y.jsxs(lt.Tr,{children:[y.jsx(lt.Td,{w:80,children:y.jsx(Ye,{size:"xs",c:"dimmed",children:"Lock aspect"})}),y.jsx(lt.Td,{children:y.jsx(Bi,{size:"xs",disabled:!X||a,checked:!!X?.lockAspect,onChange:O=>g!=null&&D(g,{lockAspect:O.currentTarget.checked})})})]})]})})]}),y.jsx("div",{ref:L,style:H?{width:"100%",aspectRatio:"16 / 9"}:{flex:1,minWidth:0,minHeight:0,display:"flex",alignItems:"center",justifyContent:"center"},children:$&&(()=>{const O=VO($.width,$.height);return y.jsx("div",{style:{width:O.width,height:O.height},children:y.jsx(YO,{elements:Y,selectedIdx:g,onSelect:v,onElementChange:D,backgroundUrl:x,previewCountNum:I,snapToCanvas:N,snapToElements:z,canvasW:O.width,canvasH:O.height,isMobile:H,readOnly:a})})})()}),y.jsxs(Qt,{gap:6,p:"sm",w:H?"100%":220,style:{flexShrink:0,minHeight:0,overflowY:"auto",border:"1px solid var(--mantine-color-dark-4)",borderRadius:6},children:[y.jsx(Ye,{size:"xs",fw:600,c:"dimmed",children:"Elements"}),Y.map((O,q)=>y.jsxs(mt,{gap:4,wrap:"nowrap",onClick:()=>v(q),style:{cursor:"pointer",padding:4,borderRadius:4,background:g===q?"rgba(51, 154, 240, 0.18)":"transparent",borderLeft:g===q?"2px solid var(--mantine-color-blue-5)":"2px solid transparent"},children:[y.jsxs(Ye,{size:"xs",c:"dimmed",children:[q+1,"."]}),y.jsx(Vi,{size:"xs",variant:"unstyled",value:O.name??"",placeholder:tx[O.type],disabled:a,onChange:W=>D(q,{name:W.currentTarget.value}),onClick:W=>W.stopPropagation(),style:{flex:1,minWidth:0},styles:{input:{minHeight:"unset",height:"auto",padding:0}}}),y.jsx(Yt,{size:"xs",variant:"subtle",disabled:a,onClick:W=>{W.stopPropagation(),P(q)},"aria-label":"Duplicate element",children:y.jsx(d5,{size:12})}),y.jsx(Yt,{size:"xs",variant:"subtle",disabled:a||q===0,onClick:W=>{W.stopPropagation(),Z(q,-1)},children:y.jsx(t5,{size:12})}),y.jsx(Yt,{size:"xs",variant:"subtle",disabled:a||q===Y.length-1,onClick:W=>{W.stopPropagation(),Z(q,1)},children:y.jsx(JM,{size:12})}),y.jsx(Yt,{size:"xs",variant:"subtle",color:"red",disabled:a,onClick:W=>{W.stopPropagation(),V(q)},children:y.jsx(pg,{size:12})})]},O.id))]})]})]})}async function GO(e,o){const r={name:o.name,elements:o.elements??[]};if(o.background_image){const a=await yC(e);a&&(r.background_image_filename=o.background_image,r.background_image_data=await _C(a))}return r}async function ix(e){const o=Na(),r={name:e.name||"Imported Style",elements:e.elements??[]};if(e.background_image_data){const a=await vC(o,e.background_image_filename||"background.png",e.background_image_data);r.background_image=a.filename}return[o,r]}function XO(e){return e.some(r=>r.type==="row"||r.type==="grid")?DC:Math.max(e.length,1)}function qO({id:e,style:o,onOpen:r,onExport:a,onDelete:l}){const c=o.elements??[],u=jO(c,XO(c))??[];return y.jsxs(Qt,{gap:4,align:"center",style:{cursor:"pointer",flexShrink:0},onClick:()=>r(e),children:[y.jsx(NC,{tiles:u}),y.jsx(Ye,{size:"xs",children:o.name||"New Style"}),y.jsxs(mt,{gap:4,children:[y.jsx(Yt,{size:"xs",variant:"subtle",onClick:f=>{f.stopPropagation(),a(e,o)},"aria-label":"Export style",children:y.jsx(Vw,{size:12})}),y.jsx(Yt,{size:"xs",variant:"subtle",color:"red",onClick:f=>{f.stopPropagation(),l(e)},"aria-label":"Delete style",children:y.jsx(pg,{size:12})})]})]})}function IO({onClick:e}){return y.jsxs(Qt,{gap:4,align:"center",style:{cursor:"pointer",flexShrink:0},onClick:e,children:[y.jsx("div",{style:{width:160,height:90,display:"flex",alignItems:"center",justifyContent:"center",border:"1px dashed var(--mantine-color-dark-4)",color:"var(--mantine-color-dimmed)"},children:y.jsx(is,{size:24})}),y.jsx(Ye,{size:"xs",c:"dimmed",children:"New Style"})]})}function FO({settings:e,onFieldsReload:o}){const r=e.multiview_custom_layouts??{},a=e.multiview_custom_layouts_order??Object.keys(r),[l,c]=b.useState({}),[u,f]=b.useState(null),[h,p]=b.useState(null),[g,v]=b.useState(!0),x=b.useRef(null),S=Qp("(max-width: 48em)");b.useEffect(()=>{(u||h)&&S&&v(!1)},[u,h]),b.useEffect(()=>{let H=!1;return Promise.all(ru.map(I=>B4(I.value,DC).catch(()=>null))).then(I=>{if(H)return;const Y={};ru.forEach((X,ee)=>{I[ee]&&(Y[X.value]=I[ee].tiles)}),c(Y)}),()=>{H=!0}},[]);async function E(H,I){try{await Ur({multiview_custom_layouts:H,multiview_custom_layouts_order:I}),await o()}catch(Y){Qe.show({title:"Save failed",message:Y.message,color:"red",autoClose:4e3})}}async function C(){try{const H=Na();await E({...r,[H]:{name:"New Style",elements:[]}},[...a,H]),f(H)}catch(H){Qe.show({title:"Failed",message:H.message,color:"red",autoClose:4e3})}}function R(H){const I={...r};delete I[H],E(I,a.filter(Y=>Y!==H)),u===H&&f(null)}function T(H,I){return E({...r,[H]:I},a)}async function z(H,I){try{const Y=await GO(H,I);xC(Y,`multiview-style-${(I.name||"style").trim().replace(/\s+/g,"-")||"style"}.json`)}catch(Y){Qe.show({title:"Export failed",message:Y.message,color:"red",autoClose:4e3})}}async function A(H){const I=H.target.files?.[0];if(H.target.value="",!!I)try{const Y=JSON.parse(await I.text());if(!Y||typeof Y!="object"||Array.isArray(Y))throw new Error("Not a valid style file");if(Array.isArray(Y.elements)){Pp(Y);const[X,ee]=await ix(Y);await E({...r,[X]:ee},[...a,X]),Qe.show({message:`Style "${ee.name}" imported`,color:"green",autoClose:2e3})}else{const X=Object.entries(Y);X.forEach(([re,j])=>Pp(j,`style "${re}"`));const ee={},ne=[];for(const[,re]of X){const[j,k]=await ix(re);ee[j]=k,ne.push(j)}await E({...r,...ee},[...a,...ne]),Qe.show({message:`Imported ${ne.length} style(s)`,color:"green",autoClose:2e3})}}catch(Y){Qe.show({title:"Import failed",message:Y.message,color:"red",autoClose:4e3})}}const N=a.filter(H=>r[H]).map(H=>[H,r[H]]),B=u?r[u]:null,M=h?{name:h.label,elements:UO[h.value]}:null;function $(H){p(null),f(H)}function L(H){f(null),p(H)}return b.useEffect(()=>{B||M||(N.length>0?(p(null),f(N[0][0])):(f(null),p(ru[0])))},[B,M,N]),y.jsxs(Qt,{gap:"xs",style:{flex:1,minHeight:0},children:[y.jsxs(mt,{justify:"space-between",gap:"xs",children:[y.jsxs(mt,{gap:4,children:[y.jsx(Ye,{size:"xs",c:"dimmed",children:"Click a built-in to preview it, or a custom style to edit it."}),S&&y.jsx(Yt,{size:"xs",variant:"subtle",onClick:()=>v(H=>!H),"aria-label":g?"Collapse styles":"Expand styles",children:g?y.jsx(s5,{size:12}):y.jsx(Pw,{size:12})})]}),y.jsx(Dt,{size:"xs",variant:"default",leftSection:y.jsx(Gw,{size:12}),onClick:()=>x.current?.click(),children:"Import"}),y.jsx("input",{ref:x,type:"file",accept:"application/json",style:{display:"none"},onChange:A})]}),y.jsx(rm,{in:!S||g,children:y.jsxs(mt,{align:"flex-start",gap:"md",wrap:"nowrap",style:{overflowX:"auto",paddingBottom:4},children:[ru.map(H=>y.jsxs(Qt,{gap:4,align:"center",style:{flexShrink:0,cursor:"pointer"},onClick:()=>L(H),children:[y.jsx(NC,{tiles:l[H.value]}),y.jsx(Ye,{size:"xs",children:H.label})]},H.value)),N.map(([H,I])=>y.jsx(qO,{id:H,style:I,onOpen:$,onExport:z,onDelete:R},H)),y.jsx(IO,{onClick:C})]})}),B?y.jsx(ax,{style:B,styleId:u,onUpdate:H=>T(u,H)}):M?y.jsx(ax,{style:M,styleId:`builtin:${h.value}`,onUpdate:()=>{},readOnly:!0}):null]})}const Gp=/^multiview_([0-9a-f]{8})_(.+)$/;function ZO(e,o,r,a){const l=o.map(p=>{const g={id:p},v=[];for(const[x,S]of Object.entries(e)){const E=x.match(Gp);if(!E||E[1]!==p)continue;const C=E[2].match(/^channel_(\d+)$/);C?v[parseInt(C[1],10)-1]=S:g[E[2]]=S}return v.length&&(g.channels=v),g}),c={};for(const[p,g]of Object.entries(e))p==="multiview_order"||p==="multiview_count"||p==="multiview_custom_layouts"||p==="multiview_custom_layouts_order"||p==="multiview_pre_migration_backup"||p==="multiview_pre_reconcile_backup"||Gp.test(p)||(c[p]=g);const u=e.multiview_custom_layouts??{},f=e.multiview_custom_layouts_order??Object.keys(u),h={};for(const p of f)u[p]&&(h[p]=u[p]);return{global:c,layouts:l,custom_styles:h,plugin_version:r,dispatcharr_version:a}}function QO(e){const o={},r=[];for(const a of e.layouts){const l=Na();r.push(l);for(const[c,u]of Object.entries(a))c!=="id"&&(c==="channels"?u.forEach((f,h)=>{o[`multiview_${l}_channel_${h+1}`]=f}):o[`multiview_${l}_${c}`]=u)}return Object.assign(o,e.global??{}),o.multiview_order=r,o.multiview_custom_layouts=e.custom_styles??{},o.multiview_custom_layouts_order=Object.keys(e.custom_styles??{}),o}function KO({id:e,...o}){const{attributes:r,listeners:a,setNodeRef:l,transform:c,transition:u,isDragging:f}=_4({id:e}),h={transform:ys.Transform.toString(c),transition:u,opacity:f?.5:1};return y.jsx("div",{ref:l,style:h,children:y.jsx(F4,{id:e,dragHandleProps:{...r,...a},...o})})}function WO({onLoggedOut:e}){const[o,r]=b.useState(null),[a,l]=b.useState({}),[c,u]=b.useState(""),[f,h]=b.useState(!1),[p,g]=b.useState(!1),[v,x]=b.useState(!1),[S,E]=b.useState(0),[C,R]=b.useState(()=>new Set),[T,z]=b.useState(null),A=b.useRef(null),N=b.useCallback(async()=>{try{const[P,Z]=await Promise.all([O4(),Y1()]);r(P);const D=Z.settings??{},O=[...P.global??[],...(P.layouts??[]).flatMap(W=>W.fields)],q={...D};for(const W of O)!(W.id in q)&&W.default!==void 0&&(q[W.id]=W.default);l(q)}catch(P){P.status!==401&&u(P.message)}},[]);b.useEffect(()=>{N()},[N]),b.useEffect(()=>{const P=async()=>{try{const O=(await gC()).active??[];E(O.length),R(new Set(O.map(q=>q.n)))}catch{}};P();const Z=setInterval(P,5e3);return()=>clearInterval(Z)},[]),b.useEffect(()=>(V1(e),()=>V1(()=>{})),[e]);const B=b.useCallback(P=>l(Z=>({...Z,...P})),[]);function M(){return(o?.layouts??[]).map(P=>P.n)}async function $(P,Z){const D=`multiview_${P}_channel_count`,O=(a[D]??4)+Z;try{await Ur({[D]:O}),await N()}catch(q){Qe.show({title:"Failed",message:q.message,color:"red",autoClose:4e3})}}async function L(){try{const P=M(),Z=Na(),D=P.length+1,O={multiview_order:[...P,Z],[`multiview_${Z}_name`]:`Multiview ${D}`,[`multiview_${Z}_layout`]:"auto",[`multiview_${Z}_selector_type`]:"classic",[`multiview_${Z}_channel_count`]:4,[`multiview_${Z}_epg_source_mode`]:"dummy"};await Ur(O),await N(),Qe.show({message:`Layout ${D} added`,color:"green",autoClose:2e3})}catch(P){Qe.show({title:"Failed",message:P.message,color:"red",autoClose:4e3})}}async function H(P){const Z=M();if(Z.length<=1)return;const D={multiview_order:Z.filter(O=>O!==P)};for(const O of Object.keys(a))O.startsWith(`multiview_${P}_`)&&(D[O]=null);try{await Ur(D);try{await Hp(P)}catch{}await N(),Qe.show({message:"Layout removed",color:"green",autoClose:2e3})}catch(O){Qe.show({title:"Failed",message:O.message,color:"red",autoClose:4e3})}}const I=o6(n6(wg,{activationConstraint:{distance:4}}));async function Y(P){const{active:Z,over:D}=P;if(!D||Z.id===D.id)return;const O=M(),q=O.indexOf(Z.id),W=O.indexOf(D.id);if(q===-1||W===-1)return;const ie=Cg(O,q,W);try{await Ur({multiview_order:ie}),await N()}catch(ue){Qe.show({title:"Failed",message:ue.message,color:"red",autoClose:4e3})}}async function X(){h(!0);try{const P=await $4();Qe.show({message:P.message||"M3U & EPG refreshed",color:P.status==="success"?"green":"red",autoClose:3e3})}catch(P){Qe.show({title:"Refresh failed",message:P.message,color:"red",autoClose:4e3})}finally{h(!1)}}async function ee(){try{const P=await Y1(),Z=M(),D=ZO(P.settings??{},Z,P.plugin_version,P.dispatcharr_version);xC(D,`multiview-backup-${new Date().toISOString().slice(0,10)}.json`)}catch(P){Qe.show({title:"Export failed",message:P.message,color:"red",autoClose:4e3})}}async function ne(P){const Z=P.target.files?.[0];if(P.target.value="",!!Z)try{const D=JSON.parse(await Z.text());if(!D||typeof D!="object"||Array.isArray(D))throw new Error("Backup file is not a valid settings object");let O,q;if(Array.isArray(D.layouts))X4(D),O=QO(D),q=O.multiview_order;else{q4(D);const fe=Array.isArray(D.multiview_order)?D.multiview_order:[],be=Object.fromEntries(fe.map(ye=>[ye,Na()]));q=fe.map(ye=>be[ye]),O={};for(const[ye,Xe]of Object.entries(D)){if(ye==="multiview_order")continue;const Ne=ye.match(Gp);Ne&&be[Ne[1]]?O[`multiview_${be[Ne[1]]}_${Ne[2]}`]=Xe:Ne||(O[ye]=Xe)}O.multiview_order=q}let W=new Set;try{const fe=await j4();W=new Set(fe.map(be=>String(be.id)))}catch{W=new Set}const ie=[];q.forEach((fe,be)=>{const ye=O[`multiview_${fe}_name`]||`Multiview ${be+1}`,Xe=`multiview_${fe}_`;for(const Ne of Object.keys(O)){if(!Ne.startsWith(Xe))continue;const We=Ne.slice(Xe.length);if(We!=="epg_forward_channel"&&!/^channel_\d+$/.test(We))continue;const Be=O[Ne];Be&&Be!=="_none"&&W.size>0&&!W.has(String(Be))&&(O[Ne]="_none",ie.push(`${ye} (${We})`))}});const ue={};for(const fe of Object.keys(a))fe.startsWith("multiview_")&&(ue[fe]=null);Object.assign(ue,O),ue.multiview_order=q;const ve=ie.length?` ${ie.length} channel selection(s) could not be matched and were cleared (reselect manually): ${ie.join(", ")}.`:"";z({title:"Restore Backup",confirmLabel:"Restore",color:"red",message:`Restore will replace all current layouts and settings with this backup (${q.length} layout(s)).${ve} Continue?`,onConfirm:async()=>{try{await Ur(ue),await N(),Qe.show({message:"Backup restored",color:"green",autoClose:2e3})}catch(fe){Qe.show({title:"Restore failed",message:fe.message,color:"red",autoClose:4e3})}}})}catch(D){Qe.show({title:"Import failed",message:D.message,color:"red",autoClose:4e3})}}if(c)return y.jsx(ps,{mih:"100dvh",children:y.jsx(Ye,{c:"red",children:c})});if(!o)return y.jsx(ps,{mih:"100dvh",children:y.jsx(Ma,{})});const{warnings:re=[],global:j=[],layouts:k=[],layout_count:V}=o;return y.jsxs(mo,{header:{height:56},children:[y.jsx(L5,{logoUrl:pC,appName:"Multiview",version:"0.4.1",githubUrl:"https://github.com/swvn-dispatch/dispatcharr-multiview",username:M4(),onLogout:e,actions:[{key:"streams",label:"Streams",icon:QM,onClick:()=>g(!0),active:S>0,count:S,variant:"default"},{key:"refresh",label:"Refresh M3U & EPG",icon:Yw,loading:f,variant:"default",onClick:()=>z({title:"Refresh M3U & EPG",confirmLabel:"Refresh",color:"blue",message:"Regenerate the M3U playlist and sync EPG data now?",onConfirm:X})},{key:"style-builder",label:"Style Builder",icon:C5,variant:"default",onClick:()=>x(!0)}],extra:y.jsxs(Nt,{shadow:"md",width:190,position:"bottom-end",children:[y.jsx(Nt.Target,{children:y.jsx(Yt,{size:"lg",variant:"default","aria-label":"More actions",children:y.jsx(A5,{size:18})})}),y.jsxs(Nt.Dropdown,{children:[y.jsx(Nt.Item,{leftSection:y.jsx(Vw,{size:14}),onClick:ee,children:"Download Backup"}),y.jsx(Nt.Item,{leftSection:y.jsx(Gw,{size:14}),onClick:()=>A.current?.click(),children:"Restore Backup"})]})]})}),y.jsx("input",{ref:A,type:"file",accept:"application/json",style:{display:"none"},onChange:ne}),y.jsx(Tn,{opened:v,onClose:()=>x(!1),title:"Style Builder",fullScreen:!0,styles:{content:{display:"flex",flexDirection:"column"},body:{flex:1,minHeight:0,display:"flex",flexDirection:"column",overflowY:"auto"}},children:y.jsx(FO,{settings:a,onFieldsReload:N})}),y.jsx(mo.Main,{children:y.jsxs(Qt,{p:"md",maw:860,mx:"auto",children:[y.jsx(P5,{fields:j,warnings:re,values:a,onSave:Ur,onOptimisticChange:B,shouldReload:bC,onReload:N,onSaved:()=>Qe.show({message:"Saved",color:"green",autoClose:1500}),onError:P=>Qe.show({title:"Save failed",message:P.message,color:"red",autoClose:4e3})}),y.jsx(Ye,{size:"xs",tt:"uppercase",fw:700,c:"dimmed",mt:"sm",children:"Layouts"}),y.jsx(l4,{sensors:I,collisionDetection:s6,onDragEnd:Y,children:y.jsx(x4,{items:M(),strategy:y4,children:k.map(({n:P,position:Z,fields:D})=>y.jsx(KO,{id:P,position:Z,fields:D,settings:a,canRemove:V>1,hasActiveStream:C.has(P),onSettingsChange:B,onFieldsReload:N,onRemove:()=>H(P),onChannelCountChange:O=>$(P,O)},P))})}),y.jsx(Dt,{variant:"default",onClick:L,children:"+ Add Layout"})]})}),y.jsx(Z4,{opened:p,onClose:()=>g(!1),settings:a}),y.jsx(Xw,{action:T,onClose:()=>z(null)})]})}function JO(){const[e,o]=b.useState(z4());return e?y.jsx(WO,{onLoggedOut:()=>{A4(),o(!1)}}):y.jsx(k5,{logoUrl:pC,appName:"Multiview",description:"Sign in with your Dispatcharr credentials. The account must have permission to modify plugin settings.",onLogin:N4,onLoggedIn:()=>o(!0)})}K2.createRoot(document.getElementById("root")).render(y.jsx(b.StrictMode,{children:y.jsx($5,{children:y.jsx(JO,{})})})); diff --git a/plugins/multiview/dash/static/index.html b/plugins/multiview/dash/static/index.html index d0637c1..ecb8a33 100644 --- a/plugins/multiview/dash/static/index.html +++ b/plugins/multiview/dash/static/index.html @@ -10,7 +10,7 @@ Multiview - + diff --git a/plugins/multiview/epg.py b/plugins/multiview/epg.py index bafc969..f5d46a1 100644 --- a/plugins/multiview/epg.py +++ b/plugins/multiview/epg.py @@ -5,6 +5,8 @@ import os from datetime import timedelta, timezone as dt_timezone +from . import config as _mvconfig + logger = logging.getLogger(__name__) @@ -18,8 +20,10 @@ def resolve_channel_names(settings: dict, n: int) -> list: pattern = settings.get(f"multiview_{n}_regex_pattern", "") if not pattern: return [] + excluded = _mvconfig._get_multiview_channel_ids() | _mvconfig._get_streamless_channel_ids() return list( Channel.objects.filter(name__iregex=pattern) + .exclude(id__in=excluded) .order_by("channel_number")[:ch_count] .values_list("name", flat=True) ) diff --git a/plugins/multiview/plugin.json b/plugins/multiview/plugin.json index 4329a9f..7a1c3c7 100644 --- a/plugins/multiview/plugin.json +++ b/plugins/multiview/plugin.json @@ -4,7 +4,7 @@ "description": "Tile multiple Dispatcharr channel streams into multi-view outputs using FFmpeg", "author": "sethwv", - "version": "0.4.0", + "version": "0.4.1", "min_dispatcharr_version": "v0.27.0", "discord_thread": "https://discord.com/channels/1340492560220684331/1509200002407465001", diff --git a/plugins/multiview/server.py b/plugins/multiview/server.py index ced0cf3..9de0d6d 100644 --- a/plugins/multiview/server.py +++ b/plugins/multiview/server.py @@ -530,8 +530,10 @@ def _resolve_layout(self, layout_id: str): pattern = settings.get(f"multiview_{layout_id}_regex_pattern", "").strip() if not pattern: raise LookupError(f"Layout {n} is in regex mode but has no pattern configured") + excluded = _mvconfig._get_multiview_channel_ids() | _mvconfig._get_streamless_channel_ids() matched = list( Channel.objects.select_related("logo").filter(name__iregex=pattern) + .exclude(id__in=excluded) .order_by("channel_number")[:ch_count] ) for ch in matched: