@espresso-lab/mantine-data-table 1.10.7 → 1.10.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DataTable/DataTableInner.d.ts +2 -1
- package/dist/index.es.js +2368 -2366
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +8 -8
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
(function(_e,
|
|
1
|
+
(function(_e,J){typeof exports=="object"&&typeof module<"u"?J(exports,require("react"),require("@mantine/core"),require("@mantine/form"),require("@tabler/icons-react"),require("@mantine/hooks")):typeof define=="function"&&define.amd?define(["exports","react","@mantine/core","@mantine/form","@tabler/icons-react","@mantine/hooks"],J):(_e=typeof globalThis<"u"?globalThis:_e||self,J(_e.MantineDataTable={},_e.React,_e.MantineCore,_e.MantineForm,_e.TablerIconsReact,_e.MantineHooks))})(this,(function(_e,J,O,Rn,nt,Ne){"use strict";function Ws(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const Te=Ws(J);function Nn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var nr={exports:{}},Ir={};var Ln;function Us(){if(Ln)return Ir;Ln=1;var t=J.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return Ir.c=function(e){return t.H.useMemoCache(e)},Ir}var Yr={};var Bn;function qs(){return Bn||(Bn=1,process.env.NODE_ENV!=="production"&&(function(){var t=J.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;Yr.c=function(e){var r=t.H;return r===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
2
2
|
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
3
3
|
2. You might be breaking the Rules of Hooks
|
|
4
4
|
3. You might have more than one copy of React in the same app
|
|
5
|
-
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),r.useMemoCache(e)}})()),Ir}var Bn;function Vs(){return Bn||(Bn=1,process.env.NODE_ENV==="production"?rr.exports=Us():rr.exports=qs()),rr.exports}var ze=Vs(),nr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Hs={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Gs=class{#t=Hs;#e=!1;setTimeoutProvider(t){process.env.NODE_ENV!=="production"&&this.#e&&t!==this.#t&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:this.#t,provider:t}),this.#t=t,process.env.NODE_ENV!=="production"&&(this.#e=!1)}setTimeout(t,e){return process.env.NODE_ENV!=="production"&&(this.#e=!0),this.#t.setTimeout(t,e)}clearTimeout(t){this.#t.clearTimeout(t)}setInterval(t,e){return process.env.NODE_ENV!=="production"&&(this.#e=!0),this.#t.setInterval(t,e)}clearInterval(t){this.#t.clearInterval(t)}},or=new Gs;function Qs(t){setTimeout(t,0)}var Yt=typeof window>"u"||"Deno"in globalThis;function sr(){}function In(t){return typeof t=="number"&&t>=0&&t!==1/0}function Ks(t,e){return Math.max(t+(e||0)-Date.now(),0)}function zt(t,e){return typeof t=="function"?t(e):t}function Xe(t,e){return typeof t=="function"?t(e):t}function Yn(t){return JSON.stringify(t,(e,r)=>zr(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}var Zs=Object.prototype.hasOwnProperty;function Yr(t,e){if(t===e)return t;const r=zn(t)&&zn(e);if(!r&&!(zr(t)&&zr(e)))return e;const s=(r?t:Object.keys(t)).length,u=r?e:Object.keys(e),d=u.length,i=r?new Array(d):{};let m=0;for(let b=0;b<d;b++){const _=r?b:u[b],M=t[_],C=e[_];if(M===C){i[_]=M,(r?b<s:Zs.call(t,_))&&m++;continue}if(M===null||C===null||typeof M!="object"||typeof C!="object"){i[_]=C;continue}const S=Yr(M,C);i[_]=S,S===M&&m++}return s===d&&m===s?t:i}function ir(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const r in t)if(t[r]!==e[r])return!1;return!0}function zn(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function zr(t){if(!Fn(t))return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return!(!Fn(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Fn(t){return Object.prototype.toString.call(t)==="[object Object]"}function Wn(t,e,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(t,e);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Yr(t,e)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return Yr(t,e)}return e}function Un(t,e){return typeof t=="function"?t(...e):!!t}var Js=class extends nr{#t;#e;#r;constructor(){super(),this.#r=t=>{if(!Yt&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#r=t,this.#e?.(),this.#e=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#t!==t&&(this.#t=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},Xs=new Js;function qn(){let t,e;const r=new Promise((s,u)=>{t=s,e=u});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),t(s)},r.reject=s=>{n({status:"rejected",reason:s}),e(s)},r}var ei=Qs;function ti(){let t=[],e=0,r=i=>{i()},n=i=>{i()},s=ei;const u=i=>{e?t.push(i):s(()=>{r(i)})},d=()=>{const i=t;t=[],i.length&&s(()=>{n(()=>{i.forEach(m=>{r(m)})})})};return{batch:i=>{let m;e++;try{m=i()}finally{e--,e||d()}return m},batchCalls:i=>(...m)=>{u(()=>{i(...m)})},schedule:u,setNotifyFunction:i=>{r=i},setBatchNotifyFunction:i=>{n=i},setScheduler:i=>{s=i}}}var ar=ti(),ri=class extends nr{#t=!0;#e;#r;constructor(){super(),this.#r=t=>{if(!Yt&&window.addEventListener){const e=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#e||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#r=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#t!==t&&(this.#t=t,this.listeners.forEach(r=>{r(t)}))}isOnline(){return this.#t}},ni=new ri;function oi(t){return(t??"online")==="online"?ni.isOnline():!0}function si(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:oi(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}var ii=class extends nr{constructor(t,e){super(),this.options=e,this.#t=t,this.#a=null,this.#i=qn(),this.bindMethods(),this.setOptions(e)}#t;#e=void 0;#r=void 0;#n=void 0;#o;#s;#i;#a;#g;#h;#f;#u;#c;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),Vn(this.#e,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Fr(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Fr(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#w(),this.#_(),this.#e.removeObserver(this)}setOptions(t){const e=this.options,r=this.#e;if(this.options=this.#t.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Xe(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#x(),this.#e.setOptions(this.options),e._defaulted&&!ir(this.options,e)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const n=this.hasListeners();n&&Hn(this.#e,r,this.options,e)&&this.#d(),this.updateResult(),n&&(this.#e!==r||Xe(this.options.enabled,this.#e)!==Xe(e.enabled,this.#e)||zt(this.options.staleTime,this.#e)!==zt(e.staleTime,this.#e))&&this.#m();const s=this.#y();n&&(this.#e!==r||Xe(this.options.enabled,this.#e)!==Xe(e.enabled,this.#e)||s!==this.#l)&&this.#v(s)}getOptimisticResult(t){const e=this.#t.getQueryCache().build(this.#t,t),r=this.createResult(e,t);return li(this,r)&&(this.#n=r,this.#s=this.options,this.#o=this.#e.state),r}getCurrentResult(){return this.#n}trackResult(t,e){return new Proxy(t,{get:(r,n)=>(this.trackProp(n),e?.(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,n))})}trackProp(t){this.#p.add(t)}getCurrentQuery(){return this.#e}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#t.defaultQueryOptions(t),r=this.#t.getQueryCache().build(this.#t,e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return this.#d({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#d(t){this.#x();let e=this.#e.fetch(this.options,t);return t?.throwOnError||(e=e.catch(sr)),e}#m(){this.#w();const t=zt(this.options.staleTime,this.#e);if(Yt||this.#n.isStale||!In(t))return;const r=Ks(this.#n.dataUpdatedAt,t)+1;this.#u=or.setTimeout(()=>{this.#n.isStale||this.updateResult()},r)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#v(t){this.#_(),this.#l=t,!(Yt||Xe(this.options.enabled,this.#e)===!1||!In(this.#l)||this.#l===0)&&(this.#c=or.setInterval(()=>{(this.options.refetchIntervalInBackground||Xs.isFocused())&&this.#d()},this.#l))}#b(){this.#m(),this.#v(this.#y())}#w(){this.#u&&(or.clearTimeout(this.#u),this.#u=void 0)}#_(){this.#c&&(or.clearInterval(this.#c),this.#c=void 0)}createResult(t,e){const r=this.#e,n=this.options,s=this.#n,u=this.#o,d=this.#s,m=t!==r?t.state:this.#r,{state:b}=t;let _={...b},M=!1,C;if(e._optimisticResults){const te=this.hasListeners(),q=!te&&Vn(t,e),V=te&&Hn(t,r,e,n);(q||V)&&(_={..._,...si(b.data,t.options)}),e._optimisticResults==="isRestoring"&&(_.fetchStatus="idle")}let{error:S,errorUpdatedAt:k,status:j}=_;C=_.data;let N=!1;if(e.placeholderData!==void 0&&C===void 0&&j==="pending"){let te;s?.isPlaceholderData&&e.placeholderData===d?.placeholderData?(te=s.data,N=!0):te=typeof e.placeholderData=="function"?e.placeholderData(this.#f?.state.data,this.#f):e.placeholderData,te!==void 0&&(j="success",C=Wn(s?.data,te,e),M=!0)}if(e.select&&C!==void 0&&!N)if(s&&C===u?.data&&e.select===this.#g)C=this.#h;else try{this.#g=e.select,C=e.select(C),C=Wn(s?.data,C,e),this.#h=C,this.#a=null}catch(te){this.#a=te}this.#a&&(S=this.#a,C=this.#h,k=Date.now(),j="error");const F=_.fetchStatus==="fetching",B=j==="pending",Q=j==="error",U=B&&F,ne=C!==void 0,G={status:j,fetchStatus:_.fetchStatus,isPending:B,isSuccess:j==="success",isError:Q,isInitialLoading:U,isLoading:U,data:C,dataUpdatedAt:_.dataUpdatedAt,error:S,errorUpdatedAt:k,failureCount:_.fetchFailureCount,failureReason:_.fetchFailureReason,errorUpdateCount:_.errorUpdateCount,isFetched:_.dataUpdateCount>0||_.errorUpdateCount>0,isFetchedAfterMount:_.dataUpdateCount>m.dataUpdateCount||_.errorUpdateCount>m.errorUpdateCount,isFetching:F,isRefetching:F&&!B,isLoadingError:Q&&!ne,isPaused:_.fetchStatus==="paused",isPlaceholderData:M,isRefetchError:Q&&ne,isStale:Wr(t,e),refetch:this.refetch,promise:this.#i,isEnabled:Xe(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const te=ee=>{G.status==="error"?ee.reject(G.error):G.data!==void 0&&ee.resolve(G.data)},q=()=>{const ee=this.#i=G.promise=qn();te(ee)},V=this.#i;switch(V.status){case"pending":t.queryHash===r.queryHash&&te(V);break;case"fulfilled":(G.status==="error"||G.data!==V.value)&&q();break;case"rejected":(G.status!=="error"||G.error!==V.reason)&&q();break}}return G}updateResult(){const t=this.#n,e=this.createResult(this.#e,this.options);if(this.#o=this.#e.state,this.#s=this.options,this.#o.data!==void 0&&(this.#f=this.#e),ir(e,t))return;this.#n=e;const r=()=>{if(!t)return!0;const{notifyOnChangeProps:n}=this.options,s=typeof n=="function"?n():n;if(s==="all"||!s&&!this.#p.size)return!0;const u=new Set(s??this.#p);return this.options.throwOnError&&u.add("error"),Object.keys(this.#n).some(d=>{const i=d;return this.#n[i]!==t[i]&&u.has(i)})};this.#C({listeners:r()})}#x(){const t=this.#t.getQueryCache().build(this.#t,this.options);if(t===this.#e)return;const e=this.#e;this.#e=t,this.#r=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#C(t){ar.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#n)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function ai(t,e){return Xe(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Vn(t,e){return ai(t,e)||t.state.data!==void 0&&Fr(t,e,e.refetchOnMount)}function Fr(t,e,r){if(Xe(e.enabled,t)!==!1&&zt(e.staleTime,t)!=="static"){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&Wr(t,e)}return!1}function Hn(t,e,r,n){return(t!==e||Xe(n.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&Wr(t,r)}function Wr(t,e){return Xe(e.enabled,t)!==!1&&t.isStaleByTime(zt(e.staleTime,t))}function li(t,e){return!ir(t.getCurrentResult(),e)}function ui(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ci=class extends nr{#t;#e=void 0;#r;#n;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#o()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const e=this.options;this.options=this.#t.defaultMutationOptions(t),ir(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),e?.mutationKey&&this.options.mutationKey&&Yn(e.mutationKey)!==Yn(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(t){this.#o(),this.#s(t)}getCurrentResult(){return this.#e}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#o(),this.#s()}mutate(t,e){return this.#n=e,this.#r?.removeObserver(this),this.#r=this.#t.getMutationCache().build(this.#t,this.options),this.#r.addObserver(this),this.#r.execute(t)}#o(){const t=this.#r?.state??ui();this.#e={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#s(t){ar.batch(()=>{if(this.#n&&this.hasListeners()){const e=this.#e.variables,r=this.#e.context,n={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#n.onSuccess?.(t.data,e,r,n),this.#n.onSettled?.(t.data,null,e,r,n)):t?.type==="error"&&(this.#n.onError?.(t.error,e,r,n),this.#n.onSettled?.(void 0,t.error,e,r,n))}this.listeners.forEach(e=>{e(this.#e)})})}},lr={exports:{}},Ft={};var Gn;function di(){if(Gn)return Ft;Gn=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,s,u){var d=null;if(u!==void 0&&(d=""+u),s.key!==void 0&&(d=""+s.key),"key"in s){u={};for(var i in s)i!=="key"&&(u[i]=s[i])}else u=s;return s=u.ref,{$$typeof:t,type:n,key:d,ref:s!==void 0?s:null,props:u}}return Ft.Fragment=e,Ft.jsx=r,Ft.jsxs=r,Ft}var Wt={};var Qn;function hi(){return Qn||(Qn=1,process.env.NODE_ENV!=="production"&&(function(){function t(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===ee?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case N:return"Fragment";case B:return"Profiler";case F:return"StrictMode";case oe:return"Suspense";case G:return"SuspenseList";case V:return"Activity"}if(typeof a=="object")switch(typeof a.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),a.$$typeof){case j:return"Portal";case U:return a.displayName||"Context";case Q:return(a._context.displayName||"Context")+".Consumer";case ne:var v=a.render;return a=a.displayName,a||(a=v.displayName||v.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case te:return v=a.displayName||null,v!==null?v:t(a.type)||"Memo";case q:v=a._payload,a=a._init;try{return t(a(v))}catch{}}return null}function e(a){return""+a}function r(a){try{e(a);var v=!1}catch{v=!0}if(v){v=console;var D=v.error,T=typeof Symbol=="function"&&Symbol.toStringTag&&a[Symbol.toStringTag]||a.constructor.name||"Object";return D.call(v,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",T),e(a)}}function n(a){if(a===N)return"<>";if(typeof a=="object"&&a!==null&&a.$$typeof===q)return"<...>";try{var v=t(a);return v?"<"+v+">":"<...>"}catch{return"<...>"}}function s(){var a=ae.A;return a===null?null:a.getOwner()}function u(){return Error("react-stack-top-frame")}function d(a){if(re.call(a,"key")){var v=Object.getOwnPropertyDescriptor(a,"key").get;if(v&&v.isReactWarning)return!1}return a.key!==void 0}function i(a,v){function D(){w||(w=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",v))}D.isReactWarning=!0,Object.defineProperty(a,"key",{get:D,configurable:!0})}function m(){var a=t(this.type);return h[a]||(h[a]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),a=this.props.ref,a!==void 0?a:null}function b(a,v,D,T,z,Z){var K=D.ref;return a={$$typeof:k,type:a,key:v,props:D,_owner:T},(K!==void 0?K:null)!==null?Object.defineProperty(a,"ref",{enumerable:!1,get:m}):Object.defineProperty(a,"ref",{enumerable:!1,value:null}),a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(a,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(a,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:z}),Object.defineProperty(a,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Z}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a}function _(a,v,D,T,z,Z){var K=v.children;if(K!==void 0)if(T)if(P(K)){for(T=0;T<K.length;T++)M(K[T]);Object.freeze&&Object.freeze(K)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else M(K);if(re.call(v,"key")){K=t(a);var H=Object.keys(v).filter(function(se){return se!=="key"});T=0<H.length?"{key: someKey, "+H.join(": ..., ")+": ...}":"{key: someKey}",f[K+T]||(H=0<H.length?"{"+H.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
5
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),r.useMemoCache(e)}})()),Yr}var In;function Vs(){return In||(In=1,process.env.NODE_ENV==="production"?nr.exports=Us():nr.exports=qs()),nr.exports}var Fe=Vs(),or=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Hs={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Gs=class{#t=Hs;#e=!1;setTimeoutProvider(t){process.env.NODE_ENV!=="production"&&this.#e&&t!==this.#t&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:this.#t,provider:t}),this.#t=t,process.env.NODE_ENV!=="production"&&(this.#e=!1)}setTimeout(t,e){return process.env.NODE_ENV!=="production"&&(this.#e=!0),this.#t.setTimeout(t,e)}clearTimeout(t){this.#t.clearTimeout(t)}setInterval(t,e){return process.env.NODE_ENV!=="production"&&(this.#e=!0),this.#t.setInterval(t,e)}clearInterval(t){this.#t.clearInterval(t)}},sr=new Gs;function Qs(t){setTimeout(t,0)}var Yt=typeof window>"u"||"Deno"in globalThis;function ir(){}function Yn(t){return typeof t=="number"&&t>=0&&t!==1/0}function Ks(t,e){return Math.max(t+(e||0)-Date.now(),0)}function zt(t,e){return typeof t=="function"?t(e):t}function ot(t,e){return typeof t=="function"?t(e):t}function zn(t){return JSON.stringify(t,(e,r)=>Fr(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}var Zs=Object.prototype.hasOwnProperty;function zr(t,e){if(t===e)return t;const r=Fn(t)&&Fn(e);if(!r&&!(Fr(t)&&Fr(e)))return e;const s=(r?t:Object.keys(t)).length,u=r?e:Object.keys(e),d=u.length,i=r?new Array(d):{};let m=0;for(let b=0;b<d;b++){const _=r?b:u[b],M=t[_],C=e[_];if(M===C){i[_]=M,(r?b<s:Zs.call(t,_))&&m++;continue}if(M===null||C===null||typeof M!="object"||typeof C!="object"){i[_]=C;continue}const S=zr(M,C);i[_]=S,S===M&&m++}return s===d&&m===s?t:i}function ar(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const r in t)if(t[r]!==e[r])return!1;return!0}function Fn(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Fr(t){if(!Wn(t))return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return!(!Wn(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Wn(t){return Object.prototype.toString.call(t)==="[object Object]"}function Un(t,e,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(t,e);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return zr(t,e)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return zr(t,e)}return e}function qn(t,e){return typeof t=="function"?t(...e):!!t}var Js=class extends or{#t;#e;#r;constructor(){super(),this.#r=t=>{if(!Yt&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#r=t,this.#e?.(),this.#e=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#t!==t&&(this.#t=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},Xs=new Js;function Vn(){let t,e;const r=new Promise((s,u)=>{t=s,e=u});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),t(s)},r.reject=s=>{n({status:"rejected",reason:s}),e(s)},r}var ei=Qs;function ti(){let t=[],e=0,r=i=>{i()},n=i=>{i()},s=ei;const u=i=>{e?t.push(i):s(()=>{r(i)})},d=()=>{const i=t;t=[],i.length&&s(()=>{n(()=>{i.forEach(m=>{r(m)})})})};return{batch:i=>{let m;e++;try{m=i()}finally{e--,e||d()}return m},batchCalls:i=>(...m)=>{u(()=>{i(...m)})},schedule:u,setNotifyFunction:i=>{r=i},setBatchNotifyFunction:i=>{n=i},setScheduler:i=>{s=i}}}var lr=ti(),ri=class extends or{#t=!0;#e;#r;constructor(){super(),this.#r=t=>{if(!Yt&&window.addEventListener){const e=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#e||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#r=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#t!==t&&(this.#t=t,this.listeners.forEach(r=>{r(t)}))}isOnline(){return this.#t}},ni=new ri;function oi(t){return(t??"online")==="online"?ni.isOnline():!0}function si(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:oi(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}var ii=class extends or{constructor(t,e){super(),this.options=e,this.#t=t,this.#a=null,this.#i=Vn(),this.bindMethods(),this.setOptions(e)}#t;#e=void 0;#r=void 0;#n=void 0;#o;#s;#i;#a;#g;#h;#f;#u;#c;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),Hn(this.#e,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Wr(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Wr(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#w(),this.#_(),this.#e.removeObserver(this)}setOptions(t){const e=this.options,r=this.#e;if(this.options=this.#t.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ot(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#x(),this.#e.setOptions(this.options),e._defaulted&&!ar(this.options,e)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const n=this.hasListeners();n&&Gn(this.#e,r,this.options,e)&&this.#d(),this.updateResult(),n&&(this.#e!==r||ot(this.options.enabled,this.#e)!==ot(e.enabled,this.#e)||zt(this.options.staleTime,this.#e)!==zt(e.staleTime,this.#e))&&this.#m();const s=this.#y();n&&(this.#e!==r||ot(this.options.enabled,this.#e)!==ot(e.enabled,this.#e)||s!==this.#l)&&this.#v(s)}getOptimisticResult(t){const e=this.#t.getQueryCache().build(this.#t,t),r=this.createResult(e,t);return li(this,r)&&(this.#n=r,this.#s=this.options,this.#o=this.#e.state),r}getCurrentResult(){return this.#n}trackResult(t,e){return new Proxy(t,{get:(r,n)=>(this.trackProp(n),e?.(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,n))})}trackProp(t){this.#p.add(t)}getCurrentQuery(){return this.#e}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#t.defaultQueryOptions(t),r=this.#t.getQueryCache().build(this.#t,e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return this.#d({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#d(t){this.#x();let e=this.#e.fetch(this.options,t);return t?.throwOnError||(e=e.catch(ir)),e}#m(){this.#w();const t=zt(this.options.staleTime,this.#e);if(Yt||this.#n.isStale||!Yn(t))return;const r=Ks(this.#n.dataUpdatedAt,t)+1;this.#u=sr.setTimeout(()=>{this.#n.isStale||this.updateResult()},r)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#v(t){this.#_(),this.#l=t,!(Yt||ot(this.options.enabled,this.#e)===!1||!Yn(this.#l)||this.#l===0)&&(this.#c=sr.setInterval(()=>{(this.options.refetchIntervalInBackground||Xs.isFocused())&&this.#d()},this.#l))}#b(){this.#m(),this.#v(this.#y())}#w(){this.#u&&(sr.clearTimeout(this.#u),this.#u=void 0)}#_(){this.#c&&(sr.clearInterval(this.#c),this.#c=void 0)}createResult(t,e){const r=this.#e,n=this.options,s=this.#n,u=this.#o,d=this.#s,m=t!==r?t.state:this.#r,{state:b}=t;let _={...b},M=!1,C;if(e._optimisticResults){const ee=this.hasListeners(),V=!ee&&Hn(t,e),H=ee&&Gn(t,r,e,n);(V||H)&&(_={..._,...si(b.data,t.options)}),e._optimisticResults==="isRestoring"&&(_.fetchStatus="idle")}let{error:S,errorUpdatedAt:P,status:j}=_;C=_.data;let N=!1;if(e.placeholderData!==void 0&&C===void 0&&j==="pending"){let ee;s?.isPlaceholderData&&e.placeholderData===d?.placeholderData?(ee=s.data,N=!0):ee=typeof e.placeholderData=="function"?e.placeholderData(this.#f?.state.data,this.#f):e.placeholderData,ee!==void 0&&(j="success",C=Un(s?.data,ee,e),M=!0)}if(e.select&&C!==void 0&&!N)if(s&&C===u?.data&&e.select===this.#g)C=this.#h;else try{this.#g=e.select,C=e.select(C),C=Un(s?.data,C,e),this.#h=C,this.#a=null}catch(ee){this.#a=ee}this.#a&&(S=this.#a,C=this.#h,P=Date.now(),j="error");const F=_.fetchStatus==="fetching",B=j==="pending",K=j==="error",q=B&&F,te=C!==void 0,G={status:j,fetchStatus:_.fetchStatus,isPending:B,isSuccess:j==="success",isError:K,isInitialLoading:q,isLoading:q,data:C,dataUpdatedAt:_.dataUpdatedAt,error:S,errorUpdatedAt:P,failureCount:_.fetchFailureCount,failureReason:_.fetchFailureReason,errorUpdateCount:_.errorUpdateCount,isFetched:_.dataUpdateCount>0||_.errorUpdateCount>0,isFetchedAfterMount:_.dataUpdateCount>m.dataUpdateCount||_.errorUpdateCount>m.errorUpdateCount,isFetching:F,isRefetching:F&&!B,isLoadingError:K&&!te,isPaused:_.fetchStatus==="paused",isPlaceholderData:M,isRefetchError:K&&te,isStale:Ur(t,e),refetch:this.refetch,promise:this.#i,isEnabled:ot(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const ee=X=>{G.status==="error"?X.reject(G.error):G.data!==void 0&&X.resolve(G.data)},V=()=>{const X=this.#i=G.promise=Vn();ee(X)},H=this.#i;switch(H.status){case"pending":t.queryHash===r.queryHash&&ee(H);break;case"fulfilled":(G.status==="error"||G.data!==H.value)&&V();break;case"rejected":(G.status!=="error"||G.error!==H.reason)&&V();break}}return G}updateResult(){const t=this.#n,e=this.createResult(this.#e,this.options);if(this.#o=this.#e.state,this.#s=this.options,this.#o.data!==void 0&&(this.#f=this.#e),ar(e,t))return;this.#n=e;const r=()=>{if(!t)return!0;const{notifyOnChangeProps:n}=this.options,s=typeof n=="function"?n():n;if(s==="all"||!s&&!this.#p.size)return!0;const u=new Set(s??this.#p);return this.options.throwOnError&&u.add("error"),Object.keys(this.#n).some(d=>{const i=d;return this.#n[i]!==t[i]&&u.has(i)})};this.#C({listeners:r()})}#x(){const t=this.#t.getQueryCache().build(this.#t,this.options);if(t===this.#e)return;const e=this.#e;this.#e=t,this.#r=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#C(t){lr.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#n)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function ai(t,e){return ot(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Hn(t,e){return ai(t,e)||t.state.data!==void 0&&Wr(t,e,e.refetchOnMount)}function Wr(t,e,r){if(ot(e.enabled,t)!==!1&&zt(e.staleTime,t)!=="static"){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&Ur(t,e)}return!1}function Gn(t,e,r,n){return(t!==e||ot(n.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&Ur(t,r)}function Ur(t,e){return ot(e.enabled,t)!==!1&&t.isStaleByTime(zt(e.staleTime,t))}function li(t,e){return!ar(t.getCurrentResult(),e)}function ui(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ci=class extends or{#t;#e=void 0;#r;#n;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#o()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const e=this.options;this.options=this.#t.defaultMutationOptions(t),ar(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),e?.mutationKey&&this.options.mutationKey&&zn(e.mutationKey)!==zn(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(t){this.#o(),this.#s(t)}getCurrentResult(){return this.#e}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#o(),this.#s()}mutate(t,e){return this.#n=e,this.#r?.removeObserver(this),this.#r=this.#t.getMutationCache().build(this.#t,this.options),this.#r.addObserver(this),this.#r.execute(t)}#o(){const t=this.#r?.state??ui();this.#e={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#s(t){lr.batch(()=>{if(this.#n&&this.hasListeners()){const e=this.#e.variables,r=this.#e.context,n={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#n.onSuccess?.(t.data,e,r,n),this.#n.onSettled?.(t.data,null,e,r,n)):t?.type==="error"&&(this.#n.onError?.(t.error,e,r,n),this.#n.onSettled?.(void 0,t.error,e,r,n))}this.listeners.forEach(e=>{e(this.#e)})})}},ur={exports:{}},Ft={};var Qn;function di(){if(Qn)return Ft;Qn=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,s,u){var d=null;if(u!==void 0&&(d=""+u),s.key!==void 0&&(d=""+s.key),"key"in s){u={};for(var i in s)i!=="key"&&(u[i]=s[i])}else u=s;return s=u.ref,{$$typeof:t,type:n,key:d,ref:s!==void 0?s:null,props:u}}return Ft.Fragment=e,Ft.jsx=r,Ft.jsxs=r,Ft}var Wt={};var Kn;function hi(){return Kn||(Kn=1,process.env.NODE_ENV!=="production"&&(function(){function t(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===X?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case N:return"Fragment";case B:return"Profiler";case F:return"StrictMode";case ne:return"Suspense";case G:return"SuspenseList";case H:return"Activity"}if(typeof a=="object")switch(typeof a.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),a.$$typeof){case j:return"Portal";case q:return a.displayName||"Context";case K:return(a._context.displayName||"Context")+".Consumer";case te:var v=a.render;return a=a.displayName,a||(a=v.displayName||v.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case ee:return v=a.displayName||null,v!==null?v:t(a.type)||"Memo";case V:v=a._payload,a=a._init;try{return t(a(v))}catch{}}return null}function e(a){return""+a}function r(a){try{e(a);var v=!1}catch{v=!0}if(v){v=console;var D=v.error,T=typeof Symbol=="function"&&Symbol.toStringTag&&a[Symbol.toStringTag]||a.constructor.name||"Object";return D.call(v,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",T),e(a)}}function n(a){if(a===N)return"<>";if(typeof a=="object"&&a!==null&&a.$$typeof===V)return"<...>";try{var v=t(a);return v?"<"+v+">":"<...>"}catch{return"<...>"}}function s(){var a=ie.A;return a===null?null:a.getOwner()}function u(){return Error("react-stack-top-frame")}function d(a){if(re.call(a,"key")){var v=Object.getOwnPropertyDescriptor(a,"key").get;if(v&&v.isReactWarning)return!1}return a.key!==void 0}function i(a,v){function D(){w||(w=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",v))}D.isReactWarning=!0,Object.defineProperty(a,"key",{get:D,configurable:!0})}function m(){var a=t(this.type);return h[a]||(h[a]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),a=this.props.ref,a!==void 0?a:null}function b(a,v,D,T,z,Q){var Z=D.ref;return a={$$typeof:P,type:a,key:v,props:D,_owner:T},(Z!==void 0?Z:null)!==null?Object.defineProperty(a,"ref",{enumerable:!1,get:m}):Object.defineProperty(a,"ref",{enumerable:!1,value:null}),a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(a,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(a,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:z}),Object.defineProperty(a,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Q}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a}function _(a,v,D,T,z,Q){var Z=v.children;if(Z!==void 0)if(T)if(k(Z)){for(T=0;T<Z.length;T++)M(Z[T]);Object.freeze&&Object.freeze(Z)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else M(Z);if(re.call(v,"key")){Z=t(a);var U=Object.keys(v).filter(function(se){return se!=="key"});T=0<U.length?"{key: someKey, "+U.join(": ..., ")+": ...}":"{key: someKey}",f[Z+T]||(U=0<U.length?"{"+U.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
6
6
|
let props = %s;
|
|
7
7
|
<%s {...props} />
|
|
8
8
|
React keys must be passed directly to JSX without using spread:
|
|
9
9
|
let props = %s;
|
|
10
|
-
<%s key={someKey} {...props} />`,T,
|
|
10
|
+
<%s key={someKey} {...props} />`,T,Z,U,Z),f[Z+T]=!0)}if(Z=null,D!==void 0&&(r(D),Z=""+D),d(v)&&(r(v.key),Z=""+v.key),"key"in v){D={};for(var ae in v)ae!=="key"&&(D[ae]=v[ae])}else D=v;return Z&&i(D,typeof a=="function"?a.displayName||a.name||"Unknown":a),b(a,Z,D,s(),z,Q)}function M(a){C(a)?a._store&&(a._store.validated=1):typeof a=="object"&&a!==null&&a.$$typeof===V&&(a._payload.status==="fulfilled"?C(a._payload.value)&&a._payload.value._store&&(a._payload.value._store.validated=1):a._store&&(a._store.validated=1))}function C(a){return typeof a=="object"&&a!==null&&a.$$typeof===P}var S=J,P=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),F=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),K=Symbol.for("react.consumer"),q=Symbol.for("react.context"),te=Symbol.for("react.forward_ref"),ne=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),ee=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),X=Symbol.for("react.client.reference"),ie=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re=Object.prototype.hasOwnProperty,k=Array.isArray,x=console.createTask?console.createTask:function(){return null};S={react_stack_bottom_frame:function(a){return a()}};var w,h={},l=S.react_stack_bottom_frame.bind(S,u)(),p=x(n(u)),f={};Wt.Fragment=N,Wt.jsx=function(a,v,D){var T=1e4>ie.recentlyCreatedOwnerStacks++;return _(a,v,D,!1,T?Error("react-stack-top-frame"):l,T?x(n(a)):p)},Wt.jsxs=function(a,v,D){var T=1e4>ie.recentlyCreatedOwnerStacks++;return _(a,v,D,!0,T?Error("react-stack-top-frame"):l,T?x(n(a)):p)}})()),Wt}var Zn;function fi(){return Zn||(Zn=1,process.env.NODE_ENV==="production"?ur.exports=di():ur.exports=hi()),ur.exports}var y=fi(),Jn=Te.createContext(void 0),Xn=t=>{const e=Te.useContext(Jn);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},eo=({client:t,children:e})=>(Te.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),y.jsx(Jn.Provider,{value:t,children:e})),to=Te.createContext(!1),pi=()=>Te.useContext(to);to.Provider;function gi(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var mi=Te.createContext(gi()),yi=()=>Te.useContext(mi),vi=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},bi=t=>{Te.useEffect(()=>{t.clearReset()},[t])},wi=({result:t,errorResetBoundary:e,throwOnError:r,query:n,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&n&&(s&&t.data===void 0||qn(r,[t.error,n])),_i=t=>{if(t.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=t.staleTime;t.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},xi=(t,e)=>t.isLoading&&t.isFetching&&!e,Ci=(t,e)=>t?.suspense&&e.isPending,ro=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});function Si(t,e,r){if(process.env.NODE_ENV!=="production"&&(typeof t!="object"||Array.isArray(t)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=pi(),s=yi(),u=Xn(),d=u.defaultQueryOptions(t);u.getDefaultOptions().queries?._experimental_beforeQuery?.(d),process.env.NODE_ENV!=="production"&&(d.queryFn||console.error(`[${d.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),d._optimisticResults=n?"isRestoring":"optimistic",_i(d),vi(d,s),bi(s);const i=!u.getQueryCache().get(d.queryHash),[m]=Te.useState(()=>new e(u,d)),b=m.getOptimisticResult(d),_=!n&&t.subscribed!==!1;if(Te.useSyncExternalStore(Te.useCallback(M=>{const C=_?m.subscribe(lr.batchCalls(M)):ir;return m.updateResult(),C},[m,_]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),Te.useEffect(()=>{m.setOptions(d)},[d,m]),Ci(d,b))throw ro(d,m,s);if(wi({result:b,errorResetBoundary:s,throwOnError:d.throwOnError,query:u.getQueryCache().get(d.queryHash),suspense:d.suspense}))throw b.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(d,b),d.experimental_prefetchInRender&&!Yt&&xi(b,n)&&(i?ro(d,m,s):u.getQueryCache().get(d.queryHash)?.promise)?.catch(ir).finally(()=>{m.updateResult()}),d.notifyOnChangeProps?b:m.trackResult(b)}function no(t,e){return Si(t,ii)}function qr(t,e){const r=Xn(),[n]=Te.useState(()=>new ci(r,t));Te.useEffect(()=>{n.setOptions(t)},[n,t]);const s=Te.useSyncExternalStore(Te.useCallback(d=>n.subscribe(lr.batchCalls(d)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),u=Te.useCallback((d,i)=>{n.mutate(d,i).catch(ir)},[n]);if(s.error&&qn(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:u,mutateAsync:s.mutate}}var oo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Vr(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return t[n]}})}),r}var Hr={exports:{}},Ut={};var so;function Di(){if(so)return Ut;so=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,s,u){var d=null;if(u!==void 0&&(d=""+u),s.key!==void 0&&(d=""+s.key),"key"in s){u={};for(var i in s)i!=="key"&&(u[i]=s[i])}else u=s;return s=u.ref,{$$typeof:t,type:n,key:d,ref:s!==void 0?s:null,props:u}}return Ut.Fragment=e,Ut.jsx=r,Ut.jsxs=r,Ut}var cr={};var io;function ki(){return io||(io=1,process.env.NODE_ENV!=="production"&&(function(){function t(f){if(f==null)return null;if(typeof f=="function")return f.$$typeof===H?null:f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case j:return"Fragment";case F:return"Profiler";case N:return"StrictMode";case te:return"Suspense";case ne:return"SuspenseList";case V:return"Activity"}if(typeof f=="object")switch(typeof f.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),f.$$typeof){case P:return"Portal";case K:return(f.displayName||"Context")+".Provider";case B:return(f._context.displayName||"Context")+".Consumer";case q:var a=f.render;return f=f.displayName,f||(f=a.displayName||a.name||"",f=f!==""?"ForwardRef("+f+")":"ForwardRef"),f;case G:return a=f.displayName||null,a!==null?a:t(f.type)||"Memo";case ee:a=f._payload,f=f._init;try{return t(f(a))}catch{}}return null}function e(f){return""+f}function r(f){try{e(f);var a=!1}catch{a=!0}if(a){a=console;var v=a.error,D=typeof Symbol=="function"&&Symbol.toStringTag&&f[Symbol.toStringTag]||f.constructor.name||"Object";return v.call(a,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",D),e(f)}}function n(f){if(f===j)return"<>";if(typeof f=="object"&&f!==null&&f.$$typeof===ee)return"<...>";try{var a=t(f);return a?"<"+a+">":"<...>"}catch{return"<...>"}}function s(){var f=X.A;return f===null?null:f.getOwner()}function u(){return Error("react-stack-top-frame")}function d(f){if(ie.call(f,"key")){var a=Object.getOwnPropertyDescriptor(f,"key").get;if(a&&a.isReactWarning)return!1}return f.key!==void 0}function i(f,a){function v(){x||(x=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",a))}v.isReactWarning=!0,Object.defineProperty(f,"key",{get:v,configurable:!0})}function m(){var f=t(this.type);return w[f]||(w[f]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),f=this.props.ref,f!==void 0?f:null}function b(f,a,v,D,T,z,Q,Z){return v=z.ref,f={$$typeof:S,type:f,key:a,props:z,_owner:T},(v!==void 0?v:null)!==null?Object.defineProperty(f,"ref",{enumerable:!1,get:m}):Object.defineProperty(f,"ref",{enumerable:!1,value:null}),f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(f,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(f,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Q}),Object.defineProperty(f,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Z}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f}function _(f,a,v,D,T,z,Q,Z){var U=a.children;if(U!==void 0)if(D)if(re(U)){for(D=0;D<U.length;D++)M(U[D]);Object.freeze&&Object.freeze(U)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else M(U);if(ie.call(a,"key")){U=t(f);var ae=Object.keys(a).filter(function(ue){return ue!=="key"});D=0<ae.length?"{key: someKey, "+ae.join(": ..., ")+": ...}":"{key: someKey}",p[U+D]||(ae=0<ae.length?"{"+ae.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
11
11
|
let props = %s;
|
|
12
12
|
<%s {...props} />
|
|
13
13
|
React keys must be passed directly to JSX without using spread:
|
|
14
14
|
let props = %s;
|
|
15
|
-
<%s key={someKey} {...props} />`,D,
|
|
15
|
+
<%s key={someKey} {...props} />`,D,U,ae,U),p[U+D]=!0)}if(U=null,v!==void 0&&(r(v),U=""+v),d(a)&&(r(a.key),U=""+a.key),"key"in a){v={};for(var se in a)se!=="key"&&(v[se]=a[se])}else v=a;return U&&i(v,typeof f=="function"?f.displayName||f.name||"Unknown":f),b(f,U,z,T,s(),v,Q,Z)}function M(f){typeof f=="object"&&f!==null&&f.$$typeof===S&&f._store&&(f._store.validated=1)}var C=J,S=Symbol.for("react.transitional.element"),P=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),K=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),te=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),ee=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),H=Symbol.for("react.client.reference"),X=C.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie=Object.prototype.hasOwnProperty,re=Array.isArray,k=console.createTask?console.createTask:function(){return null};C={react_stack_bottom_frame:function(f){return f()}};var x,w={},h=C.react_stack_bottom_frame.bind(C,u)(),l=k(n(u)),p={};cr.Fragment=j,cr.jsx=function(f,a,v,D,T){var z=1e4>X.recentlyCreatedOwnerStacks++;return _(f,a,v,!1,D,T,z?Error("react-stack-top-frame"):h,z?k(n(f)):l)},cr.jsxs=function(f,a,v,D,T){var z=1e4>X.recentlyCreatedOwnerStacks++;return _(f,a,v,!0,D,T,z?Error("react-stack-top-frame"):h,z?k(n(f)):l)}})()),cr}var ao;function Pi(){return ao||(ao=1,process.env.NODE_ENV==="production"?Hr.exports=Di():Hr.exports=ki()),Hr.exports}Pi();var Gr={exports:{}},Qr={};var lo;function Mi(){if(lo)return Qr;lo=1;var t=J.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return Qr.c=function(e){return t.H.useMemoCache(e)},Qr}var uo={};var co;function Oi(){return co||(co=1,process.env.NODE_ENV!=="production"&&(function(){var t=J.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;uo.c=function(e){var r=t.H;return r===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
16
16
|
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
17
17
|
2. You might be breaking the Rules of Hooks
|
|
18
18
|
3. You might have more than one copy of React in the same app
|
|
19
|
-
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),r.useMemoCache(e)}})()),lo}var co;function ji(){return co||(co=1,process.env.NODE_ENV==="production"?Hr.exports=Mi():Hr.exports=Oi()),Hr.exports}ji();var ho={},qt={},fo;function Ai(){if(fo)return qt;fo=1,qt.byteLength=i,qt.toByteArray=b,qt.fromByteArray=C;for(var t=[],e=[],r=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=n.length;s<u;++s)t[s]=n[s],e[n.charCodeAt(s)]=s;e[45]=62,e[95]=63;function d(S){var k=S.length;if(k%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var j=S.indexOf("=");j===-1&&(j=k);var N=j===k?0:4-j%4;return[j,N]}function i(S){var k=d(S),j=k[0],N=k[1];return(j+N)*3/4-N}function m(S,k,j){return(k+j)*3/4-j}function b(S){var k,j=d(S),N=j[0],F=j[1],B=new r(m(S,N,F)),Q=0,U=F>0?N-4:N,ne;for(ne=0;ne<U;ne+=4)k=e[S.charCodeAt(ne)]<<18|e[S.charCodeAt(ne+1)]<<12|e[S.charCodeAt(ne+2)]<<6|e[S.charCodeAt(ne+3)],B[Q++]=k>>16&255,B[Q++]=k>>8&255,B[Q++]=k&255;return F===2&&(k=e[S.charCodeAt(ne)]<<2|e[S.charCodeAt(ne+1)]>>4,B[Q++]=k&255),F===1&&(k=e[S.charCodeAt(ne)]<<10|e[S.charCodeAt(ne+1)]<<4|e[S.charCodeAt(ne+2)]>>2,B[Q++]=k>>8&255,B[Q++]=k&255),B}function _(S){return t[S>>18&63]+t[S>>12&63]+t[S>>6&63]+t[S&63]}function M(S,k,j){for(var N,F=[],B=k;B<j;B+=3)N=(S[B]<<16&16711680)+(S[B+1]<<8&65280)+(S[B+2]&255),F.push(_(N));return F.join("")}function C(S){for(var k,j=S.length,N=j%3,F=[],B=16383,Q=0,U=j-N;Q<U;Q+=B)F.push(M(S,Q,Q+B>U?U:Q+B));return N===1?(k=S[j-1],F.push(t[k>>2]+t[k<<4&63]+"==")):N===2&&(k=(S[j-2]<<8)+S[j-1],F.push(t[k>>10]+t[k>>4&63]+t[k<<2&63]+"=")),F.join("")}return qt}var Qr={};var po;function Ei(){return po||(po=1,Qr.read=function(t,e,r,n,s){var u,d,i=s*8-n-1,m=(1<<i)-1,b=m>>1,_=-7,M=r?s-1:0,C=r?-1:1,S=t[e+M];for(M+=C,u=S&(1<<-_)-1,S>>=-_,_+=i;_>0;u=u*256+t[e+M],M+=C,_-=8);for(d=u&(1<<-_)-1,u>>=-_,_+=n;_>0;d=d*256+t[e+M],M+=C,_-=8);if(u===0)u=1-b;else{if(u===m)return d?NaN:(S?-1:1)*(1/0);d=d+Math.pow(2,n),u=u-b}return(S?-1:1)*d*Math.pow(2,u-n)},Qr.write=function(t,e,r,n,s,u){var d,i,m,b=u*8-s-1,_=(1<<b)-1,M=_>>1,C=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=n?0:u-1,k=n?1:-1,j=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(i=isNaN(e)?1:0,d=_):(d=Math.floor(Math.log(e)/Math.LN2),e*(m=Math.pow(2,-d))<1&&(d--,m*=2),d+M>=1?e+=C/m:e+=C*Math.pow(2,1-M),e*m>=2&&(d++,m/=2),d+M>=_?(i=0,d=_):d+M>=1?(i=(e*m-1)*Math.pow(2,s),d=d+M):(i=e*Math.pow(2,M-1)*Math.pow(2,s),d=0));s>=8;t[r+S]=i&255,S+=k,i/=256,s-=8);for(d=d<<s|i,b+=s;b>0;t[r+S]=d&255,S+=k,d/=256,b-=8);t[r+S-k]|=j*128}),Qr}var Kr,go;function Ti(){if(go)return Kr;go=1;var t={}.toString;return Kr=Array.isArray||function(e){return t.call(e)=="[object Array]"},Kr}var mo;function $i(){return mo||(mo=1,(function(t){var e=Ai(),r=Ei(),n=Ti();t.Buffer=i,t.SlowBuffer=F,t.INSPECT_MAX_BYTES=50,i.TYPED_ARRAY_SUPPORT=no.TYPED_ARRAY_SUPPORT!==void 0?no.TYPED_ARRAY_SUPPORT:s(),t.kMaxLength=u();function s(){try{var o=new Uint8Array(1);return o.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},o.foo()===42&&typeof o.subarray=="function"&&o.subarray(1,1).byteLength===0}catch{return!1}}function u(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function d(o,c){if(u()<c)throw new RangeError("Invalid typed array length");return i.TYPED_ARRAY_SUPPORT?(o=new Uint8Array(c),o.__proto__=i.prototype):(o===null&&(o=new i(c)),o.length=c),o}function i(o,c,g){if(!i.TYPED_ARRAY_SUPPORT&&!(this instanceof i))return new i(o,c,g);if(typeof o=="number"){if(typeof c=="string")throw new Error("If encoding is specified then the first argument must be a string");return M(this,o)}return m(this,o,c,g)}i.poolSize=8192,i._augment=function(o){return o.__proto__=i.prototype,o};function m(o,c,g,A){if(typeof c=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&c instanceof ArrayBuffer?k(o,c,g,A):typeof c=="string"?C(o,c,g):j(o,c)}i.from=function(o,c,g){return m(null,o,c,g)},i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0}));function b(o){if(typeof o!="number")throw new TypeError('"size" argument must be a number');if(o<0)throw new RangeError('"size" argument must not be negative')}function _(o,c,g,A){return b(c),c<=0?d(o,c):g!==void 0?typeof A=="string"?d(o,c).fill(g,A):d(o,c).fill(g):d(o,c)}i.alloc=function(o,c,g){return _(null,o,c,g)};function M(o,c){if(b(c),o=d(o,c<0?0:N(c)|0),!i.TYPED_ARRAY_SUPPORT)for(var g=0;g<c;++g)o[g]=0;return o}i.allocUnsafe=function(o){return M(null,o)},i.allocUnsafeSlow=function(o){return M(null,o)};function C(o,c,g){if((typeof g!="string"||g==="")&&(g="utf8"),!i.isEncoding(g))throw new TypeError('"encoding" must be a valid string encoding');var A=B(c,g)|0;o=d(o,A);var R=o.write(c,g);return R!==A&&(o=o.slice(0,R)),o}function S(o,c){var g=c.length<0?0:N(c.length)|0;o=d(o,g);for(var A=0;A<g;A+=1)o[A]=c[A]&255;return o}function k(o,c,g,A){if(c.byteLength,g<0||c.byteLength<g)throw new RangeError("'offset' is out of bounds");if(c.byteLength<g+(A||0))throw new RangeError("'length' is out of bounds");return g===void 0&&A===void 0?c=new Uint8Array(c):A===void 0?c=new Uint8Array(c,g):c=new Uint8Array(c,g,A),i.TYPED_ARRAY_SUPPORT?(o=c,o.__proto__=i.prototype):o=S(o,c),o}function j(o,c){if(i.isBuffer(c)){var g=N(c.length)|0;return o=d(o,g),o.length===0||c.copy(o,0,0,g),o}if(c){if(typeof ArrayBuffer<"u"&&c.buffer instanceof ArrayBuffer||"length"in c)return typeof c.length!="number"||ce(c.length)?d(o,0):S(o,c);if(c.type==="Buffer"&&n(c.data))return S(o,c.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function N(o){if(o>=u())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u().toString(16)+" bytes");return o|0}function F(o){return+o!=o&&(o=0),i.alloc(+o)}i.isBuffer=function(o){return!!(o!=null&&o._isBuffer)},i.compare=function(o,c){if(!i.isBuffer(o)||!i.isBuffer(c))throw new TypeError("Arguments must be Buffers");if(o===c)return 0;for(var g=o.length,A=c.length,R=0,W=Math.min(g,A);R<W;++R)if(o[R]!==c[R]){g=o[R],A=c[R];break}return g<A?-1:A<g?1:0},i.isEncoding=function(o){switch(String(o).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(o,c){if(!n(o))throw new TypeError('"list" argument must be an Array of Buffers');if(o.length===0)return i.alloc(0);var g;if(c===void 0)for(c=0,g=0;g<o.length;++g)c+=o[g].length;var A=i.allocUnsafe(c),R=0;for(g=0;g<o.length;++g){var W=o[g];if(!i.isBuffer(W))throw new TypeError('"list" argument must be an Array of Buffers');W.copy(A,R),R+=W.length}return A};function B(o,c){if(i.isBuffer(o))return o.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(o)||o instanceof ArrayBuffer))return o.byteLength;typeof o!="string"&&(o=""+o);var g=o.length;if(g===0)return 0;for(var A=!1;;)switch(c){case"ascii":case"latin1":case"binary":return g;case"utf8":case"utf-8":case void 0:return E(o).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g*2;case"hex":return g>>>1;case"base64":return Y(o).length;default:if(A)return E(o).length;c=(""+c).toLowerCase(),A=!0}}i.byteLength=B;function Q(o,c,g){var A=!1;if((c===void 0||c<0)&&(c=0),c>this.length||((g===void 0||g>this.length)&&(g=this.length),g<=0)||(g>>>=0,c>>>=0,g<=c))return"";for(o||(o="utf8");;)switch(o){case"hex":return p(this,c,g);case"utf8":case"utf-8":return P(this,c,g);case"ascii":return h(this,c,g);case"latin1":case"binary":return l(this,c,g);case"base64":return re(this,c,g);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f(this,c,g);default:if(A)throw new TypeError("Unknown encoding: "+o);o=(o+"").toLowerCase(),A=!0}}i.prototype._isBuffer=!0;function U(o,c,g){var A=o[c];o[c]=o[g],o[g]=A}i.prototype.swap16=function(){var o=this.length;if(o%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var c=0;c<o;c+=2)U(this,c,c+1);return this},i.prototype.swap32=function(){var o=this.length;if(o%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var c=0;c<o;c+=4)U(this,c,c+3),U(this,c+1,c+2);return this},i.prototype.swap64=function(){var o=this.length;if(o%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var c=0;c<o;c+=8)U(this,c,c+7),U(this,c+1,c+6),U(this,c+2,c+5),U(this,c+3,c+4);return this},i.prototype.toString=function(){var o=this.length|0;return o===0?"":arguments.length===0?P(this,0,o):Q.apply(this,arguments)},i.prototype.equals=function(o){if(!i.isBuffer(o))throw new TypeError("Argument must be a Buffer");return this===o?!0:i.compare(this,o)===0},i.prototype.inspect=function(){var o="",c=t.INSPECT_MAX_BYTES;return this.length>0&&(o=this.toString("hex",0,c).match(/.{2}/g).join(" "),this.length>c&&(o+=" ... ")),"<Buffer "+o+">"},i.prototype.compare=function(o,c,g,A,R){if(!i.isBuffer(o))throw new TypeError("Argument must be a Buffer");if(c===void 0&&(c=0),g===void 0&&(g=o?o.length:0),A===void 0&&(A=0),R===void 0&&(R=this.length),c<0||g>o.length||A<0||R>this.length)throw new RangeError("out of range index");if(A>=R&&c>=g)return 0;if(A>=R)return-1;if(c>=g)return 1;if(c>>>=0,g>>>=0,A>>>=0,R>>>=0,this===o)return 0;for(var W=R-A,le=g-c,fe=Math.min(W,le),pe=this.slice(A,R),J=o.slice(c,g),he=0;he<fe;++he)if(pe[he]!==J[he]){W=pe[he],le=J[he];break}return W<le?-1:le<W?1:0};function ne(o,c,g,A,R){if(o.length===0)return-1;if(typeof g=="string"?(A=g,g=0):g>2147483647?g=2147483647:g<-2147483648&&(g=-2147483648),g=+g,isNaN(g)&&(g=R?0:o.length-1),g<0&&(g=o.length+g),g>=o.length){if(R)return-1;g=o.length-1}else if(g<0)if(R)g=0;else return-1;if(typeof c=="string"&&(c=i.from(c,A)),i.isBuffer(c))return c.length===0?-1:oe(o,c,g,A,R);if(typeof c=="number")return c=c&255,i.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?R?Uint8Array.prototype.indexOf.call(o,c,g):Uint8Array.prototype.lastIndexOf.call(o,c,g):oe(o,[c],g,A,R);throw new TypeError("val must be string, number or Buffer")}function oe(o,c,g,A,R){var W=1,le=o.length,fe=c.length;if(A!==void 0&&(A=String(A).toLowerCase(),A==="ucs2"||A==="ucs-2"||A==="utf16le"||A==="utf-16le")){if(o.length<2||c.length<2)return-1;W=2,le/=2,fe/=2,g/=2}function pe(Se,Ce){return W===1?Se[Ce]:Se.readUInt16BE(Ce*W)}var J;if(R){var he=-1;for(J=g;J<le;J++)if(pe(o,J)===pe(c,he===-1?0:J-he)){if(he===-1&&(he=J),J-he+1===fe)return he*W}else he!==-1&&(J-=J-he),he=-1}else for(g+fe>le&&(g=le-fe),J=g;J>=0;J--){for(var me=!0,ge=0;ge<fe;ge++)if(pe(o,J+ge)!==pe(c,ge)){me=!1;break}if(me)return J}return-1}i.prototype.includes=function(o,c,g){return this.indexOf(o,c,g)!==-1},i.prototype.indexOf=function(o,c,g){return ne(this,o,c,g,!0)},i.prototype.lastIndexOf=function(o,c,g){return ne(this,o,c,g,!1)};function G(o,c,g,A){g=Number(g)||0;var R=o.length-g;A?(A=Number(A),A>R&&(A=R)):A=R;var W=c.length;if(W%2!==0)throw new TypeError("Invalid hex string");A>W/2&&(A=W/2);for(var le=0;le<A;++le){var fe=parseInt(c.substr(le*2,2),16);if(isNaN(fe))return le;o[g+le]=fe}return le}function te(o,c,g,A){return I(E(c,o.length-g),o,g,A)}function q(o,c,g,A){return I(L(c),o,g,A)}function V(o,c,g,A){return q(o,c,g,A)}function ee(o,c,g,A){return I(Y(c),o,g,A)}function ae(o,c,g,A){return I($(c,o.length-g),o,g,A)}i.prototype.write=function(o,c,g,A){if(c===void 0)A="utf8",g=this.length,c=0;else if(g===void 0&&typeof c=="string")A=c,g=this.length,c=0;else if(isFinite(c))c=c|0,isFinite(g)?(g=g|0,A===void 0&&(A="utf8")):(A=g,g=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var R=this.length-c;if((g===void 0||g>R)&&(g=R),o.length>0&&(g<0||c<0)||c>this.length)throw new RangeError("Attempt to write outside buffer bounds");A||(A="utf8");for(var W=!1;;)switch(A){case"hex":return G(this,o,c,g);case"utf8":case"utf-8":return te(this,o,c,g);case"ascii":return q(this,o,c,g);case"latin1":case"binary":return V(this,o,c,g);case"base64":return ee(this,o,c,g);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,o,c,g);default:if(W)throw new TypeError("Unknown encoding: "+A);A=(""+A).toLowerCase(),W=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function re(o,c,g){return c===0&&g===o.length?e.fromByteArray(o):e.fromByteArray(o.slice(c,g))}function P(o,c,g){g=Math.min(o.length,g);for(var A=[],R=c;R<g;){var W=o[R],le=null,fe=W>239?4:W>223?3:W>191?2:1;if(R+fe<=g){var pe,J,he,me;switch(fe){case 1:W<128&&(le=W);break;case 2:pe=o[R+1],(pe&192)===128&&(me=(W&31)<<6|pe&63,me>127&&(le=me));break;case 3:pe=o[R+1],J=o[R+2],(pe&192)===128&&(J&192)===128&&(me=(W&15)<<12|(pe&63)<<6|J&63,me>2047&&(me<55296||me>57343)&&(le=me));break;case 4:pe=o[R+1],J=o[R+2],he=o[R+3],(pe&192)===128&&(J&192)===128&&(he&192)===128&&(me=(W&15)<<18|(pe&63)<<12|(J&63)<<6|he&63,me>65535&&me<1114112&&(le=me))}}le===null?(le=65533,fe=1):le>65535&&(le-=65536,A.push(le>>>10&1023|55296),le=56320|le&1023),A.push(le),R+=fe}return w(A)}var x=4096;function w(o){var c=o.length;if(c<=x)return String.fromCharCode.apply(String,o);for(var g="",A=0;A<c;)g+=String.fromCharCode.apply(String,o.slice(A,A+=x));return g}function h(o,c,g){var A="";g=Math.min(o.length,g);for(var R=c;R<g;++R)A+=String.fromCharCode(o[R]&127);return A}function l(o,c,g){var A="";g=Math.min(o.length,g);for(var R=c;R<g;++R)A+=String.fromCharCode(o[R]);return A}function p(o,c,g){var A=o.length;(!c||c<0)&&(c=0),(!g||g<0||g>A)&&(g=A);for(var R="",W=c;W<g;++W)R+=ue(o[W]);return R}function f(o,c,g){for(var A=o.slice(c,g),R="",W=0;W<A.length;W+=2)R+=String.fromCharCode(A[W]+A[W+1]*256);return R}i.prototype.slice=function(o,c){var g=this.length;o=~~o,c=c===void 0?g:~~c,o<0?(o+=g,o<0&&(o=0)):o>g&&(o=g),c<0?(c+=g,c<0&&(c=0)):c>g&&(c=g),c<o&&(c=o);var A;if(i.TYPED_ARRAY_SUPPORT)A=this.subarray(o,c),A.__proto__=i.prototype;else{var R=c-o;A=new i(R,void 0);for(var W=0;W<R;++W)A[W]=this[W+o]}return A};function a(o,c,g){if(o%1!==0||o<0)throw new RangeError("offset is not uint");if(o+c>g)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUIntLE=function(o,c,g){o=o|0,c=c|0,g||a(o,c,this.length);for(var A=this[o],R=1,W=0;++W<c&&(R*=256);)A+=this[o+W]*R;return A},i.prototype.readUIntBE=function(o,c,g){o=o|0,c=c|0,g||a(o,c,this.length);for(var A=this[o+--c],R=1;c>0&&(R*=256);)A+=this[o+--c]*R;return A},i.prototype.readUInt8=function(o,c){return c||a(o,1,this.length),this[o]},i.prototype.readUInt16LE=function(o,c){return c||a(o,2,this.length),this[o]|this[o+1]<<8},i.prototype.readUInt16BE=function(o,c){return c||a(o,2,this.length),this[o]<<8|this[o+1]},i.prototype.readUInt32LE=function(o,c){return c||a(o,4,this.length),(this[o]|this[o+1]<<8|this[o+2]<<16)+this[o+3]*16777216},i.prototype.readUInt32BE=function(o,c){return c||a(o,4,this.length),this[o]*16777216+(this[o+1]<<16|this[o+2]<<8|this[o+3])},i.prototype.readIntLE=function(o,c,g){o=o|0,c=c|0,g||a(o,c,this.length);for(var A=this[o],R=1,W=0;++W<c&&(R*=256);)A+=this[o+W]*R;return R*=128,A>=R&&(A-=Math.pow(2,8*c)),A},i.prototype.readIntBE=function(o,c,g){o=o|0,c=c|0,g||a(o,c,this.length);for(var A=c,R=1,W=this[o+--A];A>0&&(R*=256);)W+=this[o+--A]*R;return R*=128,W>=R&&(W-=Math.pow(2,8*c)),W},i.prototype.readInt8=function(o,c){return c||a(o,1,this.length),this[o]&128?(255-this[o]+1)*-1:this[o]},i.prototype.readInt16LE=function(o,c){c||a(o,2,this.length);var g=this[o]|this[o+1]<<8;return g&32768?g|4294901760:g},i.prototype.readInt16BE=function(o,c){c||a(o,2,this.length);var g=this[o+1]|this[o]<<8;return g&32768?g|4294901760:g},i.prototype.readInt32LE=function(o,c){return c||a(o,4,this.length),this[o]|this[o+1]<<8|this[o+2]<<16|this[o+3]<<24},i.prototype.readInt32BE=function(o,c){return c||a(o,4,this.length),this[o]<<24|this[o+1]<<16|this[o+2]<<8|this[o+3]},i.prototype.readFloatLE=function(o,c){return c||a(o,4,this.length),r.read(this,o,!0,23,4)},i.prototype.readFloatBE=function(o,c){return c||a(o,4,this.length),r.read(this,o,!1,23,4)},i.prototype.readDoubleLE=function(o,c){return c||a(o,8,this.length),r.read(this,o,!0,52,8)},i.prototype.readDoubleBE=function(o,c){return c||a(o,8,this.length),r.read(this,o,!1,52,8)};function v(o,c,g,A,R,W){if(!i.isBuffer(o))throw new TypeError('"buffer" argument must be a Buffer instance');if(c>R||c<W)throw new RangeError('"value" argument is out of bounds');if(g+A>o.length)throw new RangeError("Index out of range")}i.prototype.writeUIntLE=function(o,c,g,A){if(o=+o,c=c|0,g=g|0,!A){var R=Math.pow(2,8*g)-1;v(this,o,c,g,R,0)}var W=1,le=0;for(this[c]=o&255;++le<g&&(W*=256);)this[c+le]=o/W&255;return c+g},i.prototype.writeUIntBE=function(o,c,g,A){if(o=+o,c=c|0,g=g|0,!A){var R=Math.pow(2,8*g)-1;v(this,o,c,g,R,0)}var W=g-1,le=1;for(this[c+W]=o&255;--W>=0&&(le*=256);)this[c+W]=o/le&255;return c+g},i.prototype.writeUInt8=function(o,c,g){return o=+o,c=c|0,g||v(this,o,c,1,255,0),i.TYPED_ARRAY_SUPPORT||(o=Math.floor(o)),this[c]=o&255,c+1};function D(o,c,g,A){c<0&&(c=65535+c+1);for(var R=0,W=Math.min(o.length-g,2);R<W;++R)o[g+R]=(c&255<<8*(A?R:1-R))>>>(A?R:1-R)*8}i.prototype.writeUInt16LE=function(o,c,g){return o=+o,c=c|0,g||v(this,o,c,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[c]=o&255,this[c+1]=o>>>8):D(this,o,c,!0),c+2},i.prototype.writeUInt16BE=function(o,c,g){return o=+o,c=c|0,g||v(this,o,c,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[c]=o>>>8,this[c+1]=o&255):D(this,o,c,!1),c+2};function T(o,c,g,A){c<0&&(c=4294967295+c+1);for(var R=0,W=Math.min(o.length-g,4);R<W;++R)o[g+R]=c>>>(A?R:3-R)*8&255}i.prototype.writeUInt32LE=function(o,c,g){return o=+o,c=c|0,g||v(this,o,c,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[c+3]=o>>>24,this[c+2]=o>>>16,this[c+1]=o>>>8,this[c]=o&255):T(this,o,c,!0),c+4},i.prototype.writeUInt32BE=function(o,c,g){return o=+o,c=c|0,g||v(this,o,c,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[c]=o>>>24,this[c+1]=o>>>16,this[c+2]=o>>>8,this[c+3]=o&255):T(this,o,c,!1),c+4},i.prototype.writeIntLE=function(o,c,g,A){if(o=+o,c=c|0,!A){var R=Math.pow(2,8*g-1);v(this,o,c,g,R-1,-R)}var W=0,le=1,fe=0;for(this[c]=o&255;++W<g&&(le*=256);)o<0&&fe===0&&this[c+W-1]!==0&&(fe=1),this[c+W]=(o/le>>0)-fe&255;return c+g},i.prototype.writeIntBE=function(o,c,g,A){if(o=+o,c=c|0,!A){var R=Math.pow(2,8*g-1);v(this,o,c,g,R-1,-R)}var W=g-1,le=1,fe=0;for(this[c+W]=o&255;--W>=0&&(le*=256);)o<0&&fe===0&&this[c+W+1]!==0&&(fe=1),this[c+W]=(o/le>>0)-fe&255;return c+g},i.prototype.writeInt8=function(o,c,g){return o=+o,c=c|0,g||v(this,o,c,1,127,-128),i.TYPED_ARRAY_SUPPORT||(o=Math.floor(o)),o<0&&(o=255+o+1),this[c]=o&255,c+1},i.prototype.writeInt16LE=function(o,c,g){return o=+o,c=c|0,g||v(this,o,c,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[c]=o&255,this[c+1]=o>>>8):D(this,o,c,!0),c+2},i.prototype.writeInt16BE=function(o,c,g){return o=+o,c=c|0,g||v(this,o,c,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[c]=o>>>8,this[c+1]=o&255):D(this,o,c,!1),c+2},i.prototype.writeInt32LE=function(o,c,g){return o=+o,c=c|0,g||v(this,o,c,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[c]=o&255,this[c+1]=o>>>8,this[c+2]=o>>>16,this[c+3]=o>>>24):T(this,o,c,!0),c+4},i.prototype.writeInt32BE=function(o,c,g){return o=+o,c=c|0,g||v(this,o,c,4,2147483647,-2147483648),o<0&&(o=4294967295+o+1),i.TYPED_ARRAY_SUPPORT?(this[c]=o>>>24,this[c+1]=o>>>16,this[c+2]=o>>>8,this[c+3]=o&255):T(this,o,c,!1),c+4};function z(o,c,g,A,R,W){if(g+A>o.length)throw new RangeError("Index out of range");if(g<0)throw new RangeError("Index out of range")}function Z(o,c,g,A,R){return R||z(o,c,g,4),r.write(o,c,g,A,23,4),g+4}i.prototype.writeFloatLE=function(o,c,g){return Z(this,o,c,!0,g)},i.prototype.writeFloatBE=function(o,c,g){return Z(this,o,c,!1,g)};function K(o,c,g,A,R){return R||z(o,c,g,8),r.write(o,c,g,A,52,8),g+8}i.prototype.writeDoubleLE=function(o,c,g){return K(this,o,c,!0,g)},i.prototype.writeDoubleBE=function(o,c,g){return K(this,o,c,!1,g)},i.prototype.copy=function(o,c,g,A){if(g||(g=0),!A&&A!==0&&(A=this.length),c>=o.length&&(c=o.length),c||(c=0),A>0&&A<g&&(A=g),A===g||o.length===0||this.length===0)return 0;if(c<0)throw new RangeError("targetStart out of bounds");if(g<0||g>=this.length)throw new RangeError("sourceStart out of bounds");if(A<0)throw new RangeError("sourceEnd out of bounds");A>this.length&&(A=this.length),o.length-c<A-g&&(A=o.length-c+g);var R=A-g,W;if(this===o&&g<c&&c<A)for(W=R-1;W>=0;--W)o[W+c]=this[W+g];else if(R<1e3||!i.TYPED_ARRAY_SUPPORT)for(W=0;W<R;++W)o[W+c]=this[W+g];else Uint8Array.prototype.set.call(o,this.subarray(g,g+R),c);return R},i.prototype.fill=function(o,c,g,A){if(typeof o=="string"){if(typeof c=="string"?(A=c,c=0,g=this.length):typeof g=="string"&&(A=g,g=this.length),o.length===1){var R=o.charCodeAt(0);R<256&&(o=R)}if(A!==void 0&&typeof A!="string")throw new TypeError("encoding must be a string");if(typeof A=="string"&&!i.isEncoding(A))throw new TypeError("Unknown encoding: "+A)}else typeof o=="number"&&(o=o&255);if(c<0||this.length<c||this.length<g)throw new RangeError("Out of range index");if(g<=c)return this;c=c>>>0,g=g===void 0?this.length:g>>>0,o||(o=0);var W;if(typeof o=="number")for(W=c;W<g;++W)this[W]=o;else{var le=i.isBuffer(o)?o:E(new i(o,A).toString()),fe=le.length;for(W=0;W<g-c;++W)this[W+c]=le[W%fe]}return this};var H=/[^+\/0-9A-Za-z-_]/g;function ie(o){if(o=se(o).replace(H,""),o.length<2)return"";for(;o.length%4!==0;)o=o+"=";return o}function se(o){return o.trim?o.trim():o.replace(/^\s+|\s+$/g,"")}function ue(o){return o<16?"0"+o.toString(16):o.toString(16)}function E(o,c){c=c||1/0;for(var g,A=o.length,R=null,W=[],le=0;le<A;++le){if(g=o.charCodeAt(le),g>55295&&g<57344){if(!R){if(g>56319){(c-=3)>-1&&W.push(239,191,189);continue}else if(le+1===A){(c-=3)>-1&&W.push(239,191,189);continue}R=g;continue}if(g<56320){(c-=3)>-1&&W.push(239,191,189),R=g;continue}g=(R-55296<<10|g-56320)+65536}else R&&(c-=3)>-1&&W.push(239,191,189);if(R=null,g<128){if((c-=1)<0)break;W.push(g)}else if(g<2048){if((c-=2)<0)break;W.push(g>>6|192,g&63|128)}else if(g<65536){if((c-=3)<0)break;W.push(g>>12|224,g>>6&63|128,g&63|128)}else if(g<1114112){if((c-=4)<0)break;W.push(g>>18|240,g>>12&63|128,g>>6&63|128,g&63|128)}else throw new Error("Invalid code point")}return W}function L(o){for(var c=[],g=0;g<o.length;++g)c.push(o.charCodeAt(g)&255);return c}function $(o,c){for(var g,A,R,W=[],le=0;le<o.length&&!((c-=2)<0);++le)g=o.charCodeAt(le),A=g>>8,R=g%256,W.push(R),W.push(A);return W}function Y(o){return e.toByteArray(ie(o))}function I(o,c,g,A){for(var R=0;R<A&&!(R+g>=c.length||R>=o.length);++R)c[R+g]=o[R];return R}function ce(o){return o!==o}})(ho)),ho}$i();var Pt;if(typeof window<"u"&&window.crypto&&(Pt=window.crypto),!Pt&&typeof window<"u"&&window.msCrypto&&(Pt=window.msCrypto),!Pt&&typeof global<"u"&&global.crypto&&(Pt=global.crypto),!Pt&&typeof require=="function")try{Pt=require("crypto")}catch{}var yo={};var Zr=function(t,e){return Zr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var s in n)n.hasOwnProperty(s)&&(r[s]=n[s])},Zr(t,e)};function Ri(t,e){Zr(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Jr=function(){return Jr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},Jr.apply(this,arguments)};function Ni(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]]);return r}function Li(t,e,r,n){var s=arguments.length,u=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(t,e,r,n);else for(var i=t.length-1;i>=0;i--)(d=t[i])&&(u=(s<3?d(u):s>3?d(e,r,u):d(e,r))||u);return s>3&&u&&Object.defineProperty(e,r,u),u}function Bi(t,e){return function(r,n){e(r,n,t)}}function Ii(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Yi(t,e,r,n){function s(u){return u instanceof r?u:new r(function(d){d(u)})}return new(r||(r=Promise))(function(u,d){function i(_){try{b(n.next(_))}catch(M){d(M)}}function m(_){try{b(n.throw(_))}catch(M){d(M)}}function b(_){_.done?u(_.value):s(_.value).then(i,m)}b((n=n.apply(t,e||[])).next())})}function zi(t,e){var r={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},n,s,u,d;return d={next:i(0),throw:i(1),return:i(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function i(b){return function(_){return m([b,_])}}function m(b){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,s&&(u=b[0]&2?s.return:b[0]?s.throw||((u=s.return)&&u.call(s),0):s.next)&&!(u=u.call(s,b[1])).done)return u;switch(s=0,u&&(b=[b[0]&2,u.value]),b[0]){case 0:case 1:u=b;break;case 4:return r.label++,{value:b[1],done:!1};case 5:r.label++,s=b[1],b=[0];continue;case 7:b=r.ops.pop(),r.trys.pop();continue;default:if(u=r.trys,!(u=u.length>0&&u[u.length-1])&&(b[0]===6||b[0]===2)){r=0;continue}if(b[0]===3&&(!u||b[1]>u[0]&&b[1]<u[3])){r.label=b[1];break}if(b[0]===6&&r.label<u[1]){r.label=u[1],u=b;break}if(u&&r.label<u[2]){r.label=u[2],r.ops.push(b);break}u[2]&&r.ops.pop(),r.trys.pop();continue}b=e.call(t,r)}catch(_){b=[6,_],s=0}finally{n=u=0}if(b[0]&5)throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}}function Fi(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Wi(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Xr(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function vo(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),s,u=[],d;try{for(;(e===void 0||e-- >0)&&!(s=n.next()).done;)u.push(s.value)}catch(i){d={error:i}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(d)throw d.error}}return u}function Ui(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(vo(arguments[e]));return t}function qi(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),s=0,e=0;e<r;e++)for(var u=arguments[e],d=0,i=u.length;d<i;d++,s++)n[s]=u[d];return n}function Vt(t){return this instanceof Vt?(this.v=t,this):new Vt(t)}function Vi(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),s,u=[];return s={},d("next"),d("throw"),d("return"),s[Symbol.asyncIterator]=function(){return this},s;function d(C){n[C]&&(s[C]=function(S){return new Promise(function(k,j){u.push([C,S,k,j])>1||i(C,S)})})}function i(C,S){try{m(n[C](S))}catch(k){M(u[0][3],k)}}function m(C){C.value instanceof Vt?Promise.resolve(C.value.v).then(b,_):M(u[0][2],C)}function b(C){i("next",C)}function _(C){i("throw",C)}function M(C,S){C(S),u.shift(),u.length&&i(u[0][0],u[0][1])}}function Hi(t){var e,r;return e={},n("next"),n("throw",function(s){throw s}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(s,u){e[s]=t[s]?function(d){return(r=!r)?{value:Vt(t[s](d)),done:s==="return"}:u?u(d):d}:u}}function Gi(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Xr=="function"?Xr(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(u){r[u]=t[u]&&function(d){return new Promise(function(i,m){d=t[u](d),s(i,m,d.done,d.value)})}}function s(u,d,i,m){Promise.resolve(m).then(function(b){u({value:b,done:i})},d)}}function Qi(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Ki(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function Zi(t){return t&&t.__esModule?t:{default:t}}function Ji(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Xi(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}const ea=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Jr},__asyncDelegator:Hi,__asyncGenerator:Vi,__asyncValues:Gi,__await:Vt,__awaiter:Yi,__classPrivateFieldGet:Ji,__classPrivateFieldSet:Xi,__createBinding:Fi,__decorate:Li,__exportStar:Wi,__extends:Ri,__generator:zi,__importDefault:Zi,__importStar:Ki,__makeTemplateObject:Qi,__metadata:Ii,__param:Bi,__read:vo,__rest:Ni,__spread:Ui,__spreadArrays:qi,__values:Xr},Symbol.toStringTag,{value:"Module"})),bo=qr(ea);var Ht={},We={},wo;function _o(){return wo||(wo=1,Object.defineProperty(We,"__esModule",{value:!0}),We.MAX_HASHABLE_LENGTH=We.INIT=We.KEY=We.DIGEST_LENGTH=We.BLOCK_SIZE=void 0,We.BLOCK_SIZE=64,We.DIGEST_LENGTH=32,We.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),We.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],We.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1),We}var Gt={},xo;function ta(){if(xo)return Gt;xo=1,Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.RawSha256=void 0;var t=_o(),e=(function(){function r(){this.state=Int32Array.from(t.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return r.prototype.update=function(n){if(this.finished)throw new Error("Attempted to update an already finished hash.");var s=0,u=n.byteLength;if(this.bytesHashed+=u,this.bytesHashed*8>t.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;u>0;)this.buffer[this.bufferLength++]=n[s++],u--,this.bufferLength===t.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},r.prototype.digest=function(){if(!this.finished){var n=this.bytesHashed*8,s=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),u=this.bufferLength;if(s.setUint8(this.bufferLength++,128),u%t.BLOCK_SIZE>=t.BLOCK_SIZE-8){for(var d=this.bufferLength;d<t.BLOCK_SIZE;d++)s.setUint8(d,0);this.hashBuffer(),this.bufferLength=0}for(var d=this.bufferLength;d<t.BLOCK_SIZE-8;d++)s.setUint8(d,0);s.setUint32(t.BLOCK_SIZE-8,Math.floor(n/4294967296),!0),s.setUint32(t.BLOCK_SIZE-4,n),this.hashBuffer(),this.finished=!0}for(var i=new Uint8Array(t.DIGEST_LENGTH),d=0;d<8;d++)i[d*4]=this.state[d]>>>24&255,i[d*4+1]=this.state[d]>>>16&255,i[d*4+2]=this.state[d]>>>8&255,i[d*4+3]=this.state[d]>>>0&255;return i},r.prototype.hashBuffer=function(){for(var n=this,s=n.buffer,u=n.state,d=u[0],i=u[1],m=u[2],b=u[3],_=u[4],M=u[5],C=u[6],S=u[7],k=0;k<t.BLOCK_SIZE;k++){if(k<16)this.temp[k]=(s[k*4]&255)<<24|(s[k*4+1]&255)<<16|(s[k*4+2]&255)<<8|s[k*4+3]&255;else{var j=this.temp[k-2],N=(j>>>17|j<<15)^(j>>>19|j<<13)^j>>>10;j=this.temp[k-15];var F=(j>>>7|j<<25)^(j>>>18|j<<14)^j>>>3;this.temp[k]=(N+this.temp[k-7]|0)+(F+this.temp[k-16]|0)}var B=(((_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&M^~_&C)|0)+(S+(t.KEY[k]+this.temp[k]|0)|0)|0,Q=((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+(d&i^d&m^i&m)|0;S=C,C=M,M=_,_=b+B|0,b=m,m=i,i=d,d=B+Q|0}u[0]+=d,u[1]+=i,u[2]+=m,u[3]+=b,u[4]+=_,u[5]+=M,u[6]+=C,u[7]+=S},r})();return Gt.RawSha256=e,Gt}var Co={},Qt={};const ra=t=>{const e=[];for(let r=0,n=t.length;r<n;r++){const s=t.charCodeAt(r);if(s<128)e.push(s);else if(s<2048)e.push(s>>6|192,s&63|128);else if(r+1<t.length&&(s&64512)===55296&&(t.charCodeAt(r+1)&64512)===56320){const u=65536+((s&1023)<<10)+(t.charCodeAt(++r)&1023);e.push(u>>18|240,u>>12&63|128,u>>6&63|128,u&63|128)}else e.push(s>>12|224,s>>6&63|128,s&63|128)}return Uint8Array.from(e)},na=t=>{let e="";for(let r=0,n=t.length;r<n;r++){const s=t[r];if(s<128)e+=String.fromCharCode(s);else if(192<=s&&s<224){const u=t[++r];e+=String.fromCharCode((s&31)<<6|u&63)}else if(240<=s&&s<365){const u="%"+[s,t[++r],t[++r],t[++r]].map(d=>d.toString(16)).join("%");e+=decodeURIComponent(u)}else e+=String.fromCharCode((s&15)<<12|(t[++r]&63)<<6|t[++r]&63)}return e};function oa(t){return new TextEncoder().encode(t)}function sa(t){return new TextDecoder("utf-8").decode(t)}const ia=t=>typeof TextEncoder=="function"?oa(t):ra(t),aa=t=>typeof TextDecoder=="function"?sa(t):na(t),la=Object.freeze(Object.defineProperty({__proto__:null,fromUtf8:ia,toUtf8:aa},Symbol.toStringTag,{value:"Module"})),ua=qr(la);var So;function ca(){if(So)return Qt;So=1,Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.convertToBuffer=void 0;var t=ua,e=typeof Buffer<"u"&&Buffer.from?function(n){return Buffer.from(n,"utf8")}:t.fromUtf8;function r(n){return n instanceof Uint8Array?n:typeof n=="string"?e(n):ArrayBuffer.isView(n)?new Uint8Array(n.buffer,n.byteOffset,n.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(n)}return Qt.convertToBuffer=r,Qt}var Kt={},Do;function da(){if(Do)return Kt;Do=1,Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.isEmptyData=void 0;function t(e){return typeof e=="string"?e.length===0:e.byteLength===0}return Kt.isEmptyData=t,Kt}var Zt={},ko;function ha(){if(ko)return Zt;ko=1,Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.numToUint8=void 0;function t(e){return new Uint8Array([(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255])}return Zt.numToUint8=t,Zt}var Jt={},Po;function fa(){if(Po)return Jt;Po=1,Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.uint32ArrayFrom=void 0;function t(e){if(!Array.from){for(var r=new Uint32Array(e.length),n=0;n<e.length;)r[n]=e[n];return r}return Uint32Array.from(e)}return Jt.uint32ArrayFrom=t,Jt}var Mo;function pa(){return Mo||(Mo=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=t.numToUint8=t.isEmptyData=t.convertToBuffer=void 0;var e=ca();Object.defineProperty(t,"convertToBuffer",{enumerable:!0,get:function(){return e.convertToBuffer}});var r=da();Object.defineProperty(t,"isEmptyData",{enumerable:!0,get:function(){return r.isEmptyData}});var n=ha();Object.defineProperty(t,"numToUint8",{enumerable:!0,get:function(){return n.numToUint8}});var s=fa();Object.defineProperty(t,"uint32ArrayFrom",{enumerable:!0,get:function(){return s.uint32ArrayFrom}})})(Co)),Co}var Oo;function ga(){if(Oo)return Ht;Oo=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.Sha256=void 0;var t=bo,e=_o(),r=ta(),n=pa(),s=(function(){function d(i){if(this.hash=new r.RawSha256,i){this.outer=new r.RawSha256;var m=u(i),b=new Uint8Array(e.BLOCK_SIZE);b.set(m);for(var _=0;_<e.BLOCK_SIZE;_++)m[_]^=54,b[_]^=92;this.hash.update(m),this.outer.update(b);for(var _=0;_<m.byteLength;_++)m[_]=0}}return d.prototype.update=function(i){if(!((0,n.isEmptyData)(i)||this.error))try{this.hash.update((0,n.convertToBuffer)(i))}catch(m){this.error=m}},d.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},d.prototype.digest=function(){return(0,t.__awaiter)(this,void 0,void 0,function(){return(0,t.__generator)(this,function(i){return[2,this.digestSync()]})})},d})();Ht.Sha256=s;function u(d){var i=(0,n.convertToBuffer)(d);if(i.byteLength>e.BLOCK_SIZE){var m=new r.RawSha256;m.update(i),i=m.digest()}var b=new Uint8Array(e.BLOCK_SIZE);return b.set(i),b}return Ht}var jo;function ma(){return jo||(jo=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=bo;(0,e.__exportStar)(ga(),t)})(yo)),yo}ma();function ye(t,e){t!=null&&this.fromString(t,e)}function Le(){return new ye(null)}var gt,ya=0xdeadbeefcafe,Ao=(ya&16777215)==15715070;function va(t,e,r,n,s,u){for(;--u>=0;){var d=e*this[t++]+r[n]+s;s=Math.floor(d/67108864),r[n++]=d&67108863}return s}function ba(t,e,r,n,s,u){for(var d=e&32767,i=e>>15;--u>=0;){var m=this[t]&32767,b=this[t++]>>15,_=i*m+b*d;m=d*m+((_&32767)<<15)+r[n]+(s&1073741823),s=(m>>>30)+(_>>>15)+i*b+(s>>>30),r[n++]=m&1073741823}return s}function wa(t,e,r,n,s,u){for(var d=e&16383,i=e>>14;--u>=0;){var m=this[t]&16383,b=this[t++]>>14,_=i*m+b*d;m=d*m+((_&16383)<<14)+r[n]+s,s=(m>>28)+(_>>14)+i*b,r[n++]=m&268435455}return s}var Eo=typeof navigator<"u";Eo&&Ao&&navigator.appName=="Microsoft Internet Explorer"?(ye.prototype.am=ba,gt=30):Eo&&Ao&&navigator.appName!="Netscape"?(ye.prototype.am=va,gt=26):(ye.prototype.am=wa,gt=28),ye.prototype.DB=gt,ye.prototype.DM=(1<<gt)-1,ye.prototype.DV=1<<gt;var en=52;ye.prototype.FV=Math.pow(2,en),ye.prototype.F1=en-gt,ye.prototype.F2=2*gt-en;var _a="0123456789abcdefghijklmnopqrstuvwxyz",cr=new Array,Tt,Ue;for(Tt=48,Ue=0;Ue<=9;++Ue)cr[Tt++]=Ue;for(Tt=97,Ue=10;Ue<36;++Ue)cr[Tt++]=Ue;for(Tt=65,Ue=10;Ue<36;++Ue)cr[Tt++]=Ue;function To(t){return _a.charAt(t)}function xa(t,e){var r=cr[t.charCodeAt(e)];return r??-1}function Ca(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function Sa(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0}function tn(t){var e=Le();return e.fromInt(t),e}function Da(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");this.t=0,this.s=0;for(var n=t.length,s=!1,u=0;--n>=0;){var d=xa(t,n);if(d<0){t.charAt(n)=="-"&&(s=!0);continue}s=!1,u==0?this[this.t++]=d:u+r>this.DB?(this[this.t-1]|=(d&(1<<this.DB-u)-1)<<u,this[this.t++]=d>>this.DB-u):this[this.t-1]|=d<<u,u+=r,u>=this.DB&&(u-=this.DB)}this.clamp(),s&&ye.ZERO.subTo(this,this)}function ka(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function Pa(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");var r=(1<<e)-1,n,s=!1,u="",d=this.t,i=this.DB-d*this.DB%e;if(d-- >0)for(i<this.DB&&(n=this[d]>>i)>0&&(s=!0,u=To(n));d>=0;)i<e?(n=(this[d]&(1<<i)-1)<<e-i,n|=this[--d]>>(i+=this.DB-e)):(n=this[d]>>(i-=e)&r,i<=0&&(i+=this.DB,--d)),n>0&&(s=!0),s&&(u+=To(n));return s?u:"0"}function Ma(){var t=Le();return ye.ZERO.subTo(this,t),t}function Oa(){return this.s<0?this.negate():this}function ja(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this[r]-t[r])!=0)return e;return 0}function rn(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}function Aa(){return this.t<=0?0:this.DB*(this.t-1)+rn(this[this.t-1]^this.s&this.DM)}function Ea(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s}function Ta(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0),e.s=this.s}function $a(t,e){var r=t%this.DB,n=this.DB-r,s=(1<<n)-1,u=Math.floor(t/this.DB),d=this.s<<r&this.DM,i;for(i=this.t-1;i>=0;--i)e[i+u+1]=this[i]>>n|d,d=(this[i]&s)<<r;for(i=u-1;i>=0;--i)e[i]=0;e[u]=d,e.t=this.t+u+1,e.s=this.s,e.clamp()}function Ra(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var n=t%this.DB,s=this.DB-n,u=(1<<n)-1;e[0]=this[r]>>n;for(var d=r+1;d<this.t;++d)e[d-r-1]|=(this[d]&u)<<s,e[d-r]=this[d]>>n;n>0&&(e[this.t-r-1]|=(this.s&u)<<s),e.t=this.t-r,e.clamp()}function Na(t,e){for(var r=0,n=0,s=Math.min(t.t,this.t);r<s;)n+=this[r]-t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n-=t[r],e[r++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[r++]=this.DV+n:n>0&&(e[r++]=n),e.t=r,e.clamp()}function La(t,e){var r=this.abs(),n=t.abs(),s=r.t;for(e.t=s+n.t;--s>=0;)e[s]=0;for(s=0;s<n.t;++s)e[s+r.t]=r.am(0,n[s],e,s,0,r.t);e.s=0,e.clamp(),this.s!=t.s&&ye.ZERO.subTo(e,e)}function Ba(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e[r],t,2*r,0,1);(t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,n,e.t-r-1))>=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()}function Ia(t,e,r){var n=t.abs();if(!(n.t<=0)){var s=this.abs();if(s.t<n.t){e?.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=Le());var u=Le(),d=this.s,i=t.s,m=this.DB-rn(n[n.t-1]);m>0?(n.lShiftTo(m,u),s.lShiftTo(m,r)):(n.copyTo(u),s.copyTo(r));var b=u.t,_=u[b-1];if(_!=0){var M=_*(1<<this.F1)+(b>1?u[b-2]>>this.F2:0),C=this.FV/M,S=(1<<this.F1)/M,k=1<<this.F2,j=r.t,N=j-b,F=e??Le();for(u.dlShiftTo(N,F),r.compareTo(F)>=0&&(r[r.t++]=1,r.subTo(F,r)),ye.ONE.dlShiftTo(b,F),F.subTo(u,u);u.t<b;)u[u.t++]=0;for(;--N>=0;){var B=r[--j]==_?this.DM:Math.floor(r[j]*C+(r[j-1]+k)*S);if((r[j]+=u.am(0,B,r,N,0,b))<B)for(u.dlShiftTo(N,F),r.subTo(F,r);r[j]<--B;)r.subTo(F,r)}e!=null&&(r.drShiftTo(b,e),d!=i&&ye.ZERO.subTo(e,e)),r.t=b,r.clamp(),m>0&&r.rShiftTo(m,r),d<0&&ye.ZERO.subTo(r,r)}}}function Ya(t){var e=Le();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(ye.ZERO)>0&&t.subTo(e,e),e}function za(){if(this.t<1)return 0;var t=this[0];if((t&1)==0)return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function Fa(t){return this.compareTo(t)==0}function Wa(t,e){for(var r=0,n=0,s=Math.min(t.t,this.t);r<s;)n+=this[r]+t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n+=t[r],e[r++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[r++]=n:n<-1&&(e[r++]=this.DV+n),e.t=r,e.clamp()}function Ua(t){var e=Le();return this.addTo(t,e),e}function qa(t){var e=Le();return this.subTo(t,e),e}function Va(t){var e=Le();return this.multiplyTo(t,e),e}function Ha(t){var e=Le();return this.divRemTo(t,e,null),e}function $t(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function Ga(t){var e=Le();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(ye.ZERO)>0&&this.m.subTo(e,e),e}function Qa(t){var e=Le();return t.copyTo(e),this.reduce(e),e}function Ka(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=t[e]&32767,n=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t[r]+=this.m.am(0,n,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function Za(t,e){t.squareTo(e),this.reduce(e)}function Ja(t,e,r){t.multiplyTo(e,r),this.reduce(r)}$t.prototype.convert=Ga,$t.prototype.revert=Qa,$t.prototype.reduce=Ka,$t.prototype.mulTo=Ja,$t.prototype.sqrTo=Za;function Xa(t,e,r){var n=t.bitLength(),s,u=tn(1),d=new $t(e);if(n<=0)return u;n<18?s=1:n<48?s=3:n<144?s=4:n<768?s=5:s=6;var i=new Array,m=3,b=s-1,_=(1<<s)-1;if(i[1]=d.convert(this),s>1){var M=Le();for(d.sqrTo(i[1],M);m<=_;)i[m]=Le(),d.mulTo(M,i[m-2],i[m]),m+=2}var C=t.t-1,S,k=!0,j=Le(),N;for(n=rn(t[C])-1;C>=0;){for(n>=b?S=t[C]>>n-b&_:(S=(t[C]&(1<<n+1)-1)<<b-n,C>0&&(S|=t[C-1]>>this.DB+n-b)),m=s;(S&1)==0;)S>>=1,--m;if((n-=m)<0&&(n+=this.DB,--C),k)i[S].copyTo(u),k=!1;else{for(;m>1;)d.sqrTo(u,j),d.sqrTo(j,u),m-=2;m>0?d.sqrTo(u,j):(N=u,u=j,j=N),d.mulTo(j,i[S],u)}for(;C>=0&&(t[C]&1<<n)==0;)d.sqrTo(u,j),N=u,u=j,j=N,--n<0&&(n=this.DB-1,--C)}var F=d.revert(u);return r(null,F),F}ye.prototype.copyTo=Ca,ye.prototype.fromInt=Sa,ye.prototype.fromString=Da,ye.prototype.clamp=ka,ye.prototype.dlShiftTo=Ea,ye.prototype.drShiftTo=Ta,ye.prototype.lShiftTo=$a,ye.prototype.rShiftTo=Ra,ye.prototype.subTo=Na,ye.prototype.multiplyTo=La,ye.prototype.squareTo=Ba,ye.prototype.divRemTo=Ia,ye.prototype.invDigit=za,ye.prototype.addTo=Wa,ye.prototype.toString=Pa,ye.prototype.negate=Ma,ye.prototype.abs=Oa,ye.prototype.compareTo=ja,ye.prototype.bitLength=Aa,ye.prototype.mod=Ya,ye.prototype.equals=Fa,ye.prototype.add=Ua,ye.prototype.subtract=qa,ye.prototype.multiply=Va,ye.prototype.divide=Ha,ye.prototype.modPow=Xa,ye.ZERO=tn(0),ye.ONE=tn(1);function el(t,e){return e=e||{},new Promise(function(r,n){var s=new XMLHttpRequest,u=[],d=[],i={},m=function(){return{ok:(s.status/100|0)==2,statusText:s.statusText,status:s.status,url:s.responseURL,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(s.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([s.response]))},clone:m,headers:{keys:function(){return u},entries:function(){return d},get:function(_){return i[_.toLowerCase()]},has:function(_){return _.toLowerCase()in i}}}};for(var b in s.open(e.method||"get",t,!0),s.onload=function(){s.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(_,M,C){u.push(M=M.toLowerCase()),d.push([M,C]),i[M]=i[M]?i[M]+","+C:C}),r(m())},s.onerror=n,s.withCredentials=e.credentials=="include",e.headers)s.setRequestHeader(b,e.headers[b]);s.send(e.body||null)})}const tl=Object.freeze(Object.defineProperty({__proto__:null,default:el},Symbol.toStringTag,{value:"Module"})),$o=qr(tl);var Ro,No;function rl(){return No||(No=1,Ro=self.fetch||(self.fetch=$o.default||$o)),Ro}rl();var Lo={exports:{}};var Bo;function nl(){return Bo||(Bo=1,(function(t,e){(function(r){var n;if(t.exports=r(),n=!0,!n){var s=window.Cookies,u=window.Cookies=r();u.noConflict=function(){return window.Cookies=s,u}}})(function(){function r(){for(var u=0,d={};u<arguments.length;u++){var i=arguments[u];for(var m in i)d[m]=i[m]}return d}function n(u){return u.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function s(u){function d(){}function i(b,_,M){if(!(typeof document>"u")){M=r({path:"/"},d.defaults,M),typeof M.expires=="number"&&(M.expires=new Date(new Date*1+M.expires*864e5)),M.expires=M.expires?M.expires.toUTCString():"";try{var C=JSON.stringify(_);/^[\{\[]/.test(C)&&(_=C)}catch{}_=u.write?u.write(_,b):encodeURIComponent(String(_)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),b=encodeURIComponent(String(b)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var S="";for(var k in M)M[k]&&(S+="; "+k,M[k]!==!0&&(S+="="+M[k].split(";")[0]));return document.cookie=b+"="+_+S}}function m(b,_){if(!(typeof document>"u")){for(var M={},C=document.cookie?document.cookie.split("; "):[],S=0;S<C.length;S++){var k=C[S].split("="),j=k.slice(1).join("=");!_&&j.charAt(0)==='"'&&(j=j.slice(1,-1));try{var N=n(k[0]);if(j=(u.read||u)(j,N)||n(j),_)try{j=JSON.parse(j)}catch{}if(M[N]=j,b===N)break}catch{}}return b?M[b]:M}}return d.set=i,d.get=function(b){return m(b,!1)},d.getJSON=function(b){return m(b,!0)},d.remove=function(b,_){i(b,"",r(_,{expires:-1}))},d.defaults={},d.withConverter=s,d}return s(function(){})})})(Lo)),Lo.exports}nl();function ol(){if(!window.MantineCognitoUserPool)throw new Error("Cognito Userpool has not been initialized.");return window.MantineCognitoUserPool}function sl(){return ol().getCurrentUser()}function il(){return new Promise((t,e)=>{const r=sl();r===null&&e(null),r?.getSession((n,s)=>{if(n!==null||s===null)return e(null);t({session:s,authenticatedUser:r})})})}async function al(){const{session:t}=await il();return t?.getIdToken().getJwtToken()}X.createContext(void 0);var ll="undefined",ul="object",dr="browser",Io="cpu",Yo="device",nn="engine",hr="os",mt="name",fr="type",on="vendor",et="version",sn="architecture",an="major",ln="model",cl="console",dl="mobile",hl="tablet",fl="smarttv",pl="wearable",gl="embedded",ml=typeof window!==ll,un=ml&&window.navigator?window.navigator:void 0;un&&un.userAgentData&&un.userAgentData;var pr=function(t){for(var e={},r=0;r<t.length;r++)e[t[r].toUpperCase()]=t[r];return e},gr=function(t){for(var e in t){var r=t[e];typeof r==ul&&r.length==2?this[r[0]]=r[1]:this[r]=void 0}return this};(function(){var t={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return gr.call(t.init,[[dr,[mt,et,an,fr]],[Io,[sn]],[Yo,[fr,ln,on]],[nn,[mt,et]],[hr,[mt,et]]]),gr.call(t.isIgnore,[[dr,[et,an]],[nn,[et]],[hr,[et]]]),gr.call(t.isIgnoreRgx,[[dr,/ ?browser$/i],[hr,/ ?os$/i]]),gr.call(t.toString,[[dr,[mt,et]],[Io,[sn]],[Yo,[on,ln]],[nn,[mt,et]],[hr,[mt,et]]]),t})(),pr([mt,et,an,fr]),pr([sn]),pr([ln,on,fr,cl,dl,fl,hl,pl,gl]),pr([mt,et]);var cn={exports:{}},yl=cn.exports,zo;function vl(){return zo||(zo=1,(function(t,e){(function(r,n){t.exports=n()})(yl,()=>(()=>{var r={873:(d,i)=>{var m,b,_=(function(){var M=function(P,x){var w=P,h=F[x],l=null,p=0,f=null,a=[],v={},D=function(E,L){l=(function($){for(var Y=new Array($),I=0;I<$;I+=1){Y[I]=new Array($);for(var ce=0;ce<$;ce+=1)Y[I][ce]=null}return Y})(p=4*w+17),T(0,0),T(p-7,0),T(0,p-7),Z(),z(),H(E,L),w>=7&&K(E),f==null&&(f=se(w,h,a)),ie(f,L)},T=function(E,L){for(var $=-1;$<=7;$+=1)if(!(E+$<=-1||p<=E+$))for(var Y=-1;Y<=7;Y+=1)L+Y<=-1||p<=L+Y||(l[E+$][L+Y]=0<=$&&$<=6&&(Y==0||Y==6)||0<=Y&&Y<=6&&($==0||$==6)||2<=$&&$<=4&&2<=Y&&Y<=4)},z=function(){for(var E=8;E<p-8;E+=1)l[E][6]==null&&(l[E][6]=E%2==0);for(var L=8;L<p-8;L+=1)l[6][L]==null&&(l[6][L]=L%2==0)},Z=function(){for(var E=B.getPatternPosition(w),L=0;L<E.length;L+=1)for(var $=0;$<E.length;$+=1){var Y=E[L],I=E[$];if(l[Y][I]==null)for(var ce=-2;ce<=2;ce+=1)for(var o=-2;o<=2;o+=1)l[Y+ce][I+o]=ce==-2||ce==2||o==-2||o==2||ce==0&&o==0}},K=function(E){for(var L=B.getBCHTypeNumber(w),$=0;$<18;$+=1){var Y=!E&&(L>>$&1)==1;l[Math.floor($/3)][$%3+p-8-3]=Y}for($=0;$<18;$+=1)Y=!E&&(L>>$&1)==1,l[$%3+p-8-3][Math.floor($/3)]=Y},H=function(E,L){for(var $=h<<3|L,Y=B.getBCHTypeInfo($),I=0;I<15;I+=1){var ce=!E&&(Y>>I&1)==1;I<6?l[I][8]=ce:I<8?l[I+1][8]=ce:l[p-15+I][8]=ce}for(I=0;I<15;I+=1)ce=!E&&(Y>>I&1)==1,I<8?l[8][p-I-1]=ce:I<9?l[8][15-I-1+1]=ce:l[8][15-I-1]=ce;l[p-8][8]=!E},ie=function(E,L){for(var $=-1,Y=p-1,I=7,ce=0,o=B.getMaskFunction(L),c=p-1;c>0;c-=2)for(c==6&&(c-=1);;){for(var g=0;g<2;g+=1)if(l[Y][c-g]==null){var A=!1;ce<E.length&&(A=(E[ce]>>>I&1)==1),o(Y,c-g)&&(A=!A),l[Y][c-g]=A,(I-=1)==-1&&(ce+=1,I=7)}if((Y+=$)<0||p<=Y){Y-=$,$=-$;break}}},se=function(E,L,$){for(var Y=ne.getRSBlocks(E,L),I=oe(),ce=0;ce<$.length;ce+=1){var o=$[ce];I.put(o.getMode(),4),I.put(o.getLength(),B.getLengthInBits(o.getMode(),E)),o.write(I)}var c=0;for(ce=0;ce<Y.length;ce+=1)c+=Y[ce].dataCount;if(I.getLengthInBits()>8*c)throw"code length overflow. ("+I.getLengthInBits()+">"+8*c+")";for(I.getLengthInBits()+4<=8*c&&I.put(0,4);I.getLengthInBits()%8!=0;)I.putBit(!1);for(;!(I.getLengthInBits()>=8*c||(I.put(236,8),I.getLengthInBits()>=8*c));)I.put(17,8);return(function(g,A){for(var R=0,W=0,le=0,fe=new Array(A.length),pe=new Array(A.length),J=0;J<A.length;J+=1){var he=A[J].dataCount,me=A[J].totalCount-he;W=Math.max(W,he),le=Math.max(le,me),fe[J]=new Array(he);for(var ge=0;ge<fe[J].length;ge+=1)fe[J][ge]=255&g.getBuffer()[ge+R];R+=he;var Se=B.getErrorCorrectPolynomial(me),Ce=U(fe[J],Se.getLength()-1).mod(Se);for(pe[J]=new Array(Se.getLength()-1),ge=0;ge<pe[J].length;ge+=1){var ke=ge+Ce.getLength()-pe[J].length;pe[J][ge]=ke>=0?Ce.getAt(ke):0}}var Fe=0;for(ge=0;ge<A.length;ge+=1)Fe+=A[ge].totalCount;var Re=new Array(Fe),De=0;for(ge=0;ge<W;ge+=1)for(J=0;J<A.length;J+=1)ge<fe[J].length&&(Re[De]=fe[J][ge],De+=1);for(ge=0;ge<le;ge+=1)for(J=0;J<A.length;J+=1)ge<pe[J].length&&(Re[De]=pe[J][ge],De+=1);return Re})(I,Y)};v.addData=function(E,L){var $=null;switch(L=L||"Byte"){case"Numeric":$=G(E);break;case"Alphanumeric":$=te(E);break;case"Byte":$=q(E);break;case"Kanji":$=V(E);break;default:throw"mode:"+L}a.push($),f=null},v.isDark=function(E,L){if(E<0||p<=E||L<0||p<=L)throw E+","+L;return l[E][L]},v.getModuleCount=function(){return p},v.make=function(){if(w<1){for(var E=1;E<40;E++){for(var L=ne.getRSBlocks(E,h),$=oe(),Y=0;Y<a.length;Y++){var I=a[Y];$.put(I.getMode(),4),$.put(I.getLength(),B.getLengthInBits(I.getMode(),E)),I.write($)}var ce=0;for(Y=0;Y<L.length;Y++)ce+=L[Y].dataCount;if($.getLengthInBits()<=8*ce)break}w=E}D(!1,(function(){for(var o=0,c=0,g=0;g<8;g+=1){D(!0,g);var A=B.getLostPoint(v);(g==0||o>A)&&(o=A,c=g)}return c})())},v.createTableTag=function(E,L){E=E||2;var $="";$+='<table style="',$+=" border-width: 0px; border-style: none;",$+=" border-collapse: collapse;",$+=" padding: 0px; margin: "+(L=L===void 0?4*E:L)+"px;",$+='">',$+="<tbody>";for(var Y=0;Y<v.getModuleCount();Y+=1){$+="<tr>";for(var I=0;I<v.getModuleCount();I+=1)$+='<td style="',$+=" border-width: 0px; border-style: none;",$+=" border-collapse: collapse;",$+=" padding: 0px; margin: 0px;",$+=" width: "+E+"px;",$+=" height: "+E+"px;",$+=" background-color: ",$+=v.isDark(Y,I)?"#000000":"#ffffff",$+=";",$+='"/>';$+="</tr>"}return($+="</tbody>")+"</table>"},v.createSvgTag=function(E,L,$,Y){var I={};typeof arguments[0]=="object"&&(E=(I=arguments[0]).cellSize,L=I.margin,$=I.alt,Y=I.title),E=E||2,L=L===void 0?4*E:L,($=typeof $=="string"?{text:$}:$||{}).text=$.text||null,$.id=$.text?$.id||"qrcode-description":null,(Y=typeof Y=="string"?{text:Y}:Y||{}).text=Y.text||null,Y.id=Y.text?Y.id||"qrcode-title":null;var ce,o,c,g,A=v.getModuleCount()*E+2*L,R="";for(g="l"+E+",0 0,"+E+" -"+E+",0 0,-"+E+"z ",R+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',R+=I.scalable?"":' width="'+A+'px" height="'+A+'px"',R+=' viewBox="0 0 '+A+" "+A+'" ',R+=' preserveAspectRatio="xMinYMin meet"',R+=Y.text||$.text?' role="img" aria-labelledby="'+ue([Y.id,$.id].join(" ").trim())+'"':"",R+=">",R+=Y.text?'<title id="'+ue(Y.id)+'">'+ue(Y.text)+"</title>":"",R+=$.text?'<description id="'+ue($.id)+'">'+ue($.text)+"</description>":"",R+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',R+='<path d="',o=0;o<v.getModuleCount();o+=1)for(c=o*E+L,ce=0;ce<v.getModuleCount();ce+=1)v.isDark(o,ce)&&(R+="M"+(ce*E+L)+","+c+g);return(R+='" stroke="transparent" fill="black"/>')+"</svg>"},v.createDataURL=function(E,L){E=E||2,L=L===void 0?4*E:L;var $=v.getModuleCount()*E+2*L,Y=L,I=$-L;return re($,$,function(ce,o){if(Y<=ce&&ce<I&&Y<=o&&o<I){var c=Math.floor((ce-Y)/E),g=Math.floor((o-Y)/E);return v.isDark(g,c)?0:1}return 1})},v.createImgTag=function(E,L,$){E=E||2,L=L===void 0?4*E:L;var Y=v.getModuleCount()*E+2*L,I="";return I+="<img",I+=' src="',I+=v.createDataURL(E,L),I+='"',I+=' width="',I+=Y,I+='"',I+=' height="',I+=Y,I+='"',$&&(I+=' alt="',I+=ue($),I+='"'),I+"/>"};var ue=function(E){for(var L="",$=0;$<E.length;$+=1){var Y=E.charAt($);switch(Y){case"<":L+="<";break;case">":L+=">";break;case"&":L+="&";break;case'"':L+=""";break;default:L+=Y}}return L};return v.createASCII=function(E,L){if((E=E||1)<2)return(function(fe){fe=fe===void 0?2:fe;var pe,J,he,me,ge,Se=1*v.getModuleCount()+2*fe,Ce=fe,ke=Se-fe,Fe={"██":"█","█ ":"▀"," █":"▄"," ":" "},Re={"██":"▀","█ ":"▀"," █":" "," ":" "},De="";for(pe=0;pe<Se;pe+=2){for(he=Math.floor((pe-Ce)/1),me=Math.floor((pe+1-Ce)/1),J=0;J<Se;J+=1)ge="█",Ce<=J&&J<ke&&Ce<=pe&&pe<ke&&v.isDark(he,Math.floor((J-Ce)/1))&&(ge=" "),Ce<=J&&J<ke&&Ce<=pe+1&&pe+1<ke&&v.isDark(me,Math.floor((J-Ce)/1))?ge+=" ":ge+="█",De+=fe<1&&pe+1>=ke?Re[ge]:Fe[ge];De+=`
|
|
20
|
-
`}return
|
|
21
|
-
`}return W.substring(0,W.length-1)},v.renderTo2dContext=function(E,L){L=L||2;for(var $=v.getModuleCount(),Y=0;Y<$;Y++)for(var I=0;I<$;I++)E.fillStyle=v.isDark(Y,I)?"black":"white",E.fillRect(Y*L,I*L,L,L)},v};M.stringToBytes=(M.stringToBytesFuncs={default:function(P){for(var x=[],w=0;w<P.length;w+=1){var h=P.charCodeAt(w);x.push(255&h)}return x}}).default,M.createStringToBytes=function(P,x){var w=(function(){for(var l=ae(P),p=function(){var z=l.read();if(z==-1)throw"eof";return z},f=0,a={};;){var v=l.read();if(v==-1)break;var D=p(),T=p()<<8|p();a[String.fromCharCode(v<<8|D)]=T,f+=1}if(f!=x)throw f+" != "+x;return a})(),h=63;return function(l){for(var p=[],f=0;f<l.length;f+=1){var a=l.charCodeAt(f);if(a<128)p.push(a);else{var v=w[l.charAt(f)];typeof v=="number"?(255&v)==v?p.push(v):(p.push(v>>>8),p.push(255&v)):p.push(h)}}return p}};var C,S,k,j,N,F={L:1,M:0,Q:3,H:2},B=(C=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],S=1335,k=7973,N=function(P){for(var x=0;P!=0;)x+=1,P>>>=1;return x},(j={}).getBCHTypeInfo=function(P){for(var x=P<<10;N(x)-N(S)>=0;)x^=S<<N(x)-N(S);return 21522^(P<<10|x)},j.getBCHTypeNumber=function(P){for(var x=P<<12;N(x)-N(k)>=0;)x^=k<<N(x)-N(k);return P<<12|x},j.getPatternPosition=function(P){return C[P-1]},j.getMaskFunction=function(P){switch(P){case 0:return function(x,w){return(x+w)%2==0};case 1:return function(x,w){return x%2==0};case 2:return function(x,w){return w%3==0};case 3:return function(x,w){return(x+w)%3==0};case 4:return function(x,w){return(Math.floor(x/2)+Math.floor(w/3))%2==0};case 5:return function(x,w){return x*w%2+x*w%3==0};case 6:return function(x,w){return(x*w%2+x*w%3)%2==0};case 7:return function(x,w){return(x*w%3+(x+w)%2)%2==0};default:throw"bad maskPattern:"+P}},j.getErrorCorrectPolynomial=function(P){for(var x=U([1],0),w=0;w<P;w+=1)x=x.multiply(U([1,Q.gexp(w)],0));return x},j.getLengthInBits=function(P,x){if(1<=x&&x<10)switch(P){case 1:return 10;case 2:return 9;case 4:case 8:return 8;default:throw"mode:"+P}else if(x<27)switch(P){case 1:return 12;case 2:return 11;case 4:return 16;case 8:return 10;default:throw"mode:"+P}else{if(!(x<41))throw"type:"+x;switch(P){case 1:return 14;case 2:return 13;case 4:return 16;case 8:return 12;default:throw"mode:"+P}}},j.getLostPoint=function(P){for(var x=P.getModuleCount(),w=0,h=0;h<x;h+=1)for(var l=0;l<x;l+=1){for(var p=0,f=P.isDark(h,l),a=-1;a<=1;a+=1)if(!(h+a<0||x<=h+a))for(var v=-1;v<=1;v+=1)l+v<0||x<=l+v||a==0&&v==0||f==P.isDark(h+a,l+v)&&(p+=1);p>5&&(w+=3+p-5)}for(h=0;h<x-1;h+=1)for(l=0;l<x-1;l+=1){var D=0;P.isDark(h,l)&&(D+=1),P.isDark(h+1,l)&&(D+=1),P.isDark(h,l+1)&&(D+=1),P.isDark(h+1,l+1)&&(D+=1),D!=0&&D!=4||(w+=3)}for(h=0;h<x;h+=1)for(l=0;l<x-6;l+=1)P.isDark(h,l)&&!P.isDark(h,l+1)&&P.isDark(h,l+2)&&P.isDark(h,l+3)&&P.isDark(h,l+4)&&!P.isDark(h,l+5)&&P.isDark(h,l+6)&&(w+=40);for(l=0;l<x;l+=1)for(h=0;h<x-6;h+=1)P.isDark(h,l)&&!P.isDark(h+1,l)&&P.isDark(h+2,l)&&P.isDark(h+3,l)&&P.isDark(h+4,l)&&!P.isDark(h+5,l)&&P.isDark(h+6,l)&&(w+=40);var T=0;for(l=0;l<x;l+=1)for(h=0;h<x;h+=1)P.isDark(h,l)&&(T+=1);return w+Math.abs(100*T/x/x-50)/5*10},j),Q=(function(){for(var P=new Array(256),x=new Array(256),w=0;w<8;w+=1)P[w]=1<<w;for(w=8;w<256;w+=1)P[w]=P[w-4]^P[w-5]^P[w-6]^P[w-8];for(w=0;w<255;w+=1)x[P[w]]=w;return{glog:function(h){if(h<1)throw"glog("+h+")";return x[h]},gexp:function(h){for(;h<0;)h+=255;for(;h>=256;)h-=255;return P[h]}}})();function U(P,x){if(P.length===void 0)throw P.length+"/"+x;var w=(function(){for(var l=0;l<P.length&&P[l]==0;)l+=1;for(var p=new Array(P.length-l+x),f=0;f<P.length-l;f+=1)p[f]=P[f+l];return p})(),h={getAt:function(l){return w[l]},getLength:function(){return w.length},multiply:function(l){for(var p=new Array(h.getLength()+l.getLength()-1),f=0;f<h.getLength();f+=1)for(var a=0;a<l.getLength();a+=1)p[f+a]^=Q.gexp(Q.glog(h.getAt(f))+Q.glog(l.getAt(a)));return U(p,0)},mod:function(l){if(h.getLength()-l.getLength()<0)return h;for(var p=Q.glog(h.getAt(0))-Q.glog(l.getAt(0)),f=new Array(h.getLength()),a=0;a<h.getLength();a+=1)f[a]=h.getAt(a);for(a=0;a<l.getLength();a+=1)f[a]^=Q.gexp(Q.glog(l.getAt(a))+p);return U(f,0).mod(l)}};return h}var ne=(function(){var P=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],x=function(h,l){var p={};return p.totalCount=h,p.dataCount=l,p},w={getRSBlocks:function(h,l){var p=(function(K,H){switch(H){case F.L:return P[4*(K-1)+0];case F.M:return P[4*(K-1)+1];case F.Q:return P[4*(K-1)+2];case F.H:return P[4*(K-1)+3];default:return}})(h,l);if(p===void 0)throw"bad rs block @ typeNumber:"+h+"/errorCorrectionLevel:"+l;for(var f=p.length/3,a=[],v=0;v<f;v+=1)for(var D=p[3*v+0],T=p[3*v+1],z=p[3*v+2],Z=0;Z<D;Z+=1)a.push(x(T,z));return a}};return w})(),oe=function(){var P=[],x=0,w={getBuffer:function(){return P},getAt:function(h){var l=Math.floor(h/8);return(P[l]>>>7-h%8&1)==1},put:function(h,l){for(var p=0;p<l;p+=1)w.putBit((h>>>l-p-1&1)==1)},getLengthInBits:function(){return x},putBit:function(h){var l=Math.floor(x/8);P.length<=l&&P.push(0),h&&(P[l]|=128>>>x%8),x+=1}};return w},G=function(P){var x=P,w={getMode:function(){return 1},getLength:function(p){return x.length},write:function(p){for(var f=x,a=0;a+2<f.length;)p.put(h(f.substring(a,a+3)),10),a+=3;a<f.length&&(f.length-a==1?p.put(h(f.substring(a,a+1)),4):f.length-a==2&&p.put(h(f.substring(a,a+2)),7))}},h=function(p){for(var f=0,a=0;a<p.length;a+=1)f=10*f+l(p.charAt(a));return f},l=function(p){if("0"<=p&&p<="9")return p.charCodeAt(0)-48;throw"illegal char :"+p};return w},te=function(P){var x=P,w={getMode:function(){return 2},getLength:function(l){return x.length},write:function(l){for(var p=x,f=0;f+1<p.length;)l.put(45*h(p.charAt(f))+h(p.charAt(f+1)),11),f+=2;f<p.length&&l.put(h(p.charAt(f)),6)}},h=function(l){if("0"<=l&&l<="9")return l.charCodeAt(0)-48;if("A"<=l&&l<="Z")return l.charCodeAt(0)-65+10;switch(l){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+l}};return w},q=function(P){var x=M.stringToBytes(P);return{getMode:function(){return 4},getLength:function(w){return x.length},write:function(w){for(var h=0;h<x.length;h+=1)w.put(x[h],8)}}},V=function(P){var x=M.stringToBytesFuncs.SJIS;if(!x)throw"sjis not supported.";(function(){var l=x("友");if(l.length!=2||(l[0]<<8|l[1])!=38726)throw"sjis not supported."})();var w=x(P),h={getMode:function(){return 8},getLength:function(l){return~~(w.length/2)},write:function(l){for(var p=w,f=0;f+1<p.length;){var a=(255&p[f])<<8|255&p[f+1];if(33088<=a&&a<=40956)a-=33088;else{if(!(57408<=a&&a<=60351))throw"illegal char at "+(f+1)+"/"+a;a-=49472}a=192*(a>>>8&255)+(255&a),l.put(a,13),f+=2}if(f<p.length)throw"illegal char at "+(f+1)}};return h},ee=function(){var P=[],x={writeByte:function(w){P.push(255&w)},writeShort:function(w){x.writeByte(w),x.writeByte(w>>>8)},writeBytes:function(w,h,l){h=h||0,l=l||w.length;for(var p=0;p<l;p+=1)x.writeByte(w[p+h])},writeString:function(w){for(var h=0;h<w.length;h+=1)x.writeByte(w.charCodeAt(h))},toByteArray:function(){return P},toString:function(){var w="";w+="[";for(var h=0;h<P.length;h+=1)h>0&&(w+=","),w+=P[h];return w+"]"}};return x},ae=function(P){var x=P,w=0,h=0,l=0,p={read:function(){for(;l<8;){if(w>=x.length){if(l==0)return-1;throw"unexpected end of file./"+l}var a=x.charAt(w);if(w+=1,a=="=")return l=0,-1;a.match(/^\s$/)||(h=h<<6|f(a.charCodeAt(0)),l+=6)}var v=h>>>l-8&255;return l-=8,v}},f=function(a){if(65<=a&&a<=90)return a-65;if(97<=a&&a<=122)return a-97+26;if(48<=a&&a<=57)return a-48+52;if(a==43)return 62;if(a==47)return 63;throw"c:"+a};return p},re=function(P,x,w){for(var h=(function(T,z){var Z=T,K=z,H=new Array(T*z),ie={setPixel:function(E,L,$){H[L*Z+E]=$},write:function(E){E.writeString("GIF87a"),E.writeShort(Z),E.writeShort(K),E.writeByte(128),E.writeByte(0),E.writeByte(0),E.writeByte(0),E.writeByte(0),E.writeByte(0),E.writeByte(255),E.writeByte(255),E.writeByte(255),E.writeString(","),E.writeShort(0),E.writeShort(0),E.writeShort(Z),E.writeShort(K),E.writeByte(0);var L=se(2);E.writeByte(2);for(var $=0;L.length-$>255;)E.writeByte(255),E.writeBytes(L,$,255),$+=255;E.writeByte(L.length-$),E.writeBytes(L,$,L.length-$),E.writeByte(0),E.writeString(";")}},se=function(E){for(var L=1<<E,$=1+(1<<E),Y=E+1,I=ue(),ce=0;ce<L;ce+=1)I.add(String.fromCharCode(ce));I.add(String.fromCharCode(L)),I.add(String.fromCharCode($));var o,c,g,A=ee(),R=(o=A,c=0,g=0,{write:function(pe,J){if(pe>>>J)throw"length over";for(;c+J>=8;)o.writeByte(255&(pe<<c|g)),J-=8-c,pe>>>=8-c,g=0,c=0;g|=pe<<c,c+=J},flush:function(){c>0&&o.writeByte(g)}});R.write(L,Y);var W=0,le=String.fromCharCode(H[W]);for(W+=1;W<H.length;){var fe=String.fromCharCode(H[W]);W+=1,I.contains(le+fe)?le+=fe:(R.write(I.indexOf(le),Y),I.size()<4095&&(I.size()==1<<Y&&(Y+=1),I.add(le+fe)),le=fe)}return R.write(I.indexOf(le),Y),R.write($,Y),R.flush(),A.toByteArray()},ue=function(){var E={},L=0,$={add:function(Y){if($.contains(Y))throw"dup key:"+Y;E[Y]=L,L+=1},size:function(){return L},indexOf:function(Y){return E[Y]},contains:function(Y){return E[Y]!==void 0}};return $};return ie})(P,x),l=0;l<x;l+=1)for(var p=0;p<P;p+=1)h.setPixel(p,l,w(p,l));var f=ee();h.write(f);for(var a=(function(){var T=0,z=0,Z=0,K="",H={},ie=function(ue){K+=String.fromCharCode(se(63&ue))},se=function(ue){if(!(ue<0)){if(ue<26)return 65+ue;if(ue<52)return ue-26+97;if(ue<62)return ue-52+48;if(ue==62)return 43;if(ue==63)return 47}throw"n:"+ue};return H.writeByte=function(ue){for(T=T<<8|255&ue,z+=8,Z+=1;z>=6;)ie(T>>>z-6),z-=6},H.flush=function(){if(z>0&&(ie(T<<6-z),T=0,z=0),Z%3!=0)for(var ue=3-Z%3,E=0;E<ue;E+=1)K+="="},H.toString=function(){return K},H})(),v=f.toByteArray(),D=0;D<v.length;D+=1)a.writeByte(v[D]);return a.flush(),"data:image/gif;base64,"+a};return M})();_.stringToBytesFuncs["UTF-8"]=function(M){return(function(C){for(var S=[],k=0;k<C.length;k++){var j=C.charCodeAt(k);j<128?S.push(j):j<2048?S.push(192|j>>6,128|63&j):j<55296||j>=57344?S.push(224|j>>12,128|j>>6&63,128|63&j):(k++,j=65536+((1023&j)<<10|1023&C.charCodeAt(k)),S.push(240|j>>18,128|j>>12&63,128|j>>6&63,128|63&j))}return S})(M)},(b=typeof(m=function(){return _})=="function"?m.apply(i,[]):m)===void 0||(d.exports=b)}},n={};function s(d){var i=n[d];if(i!==void 0)return i.exports;var m=n[d]={exports:{}};return r[d](m,m.exports,s),m.exports}s.n=d=>{var i=d&&d.__esModule?()=>d.default:()=>d;return s.d(i,{a:i}),i},s.d=(d,i)=>{for(var m in i)s.o(i,m)&&!s.o(d,m)&&Object.defineProperty(d,m,{enumerable:!0,get:i[m]})},s.o=(d,i)=>Object.prototype.hasOwnProperty.call(d,i);var u={};return(()=>{s.d(u,{default:()=>x});const d=w=>!!w&&typeof w=="object"&&!Array.isArray(w);function i(w,...h){if(!h.length)return w;const l=h.shift();return l!==void 0&&d(w)&&d(l)?(w=Object.assign({},w),Object.keys(l).forEach(p=>{const f=w[p],a=l[p];Array.isArray(f)&&Array.isArray(a)?w[p]=a:d(f)&&d(a)?w[p]=i(Object.assign({},f),a):w[p]=a}),i(w,...h)):w}function m(w,h){const l=document.createElement("a");l.download=h,l.href=w,document.body.appendChild(l),l.click(),document.body.removeChild(l)}const b={L:.07,M:.15,Q:.25,H:.3};class _{constructor({svg:h,type:l,window:p}){this._svg=h,this._type=l,this._window=p}draw(h,l,p,f){let a;switch(this._type){case"dots":a=this._drawDot;break;case"classy":a=this._drawClassy;break;case"classy-rounded":a=this._drawClassyRounded;break;case"rounded":a=this._drawRounded;break;case"extra-rounded":a=this._drawExtraRounded;break;default:a=this._drawSquare}a.call(this,{x:h,y:l,size:p,getNeighbor:f})}_rotateFigure({x:h,y:l,size:p,rotation:f=0,draw:a}){var v;const D=h+p/2,T=l+p/2;a(),(v=this._element)===null||v===void 0||v.setAttribute("transform",`rotate(${180*f/Math.PI},${D},${T})`)}_basicDot(h){const{size:l,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(p+l/2)),this._element.setAttribute("cy",String(f+l/2)),this._element.setAttribute("r",String(l/2))}}))}_basicSquare(h){const{size:l,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(p)),this._element.setAttribute("y",String(f)),this._element.setAttribute("width",String(l)),this._element.setAttribute("height",String(l))}}))}_basicSideRounded(h){const{size:l,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${p} ${f}v ${l}h `+l/2+`a ${l/2} ${l/2}, 0, 0, 0, 0 ${-l}`)}}))}_basicCornerRounded(h){const{size:l,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${p} ${f}v ${l}h ${l}v `+-l/2+`a ${l/2} ${l/2}, 0, 0, 0, ${-l/2} ${-l/2}`)}}))}_basicCornerExtraRounded(h){const{size:l,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${p} ${f}v ${l}h ${l}a ${l} ${l}, 0, 0, 0, ${-l} ${-l}`)}}))}_basicCornersRounded(h){const{size:l,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${p} ${f}v `+l/2+`a ${l/2} ${l/2}, 0, 0, 0, ${l/2} ${l/2}h `+l/2+"v "+-l/2+`a ${l/2} ${l/2}, 0, 0, 0, ${-l/2} ${-l/2}`)}}))}_drawDot({x:h,y:l,size:p}){this._basicDot({x:h,y:l,size:p,rotation:0})}_drawSquare({x:h,y:l,size:p}){this._basicSquare({x:h,y:l,size:p,rotation:0})}_drawRounded({x:h,y:l,size:p,getNeighbor:f}){const a=f?+f(-1,0):0,v=f?+f(1,0):0,D=f?+f(0,-1):0,T=f?+f(0,1):0,z=a+v+D+T;if(z!==0)if(z>2||a&&v||D&&T)this._basicSquare({x:h,y:l,size:p,rotation:0});else{if(z===2){let Z=0;return a&&D?Z=Math.PI/2:D&&v?Z=Math.PI:v&&T&&(Z=-Math.PI/2),void this._basicCornerRounded({x:h,y:l,size:p,rotation:Z})}if(z===1){let Z=0;return D?Z=Math.PI/2:v?Z=Math.PI:T&&(Z=-Math.PI/2),void this._basicSideRounded({x:h,y:l,size:p,rotation:Z})}}else this._basicDot({x:h,y:l,size:p,rotation:0})}_drawExtraRounded({x:h,y:l,size:p,getNeighbor:f}){const a=f?+f(-1,0):0,v=f?+f(1,0):0,D=f?+f(0,-1):0,T=f?+f(0,1):0,z=a+v+D+T;if(z!==0)if(z>2||a&&v||D&&T)this._basicSquare({x:h,y:l,size:p,rotation:0});else{if(z===2){let Z=0;return a&&D?Z=Math.PI/2:D&&v?Z=Math.PI:v&&T&&(Z=-Math.PI/2),void this._basicCornerExtraRounded({x:h,y:l,size:p,rotation:Z})}if(z===1){let Z=0;return D?Z=Math.PI/2:v?Z=Math.PI:T&&(Z=-Math.PI/2),void this._basicSideRounded({x:h,y:l,size:p,rotation:Z})}}else this._basicDot({x:h,y:l,size:p,rotation:0})}_drawClassy({x:h,y:l,size:p,getNeighbor:f}){const a=f?+f(-1,0):0,v=f?+f(1,0):0,D=f?+f(0,-1):0,T=f?+f(0,1):0;a+v+D+T!==0?a||D?v||T?this._basicSquare({x:h,y:l,size:p,rotation:0}):this._basicCornerRounded({x:h,y:l,size:p,rotation:Math.PI/2}):this._basicCornerRounded({x:h,y:l,size:p,rotation:-Math.PI/2}):this._basicCornersRounded({x:h,y:l,size:p,rotation:Math.PI/2})}_drawClassyRounded({x:h,y:l,size:p,getNeighbor:f}){const a=f?+f(-1,0):0,v=f?+f(1,0):0,D=f?+f(0,-1):0,T=f?+f(0,1):0;a+v+D+T!==0?a||D?v||T?this._basicSquare({x:h,y:l,size:p,rotation:0}):this._basicCornerExtraRounded({x:h,y:l,size:p,rotation:Math.PI/2}):this._basicCornerExtraRounded({x:h,y:l,size:p,rotation:-Math.PI/2}):this._basicCornersRounded({x:h,y:l,size:p,rotation:Math.PI/2})}}const M={dot:"dot",square:"square",extraRounded:"extra-rounded"},C=Object.values(M);class S{constructor({svg:h,type:l,window:p}){this._svg=h,this._type=l,this._window=p}draw(h,l,p,f){let a;switch(this._type){case M.square:a=this._drawSquare;break;case M.extraRounded:a=this._drawExtraRounded;break;default:a=this._drawDot}a.call(this,{x:h,y:l,size:p,rotation:f})}_rotateFigure({x:h,y:l,size:p,rotation:f=0,draw:a}){var v;const D=h+p/2,T=l+p/2;a(),(v=this._element)===null||v===void 0||v.setAttribute("transform",`rotate(${180*f/Math.PI},${D},${T})`)}_basicDot(h){const{size:l,x:p,y:f}=h,a=l/7;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${p+l/2} ${f}a ${l/2} ${l/2} 0 1 0 0.1 0zm 0 ${a}a ${l/2-a} ${l/2-a} 0 1 1 -0.1 0Z`)}}))}_basicSquare(h){const{size:l,x:p,y:f}=h,a=l/7;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${p} ${f}v ${l}h ${l}v `+-l+`zM ${p+a} ${f+a}h `+(l-2*a)+"v "+(l-2*a)+"h "+(2*a-l)+"z")}}))}_basicExtraRounded(h){const{size:l,x:p,y:f}=h,a=l/7;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${p} ${f+2.5*a}v `+2*a+`a ${2.5*a} ${2.5*a}, 0, 0, 0, ${2.5*a} ${2.5*a}h `+2*a+`a ${2.5*a} ${2.5*a}, 0, 0, 0, ${2.5*a} ${2.5*-a}v `+-2*a+`a ${2.5*a} ${2.5*a}, 0, 0, 0, ${2.5*-a} ${2.5*-a}h `+-2*a+`a ${2.5*a} ${2.5*a}, 0, 0, 0, ${2.5*-a} ${2.5*a}M ${p+2.5*a} ${f+a}h `+2*a+`a ${1.5*a} ${1.5*a}, 0, 0, 1, ${1.5*a} ${1.5*a}v `+2*a+`a ${1.5*a} ${1.5*a}, 0, 0, 1, ${1.5*-a} ${1.5*a}h `+-2*a+`a ${1.5*a} ${1.5*a}, 0, 0, 1, ${1.5*-a} ${1.5*-a}v `+-2*a+`a ${1.5*a} ${1.5*a}, 0, 0, 1, ${1.5*a} ${1.5*-a}`)}}))}_drawDot({x:h,y:l,size:p,rotation:f}){this._basicDot({x:h,y:l,size:p,rotation:f})}_drawSquare({x:h,y:l,size:p,rotation:f}){this._basicSquare({x:h,y:l,size:p,rotation:f})}_drawExtraRounded({x:h,y:l,size:p,rotation:f}){this._basicExtraRounded({x:h,y:l,size:p,rotation:f})}}const k={dot:"dot",square:"square"},j=Object.values(k);class N{constructor({svg:h,type:l,window:p}){this._svg=h,this._type=l,this._window=p}draw(h,l,p,f){let a;a=this._type===k.square?this._drawSquare:this._drawDot,a.call(this,{x:h,y:l,size:p,rotation:f})}_rotateFigure({x:h,y:l,size:p,rotation:f=0,draw:a}){var v;const D=h+p/2,T=l+p/2;a(),(v=this._element)===null||v===void 0||v.setAttribute("transform",`rotate(${180*f/Math.PI},${D},${T})`)}_basicDot(h){const{size:l,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(p+l/2)),this._element.setAttribute("cy",String(f+l/2)),this._element.setAttribute("r",String(l/2))}}))}_basicSquare(h){const{size:l,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(p)),this._element.setAttribute("y",String(f)),this._element.setAttribute("width",String(l)),this._element.setAttribute("height",String(l))}}))}_drawDot({x:h,y:l,size:p,rotation:f}){this._basicDot({x:h,y:l,size:p,rotation:f})}_drawSquare({x:h,y:l,size:p,rotation:f}){this._basicSquare({x:h,y:l,size:p,rotation:f})}}const F="circle",B=[[1,1,1,1,1,1,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,1,1,1,1,1,1]],Q=[[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]];class U{constructor(h,l){this._roundSize=p=>this._options.dotsOptions.roundSize?Math.floor(p):p,this._window=l,this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("width",String(h.width)),this._element.setAttribute("height",String(h.height)),this._element.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),h.dotsOptions.roundSize||this._element.setAttribute("shape-rendering","crispEdges"),this._element.setAttribute("viewBox",`0 0 ${h.width} ${h.height}`),this._defs=this._window.document.createElementNS("http://www.w3.org/2000/svg","defs"),this._element.appendChild(this._defs),this._imageUri=h.image,this._instanceId=U.instanceCount++,this._options=h}get width(){return this._options.width}get height(){return this._options.height}getElement(){return this._element}async drawQR(h){const l=h.getModuleCount(),p=Math.min(this._options.width,this._options.height)-2*this._options.margin,f=this._options.shape===F?p/Math.sqrt(2):p,a=this._roundSize(f/l);let v={hideXDots:0,hideYDots:0,width:0,height:0};if(this._qr=h,this._options.image){if(await this.loadImage(),!this._image)return;const{imageOptions:D,qrOptions:T}=this._options,z=D.imageSize*b[T.errorCorrectionLevel],Z=Math.floor(z*l*l);v=(function({originalHeight:K,originalWidth:H,maxHiddenDots:ie,maxHiddenAxisDots:se,dotSize:ue}){const E={x:0,y:0},L={x:0,y:0};if(K<=0||H<=0||ie<=0||ue<=0)return{height:0,width:0,hideYDots:0,hideXDots:0};const $=K/H;return E.x=Math.floor(Math.sqrt(ie/$)),E.x<=0&&(E.x=1),se&&se<E.x&&(E.x=se),E.x%2==0&&E.x--,L.x=E.x*ue,E.y=1+2*Math.ceil((E.x*$-1)/2),L.y=Math.round(L.x*$),(E.y*E.x>ie||se&&se<E.y)&&(se&&se<E.y?(E.y=se,E.y%2==0&&E.x--):E.y-=2,L.y=E.y*ue,E.x=1+2*Math.ceil((E.y/$-1)/2),L.x=Math.round(L.y/$)),{height:L.y,width:L.x,hideYDots:E.y,hideXDots:E.x}})({originalWidth:this._image.width,originalHeight:this._image.height,maxHiddenDots:Z,maxHiddenAxisDots:l-14,dotSize:a})}this.drawBackground(),this.drawDots((D,T)=>{var z,Z,K,H,ie,se;return!(this._options.imageOptions.hideBackgroundDots&&D>=(l-v.hideYDots)/2&&D<(l+v.hideYDots)/2&&T>=(l-v.hideXDots)/2&&T<(l+v.hideXDots)/2||!((z=B[D])===null||z===void 0)&&z[T]||!((Z=B[D-l+7])===null||Z===void 0)&&Z[T]||!((K=B[D])===null||K===void 0)&&K[T-l+7]||!((H=Q[D])===null||H===void 0)&&H[T]||!((ie=Q[D-l+7])===null||ie===void 0)&&ie[T]||!((se=Q[D])===null||se===void 0)&&se[T-l+7])}),this.drawCorners(),this._options.image&&await this.drawImage({width:v.width,height:v.height,count:l,dotSize:a})}drawBackground(){var h,l,p;const f=this._element,a=this._options;if(f){const v=(h=a.backgroundOptions)===null||h===void 0?void 0:h.gradient,D=(l=a.backgroundOptions)===null||l===void 0?void 0:l.color;let T=a.height,z=a.width;if(v||D){const Z=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");this._backgroundClipPath=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._backgroundClipPath.setAttribute("id",`clip-path-background-color-${this._instanceId}`),this._defs.appendChild(this._backgroundClipPath),!((p=a.backgroundOptions)===null||p===void 0)&&p.round&&(T=z=Math.min(a.width,a.height),Z.setAttribute("rx",String(T/2*a.backgroundOptions.round))),Z.setAttribute("x",String(this._roundSize((a.width-z)/2))),Z.setAttribute("y",String(this._roundSize((a.height-T)/2))),Z.setAttribute("width",String(z)),Z.setAttribute("height",String(T)),this._backgroundClipPath.appendChild(Z),this._createColor({options:v,color:D,additionalRotation:0,x:0,y:0,height:a.height,width:a.width,name:`background-color-${this._instanceId}`})}}}drawDots(h){var l,p;if(!this._qr)throw"QR code is not defined";const f=this._options,a=this._qr.getModuleCount();if(a>f.width||a>f.height)throw"The canvas is too small.";const v=Math.min(f.width,f.height)-2*f.margin,D=f.shape===F?v/Math.sqrt(2):v,T=this._roundSize(D/a),z=this._roundSize((f.width-a*T)/2),Z=this._roundSize((f.height-a*T)/2),K=new _({svg:this._element,type:f.dotsOptions.type,window:this._window});this._dotsClipPath=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._dotsClipPath.setAttribute("id",`clip-path-dot-color-${this._instanceId}`),this._defs.appendChild(this._dotsClipPath),this._createColor({options:(l=f.dotsOptions)===null||l===void 0?void 0:l.gradient,color:f.dotsOptions.color,additionalRotation:0,x:0,y:0,height:f.height,width:f.width,name:`dot-color-${this._instanceId}`});for(let H=0;H<a;H++)for(let ie=0;ie<a;ie++)h&&!h(H,ie)||!((p=this._qr)===null||p===void 0)&&p.isDark(H,ie)&&(K.draw(z+ie*T,Z+H*T,T,(se,ue)=>!(ie+se<0||H+ue<0||ie+se>=a||H+ue>=a)&&!(h&&!h(H+ue,ie+se))&&!!this._qr&&this._qr.isDark(H+ue,ie+se)),K._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(K._element));if(f.shape===F){const H=this._roundSize((v/T-a)/2),ie=a+2*H,se=z-H*T,ue=Z-H*T,E=[],L=this._roundSize(ie/2);for(let $=0;$<ie;$++){E[$]=[];for(let Y=0;Y<ie;Y++)$>=H-1&&$<=ie-H&&Y>=H-1&&Y<=ie-H||Math.sqrt(($-L)*($-L)+(Y-L)*(Y-L))>L?E[$][Y]=0:E[$][Y]=this._qr.isDark(Y-2*H<0?Y:Y>=a?Y-2*H:Y-H,$-2*H<0?$:$>=a?$-2*H:$-H)?1:0}for(let $=0;$<ie;$++)for(let Y=0;Y<ie;Y++)E[$][Y]&&(K.draw(se+Y*T,ue+$*T,T,(I,ce)=>{var o;return!!(!((o=E[$+ce])===null||o===void 0)&&o[Y+I])}),K._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(K._element))}}drawCorners(){if(!this._qr)throw"QR code is not defined";const h=this._element,l=this._options;if(!h)throw"Element code is not defined";const p=this._qr.getModuleCount(),f=Math.min(l.width,l.height)-2*l.margin,a=l.shape===F?f/Math.sqrt(2):f,v=this._roundSize(a/p),D=7*v,T=3*v,z=this._roundSize((l.width-p*v)/2),Z=this._roundSize((l.height-p*v)/2);[[0,0,0],[1,0,Math.PI/2],[0,1,-Math.PI/2]].forEach(([K,H,ie])=>{var se,ue,E,L,$,Y,I,ce,o,c,g,A,R,W;const le=z+K*v*(p-7),fe=Z+H*v*(p-7);let pe=this._dotsClipPath,J=this._dotsClipPath;if((!((se=l.cornersSquareOptions)===null||se===void 0)&&se.gradient||!((ue=l.cornersSquareOptions)===null||ue===void 0)&&ue.color)&&(pe=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),pe.setAttribute("id",`clip-path-corners-square-color-${K}-${H}-${this._instanceId}`),this._defs.appendChild(pe),this._cornersSquareClipPath=this._cornersDotClipPath=J=pe,this._createColor({options:(E=l.cornersSquareOptions)===null||E===void 0?void 0:E.gradient,color:(L=l.cornersSquareOptions)===null||L===void 0?void 0:L.color,additionalRotation:ie,x:le,y:fe,height:D,width:D,name:`corners-square-color-${K}-${H}-${this._instanceId}`})),(($=l.cornersSquareOptions)===null||$===void 0?void 0:$.type)&&C.includes(l.cornersSquareOptions.type)){const he=new S({svg:this._element,type:l.cornersSquareOptions.type,window:this._window});he.draw(le,fe,D,ie),he._element&&pe&&pe.appendChild(he._element)}else{const he=new _({svg:this._element,type:((Y=l.cornersSquareOptions)===null||Y===void 0?void 0:Y.type)||l.dotsOptions.type,window:this._window});for(let me=0;me<B.length;me++)for(let ge=0;ge<B[me].length;ge++)!((I=B[me])===null||I===void 0)&&I[ge]&&(he.draw(le+ge*v,fe+me*v,v,(Se,Ce)=>{var ke;return!!(!((ke=B[me+Ce])===null||ke===void 0)&&ke[ge+Se])}),he._element&&pe&&pe.appendChild(he._element))}if((!((ce=l.cornersDotOptions)===null||ce===void 0)&&ce.gradient||!((o=l.cornersDotOptions)===null||o===void 0)&&o.color)&&(J=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),J.setAttribute("id",`clip-path-corners-dot-color-${K}-${H}-${this._instanceId}`),this._defs.appendChild(J),this._cornersDotClipPath=J,this._createColor({options:(c=l.cornersDotOptions)===null||c===void 0?void 0:c.gradient,color:(g=l.cornersDotOptions)===null||g===void 0?void 0:g.color,additionalRotation:ie,x:le+2*v,y:fe+2*v,height:T,width:T,name:`corners-dot-color-${K}-${H}-${this._instanceId}`})),((A=l.cornersDotOptions)===null||A===void 0?void 0:A.type)&&j.includes(l.cornersDotOptions.type)){const he=new N({svg:this._element,type:l.cornersDotOptions.type,window:this._window});he.draw(le+2*v,fe+2*v,T,ie),he._element&&J&&J.appendChild(he._element)}else{const he=new _({svg:this._element,type:((R=l.cornersDotOptions)===null||R===void 0?void 0:R.type)||l.dotsOptions.type,window:this._window});for(let me=0;me<Q.length;me++)for(let ge=0;ge<Q[me].length;ge++)!((W=Q[me])===null||W===void 0)&&W[ge]&&(he.draw(le+ge*v,fe+me*v,v,(Se,Ce)=>{var ke;return!!(!((ke=Q[me+Ce])===null||ke===void 0)&&ke[ge+Se])}),he._element&&J&&J.appendChild(he._element))}})}loadImage(){return new Promise((h,l)=>{var p;const f=this._options;if(!f.image)return l("Image is not defined");if(!((p=f.nodeCanvas)===null||p===void 0)&&p.loadImage)f.nodeCanvas.loadImage(f.image).then(a=>{var v,D;if(this._image=a,this._options.imageOptions.saveAsBlob){const T=(v=f.nodeCanvas)===null||v===void 0?void 0:v.createCanvas(this._image.width,this._image.height);(D=T?.getContext("2d"))===null||D===void 0||D.drawImage(a,0,0),this._imageUri=T?.toDataURL()}h()}).catch(l);else{const a=new this._window.Image;typeof f.imageOptions.crossOrigin=="string"&&(a.crossOrigin=f.imageOptions.crossOrigin),this._image=a,a.onload=async()=>{this._options.imageOptions.saveAsBlob&&(this._imageUri=await(async function(v,D){return new Promise(T=>{const z=new D.XMLHttpRequest;z.onload=function(){const Z=new D.FileReader;Z.onloadend=function(){T(Z.result)},Z.readAsDataURL(z.response)},z.open("GET",v),z.responseType="blob",z.send()})})(f.image||"",this._window)),h()},a.src=f.image}})}async drawImage({width:h,height:l,count:p,dotSize:f}){const a=this._options,v=this._roundSize((a.width-p*f)/2),D=this._roundSize((a.height-p*f)/2),T=v+this._roundSize(a.imageOptions.margin+(p*f-h)/2),z=D+this._roundSize(a.imageOptions.margin+(p*f-l)/2),Z=h-2*a.imageOptions.margin,K=l-2*a.imageOptions.margin,H=this._window.document.createElementNS("http://www.w3.org/2000/svg","image");H.setAttribute("href",this._imageUri||""),H.setAttribute("xlink:href",this._imageUri||""),H.setAttribute("x",String(T)),H.setAttribute("y",String(z)),H.setAttribute("width",`${Z}px`),H.setAttribute("height",`${K}px`),this._element.appendChild(H)}_createColor({options:h,color:l,additionalRotation:p,x:f,y:a,height:v,width:D,name:T}){const z=D>v?D:v,Z=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");if(Z.setAttribute("x",String(f)),Z.setAttribute("y",String(a)),Z.setAttribute("height",String(v)),Z.setAttribute("width",String(D)),Z.setAttribute("clip-path",`url('#clip-path-${T}')`),h){let K;if(h.type==="radial")K=this._window.document.createElementNS("http://www.w3.org/2000/svg","radialGradient"),K.setAttribute("id",T),K.setAttribute("gradientUnits","userSpaceOnUse"),K.setAttribute("fx",String(f+D/2)),K.setAttribute("fy",String(a+v/2)),K.setAttribute("cx",String(f+D/2)),K.setAttribute("cy",String(a+v/2)),K.setAttribute("r",String(z/2));else{const H=((h.rotation||0)+p)%(2*Math.PI),ie=(H+2*Math.PI)%(2*Math.PI);let se=f+D/2,ue=a+v/2,E=f+D/2,L=a+v/2;ie>=0&&ie<=.25*Math.PI||ie>1.75*Math.PI&&ie<=2*Math.PI?(se-=D/2,ue-=v/2*Math.tan(H),E+=D/2,L+=v/2*Math.tan(H)):ie>.25*Math.PI&&ie<=.75*Math.PI?(ue-=v/2,se-=D/2/Math.tan(H),L+=v/2,E+=D/2/Math.tan(H)):ie>.75*Math.PI&&ie<=1.25*Math.PI?(se+=D/2,ue+=v/2*Math.tan(H),E-=D/2,L-=v/2*Math.tan(H)):ie>1.25*Math.PI&&ie<=1.75*Math.PI&&(ue+=v/2,se+=D/2/Math.tan(H),L-=v/2,E-=D/2/Math.tan(H)),K=this._window.document.createElementNS("http://www.w3.org/2000/svg","linearGradient"),K.setAttribute("id",T),K.setAttribute("gradientUnits","userSpaceOnUse"),K.setAttribute("x1",String(Math.round(se))),K.setAttribute("y1",String(Math.round(ue))),K.setAttribute("x2",String(Math.round(E))),K.setAttribute("y2",String(Math.round(L)))}h.colorStops.forEach(({offset:H,color:ie})=>{const se=this._window.document.createElementNS("http://www.w3.org/2000/svg","stop");se.setAttribute("offset",100*H+"%"),se.setAttribute("stop-color",ie),K.appendChild(se)}),Z.setAttribute("fill",`url('#${T}')`),this._defs.appendChild(K)}else l&&Z.setAttribute("fill",l);this._element.appendChild(Z)}}U.instanceCount=0;const ne=U,oe="canvas",G={};for(let w=0;w<=40;w++)G[w]=w;const te={type:oe,shape:"square",width:300,height:300,data:"",margin:0,qrOptions:{typeNumber:G[0],mode:void 0,errorCorrectionLevel:"Q"},imageOptions:{saveAsBlob:!0,hideBackgroundDots:!0,imageSize:.4,crossOrigin:void 0,margin:0},dotsOptions:{type:"square",color:"#000",roundSize:!0},backgroundOptions:{round:0,color:"#fff"}};function q(w){const h=Object.assign({},w);if(!h.colorStops||!h.colorStops.length)throw"Field 'colorStops' is required in gradient";return h.rotation?h.rotation=Number(h.rotation):h.rotation=0,h.colorStops=h.colorStops.map(l=>Object.assign(Object.assign({},l),{offset:Number(l.offset)})),h}function V(w){const h=Object.assign({},w);return h.width=Number(h.width),h.height=Number(h.height),h.margin=Number(h.margin),h.imageOptions=Object.assign(Object.assign({},h.imageOptions),{hideBackgroundDots:!!h.imageOptions.hideBackgroundDots,imageSize:Number(h.imageOptions.imageSize),margin:Number(h.imageOptions.margin)}),h.margin>Math.min(h.width,h.height)&&(h.margin=Math.min(h.width,h.height)),h.dotsOptions=Object.assign({},h.dotsOptions),h.dotsOptions.gradient&&(h.dotsOptions.gradient=q(h.dotsOptions.gradient)),h.cornersSquareOptions&&(h.cornersSquareOptions=Object.assign({},h.cornersSquareOptions),h.cornersSquareOptions.gradient&&(h.cornersSquareOptions.gradient=q(h.cornersSquareOptions.gradient))),h.cornersDotOptions&&(h.cornersDotOptions=Object.assign({},h.cornersDotOptions),h.cornersDotOptions.gradient&&(h.cornersDotOptions.gradient=q(h.cornersDotOptions.gradient))),h.backgroundOptions&&(h.backgroundOptions=Object.assign({},h.backgroundOptions),h.backgroundOptions.gradient&&(h.backgroundOptions.gradient=q(h.backgroundOptions.gradient))),h}var ee=s(873),ae=s.n(ee);function re(w){if(!w)throw new Error("Extension must be defined");w[0]==="."&&(w=w.substring(1));const h={bmp:"image/bmp",gif:"image/gif",ico:"image/vnd.microsoft.icon",jpeg:"image/jpeg",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml",tif:"image/tiff",tiff:"image/tiff",webp:"image/webp",pdf:"application/pdf"}[w.toLowerCase()];if(!h)throw new Error(`Extension "${w}" is not supported`);return h}class P{constructor(h){h!=null&&h.jsdom?this._window=new h.jsdom("",{resources:"usable"}).window:this._window=window,this._options=h?V(i(te,h)):te,this.update()}static _clearContainer(h){h&&(h.innerHTML="")}_setupSvg(){if(!this._qr)return;const h=new ne(this._options,this._window);this._svg=h.getElement(),this._svgDrawingPromise=h.drawQR(this._qr).then(()=>{var l;this._svg&&((l=this._extension)===null||l===void 0||l.call(this,h.getElement(),this._options))})}_setupCanvas(){var h,l;this._qr&&(!((h=this._options.nodeCanvas)===null||h===void 0)&&h.createCanvas?(this._nodeCanvas=this._options.nodeCanvas.createCanvas(this._options.width,this._options.height),this._nodeCanvas.width=this._options.width,this._nodeCanvas.height=this._options.height):(this._domCanvas=document.createElement("canvas"),this._domCanvas.width=this._options.width,this._domCanvas.height=this._options.height),this._setupSvg(),this._canvasDrawingPromise=(l=this._svgDrawingPromise)===null||l===void 0?void 0:l.then(()=>{var p;if(!this._svg)return;const f=this._svg,a=new this._window.XMLSerializer().serializeToString(f),v=btoa(a),D=`data:${re("svg")};base64,${v}`;if(!((p=this._options.nodeCanvas)===null||p===void 0)&&p.loadImage)return this._options.nodeCanvas.loadImage(D).then(T=>{var z,Z;T.width=this._options.width,T.height=this._options.height,(Z=(z=this._nodeCanvas)===null||z===void 0?void 0:z.getContext("2d"))===null||Z===void 0||Z.drawImage(T,0,0)});{const T=new this._window.Image;return new Promise(z=>{T.onload=()=>{var Z,K;(K=(Z=this._domCanvas)===null||Z===void 0?void 0:Z.getContext("2d"))===null||K===void 0||K.drawImage(T,0,0),z()},T.src=D})}}))}async _getElement(h="png"){if(!this._qr)throw"QR code is empty";return h.toLowerCase()==="svg"?(this._svg&&this._svgDrawingPromise||this._setupSvg(),await this._svgDrawingPromise,this._svg):((this._domCanvas||this._nodeCanvas)&&this._canvasDrawingPromise||this._setupCanvas(),await this._canvasDrawingPromise,this._domCanvas||this._nodeCanvas)}update(h){P._clearContainer(this._container),this._options=h?V(i(this._options,h)):this._options,this._options.data&&(this._qr=ae()(this._options.qrOptions.typeNumber,this._options.qrOptions.errorCorrectionLevel),this._qr.addData(this._options.data,this._options.qrOptions.mode||(function(l){switch(!0){case/^[0-9]*$/.test(l):return"Numeric";case/^[0-9A-Z $%*+\-./:]*$/.test(l):return"Alphanumeric";default:return"Byte"}})(this._options.data)),this._qr.make(),this._options.type===oe?this._setupCanvas():this._setupSvg(),this.append(this._container))}append(h){if(h){if(typeof h.appendChild!="function")throw"Container should be a single DOM node";this._options.type===oe?this._domCanvas&&h.appendChild(this._domCanvas):this._svg&&h.appendChild(this._svg),this._container=h}}applyExtension(h){if(!h)throw"Extension function should be defined.";this._extension=h,this.update()}deleteExtension(){this._extension=void 0,this.update()}async getRawData(h="png"){if(!this._qr)throw"QR code is empty";const l=await this._getElement(h),p=re(h);if(!l)return null;if(h.toLowerCase()==="svg"){const f=`<?xml version="1.0" standalone="no"?>\r
|
|
19
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),r.useMemoCache(e)}})()),uo}var ho;function ji(){return ho||(ho=1,process.env.NODE_ENV==="production"?Gr.exports=Mi():Gr.exports=Oi()),Gr.exports}ji();var fo={},qt={},po;function Ai(){if(po)return qt;po=1,qt.byteLength=i,qt.toByteArray=b,qt.fromByteArray=C;for(var t=[],e=[],r=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=n.length;s<u;++s)t[s]=n[s],e[n.charCodeAt(s)]=s;e[45]=62,e[95]=63;function d(S){var P=S.length;if(P%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var j=S.indexOf("=");j===-1&&(j=P);var N=j===P?0:4-j%4;return[j,N]}function i(S){var P=d(S),j=P[0],N=P[1];return(j+N)*3/4-N}function m(S,P,j){return(P+j)*3/4-j}function b(S){var P,j=d(S),N=j[0],F=j[1],B=new r(m(S,N,F)),K=0,q=F>0?N-4:N,te;for(te=0;te<q;te+=4)P=e[S.charCodeAt(te)]<<18|e[S.charCodeAt(te+1)]<<12|e[S.charCodeAt(te+2)]<<6|e[S.charCodeAt(te+3)],B[K++]=P>>16&255,B[K++]=P>>8&255,B[K++]=P&255;return F===2&&(P=e[S.charCodeAt(te)]<<2|e[S.charCodeAt(te+1)]>>4,B[K++]=P&255),F===1&&(P=e[S.charCodeAt(te)]<<10|e[S.charCodeAt(te+1)]<<4|e[S.charCodeAt(te+2)]>>2,B[K++]=P>>8&255,B[K++]=P&255),B}function _(S){return t[S>>18&63]+t[S>>12&63]+t[S>>6&63]+t[S&63]}function M(S,P,j){for(var N,F=[],B=P;B<j;B+=3)N=(S[B]<<16&16711680)+(S[B+1]<<8&65280)+(S[B+2]&255),F.push(_(N));return F.join("")}function C(S){for(var P,j=S.length,N=j%3,F=[],B=16383,K=0,q=j-N;K<q;K+=B)F.push(M(S,K,K+B>q?q:K+B));return N===1?(P=S[j-1],F.push(t[P>>2]+t[P<<4&63]+"==")):N===2&&(P=(S[j-2]<<8)+S[j-1],F.push(t[P>>10]+t[P>>4&63]+t[P<<2&63]+"=")),F.join("")}return qt}var Kr={};var go;function Ei(){return go||(go=1,Kr.read=function(t,e,r,n,s){var u,d,i=s*8-n-1,m=(1<<i)-1,b=m>>1,_=-7,M=r?s-1:0,C=r?-1:1,S=t[e+M];for(M+=C,u=S&(1<<-_)-1,S>>=-_,_+=i;_>0;u=u*256+t[e+M],M+=C,_-=8);for(d=u&(1<<-_)-1,u>>=-_,_+=n;_>0;d=d*256+t[e+M],M+=C,_-=8);if(u===0)u=1-b;else{if(u===m)return d?NaN:(S?-1:1)*(1/0);d=d+Math.pow(2,n),u=u-b}return(S?-1:1)*d*Math.pow(2,u-n)},Kr.write=function(t,e,r,n,s,u){var d,i,m,b=u*8-s-1,_=(1<<b)-1,M=_>>1,C=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=n?0:u-1,P=n?1:-1,j=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(i=isNaN(e)?1:0,d=_):(d=Math.floor(Math.log(e)/Math.LN2),e*(m=Math.pow(2,-d))<1&&(d--,m*=2),d+M>=1?e+=C/m:e+=C*Math.pow(2,1-M),e*m>=2&&(d++,m/=2),d+M>=_?(i=0,d=_):d+M>=1?(i=(e*m-1)*Math.pow(2,s),d=d+M):(i=e*Math.pow(2,M-1)*Math.pow(2,s),d=0));s>=8;t[r+S]=i&255,S+=P,i/=256,s-=8);for(d=d<<s|i,b+=s;b>0;t[r+S]=d&255,S+=P,d/=256,b-=8);t[r+S-P]|=j*128}),Kr}var Zr,mo;function Ti(){if(mo)return Zr;mo=1;var t={}.toString;return Zr=Array.isArray||function(e){return t.call(e)=="[object Array]"},Zr}var yo;function $i(){return yo||(yo=1,(function(t){var e=Ai(),r=Ei(),n=Ti();t.Buffer=i,t.SlowBuffer=F,t.INSPECT_MAX_BYTES=50,i.TYPED_ARRAY_SUPPORT=oo.TYPED_ARRAY_SUPPORT!==void 0?oo.TYPED_ARRAY_SUPPORT:s(),t.kMaxLength=u();function s(){try{var o=new Uint8Array(1);return o.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},o.foo()===42&&typeof o.subarray=="function"&&o.subarray(1,1).byteLength===0}catch{return!1}}function u(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function d(o,c){if(u()<c)throw new RangeError("Invalid typed array length");return i.TYPED_ARRAY_SUPPORT?(o=new Uint8Array(c),o.__proto__=i.prototype):(o===null&&(o=new i(c)),o.length=c),o}function i(o,c,g){if(!i.TYPED_ARRAY_SUPPORT&&!(this instanceof i))return new i(o,c,g);if(typeof o=="number"){if(typeof c=="string")throw new Error("If encoding is specified then the first argument must be a string");return M(this,o)}return m(this,o,c,g)}i.poolSize=8192,i._augment=function(o){return o.__proto__=i.prototype,o};function m(o,c,g,A){if(typeof c=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&c instanceof ArrayBuffer?P(o,c,g,A):typeof c=="string"?C(o,c,g):j(o,c)}i.from=function(o,c,g){return m(null,o,c,g)},i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0}));function b(o){if(typeof o!="number")throw new TypeError('"size" argument must be a number');if(o<0)throw new RangeError('"size" argument must not be negative')}function _(o,c,g,A){return b(c),c<=0?d(o,c):g!==void 0?typeof A=="string"?d(o,c).fill(g,A):d(o,c).fill(g):d(o,c)}i.alloc=function(o,c,g){return _(null,o,c,g)};function M(o,c){if(b(c),o=d(o,c<0?0:N(c)|0),!i.TYPED_ARRAY_SUPPORT)for(var g=0;g<c;++g)o[g]=0;return o}i.allocUnsafe=function(o){return M(null,o)},i.allocUnsafeSlow=function(o){return M(null,o)};function C(o,c,g){if((typeof g!="string"||g==="")&&(g="utf8"),!i.isEncoding(g))throw new TypeError('"encoding" must be a valid string encoding');var A=B(c,g)|0;o=d(o,A);var R=o.write(c,g);return R!==A&&(o=o.slice(0,R)),o}function S(o,c){var g=c.length<0?0:N(c.length)|0;o=d(o,g);for(var A=0;A<g;A+=1)o[A]=c[A]&255;return o}function P(o,c,g,A){if(c.byteLength,g<0||c.byteLength<g)throw new RangeError("'offset' is out of bounds");if(c.byteLength<g+(A||0))throw new RangeError("'length' is out of bounds");return g===void 0&&A===void 0?c=new Uint8Array(c):A===void 0?c=new Uint8Array(c,g):c=new Uint8Array(c,g,A),i.TYPED_ARRAY_SUPPORT?(o=c,o.__proto__=i.prototype):o=S(o,c),o}function j(o,c){if(i.isBuffer(c)){var g=N(c.length)|0;return o=d(o,g),o.length===0||c.copy(o,0,0,g),o}if(c){if(typeof ArrayBuffer<"u"&&c.buffer instanceof ArrayBuffer||"length"in c)return typeof c.length!="number"||de(c.length)?d(o,0):S(o,c);if(c.type==="Buffer"&&n(c.data))return S(o,c.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function N(o){if(o>=u())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u().toString(16)+" bytes");return o|0}function F(o){return+o!=o&&(o=0),i.alloc(+o)}i.isBuffer=function(o){return!!(o!=null&&o._isBuffer)},i.compare=function(o,c){if(!i.isBuffer(o)||!i.isBuffer(c))throw new TypeError("Arguments must be Buffers");if(o===c)return 0;for(var g=o.length,A=c.length,R=0,W=Math.min(g,A);R<W;++R)if(o[R]!==c[R]){g=o[R],A=c[R];break}return g<A?-1:A<g?1:0},i.isEncoding=function(o){switch(String(o).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(o,c){if(!n(o))throw new TypeError('"list" argument must be an Array of Buffers');if(o.length===0)return i.alloc(0);var g;if(c===void 0)for(c=0,g=0;g<o.length;++g)c+=o[g].length;var A=i.allocUnsafe(c),R=0;for(g=0;g<o.length;++g){var W=o[g];if(!i.isBuffer(W))throw new TypeError('"list" argument must be an Array of Buffers');W.copy(A,R),R+=W.length}return A};function B(o,c){if(i.isBuffer(o))return o.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(o)||o instanceof ArrayBuffer))return o.byteLength;typeof o!="string"&&(o=""+o);var g=o.length;if(g===0)return 0;for(var A=!1;;)switch(c){case"ascii":case"latin1":case"binary":return g;case"utf8":case"utf-8":case void 0:return E(o).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g*2;case"hex":return g>>>1;case"base64":return I(o).length;default:if(A)return E(o).length;c=(""+c).toLowerCase(),A=!0}}i.byteLength=B;function K(o,c,g){var A=!1;if((c===void 0||c<0)&&(c=0),c>this.length||((g===void 0||g>this.length)&&(g=this.length),g<=0)||(g>>>=0,c>>>=0,g<=c))return"";for(o||(o="utf8");;)switch(o){case"hex":return p(this,c,g);case"utf8":case"utf-8":return k(this,c,g);case"ascii":return h(this,c,g);case"latin1":case"binary":return l(this,c,g);case"base64":return re(this,c,g);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f(this,c,g);default:if(A)throw new TypeError("Unknown encoding: "+o);o=(o+"").toLowerCase(),A=!0}}i.prototype._isBuffer=!0;function q(o,c,g){var A=o[c];o[c]=o[g],o[g]=A}i.prototype.swap16=function(){var o=this.length;if(o%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var c=0;c<o;c+=2)q(this,c,c+1);return this},i.prototype.swap32=function(){var o=this.length;if(o%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var c=0;c<o;c+=4)q(this,c,c+3),q(this,c+1,c+2);return this},i.prototype.swap64=function(){var o=this.length;if(o%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var c=0;c<o;c+=8)q(this,c,c+7),q(this,c+1,c+6),q(this,c+2,c+5),q(this,c+3,c+4);return this},i.prototype.toString=function(){var o=this.length|0;return o===0?"":arguments.length===0?k(this,0,o):K.apply(this,arguments)},i.prototype.equals=function(o){if(!i.isBuffer(o))throw new TypeError("Argument must be a Buffer");return this===o?!0:i.compare(this,o)===0},i.prototype.inspect=function(){var o="",c=t.INSPECT_MAX_BYTES;return this.length>0&&(o=this.toString("hex",0,c).match(/.{2}/g).join(" "),this.length>c&&(o+=" ... ")),"<Buffer "+o+">"},i.prototype.compare=function(o,c,g,A,R){if(!i.isBuffer(o))throw new TypeError("Argument must be a Buffer");if(c===void 0&&(c=0),g===void 0&&(g=o?o.length:0),A===void 0&&(A=0),R===void 0&&(R=this.length),c<0||g>o.length||A<0||R>this.length)throw new RangeError("out of range index");if(A>=R&&c>=g)return 0;if(A>=R)return-1;if(c>=g)return 1;if(c>>>=0,g>>>=0,A>>>=0,R>>>=0,this===o)return 0;for(var W=R-A,le=g-c,fe=Math.min(W,le),pe=this.slice(A,R),oe=o.slice(c,g),ce=0;ce<fe;++ce)if(pe[ce]!==oe[ce]){W=pe[ce],le=oe[ce];break}return W<le?-1:le<W?1:0};function te(o,c,g,A,R){if(o.length===0)return-1;if(typeof g=="string"?(A=g,g=0):g>2147483647?g=2147483647:g<-2147483648&&(g=-2147483648),g=+g,isNaN(g)&&(g=R?0:o.length-1),g<0&&(g=o.length+g),g>=o.length){if(R)return-1;g=o.length-1}else if(g<0)if(R)g=0;else return-1;if(typeof c=="string"&&(c=i.from(c,A)),i.isBuffer(c))return c.length===0?-1:ne(o,c,g,A,R);if(typeof c=="number")return c=c&255,i.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?R?Uint8Array.prototype.indexOf.call(o,c,g):Uint8Array.prototype.lastIndexOf.call(o,c,g):ne(o,[c],g,A,R);throw new TypeError("val must be string, number or Buffer")}function ne(o,c,g,A,R){var W=1,le=o.length,fe=c.length;if(A!==void 0&&(A=String(A).toLowerCase(),A==="ucs2"||A==="ucs-2"||A==="utf16le"||A==="utf-16le")){if(o.length<2||c.length<2)return-1;W=2,le/=2,fe/=2,g/=2}function pe(Ce,Se){return W===1?Ce[Se]:Ce.readUInt16BE(Se*W)}var oe;if(R){var ce=-1;for(oe=g;oe<le;oe++)if(pe(o,oe)===pe(c,ce===-1?0:oe-ce)){if(ce===-1&&(ce=oe),oe-ce+1===fe)return ce*W}else ce!==-1&&(oe-=oe-ce),ce=-1}else for(g+fe>le&&(g=le-fe),oe=g;oe>=0;oe--){for(var ge=!0,me=0;me<fe;me++)if(pe(o,oe+me)!==pe(c,me)){ge=!1;break}if(ge)return oe}return-1}i.prototype.includes=function(o,c,g){return this.indexOf(o,c,g)!==-1},i.prototype.indexOf=function(o,c,g){return te(this,o,c,g,!0)},i.prototype.lastIndexOf=function(o,c,g){return te(this,o,c,g,!1)};function G(o,c,g,A){g=Number(g)||0;var R=o.length-g;A?(A=Number(A),A>R&&(A=R)):A=R;var W=c.length;if(W%2!==0)throw new TypeError("Invalid hex string");A>W/2&&(A=W/2);for(var le=0;le<A;++le){var fe=parseInt(c.substr(le*2,2),16);if(isNaN(fe))return le;o[g+le]=fe}return le}function ee(o,c,g,A){return Y(E(c,o.length-g),o,g,A)}function V(o,c,g,A){return Y(L(c),o,g,A)}function H(o,c,g,A){return V(o,c,g,A)}function X(o,c,g,A){return Y(I(c),o,g,A)}function ie(o,c,g,A){return Y($(c,o.length-g),o,g,A)}i.prototype.write=function(o,c,g,A){if(c===void 0)A="utf8",g=this.length,c=0;else if(g===void 0&&typeof c=="string")A=c,g=this.length,c=0;else if(isFinite(c))c=c|0,isFinite(g)?(g=g|0,A===void 0&&(A="utf8")):(A=g,g=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var R=this.length-c;if((g===void 0||g>R)&&(g=R),o.length>0&&(g<0||c<0)||c>this.length)throw new RangeError("Attempt to write outside buffer bounds");A||(A="utf8");for(var W=!1;;)switch(A){case"hex":return G(this,o,c,g);case"utf8":case"utf-8":return ee(this,o,c,g);case"ascii":return V(this,o,c,g);case"latin1":case"binary":return H(this,o,c,g);case"base64":return X(this,o,c,g);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ie(this,o,c,g);default:if(W)throw new TypeError("Unknown encoding: "+A);A=(""+A).toLowerCase(),W=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function re(o,c,g){return c===0&&g===o.length?e.fromByteArray(o):e.fromByteArray(o.slice(c,g))}function k(o,c,g){g=Math.min(o.length,g);for(var A=[],R=c;R<g;){var W=o[R],le=null,fe=W>239?4:W>223?3:W>191?2:1;if(R+fe<=g){var pe,oe,ce,ge;switch(fe){case 1:W<128&&(le=W);break;case 2:pe=o[R+1],(pe&192)===128&&(ge=(W&31)<<6|pe&63,ge>127&&(le=ge));break;case 3:pe=o[R+1],oe=o[R+2],(pe&192)===128&&(oe&192)===128&&(ge=(W&15)<<12|(pe&63)<<6|oe&63,ge>2047&&(ge<55296||ge>57343)&&(le=ge));break;case 4:pe=o[R+1],oe=o[R+2],ce=o[R+3],(pe&192)===128&&(oe&192)===128&&(ce&192)===128&&(ge=(W&15)<<18|(pe&63)<<12|(oe&63)<<6|ce&63,ge>65535&&ge<1114112&&(le=ge))}}le===null?(le=65533,fe=1):le>65535&&(le-=65536,A.push(le>>>10&1023|55296),le=56320|le&1023),A.push(le),R+=fe}return w(A)}var x=4096;function w(o){var c=o.length;if(c<=x)return String.fromCharCode.apply(String,o);for(var g="",A=0;A<c;)g+=String.fromCharCode.apply(String,o.slice(A,A+=x));return g}function h(o,c,g){var A="";g=Math.min(o.length,g);for(var R=c;R<g;++R)A+=String.fromCharCode(o[R]&127);return A}function l(o,c,g){var A="";g=Math.min(o.length,g);for(var R=c;R<g;++R)A+=String.fromCharCode(o[R]);return A}function p(o,c,g){var A=o.length;(!c||c<0)&&(c=0),(!g||g<0||g>A)&&(g=A);for(var R="",W=c;W<g;++W)R+=ue(o[W]);return R}function f(o,c,g){for(var A=o.slice(c,g),R="",W=0;W<A.length;W+=2)R+=String.fromCharCode(A[W]+A[W+1]*256);return R}i.prototype.slice=function(o,c){var g=this.length;o=~~o,c=c===void 0?g:~~c,o<0?(o+=g,o<0&&(o=0)):o>g&&(o=g),c<0?(c+=g,c<0&&(c=0)):c>g&&(c=g),c<o&&(c=o);var A;if(i.TYPED_ARRAY_SUPPORT)A=this.subarray(o,c),A.__proto__=i.prototype;else{var R=c-o;A=new i(R,void 0);for(var W=0;W<R;++W)A[W]=this[W+o]}return A};function a(o,c,g){if(o%1!==0||o<0)throw new RangeError("offset is not uint");if(o+c>g)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUIntLE=function(o,c,g){o=o|0,c=c|0,g||a(o,c,this.length);for(var A=this[o],R=1,W=0;++W<c&&(R*=256);)A+=this[o+W]*R;return A},i.prototype.readUIntBE=function(o,c,g){o=o|0,c=c|0,g||a(o,c,this.length);for(var A=this[o+--c],R=1;c>0&&(R*=256);)A+=this[o+--c]*R;return A},i.prototype.readUInt8=function(o,c){return c||a(o,1,this.length),this[o]},i.prototype.readUInt16LE=function(o,c){return c||a(o,2,this.length),this[o]|this[o+1]<<8},i.prototype.readUInt16BE=function(o,c){return c||a(o,2,this.length),this[o]<<8|this[o+1]},i.prototype.readUInt32LE=function(o,c){return c||a(o,4,this.length),(this[o]|this[o+1]<<8|this[o+2]<<16)+this[o+3]*16777216},i.prototype.readUInt32BE=function(o,c){return c||a(o,4,this.length),this[o]*16777216+(this[o+1]<<16|this[o+2]<<8|this[o+3])},i.prototype.readIntLE=function(o,c,g){o=o|0,c=c|0,g||a(o,c,this.length);for(var A=this[o],R=1,W=0;++W<c&&(R*=256);)A+=this[o+W]*R;return R*=128,A>=R&&(A-=Math.pow(2,8*c)),A},i.prototype.readIntBE=function(o,c,g){o=o|0,c=c|0,g||a(o,c,this.length);for(var A=c,R=1,W=this[o+--A];A>0&&(R*=256);)W+=this[o+--A]*R;return R*=128,W>=R&&(W-=Math.pow(2,8*c)),W},i.prototype.readInt8=function(o,c){return c||a(o,1,this.length),this[o]&128?(255-this[o]+1)*-1:this[o]},i.prototype.readInt16LE=function(o,c){c||a(o,2,this.length);var g=this[o]|this[o+1]<<8;return g&32768?g|4294901760:g},i.prototype.readInt16BE=function(o,c){c||a(o,2,this.length);var g=this[o+1]|this[o]<<8;return g&32768?g|4294901760:g},i.prototype.readInt32LE=function(o,c){return c||a(o,4,this.length),this[o]|this[o+1]<<8|this[o+2]<<16|this[o+3]<<24},i.prototype.readInt32BE=function(o,c){return c||a(o,4,this.length),this[o]<<24|this[o+1]<<16|this[o+2]<<8|this[o+3]},i.prototype.readFloatLE=function(o,c){return c||a(o,4,this.length),r.read(this,o,!0,23,4)},i.prototype.readFloatBE=function(o,c){return c||a(o,4,this.length),r.read(this,o,!1,23,4)},i.prototype.readDoubleLE=function(o,c){return c||a(o,8,this.length),r.read(this,o,!0,52,8)},i.prototype.readDoubleBE=function(o,c){return c||a(o,8,this.length),r.read(this,o,!1,52,8)};function v(o,c,g,A,R,W){if(!i.isBuffer(o))throw new TypeError('"buffer" argument must be a Buffer instance');if(c>R||c<W)throw new RangeError('"value" argument is out of bounds');if(g+A>o.length)throw new RangeError("Index out of range")}i.prototype.writeUIntLE=function(o,c,g,A){if(o=+o,c=c|0,g=g|0,!A){var R=Math.pow(2,8*g)-1;v(this,o,c,g,R,0)}var W=1,le=0;for(this[c]=o&255;++le<g&&(W*=256);)this[c+le]=o/W&255;return c+g},i.prototype.writeUIntBE=function(o,c,g,A){if(o=+o,c=c|0,g=g|0,!A){var R=Math.pow(2,8*g)-1;v(this,o,c,g,R,0)}var W=g-1,le=1;for(this[c+W]=o&255;--W>=0&&(le*=256);)this[c+W]=o/le&255;return c+g},i.prototype.writeUInt8=function(o,c,g){return o=+o,c=c|0,g||v(this,o,c,1,255,0),i.TYPED_ARRAY_SUPPORT||(o=Math.floor(o)),this[c]=o&255,c+1};function D(o,c,g,A){c<0&&(c=65535+c+1);for(var R=0,W=Math.min(o.length-g,2);R<W;++R)o[g+R]=(c&255<<8*(A?R:1-R))>>>(A?R:1-R)*8}i.prototype.writeUInt16LE=function(o,c,g){return o=+o,c=c|0,g||v(this,o,c,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[c]=o&255,this[c+1]=o>>>8):D(this,o,c,!0),c+2},i.prototype.writeUInt16BE=function(o,c,g){return o=+o,c=c|0,g||v(this,o,c,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[c]=o>>>8,this[c+1]=o&255):D(this,o,c,!1),c+2};function T(o,c,g,A){c<0&&(c=4294967295+c+1);for(var R=0,W=Math.min(o.length-g,4);R<W;++R)o[g+R]=c>>>(A?R:3-R)*8&255}i.prototype.writeUInt32LE=function(o,c,g){return o=+o,c=c|0,g||v(this,o,c,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[c+3]=o>>>24,this[c+2]=o>>>16,this[c+1]=o>>>8,this[c]=o&255):T(this,o,c,!0),c+4},i.prototype.writeUInt32BE=function(o,c,g){return o=+o,c=c|0,g||v(this,o,c,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[c]=o>>>24,this[c+1]=o>>>16,this[c+2]=o>>>8,this[c+3]=o&255):T(this,o,c,!1),c+4},i.prototype.writeIntLE=function(o,c,g,A){if(o=+o,c=c|0,!A){var R=Math.pow(2,8*g-1);v(this,o,c,g,R-1,-R)}var W=0,le=1,fe=0;for(this[c]=o&255;++W<g&&(le*=256);)o<0&&fe===0&&this[c+W-1]!==0&&(fe=1),this[c+W]=(o/le>>0)-fe&255;return c+g},i.prototype.writeIntBE=function(o,c,g,A){if(o=+o,c=c|0,!A){var R=Math.pow(2,8*g-1);v(this,o,c,g,R-1,-R)}var W=g-1,le=1,fe=0;for(this[c+W]=o&255;--W>=0&&(le*=256);)o<0&&fe===0&&this[c+W+1]!==0&&(fe=1),this[c+W]=(o/le>>0)-fe&255;return c+g},i.prototype.writeInt8=function(o,c,g){return o=+o,c=c|0,g||v(this,o,c,1,127,-128),i.TYPED_ARRAY_SUPPORT||(o=Math.floor(o)),o<0&&(o=255+o+1),this[c]=o&255,c+1},i.prototype.writeInt16LE=function(o,c,g){return o=+o,c=c|0,g||v(this,o,c,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[c]=o&255,this[c+1]=o>>>8):D(this,o,c,!0),c+2},i.prototype.writeInt16BE=function(o,c,g){return o=+o,c=c|0,g||v(this,o,c,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[c]=o>>>8,this[c+1]=o&255):D(this,o,c,!1),c+2},i.prototype.writeInt32LE=function(o,c,g){return o=+o,c=c|0,g||v(this,o,c,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[c]=o&255,this[c+1]=o>>>8,this[c+2]=o>>>16,this[c+3]=o>>>24):T(this,o,c,!0),c+4},i.prototype.writeInt32BE=function(o,c,g){return o=+o,c=c|0,g||v(this,o,c,4,2147483647,-2147483648),o<0&&(o=4294967295+o+1),i.TYPED_ARRAY_SUPPORT?(this[c]=o>>>24,this[c+1]=o>>>16,this[c+2]=o>>>8,this[c+3]=o&255):T(this,o,c,!1),c+4};function z(o,c,g,A,R,W){if(g+A>o.length)throw new RangeError("Index out of range");if(g<0)throw new RangeError("Index out of range")}function Q(o,c,g,A,R){return R||z(o,c,g,4),r.write(o,c,g,A,23,4),g+4}i.prototype.writeFloatLE=function(o,c,g){return Q(this,o,c,!0,g)},i.prototype.writeFloatBE=function(o,c,g){return Q(this,o,c,!1,g)};function Z(o,c,g,A,R){return R||z(o,c,g,8),r.write(o,c,g,A,52,8),g+8}i.prototype.writeDoubleLE=function(o,c,g){return Z(this,o,c,!0,g)},i.prototype.writeDoubleBE=function(o,c,g){return Z(this,o,c,!1,g)},i.prototype.copy=function(o,c,g,A){if(g||(g=0),!A&&A!==0&&(A=this.length),c>=o.length&&(c=o.length),c||(c=0),A>0&&A<g&&(A=g),A===g||o.length===0||this.length===0)return 0;if(c<0)throw new RangeError("targetStart out of bounds");if(g<0||g>=this.length)throw new RangeError("sourceStart out of bounds");if(A<0)throw new RangeError("sourceEnd out of bounds");A>this.length&&(A=this.length),o.length-c<A-g&&(A=o.length-c+g);var R=A-g,W;if(this===o&&g<c&&c<A)for(W=R-1;W>=0;--W)o[W+c]=this[W+g];else if(R<1e3||!i.TYPED_ARRAY_SUPPORT)for(W=0;W<R;++W)o[W+c]=this[W+g];else Uint8Array.prototype.set.call(o,this.subarray(g,g+R),c);return R},i.prototype.fill=function(o,c,g,A){if(typeof o=="string"){if(typeof c=="string"?(A=c,c=0,g=this.length):typeof g=="string"&&(A=g,g=this.length),o.length===1){var R=o.charCodeAt(0);R<256&&(o=R)}if(A!==void 0&&typeof A!="string")throw new TypeError("encoding must be a string");if(typeof A=="string"&&!i.isEncoding(A))throw new TypeError("Unknown encoding: "+A)}else typeof o=="number"&&(o=o&255);if(c<0||this.length<c||this.length<g)throw new RangeError("Out of range index");if(g<=c)return this;c=c>>>0,g=g===void 0?this.length:g>>>0,o||(o=0);var W;if(typeof o=="number")for(W=c;W<g;++W)this[W]=o;else{var le=i.isBuffer(o)?o:E(new i(o,A).toString()),fe=le.length;for(W=0;W<g-c;++W)this[W+c]=le[W%fe]}return this};var U=/[^+\/0-9A-Za-z-_]/g;function ae(o){if(o=se(o).replace(U,""),o.length<2)return"";for(;o.length%4!==0;)o=o+"=";return o}function se(o){return o.trim?o.trim():o.replace(/^\s+|\s+$/g,"")}function ue(o){return o<16?"0"+o.toString(16):o.toString(16)}function E(o,c){c=c||1/0;for(var g,A=o.length,R=null,W=[],le=0;le<A;++le){if(g=o.charCodeAt(le),g>55295&&g<57344){if(!R){if(g>56319){(c-=3)>-1&&W.push(239,191,189);continue}else if(le+1===A){(c-=3)>-1&&W.push(239,191,189);continue}R=g;continue}if(g<56320){(c-=3)>-1&&W.push(239,191,189),R=g;continue}g=(R-55296<<10|g-56320)+65536}else R&&(c-=3)>-1&&W.push(239,191,189);if(R=null,g<128){if((c-=1)<0)break;W.push(g)}else if(g<2048){if((c-=2)<0)break;W.push(g>>6|192,g&63|128)}else if(g<65536){if((c-=3)<0)break;W.push(g>>12|224,g>>6&63|128,g&63|128)}else if(g<1114112){if((c-=4)<0)break;W.push(g>>18|240,g>>12&63|128,g>>6&63|128,g&63|128)}else throw new Error("Invalid code point")}return W}function L(o){for(var c=[],g=0;g<o.length;++g)c.push(o.charCodeAt(g)&255);return c}function $(o,c){for(var g,A,R,W=[],le=0;le<o.length&&!((c-=2)<0);++le)g=o.charCodeAt(le),A=g>>8,R=g%256,W.push(R),W.push(A);return W}function I(o){return e.toByteArray(ae(o))}function Y(o,c,g,A){for(var R=0;R<A&&!(R+g>=c.length||R>=o.length);++R)c[R+g]=o[R];return R}function de(o){return o!==o}})(fo)),fo}$i();var Pt;if(typeof window<"u"&&window.crypto&&(Pt=window.crypto),!Pt&&typeof window<"u"&&window.msCrypto&&(Pt=window.msCrypto),!Pt&&typeof global<"u"&&global.crypto&&(Pt=global.crypto),!Pt&&typeof require=="function")try{Pt=require("crypto")}catch{}var vo={};var Jr=function(t,e){return Jr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var s in n)n.hasOwnProperty(s)&&(r[s]=n[s])},Jr(t,e)};function Ri(t,e){Jr(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Xr=function(){return Xr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},Xr.apply(this,arguments)};function Ni(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]]);return r}function Li(t,e,r,n){var s=arguments.length,u=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(t,e,r,n);else for(var i=t.length-1;i>=0;i--)(d=t[i])&&(u=(s<3?d(u):s>3?d(e,r,u):d(e,r))||u);return s>3&&u&&Object.defineProperty(e,r,u),u}function Bi(t,e){return function(r,n){e(r,n,t)}}function Ii(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Yi(t,e,r,n){function s(u){return u instanceof r?u:new r(function(d){d(u)})}return new(r||(r=Promise))(function(u,d){function i(_){try{b(n.next(_))}catch(M){d(M)}}function m(_){try{b(n.throw(_))}catch(M){d(M)}}function b(_){_.done?u(_.value):s(_.value).then(i,m)}b((n=n.apply(t,e||[])).next())})}function zi(t,e){var r={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},n,s,u,d;return d={next:i(0),throw:i(1),return:i(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function i(b){return function(_){return m([b,_])}}function m(b){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,s&&(u=b[0]&2?s.return:b[0]?s.throw||((u=s.return)&&u.call(s),0):s.next)&&!(u=u.call(s,b[1])).done)return u;switch(s=0,u&&(b=[b[0]&2,u.value]),b[0]){case 0:case 1:u=b;break;case 4:return r.label++,{value:b[1],done:!1};case 5:r.label++,s=b[1],b=[0];continue;case 7:b=r.ops.pop(),r.trys.pop();continue;default:if(u=r.trys,!(u=u.length>0&&u[u.length-1])&&(b[0]===6||b[0]===2)){r=0;continue}if(b[0]===3&&(!u||b[1]>u[0]&&b[1]<u[3])){r.label=b[1];break}if(b[0]===6&&r.label<u[1]){r.label=u[1],u=b;break}if(u&&r.label<u[2]){r.label=u[2],r.ops.push(b);break}u[2]&&r.ops.pop(),r.trys.pop();continue}b=e.call(t,r)}catch(_){b=[6,_],s=0}finally{n=u=0}if(b[0]&5)throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}}function Fi(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Wi(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function en(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function bo(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),s,u=[],d;try{for(;(e===void 0||e-- >0)&&!(s=n.next()).done;)u.push(s.value)}catch(i){d={error:i}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(d)throw d.error}}return u}function Ui(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(bo(arguments[e]));return t}function qi(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),s=0,e=0;e<r;e++)for(var u=arguments[e],d=0,i=u.length;d<i;d++,s++)n[s]=u[d];return n}function Vt(t){return this instanceof Vt?(this.v=t,this):new Vt(t)}function Vi(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),s,u=[];return s={},d("next"),d("throw"),d("return"),s[Symbol.asyncIterator]=function(){return this},s;function d(C){n[C]&&(s[C]=function(S){return new Promise(function(P,j){u.push([C,S,P,j])>1||i(C,S)})})}function i(C,S){try{m(n[C](S))}catch(P){M(u[0][3],P)}}function m(C){C.value instanceof Vt?Promise.resolve(C.value.v).then(b,_):M(u[0][2],C)}function b(C){i("next",C)}function _(C){i("throw",C)}function M(C,S){C(S),u.shift(),u.length&&i(u[0][0],u[0][1])}}function Hi(t){var e,r;return e={},n("next"),n("throw",function(s){throw s}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(s,u){e[s]=t[s]?function(d){return(r=!r)?{value:Vt(t[s](d)),done:s==="return"}:u?u(d):d}:u}}function Gi(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof en=="function"?en(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(u){r[u]=t[u]&&function(d){return new Promise(function(i,m){d=t[u](d),s(i,m,d.done,d.value)})}}function s(u,d,i,m){Promise.resolve(m).then(function(b){u({value:b,done:i})},d)}}function Qi(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Ki(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function Zi(t){return t&&t.__esModule?t:{default:t}}function Ji(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Xi(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}const ea=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Xr},__asyncDelegator:Hi,__asyncGenerator:Vi,__asyncValues:Gi,__await:Vt,__awaiter:Yi,__classPrivateFieldGet:Ji,__classPrivateFieldSet:Xi,__createBinding:Fi,__decorate:Li,__exportStar:Wi,__extends:Ri,__generator:zi,__importDefault:Zi,__importStar:Ki,__makeTemplateObject:Qi,__metadata:Ii,__param:Bi,__read:bo,__rest:Ni,__spread:Ui,__spreadArrays:qi,__values:en},Symbol.toStringTag,{value:"Module"})),wo=Vr(ea);var Ht={},Ve={},_o;function xo(){return _o||(_o=1,Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.MAX_HASHABLE_LENGTH=Ve.INIT=Ve.KEY=Ve.DIGEST_LENGTH=Ve.BLOCK_SIZE=void 0,Ve.BLOCK_SIZE=64,Ve.DIGEST_LENGTH=32,Ve.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ve.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],Ve.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1),Ve}var Gt={},Co;function ta(){if(Co)return Gt;Co=1,Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.RawSha256=void 0;var t=xo(),e=(function(){function r(){this.state=Int32Array.from(t.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return r.prototype.update=function(n){if(this.finished)throw new Error("Attempted to update an already finished hash.");var s=0,u=n.byteLength;if(this.bytesHashed+=u,this.bytesHashed*8>t.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;u>0;)this.buffer[this.bufferLength++]=n[s++],u--,this.bufferLength===t.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},r.prototype.digest=function(){if(!this.finished){var n=this.bytesHashed*8,s=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),u=this.bufferLength;if(s.setUint8(this.bufferLength++,128),u%t.BLOCK_SIZE>=t.BLOCK_SIZE-8){for(var d=this.bufferLength;d<t.BLOCK_SIZE;d++)s.setUint8(d,0);this.hashBuffer(),this.bufferLength=0}for(var d=this.bufferLength;d<t.BLOCK_SIZE-8;d++)s.setUint8(d,0);s.setUint32(t.BLOCK_SIZE-8,Math.floor(n/4294967296),!0),s.setUint32(t.BLOCK_SIZE-4,n),this.hashBuffer(),this.finished=!0}for(var i=new Uint8Array(t.DIGEST_LENGTH),d=0;d<8;d++)i[d*4]=this.state[d]>>>24&255,i[d*4+1]=this.state[d]>>>16&255,i[d*4+2]=this.state[d]>>>8&255,i[d*4+3]=this.state[d]>>>0&255;return i},r.prototype.hashBuffer=function(){for(var n=this,s=n.buffer,u=n.state,d=u[0],i=u[1],m=u[2],b=u[3],_=u[4],M=u[5],C=u[6],S=u[7],P=0;P<t.BLOCK_SIZE;P++){if(P<16)this.temp[P]=(s[P*4]&255)<<24|(s[P*4+1]&255)<<16|(s[P*4+2]&255)<<8|s[P*4+3]&255;else{var j=this.temp[P-2],N=(j>>>17|j<<15)^(j>>>19|j<<13)^j>>>10;j=this.temp[P-15];var F=(j>>>7|j<<25)^(j>>>18|j<<14)^j>>>3;this.temp[P]=(N+this.temp[P-7]|0)+(F+this.temp[P-16]|0)}var B=(((_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&M^~_&C)|0)+(S+(t.KEY[P]+this.temp[P]|0)|0)|0,K=((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+(d&i^d&m^i&m)|0;S=C,C=M,M=_,_=b+B|0,b=m,m=i,i=d,d=B+K|0}u[0]+=d,u[1]+=i,u[2]+=m,u[3]+=b,u[4]+=_,u[5]+=M,u[6]+=C,u[7]+=S},r})();return Gt.RawSha256=e,Gt}var So={},Qt={};const ra=t=>{const e=[];for(let r=0,n=t.length;r<n;r++){const s=t.charCodeAt(r);if(s<128)e.push(s);else if(s<2048)e.push(s>>6|192,s&63|128);else if(r+1<t.length&&(s&64512)===55296&&(t.charCodeAt(r+1)&64512)===56320){const u=65536+((s&1023)<<10)+(t.charCodeAt(++r)&1023);e.push(u>>18|240,u>>12&63|128,u>>6&63|128,u&63|128)}else e.push(s>>12|224,s>>6&63|128,s&63|128)}return Uint8Array.from(e)},na=t=>{let e="";for(let r=0,n=t.length;r<n;r++){const s=t[r];if(s<128)e+=String.fromCharCode(s);else if(192<=s&&s<224){const u=t[++r];e+=String.fromCharCode((s&31)<<6|u&63)}else if(240<=s&&s<365){const u="%"+[s,t[++r],t[++r],t[++r]].map(d=>d.toString(16)).join("%");e+=decodeURIComponent(u)}else e+=String.fromCharCode((s&15)<<12|(t[++r]&63)<<6|t[++r]&63)}return e};function oa(t){return new TextEncoder().encode(t)}function sa(t){return new TextDecoder("utf-8").decode(t)}const ia=t=>typeof TextEncoder=="function"?oa(t):ra(t),aa=t=>typeof TextDecoder=="function"?sa(t):na(t),la=Object.freeze(Object.defineProperty({__proto__:null,fromUtf8:ia,toUtf8:aa},Symbol.toStringTag,{value:"Module"})),ua=Vr(la);var Do;function ca(){if(Do)return Qt;Do=1,Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.convertToBuffer=void 0;var t=ua,e=typeof Buffer<"u"&&Buffer.from?function(n){return Buffer.from(n,"utf8")}:t.fromUtf8;function r(n){return n instanceof Uint8Array?n:typeof n=="string"?e(n):ArrayBuffer.isView(n)?new Uint8Array(n.buffer,n.byteOffset,n.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(n)}return Qt.convertToBuffer=r,Qt}var Kt={},ko;function da(){if(ko)return Kt;ko=1,Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.isEmptyData=void 0;function t(e){return typeof e=="string"?e.length===0:e.byteLength===0}return Kt.isEmptyData=t,Kt}var Zt={},Po;function ha(){if(Po)return Zt;Po=1,Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.numToUint8=void 0;function t(e){return new Uint8Array([(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255])}return Zt.numToUint8=t,Zt}var Jt={},Mo;function fa(){if(Mo)return Jt;Mo=1,Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.uint32ArrayFrom=void 0;function t(e){if(!Array.from){for(var r=new Uint32Array(e.length),n=0;n<e.length;)r[n]=e[n];return r}return Uint32Array.from(e)}return Jt.uint32ArrayFrom=t,Jt}var Oo;function pa(){return Oo||(Oo=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=t.numToUint8=t.isEmptyData=t.convertToBuffer=void 0;var e=ca();Object.defineProperty(t,"convertToBuffer",{enumerable:!0,get:function(){return e.convertToBuffer}});var r=da();Object.defineProperty(t,"isEmptyData",{enumerable:!0,get:function(){return r.isEmptyData}});var n=ha();Object.defineProperty(t,"numToUint8",{enumerable:!0,get:function(){return n.numToUint8}});var s=fa();Object.defineProperty(t,"uint32ArrayFrom",{enumerable:!0,get:function(){return s.uint32ArrayFrom}})})(So)),So}var jo;function ga(){if(jo)return Ht;jo=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.Sha256=void 0;var t=wo,e=xo(),r=ta(),n=pa(),s=(function(){function d(i){if(this.hash=new r.RawSha256,i){this.outer=new r.RawSha256;var m=u(i),b=new Uint8Array(e.BLOCK_SIZE);b.set(m);for(var _=0;_<e.BLOCK_SIZE;_++)m[_]^=54,b[_]^=92;this.hash.update(m),this.outer.update(b);for(var _=0;_<m.byteLength;_++)m[_]=0}}return d.prototype.update=function(i){if(!((0,n.isEmptyData)(i)||this.error))try{this.hash.update((0,n.convertToBuffer)(i))}catch(m){this.error=m}},d.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},d.prototype.digest=function(){return(0,t.__awaiter)(this,void 0,void 0,function(){return(0,t.__generator)(this,function(i){return[2,this.digestSync()]})})},d})();Ht.Sha256=s;function u(d){var i=(0,n.convertToBuffer)(d);if(i.byteLength>e.BLOCK_SIZE){var m=new r.RawSha256;m.update(i),i=m.digest()}var b=new Uint8Array(e.BLOCK_SIZE);return b.set(i),b}return Ht}var Ao;function ma(){return Ao||(Ao=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=wo;(0,e.__exportStar)(ga(),t)})(vo)),vo}ma();function ye(t,e){t!=null&&this.fromString(t,e)}function Le(){return new ye(null)}var pt,ya=0xdeadbeefcafe,Eo=(ya&16777215)==15715070;function va(t,e,r,n,s,u){for(;--u>=0;){var d=e*this[t++]+r[n]+s;s=Math.floor(d/67108864),r[n++]=d&67108863}return s}function ba(t,e,r,n,s,u){for(var d=e&32767,i=e>>15;--u>=0;){var m=this[t]&32767,b=this[t++]>>15,_=i*m+b*d;m=d*m+((_&32767)<<15)+r[n]+(s&1073741823),s=(m>>>30)+(_>>>15)+i*b+(s>>>30),r[n++]=m&1073741823}return s}function wa(t,e,r,n,s,u){for(var d=e&16383,i=e>>14;--u>=0;){var m=this[t]&16383,b=this[t++]>>14,_=i*m+b*d;m=d*m+((_&16383)<<14)+r[n]+s,s=(m>>28)+(_>>14)+i*b,r[n++]=m&268435455}return s}var To=typeof navigator<"u";To&&Eo&&navigator.appName=="Microsoft Internet Explorer"?(ye.prototype.am=ba,pt=30):To&&Eo&&navigator.appName!="Netscape"?(ye.prototype.am=va,pt=26):(ye.prototype.am=wa,pt=28),ye.prototype.DB=pt,ye.prototype.DM=(1<<pt)-1,ye.prototype.DV=1<<pt;var tn=52;ye.prototype.FV=Math.pow(2,tn),ye.prototype.F1=tn-pt,ye.prototype.F2=2*pt-tn;var _a="0123456789abcdefghijklmnopqrstuvwxyz",dr=new Array,Tt,He;for(Tt=48,He=0;He<=9;++He)dr[Tt++]=He;for(Tt=97,He=10;He<36;++He)dr[Tt++]=He;for(Tt=65,He=10;He<36;++He)dr[Tt++]=He;function $o(t){return _a.charAt(t)}function xa(t,e){var r=dr[t.charCodeAt(e)];return r??-1}function Ca(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function Sa(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0}function rn(t){var e=Le();return e.fromInt(t),e}function Da(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");this.t=0,this.s=0;for(var n=t.length,s=!1,u=0;--n>=0;){var d=xa(t,n);if(d<0){t.charAt(n)=="-"&&(s=!0);continue}s=!1,u==0?this[this.t++]=d:u+r>this.DB?(this[this.t-1]|=(d&(1<<this.DB-u)-1)<<u,this[this.t++]=d>>this.DB-u):this[this.t-1]|=d<<u,u+=r,u>=this.DB&&(u-=this.DB)}this.clamp(),s&&ye.ZERO.subTo(this,this)}function ka(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function Pa(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");var r=(1<<e)-1,n,s=!1,u="",d=this.t,i=this.DB-d*this.DB%e;if(d-- >0)for(i<this.DB&&(n=this[d]>>i)>0&&(s=!0,u=$o(n));d>=0;)i<e?(n=(this[d]&(1<<i)-1)<<e-i,n|=this[--d]>>(i+=this.DB-e)):(n=this[d]>>(i-=e)&r,i<=0&&(i+=this.DB,--d)),n>0&&(s=!0),s&&(u+=$o(n));return s?u:"0"}function Ma(){var t=Le();return ye.ZERO.subTo(this,t),t}function Oa(){return this.s<0?this.negate():this}function ja(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this[r]-t[r])!=0)return e;return 0}function nn(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}function Aa(){return this.t<=0?0:this.DB*(this.t-1)+nn(this[this.t-1]^this.s&this.DM)}function Ea(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s}function Ta(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0),e.s=this.s}function $a(t,e){var r=t%this.DB,n=this.DB-r,s=(1<<n)-1,u=Math.floor(t/this.DB),d=this.s<<r&this.DM,i;for(i=this.t-1;i>=0;--i)e[i+u+1]=this[i]>>n|d,d=(this[i]&s)<<r;for(i=u-1;i>=0;--i)e[i]=0;e[u]=d,e.t=this.t+u+1,e.s=this.s,e.clamp()}function Ra(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var n=t%this.DB,s=this.DB-n,u=(1<<n)-1;e[0]=this[r]>>n;for(var d=r+1;d<this.t;++d)e[d-r-1]|=(this[d]&u)<<s,e[d-r]=this[d]>>n;n>0&&(e[this.t-r-1]|=(this.s&u)<<s),e.t=this.t-r,e.clamp()}function Na(t,e){for(var r=0,n=0,s=Math.min(t.t,this.t);r<s;)n+=this[r]-t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n-=t[r],e[r++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[r++]=this.DV+n:n>0&&(e[r++]=n),e.t=r,e.clamp()}function La(t,e){var r=this.abs(),n=t.abs(),s=r.t;for(e.t=s+n.t;--s>=0;)e[s]=0;for(s=0;s<n.t;++s)e[s+r.t]=r.am(0,n[s],e,s,0,r.t);e.s=0,e.clamp(),this.s!=t.s&&ye.ZERO.subTo(e,e)}function Ba(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e[r],t,2*r,0,1);(t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,n,e.t-r-1))>=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()}function Ia(t,e,r){var n=t.abs();if(!(n.t<=0)){var s=this.abs();if(s.t<n.t){e?.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=Le());var u=Le(),d=this.s,i=t.s,m=this.DB-nn(n[n.t-1]);m>0?(n.lShiftTo(m,u),s.lShiftTo(m,r)):(n.copyTo(u),s.copyTo(r));var b=u.t,_=u[b-1];if(_!=0){var M=_*(1<<this.F1)+(b>1?u[b-2]>>this.F2:0),C=this.FV/M,S=(1<<this.F1)/M,P=1<<this.F2,j=r.t,N=j-b,F=e??Le();for(u.dlShiftTo(N,F),r.compareTo(F)>=0&&(r[r.t++]=1,r.subTo(F,r)),ye.ONE.dlShiftTo(b,F),F.subTo(u,u);u.t<b;)u[u.t++]=0;for(;--N>=0;){var B=r[--j]==_?this.DM:Math.floor(r[j]*C+(r[j-1]+P)*S);if((r[j]+=u.am(0,B,r,N,0,b))<B)for(u.dlShiftTo(N,F),r.subTo(F,r);r[j]<--B;)r.subTo(F,r)}e!=null&&(r.drShiftTo(b,e),d!=i&&ye.ZERO.subTo(e,e)),r.t=b,r.clamp(),m>0&&r.rShiftTo(m,r),d<0&&ye.ZERO.subTo(r,r)}}}function Ya(t){var e=Le();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(ye.ZERO)>0&&t.subTo(e,e),e}function za(){if(this.t<1)return 0;var t=this[0];if((t&1)==0)return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function Fa(t){return this.compareTo(t)==0}function Wa(t,e){for(var r=0,n=0,s=Math.min(t.t,this.t);r<s;)n+=this[r]+t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n+=t[r],e[r++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[r++]=n:n<-1&&(e[r++]=this.DV+n),e.t=r,e.clamp()}function Ua(t){var e=Le();return this.addTo(t,e),e}function qa(t){var e=Le();return this.subTo(t,e),e}function Va(t){var e=Le();return this.multiplyTo(t,e),e}function Ha(t){var e=Le();return this.divRemTo(t,e,null),e}function $t(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function Ga(t){var e=Le();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(ye.ZERO)>0&&this.m.subTo(e,e),e}function Qa(t){var e=Le();return t.copyTo(e),this.reduce(e),e}function Ka(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=t[e]&32767,n=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t[r]+=this.m.am(0,n,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function Za(t,e){t.squareTo(e),this.reduce(e)}function Ja(t,e,r){t.multiplyTo(e,r),this.reduce(r)}$t.prototype.convert=Ga,$t.prototype.revert=Qa,$t.prototype.reduce=Ka,$t.prototype.mulTo=Ja,$t.prototype.sqrTo=Za;function Xa(t,e,r){var n=t.bitLength(),s,u=rn(1),d=new $t(e);if(n<=0)return u;n<18?s=1:n<48?s=3:n<144?s=4:n<768?s=5:s=6;var i=new Array,m=3,b=s-1,_=(1<<s)-1;if(i[1]=d.convert(this),s>1){var M=Le();for(d.sqrTo(i[1],M);m<=_;)i[m]=Le(),d.mulTo(M,i[m-2],i[m]),m+=2}var C=t.t-1,S,P=!0,j=Le(),N;for(n=nn(t[C])-1;C>=0;){for(n>=b?S=t[C]>>n-b&_:(S=(t[C]&(1<<n+1)-1)<<b-n,C>0&&(S|=t[C-1]>>this.DB+n-b)),m=s;(S&1)==0;)S>>=1,--m;if((n-=m)<0&&(n+=this.DB,--C),P)i[S].copyTo(u),P=!1;else{for(;m>1;)d.sqrTo(u,j),d.sqrTo(j,u),m-=2;m>0?d.sqrTo(u,j):(N=u,u=j,j=N),d.mulTo(j,i[S],u)}for(;C>=0&&(t[C]&1<<n)==0;)d.sqrTo(u,j),N=u,u=j,j=N,--n<0&&(n=this.DB-1,--C)}var F=d.revert(u);return r(null,F),F}ye.prototype.copyTo=Ca,ye.prototype.fromInt=Sa,ye.prototype.fromString=Da,ye.prototype.clamp=ka,ye.prototype.dlShiftTo=Ea,ye.prototype.drShiftTo=Ta,ye.prototype.lShiftTo=$a,ye.prototype.rShiftTo=Ra,ye.prototype.subTo=Na,ye.prototype.multiplyTo=La,ye.prototype.squareTo=Ba,ye.prototype.divRemTo=Ia,ye.prototype.invDigit=za,ye.prototype.addTo=Wa,ye.prototype.toString=Pa,ye.prototype.negate=Ma,ye.prototype.abs=Oa,ye.prototype.compareTo=ja,ye.prototype.bitLength=Aa,ye.prototype.mod=Ya,ye.prototype.equals=Fa,ye.prototype.add=Ua,ye.prototype.subtract=qa,ye.prototype.multiply=Va,ye.prototype.divide=Ha,ye.prototype.modPow=Xa,ye.ZERO=rn(0),ye.ONE=rn(1);function el(t,e){return e=e||{},new Promise(function(r,n){var s=new XMLHttpRequest,u=[],d=[],i={},m=function(){return{ok:(s.status/100|0)==2,statusText:s.statusText,status:s.status,url:s.responseURL,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(s.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([s.response]))},clone:m,headers:{keys:function(){return u},entries:function(){return d},get:function(_){return i[_.toLowerCase()]},has:function(_){return _.toLowerCase()in i}}}};for(var b in s.open(e.method||"get",t,!0),s.onload=function(){s.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(_,M,C){u.push(M=M.toLowerCase()),d.push([M,C]),i[M]=i[M]?i[M]+","+C:C}),r(m())},s.onerror=n,s.withCredentials=e.credentials=="include",e.headers)s.setRequestHeader(b,e.headers[b]);s.send(e.body||null)})}const tl=Object.freeze(Object.defineProperty({__proto__:null,default:el},Symbol.toStringTag,{value:"Module"})),Ro=Vr(tl);var No,Lo;function rl(){return Lo||(Lo=1,No=self.fetch||(self.fetch=Ro.default||Ro)),No}rl();var Bo={exports:{}};var Io;function nl(){return Io||(Io=1,(function(t,e){(function(r){var n;if(t.exports=r(),n=!0,!n){var s=window.Cookies,u=window.Cookies=r();u.noConflict=function(){return window.Cookies=s,u}}})(function(){function r(){for(var u=0,d={};u<arguments.length;u++){var i=arguments[u];for(var m in i)d[m]=i[m]}return d}function n(u){return u.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function s(u){function d(){}function i(b,_,M){if(!(typeof document>"u")){M=r({path:"/"},d.defaults,M),typeof M.expires=="number"&&(M.expires=new Date(new Date*1+M.expires*864e5)),M.expires=M.expires?M.expires.toUTCString():"";try{var C=JSON.stringify(_);/^[\{\[]/.test(C)&&(_=C)}catch{}_=u.write?u.write(_,b):encodeURIComponent(String(_)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),b=encodeURIComponent(String(b)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var S="";for(var P in M)M[P]&&(S+="; "+P,M[P]!==!0&&(S+="="+M[P].split(";")[0]));return document.cookie=b+"="+_+S}}function m(b,_){if(!(typeof document>"u")){for(var M={},C=document.cookie?document.cookie.split("; "):[],S=0;S<C.length;S++){var P=C[S].split("="),j=P.slice(1).join("=");!_&&j.charAt(0)==='"'&&(j=j.slice(1,-1));try{var N=n(P[0]);if(j=(u.read||u)(j,N)||n(j),_)try{j=JSON.parse(j)}catch{}if(M[N]=j,b===N)break}catch{}}return b?M[b]:M}}return d.set=i,d.get=function(b){return m(b,!1)},d.getJSON=function(b){return m(b,!0)},d.remove=function(b,_){i(b,"",r(_,{expires:-1}))},d.defaults={},d.withConverter=s,d}return s(function(){})})})(Bo)),Bo.exports}nl();function ol(){if(!window.MantineCognitoUserPool)throw new Error("Cognito Userpool has not been initialized.");return window.MantineCognitoUserPool}function sl(){return ol().getCurrentUser()}function il(){return new Promise((t,e)=>{const r=sl();r===null&&e(null),r?.getSession((n,s)=>{if(n!==null||s===null)return e(null);t({session:s,authenticatedUser:r})})})}async function al(){const{session:t}=await il();return t?.getIdToken().getJwtToken()}J.createContext(void 0);var ll="undefined",ul="object",hr="browser",Yo="cpu",zo="device",on="engine",fr="os",gt="name",pr="type",sn="vendor",st="version",an="architecture",ln="major",un="model",cl="console",dl="mobile",hl="tablet",fl="smarttv",pl="wearable",gl="embedded",ml=typeof window!==ll,cn=ml&&window.navigator?window.navigator:void 0;cn&&cn.userAgentData&&cn.userAgentData;var gr=function(t){for(var e={},r=0;r<t.length;r++)e[t[r].toUpperCase()]=t[r];return e},mr=function(t){for(var e in t){var r=t[e];typeof r==ul&&r.length==2?this[r[0]]=r[1]:this[r]=void 0}return this};(function(){var t={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return mr.call(t.init,[[hr,[gt,st,ln,pr]],[Yo,[an]],[zo,[pr,un,sn]],[on,[gt,st]],[fr,[gt,st]]]),mr.call(t.isIgnore,[[hr,[st,ln]],[on,[st]],[fr,[st]]]),mr.call(t.isIgnoreRgx,[[hr,/ ?browser$/i],[fr,/ ?os$/i]]),mr.call(t.toString,[[hr,[gt,st]],[Yo,[an]],[zo,[sn,un]],[on,[gt,st]],[fr,[gt,st]]]),t})(),gr([gt,st,ln,pr]),gr([an]),gr([un,sn,pr,cl,dl,fl,hl,pl,gl]),gr([gt,st]);var dn={exports:{}},yl=dn.exports,Fo;function vl(){return Fo||(Fo=1,(function(t,e){(function(r,n){t.exports=n()})(yl,()=>(()=>{var r={873:(d,i)=>{var m,b,_=(function(){var M=function(k,x){var w=k,h=F[x],l=null,p=0,f=null,a=[],v={},D=function(E,L){l=(function($){for(var I=new Array($),Y=0;Y<$;Y+=1){I[Y]=new Array($);for(var de=0;de<$;de+=1)I[Y][de]=null}return I})(p=4*w+17),T(0,0),T(p-7,0),T(0,p-7),Q(),z(),U(E,L),w>=7&&Z(E),f==null&&(f=se(w,h,a)),ae(f,L)},T=function(E,L){for(var $=-1;$<=7;$+=1)if(!(E+$<=-1||p<=E+$))for(var I=-1;I<=7;I+=1)L+I<=-1||p<=L+I||(l[E+$][L+I]=0<=$&&$<=6&&(I==0||I==6)||0<=I&&I<=6&&($==0||$==6)||2<=$&&$<=4&&2<=I&&I<=4)},z=function(){for(var E=8;E<p-8;E+=1)l[E][6]==null&&(l[E][6]=E%2==0);for(var L=8;L<p-8;L+=1)l[6][L]==null&&(l[6][L]=L%2==0)},Q=function(){for(var E=B.getPatternPosition(w),L=0;L<E.length;L+=1)for(var $=0;$<E.length;$+=1){var I=E[L],Y=E[$];if(l[I][Y]==null)for(var de=-2;de<=2;de+=1)for(var o=-2;o<=2;o+=1)l[I+de][Y+o]=de==-2||de==2||o==-2||o==2||de==0&&o==0}},Z=function(E){for(var L=B.getBCHTypeNumber(w),$=0;$<18;$+=1){var I=!E&&(L>>$&1)==1;l[Math.floor($/3)][$%3+p-8-3]=I}for($=0;$<18;$+=1)I=!E&&(L>>$&1)==1,l[$%3+p-8-3][Math.floor($/3)]=I},U=function(E,L){for(var $=h<<3|L,I=B.getBCHTypeInfo($),Y=0;Y<15;Y+=1){var de=!E&&(I>>Y&1)==1;Y<6?l[Y][8]=de:Y<8?l[Y+1][8]=de:l[p-15+Y][8]=de}for(Y=0;Y<15;Y+=1)de=!E&&(I>>Y&1)==1,Y<8?l[8][p-Y-1]=de:Y<9?l[8][15-Y-1+1]=de:l[8][15-Y-1]=de;l[p-8][8]=!E},ae=function(E,L){for(var $=-1,I=p-1,Y=7,de=0,o=B.getMaskFunction(L),c=p-1;c>0;c-=2)for(c==6&&(c-=1);;){for(var g=0;g<2;g+=1)if(l[I][c-g]==null){var A=!1;de<E.length&&(A=(E[de]>>>Y&1)==1),o(I,c-g)&&(A=!A),l[I][c-g]=A,(Y-=1)==-1&&(de+=1,Y=7)}if((I+=$)<0||p<=I){I-=$,$=-$;break}}},se=function(E,L,$){for(var I=te.getRSBlocks(E,L),Y=ne(),de=0;de<$.length;de+=1){var o=$[de];Y.put(o.getMode(),4),Y.put(o.getLength(),B.getLengthInBits(o.getMode(),E)),o.write(Y)}var c=0;for(de=0;de<I.length;de+=1)c+=I[de].dataCount;if(Y.getLengthInBits()>8*c)throw"code length overflow. ("+Y.getLengthInBits()+">"+8*c+")";for(Y.getLengthInBits()+4<=8*c&&Y.put(0,4);Y.getLengthInBits()%8!=0;)Y.putBit(!1);for(;!(Y.getLengthInBits()>=8*c||(Y.put(236,8),Y.getLengthInBits()>=8*c));)Y.put(17,8);return(function(g,A){for(var R=0,W=0,le=0,fe=new Array(A.length),pe=new Array(A.length),oe=0;oe<A.length;oe+=1){var ce=A[oe].dataCount,ge=A[oe].totalCount-ce;W=Math.max(W,ce),le=Math.max(le,ge),fe[oe]=new Array(ce);for(var me=0;me<fe[oe].length;me+=1)fe[oe][me]=255&g.getBuffer()[me+R];R+=ce;var Ce=B.getErrorCorrectPolynomial(ge),Se=q(fe[oe],Ce.getLength()-1).mod(Ce);for(pe[oe]=new Array(Ce.getLength()-1),me=0;me<pe[oe].length;me+=1){var De=me+Se.getLength()-pe[oe].length;pe[oe][me]=De>=0?Se.getAt(De):0}}var Qe=0;for(me=0;me<A.length;me+=1)Qe+=A[me].totalCount;var Ae=new Array(Qe),ke=0;for(me=0;me<W;me+=1)for(oe=0;oe<A.length;oe+=1)me<fe[oe].length&&(Ae[ke]=fe[oe][me],ke+=1);for(me=0;me<le;me+=1)for(oe=0;oe<A.length;oe+=1)me<pe[oe].length&&(Ae[ke]=pe[oe][me],ke+=1);return Ae})(Y,I)};v.addData=function(E,L){var $=null;switch(L=L||"Byte"){case"Numeric":$=G(E);break;case"Alphanumeric":$=ee(E);break;case"Byte":$=V(E);break;case"Kanji":$=H(E);break;default:throw"mode:"+L}a.push($),f=null},v.isDark=function(E,L){if(E<0||p<=E||L<0||p<=L)throw E+","+L;return l[E][L]},v.getModuleCount=function(){return p},v.make=function(){if(w<1){for(var E=1;E<40;E++){for(var L=te.getRSBlocks(E,h),$=ne(),I=0;I<a.length;I++){var Y=a[I];$.put(Y.getMode(),4),$.put(Y.getLength(),B.getLengthInBits(Y.getMode(),E)),Y.write($)}var de=0;for(I=0;I<L.length;I++)de+=L[I].dataCount;if($.getLengthInBits()<=8*de)break}w=E}D(!1,(function(){for(var o=0,c=0,g=0;g<8;g+=1){D(!0,g);var A=B.getLostPoint(v);(g==0||o>A)&&(o=A,c=g)}return c})())},v.createTableTag=function(E,L){E=E||2;var $="";$+='<table style="',$+=" border-width: 0px; border-style: none;",$+=" border-collapse: collapse;",$+=" padding: 0px; margin: "+(L=L===void 0?4*E:L)+"px;",$+='">',$+="<tbody>";for(var I=0;I<v.getModuleCount();I+=1){$+="<tr>";for(var Y=0;Y<v.getModuleCount();Y+=1)$+='<td style="',$+=" border-width: 0px; border-style: none;",$+=" border-collapse: collapse;",$+=" padding: 0px; margin: 0px;",$+=" width: "+E+"px;",$+=" height: "+E+"px;",$+=" background-color: ",$+=v.isDark(I,Y)?"#000000":"#ffffff",$+=";",$+='"/>';$+="</tr>"}return($+="</tbody>")+"</table>"},v.createSvgTag=function(E,L,$,I){var Y={};typeof arguments[0]=="object"&&(E=(Y=arguments[0]).cellSize,L=Y.margin,$=Y.alt,I=Y.title),E=E||2,L=L===void 0?4*E:L,($=typeof $=="string"?{text:$}:$||{}).text=$.text||null,$.id=$.text?$.id||"qrcode-description":null,(I=typeof I=="string"?{text:I}:I||{}).text=I.text||null,I.id=I.text?I.id||"qrcode-title":null;var de,o,c,g,A=v.getModuleCount()*E+2*L,R="";for(g="l"+E+",0 0,"+E+" -"+E+",0 0,-"+E+"z ",R+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',R+=Y.scalable?"":' width="'+A+'px" height="'+A+'px"',R+=' viewBox="0 0 '+A+" "+A+'" ',R+=' preserveAspectRatio="xMinYMin meet"',R+=I.text||$.text?' role="img" aria-labelledby="'+ue([I.id,$.id].join(" ").trim())+'"':"",R+=">",R+=I.text?'<title id="'+ue(I.id)+'">'+ue(I.text)+"</title>":"",R+=$.text?'<description id="'+ue($.id)+'">'+ue($.text)+"</description>":"",R+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',R+='<path d="',o=0;o<v.getModuleCount();o+=1)for(c=o*E+L,de=0;de<v.getModuleCount();de+=1)v.isDark(o,de)&&(R+="M"+(de*E+L)+","+c+g);return(R+='" stroke="transparent" fill="black"/>')+"</svg>"},v.createDataURL=function(E,L){E=E||2,L=L===void 0?4*E:L;var $=v.getModuleCount()*E+2*L,I=L,Y=$-L;return re($,$,function(de,o){if(I<=de&&de<Y&&I<=o&&o<Y){var c=Math.floor((de-I)/E),g=Math.floor((o-I)/E);return v.isDark(g,c)?0:1}return 1})},v.createImgTag=function(E,L,$){E=E||2,L=L===void 0?4*E:L;var I=v.getModuleCount()*E+2*L,Y="";return Y+="<img",Y+=' src="',Y+=v.createDataURL(E,L),Y+='"',Y+=' width="',Y+=I,Y+='"',Y+=' height="',Y+=I,Y+='"',$&&(Y+=' alt="',Y+=ue($),Y+='"'),Y+"/>"};var ue=function(E){for(var L="",$=0;$<E.length;$+=1){var I=E.charAt($);switch(I){case"<":L+="<";break;case">":L+=">";break;case"&":L+="&";break;case'"':L+=""";break;default:L+=I}}return L};return v.createASCII=function(E,L){if((E=E||1)<2)return(function(fe){fe=fe===void 0?2:fe;var pe,oe,ce,ge,me,Ce=1*v.getModuleCount()+2*fe,Se=fe,De=Ce-fe,Qe={"██":"█","█ ":"▀"," █":"▄"," ":" "},Ae={"██":"▀","█ ":"▀"," █":" "," ":" "},ke="";for(pe=0;pe<Ce;pe+=2){for(ce=Math.floor((pe-Se)/1),ge=Math.floor((pe+1-Se)/1),oe=0;oe<Ce;oe+=1)me="█",Se<=oe&&oe<De&&Se<=pe&&pe<De&&v.isDark(ce,Math.floor((oe-Se)/1))&&(me=" "),Se<=oe&&oe<De&&Se<=pe+1&&pe+1<De&&v.isDark(ge,Math.floor((oe-Se)/1))?me+=" ":me+="█",ke+=fe<1&&pe+1>=De?Ae[me]:Qe[me];ke+=`
|
|
20
|
+
`}return Ce%2&&fe>0?ke.substring(0,ke.length-Ce-1)+Array(Ce+1).join("▀"):ke.substring(0,ke.length-1)})(L);E-=1,L=L===void 0?2*E:L;var $,I,Y,de,o=v.getModuleCount()*E+2*L,c=L,g=o-L,A=Array(E+1).join("██"),R=Array(E+1).join(" "),W="",le="";for($=0;$<o;$+=1){for(Y=Math.floor(($-c)/E),le="",I=0;I<o;I+=1)de=1,c<=I&&I<g&&c<=$&&$<g&&v.isDark(Y,Math.floor((I-c)/E))&&(de=0),le+=de?A:R;for(Y=0;Y<E;Y+=1)W+=le+`
|
|
21
|
+
`}return W.substring(0,W.length-1)},v.renderTo2dContext=function(E,L){L=L||2;for(var $=v.getModuleCount(),I=0;I<$;I++)for(var Y=0;Y<$;Y++)E.fillStyle=v.isDark(I,Y)?"black":"white",E.fillRect(I*L,Y*L,L,L)},v};M.stringToBytes=(M.stringToBytesFuncs={default:function(k){for(var x=[],w=0;w<k.length;w+=1){var h=k.charCodeAt(w);x.push(255&h)}return x}}).default,M.createStringToBytes=function(k,x){var w=(function(){for(var l=ie(k),p=function(){var z=l.read();if(z==-1)throw"eof";return z},f=0,a={};;){var v=l.read();if(v==-1)break;var D=p(),T=p()<<8|p();a[String.fromCharCode(v<<8|D)]=T,f+=1}if(f!=x)throw f+" != "+x;return a})(),h=63;return function(l){for(var p=[],f=0;f<l.length;f+=1){var a=l.charCodeAt(f);if(a<128)p.push(a);else{var v=w[l.charAt(f)];typeof v=="number"?(255&v)==v?p.push(v):(p.push(v>>>8),p.push(255&v)):p.push(h)}}return p}};var C,S,P,j,N,F={L:1,M:0,Q:3,H:2},B=(C=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],S=1335,P=7973,N=function(k){for(var x=0;k!=0;)x+=1,k>>>=1;return x},(j={}).getBCHTypeInfo=function(k){for(var x=k<<10;N(x)-N(S)>=0;)x^=S<<N(x)-N(S);return 21522^(k<<10|x)},j.getBCHTypeNumber=function(k){for(var x=k<<12;N(x)-N(P)>=0;)x^=P<<N(x)-N(P);return k<<12|x},j.getPatternPosition=function(k){return C[k-1]},j.getMaskFunction=function(k){switch(k){case 0:return function(x,w){return(x+w)%2==0};case 1:return function(x,w){return x%2==0};case 2:return function(x,w){return w%3==0};case 3:return function(x,w){return(x+w)%3==0};case 4:return function(x,w){return(Math.floor(x/2)+Math.floor(w/3))%2==0};case 5:return function(x,w){return x*w%2+x*w%3==0};case 6:return function(x,w){return(x*w%2+x*w%3)%2==0};case 7:return function(x,w){return(x*w%3+(x+w)%2)%2==0};default:throw"bad maskPattern:"+k}},j.getErrorCorrectPolynomial=function(k){for(var x=q([1],0),w=0;w<k;w+=1)x=x.multiply(q([1,K.gexp(w)],0));return x},j.getLengthInBits=function(k,x){if(1<=x&&x<10)switch(k){case 1:return 10;case 2:return 9;case 4:case 8:return 8;default:throw"mode:"+k}else if(x<27)switch(k){case 1:return 12;case 2:return 11;case 4:return 16;case 8:return 10;default:throw"mode:"+k}else{if(!(x<41))throw"type:"+x;switch(k){case 1:return 14;case 2:return 13;case 4:return 16;case 8:return 12;default:throw"mode:"+k}}},j.getLostPoint=function(k){for(var x=k.getModuleCount(),w=0,h=0;h<x;h+=1)for(var l=0;l<x;l+=1){for(var p=0,f=k.isDark(h,l),a=-1;a<=1;a+=1)if(!(h+a<0||x<=h+a))for(var v=-1;v<=1;v+=1)l+v<0||x<=l+v||a==0&&v==0||f==k.isDark(h+a,l+v)&&(p+=1);p>5&&(w+=3+p-5)}for(h=0;h<x-1;h+=1)for(l=0;l<x-1;l+=1){var D=0;k.isDark(h,l)&&(D+=1),k.isDark(h+1,l)&&(D+=1),k.isDark(h,l+1)&&(D+=1),k.isDark(h+1,l+1)&&(D+=1),D!=0&&D!=4||(w+=3)}for(h=0;h<x;h+=1)for(l=0;l<x-6;l+=1)k.isDark(h,l)&&!k.isDark(h,l+1)&&k.isDark(h,l+2)&&k.isDark(h,l+3)&&k.isDark(h,l+4)&&!k.isDark(h,l+5)&&k.isDark(h,l+6)&&(w+=40);for(l=0;l<x;l+=1)for(h=0;h<x-6;h+=1)k.isDark(h,l)&&!k.isDark(h+1,l)&&k.isDark(h+2,l)&&k.isDark(h+3,l)&&k.isDark(h+4,l)&&!k.isDark(h+5,l)&&k.isDark(h+6,l)&&(w+=40);var T=0;for(l=0;l<x;l+=1)for(h=0;h<x;h+=1)k.isDark(h,l)&&(T+=1);return w+Math.abs(100*T/x/x-50)/5*10},j),K=(function(){for(var k=new Array(256),x=new Array(256),w=0;w<8;w+=1)k[w]=1<<w;for(w=8;w<256;w+=1)k[w]=k[w-4]^k[w-5]^k[w-6]^k[w-8];for(w=0;w<255;w+=1)x[k[w]]=w;return{glog:function(h){if(h<1)throw"glog("+h+")";return x[h]},gexp:function(h){for(;h<0;)h+=255;for(;h>=256;)h-=255;return k[h]}}})();function q(k,x){if(k.length===void 0)throw k.length+"/"+x;var w=(function(){for(var l=0;l<k.length&&k[l]==0;)l+=1;for(var p=new Array(k.length-l+x),f=0;f<k.length-l;f+=1)p[f]=k[f+l];return p})(),h={getAt:function(l){return w[l]},getLength:function(){return w.length},multiply:function(l){for(var p=new Array(h.getLength()+l.getLength()-1),f=0;f<h.getLength();f+=1)for(var a=0;a<l.getLength();a+=1)p[f+a]^=K.gexp(K.glog(h.getAt(f))+K.glog(l.getAt(a)));return q(p,0)},mod:function(l){if(h.getLength()-l.getLength()<0)return h;for(var p=K.glog(h.getAt(0))-K.glog(l.getAt(0)),f=new Array(h.getLength()),a=0;a<h.getLength();a+=1)f[a]=h.getAt(a);for(a=0;a<l.getLength();a+=1)f[a]^=K.gexp(K.glog(l.getAt(a))+p);return q(f,0).mod(l)}};return h}var te=(function(){var k=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],x=function(h,l){var p={};return p.totalCount=h,p.dataCount=l,p},w={getRSBlocks:function(h,l){var p=(function(Z,U){switch(U){case F.L:return k[4*(Z-1)+0];case F.M:return k[4*(Z-1)+1];case F.Q:return k[4*(Z-1)+2];case F.H:return k[4*(Z-1)+3];default:return}})(h,l);if(p===void 0)throw"bad rs block @ typeNumber:"+h+"/errorCorrectionLevel:"+l;for(var f=p.length/3,a=[],v=0;v<f;v+=1)for(var D=p[3*v+0],T=p[3*v+1],z=p[3*v+2],Q=0;Q<D;Q+=1)a.push(x(T,z));return a}};return w})(),ne=function(){var k=[],x=0,w={getBuffer:function(){return k},getAt:function(h){var l=Math.floor(h/8);return(k[l]>>>7-h%8&1)==1},put:function(h,l){for(var p=0;p<l;p+=1)w.putBit((h>>>l-p-1&1)==1)},getLengthInBits:function(){return x},putBit:function(h){var l=Math.floor(x/8);k.length<=l&&k.push(0),h&&(k[l]|=128>>>x%8),x+=1}};return w},G=function(k){var x=k,w={getMode:function(){return 1},getLength:function(p){return x.length},write:function(p){for(var f=x,a=0;a+2<f.length;)p.put(h(f.substring(a,a+3)),10),a+=3;a<f.length&&(f.length-a==1?p.put(h(f.substring(a,a+1)),4):f.length-a==2&&p.put(h(f.substring(a,a+2)),7))}},h=function(p){for(var f=0,a=0;a<p.length;a+=1)f=10*f+l(p.charAt(a));return f},l=function(p){if("0"<=p&&p<="9")return p.charCodeAt(0)-48;throw"illegal char :"+p};return w},ee=function(k){var x=k,w={getMode:function(){return 2},getLength:function(l){return x.length},write:function(l){for(var p=x,f=0;f+1<p.length;)l.put(45*h(p.charAt(f))+h(p.charAt(f+1)),11),f+=2;f<p.length&&l.put(h(p.charAt(f)),6)}},h=function(l){if("0"<=l&&l<="9")return l.charCodeAt(0)-48;if("A"<=l&&l<="Z")return l.charCodeAt(0)-65+10;switch(l){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+l}};return w},V=function(k){var x=M.stringToBytes(k);return{getMode:function(){return 4},getLength:function(w){return x.length},write:function(w){for(var h=0;h<x.length;h+=1)w.put(x[h],8)}}},H=function(k){var x=M.stringToBytesFuncs.SJIS;if(!x)throw"sjis not supported.";(function(){var l=x("友");if(l.length!=2||(l[0]<<8|l[1])!=38726)throw"sjis not supported."})();var w=x(k),h={getMode:function(){return 8},getLength:function(l){return~~(w.length/2)},write:function(l){for(var p=w,f=0;f+1<p.length;){var a=(255&p[f])<<8|255&p[f+1];if(33088<=a&&a<=40956)a-=33088;else{if(!(57408<=a&&a<=60351))throw"illegal char at "+(f+1)+"/"+a;a-=49472}a=192*(a>>>8&255)+(255&a),l.put(a,13),f+=2}if(f<p.length)throw"illegal char at "+(f+1)}};return h},X=function(){var k=[],x={writeByte:function(w){k.push(255&w)},writeShort:function(w){x.writeByte(w),x.writeByte(w>>>8)},writeBytes:function(w,h,l){h=h||0,l=l||w.length;for(var p=0;p<l;p+=1)x.writeByte(w[p+h])},writeString:function(w){for(var h=0;h<w.length;h+=1)x.writeByte(w.charCodeAt(h))},toByteArray:function(){return k},toString:function(){var w="";w+="[";for(var h=0;h<k.length;h+=1)h>0&&(w+=","),w+=k[h];return w+"]"}};return x},ie=function(k){var x=k,w=0,h=0,l=0,p={read:function(){for(;l<8;){if(w>=x.length){if(l==0)return-1;throw"unexpected end of file./"+l}var a=x.charAt(w);if(w+=1,a=="=")return l=0,-1;a.match(/^\s$/)||(h=h<<6|f(a.charCodeAt(0)),l+=6)}var v=h>>>l-8&255;return l-=8,v}},f=function(a){if(65<=a&&a<=90)return a-65;if(97<=a&&a<=122)return a-97+26;if(48<=a&&a<=57)return a-48+52;if(a==43)return 62;if(a==47)return 63;throw"c:"+a};return p},re=function(k,x,w){for(var h=(function(T,z){var Q=T,Z=z,U=new Array(T*z),ae={setPixel:function(E,L,$){U[L*Q+E]=$},write:function(E){E.writeString("GIF87a"),E.writeShort(Q),E.writeShort(Z),E.writeByte(128),E.writeByte(0),E.writeByte(0),E.writeByte(0),E.writeByte(0),E.writeByte(0),E.writeByte(255),E.writeByte(255),E.writeByte(255),E.writeString(","),E.writeShort(0),E.writeShort(0),E.writeShort(Q),E.writeShort(Z),E.writeByte(0);var L=se(2);E.writeByte(2);for(var $=0;L.length-$>255;)E.writeByte(255),E.writeBytes(L,$,255),$+=255;E.writeByte(L.length-$),E.writeBytes(L,$,L.length-$),E.writeByte(0),E.writeString(";")}},se=function(E){for(var L=1<<E,$=1+(1<<E),I=E+1,Y=ue(),de=0;de<L;de+=1)Y.add(String.fromCharCode(de));Y.add(String.fromCharCode(L)),Y.add(String.fromCharCode($));var o,c,g,A=X(),R=(o=A,c=0,g=0,{write:function(pe,oe){if(pe>>>oe)throw"length over";for(;c+oe>=8;)o.writeByte(255&(pe<<c|g)),oe-=8-c,pe>>>=8-c,g=0,c=0;g|=pe<<c,c+=oe},flush:function(){c>0&&o.writeByte(g)}});R.write(L,I);var W=0,le=String.fromCharCode(U[W]);for(W+=1;W<U.length;){var fe=String.fromCharCode(U[W]);W+=1,Y.contains(le+fe)?le+=fe:(R.write(Y.indexOf(le),I),Y.size()<4095&&(Y.size()==1<<I&&(I+=1),Y.add(le+fe)),le=fe)}return R.write(Y.indexOf(le),I),R.write($,I),R.flush(),A.toByteArray()},ue=function(){var E={},L=0,$={add:function(I){if($.contains(I))throw"dup key:"+I;E[I]=L,L+=1},size:function(){return L},indexOf:function(I){return E[I]},contains:function(I){return E[I]!==void 0}};return $};return ae})(k,x),l=0;l<x;l+=1)for(var p=0;p<k;p+=1)h.setPixel(p,l,w(p,l));var f=X();h.write(f);for(var a=(function(){var T=0,z=0,Q=0,Z="",U={},ae=function(ue){Z+=String.fromCharCode(se(63&ue))},se=function(ue){if(!(ue<0)){if(ue<26)return 65+ue;if(ue<52)return ue-26+97;if(ue<62)return ue-52+48;if(ue==62)return 43;if(ue==63)return 47}throw"n:"+ue};return U.writeByte=function(ue){for(T=T<<8|255&ue,z+=8,Q+=1;z>=6;)ae(T>>>z-6),z-=6},U.flush=function(){if(z>0&&(ae(T<<6-z),T=0,z=0),Q%3!=0)for(var ue=3-Q%3,E=0;E<ue;E+=1)Z+="="},U.toString=function(){return Z},U})(),v=f.toByteArray(),D=0;D<v.length;D+=1)a.writeByte(v[D]);return a.flush(),"data:image/gif;base64,"+a};return M})();_.stringToBytesFuncs["UTF-8"]=function(M){return(function(C){for(var S=[],P=0;P<C.length;P++){var j=C.charCodeAt(P);j<128?S.push(j):j<2048?S.push(192|j>>6,128|63&j):j<55296||j>=57344?S.push(224|j>>12,128|j>>6&63,128|63&j):(P++,j=65536+((1023&j)<<10|1023&C.charCodeAt(P)),S.push(240|j>>18,128|j>>12&63,128|j>>6&63,128|63&j))}return S})(M)},(b=typeof(m=function(){return _})=="function"?m.apply(i,[]):m)===void 0||(d.exports=b)}},n={};function s(d){var i=n[d];if(i!==void 0)return i.exports;var m=n[d]={exports:{}};return r[d](m,m.exports,s),m.exports}s.n=d=>{var i=d&&d.__esModule?()=>d.default:()=>d;return s.d(i,{a:i}),i},s.d=(d,i)=>{for(var m in i)s.o(i,m)&&!s.o(d,m)&&Object.defineProperty(d,m,{enumerable:!0,get:i[m]})},s.o=(d,i)=>Object.prototype.hasOwnProperty.call(d,i);var u={};return(()=>{s.d(u,{default:()=>x});const d=w=>!!w&&typeof w=="object"&&!Array.isArray(w);function i(w,...h){if(!h.length)return w;const l=h.shift();return l!==void 0&&d(w)&&d(l)?(w=Object.assign({},w),Object.keys(l).forEach(p=>{const f=w[p],a=l[p];Array.isArray(f)&&Array.isArray(a)?w[p]=a:d(f)&&d(a)?w[p]=i(Object.assign({},f),a):w[p]=a}),i(w,...h)):w}function m(w,h){const l=document.createElement("a");l.download=h,l.href=w,document.body.appendChild(l),l.click(),document.body.removeChild(l)}const b={L:.07,M:.15,Q:.25,H:.3};class _{constructor({svg:h,type:l,window:p}){this._svg=h,this._type=l,this._window=p}draw(h,l,p,f){let a;switch(this._type){case"dots":a=this._drawDot;break;case"classy":a=this._drawClassy;break;case"classy-rounded":a=this._drawClassyRounded;break;case"rounded":a=this._drawRounded;break;case"extra-rounded":a=this._drawExtraRounded;break;default:a=this._drawSquare}a.call(this,{x:h,y:l,size:p,getNeighbor:f})}_rotateFigure({x:h,y:l,size:p,rotation:f=0,draw:a}){var v;const D=h+p/2,T=l+p/2;a(),(v=this._element)===null||v===void 0||v.setAttribute("transform",`rotate(${180*f/Math.PI},${D},${T})`)}_basicDot(h){const{size:l,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(p+l/2)),this._element.setAttribute("cy",String(f+l/2)),this._element.setAttribute("r",String(l/2))}}))}_basicSquare(h){const{size:l,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(p)),this._element.setAttribute("y",String(f)),this._element.setAttribute("width",String(l)),this._element.setAttribute("height",String(l))}}))}_basicSideRounded(h){const{size:l,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${p} ${f}v ${l}h `+l/2+`a ${l/2} ${l/2}, 0, 0, 0, 0 ${-l}`)}}))}_basicCornerRounded(h){const{size:l,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${p} ${f}v ${l}h ${l}v `+-l/2+`a ${l/2} ${l/2}, 0, 0, 0, ${-l/2} ${-l/2}`)}}))}_basicCornerExtraRounded(h){const{size:l,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${p} ${f}v ${l}h ${l}a ${l} ${l}, 0, 0, 0, ${-l} ${-l}`)}}))}_basicCornersRounded(h){const{size:l,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${p} ${f}v `+l/2+`a ${l/2} ${l/2}, 0, 0, 0, ${l/2} ${l/2}h `+l/2+"v "+-l/2+`a ${l/2} ${l/2}, 0, 0, 0, ${-l/2} ${-l/2}`)}}))}_drawDot({x:h,y:l,size:p}){this._basicDot({x:h,y:l,size:p,rotation:0})}_drawSquare({x:h,y:l,size:p}){this._basicSquare({x:h,y:l,size:p,rotation:0})}_drawRounded({x:h,y:l,size:p,getNeighbor:f}){const a=f?+f(-1,0):0,v=f?+f(1,0):0,D=f?+f(0,-1):0,T=f?+f(0,1):0,z=a+v+D+T;if(z!==0)if(z>2||a&&v||D&&T)this._basicSquare({x:h,y:l,size:p,rotation:0});else{if(z===2){let Q=0;return a&&D?Q=Math.PI/2:D&&v?Q=Math.PI:v&&T&&(Q=-Math.PI/2),void this._basicCornerRounded({x:h,y:l,size:p,rotation:Q})}if(z===1){let Q=0;return D?Q=Math.PI/2:v?Q=Math.PI:T&&(Q=-Math.PI/2),void this._basicSideRounded({x:h,y:l,size:p,rotation:Q})}}else this._basicDot({x:h,y:l,size:p,rotation:0})}_drawExtraRounded({x:h,y:l,size:p,getNeighbor:f}){const a=f?+f(-1,0):0,v=f?+f(1,0):0,D=f?+f(0,-1):0,T=f?+f(0,1):0,z=a+v+D+T;if(z!==0)if(z>2||a&&v||D&&T)this._basicSquare({x:h,y:l,size:p,rotation:0});else{if(z===2){let Q=0;return a&&D?Q=Math.PI/2:D&&v?Q=Math.PI:v&&T&&(Q=-Math.PI/2),void this._basicCornerExtraRounded({x:h,y:l,size:p,rotation:Q})}if(z===1){let Q=0;return D?Q=Math.PI/2:v?Q=Math.PI:T&&(Q=-Math.PI/2),void this._basicSideRounded({x:h,y:l,size:p,rotation:Q})}}else this._basicDot({x:h,y:l,size:p,rotation:0})}_drawClassy({x:h,y:l,size:p,getNeighbor:f}){const a=f?+f(-1,0):0,v=f?+f(1,0):0,D=f?+f(0,-1):0,T=f?+f(0,1):0;a+v+D+T!==0?a||D?v||T?this._basicSquare({x:h,y:l,size:p,rotation:0}):this._basicCornerRounded({x:h,y:l,size:p,rotation:Math.PI/2}):this._basicCornerRounded({x:h,y:l,size:p,rotation:-Math.PI/2}):this._basicCornersRounded({x:h,y:l,size:p,rotation:Math.PI/2})}_drawClassyRounded({x:h,y:l,size:p,getNeighbor:f}){const a=f?+f(-1,0):0,v=f?+f(1,0):0,D=f?+f(0,-1):0,T=f?+f(0,1):0;a+v+D+T!==0?a||D?v||T?this._basicSquare({x:h,y:l,size:p,rotation:0}):this._basicCornerExtraRounded({x:h,y:l,size:p,rotation:Math.PI/2}):this._basicCornerExtraRounded({x:h,y:l,size:p,rotation:-Math.PI/2}):this._basicCornersRounded({x:h,y:l,size:p,rotation:Math.PI/2})}}const M={dot:"dot",square:"square",extraRounded:"extra-rounded"},C=Object.values(M);class S{constructor({svg:h,type:l,window:p}){this._svg=h,this._type=l,this._window=p}draw(h,l,p,f){let a;switch(this._type){case M.square:a=this._drawSquare;break;case M.extraRounded:a=this._drawExtraRounded;break;default:a=this._drawDot}a.call(this,{x:h,y:l,size:p,rotation:f})}_rotateFigure({x:h,y:l,size:p,rotation:f=0,draw:a}){var v;const D=h+p/2,T=l+p/2;a(),(v=this._element)===null||v===void 0||v.setAttribute("transform",`rotate(${180*f/Math.PI},${D},${T})`)}_basicDot(h){const{size:l,x:p,y:f}=h,a=l/7;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${p+l/2} ${f}a ${l/2} ${l/2} 0 1 0 0.1 0zm 0 ${a}a ${l/2-a} ${l/2-a} 0 1 1 -0.1 0Z`)}}))}_basicSquare(h){const{size:l,x:p,y:f}=h,a=l/7;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${p} ${f}v ${l}h ${l}v `+-l+`zM ${p+a} ${f+a}h `+(l-2*a)+"v "+(l-2*a)+"h "+(2*a-l)+"z")}}))}_basicExtraRounded(h){const{size:l,x:p,y:f}=h,a=l/7;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${p} ${f+2.5*a}v `+2*a+`a ${2.5*a} ${2.5*a}, 0, 0, 0, ${2.5*a} ${2.5*a}h `+2*a+`a ${2.5*a} ${2.5*a}, 0, 0, 0, ${2.5*a} ${2.5*-a}v `+-2*a+`a ${2.5*a} ${2.5*a}, 0, 0, 0, ${2.5*-a} ${2.5*-a}h `+-2*a+`a ${2.5*a} ${2.5*a}, 0, 0, 0, ${2.5*-a} ${2.5*a}M ${p+2.5*a} ${f+a}h `+2*a+`a ${1.5*a} ${1.5*a}, 0, 0, 1, ${1.5*a} ${1.5*a}v `+2*a+`a ${1.5*a} ${1.5*a}, 0, 0, 1, ${1.5*-a} ${1.5*a}h `+-2*a+`a ${1.5*a} ${1.5*a}, 0, 0, 1, ${1.5*-a} ${1.5*-a}v `+-2*a+`a ${1.5*a} ${1.5*a}, 0, 0, 1, ${1.5*a} ${1.5*-a}`)}}))}_drawDot({x:h,y:l,size:p,rotation:f}){this._basicDot({x:h,y:l,size:p,rotation:f})}_drawSquare({x:h,y:l,size:p,rotation:f}){this._basicSquare({x:h,y:l,size:p,rotation:f})}_drawExtraRounded({x:h,y:l,size:p,rotation:f}){this._basicExtraRounded({x:h,y:l,size:p,rotation:f})}}const P={dot:"dot",square:"square"},j=Object.values(P);class N{constructor({svg:h,type:l,window:p}){this._svg=h,this._type=l,this._window=p}draw(h,l,p,f){let a;a=this._type===P.square?this._drawSquare:this._drawDot,a.call(this,{x:h,y:l,size:p,rotation:f})}_rotateFigure({x:h,y:l,size:p,rotation:f=0,draw:a}){var v;const D=h+p/2,T=l+p/2;a(),(v=this._element)===null||v===void 0||v.setAttribute("transform",`rotate(${180*f/Math.PI},${D},${T})`)}_basicDot(h){const{size:l,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(p+l/2)),this._element.setAttribute("cy",String(f+l/2)),this._element.setAttribute("r",String(l/2))}}))}_basicSquare(h){const{size:l,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(p)),this._element.setAttribute("y",String(f)),this._element.setAttribute("width",String(l)),this._element.setAttribute("height",String(l))}}))}_drawDot({x:h,y:l,size:p,rotation:f}){this._basicDot({x:h,y:l,size:p,rotation:f})}_drawSquare({x:h,y:l,size:p,rotation:f}){this._basicSquare({x:h,y:l,size:p,rotation:f})}}const F="circle",B=[[1,1,1,1,1,1,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,1,1,1,1,1,1]],K=[[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]];class q{constructor(h,l){this._roundSize=p=>this._options.dotsOptions.roundSize?Math.floor(p):p,this._window=l,this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("width",String(h.width)),this._element.setAttribute("height",String(h.height)),this._element.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),h.dotsOptions.roundSize||this._element.setAttribute("shape-rendering","crispEdges"),this._element.setAttribute("viewBox",`0 0 ${h.width} ${h.height}`),this._defs=this._window.document.createElementNS("http://www.w3.org/2000/svg","defs"),this._element.appendChild(this._defs),this._imageUri=h.image,this._instanceId=q.instanceCount++,this._options=h}get width(){return this._options.width}get height(){return this._options.height}getElement(){return this._element}async drawQR(h){const l=h.getModuleCount(),p=Math.min(this._options.width,this._options.height)-2*this._options.margin,f=this._options.shape===F?p/Math.sqrt(2):p,a=this._roundSize(f/l);let v={hideXDots:0,hideYDots:0,width:0,height:0};if(this._qr=h,this._options.image){if(await this.loadImage(),!this._image)return;const{imageOptions:D,qrOptions:T}=this._options,z=D.imageSize*b[T.errorCorrectionLevel],Q=Math.floor(z*l*l);v=(function({originalHeight:Z,originalWidth:U,maxHiddenDots:ae,maxHiddenAxisDots:se,dotSize:ue}){const E={x:0,y:0},L={x:0,y:0};if(Z<=0||U<=0||ae<=0||ue<=0)return{height:0,width:0,hideYDots:0,hideXDots:0};const $=Z/U;return E.x=Math.floor(Math.sqrt(ae/$)),E.x<=0&&(E.x=1),se&&se<E.x&&(E.x=se),E.x%2==0&&E.x--,L.x=E.x*ue,E.y=1+2*Math.ceil((E.x*$-1)/2),L.y=Math.round(L.x*$),(E.y*E.x>ae||se&&se<E.y)&&(se&&se<E.y?(E.y=se,E.y%2==0&&E.x--):E.y-=2,L.y=E.y*ue,E.x=1+2*Math.ceil((E.y/$-1)/2),L.x=Math.round(L.y/$)),{height:L.y,width:L.x,hideYDots:E.y,hideXDots:E.x}})({originalWidth:this._image.width,originalHeight:this._image.height,maxHiddenDots:Q,maxHiddenAxisDots:l-14,dotSize:a})}this.drawBackground(),this.drawDots((D,T)=>{var z,Q,Z,U,ae,se;return!(this._options.imageOptions.hideBackgroundDots&&D>=(l-v.hideYDots)/2&&D<(l+v.hideYDots)/2&&T>=(l-v.hideXDots)/2&&T<(l+v.hideXDots)/2||!((z=B[D])===null||z===void 0)&&z[T]||!((Q=B[D-l+7])===null||Q===void 0)&&Q[T]||!((Z=B[D])===null||Z===void 0)&&Z[T-l+7]||!((U=K[D])===null||U===void 0)&&U[T]||!((ae=K[D-l+7])===null||ae===void 0)&&ae[T]||!((se=K[D])===null||se===void 0)&&se[T-l+7])}),this.drawCorners(),this._options.image&&await this.drawImage({width:v.width,height:v.height,count:l,dotSize:a})}drawBackground(){var h,l,p;const f=this._element,a=this._options;if(f){const v=(h=a.backgroundOptions)===null||h===void 0?void 0:h.gradient,D=(l=a.backgroundOptions)===null||l===void 0?void 0:l.color;let T=a.height,z=a.width;if(v||D){const Q=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");this._backgroundClipPath=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._backgroundClipPath.setAttribute("id",`clip-path-background-color-${this._instanceId}`),this._defs.appendChild(this._backgroundClipPath),!((p=a.backgroundOptions)===null||p===void 0)&&p.round&&(T=z=Math.min(a.width,a.height),Q.setAttribute("rx",String(T/2*a.backgroundOptions.round))),Q.setAttribute("x",String(this._roundSize((a.width-z)/2))),Q.setAttribute("y",String(this._roundSize((a.height-T)/2))),Q.setAttribute("width",String(z)),Q.setAttribute("height",String(T)),this._backgroundClipPath.appendChild(Q),this._createColor({options:v,color:D,additionalRotation:0,x:0,y:0,height:a.height,width:a.width,name:`background-color-${this._instanceId}`})}}}drawDots(h){var l,p;if(!this._qr)throw"QR code is not defined";const f=this._options,a=this._qr.getModuleCount();if(a>f.width||a>f.height)throw"The canvas is too small.";const v=Math.min(f.width,f.height)-2*f.margin,D=f.shape===F?v/Math.sqrt(2):v,T=this._roundSize(D/a),z=this._roundSize((f.width-a*T)/2),Q=this._roundSize((f.height-a*T)/2),Z=new _({svg:this._element,type:f.dotsOptions.type,window:this._window});this._dotsClipPath=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._dotsClipPath.setAttribute("id",`clip-path-dot-color-${this._instanceId}`),this._defs.appendChild(this._dotsClipPath),this._createColor({options:(l=f.dotsOptions)===null||l===void 0?void 0:l.gradient,color:f.dotsOptions.color,additionalRotation:0,x:0,y:0,height:f.height,width:f.width,name:`dot-color-${this._instanceId}`});for(let U=0;U<a;U++)for(let ae=0;ae<a;ae++)h&&!h(U,ae)||!((p=this._qr)===null||p===void 0)&&p.isDark(U,ae)&&(Z.draw(z+ae*T,Q+U*T,T,(se,ue)=>!(ae+se<0||U+ue<0||ae+se>=a||U+ue>=a)&&!(h&&!h(U+ue,ae+se))&&!!this._qr&&this._qr.isDark(U+ue,ae+se)),Z._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(Z._element));if(f.shape===F){const U=this._roundSize((v/T-a)/2),ae=a+2*U,se=z-U*T,ue=Q-U*T,E=[],L=this._roundSize(ae/2);for(let $=0;$<ae;$++){E[$]=[];for(let I=0;I<ae;I++)$>=U-1&&$<=ae-U&&I>=U-1&&I<=ae-U||Math.sqrt(($-L)*($-L)+(I-L)*(I-L))>L?E[$][I]=0:E[$][I]=this._qr.isDark(I-2*U<0?I:I>=a?I-2*U:I-U,$-2*U<0?$:$>=a?$-2*U:$-U)?1:0}for(let $=0;$<ae;$++)for(let I=0;I<ae;I++)E[$][I]&&(Z.draw(se+I*T,ue+$*T,T,(Y,de)=>{var o;return!!(!((o=E[$+de])===null||o===void 0)&&o[I+Y])}),Z._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(Z._element))}}drawCorners(){if(!this._qr)throw"QR code is not defined";const h=this._element,l=this._options;if(!h)throw"Element code is not defined";const p=this._qr.getModuleCount(),f=Math.min(l.width,l.height)-2*l.margin,a=l.shape===F?f/Math.sqrt(2):f,v=this._roundSize(a/p),D=7*v,T=3*v,z=this._roundSize((l.width-p*v)/2),Q=this._roundSize((l.height-p*v)/2);[[0,0,0],[1,0,Math.PI/2],[0,1,-Math.PI/2]].forEach(([Z,U,ae])=>{var se,ue,E,L,$,I,Y,de,o,c,g,A,R,W;const le=z+Z*v*(p-7),fe=Q+U*v*(p-7);let pe=this._dotsClipPath,oe=this._dotsClipPath;if((!((se=l.cornersSquareOptions)===null||se===void 0)&&se.gradient||!((ue=l.cornersSquareOptions)===null||ue===void 0)&&ue.color)&&(pe=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),pe.setAttribute("id",`clip-path-corners-square-color-${Z}-${U}-${this._instanceId}`),this._defs.appendChild(pe),this._cornersSquareClipPath=this._cornersDotClipPath=oe=pe,this._createColor({options:(E=l.cornersSquareOptions)===null||E===void 0?void 0:E.gradient,color:(L=l.cornersSquareOptions)===null||L===void 0?void 0:L.color,additionalRotation:ae,x:le,y:fe,height:D,width:D,name:`corners-square-color-${Z}-${U}-${this._instanceId}`})),(($=l.cornersSquareOptions)===null||$===void 0?void 0:$.type)&&C.includes(l.cornersSquareOptions.type)){const ce=new S({svg:this._element,type:l.cornersSquareOptions.type,window:this._window});ce.draw(le,fe,D,ae),ce._element&&pe&&pe.appendChild(ce._element)}else{const ce=new _({svg:this._element,type:((I=l.cornersSquareOptions)===null||I===void 0?void 0:I.type)||l.dotsOptions.type,window:this._window});for(let ge=0;ge<B.length;ge++)for(let me=0;me<B[ge].length;me++)!((Y=B[ge])===null||Y===void 0)&&Y[me]&&(ce.draw(le+me*v,fe+ge*v,v,(Ce,Se)=>{var De;return!!(!((De=B[ge+Se])===null||De===void 0)&&De[me+Ce])}),ce._element&&pe&&pe.appendChild(ce._element))}if((!((de=l.cornersDotOptions)===null||de===void 0)&&de.gradient||!((o=l.cornersDotOptions)===null||o===void 0)&&o.color)&&(oe=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),oe.setAttribute("id",`clip-path-corners-dot-color-${Z}-${U}-${this._instanceId}`),this._defs.appendChild(oe),this._cornersDotClipPath=oe,this._createColor({options:(c=l.cornersDotOptions)===null||c===void 0?void 0:c.gradient,color:(g=l.cornersDotOptions)===null||g===void 0?void 0:g.color,additionalRotation:ae,x:le+2*v,y:fe+2*v,height:T,width:T,name:`corners-dot-color-${Z}-${U}-${this._instanceId}`})),((A=l.cornersDotOptions)===null||A===void 0?void 0:A.type)&&j.includes(l.cornersDotOptions.type)){const ce=new N({svg:this._element,type:l.cornersDotOptions.type,window:this._window});ce.draw(le+2*v,fe+2*v,T,ae),ce._element&&oe&&oe.appendChild(ce._element)}else{const ce=new _({svg:this._element,type:((R=l.cornersDotOptions)===null||R===void 0?void 0:R.type)||l.dotsOptions.type,window:this._window});for(let ge=0;ge<K.length;ge++)for(let me=0;me<K[ge].length;me++)!((W=K[ge])===null||W===void 0)&&W[me]&&(ce.draw(le+me*v,fe+ge*v,v,(Ce,Se)=>{var De;return!!(!((De=K[ge+Se])===null||De===void 0)&&De[me+Ce])}),ce._element&&oe&&oe.appendChild(ce._element))}})}loadImage(){return new Promise((h,l)=>{var p;const f=this._options;if(!f.image)return l("Image is not defined");if(!((p=f.nodeCanvas)===null||p===void 0)&&p.loadImage)f.nodeCanvas.loadImage(f.image).then(a=>{var v,D;if(this._image=a,this._options.imageOptions.saveAsBlob){const T=(v=f.nodeCanvas)===null||v===void 0?void 0:v.createCanvas(this._image.width,this._image.height);(D=T?.getContext("2d"))===null||D===void 0||D.drawImage(a,0,0),this._imageUri=T?.toDataURL()}h()}).catch(l);else{const a=new this._window.Image;typeof f.imageOptions.crossOrigin=="string"&&(a.crossOrigin=f.imageOptions.crossOrigin),this._image=a,a.onload=async()=>{this._options.imageOptions.saveAsBlob&&(this._imageUri=await(async function(v,D){return new Promise(T=>{const z=new D.XMLHttpRequest;z.onload=function(){const Q=new D.FileReader;Q.onloadend=function(){T(Q.result)},Q.readAsDataURL(z.response)},z.open("GET",v),z.responseType="blob",z.send()})})(f.image||"",this._window)),h()},a.src=f.image}})}async drawImage({width:h,height:l,count:p,dotSize:f}){const a=this._options,v=this._roundSize((a.width-p*f)/2),D=this._roundSize((a.height-p*f)/2),T=v+this._roundSize(a.imageOptions.margin+(p*f-h)/2),z=D+this._roundSize(a.imageOptions.margin+(p*f-l)/2),Q=h-2*a.imageOptions.margin,Z=l-2*a.imageOptions.margin,U=this._window.document.createElementNS("http://www.w3.org/2000/svg","image");U.setAttribute("href",this._imageUri||""),U.setAttribute("xlink:href",this._imageUri||""),U.setAttribute("x",String(T)),U.setAttribute("y",String(z)),U.setAttribute("width",`${Q}px`),U.setAttribute("height",`${Z}px`),this._element.appendChild(U)}_createColor({options:h,color:l,additionalRotation:p,x:f,y:a,height:v,width:D,name:T}){const z=D>v?D:v,Q=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");if(Q.setAttribute("x",String(f)),Q.setAttribute("y",String(a)),Q.setAttribute("height",String(v)),Q.setAttribute("width",String(D)),Q.setAttribute("clip-path",`url('#clip-path-${T}')`),h){let Z;if(h.type==="radial")Z=this._window.document.createElementNS("http://www.w3.org/2000/svg","radialGradient"),Z.setAttribute("id",T),Z.setAttribute("gradientUnits","userSpaceOnUse"),Z.setAttribute("fx",String(f+D/2)),Z.setAttribute("fy",String(a+v/2)),Z.setAttribute("cx",String(f+D/2)),Z.setAttribute("cy",String(a+v/2)),Z.setAttribute("r",String(z/2));else{const U=((h.rotation||0)+p)%(2*Math.PI),ae=(U+2*Math.PI)%(2*Math.PI);let se=f+D/2,ue=a+v/2,E=f+D/2,L=a+v/2;ae>=0&&ae<=.25*Math.PI||ae>1.75*Math.PI&&ae<=2*Math.PI?(se-=D/2,ue-=v/2*Math.tan(U),E+=D/2,L+=v/2*Math.tan(U)):ae>.25*Math.PI&&ae<=.75*Math.PI?(ue-=v/2,se-=D/2/Math.tan(U),L+=v/2,E+=D/2/Math.tan(U)):ae>.75*Math.PI&&ae<=1.25*Math.PI?(se+=D/2,ue+=v/2*Math.tan(U),E-=D/2,L-=v/2*Math.tan(U)):ae>1.25*Math.PI&&ae<=1.75*Math.PI&&(ue+=v/2,se+=D/2/Math.tan(U),L-=v/2,E-=D/2/Math.tan(U)),Z=this._window.document.createElementNS("http://www.w3.org/2000/svg","linearGradient"),Z.setAttribute("id",T),Z.setAttribute("gradientUnits","userSpaceOnUse"),Z.setAttribute("x1",String(Math.round(se))),Z.setAttribute("y1",String(Math.round(ue))),Z.setAttribute("x2",String(Math.round(E))),Z.setAttribute("y2",String(Math.round(L)))}h.colorStops.forEach(({offset:U,color:ae})=>{const se=this._window.document.createElementNS("http://www.w3.org/2000/svg","stop");se.setAttribute("offset",100*U+"%"),se.setAttribute("stop-color",ae),Z.appendChild(se)}),Q.setAttribute("fill",`url('#${T}')`),this._defs.appendChild(Z)}else l&&Q.setAttribute("fill",l);this._element.appendChild(Q)}}q.instanceCount=0;const te=q,ne="canvas",G={};for(let w=0;w<=40;w++)G[w]=w;const ee={type:ne,shape:"square",width:300,height:300,data:"",margin:0,qrOptions:{typeNumber:G[0],mode:void 0,errorCorrectionLevel:"Q"},imageOptions:{saveAsBlob:!0,hideBackgroundDots:!0,imageSize:.4,crossOrigin:void 0,margin:0},dotsOptions:{type:"square",color:"#000",roundSize:!0},backgroundOptions:{round:0,color:"#fff"}};function V(w){const h=Object.assign({},w);if(!h.colorStops||!h.colorStops.length)throw"Field 'colorStops' is required in gradient";return h.rotation?h.rotation=Number(h.rotation):h.rotation=0,h.colorStops=h.colorStops.map(l=>Object.assign(Object.assign({},l),{offset:Number(l.offset)})),h}function H(w){const h=Object.assign({},w);return h.width=Number(h.width),h.height=Number(h.height),h.margin=Number(h.margin),h.imageOptions=Object.assign(Object.assign({},h.imageOptions),{hideBackgroundDots:!!h.imageOptions.hideBackgroundDots,imageSize:Number(h.imageOptions.imageSize),margin:Number(h.imageOptions.margin)}),h.margin>Math.min(h.width,h.height)&&(h.margin=Math.min(h.width,h.height)),h.dotsOptions=Object.assign({},h.dotsOptions),h.dotsOptions.gradient&&(h.dotsOptions.gradient=V(h.dotsOptions.gradient)),h.cornersSquareOptions&&(h.cornersSquareOptions=Object.assign({},h.cornersSquareOptions),h.cornersSquareOptions.gradient&&(h.cornersSquareOptions.gradient=V(h.cornersSquareOptions.gradient))),h.cornersDotOptions&&(h.cornersDotOptions=Object.assign({},h.cornersDotOptions),h.cornersDotOptions.gradient&&(h.cornersDotOptions.gradient=V(h.cornersDotOptions.gradient))),h.backgroundOptions&&(h.backgroundOptions=Object.assign({},h.backgroundOptions),h.backgroundOptions.gradient&&(h.backgroundOptions.gradient=V(h.backgroundOptions.gradient))),h}var X=s(873),ie=s.n(X);function re(w){if(!w)throw new Error("Extension must be defined");w[0]==="."&&(w=w.substring(1));const h={bmp:"image/bmp",gif:"image/gif",ico:"image/vnd.microsoft.icon",jpeg:"image/jpeg",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml",tif:"image/tiff",tiff:"image/tiff",webp:"image/webp",pdf:"application/pdf"}[w.toLowerCase()];if(!h)throw new Error(`Extension "${w}" is not supported`);return h}class k{constructor(h){h!=null&&h.jsdom?this._window=new h.jsdom("",{resources:"usable"}).window:this._window=window,this._options=h?H(i(ee,h)):ee,this.update()}static _clearContainer(h){h&&(h.innerHTML="")}_setupSvg(){if(!this._qr)return;const h=new te(this._options,this._window);this._svg=h.getElement(),this._svgDrawingPromise=h.drawQR(this._qr).then(()=>{var l;this._svg&&((l=this._extension)===null||l===void 0||l.call(this,h.getElement(),this._options))})}_setupCanvas(){var h,l;this._qr&&(!((h=this._options.nodeCanvas)===null||h===void 0)&&h.createCanvas?(this._nodeCanvas=this._options.nodeCanvas.createCanvas(this._options.width,this._options.height),this._nodeCanvas.width=this._options.width,this._nodeCanvas.height=this._options.height):(this._domCanvas=document.createElement("canvas"),this._domCanvas.width=this._options.width,this._domCanvas.height=this._options.height),this._setupSvg(),this._canvasDrawingPromise=(l=this._svgDrawingPromise)===null||l===void 0?void 0:l.then(()=>{var p;if(!this._svg)return;const f=this._svg,a=new this._window.XMLSerializer().serializeToString(f),v=btoa(a),D=`data:${re("svg")};base64,${v}`;if(!((p=this._options.nodeCanvas)===null||p===void 0)&&p.loadImage)return this._options.nodeCanvas.loadImage(D).then(T=>{var z,Q;T.width=this._options.width,T.height=this._options.height,(Q=(z=this._nodeCanvas)===null||z===void 0?void 0:z.getContext("2d"))===null||Q===void 0||Q.drawImage(T,0,0)});{const T=new this._window.Image;return new Promise(z=>{T.onload=()=>{var Q,Z;(Z=(Q=this._domCanvas)===null||Q===void 0?void 0:Q.getContext("2d"))===null||Z===void 0||Z.drawImage(T,0,0),z()},T.src=D})}}))}async _getElement(h="png"){if(!this._qr)throw"QR code is empty";return h.toLowerCase()==="svg"?(this._svg&&this._svgDrawingPromise||this._setupSvg(),await this._svgDrawingPromise,this._svg):((this._domCanvas||this._nodeCanvas)&&this._canvasDrawingPromise||this._setupCanvas(),await this._canvasDrawingPromise,this._domCanvas||this._nodeCanvas)}update(h){k._clearContainer(this._container),this._options=h?H(i(this._options,h)):this._options,this._options.data&&(this._qr=ie()(this._options.qrOptions.typeNumber,this._options.qrOptions.errorCorrectionLevel),this._qr.addData(this._options.data,this._options.qrOptions.mode||(function(l){switch(!0){case/^[0-9]*$/.test(l):return"Numeric";case/^[0-9A-Z $%*+\-./:]*$/.test(l):return"Alphanumeric";default:return"Byte"}})(this._options.data)),this._qr.make(),this._options.type===ne?this._setupCanvas():this._setupSvg(),this.append(this._container))}append(h){if(h){if(typeof h.appendChild!="function")throw"Container should be a single DOM node";this._options.type===ne?this._domCanvas&&h.appendChild(this._domCanvas):this._svg&&h.appendChild(this._svg),this._container=h}}applyExtension(h){if(!h)throw"Extension function should be defined.";this._extension=h,this.update()}deleteExtension(){this._extension=void 0,this.update()}async getRawData(h="png"){if(!this._qr)throw"QR code is empty";const l=await this._getElement(h),p=re(h);if(!l)return null;if(h.toLowerCase()==="svg"){const f=`<?xml version="1.0" standalone="no"?>\r
|
|
22
22
|
${new this._window.XMLSerializer().serializeToString(l)}`;return typeof Blob>"u"||this._options.jsdom?Buffer.from(f):new Blob([f],{type:p})}return new Promise(f=>{const a=l;if("toBuffer"in a)if(p==="image/png")f(a.toBuffer(p));else if(p==="image/jpeg")f(a.toBuffer(p));else{if(p!=="application/pdf")throw Error("Unsupported extension");f(a.toBuffer(p))}else"toBlob"in a&&a.toBlob(f,p,1)})}async download(h){if(!this._qr)throw"QR code is empty";if(typeof Blob>"u")throw"Cannot download in Node.js, call getRawData instead.";let l="png",p="qr";typeof h=="string"?(l=h,console.warn("Extension is deprecated as argument for 'download' method, please pass object { name: '...', extension: '...' } as argument")):typeof h=="object"&&h!==null&&(h.name&&(p=h.name),h.extension&&(l=h.extension));const f=await this._getElement(l);if(f)if(l.toLowerCase()==="svg"){let a=new XMLSerializer().serializeToString(f);a=`<?xml version="1.0" standalone="no"?>\r
|
|
23
|
-
`+a,m(`data:${re(l)};charset=utf-8,${encodeURIComponent(a)}`,`${p}.svg`)}else m(f.toDataURL(re(l)),`${p}.${l}`)}}const x=P})(),u.default})())})(cn)),cn.exports}vl();const Fo=X.createContext(void 0);function bl(t){const e=ze.c(9),{children:r,baseUrl:n,queryClient:s}=t;let u;e[0]!==n||e[1]!==s?(u={baseUrl:n,queryClient:s},e[0]=n,e[1]=s,e[2]=u):u=e[2];let d;e[3]!==r||e[4]!==s?(d=y.jsx(Xn,{client:s,children:r}),e[3]=r,e[4]=s,e[5]=d):d=e[5];let i;return e[6]!==u||e[7]!==d?(i=y.jsx(Fo.Provider,{value:u,children:d}),e[6]=u,e[7]=d,e[8]=i):i=e[8],i}function yt(){const t=X.useContext(Fo);if(!t)throw new Error("useDataTable must be used within a DataTableProvider");return t}function dn(t){if(typeof t=="string")try{const e=JSON.parse(t);return{message:e.message||t,code:e.code,details:e.details}}catch{return{message:t}}return t instanceof Error?{message:t.message}:{message:"Unbekannter Fehler"}}async function Rt(t){const e=await t.text();if(!e)throw new Error(`HTTP ${t.status}: ${t.statusText}`);let r=null;try{r=JSON.parse(e)}catch{throw new Error(e)}throw r?.message?new Error(r.message):r?.error?new Error(r.error):new Error(e)}function wl(){const t=localStorage.getItem("a360.assumed-org");return t?{"X-Assume-Org":t}:{}}async function Mt(){return{"Content-Type":"application/json",Authorization:`Bearer ${await al()??""}`,...wl()}}async function Wo(t){return fetch(t,{method:"GET",headers:await Mt()}).then(async e=>(e.status>=400&&await Rt(e),e)).then(e=>e.json()).then(e=>e)}async function Uo(t,e){return fetch(`${t}/${e}`,{method:"GET",headers:await Mt()}).then(async r=>(r.status>=400&&await Rt(r),r)).then(r=>r.json()).then(r=>r)}async function qo(t,e){const r=await fetch(`${t}/${e}`,{method:"DELETE",headers:await Mt()});r.status>=400&&await Rt(r)}async function Vo(t,e){return fetch(t,{method:"POST",headers:await Mt(),body:JSON.stringify(e)}).then(async r=>(r.status>=400&&await Rt(r),r)).then(r=>r.status==204?e:r.json()).then(r=>r)}async function _l(t,e,r){return fetch(e,{method:t,headers:await Mt(),body:r?JSON.stringify(r):void 0}).then(async n=>(n.status>=400&&await Rt(n),n)).then(n=>{if(n.status!=204)return n.json()}).then(n=>n)}async function Ho(t,e){return fetch(`${t}/${e.id}`,{method:"PUT",headers:await Mt(),body:JSON.stringify(e)}).then(async r=>(r.status>=400&&await Rt(r),r)).then(r=>r.status==204?e:r.json()).then(r=>r)}function Go(t,e,r){const n=ze.c(13),{baseUrl:s}=yt();let u;if(n[0]!==r||n[1]!==e){let b;n[3]!==r?(b=r?.toString(),n[3]=r,n[4]=b):b=n[4],u=[...e.map(xl),String(b)],n[0]=r,n[1]=e,n[2]=u}else u=n[2];let d;n[5]!==t||n[6]!==s||n[7]!==r?(d=()=>Uo(`${s}${t}`,r),n[5]=t,n[6]=s,n[7]=r,n[8]=d):d=n[8];const i=!!r;let m;return n[9]!==u||n[10]!==d||n[11]!==i?(m={queryKey:u,queryFn:d,enabled:i},n[9]=u,n[10]=d,n[11]=i,n[12]=m):m=n[12],ro(m)}function xl(t){return t.toString()}function Qo(t,e,r){const n=ze.c(9),s=r===void 0?!0:r,{baseUrl:u}=yt();let d;n[0]!==e?(d=[...e.map(Cl)],n[0]=e,n[1]=d):d=n[1];let i;n[2]!==t||n[3]!==u?(i=()=>Wo(`${u}${t}`),n[2]=t,n[3]=u,n[4]=i):i=n[4];let m;return n[5]!==s||n[6]!==d||n[7]!==i?(m={queryKey:d,queryFn:i,enabled:s},n[5]=s,n[6]=d,n[7]=i,n[8]=m):m=n[8],ro(m)}function Cl(t){return t.toString()}function Ko(t,e){const r=ze.c(10),{baseUrl:n,queryClient:s}=yt();let u;r[0]!==e?(u=[...e.map(Dl)],r[0]=e,r[1]=u):u=r[1];let d;r[2]!==t||r[3]!==n?(d=m=>Vo(`${n}${t}`,m),r[2]=t,r[3]=n,r[4]=d):d=r[4];let i;return r[5]!==s||r[6]!==e||r[7]!==u||r[8]!==d?(i={mutationKey:u,mutationFn:d,onSettled(){return s.invalidateQueries({queryKey:[...e.map(Sl)]})},onError(m){dn(m)}},r[5]=s,r[6]=e,r[7]=u,r[8]=d,r[9]=i):i=r[9],Ur(i)}function Sl(t){return t.toString()}function Dl(t){return t.toString()}function hn(t,e){const r=ze.c(10),{baseUrl:n,queryClient:s}=yt();let u;r[0]!==e?(u=[...e.map(Pl)],r[0]=e,r[1]=u):u=r[1];let d;r[2]!==t||r[3]!==n?(d=m=>Ho(`${n}${t}`,m),r[2]=t,r[3]=n,r[4]=d):d=r[4];let i;return r[5]!==s||r[6]!==e||r[7]!==u||r[8]!==d?(i={mutationKey:u,mutationFn:d,onSettled(){return s.invalidateQueries({queryKey:[...e.map(kl)]})},onError(m){dn(m)}},r[5]=s,r[6]=e,r[7]=u,r[8]=d,r[9]=i):i=r[9],Ur(i)}function kl(t){return t.toString()}function Pl(t){return t.toString()}function Zo(t,e){const r=ze.c(10),{baseUrl:n,queryClient:s}=yt();let u;r[0]!==e?(u=[...e.map(Ol)],r[0]=e,r[1]=u):u=r[1];let d;r[2]!==t||r[3]!==n?(d=m=>qo(`${n}${t}`,m),r[2]=t,r[3]=n,r[4]=d):d=r[4];let i;return r[5]!==s||r[6]!==e||r[7]!==u||r[8]!==d?(i={mutationKey:u,mutationFn:d,onSettled(){return s.invalidateQueries({queryKey:[...e.map(Ml)]})},onError(m){dn(m)}},r[5]=s,r[6]=e,r[7]=u,r[8]=d,r[9]=i):i=r[9],Ur(i)}function Ml(t){return t.toString()}function Ol(t){return t.toString()}var mr={exports:{}},jl=mr.exports,Jo;function Al(){return Jo||(Jo=1,(function(t,e){(function(r,n){t.exports=n()})(jl,(function(){var r=1e3,n=6e4,s=36e5,u="millisecond",d="second",i="minute",m="hour",b="day",_="week",M="month",C="quarter",S="year",k="date",j="Invalid Date",N=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,F=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,B={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(P){var x=["th","st","nd","rd"],w=P%100;return"["+P+(x[(w-20)%10]||x[w]||x[0])+"]"}},Q=function(P,x,w){var h=String(P);return!h||h.length>=x?P:""+Array(x+1-h.length).join(w)+P},U={s:Q,z:function(P){var x=-P.utcOffset(),w=Math.abs(x),h=Math.floor(w/60),l=w%60;return(x<=0?"+":"-")+Q(h,2,"0")+":"+Q(l,2,"0")},m:function P(x,w){if(x.date()<w.date())return-P(w,x);var h=12*(w.year()-x.year())+(w.month()-x.month()),l=x.clone().add(h,M),p=w-l<0,f=x.clone().add(h+(p?-1:1),M);return+(-(h+(w-l)/(p?l-f:f-l))||0)},a:function(P){return P<0?Math.ceil(P)||0:Math.floor(P)},p:function(P){return{M,y:S,w:_,d:b,D:k,h:m,m:i,s:d,ms:u,Q:C}[P]||String(P||"").toLowerCase().replace(/s$/,"")},u:function(P){return P===void 0}},ne="en",oe={};oe[ne]=B;var G="$isDayjsObject",te=function(P){return P instanceof ae||!(!P||!P[G])},q=function P(x,w,h){var l;if(!x)return ne;if(typeof x=="string"){var p=x.toLowerCase();oe[p]&&(l=p),w&&(oe[p]=w,l=p);var f=x.split("-");if(!l&&f.length>1)return P(f[0])}else{var a=x.name;oe[a]=x,l=a}return!h&&l&&(ne=l),l||!h&&ne},V=function(P,x){if(te(P))return P.clone();var w=typeof x=="object"?x:{};return w.date=P,w.args=arguments,new ae(w)},ee=U;ee.l=q,ee.i=te,ee.w=function(P,x){return V(P,{locale:x.$L,utc:x.$u,x:x.$x,$offset:x.$offset})};var ae=(function(){function P(w){this.$L=q(w.locale,null,!0),this.parse(w),this.$x=this.$x||w.x||{},this[G]=!0}var x=P.prototype;return x.parse=function(w){this.$d=(function(h){var l=h.date,p=h.utc;if(l===null)return new Date(NaN);if(ee.u(l))return new Date;if(l instanceof Date)return new Date(l);if(typeof l=="string"&&!/Z$/i.test(l)){var f=l.match(N);if(f){var a=f[2]-1||0,v=(f[7]||"0").substring(0,3);return p?new Date(Date.UTC(f[1],a,f[3]||1,f[4]||0,f[5]||0,f[6]||0,v)):new Date(f[1],a,f[3]||1,f[4]||0,f[5]||0,f[6]||0,v)}}return new Date(l)})(w),this.init()},x.init=function(){var w=this.$d;this.$y=w.getFullYear(),this.$M=w.getMonth(),this.$D=w.getDate(),this.$W=w.getDay(),this.$H=w.getHours(),this.$m=w.getMinutes(),this.$s=w.getSeconds(),this.$ms=w.getMilliseconds()},x.$utils=function(){return ee},x.isValid=function(){return this.$d.toString()!==j},x.isSame=function(w,h){var l=V(w);return this.startOf(h)<=l&&l<=this.endOf(h)},x.isAfter=function(w,h){return V(w)<this.startOf(h)},x.isBefore=function(w,h){return this.endOf(h)<V(w)},x.$g=function(w,h,l){return ee.u(w)?this[h]:this.set(l,w)},x.unix=function(){return Math.floor(this.valueOf()/1e3)},x.valueOf=function(){return this.$d.getTime()},x.startOf=function(w,h){var l=this,p=!!ee.u(h)||h,f=ee.p(w),a=function(ie,se){var ue=ee.w(l.$u?Date.UTC(l.$y,se,ie):new Date(l.$y,se,ie),l);return p?ue:ue.endOf(b)},v=function(ie,se){return ee.w(l.toDate()[ie].apply(l.toDate("s"),(p?[0,0,0,0]:[23,59,59,999]).slice(se)),l)},D=this.$W,T=this.$M,z=this.$D,Z="set"+(this.$u?"UTC":"");switch(f){case S:return p?a(1,0):a(31,11);case M:return p?a(1,T):a(0,T+1);case _:var K=this.$locale().weekStart||0,H=(D<K?D+7:D)-K;return a(p?z-H:z+(6-H),T);case b:case k:return v(Z+"Hours",0);case m:return v(Z+"Minutes",1);case i:return v(Z+"Seconds",2);case d:return v(Z+"Milliseconds",3);default:return this.clone()}},x.endOf=function(w){return this.startOf(w,!1)},x.$set=function(w,h){var l,p=ee.p(w),f="set"+(this.$u?"UTC":""),a=(l={},l[b]=f+"Date",l[k]=f+"Date",l[M]=f+"Month",l[S]=f+"FullYear",l[m]=f+"Hours",l[i]=f+"Minutes",l[d]=f+"Seconds",l[u]=f+"Milliseconds",l)[p],v=p===b?this.$D+(h-this.$W):h;if(p===M||p===S){var D=this.clone().set(k,1);D.$d[a](v),D.init(),this.$d=D.set(k,Math.min(this.$D,D.daysInMonth())).$d}else a&&this.$d[a](v);return this.init(),this},x.set=function(w,h){return this.clone().$set(w,h)},x.get=function(w){return this[ee.p(w)]()},x.add=function(w,h){var l,p=this;w=Number(w);var f=ee.p(h),a=function(T){var z=V(p);return ee.w(z.date(z.date()+Math.round(T*w)),p)};if(f===M)return this.set(M,this.$M+w);if(f===S)return this.set(S,this.$y+w);if(f===b)return a(1);if(f===_)return a(7);var v=(l={},l[i]=n,l[m]=s,l[d]=r,l)[f]||1,D=this.$d.getTime()+w*v;return ee.w(D,this)},x.subtract=function(w,h){return this.add(-1*w,h)},x.format=function(w){var h=this,l=this.$locale();if(!this.isValid())return l.invalidDate||j;var p=w||"YYYY-MM-DDTHH:mm:ssZ",f=ee.z(this),a=this.$H,v=this.$m,D=this.$M,T=l.weekdays,z=l.months,Z=l.meridiem,K=function(se,ue,E,L){return se&&(se[ue]||se(h,p))||E[ue].slice(0,L)},H=function(se){return ee.s(a%12||12,se,"0")},ie=Z||function(se,ue,E){var L=se<12?"AM":"PM";return E?L.toLowerCase():L};return p.replace(F,(function(se,ue){return ue||(function(E){switch(E){case"YY":return String(h.$y).slice(-2);case"YYYY":return ee.s(h.$y,4,"0");case"M":return D+1;case"MM":return ee.s(D+1,2,"0");case"MMM":return K(l.monthsShort,D,z,3);case"MMMM":return K(z,D);case"D":return h.$D;case"DD":return ee.s(h.$D,2,"0");case"d":return String(h.$W);case"dd":return K(l.weekdaysMin,h.$W,T,2);case"ddd":return K(l.weekdaysShort,h.$W,T,3);case"dddd":return T[h.$W];case"H":return String(a);case"HH":return ee.s(a,2,"0");case"h":return H(1);case"hh":return H(2);case"a":return ie(a,v,!0);case"A":return ie(a,v,!1);case"m":return String(v);case"mm":return ee.s(v,2,"0");case"s":return String(h.$s);case"ss":return ee.s(h.$s,2,"0");case"SSS":return ee.s(h.$ms,3,"0");case"Z":return f}return null})(se)||f.replace(":","")}))},x.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},x.diff=function(w,h,l){var p,f=this,a=ee.p(h),v=V(w),D=(v.utcOffset()-this.utcOffset())*n,T=this-v,z=function(){return ee.m(f,v)};switch(a){case S:p=z()/12;break;case M:p=z();break;case C:p=z()/3;break;case _:p=(T-D)/6048e5;break;case b:p=(T-D)/864e5;break;case m:p=T/s;break;case i:p=T/n;break;case d:p=T/r;break;default:p=T}return l?p:ee.a(p)},x.daysInMonth=function(){return this.endOf(M).$D},x.$locale=function(){return oe[this.$L]},x.locale=function(w,h){if(!w)return this.$L;var l=this.clone(),p=q(w,h,!0);return p&&(l.$L=p),l},x.clone=function(){return ee.w(this.$d,this)},x.toDate=function(){return new Date(this.valueOf())},x.toJSON=function(){return this.isValid()?this.toISOString():null},x.toISOString=function(){return this.$d.toISOString()},x.toString=function(){return this.$d.toUTCString()},P})(),re=ae.prototype;return V.prototype=re,[["$ms",u],["$s",d],["$m",i],["$H",m],["$W",b],["$M",M],["$y",S],["$D",k]].forEach((function(P){re[P[1]]=function(x){return this.$g(x,P[0],P[1])}})),V.extend=function(P,x){return P.$i||(P(x,ae,V),P.$i=!0),V},V.locale=q,V.isDayjs=te,V.unix=function(P){return V(1e3*P)},V.en=oe[ne],V.Ls=oe,V.p={},V}))})(mr)),mr.exports}var El=Al();const de=Rn(El);function Tl({direction:t,levelIndex:e,rowIndex:r,cellIndex:n,size:s}){switch(t){case"up":return e===0&&r===0?null:r===0?{levelIndex:e-1,rowIndex:n<=s[e-1][s[e-1].length-1]-1?s[e-1].length-1:s[e-1].length-2,cellIndex:n}:{levelIndex:e,rowIndex:r-1,cellIndex:n};case"down":return r===s[e].length-1?{levelIndex:e+1,rowIndex:0,cellIndex:n}:r===s[e].length-2&&n>=s[e][s[e].length-1]?{levelIndex:e+1,rowIndex:0,cellIndex:n}:{levelIndex:e,rowIndex:r+1,cellIndex:n};case"left":return e===0&&r===0&&n===0?null:r===0&&n===0?{levelIndex:e-1,rowIndex:s[e-1].length-1,cellIndex:s[e-1][s[e-1].length-1]-1}:n===0?{levelIndex:e,rowIndex:r-1,cellIndex:s[e][r-1]-1}:{levelIndex:e,rowIndex:r,cellIndex:n-1};case"right":return r===s[e].length-1&&n===s[e][r]-1?{levelIndex:e+1,rowIndex:0,cellIndex:0}:n===s[e][r]-1?{levelIndex:e,rowIndex:r+1,cellIndex:0}:{levelIndex:e,rowIndex:r,cellIndex:n+1};default:return{levelIndex:e,rowIndex:r,cellIndex:n}}}function Xo({controlsRef:t,direction:e,levelIndex:r,rowIndex:n,cellIndex:s,size:u}){const d=Tl({direction:e,size:u,rowIndex:n,cellIndex:s,levelIndex:r});if(!d)return;const i=t.current?.[d.levelIndex]?.[d.rowIndex]?.[d.cellIndex];i&&(i.disabled||i.getAttribute("data-hidden")||i.getAttribute("data-outside")?Xo({controlsRef:t,direction:e,levelIndex:d.levelIndex,cellIndex:d.cellIndex,rowIndex:d.rowIndex,size:u}):i.focus())}function $l(t){switch(t){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function Rl(t){return t.current?.map(e=>e.map(r=>r.length))}function fn({controlsRef:t,levelIndex:e,rowIndex:r,cellIndex:n,event:s}){const u=$l(s.key);if(u){s.preventDefault();const d=Rl(t);Xo({controlsRef:t,direction:u,levelIndex:e,rowIndex:r,cellIndex:n,size:d})}}function qe(t){return t==null||t===""?t:de(t).format("YYYY-MM-DD")}function es(t){return t==null||t===""?t:de(t).format("YYYY-MM-DD HH:mm:ss")}const Nl={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},Ll=X.createContext(Nl);function vt(){const t=X.useContext(Ll),e=X.useCallback(u=>u||t.locale,[t.locale]),r=X.useCallback(u=>typeof u=="number"?u:t.firstDayOfWeek,[t.firstDayOfWeek]),n=X.useCallback(u=>Array.isArray(u)?u:t.weekendDays,[t.weekendDays]),s=X.useCallback(u=>typeof u=="string"?u:t.labelSeparator,[t.labelSeparator]);return{...t,getLocale:e,getFirstDayOfWeek:r,getWeekendDays:n,getLabelSeparator:s}}function Bl({value:t,type:e,withTime:r}){const n=r?es:qe;if(e==="range"&&Array.isArray(t)){const s=n(t[0]),u=n(t[1]);return s?u?`${s} – ${u}`:`${s} –`:""}return e==="multiple"&&Array.isArray(t)?t.filter(Boolean).join(", "):!Array.isArray(t)&&t?n(t):""}function ts({value:t,type:e,name:r,form:n,withTime:s=!1}){return y.jsx("input",{type:"hidden",value:Bl({value:t,type:e,withTime:s}),name:r,form:n})}ts.displayName="@mantine/dates/HiddenDatesInput";function rs(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(r=rs(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Oe(){for(var t,e,r=0,n="",s=arguments.length;r<s;r++)(t=arguments[r])&&(e=rs(t))&&(n&&(n+=" "),n+=e);return n}var ns={day:"m_396ce5cb"};const Il=O.createVarsResolver((t,{size:e})=>({day:{"--day-size":O.getSize(e,"day-size")}})),pn=O.factory((t,e)=>{const r=O.useProps("Day",null,t),{classNames:n,className:s,style:u,styles:d,unstyled:i,vars:m,date:b,disabled:_,__staticSelector:M,weekend:C,outside:S,selected:k,renderDay:j,inRange:N,firstInRange:F,lastInRange:B,hidden:Q,static:U,highlightToday:ne,attributes:oe,...G}=r,te=O.useStyles({name:M||"Day",classes:ns,props:r,className:s,style:u,classNames:n,styles:d,unstyled:i,attributes:oe,vars:m,varsResolver:Il,rootSelector:"day"});return y.jsx(O.UnstyledButton,{...te("day",{style:Q?{display:"none"}:void 0}),component:U?"div":"button",ref:e,disabled:_,"data-today":de(b).isSame(new Date,"day")||void 0,"data-hidden":Q||void 0,"data-highlight-today":ne||void 0,"data-disabled":_||void 0,"data-weekend":!_&&!S&&C||void 0,"data-outside":!_&&S||void 0,"data-selected":!_&&k||void 0,"data-in-range":N&&!_||void 0,"data-first-in-range":F&&!_||void 0,"data-last-in-range":B&&!_||void 0,"data-static":U||void 0,unstyled:i,...G,children:j?.(b)||de(b).date()})});pn.classes=ns,pn.displayName="@mantine/dates/Day";function Yl({locale:t,format:e="dd",firstDayOfWeek:r=1}){const n=de().day(r),s=[];for(let u=0;u<7;u+=1)typeof e=="string"?s.push(de(n).add(u,"days").locale(t).format(e)):s.push(e(de(n).add(u,"days").format("YYYY-MM-DD")));return s}var os={weekday:"m_18a3eca"};const zl=O.createVarsResolver((t,{size:e})=>({weekdaysRow:{"--wr-fz":O.getFontSize(e),"--wr-spacing":O.getSpacing(e)}})),gn=O.factory((t,e)=>{const r=O.useProps("WeekdaysRow",null,t),{classNames:n,className:s,style:u,styles:d,unstyled:i,vars:m,locale:b,firstDayOfWeek:_,weekdayFormat:M,cellComponent:C="th",__staticSelector:S,withWeekNumbers:k,attributes:j,...N}=r,F=O.useStyles({name:S||"WeekdaysRow",classes:os,props:r,className:s,style:u,classNames:n,styles:d,unstyled:i,attributes:j,vars:m,varsResolver:zl,rootSelector:"weekdaysRow"}),B=vt(),Q=Yl({locale:B.getLocale(b),format:M,firstDayOfWeek:B.getFirstDayOfWeek(_)}).map((U,ne)=>y.jsx(C,{...F("weekday"),children:U},ne));return y.jsxs(O.Box,{component:"tr",ref:e,...F("weekdaysRow"),...N,children:[k&&y.jsx(C,{...F("weekday"),children:"#"}),Q]})});gn.classes=os,gn.displayName="@mantine/dates/WeekdaysRow";function Fl(t,e=1){let r=de(t);if(!r.isValid())return r;const n=e===0?6:e-1;for(;r.day()!==n;)r=r.add(1,"day");return r.format("YYYY-MM-DD")}function Wl(t,e=1){let r=de(t);for(;r.day()!==e;)r=r.subtract(1,"day");return r.format("YYYY-MM-DD")}function Ul({month:t,firstDayOfWeek:e=1,consistentWeeks:r}){const n=de(t).subtract(de(t).date()-1,"day"),s=de(n.format("YYYY-M-D")),u=s.format("YYYY-MM-DD"),d=s.add(+s.daysInMonth()-1,"day").format("YYYY-MM-DD"),i=Fl(d,e),m=[];let b=de(Wl(u,e));for(;de(b).isBefore(i,"day");){const _=[];for(let M=0;M<7;M+=1)_.push(b.format("YYYY-MM-DD")),b=b.add(1,"day");m.push(_)}if(r&&m.length<6){const _=m[m.length-1],M=_[_.length-1];let C=de(M).add(1,"day");for(;m.length<6;){const S=[];for(let k=0;k<7;k+=1)S.push(C.format("YYYY-MM-DD")),C=C.add(1,"day");m.push(S)}}return m}function mn(t,e){return de(t).format("YYYY-MM")===de(e).format("YYYY-MM")}function ss(t,e){return e?de(t).isAfter(de(e).subtract(1,"day"),"day"):!0}function is(t,e){return e?de(t).isBefore(de(e).add(1,"day"),"day"):!0}function ql({dates:t,minDate:e,maxDate:r,getDayProps:n,excludeDate:s,hideOutsideDates:u,month:d}){const i=t.flat().filter(_=>is(_,r)&&ss(_,e)&&!s?.(_)&&!n?.(_)?.disabled&&(!u||mn(_,d))),m=i.find(_=>n?.(_)?.selected);if(m)return m;const b=i.find(_=>de().isSame(_,"date"));return b||i[0]}var yr={exports:{}},Vl=yr.exports,as;function Hl(){return as||(as=1,(function(t,e){(function(r,n){t.exports=n()})(Vl,(function(){var r="day";return function(n,s,u){var d=function(b){return b.add(4-b.isoWeekday(),r)},i=s.prototype;i.isoWeekYear=function(){return d(this).year()},i.isoWeek=function(b){if(!this.$utils().u(b))return this.add(7*(b-this.isoWeek()),r);var _,M,C,S,k=d(this),j=(_=this.isoWeekYear(),M=this.$u,C=(M?u.utc:u)().year(_).startOf("year"),S=4-C.isoWeekday(),C.isoWeekday()>4&&(S+=7),C.add(S,r));return k.diff(j,"week")+1},i.isoWeekday=function(b){return this.$utils().u(b)?this.day()||7:this.day(this.day()%7?b:b-7)};var m=i.startOf;i.startOf=function(b,_){var M=this.$utils(),C=!!M.u(_)||_;return M.p(b)==="isoweek"?C?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):m.bind(this)(b,_)}}}))})(yr)),yr.exports}var Gl=Hl();const Ql=Rn(Gl);de.extend(Ql);function Kl(t){const e=t.find(r=>de(r).day()===1);return de(e).isoWeek()}var ls={month:"m_cc9820d3",monthCell:"m_8f457cd5",weekNumber:"m_6cff9dea"};const Zl={withCellSpacing:!0},Jl=O.createVarsResolver((t,{size:e})=>({weekNumber:{"--wn-fz":O.getFontSize(e),"--wn-size":O.getSize(e,"wn-size")}})),vr=O.factory((t,e)=>{const r=O.useProps("Month",Zl,t),{classNames:n,className:s,style:u,styles:d,unstyled:i,vars:m,__staticSelector:b,locale:_,firstDayOfWeek:M,weekdayFormat:C,month:S,weekendDays:k,getDayProps:j,excludeDate:N,minDate:F,maxDate:B,renderDay:Q,hideOutsideDates:U,hideWeekdays:ne,getDayAriaLabel:oe,static:G,__getDayRef:te,__onDayKeyDown:q,__onDayClick:V,__onDayMouseEnter:ee,__preventFocus:ae,__stopPropagation:re,withCellSpacing:P,size:x,highlightToday:w,withWeekNumbers:h,attributes:l,...p}=r,f=O.useStyles({name:b||"Month",classes:ls,props:r,className:s,style:u,classNames:n,styles:d,unstyled:i,attributes:l,vars:m,varsResolver:Jl,rootSelector:"month"}),a=vt(),v=Ul({month:S,firstDayOfWeek:a.getFirstDayOfWeek(M),consistentWeeks:a.consistentWeeks}),D=ql({dates:v,minDate:qe(F),maxDate:qe(B),getDayProps:j,excludeDate:N,hideOutsideDates:U,month:S}),{resolvedClassNames:T,resolvedStyles:z}=O.useResolvedStylesApi({classNames:n,styles:d,props:r}),Z=v.map((K,H)=>{const ie=K.map((se,ue)=>{const E=!mn(se,S),L=oe?.(se)||de(se).locale(_||a.locale).format("D MMMM YYYY"),$=j?.(se),Y=de(se).isSame(D,"date");return y.jsx("td",{...f("monthCell"),"data-with-spacing":P||void 0,children:y.jsx(pn,{__staticSelector:b||"Month",classNames:T,styles:z,unstyled:i,"data-mantine-stop-propagation":re||void 0,highlightToday:w,renderDay:Q,date:se,size:x,weekend:a.getWeekendDays(k).includes(de(se).get("day")),outside:E,hidden:U?E:!1,"aria-label":L,static:G,disabled:N?.(se)||!is(se,qe(B))||!ss(se,qe(F)),ref:I=>{I&&te?.(H,ue,I)},...$,onKeyDown:I=>{$?.onKeyDown?.(I),q?.(I,{rowIndex:H,cellIndex:ue,date:se})},onMouseEnter:I=>{$?.onMouseEnter?.(I),ee?.(I,se)},onClick:I=>{$?.onClick?.(I),V?.(I,se)},onMouseDown:I=>{$?.onMouseDown?.(I),ae&&I.preventDefault()},tabIndex:ae||!Y?-1:0})},se.toString())});return y.jsxs("tr",{...f("monthRow"),children:[h&&y.jsx("td",{...f("weekNumber"),children:Kl(K)}),ie]},H)});return y.jsxs(O.Box,{component:"table",...f("month"),size:x,ref:e,...p,children:[!ne&&y.jsx("thead",{...f("monthThead"),children:y.jsx(gn,{__staticSelector:b||"Month",locale:_,firstDayOfWeek:M,weekdayFormat:C,size:x,classNames:T,styles:z,unstyled:i,withWeekNumbers:h})}),y.jsx("tbody",{...f("monthTbody"),children:Z})]})});vr.classes=ls,vr.displayName="@mantine/dates/Month";var us={pickerControl:"m_dc6a3c71"};const Xl=O.createVarsResolver((t,{size:e})=>({pickerControl:{"--dpc-fz":O.getFontSize(e),"--dpc-size":O.getSize(e,"dpc-size")}})),br=O.factory((t,e)=>{const r=O.useProps("PickerControl",null,t),{classNames:n,className:s,style:u,styles:d,unstyled:i,vars:m,firstInRange:b,lastInRange:_,inRange:M,__staticSelector:C,selected:S,disabled:k,attributes:j,...N}=r,F=O.useStyles({name:C||"PickerControl",classes:us,props:r,className:s,style:u,classNames:n,styles:d,unstyled:i,attributes:j,vars:m,varsResolver:Xl,rootSelector:"pickerControl"});return y.jsx(O.UnstyledButton,{...F("pickerControl"),ref:e,unstyled:i,"data-picker-control":!0,"data-selected":S&&!k||void 0,"data-disabled":k||void 0,"data-in-range":M&&!k&&!S||void 0,"data-first-in-range":b&&!k||void 0,"data-last-in-range":_&&!k||void 0,disabled:k,...N})});br.classes=us,br.displayName="@mantine/dates/PickerControl";function cs({year:t,minDate:e,maxDate:r}){return!e&&!r?!1:!!(e&&de(t).isBefore(e,"year")||r&&de(t).isAfter(r,"year"))}function eu({years:t,minDate:e,maxDate:r,getYearControlProps:n}){const s=t.flat().filter(i=>!cs({year:i,minDate:e,maxDate:r})&&!n?.(i)?.disabled),u=s.find(i=>n?.(i)?.selected);if(u)return u;const d=s.find(i=>de().isSame(i,"year"));return d||s[0]}function ds(t){const e=de(t).year(),r=e-e%10;let n=0;const s=[[],[],[],[]];for(let u=0;u<4;u+=1){const d=u===3?1:3;for(let i=0;i<d;i+=1)s[u].push(de(new Date(r+n,0)).format("YYYY-MM-DD")),n+=1}return s}var hs={yearsList:"m_9206547b",yearsListCell:"m_c5a19c7d"};const tu={yearsListFormat:"YYYY",withCellSpacing:!0},wr=O.factory((t,e)=>{const r=O.useProps("YearsList",tu,t),{classNames:n,className:s,style:u,styles:d,unstyled:i,vars:m,decade:b,yearsListFormat:_,locale:M,minDate:C,maxDate:S,getYearControlProps:k,__staticSelector:j,__getControlRef:N,__onControlKeyDown:F,__onControlClick:B,__onControlMouseEnter:Q,__preventFocus:U,__stopPropagation:ne,withCellSpacing:oe,size:G,attributes:te,...q}=r,V=O.useStyles({name:j||"YearsList",classes:hs,props:r,className:s,style:u,classNames:n,styles:d,unstyled:i,attributes:te,vars:m,rootSelector:"yearsList"}),ee=vt(),ae=ds(b),re=eu({years:ae,minDate:C,maxDate:S,getYearControlProps:k}),P=ae.map((x,w)=>{const h=x.map((l,p)=>{const f=k?.(l),a=de(l).isSame(re,"year");return y.jsx("td",{...V("yearsListCell"),"data-with-spacing":oe||void 0,children:y.jsx(br,{...V("yearsListControl"),size:G,unstyled:i,"data-mantine-stop-propagation":ne||void 0,disabled:cs({year:l,minDate:C,maxDate:S}),ref:v=>{v&&N?.(w,p,v)},...f,onKeyDown:v=>{f?.onKeyDown?.(v),F?.(v,{rowIndex:w,cellIndex:p,date:l})},onClick:v=>{f?.onClick?.(v),B?.(v,l)},onMouseEnter:v=>{f?.onMouseEnter?.(v),Q?.(v,l)},onMouseDown:v=>{f?.onMouseDown?.(v),U&&v.preventDefault()},tabIndex:U||!a?-1:0,children:de(l).locale(ee.getLocale(M)).format(_)})},p)});return y.jsx("tr",{...V("yearsListRow"),children:h},w)});return y.jsx(O.Box,{component:"table",ref:e,size:G,...V("yearsList"),...q,children:y.jsx("tbody",{children:P})})});wr.classes=hs,wr.displayName="@mantine/dates/YearsList";function fs({month:t,minDate:e,maxDate:r}){return!e&&!r?!1:!!(e&&de(t).isBefore(e,"month")||r&&de(t).isAfter(r,"month"))}function ru({months:t,minDate:e,maxDate:r,getMonthControlProps:n}){const s=t.flat().filter(i=>!fs({month:i,minDate:e,maxDate:r})&&!n?.(i)?.disabled),u=s.find(i=>n?.(i)?.selected);if(u)return u;const d=s.find(i=>de().isSame(i,"month"));return d||s[0]}function nu(t){const e=de(t).startOf("year").toDate(),r=[[],[],[],[]];let n=0;for(let s=0;s<4;s+=1)for(let u=0;u<3;u+=1)r[s].push(de(e).add(n,"months").format("YYYY-MM-DD")),n+=1;return r}var ps={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const ou={monthsListFormat:"MMM",withCellSpacing:!0},_r=O.factory((t,e)=>{const r=O.useProps("MonthsList",ou,t),{classNames:n,className:s,style:u,styles:d,unstyled:i,vars:m,__staticSelector:b,year:_,monthsListFormat:M,locale:C,minDate:S,maxDate:k,getMonthControlProps:j,__getControlRef:N,__onControlKeyDown:F,__onControlClick:B,__onControlMouseEnter:Q,__preventFocus:U,__stopPropagation:ne,withCellSpacing:oe,size:G,attributes:te,...q}=r,V=O.useStyles({name:b||"MonthsList",classes:ps,props:r,className:s,style:u,classNames:n,styles:d,unstyled:i,attributes:te,vars:m,rootSelector:"monthsList"}),ee=vt(),ae=nu(_),re=ru({months:ae,minDate:qe(S),maxDate:qe(k),getMonthControlProps:j}),P=ae.map((x,w)=>{const h=x.map((l,p)=>{const f=j?.(l),a=de(l).isSame(re,"month");return y.jsx("td",{...V("monthsListCell"),"data-with-spacing":oe||void 0,children:y.jsx(br,{...V("monthsListControl"),size:G,unstyled:i,__staticSelector:b||"MonthsList","data-mantine-stop-propagation":ne||void 0,disabled:fs({month:l,minDate:qe(S),maxDate:qe(k)}),ref:v=>{v&&N?.(w,p,v)},...f,onKeyDown:v=>{f?.onKeyDown?.(v),F?.(v,{rowIndex:w,cellIndex:p,date:l})},onClick:v=>{f?.onClick?.(v),B?.(v,l)},onMouseEnter:v=>{f?.onMouseEnter?.(v),Q?.(v,l)},onMouseDown:v=>{f?.onMouseDown?.(v),U&&v.preventDefault()},tabIndex:U||!a?-1:0,children:de(l).locale(ee.getLocale(C)).format(M)})},p)});return y.jsx("tr",{...V("monthsListRow"),children:h},w)});return y.jsx(O.Box,{component:"table",ref:e,size:G,...V("monthsList"),...q,children:y.jsx("tbody",{children:P})})});_r.classes=ps,_r.displayName="@mantine/dates/MonthsList";var gs={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderControlIcon:"m_367dc749"};const su={hasNextLevel:!0,withNext:!0,withPrevious:!0,headerControlsOrder:["previous","level","next"]},iu=O.createVarsResolver((t,{size:e})=>({calendarHeader:{"--dch-control-size":O.getSize(e,"dch-control-size"),"--dch-fz":O.getFontSize(e)}})),bt=O.factory((t,e)=>{const r=O.useProps("CalendarHeader",su,t),{classNames:n,className:s,style:u,styles:d,unstyled:i,vars:m,nextIcon:b,previousIcon:_,nextLabel:M,previousLabel:C,onNext:S,onPrevious:k,onLevelClick:j,label:N,nextDisabled:F,previousDisabled:B,hasNextLevel:Q,levelControlAriaLabel:U,withNext:ne,withPrevious:oe,headerControlsOrder:G,__staticSelector:te,__preventFocus:q,__stopPropagation:V,attributes:ee,...ae}=r,re=O.useStyles({name:te||"CalendarHeader",classes:gs,props:r,className:s,style:u,classNames:n,styles:d,unstyled:i,attributes:ee,vars:m,varsResolver:iu,rootSelector:"calendarHeader"}),P=q?p=>p.preventDefault():void 0,x=oe&&X.createElement(O.UnstyledButton,{...re("calendarHeaderControl"),key:"previous","data-direction":"previous","aria-label":C,onClick:k,unstyled:i,onMouseDown:P,disabled:B,"data-disabled":B||void 0,tabIndex:q||B?-1:0,"data-mantine-stop-propagation":V||void 0},_||y.jsx(O.AccordionChevron,{...re("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})),w=X.createElement(O.UnstyledButton,{component:Q?"button":"div",...re("calendarHeaderLevel"),key:"level",onClick:Q?j:void 0,unstyled:i,onMouseDown:Q?P:void 0,disabled:!Q,"data-static":!Q||void 0,"aria-label":U,tabIndex:q||!Q?-1:0,"data-mantine-stop-propagation":V||void 0},N),h=ne&&X.createElement(O.UnstyledButton,{...re("calendarHeaderControl"),key:"next","data-direction":"next","aria-label":M,onClick:S,unstyled:i,onMouseDown:P,disabled:F,"data-disabled":F||void 0,tabIndex:q||F?-1:0,"data-mantine-stop-propagation":V||void 0},b||y.jsx(O.AccordionChevron,{...re("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})),l=G.map(p=>p==="previous"?x:p==="level"?w:p==="next"?h:null);return y.jsx(O.Box,{...re("calendarHeader"),ref:e,...ae,children:l})});bt.classes=gs,bt.displayName="@mantine/dates/CalendarHeader";function au(t){const e=ds(t);return[e[0][0],e[3][0]]}const lu={decadeLabelFormat:"YYYY"},xr=O.factory((t,e)=>{const r=O.useProps("DecadeLevel",lu,t),{decade:n,locale:s,minDate:u,maxDate:d,yearsListFormat:i,getYearControlProps:m,__getControlRef:b,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:C,withCellSpacing:S,__preventFocus:k,nextIcon:j,previousIcon:N,nextLabel:F,previousLabel:B,onNext:Q,onPrevious:U,nextDisabled:ne,previousDisabled:oe,levelControlAriaLabel:G,withNext:te,withPrevious:q,headerControlsOrder:V,decadeLabelFormat:ee,classNames:ae,styles:re,unstyled:P,__staticSelector:x,__stopPropagation:w,size:h,attributes:l,...p}=r,f=vt(),[a,v]=au(n),D={__staticSelector:x||"DecadeLevel",classNames:ae,styles:re,unstyled:P,size:h,attributes:l},T=typeof ne=="boolean"?ne:d?!de(v).endOf("year").isBefore(d):!1,z=typeof oe=="boolean"?oe:u?!de(a).startOf("year").isAfter(u):!1,Z=(K,H)=>de(K).locale(s||f.locale).format(H);return y.jsxs(O.Box,{"data-decade-level":!0,size:h,ref:e,...p,children:[y.jsx(bt,{label:typeof ee=="function"?ee(a,v):`${Z(a,ee)} – ${Z(v,ee)}`,__preventFocus:k,__stopPropagation:w,nextIcon:j,previousIcon:N,nextLabel:F,previousLabel:B,onNext:Q,onPrevious:U,nextDisabled:T,previousDisabled:z,hasNextLevel:!1,levelControlAriaLabel:G,withNext:te,withPrevious:q,headerControlsOrder:V,...D}),y.jsx(wr,{decade:n,locale:s,minDate:u,maxDate:d,yearsListFormat:i,getYearControlProps:m,__getControlRef:b,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:C,__preventFocus:k,__stopPropagation:w,withCellSpacing:S,...D})]})});xr.classes={...wr.classes,...bt.classes},xr.displayName="@mantine/dates/DecadeLevel";const uu={yearLabelFormat:"YYYY"},Cr=O.factory((t,e)=>{const r=O.useProps("YearLevel",uu,t),{year:n,locale:s,minDate:u,maxDate:d,monthsListFormat:i,getMonthControlProps:m,__getControlRef:b,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:C,withCellSpacing:S,__preventFocus:k,nextIcon:j,previousIcon:N,nextLabel:F,previousLabel:B,onNext:Q,onPrevious:U,onLevelClick:ne,nextDisabled:oe,previousDisabled:G,hasNextLevel:te,levelControlAriaLabel:q,withNext:V,withPrevious:ee,headerControlsOrder:ae,yearLabelFormat:re,__staticSelector:P,__stopPropagation:x,size:w,classNames:h,styles:l,unstyled:p,attributes:f,...a}=r,v=vt(),D={__staticSelector:P||"YearLevel",classNames:h,styles:l,unstyled:p,size:w,attributes:f},T=typeof oe=="boolean"?oe:d?!de(n).endOf("year").isBefore(d):!1,z=typeof G=="boolean"?G:u?!de(n).startOf("year").isAfter(u):!1;return y.jsxs(O.Box,{"data-year-level":!0,size:w,ref:e,...a,children:[y.jsx(bt,{label:typeof re=="function"?re(n):de(n).locale(s||v.locale).format(re),__preventFocus:k,__stopPropagation:x,nextIcon:j,previousIcon:N,nextLabel:F,previousLabel:B,onNext:Q,onPrevious:U,onLevelClick:ne,nextDisabled:T,previousDisabled:z,hasNextLevel:te,levelControlAriaLabel:q,withNext:V,withPrevious:ee,headerControlsOrder:ae,...D}),y.jsx(_r,{year:n,locale:s,minDate:u,maxDate:d,monthsListFormat:i,getMonthControlProps:m,__getControlRef:b,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:C,__preventFocus:k,__stopPropagation:x,withCellSpacing:S,...D})]})});Cr.classes={...bt.classes,..._r.classes},Cr.displayName="@mantine/dates/YearLevel";const cu={monthLabelFormat:"MMMM YYYY"},Sr=O.factory((t,e)=>{const r=O.useProps("MonthLevel",cu,t),{month:n,locale:s,firstDayOfWeek:u,weekdayFormat:d,weekendDays:i,getDayProps:m,excludeDate:b,minDate:_,maxDate:M,renderDay:C,hideOutsideDates:S,hideWeekdays:k,getDayAriaLabel:j,__getDayRef:N,__onDayKeyDown:F,__onDayClick:B,__onDayMouseEnter:Q,withCellSpacing:U,highlightToday:ne,withWeekNumbers:oe,__preventFocus:G,__stopPropagation:te,nextIcon:q,previousIcon:V,nextLabel:ee,previousLabel:ae,onNext:re,onPrevious:P,onLevelClick:x,nextDisabled:w,previousDisabled:h,hasNextLevel:l,levelControlAriaLabel:p,withNext:f,withPrevious:a,headerControlsOrder:v,monthLabelFormat:D,classNames:T,styles:z,unstyled:Z,__staticSelector:K,size:H,static:ie,attributes:se,...ue}=r,E=vt(),L={__staticSelector:K||"MonthLevel",classNames:T,styles:z,unstyled:Z,size:H,attributes:se},$=typeof w=="boolean"?w:M?!de(n).endOf("month").isBefore(M):!1,Y=typeof h=="boolean"?h:_?!de(n).startOf("month").isAfter(_):!1;return y.jsxs(O.Box,{"data-month-level":!0,size:H,ref:e,...ue,children:[y.jsx(bt,{label:typeof D=="function"?D(n):de(n).locale(s||E.locale).format(D),__preventFocus:G,__stopPropagation:te,nextIcon:q,previousIcon:V,nextLabel:ee,previousLabel:ae,onNext:re,onPrevious:P,onLevelClick:x,nextDisabled:$,previousDisabled:Y,hasNextLevel:l,levelControlAriaLabel:p,withNext:f,withPrevious:a,headerControlsOrder:v,...L}),y.jsx(vr,{month:n,locale:s,firstDayOfWeek:u,weekdayFormat:d,weekendDays:i,getDayProps:m,excludeDate:b,minDate:_,maxDate:M,renderDay:C,hideOutsideDates:S,hideWeekdays:k,getDayAriaLabel:j,__getDayRef:N,__onDayKeyDown:F,__onDayClick:B,__onDayMouseEnter:Q,__preventFocus:G,__stopPropagation:te,static:ie,withCellSpacing:U,highlightToday:ne,withWeekNumbers:oe,...L})]})});Sr.classes={...vr.classes,...bt.classes},Sr.displayName="@mantine/dates/MonthLevel";var ms={levelsGroup:"m_30b26e33"};const wt=O.factory((t,e)=>{const r=O.useProps("LevelsGroup",null,t),{classNames:n,className:s,style:u,styles:d,unstyled:i,vars:m,__staticSelector:b,attributes:_,...M}=r,C=O.useStyles({name:b||"LevelsGroup",classes:ms,props:r,className:s,style:u,classNames:n,styles:d,unstyled:i,attributes:_,vars:m,rootSelector:"levelsGroup"});return y.jsx(O.Box,{ref:e,...C("levelsGroup"),...M})});wt.classes=ms,wt.displayName="@mantine/dates/LevelsGroup";const du={numberOfColumns:1},Dr=O.factory((t,e)=>{const r=O.useProps("DecadeLevelGroup",du,t),{decade:n,locale:s,minDate:u,maxDate:d,yearsListFormat:i,getYearControlProps:m,__onControlClick:b,__onControlMouseEnter:_,withCellSpacing:M,__preventFocus:C,nextIcon:S,previousIcon:k,nextLabel:j,previousLabel:N,onNext:F,onPrevious:B,nextDisabled:Q,previousDisabled:U,headerControlsOrder:ne,classNames:oe,styles:G,unstyled:te,__staticSelector:q,__stopPropagation:V,numberOfColumns:ee,levelControlAriaLabel:ae,decadeLabelFormat:re,size:P,vars:x,attributes:w,...h}=r,l=X.useRef([]),p=Array(ee).fill(0).map((f,a)=>{const v=de(n).add(a*10,"years").format("YYYY-MM-DD");return y.jsx(xr,{size:P,yearsListFormat:i,decade:v,withNext:a===ee-1,withPrevious:a===0,decadeLabelFormat:re,__onControlClick:b,__onControlMouseEnter:_,__onControlKeyDown:(D,T)=>fn({levelIndex:a,rowIndex:T.rowIndex,cellIndex:T.cellIndex,event:D,controlsRef:l}),__getControlRef:(D,T,z)=>{Array.isArray(l.current[a])||(l.current[a]=[]),Array.isArray(l.current[a][D])||(l.current[a][D]=[]),l.current[a][D][T]=z},levelControlAriaLabel:typeof ae=="function"?ae(v):ae,locale:s,minDate:u,maxDate:d,__preventFocus:C,__stopPropagation:V,nextIcon:S,previousIcon:k,nextLabel:j,previousLabel:N,onNext:F,onPrevious:B,nextDisabled:Q,previousDisabled:U,getYearControlProps:m,__staticSelector:q||"DecadeLevelGroup",classNames:oe,styles:G,unstyled:te,withCellSpacing:M,headerControlsOrder:ne,attributes:w},a)});return y.jsx(wt,{classNames:oe,styles:G,__staticSelector:q||"DecadeLevelGroup",ref:e,size:P,unstyled:te,attributes:w,...h,children:p})});Dr.classes={...wt.classes,...xr.classes},Dr.displayName="@mantine/dates/DecadeLevelGroup";const hu={numberOfColumns:1},kr=O.factory((t,e)=>{const r=O.useProps("YearLevelGroup",hu,t),{year:n,locale:s,minDate:u,maxDate:d,monthsListFormat:i,getMonthControlProps:m,__onControlClick:b,__onControlMouseEnter:_,withCellSpacing:M,__preventFocus:C,nextIcon:S,previousIcon:k,nextLabel:j,previousLabel:N,onNext:F,onPrevious:B,onLevelClick:Q,nextDisabled:U,previousDisabled:ne,hasNextLevel:oe,headerControlsOrder:G,classNames:te,styles:q,unstyled:V,__staticSelector:ee,__stopPropagation:ae,numberOfColumns:re,levelControlAriaLabel:P,yearLabelFormat:x,size:w,vars:h,attributes:l,...p}=r,f=X.useRef([]),a=Array(re).fill(0).map((v,D)=>{const T=de(n).add(D,"years").format("YYYY-MM-DD");return y.jsx(Cr,{size:w,monthsListFormat:i,year:T,withNext:D===re-1,withPrevious:D===0,yearLabelFormat:x,__stopPropagation:ae,__onControlClick:b,__onControlMouseEnter:_,__onControlKeyDown:(z,Z)=>fn({levelIndex:D,rowIndex:Z.rowIndex,cellIndex:Z.cellIndex,event:z,controlsRef:f}),__getControlRef:(z,Z,K)=>{Array.isArray(f.current[D])||(f.current[D]=[]),Array.isArray(f.current[D][z])||(f.current[D][z]=[]),f.current[D][z][Z]=K},levelControlAriaLabel:typeof P=="function"?P(T):P,locale:s,minDate:u,maxDate:d,__preventFocus:C,nextIcon:S,previousIcon:k,nextLabel:j,previousLabel:N,onNext:F,onPrevious:B,onLevelClick:Q,nextDisabled:U,previousDisabled:ne,hasNextLevel:oe,getMonthControlProps:m,classNames:te,styles:q,unstyled:V,__staticSelector:ee||"YearLevelGroup",withCellSpacing:M,headerControlsOrder:G,attributes:l},D)});return y.jsx(wt,{classNames:te,styles:q,__staticSelector:ee||"YearLevelGroup",ref:e,size:w,unstyled:V,attributes:l,...p,children:a})});kr.classes={...Cr.classes,...wt.classes},kr.displayName="@mantine/dates/YearLevelGroup";const fu={numberOfColumns:1},Pr=O.factory((t,e)=>{const r=O.useProps("MonthLevelGroup",fu,t),{month:n,locale:s,firstDayOfWeek:u,weekdayFormat:d,weekendDays:i,getDayProps:m,excludeDate:b,minDate:_,maxDate:M,renderDay:C,hideOutsideDates:S,hideWeekdays:k,getDayAriaLabel:j,__onDayClick:N,__onDayMouseEnter:F,withCellSpacing:B,highlightToday:Q,withWeekNumbers:U,__preventFocus:ne,nextIcon:oe,previousIcon:G,nextLabel:te,previousLabel:q,onNext:V,onPrevious:ee,onLevelClick:ae,nextDisabled:re,previousDisabled:P,hasNextLevel:x,headerControlsOrder:w,classNames:h,styles:l,unstyled:p,numberOfColumns:f,levelControlAriaLabel:a,monthLabelFormat:v,__staticSelector:D,__stopPropagation:T,size:z,static:Z,vars:K,attributes:H,...ie}=r,se=X.useRef([]),ue=Array(f).fill(0).map((E,L)=>{const $=de(n).add(L,"months").format("YYYY-MM-DD");return y.jsx(Sr,{month:$,withNext:L===f-1,withPrevious:L===0,monthLabelFormat:v,__stopPropagation:T,__onDayClick:N,__onDayMouseEnter:F,__onDayKeyDown:(Y,I)=>fn({levelIndex:L,rowIndex:I.rowIndex,cellIndex:I.cellIndex,event:Y,controlsRef:se}),__getDayRef:(Y,I,ce)=>{Array.isArray(se.current[L])||(se.current[L]=[]),Array.isArray(se.current[L][Y])||(se.current[L][Y]=[]),se.current[L][Y][I]=ce},levelControlAriaLabel:typeof a=="function"?a($):a,locale:s,firstDayOfWeek:u,weekdayFormat:d,weekendDays:i,getDayProps:m,excludeDate:b,minDate:_,maxDate:M,renderDay:C,hideOutsideDates:S,hideWeekdays:k,getDayAriaLabel:j,__preventFocus:ne,nextIcon:oe,previousIcon:G,nextLabel:te,previousLabel:q,onNext:V,onPrevious:ee,onLevelClick:ae,nextDisabled:re,previousDisabled:P,hasNextLevel:x,classNames:h,styles:l,unstyled:p,__staticSelector:D||"MonthLevelGroup",size:z,static:Z,withCellSpacing:B,highlightToday:Q,withWeekNumbers:U,headerControlsOrder:w,attributes:H},L)});return y.jsx(wt,{classNames:h,styles:l,__staticSelector:D||"MonthLevelGroup",ref:e,size:z,attributes:H,...ie,children:ue})});Pr.classes={...wt.classes,...Sr.classes},Pr.displayName="@mantine/dates/MonthLevelGroup";const ys=t=>t==="range"?[null,null]:t==="multiple"?[]:null,vs=(t,e)=>{const r=e?es:qe;return Array.isArray(t)?t.map(r):r(t)};function yn({type:t,value:e,defaultValue:r,onChange:n,withTime:s=!1}){const u=X.useRef(t),[d,i,m]=Ne.useUncontrolled({value:vs(e,s),defaultValue:vs(r,s),finalValue:ys(t),onChange:n});let b=d;return u.current!==t&&(u.current=t,e===void 0&&(b=r!==void 0?r:ys(t),i(b))),[b,i,m]}function vn(t,e){return t?t==="month"?0:t==="year"?1:2:e||0}function pu(t){return t===0?"month":t===1?"year":"decade"}function Xt(t,e,r){return pu(Ne.clamp(vn(t,0),vn(e,0),vn(r,2)))}const gu={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0,enableKeyboardNavigation:!0},Mr=O.factory((t,e)=>{const r=O.useProps("Calendar",gu,t),{vars:n,maxLevel:s,minLevel:u,defaultLevel:d,level:i,onLevelChange:m,date:b,defaultDate:_,onDateChange:M,numberOfColumns:C,columnsToScroll:S,ariaLabels:k,nextLabel:j,previousLabel:N,onYearSelect:F,onMonthSelect:B,onYearMouseEnter:Q,onMonthMouseEnter:U,headerControlsOrder:ne,__updateDateOnYearSelect:oe,__updateDateOnMonthSelect:G,__setDateRef:te,__setLevelRef:q,firstDayOfWeek:V,weekdayFormat:ee,weekendDays:ae,getDayProps:re,excludeDate:P,renderDay:x,hideOutsideDates:w,hideWeekdays:h,getDayAriaLabel:l,monthLabelFormat:p,nextIcon:f,previousIcon:a,__onDayClick:v,__onDayMouseEnter:D,withCellSpacing:T,highlightToday:z,withWeekNumbers:Z,monthsListFormat:K,getMonthControlProps:H,yearLabelFormat:ie,yearsListFormat:se,getYearControlProps:ue,decadeLabelFormat:E,classNames:L,styles:$,unstyled:Y,minDate:I,maxDate:ce,locale:o,__staticSelector:c,size:g,__preventFocus:A,__stopPropagation:R,onNextDecade:W,onPreviousDecade:le,onNextYear:fe,onPreviousYear:pe,onNextMonth:J,onPreviousMonth:he,static:me,enableKeyboardNavigation:ge,attributes:Se,...Ce}=r,{resolvedClassNames:ke,resolvedStyles:Fe}=O.useResolvedStylesApi({classNames:L,styles:$,props:r}),[Re,De]=Ne.useUncontrolled({value:i?Xt(i,u,s):void 0,defaultValue:d?Xt(d,u,s):void 0,finalValue:Xt(void 0,u,s),onChange:m}),[_t,Ie]=yn({type:"default",value:qe(b),defaultValue:qe(_),onChange:M});X.useImperativeHandle(te,()=>be=>{Ie(be)}),X.useImperativeHandle(q,()=>be=>{De(be)});const it={__staticSelector:c||"Calendar",styles:Fe,classNames:ke,unstyled:Y,size:g,attributes:Se},Ve=S||C||1,Ye=new Date,Ot=I&&de(Ye).isAfter(I)?I:de(Ye).format("YYYY-MM-DD"),Ae=_t||Ot,xt=()=>{const be=de(Ae).add(Ve,"month").format("YYYY-MM-DD");J?.(be),Ie(be)},at=()=>{const be=de(Ae).subtract(Ve,"month").format("YYYY-MM-DD");he?.(be),Ie(be)},He=()=>{const be=de(Ae).add(Ve,"year").format("YYYY-MM-DD");fe?.(be),Ie(be)},Ge=()=>{const be=de(Ae).subtract(Ve,"year").format("YYYY-MM-DD");pe?.(be),Ie(be)},Qe=()=>{const be=de(Ae).add(10*Ve,"year").format("YYYY-MM-DD");W?.(be),Ie(be)},Ke=()=>{const be=de(Ae).subtract(10*Ve,"year").format("YYYY-MM-DD");le?.(be),Ie(be)},rt=X.useRef(null);X.useEffect(()=>{if(!ge||me)return;const be=Pe=>{if(!rt.current?.contains(document.activeElement))return;const nt=Pe.ctrlKey||Pe.metaKey,Ct=Pe.shiftKey;switch(Pe.key){case"ArrowUp":nt&&Ct?(Pe.preventDefault(),Ke()):nt&&(Pe.preventDefault(),Ge());break;case"ArrowDown":nt&&Ct?(Pe.preventDefault(),Qe()):nt&&(Pe.preventDefault(),He());break;case"y":case"Y":Re==="month"&&(Pe.preventDefault(),De("year"));break}};return document.addEventListener("keydown",be),()=>{document.removeEventListener("keydown",be)}},[ge,me,Re,He,Ge,Qe,Ke]);const lt=be=>{rt.current=be,typeof e=="function"?e(be):e&&(e.current=be)};return y.jsxs(O.Box,{ref:lt,size:g,"data-calendar":!0,...Ce,children:[Re==="month"&&y.jsx(Pr,{month:Ae,minDate:I,maxDate:ce,firstDayOfWeek:V,weekdayFormat:ee,weekendDays:ae,getDayProps:re,excludeDate:P,renderDay:x,hideOutsideDates:w,hideWeekdays:h,getDayAriaLabel:l,onNext:xt,onPrevious:at,hasNextLevel:s!=="month",onLevelClick:()=>De("year"),numberOfColumns:C,locale:o,levelControlAriaLabel:k?.monthLevelControl,nextLabel:k?.nextMonth??j,nextIcon:f,previousLabel:k?.previousMonth??N,previousIcon:a,monthLabelFormat:p,__onDayClick:v,__onDayMouseEnter:D,__preventFocus:A,__stopPropagation:R,static:me,withCellSpacing:T,highlightToday:z,withWeekNumbers:Z,headerControlsOrder:ne,...it}),Re==="year"&&y.jsx(kr,{year:Ae,numberOfColumns:C,minDate:I,maxDate:ce,monthsListFormat:K,getMonthControlProps:H,locale:o,onNext:He,onPrevious:Ge,hasNextLevel:s!=="month"&&s!=="year",onLevelClick:()=>De("decade"),levelControlAriaLabel:k?.yearLevelControl,nextLabel:k?.nextYear??j,nextIcon:f,previousLabel:k?.previousYear??N,previousIcon:a,yearLabelFormat:ie,__onControlMouseEnter:U,__onControlClick:(be,Pe)=>{G&&Ie(Pe),De(Xt("month",u,s)),B?.(Pe)},__preventFocus:A,__stopPropagation:R,withCellSpacing:T,headerControlsOrder:ne,...it}),Re==="decade"&&y.jsx(Dr,{decade:Ae,minDate:I,maxDate:ce,yearsListFormat:se,getYearControlProps:ue,locale:o,onNext:Qe,onPrevious:Ke,numberOfColumns:C,nextLabel:k?.nextDecade??j,nextIcon:f,previousLabel:k?.previousDecade??N,previousIcon:a,decadeLabelFormat:E,__onControlMouseEnter:Q,__onControlClick:(be,Pe)=>{oe&&Ie(Pe),De(Xt("year",u,s)),F?.(Pe)},__preventFocus:A,__stopPropagation:R,withCellSpacing:T,headerControlsOrder:ne,...it})]})});Mr.classes={...Dr.classes,...kr.classes,...Pr.classes},Mr.displayName="@mantine/dates/Calendar";function mu(t){const{maxLevel:e,minLevel:r,defaultLevel:n,level:s,onLevelChange:u,nextIcon:d,previousIcon:i,date:m,defaultDate:b,onDateChange:_,numberOfColumns:M,columnsToScroll:C,ariaLabels:S,nextLabel:k,previousLabel:j,onYearSelect:N,onMonthSelect:F,onYearMouseEnter:B,onMonthMouseEnter:Q,onNextMonth:U,onPreviousMonth:ne,onNextYear:oe,onPreviousYear:G,onNextDecade:te,onPreviousDecade:q,withCellSpacing:V,highlightToday:ee,__updateDateOnYearSelect:ae,__updateDateOnMonthSelect:re,__setDateRef:P,__setLevelRef:x,withWeekNumbers:w,headerControlsOrder:h,firstDayOfWeek:l,weekdayFormat:p,weekendDays:f,getDayProps:a,excludeDate:v,renderDay:D,hideOutsideDates:T,hideWeekdays:z,getDayAriaLabel:Z,monthLabelFormat:K,monthsListFormat:H,getMonthControlProps:ie,yearLabelFormat:se,yearsListFormat:ue,getYearControlProps:E,decadeLabelFormat:L,allowSingleDateInRange:$,allowDeselect:Y,minDate:I,maxDate:ce,locale:o,...c}=t;return{calendarProps:{maxLevel:e,minLevel:r,defaultLevel:n,level:s,onLevelChange:u,nextIcon:d,previousIcon:i,date:m,defaultDate:b,onDateChange:_,numberOfColumns:M,columnsToScroll:C,ariaLabels:S,nextLabel:k,previousLabel:j,onYearSelect:N,onMonthSelect:F,onYearMouseEnter:B,onMonthMouseEnter:Q,onNextMonth:U,onPreviousMonth:ne,onNextYear:oe,onPreviousYear:G,onNextDecade:te,onPreviousDecade:q,withCellSpacing:V,highlightToday:ee,__updateDateOnYearSelect:ae,__updateDateOnMonthSelect:re,__setDateRef:P,withWeekNumbers:w,headerControlsOrder:h,firstDayOfWeek:l,weekdayFormat:p,weekendDays:f,getDayProps:a,excludeDate:v,renderDay:D,hideOutsideDates:T,hideWeekdays:z,getDayAriaLabel:Z,monthLabelFormat:K,monthsListFormat:H,getMonthControlProps:ie,yearLabelFormat:se,yearsListFormat:ue,getYearControlProps:E,decadeLabelFormat:L,allowSingleDateInRange:$,allowDeselect:Y,minDate:I,maxDate:ce,locale:o},others:c}}function yu(t){if(t===null)return null;const e=new Date(t);return Number.isNaN(e.getTime())||!t?null:de(e).format("YYYY-MM-DD")}function vu({date:t,maxDate:e,minDate:r}){return!(t==null||Number.isNaN(new Date(t).getTime())||e&&de(t).isAfter(e,"date")||r&&de(t).isBefore(r,"date"))}const bu={valueFormat:"MMMM D, YYYY",fixOnBlur:!0,size:"sm"},Or=O.factory((t,e)=>{const r=O.useInputProps("DateInput",bu,t),{inputProps:n,wrapperProps:s,value:u,defaultValue:d,onChange:i,clearable:m,clearButtonProps:b,popoverProps:_,getDayProps:M,locale:C,valueFormat:S,dateParser:k,minDate:j,maxDate:N,fixOnBlur:F,onFocus:B,onBlur:Q,onClick:U,onKeyDown:ne,readOnly:oe,name:G,form:te,rightSection:q,unstyled:V,classNames:ee,styles:ae,allowDeselect:re,date:P,defaultDate:x,onDateChange:w,getMonthControlProps:h,getYearControlProps:l,disabled:p,...f}=r,a=X.useRef(null),v=X.useRef(null),[D,T]=X.useState(!1),{calendarProps:z,others:Z}=mu(f),K=vt(),ie=k||(J=>{const he=de(J,S,K.getLocale(C)).toDate();return Number.isNaN(he.getTime())?yu(J):de(he).format("YYYY-MM-DD")}),se=re!==void 0?re:m,ue=J=>J?de(J).locale(K.getLocale(C)).format(S):"",[E,L,$]=yn({type:"default",value:u,defaultValue:d,onChange:i}),[Y,I]=yn({type:"default",value:P,defaultValue:d||x,onChange:w});X.useEffect(()=>{$&&u!==null&&I(u)},[$,u]);const[ce,o]=X.useState(ue(E));X.useEffect(()=>{o(ue(E))},[K.getLocale(C)]);const c=J=>{const he=J.currentTarget.value;if(o(he),T(!0),he.trim()===""&&(re||m))L(null);else{const me=ie(he);me&&vu({date:me,minDate:j,maxDate:N})&&(L(me),I(me))}},g=J=>{Q?.(J),T(!1),F&&o(ue(E))},A=J=>{B?.(J),T(!0)},R=J=>{U?.(J),T(!0)},W=J=>{J.key==="Escape"&&T(!1),ne?.(J)},le=J=>({...M?.(J),selected:de(E).isSame(J,"day"),onClick:he=>{M?.(J).onClick?.(he);const me=se&&de(E).isSame(J,"day")?null:J;L(me),!$&&me&&o(ue(me)),T(!1)}}),fe=y.jsx(O.Input.ClearButton,{onClick:()=>{L(null),!$&&o(""),T(!1)},unstyled:V,...b}),pe=m&&!!E&&!oe&&!p;return Ne.useDidUpdate(()=>{E!==void 0&&!D&&o(ue(E))},[E]),Ne.useClickOutside(()=>T(!1),void 0,[a.current,v.current]),y.jsxs(y.Fragment,{children:[y.jsx(O.Input.Wrapper,{...s,__staticSelector:"DateInput",ref:a,children:y.jsxs(O.Popover,{opened:D,trapFocus:!1,position:"bottom-start",disabled:oe||p,withRoles:!1,unstyled:V,..._,children:[y.jsx(O.Popover.Target,{children:y.jsx(O.Input,{"data-dates-input":!0,"data-read-only":oe||void 0,autoComplete:"off",ref:e,value:ce,onChange:c,onBlur:g,onFocus:A,onClick:R,onKeyDown:W,readOnly:oe,rightSection:q,__clearSection:fe,__clearable:pe,...n,...Z,disabled:p,__staticSelector:"DateInput"})}),y.jsx(O.Popover.Dropdown,{onMouseDown:J=>J.preventDefault(),"data-dates-dropdown":!0,ref:v,children:y.jsx(Mr,{__staticSelector:"DateInput",...z,classNames:ee,styles:ae,unstyled:V,__preventFocus:!0,minDate:j,maxDate:N,locale:C,getDayProps:le,size:n.size,date:Y,onDateChange:I,getMonthControlProps:J=>({selected:typeof E=="string"?mn(J,E):!1,...h?.(J)}),getYearControlProps:J=>({selected:typeof E=="string"?de(J).isSame(E,"year"):!1,...l?.(J)}),attributes:s.attributes})})]})}),y.jsx(ts,{name:G,form:te,value:E,type:"default"})]})});Or.classes={...O.Input.classes,...Mr.classes},Or.displayName="@mantine/dates/DateInput";function bs(t){const e=ze.c(49),{fields:r,onClose:n,queryKey:s,apiPath:u,steps:d,onCreated:i}=t,[m,b]=X.useState(0),[_,M]=X.useState(!1),[C,S]=X.useState(),{mutateAsync:k,isError:j,error:N,isPending:F}=Ko(u,s),{mutateAsync:B,isPending:Q}=hn(u,s),U=F||Q;let ne;e[0]!==r?(ne=new Set(r.filter(Cu).map(xu)),e[0]=r,e[1]=ne):ne=e[1];let oe;e[2]!==ne?(oe=[...ne],e[2]=ne,e[3]=oe):oe=e[3];const G=oe;let te;e[4]===Symbol.for("react.memo_cache_sentinel")?(te=function(D,T){return typeof D.required=="function"?D.required(T??{}):!!D.required},e[4]=te):te=e[4];const q=te;let V;e[5]!==r?(V=r.reduce(_u,{}),e[5]=r,e[6]=V):V=e[6];let ee;if(e[7]!==r){let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=(D,T)=>(D[T.id]=(z,Z)=>T.conditional&&!T.conditional(Z)||!q(T,Z)||z?null:"Pflichtfeld",D),e[9]=v):v=e[9],ee=r.filter(wu).reduce(v,{}),e[7]=r,e[8]=ee}else ee=e[8];let ae;e[10]!==V||e[11]!==ee?(ae={mode:"uncontrolled",initialValues:V,validate:ee},e[10]=V,e[11]=ee,e[12]=ae):ae=e[12];const re=$n.useForm(ae);let P;e[13]!==re||e[14]!==C?(P=function(D){const T=re.getValues();if(D.conditional&&!D.conditional(T))return null;const z=q(D,T);return y.jsxs(X.Fragment,{children:[(D.type===void 0||D.type=="text")&&y.jsx(O.TextInput,{label:D.column.title,placeholder:D.placeholder??"",...re.getInputProps(D.id),type:D.id.includes("email")?"email":void 0,required:z},re.key(D.id)),D.type==="number"&&y.jsx(O.NumberInput,{decimalSeparator:",",label:D.column.title,placeholder:D.placeholder??"",...re.getInputProps(D.id),required:z},re.key(D.id)),D.type==="date"&&y.jsx(Or,{label:D.column.title,placeholder:D.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...re.getInputProps(D.id),required:z},re.key(D.id)),D.type==="boolean"&&y.jsx(O.Checkbox,{mt:"md",label:D.column.title,...re.getInputProps(D.id,{type:"checkbox"}),required:z},re.key(D.id)),D.type==="textarea"&&y.jsx(O.Textarea,{label:D.column.title,placeholder:D.placeholder??"",...re.getInputProps(D.id),minRows:3,autosize:!0,required:z},re.key(D.id)),D.type==="custom"&&D.render&&D.render({...re.getValues(),...C&&{id:C}},re.setValues,M,{error:re.getInputProps(D.id).error,required:z})]},D.id)},e[13]=re,e[14]=C,e[15]=P):P=e[15];const x=P;let w;e[16]!==N?.message||e[17]!==N?.name||e[18]!==j?(w=j&&y.jsx(O.Alert,{variant:"outline",color:"red",title:N?.name??"Fehler aufgetreten",mb:"lg",children:N?.message??"Fehler aufgetreten"}),e[16]=N?.message,e[17]=N?.name,e[18]=j,e[19]=w):w=e[19];let h;e[20]!==m||e[21]!==k||e[22]!==re||e[23]!==j||e[24]!==n||e[25]!==i||e[26]!==C||e[27]!==G.length||e[28]!==B?(h=re.onSubmit(async v=>{if(C)await B({...v,id:C});else{const D=await k(v);S(D.id),i?.(D.id)}G.length&&m<G.length-1?j||b(m+1):j||(re.setInitialValues(v),re.reset(),n())}),e[20]=m,e[21]=k,e[22]=re,e[23]=j,e[24]=n,e[25]=i,e[26]=C,e[27]=G.length,e[28]=B,e[29]=h):h=e[29];let l;e[30]!==m||e[31]!==r||e[32]!==x||e[33]!==d||e[34]!==G?(l=G.length?y.jsx(O.Stepper,{active:m,size:"sm",children:G.map(v=>y.jsx(O.Stepper.Step,{...d&&d[v-1]?{label:d[v-1].label}:{},children:r.filter(D=>D.step===v).map(D=>x(D))},v))}):r.map(v=>x(v)),e[30]=m,e[31]=r,e[32]=x,e[33]=d,e[34]=G,e[35]=l):l=e[35];let p;e[36]!==m||e[37]!==_||e[38]!==U||e[39]!==n||e[40]!==G.length?(p=!_&&y.jsxs(O.Group,{mt:"md",justify:"end",children:[y.jsx(O.Button,{onClick:()=>G.length?m===0?n():b(m-1):n(),variant:"outline",children:G.length?m===0?"Abbrechen":"Zurück":"Abbrechen"}),y.jsx(O.Button,{type:"submit",loading:U,children:G.length?m===G.length-1?"Speichern":"Weiter":"Speichern"})]}),e[36]=m,e[37]=_,e[38]=U,e[39]=n,e[40]=G.length,e[41]=p):p=e[41];let f;e[42]!==l||e[43]!==p||e[44]!==h?(f=y.jsxs("form",{onSubmit:h,children:[l,p]}),e[42]=l,e[43]=p,e[44]=h,e[45]=f):f=e[45];let a;return e[46]!==f||e[47]!==w?(a=y.jsxs(y.Fragment,{children:[w,f]}),e[46]=f,e[47]=w,e[48]=a):a=e[48],a}function wu(t){return t.required}function _u(t,e){return t[e.id]=e.type==="boolean"?!1:e.defaultValue??"",t}function xu(t){return t.step}function Cu(t){return typeof t.step=="number"}var[Su,bn]=O.createSafeContext("useDataTableColumnsContext must be used within DataTableColumnProvider"),ws=t=>{let{children:e,columnsOrder:r,setColumnsOrder:n,columnsToggle:s,setColumnsToggle:u,resetColumnsOrder:d,resetColumnsToggle:i,setColumnWidth:m,setMultipleColumnWidths:b,resetColumnsWidth:_}=t,[M,C]=X.useState(""),[S,k]=X.useState("");return y.jsx(Su,{value:{sourceColumn:M,setSourceColumn:C,targetColumn:S,setTargetColumn:k,columnsToggle:s,setColumnsToggle:u,swapColumns:()=>{if(!r||!n||!M||!S)return;let j=r.indexOf(M),N=r.indexOf(S);if(j!==-1&&N!==-1){let F=r.splice(j,1)[0];r.splice(N,0,F),n([...r])}},resetColumnsOrder:d,resetColumnsToggle:i,setColumnWidth:m,setMultipleColumnWidths:b,resetColumnsWidth:_},children:e})};function Du(){return y.jsx("tr",{className:"mantine-datatable-empty-row",children:y.jsx("td",{})})}function ku(){return y.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74"}),y.jsx("path",{d:"M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6"}),y.jsx("path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4"}),y.jsx("path",{d:"M3 3l18 18"})]})}function Pu({icon:t,text:e,active:r,children:n}){return y.jsx(O.Center,{className:"mantine-datatable-empty-state","data-active":r||void 0,children:n||y.jsxs(y.Fragment,{children:[t||y.jsx("div",{className:"mantine-datatable-empty-state-icon",children:y.jsx(ku,{})}),y.jsx(O.Text,{component:"div",size:"sm",c:"dimmed",children:e})]})})}function Mu({key:t,columns:e=[],getInitialValueInEffect:r=!0}){function n(M,C){let S=[];return M.forEach(k=>{C.find(j=>j.accessor===k)&&S.push(k)}),C.forEach(k=>{S.includes(k.accessor)||S.push(k.accessor)}),S}let s=e&&e.map(M=>M.accessor)||[],[u,d]=Ne.useLocalStorage({key:t?`${t}-columns-order`:"",defaultValue:t?s:void 0,getInitialValueInEffect:r});function i(M){t&&d(M)}let m=()=>{i(s)};if(!t)return{columnsOrder:u,setColumnsOrder:i,resetColumnsOrder:m};let b=n(u,e),_=JSON.stringify(u);return JSON.stringify(b)!==_&&i(b),{columnsOrder:b,setColumnsOrder:i,resetColumnsOrder:m}}function Ou({key:t,columns:e=[],getInitialValueInEffect:r=!0,headerRef:n,onFixedLayoutChange:s}){let u=X.useRef(!1),d=X.useRef({}),[i,m]=X.useState(!0),b=X.useMemo(()=>e.some(q=>q.resizable&&!q.hidden&&q.accessor!=="__selection__"),[e]),_=X.useMemo(()=>e.filter(q=>q.resizable&&!q.hidden&&q.accessor!=="__selection__"),[e]),M=X.useMemo(()=>_.some(q=>q.width===void 0||q.width===""||q.width==="initial"),[_]),C=X.useCallback(()=>e.filter(q=>q.accessor!=="__selection__").map(q=>({[q.accessor]:q.width??"auto"})),[e]),[S,k]=Ne.useLocalStorage({key:t?`${t}-columns-width`:"",defaultValue:t?C():void 0,getInitialValueInEffect:!1}),[j,N]=X.useState(()=>C());X.useEffect(()=>{m(!1)},[]);let F=X.useCallback(()=>{if(!n?.current||i)return{};let q=n.current,V=Array.from(q.querySelectorAll("th[data-accessor]")),ee={};return V.forEach(ae=>{let re=ae.getAttribute("data-accessor");if(!re||re==="__selection__")return;let P=_.find(x=>x.accessor===re);if(P&&(P.width===void 0||P.width===""||P.width==="initial")){let x=ae.getBoundingClientRect();ee[re]=Math.round(x.width)}}),ee},[n,_,i]),B=X.useCallback(q=>{let V=q.filter(ae=>ae.accessor!=="__selection__"),ee=j.map(ae=>{let re=Object.keys(ae)[0],P=V.find(x=>x.accessor===re);return P?{[re]:P.width}:ae});N(ee),t&&k(ee)},[j,t,k]),Q=X.useCallback(q=>{B(q)},[B]),U=X.useCallback(()=>{if(!(!n?.current||!s||i))if(M)s(!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{let q=F();d.current={...d.current,...q};let V=e.filter(ee=>ee.accessor!=="__selection__").map(ee=>{let ae=ee.accessor,re=S?.find(x=>Object.keys(x)[0]===ae);if(re&&re[ae]!=="auto")return{[ae]:re[ae]};let P=q[ae];return P?{[ae]:`${P}px`}:{[ae]:ee.width??"auto"}});N(V),setTimeout(()=>{s(!0),u.current=!0},10)})});else{let q=e.filter(V=>V.accessor!=="__selection__").map(V=>({[V.accessor]:V.width??"auto"}));N(q),s(!0),u.current=!0}},[n,s,i,M,F,e,S]),ne=U;X.useEffect(()=>{if(!b||!s||i){s?.(!1);return}u.current=!1;let q=setTimeout(()=>{U()},50);return()=>clearTimeout(q)},[b,s,i,U]),X.useEffect(()=>{i||!t||!r||S&&S.length>0&&N(S)},[i,t,r,S]);let oe=X.useCallback(()=>{t&&k(C()),d.current={},u.current=!1,s&&(s(!1),setTimeout(()=>{U()},10))},[t,k,C,s,U]),G=X.useCallback((q,V)=>{B([{accessor:q,width:V}])},[B]),te=X.useMemo(()=>b?j.filter(q=>{let V=Object.keys(q)[0];return _.some(ee=>ee.accessor===V)}).every(q=>{let V=Object.values(q)[0];return V==="auto"||V==="initial"}):!1,[b,j,_]);return{columnsWidth:j,setColumnsWidth:B,setColumnWidth:G,setMultipleColumnWidths:Q,resetColumnsWidth:oe,hasResizableColumns:b,allResizableWidthsInitial:te,measureAndSetColumnWidths:ne}}function ju({key:t,columns:e=[],getInitialValueInEffect:r=!0}){function n(M,C){let S=[];return M.forEach(k=>{C.find(j=>j.accessor===k.accessor)&&S.push(k)}),C.forEach(k=>{S.find(j=>j.accessor===k.accessor)||S.push({accessor:k.accessor,defaultToggle:k.defaultToggle||!0,toggleable:k.toggleable,toggled:k.defaultToggle===void 0?!0:k.defaultToggle})}),S}let s=e&&e.map(M=>({accessor:M.accessor,defaultToggle:M.defaultToggle||!0,toggleable:M.toggleable,toggled:M.defaultToggle===void 0?!0:M.defaultToggle})),[u,d]=Ne.useLocalStorage({key:t?`${t}-columns-toggle`:"",defaultValue:t?s:void 0,getInitialValueInEffect:r});function i(M){t&&d(M)}let m=()=>{i(s)};if(!t)return{columnsToggle:u,setColumnsToggle:i,resetColumnsToggle:m};let b=n(u,e),_=JSON.stringify(u);return JSON.stringify(b)!==_&&i(b),{columnsToggle:b,setColumnsToggle:i,resetColumnsToggle:m}}var Au=({key:t,columns:e=[],getInitialValueInEffect:r=!0,headerRef:n,scrollViewportRef:s,onFixedLayoutChange:u})=>{let{columnsOrder:d,setColumnsOrder:i,resetColumnsOrder:m}=Mu({key:t,columns:e,getInitialValueInEffect:r}),{columnsToggle:b,setColumnsToggle:_,resetColumnsToggle:M}=ju({key:t,columns:e,getInitialValueInEffect:r}),{columnsWidth:C,setColumnsWidth:S,setColumnWidth:k,setMultipleColumnWidths:j,resetColumnsWidth:N,hasResizableColumns:F,allResizableWidthsInitial:B,measureAndSetColumnWidths:Q}=Ou({key:t,columns:e,getInitialValueInEffect:r,headerRef:n,onFixedLayoutChange:u});return{effectiveColumns:X.useMemo(()=>d?d.map(U=>e.find(ne=>ne.accessor===U)).map(U=>({...U,hidden:U?.hidden||!b.find(ne=>ne.accessor===U?.accessor)?.toggled})).map(U=>U?.accessor==="__selection__"?U:{...U,width:C.find(ne=>ne[U?.accessor])?.[U?.accessor]}):e,[e,d,b,C]),setColumnsOrder:i,columnsOrder:d,resetColumnsOrder:m,columnsToggle:b,setColumnsToggle:_,resetColumnsToggle:M,columnsWidth:C,setColumnsWidth:S,setColumnWidth:k,setMultipleColumnWidths:j,resetColumnsWidth:N,hasResizableColumns:F,allResizableWidthsInitial:B,measureAndSetColumnWidths:Q}},_s=typeof window<"u"?X.useLayoutEffect:X.useEffect;function xs(t){let e=X.useRef(t);return e.current=t,e}var Cs="--mantine-datatable-header-height",Ss="--mantine-datatable-footer-height",Ds="--mantine-datatable-selection-column-width",ks="--mantine-datatable-last-row-border-bottom";function tt(t,e,r){t?.style.setProperty(e,r)}function wn(t){let e=t.borderBoxSize?.[0]||t.contentBoxSize?.[0];return e?{width:e.inlineSize,height:e.blockSize}:{width:t.contentRect.width,height:t.contentRect.height}}function _n(t,e,r){if(t){let n=new ResizeObserver(s=>{let u=s[0];u&&e(wn(u))});return n.observe(t),()=>{n.disconnect(),r()}}}function Eu({scrollCallbacks:t,withRowBorders:e}){let r={root:X.useRef(null),table:X.useRef(null),scrollViewport:X.useRef(null),header:X.useRef(null),footer:X.useRef(null),selectionColumnHeader:X.useRef(null)},{root:n,table:s,scrollViewport:u,header:d,footer:i,selectionColumnHeader:m}=r,b=xs({withRowBorders:e}),_=xs(t),M=X.useRef(()=>{}),C=X.useRef(()=>{}),S=X.useCallback(k=>{_.current.onScroll?.(k),M.current()},[]);return X.useEffect(()=>_n(d.current,k=>{tt(n.current,Cs,`${k.height}px`)},()=>tt(n.current,Cs,"0")),[d.current]),X.useEffect(()=>_n(i.current,k=>{tt(n.current,Ss,`${k.height}px`)},()=>tt(n.current,Ss,"0")),[i.current]),X.useEffect(()=>_n(m.current,k=>{tt(n.current,Ds,`${k.width}px`)},()=>tt(n.current,Ds,"0")),[m.current]),_s(()=>{if(typeof window===void 0)return;let k={top:!0,bottom:!0,left:!0,right:!0},j={width:0,height:0},N={width:0,height:0};function F(oe,G){let te=k[oe];return k[oe]=G,tt(n.current,`--mantine-datatable-${oe}-shadow-opacity`,G?"0":"1"),te}function B(){let oe=j.height-N.height,G=oe<0;tt(n.current,"--mantine-datatable-footer-position",G?"relative":"sticky"),tt(n.current,"--mantine-datatable-footer-bottom",G?`${oe}px`:"0")}function Q(){b.current.withRowBorders&&j.height<N.height?tt(n.current,ks,`${O.rem("1px")} solid var(--mantine-datatable-border-color)`):tt(n.current,ks,"unset")}C.current=Q;function U(){let oe=_.current,G=u.current,te=G?.scrollTop??0,q=G?.scrollLeft??0,V=te===0,ee=j.height-te-N.height<1,ae=F("top",V),re=F("bottom",ee);V&&V!==ae&&oe.onScrollToTop?.(),ee&&ee!==re&&oe.onScrollToBottom?.();let P=G?getComputedStyle(G).direction==="rtl":!1,x=(G?.scrollWidth??0)-N.width,w,h;if(P){let f=Math.abs(q);h=f<1,w=x-f<1}else w=q<1,h=j.width-q-N.width<1;let l=F("left",w),p=F("right",h);w&&w!==l&&oe.onScrollToLeft?.(),h&&h!==p&&oe.onScrollToRight?.()}M.current=U;let ne=new ResizeObserver(oe=>{for(let G of oe)switch(G.target.tagName){case"TABLE":{j=wn(G);break}case"DIV":{N=wn(G);break}}U(),B(),Q()});return ne.observe(s.current),ne.observe(u.current),()=>{ne.disconnect()}},[]),_s(()=>{C.current()},[e]),{refs:r,onScroll:S}}function Tu(t){let[e,r]=X.useState(null),n=t?.join(":")||"";return X.useEffect(()=>{r(null)},[n]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:r}}function $u(t,e){let r=()=>{e(t.map(s=>s.matches))},n=t.map(s=>{try{return s.addEventListener("change",r),()=>s.removeEventListener("change",r)}catch{return s.addListener(r),()=>s.removeListener(r)}});return()=>{n.forEach(s=>s())}}function Ru(t,e){return e||(typeof window<"u"&&"matchMedia"in window?t.map(r=>window.matchMedia(r).matches):t.map(()=>!1))}function Nu(t,e,{getInitialValueInEffect:r}={getInitialValueInEffect:!0}){let[n,s]=X.useState(r?e:Ru(t,e)),u=X.useRef(null);return X.useEffect(()=>{if("matchMedia"in window)return u.current=t.map(d=>window.matchMedia(d)),s(u.current.map(d=>d.matches)),$u(u.current,d=>{s(d)})},[t]),n}function Lu(t){let e=O.useMantineTheme(),r=X.useMemo(()=>t.map(s=>(typeof s=="function"?s(e):s)??""),[t,e]),n=X.useMemo(()=>t.map(()=>!0),[t]);return Nu(r,n)}function jr(t){let e=O.useMantineTheme(),r=typeof t=="function"?t(e):t;return Ne.useMediaQuery(r||"",!0)}function xn(t){let e=t.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function Bu(t,e,r){return t.filter(n=>!e.map(r).includes(r(n)))}function Cn(t,e){return t.filter((r,n,s)=>n===s.findIndex(u=>e(r)===e(u)))}function Ps(t,e){return e?e.match(/([^[.\]])+/g).reduce((r,n)=>r&&r[n],t):void 0}function Be(t,e){return typeof e=="string"?Ps(t,e):e(t)}function Ms(t){return!t||t.length===0?0:Math.max(...t.map(e=>e.groups&&e.groups.length>0?1+Ms(e.groups):1))}function Sn(t){let e=[];for(let r of t)r.columns&&r.columns.length>0?e.push(...r.columns.filter(n=>n!=null)):r.groups&&r.groups.length>0&&e.push(...Sn(r.groups));return e.filter(r=>r!=null)}function Dn(t,e){return t.columns&&t.columns.length>0?t.columns.filter((r,n)=>r.hidden?!1:e?e[n]!==!1:!0).length:t.groups&&t.groups.length>0?t.groups.reduce((r,n)=>r+Dn(n,e),0):0}function Os(t,e,r=0){if(r===e)return[...t];let n=[];for(let s of t)s.groups&&s.groups.length>0&&n.push(...Os(s.groups,e,r+1));return n}function Iu(t,e,r){return r?!t||e:!1}function Yu({rowExpansion:t,records:e,idAccessor:r}){let n=[];if(t&&e){let{trigger:i,allowMultiple:m,initiallyExpanded:b}=t;e&&i==="always"?n=e.map(_=>Be(_,r)):b&&(n=e.filter((_,M)=>b({record:_,index:M})).map(_=>Be(_,r)),m||(n=[n[0]]))}let s,u,d=X.useState(n);if(t){let{expandable:i,trigger:m,allowMultiple:b,collapseProps:_,content:M}=t;t.expanded?{recordIds:s,onRecordIdsChange:u}=t.expanded:[s,u]=d;let C=S=>u?.(s.filter(k=>k!==Be(S,r)));return{expandOnClick:m!=="always"&&m!=="never",isRowExpanded:S=>m==="always"?!0:s.includes(Be(S,r)),isExpandable:({record:S,index:k})=>i?i({record:S,index:k}):!0,expandRow:S=>{let k=Be(S,r);u?.(b?[...s,k]:[k])},collapseRow:C,collapseProps:_,content:({record:S,index:k})=>()=>M({record:S,index:k,collapse:()=>C(S)})}}}function zu(t,e){let[r,n]=X.useState(t),[s,u]=X.useState(t),d=Ne.useTimeout(()=>n(!0),0),i=Ne.useTimeout(()=>u(!1),e||200);return X.useEffect(()=>{t?(i.clear(),u(!0),d.start()):(d.clear(),n(!1),i.start())},[d,i,t]),{expanded:r,visible:s}}var kn="mantine-datatable-nowrap",Pn="mantine-datatable-ellipsis",Nt="mantine-datatable-pointer-cursor",js="mantine-datatable-context-menu-cursor",Fu="mantine-datatable-text-selection-disabled",Ar="mantine-datatable-text-align-left",Er="mantine-datatable-text-align-center",Tr="mantine-datatable-text-align-right";function Wu({className:t,style:e,visibleMediaQuery:r,title:n,noWrap:s,ellipsis:u,textAlign:d,width:i}){return jr(r)?y.jsx(O.TableTh,{className:Oe({[kn]:s||u,[Pn]:u,[Ar]:d==="left",[Er]:d==="center",[Tr]:d==="right"},t),style:[{width:i,minWidth:i,maxWidth:i},e],children:n}):null}function Uu({shadowVisible:t}){return y.jsx(O.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":t||void 0})}function qu({className:t,style:e,columns:r,defaultColumnProps:n,selectionVisible:s,selectorCellShadowVisible:u,ref:d}){return y.jsx(O.TableTfoot,{ref:d,className:Oe("mantine-datatable-footer",t),style:e,children:y.jsxs(O.TableTr,{children:[s&&y.jsx(Uu,{shadowVisible:u}),r.map(({hidden:i,...m})=>{if(i)return null;let{accessor:b,visibleMediaQuery:_,textAlign:M,width:C,footer:S,footerClassName:k,footerStyle:j,noWrap:N,ellipsis:F}={...n,...m};return y.jsx(Wu,{className:k,style:j,visibleMediaQuery:_,textAlign:M,width:C,title:S,noWrap:N,ellipsis:F},b)})]})})}function Vu({group:{id:t,columns:e,groups:r,title:n,textAlign:s,className:u,style:d},maxDepth:i,currentDepth:m,previousGroups:b,isLastGroup:_,withColumnBorders:M=!1,totalTableColumns:C}){let S=X.useMemo(()=>e&&e.length>0?e:r&&r.length>0?Sn([{id:t,columns:e,groups:r}]):[],[e,r,t]),k=X.useMemo(()=>S.map(({visibleMediaQuery:ne})=>ne),[S]),j=Lu(k),N=X.useMemo(()=>Dn({columns:e,groups:r},j),[t,e,r,j]),F=X.useMemo(()=>b.reduce((ne,oe)=>ne+Dn(oe,j),0),[b,j]),B=r&&r.length>0?1:i-m,Q=F+N<C,U=Iu(_,Q,M);return N>0?y.jsx(O.TableTh,{colSpan:N,rowSpan:B>1?B:void 0,className:Oe("mantine-datatable-column-group-header-cell",{[Ar]:s==="left",[Er]:s==="center",[Tr]:s==="right","mantine-datatable-column-group-header-cell--needs-border":U},u),style:d,children:n??xn(t)}):null}function Hu(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"})]})}function Gu(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M20 3h-16a1 1 0 0 0 -1 1v2.227l.008 .223a3 3 0 0 0 .772 1.795l4.22 4.641v8.114a1 1 0 0 0 1.316 .949l6 -2l.108 -.043a1 1 0 0 0 .576 -.906v-6.586l4.121 -4.12a3 3 0 0 0 .879 -2.123v-2.171a1 1 0 0 0 -1 -1z",strokeWidth:"0",fill:"currentColor"})]})}function Qu({children:t,isActive:e,filterPopoverProps:r,filterPopoverDisableClickOutside:n}){let[s,{close:u,toggle:d}]=Ne.useDisclosure(!1),i=e?Gu:Hu,m=Ne.useClickOutside(u);return n&&(m=void 0),y.jsxs(O.Popover,{withArrow:!0,shadow:"md",opened:s,onClose:u,trapFocus:!0,...r,children:[y.jsx(O.PopoverTarget,{children:y.jsx(O.ActionIcon,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":e||void 0,size:"sm",variant:"default",onClick:b=>{b.preventDefault(),d()},onKeyDown:b=>b.stopPropagation(),children:y.jsx(i,{})})}),y.jsx(O.PopoverDropdown,{ref:m,onClick:b=>b.stopPropagation(),onKeyDown:b=>b.stopPropagation(),children:typeof t=="function"?t({close:u}):t})]})}var Ku=t=>{let{accessor:e,columnRef:r}=t,[n,s]=X.useState(!1),u=X.useRef(0),d=X.useRef({current:0,next:0}),{dir:i}=O.useDirection(),m=i==="rtl",{setMultipleColumnWidths:b}=bn(),_=X.useCallback(C=>{if(C.preventDefault(),C.stopPropagation(),!r.current)return;let S=r.current,k=S.nextElementSibling;for(;k;){let ne=k.getAttribute("data-accessor");if(ne&&ne!=="__selection__")break;k=k.nextElementSibling}if(!k)return;let j=k.getAttribute("data-accessor");if(!j)return;let N=j==="__selection__";s(!0),u.current=C.clientX;let F=S.offsetWidth,B=k.offsetWidth;d.current={current:F,next:B};let Q=ne=>{if(!r.current)return;let oe=r.current,G=oe.nextElementSibling;if(!G)return;let te=ne.clientX-u.current;m&&(te=-te);let q=50,V=d.current.current-q,ee=d.current.next-q,ae=Math.max(-V,Math.min(te,ee)),re=d.current.current+ae,P=d.current.next-ae;oe.style.width=`${re}px`,G.style.width=`${P}px`,oe.style.minWidth=`${re}px`,oe.style.maxWidth=`${re}px`,G.style.minWidth=`${P}px`,G.style.maxWidth=`${P}px`},U=()=>{if(!r.current)return;let ne=r.current,oe=ne.nextElementSibling;s(!1),document.body.style.cursor="initial",document.body.style.userSelect="initial";let G=parseInt(ne.style.width)||ne.offsetWidth,te=oe?parseInt(oe.style.width)||oe.offsetWidth:0,q=[{accessor:e,width:`${G}px`}];if(oe&&!N){let V=oe.getAttribute("data-accessor");V&&q.push({accessor:V,width:`${te}px`})}setTimeout(()=>{b(q)},0),document.removeEventListener("mousemove",Q),document.removeEventListener("mouseup",U)};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",Q),document.addEventListener("mouseup",U)},[e,r,m,b]),M=X.useCallback(()=>{if(!r.current)return;let C=r.current,S=C.nextElementSibling;C.style.width="",C.style.minWidth="",C.style.maxWidth="";let k=[{accessor:e,width:"auto"}];if(S){S.style.width="",S.style.minWidth="",S.style.maxWidth="";let j=S.getAttribute("data-accessor");j&&j!=="__selection__"&&k.push({accessor:j,width:"auto"})}setTimeout(()=>{b(k)},0)},[e,r,b]);return y.jsx("div",{className:"mantine-datatable-header-resizable-handle",style:{cursor:n?"col-resize":void 0},onMouseDown:_,onDoubleClick:M,onClick:C=>C.stopPropagation(),title:"Drag to resize column, double-click to reset"})};function Zu(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M12 5l0 14"}),y.jsx("path",{d:"M16 9l-4 -4"}),y.jsx("path",{d:"M8 9l4 -4"})]})}function Ju(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M8 7l4 -4l4 4"}),y.jsx("path",{d:"M8 17l4 4l4 -4"}),y.jsx("path",{d:"M12 3l0 18"})]})}function Xu(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),y.jsx("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),y.jsx("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),y.jsx("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),y.jsx("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),y.jsx("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]})}function ec(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M18 6l-12 12"}),y.jsx("path",{d:"M6 6l12 12"})]})}function tc({className:t,style:e,accessor:r,visibleMediaQuery:n,title:s,sortable:u,draggable:d,toggleable:i,resizable:m,sortIcons:b,textAlign:_,width:M,sortStatus:C,onSortStatusChange:S,filter:k,filterPopoverProps:j,filterPopoverDisableClickOutside:N,filtering:F,sortKey:B}){let{setSourceColumn:Q,setTargetColumn:U,swapColumns:ne,setColumnsToggle:oe}=bn(),[G,te]=X.useState(!1),q=X.useRef(null);if(!jr(n))return null;let V=s??xn(r),ee=typeof V=="string"?V:void 0,ae=u&&S?p=>{p?.defaultPrevented||S({sortKey:B,columnAccessor:r,direction:C?.columnAccessor===r?C.direction==="asc"?"desc":"asc":C?.direction??"asc"})}:void 0,re=p=>{p.stopPropagation(),Q(r),te(!1)},P=p=>{p.preventDefault(),U(r),te(!0)},x=()=>{U(r),te(!1),ne()},w=()=>{te(!0)},h=()=>{te(!1)},l=p=>{p.stopPropagation(),oe(f=>f.map(a=>a.accessor===r?{...a,toggled:!1}:a))};return y.jsxs(O.TableTh,{"data-accessor":r,className:Oe({"mantine-datatable-header-cell-sortable":u,"mantine-datatable-header-cell-toggleable":i,"mantine-datatable-header-cell-resizable":m},t),style:[{width:M,...m?{}:{minWidth:M,maxWidth:M}},e],role:u?"button":void 0,tabIndex:u?0:void 0,onClick:ae,onKeyDown:p=>p.key==="Enter"&&ae?.(),ref:q,children:[y.jsxs(O.Group,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[y.jsxs(O.Flex,{align:"center",w:"100%",className:Oe({"mantine-datatable-header-cell-draggable":d,"mantine-datatable-header-cell-drag-over":G}),draggable:d,onDragStart:d?re:void 0,onDragEnter:d?w:void 0,onDragOver:d?P:void 0,onDrop:d?x:void 0,onDragLeave:d?h:void 0,children:[d?y.jsx(O.Center,{role:"img","aria-label":"Drag column",children:y.jsx(O.ActionIcon,{className:"mantine-datatable-header-cell-draggable-action-icon",variant:"subtle",size:"xs",onClick:p=>{p.stopPropagation()},children:y.jsx(Xu,{})})}):null,y.jsx(O.Box,{className:Oe("mantine-datatable-header-cell-sortable-text",{[Ar]:_==="left",[Er]:_==="center",[Tr]:_==="right"},kn,Pn),title:ee,children:V})]}),i?y.jsx(O.Center,{className:"mantine-datatable-header-cell-toggleable-icon",role:"img","aria-label":"Toggle column",children:y.jsx(O.ActionIcon,{size:"xs",variant:"light",onClick:l,children:y.jsx(ec,{})})}):null,u||C?.columnAccessor===r?y.jsx(y.Fragment,{children:C?.columnAccessor===r?y.jsx(O.Center,{className:Oe("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":C.direction==="desc"}),role:"img","aria-label":`Sorted ${C.direction==="desc"?"descending":"ascending"}`,children:b?.sorted||y.jsx(Zu,{})}):y.jsx(O.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:b?.unsorted||y.jsx(Ju,{})})}):null,k?y.jsx(Qu,{filterPopoverProps:j,isActive:!!F,filterPopoverDisableClickOutside:N,children:k}):null]}),m&&r!=="__selection__"?y.jsx(Ku,{accessor:r,columnRef:q}):null]})}function rc({className:t,style:e,trigger:r,shadowVisible:n,checked:s,indeterminate:u,checkboxProps:d,onChange:i,rowSpan:m,ref:b}){let _=!d.disabled;return y.jsx(O.TableTh,{ref:b,className:Oe("mantine-datatable-header-selector-cell",{[Nt]:r==="cell"&&_},t),style:e,rowSpan:m,"data-shadow-visible":n||void 0,"data-accessor":"__selection__",onClick:r==="cell"&&_?i:void 0,children:y.jsx(O.Checkbox,{classNames:_?{input:Nt}:void 0,checked:s,indeterminate:u,onChange:i,...d,disabled:!(i||d.onChange)||d.disabled})})}function nc({selectionColumnHeaderRef:t,className:e,style:r,sortStatus:n,sortIcons:s,onSortStatusChange:u,columns:d,defaultColumnProps:i,groups:m,selectionTrigger:b,selectionVisible:_,selectionChecked:M,selectionIndeterminate:C,onSelectionChange:S,selectionCheckboxProps:k,selectorCellShadowVisible:j,selectionColumnClassName:N,selectionColumnStyle:F,withColumnBorders:B=!1,ref:Q}){let U=m?Ms(m):0,ne=U>0?U+1:1,oe=_?y.jsx(rc,{ref:t,className:N,style:F,trigger:b,shadowVisible:j,checked:M,indeterminate:C,checkboxProps:k,onChange:S,rowSpan:m?ne:void 0}):null,{columnsToggle:G,setColumnsToggle:te}=bn(),[q,V]=X.useState(!1),ee=d.some(P=>P.toggleable),ae=ee?Object.fromEntries(d.map(({accessor:P,title:x})=>[P,x??xn(String(P))])):void 0,re=y.jsxs(O.TableThead,{className:Oe("mantine-datatable-header",e),style:r,ref:Q,onContextMenu:ee?P=>{P.preventDefault(),V(x=>!x)}:void 0,children:[m&&Array.from({length:U},(P,x)=>{let w=Os(m,x);return y.jsxs(O.TableTr,{children:[x===0&&oe,w.map((h,l)=>y.jsx(Vu,{group:h,maxDepth:U,currentDepth:x,previousGroups:w.slice(0,l),isLastGroup:l===w.length-1,withColumnBorders:B,totalTableColumns:d.length},h.id))]},`group-depth-${x}`)}),y.jsxs(O.TableTr,{children:[!m&&oe,d.map(({hidden:P,...x},w)=>{if(P)return null;let{accessor:h,visibleMediaQuery:l,textAlign:p,width:f,title:a,sortable:v,draggable:D,toggleable:T,resizable:z,titleClassName:Z,titleStyle:K,filter:H,filterPopoverProps:ie,filterPopoverDisableClickOutside:se,filtering:ue,sortKey:E}={...i,...x};return y.jsx(tc,{accessor:h,className:Z,style:K,visibleMediaQuery:l,textAlign:p,width:f,title:a,sortable:v,draggable:D,toggleable:T,resizable:z&&w<d.length-1,sortStatus:n,sortIcons:s,sortKey:E,onSortStatusChange:u,filter:H,filterPopoverProps:ie,filterPopoverDisableClickOutside:se,filtering:ue},h)})]})]});return ee?y.jsxs(O.Popover,{position:"bottom",withArrow:!0,shadow:"md",opened:q,onChange:V,children:[y.jsx(O.PopoverTarget,{children:re}),y.jsx(O.PopoverDropdown,{children:y.jsx(O.Stack,{children:G.filter(P=>P.toggleable).map(P=>y.jsx(O.Group,{children:y.jsx(O.Checkbox,{classNames:{label:"mantine-datatable-header-column-toggle-checkbox-label"},size:"xs",label:ae[P.accessor],checked:P.toggled,onChange:x=>{te(G.map(w=>w.accessor===P.accessor?{...w,toggled:x.currentTarget.checked}:w))}})},P.accessor))})})]}):re}function oc({fetching:t,customContent:e,backgroundBlur:r,size:n,type:s,color:u}){return y.jsx(O.Center,{className:Oe("mantine-datatable-loader",{"mantine-datatable-loader-fetching":t}),style:[{backdropFilter:r?`blur(${r}px)`:void 0}],children:t&&(e||y.jsx(O.Loader,{size:n,type:s,color:u}))})}function je(t,e,r){return t?O.parseThemeColor({color:typeof t=="object"?t[r]:t,theme:e}).value:void 0}function sc({theme:t,c:e,backgroundColor:r,borderColor:n,rowBorderColor:s,stripedColor:u,highlightOnHoverColor:d}){return{"--mantine-datatable-color-light":je(e,t,"light"),"--mantine-datatable-color-dark":je(e,t,"dark"),"--mantine-datatable-background-color-light":je(r,t,"light"),"--mantine-datatable-background-color-dark":je(r,t,"dark"),"--mantine-datatable-border-color-light":je(n,t,"light"),"--mantine-datatable-border-color-dark":je(n,t,"dark"),"--mantine-datatable-row-border-color-light":je(s,t,"light"),"--mantine-datatable-row-border-color-dark":je(s,t,"dark"),"--mantine-datatable-striped-color-light":je(u,t,"light"),"--mantine-datatable-striped-color-dark":je(u,t,"dark"),"--mantine-datatable-highlight-on-hover-color-light":je(d,t,"light"),"--mantine-datatable-highlight-on-hover-color-dark":je(d,t,"dark")}}function As({theme:t,paginationActiveTextColor:e,paginationActiveBackgroundColor:r}){return{"--mantine-datatable-pagination-active-text-color-light":je(e,t,"light"),"--mantine-datatable-pagination-active-text-color-dark":je(e,t,"dark"),"--mantine-datatable-pagination-active-background-color-light":je(r,t,"light"),"--mantine-datatable-pagination-active-background-color-dark":je(r,t,"dark")}}function ic({theme:t,color:e,backgroundColor:r}){return{"--mantine-datatable-row-color-light":je(e,t,"light"),"--mantine-datatable-row-color-dark":je(e,t,"dark"),"--mantine-datatable-row-background-color-light":je(r,t,"light"),"--mantine-datatable-row-background-color-dark":je(r,t,"dark")}}function ac(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M8 9l4 -4l4 4"}),y.jsx("path",{d:"M16 15l-4 4l-4 -4"})]})}var Es={xs:O.rem(22),sm:O.rem(26),md:O.rem(32),lg:O.rem(38),xl:O.rem(44)};function lc({size:t,label:e,values:r,value:n,activeTextColor:s,activeBackgroundColor:u,onChange:d}){return y.jsxs(O.Group,{gap:"xs",children:[y.jsx(O.Text,{component:"div",size:t,children:e}),y.jsxs(O.Menu,{withinPortal:!0,withArrow:!0,offset:2,classNames:{arrow:"mantine-datatable-page-size-selector-menu-arrow"},children:[y.jsx(O.MenuTarget,{children:y.jsx(O.Button,{size:t,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:y.jsx(ac,{}),style:[{fontWeight:"normal"},i=>({height:Es[t],paddingLeft:i.spacing[t],paddingRight:i.spacing[t]})],children:n})}),y.jsx(O.MenuDropdown,{children:r.map(i=>{let m=i===n;return y.jsx(O.MenuItem,{className:Oe({"mantine-datatable-page-size-selector-active":m}),style:[{height:Es[t]},m&&(s||u)?b=>As({theme:b,paginationActiveTextColor:s,paginationActiveBackgroundColor:u}):void 0],disabled:m,onClick:()=>d(i),children:y.jsx(O.Text,{component:"div",size:t,children:i})},i)})})]})]})}function uc({className:t,style:e,fetching:r,page:n,onPageChange:s,paginationWithEdges:u,paginationWithControls:d,paginationActiveTextColor:i,paginationActiveBackgroundColor:m,paginationSize:b,loadingText:_,noRecordsText:M,paginationText:C,totalRecords:S,recordsPerPage:k,onRecordsPerPageChange:j,recordsPerPageLabel:N,recordsPerPageOptions:F,recordsLength:B,horizontalSpacing:Q,paginationWrapBreakpoint:U,getPaginationControlProps:ne,getPaginationItemProps:oe,renderPagination:G}){let te;if(S){let x=(n-1)*k+1,w=x+(B||0)-1;te=C({from:x,to:w,totalRecords:S})}else te=r?_:M;let q=S&&k?Math.max(1,Math.ceil(S/k)):1,V=S?(n-1)*(k??0)+1:void 0,ee=S?(V??1)+(B??0)-1:void 0,ae=!jr(({breakpoints:x})=>`(min-width: ${typeof U=="number"?`${O.rem(U)}rem`:x[U]||U})`),re={Text:x=>y.jsx(O.Text,{component:"div",className:"mantine-datatable-pagination-text",size:b,...x,children:te}),PageSizeSelector:x=>F?y.jsx(lc,{activeTextColor:i,activeBackgroundColor:m,size:b,label:N,values:F,value:k,onChange:j,...x}):y.jsx(y.Fragment,{}),Pagination:x=>y.jsx(O.Pagination,{classNames:{root:Oe("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":r||!B}),control:"mantine-datatable-pagination-pages-control"},style:i||m?w=>As({theme:w,paginationActiveTextColor:i,paginationActiveBackgroundColor:m}):void 0,withEdges:u,withControls:d,value:n,onChange:s,size:b,total:q,getControlProps:ne,getItemProps:oe,...x})},P={state:{paginationSize:b,page:n,totalPages:q,totalRecords:S,recordsPerPage:k,recordsLength:B,fetching:r,from:V,to:ee,isWrapped:ae},actions:{setPage:x=>s?.(x),setRecordsPerPage:j?x=>j(x):void 0},Controls:re};return y.jsx(O.Box,{px:Q??"xs",py:"xs",className:Oe("mantine-datatable-pagination",t),style:[{flexDirection:ae?"column":"row"},e],children:typeof G=="function"?G(P):y.jsxs(y.Fragment,{children:[y.jsx(re.Text,{}),y.jsx(re.PageSizeSelector,{}),y.jsx(re.Pagination,{})]})})}function cc({className:t,style:e,visibleMediaQuery:r,record:n,index:s,onClick:u,onDoubleClick:d,onContextMenu:i,noWrap:m,ellipsis:b,textAlign:_,width:M,accessor:C,render:S,defaultRender:k,customCellAttributes:j}){return jr(r)?y.jsx(O.TableTd,{className:Oe({[kn]:m||b,[Pn]:b,[Nt]:u||d,[js]:i,[Ar]:_==="left",[Er]:_==="center",[Tr]:_==="right"},t),style:[{width:M,minWidth:M,maxWidth:M},e],onClick:u,onDoubleClick:d,onContextMenu:i,...j?.(n,s),children:S?S(n,s):k?k(n,s,C):Ps(n,C)}):null}function dc({open:t,colSpan:e,content:r,collapseProps:n}){let{expanded:s,visible:u}=zu(t,n?.transitionDuration);return u?y.jsxs(y.Fragment,{children:[y.jsx(O.TableTr,{}),y.jsx(O.TableTr,{children:y.jsx(O.TableTd,{className:"mantine-datatable-row-expansion-cell",colSpan:e,children:y.jsx(O.Collapse,{in:s,...n,children:y.jsx("div",{className:"mantine-datatable-row-expansion-cell-content",children:r()})})})})]}):null}function hc({className:t,style:e,record:r,index:n,trigger:s,onChange:u,withRightShadow:d,checkboxProps:i,getCheckboxProps:m,...b}){let _={...i,...m(r,n)},M=!b.disabled&&!_.disabled,C=S=>{S.stopPropagation(),s==="cell"&&M&&u?.(S)};return y.jsx(O.TableTd,{className:Oe("mantine-datatable-row-selector-cell",{[Nt]:s==="cell"&&M},t),style:e,"data-shadow-visible":d||void 0,onClick:C,children:y.jsx(O.Checkbox,{classNames:M?{input:Nt}:void 0,onChange:u,...b,..._})})}function fc({record:t,index:e,columns:r,defaultColumnProps:n,defaultColumnRender:s,selectionTrigger:u,selectionVisible:d,selectionChecked:i,onSelectionChange:m,isRecordSelectable:b,selectionCheckboxProps:_,getSelectionCheckboxProps:M,onClick:C,onDoubleClick:S,onContextMenu:k,onCellClick:j,onCellDoubleClick:N,onCellContextMenu:F,expansion:B,customAttributes:Q,color:U,backgroundColor:ne,className:oe,style:G,selectorCellShadowVisible:te,selectionColumnClassName:q,selectionColumnStyle:V,rowFactory:ee}){let ae=y.jsxs(y.Fragment,{children:[d&&y.jsx(hc,{className:q,style:V,record:t,index:e,trigger:u,withRightShadow:te,checked:i,disabled:!m||(b?!b(t,e):!1),onChange:m,checkboxProps:_,getCheckboxProps:M}),r.map(({hidden:x,hiddenContent:w,...h},l)=>{if(x||w)return null;let{accessor:p,visibleMediaQuery:f,textAlign:a,noWrap:v,ellipsis:D,width:T,render:z,cellsClassName:Z,cellsStyle:K,customCellAttributes:H}={...n,...h};return y.jsx(cc,{className:typeof Z=="function"?Z(t,e):Z,style:K?.(t,e),visibleMediaQuery:f,record:t,index:e,onClick:j?ie=>j({event:ie,record:t,index:e,column:h,columnIndex:l}):void 0,onDoubleClick:N?ie=>N({event:ie,record:t,index:e,column:h,columnIndex:l}):void 0,onContextMenu:F?ie=>F({event:ie,record:t,index:e,column:h,columnIndex:l}):void 0,accessor:p,textAlign:a,noWrap:v,ellipsis:D,width:T,render:z,defaultRender:s,customCellAttributes:H},p)})]}),re=B&&y.jsx(dc,{colSpan:r.filter(({hidden:x})=>!x).length+(d?1:0),open:B.isRowExpanded(t),content:B.content({record:t,index:e}),collapseProps:B.collapseProps}),P=pc({record:t,index:e,selectionChecked:i,onClick:C,onDoubleClick:S,onContextMenu:k,expansion:B,customAttributes:Q,color:U,backgroundColor:ne,className:oe,style:G});return ee?ee({record:t,index:e,rowProps:P,children:ae,expandedElement:re}):y.jsxs(y.Fragment,{children:[y.jsx(O.TableTr,{...P,children:ae}),re]})}function pc({record:t,index:e,selectionChecked:r,onClick:n,onDoubleClick:s,onContextMenu:u,expansion:d,customAttributes:i,color:m,backgroundColor:b,className:_,style:M}){return{className:Oe("mantine-datatable-row",{[Nt]:n||s||d?.isExpandable({record:t,index:e})&&d?.expandOnClick},{[js]:u},typeof _=="function"?_(t,e):_),"data-selected":r||void 0,onClick:C=>{if(d){let{isExpandable:S,isRowExpanded:k,expandOnClick:j,expandRow:N,collapseRow:F}=d;S({record:t,index:e})&&j&&(k(t)?F(t):N(t))}n?.({event:C,record:t,index:e})},onDoubleClick:s?C=>s({event:C,record:t,index:e}):void 0,onContextMenu:u?C=>u({event:C,record:t,index:e}):void 0,style:[m||b?C=>{let S=m?.(t,e),k=b?.(t,e);return ic({theme:C,color:S,backgroundColor:k})}:void 0,M?.(t,e)],...i?.(t,e)??{}}}function gc({leftShadowBehind:t,rightShadowBehind:e,onScrollPositionChange:r,children:n,viewportRef:s,scrollAreaProps:u}){return y.jsxs(O.ScrollArea,{...u,viewportRef:s,classNames:{root:"mantine-datatable-scroll-area",scrollbar:"mantine-datatable-scroll-area-scrollbar",thumb:"mantine-datatable-scroll-area-thumb",corner:"mantine-datatable-scroll-area-corner"},onScrollPositionChange:r,children:[n,y.jsx(O.Box,{className:Oe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow")}),y.jsx("div",{className:Oe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-behind":t})}),y.jsx("div",{className:Oe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-behind":e})}),y.jsx(O.Box,{className:Oe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow")})]})}function mc({withTableBorder:t,borderRadius:e,textSelectionDisabled:r,height:n="100%",minHeight:s,maxHeight:u,shadow:d,verticalAlign:i="center",fetching:m,columns:b,storeColumnsKey:_,groups:M,pinFirstColumn:C,pinLastColumn:S,defaultColumnProps:k,defaultColumnRender:j,idAccessor:N="id",records:F,selectionTrigger:B="checkbox",selectedRecords:Q,onSelectedRecordsChange:U,selectionColumnClassName:ne,selectionColumnStyle:oe,isRecordSelectable:G,selectionCheckboxProps:te,allRecordsSelectionCheckboxProps:q={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:V=(Ee,ht)=>({"aria-label":`Select record ${ht+1}`}),sortStatus:ee,sortIcons:ae,onSortStatusChange:re,horizontalSpacing:P,page:x,onPageChange:w,totalRecords:h,recordsPerPage:l,onRecordsPerPageChange:p,recordsPerPageOptions:f,recordsPerPageLabel:a="Records per page",paginationWithEdges:v,paginationWithControls:D,paginationActiveTextColor:T,paginationActiveBackgroundColor:z,paginationSize:Z="sm",paginationText:K=({from:Ee,to:ht,totalRecords:we})=>`${Ee} - ${ht} / ${we}`,paginationWrapBreakpoint:H="sm",getPaginationControlProps:ie=Ee=>Ee==="previous"?{"aria-label":"Previous page"}:Ee==="next"?{"aria-label":"Next page"}:{},getPaginationItemProps:se,renderPagination:ue,loaderBackgroundBlur:E,customLoader:L,loaderSize:$,loaderType:Y,loaderColor:I,loadingText:ce="...",emptyState:o,noRecordsText:c="No records",noRecordsIcon:g,highlightOnHover:A,striped:R,noHeader:W,onRowClick:le,onRowDoubleClick:fe,onRowContextMenu:pe,onCellClick:J,onCellDoubleClick:he,onCellContextMenu:me,onScroll:ge,onScrollToTop:Se,onScrollToBottom:Ce,onScrollToLeft:ke,onScrollToRight:Fe,c:Re,backgroundColor:De,borderColor:_t,rowBorderColor:Ie,stripedColor:it,highlightOnHoverColor:Ve,rowColor:Ye,rowBackgroundColor:Ot,rowExpansion:Ae,rowClassName:xt,rowStyle:at,customRowAttributes:He,scrollViewportRef:Ge,scrollAreaProps:Qe,tableRef:Ke,bodyRef:rt,m:lt,my:be,mx:Pe,mt:nt,mb:Ct,ml:St,mr:Dt,className:kt,classNames:ut,style:er,styles:ft,rowFactory:Lt,tableWrapper:ct,...dt}){let Ee=X.useMemo(()=>M?Sn(M):b,[b,M]),[ht,we]=X.useState(!1),{refs:ve,onScroll:ot}=Eu({scrollCallbacks:{onScroll:ge,onScrollToTop:Se,onScrollToBottom:Ce,onScrollToLeft:ke,onScrollToRight:Fe},withRowBorders:dt.withRowBorders}),Te=Au({key:_,columns:Ee,headerRef:ve.header,scrollViewportRef:ve.scrollViewport,onFixedLayoutChange:we}),Me=Ne.useMergedRef(ve.table,Ke),Ze=Ne.useMergedRef(ve.scrollViewport,Ge),st=Yu({rowExpansion:Ae,records:F,idAccessor:N}),pt=X.useRef(!1),Is=X.useRef(x),On=X.useRef(F),Gc=X.useCallback(xe=>{pt.current=!0,On.current=F,w(xe)},[w,F]);X.useEffect(()=>{Is.current!==x&&(pt.current=!0,On.current=F,Is.current=x)},[x,F]);let $r=F?.length;X.useLayoutEffect(()=>{if(!pt.current||m||F===On.current)return;let xe=ve.scrollViewport.current;if(!xe)return;let jt=requestAnimationFrame(()=>{xe.scrollTo({top:0,left:0}),pt.current=!1});return()=>cancelAnimationFrame(jt)},[m,F,ve.scrollViewport]);let Ys=F?.map(xe=>Be(xe,N)),Bt=!!Q,tr=Q?.map(xe=>Be(xe,N)),zs=Ys!==void 0&&tr!==void 0&&tr.length>0,jn=G?F?.filter(G):F,Rr=jn?.map(xe=>Be(xe,N)),Nr=zs&&Rr.every(xe=>tr.includes(xe)),Qc=zs&&Rr.some(xe=>tr.includes(xe)),Kc=X.useCallback(()=>{Q&&U&&U(Nr?Q.filter(xe=>!Rr.includes(Be(xe,N))):Cn([...Q,...jn],xe=>Be(xe,N)))},[Nr,N,U,Rr,jn,Q]),{lastSelectionChangeIndex:Lr,setLastSelectionChangeIndex:Zc}=Tu(Ys),An=Bt&&!C,Jc={m:lt,my:be,mx:Pe,mt:nt,mb:Ct,ml:St,mr:Dt},Xc=X.useCallback(({children:xe})=>ct?ct({children:xe}):xe,[ct]);return y.jsx(ws,{...Te,children:y.jsxs(O.Box,{ref:ve.root,...Jc,className:Oe("mantine-datatable",{"mantine-datatable-with-border":t},kt,ut?.root),style:[xe=>({...sc({theme:xe,c:Re,backgroundColor:De,borderColor:_t,rowBorderColor:Ie,stripedColor:it,highlightOnHoverColor:Ve}),borderRadius:xe.radius[e]||e,boxShadow:xe.shadows[d]||d,height:n,minHeight:s,maxHeight:u}),er,ft?.root,{position:"relative"}],children:[y.jsx(gc,{viewportRef:Ze,leftShadowBehind:Bt||!!C,rightShadowBehind:S,onScrollPositionChange:ot,scrollAreaProps:Qe,children:y.jsx(Xc,{children:y.jsxs(O.Table,{ref:Me,horizontalSpacing:P,className:Oe("mantine-datatable-table",{[Fu]:r,"mantine-datatable-vertical-align-top":i==="top","mantine-datatable-vertical-align-bottom":i==="bottom","mantine-datatable-pin-last-column":S,"mantine-datatable-selection-column-visible":Bt,"mantine-datatable-pin-first-column":C,"mantine-datatable-resizable-columns":Te.hasResizableColumns&&ht},ut?.table),style:{...ft?.table},"data-striped":$r&&R||void 0,"data-highlight-on-hover":A||void 0,...dt,children:[W?null:y.jsx(ws,{...Te,children:y.jsx(nc,{ref:ve.header,selectionColumnHeaderRef:ve.selectionColumnHeader,className:ut?.header,style:ft?.header,columns:Ee,defaultColumnProps:k,groups:M,sortStatus:ee,sortIcons:ae,onSortStatusChange:re,selectionTrigger:B,selectionVisible:Bt,selectionChecked:Nr,selectionIndeterminate:Qc&&!Nr,onSelectionChange:Kc,selectionCheckboxProps:{...te,...q},selectorCellShadowVisible:An,selectionColumnClassName:ne,selectionColumnStyle:oe,withColumnBorders:dt.withColumnBorders})}),y.jsx("tbody",{ref:rt,children:$r?F.map((xe,jt)=>{let En=Be(xe,N),Tn=tr?.includes(En)||!1,Fs;return U&&Q&&(Fs=ed=>{if(ed.nativeEvent.shiftKey&&Lr!==null){let It=F.filter(jt>Lr?(At,Et)=>Et>=Lr&&Et<=jt&&(G?G(At,Et):!0):(At,Et)=>Et>=jt&&Et<=Lr&&(G?G(At,Et):!0));U(Tn?Bu(Q,It,At=>Be(At,N)):Cn([...Q,...It],At=>Be(At,N)))}else U(Tn?Q.filter(It=>Be(It,N)!==En):Cn([...Q,xe],It=>Be(It,N)));Zc(jt)}),y.jsx(fc,{record:xe,index:jt,columns:Ee,defaultColumnProps:k,defaultColumnRender:j,selectionTrigger:B,selectionVisible:Bt,selectionChecked:Tn,onSelectionChange:Fs,isRecordSelectable:G,selectionCheckboxProps:te,getSelectionCheckboxProps:V,onClick:le,onDoubleClick:fe,onCellClick:J,onCellDoubleClick:he,onContextMenu:pe,onCellContextMenu:me,expansion:st,color:Ye,backgroundColor:Ot,className:xt,style:at,customAttributes:He,selectorCellShadowVisible:An,selectionColumnClassName:ne,selectionColumnStyle:oe,idAccessor:N,rowFactory:Lt},En)}):y.jsx(Du,{})}),Ee.some(({footer:xe})=>xe)&&y.jsx(qu,{ref:ve.footer,className:ut?.footer,style:ft?.footer,columns:Ee,defaultColumnProps:k,selectionVisible:Bt,selectorCellShadowVisible:An})]})})}),x&&y.jsx(uc,{className:ut?.pagination,style:ft?.pagination,horizontalSpacing:P,fetching:m,page:x,onPageChange:Gc,totalRecords:h,recordsPerPage:l,onRecordsPerPageChange:p,recordsPerPageOptions:f,recordsPerPageLabel:a,paginationWithEdges:v,paginationWithControls:D,paginationActiveTextColor:T,paginationActiveBackgroundColor:z,paginationSize:Z,paginationText:K,paginationWrapBreakpoint:H,getPaginationControlProps:ie,getPaginationItemProps:se,noRecordsText:c,loadingText:ce,recordsLength:$r,renderPagination:ue}),y.jsx(oc,{fetching:m,backgroundBlur:E,customContent:L,size:$,type:Y,color:I}),y.jsx(Pu,{icon:g,text:c,active:!m&&!$r,children:o})]})})}function Ts(t){const e=ze.c(42),{fields:r,onClose:n,queryKey:s,apiPath:u,id:d,steps:i}=t,[m,b]=X.useState(0),[_,M]=X.useState(!1),{data:C,isLoading:S}=Go(u,s,d),{mutateAsync:k,isError:j,error:N,isPending:F}=hn(u,s);let B;e[0]!==r?(B=new Set(r.filter(xc).map(_c)),e[0]=r,e[1]=B):B=e[1];let Q;e[2]!==B?(Q=[...B],e[2]=B,e[3]=Q):Q=e[3];const U=Q;let ne;e[4]!==r?(ne=r.reduce(wc,{}),e[4]=r,e[5]=ne):ne=e[5];let oe;e[6]!==r?(oe=r.filter(bc).reduce(vc,{}),e[6]=r,e[7]=oe):oe=e[7];let G;e[8]!==ne||e[9]!==oe?(G={mode:"uncontrolled",initialValues:ne,validate:oe},e[8]=ne,e[9]=oe,e[10]=G):G=e[10];const te=$n.useForm(G);let q;e[11]!==C||e[12]!==r||e[13]!==te?(q=()=>{if(C){const l={...C};r.forEach(p=>{const f=p.id;p.type==="boolean"&&l[f]===null?l[f]=!1:p.type==="date"&&l[f]?l[f]=new Date(l[f]):l[f]===null&&(l[f]="")}),te.initialize(l),te.setValues(l)}},e[11]=C,e[12]=r,e[13]=te,e[14]=q):q=e[14];let V;e[15]!==C?(V=[C],e[15]=C,e[16]=V):V=e[16],X.useEffect(q,V);let ee;e[17]===Symbol.for("react.memo_cache_sentinel")?(ee=function(p,f){return typeof p.required=="function"?p.required(f??{}):!!p.required},e[17]=ee):ee=e[17];const ae=ee;let re;e[18]!==te||e[19]!==d?(re=function(p){const f=te.getValues();if(p.conditional&&!p.conditional(f))return null;const a=ae(p,f);return y.jsxs(X.Fragment,{children:[(p.type===void 0||p.type=="text")&&y.jsx(O.TextInput,{label:p.column.title,placeholder:p.placeholder??"",...te.getInputProps(p.id),type:p.id.includes("email")?"email":void 0,required:a},te.key(p.id)),p.type==="number"&&y.jsx(O.NumberInput,{decimalSeparator:",",label:p.column.title,placeholder:p.placeholder??"",...te.getInputProps(p.id),required:a},te.key(p.id)),p.type==="date"&&y.jsx(Or,{label:p.column.title,placeholder:p.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...te.getInputProps(p.id),required:a},te.key(p.id)),p.type==="boolean"&&y.jsx(O.Checkbox,{mt:"md",label:p.column.title,...te.getInputProps(p.id,{type:"checkbox"}),required:a},te.key(p.id)),p.type==="textarea"&&y.jsx(O.Textarea,{label:p.column.title,placeholder:p.placeholder??"",...te.getInputProps(p.id),minRows:3,autosize:!0,required:a},te.key(p.id)),p.type==="custom"&&p.render&&p.render({...te.getValues(),id:d},te.setValues,M,{error:te.getInputProps(p.id).error,required:a})]},p.id)},e[18]=te,e[19]=d,e[20]=re):re=e[20];const P=re;let x;e[21]!==j||e[22]!==N?.message||e[23]!==N?.name?(x=j&&y.jsx(O.Alert,{variant:"outline",color:"red",title:N?.name??"Fehler aufgetreten",mb:"lg",children:N?.message??"Fehler aufgetreten"}),e[21]=j,e[22]=N?.message,e[23]=N?.name,e[24]=x):x=e[24];let w;e[25]!==m||e[26]!==r||e[27]!==te||e[28]!==_||e[29]!==d||e[30]!==S||e[31]!==F||e[32]!==j||e[33]!==n||e[34]!==P||e[35]!==i||e[36]!==U||e[37]!==k?(w=S?y.jsxs(O.Stack,{gap:"md",children:[y.jsx(O.Skeleton,{height:40}),Array(r.length).fill(0).map(yc),y.jsxs(O.Group,{mt:"md",justify:"end",children:[y.jsx(O.Skeleton,{width:100,height:36}),y.jsx(O.Skeleton,{width:100,height:36})]})]}):y.jsxs("form",{onSubmit:te.onSubmit(async l=>{await k({...l,id:d}),U.length&&m<U.length-1?j||b(m+1):j||(te.setInitialValues(l),te.reset(),n())}),children:[U.length?y.jsx(O.Stepper,{active:m,size:"sm",children:U.map(l=>y.jsx(O.Stepper.Step,{...i&&i[l-1]?{label:i[l-1].label}:{},children:r.filter(p=>p.step===l).map(p=>P(p))},l))}):r.map(l=>P(l)),!_&&y.jsxs(O.Group,{mt:"md",justify:"end",children:[y.jsx(O.Button,{onClick:()=>U.length?m===0?n():b(m-1):n(),variant:"outline",children:U.length?m===0?"Abbrechen":"Zurück":"Abbrechen"}),y.jsx(O.Button,{type:"submit",loading:F,children:U.length?m===U.length-1?"Speichern":"Weiter":"Speichern"})]})]}),e[25]=m,e[26]=r,e[27]=te,e[28]=_,e[29]=d,e[30]=S,e[31]=F,e[32]=j,e[33]=n,e[34]=P,e[35]=i,e[36]=U,e[37]=k,e[38]=w):w=e[38];let h;return e[39]!==x||e[40]!==w?(h=y.jsxs(y.Fragment,{children:[x,w]}),e[39]=x,e[40]=w,e[41]=h):h=e[41],h}function yc(t,e){return y.jsx(O.Skeleton,{height:35},`skeleton-field-${e}`)}function vc(t,e){return t[e.id]=(r,n)=>e.conditional&&!e.conditional(n)||!(typeof e.required=="function"?e.required(n):!!e.required)||r?null:"Pflichtfeld",t}function bc(t){return t.required}function wc(t,e){return t[e.id]=e.type==="boolean"?e.defaultValue??!1:e.defaultValue??"",t}function _c(t){return t.step}function xc(t){return typeof t.step=="number"}function $s({queryKey:t,apiPath:e,onClose:r,selectedRecords:n}){const{mutateAsync:s,isError:u,error:d,isPending:i}=Zo(e,t),[m,b]=X.useState(n),[_,M]=X.useState(!1),C=_||i;return X.useEffect(()=>{m.length||r()},[r,m]),m.length?y.jsxs(y.Fragment,{children:[u&&d.message&&y.jsx(O.Alert,{variant:"outline",color:"red",title:d.name,children:d.message}),y.jsx(O.Text,{children:m.length===1?`Soll ${m.length} Eintrag wirklich gelöscht werden?`:`Sollen ${m.length} Einträge wirklich gelöscht werden?`}),y.jsxs(O.Group,{mt:"md",justify:"end",children:[y.jsx(O.Button,{onClick:r,variant:"outline",disabled:C,children:"Abbrechen"}),y.jsx(O.Button,{color:"red",loading:C,onClick:async()=>{M(!0);try{await Promise.all(m.map(S=>s(S.id))),b([])}finally{M(!1)}},children:"Löschen"})]})]}):y.jsx(y.Fragment,{})}function Rs(t,e){const r=ze.c(8);let n;r[0]!==t||r[1]!==e?(n=()=>{const b=localStorage.getItem(`use_persistent_storage_${e}`);return b?JSON.parse(b):t},r[0]=t,r[1]=e,r[2]=n):n=r[2];const[s,u]=X.useState(n);let d;r[3]!==e?(d=b=>{u(b),localStorage.setItem(`use_persistent_storage_${e}`,JSON.stringify(b))},r[3]=e,r[4]=d):d=r[4];const i=d;let m;return r[5]!==i||r[6]!==s?(m=[s,i],r[5]=i,r[6]=s,r[7]=m):m=r[7],m}const Cc=(t,e)=>{const r=t.map(m=>m[e]).filter(m=>m!=null&&m!=="");if(r.length===0)return"string";const n=Math.min(100,r.length),s=r.slice(0,n),u={string:0,number:0,date:0},d=[/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,/^\d{4}-\d{2}-\d{2}$/,/^\d{1,2}\/\d{1,2}\/\d{4}$/,/^\d{1,2}\.\d{1,2}\.\d{4}$/];s.forEach(m=>{if(typeof m=="number")u.number++;else if(typeof m=="string"){const b=m.trim();if(b!==""&&!isNaN(Number(b))&&!isNaN(parseFloat(b))){u.number++;return}if(d.some(_=>_.test(b))){const _=new Date(b);if(!isNaN(_.getTime())){u.date++;return}}u.string++}else m instanceof Date?u.date++:u.string++});const i=u.string+u.number+u.date;return u.date/i>=.6?"date":u.number/i>=.6?"number":u.string/i>=.6?"string":"mixed"},Ns=new Map,Ls=(t,e,r="asc")=>{if(!t||t.length===0)return[];const n=`${String(e)}_${t.length}`;let s=Ns.get(n);return s||(s=Cc(t,e),Ns.set(n,s)),[...t].sort((d,i)=>{const m=d[e],b=i[e],_=m==null||m==="",M=b==null||b==="";if(_&&M)return 0;if(_)return r==="asc"?-1:1;if(M)return r==="asc"?1:-1;let C,S;switch(s){case"date":if(typeof m=="string"){const B=new Date(m.trim());C=isNaN(B.getTime())?null:B.getTime()}else m instanceof Date?C=m.getTime():C=null;if(typeof b=="string"){const B=new Date(b.trim());S=isNaN(B.getTime())?null:B.getTime()}else b instanceof Date?S=b.getTime():S=null;break;case"number":if(typeof m=="number")C=m;else{const B=String(m).trim(),Q=parseFloat(B);C=isNaN(Q)?null:Q}if(typeof b=="number")S=b;else{const B=String(b).trim(),Q=parseFloat(B);S=isNaN(Q)?null:Q}break;case"string":const k=typeof m=="string"?m:String(m),j=typeof b=="string"?b:String(b);C=k.toLowerCase().trim(),S=j.toLowerCase().trim();break;case"mixed":default:const N=String(m),F=String(b);C=N.toLowerCase().trim(),S=F.toLowerCase().trim();break}return C===null&&S===null?0:C===null?r==="asc"?1:-1:S===null||C<S?r==="asc"?-1:1:C>S?r==="asc"?1:-1:0})};function Sc(t,e){return e.split(".").reduce((r,n)=>{if(r&&typeof r=="object"&&n in r)return r[n]},t)}function Dc(t,e){const r=e.column;if(r.render)return r.render(t,0);const n=r.accessor??e.id,s=Sc(t,n);return s==null?y.jsx(O.Text,{c:"dimmed",children:"–"}):typeof s=="boolean"?y.jsx(O.Text,{fz:"sm",children:s?"Ja":"Nein"}):y.jsx(O.Text,{fz:"sm",children:String(s)})}function kc(t){const e=ze.c(10),{field:r,record:n}=t,s=r.column.title??r.id;let u;e[0]!==s?(u=y.jsx(O.Text,{fw:700,fz:"sm",children:s}),e[0]=s,e[1]=u):u=e[1];let d;e[2]!==r||e[3]!==n?(d=Dc(n,r),e[2]=r,e[3]=n,e[4]=d):d=e[4];let i;e[5]!==d?(i=y.jsx(O.Box,{ta:"right",fz:"sm",children:d}),e[5]=d,e[6]=i):i=e[6];let m;return e[7]!==u||e[8]!==i?(m=y.jsxs(O.Group,{wrap:"nowrap",justify:"space-between",align:"center",py:"xs",px:"sm",children:[u,i]}),e[7]=u,e[8]=i,e[9]=m):m=e[9],m}function Bs(t){const e=ze.c(42),{records:r,fields:n,selection:s,selectedRecords:u,onSelectedRecordsChange:d,onRowClick:i,actions:m,canUpdate:b,canDelete:_,pagination:M,sort:C,rowExpansion:S}=t;let k;e[0]!==u?(k=u===void 0?[]:u,e[0]=u,e[1]=k):k=e[1];const j=k;let N;e[2]===Symbol.for("react.memo_cache_sentinel")?(N=new Set,e[2]=N):N=e[2];const[F,B]=X.useState(N);let Q;e[3]===Symbol.for("react.memo_cache_sentinel")?(Q=re=>{B(P=>{const x=new Set(P);return x.has(re)?x.delete(re):x.add(re),x})},e[3]=Q):Q=e[3];const U=Q;let ne,oe,G,te,q,V;if(e[4]!==m||e[5]!==_||e[6]!==b||e[7]!==F||e[8]!==n||e[9]!==i||e[10]!==d||e[11]!==r||e[12]!==S||e[13]!==j||e[14]!==s||e[15]!==C){V=Symbol.for("react.early_return_sentinel");e:{const re=n.filter(Ec),P=re.filter(Ac).reduce(jc,[]);let x;e[22]!==j?(x=a=>j.some(v=>v.id===a.id),e[22]=j,e[23]=x):x=e[23];const w=x;let h;e[24]!==w||e[25]!==d||e[26]!==j?(h=a=>{d&&(w(a)?d(j.filter(v=>v.id!==a.id)):d([...j,a]))},e[24]=w,e[25]=d,e[26]=j,e[27]=h):h=e[27];const l=h;let p;e[28]!==i||e[29]!==s||e[30]!==l?(p=(a,v,D)=>{i?i({record:a,index:v,event:D}):s&&l(a)},e[28]=i,e[29]=s,e[30]=l,e[31]=p):p=e[31];const f=p;if(r.length===0){let a;e[32]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx(O.Text,{c:"dimmed",ta:"center",py:"xl",children:"Keine Einträge gefunden"}),e[32]=a):a=e[32],V=a;break e}ne=O.Stack,oe="sm",G="md",te=C&&P.length>0&&y.jsxs(O.Group,{gap:"xs",wrap:"nowrap",children:[y.jsx(O.Select,{data:P,value:C.field,onChange:a=>a&&C.onSortChange(a,C.direction),allowDeselect:!1,style:{flex:1}}),y.jsx(O.ActionIcon,{variant:"filled",size:"input-sm",onClick:()=>C.onSortChange(C.field,C.direction==="asc"?"desc":"asc"),children:C.direction==="asc"?y.jsx(Je.IconSortAscending,{size:18}):y.jsx(Je.IconSortDescending,{size:18})})]}),q=r.map((a,v)=>{const D=w(a),T=!!i||!!s,z=a.id??v,Z=F.has(z);return y.jsx(X.Fragment,{children:y.jsxs(O.Box,{bg:D?"var(--mantine-primary-color-light)":v%2===0?"var(--mantine-color-gray-0)":"white",bd:D?void 0:"1px solid var(--mantine-color-gray-2)",style:{borderRadius:"var(--mantine-radius-md)",overflow:"hidden"},children:[y.jsxs(O.Box,{w:"100%",style:{cursor:T||S?"pointer":"default"},onClick:K=>{S&&!i?U(z):f(a,v,K)},children:[(s||S||m&&m.length>0)&&y.jsxs(O.Group,{px:"sm",pt:"sm",justify:"space-between",children:[y.jsxs(O.Group,{gap:"xs",children:[S&&y.jsx(O.Box,{c:"var(--mantine-primary-color-filled)",style:{cursor:"pointer",display:"flex",alignItems:"center"},onClick:K=>{K.stopPropagation(),U(z)},children:y.jsx(Je.IconChevronDown,{size:16,style:{transform:Z?"rotate(0deg)":"rotate(-90deg)",transition:"transform 200ms"}})}),s&&y.jsx(O.Checkbox,{checked:D,onChange:()=>l(a),onClick:Oc})]}),m&&m.length>0&&(()=>{const K=m.filter(H=>!(H.label==="Bearbeiten"&&b&&!b(a)||H.label==="Löschen"&&_&&!_(a)));return K.length===0?null:y.jsxs(O.Menu,{shadow:"md",position:"bottom-end",children:[y.jsx(O.Menu.Target,{children:y.jsx(O.ActionIcon,{variant:"subtle",color:"gray",size:"sm",onClick:Mc,children:y.jsx(Je.IconDotsVertical,{size:16})})}),y.jsx(O.Menu.Dropdown,{children:K.map((H,ie)=>y.jsx(O.Menu.Item,{leftSection:H.icon,onClick:se=>{se.stopPropagation(),H.onClick([a])},children:H.label},`card_action_${ie}`))})]})})()]}),re.map((K,H)=>y.jsxs(X.Fragment,{children:[H>0&&y.jsx(O.Divider,{}),y.jsx(kc,{field:K,record:a})]},K.id))]}),S&&y.jsxs(O.Collapse,{in:Z,children:[y.jsx(O.Divider,{}),y.jsx(O.Box,{px:"sm",py:"sm",children:S.content(a)})]})]})},z)})}e[4]=m,e[5]=_,e[6]=b,e[7]=F,e[8]=n,e[9]=i,e[10]=d,e[11]=r,e[12]=S,e[13]=j,e[14]=s,e[15]=C,e[16]=ne,e[17]=oe,e[18]=G,e[19]=te,e[20]=q,e[21]=V}else ne=e[16],oe=e[17],G=e[18],te=e[19],q=e[20],V=e[21];if(V!==Symbol.for("react.early_return_sentinel"))return V;let ee;e[33]!==M?(ee=M&&M.totalRecords>M.recordsPerPage&&y.jsxs(O.Stack,{gap:"xs",mt:"sm",children:[y.jsx(O.Group,{justify:"center",children:y.jsx(O.Pagination,{total:Math.ceil(M.totalRecords/M.recordsPerPage),value:M.page,onChange:M.onPageChange,size:"sm"})}),M.recordsPerPageOptions&&M.onRecordsPerPageChange&&y.jsxs(O.Group,{justify:"center",gap:"xs",children:[y.jsx(O.Text,{fz:"xs",c:"dimmed",children:"Einträge pro Seite:"}),y.jsx(O.Select,{data:M.recordsPerPageOptions.map(Pc),value:String(M.recordsPerPage),onChange:re=>re&&M.onRecordsPerPageChange(Number(re)),allowDeselect:!1,size:"xs",w:70})]})]}),e[33]=M,e[34]=ee):ee=e[34];let ae;return e[35]!==ne||e[36]!==ee||e[37]!==oe||e[38]!==G||e[39]!==te||e[40]!==q?(ae=y.jsxs(ne,{gap:oe,my:G,children:[te,q,ee]}),e[35]=ne,e[36]=ee,e[37]=oe,e[38]=G,e[39]=te,e[40]=q,e[41]=ae):ae=e[41],ae}function Pc(t){return{value:String(t),label:String(t)}}function Mc(t){return t.stopPropagation()}function Oc(t){return t.stopPropagation()}function jc(t,e){const r=e.column.accessor??e.id;return t.some(n=>n.value===r)||t.push({value:r,label:e.column.title??e.id}),t}function Ac(t){return t.column.sortable!==!1}function Ec(t){return t.list&&t.column}const Mn=[10,15,50,100,500];function Tc(t){const e=ze.c(132),{title:r,queryKey:n,connectedQueryKeys:s,apiPath:u,mutationApiPath:d,buttons:i,fields:m,selection:b,pagination:_,filters:M,actions:C,steps:S,defaultSort:k,onSortChange:j,createButtonText:N,queryParams:F,tabs:B,defaultTab:Q,activeTab:U,onActiveTabChange:ne,canUpdate:oe,canDelete:G,showRefresh:te,rowExpansion:q,onRowClick:V,mobileCards:ee}=t,ae=te===void 0?!0:te,re=ee===void 0?!1:ee,[P,x]=X.useState(Q||(B&&B.length>0?B[0].value:null)),w=U!==void 0?U:P;let h;e[0]!==U||e[1]!==ne?(h=we=>{U===void 0&&x(we),ne&&ne(we)},e[0]=U,e[1]=ne,e[2]=h):h=e[2];const l=h,p=B?.find(we=>we.value===w)?.queryParams||{},f={...F,...p},a=f?"?"+Object.entries(f).filter(Vc).map(qc).join("&"):"";let v;e[3]!==w||e[4]!==n?(v=w?[...n,w]:n,e[3]=w,e[4]=n,e[5]=v):v=e[5];const D=v,{data:T,isLoading:z,isError:Z,isRefetching:K,refetch:H}=Qo(u+a,D),{queryClient:ie}=yt();let se,ue;e[6]!==T||e[7]!==s||e[8]!==ie?(se=()=>{!T||!Array.isArray(T)||s?.forEach(we=>ie.invalidateQueries({queryKey:we}))},ue=[T,s,ie],e[6]=T,e[7]=s,e[8]=ie,e[9]=se,e[10]=ue):(se=e[9],ue=e[10]),X.useEffect(se,ue);const E=!T||!Array.isArray(T)?[]:!M||M.length===0?T:T.filter(we=>M.every(ve=>{if(ve.value===void 0)return!0;const ot=ve.id;if(ve.type==="query"){const Te=we[ot];return Array.isArray(ve.value)?Array.isArray(Te)?Te.some(Me=>{if(typeof Me=="string"||typeof Me=="number")return ve.value.includes(String(Me));if(Me&&typeof Me=="object"){if("id"in Me&&ve.value.includes(Me.id))return!0;for(const Ze in Me){const st=Me[Ze];if(typeof st=="string"&&ve.value.includes(st)||st&&typeof st=="object"&&"id"in st&&ve.value.includes(st.id))return!0}}return!1}):Te&&typeof Te=="object"&&"id"in Te?ve.value.includes(Te.id):!1:typeof Te=="string"&&Te.includes(ve.value)}else if(ve.type==="date"){const Te=ve.value;if(!Te)return!0;const[Me,Ze]=Te;if(!Me&&!Ze)return!0;const st=we[ot];if(typeof st=="string"){const pt=st.split(" ")[0];if(Me&&Ze)return pt>=Me&&pt<=Ze;if(Me&&!Ze)return pt>=Me;if(!Me&&Ze)return pt<=Ze}return!0}else if(ve.type==="boolean")return we[ot]===ve.value;return!0})),L=k?.field??m[0].id,$=k?.direction??"desc";let Y;e[11]!==L||e[12]!==$?(Y={columnAccessor:L,direction:$},e[11]=L,e[12]=$,e[13]=Y):Y=e[13];const[I,ce]=X.useState(Y);let o;e[14]!==j?(o=we=>{ce(we),j&&j(String(we.columnAccessor),we.direction)},e[14]=j,e[15]=o):o=e[15];const c=o,g=Ls(E,I.columnAccessor,I.direction),[A,R]=Rs(Mn[1],"mantine-table-page-size"),[W,le]=X.useState(1),fe=_?g.slice((W-1)*A,W*A):g;let pe;e[16]===Symbol.for("react.memo_cache_sentinel")?(pe=[],e[16]=pe):pe=e[16];const[J,he]=X.useState(pe);let me;e[17]===Symbol.for("react.memo_cache_sentinel")?(me=()=>{he([])},e[17]=me):me=e[17];let ge;e[18]!==w?(ge=[w],e[18]=w,e[19]=ge):ge=e[19],X.useEffect(me,ge);const[Se,Ce]=X.useState(!1),[ke,Fe]=X.useState(!1),[Re,De]=X.useState(!1);let _t;e[20]!==m?(_t=m.some(Uc),e[20]=m,e[21]=_t):_t=e[21];const Ie=_t;let it;e[22]!==m?(it=m.some(Wc),e[22]=m,e[23]=it):it=e[23];const Ve=it;let Ye;if(e[24]!==C||e[25]!==Ve||e[26]!==Ie){if(Ye=[],Ie){let we;e[28]===Symbol.for("react.memo_cache_sentinel")?(we=y.jsx(Je.IconPencil,{size:14}),e[28]=we):we=e[28];let ve;e[29]===Symbol.for("react.memo_cache_sentinel")?(ve={icon:we,label:"Bearbeiten",onClick:ot=>{he(ot),Fe(!0)}},e[29]=ve):ve=e[29],Ye.push(ve)}if(C&&Ye.push(...C),Ve){let we;e[30]===Symbol.for("react.memo_cache_sentinel")?(we=y.jsx(Je.IconTrash,{size:14}),e[30]=we):we=e[30];let ve;e[31]===Symbol.for("react.memo_cache_sentinel")?(ve={icon:we,label:"Löschen",onClick:ot=>{he(ot),De(!0)}},e[31]=ve):ve=e[31],Ye.push(ve)}e[24]=C,e[25]=Ve,e[26]=Ie,e[27]=Ye}else Ye=e[27];const Ot=r?"space-between":"end";let Ae;e[32]!==r?(Ae=r&&(typeof r=="string"?y.jsx(O.Title,{order:4,children:r}):r),e[32]=r,e[33]=Ae):Ae=e[33];let xt;e[34]===Symbol.for("react.memo_cache_sentinel")?(xt={marginLeft:"auto"},e[34]=xt):xt=e[34];let at;e[35]!==H||e[36]!==ae?(at=ae&&y.jsx(O.ActionIcon,{variant:"subtle",onClick:()=>H(),"aria-label":"Neuladen",children:y.jsx(Je.IconRefresh,{})}),e[35]=H,e[36]=ae,e[37]=at):at=e[37];let He;e[38]!==C||e[39]!==G||e[40]!==oe||e[41]!==m||e[42]!==re||e[43]!==J||e[44]!==b?(He=(m.some(Fc)||b)&&(()=>{const we=m.find(zc)&&(!oe||J.length>0&&oe(J[0])),ve=m.find(Yc)&&(!G||J.length>0&&G(J[0])),ot=(C??[]).length>0,Te=we||ve||ot;return y.jsx(O.Box,{...re?{visibleFrom:"sm"}:{},children:y.jsxs(O.Menu,{shadow:"md",children:[y.jsx(O.Menu.Target,{children:y.jsx(O.Button,{variant:"outline",rightSection:y.jsx(Je.IconCaretDownFilled,{size:14}),disabled:!J.length||!Te,children:"Aktionen"})}),y.jsxs(O.Menu.Dropdown,{children:[we&&y.jsx(O.Menu.Item,{leftSection:y.jsx(Je.IconPencil,{size:14}),onClick:()=>Fe(!0),disabled:J.length!==1,children:"Bearbeiten"}),(C??[]).map((Me,Ze)=>X.createElement(O.Menu.Item,{...Me.icon&&{leftSection:Me.icon},key:`custom_action_${Ze}`,onClick:()=>Me.onClick(J)},Me.label)),ve&&y.jsx(O.Menu.Item,{leftSection:y.jsx(Je.IconTrash,{size:14}),onClick:()=>De(!0),color:"red",children:"Löschen"})]})]})})})(),e[38]=C,e[39]=G,e[40]=oe,e[41]=m,e[42]=re,e[43]=J,e[44]=b,e[45]=He):He=e[45];let Ge;e[46]!==N||e[47]!==m||e[48]!==z?(Ge=m.find(Ic)&&y.jsx(O.Button,{onClick:()=>Ce(!0),disabled:z,children:N??"Erstellen"}),e[46]=N,e[47]=m,e[48]=z,e[49]=Ge):Ge=e[49];let Qe;e[50]!==i||e[51]!==at||e[52]!==He||e[53]!==Ge?(Qe=y.jsxs(O.Group,{align:"center",gap:"xs",wrap:"wrap",justify:"end",style:xt,children:[at,He,Ge,i]}),e[50]=i,e[51]=at,e[52]=He,e[53]=Ge,e[54]=Qe):Qe=e[54];let Ke;e[55]!==Ot||e[56]!==Ae||e[57]!==Qe?(Ke=y.jsxs(O.Group,{gap:"xs",justify:Ot,align:"center",wrap:"wrap",children:[Ae,Qe]}),e[55]=Ot,e[56]=Ae,e[57]=Qe,e[58]=Ke):Ke=e[58];let rt;e[59]!==w||e[60]!==l||e[61]!==B?(rt=B&&B.length>0&&y.jsx(O.Tabs,{value:w,onChange:l,mt:"md",children:y.jsx(O.Tabs.List,{children:B.map(Bc)})}),e[59]=w,e[60]=l,e[61]=B,e[62]=rt):rt=e[62];let lt;e[63]!==Z?(lt=Z&&y.jsx(O.Alert,{mt:"md",variant:"light",color:"red",title:"Es ist ein Fehler aufgetreten.",icon:y.jsx(Je.IconInfoCircle,{}),children:"Bitte versuche es später erneut oder sende eine Nachricht an unseren Support."}),e[63]=Z,e[64]=lt):lt=e[64];let be;e[65]!==z||e[66]!==K?(be=(z||K)&&y.jsxs(O.Stack,{my:"md",children:[y.jsx(O.Skeleton,{height:40}),Array(5).fill(0).map(Lc)]}),e[65]=z,e[66]=K,e[67]=be):be=e[67];let Pe;e[68]!==G||e[69]!==oe||e[70]!==m||e[71]!==c||e[72]!==Z||e[73]!==z||e[74]!==K||e[75]!==Ye||e[76]!==re||e[77]!==V||e[78]!==W||e[79]!==A||e[80]!==_||e[81]!==fe||e[82]!==q||e[83]!==J||e[84]!==b||e[85]!==le||e[86]!==R||e[87]!==I||e[88]!==g?(Pe=!z&&!K&&y.jsxs(y.Fragment,{children:[y.jsx(O.Box,{...re?{visibleFrom:"sm"}:{},children:y.jsx(mc,{my:"md",striped:!0,highlightOnHover:!0,minHeight:150,fetching:Z,records:fe,sortStatus:I,onSortStatusChange:c,...b&&{selectedRecords:J,onSelectedRecordsChange:he},..._&&fe.length&&{totalRecords:g.length,recordsPerPage:A,onPageChange:le,page:W,recordsPerPageOptions:Mn,onRecordsPerPageChange:R,recordsPerPageLabel:"Einträge pro Seite"},...q&&{rowExpansion:{allowMultiple:q.allowMultiple??!1,content:we=>{const{record:ve}=we;return q.content(ve)},...q.expanded&&{expanded:q.expanded}}},columns:m.map(Nc),noRecordsText:"Keine Einträge gefunden",onRowClick:V,...V&&{style:{cursor:"pointer"}}})}),re&&y.jsx(O.Box,{hiddenFrom:"sm",children:y.jsx(Bs,{records:fe,fields:m,selection:b,selectedRecords:J,onSelectedRecordsChange:he,onRowClick:V,sort:{field:String(I.columnAccessor),direction:I.direction,onSortChange:(we,ve)=>{c({columnAccessor:we,direction:ve})}},..._&&fe.length&&{pagination:{totalRecords:g.length,recordsPerPage:A,page:W,onPageChange:le,recordsPerPageOptions:Mn,onRecordsPerPageChange:we=>{R(we),le(1)}}},...q&&{rowExpansion:{content:q.content}},...Ye.length>0&&{actions:Ye,canUpdate:oe,canDelete:G}})})]}),e[68]=G,e[69]=oe,e[70]=m,e[71]=c,e[72]=Z,e[73]=z,e[74]=K,e[75]=Ye,e[76]=re,e[77]=V,e[78]=W,e[79]=A,e[80]=_,e[81]=fe,e[82]=q,e[83]=J,e[84]=b,e[85]=le,e[86]=R,e[87]=I,e[88]=g,e[89]=Pe):Pe=e[89];let nt;e[90]===Symbol.for("react.memo_cache_sentinel")?(nt=()=>{Fe(!1),he([])},e[90]=nt):nt=e[90];const Ct=r??"Bearbeiten";let St;e[91]!==u||e[92]!==m||e[93]!==d||e[94]!==n||e[95]!==J[0]||e[96]!==J.length||e[97]!==S?(St=J.length>0&&y.jsx(Ts,{fields:m.filter(Rc),queryKey:n,apiPath:d??u,id:J[0].id,onClose:()=>{Fe(!1),he([])},steps:S}),e[91]=u,e[92]=m,e[93]=d,e[94]=n,e[95]=J[0],e[96]=J.length,e[97]=S,e[98]=St):St=e[98];let Dt;e[99]!==Ct||e[100]!==St||e[101]!==ke?(Dt=y.jsx(O.Modal,{opened:ke,onClose:nt,title:Ct,children:St}),e[99]=Ct,e[100]=St,e[101]=ke,e[102]=Dt):Dt=e[102];let kt;e[103]!==u||e[104]!==Re||e[105]!==d||e[106]!==n||e[107]!==J||e[108]!==r?(kt=J.length>0&&y.jsx(O.Modal,{opened:Re,onClose:()=>{De(!1),he([])},title:r??"Löschen",children:y.jsx($s,{onClose:()=>{De(!1),he([])},queryKey:n,apiPath:d??u,selectedRecords:J})}),e[103]=u,e[104]=Re,e[105]=d,e[106]=n,e[107]=J,e[108]=r,e[109]=kt):kt=e[109];let ut;e[110]===Symbol.for("react.memo_cache_sentinel")?(ut=()=>{Ce(!1)},e[110]=ut):ut=e[110];const er=r??"Anlegen",ft=d??u;let Lt;e[111]===Symbol.for("react.memo_cache_sentinel")?(Lt=()=>{Ce(!1)},e[111]=Lt):Lt=e[111];let ct;e[112]!==m?(ct=m.filter($c),e[112]=m,e[113]=ct):ct=e[113];let dt;e[114]!==n||e[115]!==S||e[116]!==ft||e[117]!==ct?(dt=y.jsx(bs,{queryKey:n,apiPath:ft,onClose:Lt,fields:ct,steps:S}),e[114]=n,e[115]=S,e[116]=ft,e[117]=ct,e[118]=dt):dt=e[118];let Ee;e[119]!==Se||e[120]!==er||e[121]!==dt?(Ee=y.jsx(O.Modal,{opened:Se,onClose:ut,title:er,children:dt}),e[119]=Se,e[120]=er,e[121]=dt,e[122]=Ee):Ee=e[122];let ht;return e[123]!==Ke||e[124]!==rt||e[125]!==lt||e[126]!==be||e[127]!==Pe||e[128]!==Dt||e[129]!==kt||e[130]!==Ee?(ht=y.jsxs(y.Fragment,{children:[Ke,rt,lt,be,Pe,Dt,kt,Ee]}),e[123]=Ke,e[124]=rt,e[125]=lt,e[126]=be,e[127]=Pe,e[128]=Dt,e[129]=kt,e[130]=Ee,e[131]=ht):ht=e[131],ht}function $c(t){return t.create}function Rc(t){return t.update}function Nc(t){return t.column}function Lc(t,e){return y.jsx(O.Skeleton,{height:35},`skeleton-${e}`)}function Bc(t){return y.jsx(O.Tabs.Tab,{value:t.value,leftSection:t.icon,children:t.label},t.value)}function Ic(t){return t.create}function Yc(t){return t.delete}function zc(t){return t.update}function Fc(t){return t.update}function Wc(t){return t.delete}function Uc(t){return t.update}function qc(t){const[e,r]=t;return`${e}=${encodeURIComponent(r??"")}`}function Vc(t){const[,e]=t;return e!=null}function Hc(t){const e=ze.c(5),{queryClient:r}=yt();let n;e[0]!==t?(n=y.jsx(Tc,{...t}),e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==r||e[3]!==n?(s=y.jsx(Xn,{client:r,children:n}),e[2]=r,e[3]=n,e[4]=s):s=e[4],s}_e.CreateModal=bs,_e.DataTable=Hc,_e.DataTableProvider=bl,_e.DeleteModal=$s,_e.MobileCardList=Bs,_e.UpdateModal=Ts,_e.api=_l,_e.createOne=Vo,_e.deleteOne=qo,_e.getAll=Wo,_e.getApiHeaders=Mt,_e.getOne=Uo,_e.sortData=Ls,_e.updateOne=Ho,_e.useAddOne=Ko,_e.useDataTable=yt,_e.useDeleteOne=Zo,_e.useGetAll=Qo,_e.useGetOne=Go,_e.usePersistentState=Rs,_e.useUpdateOne=hn,Object.defineProperty(_e,Symbol.toStringTag,{value:"Module"})}));
|
|
23
|
+
`+a,m(`data:${re(l)};charset=utf-8,${encodeURIComponent(a)}`,`${p}.svg`)}else m(f.toDataURL(re(l)),`${p}.${l}`)}}const x=k})(),u.default})())})(dn)),dn.exports}vl();const Wo=J.createContext(void 0);function bl(t){const e=Fe.c(9),{children:r,baseUrl:n,queryClient:s}=t;let u;e[0]!==n||e[1]!==s?(u={baseUrl:n,queryClient:s},e[0]=n,e[1]=s,e[2]=u):u=e[2];let d;e[3]!==r||e[4]!==s?(d=y.jsx(eo,{client:s,children:r}),e[3]=r,e[4]=s,e[5]=d):d=e[5];let i;return e[6]!==u||e[7]!==d?(i=y.jsx(Wo.Provider,{value:u,children:d}),e[6]=u,e[7]=d,e[8]=i):i=e[8],i}function mt(){const t=J.useContext(Wo);if(!t)throw new Error("useDataTable must be used within a DataTableProvider");return t}function hn(t){if(typeof t=="string")try{const e=JSON.parse(t);return{message:e.message||t,code:e.code,details:e.details}}catch{return{message:t}}return t instanceof Error?{message:t.message}:{message:"Unbekannter Fehler"}}async function Rt(t){const e=await t.text();if(!e)throw new Error(`HTTP ${t.status}: ${t.statusText}`);let r=null;try{r=JSON.parse(e)}catch{throw new Error(e)}throw r?.message?new Error(r.message):r?.error?new Error(r.error):new Error(e)}function wl(){const t=localStorage.getItem("a360.assumed-org");return t?{"X-Assume-Org":t}:{}}async function Mt(){return{"Content-Type":"application/json",Authorization:`Bearer ${await al()??""}`,...wl()}}async function Uo(t){return fetch(t,{method:"GET",headers:await Mt()}).then(async e=>(e.status>=400&&await Rt(e),e)).then(e=>e.json()).then(e=>e)}async function qo(t,e){return fetch(`${t}/${e}`,{method:"GET",headers:await Mt()}).then(async r=>(r.status>=400&&await Rt(r),r)).then(r=>r.json()).then(r=>r)}async function Vo(t,e){const r=await fetch(`${t}/${e}`,{method:"DELETE",headers:await Mt()});r.status>=400&&await Rt(r)}async function Ho(t,e){return fetch(t,{method:"POST",headers:await Mt(),body:JSON.stringify(e)}).then(async r=>(r.status>=400&&await Rt(r),r)).then(r=>r.status==204?e:r.json()).then(r=>r)}async function _l(t,e,r){return fetch(e,{method:t,headers:await Mt(),body:r?JSON.stringify(r):void 0}).then(async n=>(n.status>=400&&await Rt(n),n)).then(n=>{if(n.status!=204)return n.json()}).then(n=>n)}async function Go(t,e){return fetch(`${t}/${e.id}`,{method:"PUT",headers:await Mt(),body:JSON.stringify(e)}).then(async r=>(r.status>=400&&await Rt(r),r)).then(r=>r.status==204?e:r.json()).then(r=>r)}function Qo(t,e,r){const n=Fe.c(13),{baseUrl:s}=mt();let u;if(n[0]!==r||n[1]!==e){let b;n[3]!==r?(b=r?.toString(),n[3]=r,n[4]=b):b=n[4],u=[...e.map(xl),String(b)],n[0]=r,n[1]=e,n[2]=u}else u=n[2];let d;n[5]!==t||n[6]!==s||n[7]!==r?(d=()=>qo(`${s}${t}`,r),n[5]=t,n[6]=s,n[7]=r,n[8]=d):d=n[8];const i=!!r;let m;return n[9]!==u||n[10]!==d||n[11]!==i?(m={queryKey:u,queryFn:d,enabled:i},n[9]=u,n[10]=d,n[11]=i,n[12]=m):m=n[12],no(m)}function xl(t){return t.toString()}function Ko(t,e,r){const n=Fe.c(9),s=r===void 0?!0:r,{baseUrl:u}=mt();let d;n[0]!==e?(d=[...e.map(Cl)],n[0]=e,n[1]=d):d=n[1];let i;n[2]!==t||n[3]!==u?(i=()=>Uo(`${u}${t}`),n[2]=t,n[3]=u,n[4]=i):i=n[4];let m;return n[5]!==s||n[6]!==d||n[7]!==i?(m={queryKey:d,queryFn:i,enabled:s},n[5]=s,n[6]=d,n[7]=i,n[8]=m):m=n[8],no(m)}function Cl(t){return t.toString()}function Zo(t,e){const r=Fe.c(10),{baseUrl:n,queryClient:s}=mt();let u;r[0]!==e?(u=[...e.map(Dl)],r[0]=e,r[1]=u):u=r[1];let d;r[2]!==t||r[3]!==n?(d=m=>Ho(`${n}${t}`,m),r[2]=t,r[3]=n,r[4]=d):d=r[4];let i;return r[5]!==s||r[6]!==e||r[7]!==u||r[8]!==d?(i={mutationKey:u,mutationFn:d,onSettled(){return s.invalidateQueries({queryKey:[...e.map(Sl)]})},onError(m){hn(m)}},r[5]=s,r[6]=e,r[7]=u,r[8]=d,r[9]=i):i=r[9],qr(i)}function Sl(t){return t.toString()}function Dl(t){return t.toString()}function fn(t,e){const r=Fe.c(10),{baseUrl:n,queryClient:s}=mt();let u;r[0]!==e?(u=[...e.map(Pl)],r[0]=e,r[1]=u):u=r[1];let d;r[2]!==t||r[3]!==n?(d=m=>Go(`${n}${t}`,m),r[2]=t,r[3]=n,r[4]=d):d=r[4];let i;return r[5]!==s||r[6]!==e||r[7]!==u||r[8]!==d?(i={mutationKey:u,mutationFn:d,onSettled(){return s.invalidateQueries({queryKey:[...e.map(kl)]})},onError(m){hn(m)}},r[5]=s,r[6]=e,r[7]=u,r[8]=d,r[9]=i):i=r[9],qr(i)}function kl(t){return t.toString()}function Pl(t){return t.toString()}function Jo(t,e){const r=Fe.c(10),{baseUrl:n,queryClient:s}=mt();let u;r[0]!==e?(u=[...e.map(Ol)],r[0]=e,r[1]=u):u=r[1];let d;r[2]!==t||r[3]!==n?(d=m=>Vo(`${n}${t}`,m),r[2]=t,r[3]=n,r[4]=d):d=r[4];let i;return r[5]!==s||r[6]!==e||r[7]!==u||r[8]!==d?(i={mutationKey:u,mutationFn:d,onSettled(){return s.invalidateQueries({queryKey:[...e.map(Ml)]})},onError(m){hn(m)}},r[5]=s,r[6]=e,r[7]=u,r[8]=d,r[9]=i):i=r[9],qr(i)}function Ml(t){return t.toString()}function Ol(t){return t.toString()}var yr={exports:{}},jl=yr.exports,Xo;function Al(){return Xo||(Xo=1,(function(t,e){(function(r,n){t.exports=n()})(jl,(function(){var r=1e3,n=6e4,s=36e5,u="millisecond",d="second",i="minute",m="hour",b="day",_="week",M="month",C="quarter",S="year",P="date",j="Invalid Date",N=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,F=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,B={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(k){var x=["th","st","nd","rd"],w=k%100;return"["+k+(x[(w-20)%10]||x[w]||x[0])+"]"}},K=function(k,x,w){var h=String(k);return!h||h.length>=x?k:""+Array(x+1-h.length).join(w)+k},q={s:K,z:function(k){var x=-k.utcOffset(),w=Math.abs(x),h=Math.floor(w/60),l=w%60;return(x<=0?"+":"-")+K(h,2,"0")+":"+K(l,2,"0")},m:function k(x,w){if(x.date()<w.date())return-k(w,x);var h=12*(w.year()-x.year())+(w.month()-x.month()),l=x.clone().add(h,M),p=w-l<0,f=x.clone().add(h+(p?-1:1),M);return+(-(h+(w-l)/(p?l-f:f-l))||0)},a:function(k){return k<0?Math.ceil(k)||0:Math.floor(k)},p:function(k){return{M,y:S,w:_,d:b,D:P,h:m,m:i,s:d,ms:u,Q:C}[k]||String(k||"").toLowerCase().replace(/s$/,"")},u:function(k){return k===void 0}},te="en",ne={};ne[te]=B;var G="$isDayjsObject",ee=function(k){return k instanceof ie||!(!k||!k[G])},V=function k(x,w,h){var l;if(!x)return te;if(typeof x=="string"){var p=x.toLowerCase();ne[p]&&(l=p),w&&(ne[p]=w,l=p);var f=x.split("-");if(!l&&f.length>1)return k(f[0])}else{var a=x.name;ne[a]=x,l=a}return!h&&l&&(te=l),l||!h&&te},H=function(k,x){if(ee(k))return k.clone();var w=typeof x=="object"?x:{};return w.date=k,w.args=arguments,new ie(w)},X=q;X.l=V,X.i=ee,X.w=function(k,x){return H(k,{locale:x.$L,utc:x.$u,x:x.$x,$offset:x.$offset})};var ie=(function(){function k(w){this.$L=V(w.locale,null,!0),this.parse(w),this.$x=this.$x||w.x||{},this[G]=!0}var x=k.prototype;return x.parse=function(w){this.$d=(function(h){var l=h.date,p=h.utc;if(l===null)return new Date(NaN);if(X.u(l))return new Date;if(l instanceof Date)return new Date(l);if(typeof l=="string"&&!/Z$/i.test(l)){var f=l.match(N);if(f){var a=f[2]-1||0,v=(f[7]||"0").substring(0,3);return p?new Date(Date.UTC(f[1],a,f[3]||1,f[4]||0,f[5]||0,f[6]||0,v)):new Date(f[1],a,f[3]||1,f[4]||0,f[5]||0,f[6]||0,v)}}return new Date(l)})(w),this.init()},x.init=function(){var w=this.$d;this.$y=w.getFullYear(),this.$M=w.getMonth(),this.$D=w.getDate(),this.$W=w.getDay(),this.$H=w.getHours(),this.$m=w.getMinutes(),this.$s=w.getSeconds(),this.$ms=w.getMilliseconds()},x.$utils=function(){return X},x.isValid=function(){return this.$d.toString()!==j},x.isSame=function(w,h){var l=H(w);return this.startOf(h)<=l&&l<=this.endOf(h)},x.isAfter=function(w,h){return H(w)<this.startOf(h)},x.isBefore=function(w,h){return this.endOf(h)<H(w)},x.$g=function(w,h,l){return X.u(w)?this[h]:this.set(l,w)},x.unix=function(){return Math.floor(this.valueOf()/1e3)},x.valueOf=function(){return this.$d.getTime()},x.startOf=function(w,h){var l=this,p=!!X.u(h)||h,f=X.p(w),a=function(ae,se){var ue=X.w(l.$u?Date.UTC(l.$y,se,ae):new Date(l.$y,se,ae),l);return p?ue:ue.endOf(b)},v=function(ae,se){return X.w(l.toDate()[ae].apply(l.toDate("s"),(p?[0,0,0,0]:[23,59,59,999]).slice(se)),l)},D=this.$W,T=this.$M,z=this.$D,Q="set"+(this.$u?"UTC":"");switch(f){case S:return p?a(1,0):a(31,11);case M:return p?a(1,T):a(0,T+1);case _:var Z=this.$locale().weekStart||0,U=(D<Z?D+7:D)-Z;return a(p?z-U:z+(6-U),T);case b:case P:return v(Q+"Hours",0);case m:return v(Q+"Minutes",1);case i:return v(Q+"Seconds",2);case d:return v(Q+"Milliseconds",3);default:return this.clone()}},x.endOf=function(w){return this.startOf(w,!1)},x.$set=function(w,h){var l,p=X.p(w),f="set"+(this.$u?"UTC":""),a=(l={},l[b]=f+"Date",l[P]=f+"Date",l[M]=f+"Month",l[S]=f+"FullYear",l[m]=f+"Hours",l[i]=f+"Minutes",l[d]=f+"Seconds",l[u]=f+"Milliseconds",l)[p],v=p===b?this.$D+(h-this.$W):h;if(p===M||p===S){var D=this.clone().set(P,1);D.$d[a](v),D.init(),this.$d=D.set(P,Math.min(this.$D,D.daysInMonth())).$d}else a&&this.$d[a](v);return this.init(),this},x.set=function(w,h){return this.clone().$set(w,h)},x.get=function(w){return this[X.p(w)]()},x.add=function(w,h){var l,p=this;w=Number(w);var f=X.p(h),a=function(T){var z=H(p);return X.w(z.date(z.date()+Math.round(T*w)),p)};if(f===M)return this.set(M,this.$M+w);if(f===S)return this.set(S,this.$y+w);if(f===b)return a(1);if(f===_)return a(7);var v=(l={},l[i]=n,l[m]=s,l[d]=r,l)[f]||1,D=this.$d.getTime()+w*v;return X.w(D,this)},x.subtract=function(w,h){return this.add(-1*w,h)},x.format=function(w){var h=this,l=this.$locale();if(!this.isValid())return l.invalidDate||j;var p=w||"YYYY-MM-DDTHH:mm:ssZ",f=X.z(this),a=this.$H,v=this.$m,D=this.$M,T=l.weekdays,z=l.months,Q=l.meridiem,Z=function(se,ue,E,L){return se&&(se[ue]||se(h,p))||E[ue].slice(0,L)},U=function(se){return X.s(a%12||12,se,"0")},ae=Q||function(se,ue,E){var L=se<12?"AM":"PM";return E?L.toLowerCase():L};return p.replace(F,(function(se,ue){return ue||(function(E){switch(E){case"YY":return String(h.$y).slice(-2);case"YYYY":return X.s(h.$y,4,"0");case"M":return D+1;case"MM":return X.s(D+1,2,"0");case"MMM":return Z(l.monthsShort,D,z,3);case"MMMM":return Z(z,D);case"D":return h.$D;case"DD":return X.s(h.$D,2,"0");case"d":return String(h.$W);case"dd":return Z(l.weekdaysMin,h.$W,T,2);case"ddd":return Z(l.weekdaysShort,h.$W,T,3);case"dddd":return T[h.$W];case"H":return String(a);case"HH":return X.s(a,2,"0");case"h":return U(1);case"hh":return U(2);case"a":return ae(a,v,!0);case"A":return ae(a,v,!1);case"m":return String(v);case"mm":return X.s(v,2,"0");case"s":return String(h.$s);case"ss":return X.s(h.$s,2,"0");case"SSS":return X.s(h.$ms,3,"0");case"Z":return f}return null})(se)||f.replace(":","")}))},x.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},x.diff=function(w,h,l){var p,f=this,a=X.p(h),v=H(w),D=(v.utcOffset()-this.utcOffset())*n,T=this-v,z=function(){return X.m(f,v)};switch(a){case S:p=z()/12;break;case M:p=z();break;case C:p=z()/3;break;case _:p=(T-D)/6048e5;break;case b:p=(T-D)/864e5;break;case m:p=T/s;break;case i:p=T/n;break;case d:p=T/r;break;default:p=T}return l?p:X.a(p)},x.daysInMonth=function(){return this.endOf(M).$D},x.$locale=function(){return ne[this.$L]},x.locale=function(w,h){if(!w)return this.$L;var l=this.clone(),p=V(w,h,!0);return p&&(l.$L=p),l},x.clone=function(){return X.w(this.$d,this)},x.toDate=function(){return new Date(this.valueOf())},x.toJSON=function(){return this.isValid()?this.toISOString():null},x.toISOString=function(){return this.$d.toISOString()},x.toString=function(){return this.$d.toUTCString()},k})(),re=ie.prototype;return H.prototype=re,[["$ms",u],["$s",d],["$m",i],["$H",m],["$W",b],["$M",M],["$y",S],["$D",P]].forEach((function(k){re[k[1]]=function(x){return this.$g(x,k[0],k[1])}})),H.extend=function(k,x){return k.$i||(k(x,ie,H),k.$i=!0),H},H.locale=V,H.isDayjs=ee,H.unix=function(k){return H(1e3*k)},H.en=ne[te],H.Ls=ne,H.p={},H}))})(yr)),yr.exports}var El=Al();const he=Nn(El);function Tl({direction:t,levelIndex:e,rowIndex:r,cellIndex:n,size:s}){switch(t){case"up":return e===0&&r===0?null:r===0?{levelIndex:e-1,rowIndex:n<=s[e-1][s[e-1].length-1]-1?s[e-1].length-1:s[e-1].length-2,cellIndex:n}:{levelIndex:e,rowIndex:r-1,cellIndex:n};case"down":return r===s[e].length-1?{levelIndex:e+1,rowIndex:0,cellIndex:n}:r===s[e].length-2&&n>=s[e][s[e].length-1]?{levelIndex:e+1,rowIndex:0,cellIndex:n}:{levelIndex:e,rowIndex:r+1,cellIndex:n};case"left":return e===0&&r===0&&n===0?null:r===0&&n===0?{levelIndex:e-1,rowIndex:s[e-1].length-1,cellIndex:s[e-1][s[e-1].length-1]-1}:n===0?{levelIndex:e,rowIndex:r-1,cellIndex:s[e][r-1]-1}:{levelIndex:e,rowIndex:r,cellIndex:n-1};case"right":return r===s[e].length-1&&n===s[e][r]-1?{levelIndex:e+1,rowIndex:0,cellIndex:0}:n===s[e][r]-1?{levelIndex:e,rowIndex:r+1,cellIndex:0}:{levelIndex:e,rowIndex:r,cellIndex:n+1};default:return{levelIndex:e,rowIndex:r,cellIndex:n}}}function es({controlsRef:t,direction:e,levelIndex:r,rowIndex:n,cellIndex:s,size:u}){const d=Tl({direction:e,size:u,rowIndex:n,cellIndex:s,levelIndex:r});if(!d)return;const i=t.current?.[d.levelIndex]?.[d.rowIndex]?.[d.cellIndex];i&&(i.disabled||i.getAttribute("data-hidden")||i.getAttribute("data-outside")?es({controlsRef:t,direction:e,levelIndex:d.levelIndex,cellIndex:d.cellIndex,rowIndex:d.rowIndex,size:u}):i.focus())}function $l(t){switch(t){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function Rl(t){return t.current?.map(e=>e.map(r=>r.length))}function pn({controlsRef:t,levelIndex:e,rowIndex:r,cellIndex:n,event:s}){const u=$l(s.key);if(u){s.preventDefault();const d=Rl(t);es({controlsRef:t,direction:u,levelIndex:e,rowIndex:r,cellIndex:n,size:d})}}function Ge(t){return t==null||t===""?t:he(t).format("YYYY-MM-DD")}function ts(t){return t==null||t===""?t:he(t).format("YYYY-MM-DD HH:mm:ss")}const Nl={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},Ll=J.createContext(Nl);function yt(){const t=J.useContext(Ll),e=J.useCallback(u=>u||t.locale,[t.locale]),r=J.useCallback(u=>typeof u=="number"?u:t.firstDayOfWeek,[t.firstDayOfWeek]),n=J.useCallback(u=>Array.isArray(u)?u:t.weekendDays,[t.weekendDays]),s=J.useCallback(u=>typeof u=="string"?u:t.labelSeparator,[t.labelSeparator]);return{...t,getLocale:e,getFirstDayOfWeek:r,getWeekendDays:n,getLabelSeparator:s}}function Bl({value:t,type:e,withTime:r}){const n=r?ts:Ge;if(e==="range"&&Array.isArray(t)){const s=n(t[0]),u=n(t[1]);return s?u?`${s} – ${u}`:`${s} –`:""}return e==="multiple"&&Array.isArray(t)?t.filter(Boolean).join(", "):!Array.isArray(t)&&t?n(t):""}function rs({value:t,type:e,name:r,form:n,withTime:s=!1}){return y.jsx("input",{type:"hidden",value:Bl({value:t,type:e,withTime:s}),name:r,form:n})}rs.displayName="@mantine/dates/HiddenDatesInput";function ns(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(r=ns(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Oe(){for(var t,e,r=0,n="",s=arguments.length;r<s;r++)(t=arguments[r])&&(e=ns(t))&&(n&&(n+=" "),n+=e);return n}var os={day:"m_396ce5cb"};const Il=O.createVarsResolver((t,{size:e})=>({day:{"--day-size":O.getSize(e,"day-size")}})),gn=O.factory((t,e)=>{const r=O.useProps("Day",null,t),{classNames:n,className:s,style:u,styles:d,unstyled:i,vars:m,date:b,disabled:_,__staticSelector:M,weekend:C,outside:S,selected:P,renderDay:j,inRange:N,firstInRange:F,lastInRange:B,hidden:K,static:q,highlightToday:te,attributes:ne,...G}=r,ee=O.useStyles({name:M||"Day",classes:os,props:r,className:s,style:u,classNames:n,styles:d,unstyled:i,attributes:ne,vars:m,varsResolver:Il,rootSelector:"day"});return y.jsx(O.UnstyledButton,{...ee("day",{style:K?{display:"none"}:void 0}),component:q?"div":"button",ref:e,disabled:_,"data-today":he(b).isSame(new Date,"day")||void 0,"data-hidden":K||void 0,"data-highlight-today":te||void 0,"data-disabled":_||void 0,"data-weekend":!_&&!S&&C||void 0,"data-outside":!_&&S||void 0,"data-selected":!_&&P||void 0,"data-in-range":N&&!_||void 0,"data-first-in-range":F&&!_||void 0,"data-last-in-range":B&&!_||void 0,"data-static":q||void 0,unstyled:i,...G,children:j?.(b)||he(b).date()})});gn.classes=os,gn.displayName="@mantine/dates/Day";function Yl({locale:t,format:e="dd",firstDayOfWeek:r=1}){const n=he().day(r),s=[];for(let u=0;u<7;u+=1)typeof e=="string"?s.push(he(n).add(u,"days").locale(t).format(e)):s.push(e(he(n).add(u,"days").format("YYYY-MM-DD")));return s}var ss={weekday:"m_18a3eca"};const zl=O.createVarsResolver((t,{size:e})=>({weekdaysRow:{"--wr-fz":O.getFontSize(e),"--wr-spacing":O.getSpacing(e)}})),mn=O.factory((t,e)=>{const r=O.useProps("WeekdaysRow",null,t),{classNames:n,className:s,style:u,styles:d,unstyled:i,vars:m,locale:b,firstDayOfWeek:_,weekdayFormat:M,cellComponent:C="th",__staticSelector:S,withWeekNumbers:P,attributes:j,...N}=r,F=O.useStyles({name:S||"WeekdaysRow",classes:ss,props:r,className:s,style:u,classNames:n,styles:d,unstyled:i,attributes:j,vars:m,varsResolver:zl,rootSelector:"weekdaysRow"}),B=yt(),K=Yl({locale:B.getLocale(b),format:M,firstDayOfWeek:B.getFirstDayOfWeek(_)}).map((q,te)=>y.jsx(C,{...F("weekday"),children:q},te));return y.jsxs(O.Box,{component:"tr",ref:e,...F("weekdaysRow"),...N,children:[P&&y.jsx(C,{...F("weekday"),children:"#"}),K]})});mn.classes=ss,mn.displayName="@mantine/dates/WeekdaysRow";function Fl(t,e=1){let r=he(t);if(!r.isValid())return r;const n=e===0?6:e-1;for(;r.day()!==n;)r=r.add(1,"day");return r.format("YYYY-MM-DD")}function Wl(t,e=1){let r=he(t);for(;r.day()!==e;)r=r.subtract(1,"day");return r.format("YYYY-MM-DD")}function Ul({month:t,firstDayOfWeek:e=1,consistentWeeks:r}){const n=he(t).subtract(he(t).date()-1,"day"),s=he(n.format("YYYY-M-D")),u=s.format("YYYY-MM-DD"),d=s.add(+s.daysInMonth()-1,"day").format("YYYY-MM-DD"),i=Fl(d,e),m=[];let b=he(Wl(u,e));for(;he(b).isBefore(i,"day");){const _=[];for(let M=0;M<7;M+=1)_.push(b.format("YYYY-MM-DD")),b=b.add(1,"day");m.push(_)}if(r&&m.length<6){const _=m[m.length-1],M=_[_.length-1];let C=he(M).add(1,"day");for(;m.length<6;){const S=[];for(let P=0;P<7;P+=1)S.push(C.format("YYYY-MM-DD")),C=C.add(1,"day");m.push(S)}}return m}function yn(t,e){return he(t).format("YYYY-MM")===he(e).format("YYYY-MM")}function is(t,e){return e?he(t).isAfter(he(e).subtract(1,"day"),"day"):!0}function as(t,e){return e?he(t).isBefore(he(e).add(1,"day"),"day"):!0}function ql({dates:t,minDate:e,maxDate:r,getDayProps:n,excludeDate:s,hideOutsideDates:u,month:d}){const i=t.flat().filter(_=>as(_,r)&&is(_,e)&&!s?.(_)&&!n?.(_)?.disabled&&(!u||yn(_,d))),m=i.find(_=>n?.(_)?.selected);if(m)return m;const b=i.find(_=>he().isSame(_,"date"));return b||i[0]}var vr={exports:{}},Vl=vr.exports,ls;function Hl(){return ls||(ls=1,(function(t,e){(function(r,n){t.exports=n()})(Vl,(function(){var r="day";return function(n,s,u){var d=function(b){return b.add(4-b.isoWeekday(),r)},i=s.prototype;i.isoWeekYear=function(){return d(this).year()},i.isoWeek=function(b){if(!this.$utils().u(b))return this.add(7*(b-this.isoWeek()),r);var _,M,C,S,P=d(this),j=(_=this.isoWeekYear(),M=this.$u,C=(M?u.utc:u)().year(_).startOf("year"),S=4-C.isoWeekday(),C.isoWeekday()>4&&(S+=7),C.add(S,r));return P.diff(j,"week")+1},i.isoWeekday=function(b){return this.$utils().u(b)?this.day()||7:this.day(this.day()%7?b:b-7)};var m=i.startOf;i.startOf=function(b,_){var M=this.$utils(),C=!!M.u(_)||_;return M.p(b)==="isoweek"?C?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):m.bind(this)(b,_)}}}))})(vr)),vr.exports}var Gl=Hl();const Ql=Nn(Gl);he.extend(Ql);function Kl(t){const e=t.find(r=>he(r).day()===1);return he(e).isoWeek()}var us={month:"m_cc9820d3",monthCell:"m_8f457cd5",weekNumber:"m_6cff9dea"};const Zl={withCellSpacing:!0},Jl=O.createVarsResolver((t,{size:e})=>({weekNumber:{"--wn-fz":O.getFontSize(e),"--wn-size":O.getSize(e,"wn-size")}})),br=O.factory((t,e)=>{const r=O.useProps("Month",Zl,t),{classNames:n,className:s,style:u,styles:d,unstyled:i,vars:m,__staticSelector:b,locale:_,firstDayOfWeek:M,weekdayFormat:C,month:S,weekendDays:P,getDayProps:j,excludeDate:N,minDate:F,maxDate:B,renderDay:K,hideOutsideDates:q,hideWeekdays:te,getDayAriaLabel:ne,static:G,__getDayRef:ee,__onDayKeyDown:V,__onDayClick:H,__onDayMouseEnter:X,__preventFocus:ie,__stopPropagation:re,withCellSpacing:k,size:x,highlightToday:w,withWeekNumbers:h,attributes:l,...p}=r,f=O.useStyles({name:b||"Month",classes:us,props:r,className:s,style:u,classNames:n,styles:d,unstyled:i,attributes:l,vars:m,varsResolver:Jl,rootSelector:"month"}),a=yt(),v=Ul({month:S,firstDayOfWeek:a.getFirstDayOfWeek(M),consistentWeeks:a.consistentWeeks}),D=ql({dates:v,minDate:Ge(F),maxDate:Ge(B),getDayProps:j,excludeDate:N,hideOutsideDates:q,month:S}),{resolvedClassNames:T,resolvedStyles:z}=O.useResolvedStylesApi({classNames:n,styles:d,props:r}),Q=v.map((Z,U)=>{const ae=Z.map((se,ue)=>{const E=!yn(se,S),L=ne?.(se)||he(se).locale(_||a.locale).format("D MMMM YYYY"),$=j?.(se),I=he(se).isSame(D,"date");return y.jsx("td",{...f("monthCell"),"data-with-spacing":k||void 0,children:y.jsx(gn,{__staticSelector:b||"Month",classNames:T,styles:z,unstyled:i,"data-mantine-stop-propagation":re||void 0,highlightToday:w,renderDay:K,date:se,size:x,weekend:a.getWeekendDays(P).includes(he(se).get("day")),outside:E,hidden:q?E:!1,"aria-label":L,static:G,disabled:N?.(se)||!as(se,Ge(B))||!is(se,Ge(F)),ref:Y=>{Y&&ee?.(U,ue,Y)},...$,onKeyDown:Y=>{$?.onKeyDown?.(Y),V?.(Y,{rowIndex:U,cellIndex:ue,date:se})},onMouseEnter:Y=>{$?.onMouseEnter?.(Y),X?.(Y,se)},onClick:Y=>{$?.onClick?.(Y),H?.(Y,se)},onMouseDown:Y=>{$?.onMouseDown?.(Y),ie&&Y.preventDefault()},tabIndex:ie||!I?-1:0})},se.toString())});return y.jsxs("tr",{...f("monthRow"),children:[h&&y.jsx("td",{...f("weekNumber"),children:Kl(Z)}),ae]},U)});return y.jsxs(O.Box,{component:"table",...f("month"),size:x,ref:e,...p,children:[!te&&y.jsx("thead",{...f("monthThead"),children:y.jsx(mn,{__staticSelector:b||"Month",locale:_,firstDayOfWeek:M,weekdayFormat:C,size:x,classNames:T,styles:z,unstyled:i,withWeekNumbers:h})}),y.jsx("tbody",{...f("monthTbody"),children:Q})]})});br.classes=us,br.displayName="@mantine/dates/Month";var cs={pickerControl:"m_dc6a3c71"};const Xl=O.createVarsResolver((t,{size:e})=>({pickerControl:{"--dpc-fz":O.getFontSize(e),"--dpc-size":O.getSize(e,"dpc-size")}})),wr=O.factory((t,e)=>{const r=O.useProps("PickerControl",null,t),{classNames:n,className:s,style:u,styles:d,unstyled:i,vars:m,firstInRange:b,lastInRange:_,inRange:M,__staticSelector:C,selected:S,disabled:P,attributes:j,...N}=r,F=O.useStyles({name:C||"PickerControl",classes:cs,props:r,className:s,style:u,classNames:n,styles:d,unstyled:i,attributes:j,vars:m,varsResolver:Xl,rootSelector:"pickerControl"});return y.jsx(O.UnstyledButton,{...F("pickerControl"),ref:e,unstyled:i,"data-picker-control":!0,"data-selected":S&&!P||void 0,"data-disabled":P||void 0,"data-in-range":M&&!P&&!S||void 0,"data-first-in-range":b&&!P||void 0,"data-last-in-range":_&&!P||void 0,disabled:P,...N})});wr.classes=cs,wr.displayName="@mantine/dates/PickerControl";function ds({year:t,minDate:e,maxDate:r}){return!e&&!r?!1:!!(e&&he(t).isBefore(e,"year")||r&&he(t).isAfter(r,"year"))}function eu({years:t,minDate:e,maxDate:r,getYearControlProps:n}){const s=t.flat().filter(i=>!ds({year:i,minDate:e,maxDate:r})&&!n?.(i)?.disabled),u=s.find(i=>n?.(i)?.selected);if(u)return u;const d=s.find(i=>he().isSame(i,"year"));return d||s[0]}function hs(t){const e=he(t).year(),r=e-e%10;let n=0;const s=[[],[],[],[]];for(let u=0;u<4;u+=1){const d=u===3?1:3;for(let i=0;i<d;i+=1)s[u].push(he(new Date(r+n,0)).format("YYYY-MM-DD")),n+=1}return s}var fs={yearsList:"m_9206547b",yearsListCell:"m_c5a19c7d"};const tu={yearsListFormat:"YYYY",withCellSpacing:!0},_r=O.factory((t,e)=>{const r=O.useProps("YearsList",tu,t),{classNames:n,className:s,style:u,styles:d,unstyled:i,vars:m,decade:b,yearsListFormat:_,locale:M,minDate:C,maxDate:S,getYearControlProps:P,__staticSelector:j,__getControlRef:N,__onControlKeyDown:F,__onControlClick:B,__onControlMouseEnter:K,__preventFocus:q,__stopPropagation:te,withCellSpacing:ne,size:G,attributes:ee,...V}=r,H=O.useStyles({name:j||"YearsList",classes:fs,props:r,className:s,style:u,classNames:n,styles:d,unstyled:i,attributes:ee,vars:m,rootSelector:"yearsList"}),X=yt(),ie=hs(b),re=eu({years:ie,minDate:C,maxDate:S,getYearControlProps:P}),k=ie.map((x,w)=>{const h=x.map((l,p)=>{const f=P?.(l),a=he(l).isSame(re,"year");return y.jsx("td",{...H("yearsListCell"),"data-with-spacing":ne||void 0,children:y.jsx(wr,{...H("yearsListControl"),size:G,unstyled:i,"data-mantine-stop-propagation":te||void 0,disabled:ds({year:l,minDate:C,maxDate:S}),ref:v=>{v&&N?.(w,p,v)},...f,onKeyDown:v=>{f?.onKeyDown?.(v),F?.(v,{rowIndex:w,cellIndex:p,date:l})},onClick:v=>{f?.onClick?.(v),B?.(v,l)},onMouseEnter:v=>{f?.onMouseEnter?.(v),K?.(v,l)},onMouseDown:v=>{f?.onMouseDown?.(v),q&&v.preventDefault()},tabIndex:q||!a?-1:0,children:he(l).locale(X.getLocale(M)).format(_)})},p)});return y.jsx("tr",{...H("yearsListRow"),children:h},w)});return y.jsx(O.Box,{component:"table",ref:e,size:G,...H("yearsList"),...V,children:y.jsx("tbody",{children:k})})});_r.classes=fs,_r.displayName="@mantine/dates/YearsList";function ps({month:t,minDate:e,maxDate:r}){return!e&&!r?!1:!!(e&&he(t).isBefore(e,"month")||r&&he(t).isAfter(r,"month"))}function ru({months:t,minDate:e,maxDate:r,getMonthControlProps:n}){const s=t.flat().filter(i=>!ps({month:i,minDate:e,maxDate:r})&&!n?.(i)?.disabled),u=s.find(i=>n?.(i)?.selected);if(u)return u;const d=s.find(i=>he().isSame(i,"month"));return d||s[0]}function nu(t){const e=he(t).startOf("year").toDate(),r=[[],[],[],[]];let n=0;for(let s=0;s<4;s+=1)for(let u=0;u<3;u+=1)r[s].push(he(e).add(n,"months").format("YYYY-MM-DD")),n+=1;return r}var gs={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const ou={monthsListFormat:"MMM",withCellSpacing:!0},xr=O.factory((t,e)=>{const r=O.useProps("MonthsList",ou,t),{classNames:n,className:s,style:u,styles:d,unstyled:i,vars:m,__staticSelector:b,year:_,monthsListFormat:M,locale:C,minDate:S,maxDate:P,getMonthControlProps:j,__getControlRef:N,__onControlKeyDown:F,__onControlClick:B,__onControlMouseEnter:K,__preventFocus:q,__stopPropagation:te,withCellSpacing:ne,size:G,attributes:ee,...V}=r,H=O.useStyles({name:b||"MonthsList",classes:gs,props:r,className:s,style:u,classNames:n,styles:d,unstyled:i,attributes:ee,vars:m,rootSelector:"monthsList"}),X=yt(),ie=nu(_),re=ru({months:ie,minDate:Ge(S),maxDate:Ge(P),getMonthControlProps:j}),k=ie.map((x,w)=>{const h=x.map((l,p)=>{const f=j?.(l),a=he(l).isSame(re,"month");return y.jsx("td",{...H("monthsListCell"),"data-with-spacing":ne||void 0,children:y.jsx(wr,{...H("monthsListControl"),size:G,unstyled:i,__staticSelector:b||"MonthsList","data-mantine-stop-propagation":te||void 0,disabled:ps({month:l,minDate:Ge(S),maxDate:Ge(P)}),ref:v=>{v&&N?.(w,p,v)},...f,onKeyDown:v=>{f?.onKeyDown?.(v),F?.(v,{rowIndex:w,cellIndex:p,date:l})},onClick:v=>{f?.onClick?.(v),B?.(v,l)},onMouseEnter:v=>{f?.onMouseEnter?.(v),K?.(v,l)},onMouseDown:v=>{f?.onMouseDown?.(v),q&&v.preventDefault()},tabIndex:q||!a?-1:0,children:he(l).locale(X.getLocale(C)).format(M)})},p)});return y.jsx("tr",{...H("monthsListRow"),children:h},w)});return y.jsx(O.Box,{component:"table",ref:e,size:G,...H("monthsList"),...V,children:y.jsx("tbody",{children:k})})});xr.classes=gs,xr.displayName="@mantine/dates/MonthsList";var ms={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderControlIcon:"m_367dc749"};const su={hasNextLevel:!0,withNext:!0,withPrevious:!0,headerControlsOrder:["previous","level","next"]},iu=O.createVarsResolver((t,{size:e})=>({calendarHeader:{"--dch-control-size":O.getSize(e,"dch-control-size"),"--dch-fz":O.getFontSize(e)}})),vt=O.factory((t,e)=>{const r=O.useProps("CalendarHeader",su,t),{classNames:n,className:s,style:u,styles:d,unstyled:i,vars:m,nextIcon:b,previousIcon:_,nextLabel:M,previousLabel:C,onNext:S,onPrevious:P,onLevelClick:j,label:N,nextDisabled:F,previousDisabled:B,hasNextLevel:K,levelControlAriaLabel:q,withNext:te,withPrevious:ne,headerControlsOrder:G,__staticSelector:ee,__preventFocus:V,__stopPropagation:H,attributes:X,...ie}=r,re=O.useStyles({name:ee||"CalendarHeader",classes:ms,props:r,className:s,style:u,classNames:n,styles:d,unstyled:i,attributes:X,vars:m,varsResolver:iu,rootSelector:"calendarHeader"}),k=V?p=>p.preventDefault():void 0,x=ne&&J.createElement(O.UnstyledButton,{...re("calendarHeaderControl"),key:"previous","data-direction":"previous","aria-label":C,onClick:P,unstyled:i,onMouseDown:k,disabled:B,"data-disabled":B||void 0,tabIndex:V||B?-1:0,"data-mantine-stop-propagation":H||void 0},_||y.jsx(O.AccordionChevron,{...re("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})),w=J.createElement(O.UnstyledButton,{component:K?"button":"div",...re("calendarHeaderLevel"),key:"level",onClick:K?j:void 0,unstyled:i,onMouseDown:K?k:void 0,disabled:!K,"data-static":!K||void 0,"aria-label":q,tabIndex:V||!K?-1:0,"data-mantine-stop-propagation":H||void 0},N),h=te&&J.createElement(O.UnstyledButton,{...re("calendarHeaderControl"),key:"next","data-direction":"next","aria-label":M,onClick:S,unstyled:i,onMouseDown:k,disabled:F,"data-disabled":F||void 0,tabIndex:V||F?-1:0,"data-mantine-stop-propagation":H||void 0},b||y.jsx(O.AccordionChevron,{...re("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})),l=G.map(p=>p==="previous"?x:p==="level"?w:p==="next"?h:null);return y.jsx(O.Box,{...re("calendarHeader"),ref:e,...ie,children:l})});vt.classes=ms,vt.displayName="@mantine/dates/CalendarHeader";function au(t){const e=hs(t);return[e[0][0],e[3][0]]}const lu={decadeLabelFormat:"YYYY"},Cr=O.factory((t,e)=>{const r=O.useProps("DecadeLevel",lu,t),{decade:n,locale:s,minDate:u,maxDate:d,yearsListFormat:i,getYearControlProps:m,__getControlRef:b,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:C,withCellSpacing:S,__preventFocus:P,nextIcon:j,previousIcon:N,nextLabel:F,previousLabel:B,onNext:K,onPrevious:q,nextDisabled:te,previousDisabled:ne,levelControlAriaLabel:G,withNext:ee,withPrevious:V,headerControlsOrder:H,decadeLabelFormat:X,classNames:ie,styles:re,unstyled:k,__staticSelector:x,__stopPropagation:w,size:h,attributes:l,...p}=r,f=yt(),[a,v]=au(n),D={__staticSelector:x||"DecadeLevel",classNames:ie,styles:re,unstyled:k,size:h,attributes:l},T=typeof te=="boolean"?te:d?!he(v).endOf("year").isBefore(d):!1,z=typeof ne=="boolean"?ne:u?!he(a).startOf("year").isAfter(u):!1,Q=(Z,U)=>he(Z).locale(s||f.locale).format(U);return y.jsxs(O.Box,{"data-decade-level":!0,size:h,ref:e,...p,children:[y.jsx(vt,{label:typeof X=="function"?X(a,v):`${Q(a,X)} – ${Q(v,X)}`,__preventFocus:P,__stopPropagation:w,nextIcon:j,previousIcon:N,nextLabel:F,previousLabel:B,onNext:K,onPrevious:q,nextDisabled:T,previousDisabled:z,hasNextLevel:!1,levelControlAriaLabel:G,withNext:ee,withPrevious:V,headerControlsOrder:H,...D}),y.jsx(_r,{decade:n,locale:s,minDate:u,maxDate:d,yearsListFormat:i,getYearControlProps:m,__getControlRef:b,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:C,__preventFocus:P,__stopPropagation:w,withCellSpacing:S,...D})]})});Cr.classes={..._r.classes,...vt.classes},Cr.displayName="@mantine/dates/DecadeLevel";const uu={yearLabelFormat:"YYYY"},Sr=O.factory((t,e)=>{const r=O.useProps("YearLevel",uu,t),{year:n,locale:s,minDate:u,maxDate:d,monthsListFormat:i,getMonthControlProps:m,__getControlRef:b,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:C,withCellSpacing:S,__preventFocus:P,nextIcon:j,previousIcon:N,nextLabel:F,previousLabel:B,onNext:K,onPrevious:q,onLevelClick:te,nextDisabled:ne,previousDisabled:G,hasNextLevel:ee,levelControlAriaLabel:V,withNext:H,withPrevious:X,headerControlsOrder:ie,yearLabelFormat:re,__staticSelector:k,__stopPropagation:x,size:w,classNames:h,styles:l,unstyled:p,attributes:f,...a}=r,v=yt(),D={__staticSelector:k||"YearLevel",classNames:h,styles:l,unstyled:p,size:w,attributes:f},T=typeof ne=="boolean"?ne:d?!he(n).endOf("year").isBefore(d):!1,z=typeof G=="boolean"?G:u?!he(n).startOf("year").isAfter(u):!1;return y.jsxs(O.Box,{"data-year-level":!0,size:w,ref:e,...a,children:[y.jsx(vt,{label:typeof re=="function"?re(n):he(n).locale(s||v.locale).format(re),__preventFocus:P,__stopPropagation:x,nextIcon:j,previousIcon:N,nextLabel:F,previousLabel:B,onNext:K,onPrevious:q,onLevelClick:te,nextDisabled:T,previousDisabled:z,hasNextLevel:ee,levelControlAriaLabel:V,withNext:H,withPrevious:X,headerControlsOrder:ie,...D}),y.jsx(xr,{year:n,locale:s,minDate:u,maxDate:d,monthsListFormat:i,getMonthControlProps:m,__getControlRef:b,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:C,__preventFocus:P,__stopPropagation:x,withCellSpacing:S,...D})]})});Sr.classes={...vt.classes,...xr.classes},Sr.displayName="@mantine/dates/YearLevel";const cu={monthLabelFormat:"MMMM YYYY"},Dr=O.factory((t,e)=>{const r=O.useProps("MonthLevel",cu,t),{month:n,locale:s,firstDayOfWeek:u,weekdayFormat:d,weekendDays:i,getDayProps:m,excludeDate:b,minDate:_,maxDate:M,renderDay:C,hideOutsideDates:S,hideWeekdays:P,getDayAriaLabel:j,__getDayRef:N,__onDayKeyDown:F,__onDayClick:B,__onDayMouseEnter:K,withCellSpacing:q,highlightToday:te,withWeekNumbers:ne,__preventFocus:G,__stopPropagation:ee,nextIcon:V,previousIcon:H,nextLabel:X,previousLabel:ie,onNext:re,onPrevious:k,onLevelClick:x,nextDisabled:w,previousDisabled:h,hasNextLevel:l,levelControlAriaLabel:p,withNext:f,withPrevious:a,headerControlsOrder:v,monthLabelFormat:D,classNames:T,styles:z,unstyled:Q,__staticSelector:Z,size:U,static:ae,attributes:se,...ue}=r,E=yt(),L={__staticSelector:Z||"MonthLevel",classNames:T,styles:z,unstyled:Q,size:U,attributes:se},$=typeof w=="boolean"?w:M?!he(n).endOf("month").isBefore(M):!1,I=typeof h=="boolean"?h:_?!he(n).startOf("month").isAfter(_):!1;return y.jsxs(O.Box,{"data-month-level":!0,size:U,ref:e,...ue,children:[y.jsx(vt,{label:typeof D=="function"?D(n):he(n).locale(s||E.locale).format(D),__preventFocus:G,__stopPropagation:ee,nextIcon:V,previousIcon:H,nextLabel:X,previousLabel:ie,onNext:re,onPrevious:k,onLevelClick:x,nextDisabled:$,previousDisabled:I,hasNextLevel:l,levelControlAriaLabel:p,withNext:f,withPrevious:a,headerControlsOrder:v,...L}),y.jsx(br,{month:n,locale:s,firstDayOfWeek:u,weekdayFormat:d,weekendDays:i,getDayProps:m,excludeDate:b,minDate:_,maxDate:M,renderDay:C,hideOutsideDates:S,hideWeekdays:P,getDayAriaLabel:j,__getDayRef:N,__onDayKeyDown:F,__onDayClick:B,__onDayMouseEnter:K,__preventFocus:G,__stopPropagation:ee,static:ae,withCellSpacing:q,highlightToday:te,withWeekNumbers:ne,...L})]})});Dr.classes={...br.classes,...vt.classes},Dr.displayName="@mantine/dates/MonthLevel";var ys={levelsGroup:"m_30b26e33"};const bt=O.factory((t,e)=>{const r=O.useProps("LevelsGroup",null,t),{classNames:n,className:s,style:u,styles:d,unstyled:i,vars:m,__staticSelector:b,attributes:_,...M}=r,C=O.useStyles({name:b||"LevelsGroup",classes:ys,props:r,className:s,style:u,classNames:n,styles:d,unstyled:i,attributes:_,vars:m,rootSelector:"levelsGroup"});return y.jsx(O.Box,{ref:e,...C("levelsGroup"),...M})});bt.classes=ys,bt.displayName="@mantine/dates/LevelsGroup";const du={numberOfColumns:1},kr=O.factory((t,e)=>{const r=O.useProps("DecadeLevelGroup",du,t),{decade:n,locale:s,minDate:u,maxDate:d,yearsListFormat:i,getYearControlProps:m,__onControlClick:b,__onControlMouseEnter:_,withCellSpacing:M,__preventFocus:C,nextIcon:S,previousIcon:P,nextLabel:j,previousLabel:N,onNext:F,onPrevious:B,nextDisabled:K,previousDisabled:q,headerControlsOrder:te,classNames:ne,styles:G,unstyled:ee,__staticSelector:V,__stopPropagation:H,numberOfColumns:X,levelControlAriaLabel:ie,decadeLabelFormat:re,size:k,vars:x,attributes:w,...h}=r,l=J.useRef([]),p=Array(X).fill(0).map((f,a)=>{const v=he(n).add(a*10,"years").format("YYYY-MM-DD");return y.jsx(Cr,{size:k,yearsListFormat:i,decade:v,withNext:a===X-1,withPrevious:a===0,decadeLabelFormat:re,__onControlClick:b,__onControlMouseEnter:_,__onControlKeyDown:(D,T)=>pn({levelIndex:a,rowIndex:T.rowIndex,cellIndex:T.cellIndex,event:D,controlsRef:l}),__getControlRef:(D,T,z)=>{Array.isArray(l.current[a])||(l.current[a]=[]),Array.isArray(l.current[a][D])||(l.current[a][D]=[]),l.current[a][D][T]=z},levelControlAriaLabel:typeof ie=="function"?ie(v):ie,locale:s,minDate:u,maxDate:d,__preventFocus:C,__stopPropagation:H,nextIcon:S,previousIcon:P,nextLabel:j,previousLabel:N,onNext:F,onPrevious:B,nextDisabled:K,previousDisabled:q,getYearControlProps:m,__staticSelector:V||"DecadeLevelGroup",classNames:ne,styles:G,unstyled:ee,withCellSpacing:M,headerControlsOrder:te,attributes:w},a)});return y.jsx(bt,{classNames:ne,styles:G,__staticSelector:V||"DecadeLevelGroup",ref:e,size:k,unstyled:ee,attributes:w,...h,children:p})});kr.classes={...bt.classes,...Cr.classes},kr.displayName="@mantine/dates/DecadeLevelGroup";const hu={numberOfColumns:1},Pr=O.factory((t,e)=>{const r=O.useProps("YearLevelGroup",hu,t),{year:n,locale:s,minDate:u,maxDate:d,monthsListFormat:i,getMonthControlProps:m,__onControlClick:b,__onControlMouseEnter:_,withCellSpacing:M,__preventFocus:C,nextIcon:S,previousIcon:P,nextLabel:j,previousLabel:N,onNext:F,onPrevious:B,onLevelClick:K,nextDisabled:q,previousDisabled:te,hasNextLevel:ne,headerControlsOrder:G,classNames:ee,styles:V,unstyled:H,__staticSelector:X,__stopPropagation:ie,numberOfColumns:re,levelControlAriaLabel:k,yearLabelFormat:x,size:w,vars:h,attributes:l,...p}=r,f=J.useRef([]),a=Array(re).fill(0).map((v,D)=>{const T=he(n).add(D,"years").format("YYYY-MM-DD");return y.jsx(Sr,{size:w,monthsListFormat:i,year:T,withNext:D===re-1,withPrevious:D===0,yearLabelFormat:x,__stopPropagation:ie,__onControlClick:b,__onControlMouseEnter:_,__onControlKeyDown:(z,Q)=>pn({levelIndex:D,rowIndex:Q.rowIndex,cellIndex:Q.cellIndex,event:z,controlsRef:f}),__getControlRef:(z,Q,Z)=>{Array.isArray(f.current[D])||(f.current[D]=[]),Array.isArray(f.current[D][z])||(f.current[D][z]=[]),f.current[D][z][Q]=Z},levelControlAriaLabel:typeof k=="function"?k(T):k,locale:s,minDate:u,maxDate:d,__preventFocus:C,nextIcon:S,previousIcon:P,nextLabel:j,previousLabel:N,onNext:F,onPrevious:B,onLevelClick:K,nextDisabled:q,previousDisabled:te,hasNextLevel:ne,getMonthControlProps:m,classNames:ee,styles:V,unstyled:H,__staticSelector:X||"YearLevelGroup",withCellSpacing:M,headerControlsOrder:G,attributes:l},D)});return y.jsx(bt,{classNames:ee,styles:V,__staticSelector:X||"YearLevelGroup",ref:e,size:w,unstyled:H,attributes:l,...p,children:a})});Pr.classes={...Sr.classes,...bt.classes},Pr.displayName="@mantine/dates/YearLevelGroup";const fu={numberOfColumns:1},Mr=O.factory((t,e)=>{const r=O.useProps("MonthLevelGroup",fu,t),{month:n,locale:s,firstDayOfWeek:u,weekdayFormat:d,weekendDays:i,getDayProps:m,excludeDate:b,minDate:_,maxDate:M,renderDay:C,hideOutsideDates:S,hideWeekdays:P,getDayAriaLabel:j,__onDayClick:N,__onDayMouseEnter:F,withCellSpacing:B,highlightToday:K,withWeekNumbers:q,__preventFocus:te,nextIcon:ne,previousIcon:G,nextLabel:ee,previousLabel:V,onNext:H,onPrevious:X,onLevelClick:ie,nextDisabled:re,previousDisabled:k,hasNextLevel:x,headerControlsOrder:w,classNames:h,styles:l,unstyled:p,numberOfColumns:f,levelControlAriaLabel:a,monthLabelFormat:v,__staticSelector:D,__stopPropagation:T,size:z,static:Q,vars:Z,attributes:U,...ae}=r,se=J.useRef([]),ue=Array(f).fill(0).map((E,L)=>{const $=he(n).add(L,"months").format("YYYY-MM-DD");return y.jsx(Dr,{month:$,withNext:L===f-1,withPrevious:L===0,monthLabelFormat:v,__stopPropagation:T,__onDayClick:N,__onDayMouseEnter:F,__onDayKeyDown:(I,Y)=>pn({levelIndex:L,rowIndex:Y.rowIndex,cellIndex:Y.cellIndex,event:I,controlsRef:se}),__getDayRef:(I,Y,de)=>{Array.isArray(se.current[L])||(se.current[L]=[]),Array.isArray(se.current[L][I])||(se.current[L][I]=[]),se.current[L][I][Y]=de},levelControlAriaLabel:typeof a=="function"?a($):a,locale:s,firstDayOfWeek:u,weekdayFormat:d,weekendDays:i,getDayProps:m,excludeDate:b,minDate:_,maxDate:M,renderDay:C,hideOutsideDates:S,hideWeekdays:P,getDayAriaLabel:j,__preventFocus:te,nextIcon:ne,previousIcon:G,nextLabel:ee,previousLabel:V,onNext:H,onPrevious:X,onLevelClick:ie,nextDisabled:re,previousDisabled:k,hasNextLevel:x,classNames:h,styles:l,unstyled:p,__staticSelector:D||"MonthLevelGroup",size:z,static:Q,withCellSpacing:B,highlightToday:K,withWeekNumbers:q,headerControlsOrder:w,attributes:U},L)});return y.jsx(bt,{classNames:h,styles:l,__staticSelector:D||"MonthLevelGroup",ref:e,size:z,attributes:U,...ae,children:ue})});Mr.classes={...bt.classes,...Dr.classes},Mr.displayName="@mantine/dates/MonthLevelGroup";const vs=t=>t==="range"?[null,null]:t==="multiple"?[]:null,bs=(t,e)=>{const r=e?ts:Ge;return Array.isArray(t)?t.map(r):r(t)};function vn({type:t,value:e,defaultValue:r,onChange:n,withTime:s=!1}){const u=J.useRef(t),[d,i,m]=Ne.useUncontrolled({value:bs(e,s),defaultValue:bs(r,s),finalValue:vs(t),onChange:n});let b=d;return u.current!==t&&(u.current=t,e===void 0&&(b=r!==void 0?r:vs(t),i(b))),[b,i,m]}function bn(t,e){return t?t==="month"?0:t==="year"?1:2:e||0}function pu(t){return t===0?"month":t===1?"year":"decade"}function Xt(t,e,r){return pu(Ne.clamp(bn(t,0),bn(e,0),bn(r,2)))}const gu={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0,enableKeyboardNavigation:!0},Or=O.factory((t,e)=>{const r=O.useProps("Calendar",gu,t),{vars:n,maxLevel:s,minLevel:u,defaultLevel:d,level:i,onLevelChange:m,date:b,defaultDate:_,onDateChange:M,numberOfColumns:C,columnsToScroll:S,ariaLabels:P,nextLabel:j,previousLabel:N,onYearSelect:F,onMonthSelect:B,onYearMouseEnter:K,onMonthMouseEnter:q,headerControlsOrder:te,__updateDateOnYearSelect:ne,__updateDateOnMonthSelect:G,__setDateRef:ee,__setLevelRef:V,firstDayOfWeek:H,weekdayFormat:X,weekendDays:ie,getDayProps:re,excludeDate:k,renderDay:x,hideOutsideDates:w,hideWeekdays:h,getDayAriaLabel:l,monthLabelFormat:p,nextIcon:f,previousIcon:a,__onDayClick:v,__onDayMouseEnter:D,withCellSpacing:T,highlightToday:z,withWeekNumbers:Q,monthsListFormat:Z,getMonthControlProps:U,yearLabelFormat:ae,yearsListFormat:se,getYearControlProps:ue,decadeLabelFormat:E,classNames:L,styles:$,unstyled:I,minDate:Y,maxDate:de,locale:o,__staticSelector:c,size:g,__preventFocus:A,__stopPropagation:R,onNextDecade:W,onPreviousDecade:le,onNextYear:fe,onPreviousYear:pe,onNextMonth:oe,onPreviousMonth:ce,static:ge,enableKeyboardNavigation:me,attributes:Ce,...Se}=r,{resolvedClassNames:De,resolvedStyles:Qe}=O.useResolvedStylesApi({classNames:L,styles:$,props:r}),[Ae,ke]=Ne.useUncontrolled({value:i?Xt(i,u,s):void 0,defaultValue:d?Xt(d,u,s):void 0,finalValue:Xt(void 0,u,s),onChange:m}),[wt,$e]=vn({type:"default",value:Ge(b),defaultValue:Ge(_),onChange:M});J.useImperativeHandle(ee,()=>be=>{$e(be)}),J.useImperativeHandle(V,()=>be=>{ke(be)});const dt={__staticSelector:c||"Calendar",styles:Qe,classNames:De,unstyled:I,size:g,attributes:Ce},We=S||C||1,_t=new Date,Ye=Y&&he(_t).isAfter(Y)?Y:he(_t).format("YYYY-MM-DD"),Ie=wt||Ye,lt=()=>{const be=he(Ie).add(We,"month").format("YYYY-MM-DD");oe?.(be),$e(be)},xt=()=>{const be=he(Ie).subtract(We,"month").format("YYYY-MM-DD");ce?.(be),$e(be)},Ke=()=>{const be=he(Ie).add(We,"year").format("YYYY-MM-DD");fe?.(be),$e(be)},Ze=()=>{const be=he(Ie).subtract(We,"year").format("YYYY-MM-DD");pe?.(be),$e(be)},Je=()=>{const be=he(Ie).add(10*We,"year").format("YYYY-MM-DD");W?.(be),$e(be)},Xe=()=>{const be=he(Ie).subtract(10*We,"year").format("YYYY-MM-DD");le?.(be),$e(be)},at=J.useRef(null);J.useEffect(()=>{if(!me||ge)return;const be=Pe=>{if(!at.current?.contains(document.activeElement))return;const Ue=Pe.ctrlKey||Pe.metaKey,ht=Pe.shiftKey;switch(Pe.key){case"ArrowUp":Ue&&ht?(Pe.preventDefault(),Xe()):Ue&&(Pe.preventDefault(),Ze());break;case"ArrowDown":Ue&&ht?(Pe.preventDefault(),Je()):Ue&&(Pe.preventDefault(),Ke());break;case"y":case"Y":Ae==="month"&&(Pe.preventDefault(),ke("year"));break}};return document.addEventListener("keydown",be),()=>{document.removeEventListener("keydown",be)}},[me,ge,Ae,Ke,Ze,Je,Xe]);const ut=be=>{at.current=be,typeof e=="function"?e(be):e&&(e.current=be)};return y.jsxs(O.Box,{ref:ut,size:g,"data-calendar":!0,...Se,children:[Ae==="month"&&y.jsx(Mr,{month:Ie,minDate:Y,maxDate:de,firstDayOfWeek:H,weekdayFormat:X,weekendDays:ie,getDayProps:re,excludeDate:k,renderDay:x,hideOutsideDates:w,hideWeekdays:h,getDayAriaLabel:l,onNext:lt,onPrevious:xt,hasNextLevel:s!=="month",onLevelClick:()=>ke("year"),numberOfColumns:C,locale:o,levelControlAriaLabel:P?.monthLevelControl,nextLabel:P?.nextMonth??j,nextIcon:f,previousLabel:P?.previousMonth??N,previousIcon:a,monthLabelFormat:p,__onDayClick:v,__onDayMouseEnter:D,__preventFocus:A,__stopPropagation:R,static:ge,withCellSpacing:T,highlightToday:z,withWeekNumbers:Q,headerControlsOrder:te,...dt}),Ae==="year"&&y.jsx(Pr,{year:Ie,numberOfColumns:C,minDate:Y,maxDate:de,monthsListFormat:Z,getMonthControlProps:U,locale:o,onNext:Ke,onPrevious:Ze,hasNextLevel:s!=="month"&&s!=="year",onLevelClick:()=>ke("decade"),levelControlAriaLabel:P?.yearLevelControl,nextLabel:P?.nextYear??j,nextIcon:f,previousLabel:P?.previousYear??N,previousIcon:a,yearLabelFormat:ae,__onControlMouseEnter:q,__onControlClick:(be,Pe)=>{G&&$e(Pe),ke(Xt("month",u,s)),B?.(Pe)},__preventFocus:A,__stopPropagation:R,withCellSpacing:T,headerControlsOrder:te,...dt}),Ae==="decade"&&y.jsx(kr,{decade:Ie,minDate:Y,maxDate:de,yearsListFormat:se,getYearControlProps:ue,locale:o,onNext:Je,onPrevious:Xe,numberOfColumns:C,nextLabel:P?.nextDecade??j,nextIcon:f,previousLabel:P?.previousDecade??N,previousIcon:a,decadeLabelFormat:E,__onControlMouseEnter:K,__onControlClick:(be,Pe)=>{ne&&$e(Pe),ke(Xt("year",u,s)),F?.(Pe)},__preventFocus:A,__stopPropagation:R,withCellSpacing:T,headerControlsOrder:te,...dt})]})});Or.classes={...kr.classes,...Pr.classes,...Mr.classes},Or.displayName="@mantine/dates/Calendar";function mu(t){const{maxLevel:e,minLevel:r,defaultLevel:n,level:s,onLevelChange:u,nextIcon:d,previousIcon:i,date:m,defaultDate:b,onDateChange:_,numberOfColumns:M,columnsToScroll:C,ariaLabels:S,nextLabel:P,previousLabel:j,onYearSelect:N,onMonthSelect:F,onYearMouseEnter:B,onMonthMouseEnter:K,onNextMonth:q,onPreviousMonth:te,onNextYear:ne,onPreviousYear:G,onNextDecade:ee,onPreviousDecade:V,withCellSpacing:H,highlightToday:X,__updateDateOnYearSelect:ie,__updateDateOnMonthSelect:re,__setDateRef:k,__setLevelRef:x,withWeekNumbers:w,headerControlsOrder:h,firstDayOfWeek:l,weekdayFormat:p,weekendDays:f,getDayProps:a,excludeDate:v,renderDay:D,hideOutsideDates:T,hideWeekdays:z,getDayAriaLabel:Q,monthLabelFormat:Z,monthsListFormat:U,getMonthControlProps:ae,yearLabelFormat:se,yearsListFormat:ue,getYearControlProps:E,decadeLabelFormat:L,allowSingleDateInRange:$,allowDeselect:I,minDate:Y,maxDate:de,locale:o,...c}=t;return{calendarProps:{maxLevel:e,minLevel:r,defaultLevel:n,level:s,onLevelChange:u,nextIcon:d,previousIcon:i,date:m,defaultDate:b,onDateChange:_,numberOfColumns:M,columnsToScroll:C,ariaLabels:S,nextLabel:P,previousLabel:j,onYearSelect:N,onMonthSelect:F,onYearMouseEnter:B,onMonthMouseEnter:K,onNextMonth:q,onPreviousMonth:te,onNextYear:ne,onPreviousYear:G,onNextDecade:ee,onPreviousDecade:V,withCellSpacing:H,highlightToday:X,__updateDateOnYearSelect:ie,__updateDateOnMonthSelect:re,__setDateRef:k,withWeekNumbers:w,headerControlsOrder:h,firstDayOfWeek:l,weekdayFormat:p,weekendDays:f,getDayProps:a,excludeDate:v,renderDay:D,hideOutsideDates:T,hideWeekdays:z,getDayAriaLabel:Q,monthLabelFormat:Z,monthsListFormat:U,getMonthControlProps:ae,yearLabelFormat:se,yearsListFormat:ue,getYearControlProps:E,decadeLabelFormat:L,allowSingleDateInRange:$,allowDeselect:I,minDate:Y,maxDate:de,locale:o},others:c}}function yu(t){if(t===null)return null;const e=new Date(t);return Number.isNaN(e.getTime())||!t?null:he(e).format("YYYY-MM-DD")}function vu({date:t,maxDate:e,minDate:r}){return!(t==null||Number.isNaN(new Date(t).getTime())||e&&he(t).isAfter(e,"date")||r&&he(t).isBefore(r,"date"))}const bu={valueFormat:"MMMM D, YYYY",fixOnBlur:!0,size:"sm"},jr=O.factory((t,e)=>{const r=O.useInputProps("DateInput",bu,t),{inputProps:n,wrapperProps:s,value:u,defaultValue:d,onChange:i,clearable:m,clearButtonProps:b,popoverProps:_,getDayProps:M,locale:C,valueFormat:S,dateParser:P,minDate:j,maxDate:N,fixOnBlur:F,onFocus:B,onBlur:K,onClick:q,onKeyDown:te,readOnly:ne,name:G,form:ee,rightSection:V,unstyled:H,classNames:X,styles:ie,allowDeselect:re,date:k,defaultDate:x,onDateChange:w,getMonthControlProps:h,getYearControlProps:l,disabled:p,...f}=r,a=J.useRef(null),v=J.useRef(null),[D,T]=J.useState(!1),{calendarProps:z,others:Q}=mu(f),Z=yt(),ae=P||(oe=>{const ce=he(oe,S,Z.getLocale(C)).toDate();return Number.isNaN(ce.getTime())?yu(oe):he(ce).format("YYYY-MM-DD")}),se=re!==void 0?re:m,ue=oe=>oe?he(oe).locale(Z.getLocale(C)).format(S):"",[E,L,$]=vn({type:"default",value:u,defaultValue:d,onChange:i}),[I,Y]=vn({type:"default",value:k,defaultValue:d||x,onChange:w});J.useEffect(()=>{$&&u!==null&&Y(u)},[$,u]);const[de,o]=J.useState(ue(E));J.useEffect(()=>{o(ue(E))},[Z.getLocale(C)]);const c=oe=>{const ce=oe.currentTarget.value;if(o(ce),T(!0),ce.trim()===""&&(re||m))L(null);else{const ge=ae(ce);ge&&vu({date:ge,minDate:j,maxDate:N})&&(L(ge),Y(ge))}},g=oe=>{K?.(oe),T(!1),F&&o(ue(E))},A=oe=>{B?.(oe),T(!0)},R=oe=>{q?.(oe),T(!0)},W=oe=>{oe.key==="Escape"&&T(!1),te?.(oe)},le=oe=>({...M?.(oe),selected:he(E).isSame(oe,"day"),onClick:ce=>{M?.(oe).onClick?.(ce);const ge=se&&he(E).isSame(oe,"day")?null:oe;L(ge),!$&&ge&&o(ue(ge)),T(!1)}}),fe=y.jsx(O.Input.ClearButton,{onClick:()=>{L(null),!$&&o(""),T(!1)},unstyled:H,...b}),pe=m&&!!E&&!ne&&!p;return Ne.useDidUpdate(()=>{E!==void 0&&!D&&o(ue(E))},[E]),Ne.useClickOutside(()=>T(!1),void 0,[a.current,v.current]),y.jsxs(y.Fragment,{children:[y.jsx(O.Input.Wrapper,{...s,__staticSelector:"DateInput",ref:a,children:y.jsxs(O.Popover,{opened:D,trapFocus:!1,position:"bottom-start",disabled:ne||p,withRoles:!1,unstyled:H,..._,children:[y.jsx(O.Popover.Target,{children:y.jsx(O.Input,{"data-dates-input":!0,"data-read-only":ne||void 0,autoComplete:"off",ref:e,value:de,onChange:c,onBlur:g,onFocus:A,onClick:R,onKeyDown:W,readOnly:ne,rightSection:V,__clearSection:fe,__clearable:pe,...n,...Q,disabled:p,__staticSelector:"DateInput"})}),y.jsx(O.Popover.Dropdown,{onMouseDown:oe=>oe.preventDefault(),"data-dates-dropdown":!0,ref:v,children:y.jsx(Or,{__staticSelector:"DateInput",...z,classNames:X,styles:ie,unstyled:H,__preventFocus:!0,minDate:j,maxDate:N,locale:C,getDayProps:le,size:n.size,date:I,onDateChange:Y,getMonthControlProps:oe=>({selected:typeof E=="string"?yn(oe,E):!1,...h?.(oe)}),getYearControlProps:oe=>({selected:typeof E=="string"?he(oe).isSame(E,"year"):!1,...l?.(oe)}),attributes:s.attributes})})]})}),y.jsx(rs,{name:G,form:ee,value:E,type:"default"})]})});jr.classes={...O.Input.classes,...Or.classes},jr.displayName="@mantine/dates/DateInput";function ws(t){const e=Fe.c(49),{fields:r,onClose:n,queryKey:s,apiPath:u,steps:d,onCreated:i}=t,[m,b]=J.useState(0),[_,M]=J.useState(!1),[C,S]=J.useState(),{mutateAsync:P,isError:j,error:N,isPending:F}=Zo(u,s),{mutateAsync:B,isPending:K}=fn(u,s),q=F||K;let te;e[0]!==r?(te=new Set(r.filter(Cu).map(xu)),e[0]=r,e[1]=te):te=e[1];let ne;e[2]!==te?(ne=[...te],e[2]=te,e[3]=ne):ne=e[3];const G=ne;let ee;e[4]===Symbol.for("react.memo_cache_sentinel")?(ee=function(D,T){return typeof D.required=="function"?D.required(T??{}):!!D.required},e[4]=ee):ee=e[4];const V=ee;let H;e[5]!==r?(H=r.reduce(_u,{}),e[5]=r,e[6]=H):H=e[6];let X;if(e[7]!==r){let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=(D,T)=>(D[T.id]=(z,Q)=>T.conditional&&!T.conditional(Q)||!V(T,Q)||z?null:"Pflichtfeld",D),e[9]=v):v=e[9],X=r.filter(wu).reduce(v,{}),e[7]=r,e[8]=X}else X=e[8];let ie;e[10]!==H||e[11]!==X?(ie={mode:"uncontrolled",initialValues:H,validate:X},e[10]=H,e[11]=X,e[12]=ie):ie=e[12];const re=Rn.useForm(ie);let k;e[13]!==re||e[14]!==C?(k=function(D){const T=re.getValues();if(D.conditional&&!D.conditional(T))return null;const z=V(D,T);return y.jsxs(J.Fragment,{children:[(D.type===void 0||D.type=="text")&&y.jsx(O.TextInput,{label:D.column.title,placeholder:D.placeholder??"",...re.getInputProps(D.id),type:D.id.includes("email")?"email":void 0,required:z},re.key(D.id)),D.type==="number"&&y.jsx(O.NumberInput,{decimalSeparator:",",label:D.column.title,placeholder:D.placeholder??"",...re.getInputProps(D.id),required:z},re.key(D.id)),D.type==="date"&&y.jsx(jr,{label:D.column.title,placeholder:D.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...re.getInputProps(D.id),required:z},re.key(D.id)),D.type==="boolean"&&y.jsx(O.Checkbox,{mt:"md",label:D.column.title,...re.getInputProps(D.id,{type:"checkbox"}),required:z},re.key(D.id)),D.type==="textarea"&&y.jsx(O.Textarea,{label:D.column.title,placeholder:D.placeholder??"",...re.getInputProps(D.id),minRows:3,autosize:!0,required:z},re.key(D.id)),D.type==="custom"&&D.render&&D.render({...re.getValues(),...C&&{id:C}},re.setValues,M,{error:re.getInputProps(D.id).error,required:z})]},D.id)},e[13]=re,e[14]=C,e[15]=k):k=e[15];const x=k;let w;e[16]!==N?.message||e[17]!==N?.name||e[18]!==j?(w=j&&y.jsx(O.Alert,{variant:"outline",color:"red",title:N?.name??"Fehler aufgetreten",mb:"lg",children:N?.message??"Fehler aufgetreten"}),e[16]=N?.message,e[17]=N?.name,e[18]=j,e[19]=w):w=e[19];let h;e[20]!==m||e[21]!==P||e[22]!==re||e[23]!==j||e[24]!==n||e[25]!==i||e[26]!==C||e[27]!==G.length||e[28]!==B?(h=re.onSubmit(async v=>{if(C)await B({...v,id:C});else{const D=await P(v);S(D.id),i?.(D.id)}G.length&&m<G.length-1?j||b(m+1):j||(re.setInitialValues(v),re.reset(),n())}),e[20]=m,e[21]=P,e[22]=re,e[23]=j,e[24]=n,e[25]=i,e[26]=C,e[27]=G.length,e[28]=B,e[29]=h):h=e[29];let l;e[30]!==m||e[31]!==r||e[32]!==x||e[33]!==d||e[34]!==G?(l=G.length?y.jsx(O.Stepper,{active:m,size:"sm",children:G.map(v=>y.jsx(O.Stepper.Step,{...d&&d[v-1]?{label:d[v-1].label}:{},children:r.filter(D=>D.step===v).map(D=>x(D))},v))}):r.map(v=>x(v)),e[30]=m,e[31]=r,e[32]=x,e[33]=d,e[34]=G,e[35]=l):l=e[35];let p;e[36]!==m||e[37]!==_||e[38]!==q||e[39]!==n||e[40]!==G.length?(p=!_&&y.jsxs(O.Group,{mt:"md",justify:"end",children:[y.jsx(O.Button,{onClick:()=>G.length?m===0?n():b(m-1):n(),variant:"outline",children:G.length?m===0?"Abbrechen":"Zurück":"Abbrechen"}),y.jsx(O.Button,{type:"submit",loading:q,children:G.length?m===G.length-1?"Speichern":"Weiter":"Speichern"})]}),e[36]=m,e[37]=_,e[38]=q,e[39]=n,e[40]=G.length,e[41]=p):p=e[41];let f;e[42]!==l||e[43]!==p||e[44]!==h?(f=y.jsxs("form",{onSubmit:h,children:[l,p]}),e[42]=l,e[43]=p,e[44]=h,e[45]=f):f=e[45];let a;return e[46]!==f||e[47]!==w?(a=y.jsxs(y.Fragment,{children:[w,f]}),e[46]=f,e[47]=w,e[48]=a):a=e[48],a}function wu(t){return t.required}function _u(t,e){return t[e.id]=e.type==="boolean"?!1:e.defaultValue??"",t}function xu(t){return t.step}function Cu(t){return typeof t.step=="number"}var[Su,wn]=O.createSafeContext("useDataTableColumnsContext must be used within DataTableColumnProvider"),_s=t=>{let{children:e,columnsOrder:r,setColumnsOrder:n,columnsToggle:s,setColumnsToggle:u,resetColumnsOrder:d,resetColumnsToggle:i,setColumnWidth:m,setMultipleColumnWidths:b,resetColumnsWidth:_}=t,[M,C]=J.useState(""),[S,P]=J.useState("");return y.jsx(Su,{value:{sourceColumn:M,setSourceColumn:C,targetColumn:S,setTargetColumn:P,columnsToggle:s,setColumnsToggle:u,swapColumns:()=>{if(!r||!n||!M||!S)return;let j=r.indexOf(M),N=r.indexOf(S);if(j!==-1&&N!==-1){let F=r.splice(j,1)[0];r.splice(N,0,F),n([...r])}},resetColumnsOrder:d,resetColumnsToggle:i,setColumnWidth:m,setMultipleColumnWidths:b,resetColumnsWidth:_},children:e})};function Du(){return y.jsx("tr",{className:"mantine-datatable-empty-row",children:y.jsx("td",{})})}function ku(){return y.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74"}),y.jsx("path",{d:"M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6"}),y.jsx("path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4"}),y.jsx("path",{d:"M3 3l18 18"})]})}function Pu({icon:t,text:e,active:r,children:n}){return y.jsx(O.Center,{className:"mantine-datatable-empty-state","data-active":r||void 0,children:n||y.jsxs(y.Fragment,{children:[t||y.jsx("div",{className:"mantine-datatable-empty-state-icon",children:y.jsx(ku,{})}),y.jsx(O.Text,{component:"div",size:"sm",c:"dimmed",children:e})]})})}function Mu({key:t,columns:e=[],getInitialValueInEffect:r=!0}){function n(M,C){let S=[];return M.forEach(P=>{C.find(j=>j.accessor===P)&&S.push(P)}),C.forEach(P=>{S.includes(P.accessor)||S.push(P.accessor)}),S}let s=e&&e.map(M=>M.accessor)||[],[u,d]=Ne.useLocalStorage({key:t?`${t}-columns-order`:"",defaultValue:t?s:void 0,getInitialValueInEffect:r});function i(M){t&&d(M)}let m=()=>{i(s)};if(!t)return{columnsOrder:u,setColumnsOrder:i,resetColumnsOrder:m};let b=n(u,e),_=JSON.stringify(u);return JSON.stringify(b)!==_&&i(b),{columnsOrder:b,setColumnsOrder:i,resetColumnsOrder:m}}function Ou({key:t,columns:e=[],getInitialValueInEffect:r=!0,headerRef:n,onFixedLayoutChange:s}){let u=J.useRef(!1),d=J.useRef({}),[i,m]=J.useState(!0),b=J.useMemo(()=>e.some(V=>V.resizable&&!V.hidden&&V.accessor!=="__selection__"),[e]),_=J.useMemo(()=>e.filter(V=>V.resizable&&!V.hidden&&V.accessor!=="__selection__"),[e]),M=J.useMemo(()=>_.some(V=>V.width===void 0||V.width===""||V.width==="initial"),[_]),C=J.useCallback(()=>e.filter(V=>V.accessor!=="__selection__").map(V=>({[V.accessor]:V.width??"auto"})),[e]),[S,P]=Ne.useLocalStorage({key:t?`${t}-columns-width`:"",defaultValue:t?C():void 0,getInitialValueInEffect:!1}),[j,N]=J.useState(()=>C());J.useEffect(()=>{m(!1)},[]);let F=J.useCallback(()=>{if(!n?.current||i)return{};let V=n.current,H=Array.from(V.querySelectorAll("th[data-accessor]")),X={};return H.forEach(ie=>{let re=ie.getAttribute("data-accessor");if(!re||re==="__selection__")return;let k=_.find(x=>x.accessor===re);if(k&&(k.width===void 0||k.width===""||k.width==="initial")){let x=ie.getBoundingClientRect();X[re]=Math.round(x.width)}}),X},[n,_,i]),B=J.useCallback(V=>{let H=V.filter(ie=>ie.accessor!=="__selection__"),X=j.map(ie=>{let re=Object.keys(ie)[0],k=H.find(x=>x.accessor===re);return k?{[re]:k.width}:ie});N(X),t&&P(X)},[j,t,P]),K=J.useCallback(V=>{B(V)},[B]),q=J.useCallback(()=>{if(!(!n?.current||!s||i))if(M)s(!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{let V=F();d.current={...d.current,...V};let H=e.filter(X=>X.accessor!=="__selection__").map(X=>{let ie=X.accessor,re=S?.find(x=>Object.keys(x)[0]===ie);if(re&&re[ie]!=="auto")return{[ie]:re[ie]};let k=V[ie];return k?{[ie]:`${k}px`}:{[ie]:X.width??"auto"}});N(H),setTimeout(()=>{s(!0),u.current=!0},10)})});else{let V=e.filter(H=>H.accessor!=="__selection__").map(H=>({[H.accessor]:H.width??"auto"}));N(V),s(!0),u.current=!0}},[n,s,i,M,F,e,S]),te=q;J.useEffect(()=>{if(!b||!s||i){s?.(!1);return}u.current=!1;let V=setTimeout(()=>{q()},50);return()=>clearTimeout(V)},[b,s,i,q]),J.useEffect(()=>{i||!t||!r||S&&S.length>0&&N(S)},[i,t,r,S]);let ne=J.useCallback(()=>{t&&P(C()),d.current={},u.current=!1,s&&(s(!1),setTimeout(()=>{q()},10))},[t,P,C,s,q]),G=J.useCallback((V,H)=>{B([{accessor:V,width:H}])},[B]),ee=J.useMemo(()=>b?j.filter(V=>{let H=Object.keys(V)[0];return _.some(X=>X.accessor===H)}).every(V=>{let H=Object.values(V)[0];return H==="auto"||H==="initial"}):!1,[b,j,_]);return{columnsWidth:j,setColumnsWidth:B,setColumnWidth:G,setMultipleColumnWidths:K,resetColumnsWidth:ne,hasResizableColumns:b,allResizableWidthsInitial:ee,measureAndSetColumnWidths:te}}function ju({key:t,columns:e=[],getInitialValueInEffect:r=!0}){function n(M,C){let S=[];return M.forEach(P=>{C.find(j=>j.accessor===P.accessor)&&S.push(P)}),C.forEach(P=>{S.find(j=>j.accessor===P.accessor)||S.push({accessor:P.accessor,defaultToggle:P.defaultToggle||!0,toggleable:P.toggleable,toggled:P.defaultToggle===void 0?!0:P.defaultToggle})}),S}let s=e&&e.map(M=>({accessor:M.accessor,defaultToggle:M.defaultToggle||!0,toggleable:M.toggleable,toggled:M.defaultToggle===void 0?!0:M.defaultToggle})),[u,d]=Ne.useLocalStorage({key:t?`${t}-columns-toggle`:"",defaultValue:t?s:void 0,getInitialValueInEffect:r});function i(M){t&&d(M)}let m=()=>{i(s)};if(!t)return{columnsToggle:u,setColumnsToggle:i,resetColumnsToggle:m};let b=n(u,e),_=JSON.stringify(u);return JSON.stringify(b)!==_&&i(b),{columnsToggle:b,setColumnsToggle:i,resetColumnsToggle:m}}var Au=({key:t,columns:e=[],getInitialValueInEffect:r=!0,headerRef:n,scrollViewportRef:s,onFixedLayoutChange:u})=>{let{columnsOrder:d,setColumnsOrder:i,resetColumnsOrder:m}=Mu({key:t,columns:e,getInitialValueInEffect:r}),{columnsToggle:b,setColumnsToggle:_,resetColumnsToggle:M}=ju({key:t,columns:e,getInitialValueInEffect:r}),{columnsWidth:C,setColumnsWidth:S,setColumnWidth:P,setMultipleColumnWidths:j,resetColumnsWidth:N,hasResizableColumns:F,allResizableWidthsInitial:B,measureAndSetColumnWidths:K}=Ou({key:t,columns:e,getInitialValueInEffect:r,headerRef:n,onFixedLayoutChange:u});return{effectiveColumns:J.useMemo(()=>d?d.map(q=>e.find(te=>te.accessor===q)).map(q=>({...q,hidden:q?.hidden||!b.find(te=>te.accessor===q?.accessor)?.toggled})).map(q=>q?.accessor==="__selection__"?q:{...q,width:C.find(te=>te[q?.accessor])?.[q?.accessor]}):e,[e,d,b,C]),setColumnsOrder:i,columnsOrder:d,resetColumnsOrder:m,columnsToggle:b,setColumnsToggle:_,resetColumnsToggle:M,columnsWidth:C,setColumnsWidth:S,setColumnWidth:P,setMultipleColumnWidths:j,resetColumnsWidth:N,hasResizableColumns:F,allResizableWidthsInitial:B,measureAndSetColumnWidths:K}},xs=typeof window<"u"?J.useLayoutEffect:J.useEffect;function Cs(t){let e=J.useRef(t);return e.current=t,e}var Ss="--mantine-datatable-header-height",Ds="--mantine-datatable-footer-height",ks="--mantine-datatable-selection-column-width",Ps="--mantine-datatable-last-row-border-bottom";function it(t,e,r){t?.style.setProperty(e,r)}function _n(t){let e=t.borderBoxSize?.[0]||t.contentBoxSize?.[0];return e?{width:e.inlineSize,height:e.blockSize}:{width:t.contentRect.width,height:t.contentRect.height}}function xn(t,e,r){if(t){let n=new ResizeObserver(s=>{let u=s[0];u&&e(_n(u))});return n.observe(t),()=>{n.disconnect(),r()}}}function Eu({scrollCallbacks:t,withRowBorders:e}){let r={root:J.useRef(null),table:J.useRef(null),scrollViewport:J.useRef(null),header:J.useRef(null),footer:J.useRef(null),selectionColumnHeader:J.useRef(null)},{root:n,table:s,scrollViewport:u,header:d,footer:i,selectionColumnHeader:m}=r,b=Cs({withRowBorders:e}),_=Cs(t),M=J.useRef(()=>{}),C=J.useRef(()=>{}),S=J.useCallback(P=>{_.current.onScroll?.(P),M.current()},[]);return J.useEffect(()=>xn(d.current,P=>{it(n.current,Ss,`${P.height}px`)},()=>it(n.current,Ss,"0")),[d.current]),J.useEffect(()=>xn(i.current,P=>{it(n.current,Ds,`${P.height}px`)},()=>it(n.current,Ds,"0")),[i.current]),J.useEffect(()=>xn(m.current,P=>{it(n.current,ks,`${P.width}px`)},()=>it(n.current,ks,"0")),[m.current]),xs(()=>{if(typeof window===void 0)return;let P={top:!0,bottom:!0,left:!0,right:!0},j={width:0,height:0},N={width:0,height:0};function F(ne,G){let ee=P[ne];return P[ne]=G,it(n.current,`--mantine-datatable-${ne}-shadow-opacity`,G?"0":"1"),ee}function B(){let ne=j.height-N.height,G=ne<0;it(n.current,"--mantine-datatable-footer-position",G?"relative":"sticky"),it(n.current,"--mantine-datatable-footer-bottom",G?`${ne}px`:"0")}function K(){b.current.withRowBorders&&j.height<N.height?it(n.current,Ps,`${O.rem("1px")} solid var(--mantine-datatable-border-color)`):it(n.current,Ps,"unset")}C.current=K;function q(){let ne=_.current,G=u.current,ee=G?.scrollTop??0,V=G?.scrollLeft??0,H=ee===0,X=j.height-ee-N.height<1,ie=F("top",H),re=F("bottom",X);H&&H!==ie&&ne.onScrollToTop?.(),X&&X!==re&&ne.onScrollToBottom?.();let k=G?getComputedStyle(G).direction==="rtl":!1,x=(G?.scrollWidth??0)-N.width,w,h;if(k){let f=Math.abs(V);h=f<1,w=x-f<1}else w=V<1,h=j.width-V-N.width<1;let l=F("left",w),p=F("right",h);w&&w!==l&&ne.onScrollToLeft?.(),h&&h!==p&&ne.onScrollToRight?.()}M.current=q;let te=new ResizeObserver(ne=>{for(let G of ne)switch(G.target.tagName){case"TABLE":{j=_n(G);break}case"DIV":{N=_n(G);break}}q(),B(),K()});return te.observe(s.current),te.observe(u.current),()=>{te.disconnect()}},[]),xs(()=>{C.current()},[e]),{refs:r,onScroll:S}}function Tu(t){let[e,r]=J.useState(null),n=t?.join(":")||"";return J.useEffect(()=>{r(null)},[n]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:r}}function $u(t,e){let r=()=>{e(t.map(s=>s.matches))},n=t.map(s=>{try{return s.addEventListener("change",r),()=>s.removeEventListener("change",r)}catch{return s.addListener(r),()=>s.removeListener(r)}});return()=>{n.forEach(s=>s())}}function Ru(t,e){return e||(typeof window<"u"&&"matchMedia"in window?t.map(r=>window.matchMedia(r).matches):t.map(()=>!1))}function Nu(t,e,{getInitialValueInEffect:r}={getInitialValueInEffect:!0}){let[n,s]=J.useState(r?e:Ru(t,e)),u=J.useRef(null);return J.useEffect(()=>{if("matchMedia"in window)return u.current=t.map(d=>window.matchMedia(d)),s(u.current.map(d=>d.matches)),$u(u.current,d=>{s(d)})},[t]),n}function Lu(t){let e=O.useMantineTheme(),r=J.useMemo(()=>t.map(s=>(typeof s=="function"?s(e):s)??""),[t,e]),n=J.useMemo(()=>t.map(()=>!0),[t]);return Nu(r,n)}function Ar(t){let e=O.useMantineTheme(),r=typeof t=="function"?t(e):t;return Ne.useMediaQuery(r||"",!0)}function Cn(t){let e=t.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function Bu(t,e,r){return t.filter(n=>!e.map(r).includes(r(n)))}function Sn(t,e){return t.filter((r,n,s)=>n===s.findIndex(u=>e(r)===e(u)))}function Ms(t,e){return e?e.match(/([^[.\]])+/g).reduce((r,n)=>r&&r[n],t):void 0}function Be(t,e){return typeof e=="string"?Ms(t,e):e(t)}function Os(t){return!t||t.length===0?0:Math.max(...t.map(e=>e.groups&&e.groups.length>0?1+Os(e.groups):1))}function Dn(t){let e=[];for(let r of t)r.columns&&r.columns.length>0?e.push(...r.columns.filter(n=>n!=null)):r.groups&&r.groups.length>0&&e.push(...Dn(r.groups));return e.filter(r=>r!=null)}function kn(t,e){return t.columns&&t.columns.length>0?t.columns.filter((r,n)=>r.hidden?!1:e?e[n]!==!1:!0).length:t.groups&&t.groups.length>0?t.groups.reduce((r,n)=>r+kn(n,e),0):0}function js(t,e,r=0){if(r===e)return[...t];let n=[];for(let s of t)s.groups&&s.groups.length>0&&n.push(...js(s.groups,e,r+1));return n}function Iu(t,e,r){return r?!t||e:!1}function Yu({rowExpansion:t,records:e,idAccessor:r}){let n=[];if(t&&e){let{trigger:i,allowMultiple:m,initiallyExpanded:b}=t;e&&i==="always"?n=e.map(_=>Be(_,r)):b&&(n=e.filter((_,M)=>b({record:_,index:M})).map(_=>Be(_,r)),m||(n=[n[0]]))}let s,u,d=J.useState(n);if(t){let{expandable:i,trigger:m,allowMultiple:b,collapseProps:_,content:M}=t;t.expanded?{recordIds:s,onRecordIdsChange:u}=t.expanded:[s,u]=d;let C=S=>u?.(s.filter(P=>P!==Be(S,r)));return{expandOnClick:m!=="always"&&m!=="never",isRowExpanded:S=>m==="always"?!0:s.includes(Be(S,r)),isExpandable:({record:S,index:P})=>i?i({record:S,index:P}):!0,expandRow:S=>{let P=Be(S,r);u?.(b?[...s,P]:[P])},collapseRow:C,collapseProps:_,content:({record:S,index:P})=>()=>M({record:S,index:P,collapse:()=>C(S)})}}}function zu(t,e){let[r,n]=J.useState(t),[s,u]=J.useState(t),d=Ne.useTimeout(()=>n(!0),0),i=Ne.useTimeout(()=>u(!1),e||200);return J.useEffect(()=>{t?(i.clear(),u(!0),d.start()):(d.clear(),n(!1),i.start())},[d,i,t]),{expanded:r,visible:s}}var Pn="mantine-datatable-nowrap",Mn="mantine-datatable-ellipsis",Nt="mantine-datatable-pointer-cursor",As="mantine-datatable-context-menu-cursor",Fu="mantine-datatable-text-selection-disabled",Er="mantine-datatable-text-align-left",Tr="mantine-datatable-text-align-center",$r="mantine-datatable-text-align-right";function Wu({className:t,style:e,visibleMediaQuery:r,title:n,noWrap:s,ellipsis:u,textAlign:d,width:i}){return Ar(r)?y.jsx(O.TableTh,{className:Oe({[Pn]:s||u,[Mn]:u,[Er]:d==="left",[Tr]:d==="center",[$r]:d==="right"},t),style:[{width:i,minWidth:i,maxWidth:i},e],children:n}):null}function Uu({shadowVisible:t}){return y.jsx(O.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":t||void 0})}function qu({className:t,style:e,columns:r,defaultColumnProps:n,selectionVisible:s,selectorCellShadowVisible:u,ref:d}){return y.jsx(O.TableTfoot,{ref:d,className:Oe("mantine-datatable-footer",t),style:e,children:y.jsxs(O.TableTr,{children:[s&&y.jsx(Uu,{shadowVisible:u}),r.map(({hidden:i,...m})=>{if(i)return null;let{accessor:b,visibleMediaQuery:_,textAlign:M,width:C,footer:S,footerClassName:P,footerStyle:j,noWrap:N,ellipsis:F}={...n,...m};return y.jsx(Wu,{className:P,style:j,visibleMediaQuery:_,textAlign:M,width:C,title:S,noWrap:N,ellipsis:F},b)})]})})}function Vu({group:{id:t,columns:e,groups:r,title:n,textAlign:s,className:u,style:d},maxDepth:i,currentDepth:m,previousGroups:b,isLastGroup:_,withColumnBorders:M=!1,totalTableColumns:C}){let S=J.useMemo(()=>e&&e.length>0?e:r&&r.length>0?Dn([{id:t,columns:e,groups:r}]):[],[e,r,t]),P=J.useMemo(()=>S.map(({visibleMediaQuery:te})=>te),[S]),j=Lu(P),N=J.useMemo(()=>kn({columns:e,groups:r},j),[t,e,r,j]),F=J.useMemo(()=>b.reduce((te,ne)=>te+kn(ne,j),0),[b,j]),B=r&&r.length>0?1:i-m,K=F+N<C,q=Iu(_,K,M);return N>0?y.jsx(O.TableTh,{colSpan:N,rowSpan:B>1?B:void 0,className:Oe("mantine-datatable-column-group-header-cell",{[Er]:s==="left",[Tr]:s==="center",[$r]:s==="right","mantine-datatable-column-group-header-cell--needs-border":q},u),style:d,children:n??Cn(t)}):null}function Hu(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"})]})}function Gu(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M20 3h-16a1 1 0 0 0 -1 1v2.227l.008 .223a3 3 0 0 0 .772 1.795l4.22 4.641v8.114a1 1 0 0 0 1.316 .949l6 -2l.108 -.043a1 1 0 0 0 .576 -.906v-6.586l4.121 -4.12a3 3 0 0 0 .879 -2.123v-2.171a1 1 0 0 0 -1 -1z",strokeWidth:"0",fill:"currentColor"})]})}function Qu({children:t,isActive:e,filterPopoverProps:r,filterPopoverDisableClickOutside:n}){let[s,{close:u,toggle:d}]=Ne.useDisclosure(!1),i=e?Gu:Hu,m=Ne.useClickOutside(u);return n&&(m=void 0),y.jsxs(O.Popover,{withArrow:!0,shadow:"md",opened:s,onClose:u,trapFocus:!0,...r,children:[y.jsx(O.PopoverTarget,{children:y.jsx(O.ActionIcon,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":e||void 0,size:"sm",variant:"default",onClick:b=>{b.preventDefault(),d()},onKeyDown:b=>b.stopPropagation(),children:y.jsx(i,{})})}),y.jsx(O.PopoverDropdown,{ref:m,onClick:b=>b.stopPropagation(),onKeyDown:b=>b.stopPropagation(),children:typeof t=="function"?t({close:u}):t})]})}var Ku=t=>{let{accessor:e,columnRef:r}=t,[n,s]=J.useState(!1),u=J.useRef(0),d=J.useRef({current:0,next:0}),{dir:i}=O.useDirection(),m=i==="rtl",{setMultipleColumnWidths:b}=wn(),_=J.useCallback(C=>{if(C.preventDefault(),C.stopPropagation(),!r.current)return;let S=r.current,P=S.nextElementSibling;for(;P;){let te=P.getAttribute("data-accessor");if(te&&te!=="__selection__")break;P=P.nextElementSibling}if(!P)return;let j=P.getAttribute("data-accessor");if(!j)return;let N=j==="__selection__";s(!0),u.current=C.clientX;let F=S.offsetWidth,B=P.offsetWidth;d.current={current:F,next:B};let K=te=>{if(!r.current)return;let ne=r.current,G=ne.nextElementSibling;if(!G)return;let ee=te.clientX-u.current;m&&(ee=-ee);let V=50,H=d.current.current-V,X=d.current.next-V,ie=Math.max(-H,Math.min(ee,X)),re=d.current.current+ie,k=d.current.next-ie;ne.style.width=`${re}px`,G.style.width=`${k}px`,ne.style.minWidth=`${re}px`,ne.style.maxWidth=`${re}px`,G.style.minWidth=`${k}px`,G.style.maxWidth=`${k}px`},q=()=>{if(!r.current)return;let te=r.current,ne=te.nextElementSibling;s(!1),document.body.style.cursor="initial",document.body.style.userSelect="initial";let G=parseInt(te.style.width)||te.offsetWidth,ee=ne?parseInt(ne.style.width)||ne.offsetWidth:0,V=[{accessor:e,width:`${G}px`}];if(ne&&!N){let H=ne.getAttribute("data-accessor");H&&V.push({accessor:H,width:`${ee}px`})}setTimeout(()=>{b(V)},0),document.removeEventListener("mousemove",K),document.removeEventListener("mouseup",q)};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",K),document.addEventListener("mouseup",q)},[e,r,m,b]),M=J.useCallback(()=>{if(!r.current)return;let C=r.current,S=C.nextElementSibling;C.style.width="",C.style.minWidth="",C.style.maxWidth="";let P=[{accessor:e,width:"auto"}];if(S){S.style.width="",S.style.minWidth="",S.style.maxWidth="";let j=S.getAttribute("data-accessor");j&&j!=="__selection__"&&P.push({accessor:j,width:"auto"})}setTimeout(()=>{b(P)},0)},[e,r,b]);return y.jsx("div",{className:"mantine-datatable-header-resizable-handle",style:{cursor:n?"col-resize":void 0},onMouseDown:_,onDoubleClick:M,onClick:C=>C.stopPropagation(),title:"Drag to resize column, double-click to reset"})};function Zu(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M12 5l0 14"}),y.jsx("path",{d:"M16 9l-4 -4"}),y.jsx("path",{d:"M8 9l4 -4"})]})}function Ju(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M8 7l4 -4l4 4"}),y.jsx("path",{d:"M8 17l4 4l4 -4"}),y.jsx("path",{d:"M12 3l0 18"})]})}function Xu(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),y.jsx("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),y.jsx("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),y.jsx("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),y.jsx("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),y.jsx("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]})}function ec(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M18 6l-12 12"}),y.jsx("path",{d:"M6 6l12 12"})]})}function tc({className:t,style:e,accessor:r,visibleMediaQuery:n,title:s,sortable:u,draggable:d,toggleable:i,resizable:m,sortIcons:b,textAlign:_,width:M,sortStatus:C,onSortStatusChange:S,filter:P,filterPopoverProps:j,filterPopoverDisableClickOutside:N,filtering:F,sortKey:B}){let{setSourceColumn:K,setTargetColumn:q,swapColumns:te,setColumnsToggle:ne}=wn(),[G,ee]=J.useState(!1),V=J.useRef(null);if(!Ar(n))return null;let H=s??Cn(r),X=typeof H=="string"?H:void 0,ie=u&&S?p=>{p?.defaultPrevented||S({sortKey:B,columnAccessor:r,direction:C?.columnAccessor===r?C.direction==="asc"?"desc":"asc":C?.direction??"asc"})}:void 0,re=p=>{p.stopPropagation(),K(r),ee(!1)},k=p=>{p.preventDefault(),q(r),ee(!0)},x=()=>{q(r),ee(!1),te()},w=()=>{ee(!0)},h=()=>{ee(!1)},l=p=>{p.stopPropagation(),ne(f=>f.map(a=>a.accessor===r?{...a,toggled:!1}:a))};return y.jsxs(O.TableTh,{"data-accessor":r,className:Oe({"mantine-datatable-header-cell-sortable":u,"mantine-datatable-header-cell-toggleable":i,"mantine-datatable-header-cell-resizable":m},t),style:[{width:M,...m?{}:{minWidth:M,maxWidth:M}},e],role:u?"button":void 0,tabIndex:u?0:void 0,onClick:ie,onKeyDown:p=>p.key==="Enter"&&ie?.(),ref:V,children:[y.jsxs(O.Group,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[y.jsxs(O.Flex,{align:"center",w:"100%",className:Oe({"mantine-datatable-header-cell-draggable":d,"mantine-datatable-header-cell-drag-over":G}),draggable:d,onDragStart:d?re:void 0,onDragEnter:d?w:void 0,onDragOver:d?k:void 0,onDrop:d?x:void 0,onDragLeave:d?h:void 0,children:[d?y.jsx(O.Center,{role:"img","aria-label":"Drag column",children:y.jsx(O.ActionIcon,{className:"mantine-datatable-header-cell-draggable-action-icon",variant:"subtle",size:"xs",onClick:p=>{p.stopPropagation()},children:y.jsx(Xu,{})})}):null,y.jsx(O.Box,{className:Oe("mantine-datatable-header-cell-sortable-text",{[Er]:_==="left",[Tr]:_==="center",[$r]:_==="right"},Pn,Mn),title:X,children:H})]}),i?y.jsx(O.Center,{className:"mantine-datatable-header-cell-toggleable-icon",role:"img","aria-label":"Toggle column",children:y.jsx(O.ActionIcon,{size:"xs",variant:"light",onClick:l,children:y.jsx(ec,{})})}):null,u||C?.columnAccessor===r?y.jsx(y.Fragment,{children:C?.columnAccessor===r?y.jsx(O.Center,{className:Oe("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":C.direction==="desc"}),role:"img","aria-label":`Sorted ${C.direction==="desc"?"descending":"ascending"}`,children:b?.sorted||y.jsx(Zu,{})}):y.jsx(O.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:b?.unsorted||y.jsx(Ju,{})})}):null,P?y.jsx(Qu,{filterPopoverProps:j,isActive:!!F,filterPopoverDisableClickOutside:N,children:P}):null]}),m&&r!=="__selection__"?y.jsx(Ku,{accessor:r,columnRef:V}):null]})}function rc({className:t,style:e,trigger:r,shadowVisible:n,checked:s,indeterminate:u,checkboxProps:d,onChange:i,rowSpan:m,ref:b}){let _=!d.disabled;return y.jsx(O.TableTh,{ref:b,className:Oe("mantine-datatable-header-selector-cell",{[Nt]:r==="cell"&&_},t),style:e,rowSpan:m,"data-shadow-visible":n||void 0,"data-accessor":"__selection__",onClick:r==="cell"&&_?i:void 0,children:y.jsx(O.Checkbox,{classNames:_?{input:Nt}:void 0,checked:s,indeterminate:u,onChange:i,...d,disabled:!(i||d.onChange)||d.disabled})})}function nc({selectionColumnHeaderRef:t,className:e,style:r,sortStatus:n,sortIcons:s,onSortStatusChange:u,columns:d,defaultColumnProps:i,groups:m,selectionTrigger:b,selectionVisible:_,selectionChecked:M,selectionIndeterminate:C,onSelectionChange:S,selectionCheckboxProps:P,selectorCellShadowVisible:j,selectionColumnClassName:N,selectionColumnStyle:F,withColumnBorders:B=!1,ref:K}){let q=m?Os(m):0,te=q>0?q+1:1,ne=_?y.jsx(rc,{ref:t,className:N,style:F,trigger:b,shadowVisible:j,checked:M,indeterminate:C,checkboxProps:P,onChange:S,rowSpan:m?te:void 0}):null,{columnsToggle:G,setColumnsToggle:ee}=wn(),[V,H]=J.useState(!1),X=d.some(k=>k.toggleable),ie=X?Object.fromEntries(d.map(({accessor:k,title:x})=>[k,x??Cn(String(k))])):void 0,re=y.jsxs(O.TableThead,{className:Oe("mantine-datatable-header",e),style:r,ref:K,onContextMenu:X?k=>{k.preventDefault(),H(x=>!x)}:void 0,children:[m&&Array.from({length:q},(k,x)=>{let w=js(m,x);return y.jsxs(O.TableTr,{children:[x===0&&ne,w.map((h,l)=>y.jsx(Vu,{group:h,maxDepth:q,currentDepth:x,previousGroups:w.slice(0,l),isLastGroup:l===w.length-1,withColumnBorders:B,totalTableColumns:d.length},h.id))]},`group-depth-${x}`)}),y.jsxs(O.TableTr,{children:[!m&&ne,d.map(({hidden:k,...x},w)=>{if(k)return null;let{accessor:h,visibleMediaQuery:l,textAlign:p,width:f,title:a,sortable:v,draggable:D,toggleable:T,resizable:z,titleClassName:Q,titleStyle:Z,filter:U,filterPopoverProps:ae,filterPopoverDisableClickOutside:se,filtering:ue,sortKey:E}={...i,...x};return y.jsx(tc,{accessor:h,className:Q,style:Z,visibleMediaQuery:l,textAlign:p,width:f,title:a,sortable:v,draggable:D,toggleable:T,resizable:z&&w<d.length-1,sortStatus:n,sortIcons:s,sortKey:E,onSortStatusChange:u,filter:U,filterPopoverProps:ae,filterPopoverDisableClickOutside:se,filtering:ue},h)})]})]});return X?y.jsxs(O.Popover,{position:"bottom",withArrow:!0,shadow:"md",opened:V,onChange:H,children:[y.jsx(O.PopoverTarget,{children:re}),y.jsx(O.PopoverDropdown,{children:y.jsx(O.Stack,{children:G.filter(k=>k.toggleable).map(k=>y.jsx(O.Group,{children:y.jsx(O.Checkbox,{classNames:{label:"mantine-datatable-header-column-toggle-checkbox-label"},size:"xs",label:ie[k.accessor],checked:k.toggled,onChange:x=>{ee(G.map(w=>w.accessor===k.accessor?{...w,toggled:x.currentTarget.checked}:w))}})},k.accessor))})})]}):re}function oc({fetching:t,customContent:e,backgroundBlur:r,size:n,type:s,color:u}){return y.jsx(O.Center,{className:Oe("mantine-datatable-loader",{"mantine-datatable-loader-fetching":t}),style:[{backdropFilter:r?`blur(${r}px)`:void 0}],children:t&&(e||y.jsx(O.Loader,{size:n,type:s,color:u}))})}function je(t,e,r){return t?O.parseThemeColor({color:typeof t=="object"?t[r]:t,theme:e}).value:void 0}function sc({theme:t,c:e,backgroundColor:r,borderColor:n,rowBorderColor:s,stripedColor:u,highlightOnHoverColor:d}){return{"--mantine-datatable-color-light":je(e,t,"light"),"--mantine-datatable-color-dark":je(e,t,"dark"),"--mantine-datatable-background-color-light":je(r,t,"light"),"--mantine-datatable-background-color-dark":je(r,t,"dark"),"--mantine-datatable-border-color-light":je(n,t,"light"),"--mantine-datatable-border-color-dark":je(n,t,"dark"),"--mantine-datatable-row-border-color-light":je(s,t,"light"),"--mantine-datatable-row-border-color-dark":je(s,t,"dark"),"--mantine-datatable-striped-color-light":je(u,t,"light"),"--mantine-datatable-striped-color-dark":je(u,t,"dark"),"--mantine-datatable-highlight-on-hover-color-light":je(d,t,"light"),"--mantine-datatable-highlight-on-hover-color-dark":je(d,t,"dark")}}function Es({theme:t,paginationActiveTextColor:e,paginationActiveBackgroundColor:r}){return{"--mantine-datatable-pagination-active-text-color-light":je(e,t,"light"),"--mantine-datatable-pagination-active-text-color-dark":je(e,t,"dark"),"--mantine-datatable-pagination-active-background-color-light":je(r,t,"light"),"--mantine-datatable-pagination-active-background-color-dark":je(r,t,"dark")}}function ic({theme:t,color:e,backgroundColor:r}){return{"--mantine-datatable-row-color-light":je(e,t,"light"),"--mantine-datatable-row-color-dark":je(e,t,"dark"),"--mantine-datatable-row-background-color-light":je(r,t,"light"),"--mantine-datatable-row-background-color-dark":je(r,t,"dark")}}function ac(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M8 9l4 -4l4 4"}),y.jsx("path",{d:"M16 15l-4 4l-4 -4"})]})}var Ts={xs:O.rem(22),sm:O.rem(26),md:O.rem(32),lg:O.rem(38),xl:O.rem(44)};function lc({size:t,label:e,values:r,value:n,activeTextColor:s,activeBackgroundColor:u,onChange:d}){return y.jsxs(O.Group,{gap:"xs",children:[y.jsx(O.Text,{component:"div",size:t,children:e}),y.jsxs(O.Menu,{withinPortal:!0,withArrow:!0,offset:2,classNames:{arrow:"mantine-datatable-page-size-selector-menu-arrow"},children:[y.jsx(O.MenuTarget,{children:y.jsx(O.Button,{size:t,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:y.jsx(ac,{}),style:[{fontWeight:"normal"},i=>({height:Ts[t],paddingLeft:i.spacing[t],paddingRight:i.spacing[t]})],children:n})}),y.jsx(O.MenuDropdown,{children:r.map(i=>{let m=i===n;return y.jsx(O.MenuItem,{className:Oe({"mantine-datatable-page-size-selector-active":m}),style:[{height:Ts[t]},m&&(s||u)?b=>Es({theme:b,paginationActiveTextColor:s,paginationActiveBackgroundColor:u}):void 0],disabled:m,onClick:()=>d(i),children:y.jsx(O.Text,{component:"div",size:t,children:i})},i)})})]})]})}function uc({className:t,style:e,fetching:r,page:n,onPageChange:s,paginationWithEdges:u,paginationWithControls:d,paginationActiveTextColor:i,paginationActiveBackgroundColor:m,paginationSize:b,loadingText:_,noRecordsText:M,paginationText:C,totalRecords:S,recordsPerPage:P,onRecordsPerPageChange:j,recordsPerPageLabel:N,recordsPerPageOptions:F,recordsLength:B,horizontalSpacing:K,paginationWrapBreakpoint:q,getPaginationControlProps:te,getPaginationItemProps:ne,renderPagination:G}){let ee;if(S){let x=(n-1)*P+1,w=x+(B||0)-1;ee=C({from:x,to:w,totalRecords:S})}else ee=r?_:M;let V=S&&P?Math.max(1,Math.ceil(S/P)):1,H=S?(n-1)*(P??0)+1:void 0,X=S?(H??1)+(B??0)-1:void 0,ie=!Ar(({breakpoints:x})=>`(min-width: ${typeof q=="number"?`${O.rem(q)}rem`:x[q]||q})`),re={Text:x=>y.jsx(O.Text,{component:"div",className:"mantine-datatable-pagination-text",size:b,...x,children:ee}),PageSizeSelector:x=>F?y.jsx(lc,{activeTextColor:i,activeBackgroundColor:m,size:b,label:N,values:F,value:P,onChange:j,...x}):y.jsx(y.Fragment,{}),Pagination:x=>y.jsx(O.Pagination,{classNames:{root:Oe("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":r||!B}),control:"mantine-datatable-pagination-pages-control"},style:i||m?w=>Es({theme:w,paginationActiveTextColor:i,paginationActiveBackgroundColor:m}):void 0,withEdges:u,withControls:d,value:n,onChange:s,size:b,total:V,getControlProps:te,getItemProps:ne,...x})},k={state:{paginationSize:b,page:n,totalPages:V,totalRecords:S,recordsPerPage:P,recordsLength:B,fetching:r,from:H,to:X,isWrapped:ie},actions:{setPage:x=>s?.(x),setRecordsPerPage:j?x=>j(x):void 0},Controls:re};return y.jsx(O.Box,{px:K??"xs",py:"xs",className:Oe("mantine-datatable-pagination",t),style:[{flexDirection:ie?"column":"row"},e],children:typeof G=="function"?G(k):y.jsxs(y.Fragment,{children:[y.jsx(re.Text,{}),y.jsx(re.PageSizeSelector,{}),y.jsx(re.Pagination,{})]})})}function cc({className:t,style:e,visibleMediaQuery:r,record:n,index:s,onClick:u,onDoubleClick:d,onContextMenu:i,noWrap:m,ellipsis:b,textAlign:_,width:M,accessor:C,render:S,defaultRender:P,customCellAttributes:j}){return Ar(r)?y.jsx(O.TableTd,{className:Oe({[Pn]:m||b,[Mn]:b,[Nt]:u||d,[As]:i,[Er]:_==="left",[Tr]:_==="center",[$r]:_==="right"},t),style:[{width:M,minWidth:M,maxWidth:M},e],onClick:u,onDoubleClick:d,onContextMenu:i,...j?.(n,s),children:S?S(n,s):P?P(n,s,C):Ms(n,C)}):null}function dc({open:t,colSpan:e,content:r,collapseProps:n}){let{expanded:s,visible:u}=zu(t,n?.transitionDuration);return u?y.jsxs(y.Fragment,{children:[y.jsx(O.TableTr,{}),y.jsx(O.TableTr,{children:y.jsx(O.TableTd,{className:"mantine-datatable-row-expansion-cell",colSpan:e,children:y.jsx(O.Collapse,{in:s,...n,children:y.jsx("div",{className:"mantine-datatable-row-expansion-cell-content",children:r()})})})})]}):null}function hc({className:t,style:e,record:r,index:n,trigger:s,onChange:u,withRightShadow:d,checkboxProps:i,getCheckboxProps:m,...b}){let _={...i,...m(r,n)},M=!b.disabled&&!_.disabled,C=S=>{S.stopPropagation(),s==="cell"&&M&&u?.(S)};return y.jsx(O.TableTd,{className:Oe("mantine-datatable-row-selector-cell",{[Nt]:s==="cell"&&M},t),style:e,"data-shadow-visible":d||void 0,onClick:C,children:y.jsx(O.Checkbox,{classNames:M?{input:Nt}:void 0,onChange:u,...b,..._})})}function fc({record:t,index:e,columns:r,defaultColumnProps:n,defaultColumnRender:s,selectionTrigger:u,selectionVisible:d,selectionChecked:i,onSelectionChange:m,isRecordSelectable:b,selectionCheckboxProps:_,getSelectionCheckboxProps:M,onClick:C,onDoubleClick:S,onContextMenu:P,onCellClick:j,onCellDoubleClick:N,onCellContextMenu:F,expansion:B,customAttributes:K,color:q,backgroundColor:te,className:ne,style:G,selectorCellShadowVisible:ee,selectionColumnClassName:V,selectionColumnStyle:H,rowFactory:X}){let ie=y.jsxs(y.Fragment,{children:[d&&y.jsx(hc,{className:V,style:H,record:t,index:e,trigger:u,withRightShadow:ee,checked:i,disabled:!m||(b?!b(t,e):!1),onChange:m,checkboxProps:_,getCheckboxProps:M}),r.map(({hidden:x,hiddenContent:w,...h},l)=>{if(x||w)return null;let{accessor:p,visibleMediaQuery:f,textAlign:a,noWrap:v,ellipsis:D,width:T,render:z,cellsClassName:Q,cellsStyle:Z,customCellAttributes:U}={...n,...h};return y.jsx(cc,{className:typeof Q=="function"?Q(t,e):Q,style:Z?.(t,e),visibleMediaQuery:f,record:t,index:e,onClick:j?ae=>j({event:ae,record:t,index:e,column:h,columnIndex:l}):void 0,onDoubleClick:N?ae=>N({event:ae,record:t,index:e,column:h,columnIndex:l}):void 0,onContextMenu:F?ae=>F({event:ae,record:t,index:e,column:h,columnIndex:l}):void 0,accessor:p,textAlign:a,noWrap:v,ellipsis:D,width:T,render:z,defaultRender:s,customCellAttributes:U},p)})]}),re=B&&y.jsx(dc,{colSpan:r.filter(({hidden:x})=>!x).length+(d?1:0),open:B.isRowExpanded(t),content:B.content({record:t,index:e}),collapseProps:B.collapseProps}),k=pc({record:t,index:e,selectionChecked:i,onClick:C,onDoubleClick:S,onContextMenu:P,expansion:B,customAttributes:K,color:q,backgroundColor:te,className:ne,style:G});return X?X({record:t,index:e,rowProps:k,children:ie,expandedElement:re}):y.jsxs(y.Fragment,{children:[y.jsx(O.TableTr,{...k,children:ie}),re]})}function pc({record:t,index:e,selectionChecked:r,onClick:n,onDoubleClick:s,onContextMenu:u,expansion:d,customAttributes:i,color:m,backgroundColor:b,className:_,style:M}){return{className:Oe("mantine-datatable-row",{[Nt]:n||s||d?.isExpandable({record:t,index:e})&&d?.expandOnClick},{[As]:u},typeof _=="function"?_(t,e):_),"data-selected":r||void 0,onClick:C=>{if(d){let{isExpandable:S,isRowExpanded:P,expandOnClick:j,expandRow:N,collapseRow:F}=d;S({record:t,index:e})&&j&&(P(t)?F(t):N(t))}n?.({event:C,record:t,index:e})},onDoubleClick:s?C=>s({event:C,record:t,index:e}):void 0,onContextMenu:u?C=>u({event:C,record:t,index:e}):void 0,style:[m||b?C=>{let S=m?.(t,e),P=b?.(t,e);return ic({theme:C,color:S,backgroundColor:P})}:void 0,M?.(t,e)],...i?.(t,e)??{}}}function gc({leftShadowBehind:t,rightShadowBehind:e,onScrollPositionChange:r,children:n,viewportRef:s,scrollAreaProps:u}){return y.jsxs(O.ScrollArea,{...u,viewportRef:s,classNames:{root:"mantine-datatable-scroll-area",scrollbar:"mantine-datatable-scroll-area-scrollbar",thumb:"mantine-datatable-scroll-area-thumb",corner:"mantine-datatable-scroll-area-corner"},onScrollPositionChange:r,children:[n,y.jsx(O.Box,{className:Oe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow")}),y.jsx("div",{className:Oe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-behind":t})}),y.jsx("div",{className:Oe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-behind":e})}),y.jsx(O.Box,{className:Oe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow")})]})}function mc({withTableBorder:t,borderRadius:e,textSelectionDisabled:r,height:n="100%",minHeight:s,maxHeight:u,shadow:d,verticalAlign:i="center",fetching:m,columns:b,storeColumnsKey:_,groups:M,pinFirstColumn:C,pinLastColumn:S,defaultColumnProps:P,defaultColumnRender:j,idAccessor:N="id",records:F,selectionTrigger:B="checkbox",selectedRecords:K,onSelectedRecordsChange:q,selectionColumnClassName:te,selectionColumnStyle:ne,isRecordSelectable:G,selectionCheckboxProps:ee,allRecordsSelectionCheckboxProps:V={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:H=(Ee,tt)=>({"aria-label":`Select record ${tt+1}`}),sortStatus:X,sortIcons:ie,onSortStatusChange:re,horizontalSpacing:k,page:x,onPageChange:w,totalRecords:h,recordsPerPage:l,onRecordsPerPageChange:p,recordsPerPageOptions:f,recordsPerPageLabel:a="Records per page",paginationWithEdges:v,paginationWithControls:D,paginationActiveTextColor:T,paginationActiveBackgroundColor:z,paginationSize:Q="sm",paginationText:Z=({from:Ee,to:tt,totalRecords:kt})=>`${Ee} - ${tt} / ${kt}`,paginationWrapBreakpoint:U="sm",getPaginationControlProps:ae=Ee=>Ee==="previous"?{"aria-label":"Previous page"}:Ee==="next"?{"aria-label":"Next page"}:{},getPaginationItemProps:se,renderPagination:ue,loaderBackgroundBlur:E,customLoader:L,loaderSize:$,loaderType:I,loaderColor:Y,loadingText:de="...",emptyState:o,noRecordsText:c="No records",noRecordsIcon:g,highlightOnHover:A,striped:R,noHeader:W,onRowClick:le,onRowDoubleClick:fe,onRowContextMenu:pe,onCellClick:oe,onCellDoubleClick:ce,onCellContextMenu:ge,onScroll:me,onScrollToTop:Ce,onScrollToBottom:Se,onScrollToLeft:De,onScrollToRight:Qe,c:Ae,backgroundColor:ke,borderColor:wt,rowBorderColor:$e,stripedColor:dt,highlightOnHoverColor:We,rowColor:_t,rowBackgroundColor:Ye,rowExpansion:Ie,rowClassName:lt,rowStyle:xt,customRowAttributes:Ke,scrollViewportRef:Ze,scrollAreaProps:Je,tableRef:Xe,bodyRef:at,m:ut,my:be,mx:Pe,mt:Ue,mb:ht,ml:er,mr:Ct,className:St,classNames:et,style:Lt,styles:ft,rowFactory:tr,tableWrapper:Dt,...ct}){let Ee=J.useMemo(()=>M?Dn(M):b,[b,M]),[tt,kt]=J.useState(!1),{refs:ve,onScroll:we}=Eu({scrollCallbacks:{onScroll:me,onScrollToTop:Ce,onScrollToBottom:Se,onScrollToLeft:De,onScrollToRight:Qe},withRowBorders:ct.withRowBorders}),qe=Au({key:_,columns:Ee,headerRef:ve.header,scrollViewportRef:ve.scrollViewport,onFixedLayoutChange:kt}),Re=Ne.useMergedRef(ve.table,Xe),Me=Ne.useMergedRef(ve.scrollViewport,Ze),rt=Yu({rowExpansion:Ie,records:F,idAccessor:N}),ze=J.useRef(!1),Ot=J.useRef(x),jn=J.useRef(F),Gc=J.useCallback(xe=>{ze.current=!0,jn.current=F,w(xe)},[w,F]);J.useEffect(()=>{Ot.current!==x&&(ze.current=!0,jn.current=F,Ot.current=x)},[x,F]);let Rr=F?.length;J.useLayoutEffect(()=>{if(!ze.current||m||F===jn.current)return;let xe=ve.scrollViewport.current;if(!xe)return;let jt=requestAnimationFrame(()=>{xe.scrollTo({top:0,left:0}),ze.current=!1});return()=>cancelAnimationFrame(jt)},[m,F,ve.scrollViewport]);let Ys=F?.map(xe=>Be(xe,N)),Bt=!!K,rr=K?.map(xe=>Be(xe,N)),zs=Ys!==void 0&&rr!==void 0&&rr.length>0,An=G?F?.filter(G):F,Nr=An?.map(xe=>Be(xe,N)),Lr=zs&&Nr.every(xe=>rr.includes(xe)),Qc=zs&&Nr.some(xe=>rr.includes(xe)),Kc=J.useCallback(()=>{K&&q&&q(Lr?K.filter(xe=>!Nr.includes(Be(xe,N))):Sn([...K,...An],xe=>Be(xe,N)))},[Lr,N,q,Nr,An,K]),{lastSelectionChangeIndex:Br,setLastSelectionChangeIndex:Zc}=Tu(Ys),En=Bt&&!C,Jc={m:ut,my:be,mx:Pe,mt:Ue,mb:ht,ml:er,mr:Ct},Xc=J.useCallback(({children:xe})=>Dt?Dt({children:xe}):xe,[Dt]);return y.jsx(_s,{...qe,children:y.jsxs(O.Box,{ref:ve.root,...Jc,className:Oe("mantine-datatable",{"mantine-datatable-with-border":t},St,et?.root),style:[xe=>({...sc({theme:xe,c:Ae,backgroundColor:ke,borderColor:wt,rowBorderColor:$e,stripedColor:dt,highlightOnHoverColor:We}),borderRadius:xe.radius[e]||e,boxShadow:xe.shadows[d]||d,height:n,minHeight:s,maxHeight:u}),Lt,ft?.root,{position:"relative"}],children:[y.jsx(gc,{viewportRef:Me,leftShadowBehind:Bt||!!C,rightShadowBehind:S,onScrollPositionChange:we,scrollAreaProps:Je,children:y.jsx(Xc,{children:y.jsxs(O.Table,{ref:Re,horizontalSpacing:k,className:Oe("mantine-datatable-table",{[Fu]:r,"mantine-datatable-vertical-align-top":i==="top","mantine-datatable-vertical-align-bottom":i==="bottom","mantine-datatable-pin-last-column":S,"mantine-datatable-selection-column-visible":Bt,"mantine-datatable-pin-first-column":C,"mantine-datatable-resizable-columns":qe.hasResizableColumns&&tt},et?.table),style:{...ft?.table},"data-striped":Rr&&R||void 0,"data-highlight-on-hover":A||void 0,...ct,children:[W?null:y.jsx(_s,{...qe,children:y.jsx(nc,{ref:ve.header,selectionColumnHeaderRef:ve.selectionColumnHeader,className:et?.header,style:ft?.header,columns:Ee,defaultColumnProps:P,groups:M,sortStatus:X,sortIcons:ie,onSortStatusChange:re,selectionTrigger:B,selectionVisible:Bt,selectionChecked:Lr,selectionIndeterminate:Qc&&!Lr,onSelectionChange:Kc,selectionCheckboxProps:{...ee,...V},selectorCellShadowVisible:En,selectionColumnClassName:te,selectionColumnStyle:ne,withColumnBorders:ct.withColumnBorders})}),y.jsx("tbody",{ref:at,children:Rr?F.map((xe,jt)=>{let Tn=Be(xe,N),$n=rr?.includes(Tn)||!1,Fs;return q&&K&&(Fs=ed=>{if(ed.nativeEvent.shiftKey&&Br!==null){let It=F.filter(jt>Br?(At,Et)=>Et>=Br&&Et<=jt&&(G?G(At,Et):!0):(At,Et)=>Et>=jt&&Et<=Br&&(G?G(At,Et):!0));q($n?Bu(K,It,At=>Be(At,N)):Sn([...K,...It],At=>Be(At,N)))}else q($n?K.filter(It=>Be(It,N)!==Tn):Sn([...K,xe],It=>Be(It,N)));Zc(jt)}),y.jsx(fc,{record:xe,index:jt,columns:Ee,defaultColumnProps:P,defaultColumnRender:j,selectionTrigger:B,selectionVisible:Bt,selectionChecked:$n,onSelectionChange:Fs,isRecordSelectable:G,selectionCheckboxProps:ee,getSelectionCheckboxProps:H,onClick:le,onDoubleClick:fe,onCellClick:oe,onCellDoubleClick:ce,onContextMenu:pe,onCellContextMenu:ge,expansion:rt,color:_t,backgroundColor:Ye,className:lt,style:xt,customAttributes:Ke,selectorCellShadowVisible:En,selectionColumnClassName:te,selectionColumnStyle:ne,idAccessor:N,rowFactory:tr},Tn)}):y.jsx(Du,{})}),Ee.some(({footer:xe})=>xe)&&y.jsx(qu,{ref:ve.footer,className:et?.footer,style:ft?.footer,columns:Ee,defaultColumnProps:P,selectionVisible:Bt,selectorCellShadowVisible:En})]})})}),x&&y.jsx(uc,{className:et?.pagination,style:ft?.pagination,horizontalSpacing:k,fetching:m,page:x,onPageChange:Gc,totalRecords:h,recordsPerPage:l,onRecordsPerPageChange:p,recordsPerPageOptions:f,recordsPerPageLabel:a,paginationWithEdges:v,paginationWithControls:D,paginationActiveTextColor:T,paginationActiveBackgroundColor:z,paginationSize:Q,paginationText:Z,paginationWrapBreakpoint:U,getPaginationControlProps:ae,getPaginationItemProps:se,noRecordsText:c,loadingText:de,recordsLength:Rr,renderPagination:ue}),y.jsx(oc,{fetching:m,backgroundBlur:E,customContent:L,size:$,type:I,color:Y}),y.jsx(Pu,{icon:g,text:c,active:!m&&!Rr,children:o})]})})}function $s(t){const e=Fe.c(42),{fields:r,onClose:n,queryKey:s,apiPath:u,id:d,steps:i}=t,[m,b]=J.useState(0),[_,M]=J.useState(!1),{data:C,isLoading:S}=Qo(u,s,d),{mutateAsync:P,isError:j,error:N,isPending:F}=fn(u,s);let B;e[0]!==r?(B=new Set(r.filter(xc).map(_c)),e[0]=r,e[1]=B):B=e[1];let K;e[2]!==B?(K=[...B],e[2]=B,e[3]=K):K=e[3];const q=K;let te;e[4]!==r?(te=r.reduce(wc,{}),e[4]=r,e[5]=te):te=e[5];let ne;e[6]!==r?(ne=r.filter(bc).reduce(vc,{}),e[6]=r,e[7]=ne):ne=e[7];let G;e[8]!==te||e[9]!==ne?(G={mode:"uncontrolled",initialValues:te,validate:ne},e[8]=te,e[9]=ne,e[10]=G):G=e[10];const ee=Rn.useForm(G);let V;e[11]!==C||e[12]!==r||e[13]!==ee?(V=()=>{if(C){const l={...C};r.forEach(p=>{const f=p.id;p.type==="boolean"&&l[f]===null?l[f]=!1:p.type==="date"&&l[f]?l[f]=new Date(l[f]):l[f]===null&&(l[f]="")}),ee.initialize(l),ee.setValues(l)}},e[11]=C,e[12]=r,e[13]=ee,e[14]=V):V=e[14];let H;e[15]!==C?(H=[C],e[15]=C,e[16]=H):H=e[16],J.useEffect(V,H);let X;e[17]===Symbol.for("react.memo_cache_sentinel")?(X=function(p,f){return typeof p.required=="function"?p.required(f??{}):!!p.required},e[17]=X):X=e[17];const ie=X;let re;e[18]!==ee||e[19]!==d?(re=function(p){const f=ee.getValues();if(p.conditional&&!p.conditional(f))return null;const a=ie(p,f);return y.jsxs(J.Fragment,{children:[(p.type===void 0||p.type=="text")&&y.jsx(O.TextInput,{label:p.column.title,placeholder:p.placeholder??"",...ee.getInputProps(p.id),type:p.id.includes("email")?"email":void 0,required:a},ee.key(p.id)),p.type==="number"&&y.jsx(O.NumberInput,{decimalSeparator:",",label:p.column.title,placeholder:p.placeholder??"",...ee.getInputProps(p.id),required:a},ee.key(p.id)),p.type==="date"&&y.jsx(jr,{label:p.column.title,placeholder:p.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...ee.getInputProps(p.id),required:a},ee.key(p.id)),p.type==="boolean"&&y.jsx(O.Checkbox,{mt:"md",label:p.column.title,...ee.getInputProps(p.id,{type:"checkbox"}),required:a},ee.key(p.id)),p.type==="textarea"&&y.jsx(O.Textarea,{label:p.column.title,placeholder:p.placeholder??"",...ee.getInputProps(p.id),minRows:3,autosize:!0,required:a},ee.key(p.id)),p.type==="custom"&&p.render&&p.render({...ee.getValues(),id:d},ee.setValues,M,{error:ee.getInputProps(p.id).error,required:a})]},p.id)},e[18]=ee,e[19]=d,e[20]=re):re=e[20];const k=re;let x;e[21]!==j||e[22]!==N?.message||e[23]!==N?.name?(x=j&&y.jsx(O.Alert,{variant:"outline",color:"red",title:N?.name??"Fehler aufgetreten",mb:"lg",children:N?.message??"Fehler aufgetreten"}),e[21]=j,e[22]=N?.message,e[23]=N?.name,e[24]=x):x=e[24];let w;e[25]!==m||e[26]!==r||e[27]!==ee||e[28]!==_||e[29]!==d||e[30]!==S||e[31]!==F||e[32]!==j||e[33]!==n||e[34]!==k||e[35]!==i||e[36]!==q||e[37]!==P?(w=S?y.jsxs(O.Stack,{gap:"md",children:[y.jsx(O.Skeleton,{height:40}),Array(r.length).fill(0).map(yc),y.jsxs(O.Group,{mt:"md",justify:"end",children:[y.jsx(O.Skeleton,{width:100,height:36}),y.jsx(O.Skeleton,{width:100,height:36})]})]}):y.jsxs("form",{onSubmit:ee.onSubmit(async l=>{await P({...l,id:d}),q.length&&m<q.length-1?j||b(m+1):j||(ee.setInitialValues(l),ee.reset(),n())}),children:[q.length?y.jsx(O.Stepper,{active:m,size:"sm",children:q.map(l=>y.jsx(O.Stepper.Step,{...i&&i[l-1]?{label:i[l-1].label}:{},children:r.filter(p=>p.step===l).map(p=>k(p))},l))}):r.map(l=>k(l)),!_&&y.jsxs(O.Group,{mt:"md",justify:"end",children:[y.jsx(O.Button,{onClick:()=>q.length?m===0?n():b(m-1):n(),variant:"outline",children:q.length?m===0?"Abbrechen":"Zurück":"Abbrechen"}),y.jsx(O.Button,{type:"submit",loading:F,children:q.length?m===q.length-1?"Speichern":"Weiter":"Speichern"})]})]}),e[25]=m,e[26]=r,e[27]=ee,e[28]=_,e[29]=d,e[30]=S,e[31]=F,e[32]=j,e[33]=n,e[34]=k,e[35]=i,e[36]=q,e[37]=P,e[38]=w):w=e[38];let h;return e[39]!==x||e[40]!==w?(h=y.jsxs(y.Fragment,{children:[x,w]}),e[39]=x,e[40]=w,e[41]=h):h=e[41],h}function yc(t,e){return y.jsx(O.Skeleton,{height:35},`skeleton-field-${e}`)}function vc(t,e){return t[e.id]=(r,n)=>e.conditional&&!e.conditional(n)||!(typeof e.required=="function"?e.required(n):!!e.required)||r?null:"Pflichtfeld",t}function bc(t){return t.required}function wc(t,e){return t[e.id]=e.type==="boolean"?e.defaultValue??!1:e.defaultValue??"",t}function _c(t){return t.step}function xc(t){return typeof t.step=="number"}function Rs({queryKey:t,apiPath:e,onClose:r,selectedRecords:n}){const{mutateAsync:s,isError:u,error:d,isPending:i}=Jo(e,t),[m,b]=J.useState(n),[_,M]=J.useState(!1),C=_||i;return J.useEffect(()=>{m.length||r()},[r,m]),m.length?y.jsxs(y.Fragment,{children:[u&&d.message&&y.jsx(O.Alert,{variant:"outline",color:"red",title:d.name,children:d.message}),y.jsx(O.Text,{children:m.length===1?`Soll ${m.length} Eintrag wirklich gelöscht werden?`:`Sollen ${m.length} Einträge wirklich gelöscht werden?`}),y.jsxs(O.Group,{mt:"md",justify:"end",children:[y.jsx(O.Button,{onClick:r,variant:"outline",disabled:C,children:"Abbrechen"}),y.jsx(O.Button,{color:"red",loading:C,onClick:async()=>{M(!0);try{await Promise.all(m.map(S=>s(S.id))),b([])}finally{M(!1)}},children:"Löschen"})]})]}):y.jsx(y.Fragment,{})}function Ns(t,e){const r=Fe.c(8);let n;r[0]!==t||r[1]!==e?(n=()=>{const b=localStorage.getItem(`use_persistent_storage_${e}`);return b?JSON.parse(b):t},r[0]=t,r[1]=e,r[2]=n):n=r[2];const[s,u]=J.useState(n);let d;r[3]!==e?(d=b=>{u(b),localStorage.setItem(`use_persistent_storage_${e}`,JSON.stringify(b))},r[3]=e,r[4]=d):d=r[4];const i=d;let m;return r[5]!==i||r[6]!==s?(m=[s,i],r[5]=i,r[6]=s,r[7]=m):m=r[7],m}const Cc=(t,e)=>{const r=t.map(m=>m[e]).filter(m=>m!=null&&m!=="");if(r.length===0)return"string";const n=Math.min(100,r.length),s=r.slice(0,n),u={string:0,number:0,date:0},d=[/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,/^\d{4}-\d{2}-\d{2}$/,/^\d{1,2}\/\d{1,2}\/\d{4}$/,/^\d{1,2}\.\d{1,2}\.\d{4}$/];s.forEach(m=>{if(typeof m=="number")u.number++;else if(typeof m=="string"){const b=m.trim();if(b!==""&&!isNaN(Number(b))&&!isNaN(parseFloat(b))){u.number++;return}if(d.some(_=>_.test(b))){const _=new Date(b);if(!isNaN(_.getTime())){u.date++;return}}u.string++}else m instanceof Date?u.date++:u.string++});const i=u.string+u.number+u.date;return u.date/i>=.6?"date":u.number/i>=.6?"number":u.string/i>=.6?"string":"mixed"},Ls=new Map,Bs=(t,e,r="asc")=>{if(!t||t.length===0)return[];const n=`${String(e)}_${t.length}`;let s=Ls.get(n);return s||(s=Cc(t,e),Ls.set(n,s)),[...t].sort((d,i)=>{const m=d[e],b=i[e],_=m==null||m==="",M=b==null||b==="";if(_&&M)return 0;if(_)return r==="asc"?-1:1;if(M)return r==="asc"?1:-1;let C,S;switch(s){case"date":if(typeof m=="string"){const B=new Date(m.trim());C=isNaN(B.getTime())?null:B.getTime()}else m instanceof Date?C=m.getTime():C=null;if(typeof b=="string"){const B=new Date(b.trim());S=isNaN(B.getTime())?null:B.getTime()}else b instanceof Date?S=b.getTime():S=null;break;case"number":if(typeof m=="number")C=m;else{const B=String(m).trim(),K=parseFloat(B);C=isNaN(K)?null:K}if(typeof b=="number")S=b;else{const B=String(b).trim(),K=parseFloat(B);S=isNaN(K)?null:K}break;case"string":const P=typeof m=="string"?m:String(m),j=typeof b=="string"?b:String(b);C=P.toLowerCase().trim(),S=j.toLowerCase().trim();break;case"mixed":default:const N=String(m),F=String(b);C=N.toLowerCase().trim(),S=F.toLowerCase().trim();break}return C===null&&S===null?0:C===null?r==="asc"?1:-1:S===null||C<S?r==="asc"?-1:1:C>S?r==="asc"?1:-1:0})};function Sc(t,e){return e.split(".").reduce((r,n)=>{if(r&&typeof r=="object"&&n in r)return r[n]},t)}function Dc(t,e){const r=e.column;if(r.render)return r.render(t,0);const n=r.accessor??e.id,s=Sc(t,n);return s==null?y.jsx(O.Text,{c:"dimmed",children:"–"}):typeof s=="boolean"?y.jsx(O.Text,{fz:"sm",children:s?"Ja":"Nein"}):y.jsx(O.Text,{fz:"sm",children:String(s)})}function kc(t){const e=Fe.c(10),{field:r,record:n}=t,s=r.column.title??r.id;let u;e[0]!==s?(u=y.jsx(O.Text,{fw:700,fz:"sm",children:s}),e[0]=s,e[1]=u):u=e[1];let d;e[2]!==r||e[3]!==n?(d=Dc(n,r),e[2]=r,e[3]=n,e[4]=d):d=e[4];let i;e[5]!==d?(i=y.jsx(O.Box,{ta:"right",fz:"sm",children:d}),e[5]=d,e[6]=i):i=e[6];let m;return e[7]!==u||e[8]!==i?(m=y.jsxs(O.Group,{wrap:"nowrap",justify:"space-between",align:"center",py:"xs",px:"sm",children:[u,i]}),e[7]=u,e[8]=i,e[9]=m):m=e[9],m}function Is(t){const e=Fe.c(42),{records:r,fields:n,selection:s,selectedRecords:u,onSelectedRecordsChange:d,onRowClick:i,actions:m,canUpdate:b,canDelete:_,pagination:M,sort:C,rowExpansion:S}=t;let P;e[0]!==u?(P=u===void 0?[]:u,e[0]=u,e[1]=P):P=e[1];const j=P;let N;e[2]===Symbol.for("react.memo_cache_sentinel")?(N=new Set,e[2]=N):N=e[2];const[F,B]=J.useState(N);let K;e[3]===Symbol.for("react.memo_cache_sentinel")?(K=re=>{B(k=>{const x=new Set(k);return x.has(re)?x.delete(re):x.add(re),x})},e[3]=K):K=e[3];const q=K;let te,ne,G,ee,V,H;if(e[4]!==m||e[5]!==_||e[6]!==b||e[7]!==F||e[8]!==n||e[9]!==i||e[10]!==d||e[11]!==r||e[12]!==S||e[13]!==j||e[14]!==s||e[15]!==C){H=Symbol.for("react.early_return_sentinel");e:{const re=n.filter(Ec),k=re.filter(Ac).reduce(jc,[]);let x;e[22]!==j?(x=a=>j.some(v=>v.id===a.id),e[22]=j,e[23]=x):x=e[23];const w=x;let h;e[24]!==w||e[25]!==d||e[26]!==j?(h=a=>{d&&(w(a)?d(j.filter(v=>v.id!==a.id)):d([...j,a]))},e[24]=w,e[25]=d,e[26]=j,e[27]=h):h=e[27];const l=h;let p;e[28]!==i||e[29]!==s||e[30]!==l?(p=(a,v,D)=>{i?i({record:a,index:v,event:D}):s&&l(a)},e[28]=i,e[29]=s,e[30]=l,e[31]=p):p=e[31];const f=p;if(r.length===0){let a;e[32]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx(O.Text,{c:"dimmed",ta:"center",py:"xl",children:"Keine Einträge gefunden"}),e[32]=a):a=e[32],H=a;break e}te=O.Stack,ne="sm",G="md",ee=C&&k.length>0&&y.jsxs(O.Group,{gap:"xs",wrap:"nowrap",children:[y.jsx(O.Select,{data:k,value:C.field,onChange:a=>a&&C.onSortChange(a,C.direction),allowDeselect:!1,style:{flex:1}}),y.jsx(O.ActionIcon,{variant:"filled",size:"input-sm",onClick:()=>C.onSortChange(C.field,C.direction==="asc"?"desc":"asc"),children:C.direction==="asc"?y.jsx(nt.IconSortAscending,{size:18}):y.jsx(nt.IconSortDescending,{size:18})})]}),V=r.map((a,v)=>{const D=w(a),T=!!i||!!s,z=a.id??v,Q=F.has(z);return y.jsx(J.Fragment,{children:y.jsxs(O.Box,{bg:D?"var(--mantine-primary-color-light)":v%2===0?"var(--mantine-color-gray-0)":"white",bd:D?void 0:"1px solid var(--mantine-color-gray-2)",style:{borderRadius:"var(--mantine-radius-md)",overflow:"hidden"},children:[y.jsxs(O.Box,{w:"100%",style:{cursor:T||S?"pointer":"default"},onClick:Z=>{S&&!i?q(z):f(a,v,Z)},children:[(s||S||m&&m.length>0)&&y.jsxs(O.Group,{px:"sm",pt:"sm",justify:"space-between",children:[y.jsxs(O.Group,{gap:"xs",children:[S&&y.jsx(O.Box,{c:"var(--mantine-primary-color-filled)",style:{cursor:"pointer",display:"flex",alignItems:"center"},onClick:Z=>{Z.stopPropagation(),q(z)},children:y.jsx(nt.IconChevronDown,{size:16,style:{transform:Q?"rotate(0deg)":"rotate(-90deg)",transition:"transform 200ms"}})}),s&&y.jsx(O.Checkbox,{checked:D,onChange:()=>l(a),onClick:Oc})]}),m&&m.length>0&&(()=>{const Z=m.filter(U=>!(U.label==="Bearbeiten"&&b&&!b(a)||U.label==="Löschen"&&_&&!_(a)));return Z.length===0?null:y.jsxs(O.Menu,{shadow:"md",position:"bottom-end",children:[y.jsx(O.Menu.Target,{children:y.jsx(O.ActionIcon,{variant:"subtle",color:"gray",size:"sm",onClick:Mc,children:y.jsx(nt.IconDotsVertical,{size:16})})}),y.jsx(O.Menu.Dropdown,{children:Z.map((U,ae)=>y.jsx(O.Menu.Item,{leftSection:U.icon,onClick:se=>{se.stopPropagation(),U.onClick([a])},children:U.label},`card_action_${ae}`))})]})})()]}),re.map((Z,U)=>y.jsxs(J.Fragment,{children:[U>0&&y.jsx(O.Divider,{}),y.jsx(kc,{field:Z,record:a})]},Z.id))]}),S&&y.jsxs(O.Collapse,{in:Q,children:[y.jsx(O.Divider,{}),y.jsx(O.Box,{px:"sm",py:"sm",children:S.content(a)})]})]})},z)})}e[4]=m,e[5]=_,e[6]=b,e[7]=F,e[8]=n,e[9]=i,e[10]=d,e[11]=r,e[12]=S,e[13]=j,e[14]=s,e[15]=C,e[16]=te,e[17]=ne,e[18]=G,e[19]=ee,e[20]=V,e[21]=H}else te=e[16],ne=e[17],G=e[18],ee=e[19],V=e[20],H=e[21];if(H!==Symbol.for("react.early_return_sentinel"))return H;let X;e[33]!==M?(X=M&&M.totalRecords>M.recordsPerPage&&y.jsxs(O.Stack,{gap:"xs",mt:"sm",children:[y.jsx(O.Group,{justify:"center",children:y.jsx(O.Pagination,{total:Math.ceil(M.totalRecords/M.recordsPerPage),value:M.page,onChange:M.onPageChange,size:"sm"})}),M.recordsPerPageOptions&&M.onRecordsPerPageChange&&y.jsxs(O.Group,{justify:"center",gap:"xs",children:[y.jsx(O.Text,{fz:"xs",c:"dimmed",children:"Einträge pro Seite:"}),y.jsx(O.Select,{data:M.recordsPerPageOptions.map(Pc),value:String(M.recordsPerPage),onChange:re=>re&&M.onRecordsPerPageChange(Number(re)),allowDeselect:!1,size:"xs",w:70})]})]}),e[33]=M,e[34]=X):X=e[34];let ie;return e[35]!==te||e[36]!==X||e[37]!==ne||e[38]!==G||e[39]!==ee||e[40]!==V?(ie=y.jsxs(te,{gap:ne,my:G,children:[ee,V,X]}),e[35]=te,e[36]=X,e[37]=ne,e[38]=G,e[39]=ee,e[40]=V,e[41]=ie):ie=e[41],ie}function Pc(t){return{value:String(t),label:String(t)}}function Mc(t){return t.stopPropagation()}function Oc(t){return t.stopPropagation()}function jc(t,e){const r=e.column.accessor??e.id;return t.some(n=>n.value===r)||t.push({value:r,label:e.column.title??e.id}),t}function Ac(t){return t.column.sortable!==!1}function Ec(t){return t.list&&t.column}const On=[10,15,50,100,500];function Tc(t){const e=Fe.c(134),{title:r,queryKey:n,connectedQueryKeys:s,apiPath:u,mutationApiPath:d,buttons:i,fields:m,selection:b,pagination:_,filters:M,actions:C,steps:S,defaultSort:P,onSortChange:j,createButtonText:N,queryParams:F,tabs:B,defaultTab:K,activeTab:q,onActiveTabChange:te,canUpdate:ne,canDelete:G,showRefresh:ee,rowExpansion:V,onRowClick:H,mobileCards:X,footer:ie}=t,re=ee===void 0?!0:ee,k=X===void 0?!1:X,[x,w]=J.useState(K||(B&&B.length>0?B[0].value:null)),h=q!==void 0?q:x;let l;e[0]!==q||e[1]!==te?(l=ve=>{q===void 0&&w(ve),te&&te(ve)},e[0]=q,e[1]=te,e[2]=l):l=e[2];const p=l,f=B?.find(ve=>ve.value===h)?.queryParams||{},a={...F,...f},v=a?"?"+Object.entries(a).filter(Vc).map(qc).join("&"):"";let D;e[3]!==h||e[4]!==n?(D=h?[...n,h]:n,e[3]=h,e[4]=n,e[5]=D):D=e[5];const T=D,{data:z,isLoading:Q,isError:Z,isRefetching:U,refetch:ae}=Ko(u+v,T),{queryClient:se}=mt();let ue,E;e[6]!==z||e[7]!==s||e[8]!==se?(ue=()=>{!z||!Array.isArray(z)||s?.forEach(ve=>se.invalidateQueries({queryKey:ve}))},E=[z,s,se],e[6]=z,e[7]=s,e[8]=se,e[9]=ue,e[10]=E):(ue=e[9],E=e[10]),J.useEffect(ue,E);const L=!z||!Array.isArray(z)?[]:!M||M.length===0?z:z.filter(ve=>M.every(we=>{if(we.value===void 0)return!0;const qe=we.id;if(we.type==="query"){const Re=ve[qe];return Array.isArray(we.value)?Array.isArray(Re)?Re.some(Me=>{if(typeof Me=="string"||typeof Me=="number")return we.value.includes(String(Me));if(Me&&typeof Me=="object"){if("id"in Me&&we.value.includes(Me.id))return!0;for(const rt in Me){const ze=Me[rt];if(typeof ze=="string"&&we.value.includes(ze)||ze&&typeof ze=="object"&&"id"in ze&&we.value.includes(ze.id))return!0}}return!1}):Re&&typeof Re=="object"&&"id"in Re?we.value.includes(Re.id):!1:typeof Re=="string"&&Re.includes(we.value)}else if(we.type==="date"){const Re=we.value;if(!Re)return!0;const[Me,rt]=Re;if(!Me&&!rt)return!0;const ze=ve[qe];if(typeof ze=="string"){const Ot=ze.split(" ")[0];if(Me&&rt)return Ot>=Me&&Ot<=rt;if(Me&&!rt)return Ot>=Me;if(!Me&&rt)return Ot<=rt}return!0}else if(we.type==="boolean")return ve[qe]===we.value;return!0})),$=P?.field??m[0].id,I=P?.direction??"desc";let Y;e[11]!==$||e[12]!==I?(Y={columnAccessor:$,direction:I},e[11]=$,e[12]=I,e[13]=Y):Y=e[13];const[de,o]=J.useState(Y);let c;e[14]!==j?(c=ve=>{o(ve),j&&j(String(ve.columnAccessor),ve.direction)},e[14]=j,e[15]=c):c=e[15];const g=c,A=Bs(L,de.columnAccessor,de.direction),[R,W]=Ns(On[1],"mantine-table-page-size"),[le,fe]=J.useState(1),pe=_?A.slice((le-1)*R,le*R):A;let oe;e[16]===Symbol.for("react.memo_cache_sentinel")?(oe=[],e[16]=oe):oe=e[16];const[ce,ge]=J.useState(oe);let me;e[17]===Symbol.for("react.memo_cache_sentinel")?(me=()=>{ge([])},e[17]=me):me=e[17];let Ce;e[18]!==h?(Ce=[h],e[18]=h,e[19]=Ce):Ce=e[19],J.useEffect(me,Ce);const[Se,De]=J.useState(!1),[Qe,Ae]=J.useState(!1),[ke,wt]=J.useState(!1);let $e;e[20]!==m?($e=m.some(Uc),e[20]=m,e[21]=$e):$e=e[21];const dt=$e;let We;e[22]!==m?(We=m.some(Wc),e[22]=m,e[23]=We):We=e[23];const _t=We;let Ye;if(e[24]!==C||e[25]!==_t||e[26]!==dt){if(Ye=[],dt){let ve;e[28]===Symbol.for("react.memo_cache_sentinel")?(ve=y.jsx(nt.IconPencil,{size:14}),e[28]=ve):ve=e[28];let we;e[29]===Symbol.for("react.memo_cache_sentinel")?(we={icon:ve,label:"Bearbeiten",onClick:qe=>{ge(qe),Ae(!0)}},e[29]=we):we=e[29],Ye.push(we)}if(C&&Ye.push(...C),_t){let ve;e[30]===Symbol.for("react.memo_cache_sentinel")?(ve=y.jsx(nt.IconTrash,{size:14}),e[30]=ve):ve=e[30];let we;e[31]===Symbol.for("react.memo_cache_sentinel")?(we={icon:ve,label:"Löschen",onClick:qe=>{ge(qe),wt(!0)}},e[31]=we):we=e[31],Ye.push(we)}e[24]=C,e[25]=_t,e[26]=dt,e[27]=Ye}else Ye=e[27];const Ie=r?"space-between":"end";let lt;e[32]!==r?(lt=r&&(typeof r=="string"?y.jsx(O.Title,{order:4,children:r}):r),e[32]=r,e[33]=lt):lt=e[33];let xt;e[34]===Symbol.for("react.memo_cache_sentinel")?(xt={marginLeft:"auto"},e[34]=xt):xt=e[34];let Ke;e[35]!==ae||e[36]!==re?(Ke=re&&y.jsx(O.ActionIcon,{variant:"subtle",onClick:()=>ae(),"aria-label":"Neuladen",children:y.jsx(nt.IconRefresh,{})}),e[35]=ae,e[36]=re,e[37]=Ke):Ke=e[37];let Ze;e[38]!==C||e[39]!==G||e[40]!==ne||e[41]!==m||e[42]!==k||e[43]!==ce||e[44]!==b?(Ze=(m.some(Fc)||b)&&(()=>{const ve=m.find(zc)&&(!ne||ce.length>0&&ne(ce[0])),we=m.find(Yc)&&(!G||ce.length>0&&G(ce[0])),qe=(C??[]).length>0,Re=ve||we||qe;return y.jsx(O.Box,{...k?{visibleFrom:"sm"}:{},children:y.jsxs(O.Menu,{shadow:"md",children:[y.jsx(O.Menu.Target,{children:y.jsx(O.Button,{variant:"outline",rightSection:y.jsx(nt.IconCaretDownFilled,{size:14}),disabled:!ce.length||!Re,children:"Aktionen"})}),y.jsxs(O.Menu.Dropdown,{children:[ve&&y.jsx(O.Menu.Item,{leftSection:y.jsx(nt.IconPencil,{size:14}),onClick:()=>Ae(!0),disabled:ce.length!==1,children:"Bearbeiten"}),(C??[]).map((Me,rt)=>J.createElement(O.Menu.Item,{...Me.icon&&{leftSection:Me.icon},key:`custom_action_${rt}`,onClick:()=>Me.onClick(ce)},Me.label)),we&&y.jsx(O.Menu.Item,{leftSection:y.jsx(nt.IconTrash,{size:14}),onClick:()=>wt(!0),color:"red",children:"Löschen"})]})]})})})(),e[38]=C,e[39]=G,e[40]=ne,e[41]=m,e[42]=k,e[43]=ce,e[44]=b,e[45]=Ze):Ze=e[45];let Je;e[46]!==N||e[47]!==m||e[48]!==Q?(Je=m.find(Ic)&&y.jsx(O.Button,{onClick:()=>De(!0),disabled:Q,children:N??"Erstellen"}),e[46]=N,e[47]=m,e[48]=Q,e[49]=Je):Je=e[49];let Xe;e[50]!==i||e[51]!==Ke||e[52]!==Ze||e[53]!==Je?(Xe=y.jsxs(O.Group,{align:"center",gap:"xs",wrap:"wrap",justify:"end",style:xt,children:[Ke,Ze,Je,i]}),e[50]=i,e[51]=Ke,e[52]=Ze,e[53]=Je,e[54]=Xe):Xe=e[54];let at;e[55]!==Ie||e[56]!==lt||e[57]!==Xe?(at=y.jsxs(O.Group,{gap:"xs",justify:Ie,align:"center",wrap:"wrap",children:[lt,Xe]}),e[55]=Ie,e[56]=lt,e[57]=Xe,e[58]=at):at=e[58];let ut;e[59]!==h||e[60]!==p||e[61]!==B?(ut=B&&B.length>0&&y.jsx(O.Tabs,{value:h,onChange:p,mt:"md",children:y.jsx(O.Tabs.List,{children:B.map(Bc)})}),e[59]=h,e[60]=p,e[61]=B,e[62]=ut):ut=e[62];let be;e[63]!==Z?(be=Z&&y.jsx(O.Alert,{mt:"md",variant:"light",color:"red",title:"Es ist ein Fehler aufgetreten.",icon:y.jsx(nt.IconInfoCircle,{}),children:"Bitte versuche es später erneut oder sende eine Nachricht an unseren Support."}),e[63]=Z,e[64]=be):be=e[64];let Pe;e[65]!==Q||e[66]!==U?(Pe=(Q||U)&&y.jsxs(O.Stack,{my:"md",children:[y.jsx(O.Skeleton,{height:40}),Array(5).fill(0).map(Lc)]}),e[65]=Q,e[66]=U,e[67]=Pe):Pe=e[67];let Ue;e[68]!==G||e[69]!==ne||e[70]!==m||e[71]!==L||e[72]!==ie||e[73]!==g||e[74]!==Z||e[75]!==Q||e[76]!==U||e[77]!==Ye||e[78]!==k||e[79]!==H||e[80]!==le||e[81]!==R||e[82]!==_||e[83]!==pe||e[84]!==V||e[85]!==ce||e[86]!==b||e[87]!==fe||e[88]!==W||e[89]!==de||e[90]!==A?(Ue=!Q&&!U&&y.jsxs(y.Fragment,{children:[y.jsx(O.Box,{...k?{visibleFrom:"sm"}:{},children:y.jsx(mc,{my:"md",striped:!0,highlightOnHover:!0,minHeight:150,fetching:Z,records:pe,sortStatus:de,onSortStatusChange:g,...b&&{selectedRecords:ce,onSelectedRecordsChange:ge},..._&&pe.length&&{totalRecords:A.length,recordsPerPage:R,onPageChange:fe,page:le,recordsPerPageOptions:On,onRecordsPerPageChange:W,recordsPerPageLabel:"Einträge pro Seite"},...V&&{rowExpansion:{allowMultiple:V.allowMultiple??!1,content:ve=>{const{record:we}=ve;return V.content(we)},...V.expanded&&{expanded:V.expanded}}},columns:m.map(Nc),noRecordsText:"Keine Einträge gefunden",onRowClick:H,...H&&{style:{cursor:"pointer"}}})}),k&&y.jsx(O.Box,{hiddenFrom:"sm",children:y.jsx(Is,{records:pe,fields:m,selection:b,selectedRecords:ce,onSelectedRecordsChange:ge,onRowClick:H,sort:{field:String(de.columnAccessor),direction:de.direction,onSortChange:(ve,we)=>{g({columnAccessor:ve,direction:we})}},..._&&pe.length&&{pagination:{totalRecords:A.length,recordsPerPage:R,page:le,onPageChange:fe,recordsPerPageOptions:On,onRecordsPerPageChange:ve=>{W(ve),fe(1)}}},...V&&{rowExpansion:{content:V.content}},...Ye.length>0&&{actions:Ye,canUpdate:ne,canDelete:G}})}),ie&&ie(L)]}),e[68]=G,e[69]=ne,e[70]=m,e[71]=L,e[72]=ie,e[73]=g,e[74]=Z,e[75]=Q,e[76]=U,e[77]=Ye,e[78]=k,e[79]=H,e[80]=le,e[81]=R,e[82]=_,e[83]=pe,e[84]=V,e[85]=ce,e[86]=b,e[87]=fe,e[88]=W,e[89]=de,e[90]=A,e[91]=Ue):Ue=e[91];let ht;e[92]===Symbol.for("react.memo_cache_sentinel")?(ht=()=>{Ae(!1),ge([])},e[92]=ht):ht=e[92];const er=r??"Bearbeiten";let Ct;e[93]!==u||e[94]!==m||e[95]!==d||e[96]!==n||e[97]!==ce[0]||e[98]!==ce.length||e[99]!==S?(Ct=ce.length>0&&y.jsx($s,{fields:m.filter(Rc),queryKey:n,apiPath:d??u,id:ce[0].id,onClose:()=>{Ae(!1),ge([])},steps:S}),e[93]=u,e[94]=m,e[95]=d,e[96]=n,e[97]=ce[0],e[98]=ce.length,e[99]=S,e[100]=Ct):Ct=e[100];let St;e[101]!==er||e[102]!==Ct||e[103]!==Qe?(St=y.jsx(O.Modal,{opened:Qe,onClose:ht,title:er,children:Ct}),e[101]=er,e[102]=Ct,e[103]=Qe,e[104]=St):St=e[104];let et;e[105]!==u||e[106]!==ke||e[107]!==d||e[108]!==n||e[109]!==ce||e[110]!==r?(et=ce.length>0&&y.jsx(O.Modal,{opened:ke,onClose:()=>{wt(!1),ge([])},title:r??"Löschen",children:y.jsx(Rs,{onClose:()=>{wt(!1),ge([])},queryKey:n,apiPath:d??u,selectedRecords:ce})}),e[105]=u,e[106]=ke,e[107]=d,e[108]=n,e[109]=ce,e[110]=r,e[111]=et):et=e[111];let Lt;e[112]===Symbol.for("react.memo_cache_sentinel")?(Lt=()=>{De(!1)},e[112]=Lt):Lt=e[112];const ft=r??"Anlegen",tr=d??u;let Dt;e[113]===Symbol.for("react.memo_cache_sentinel")?(Dt=()=>{De(!1)},e[113]=Dt):Dt=e[113];let ct;e[114]!==m?(ct=m.filter($c),e[114]=m,e[115]=ct):ct=e[115];let Ee;e[116]!==n||e[117]!==S||e[118]!==tr||e[119]!==ct?(Ee=y.jsx(ws,{queryKey:n,apiPath:tr,onClose:Dt,fields:ct,steps:S}),e[116]=n,e[117]=S,e[118]=tr,e[119]=ct,e[120]=Ee):Ee=e[120];let tt;e[121]!==Se||e[122]!==ft||e[123]!==Ee?(tt=y.jsx(O.Modal,{opened:Se,onClose:Lt,title:ft,children:Ee}),e[121]=Se,e[122]=ft,e[123]=Ee,e[124]=tt):tt=e[124];let kt;return e[125]!==at||e[126]!==ut||e[127]!==be||e[128]!==Pe||e[129]!==Ue||e[130]!==St||e[131]!==et||e[132]!==tt?(kt=y.jsxs(y.Fragment,{children:[at,ut,be,Pe,Ue,St,et,tt]}),e[125]=at,e[126]=ut,e[127]=be,e[128]=Pe,e[129]=Ue,e[130]=St,e[131]=et,e[132]=tt,e[133]=kt):kt=e[133],kt}function $c(t){return t.create}function Rc(t){return t.update}function Nc(t){return t.column}function Lc(t,e){return y.jsx(O.Skeleton,{height:35},`skeleton-${e}`)}function Bc(t){return y.jsx(O.Tabs.Tab,{value:t.value,leftSection:t.icon,children:t.label},t.value)}function Ic(t){return t.create}function Yc(t){return t.delete}function zc(t){return t.update}function Fc(t){return t.update}function Wc(t){return t.delete}function Uc(t){return t.update}function qc(t){const[e,r]=t;return`${e}=${encodeURIComponent(r??"")}`}function Vc(t){const[,e]=t;return e!=null}function Hc(t){const e=Fe.c(5),{queryClient:r}=mt();let n;e[0]!==t?(n=y.jsx(Tc,{...t}),e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==r||e[3]!==n?(s=y.jsx(eo,{client:r,children:n}),e[2]=r,e[3]=n,e[4]=s):s=e[4],s}_e.CreateModal=ws,_e.DataTable=Hc,_e.DataTableProvider=bl,_e.DeleteModal=Rs,_e.MobileCardList=Is,_e.UpdateModal=$s,_e.api=_l,_e.createOne=Ho,_e.deleteOne=Vo,_e.getAll=Uo,_e.getApiHeaders=Mt,_e.getOne=qo,_e.sortData=Bs,_e.updateOne=Go,_e.useAddOne=Zo,_e.useDataTable=mt,_e.useDeleteOne=Jo,_e.useGetAll=Ko,_e.useGetOne=Qo,_e.usePersistentState=Ns,_e.useUpdateOne=fn,Object.defineProperty(_e,Symbol.toStringTag,{value:"Module"})}));
|
|
24
24
|
//# sourceMappingURL=index.umd.js.map
|