@espresso-lab/mantine-data-table 1.9.39 → 1.9.41
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 +2584 -2586
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +9 -9
- 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(we,G){typeof exports=="object"&&typeof module<"u"?G(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"],G):(we=typeof globalThis<"u"?globalThis:we||self,G(we.MantineDataTable={},we.React,we.MantineCore,we.MantineForm,we.TablerIconsReact,we.MantineHooks))})(this,(function(we,G,
|
|
1
|
+
(function(we,G){typeof exports=="object"&&typeof module<"u"?G(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"],G):(we=typeof globalThis<"u"?globalThis:we||self,G(we.MantineDataTable={},we.React,we.MantineCore,we.MantineForm,we.TablerIconsReact,we.MantineHooks))})(this,(function(we,G,T,On,Et,Le){"use strict";function Bs(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 Re=Bs(G);function An(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Gt={exports:{}},Er={};var En;function Is(){if(En)return Er;En=1;var t=G.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return Er.c=function(e){return t.H.useMemoCache(e)},Er}var Tr={};var Tn;function Ys(){return Tn||(Tn=1,process.env.NODE_ENV!=="production"&&(function(){var t=G.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;Tr.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)}})()),Tr}var jn;function zs(){return jn||(jn=1,process.env.NODE_ENV==="production"?Gt.exports=Is():Gt.exports=Ys()),Gt.exports}var Ze=zs(),Qt=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(){}},Fs={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Ws=class{#t=Fs;#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)}},Zt=new Ws;function Us(t){setTimeout(t,0)}var Tt=typeof window>"u"||"Deno"in globalThis;function Kt(){}function $n(t){return typeof t=="number"&&t>=0&&t!==1/0}function qs(t,e){return Math.max(t+(e||0)-Date.now(),0)}function jt(t,e){return typeof t=="function"?t(e):t}function Ke(t,e){return typeof t=="function"?t(e):t}function Rn(t){return JSON.stringify(t,(e,r)=>$r(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}var Vs=Object.prototype.hasOwnProperty;function jr(t,e){if(t===e)return t;const r=Nn(t)&&Nn(e);if(!r&&!($r(t)&&$r(e)))return e;const s=(r?t:Object.keys(t)).length,c=r?e:Object.keys(e),h=c.length,a=r?new Array(h):{};let g=0;for(let y=0;y<h;y++){const _=r?y:c[y],M=t[_],x=e[_];if(M===x){a[_]=M,(r?y<s:Vs.call(t,_))&&g++;continue}if(M===null||x===null||typeof M!="object"||typeof x!="object"){a[_]=x;continue}const S=jr(M,x);a[_]=S,S===M&&g++}return s===h&&g===s?t:a}function Jt(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 Nn(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function $r(t){if(!Ln(t))return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return!(!Ln(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Ln(t){return Object.prototype.toString.call(t)==="[object Object]"}function Bn(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 jr(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 jr(t,e)}return e}function In(t,e){return typeof t=="function"?t(...e):!!t}var Hs=class extends Qt{#t;#e;#r;constructor(){super(),this.#r=t=>{if(!Tt&&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"}},Gs=new Hs;function Yn(){let t,e;const r=new Promise((s,c)=>{t=s,e=c});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 Qs=Us;function Zs(){let t=[],e=0,r=a=>{a()},n=a=>{a()},s=Qs;const c=a=>{e?t.push(a):s(()=>{r(a)})},h=()=>{const a=t;t=[],a.length&&s(()=>{n(()=>{a.forEach(g=>{r(g)})})})};return{batch:a=>{let g;e++;try{g=a()}finally{e--,e||h()}return g},batchCalls:a=>(...g)=>{c(()=>{a(...g)})},schedule:c,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{s=a}}}var Xt=Zs(),Ks=class extends Qt{#t=!0;#e;#r;constructor(){super(),this.#r=t=>{if(!Tt&&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}},Js=new Ks;function Xs(t){return(t??"online")==="online"?Js.isOnline():!0}function ei(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Xs(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}var ti=class extends Qt{constructor(t,e){super(),this.options=e,this.#t=t,this.#a=null,this.#i=Yn(),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),zn(this.#e,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Rr(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Rr(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 Ke(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#C(),this.#e.setOptions(this.options),e._defaulted&&!Jt(this.options,e)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const n=this.hasListeners();n&&Fn(this.#e,r,this.options,e)&&this.#d(),this.updateResult(),n&&(this.#e!==r||Ke(this.options.enabled,this.#e)!==Ke(e.enabled,this.#e)||jt(this.options.staleTime,this.#e)!==jt(e.staleTime,this.#e))&&this.#m();const s=this.#y();n&&(this.#e!==r||Ke(this.options.enabled,this.#e)!==Ke(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 ni(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.#C();let e=this.#e.fetch(this.options,t);return t?.throwOnError||(e=e.catch(Kt)),e}#m(){this.#w();const t=jt(this.options.staleTime,this.#e);if(Tt||this.#n.isStale||!$n(t))return;const r=qs(this.#n.dataUpdatedAt,t)+1;this.#u=Zt.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,!(Tt||Ke(this.options.enabled,this.#e)===!1||!$n(this.#l)||this.#l===0)&&(this.#c=Zt.setInterval(()=>{(this.options.refetchIntervalInBackground||Gs.isFocused())&&this.#d()},this.#l))}#b(){this.#m(),this.#v(this.#y())}#w(){this.#u&&(Zt.clearTimeout(this.#u),this.#u=void 0)}#_(){this.#c&&(Zt.clearInterval(this.#c),this.#c=void 0)}createResult(t,e){const r=this.#e,n=this.options,s=this.#n,c=this.#o,h=this.#s,g=t!==r?t.state:this.#r,{state:y}=t;let _={...y},M=!1,x;if(e._optimisticResults){const J=this.hasListeners(),Z=!J&&zn(t,e),U=J&&Fn(t,r,e,n);(Z||U)&&(_={..._,...ei(y.data,t.options)}),e._optimisticResults==="isRestoring"&&(_.fetchStatus="idle")}let{error:S,errorUpdatedAt:D,status:O}=_;x=_.data;let L=!1;if(e.placeholderData!==void 0&&x===void 0&&O==="pending"){let J;s?.isPlaceholderData&&e.placeholderData===h?.placeholderData?(J=s.data,L=!0):J=typeof e.placeholderData=="function"?e.placeholderData(this.#f?.state.data,this.#f):e.placeholderData,J!==void 0&&(O="success",x=Bn(s?.data,J,e),M=!0)}if(e.select&&x!==void 0&&!L)if(s&&x===c?.data&&e.select===this.#g)x=this.#h;else try{this.#g=e.select,x=e.select(x),x=Bn(s?.data,x,e),this.#h=x,this.#a=null}catch(J){this.#a=J}this.#a&&(S=this.#a,x=this.#h,D=Date.now(),O="error");const I=_.fetchStatus==="fetching",z=O==="pending",V=O==="error",q=z&&I,X=x!==void 0,Q={status:O,fetchStatus:_.fetchStatus,isPending:z,isSuccess:O==="success",isError:V,isInitialLoading:q,isLoading:q,data:x,dataUpdatedAt:_.dataUpdatedAt,error:S,errorUpdatedAt:D,failureCount:_.fetchFailureCount,failureReason:_.fetchFailureReason,errorUpdateCount:_.errorUpdateCount,isFetched:_.dataUpdateCount>0||_.errorUpdateCount>0,isFetchedAfterMount:_.dataUpdateCount>g.dataUpdateCount||_.errorUpdateCount>g.errorUpdateCount,isFetching:I,isRefetching:I&&!z,isLoadingError:V&&!X,isPaused:_.fetchStatus==="paused",isPlaceholderData:M,isRefetchError:V&&X,isStale:Nr(t,e),refetch:this.refetch,promise:this.#i,isEnabled:Ke(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const J=W=>{Q.status==="error"?W.reject(Q.error):Q.data!==void 0&&W.resolve(Q.data)},Z=()=>{const W=this.#i=Q.promise=Yn();J(W)},U=this.#i;switch(U.status){case"pending":t.queryHash===r.queryHash&&J(U);break;case"fulfilled":(Q.status==="error"||Q.data!==U.value)&&Z();break;case"rejected":(Q.status!=="error"||Q.error!==U.reason)&&Z();break}}return Q}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),Jt(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 c=new Set(s??this.#p);return this.options.throwOnError&&c.add("error"),Object.keys(this.#n).some(h=>{const a=h;return this.#n[a]!==t[a]&&c.has(a)})};this.#x({listeners:r()})}#C(){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()}#x(t){Xt.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#n)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function ri(t,e){return Ke(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function zn(t,e){return ri(t,e)||t.state.data!==void 0&&Rr(t,e,e.refetchOnMount)}function Rr(t,e,r){if(Ke(e.enabled,t)!==!1&&jt(e.staleTime,t)!=="static"){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&Nr(t,e)}return!1}function Fn(t,e,r,n){return(t!==e||Ke(n.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&Nr(t,r)}function Nr(t,e){return Ke(e.enabled,t)!==!1&&t.isStaleByTime(jt(e.staleTime,t))}function ni(t,e){return!Jt(t.getCurrentResult(),e)}function oi(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var si=class extends Qt{#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),Jt(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),e?.mutationKey&&this.options.mutationKey&&Rn(e.mutationKey)!==Rn(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??oi();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){Xt.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)})})}},er={exports:{}},$t={};var Wn;function ii(){if(Wn)return $t;Wn=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,s,c){var h=null;if(c!==void 0&&(h=""+c),s.key!==void 0&&(h=""+s.key),"key"in s){c={};for(var a in s)a!=="key"&&(c[a]=s[a])}else c=s;return s=c.ref,{$$typeof:t,type:n,key:h,ref:s!==void 0?s:null,props:c}}return $t.Fragment=e,$t.jsx=r,$t.jsxs=r,$t}var Rt={};var Un;function ai(){return Un||(Un=1,process.env.NODE_ENV!=="production"&&(function(){function t(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===W?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case L:return"Fragment";case z:return"Profiler";case I:return"StrictMode";case re:return"Suspense";case Q:return"SuspenseList";case U:return"Activity"}if(typeof i=="object")switch(typeof i.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),i.$$typeof){case O:return"Portal";case q:return i.displayName||"Context";case V:return(i._context.displayName||"Context")+".Consumer";case X:var b=i.render;return i=i.displayName,i||(i=b.displayName||b.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case J:return b=i.displayName||null,b!==null?b:t(i.type)||"Memo";case Z:b=i._payload,i=i._init;try{return t(i(b))}catch{}}return null}function e(i){return""+i}function r(i){try{e(i);var b=!1}catch{b=!0}if(b){b=console;var T=b.error,j=typeof Symbol=="function"&&Symbol.toStringTag&&i[Symbol.toStringTag]||i.constructor.name||"Object";return T.call(b,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",j),e(i)}}function n(i){if(i===L)return"<>";if(typeof i=="object"&&i!==null&&i.$$typeof===Z)return"<...>";try{var b=t(i);return b?"<"+b+">":"<...>"}catch{return"<...>"}}function s(){var i=ae.A;return i===null?null:i.getOwner()}function c(){return Error("react-stack-top-frame")}function h(i){if(se.call(i,"key")){var b=Object.getOwnPropertyDescriptor(i,"key").get;if(b&&b.isReactWarning)return!1}return i.key!==void 0}function a(i,b){function T(){v||(v=!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)",b))}T.isReactWarning=!0,Object.defineProperty(i,"key",{get:T,configurable:!0})}function g(){var i=t(this.type);return d[i]||(d[i]=!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.")),i=this.props.ref,i!==void 0?i:null}function y(i,b,T,j,K,ee){var te=T.ref;return i={$$typeof:D,type:i,key:b,props:T,_owner:j},(te!==void 0?te:null)!==null?Object.defineProperty(i,"ref",{enumerable:!1,get:g}):Object.defineProperty(i,"ref",{enumerable:!1,value:null}),i._store={},Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(i,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(i,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:K}),Object.defineProperty(i,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i}function _(i,b,T,j,K,ee){var te=b.children;if(te!==void 0)if(j)if(k(te)){for(j=0;j<te.length;j++)M(te[j]);Object.freeze&&Object.freeze(te)}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(te);if(se.call(b,"key")){te=t(i);var H=Object.keys(b).filter(function(oe){return oe!=="key"});j=0<H.length?"{key: someKey, "+H.join(": ..., ")+": ...}":"{key: someKey}",f[te+j]||(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)}})()),Tr}var jn;function zs(){return jn||(jn=1,process.env.NODE_ENV==="production"?Gt.exports=Is():Gt.exports=Ys()),Gt.exports}var Ze=zs(),Qt=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(){}},Fs={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Ws=class{#t=Fs;#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)}},Zt=new Ws;function Us(t){setTimeout(t,0)}var Tt=typeof window>"u"||"Deno"in globalThis;function Kt(){}function $n(t){return typeof t=="number"&&t>=0&&t!==1/0}function qs(t,e){return Math.max(t+(e||0)-Date.now(),0)}function jt(t,e){return typeof t=="function"?t(e):t}function Ke(t,e){return typeof t=="function"?t(e):t}function Rn(t){return JSON.stringify(t,(e,r)=>$r(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}var Vs=Object.prototype.hasOwnProperty;function jr(t,e){if(t===e)return t;const r=Nn(t)&&Nn(e);if(!r&&!($r(t)&&$r(e)))return e;const s=(r?t:Object.keys(t)).length,u=r?e:Object.keys(e),h=u.length,a=r?new Array(h):{};let g=0;for(let y=0;y<h;y++){const _=r?y:u[y],P=t[_],x=e[_];if(P===x){a[_]=P,(r?y<s:Vs.call(t,_))&&g++;continue}if(P===null||x===null||typeof P!="object"||typeof x!="object"){a[_]=x;continue}const S=jr(P,x);a[_]=S,S===P&&g++}return s===h&&g===s?t:a}function Jt(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 Nn(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function $r(t){if(!Ln(t))return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return!(!Ln(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Ln(t){return Object.prototype.toString.call(t)==="[object Object]"}function Bn(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 jr(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 jr(t,e)}return e}function In(t,e){return typeof t=="function"?t(...e):!!t}var Hs=class extends Qt{#t;#e;#r;constructor(){super(),this.#r=t=>{if(!Tt&&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"}},Gs=new Hs;function Yn(){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 Qs=Us;function Zs(){let t=[],e=0,r=a=>{a()},n=a=>{a()},s=Qs;const u=a=>{e?t.push(a):s(()=>{r(a)})},h=()=>{const a=t;t=[],a.length&&s(()=>{n(()=>{a.forEach(g=>{r(g)})})})};return{batch:a=>{let g;e++;try{g=a()}finally{e--,e||h()}return g},batchCalls:a=>(...g)=>{u(()=>{a(...g)})},schedule:u,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{s=a}}}var Xt=Zs(),Ks=class extends Qt{#t=!0;#e;#r;constructor(){super(),this.#r=t=>{if(!Tt&&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}},Js=new Ks;function Xs(t){return(t??"online")==="online"?Js.isOnline():!0}function ei(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Xs(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}var ti=class extends Qt{constructor(t,e){super(),this.options=e,this.#t=t,this.#a=null,this.#i=Yn(),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),zn(this.#e,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Rr(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Rr(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 Ke(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#C(),this.#e.setOptions(this.options),e._defaulted&&!Jt(this.options,e)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const n=this.hasListeners();n&&Fn(this.#e,r,this.options,e)&&this.#d(),this.updateResult(),n&&(this.#e!==r||Ke(this.options.enabled,this.#e)!==Ke(e.enabled,this.#e)||jt(this.options.staleTime,this.#e)!==jt(e.staleTime,this.#e))&&this.#m();const s=this.#y();n&&(this.#e!==r||Ke(this.options.enabled,this.#e)!==Ke(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 ni(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.#C();let e=this.#e.fetch(this.options,t);return t?.throwOnError||(e=e.catch(Kt)),e}#m(){this.#w();const t=jt(this.options.staleTime,this.#e);if(Tt||this.#n.isStale||!$n(t))return;const r=qs(this.#n.dataUpdatedAt,t)+1;this.#u=Zt.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,!(Tt||Ke(this.options.enabled,this.#e)===!1||!$n(this.#l)||this.#l===0)&&(this.#c=Zt.setInterval(()=>{(this.options.refetchIntervalInBackground||Gs.isFocused())&&this.#d()},this.#l))}#b(){this.#m(),this.#v(this.#y())}#w(){this.#u&&(Zt.clearTimeout(this.#u),this.#u=void 0)}#_(){this.#c&&(Zt.clearInterval(this.#c),this.#c=void 0)}createResult(t,e){const r=this.#e,n=this.options,s=this.#n,u=this.#o,h=this.#s,g=t!==r?t.state:this.#r,{state:y}=t;let _={...y},P=!1,x;if(e._optimisticResults){const V=this.hasListeners(),H=!V&&zn(t,e),K=V&&Fn(t,r,e,n);(H||K)&&(_={..._,...ei(y.data,t.options)}),e._optimisticResults==="isRestoring"&&(_.fetchStatus="idle")}let{error:S,errorUpdatedAt:D,status:O}=_;x=_.data;let N=!1;if(e.placeholderData!==void 0&&x===void 0&&O==="pending"){let V;s?.isPlaceholderData&&e.placeholderData===h?.placeholderData?(V=s.data,N=!0):V=typeof e.placeholderData=="function"?e.placeholderData(this.#f?.state.data,this.#f):e.placeholderData,V!==void 0&&(O="success",x=Bn(s?.data,V,e),P=!0)}if(e.select&&x!==void 0&&!N)if(s&&x===u?.data&&e.select===this.#g)x=this.#h;else try{this.#g=e.select,x=e.select(x),x=Bn(s?.data,x,e),this.#h=x,this.#a=null}catch(V){this.#a=V}this.#a&&(S=this.#a,x=this.#h,D=Date.now(),O="error");const z=_.fetchStatus==="fetching",F=O==="pending",q=O==="error",U=F&&z,ee=x!==void 0,X={status:O,fetchStatus:_.fetchStatus,isPending:F,isSuccess:O==="success",isError:q,isInitialLoading:U,isLoading:U,data:x,dataUpdatedAt:_.dataUpdatedAt,error:S,errorUpdatedAt:D,failureCount:_.fetchFailureCount,failureReason:_.fetchFailureReason,errorUpdateCount:_.errorUpdateCount,isFetched:_.dataUpdateCount>0||_.errorUpdateCount>0,isFetchedAfterMount:_.dataUpdateCount>g.dataUpdateCount||_.errorUpdateCount>g.errorUpdateCount,isFetching:z,isRefetching:z&&!F,isLoadingError:q&&!ee,isPaused:_.fetchStatus==="paused",isPlaceholderData:P,isRefetchError:q&&ee,isStale:Nr(t,e),refetch:this.refetch,promise:this.#i,isEnabled:Ke(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const V=W=>{X.status==="error"?W.reject(X.error):X.data!==void 0&&W.resolve(X.data)},H=()=>{const W=this.#i=X.promise=Yn();V(W)},K=this.#i;switch(K.status){case"pending":t.queryHash===r.queryHash&&V(K);break;case"fulfilled":(X.status==="error"||X.data!==K.value)&&H();break;case"rejected":(X.status!=="error"||X.error!==K.reason)&&H();break}}return X}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),Jt(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(h=>{const a=h;return this.#n[a]!==t[a]&&u.has(a)})};this.#x({listeners:r()})}#C(){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()}#x(t){Xt.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#n)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function ri(t,e){return Ke(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function zn(t,e){return ri(t,e)||t.state.data!==void 0&&Rr(t,e,e.refetchOnMount)}function Rr(t,e,r){if(Ke(e.enabled,t)!==!1&&jt(e.staleTime,t)!=="static"){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&Nr(t,e)}return!1}function Fn(t,e,r,n){return(t!==e||Ke(n.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&Nr(t,r)}function Nr(t,e){return Ke(e.enabled,t)!==!1&&t.isStaleByTime(jt(e.staleTime,t))}function ni(t,e){return!Jt(t.getCurrentResult(),e)}function oi(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var si=class extends Qt{#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),Jt(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),e?.mutationKey&&this.options.mutationKey&&Rn(e.mutationKey)!==Rn(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??oi();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){Xt.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)})})}},er={exports:{}},$t={};var Wn;function ii(){if(Wn)return $t;Wn=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,s,u){var h=null;if(u!==void 0&&(h=""+u),s.key!==void 0&&(h=""+s.key),"key"in s){u={};for(var a in s)a!=="key"&&(u[a]=s[a])}else u=s;return s=u.ref,{$$typeof:t,type:n,key:h,ref:s!==void 0?s:null,props:u}}return $t.Fragment=e,$t.jsx=r,$t.jsxs=r,$t}var Rt={};var Un;function ai(){return Un||(Un=1,process.env.NODE_ENV!=="production"&&(function(){function t(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===W?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case N:return"Fragment";case F:return"Profiler";case z:return"StrictMode";case re:return"Suspense";case X:return"SuspenseList";case K:return"Activity"}if(typeof i=="object")switch(typeof i.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),i.$$typeof){case O:return"Portal";case U:return i.displayName||"Context";case q:return(i._context.displayName||"Context")+".Consumer";case ee:var v=i.render;return i=i.displayName,i||(i=v.displayName||v.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case V:return v=i.displayName||null,v!==null?v:t(i.type)||"Memo";case H:v=i._payload,i=i._init;try{return t(i(v))}catch{}}return null}function e(i){return""+i}function r(i){try{e(i);var v=!1}catch{v=!0}if(v){v=console;var E=v.error,j=typeof Symbol=="function"&&Symbol.toStringTag&&i[Symbol.toStringTag]||i.constructor.name||"Object";return E.call(v,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",j),e(i)}}function n(i){if(i===N)return"<>";if(typeof i=="object"&&i!==null&&i.$$typeof===H)return"<...>";try{var v=t(i);return v?"<"+v+">":"<...>"}catch{return"<...>"}}function s(){var i=oe.A;return i===null?null:i.getOwner()}function u(){return Error("react-stack-top-frame")}function h(i){if(se.call(i,"key")){var v=Object.getOwnPropertyDescriptor(i,"key").get;if(v&&v.isReactWarning)return!1}return i.key!==void 0}function a(i,v){function E(){b||(b=!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))}E.isReactWarning=!0,Object.defineProperty(i,"key",{get:E,configurable:!0})}function g(){var i=t(this.type);return c[i]||(c[i]=!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.")),i=this.props.ref,i!==void 0?i:null}function y(i,v,E,j,Q,J){var te=E.ref;return i={$$typeof:D,type:i,key:v,props:E,_owner:j},(te!==void 0?te:null)!==null?Object.defineProperty(i,"ref",{enumerable:!1,get:g}):Object.defineProperty(i,"ref",{enumerable:!1,value:null}),i._store={},Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(i,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(i,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Q}),Object.defineProperty(i,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:J}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i}function _(i,v,E,j,Q,J){var te=v.children;if(te!==void 0)if(j)if(k(te)){for(j=0;j<te.length;j++)P(te[j]);Object.freeze&&Object.freeze(te)}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 P(te);if(se.call(v,"key")){te=t(i);var Z=Object.keys(v).filter(function(ie){return ie!=="key"});j=0<Z.length?"{key: someKey, "+Z.join(": ..., ")+": ...}":"{key: someKey}",f[te+j]||(Z=0<Z.length?"{"+Z.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} />`,j,te,
|
|
10
|
+
<%s key={someKey} {...props} />`,j,te,Z,te),f[te+j]=!0)}if(te=null,E!==void 0&&(r(E),te=""+E),h(v)&&(r(v.key),te=""+v.key),"key"in v){E={};for(var ae in v)ae!=="key"&&(E[ae]=v[ae])}else E=v;return te&&a(E,typeof i=="function"?i.displayName||i.name||"Unknown":i),y(i,te,E,s(),Q,J)}function P(i){x(i)?i._store&&(i._store.validated=1):typeof i=="object"&&i!==null&&i.$$typeof===H&&(i._payload.status==="fulfilled"?x(i._payload.value)&&i._payload.value._store&&(i._payload.value._store.validated=1):i._store&&(i._store.validated=1))}function x(i){return typeof i=="object"&&i!==null&&i.$$typeof===D}var S=G,D=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),q=Symbol.for("react.consumer"),U=Symbol.for("react.context"),ee=Symbol.for("react.forward_ref"),re=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),W=Symbol.for("react.client.reference"),oe=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se=Object.prototype.hasOwnProperty,k=Array.isArray,C=console.createTask?console.createTask:function(){return null};S={react_stack_bottom_frame:function(i){return i()}};var b,c={},d=S.react_stack_bottom_frame.bind(S,u)(),m=C(n(u)),f={};Rt.Fragment=N,Rt.jsx=function(i,v,E){var j=1e4>oe.recentlyCreatedOwnerStacks++;return _(i,v,E,!1,j?Error("react-stack-top-frame"):d,j?C(n(i)):m)},Rt.jsxs=function(i,v,E){var j=1e4>oe.recentlyCreatedOwnerStacks++;return _(i,v,E,!0,j?Error("react-stack-top-frame"):d,j?C(n(i)):m)}})()),Rt}var qn;function li(){return qn||(qn=1,process.env.NODE_ENV==="production"?er.exports=ii():er.exports=ai()),er.exports}var w=li(),Vn=Re.createContext(void 0),Hn=t=>{const e=Re.useContext(Vn);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Gn=({client:t,children:e})=>(Re.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),w.jsx(Vn.Provider,{value:t,children:e})),Qn=Re.createContext(!1),ui=()=>Re.useContext(Qn);Qn.Provider;function ci(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var di=Re.createContext(ci()),hi=()=>Re.useContext(di),fi=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},pi=t=>{Re.useEffect(()=>{t.clearReset()},[t])},gi=({result:t,errorResetBoundary:e,throwOnError:r,query:n,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&n&&(s&&t.data===void 0||In(r,[t.error,n])),mi=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))}},yi=(t,e)=>t.isLoading&&t.isFetching&&!e,vi=(t,e)=>t?.suspense&&e.isPending,Zn=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});function bi(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=ui(),s=hi(),u=Hn(),h=u.defaultQueryOptions(t);u.getDefaultOptions().queries?._experimental_beforeQuery?.(h),process.env.NODE_ENV!=="production"&&(h.queryFn||console.error(`[${h.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`)),h._optimisticResults=n?"isRestoring":"optimistic",mi(h),fi(h,s),pi(s);const a=!u.getQueryCache().get(h.queryHash),[g]=Re.useState(()=>new e(u,h)),y=g.getOptimisticResult(h),_=!n&&t.subscribed!==!1;if(Re.useSyncExternalStore(Re.useCallback(P=>{const x=_?g.subscribe(Xt.batchCalls(P)):Kt;return g.updateResult(),x},[g,_]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),Re.useEffect(()=>{g.setOptions(h)},[h,g]),vi(h,y))throw Zn(h,g,s);if(gi({result:y,errorResetBoundary:s,throwOnError:h.throwOnError,query:u.getQueryCache().get(h.queryHash),suspense:h.suspense}))throw y.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(h,y),h.experimental_prefetchInRender&&!Tt&&yi(y,n)&&(a?Zn(h,g,s):u.getQueryCache().get(h.queryHash)?.promise)?.catch(Kt).finally(()=>{g.updateResult()}),h.notifyOnChangeProps?y:g.trackResult(y)}function Kn(t,e){return bi(t,ti)}function Lr(t,e){const r=Hn(),[n]=Re.useState(()=>new si(r,t));Re.useEffect(()=>{n.setOptions(t)},[n,t]);const s=Re.useSyncExternalStore(Re.useCallback(h=>n.subscribe(Xt.batchCalls(h)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),u=Re.useCallback((h,a)=>{n.mutate(h,a).catch(Kt)},[n]);if(s.error&&In(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:u,mutateAsync:s.mutate}}var Jn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Br(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 Ir={exports:{}},Nt={};var Xn;function wi(){if(Xn)return Nt;Xn=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,s,u){var h=null;if(u!==void 0&&(h=""+u),s.key!==void 0&&(h=""+s.key),"key"in s){u={};for(var a in s)a!=="key"&&(u[a]=s[a])}else u=s;return s=u.ref,{$$typeof:t,type:n,key:h,ref:s!==void 0?s:null,props:u}}return Nt.Fragment=e,Nt.jsx=r,Nt.jsxs=r,Nt}var tr={};var eo;function _i(){return eo||(eo=1,process.env.NODE_ENV!=="production"&&(function(){function t(f){if(f==null)return null;if(typeof f=="function")return f.$$typeof===K?null:f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case O:return"Fragment";case z:return"Profiler";case N:return"StrictMode";case ee:return"Suspense";case re:return"SuspenseList";case H: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 D:return"Portal";case q:return(f.displayName||"Context")+".Provider";case F:return(f._context.displayName||"Context")+".Consumer";case U:var i=f.render;return f=f.displayName,f||(f=i.displayName||i.name||"",f=f!==""?"ForwardRef("+f+")":"ForwardRef"),f;case X:return i=f.displayName||null,i!==null?i:t(f.type)||"Memo";case V:i=f._payload,f=f._init;try{return t(f(i))}catch{}}return null}function e(f){return""+f}function r(f){try{e(f);var i=!1}catch{i=!0}if(i){i=console;var v=i.error,E=typeof Symbol=="function"&&Symbol.toStringTag&&f[Symbol.toStringTag]||f.constructor.name||"Object";return v.call(i,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",E),e(f)}}function n(f){if(f===O)return"<>";if(typeof f=="object"&&f!==null&&f.$$typeof===V)return"<...>";try{var i=t(f);return i?"<"+i+">":"<...>"}catch{return"<...>"}}function s(){var f=W.A;return f===null?null:f.getOwner()}function u(){return Error("react-stack-top-frame")}function h(f){if(oe.call(f,"key")){var i=Object.getOwnPropertyDescriptor(f,"key").get;if(i&&i.isReactWarning)return!1}return f.key!==void 0}function a(f,i){function v(){C||(C=!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)",i))}v.isReactWarning=!0,Object.defineProperty(f,"key",{get:v,configurable:!0})}function g(){var f=t(this.type);return b[f]||(b[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 y(f,i,v,E,j,Q,J,te){return v=Q.ref,f={$$typeof:S,type:f,key:i,props:Q,_owner:j},(v!==void 0?v:null)!==null?Object.defineProperty(f,"ref",{enumerable:!1,get:g}):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:J}),Object.defineProperty(f,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f}function _(f,i,v,E,j,Q,J,te){var Z=i.children;if(Z!==void 0)if(E)if(se(Z)){for(E=0;E<Z.length;E++)P(Z[E]);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 P(Z);if(oe.call(i,"key")){Z=t(f);var ae=Object.keys(i).filter(function(ue){return ue!=="key"});E=0<ae.length?"{key: someKey, "+ae.join(": ..., ")+": ...}":"{key: someKey}",m[Z+E]||(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} />`,
|
|
15
|
+
<%s key={someKey} {...props} />`,E,Z,ae,Z),m[Z+E]=!0)}if(Z=null,v!==void 0&&(r(v),Z=""+v),h(i)&&(r(i.key),Z=""+i.key),"key"in i){v={};for(var ie in i)ie!=="key"&&(v[ie]=i[ie])}else v=i;return Z&&a(v,typeof f=="function"?f.displayName||f.name||"Unknown":f),y(f,Z,Q,j,s(),v,J,te)}function P(f){typeof f=="object"&&f!==null&&f.$$typeof===S&&f._store&&(f._store.validated=1)}var x=G,S=Symbol.for("react.transitional.element"),D=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),F=Symbol.for("react.consumer"),q=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),ee=Symbol.for("react.suspense"),re=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),K=Symbol.for("react.client.reference"),W=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=Object.prototype.hasOwnProperty,se=Array.isArray,k=console.createTask?console.createTask:function(){return null};x={react_stack_bottom_frame:function(f){return f()}};var C,b={},c=x.react_stack_bottom_frame.bind(x,u)(),d=k(n(u)),m={};tr.Fragment=O,tr.jsx=function(f,i,v,E,j){var Q=1e4>W.recentlyCreatedOwnerStacks++;return _(f,i,v,!1,E,j,Q?Error("react-stack-top-frame"):c,Q?k(n(f)):d)},tr.jsxs=function(f,i,v,E,j){var Q=1e4>W.recentlyCreatedOwnerStacks++;return _(f,i,v,!0,E,j,Q?Error("react-stack-top-frame"):c,Q?k(n(f)):d)}})()),tr}var to;function Ci(){return to||(to=1,process.env.NODE_ENV==="production"?Ir.exports=wi():Ir.exports=_i()),Ir.exports}Ci();var Yr={exports:{}},zr={};var ro;function xi(){if(ro)return zr;ro=1;var t=G.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return zr.c=function(e){return t.H.useMemoCache(e)},zr}var no={};var oo;function Si(){return oo||(oo=1,process.env.NODE_ENV!=="production"&&(function(){var t=G.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;no.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)}})()),no}var so;function Di(){return so||(so=1,process.env.NODE_ENV==="production"?Yr.exports=xi():Yr.exports=Si()),Yr.exports}Di();var io={},Lt={},ao;function ki(){if(ao)return Lt;ao=1,Lt.byteLength=a,Lt.toByteArray=y,Lt.fromByteArray=x;for(var t=[],e=[],r=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,c=n.length;s<c;++s)t[s]=n[s],e[n.charCodeAt(s)]=s;e[45]=62,e[95]=63;function h(S){var D=S.length;if(D%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var O=S.indexOf("=");O===-1&&(O=D);var L=O===D?0:4-O%4;return[O,L]}function a(S){var D=h(S),O=D[0],L=D[1];return(O+L)*3/4-L}function g(S,D,O){return(D+O)*3/4-O}function y(S){var D,O=h(S),L=O[0],I=O[1],z=new r(g(S,L,I)),V=0,q=I>0?L-4:L,X;for(X=0;X<q;X+=4)D=e[S.charCodeAt(X)]<<18|e[S.charCodeAt(X+1)]<<12|e[S.charCodeAt(X+2)]<<6|e[S.charCodeAt(X+3)],z[V++]=D>>16&255,z[V++]=D>>8&255,z[V++]=D&255;return I===2&&(D=e[S.charCodeAt(X)]<<2|e[S.charCodeAt(X+1)]>>4,z[V++]=D&255),I===1&&(D=e[S.charCodeAt(X)]<<10|e[S.charCodeAt(X+1)]<<4|e[S.charCodeAt(X+2)]>>2,z[V++]=D>>8&255,z[V++]=D&255),z}function _(S){return t[S>>18&63]+t[S>>12&63]+t[S>>6&63]+t[S&63]}function M(S,D,O){for(var L,I=[],z=D;z<O;z+=3)L=(S[z]<<16&16711680)+(S[z+1]<<8&65280)+(S[z+2]&255),I.push(_(L));return I.join("")}function x(S){for(var D,O=S.length,L=O%3,I=[],z=16383,V=0,q=O-L;V<q;V+=z)I.push(M(S,V,V+z>q?q:V+z));return L===1?(D=S[O-1],I.push(t[D>>2]+t[D<<4&63]+"==")):L===2&&(D=(S[O-2]<<8)+S[O-1],I.push(t[D>>10]+t[D>>4&63]+t[D<<2&63]+"=")),I.join("")}return Lt}var Fr={};var lo;function Pi(){return lo||(lo=1,Fr.read=function(t,e,r,n,s){var c,h,a=s*8-n-1,g=(1<<a)-1,y=g>>1,_=-7,M=r?s-1:0,x=r?-1:1,S=t[e+M];for(M+=x,c=S&(1<<-_)-1,S>>=-_,_+=a;_>0;c=c*256+t[e+M],M+=x,_-=8);for(h=c&(1<<-_)-1,c>>=-_,_+=n;_>0;h=h*256+t[e+M],M+=x,_-=8);if(c===0)c=1-y;else{if(c===g)return h?NaN:(S?-1:1)*(1/0);h=h+Math.pow(2,n),c=c-y}return(S?-1:1)*h*Math.pow(2,c-n)},Fr.write=function(t,e,r,n,s,c){var h,a,g,y=c*8-s-1,_=(1<<y)-1,M=_>>1,x=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=n?0:c-1,D=n?1:-1,O=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,h=_):(h=Math.floor(Math.log(e)/Math.LN2),e*(g=Math.pow(2,-h))<1&&(h--,g*=2),h+M>=1?e+=x/g:e+=x*Math.pow(2,1-M),e*g>=2&&(h++,g/=2),h+M>=_?(a=0,h=_):h+M>=1?(a=(e*g-1)*Math.pow(2,s),h=h+M):(a=e*Math.pow(2,M-1)*Math.pow(2,s),h=0));s>=8;t[r+S]=a&255,S+=D,a/=256,s-=8);for(h=h<<s|a,y+=s;y>0;t[r+S]=h&255,S+=D,h/=256,y-=8);t[r+S-D]|=O*128}),Fr}var Wr,uo;function Mi(){if(uo)return Wr;uo=1;var t={}.toString;return Wr=Array.isArray||function(e){return t.call(e)=="[object Array]"},Wr}var co;function Oi(){return co||(co=1,(function(t){var e=ki(),r=Pi(),n=Mi();t.Buffer=a,t.SlowBuffer=I,t.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=Jn.TYPED_ARRAY_SUPPORT!==void 0?Jn.TYPED_ARRAY_SUPPORT:s(),t.kMaxLength=c();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 c(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function h(o,l){if(c()<l)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(o=new Uint8Array(l),o.__proto__=a.prototype):(o===null&&(o=new a(l)),o.length=l),o}function a(o,l,p){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(o,l,p);if(typeof o=="number"){if(typeof l=="string")throw new Error("If encoding is specified then the first argument must be a string");return M(this,o)}return g(this,o,l,p)}a.poolSize=8192,a._augment=function(o){return o.__proto__=a.prototype,o};function g(o,l,p,P){if(typeof l=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&l instanceof ArrayBuffer?D(o,l,p,P):typeof l=="string"?x(o,l,p):O(o,l)}a.from=function(o,l,p){return g(null,o,l,p)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0}));function y(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,l,p,P){return y(l),l<=0?h(o,l):p!==void 0?typeof P=="string"?h(o,l).fill(p,P):h(o,l).fill(p):h(o,l)}a.alloc=function(o,l,p){return _(null,o,l,p)};function M(o,l){if(y(l),o=h(o,l<0?0:L(l)|0),!a.TYPED_ARRAY_SUPPORT)for(var p=0;p<l;++p)o[p]=0;return o}a.allocUnsafe=function(o){return M(null,o)},a.allocUnsafeSlow=function(o){return M(null,o)};function x(o,l,p){if((typeof p!="string"||p==="")&&(p="utf8"),!a.isEncoding(p))throw new TypeError('"encoding" must be a valid string encoding');var P=z(l,p)|0;o=h(o,P);var R=o.write(l,p);return R!==P&&(o=o.slice(0,R)),o}function S(o,l){var p=l.length<0?0:L(l.length)|0;o=h(o,p);for(var P=0;P<p;P+=1)o[P]=l[P]&255;return o}function D(o,l,p,P){if(l.byteLength,p<0||l.byteLength<p)throw new RangeError("'offset' is out of bounds");if(l.byteLength<p+(P||0))throw new RangeError("'length' is out of bounds");return p===void 0&&P===void 0?l=new Uint8Array(l):P===void 0?l=new Uint8Array(l,p):l=new Uint8Array(l,p,P),a.TYPED_ARRAY_SUPPORT?(o=l,o.__proto__=a.prototype):o=S(o,l),o}function O(o,l){if(a.isBuffer(l)){var p=L(l.length)|0;return o=h(o,p),o.length===0||l.copy(o,0,0,p),o}if(l){if(typeof ArrayBuffer<"u"&&l.buffer instanceof ArrayBuffer||"length"in l)return typeof l.length!="number"||ce(l.length)?h(o,0):S(o,l);if(l.type==="Buffer"&&n(l.data))return S(o,l.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function L(o){if(o>=c())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c().toString(16)+" bytes");return o|0}function I(o){return+o!=o&&(o=0),a.alloc(+o)}a.isBuffer=function(o){return!!(o!=null&&o._isBuffer)},a.compare=function(o,l){if(!a.isBuffer(o)||!a.isBuffer(l))throw new TypeError("Arguments must be Buffers");if(o===l)return 0;for(var p=o.length,P=l.length,R=0,F=Math.min(p,P);R<F;++R)if(o[R]!==l[R]){p=o[R],P=l[R];break}return p<P?-1:P<p?1:0},a.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}},a.concat=function(o,l){if(!n(o))throw new TypeError('"list" argument must be an Array of Buffers');if(o.length===0)return a.alloc(0);var p;if(l===void 0)for(l=0,p=0;p<o.length;++p)l+=o[p].length;var P=a.allocUnsafe(l),R=0;for(p=0;p<o.length;++p){var F=o[p];if(!a.isBuffer(F))throw new TypeError('"list" argument must be an Array of Buffers');F.copy(P,R),R+=F.length}return P};function z(o,l){if(a.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 p=o.length;if(p===0)return 0;for(var P=!1;;)switch(l){case"ascii":case"latin1":case"binary":return p;case"utf8":case"utf-8":case void 0:return A(o).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p*2;case"hex":return p>>>1;case"base64":return B(o).length;default:if(P)return A(o).length;l=(""+l).toLowerCase(),P=!0}}a.byteLength=z;function V(o,l,p){var P=!1;if((l===void 0||l<0)&&(l=0),l>this.length||((p===void 0||p>this.length)&&(p=this.length),p<=0)||(p>>>=0,l>>>=0,p<=l))return"";for(o||(o="utf8");;)switch(o){case"hex":return m(this,l,p);case"utf8":case"utf-8":return k(this,l,p);case"ascii":return d(this,l,p);case"latin1":case"binary":return u(this,l,p);case"base64":return se(this,l,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f(this,l,p);default:if(P)throw new TypeError("Unknown encoding: "+o);o=(o+"").toLowerCase(),P=!0}}a.prototype._isBuffer=!0;function q(o,l,p){var P=o[l];o[l]=o[p],o[p]=P}a.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 l=0;l<o;l+=2)q(this,l,l+1);return this},a.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 l=0;l<o;l+=4)q(this,l,l+3),q(this,l+1,l+2);return this},a.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 l=0;l<o;l+=8)q(this,l,l+7),q(this,l+1,l+6),q(this,l+2,l+5),q(this,l+3,l+4);return this},a.prototype.toString=function(){var o=this.length|0;return o===0?"":arguments.length===0?k(this,0,o):V.apply(this,arguments)},a.prototype.equals=function(o){if(!a.isBuffer(o))throw new TypeError("Argument must be a Buffer");return this===o?!0:a.compare(this,o)===0},a.prototype.inspect=function(){var o="",l=t.INSPECT_MAX_BYTES;return this.length>0&&(o=this.toString("hex",0,l).match(/.{2}/g).join(" "),this.length>l&&(o+=" ... ")),"<Buffer "+o+">"},a.prototype.compare=function(o,l,p,P,R){if(!a.isBuffer(o))throw new TypeError("Argument must be a Buffer");if(l===void 0&&(l=0),p===void 0&&(p=o?o.length:0),P===void 0&&(P=0),R===void 0&&(R=this.length),l<0||p>o.length||P<0||R>this.length)throw new RangeError("out of range index");if(P>=R&&l>=p)return 0;if(P>=R)return-1;if(l>=p)return 1;if(l>>>=0,p>>>=0,P>>>=0,R>>>=0,this===o)return 0;for(var F=R-P,le=p-l,he=Math.min(F,le),pe=this.slice(P,R),ne=o.slice(l,p),fe=0;fe<he;++fe)if(pe[fe]!==ne[fe]){F=pe[fe],le=ne[fe];break}return F<le?-1:le<F?1:0};function X(o,l,p,P,R){if(o.length===0)return-1;if(typeof p=="string"?(P=p,p=0):p>2147483647?p=2147483647:p<-2147483648&&(p=-2147483648),p=+p,isNaN(p)&&(p=R?0:o.length-1),p<0&&(p=o.length+p),p>=o.length){if(R)return-1;p=o.length-1}else if(p<0)if(R)p=0;else return-1;if(typeof l=="string"&&(l=a.from(l,P)),a.isBuffer(l))return l.length===0?-1:re(o,l,p,P,R);if(typeof l=="number")return l=l&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?R?Uint8Array.prototype.indexOf.call(o,l,p):Uint8Array.prototype.lastIndexOf.call(o,l,p):re(o,[l],p,P,R);throw new TypeError("val must be string, number or Buffer")}function re(o,l,p,P,R){var F=1,le=o.length,he=l.length;if(P!==void 0&&(P=String(P).toLowerCase(),P==="ucs2"||P==="ucs-2"||P==="utf16le"||P==="utf-16le")){if(o.length<2||l.length<2)return-1;F=2,le/=2,he/=2,p/=2}function pe(Se,_e){return F===1?Se[_e]:Se.readUInt16BE(_e*F)}var ne;if(R){var fe=-1;for(ne=p;ne<le;ne++)if(pe(o,ne)===pe(l,fe===-1?0:ne-fe)){if(fe===-1&&(fe=ne),ne-fe+1===he)return fe*F}else fe!==-1&&(ne-=ne-fe),fe=-1}else for(p+he>le&&(p=le-he),ne=p;ne>=0;ne--){for(var me=!0,ge=0;ge<he;ge++)if(pe(o,ne+ge)!==pe(l,ge)){me=!1;break}if(me)return ne}return-1}a.prototype.includes=function(o,l,p){return this.indexOf(o,l,p)!==-1},a.prototype.indexOf=function(o,l,p){return X(this,o,l,p,!0)},a.prototype.lastIndexOf=function(o,l,p){return X(this,o,l,p,!1)};function Q(o,l,p,P){p=Number(p)||0;var R=o.length-p;P?(P=Number(P),P>R&&(P=R)):P=R;var F=l.length;if(F%2!==0)throw new TypeError("Invalid hex string");P>F/2&&(P=F/2);for(var le=0;le<P;++le){var he=parseInt(l.substr(le*2,2),16);if(isNaN(he))return le;o[p+le]=he}return le}function J(o,l,p,P){return Y(A(l,o.length-p),o,p,P)}function Z(o,l,p,P){return Y(N(l),o,p,P)}function U(o,l,p,P){return Z(o,l,p,P)}function W(o,l,p,P){return Y(B(l),o,p,P)}function ae(o,l,p,P){return Y($(l,o.length-p),o,p,P)}a.prototype.write=function(o,l,p,P){if(l===void 0)P="utf8",p=this.length,l=0;else if(p===void 0&&typeof l=="string")P=l,p=this.length,l=0;else if(isFinite(l))l=l|0,isFinite(p)?(p=p|0,P===void 0&&(P="utf8")):(P=p,p=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var R=this.length-l;if((p===void 0||p>R)&&(p=R),o.length>0&&(p<0||l<0)||l>this.length)throw new RangeError("Attempt to write outside buffer bounds");P||(P="utf8");for(var F=!1;;)switch(P){case"hex":return Q(this,o,l,p);case"utf8":case"utf-8":return J(this,o,l,p);case"ascii":return Z(this,o,l,p);case"latin1":case"binary":return U(this,o,l,p);case"base64":return W(this,o,l,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,o,l,p);default:if(F)throw new TypeError("Unknown encoding: "+P);P=(""+P).toLowerCase(),F=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function se(o,l,p){return l===0&&p===o.length?e.fromByteArray(o):e.fromByteArray(o.slice(l,p))}function k(o,l,p){p=Math.min(o.length,p);for(var P=[],R=l;R<p;){var F=o[R],le=null,he=F>239?4:F>223?3:F>191?2:1;if(R+he<=p){var pe,ne,fe,me;switch(he){case 1:F<128&&(le=F);break;case 2:pe=o[R+1],(pe&192)===128&&(me=(F&31)<<6|pe&63,me>127&&(le=me));break;case 3:pe=o[R+1],ne=o[R+2],(pe&192)===128&&(ne&192)===128&&(me=(F&15)<<12|(pe&63)<<6|ne&63,me>2047&&(me<55296||me>57343)&&(le=me));break;case 4:pe=o[R+1],ne=o[R+2],fe=o[R+3],(pe&192)===128&&(ne&192)===128&&(fe&192)===128&&(me=(F&15)<<18|(pe&63)<<12|(ne&63)<<6|fe&63,me>65535&&me<1114112&&(le=me))}}le===null?(le=65533,he=1):le>65535&&(le-=65536,P.push(le>>>10&1023|55296),le=56320|le&1023),P.push(le),R+=he}return v(P)}var C=4096;function v(o){var l=o.length;if(l<=C)return String.fromCharCode.apply(String,o);for(var p="",P=0;P<l;)p+=String.fromCharCode.apply(String,o.slice(P,P+=C));return p}function d(o,l,p){var P="";p=Math.min(o.length,p);for(var R=l;R<p;++R)P+=String.fromCharCode(o[R]&127);return P}function u(o,l,p){var P="";p=Math.min(o.length,p);for(var R=l;R<p;++R)P+=String.fromCharCode(o[R]);return P}function m(o,l,p){var P=o.length;(!l||l<0)&&(l=0),(!p||p<0||p>P)&&(p=P);for(var R="",F=l;F<p;++F)R+=ue(o[F]);return R}function f(o,l,p){for(var P=o.slice(l,p),R="",F=0;F<P.length;F+=2)R+=String.fromCharCode(P[F]+P[F+1]*256);return R}a.prototype.slice=function(o,l){var p=this.length;o=~~o,l=l===void 0?p:~~l,o<0?(o+=p,o<0&&(o=0)):o>p&&(o=p),l<0?(l+=p,l<0&&(l=0)):l>p&&(l=p),l<o&&(l=o);var P;if(a.TYPED_ARRAY_SUPPORT)P=this.subarray(o,l),P.__proto__=a.prototype;else{var R=l-o;P=new a(R,void 0);for(var F=0;F<R;++F)P[F]=this[F+o]}return P};function i(o,l,p){if(o%1!==0||o<0)throw new RangeError("offset is not uint");if(o+l>p)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUIntLE=function(o,l,p){o=o|0,l=l|0,p||i(o,l,this.length);for(var P=this[o],R=1,F=0;++F<l&&(R*=256);)P+=this[o+F]*R;return P},a.prototype.readUIntBE=function(o,l,p){o=o|0,l=l|0,p||i(o,l,this.length);for(var P=this[o+--l],R=1;l>0&&(R*=256);)P+=this[o+--l]*R;return P},a.prototype.readUInt8=function(o,l){return l||i(o,1,this.length),this[o]},a.prototype.readUInt16LE=function(o,l){return l||i(o,2,this.length),this[o]|this[o+1]<<8},a.prototype.readUInt16BE=function(o,l){return l||i(o,2,this.length),this[o]<<8|this[o+1]},a.prototype.readUInt32LE=function(o,l){return l||i(o,4,this.length),(this[o]|this[o+1]<<8|this[o+2]<<16)+this[o+3]*16777216},a.prototype.readUInt32BE=function(o,l){return l||i(o,4,this.length),this[o]*16777216+(this[o+1]<<16|this[o+2]<<8|this[o+3])},a.prototype.readIntLE=function(o,l,p){o=o|0,l=l|0,p||i(o,l,this.length);for(var P=this[o],R=1,F=0;++F<l&&(R*=256);)P+=this[o+F]*R;return R*=128,P>=R&&(P-=Math.pow(2,8*l)),P},a.prototype.readIntBE=function(o,l,p){o=o|0,l=l|0,p||i(o,l,this.length);for(var P=l,R=1,F=this[o+--P];P>0&&(R*=256);)F+=this[o+--P]*R;return R*=128,F>=R&&(F-=Math.pow(2,8*l)),F},a.prototype.readInt8=function(o,l){return l||i(o,1,this.length),this[o]&128?(255-this[o]+1)*-1:this[o]},a.prototype.readInt16LE=function(o,l){l||i(o,2,this.length);var p=this[o]|this[o+1]<<8;return p&32768?p|4294901760:p},a.prototype.readInt16BE=function(o,l){l||i(o,2,this.length);var p=this[o+1]|this[o]<<8;return p&32768?p|4294901760:p},a.prototype.readInt32LE=function(o,l){return l||i(o,4,this.length),this[o]|this[o+1]<<8|this[o+2]<<16|this[o+3]<<24},a.prototype.readInt32BE=function(o,l){return l||i(o,4,this.length),this[o]<<24|this[o+1]<<16|this[o+2]<<8|this[o+3]},a.prototype.readFloatLE=function(o,l){return l||i(o,4,this.length),r.read(this,o,!0,23,4)},a.prototype.readFloatBE=function(o,l){return l||i(o,4,this.length),r.read(this,o,!1,23,4)},a.prototype.readDoubleLE=function(o,l){return l||i(o,8,this.length),r.read(this,o,!0,52,8)},a.prototype.readDoubleBE=function(o,l){return l||i(o,8,this.length),r.read(this,o,!1,52,8)};function b(o,l,p,P,R,F){if(!a.isBuffer(o))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>R||l<F)throw new RangeError('"value" argument is out of bounds');if(p+P>o.length)throw new RangeError("Index out of range")}a.prototype.writeUIntLE=function(o,l,p,P){if(o=+o,l=l|0,p=p|0,!P){var R=Math.pow(2,8*p)-1;b(this,o,l,p,R,0)}var F=1,le=0;for(this[l]=o&255;++le<p&&(F*=256);)this[l+le]=o/F&255;return l+p},a.prototype.writeUIntBE=function(o,l,p,P){if(o=+o,l=l|0,p=p|0,!P){var R=Math.pow(2,8*p)-1;b(this,o,l,p,R,0)}var F=p-1,le=1;for(this[l+F]=o&255;--F>=0&&(le*=256);)this[l+F]=o/le&255;return l+p},a.prototype.writeUInt8=function(o,l,p){return o=+o,l=l|0,p||b(this,o,l,1,255,0),a.TYPED_ARRAY_SUPPORT||(o=Math.floor(o)),this[l]=o&255,l+1};function T(o,l,p,P){l<0&&(l=65535+l+1);for(var R=0,F=Math.min(o.length-p,2);R<F;++R)o[p+R]=(l&255<<8*(P?R:1-R))>>>(P?R:1-R)*8}a.prototype.writeUInt16LE=function(o,l,p){return o=+o,l=l|0,p||b(this,o,l,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[l]=o&255,this[l+1]=o>>>8):T(this,o,l,!0),l+2},a.prototype.writeUInt16BE=function(o,l,p){return o=+o,l=l|0,p||b(this,o,l,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[l]=o>>>8,this[l+1]=o&255):T(this,o,l,!1),l+2};function j(o,l,p,P){l<0&&(l=4294967295+l+1);for(var R=0,F=Math.min(o.length-p,4);R<F;++R)o[p+R]=l>>>(P?R:3-R)*8&255}a.prototype.writeUInt32LE=function(o,l,p){return o=+o,l=l|0,p||b(this,o,l,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[l+3]=o>>>24,this[l+2]=o>>>16,this[l+1]=o>>>8,this[l]=o&255):j(this,o,l,!0),l+4},a.prototype.writeUInt32BE=function(o,l,p){return o=+o,l=l|0,p||b(this,o,l,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[l]=o>>>24,this[l+1]=o>>>16,this[l+2]=o>>>8,this[l+3]=o&255):j(this,o,l,!1),l+4},a.prototype.writeIntLE=function(o,l,p,P){if(o=+o,l=l|0,!P){var R=Math.pow(2,8*p-1);b(this,o,l,p,R-1,-R)}var F=0,le=1,he=0;for(this[l]=o&255;++F<p&&(le*=256);)o<0&&he===0&&this[l+F-1]!==0&&(he=1),this[l+F]=(o/le>>0)-he&255;return l+p},a.prototype.writeIntBE=function(o,l,p,P){if(o=+o,l=l|0,!P){var R=Math.pow(2,8*p-1);b(this,o,l,p,R-1,-R)}var F=p-1,le=1,he=0;for(this[l+F]=o&255;--F>=0&&(le*=256);)o<0&&he===0&&this[l+F+1]!==0&&(he=1),this[l+F]=(o/le>>0)-he&255;return l+p},a.prototype.writeInt8=function(o,l,p){return o=+o,l=l|0,p||b(this,o,l,1,127,-128),a.TYPED_ARRAY_SUPPORT||(o=Math.floor(o)),o<0&&(o=255+o+1),this[l]=o&255,l+1},a.prototype.writeInt16LE=function(o,l,p){return o=+o,l=l|0,p||b(this,o,l,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[l]=o&255,this[l+1]=o>>>8):T(this,o,l,!0),l+2},a.prototype.writeInt16BE=function(o,l,p){return o=+o,l=l|0,p||b(this,o,l,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[l]=o>>>8,this[l+1]=o&255):T(this,o,l,!1),l+2},a.prototype.writeInt32LE=function(o,l,p){return o=+o,l=l|0,p||b(this,o,l,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[l]=o&255,this[l+1]=o>>>8,this[l+2]=o>>>16,this[l+3]=o>>>24):j(this,o,l,!0),l+4},a.prototype.writeInt32BE=function(o,l,p){return o=+o,l=l|0,p||b(this,o,l,4,2147483647,-2147483648),o<0&&(o=4294967295+o+1),a.TYPED_ARRAY_SUPPORT?(this[l]=o>>>24,this[l+1]=o>>>16,this[l+2]=o>>>8,this[l+3]=o&255):j(this,o,l,!1),l+4};function K(o,l,p,P,R,F){if(p+P>o.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("Index out of range")}function ee(o,l,p,P,R){return R||K(o,l,p,4),r.write(o,l,p,P,23,4),p+4}a.prototype.writeFloatLE=function(o,l,p){return ee(this,o,l,!0,p)},a.prototype.writeFloatBE=function(o,l,p){return ee(this,o,l,!1,p)};function te(o,l,p,P,R){return R||K(o,l,p,8),r.write(o,l,p,P,52,8),p+8}a.prototype.writeDoubleLE=function(o,l,p){return te(this,o,l,!0,p)},a.prototype.writeDoubleBE=function(o,l,p){return te(this,o,l,!1,p)},a.prototype.copy=function(o,l,p,P){if(p||(p=0),!P&&P!==0&&(P=this.length),l>=o.length&&(l=o.length),l||(l=0),P>0&&P<p&&(P=p),P===p||o.length===0||this.length===0)return 0;if(l<0)throw new RangeError("targetStart out of bounds");if(p<0||p>=this.length)throw new RangeError("sourceStart out of bounds");if(P<0)throw new RangeError("sourceEnd out of bounds");P>this.length&&(P=this.length),o.length-l<P-p&&(P=o.length-l+p);var R=P-p,F;if(this===o&&p<l&&l<P)for(F=R-1;F>=0;--F)o[F+l]=this[F+p];else if(R<1e3||!a.TYPED_ARRAY_SUPPORT)for(F=0;F<R;++F)o[F+l]=this[F+p];else Uint8Array.prototype.set.call(o,this.subarray(p,p+R),l);return R},a.prototype.fill=function(o,l,p,P){if(typeof o=="string"){if(typeof l=="string"?(P=l,l=0,p=this.length):typeof p=="string"&&(P=p,p=this.length),o.length===1){var R=o.charCodeAt(0);R<256&&(o=R)}if(P!==void 0&&typeof P!="string")throw new TypeError("encoding must be a string");if(typeof P=="string"&&!a.isEncoding(P))throw new TypeError("Unknown encoding: "+P)}else typeof o=="number"&&(o=o&255);if(l<0||this.length<l||this.length<p)throw new RangeError("Out of range index");if(p<=l)return this;l=l>>>0,p=p===void 0?this.length:p>>>0,o||(o=0);var F;if(typeof o=="number")for(F=l;F<p;++F)this[F]=o;else{var le=a.isBuffer(o)?o:A(new a(o,P).toString()),he=le.length;for(F=0;F<p-l;++F)this[F+l]=le[F%he]}return this};var H=/[^+\/0-9A-Za-z-_]/g;function ie(o){if(o=oe(o).replace(H,""),o.length<2)return"";for(;o.length%4!==0;)o=o+"=";return o}function oe(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 A(o,l){l=l||1/0;for(var p,P=o.length,R=null,F=[],le=0;le<P;++le){if(p=o.charCodeAt(le),p>55295&&p<57344){if(!R){if(p>56319){(l-=3)>-1&&F.push(239,191,189);continue}else if(le+1===P){(l-=3)>-1&&F.push(239,191,189);continue}R=p;continue}if(p<56320){(l-=3)>-1&&F.push(239,191,189),R=p;continue}p=(R-55296<<10|p-56320)+65536}else R&&(l-=3)>-1&&F.push(239,191,189);if(R=null,p<128){if((l-=1)<0)break;F.push(p)}else if(p<2048){if((l-=2)<0)break;F.push(p>>6|192,p&63|128)}else if(p<65536){if((l-=3)<0)break;F.push(p>>12|224,p>>6&63|128,p&63|128)}else if(p<1114112){if((l-=4)<0)break;F.push(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}else throw new Error("Invalid code point")}return F}function N(o){for(var l=[],p=0;p<o.length;++p)l.push(o.charCodeAt(p)&255);return l}function $(o,l){for(var p,P,R,F=[],le=0;le<o.length&&!((l-=2)<0);++le)p=o.charCodeAt(le),P=p>>8,R=p%256,F.push(R),F.push(P);return F}function B(o){return e.toByteArray(ie(o))}function Y(o,l,p,P){for(var R=0;R<P&&!(R+p>=l.length||R>=o.length);++R)l[R+p]=o[R];return R}function ce(o){return o!==o}})(io)),io}Oi();var vt;if(typeof window<"u"&&window.crypto&&(vt=window.crypto),!vt&&typeof window<"u"&&window.msCrypto&&(vt=window.msCrypto),!vt&&typeof global<"u"&&global.crypto&&(vt=global.crypto),!vt&&typeof require=="function")try{vt=require("crypto")}catch{}var ho={};var Ur=function(t,e){return Ur=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])},Ur(t,e)};function Ai(t,e){Ur(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var qr=function(){return qr=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},qr.apply(this,arguments)};function Ei(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 Ti(t,e,r,n){var s=arguments.length,c=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(h=t[a])&&(c=(s<3?h(c):s>3?h(e,r,c):h(e,r))||c);return s>3&&c&&Object.defineProperty(e,r,c),c}function ji(t,e){return function(r,n){e(r,n,t)}}function $i(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Ri(t,e,r,n){function s(c){return c instanceof r?c:new r(function(h){h(c)})}return new(r||(r=Promise))(function(c,h){function a(_){try{y(n.next(_))}catch(M){h(M)}}function g(_){try{y(n.throw(_))}catch(M){h(M)}}function y(_){_.done?c(_.value):s(_.value).then(a,g)}y((n=n.apply(t,e||[])).next())})}function Ni(t,e){var r={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},n,s,c,h;return h={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function a(y){return function(_){return g([y,_])}}function g(y){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,s&&(c=y[0]&2?s.return:y[0]?s.throw||((c=s.return)&&c.call(s),0):s.next)&&!(c=c.call(s,y[1])).done)return c;switch(s=0,c&&(y=[y[0]&2,c.value]),y[0]){case 0:case 1:c=y;break;case 4:return r.label++,{value:y[1],done:!1};case 5:r.label++,s=y[1],y=[0];continue;case 7:y=r.ops.pop(),r.trys.pop();continue;default:if(c=r.trys,!(c=c.length>0&&c[c.length-1])&&(y[0]===6||y[0]===2)){r=0;continue}if(y[0]===3&&(!c||y[1]>c[0]&&y[1]<c[3])){r.label=y[1];break}if(y[0]===6&&r.label<c[1]){r.label=c[1],c=y;break}if(c&&r.label<c[2]){r.label=c[2],r.ops.push(y);break}c[2]&&r.ops.pop(),r.trys.pop();continue}y=e.call(t,r)}catch(_){y=[6,_],s=0}finally{n=c=0}if(y[0]&5)throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}}function Li(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Bi(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Vr(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 fo(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),s,c=[],h;try{for(;(e===void 0||e-- >0)&&!(s=n.next()).done;)c.push(s.value)}catch(a){h={error:a}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(h)throw h.error}}return c}function Ii(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(fo(arguments[e]));return t}function Yi(){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 c=arguments[e],h=0,a=c.length;h<a;h++,s++)n[s]=c[h];return n}function Bt(t){return this instanceof Bt?(this.v=t,this):new Bt(t)}function zi(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),s,c=[];return s={},h("next"),h("throw"),h("return"),s[Symbol.asyncIterator]=function(){return this},s;function h(x){n[x]&&(s[x]=function(S){return new Promise(function(D,O){c.push([x,S,D,O])>1||a(x,S)})})}function a(x,S){try{g(n[x](S))}catch(D){M(c[0][3],D)}}function g(x){x.value instanceof Bt?Promise.resolve(x.value.v).then(y,_):M(c[0][2],x)}function y(x){a("next",x)}function _(x){a("throw",x)}function M(x,S){x(S),c.shift(),c.length&&a(c[0][0],c[0][1])}}function Fi(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,c){e[s]=t[s]?function(h){return(r=!r)?{value:Bt(t[s](h)),done:s==="return"}:c?c(h):h}:c}}function Wi(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 Vr=="function"?Vr(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(c){r[c]=t[c]&&function(h){return new Promise(function(a,g){h=t[c](h),s(a,g,h.done,h.value)})}}function s(c,h,a,g){Promise.resolve(g).then(function(y){c({value:y,done:a})},h)}}function Ui(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function qi(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 Vi(t){return t&&t.__esModule?t:{default:t}}function Hi(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Gi(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 Qi=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return qr},__asyncDelegator:Fi,__asyncGenerator:zi,__asyncValues:Wi,__await:Bt,__awaiter:Ri,__classPrivateFieldGet:Hi,__classPrivateFieldSet:Gi,__createBinding:Li,__decorate:Ti,__exportStar:Bi,__extends:Ai,__generator:Ni,__importDefault:Vi,__importStar:qi,__makeTemplateObject:Ui,__metadata:$i,__param:ji,__read:fo,__rest:Ei,__spread:Ii,__spreadArrays:Yi,__values:Vr},Symbol.toStringTag,{value:"Module"})),po=Br(Qi);var It={},We={},go;function mo(){return go||(go=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 Yt={},yo;function Zi(){if(yo)return Yt;yo=1,Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.RawSha256=void 0;var t=mo(),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,c=n.byteLength;if(this.bytesHashed+=c,this.bytesHashed*8>t.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;c>0;)this.buffer[this.bufferLength++]=n[s++],c--,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),c=this.bufferLength;if(s.setUint8(this.bufferLength++,128),c%t.BLOCK_SIZE>=t.BLOCK_SIZE-8){for(var h=this.bufferLength;h<t.BLOCK_SIZE;h++)s.setUint8(h,0);this.hashBuffer(),this.bufferLength=0}for(var h=this.bufferLength;h<t.BLOCK_SIZE-8;h++)s.setUint8(h,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 a=new Uint8Array(t.DIGEST_LENGTH),h=0;h<8;h++)a[h*4]=this.state[h]>>>24&255,a[h*4+1]=this.state[h]>>>16&255,a[h*4+2]=this.state[h]>>>8&255,a[h*4+3]=this.state[h]>>>0&255;return a},r.prototype.hashBuffer=function(){for(var n=this,s=n.buffer,c=n.state,h=c[0],a=c[1],g=c[2],y=c[3],_=c[4],M=c[5],x=c[6],S=c[7],D=0;D<t.BLOCK_SIZE;D++){if(D<16)this.temp[D]=(s[D*4]&255)<<24|(s[D*4+1]&255)<<16|(s[D*4+2]&255)<<8|s[D*4+3]&255;else{var O=this.temp[D-2],L=(O>>>17|O<<15)^(O>>>19|O<<13)^O>>>10;O=this.temp[D-15];var I=(O>>>7|O<<25)^(O>>>18|O<<14)^O>>>3;this.temp[D]=(L+this.temp[D-7]|0)+(I+this.temp[D-16]|0)}var z=(((_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&M^~_&x)|0)+(S+(t.KEY[D]+this.temp[D]|0)|0)|0,V=((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+(h&a^h&g^a&g)|0;S=x,x=M,M=_,_=y+z|0,y=g,g=a,a=h,h=z+V|0}c[0]+=h,c[1]+=a,c[2]+=g,c[3]+=y,c[4]+=_,c[5]+=M,c[6]+=x,c[7]+=S},r})();return Yt.RawSha256=e,Yt}var vo={},zt={};const Ki=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 c=65536+((s&1023)<<10)+(t.charCodeAt(++r)&1023);e.push(c>>18|240,c>>12&63|128,c>>6&63|128,c&63|128)}else e.push(s>>12|224,s>>6&63|128,s&63|128)}return Uint8Array.from(e)},Ji=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 c=t[++r];e+=String.fromCharCode((s&31)<<6|c&63)}else if(240<=s&&s<365){const c="%"+[s,t[++r],t[++r],t[++r]].map(h=>h.toString(16)).join("%");e+=decodeURIComponent(c)}else e+=String.fromCharCode((s&15)<<12|(t[++r]&63)<<6|t[++r]&63)}return e};function Xi(t){return new TextEncoder().encode(t)}function ea(t){return new TextDecoder("utf-8").decode(t)}const ta=t=>typeof TextEncoder=="function"?Xi(t):Ki(t),ra=t=>typeof TextDecoder=="function"?ea(t):Ji(t),na=Object.freeze(Object.defineProperty({__proto__:null,fromUtf8:ta,toUtf8:ra},Symbol.toStringTag,{value:"Module"})),oa=Br(na);var bo;function sa(){if(bo)return zt;bo=1,Object.defineProperty(zt,"__esModule",{value:!0}),zt.convertToBuffer=void 0;var t=oa,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 zt.convertToBuffer=r,zt}var Ft={},wo;function ia(){if(wo)return Ft;wo=1,Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.isEmptyData=void 0;function t(e){return typeof e=="string"?e.length===0:e.byteLength===0}return Ft.isEmptyData=t,Ft}var Wt={},_o;function aa(){if(_o)return Wt;_o=1,Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.numToUint8=void 0;function t(e){return new Uint8Array([(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255])}return Wt.numToUint8=t,Wt}var Ut={},Co;function la(){if(Co)return Ut;Co=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.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 Ut.uint32ArrayFrom=t,Ut}var xo;function ua(){return xo||(xo=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=t.numToUint8=t.isEmptyData=t.convertToBuffer=void 0;var e=sa();Object.defineProperty(t,"convertToBuffer",{enumerable:!0,get:function(){return e.convertToBuffer}});var r=ia();Object.defineProperty(t,"isEmptyData",{enumerable:!0,get:function(){return r.isEmptyData}});var n=aa();Object.defineProperty(t,"numToUint8",{enumerable:!0,get:function(){return n.numToUint8}});var s=la();Object.defineProperty(t,"uint32ArrayFrom",{enumerable:!0,get:function(){return s.uint32ArrayFrom}})})(vo)),vo}var So;function ca(){if(So)return It;So=1,Object.defineProperty(It,"__esModule",{value:!0}),It.Sha256=void 0;var t=po,e=mo(),r=Zi(),n=ua(),s=(function(){function h(a){if(this.hash=new r.RawSha256,a){this.outer=new r.RawSha256;var g=c(a),y=new Uint8Array(e.BLOCK_SIZE);y.set(g);for(var _=0;_<e.BLOCK_SIZE;_++)g[_]^=54,y[_]^=92;this.hash.update(g),this.outer.update(y);for(var _=0;_<g.byteLength;_++)g[_]=0}}return h.prototype.update=function(a){if(!((0,n.isEmptyData)(a)||this.error))try{this.hash.update((0,n.convertToBuffer)(a))}catch(g){this.error=g}},h.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()},h.prototype.digest=function(){return(0,t.__awaiter)(this,void 0,void 0,function(){return(0,t.__generator)(this,function(a){return[2,this.digestSync()]})})},h})();It.Sha256=s;function c(h){var a=(0,n.convertToBuffer)(h);if(a.byteLength>e.BLOCK_SIZE){var g=new r.RawSha256;g.update(a),a=g.digest()}var y=new Uint8Array(e.BLOCK_SIZE);return y.set(a),y}return It}var Do;function da(){return Do||(Do=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=po;(0,e.__exportStar)(ca(),t)})(ho)),ho}da();function ye(t,e){t!=null&&this.fromString(t,e)}function Be(){return new ye(null)}var lt,ha=0xdeadbeefcafe,ko=(ha&16777215)==15715070;function fa(t,e,r,n,s,c){for(;--c>=0;){var h=e*this[t++]+r[n]+s;s=Math.floor(h/67108864),r[n++]=h&67108863}return s}function pa(t,e,r,n,s,c){for(var h=e&32767,a=e>>15;--c>=0;){var g=this[t]&32767,y=this[t++]>>15,_=a*g+y*h;g=h*g+((_&32767)<<15)+r[n]+(s&1073741823),s=(g>>>30)+(_>>>15)+a*y+(s>>>30),r[n++]=g&1073741823}return s}function ga(t,e,r,n,s,c){for(var h=e&16383,a=e>>14;--c>=0;){var g=this[t]&16383,y=this[t++]>>14,_=a*g+y*h;g=h*g+((_&16383)<<14)+r[n]+s,s=(g>>28)+(_>>14)+a*y,r[n++]=g&268435455}return s}var Po=typeof navigator<"u";Po&&ko&&navigator.appName=="Microsoft Internet Explorer"?(ye.prototype.am=pa,lt=30):Po&&ko&&navigator.appName!="Netscape"?(ye.prototype.am=fa,lt=26):(ye.prototype.am=ga,lt=28),ye.prototype.DB=lt,ye.prototype.DM=(1<<lt)-1,ye.prototype.DV=1<<lt;var Hr=52;ye.prototype.FV=Math.pow(2,Hr),ye.prototype.F1=Hr-lt,ye.prototype.F2=2*lt-Hr;var ma="0123456789abcdefghijklmnopqrstuvwxyz",rr=new Array,Dt,Ue;for(Dt=48,Ue=0;Ue<=9;++Ue)rr[Dt++]=Ue;for(Dt=97,Ue=10;Ue<36;++Ue)rr[Dt++]=Ue;for(Dt=65,Ue=10;Ue<36;++Ue)rr[Dt++]=Ue;function Mo(t){return ma.charAt(t)}function ya(t,e){var r=rr[t.charCodeAt(e)];return r??-1}function va(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function ba(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 Gr(t){var e=Be();return e.fromInt(t),e}function wa(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,c=0;--n>=0;){var h=ya(t,n);if(h<0){t.charAt(n)=="-"&&(s=!0);continue}s=!1,c==0?this[this.t++]=h:c+r>this.DB?(this[this.t-1]|=(h&(1<<this.DB-c)-1)<<c,this[this.t++]=h>>this.DB-c):this[this.t-1]|=h<<c,c+=r,c>=this.DB&&(c-=this.DB)}this.clamp(),s&&ye.ZERO.subTo(this,this)}function _a(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function Ca(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,c="",h=this.t,a=this.DB-h*this.DB%e;if(h-- >0)for(a<this.DB&&(n=this[h]>>a)>0&&(s=!0,c=Mo(n));h>=0;)a<e?(n=(this[h]&(1<<a)-1)<<e-a,n|=this[--h]>>(a+=this.DB-e)):(n=this[h]>>(a-=e)&r,a<=0&&(a+=this.DB,--h)),n>0&&(s=!0),s&&(c+=Mo(n));return s?c:"0"}function xa(){var t=Be();return ye.ZERO.subTo(this,t),t}function Sa(){return this.s<0?this.negate():this}function Da(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 Qr(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 ka(){return this.t<=0?0:this.DB*(this.t-1)+Qr(this[this.t-1]^this.s&this.DM)}function Pa(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 Ma(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 Oa(t,e){var r=t%this.DB,n=this.DB-r,s=(1<<n)-1,c=Math.floor(t/this.DB),h=this.s<<r&this.DM,a;for(a=this.t-1;a>=0;--a)e[a+c+1]=this[a]>>n|h,h=(this[a]&s)<<r;for(a=c-1;a>=0;--a)e[a]=0;e[c]=h,e.t=this.t+c+1,e.s=this.s,e.clamp()}function Aa(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,c=(1<<n)-1;e[0]=this[r]>>n;for(var h=r+1;h<this.t;++h)e[h-r-1]|=(this[h]&c)<<s,e[h-r]=this[h]>>n;n>0&&(e[this.t-r-1]|=(this.s&c)<<s),e.t=this.t-r,e.clamp()}function Ea(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 Ta(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 ja(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 $a(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=Be());var c=Be(),h=this.s,a=t.s,g=this.DB-Qr(n[n.t-1]);g>0?(n.lShiftTo(g,c),s.lShiftTo(g,r)):(n.copyTo(c),s.copyTo(r));var y=c.t,_=c[y-1];if(_!=0){var M=_*(1<<this.F1)+(y>1?c[y-2]>>this.F2:0),x=this.FV/M,S=(1<<this.F1)/M,D=1<<this.F2,O=r.t,L=O-y,I=e??Be();for(c.dlShiftTo(L,I),r.compareTo(I)>=0&&(r[r.t++]=1,r.subTo(I,r)),ye.ONE.dlShiftTo(y,I),I.subTo(c,c);c.t<y;)c[c.t++]=0;for(;--L>=0;){var z=r[--O]==_?this.DM:Math.floor(r[O]*x+(r[O-1]+D)*S);if((r[O]+=c.am(0,z,r,L,0,y))<z)for(c.dlShiftTo(L,I),r.subTo(I,r);r[O]<--z;)r.subTo(I,r)}e!=null&&(r.drShiftTo(y,e),h!=a&&ye.ZERO.subTo(e,e)),r.t=y,r.clamp(),g>0&&r.rShiftTo(g,r),h<0&&ye.ZERO.subTo(r,r)}}}function Ra(t){var e=Be();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(ye.ZERO)>0&&t.subTo(e,e),e}function Na(){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 La(t){return this.compareTo(t)==0}function Ba(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 Ia(t){var e=Be();return this.addTo(t,e),e}function Ya(t){var e=Be();return this.subTo(t,e),e}function za(t){var e=Be();return this.multiplyTo(t,e),e}function Fa(t){var e=Be();return this.divRemTo(t,e,null),e}function kt(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 Wa(t){var e=Be();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 Ua(t){var e=Be();return t.copyTo(e),this.reduce(e),e}function qa(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 Va(t,e){t.squareTo(e),this.reduce(e)}function Ha(t,e,r){t.multiplyTo(e,r),this.reduce(r)}kt.prototype.convert=Wa,kt.prototype.revert=Ua,kt.prototype.reduce=qa,kt.prototype.mulTo=Ha,kt.prototype.sqrTo=Va;function Ga(t,e,r){var n=t.bitLength(),s,c=Gr(1),h=new kt(e);if(n<=0)return c;n<18?s=1:n<48?s=3:n<144?s=4:n<768?s=5:s=6;var a=new Array,g=3,y=s-1,_=(1<<s)-1;if(a[1]=h.convert(this),s>1){var M=Be();for(h.sqrTo(a[1],M);g<=_;)a[g]=Be(),h.mulTo(M,a[g-2],a[g]),g+=2}var x=t.t-1,S,D=!0,O=Be(),L;for(n=Qr(t[x])-1;x>=0;){for(n>=y?S=t[x]>>n-y&_:(S=(t[x]&(1<<n+1)-1)<<y-n,x>0&&(S|=t[x-1]>>this.DB+n-y)),g=s;(S&1)==0;)S>>=1,--g;if((n-=g)<0&&(n+=this.DB,--x),D)a[S].copyTo(c),D=!1;else{for(;g>1;)h.sqrTo(c,O),h.sqrTo(O,c),g-=2;g>0?h.sqrTo(c,O):(L=c,c=O,O=L),h.mulTo(O,a[S],c)}for(;x>=0&&(t[x]&1<<n)==0;)h.sqrTo(c,O),L=c,c=O,O=L,--n<0&&(n=this.DB-1,--x)}var I=h.revert(c);return r(null,I),I}ye.prototype.copyTo=va,ye.prototype.fromInt=ba,ye.prototype.fromString=wa,ye.prototype.clamp=_a,ye.prototype.dlShiftTo=Pa,ye.prototype.drShiftTo=Ma,ye.prototype.lShiftTo=Oa,ye.prototype.rShiftTo=Aa,ye.prototype.subTo=Ea,ye.prototype.multiplyTo=Ta,ye.prototype.squareTo=ja,ye.prototype.divRemTo=$a,ye.prototype.invDigit=Na,ye.prototype.addTo=Ba,ye.prototype.toString=Ca,ye.prototype.negate=xa,ye.prototype.abs=Sa,ye.prototype.compareTo=Da,ye.prototype.bitLength=ka,ye.prototype.mod=Ra,ye.prototype.equals=La,ye.prototype.add=Ia,ye.prototype.subtract=Ya,ye.prototype.multiply=za,ye.prototype.divide=Fa,ye.prototype.modPow=Ga,ye.ZERO=Gr(0),ye.ONE=Gr(1);function Qa(t,e){return e=e||{},new Promise(function(r,n){var s=new XMLHttpRequest,c=[],h=[],a={},g=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:g,headers:{keys:function(){return c},entries:function(){return h},get:function(_){return a[_.toLowerCase()]},has:function(_){return _.toLowerCase()in a}}}};for(var y in s.open(e.method||"get",t,!0),s.onload=function(){s.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(_,M,x){c.push(M=M.toLowerCase()),h.push([M,x]),a[M]=a[M]?a[M]+","+x:x}),r(g())},s.onerror=n,s.withCredentials=e.credentials=="include",e.headers)s.setRequestHeader(y,e.headers[y]);s.send(e.body||null)})}const Za=Object.freeze(Object.defineProperty({__proto__:null,default:Qa},Symbol.toStringTag,{value:"Module"})),Oo=Br(Za);var Ao,Eo;function Ka(){return Eo||(Eo=1,Ao=self.fetch||(self.fetch=Oo.default||Oo)),Ao}Ka();var To={exports:{}};var jo;function Ja(){return jo||(jo=1,(function(t,e){(function(r){var n;if(t.exports=r(),n=!0,!n){var s=window.Cookies,c=window.Cookies=r();c.noConflict=function(){return window.Cookies=s,c}}})(function(){function r(){for(var c=0,h={};c<arguments.length;c++){var a=arguments[c];for(var g in a)h[g]=a[g]}return h}function n(c){return c.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function s(c){function h(){}function a(y,_,M){if(!(typeof document>"u")){M=r({path:"/"},h.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 x=JSON.stringify(_);/^[\{\[]/.test(x)&&(_=x)}catch{}_=c.write?c.write(_,y):encodeURIComponent(String(_)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),y=encodeURIComponent(String(y)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var S="";for(var D in M)M[D]&&(S+="; "+D,M[D]!==!0&&(S+="="+M[D].split(";")[0]));return document.cookie=y+"="+_+S}}function g(y,_){if(!(typeof document>"u")){for(var M={},x=document.cookie?document.cookie.split("; "):[],S=0;S<x.length;S++){var D=x[S].split("="),O=D.slice(1).join("=");!_&&O.charAt(0)==='"'&&(O=O.slice(1,-1));try{var L=n(D[0]);if(O=(c.read||c)(O,L)||n(O),_)try{O=JSON.parse(O)}catch{}if(M[L]=O,y===L)break}catch{}}return y?M[y]:M}}return h.set=a,h.get=function(y){return g(y,!1)},h.getJSON=function(y){return g(y,!0)},h.remove=function(y,_){a(y,"",r(_,{expires:-1}))},h.defaults={},h.withConverter=s,h}return s(function(){})})})(To)),To.exports}Ja();function Xa(){if(!window.MantineCognitoUserPool)throw new Error("Cognito Userpool has not been initialized.");return window.MantineCognitoUserPool}function el(){return Xa().getCurrentUser()}function tl(){return new Promise((t,e)=>{const r=el();r===null&&e(null),r?.getSession((n,s)=>{if(n!==null||s===null)return e(null);t({session:s,authenticatedUser:r})})})}async function rl(){const{session:t}=await tl();return t?.getIdToken().getJwtToken()}G.createContext(void 0);var nl="undefined",ol="object",nr="browser",$o="cpu",Ro="device",Zr="engine",or="os",ut="name",sr="type",Kr="vendor",Je="version",Jr="architecture",Xr="major",en="model",sl="console",il="mobile",al="tablet",ll="smarttv",ul="wearable",cl="embedded",dl=typeof window!==nl,tn=dl&&window.navigator?window.navigator:void 0;tn&&tn.userAgentData&&tn.userAgentData;var ir=function(t){for(var e={},r=0;r<t.length;r++)e[t[r].toUpperCase()]=t[r];return e},ar=function(t){for(var e in t){var r=t[e];typeof r==ol&&r.length==2?this[r[0]]=r[1]:this[r]=void 0}return this};(function(){var t={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return ar.call(t.init,[[nr,[ut,Je,Xr,sr]],[$o,[Jr]],[Ro,[sr,en,Kr]],[Zr,[ut,Je]],[or,[ut,Je]]]),ar.call(t.isIgnore,[[nr,[Je,Xr]],[Zr,[Je]],[or,[Je]]]),ar.call(t.isIgnoreRgx,[[nr,/ ?browser$/i],[or,/ ?os$/i]]),ar.call(t.toString,[[nr,[ut,Je]],[$o,[Jr]],[Ro,[Kr,en]],[Zr,[ut,Je]],[or,[ut,Je]]]),t})(),ir([ut,Je,Xr,sr]),ir([Jr]),ir([en,Kr,sr,sl,il,ll,al,ul,cl]),ir([ut,Je]);var rn={exports:{}},hl=rn.exports,No;function fl(){return No||(No=1,(function(t,e){(function(r,n){t.exports=n()})(hl,()=>(()=>{var r={873:(h,a)=>{var g,y,_=(function(){var M=function(k,C){var v=k,d=I[C],u=null,m=0,f=null,i=[],b={},T=function(A,N){u=(function($){for(var B=new Array($),Y=0;Y<$;Y+=1){B[Y]=new Array($);for(var ce=0;ce<$;ce+=1)B[Y][ce]=null}return B})(m=4*v+17),j(0,0),j(m-7,0),j(0,m-7),ee(),K(),H(A,N),v>=7&&te(A),f==null&&(f=oe(v,d,i)),ie(f,N)},j=function(A,N){for(var $=-1;$<=7;$+=1)if(!(A+$<=-1||m<=A+$))for(var B=-1;B<=7;B+=1)N+B<=-1||m<=N+B||(u[A+$][N+B]=0<=$&&$<=6&&(B==0||B==6)||0<=B&&B<=6&&($==0||$==6)||2<=$&&$<=4&&2<=B&&B<=4)},K=function(){for(var A=8;A<m-8;A+=1)u[A][6]==null&&(u[A][6]=A%2==0);for(var N=8;N<m-8;N+=1)u[6][N]==null&&(u[6][N]=N%2==0)},ee=function(){for(var A=z.getPatternPosition(v),N=0;N<A.length;N+=1)for(var $=0;$<A.length;$+=1){var B=A[N],Y=A[$];if(u[B][Y]==null)for(var ce=-2;ce<=2;ce+=1)for(var o=-2;o<=2;o+=1)u[B+ce][Y+o]=ce==-2||ce==2||o==-2||o==2||ce==0&&o==0}},te=function(A){for(var N=z.getBCHTypeNumber(v),$=0;$<18;$+=1){var B=!A&&(N>>$&1)==1;u[Math.floor($/3)][$%3+m-8-3]=B}for($=0;$<18;$+=1)B=!A&&(N>>$&1)==1,u[$%3+m-8-3][Math.floor($/3)]=B},H=function(A,N){for(var $=d<<3|N,B=z.getBCHTypeInfo($),Y=0;Y<15;Y+=1){var ce=!A&&(B>>Y&1)==1;Y<6?u[Y][8]=ce:Y<8?u[Y+1][8]=ce:u[m-15+Y][8]=ce}for(Y=0;Y<15;Y+=1)ce=!A&&(B>>Y&1)==1,Y<8?u[8][m-Y-1]=ce:Y<9?u[8][15-Y-1+1]=ce:u[8][15-Y-1]=ce;u[m-8][8]=!A},ie=function(A,N){for(var $=-1,B=m-1,Y=7,ce=0,o=z.getMaskFunction(N),l=m-1;l>0;l-=2)for(l==6&&(l-=1);;){for(var p=0;p<2;p+=1)if(u[B][l-p]==null){var P=!1;ce<A.length&&(P=(A[ce]>>>Y&1)==1),o(B,l-p)&&(P=!P),u[B][l-p]=P,(Y-=1)==-1&&(ce+=1,Y=7)}if((B+=$)<0||m<=B){B-=$,$=-$;break}}},oe=function(A,N,$){for(var B=X.getRSBlocks(A,N),Y=re(),ce=0;ce<$.length;ce+=1){var o=$[ce];Y.put(o.getMode(),4),Y.put(o.getLength(),z.getLengthInBits(o.getMode(),A)),o.write(Y)}var l=0;for(ce=0;ce<B.length;ce+=1)l+=B[ce].dataCount;if(Y.getLengthInBits()>8*l)throw"code length overflow. ("+Y.getLengthInBits()+">"+8*l+")";for(Y.getLengthInBits()+4<=8*l&&Y.put(0,4);Y.getLengthInBits()%8!=0;)Y.putBit(!1);for(;!(Y.getLengthInBits()>=8*l||(Y.put(236,8),Y.getLengthInBits()>=8*l));)Y.put(17,8);return(function(p,P){for(var R=0,F=0,le=0,he=new Array(P.length),pe=new Array(P.length),ne=0;ne<P.length;ne+=1){var fe=P[ne].dataCount,me=P[ne].totalCount-fe;F=Math.max(F,fe),le=Math.max(le,me),he[ne]=new Array(fe);for(var ge=0;ge<he[ne].length;ge+=1)he[ne][ge]=255&p.getBuffer()[ge+R];R+=fe;var Se=z.getErrorCorrectPolynomial(me),_e=q(he[ne],Se.getLength()-1).mod(Se);for(pe[ne]=new Array(Se.getLength()-1),ge=0;ge<pe[ne].length;ge+=1){var Ce=ge+_e.getLength()-pe[ne].length;pe[ne][ge]=Ce>=0?_e.getAt(Ce):0}}var ze=0;for(ge=0;ge<P.length;ge+=1)ze+=P[ge].totalCount;var Ee=new Array(ze),xe=0;for(ge=0;ge<F;ge+=1)for(ne=0;ne<P.length;ne+=1)ge<he[ne].length&&(Ee[xe]=he[ne][ge],xe+=1);for(ge=0;ge<le;ge+=1)for(ne=0;ne<P.length;ne+=1)ge<pe[ne].length&&(Ee[xe]=pe[ne][ge],xe+=1);return Ee})(Y,B)};b.addData=function(A,N){var $=null;switch(N=N||"Byte"){case"Numeric":$=Q(A);break;case"Alphanumeric":$=J(A);break;case"Byte":$=Z(A);break;case"Kanji":$=U(A);break;default:throw"mode:"+N}i.push($),f=null},b.isDark=function(A,N){if(A<0||m<=A||N<0||m<=N)throw A+","+N;return u[A][N]},b.getModuleCount=function(){return m},b.make=function(){if(v<1){for(var A=1;A<40;A++){for(var N=X.getRSBlocks(A,d),$=re(),B=0;B<i.length;B++){var Y=i[B];$.put(Y.getMode(),4),$.put(Y.getLength(),z.getLengthInBits(Y.getMode(),A)),Y.write($)}var ce=0;for(B=0;B<N.length;B++)ce+=N[B].dataCount;if($.getLengthInBits()<=8*ce)break}v=A}T(!1,(function(){for(var o=0,l=0,p=0;p<8;p+=1){T(!0,p);var P=z.getLostPoint(b);(p==0||o>P)&&(o=P,l=p)}return l})())},b.createTableTag=function(A,N){A=A||2;var $="";$+='<table style="',$+=" border-width: 0px; border-style: none;",$+=" border-collapse: collapse;",$+=" padding: 0px; margin: "+(N=N===void 0?4*A:N)+"px;",$+='">',$+="<tbody>";for(var B=0;B<b.getModuleCount();B+=1){$+="<tr>";for(var Y=0;Y<b.getModuleCount();Y+=1)$+='<td style="',$+=" border-width: 0px; border-style: none;",$+=" border-collapse: collapse;",$+=" padding: 0px; margin: 0px;",$+=" width: "+A+"px;",$+=" height: "+A+"px;",$+=" background-color: ",$+=b.isDark(B,Y)?"#000000":"#ffffff",$+=";",$+='"/>';$+="</tr>"}return($+="</tbody>")+"</table>"},b.createSvgTag=function(A,N,$,B){var Y={};typeof arguments[0]=="object"&&(A=(Y=arguments[0]).cellSize,N=Y.margin,$=Y.alt,B=Y.title),A=A||2,N=N===void 0?4*A:N,($=typeof $=="string"?{text:$}:$||{}).text=$.text||null,$.id=$.text?$.id||"qrcode-description":null,(B=typeof B=="string"?{text:B}:B||{}).text=B.text||null,B.id=B.text?B.id||"qrcode-title":null;var ce,o,l,p,P=b.getModuleCount()*A+2*N,R="";for(p="l"+A+",0 0,"+A+" -"+A+",0 0,-"+A+"z ",R+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',R+=Y.scalable?"":' width="'+P+'px" height="'+P+'px"',R+=' viewBox="0 0 '+P+" "+P+'" ',R+=' preserveAspectRatio="xMinYMin meet"',R+=B.text||$.text?' role="img" aria-labelledby="'+ue([B.id,$.id].join(" ").trim())+'"':"",R+=">",R+=B.text?'<title id="'+ue(B.id)+'">'+ue(B.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<b.getModuleCount();o+=1)for(l=o*A+N,ce=0;ce<b.getModuleCount();ce+=1)b.isDark(o,ce)&&(R+="M"+(ce*A+N)+","+l+p);return(R+='" stroke="transparent" fill="black"/>')+"</svg>"},b.createDataURL=function(A,N){A=A||2,N=N===void 0?4*A:N;var $=b.getModuleCount()*A+2*N,B=N,Y=$-N;return se($,$,function(ce,o){if(B<=ce&&ce<Y&&B<=o&&o<Y){var l=Math.floor((ce-B)/A),p=Math.floor((o-B)/A);return b.isDark(p,l)?0:1}return 1})},b.createImgTag=function(A,N,$){A=A||2,N=N===void 0?4*A:N;var B=b.getModuleCount()*A+2*N,Y="";return Y+="<img",Y+=' src="',Y+=b.createDataURL(A,N),Y+='"',Y+=' width="',Y+=B,Y+='"',Y+=' height="',Y+=B,Y+='"',$&&(Y+=' alt="',Y+=ue($),Y+='"'),Y+"/>"};var ue=function(A){for(var N="",$=0;$<A.length;$+=1){var B=A.charAt($);switch(B){case"<":N+="<";break;case">":N+=">";break;case"&":N+="&";break;case'"':N+=""";break;default:N+=B}}return N};return b.createASCII=function(A,N){if((A=A||1)<2)return(function(he){he=he===void 0?2:he;var pe,ne,fe,me,ge,Se=1*b.getModuleCount()+2*he,_e=he,Ce=Se-he,ze={"██":"█","█ ":"▀"," █":"▄"," ":" "},Ee={"██":"▀","█ ":"▀"," █":" "," ":" "},xe="";for(pe=0;pe<Se;pe+=2){for(fe=Math.floor((pe-_e)/1),me=Math.floor((pe+1-_e)/1),ne=0;ne<Se;ne+=1)ge="█",_e<=ne&&ne<Ce&&_e<=pe&&pe<Ce&&b.isDark(fe,Math.floor((ne-_e)/1))&&(ge=" "),_e<=ne&&ne<Ce&&_e<=pe+1&&pe+1<Ce&&b.isDark(me,Math.floor((ne-_e)/1))?ge+=" ":ge+="█",xe+=he<1&&pe+1>=Ce?Ee[ge]:ze[ge];xe+=`
|
|
20
|
-
`}return
|
|
21
|
-
`}return F.substring(0,F.length-1)},b.renderTo2dContext=function(A,N){N=N||2;for(var $=b.getModuleCount(),B=0;B<$;B++)for(var Y=0;Y<$;Y++)A.fillStyle=b.isDark(B,Y)?"black":"white",A.fillRect(B*N,Y*N,N,N)},b};M.stringToBytes=(M.stringToBytesFuncs={default:function(k){for(var C=[],v=0;v<k.length;v+=1){var d=k.charCodeAt(v);C.push(255&d)}return C}}).default,M.createStringToBytes=function(k,C){var v=(function(){for(var u=ae(k),m=function(){var K=u.read();if(K==-1)throw"eof";return K},f=0,i={};;){var b=u.read();if(b==-1)break;var T=m(),j=m()<<8|m();i[String.fromCharCode(b<<8|T)]=j,f+=1}if(f!=C)throw f+" != "+C;return i})(),d=63;return function(u){for(var m=[],f=0;f<u.length;f+=1){var i=u.charCodeAt(f);if(i<128)m.push(i);else{var b=v[u.charAt(f)];typeof b=="number"?(255&b)==b?m.push(b):(m.push(b>>>8),m.push(255&b)):m.push(d)}}return m}};var x,S,D,O,L,I={L:1,M:0,Q:3,H:2},z=(x=[[],[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,D=7973,L=function(k){for(var C=0;k!=0;)C+=1,k>>>=1;return C},(O={}).getBCHTypeInfo=function(k){for(var C=k<<10;L(C)-L(S)>=0;)C^=S<<L(C)-L(S);return 21522^(k<<10|C)},O.getBCHTypeNumber=function(k){for(var C=k<<12;L(C)-L(D)>=0;)C^=D<<L(C)-L(D);return k<<12|C},O.getPatternPosition=function(k){return x[k-1]},O.getMaskFunction=function(k){switch(k){case 0:return function(C,v){return(C+v)%2==0};case 1:return function(C,v){return C%2==0};case 2:return function(C,v){return v%3==0};case 3:return function(C,v){return(C+v)%3==0};case 4:return function(C,v){return(Math.floor(C/2)+Math.floor(v/3))%2==0};case 5:return function(C,v){return C*v%2+C*v%3==0};case 6:return function(C,v){return(C*v%2+C*v%3)%2==0};case 7:return function(C,v){return(C*v%3+(C+v)%2)%2==0};default:throw"bad maskPattern:"+k}},O.getErrorCorrectPolynomial=function(k){for(var C=q([1],0),v=0;v<k;v+=1)C=C.multiply(q([1,V.gexp(v)],0));return C},O.getLengthInBits=function(k,C){if(1<=C&&C<10)switch(k){case 1:return 10;case 2:return 9;case 4:case 8:return 8;default:throw"mode:"+k}else if(C<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(!(C<41))throw"type:"+C;switch(k){case 1:return 14;case 2:return 13;case 4:return 16;case 8:return 12;default:throw"mode:"+k}}},O.getLostPoint=function(k){for(var C=k.getModuleCount(),v=0,d=0;d<C;d+=1)for(var u=0;u<C;u+=1){for(var m=0,f=k.isDark(d,u),i=-1;i<=1;i+=1)if(!(d+i<0||C<=d+i))for(var b=-1;b<=1;b+=1)u+b<0||C<=u+b||i==0&&b==0||f==k.isDark(d+i,u+b)&&(m+=1);m>5&&(v+=3+m-5)}for(d=0;d<C-1;d+=1)for(u=0;u<C-1;u+=1){var T=0;k.isDark(d,u)&&(T+=1),k.isDark(d+1,u)&&(T+=1),k.isDark(d,u+1)&&(T+=1),k.isDark(d+1,u+1)&&(T+=1),T!=0&&T!=4||(v+=3)}for(d=0;d<C;d+=1)for(u=0;u<C-6;u+=1)k.isDark(d,u)&&!k.isDark(d,u+1)&&k.isDark(d,u+2)&&k.isDark(d,u+3)&&k.isDark(d,u+4)&&!k.isDark(d,u+5)&&k.isDark(d,u+6)&&(v+=40);for(u=0;u<C;u+=1)for(d=0;d<C-6;d+=1)k.isDark(d,u)&&!k.isDark(d+1,u)&&k.isDark(d+2,u)&&k.isDark(d+3,u)&&k.isDark(d+4,u)&&!k.isDark(d+5,u)&&k.isDark(d+6,u)&&(v+=40);var j=0;for(u=0;u<C;u+=1)for(d=0;d<C;d+=1)k.isDark(d,u)&&(j+=1);return v+Math.abs(100*j/C/C-50)/5*10},O),V=(function(){for(var k=new Array(256),C=new Array(256),v=0;v<8;v+=1)k[v]=1<<v;for(v=8;v<256;v+=1)k[v]=k[v-4]^k[v-5]^k[v-6]^k[v-8];for(v=0;v<255;v+=1)C[k[v]]=v;return{glog:function(d){if(d<1)throw"glog("+d+")";return C[d]},gexp:function(d){for(;d<0;)d+=255;for(;d>=256;)d-=255;return k[d]}}})();function q(k,C){if(k.length===void 0)throw k.length+"/"+C;var v=(function(){for(var u=0;u<k.length&&k[u]==0;)u+=1;for(var m=new Array(k.length-u+C),f=0;f<k.length-u;f+=1)m[f]=k[f+u];return m})(),d={getAt:function(u){return v[u]},getLength:function(){return v.length},multiply:function(u){for(var m=new Array(d.getLength()+u.getLength()-1),f=0;f<d.getLength();f+=1)for(var i=0;i<u.getLength();i+=1)m[f+i]^=V.gexp(V.glog(d.getAt(f))+V.glog(u.getAt(i)));return q(m,0)},mod:function(u){if(d.getLength()-u.getLength()<0)return d;for(var m=V.glog(d.getAt(0))-V.glog(u.getAt(0)),f=new Array(d.getLength()),i=0;i<d.getLength();i+=1)f[i]=d.getAt(i);for(i=0;i<u.getLength();i+=1)f[i]^=V.gexp(V.glog(u.getAt(i))+m);return q(f,0).mod(u)}};return d}var X=(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]],C=function(d,u){var m={};return m.totalCount=d,m.dataCount=u,m},v={getRSBlocks:function(d,u){var m=(function(te,H){switch(H){case I.L:return k[4*(te-1)+0];case I.M:return k[4*(te-1)+1];case I.Q:return k[4*(te-1)+2];case I.H:return k[4*(te-1)+3];default:return}})(d,u);if(m===void 0)throw"bad rs block @ typeNumber:"+d+"/errorCorrectionLevel:"+u;for(var f=m.length/3,i=[],b=0;b<f;b+=1)for(var T=m[3*b+0],j=m[3*b+1],K=m[3*b+2],ee=0;ee<T;ee+=1)i.push(C(j,K));return i}};return v})(),re=function(){var k=[],C=0,v={getBuffer:function(){return k},getAt:function(d){var u=Math.floor(d/8);return(k[u]>>>7-d%8&1)==1},put:function(d,u){for(var m=0;m<u;m+=1)v.putBit((d>>>u-m-1&1)==1)},getLengthInBits:function(){return C},putBit:function(d){var u=Math.floor(C/8);k.length<=u&&k.push(0),d&&(k[u]|=128>>>C%8),C+=1}};return v},Q=function(k){var C=k,v={getMode:function(){return 1},getLength:function(m){return C.length},write:function(m){for(var f=C,i=0;i+2<f.length;)m.put(d(f.substring(i,i+3)),10),i+=3;i<f.length&&(f.length-i==1?m.put(d(f.substring(i,i+1)),4):f.length-i==2&&m.put(d(f.substring(i,i+2)),7))}},d=function(m){for(var f=0,i=0;i<m.length;i+=1)f=10*f+u(m.charAt(i));return f},u=function(m){if("0"<=m&&m<="9")return m.charCodeAt(0)-48;throw"illegal char :"+m};return v},J=function(k){var C=k,v={getMode:function(){return 2},getLength:function(u){return C.length},write:function(u){for(var m=C,f=0;f+1<m.length;)u.put(45*d(m.charAt(f))+d(m.charAt(f+1)),11),f+=2;f<m.length&&u.put(d(m.charAt(f)),6)}},d=function(u){if("0"<=u&&u<="9")return u.charCodeAt(0)-48;if("A"<=u&&u<="Z")return u.charCodeAt(0)-65+10;switch(u){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 :"+u}};return v},Z=function(k){var C=M.stringToBytes(k);return{getMode:function(){return 4},getLength:function(v){return C.length},write:function(v){for(var d=0;d<C.length;d+=1)v.put(C[d],8)}}},U=function(k){var C=M.stringToBytesFuncs.SJIS;if(!C)throw"sjis not supported.";(function(){var u=C("友");if(u.length!=2||(u[0]<<8|u[1])!=38726)throw"sjis not supported."})();var v=C(k),d={getMode:function(){return 8},getLength:function(u){return~~(v.length/2)},write:function(u){for(var m=v,f=0;f+1<m.length;){var i=(255&m[f])<<8|255&m[f+1];if(33088<=i&&i<=40956)i-=33088;else{if(!(57408<=i&&i<=60351))throw"illegal char at "+(f+1)+"/"+i;i-=49472}i=192*(i>>>8&255)+(255&i),u.put(i,13),f+=2}if(f<m.length)throw"illegal char at "+(f+1)}};return d},W=function(){var k=[],C={writeByte:function(v){k.push(255&v)},writeShort:function(v){C.writeByte(v),C.writeByte(v>>>8)},writeBytes:function(v,d,u){d=d||0,u=u||v.length;for(var m=0;m<u;m+=1)C.writeByte(v[m+d])},writeString:function(v){for(var d=0;d<v.length;d+=1)C.writeByte(v.charCodeAt(d))},toByteArray:function(){return k},toString:function(){var v="";v+="[";for(var d=0;d<k.length;d+=1)d>0&&(v+=","),v+=k[d];return v+"]"}};return C},ae=function(k){var C=k,v=0,d=0,u=0,m={read:function(){for(;u<8;){if(v>=C.length){if(u==0)return-1;throw"unexpected end of file./"+u}var i=C.charAt(v);if(v+=1,i=="=")return u=0,-1;i.match(/^\s$/)||(d=d<<6|f(i.charCodeAt(0)),u+=6)}var b=d>>>u-8&255;return u-=8,b}},f=function(i){if(65<=i&&i<=90)return i-65;if(97<=i&&i<=122)return i-97+26;if(48<=i&&i<=57)return i-48+52;if(i==43)return 62;if(i==47)return 63;throw"c:"+i};return m},se=function(k,C,v){for(var d=(function(j,K){var ee=j,te=K,H=new Array(j*K),ie={setPixel:function(A,N,$){H[N*ee+A]=$},write:function(A){A.writeString("GIF87a"),A.writeShort(ee),A.writeShort(te),A.writeByte(128),A.writeByte(0),A.writeByte(0),A.writeByte(0),A.writeByte(0),A.writeByte(0),A.writeByte(255),A.writeByte(255),A.writeByte(255),A.writeString(","),A.writeShort(0),A.writeShort(0),A.writeShort(ee),A.writeShort(te),A.writeByte(0);var N=oe(2);A.writeByte(2);for(var $=0;N.length-$>255;)A.writeByte(255),A.writeBytes(N,$,255),$+=255;A.writeByte(N.length-$),A.writeBytes(N,$,N.length-$),A.writeByte(0),A.writeString(";")}},oe=function(A){for(var N=1<<A,$=1+(1<<A),B=A+1,Y=ue(),ce=0;ce<N;ce+=1)Y.add(String.fromCharCode(ce));Y.add(String.fromCharCode(N)),Y.add(String.fromCharCode($));var o,l,p,P=W(),R=(o=P,l=0,p=0,{write:function(pe,ne){if(pe>>>ne)throw"length over";for(;l+ne>=8;)o.writeByte(255&(pe<<l|p)),ne-=8-l,pe>>>=8-l,p=0,l=0;p|=pe<<l,l+=ne},flush:function(){l>0&&o.writeByte(p)}});R.write(N,B);var F=0,le=String.fromCharCode(H[F]);for(F+=1;F<H.length;){var he=String.fromCharCode(H[F]);F+=1,Y.contains(le+he)?le+=he:(R.write(Y.indexOf(le),B),Y.size()<4095&&(Y.size()==1<<B&&(B+=1),Y.add(le+he)),le=he)}return R.write(Y.indexOf(le),B),R.write($,B),R.flush(),P.toByteArray()},ue=function(){var A={},N=0,$={add:function(B){if($.contains(B))throw"dup key:"+B;A[B]=N,N+=1},size:function(){return N},indexOf:function(B){return A[B]},contains:function(B){return A[B]!==void 0}};return $};return ie})(k,C),u=0;u<C;u+=1)for(var m=0;m<k;m+=1)d.setPixel(m,u,v(m,u));var f=W();d.write(f);for(var i=(function(){var j=0,K=0,ee=0,te="",H={},ie=function(ue){te+=String.fromCharCode(oe(63&ue))},oe=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(j=j<<8|255&ue,K+=8,ee+=1;K>=6;)ie(j>>>K-6),K-=6},H.flush=function(){if(K>0&&(ie(j<<6-K),j=0,K=0),ee%3!=0)for(var ue=3-ee%3,A=0;A<ue;A+=1)te+="="},H.toString=function(){return te},H})(),b=f.toByteArray(),T=0;T<b.length;T+=1)i.writeByte(b[T]);return i.flush(),"data:image/gif;base64,"+i};return M})();_.stringToBytesFuncs["UTF-8"]=function(M){return(function(x){for(var S=[],D=0;D<x.length;D++){var O=x.charCodeAt(D);O<128?S.push(O):O<2048?S.push(192|O>>6,128|63&O):O<55296||O>=57344?S.push(224|O>>12,128|O>>6&63,128|63&O):(D++,O=65536+((1023&O)<<10|1023&x.charCodeAt(D)),S.push(240|O>>18,128|O>>12&63,128|O>>6&63,128|63&O))}return S})(M)},(y=typeof(g=function(){return _})=="function"?g.apply(a,[]):g)===void 0||(h.exports=y)}},n={};function s(h){var a=n[h];if(a!==void 0)return a.exports;var g=n[h]={exports:{}};return r[h](g,g.exports,s),g.exports}s.n=h=>{var a=h&&h.__esModule?()=>h.default:()=>h;return s.d(a,{a}),a},s.d=(h,a)=>{for(var g in a)s.o(a,g)&&!s.o(h,g)&&Object.defineProperty(h,g,{enumerable:!0,get:a[g]})},s.o=(h,a)=>Object.prototype.hasOwnProperty.call(h,a);var c={};return(()=>{s.d(c,{default:()=>C});const h=v=>!!v&&typeof v=="object"&&!Array.isArray(v);function a(v,...d){if(!d.length)return v;const u=d.shift();return u!==void 0&&h(v)&&h(u)?(v=Object.assign({},v),Object.keys(u).forEach(m=>{const f=v[m],i=u[m];Array.isArray(f)&&Array.isArray(i)?v[m]=i:h(f)&&h(i)?v[m]=a(Object.assign({},f),i):v[m]=i}),a(v,...d)):v}function g(v,d){const u=document.createElement("a");u.download=d,u.href=v,document.body.appendChild(u),u.click(),document.body.removeChild(u)}const y={L:.07,M:.15,Q:.25,H:.3};class _{constructor({svg:d,type:u,window:m}){this._svg=d,this._type=u,this._window=m}draw(d,u,m,f){let i;switch(this._type){case"dots":i=this._drawDot;break;case"classy":i=this._drawClassy;break;case"classy-rounded":i=this._drawClassyRounded;break;case"rounded":i=this._drawRounded;break;case"extra-rounded":i=this._drawExtraRounded;break;default:i=this._drawSquare}i.call(this,{x:d,y:u,size:m,getNeighbor:f})}_rotateFigure({x:d,y:u,size:m,rotation:f=0,draw:i}){var b;const T=d+m/2,j=u+m/2;i(),(b=this._element)===null||b===void 0||b.setAttribute("transform",`rotate(${180*f/Math.PI},${T},${j})`)}_basicDot(d){const{size:u,x:m,y:f}=d;this._rotateFigure(Object.assign(Object.assign({},d),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(m+u/2)),this._element.setAttribute("cy",String(f+u/2)),this._element.setAttribute("r",String(u/2))}}))}_basicSquare(d){const{size:u,x:m,y:f}=d;this._rotateFigure(Object.assign(Object.assign({},d),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(m)),this._element.setAttribute("y",String(f)),this._element.setAttribute("width",String(u)),this._element.setAttribute("height",String(u))}}))}_basicSideRounded(d){const{size:u,x:m,y:f}=d;this._rotateFigure(Object.assign(Object.assign({},d),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${m} ${f}v ${u}h `+u/2+`a ${u/2} ${u/2}, 0, 0, 0, 0 ${-u}`)}}))}_basicCornerRounded(d){const{size:u,x:m,y:f}=d;this._rotateFigure(Object.assign(Object.assign({},d),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${m} ${f}v ${u}h ${u}v `+-u/2+`a ${u/2} ${u/2}, 0, 0, 0, ${-u/2} ${-u/2}`)}}))}_basicCornerExtraRounded(d){const{size:u,x:m,y:f}=d;this._rotateFigure(Object.assign(Object.assign({},d),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${m} ${f}v ${u}h ${u}a ${u} ${u}, 0, 0, 0, ${-u} ${-u}`)}}))}_basicCornersRounded(d){const{size:u,x:m,y:f}=d;this._rotateFigure(Object.assign(Object.assign({},d),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${m} ${f}v `+u/2+`a ${u/2} ${u/2}, 0, 0, 0, ${u/2} ${u/2}h `+u/2+"v "+-u/2+`a ${u/2} ${u/2}, 0, 0, 0, ${-u/2} ${-u/2}`)}}))}_drawDot({x:d,y:u,size:m}){this._basicDot({x:d,y:u,size:m,rotation:0})}_drawSquare({x:d,y:u,size:m}){this._basicSquare({x:d,y:u,size:m,rotation:0})}_drawRounded({x:d,y:u,size:m,getNeighbor:f}){const i=f?+f(-1,0):0,b=f?+f(1,0):0,T=f?+f(0,-1):0,j=f?+f(0,1):0,K=i+b+T+j;if(K!==0)if(K>2||i&&b||T&&j)this._basicSquare({x:d,y:u,size:m,rotation:0});else{if(K===2){let ee=0;return i&&T?ee=Math.PI/2:T&&b?ee=Math.PI:b&&j&&(ee=-Math.PI/2),void this._basicCornerRounded({x:d,y:u,size:m,rotation:ee})}if(K===1){let ee=0;return T?ee=Math.PI/2:b?ee=Math.PI:j&&(ee=-Math.PI/2),void this._basicSideRounded({x:d,y:u,size:m,rotation:ee})}}else this._basicDot({x:d,y:u,size:m,rotation:0})}_drawExtraRounded({x:d,y:u,size:m,getNeighbor:f}){const i=f?+f(-1,0):0,b=f?+f(1,0):0,T=f?+f(0,-1):0,j=f?+f(0,1):0,K=i+b+T+j;if(K!==0)if(K>2||i&&b||T&&j)this._basicSquare({x:d,y:u,size:m,rotation:0});else{if(K===2){let ee=0;return i&&T?ee=Math.PI/2:T&&b?ee=Math.PI:b&&j&&(ee=-Math.PI/2),void this._basicCornerExtraRounded({x:d,y:u,size:m,rotation:ee})}if(K===1){let ee=0;return T?ee=Math.PI/2:b?ee=Math.PI:j&&(ee=-Math.PI/2),void this._basicSideRounded({x:d,y:u,size:m,rotation:ee})}}else this._basicDot({x:d,y:u,size:m,rotation:0})}_drawClassy({x:d,y:u,size:m,getNeighbor:f}){const i=f?+f(-1,0):0,b=f?+f(1,0):0,T=f?+f(0,-1):0,j=f?+f(0,1):0;i+b+T+j!==0?i||T?b||j?this._basicSquare({x:d,y:u,size:m,rotation:0}):this._basicCornerRounded({x:d,y:u,size:m,rotation:Math.PI/2}):this._basicCornerRounded({x:d,y:u,size:m,rotation:-Math.PI/2}):this._basicCornersRounded({x:d,y:u,size:m,rotation:Math.PI/2})}_drawClassyRounded({x:d,y:u,size:m,getNeighbor:f}){const i=f?+f(-1,0):0,b=f?+f(1,0):0,T=f?+f(0,-1):0,j=f?+f(0,1):0;i+b+T+j!==0?i||T?b||j?this._basicSquare({x:d,y:u,size:m,rotation:0}):this._basicCornerExtraRounded({x:d,y:u,size:m,rotation:Math.PI/2}):this._basicCornerExtraRounded({x:d,y:u,size:m,rotation:-Math.PI/2}):this._basicCornersRounded({x:d,y:u,size:m,rotation:Math.PI/2})}}const M={dot:"dot",square:"square",extraRounded:"extra-rounded"},x=Object.values(M);class S{constructor({svg:d,type:u,window:m}){this._svg=d,this._type=u,this._window=m}draw(d,u,m,f){let i;switch(this._type){case M.square:i=this._drawSquare;break;case M.extraRounded:i=this._drawExtraRounded;break;default:i=this._drawDot}i.call(this,{x:d,y:u,size:m,rotation:f})}_rotateFigure({x:d,y:u,size:m,rotation:f=0,draw:i}){var b;const T=d+m/2,j=u+m/2;i(),(b=this._element)===null||b===void 0||b.setAttribute("transform",`rotate(${180*f/Math.PI},${T},${j})`)}_basicDot(d){const{size:u,x:m,y:f}=d,i=u/7;this._rotateFigure(Object.assign(Object.assign({},d),{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 ${m+u/2} ${f}a ${u/2} ${u/2} 0 1 0 0.1 0zm 0 ${i}a ${u/2-i} ${u/2-i} 0 1 1 -0.1 0Z`)}}))}_basicSquare(d){const{size:u,x:m,y:f}=d,i=u/7;this._rotateFigure(Object.assign(Object.assign({},d),{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 ${m} ${f}v ${u}h ${u}v `+-u+`zM ${m+i} ${f+i}h `+(u-2*i)+"v "+(u-2*i)+"h "+(2*i-u)+"z")}}))}_basicExtraRounded(d){const{size:u,x:m,y:f}=d,i=u/7;this._rotateFigure(Object.assign(Object.assign({},d),{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 ${m} ${f+2.5*i}v `+2*i+`a ${2.5*i} ${2.5*i}, 0, 0, 0, ${2.5*i} ${2.5*i}h `+2*i+`a ${2.5*i} ${2.5*i}, 0, 0, 0, ${2.5*i} ${2.5*-i}v `+-2*i+`a ${2.5*i} ${2.5*i}, 0, 0, 0, ${2.5*-i} ${2.5*-i}h `+-2*i+`a ${2.5*i} ${2.5*i}, 0, 0, 0, ${2.5*-i} ${2.5*i}M ${m+2.5*i} ${f+i}h `+2*i+`a ${1.5*i} ${1.5*i}, 0, 0, 1, ${1.5*i} ${1.5*i}v `+2*i+`a ${1.5*i} ${1.5*i}, 0, 0, 1, ${1.5*-i} ${1.5*i}h `+-2*i+`a ${1.5*i} ${1.5*i}, 0, 0, 1, ${1.5*-i} ${1.5*-i}v `+-2*i+`a ${1.5*i} ${1.5*i}, 0, 0, 1, ${1.5*i} ${1.5*-i}`)}}))}_drawDot({x:d,y:u,size:m,rotation:f}){this._basicDot({x:d,y:u,size:m,rotation:f})}_drawSquare({x:d,y:u,size:m,rotation:f}){this._basicSquare({x:d,y:u,size:m,rotation:f})}_drawExtraRounded({x:d,y:u,size:m,rotation:f}){this._basicExtraRounded({x:d,y:u,size:m,rotation:f})}}const D={dot:"dot",square:"square"},O=Object.values(D);class L{constructor({svg:d,type:u,window:m}){this._svg=d,this._type=u,this._window=m}draw(d,u,m,f){let i;i=this._type===D.square?this._drawSquare:this._drawDot,i.call(this,{x:d,y:u,size:m,rotation:f})}_rotateFigure({x:d,y:u,size:m,rotation:f=0,draw:i}){var b;const T=d+m/2,j=u+m/2;i(),(b=this._element)===null||b===void 0||b.setAttribute("transform",`rotate(${180*f/Math.PI},${T},${j})`)}_basicDot(d){const{size:u,x:m,y:f}=d;this._rotateFigure(Object.assign(Object.assign({},d),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(m+u/2)),this._element.setAttribute("cy",String(f+u/2)),this._element.setAttribute("r",String(u/2))}}))}_basicSquare(d){const{size:u,x:m,y:f}=d;this._rotateFigure(Object.assign(Object.assign({},d),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(m)),this._element.setAttribute("y",String(f)),this._element.setAttribute("width",String(u)),this._element.setAttribute("height",String(u))}}))}_drawDot({x:d,y:u,size:m,rotation:f}){this._basicDot({x:d,y:u,size:m,rotation:f})}_drawSquare({x:d,y:u,size:m,rotation:f}){this._basicSquare({x:d,y:u,size:m,rotation:f})}}const I="circle",z=[[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]],V=[[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(d,u){this._roundSize=m=>this._options.dotsOptions.roundSize?Math.floor(m):m,this._window=u,this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("width",String(d.width)),this._element.setAttribute("height",String(d.height)),this._element.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),d.dotsOptions.roundSize||this._element.setAttribute("shape-rendering","crispEdges"),this._element.setAttribute("viewBox",`0 0 ${d.width} ${d.height}`),this._defs=this._window.document.createElementNS("http://www.w3.org/2000/svg","defs"),this._element.appendChild(this._defs),this._imageUri=d.image,this._instanceId=q.instanceCount++,this._options=d}get width(){return this._options.width}get height(){return this._options.height}getElement(){return this._element}async drawQR(d){const u=d.getModuleCount(),m=Math.min(this._options.width,this._options.height)-2*this._options.margin,f=this._options.shape===I?m/Math.sqrt(2):m,i=this._roundSize(f/u);let b={hideXDots:0,hideYDots:0,width:0,height:0};if(this._qr=d,this._options.image){if(await this.loadImage(),!this._image)return;const{imageOptions:T,qrOptions:j}=this._options,K=T.imageSize*y[j.errorCorrectionLevel],ee=Math.floor(K*u*u);b=(function({originalHeight:te,originalWidth:H,maxHiddenDots:ie,maxHiddenAxisDots:oe,dotSize:ue}){const A={x:0,y:0},N={x:0,y:0};if(te<=0||H<=0||ie<=0||ue<=0)return{height:0,width:0,hideYDots:0,hideXDots:0};const $=te/H;return A.x=Math.floor(Math.sqrt(ie/$)),A.x<=0&&(A.x=1),oe&&oe<A.x&&(A.x=oe),A.x%2==0&&A.x--,N.x=A.x*ue,A.y=1+2*Math.ceil((A.x*$-1)/2),N.y=Math.round(N.x*$),(A.y*A.x>ie||oe&&oe<A.y)&&(oe&&oe<A.y?(A.y=oe,A.y%2==0&&A.x--):A.y-=2,N.y=A.y*ue,A.x=1+2*Math.ceil((A.y/$-1)/2),N.x=Math.round(N.y/$)),{height:N.y,width:N.x,hideYDots:A.y,hideXDots:A.x}})({originalWidth:this._image.width,originalHeight:this._image.height,maxHiddenDots:ee,maxHiddenAxisDots:u-14,dotSize:i})}this.drawBackground(),this.drawDots((T,j)=>{var K,ee,te,H,ie,oe;return!(this._options.imageOptions.hideBackgroundDots&&T>=(u-b.hideYDots)/2&&T<(u+b.hideYDots)/2&&j>=(u-b.hideXDots)/2&&j<(u+b.hideXDots)/2||!((K=z[T])===null||K===void 0)&&K[j]||!((ee=z[T-u+7])===null||ee===void 0)&&ee[j]||!((te=z[T])===null||te===void 0)&&te[j-u+7]||!((H=V[T])===null||H===void 0)&&H[j]||!((ie=V[T-u+7])===null||ie===void 0)&&ie[j]||!((oe=V[T])===null||oe===void 0)&&oe[j-u+7])}),this.drawCorners(),this._options.image&&await this.drawImage({width:b.width,height:b.height,count:u,dotSize:i})}drawBackground(){var d,u,m;const f=this._element,i=this._options;if(f){const b=(d=i.backgroundOptions)===null||d===void 0?void 0:d.gradient,T=(u=i.backgroundOptions)===null||u===void 0?void 0:u.color;let j=i.height,K=i.width;if(b||T){const ee=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),!((m=i.backgroundOptions)===null||m===void 0)&&m.round&&(j=K=Math.min(i.width,i.height),ee.setAttribute("rx",String(j/2*i.backgroundOptions.round))),ee.setAttribute("x",String(this._roundSize((i.width-K)/2))),ee.setAttribute("y",String(this._roundSize((i.height-j)/2))),ee.setAttribute("width",String(K)),ee.setAttribute("height",String(j)),this._backgroundClipPath.appendChild(ee),this._createColor({options:b,color:T,additionalRotation:0,x:0,y:0,height:i.height,width:i.width,name:`background-color-${this._instanceId}`})}}}drawDots(d){var u,m;if(!this._qr)throw"QR code is not defined";const f=this._options,i=this._qr.getModuleCount();if(i>f.width||i>f.height)throw"The canvas is too small.";const b=Math.min(f.width,f.height)-2*f.margin,T=f.shape===I?b/Math.sqrt(2):b,j=this._roundSize(T/i),K=this._roundSize((f.width-i*j)/2),ee=this._roundSize((f.height-i*j)/2),te=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:(u=f.dotsOptions)===null||u===void 0?void 0:u.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<i;H++)for(let ie=0;ie<i;ie++)d&&!d(H,ie)||!((m=this._qr)===null||m===void 0)&&m.isDark(H,ie)&&(te.draw(K+ie*j,ee+H*j,j,(oe,ue)=>!(ie+oe<0||H+ue<0||ie+oe>=i||H+ue>=i)&&!(d&&!d(H+ue,ie+oe))&&!!this._qr&&this._qr.isDark(H+ue,ie+oe)),te._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(te._element));if(f.shape===I){const H=this._roundSize((b/j-i)/2),ie=i+2*H,oe=K-H*j,ue=ee-H*j,A=[],N=this._roundSize(ie/2);for(let $=0;$<ie;$++){A[$]=[];for(let B=0;B<ie;B++)$>=H-1&&$<=ie-H&&B>=H-1&&B<=ie-H||Math.sqrt(($-N)*($-N)+(B-N)*(B-N))>N?A[$][B]=0:A[$][B]=this._qr.isDark(B-2*H<0?B:B>=i?B-2*H:B-H,$-2*H<0?$:$>=i?$-2*H:$-H)?1:0}for(let $=0;$<ie;$++)for(let B=0;B<ie;B++)A[$][B]&&(te.draw(oe+B*j,ue+$*j,j,(Y,ce)=>{var o;return!!(!((o=A[$+ce])===null||o===void 0)&&o[B+Y])}),te._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(te._element))}}drawCorners(){if(!this._qr)throw"QR code is not defined";const d=this._element,u=this._options;if(!d)throw"Element code is not defined";const m=this._qr.getModuleCount(),f=Math.min(u.width,u.height)-2*u.margin,i=u.shape===I?f/Math.sqrt(2):f,b=this._roundSize(i/m),T=7*b,j=3*b,K=this._roundSize((u.width-m*b)/2),ee=this._roundSize((u.height-m*b)/2);[[0,0,0],[1,0,Math.PI/2],[0,1,-Math.PI/2]].forEach(([te,H,ie])=>{var oe,ue,A,N,$,B,Y,ce,o,l,p,P,R,F;const le=K+te*b*(m-7),he=ee+H*b*(m-7);let pe=this._dotsClipPath,ne=this._dotsClipPath;if((!((oe=u.cornersSquareOptions)===null||oe===void 0)&&oe.gradient||!((ue=u.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-${te}-${H}-${this._instanceId}`),this._defs.appendChild(pe),this._cornersSquareClipPath=this._cornersDotClipPath=ne=pe,this._createColor({options:(A=u.cornersSquareOptions)===null||A===void 0?void 0:A.gradient,color:(N=u.cornersSquareOptions)===null||N===void 0?void 0:N.color,additionalRotation:ie,x:le,y:he,height:T,width:T,name:`corners-square-color-${te}-${H}-${this._instanceId}`})),(($=u.cornersSquareOptions)===null||$===void 0?void 0:$.type)&&x.includes(u.cornersSquareOptions.type)){const fe=new S({svg:this._element,type:u.cornersSquareOptions.type,window:this._window});fe.draw(le,he,T,ie),fe._element&&pe&&pe.appendChild(fe._element)}else{const fe=new _({svg:this._element,type:((B=u.cornersSquareOptions)===null||B===void 0?void 0:B.type)||u.dotsOptions.type,window:this._window});for(let me=0;me<z.length;me++)for(let ge=0;ge<z[me].length;ge++)!((Y=z[me])===null||Y===void 0)&&Y[ge]&&(fe.draw(le+ge*b,he+me*b,b,(Se,_e)=>{var Ce;return!!(!((Ce=z[me+_e])===null||Ce===void 0)&&Ce[ge+Se])}),fe._element&&pe&&pe.appendChild(fe._element))}if((!((ce=u.cornersDotOptions)===null||ce===void 0)&&ce.gradient||!((o=u.cornersDotOptions)===null||o===void 0)&&o.color)&&(ne=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),ne.setAttribute("id",`clip-path-corners-dot-color-${te}-${H}-${this._instanceId}`),this._defs.appendChild(ne),this._cornersDotClipPath=ne,this._createColor({options:(l=u.cornersDotOptions)===null||l===void 0?void 0:l.gradient,color:(p=u.cornersDotOptions)===null||p===void 0?void 0:p.color,additionalRotation:ie,x:le+2*b,y:he+2*b,height:j,width:j,name:`corners-dot-color-${te}-${H}-${this._instanceId}`})),((P=u.cornersDotOptions)===null||P===void 0?void 0:P.type)&&O.includes(u.cornersDotOptions.type)){const fe=new L({svg:this._element,type:u.cornersDotOptions.type,window:this._window});fe.draw(le+2*b,he+2*b,j,ie),fe._element&&ne&&ne.appendChild(fe._element)}else{const fe=new _({svg:this._element,type:((R=u.cornersDotOptions)===null||R===void 0?void 0:R.type)||u.dotsOptions.type,window:this._window});for(let me=0;me<V.length;me++)for(let ge=0;ge<V[me].length;ge++)!((F=V[me])===null||F===void 0)&&F[ge]&&(fe.draw(le+ge*b,he+me*b,b,(Se,_e)=>{var Ce;return!!(!((Ce=V[me+_e])===null||Ce===void 0)&&Ce[ge+Se])}),fe._element&&ne&&ne.appendChild(fe._element))}})}loadImage(){return new Promise((d,u)=>{var m;const f=this._options;if(!f.image)return u("Image is not defined");if(!((m=f.nodeCanvas)===null||m===void 0)&&m.loadImage)f.nodeCanvas.loadImage(f.image).then(i=>{var b,T;if(this._image=i,this._options.imageOptions.saveAsBlob){const j=(b=f.nodeCanvas)===null||b===void 0?void 0:b.createCanvas(this._image.width,this._image.height);(T=j?.getContext("2d"))===null||T===void 0||T.drawImage(i,0,0),this._imageUri=j?.toDataURL()}d()}).catch(u);else{const i=new this._window.Image;typeof f.imageOptions.crossOrigin=="string"&&(i.crossOrigin=f.imageOptions.crossOrigin),this._image=i,i.onload=async()=>{this._options.imageOptions.saveAsBlob&&(this._imageUri=await(async function(b,T){return new Promise(j=>{const K=new T.XMLHttpRequest;K.onload=function(){const ee=new T.FileReader;ee.onloadend=function(){j(ee.result)},ee.readAsDataURL(K.response)},K.open("GET",b),K.responseType="blob",K.send()})})(f.image||"",this._window)),d()},i.src=f.image}})}async drawImage({width:d,height:u,count:m,dotSize:f}){const i=this._options,b=this._roundSize((i.width-m*f)/2),T=this._roundSize((i.height-m*f)/2),j=b+this._roundSize(i.imageOptions.margin+(m*f-d)/2),K=T+this._roundSize(i.imageOptions.margin+(m*f-u)/2),ee=d-2*i.imageOptions.margin,te=u-2*i.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(j)),H.setAttribute("y",String(K)),H.setAttribute("width",`${ee}px`),H.setAttribute("height",`${te}px`),this._element.appendChild(H)}_createColor({options:d,color:u,additionalRotation:m,x:f,y:i,height:b,width:T,name:j}){const K=T>b?T:b,ee=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");if(ee.setAttribute("x",String(f)),ee.setAttribute("y",String(i)),ee.setAttribute("height",String(b)),ee.setAttribute("width",String(T)),ee.setAttribute("clip-path",`url('#clip-path-${j}')`),d){let te;if(d.type==="radial")te=this._window.document.createElementNS("http://www.w3.org/2000/svg","radialGradient"),te.setAttribute("id",j),te.setAttribute("gradientUnits","userSpaceOnUse"),te.setAttribute("fx",String(f+T/2)),te.setAttribute("fy",String(i+b/2)),te.setAttribute("cx",String(f+T/2)),te.setAttribute("cy",String(i+b/2)),te.setAttribute("r",String(K/2));else{const H=((d.rotation||0)+m)%(2*Math.PI),ie=(H+2*Math.PI)%(2*Math.PI);let oe=f+T/2,ue=i+b/2,A=f+T/2,N=i+b/2;ie>=0&&ie<=.25*Math.PI||ie>1.75*Math.PI&&ie<=2*Math.PI?(oe-=T/2,ue-=b/2*Math.tan(H),A+=T/2,N+=b/2*Math.tan(H)):ie>.25*Math.PI&&ie<=.75*Math.PI?(ue-=b/2,oe-=T/2/Math.tan(H),N+=b/2,A+=T/2/Math.tan(H)):ie>.75*Math.PI&&ie<=1.25*Math.PI?(oe+=T/2,ue+=b/2*Math.tan(H),A-=T/2,N-=b/2*Math.tan(H)):ie>1.25*Math.PI&&ie<=1.75*Math.PI&&(ue+=b/2,oe+=T/2/Math.tan(H),N-=b/2,A-=T/2/Math.tan(H)),te=this._window.document.createElementNS("http://www.w3.org/2000/svg","linearGradient"),te.setAttribute("id",j),te.setAttribute("gradientUnits","userSpaceOnUse"),te.setAttribute("x1",String(Math.round(oe))),te.setAttribute("y1",String(Math.round(ue))),te.setAttribute("x2",String(Math.round(A))),te.setAttribute("y2",String(Math.round(N)))}d.colorStops.forEach(({offset:H,color:ie})=>{const oe=this._window.document.createElementNS("http://www.w3.org/2000/svg","stop");oe.setAttribute("offset",100*H+"%"),oe.setAttribute("stop-color",ie),te.appendChild(oe)}),ee.setAttribute("fill",`url('#${j}')`),this._defs.appendChild(te)}else u&&ee.setAttribute("fill",u);this._element.appendChild(ee)}}q.instanceCount=0;const X=q,re="canvas",Q={};for(let v=0;v<=40;v++)Q[v]=v;const J={type:re,shape:"square",width:300,height:300,data:"",margin:0,qrOptions:{typeNumber:Q[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 Z(v){const d=Object.assign({},v);if(!d.colorStops||!d.colorStops.length)throw"Field 'colorStops' is required in gradient";return d.rotation?d.rotation=Number(d.rotation):d.rotation=0,d.colorStops=d.colorStops.map(u=>Object.assign(Object.assign({},u),{offset:Number(u.offset)})),d}function U(v){const d=Object.assign({},v);return d.width=Number(d.width),d.height=Number(d.height),d.margin=Number(d.margin),d.imageOptions=Object.assign(Object.assign({},d.imageOptions),{hideBackgroundDots:!!d.imageOptions.hideBackgroundDots,imageSize:Number(d.imageOptions.imageSize),margin:Number(d.imageOptions.margin)}),d.margin>Math.min(d.width,d.height)&&(d.margin=Math.min(d.width,d.height)),d.dotsOptions=Object.assign({},d.dotsOptions),d.dotsOptions.gradient&&(d.dotsOptions.gradient=Z(d.dotsOptions.gradient)),d.cornersSquareOptions&&(d.cornersSquareOptions=Object.assign({},d.cornersSquareOptions),d.cornersSquareOptions.gradient&&(d.cornersSquareOptions.gradient=Z(d.cornersSquareOptions.gradient))),d.cornersDotOptions&&(d.cornersDotOptions=Object.assign({},d.cornersDotOptions),d.cornersDotOptions.gradient&&(d.cornersDotOptions.gradient=Z(d.cornersDotOptions.gradient))),d.backgroundOptions&&(d.backgroundOptions=Object.assign({},d.backgroundOptions),d.backgroundOptions.gradient&&(d.backgroundOptions.gradient=Z(d.backgroundOptions.gradient))),d}var W=s(873),ae=s.n(W);function se(v){if(!v)throw new Error("Extension must be defined");v[0]==="."&&(v=v.substring(1));const d={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"}[v.toLowerCase()];if(!d)throw new Error(`Extension "${v}" is not supported`);return d}class k{constructor(d){d!=null&&d.jsdom?this._window=new d.jsdom("",{resources:"usable"}).window:this._window=window,this._options=d?U(a(J,d)):J,this.update()}static _clearContainer(d){d&&(d.innerHTML="")}_setupSvg(){if(!this._qr)return;const d=new X(this._options,this._window);this._svg=d.getElement(),this._svgDrawingPromise=d.drawQR(this._qr).then(()=>{var u;this._svg&&((u=this._extension)===null||u===void 0||u.call(this,d.getElement(),this._options))})}_setupCanvas(){var d,u;this._qr&&(!((d=this._options.nodeCanvas)===null||d===void 0)&&d.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=(u=this._svgDrawingPromise)===null||u===void 0?void 0:u.then(()=>{var m;if(!this._svg)return;const f=this._svg,i=new this._window.XMLSerializer().serializeToString(f),b=btoa(i),T=`data:${se("svg")};base64,${b}`;if(!((m=this._options.nodeCanvas)===null||m===void 0)&&m.loadImage)return this._options.nodeCanvas.loadImage(T).then(j=>{var K,ee;j.width=this._options.width,j.height=this._options.height,(ee=(K=this._nodeCanvas)===null||K===void 0?void 0:K.getContext("2d"))===null||ee===void 0||ee.drawImage(j,0,0)});{const j=new this._window.Image;return new Promise(K=>{j.onload=()=>{var ee,te;(te=(ee=this._domCanvas)===null||ee===void 0?void 0:ee.getContext("2d"))===null||te===void 0||te.drawImage(j,0,0),K()},j.src=T})}}))}async _getElement(d="png"){if(!this._qr)throw"QR code is empty";return d.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(d){k._clearContainer(this._container),this._options=d?U(a(this._options,d)):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(u){switch(!0){case/^[0-9]*$/.test(u):return"Numeric";case/^[0-9A-Z $%*+\-./:]*$/.test(u):return"Alphanumeric";default:return"Byte"}})(this._options.data)),this._qr.make(),this._options.type===re?this._setupCanvas():this._setupSvg(),this.append(this._container))}append(d){if(d){if(typeof d.appendChild!="function")throw"Container should be a single DOM node";this._options.type===re?this._domCanvas&&d.appendChild(this._domCanvas):this._svg&&d.appendChild(this._svg),this._container=d}}applyExtension(d){if(!d)throw"Extension function should be defined.";this._extension=d,this.update()}deleteExtension(){this._extension=void 0,this.update()}async getRawData(d="png"){if(!this._qr)throw"QR code is empty";const u=await this._getElement(d),m=se(d);if(!u)return null;if(d.toLowerCase()==="svg"){const f=`<?xml version="1.0" standalone="no"?>\r
|
|
22
|
-
${new this._window.XMLSerializer().serializeToString(
|
|
23
|
-
`+i,g(`data:${se(u)};charset=utf-8,${encodeURIComponent(i)}`,`${m}.svg`)}else g(f.toDataURL(se(u)),`${m}.${u}`)}}const C=k})(),c.default})())})(rn)),rn.exports}fl();const Lo=G.createContext(void 0);function pl(t){const e=Ze.c(9),{children:r,baseUrl:n,queryClient:s}=t;let c;e[0]!==n||e[1]!==s?(c={baseUrl:n,queryClient:s},e[0]=n,e[1]=s,e[2]=c):c=e[2];let h;e[3]!==r||e[4]!==s?(h=w.jsx(Gn,{client:s,children:r}),e[3]=r,e[4]=s,e[5]=h):h=e[5];let a;return e[6]!==c||e[7]!==h?(a=w.jsx(Lo.Provider,{value:c,children:h}),e[6]=c,e[7]=h,e[8]=a):a=e[8],a}function ct(){const t=G.useContext(Lo);if(!t)throw new Error("useDataTable must be used within a DataTableProvider");return t}function nn(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 Pt(t){const e=await t.text();if(!e)throw new Error(`HTTP ${t.status}: ${t.statusText}`);try{const r=JSON.parse(e);throw r.message?new Error(r.message):r.error?new Error(r.error):new Error(e)}catch{throw new Error(e)}}function gl(){const t=localStorage.getItem("a360.assumed-org");return t?{"X-Assume-Org":t}:{}}async function bt(){return{"Content-Type":"application/json",Authorization:`Bearer ${await rl()??""}`,...gl()}}async function Bo(t){return fetch(t,{method:"GET",headers:await bt()}).then(async e=>(e.status>=400&&await Pt(e),e)).then(e=>e.json()).then(e=>e)}async function Io(t,e){return fetch(`${t}/${e}`,{method:"GET",headers:await bt()}).then(async r=>(r.status>=400&&await Pt(r),r)).then(r=>r.json()).then(r=>r)}async function Yo(t,e){const r=await fetch(`${t}/${e}`,{method:"DELETE",headers:await bt()});r.status>=400&&await Pt(r)}async function zo(t,e){return fetch(t,{method:"POST",headers:await bt(),body:JSON.stringify(e)}).then(async r=>(r.status>=400&&await Pt(r),r)).then(r=>r.status==204?e:r.json()).then(r=>r)}async function ml(t,e,r){return fetch(e,{method:t,headers:await bt(),body:r?JSON.stringify(r):void 0}).then(async n=>(n.status>=400&&await Pt(n),n)).then(n=>{if(n.status!=204)return n.json()}).then(n=>n)}async function Fo(t,e){return fetch(`${t}/${e.id}`,{method:"PUT",headers:await bt(),body:JSON.stringify(e)}).then(async r=>(r.status>=400&&await Pt(r),r)).then(r=>r.status==204?e:r.json()).then(r=>r)}function Wo(t,e,r){const n=Ze.c(13),{baseUrl:s}=ct();let c;if(n[0]!==r||n[1]!==e){let y;n[3]!==r?(y=r?.toString(),n[3]=r,n[4]=y):y=n[4],c=[...e.map(yl),String(y)],n[0]=r,n[1]=e,n[2]=c}else c=n[2];let h;n[5]!==t||n[6]!==s||n[7]!==r?(h=()=>Io(`${s}${t}`,r),n[5]=t,n[6]=s,n[7]=r,n[8]=h):h=n[8];const a=!!r;let g;return n[9]!==c||n[10]!==h||n[11]!==a?(g={queryKey:c,queryFn:h,enabled:a},n[9]=c,n[10]=h,n[11]=a,n[12]=g):g=n[12],Kn(g)}function yl(t){return t.toString()}function Uo(t,e,r){const n=Ze.c(9),s=r===void 0?!0:r,{baseUrl:c}=ct();let h;n[0]!==e?(h=[...e.map(vl)],n[0]=e,n[1]=h):h=n[1];let a;n[2]!==t||n[3]!==c?(a=()=>Bo(`${c}${t}`),n[2]=t,n[3]=c,n[4]=a):a=n[4];let g;return n[5]!==s||n[6]!==h||n[7]!==a?(g={queryKey:h,queryFn:a,enabled:s},n[5]=s,n[6]=h,n[7]=a,n[8]=g):g=n[8],Kn(g)}function vl(t){return t.toString()}function qo(t,e){const r=Ze.c(10),{baseUrl:n,queryClient:s}=ct();let c;r[0]!==e?(c=[...e.map(wl)],r[0]=e,r[1]=c):c=r[1];let h;r[2]!==t||r[3]!==n?(h=g=>zo(`${n}${t}`,g),r[2]=t,r[3]=n,r[4]=h):h=r[4];let a;return r[5]!==s||r[6]!==e||r[7]!==c||r[8]!==h?(a={mutationKey:c,mutationFn:h,onSettled(){return s.invalidateQueries({queryKey:[...e.map(bl)]})},onError(g){nn(g)}},r[5]=s,r[6]=e,r[7]=c,r[8]=h,r[9]=a):a=r[9],Lr(a)}function bl(t){return t.toString()}function wl(t){return t.toString()}function on(t,e){const r=Ze.c(10),{baseUrl:n,queryClient:s}=ct();let c;r[0]!==e?(c=[...e.map(Cl)],r[0]=e,r[1]=c):c=r[1];let h;r[2]!==t||r[3]!==n?(h=g=>Fo(`${n}${t}`,g),r[2]=t,r[3]=n,r[4]=h):h=r[4];let a;return r[5]!==s||r[6]!==e||r[7]!==c||r[8]!==h?(a={mutationKey:c,mutationFn:h,onSettled(){return s.invalidateQueries({queryKey:[...e.map(_l)]})},onError(g){nn(g)}},r[5]=s,r[6]=e,r[7]=c,r[8]=h,r[9]=a):a=r[9],Lr(a)}function _l(t){return t.toString()}function Cl(t){return t.toString()}function Vo(t,e){const r=Ze.c(10),{baseUrl:n,queryClient:s}=ct();let c;r[0]!==e?(c=[...e.map(Sl)],r[0]=e,r[1]=c):c=r[1];let h;r[2]!==t||r[3]!==n?(h=g=>Yo(`${n}${t}`,g),r[2]=t,r[3]=n,r[4]=h):h=r[4];let a;return r[5]!==s||r[6]!==e||r[7]!==c||r[8]!==h?(a={mutationKey:c,mutationFn:h,onSettled(){return s.invalidateQueries({queryKey:[...e.map(xl)]})},onError(g){nn(g)}},r[5]=s,r[6]=e,r[7]=c,r[8]=h,r[9]=a):a=r[9],Lr(a)}function xl(t){return t.toString()}function Sl(t){return t.toString()}var lr={exports:{}},Dl=lr.exports,Ho;function kl(){return Ho||(Ho=1,(function(t,e){(function(r,n){t.exports=n()})(Dl,(function(){var r=1e3,n=6e4,s=36e5,c="millisecond",h="second",a="minute",g="hour",y="day",_="week",M="month",x="quarter",S="year",D="date",O="Invalid Date",L=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,I=/\[([^\]]+)]|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,z={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 C=["th","st","nd","rd"],v=k%100;return"["+k+(C[(v-20)%10]||C[v]||C[0])+"]"}},V=function(k,C,v){var d=String(k);return!d||d.length>=C?k:""+Array(C+1-d.length).join(v)+k},q={s:V,z:function(k){var C=-k.utcOffset(),v=Math.abs(C),d=Math.floor(v/60),u=v%60;return(C<=0?"+":"-")+V(d,2,"0")+":"+V(u,2,"0")},m:function k(C,v){if(C.date()<v.date())return-k(v,C);var d=12*(v.year()-C.year())+(v.month()-C.month()),u=C.clone().add(d,M),m=v-u<0,f=C.clone().add(d+(m?-1:1),M);return+(-(d+(v-u)/(m?u-f:f-u))||0)},a:function(k){return k<0?Math.ceil(k)||0:Math.floor(k)},p:function(k){return{M,y:S,w:_,d:y,D,h:g,m:a,s:h,ms:c,Q:x}[k]||String(k||"").toLowerCase().replace(/s$/,"")},u:function(k){return k===void 0}},X="en",re={};re[X]=z;var Q="$isDayjsObject",J=function(k){return k instanceof ae||!(!k||!k[Q])},Z=function k(C,v,d){var u;if(!C)return X;if(typeof C=="string"){var m=C.toLowerCase();re[m]&&(u=m),v&&(re[m]=v,u=m);var f=C.split("-");if(!u&&f.length>1)return k(f[0])}else{var i=C.name;re[i]=C,u=i}return!d&&u&&(X=u),u||!d&&X},U=function(k,C){if(J(k))return k.clone();var v=typeof C=="object"?C:{};return v.date=k,v.args=arguments,new ae(v)},W=q;W.l=Z,W.i=J,W.w=function(k,C){return U(k,{locale:C.$L,utc:C.$u,x:C.$x,$offset:C.$offset})};var ae=(function(){function k(v){this.$L=Z(v.locale,null,!0),this.parse(v),this.$x=this.$x||v.x||{},this[Q]=!0}var C=k.prototype;return C.parse=function(v){this.$d=(function(d){var u=d.date,m=d.utc;if(u===null)return new Date(NaN);if(W.u(u))return new Date;if(u instanceof Date)return new Date(u);if(typeof u=="string"&&!/Z$/i.test(u)){var f=u.match(L);if(f){var i=f[2]-1||0,b=(f[7]||"0").substring(0,3);return m?new Date(Date.UTC(f[1],i,f[3]||1,f[4]||0,f[5]||0,f[6]||0,b)):new Date(f[1],i,f[3]||1,f[4]||0,f[5]||0,f[6]||0,b)}}return new Date(u)})(v),this.init()},C.init=function(){var v=this.$d;this.$y=v.getFullYear(),this.$M=v.getMonth(),this.$D=v.getDate(),this.$W=v.getDay(),this.$H=v.getHours(),this.$m=v.getMinutes(),this.$s=v.getSeconds(),this.$ms=v.getMilliseconds()},C.$utils=function(){return W},C.isValid=function(){return this.$d.toString()!==O},C.isSame=function(v,d){var u=U(v);return this.startOf(d)<=u&&u<=this.endOf(d)},C.isAfter=function(v,d){return U(v)<this.startOf(d)},C.isBefore=function(v,d){return this.endOf(d)<U(v)},C.$g=function(v,d,u){return W.u(v)?this[d]:this.set(u,v)},C.unix=function(){return Math.floor(this.valueOf()/1e3)},C.valueOf=function(){return this.$d.getTime()},C.startOf=function(v,d){var u=this,m=!!W.u(d)||d,f=W.p(v),i=function(ie,oe){var ue=W.w(u.$u?Date.UTC(u.$y,oe,ie):new Date(u.$y,oe,ie),u);return m?ue:ue.endOf(y)},b=function(ie,oe){return W.w(u.toDate()[ie].apply(u.toDate("s"),(m?[0,0,0,0]:[23,59,59,999]).slice(oe)),u)},T=this.$W,j=this.$M,K=this.$D,ee="set"+(this.$u?"UTC":"");switch(f){case S:return m?i(1,0):i(31,11);case M:return m?i(1,j):i(0,j+1);case _:var te=this.$locale().weekStart||0,H=(T<te?T+7:T)-te;return i(m?K-H:K+(6-H),j);case y:case D:return b(ee+"Hours",0);case g:return b(ee+"Minutes",1);case a:return b(ee+"Seconds",2);case h:return b(ee+"Milliseconds",3);default:return this.clone()}},C.endOf=function(v){return this.startOf(v,!1)},C.$set=function(v,d){var u,m=W.p(v),f="set"+(this.$u?"UTC":""),i=(u={},u[y]=f+"Date",u[D]=f+"Date",u[M]=f+"Month",u[S]=f+"FullYear",u[g]=f+"Hours",u[a]=f+"Minutes",u[h]=f+"Seconds",u[c]=f+"Milliseconds",u)[m],b=m===y?this.$D+(d-this.$W):d;if(m===M||m===S){var T=this.clone().set(D,1);T.$d[i](b),T.init(),this.$d=T.set(D,Math.min(this.$D,T.daysInMonth())).$d}else i&&this.$d[i](b);return this.init(),this},C.set=function(v,d){return this.clone().$set(v,d)},C.get=function(v){return this[W.p(v)]()},C.add=function(v,d){var u,m=this;v=Number(v);var f=W.p(d),i=function(j){var K=U(m);return W.w(K.date(K.date()+Math.round(j*v)),m)};if(f===M)return this.set(M,this.$M+v);if(f===S)return this.set(S,this.$y+v);if(f===y)return i(1);if(f===_)return i(7);var b=(u={},u[a]=n,u[g]=s,u[h]=r,u)[f]||1,T=this.$d.getTime()+v*b;return W.w(T,this)},C.subtract=function(v,d){return this.add(-1*v,d)},C.format=function(v){var d=this,u=this.$locale();if(!this.isValid())return u.invalidDate||O;var m=v||"YYYY-MM-DDTHH:mm:ssZ",f=W.z(this),i=this.$H,b=this.$m,T=this.$M,j=u.weekdays,K=u.months,ee=u.meridiem,te=function(oe,ue,A,N){return oe&&(oe[ue]||oe(d,m))||A[ue].slice(0,N)},H=function(oe){return W.s(i%12||12,oe,"0")},ie=ee||function(oe,ue,A){var N=oe<12?"AM":"PM";return A?N.toLowerCase():N};return m.replace(I,(function(oe,ue){return ue||(function(A){switch(A){case"YY":return String(d.$y).slice(-2);case"YYYY":return W.s(d.$y,4,"0");case"M":return T+1;case"MM":return W.s(T+1,2,"0");case"MMM":return te(u.monthsShort,T,K,3);case"MMMM":return te(K,T);case"D":return d.$D;case"DD":return W.s(d.$D,2,"0");case"d":return String(d.$W);case"dd":return te(u.weekdaysMin,d.$W,j,2);case"ddd":return te(u.weekdaysShort,d.$W,j,3);case"dddd":return j[d.$W];case"H":return String(i);case"HH":return W.s(i,2,"0");case"h":return H(1);case"hh":return H(2);case"a":return ie(i,b,!0);case"A":return ie(i,b,!1);case"m":return String(b);case"mm":return W.s(b,2,"0");case"s":return String(d.$s);case"ss":return W.s(d.$s,2,"0");case"SSS":return W.s(d.$ms,3,"0");case"Z":return f}return null})(oe)||f.replace(":","")}))},C.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},C.diff=function(v,d,u){var m,f=this,i=W.p(d),b=U(v),T=(b.utcOffset()-this.utcOffset())*n,j=this-b,K=function(){return W.m(f,b)};switch(i){case S:m=K()/12;break;case M:m=K();break;case x:m=K()/3;break;case _:m=(j-T)/6048e5;break;case y:m=(j-T)/864e5;break;case g:m=j/s;break;case a:m=j/n;break;case h:m=j/r;break;default:m=j}return u?m:W.a(m)},C.daysInMonth=function(){return this.endOf(M).$D},C.$locale=function(){return re[this.$L]},C.locale=function(v,d){if(!v)return this.$L;var u=this.clone(),m=Z(v,d,!0);return m&&(u.$L=m),u},C.clone=function(){return W.w(this.$d,this)},C.toDate=function(){return new Date(this.valueOf())},C.toJSON=function(){return this.isValid()?this.toISOString():null},C.toISOString=function(){return this.$d.toISOString()},C.toString=function(){return this.$d.toUTCString()},k})(),se=ae.prototype;return U.prototype=se,[["$ms",c],["$s",h],["$m",a],["$H",g],["$W",y],["$M",M],["$y",S],["$D",D]].forEach((function(k){se[k[1]]=function(C){return this.$g(C,k[0],k[1])}})),U.extend=function(k,C){return k.$i||(k(C,ae,U),k.$i=!0),U},U.locale=Z,U.isDayjs=J,U.unix=function(k){return U(1e3*k)},U.en=re[X],U.Ls=re,U.p={},U}))})(lr)),lr.exports}var Pl=kl();const de=An(Pl);function Ml({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 Go({controlsRef:t,direction:e,levelIndex:r,rowIndex:n,cellIndex:s,size:c}){const h=Ml({direction:e,size:c,rowIndex:n,cellIndex:s,levelIndex:r});if(!h)return;const a=t.current?.[h.levelIndex]?.[h.rowIndex]?.[h.cellIndex];a&&(a.disabled||a.getAttribute("data-hidden")||a.getAttribute("data-outside")?Go({controlsRef:t,direction:e,levelIndex:h.levelIndex,cellIndex:h.cellIndex,rowIndex:h.rowIndex,size:c}):a.focus())}function Ol(t){switch(t){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function Al(t){return t.current?.map(e=>e.map(r=>r.length))}function sn({controlsRef:t,levelIndex:e,rowIndex:r,cellIndex:n,event:s}){const c=Ol(s.key);if(c){s.preventDefault();const h=Al(t);Go({controlsRef:t,direction:c,levelIndex:e,rowIndex:r,cellIndex:n,size:h})}}function qe(t){return t==null||t===""?t:de(t).format("YYYY-MM-DD")}function Qo(t){return t==null||t===""?t:de(t).format("YYYY-MM-DD HH:mm:ss")}const El={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},Tl=G.createContext(El);function dt(){const t=G.useContext(Tl),e=G.useCallback(c=>c||t.locale,[t.locale]),r=G.useCallback(c=>typeof c=="number"?c:t.firstDayOfWeek,[t.firstDayOfWeek]),n=G.useCallback(c=>Array.isArray(c)?c:t.weekendDays,[t.weekendDays]),s=G.useCallback(c=>typeof c=="string"?c:t.labelSeparator,[t.labelSeparator]);return{...t,getLocale:e,getFirstDayOfWeek:r,getWeekendDays:n,getLabelSeparator:s}}function jl({value:t,type:e,withTime:r}){const n=r?Qo:qe;if(e==="range"&&Array.isArray(t)){const s=n(t[0]),c=n(t[1]);return s?c?`${s} – ${c}`:`${s} –`:""}return e==="multiple"&&Array.isArray(t)?t.filter(Boolean).join(", "):!Array.isArray(t)&&t?n(t):""}function Zo({value:t,type:e,name:r,form:n,withTime:s=!1}){return w.jsx("input",{type:"hidden",value:jl({value:t,type:e,withTime:s}),name:r,form:n})}Zo.displayName="@mantine/dates/HiddenDatesInput";function Ko(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=Ko(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Pe(){for(var t,e,r=0,n="",s=arguments.length;r<s;r++)(t=arguments[r])&&(e=Ko(t))&&(n&&(n+=" "),n+=e);return n}var Jo={day:"m_396ce5cb"};const $l=E.createVarsResolver((t,{size:e})=>({day:{"--day-size":E.getSize(e,"day-size")}})),an=E.factory((t,e)=>{const r=E.useProps("Day",null,t),{classNames:n,className:s,style:c,styles:h,unstyled:a,vars:g,date:y,disabled:_,__staticSelector:M,weekend:x,outside:S,selected:D,renderDay:O,inRange:L,firstInRange:I,lastInRange:z,hidden:V,static:q,highlightToday:X,attributes:re,...Q}=r,J=E.useStyles({name:M||"Day",classes:Jo,props:r,className:s,style:c,classNames:n,styles:h,unstyled:a,attributes:re,vars:g,varsResolver:$l,rootSelector:"day"});return w.jsx(E.UnstyledButton,{...J("day",{style:V?{display:"none"}:void 0}),component:q?"div":"button",ref:e,disabled:_,"data-today":de(y).isSame(new Date,"day")||void 0,"data-hidden":V||void 0,"data-highlight-today":X||void 0,"data-disabled":_||void 0,"data-weekend":!_&&!S&&x||void 0,"data-outside":!_&&S||void 0,"data-selected":!_&&D||void 0,"data-in-range":L&&!_||void 0,"data-first-in-range":I&&!_||void 0,"data-last-in-range":z&&!_||void 0,"data-static":q||void 0,unstyled:a,...Q,children:O?.(y)||de(y).date()})});an.classes=Jo,an.displayName="@mantine/dates/Day";function Rl({locale:t,format:e="dd",firstDayOfWeek:r=1}){const n=de().day(r),s=[];for(let c=0;c<7;c+=1)typeof e=="string"?s.push(de(n).add(c,"days").locale(t).format(e)):s.push(e(de(n).add(c,"days").format("YYYY-MM-DD")));return s}var Xo={weekday:"m_18a3eca"};const Nl=E.createVarsResolver((t,{size:e})=>({weekdaysRow:{"--wr-fz":E.getFontSize(e),"--wr-spacing":E.getSpacing(e)}})),ln=E.factory((t,e)=>{const r=E.useProps("WeekdaysRow",null,t),{classNames:n,className:s,style:c,styles:h,unstyled:a,vars:g,locale:y,firstDayOfWeek:_,weekdayFormat:M,cellComponent:x="th",__staticSelector:S,withWeekNumbers:D,attributes:O,...L}=r,I=E.useStyles({name:S||"WeekdaysRow",classes:Xo,props:r,className:s,style:c,classNames:n,styles:h,unstyled:a,attributes:O,vars:g,varsResolver:Nl,rootSelector:"weekdaysRow"}),z=dt(),V=Rl({locale:z.getLocale(y),format:M,firstDayOfWeek:z.getFirstDayOfWeek(_)}).map((q,X)=>w.jsx(x,{...I("weekday"),children:q},X));return w.jsxs(E.Box,{component:"tr",ref:e,...I("weekdaysRow"),...L,children:[D&&w.jsx(x,{...I("weekday"),children:"#"}),V]})});ln.classes=Xo,ln.displayName="@mantine/dates/WeekdaysRow";function Ll(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 Bl(t,e=1){let r=de(t);for(;r.day()!==e;)r=r.subtract(1,"day");return r.format("YYYY-MM-DD")}function Il({month:t,firstDayOfWeek:e=1,consistentWeeks:r}){const n=de(t).subtract(de(t).date()-1,"day"),s=de(n.format("YYYY-M-D")),c=s.format("YYYY-MM-DD"),h=s.add(+s.daysInMonth()-1,"day").format("YYYY-MM-DD"),a=Ll(h,e),g=[];let y=de(Bl(c,e));for(;de(y).isBefore(a,"day");){const _=[];for(let M=0;M<7;M+=1)_.push(y.format("YYYY-MM-DD")),y=y.add(1,"day");g.push(_)}if(r&&g.length<6){const _=g[g.length-1],M=_[_.length-1];let x=de(M).add(1,"day");for(;g.length<6;){const S=[];for(let D=0;D<7;D+=1)S.push(x.format("YYYY-MM-DD")),x=x.add(1,"day");g.push(S)}}return g}function un(t,e){return de(t).format("YYYY-MM")===de(e).format("YYYY-MM")}function es(t,e){return e?de(t).isAfter(de(e).subtract(1,"day"),"day"):!0}function ts(t,e){return e?de(t).isBefore(de(e).add(1,"day"),"day"):!0}function Yl({dates:t,minDate:e,maxDate:r,getDayProps:n,excludeDate:s,hideOutsideDates:c,month:h}){const a=t.flat().filter(_=>ts(_,r)&&es(_,e)&&!s?.(_)&&!n?.(_)?.disabled&&(!c||un(_,h))),g=a.find(_=>n?.(_)?.selected);if(g)return g;const y=a.find(_=>de().isSame(_,"date"));return y||a[0]}var ur={exports:{}},zl=ur.exports,rs;function Fl(){return rs||(rs=1,(function(t,e){(function(r,n){t.exports=n()})(zl,(function(){var r="day";return function(n,s,c){var h=function(y){return y.add(4-y.isoWeekday(),r)},a=s.prototype;a.isoWeekYear=function(){return h(this).year()},a.isoWeek=function(y){if(!this.$utils().u(y))return this.add(7*(y-this.isoWeek()),r);var _,M,x,S,D=h(this),O=(_=this.isoWeekYear(),M=this.$u,x=(M?c.utc:c)().year(_).startOf("year"),S=4-x.isoWeekday(),x.isoWeekday()>4&&(S+=7),x.add(S,r));return D.diff(O,"week")+1},a.isoWeekday=function(y){return this.$utils().u(y)?this.day()||7:this.day(this.day()%7?y:y-7)};var g=a.startOf;a.startOf=function(y,_){var M=this.$utils(),x=!!M.u(_)||_;return M.p(y)==="isoweek"?x?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):g.bind(this)(y,_)}}}))})(ur)),ur.exports}var Wl=Fl();const Ul=An(Wl);de.extend(Ul);function ql(t){const e=t.find(r=>de(r).day()===1);return de(e).isoWeek()}var ns={month:"m_cc9820d3",monthCell:"m_8f457cd5",weekNumber:"m_6cff9dea"};const Vl={withCellSpacing:!0},Hl=E.createVarsResolver((t,{size:e})=>({weekNumber:{"--wn-fz":E.getFontSize(e),"--wn-size":E.getSize(e,"wn-size")}})),cr=E.factory((t,e)=>{const r=E.useProps("Month",Vl,t),{classNames:n,className:s,style:c,styles:h,unstyled:a,vars:g,__staticSelector:y,locale:_,firstDayOfWeek:M,weekdayFormat:x,month:S,weekendDays:D,getDayProps:O,excludeDate:L,minDate:I,maxDate:z,renderDay:V,hideOutsideDates:q,hideWeekdays:X,getDayAriaLabel:re,static:Q,__getDayRef:J,__onDayKeyDown:Z,__onDayClick:U,__onDayMouseEnter:W,__preventFocus:ae,__stopPropagation:se,withCellSpacing:k,size:C,highlightToday:v,withWeekNumbers:d,attributes:u,...m}=r,f=E.useStyles({name:y||"Month",classes:ns,props:r,className:s,style:c,classNames:n,styles:h,unstyled:a,attributes:u,vars:g,varsResolver:Hl,rootSelector:"month"}),i=dt(),b=Il({month:S,firstDayOfWeek:i.getFirstDayOfWeek(M),consistentWeeks:i.consistentWeeks}),T=Yl({dates:b,minDate:qe(I),maxDate:qe(z),getDayProps:O,excludeDate:L,hideOutsideDates:q,month:S}),{resolvedClassNames:j,resolvedStyles:K}=E.useResolvedStylesApi({classNames:n,styles:h,props:r}),ee=b.map((te,H)=>{const ie=te.map((oe,ue)=>{const A=!un(oe,S),N=re?.(oe)||de(oe).locale(_||i.locale).format("D MMMM YYYY"),$=O?.(oe),B=de(oe).isSame(T,"date");return w.jsx("td",{...f("monthCell"),"data-with-spacing":k||void 0,children:w.jsx(an,{__staticSelector:y||"Month",classNames:j,styles:K,unstyled:a,"data-mantine-stop-propagation":se||void 0,highlightToday:v,renderDay:V,date:oe,size:C,weekend:i.getWeekendDays(D).includes(de(oe).get("day")),outside:A,hidden:q?A:!1,"aria-label":N,static:Q,disabled:L?.(oe)||!ts(oe,qe(z))||!es(oe,qe(I)),ref:Y=>{Y&&J?.(H,ue,Y)},...$,onKeyDown:Y=>{$?.onKeyDown?.(Y),Z?.(Y,{rowIndex:H,cellIndex:ue,date:oe})},onMouseEnter:Y=>{$?.onMouseEnter?.(Y),W?.(Y,oe)},onClick:Y=>{$?.onClick?.(Y),U?.(Y,oe)},onMouseDown:Y=>{$?.onMouseDown?.(Y),ae&&Y.preventDefault()},tabIndex:ae||!B?-1:0})},oe.toString())});return w.jsxs("tr",{...f("monthRow"),children:[d&&w.jsx("td",{...f("weekNumber"),children:ql(te)}),ie]},H)});return w.jsxs(E.Box,{component:"table",...f("month"),size:C,ref:e,...m,children:[!X&&w.jsx("thead",{...f("monthThead"),children:w.jsx(ln,{__staticSelector:y||"Month",locale:_,firstDayOfWeek:M,weekdayFormat:x,size:C,classNames:j,styles:K,unstyled:a,withWeekNumbers:d})}),w.jsx("tbody",{...f("monthTbody"),children:ee})]})});cr.classes=ns,cr.displayName="@mantine/dates/Month";var os={pickerControl:"m_dc6a3c71"};const Gl=E.createVarsResolver((t,{size:e})=>({pickerControl:{"--dpc-fz":E.getFontSize(e),"--dpc-size":E.getSize(e,"dpc-size")}})),dr=E.factory((t,e)=>{const r=E.useProps("PickerControl",null,t),{classNames:n,className:s,style:c,styles:h,unstyled:a,vars:g,firstInRange:y,lastInRange:_,inRange:M,__staticSelector:x,selected:S,disabled:D,attributes:O,...L}=r,I=E.useStyles({name:x||"PickerControl",classes:os,props:r,className:s,style:c,classNames:n,styles:h,unstyled:a,attributes:O,vars:g,varsResolver:Gl,rootSelector:"pickerControl"});return w.jsx(E.UnstyledButton,{...I("pickerControl"),ref:e,unstyled:a,"data-picker-control":!0,"data-selected":S&&!D||void 0,"data-disabled":D||void 0,"data-in-range":M&&!D&&!S||void 0,"data-first-in-range":y&&!D||void 0,"data-last-in-range":_&&!D||void 0,disabled:D,...L})});dr.classes=os,dr.displayName="@mantine/dates/PickerControl";function ss({year:t,minDate:e,maxDate:r}){return!e&&!r?!1:!!(e&&de(t).isBefore(e,"year")||r&&de(t).isAfter(r,"year"))}function Ql({years:t,minDate:e,maxDate:r,getYearControlProps:n}){const s=t.flat().filter(a=>!ss({year:a,minDate:e,maxDate:r})&&!n?.(a)?.disabled),c=s.find(a=>n?.(a)?.selected);if(c)return c;const h=s.find(a=>de().isSame(a,"year"));return h||s[0]}function is(t){const e=de(t).year(),r=e-e%10;let n=0;const s=[[],[],[],[]];for(let c=0;c<4;c+=1){const h=c===3?1:3;for(let a=0;a<h;a+=1)s[c].push(de(new Date(r+n,0)).format("YYYY-MM-DD")),n+=1}return s}var as={yearsList:"m_9206547b",yearsListCell:"m_c5a19c7d"};const Zl={yearsListFormat:"YYYY",withCellSpacing:!0},hr=E.factory((t,e)=>{const r=E.useProps("YearsList",Zl,t),{classNames:n,className:s,style:c,styles:h,unstyled:a,vars:g,decade:y,yearsListFormat:_,locale:M,minDate:x,maxDate:S,getYearControlProps:D,__staticSelector:O,__getControlRef:L,__onControlKeyDown:I,__onControlClick:z,__onControlMouseEnter:V,__preventFocus:q,__stopPropagation:X,withCellSpacing:re,size:Q,attributes:J,...Z}=r,U=E.useStyles({name:O||"YearsList",classes:as,props:r,className:s,style:c,classNames:n,styles:h,unstyled:a,attributes:J,vars:g,rootSelector:"yearsList"}),W=dt(),ae=is(y),se=Ql({years:ae,minDate:x,maxDate:S,getYearControlProps:D}),k=ae.map((C,v)=>{const d=C.map((u,m)=>{const f=D?.(u),i=de(u).isSame(se,"year");return w.jsx("td",{...U("yearsListCell"),"data-with-spacing":re||void 0,children:w.jsx(dr,{...U("yearsListControl"),size:Q,unstyled:a,"data-mantine-stop-propagation":X||void 0,disabled:ss({year:u,minDate:x,maxDate:S}),ref:b=>{b&&L?.(v,m,b)},...f,onKeyDown:b=>{f?.onKeyDown?.(b),I?.(b,{rowIndex:v,cellIndex:m,date:u})},onClick:b=>{f?.onClick?.(b),z?.(b,u)},onMouseEnter:b=>{f?.onMouseEnter?.(b),V?.(b,u)},onMouseDown:b=>{f?.onMouseDown?.(b),q&&b.preventDefault()},tabIndex:q||!i?-1:0,children:de(u).locale(W.getLocale(M)).format(_)})},m)});return w.jsx("tr",{...U("yearsListRow"),children:d},v)});return w.jsx(E.Box,{component:"table",ref:e,size:Q,...U("yearsList"),...Z,children:w.jsx("tbody",{children:k})})});hr.classes=as,hr.displayName="@mantine/dates/YearsList";function ls({month:t,minDate:e,maxDate:r}){return!e&&!r?!1:!!(e&&de(t).isBefore(e,"month")||r&&de(t).isAfter(r,"month"))}function Kl({months:t,minDate:e,maxDate:r,getMonthControlProps:n}){const s=t.flat().filter(a=>!ls({month:a,minDate:e,maxDate:r})&&!n?.(a)?.disabled),c=s.find(a=>n?.(a)?.selected);if(c)return c;const h=s.find(a=>de().isSame(a,"month"));return h||s[0]}function Jl(t){const e=de(t).startOf("year").toDate(),r=[[],[],[],[]];let n=0;for(let s=0;s<4;s+=1)for(let c=0;c<3;c+=1)r[s].push(de(e).add(n,"months").format("YYYY-MM-DD")),n+=1;return r}var us={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const Xl={monthsListFormat:"MMM",withCellSpacing:!0},fr=E.factory((t,e)=>{const r=E.useProps("MonthsList",Xl,t),{classNames:n,className:s,style:c,styles:h,unstyled:a,vars:g,__staticSelector:y,year:_,monthsListFormat:M,locale:x,minDate:S,maxDate:D,getMonthControlProps:O,__getControlRef:L,__onControlKeyDown:I,__onControlClick:z,__onControlMouseEnter:V,__preventFocus:q,__stopPropagation:X,withCellSpacing:re,size:Q,attributes:J,...Z}=r,U=E.useStyles({name:y||"MonthsList",classes:us,props:r,className:s,style:c,classNames:n,styles:h,unstyled:a,attributes:J,vars:g,rootSelector:"monthsList"}),W=dt(),ae=Jl(_),se=Kl({months:ae,minDate:qe(S),maxDate:qe(D),getMonthControlProps:O}),k=ae.map((C,v)=>{const d=C.map((u,m)=>{const f=O?.(u),i=de(u).isSame(se,"month");return w.jsx("td",{...U("monthsListCell"),"data-with-spacing":re||void 0,children:w.jsx(dr,{...U("monthsListControl"),size:Q,unstyled:a,__staticSelector:y||"MonthsList","data-mantine-stop-propagation":X||void 0,disabled:ls({month:u,minDate:qe(S),maxDate:qe(D)}),ref:b=>{b&&L?.(v,m,b)},...f,onKeyDown:b=>{f?.onKeyDown?.(b),I?.(b,{rowIndex:v,cellIndex:m,date:u})},onClick:b=>{f?.onClick?.(b),z?.(b,u)},onMouseEnter:b=>{f?.onMouseEnter?.(b),V?.(b,u)},onMouseDown:b=>{f?.onMouseDown?.(b),q&&b.preventDefault()},tabIndex:q||!i?-1:0,children:de(u).locale(W.getLocale(x)).format(M)})},m)});return w.jsx("tr",{...U("monthsListRow"),children:d},v)});return w.jsx(E.Box,{component:"table",ref:e,size:Q,...U("monthsList"),...Z,children:w.jsx("tbody",{children:k})})});fr.classes=us,fr.displayName="@mantine/dates/MonthsList";var cs={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderControlIcon:"m_367dc749"};const eu={hasNextLevel:!0,withNext:!0,withPrevious:!0,headerControlsOrder:["previous","level","next"]},tu=E.createVarsResolver((t,{size:e})=>({calendarHeader:{"--dch-control-size":E.getSize(e,"dch-control-size"),"--dch-fz":E.getFontSize(e)}})),ht=E.factory((t,e)=>{const r=E.useProps("CalendarHeader",eu,t),{classNames:n,className:s,style:c,styles:h,unstyled:a,vars:g,nextIcon:y,previousIcon:_,nextLabel:M,previousLabel:x,onNext:S,onPrevious:D,onLevelClick:O,label:L,nextDisabled:I,previousDisabled:z,hasNextLevel:V,levelControlAriaLabel:q,withNext:X,withPrevious:re,headerControlsOrder:Q,__staticSelector:J,__preventFocus:Z,__stopPropagation:U,attributes:W,...ae}=r,se=E.useStyles({name:J||"CalendarHeader",classes:cs,props:r,className:s,style:c,classNames:n,styles:h,unstyled:a,attributes:W,vars:g,varsResolver:tu,rootSelector:"calendarHeader"}),k=Z?m=>m.preventDefault():void 0,C=re&&G.createElement(E.UnstyledButton,{...se("calendarHeaderControl"),key:"previous","data-direction":"previous","aria-label":x,onClick:D,unstyled:a,onMouseDown:k,disabled:z,"data-disabled":z||void 0,tabIndex:Z||z?-1:0,"data-mantine-stop-propagation":U||void 0},_||w.jsx(E.AccordionChevron,{...se("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})),v=G.createElement(E.UnstyledButton,{component:V?"button":"div",...se("calendarHeaderLevel"),key:"level",onClick:V?O:void 0,unstyled:a,onMouseDown:V?k:void 0,disabled:!V,"data-static":!V||void 0,"aria-label":q,tabIndex:Z||!V?-1:0,"data-mantine-stop-propagation":U||void 0},L),d=X&&G.createElement(E.UnstyledButton,{...se("calendarHeaderControl"),key:"next","data-direction":"next","aria-label":M,onClick:S,unstyled:a,onMouseDown:k,disabled:I,"data-disabled":I||void 0,tabIndex:Z||I?-1:0,"data-mantine-stop-propagation":U||void 0},y||w.jsx(E.AccordionChevron,{...se("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})),u=Q.map(m=>m==="previous"?C:m==="level"?v:m==="next"?d:null);return w.jsx(E.Box,{...se("calendarHeader"),ref:e,...ae,children:u})});ht.classes=cs,ht.displayName="@mantine/dates/CalendarHeader";function ru(t){const e=is(t);return[e[0][0],e[3][0]]}const nu={decadeLabelFormat:"YYYY"},pr=E.factory((t,e)=>{const r=E.useProps("DecadeLevel",nu,t),{decade:n,locale:s,minDate:c,maxDate:h,yearsListFormat:a,getYearControlProps:g,__getControlRef:y,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:x,withCellSpacing:S,__preventFocus:D,nextIcon:O,previousIcon:L,nextLabel:I,previousLabel:z,onNext:V,onPrevious:q,nextDisabled:X,previousDisabled:re,levelControlAriaLabel:Q,withNext:J,withPrevious:Z,headerControlsOrder:U,decadeLabelFormat:W,classNames:ae,styles:se,unstyled:k,__staticSelector:C,__stopPropagation:v,size:d,attributes:u,...m}=r,f=dt(),[i,b]=ru(n),T={__staticSelector:C||"DecadeLevel",classNames:ae,styles:se,unstyled:k,size:d,attributes:u},j=typeof X=="boolean"?X:h?!de(b).endOf("year").isBefore(h):!1,K=typeof re=="boolean"?re:c?!de(i).startOf("year").isAfter(c):!1,ee=(te,H)=>de(te).locale(s||f.locale).format(H);return w.jsxs(E.Box,{"data-decade-level":!0,size:d,ref:e,...m,children:[w.jsx(ht,{label:typeof W=="function"?W(i,b):`${ee(i,W)} – ${ee(b,W)}`,__preventFocus:D,__stopPropagation:v,nextIcon:O,previousIcon:L,nextLabel:I,previousLabel:z,onNext:V,onPrevious:q,nextDisabled:j,previousDisabled:K,hasNextLevel:!1,levelControlAriaLabel:Q,withNext:J,withPrevious:Z,headerControlsOrder:U,...T}),w.jsx(hr,{decade:n,locale:s,minDate:c,maxDate:h,yearsListFormat:a,getYearControlProps:g,__getControlRef:y,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:x,__preventFocus:D,__stopPropagation:v,withCellSpacing:S,...T})]})});pr.classes={...hr.classes,...ht.classes},pr.displayName="@mantine/dates/DecadeLevel";const ou={yearLabelFormat:"YYYY"},gr=E.factory((t,e)=>{const r=E.useProps("YearLevel",ou,t),{year:n,locale:s,minDate:c,maxDate:h,monthsListFormat:a,getMonthControlProps:g,__getControlRef:y,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:x,withCellSpacing:S,__preventFocus:D,nextIcon:O,previousIcon:L,nextLabel:I,previousLabel:z,onNext:V,onPrevious:q,onLevelClick:X,nextDisabled:re,previousDisabled:Q,hasNextLevel:J,levelControlAriaLabel:Z,withNext:U,withPrevious:W,headerControlsOrder:ae,yearLabelFormat:se,__staticSelector:k,__stopPropagation:C,size:v,classNames:d,styles:u,unstyled:m,attributes:f,...i}=r,b=dt(),T={__staticSelector:k||"YearLevel",classNames:d,styles:u,unstyled:m,size:v,attributes:f},j=typeof re=="boolean"?re:h?!de(n).endOf("year").isBefore(h):!1,K=typeof Q=="boolean"?Q:c?!de(n).startOf("year").isAfter(c):!1;return w.jsxs(E.Box,{"data-year-level":!0,size:v,ref:e,...i,children:[w.jsx(ht,{label:typeof se=="function"?se(n):de(n).locale(s||b.locale).format(se),__preventFocus:D,__stopPropagation:C,nextIcon:O,previousIcon:L,nextLabel:I,previousLabel:z,onNext:V,onPrevious:q,onLevelClick:X,nextDisabled:j,previousDisabled:K,hasNextLevel:J,levelControlAriaLabel:Z,withNext:U,withPrevious:W,headerControlsOrder:ae,...T}),w.jsx(fr,{year:n,locale:s,minDate:c,maxDate:h,monthsListFormat:a,getMonthControlProps:g,__getControlRef:y,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:x,__preventFocus:D,__stopPropagation:C,withCellSpacing:S,...T})]})});gr.classes={...ht.classes,...fr.classes},gr.displayName="@mantine/dates/YearLevel";const su={monthLabelFormat:"MMMM YYYY"},mr=E.factory((t,e)=>{const r=E.useProps("MonthLevel",su,t),{month:n,locale:s,firstDayOfWeek:c,weekdayFormat:h,weekendDays:a,getDayProps:g,excludeDate:y,minDate:_,maxDate:M,renderDay:x,hideOutsideDates:S,hideWeekdays:D,getDayAriaLabel:O,__getDayRef:L,__onDayKeyDown:I,__onDayClick:z,__onDayMouseEnter:V,withCellSpacing:q,highlightToday:X,withWeekNumbers:re,__preventFocus:Q,__stopPropagation:J,nextIcon:Z,previousIcon:U,nextLabel:W,previousLabel:ae,onNext:se,onPrevious:k,onLevelClick:C,nextDisabled:v,previousDisabled:d,hasNextLevel:u,levelControlAriaLabel:m,withNext:f,withPrevious:i,headerControlsOrder:b,monthLabelFormat:T,classNames:j,styles:K,unstyled:ee,__staticSelector:te,size:H,static:ie,attributes:oe,...ue}=r,A=dt(),N={__staticSelector:te||"MonthLevel",classNames:j,styles:K,unstyled:ee,size:H,attributes:oe},$=typeof v=="boolean"?v:M?!de(n).endOf("month").isBefore(M):!1,B=typeof d=="boolean"?d:_?!de(n).startOf("month").isAfter(_):!1;return w.jsxs(E.Box,{"data-month-level":!0,size:H,ref:e,...ue,children:[w.jsx(ht,{label:typeof T=="function"?T(n):de(n).locale(s||A.locale).format(T),__preventFocus:Q,__stopPropagation:J,nextIcon:Z,previousIcon:U,nextLabel:W,previousLabel:ae,onNext:se,onPrevious:k,onLevelClick:C,nextDisabled:$,previousDisabled:B,hasNextLevel:u,levelControlAriaLabel:m,withNext:f,withPrevious:i,headerControlsOrder:b,...N}),w.jsx(cr,{month:n,locale:s,firstDayOfWeek:c,weekdayFormat:h,weekendDays:a,getDayProps:g,excludeDate:y,minDate:_,maxDate:M,renderDay:x,hideOutsideDates:S,hideWeekdays:D,getDayAriaLabel:O,__getDayRef:L,__onDayKeyDown:I,__onDayClick:z,__onDayMouseEnter:V,__preventFocus:Q,__stopPropagation:J,static:ie,withCellSpacing:q,highlightToday:X,withWeekNumbers:re,...N})]})});mr.classes={...cr.classes,...ht.classes},mr.displayName="@mantine/dates/MonthLevel";var ds={levelsGroup:"m_30b26e33"};const ft=E.factory((t,e)=>{const r=E.useProps("LevelsGroup",null,t),{classNames:n,className:s,style:c,styles:h,unstyled:a,vars:g,__staticSelector:y,attributes:_,...M}=r,x=E.useStyles({name:y||"LevelsGroup",classes:ds,props:r,className:s,style:c,classNames:n,styles:h,unstyled:a,attributes:_,vars:g,rootSelector:"levelsGroup"});return w.jsx(E.Box,{ref:e,...x("levelsGroup"),...M})});ft.classes=ds,ft.displayName="@mantine/dates/LevelsGroup";const iu={numberOfColumns:1},yr=E.factory((t,e)=>{const r=E.useProps("DecadeLevelGroup",iu,t),{decade:n,locale:s,minDate:c,maxDate:h,yearsListFormat:a,getYearControlProps:g,__onControlClick:y,__onControlMouseEnter:_,withCellSpacing:M,__preventFocus:x,nextIcon:S,previousIcon:D,nextLabel:O,previousLabel:L,onNext:I,onPrevious:z,nextDisabled:V,previousDisabled:q,headerControlsOrder:X,classNames:re,styles:Q,unstyled:J,__staticSelector:Z,__stopPropagation:U,numberOfColumns:W,levelControlAriaLabel:ae,decadeLabelFormat:se,size:k,vars:C,attributes:v,...d}=r,u=G.useRef([]),m=Array(W).fill(0).map((f,i)=>{const b=de(n).add(i*10,"years").format("YYYY-MM-DD");return w.jsx(pr,{size:k,yearsListFormat:a,decade:b,withNext:i===W-1,withPrevious:i===0,decadeLabelFormat:se,__onControlClick:y,__onControlMouseEnter:_,__onControlKeyDown:(T,j)=>sn({levelIndex:i,rowIndex:j.rowIndex,cellIndex:j.cellIndex,event:T,controlsRef:u}),__getControlRef:(T,j,K)=>{Array.isArray(u.current[i])||(u.current[i]=[]),Array.isArray(u.current[i][T])||(u.current[i][T]=[]),u.current[i][T][j]=K},levelControlAriaLabel:typeof ae=="function"?ae(b):ae,locale:s,minDate:c,maxDate:h,__preventFocus:x,__stopPropagation:U,nextIcon:S,previousIcon:D,nextLabel:O,previousLabel:L,onNext:I,onPrevious:z,nextDisabled:V,previousDisabled:q,getYearControlProps:g,__staticSelector:Z||"DecadeLevelGroup",classNames:re,styles:Q,unstyled:J,withCellSpacing:M,headerControlsOrder:X,attributes:v},i)});return w.jsx(ft,{classNames:re,styles:Q,__staticSelector:Z||"DecadeLevelGroup",ref:e,size:k,unstyled:J,attributes:v,...d,children:m})});yr.classes={...ft.classes,...pr.classes},yr.displayName="@mantine/dates/DecadeLevelGroup";const au={numberOfColumns:1},vr=E.factory((t,e)=>{const r=E.useProps("YearLevelGroup",au,t),{year:n,locale:s,minDate:c,maxDate:h,monthsListFormat:a,getMonthControlProps:g,__onControlClick:y,__onControlMouseEnter:_,withCellSpacing:M,__preventFocus:x,nextIcon:S,previousIcon:D,nextLabel:O,previousLabel:L,onNext:I,onPrevious:z,onLevelClick:V,nextDisabled:q,previousDisabled:X,hasNextLevel:re,headerControlsOrder:Q,classNames:J,styles:Z,unstyled:U,__staticSelector:W,__stopPropagation:ae,numberOfColumns:se,levelControlAriaLabel:k,yearLabelFormat:C,size:v,vars:d,attributes:u,...m}=r,f=G.useRef([]),i=Array(se).fill(0).map((b,T)=>{const j=de(n).add(T,"years").format("YYYY-MM-DD");return w.jsx(gr,{size:v,monthsListFormat:a,year:j,withNext:T===se-1,withPrevious:T===0,yearLabelFormat:C,__stopPropagation:ae,__onControlClick:y,__onControlMouseEnter:_,__onControlKeyDown:(K,ee)=>sn({levelIndex:T,rowIndex:ee.rowIndex,cellIndex:ee.cellIndex,event:K,controlsRef:f}),__getControlRef:(K,ee,te)=>{Array.isArray(f.current[T])||(f.current[T]=[]),Array.isArray(f.current[T][K])||(f.current[T][K]=[]),f.current[T][K][ee]=te},levelControlAriaLabel:typeof k=="function"?k(j):k,locale:s,minDate:c,maxDate:h,__preventFocus:x,nextIcon:S,previousIcon:D,nextLabel:O,previousLabel:L,onNext:I,onPrevious:z,onLevelClick:V,nextDisabled:q,previousDisabled:X,hasNextLevel:re,getMonthControlProps:g,classNames:J,styles:Z,unstyled:U,__staticSelector:W||"YearLevelGroup",withCellSpacing:M,headerControlsOrder:Q,attributes:u},T)});return w.jsx(ft,{classNames:J,styles:Z,__staticSelector:W||"YearLevelGroup",ref:e,size:v,unstyled:U,attributes:u,...m,children:i})});vr.classes={...gr.classes,...ft.classes},vr.displayName="@mantine/dates/YearLevelGroup";const lu={numberOfColumns:1},br=E.factory((t,e)=>{const r=E.useProps("MonthLevelGroup",lu,t),{month:n,locale:s,firstDayOfWeek:c,weekdayFormat:h,weekendDays:a,getDayProps:g,excludeDate:y,minDate:_,maxDate:M,renderDay:x,hideOutsideDates:S,hideWeekdays:D,getDayAriaLabel:O,__onDayClick:L,__onDayMouseEnter:I,withCellSpacing:z,highlightToday:V,withWeekNumbers:q,__preventFocus:X,nextIcon:re,previousIcon:Q,nextLabel:J,previousLabel:Z,onNext:U,onPrevious:W,onLevelClick:ae,nextDisabled:se,previousDisabled:k,hasNextLevel:C,headerControlsOrder:v,classNames:d,styles:u,unstyled:m,numberOfColumns:f,levelControlAriaLabel:i,monthLabelFormat:b,__staticSelector:T,__stopPropagation:j,size:K,static:ee,vars:te,attributes:H,...ie}=r,oe=G.useRef([]),ue=Array(f).fill(0).map((A,N)=>{const $=de(n).add(N,"months").format("YYYY-MM-DD");return w.jsx(mr,{month:$,withNext:N===f-1,withPrevious:N===0,monthLabelFormat:b,__stopPropagation:j,__onDayClick:L,__onDayMouseEnter:I,__onDayKeyDown:(B,Y)=>sn({levelIndex:N,rowIndex:Y.rowIndex,cellIndex:Y.cellIndex,event:B,controlsRef:oe}),__getDayRef:(B,Y,ce)=>{Array.isArray(oe.current[N])||(oe.current[N]=[]),Array.isArray(oe.current[N][B])||(oe.current[N][B]=[]),oe.current[N][B][Y]=ce},levelControlAriaLabel:typeof i=="function"?i($):i,locale:s,firstDayOfWeek:c,weekdayFormat:h,weekendDays:a,getDayProps:g,excludeDate:y,minDate:_,maxDate:M,renderDay:x,hideOutsideDates:S,hideWeekdays:D,getDayAriaLabel:O,__preventFocus:X,nextIcon:re,previousIcon:Q,nextLabel:J,previousLabel:Z,onNext:U,onPrevious:W,onLevelClick:ae,nextDisabled:se,previousDisabled:k,hasNextLevel:C,classNames:d,styles:u,unstyled:m,__staticSelector:T||"MonthLevelGroup",size:K,static:ee,withCellSpacing:z,highlightToday:V,withWeekNumbers:q,headerControlsOrder:v,attributes:H},N)});return w.jsx(ft,{classNames:d,styles:u,__staticSelector:T||"MonthLevelGroup",ref:e,size:K,attributes:H,...ie,children:ue})});br.classes={...ft.classes,...mr.classes},br.displayName="@mantine/dates/MonthLevelGroup";const hs=t=>t==="range"?[null,null]:t==="multiple"?[]:null,fs=(t,e)=>{const r=e?Qo:qe;return Array.isArray(t)?t.map(r):r(t)};function cn({type:t,value:e,defaultValue:r,onChange:n,withTime:s=!1}){const c=G.useRef(t),[h,a,g]=Le.useUncontrolled({value:fs(e,s),defaultValue:fs(r,s),finalValue:hs(t),onChange:n});let y=h;return c.current!==t&&(c.current=t,e===void 0&&(y=r!==void 0?r:hs(t),a(y))),[y,a,g]}function dn(t,e){return t?t==="month"?0:t==="year"?1:2:e||0}function uu(t){return t===0?"month":t===1?"year":"decade"}function qt(t,e,r){return uu(Le.clamp(dn(t,0),dn(e,0),dn(r,2)))}const cu={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0,enableKeyboardNavigation:!0},wr=E.factory((t,e)=>{const r=E.useProps("Calendar",cu,t),{vars:n,maxLevel:s,minLevel:c,defaultLevel:h,level:a,onLevelChange:g,date:y,defaultDate:_,onDateChange:M,numberOfColumns:x,columnsToScroll:S,ariaLabels:D,nextLabel:O,previousLabel:L,onYearSelect:I,onMonthSelect:z,onYearMouseEnter:V,onMonthMouseEnter:q,headerControlsOrder:X,__updateDateOnYearSelect:re,__updateDateOnMonthSelect:Q,__setDateRef:J,__setLevelRef:Z,firstDayOfWeek:U,weekdayFormat:W,weekendDays:ae,getDayProps:se,excludeDate:k,renderDay:C,hideOutsideDates:v,hideWeekdays:d,getDayAriaLabel:u,monthLabelFormat:m,nextIcon:f,previousIcon:i,__onDayClick:b,__onDayMouseEnter:T,withCellSpacing:j,highlightToday:K,withWeekNumbers:ee,monthsListFormat:te,getMonthControlProps:H,yearLabelFormat:ie,yearsListFormat:oe,getYearControlProps:ue,decadeLabelFormat:A,classNames:N,styles:$,unstyled:B,minDate:Y,maxDate:ce,locale:o,__staticSelector:l,size:p,__preventFocus:P,__stopPropagation:R,onNextDecade:F,onPreviousDecade:le,onNextYear:he,onPreviousYear:pe,onNextMonth:ne,onPreviousMonth:fe,static:me,enableKeyboardNavigation:ge,attributes:Se,..._e}=r,{resolvedClassNames:Ce,resolvedStyles:ze}=E.useResolvedStylesApi({classNames:N,styles:$,props:r}),[Ee,xe]=Le.useUncontrolled({value:a?qt(a,c,s):void 0,defaultValue:h?qt(h,c,s):void 0,finalValue:qt(void 0,c,s),onChange:g}),[nt,je]=cn({type:"default",value:qe(y),defaultValue:qe(_),onChange:M});G.useImperativeHandle(J,()=>ve=>{je(ve)}),G.useImperativeHandle(Z,()=>ve=>{xe(ve)});const Ve={__staticSelector:l||"Calendar",styles:ze,classNames:Ce,unstyled:B,size:p,attributes:Se},Ye=S||x||1,et=new Date,ot=Y&&de(et).isAfter(Y)?Y:de(et).format("YYYY-MM-DD"),$e=nt||ot,pt=()=>{const ve=de($e).add(Ye,"month").format("YYYY-MM-DD");ne?.(ve),je(ve)},wt=()=>{const ve=de($e).subtract(Ye,"month").format("YYYY-MM-DD");fe?.(ve),je(ve)},He=()=>{const ve=de($e).add(Ye,"year").format("YYYY-MM-DD");he?.(ve),je(ve)},Ge=()=>{const ve=de($e).subtract(Ye,"year").format("YYYY-MM-DD");pe?.(ve),je(ve)},Qe=()=>{const ve=de($e).add(10*Ye,"year").format("YYYY-MM-DD");F?.(ve),je(ve)},st=()=>{const ve=de($e).subtract(10*Ye,"year").format("YYYY-MM-DD");le?.(ve),je(ve)},gt=G.useRef(null);G.useEffect(()=>{if(!ge||me)return;const ve=De=>{if(!gt.current?.contains(document.activeElement))return;const Fe=De.ctrlKey||De.metaKey,at=De.shiftKey;switch(De.key){case"ArrowUp":Fe&&at?(De.preventDefault(),st()):Fe&&(De.preventDefault(),Ge());break;case"ArrowDown":Fe&&at?(De.preventDefault(),Qe()):Fe&&(De.preventDefault(),He());break;case"y":case"Y":Ee==="month"&&(De.preventDefault(),xe("year"));break}};return document.addEventListener("keydown",ve),()=>{document.removeEventListener("keydown",ve)}},[ge,me,Ee,He,Ge,Qe,st]);const mt=ve=>{gt.current=ve,typeof e=="function"?e(ve):e&&(e.current=ve)};return w.jsxs(E.Box,{ref:mt,size:p,"data-calendar":!0,..._e,children:[Ee==="month"&&w.jsx(br,{month:$e,minDate:Y,maxDate:ce,firstDayOfWeek:U,weekdayFormat:W,weekendDays:ae,getDayProps:se,excludeDate:k,renderDay:C,hideOutsideDates:v,hideWeekdays:d,getDayAriaLabel:u,onNext:pt,onPrevious:wt,hasNextLevel:s!=="month",onLevelClick:()=>xe("year"),numberOfColumns:x,locale:o,levelControlAriaLabel:D?.monthLevelControl,nextLabel:D?.nextMonth??O,nextIcon:f,previousLabel:D?.previousMonth??L,previousIcon:i,monthLabelFormat:m,__onDayClick:b,__onDayMouseEnter:T,__preventFocus:P,__stopPropagation:R,static:me,withCellSpacing:j,highlightToday:K,withWeekNumbers:ee,headerControlsOrder:X,...Ve}),Ee==="year"&&w.jsx(vr,{year:$e,numberOfColumns:x,minDate:Y,maxDate:ce,monthsListFormat:te,getMonthControlProps:H,locale:o,onNext:He,onPrevious:Ge,hasNextLevel:s!=="month"&&s!=="year",onLevelClick:()=>xe("decade"),levelControlAriaLabel:D?.yearLevelControl,nextLabel:D?.nextYear??O,nextIcon:f,previousLabel:D?.previousYear??L,previousIcon:i,yearLabelFormat:ie,__onControlMouseEnter:q,__onControlClick:(ve,De)=>{Q&&je(De),xe(qt("month",c,s)),z?.(De)},__preventFocus:P,__stopPropagation:R,withCellSpacing:j,headerControlsOrder:X,...Ve}),Ee==="decade"&&w.jsx(yr,{decade:$e,minDate:Y,maxDate:ce,yearsListFormat:oe,getYearControlProps:ue,locale:o,onNext:Qe,onPrevious:st,numberOfColumns:x,nextLabel:D?.nextDecade??O,nextIcon:f,previousLabel:D?.previousDecade??L,previousIcon:i,decadeLabelFormat:A,__onControlMouseEnter:V,__onControlClick:(ve,De)=>{re&&je(De),xe(qt("year",c,s)),I?.(De)},__preventFocus:P,__stopPropagation:R,withCellSpacing:j,headerControlsOrder:X,...Ve})]})});wr.classes={...yr.classes,...vr.classes,...br.classes},wr.displayName="@mantine/dates/Calendar";function du(t){const{maxLevel:e,minLevel:r,defaultLevel:n,level:s,onLevelChange:c,nextIcon:h,previousIcon:a,date:g,defaultDate:y,onDateChange:_,numberOfColumns:M,columnsToScroll:x,ariaLabels:S,nextLabel:D,previousLabel:O,onYearSelect:L,onMonthSelect:I,onYearMouseEnter:z,onMonthMouseEnter:V,onNextMonth:q,onPreviousMonth:X,onNextYear:re,onPreviousYear:Q,onNextDecade:J,onPreviousDecade:Z,withCellSpacing:U,highlightToday:W,__updateDateOnYearSelect:ae,__updateDateOnMonthSelect:se,__setDateRef:k,__setLevelRef:C,withWeekNumbers:v,headerControlsOrder:d,firstDayOfWeek:u,weekdayFormat:m,weekendDays:f,getDayProps:i,excludeDate:b,renderDay:T,hideOutsideDates:j,hideWeekdays:K,getDayAriaLabel:ee,monthLabelFormat:te,monthsListFormat:H,getMonthControlProps:ie,yearLabelFormat:oe,yearsListFormat:ue,getYearControlProps:A,decadeLabelFormat:N,allowSingleDateInRange:$,allowDeselect:B,minDate:Y,maxDate:ce,locale:o,...l}=t;return{calendarProps:{maxLevel:e,minLevel:r,defaultLevel:n,level:s,onLevelChange:c,nextIcon:h,previousIcon:a,date:g,defaultDate:y,onDateChange:_,numberOfColumns:M,columnsToScroll:x,ariaLabels:S,nextLabel:D,previousLabel:O,onYearSelect:L,onMonthSelect:I,onYearMouseEnter:z,onMonthMouseEnter:V,onNextMonth:q,onPreviousMonth:X,onNextYear:re,onPreviousYear:Q,onNextDecade:J,onPreviousDecade:Z,withCellSpacing:U,highlightToday:W,__updateDateOnYearSelect:ae,__updateDateOnMonthSelect:se,__setDateRef:k,withWeekNumbers:v,headerControlsOrder:d,firstDayOfWeek:u,weekdayFormat:m,weekendDays:f,getDayProps:i,excludeDate:b,renderDay:T,hideOutsideDates:j,hideWeekdays:K,getDayAriaLabel:ee,monthLabelFormat:te,monthsListFormat:H,getMonthControlProps:ie,yearLabelFormat:oe,yearsListFormat:ue,getYearControlProps:A,decadeLabelFormat:N,allowSingleDateInRange:$,allowDeselect:B,minDate:Y,maxDate:ce,locale:o},others:l}}function hu(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 fu({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 pu={valueFormat:"MMMM D, YYYY",fixOnBlur:!0,size:"sm"},_r=E.factory((t,e)=>{const r=E.useInputProps("DateInput",pu,t),{inputProps:n,wrapperProps:s,value:c,defaultValue:h,onChange:a,clearable:g,clearButtonProps:y,popoverProps:_,getDayProps:M,locale:x,valueFormat:S,dateParser:D,minDate:O,maxDate:L,fixOnBlur:I,onFocus:z,onBlur:V,onClick:q,onKeyDown:X,readOnly:re,name:Q,form:J,rightSection:Z,unstyled:U,classNames:W,styles:ae,allowDeselect:se,date:k,defaultDate:C,onDateChange:v,getMonthControlProps:d,getYearControlProps:u,disabled:m,...f}=r,i=G.useRef(null),b=G.useRef(null),[T,j]=G.useState(!1),{calendarProps:K,others:ee}=du(f),te=dt(),ie=D||(ne=>{const fe=de(ne,S,te.getLocale(x)).toDate();return Number.isNaN(fe.getTime())?hu(ne):de(fe).format("YYYY-MM-DD")}),oe=se!==void 0?se:g,ue=ne=>ne?de(ne).locale(te.getLocale(x)).format(S):"",[A,N,$]=cn({type:"default",value:c,defaultValue:h,onChange:a}),[B,Y]=cn({type:"default",value:k,defaultValue:h||C,onChange:v});G.useEffect(()=>{$&&c!==null&&Y(c)},[$,c]);const[ce,o]=G.useState(ue(A));G.useEffect(()=>{o(ue(A))},[te.getLocale(x)]);const l=ne=>{const fe=ne.currentTarget.value;if(o(fe),j(!0),fe.trim()===""&&(se||g))N(null);else{const me=ie(fe);me&&fu({date:me,minDate:O,maxDate:L})&&(N(me),Y(me))}},p=ne=>{V?.(ne),j(!1),I&&o(ue(A))},P=ne=>{z?.(ne),j(!0)},R=ne=>{q?.(ne),j(!0)},F=ne=>{ne.key==="Escape"&&j(!1),X?.(ne)},le=ne=>({...M?.(ne),selected:de(A).isSame(ne,"day"),onClick:fe=>{M?.(ne).onClick?.(fe);const me=oe&&de(A).isSame(ne,"day")?null:ne;N(me),!$&&me&&o(ue(me)),j(!1)}}),he=w.jsx(E.Input.ClearButton,{onClick:()=>{N(null),!$&&o(""),j(!1)},unstyled:U,...y}),pe=g&&!!A&&!re&&!m;return Le.useDidUpdate(()=>{A!==void 0&&!T&&o(ue(A))},[A]),Le.useClickOutside(()=>j(!1),void 0,[i.current,b.current]),w.jsxs(w.Fragment,{children:[w.jsx(E.Input.Wrapper,{...s,__staticSelector:"DateInput",ref:i,children:w.jsxs(E.Popover,{opened:T,trapFocus:!1,position:"bottom-start",disabled:re||m,withRoles:!1,unstyled:U,..._,children:[w.jsx(E.Popover.Target,{children:w.jsx(E.Input,{"data-dates-input":!0,"data-read-only":re||void 0,autoComplete:"off",ref:e,value:ce,onChange:l,onBlur:p,onFocus:P,onClick:R,onKeyDown:F,readOnly:re,rightSection:Z,__clearSection:he,__clearable:pe,...n,...ee,disabled:m,__staticSelector:"DateInput"})}),w.jsx(E.Popover.Dropdown,{onMouseDown:ne=>ne.preventDefault(),"data-dates-dropdown":!0,ref:b,children:w.jsx(wr,{__staticSelector:"DateInput",...K,classNames:W,styles:ae,unstyled:U,__preventFocus:!0,minDate:O,maxDate:L,locale:x,getDayProps:le,size:n.size,date:B,onDateChange:Y,getMonthControlProps:ne=>({selected:typeof A=="string"?un(ne,A):!1,...d?.(ne)}),getYearControlProps:ne=>({selected:typeof A=="string"?de(ne).isSame(A,"year"):!1,...u?.(ne)}),attributes:s.attributes})})]})}),w.jsx(Zo,{name:Q,form:J,value:A,type:"default"})]})});_r.classes={...E.Input.classes,...wr.classes},_r.displayName="@mantine/dates/DateInput";function ps(t){const e=Ze.c(47),{fields:r,onClose:n,queryKey:s,apiPath:c,steps:h,onCreated:a}=t,[g,y]=G.useState(0),[_,M]=G.useState(!1),[x,S]=G.useState(),{mutateAsync:D,isError:O,error:L,isPending:I}=qo(c,s),{mutateAsync:z,isPending:V}=on(c,s),q=I||V;let X;e[0]!==r?(X=new Set(r.filter(bu).map(vu)),e[0]=r,e[1]=X):X=e[1];let re;e[2]!==X?(re=[...X],e[2]=X,e[3]=re):re=e[3];const Q=re;let J;e[4]!==r?(J=r.reduce(yu,{}),e[4]=r,e[5]=J):J=e[5];let Z;e[6]!==r?(Z=r.filter(mu).reduce(gu,{}),e[6]=r,e[7]=Z):Z=e[7];let U;e[8]!==J||e[9]!==Z?(U={mode:"uncontrolled",initialValues:J,validate:Z},e[8]=J,e[9]=Z,e[10]=U):U=e[10];const W=On.useForm(U);let ae;e[11]!==W||e[12]!==x?(ae=function(i){const b=W.getValues();return i.conditional&&!i.conditional(b)?null:w.jsxs(G.Fragment,{children:[(i.type===void 0||i.type=="text")&&w.jsx(E.TextInput,{label:i.column.title,placeholder:i.placeholder??"",...W.getInputProps(i.id),type:i.id.includes("email")?"email":void 0,required:i.required},W.key(i.id)),i.type==="number"&&w.jsx(E.NumberInput,{decimalSeparator:",",label:i.column.title,placeholder:i.placeholder??"",...W.getInputProps(i.id),required:i.required},W.key(i.id)),i.type==="date"&&w.jsx(_r,{label:i.column.title,placeholder:i.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...W.getInputProps(i.id),required:i.required},W.key(i.id)),i.type==="boolean"&&w.jsx(E.Checkbox,{mt:"md",label:i.column.title,...W.getInputProps(i.id,{type:"checkbox"}),required:i.required},W.key(i.id)),i.type==="textarea"&&w.jsx(E.Textarea,{label:i.column.title,placeholder:i.placeholder??"",...W.getInputProps(i.id),minRows:3,autosize:!0,required:i.required},W.key(i.id)),i.type==="custom"&&i.render&&i.render({...W.getValues(),...x&&{id:x}},W.setValues,M,{error:W.getInputProps(i.id).error,required:i.required})]},i.id)},e[11]=W,e[12]=x,e[13]=ae):ae=e[13];const se=ae;let k;e[14]!==L?.message||e[15]!==L?.name||e[16]!==O?(k=O&&w.jsx(E.Alert,{variant:"outline",color:"red",title:L?.name??"Fehler aufgetreten",mb:"lg",children:L?.message??"Fehler aufgetreten"}),e[14]=L?.message,e[15]=L?.name,e[16]=O,e[17]=k):k=e[17];let C;e[18]!==g||e[19]!==D||e[20]!==W||e[21]!==O||e[22]!==n||e[23]!==a||e[24]!==x||e[25]!==Q.length||e[26]!==z?(C=W.onSubmit(async f=>{if(x)await z({...f,id:x});else{const i=await D(f);S(i.id),a?.(i.id)}Q.length&&g<Q.length-1?O||y(g+1):O||(W.setInitialValues(f),W.reset(),n())}),e[18]=g,e[19]=D,e[20]=W,e[21]=O,e[22]=n,e[23]=a,e[24]=x,e[25]=Q.length,e[26]=z,e[27]=C):C=e[27];let v;e[28]!==g||e[29]!==r||e[30]!==se||e[31]!==h||e[32]!==Q?(v=Q.length?w.jsx(E.Stepper,{active:g,size:"sm",children:Q.map(f=>w.jsx(E.Stepper.Step,{...h&&h[f-1]?{label:h[f-1].label}:{},children:r.filter(i=>i.step===f).map(i=>se(i))},f))}):r.map(f=>se(f)),e[28]=g,e[29]=r,e[30]=se,e[31]=h,e[32]=Q,e[33]=v):v=e[33];let d;e[34]!==g||e[35]!==_||e[36]!==q||e[37]!==n||e[38]!==Q.length?(d=!_&&w.jsxs(E.Group,{mt:"md",justify:"end",children:[w.jsx(E.Button,{onClick:()=>Q.length?g===0?n():y(g-1):n(),variant:"outline",children:Q.length?g===0?"Abbrechen":"Zurück":"Abbrechen"}),w.jsx(E.Button,{type:"submit",loading:q,children:Q.length?g===Q.length-1?"Speichern":"Weiter":"Speichern"})]}),e[34]=g,e[35]=_,e[36]=q,e[37]=n,e[38]=Q.length,e[39]=d):d=e[39];let u;e[40]!==d||e[41]!==C||e[42]!==v?(u=w.jsxs("form",{onSubmit:C,children:[v,d]}),e[40]=d,e[41]=C,e[42]=v,e[43]=u):u=e[43];let m;return e[44]!==u||e[45]!==k?(m=w.jsxs(w.Fragment,{children:[k,u]}),e[44]=u,e[45]=k,e[46]=m):m=e[46],m}function gu(t,e){return t[e.id]=(r,n)=>e.conditional&&!e.conditional(n)||r?null:"Pflichtfeld",t}function mu(t){return t.required}function yu(t,e){return t[e.id]=e.type==="boolean"?!1:e.defaultValue??"",t}function vu(t){return t.step}function bu(t){return typeof t.step=="number"}var[wu,hn]=E.createSafeContext("useDataTableColumnsContext must be used within DataTableColumnProvider"),gs=t=>{let{children:e,columnsOrder:r,setColumnsOrder:n,columnsToggle:s,setColumnsToggle:c,resetColumnsOrder:h,resetColumnsToggle:a,setColumnWidth:g,setMultipleColumnWidths:y,resetColumnsWidth:_}=t,[M,x]=G.useState(""),[S,D]=G.useState("");return w.jsx(wu,{value:{sourceColumn:M,setSourceColumn:x,targetColumn:S,setTargetColumn:D,columnsToggle:s,setColumnsToggle:c,swapColumns:()=>{if(!r||!n||!M||!S)return;let O=r.indexOf(M),L=r.indexOf(S);if(O!==-1&&L!==-1){let I=r.splice(O,1)[0];r.splice(L,0,I),n([...r])}},resetColumnsOrder:h,resetColumnsToggle:a,setColumnWidth:g,setMultipleColumnWidths:y,resetColumnsWidth:_},children:e})};function _u(){return w.jsx("tr",{className:"mantine-datatable-empty-row",children:w.jsx("td",{})})}function Cu(){return w.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.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"}),w.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"}),w.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"}),w.jsx("path",{d:"M3 3l18 18"})]})}function xu({icon:t,text:e,active:r,children:n}){return w.jsx(E.Center,{className:"mantine-datatable-empty-state","data-active":r||void 0,children:n||w.jsxs(w.Fragment,{children:[t||w.jsx("div",{className:"mantine-datatable-empty-state-icon",children:w.jsx(Cu,{})}),w.jsx(E.Text,{component:"div",size:"sm",c:"dimmed",children:e})]})})}function Su({key:t,columns:e=[],getInitialValueInEffect:r=!0}){function n(M,x){let S=[];return M.forEach(D=>{x.find(O=>O.accessor===D)&&S.push(D)}),x.forEach(D=>{S.includes(D.accessor)||S.push(D.accessor)}),S}let s=e&&e.map(M=>M.accessor)||[],[c,h]=Le.useLocalStorage({key:t?`${t}-columns-order`:"",defaultValue:t?s:void 0,getInitialValueInEffect:r});function a(M){t&&h(M)}let g=()=>{a(s)};if(!t)return{columnsOrder:c,setColumnsOrder:a,resetColumnsOrder:g};let y=n(c,e),_=JSON.stringify(c);return JSON.stringify(y)!==_&&a(y),{columnsOrder:y,setColumnsOrder:a,resetColumnsOrder:g}}function Du({key:t,columns:e=[],getInitialValueInEffect:r=!0,headerRef:n,onFixedLayoutChange:s}){let c=G.useRef(!1),h=G.useRef({}),[a,g]=G.useState(!0),y=G.useMemo(()=>e.some(Z=>Z.resizable&&!Z.hidden&&Z.accessor!=="__selection__"),[e]),_=G.useMemo(()=>e.filter(Z=>Z.resizable&&!Z.hidden&&Z.accessor!=="__selection__"),[e]),M=G.useMemo(()=>_.some(Z=>Z.width===void 0||Z.width===""||Z.width==="initial"),[_]),x=G.useCallback(()=>e.filter(Z=>Z.accessor!=="__selection__").map(Z=>({[Z.accessor]:Z.width??"auto"})),[e]),[S,D]=Le.useLocalStorage({key:t?`${t}-columns-width`:"",defaultValue:t?x():void 0,getInitialValueInEffect:!1}),[O,L]=G.useState(()=>x());G.useEffect(()=>{g(!1)},[]);let I=G.useCallback(()=>{if(!n?.current||a)return{};let Z=n.current,U=Array.from(Z.querySelectorAll("th[data-accessor]")),W={};return U.forEach(ae=>{let se=ae.getAttribute("data-accessor");if(!se||se==="__selection__")return;let k=_.find(C=>C.accessor===se);if(k&&(k.width===void 0||k.width===""||k.width==="initial")){let C=ae.getBoundingClientRect();W[se]=Math.round(C.width)}}),W},[n,_,a]),z=G.useCallback(Z=>{let U=Z.filter(ae=>ae.accessor!=="__selection__"),W=O.map(ae=>{let se=Object.keys(ae)[0],k=U.find(C=>C.accessor===se);return k?{[se]:k.width}:ae});L(W),t&&D(W)},[O,t,D]),V=G.useCallback(Z=>{z(Z)},[z]),q=G.useCallback(()=>{if(!(!n?.current||!s||a))if(M)s(!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{let Z=I();h.current={...h.current,...Z};let U=e.filter(W=>W.accessor!=="__selection__").map(W=>{let ae=W.accessor,se=S?.find(C=>Object.keys(C)[0]===ae);if(se&&se[ae]!=="auto")return{[ae]:se[ae]};let k=Z[ae];return k?{[ae]:`${k}px`}:{[ae]:W.width??"auto"}});L(U),setTimeout(()=>{s(!0),c.current=!0},10)})});else{let Z=e.filter(U=>U.accessor!=="__selection__").map(U=>({[U.accessor]:U.width??"auto"}));L(Z),s(!0),c.current=!0}},[n,s,a,M,I,e,S]),X=q;G.useEffect(()=>{if(!y||!s||a){s?.(!1);return}c.current=!1;let Z=setTimeout(()=>{q()},50);return()=>clearTimeout(Z)},[y,s,a,q]),G.useEffect(()=>{a||!t||!r||S&&S.length>0&&L(S)},[a,t,r,S]);let re=G.useCallback(()=>{t&&D(x()),h.current={},c.current=!1,s&&(s(!1),setTimeout(()=>{q()},10))},[t,D,x,s,q]),Q=G.useCallback((Z,U)=>{z([{accessor:Z,width:U}])},[z]),J=G.useMemo(()=>y?O.filter(Z=>{let U=Object.keys(Z)[0];return _.some(W=>W.accessor===U)}).every(Z=>{let U=Object.values(Z)[0];return U==="auto"||U==="initial"}):!1,[y,O,_]);return{columnsWidth:O,setColumnsWidth:z,setColumnWidth:Q,setMultipleColumnWidths:V,resetColumnsWidth:re,hasResizableColumns:y,allResizableWidthsInitial:J,measureAndSetColumnWidths:X}}function ku({key:t,columns:e=[],getInitialValueInEffect:r=!0}){function n(M,x){let S=[];return M.forEach(D=>{x.find(O=>O.accessor===D.accessor)&&S.push(D)}),x.forEach(D=>{S.find(O=>O.accessor===D.accessor)||S.push({accessor:D.accessor,defaultToggle:D.defaultToggle||!0,toggleable:D.toggleable,toggled:D.defaultToggle===void 0?!0:D.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})),[c,h]=Le.useLocalStorage({key:t?`${t}-columns-toggle`:"",defaultValue:t?s:void 0,getInitialValueInEffect:r});function a(M){t&&h(M)}let g=()=>{a(s)};if(!t)return{columnsToggle:c,setColumnsToggle:a,resetColumnsToggle:g};let y=n(c,e),_=JSON.stringify(c);return JSON.stringify(y)!==_&&a(y),{columnsToggle:y,setColumnsToggle:a,resetColumnsToggle:g}}var Pu=({key:t,columns:e=[],getInitialValueInEffect:r=!0,headerRef:n,scrollViewportRef:s,onFixedLayoutChange:c})=>{let{columnsOrder:h,setColumnsOrder:a,resetColumnsOrder:g}=Su({key:t,columns:e,getInitialValueInEffect:r}),{columnsToggle:y,setColumnsToggle:_,resetColumnsToggle:M}=ku({key:t,columns:e,getInitialValueInEffect:r}),{columnsWidth:x,setColumnsWidth:S,setColumnWidth:D,setMultipleColumnWidths:O,resetColumnsWidth:L,hasResizableColumns:I,allResizableWidthsInitial:z,measureAndSetColumnWidths:V}=Du({key:t,columns:e,getInitialValueInEffect:r,headerRef:n,onFixedLayoutChange:c});return{effectiveColumns:G.useMemo(()=>h?h.map(q=>e.find(X=>X.accessor===q)).map(q=>({...q,hidden:q?.hidden||!y.find(X=>X.accessor===q?.accessor)?.toggled})).map(q=>q?.accessor==="__selection__"?q:{...q,width:x.find(X=>X[q?.accessor])?.[q?.accessor]}):e,[e,h,y,x]),setColumnsOrder:a,columnsOrder:h,resetColumnsOrder:g,columnsToggle:y,setColumnsToggle:_,resetColumnsToggle:M,columnsWidth:x,setColumnsWidth:S,setColumnWidth:D,setMultipleColumnWidths:O,resetColumnsWidth:L,hasResizableColumns:I,allResizableWidthsInitial:z,measureAndSetColumnWidths:V}},ms=typeof window<"u"?G.useLayoutEffect:G.useEffect;function ys(t){let e=G.useRef(t);return e.current=t,e}var vs="--mantine-datatable-header-height",bs="--mantine-datatable-footer-height",ws="--mantine-datatable-selection-column-width",_s="--mantine-datatable-last-row-border-bottom";function Xe(t,e,r){t?.style.setProperty(e,r)}function fn(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 pn(t,e,r){if(t){let n=new ResizeObserver(s=>{let c=s[0];c&&e(fn(c))});return n.observe(t),()=>{n.disconnect(),r()}}}function Mu({scrollCallbacks:t,withRowBorders:e}){let r={root:G.useRef(null),table:G.useRef(null),scrollViewport:G.useRef(null),header:G.useRef(null),footer:G.useRef(null),selectionColumnHeader:G.useRef(null)},{root:n,table:s,scrollViewport:c,header:h,footer:a,selectionColumnHeader:g}=r,y=ys({withRowBorders:e}),_=ys(t),M=G.useRef(()=>{}),x=G.useRef(()=>{}),S=G.useCallback(D=>{_.current.onScroll?.(D),M.current()},[]);return G.useEffect(()=>pn(h.current,D=>{Xe(n.current,vs,`${D.height}px`)},()=>Xe(n.current,vs,"0")),[h.current]),G.useEffect(()=>pn(a.current,D=>{Xe(n.current,bs,`${D.height}px`)},()=>Xe(n.current,bs,"0")),[a.current]),G.useEffect(()=>pn(g.current,D=>{Xe(n.current,ws,`${D.width}px`)},()=>Xe(n.current,ws,"0")),[g.current]),ms(()=>{if(typeof window===void 0)return;let D={top:!0,bottom:!0,left:!0,right:!0},O={width:0,height:0},L={width:0,height:0};function I(re,Q){let J=D[re];return D[re]=Q,Xe(n.current,`--mantine-datatable-${re}-shadow-opacity`,Q?"0":"1"),J}function z(){let re=O.height-L.height,Q=re<0;Xe(n.current,"--mantine-datatable-footer-position",Q?"relative":"sticky"),Xe(n.current,"--mantine-datatable-footer-bottom",Q?`${re}px`:"0")}function V(){y.current.withRowBorders&&O.height<L.height?Xe(n.current,_s,`${E.rem("1px")} solid var(--mantine-datatable-border-color)`):Xe(n.current,_s,"unset")}x.current=V;function q(){let re=_.current,Q=c.current,J=Q?.scrollTop??0,Z=Q?.scrollLeft??0,U=J===0,W=O.height-J-L.height<1,ae=I("top",U),se=I("bottom",W);U&&U!==ae&&re.onScrollToTop?.(),W&&W!==se&&re.onScrollToBottom?.();let k=Q?getComputedStyle(Q).direction==="rtl":!1,C=(Q?.scrollWidth??0)-L.width,v,d;if(k){let f=Math.abs(Z);d=f<1,v=C-f<1}else v=Z<1,d=O.width-Z-L.width<1;let u=I("left",v),m=I("right",d);v&&v!==u&&re.onScrollToLeft?.(),d&&d!==m&&re.onScrollToRight?.()}M.current=q;let X=new ResizeObserver(re=>{for(let Q of re)switch(Q.target.tagName){case"TABLE":{O=fn(Q);break}case"DIV":{L=fn(Q);break}}q(),z(),V()});return X.observe(s.current),X.observe(c.current),()=>{X.disconnect()}},[]),ms(()=>{x.current()},[e]),{refs:r,onScroll:S}}function Ou(t){let[e,r]=G.useState(null),n=t?.join(":")||"";return G.useEffect(()=>{r(null)},[n]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:r}}function Au(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 Eu(t,e){return e||(typeof window<"u"&&"matchMedia"in window?t.map(r=>window.matchMedia(r).matches):t.map(()=>!1))}function Tu(t,e,{getInitialValueInEffect:r}={getInitialValueInEffect:!0}){let[n,s]=G.useState(r?e:Eu(t,e)),c=G.useRef(null);return G.useEffect(()=>{if("matchMedia"in window)return c.current=t.map(h=>window.matchMedia(h)),s(c.current.map(h=>h.matches)),Au(c.current,h=>{s(h)})},[t]),n}function ju(t){let e=E.useMantineTheme(),r=G.useMemo(()=>t.map(s=>(typeof s=="function"?s(e):s)??""),[t,e]),n=G.useMemo(()=>t.map(()=>!0),[t]);return Tu(r,n)}function Cr(t){let e=E.useMantineTheme(),r=typeof t=="function"?t(e):t;return Le.useMediaQuery(r||"",!0)}function gn(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 $u(t,e,r){return t.filter(n=>!e.map(r).includes(r(n)))}function mn(t,e){return t.filter((r,n,s)=>n===s.findIndex(c=>e(r)===e(c)))}function Cs(t,e){return e?e.match(/([^[.\]])+/g).reduce((r,n)=>r&&r[n],t):void 0}function Ie(t,e){return typeof e=="string"?Cs(t,e):e(t)}function xs(t){return!t||t.length===0?0:Math.max(...t.map(e=>e.groups&&e.groups.length>0?1+xs(e.groups):1))}function yn(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(...yn(r.groups));return e.filter(r=>r!=null)}function vn(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+vn(n,e),0):0}function Ss(t,e,r=0){if(r===e)return[...t];let n=[];for(let s of t)s.groups&&s.groups.length>0&&n.push(...Ss(s.groups,e,r+1));return n}function Ru(t,e,r){return r?!t||e:!1}function Nu({rowExpansion:t,records:e,idAccessor:r}){let n=[];if(t&&e){let{trigger:a,allowMultiple:g,initiallyExpanded:y}=t;e&&a==="always"?n=e.map(_=>Ie(_,r)):y&&(n=e.filter((_,M)=>y({record:_,index:M})).map(_=>Ie(_,r)),g||(n=[n[0]]))}let s,c,h=G.useState(n);if(t){let{expandable:a,trigger:g,allowMultiple:y,collapseProps:_,content:M}=t;t.expanded?{recordIds:s,onRecordIdsChange:c}=t.expanded:[s,c]=h;let x=S=>c?.(s.filter(D=>D!==Ie(S,r)));return{expandOnClick:g!=="always"&&g!=="never",isRowExpanded:S=>g==="always"?!0:s.includes(Ie(S,r)),isExpandable:({record:S,index:D})=>a?a({record:S,index:D}):!0,expandRow:S=>{let D=Ie(S,r);c?.(y?[...s,D]:[D])},collapseRow:x,collapseProps:_,content:({record:S,index:D})=>()=>M({record:S,index:D,collapse:()=>x(S)})}}}function Lu(t,e){let[r,n]=G.useState(t),[s,c]=G.useState(t),h=Le.useTimeout(()=>n(!0),0),a=Le.useTimeout(()=>c(!1),e||200);return G.useEffect(()=>{t?(a.clear(),c(!0),h.start()):(h.clear(),n(!1),a.start())},[h,a,t]),{expanded:r,visible:s}}var bn="mantine-datatable-nowrap",wn="mantine-datatable-ellipsis",Mt="mantine-datatable-pointer-cursor",Ds="mantine-datatable-context-menu-cursor",Bu="mantine-datatable-text-selection-disabled",xr="mantine-datatable-text-align-left",Sr="mantine-datatable-text-align-center",Dr="mantine-datatable-text-align-right";function Iu({className:t,style:e,visibleMediaQuery:r,title:n,noWrap:s,ellipsis:c,textAlign:h,width:a}){return Cr(r)?w.jsx(E.TableTh,{className:Pe({[bn]:s||c,[wn]:c,[xr]:h==="left",[Sr]:h==="center",[Dr]:h==="right"},t),style:[{width:a,minWidth:a,maxWidth:a},e],children:n}):null}function Yu({shadowVisible:t}){return w.jsx(E.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":t||void 0})}function zu({className:t,style:e,columns:r,defaultColumnProps:n,selectionVisible:s,selectorCellShadowVisible:c,ref:h}){return w.jsx(E.TableTfoot,{ref:h,className:Pe("mantine-datatable-footer",t),style:e,children:w.jsxs(E.TableTr,{children:[s&&w.jsx(Yu,{shadowVisible:c}),r.map(({hidden:a,...g})=>{if(a)return null;let{accessor:y,visibleMediaQuery:_,textAlign:M,width:x,footer:S,footerClassName:D,footerStyle:O,noWrap:L,ellipsis:I}={...n,...g};return w.jsx(Iu,{className:D,style:O,visibleMediaQuery:_,textAlign:M,width:x,title:S,noWrap:L,ellipsis:I},y)})]})})}function Fu({group:{id:t,columns:e,groups:r,title:n,textAlign:s,className:c,style:h},maxDepth:a,currentDepth:g,previousGroups:y,isLastGroup:_,withColumnBorders:M=!1,totalTableColumns:x}){let S=G.useMemo(()=>e&&e.length>0?e:r&&r.length>0?yn([{id:t,columns:e,groups:r}]):[],[e,r,t]),D=G.useMemo(()=>S.map(({visibleMediaQuery:X})=>X),[S]),O=ju(D),L=G.useMemo(()=>vn({columns:e,groups:r},O),[t,e,r,O]),I=G.useMemo(()=>y.reduce((X,re)=>X+vn(re,O),0),[y,O]),z=r&&r.length>0?1:a-g,V=I+L<x,q=Ru(_,V,M);return L>0?w.jsx(E.TableTh,{colSpan:L,rowSpan:z>1?z:void 0,className:Pe("mantine-datatable-column-group-header-cell",{[xr]:s==="left",[Sr]:s==="center",[Dr]:s==="right","mantine-datatable-column-group-header-cell--needs-border":q},c),style:h,children:n??gn(t)}):null}function Wu(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.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 Uu(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.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:c,toggle:h}]=Le.useDisclosure(!1),a=e?Uu:Wu,g=Le.useClickOutside(c);return n&&(g=void 0),w.jsxs(E.Popover,{withArrow:!0,shadow:"md",opened:s,onClose:c,trapFocus:!0,...r,children:[w.jsx(E.PopoverTarget,{children:w.jsx(E.ActionIcon,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":e||void 0,size:"sm",variant:"default",onClick:y=>{y.preventDefault(),h()},onKeyDown:y=>y.stopPropagation(),children:w.jsx(a,{})})}),w.jsx(E.PopoverDropdown,{ref:g,onClick:y=>y.stopPropagation(),onKeyDown:y=>y.stopPropagation(),children:typeof t=="function"?t({close:c}):t})]})}var Vu=t=>{let{accessor:e,columnRef:r}=t,[n,s]=G.useState(!1),c=G.useRef(0),h=G.useRef({current:0,next:0}),{dir:a}=E.useDirection(),g=a==="rtl",{setMultipleColumnWidths:y}=hn(),_=G.useCallback(x=>{if(x.preventDefault(),x.stopPropagation(),!r.current)return;let S=r.current,D=S.nextElementSibling;for(;D;){let X=D.getAttribute("data-accessor");if(X&&X!=="__selection__")break;D=D.nextElementSibling}if(!D)return;let O=D.getAttribute("data-accessor");if(!O)return;let L=O==="__selection__";s(!0),c.current=x.clientX;let I=S.offsetWidth,z=D.offsetWidth;h.current={current:I,next:z};let V=X=>{if(!r.current)return;let re=r.current,Q=re.nextElementSibling;if(!Q)return;let J=X.clientX-c.current;g&&(J=-J);let Z=50,U=h.current.current-Z,W=h.current.next-Z,ae=Math.max(-U,Math.min(J,W)),se=h.current.current+ae,k=h.current.next-ae;re.style.width=`${se}px`,Q.style.width=`${k}px`,re.style.minWidth=`${se}px`,re.style.maxWidth=`${se}px`,Q.style.minWidth=`${k}px`,Q.style.maxWidth=`${k}px`},q=()=>{if(!r.current)return;let X=r.current,re=X.nextElementSibling;s(!1),document.body.style.cursor="initial",document.body.style.userSelect="initial";let Q=parseInt(X.style.width)||X.offsetWidth,J=re?parseInt(re.style.width)||re.offsetWidth:0,Z=[{accessor:e,width:`${Q}px`}];if(re&&!L){let U=re.getAttribute("data-accessor");U&&Z.push({accessor:U,width:`${J}px`})}setTimeout(()=>{y(Z)},0),document.removeEventListener("mousemove",V),document.removeEventListener("mouseup",q)};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",V),document.addEventListener("mouseup",q)},[e,r,g,y]),M=G.useCallback(()=>{if(!r.current)return;let x=r.current,S=x.nextElementSibling;x.style.width="",x.style.minWidth="",x.style.maxWidth="";let D=[{accessor:e,width:"auto"}];if(S){S.style.width="",S.style.minWidth="",S.style.maxWidth="";let O=S.getAttribute("data-accessor");O&&O!=="__selection__"&&D.push({accessor:O,width:"auto"})}setTimeout(()=>{y(D)},0)},[e,r,y]);return w.jsx("div",{className:"mantine-datatable-header-resizable-handle",style:{cursor:n?"col-resize":void 0},onMouseDown:_,onDoubleClick:M,onClick:x=>x.stopPropagation(),title:"Drag to resize column, double-click to reset"})};function Hu(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.jsx("path",{d:"M12 5l0 14"}),w.jsx("path",{d:"M16 9l-4 -4"}),w.jsx("path",{d:"M8 9l4 -4"})]})}function Gu(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.jsx("path",{d:"M8 7l4 -4l4 4"}),w.jsx("path",{d:"M8 17l4 4l4 -4"}),w.jsx("path",{d:"M12 3l0 18"})]})}function Qu(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.jsx("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),w.jsx("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),w.jsx("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),w.jsx("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),w.jsx("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),w.jsx("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]})}function Zu(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.jsx("path",{d:"M18 6l-12 12"}),w.jsx("path",{d:"M6 6l12 12"})]})}function Ku({className:t,style:e,accessor:r,visibleMediaQuery:n,title:s,sortable:c,draggable:h,toggleable:a,resizable:g,sortIcons:y,textAlign:_,width:M,sortStatus:x,onSortStatusChange:S,filter:D,filterPopoverProps:O,filterPopoverDisableClickOutside:L,filtering:I,sortKey:z}){let{setSourceColumn:V,setTargetColumn:q,swapColumns:X,setColumnsToggle:re}=hn(),[Q,J]=G.useState(!1),Z=G.useRef(null);if(!Cr(n))return null;let U=s??gn(r),W=typeof U=="string"?U:void 0,ae=c&&S?m=>{m?.defaultPrevented||S({sortKey:z,columnAccessor:r,direction:x?.columnAccessor===r?x.direction==="asc"?"desc":"asc":x?.direction??"asc"})}:void 0,se=m=>{m.stopPropagation(),V(r),J(!1)},k=m=>{m.preventDefault(),q(r),J(!0)},C=()=>{q(r),J(!1),X()},v=()=>{J(!0)},d=()=>{J(!1)},u=m=>{m.stopPropagation(),re(f=>f.map(i=>i.accessor===r?{...i,toggled:!1}:i))};return w.jsxs(E.TableTh,{"data-accessor":r,className:Pe({"mantine-datatable-header-cell-sortable":c,"mantine-datatable-header-cell-toggleable":a,"mantine-datatable-header-cell-resizable":g},t),style:[{width:M,...g?{}:{minWidth:M,maxWidth:M}},e],role:c?"button":void 0,tabIndex:c?0:void 0,onClick:ae,onKeyDown:m=>m.key==="Enter"&&ae?.(),ref:Z,children:[w.jsxs(E.Group,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[w.jsxs(E.Flex,{align:"center",w:"100%",className:Pe({"mantine-datatable-header-cell-draggable":h,"mantine-datatable-header-cell-drag-over":Q}),draggable:h,onDragStart:h?se:void 0,onDragEnter:h?v:void 0,onDragOver:h?k:void 0,onDrop:h?C:void 0,onDragLeave:h?d:void 0,children:[h?w.jsx(E.Center,{role:"img","aria-label":"Drag column",children:w.jsx(E.ActionIcon,{className:"mantine-datatable-header-cell-draggable-action-icon",variant:"subtle",size:"xs",onClick:m=>{m.stopPropagation()},children:w.jsx(Qu,{})})}):null,w.jsx(E.Box,{className:Pe("mantine-datatable-header-cell-sortable-text",{[xr]:_==="left",[Sr]:_==="center",[Dr]:_==="right"},bn,wn),title:W,children:U})]}),a?w.jsx(E.Center,{className:"mantine-datatable-header-cell-toggleable-icon",role:"img","aria-label":"Toggle column",children:w.jsx(E.ActionIcon,{size:"xs",variant:"light",onClick:u,children:w.jsx(Zu,{})})}):null,c||x?.columnAccessor===r?w.jsx(w.Fragment,{children:x?.columnAccessor===r?w.jsx(E.Center,{className:Pe("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":x.direction==="desc"}),role:"img","aria-label":`Sorted ${x.direction==="desc"?"descending":"ascending"}`,children:y?.sorted||w.jsx(Hu,{})}):w.jsx(E.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:y?.unsorted||w.jsx(Gu,{})})}):null,D?w.jsx(qu,{filterPopoverProps:O,isActive:!!I,filterPopoverDisableClickOutside:L,children:D}):null]}),g&&r!=="__selection__"?w.jsx(Vu,{accessor:r,columnRef:Z}):null]})}function Ju({className:t,style:e,trigger:r,shadowVisible:n,checked:s,indeterminate:c,checkboxProps:h,onChange:a,rowSpan:g,ref:y}){let _=!h.disabled;return w.jsx(E.TableTh,{ref:y,className:Pe("mantine-datatable-header-selector-cell",{[Mt]:r==="cell"&&_},t),style:e,rowSpan:g,"data-shadow-visible":n||void 0,"data-accessor":"__selection__",onClick:r==="cell"&&_?a:void 0,children:w.jsx(E.Checkbox,{classNames:_?{input:Mt}:void 0,checked:s,indeterminate:c,onChange:a,...h,disabled:!(a||h.onChange)||h.disabled})})}function Xu({selectionColumnHeaderRef:t,className:e,style:r,sortStatus:n,sortIcons:s,onSortStatusChange:c,columns:h,defaultColumnProps:a,groups:g,selectionTrigger:y,selectionVisible:_,selectionChecked:M,selectionIndeterminate:x,onSelectionChange:S,selectionCheckboxProps:D,selectorCellShadowVisible:O,selectionColumnClassName:L,selectionColumnStyle:I,withColumnBorders:z=!1,ref:V}){let q=g?xs(g):0,X=q>0?q+1:1,re=_?w.jsx(Ju,{ref:t,className:L,style:I,trigger:y,shadowVisible:O,checked:M,indeterminate:x,checkboxProps:D,onChange:S,rowSpan:g?X:void 0}):null,{columnsToggle:Q,setColumnsToggle:J}=hn(),[Z,U]=G.useState(!1),W=h.some(k=>k.toggleable),ae=W?Object.fromEntries(h.map(({accessor:k,title:C})=>[k,C??gn(String(k))])):void 0,se=w.jsxs(E.TableThead,{className:Pe("mantine-datatable-header",e),style:r,ref:V,onContextMenu:W?k=>{k.preventDefault(),U(C=>!C)}:void 0,children:[g&&Array.from({length:q},(k,C)=>{let v=Ss(g,C);return w.jsxs(E.TableTr,{children:[C===0&&re,v.map((d,u)=>w.jsx(Fu,{group:d,maxDepth:q,currentDepth:C,previousGroups:v.slice(0,u),isLastGroup:u===v.length-1,withColumnBorders:z,totalTableColumns:h.length},d.id))]},`group-depth-${C}`)}),w.jsxs(E.TableTr,{children:[!g&&re,h.map(({hidden:k,...C},v)=>{if(k)return null;let{accessor:d,visibleMediaQuery:u,textAlign:m,width:f,title:i,sortable:b,draggable:T,toggleable:j,resizable:K,titleClassName:ee,titleStyle:te,filter:H,filterPopoverProps:ie,filterPopoverDisableClickOutside:oe,filtering:ue,sortKey:A}={...a,...C};return w.jsx(Ku,{accessor:d,className:ee,style:te,visibleMediaQuery:u,textAlign:m,width:f,title:i,sortable:b,draggable:T,toggleable:j,resizable:K&&v<h.length-1,sortStatus:n,sortIcons:s,sortKey:A,onSortStatusChange:c,filter:H,filterPopoverProps:ie,filterPopoverDisableClickOutside:oe,filtering:ue},d)})]})]});return W?w.jsxs(E.Popover,{position:"bottom",withArrow:!0,shadow:"md",opened:Z,onChange:U,children:[w.jsx(E.PopoverTarget,{children:se}),w.jsx(E.PopoverDropdown,{children:w.jsx(E.Stack,{children:Q.filter(k=>k.toggleable).map(k=>w.jsx(E.Group,{children:w.jsx(E.Checkbox,{classNames:{label:"mantine-datatable-header-column-toggle-checkbox-label"},size:"xs",label:ae[k.accessor],checked:k.toggled,onChange:C=>{J(Q.map(v=>v.accessor===k.accessor?{...v,toggled:C.currentTarget.checked}:v))}})},k.accessor))})})]}):se}function ec({fetching:t,customContent:e,backgroundBlur:r,size:n,type:s,color:c}){return w.jsx(E.Center,{className:Pe("mantine-datatable-loader",{"mantine-datatable-loader-fetching":t}),style:[{backdropFilter:r?`blur(${r}px)`:void 0}],children:t&&(e||w.jsx(E.Loader,{size:n,type:s,color:c}))})}function Ae(t,e,r){return t?E.parseThemeColor({color:typeof t=="object"?t[r]:t,theme:e}).value:void 0}function tc({theme:t,c:e,backgroundColor:r,borderColor:n,rowBorderColor:s,stripedColor:c,highlightOnHoverColor:h}){return{"--mantine-datatable-color-light":Ae(e,t,"light"),"--mantine-datatable-color-dark":Ae(e,t,"dark"),"--mantine-datatable-background-color-light":Ae(r,t,"light"),"--mantine-datatable-background-color-dark":Ae(r,t,"dark"),"--mantine-datatable-border-color-light":Ae(n,t,"light"),"--mantine-datatable-border-color-dark":Ae(n,t,"dark"),"--mantine-datatable-row-border-color-light":Ae(s,t,"light"),"--mantine-datatable-row-border-color-dark":Ae(s,t,"dark"),"--mantine-datatable-striped-color-light":Ae(c,t,"light"),"--mantine-datatable-striped-color-dark":Ae(c,t,"dark"),"--mantine-datatable-highlight-on-hover-color-light":Ae(h,t,"light"),"--mantine-datatable-highlight-on-hover-color-dark":Ae(h,t,"dark")}}function ks({theme:t,paginationActiveTextColor:e,paginationActiveBackgroundColor:r}){return{"--mantine-datatable-pagination-active-text-color-light":Ae(e,t,"light"),"--mantine-datatable-pagination-active-text-color-dark":Ae(e,t,"dark"),"--mantine-datatable-pagination-active-background-color-light":Ae(r,t,"light"),"--mantine-datatable-pagination-active-background-color-dark":Ae(r,t,"dark")}}function rc({theme:t,color:e,backgroundColor:r}){return{"--mantine-datatable-row-color-light":Ae(e,t,"light"),"--mantine-datatable-row-color-dark":Ae(e,t,"dark"),"--mantine-datatable-row-background-color-light":Ae(r,t,"light"),"--mantine-datatable-row-background-color-dark":Ae(r,t,"dark")}}function nc(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.jsx("path",{d:"M8 9l4 -4l4 4"}),w.jsx("path",{d:"M16 15l-4 4l-4 -4"})]})}var Ps={xs:E.rem(22),sm:E.rem(26),md:E.rem(32),lg:E.rem(38),xl:E.rem(44)};function oc({size:t,label:e,values:r,value:n,activeTextColor:s,activeBackgroundColor:c,onChange:h}){return w.jsxs(E.Group,{gap:"xs",children:[w.jsx(E.Text,{component:"div",size:t,children:e}),w.jsxs(E.Menu,{withinPortal:!0,withArrow:!0,offset:2,classNames:{arrow:"mantine-datatable-page-size-selector-menu-arrow"},children:[w.jsx(E.MenuTarget,{children:w.jsx(E.Button,{size:t,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:w.jsx(nc,{}),style:[{fontWeight:"normal"},a=>({height:Ps[t],paddingLeft:a.spacing[t],paddingRight:a.spacing[t]})],children:n})}),w.jsx(E.MenuDropdown,{children:r.map(a=>{let g=a===n;return w.jsx(E.MenuItem,{className:Pe({"mantine-datatable-page-size-selector-active":g}),style:[{height:Ps[t]},g&&(s||c)?y=>ks({theme:y,paginationActiveTextColor:s,paginationActiveBackgroundColor:c}):void 0],disabled:g,onClick:()=>h(a),children:w.jsx(E.Text,{component:"div",size:t,children:a})},a)})})]})]})}function sc({className:t,style:e,fetching:r,page:n,onPageChange:s,paginationWithEdges:c,paginationWithControls:h,paginationActiveTextColor:a,paginationActiveBackgroundColor:g,paginationSize:y,loadingText:_,noRecordsText:M,paginationText:x,totalRecords:S,recordsPerPage:D,onRecordsPerPageChange:O,recordsPerPageLabel:L,recordsPerPageOptions:I,recordsLength:z,horizontalSpacing:V,paginationWrapBreakpoint:q,getPaginationControlProps:X,getPaginationItemProps:re,renderPagination:Q}){let J;if(S){let C=(n-1)*D+1,v=C+(z||0)-1;J=x({from:C,to:v,totalRecords:S})}else J=r?_:M;let Z=S&&D?Math.max(1,Math.ceil(S/D)):1,U=S?(n-1)*(D??0)+1:void 0,W=S?(U??1)+(z??0)-1:void 0,ae=!Cr(({breakpoints:C})=>`(min-width: ${typeof q=="number"?`${E.rem(q)}rem`:C[q]||q})`),se={Text:C=>w.jsx(E.Text,{component:"div",className:"mantine-datatable-pagination-text",size:y,...C,children:J}),PageSizeSelector:C=>I?w.jsx(oc,{activeTextColor:a,activeBackgroundColor:g,size:y,label:L,values:I,value:D,onChange:O,...C}):w.jsx(w.Fragment,{}),Pagination:C=>w.jsx(E.Pagination,{classNames:{root:Pe("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":r||!z}),control:"mantine-datatable-pagination-pages-control"},style:a||g?v=>ks({theme:v,paginationActiveTextColor:a,paginationActiveBackgroundColor:g}):void 0,withEdges:c,withControls:h,value:n,onChange:s,size:y,total:Z,getControlProps:X,getItemProps:re,...C})},k={state:{paginationSize:y,page:n,totalPages:Z,totalRecords:S,recordsPerPage:D,recordsLength:z,fetching:r,from:U,to:W,isWrapped:ae},actions:{setPage:C=>s?.(C),setRecordsPerPage:O?C=>O(C):void 0},Controls:se};return w.jsx(E.Box,{px:V??"xs",py:"xs",className:Pe("mantine-datatable-pagination",t),style:[{flexDirection:ae?"column":"row"},e],children:typeof Q=="function"?Q(k):w.jsxs(w.Fragment,{children:[w.jsx(se.Text,{}),w.jsx(se.PageSizeSelector,{}),w.jsx(se.Pagination,{})]})})}function ic({className:t,style:e,visibleMediaQuery:r,record:n,index:s,onClick:c,onDoubleClick:h,onContextMenu:a,noWrap:g,ellipsis:y,textAlign:_,width:M,accessor:x,render:S,defaultRender:D,customCellAttributes:O}){return Cr(r)?w.jsx(E.TableTd,{className:Pe({[bn]:g||y,[wn]:y,[Mt]:c||h,[Ds]:a,[xr]:_==="left",[Sr]:_==="center",[Dr]:_==="right"},t),style:[{width:M,minWidth:M,maxWidth:M},e],onClick:c,onDoubleClick:h,onContextMenu:a,...O?.(n,s),children:S?S(n,s):D?D(n,s,x):Cs(n,x)}):null}function ac({open:t,colSpan:e,content:r,collapseProps:n}){let{expanded:s,visible:c}=Lu(t,n?.transitionDuration);return c?w.jsxs(w.Fragment,{children:[w.jsx(E.TableTr,{}),w.jsx(E.TableTr,{children:w.jsx(E.TableTd,{className:"mantine-datatable-row-expansion-cell",colSpan:e,children:w.jsx(E.Collapse,{in:s,...n,children:w.jsx("div",{className:"mantine-datatable-row-expansion-cell-content",children:r()})})})})]}):null}function lc({className:t,style:e,record:r,index:n,trigger:s,onChange:c,withRightShadow:h,checkboxProps:a,getCheckboxProps:g,...y}){let _={...a,...g(r,n)},M=!y.disabled&&!_.disabled,x=S=>{S.stopPropagation(),s==="cell"&&M&&c?.(S)};return w.jsx(E.TableTd,{className:Pe("mantine-datatable-row-selector-cell",{[Mt]:s==="cell"&&M},t),style:e,"data-shadow-visible":h||void 0,onClick:x,children:w.jsx(E.Checkbox,{classNames:M?{input:Mt}:void 0,onChange:c,...y,..._})})}function uc({record:t,index:e,columns:r,defaultColumnProps:n,defaultColumnRender:s,selectionTrigger:c,selectionVisible:h,selectionChecked:a,onSelectionChange:g,isRecordSelectable:y,selectionCheckboxProps:_,getSelectionCheckboxProps:M,onClick:x,onDoubleClick:S,onContextMenu:D,onCellClick:O,onCellDoubleClick:L,onCellContextMenu:I,expansion:z,customAttributes:V,color:q,backgroundColor:X,className:re,style:Q,selectorCellShadowVisible:J,selectionColumnClassName:Z,selectionColumnStyle:U,rowFactory:W}){let ae=w.jsxs(w.Fragment,{children:[h&&w.jsx(lc,{className:Z,style:U,record:t,index:e,trigger:c,withRightShadow:J,checked:a,disabled:!g||(y?!y(t,e):!1),onChange:g,checkboxProps:_,getCheckboxProps:M}),r.map(({hidden:C,hiddenContent:v,...d},u)=>{if(C||v)return null;let{accessor:m,visibleMediaQuery:f,textAlign:i,noWrap:b,ellipsis:T,width:j,render:K,cellsClassName:ee,cellsStyle:te,customCellAttributes:H}={...n,...d};return w.jsx(ic,{className:typeof ee=="function"?ee(t,e):ee,style:te?.(t,e),visibleMediaQuery:f,record:t,index:e,onClick:O?ie=>O({event:ie,record:t,index:e,column:d,columnIndex:u}):void 0,onDoubleClick:L?ie=>L({event:ie,record:t,index:e,column:d,columnIndex:u}):void 0,onContextMenu:I?ie=>I({event:ie,record:t,index:e,column:d,columnIndex:u}):void 0,accessor:m,textAlign:i,noWrap:b,ellipsis:T,width:j,render:K,defaultRender:s,customCellAttributes:H},m)})]}),se=z&&w.jsx(ac,{colSpan:r.filter(({hidden:C})=>!C).length+(h?1:0),open:z.isRowExpanded(t),content:z.content({record:t,index:e}),collapseProps:z.collapseProps}),k=cc({record:t,index:e,selectionChecked:a,onClick:x,onDoubleClick:S,onContextMenu:D,expansion:z,customAttributes:V,color:q,backgroundColor:X,className:re,style:Q});return W?W({record:t,index:e,rowProps:k,children:ae,expandedElement:se}):w.jsxs(w.Fragment,{children:[w.jsx(E.TableTr,{...k,children:ae}),se]})}function cc({record:t,index:e,selectionChecked:r,onClick:n,onDoubleClick:s,onContextMenu:c,expansion:h,customAttributes:a,color:g,backgroundColor:y,className:_,style:M}){return{className:Pe("mantine-datatable-row",{[Mt]:n||s||h?.isExpandable({record:t,index:e})&&h?.expandOnClick},{[Ds]:c},typeof _=="function"?_(t,e):_),"data-selected":r||void 0,onClick:x=>{if(h){let{isExpandable:S,isRowExpanded:D,expandOnClick:O,expandRow:L,collapseRow:I}=h;S({record:t,index:e})&&O&&(D(t)?I(t):L(t))}n?.({event:x,record:t,index:e})},onDoubleClick:s?x=>s({event:x,record:t,index:e}):void 0,onContextMenu:c?x=>c({event:x,record:t,index:e}):void 0,style:[g||y?x=>{let S=g?.(t,e),D=y?.(t,e);return rc({theme:x,color:S,backgroundColor:D})}:void 0,M?.(t,e)],...a?.(t,e)??{}}}function dc({leftShadowBehind:t,rightShadowBehind:e,onScrollPositionChange:r,children:n,viewportRef:s,scrollAreaProps:c}){return w.jsxs(E.ScrollArea,{...c,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,w.jsx(E.Box,{className:Pe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow")}),w.jsx("div",{className:Pe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-behind":t})}),w.jsx("div",{className:Pe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-behind":e})}),w.jsx(E.Box,{className:Pe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow")})]})}function hc({withTableBorder:t,borderRadius:e,textSelectionDisabled:r,height:n="100%",minHeight:s,maxHeight:c,shadow:h,verticalAlign:a="center",fetching:g,columns:y,storeColumnsKey:_,groups:M,pinFirstColumn:x,pinLastColumn:S,defaultColumnProps:D,defaultColumnRender:O,idAccessor:L="id",records:I,selectionTrigger:z="checkbox",selectedRecords:V,onSelectedRecordsChange:q,selectionColumnClassName:X,selectionColumnStyle:re,isRecordSelectable:Q,selectionCheckboxProps:J,allRecordsSelectionCheckboxProps:Z={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:U=(rt,Vt)=>({"aria-label":`Select record ${Vt+1}`}),sortStatus:W,sortIcons:ae,onSortStatusChange:se,horizontalSpacing:k,page:C,onPageChange:v,totalRecords:d,recordsPerPage:u,onRecordsPerPageChange:m,recordsPerPageOptions:f,recordsPerPageLabel:i="Records per page",paginationWithEdges:b,paginationWithControls:T,paginationActiveTextColor:j,paginationActiveBackgroundColor:K,paginationSize:ee="sm",paginationText:te=({from:rt,to:Vt,totalRecords:Cn})=>`${rt} - ${Vt} / ${Cn}`,paginationWrapBreakpoint:H="sm",getPaginationControlProps:ie=rt=>rt==="previous"?{"aria-label":"Previous page"}:rt==="next"?{"aria-label":"Next page"}:{},getPaginationItemProps:oe,renderPagination:ue,loaderBackgroundBlur:A,customLoader:N,loaderSize:$,loaderType:B,loaderColor:Y,loadingText:ce="...",emptyState:o,noRecordsText:l="No records",noRecordsIcon:p,highlightOnHover:P,striped:R,noHeader:F,onRowClick:le,onRowDoubleClick:he,onRowContextMenu:pe,onCellClick:ne,onCellDoubleClick:fe,onCellContextMenu:me,onScroll:ge,onScrollToTop:Se,onScrollToBottom:_e,onScrollToLeft:Ce,onScrollToRight:ze,c:Ee,backgroundColor:xe,borderColor:nt,rowBorderColor:je,stripedColor:Ve,highlightOnHoverColor:Ye,rowColor:et,rowBackgroundColor:ot,rowExpansion:$e,rowClassName:pt,rowStyle:wt,customRowAttributes:He,scrollViewportRef:Ge,scrollAreaProps:Qe,tableRef:st,bodyRef:gt,m:mt,my:ve,mx:De,mt:Fe,mb:at,ml:Me,mr:Oe,className:_t,classNames:Te,style:ke,styles:Ne,rowFactory:tt,tableWrapper:yt,..._n}){let rt=G.useMemo(()=>M?yn(M):y,[y,M]),[Vt,Cn]=G.useState(!1),{refs:it,onScroll:jc}=Mu({scrollCallbacks:{onScroll:ge,onScrollToTop:Se,onScrollToBottom:_e,onScrollToLeft:Ce,onScrollToRight:ze},withRowBorders:_n.withRowBorders}),xn=Pu({key:_,columns:rt,headerRef:it.header,scrollViewportRef:it.scrollViewport,onFixedLayoutChange:Cn}),$c=Le.useMergedRef(it.table,st),Rc=Le.useMergedRef(it.scrollViewport,Ge),Nc=Nu({rowExpansion:$e,records:I,idAccessor:L}),kr=G.useRef(!1),$s=G.useRef(C),Sn=G.useRef(I),Lc=G.useCallback(be=>{kr.current=!0,Sn.current=I,v(be)},[v,I]);G.useEffect(()=>{$s.current!==C&&(kr.current=!0,Sn.current=I,$s.current=C)},[C,I]);let Pr=I?.length;G.useLayoutEffect(()=>{if(!kr.current||g||I===Sn.current)return;let be=it.scrollViewport.current;if(!be)return;let Ct=requestAnimationFrame(()=>{be.scrollTo({top:0,left:0}),kr.current=!1});return()=>cancelAnimationFrame(Ct)},[g,I,it.scrollViewport]);let Rs=I?.map(be=>Ie(be,L)),Ot=!!V,Ht=V?.map(be=>Ie(be,L)),Ns=Rs!==void 0&&Ht!==void 0&&Ht.length>0,Dn=Q?I?.filter(Q):I,Mr=Dn?.map(be=>Ie(be,L)),Or=Ns&&Mr.every(be=>Ht.includes(be)),Bc=Ns&&Mr.some(be=>Ht.includes(be)),Ic=G.useCallback(()=>{V&&q&&q(Or?V.filter(be=>!Mr.includes(Ie(be,L))):mn([...V,...Dn],be=>Ie(be,L)))},[Or,L,q,Mr,Dn,V]),{lastSelectionChangeIndex:Ar,setLastSelectionChangeIndex:Yc}=Ou(Rs),kn=Ot&&!x,zc={m:mt,my:ve,mx:De,mt:Fe,mb:at,ml:Me,mr:Oe},Fc=G.useCallback(({children:be})=>yt?yt({children:be}):be,[yt]);return w.jsx(gs,{...xn,children:w.jsxs(E.Box,{ref:it.root,...zc,className:Pe("mantine-datatable",{"mantine-datatable-with-border":t},_t,Te?.root),style:[be=>({...tc({theme:be,c:Ee,backgroundColor:xe,borderColor:nt,rowBorderColor:je,stripedColor:Ve,highlightOnHoverColor:Ye}),borderRadius:be.radius[e]||e,boxShadow:be.shadows[h]||h,height:n,minHeight:s,maxHeight:c}),ke,Ne?.root,{position:"relative"}],children:[w.jsx(dc,{viewportRef:Rc,leftShadowBehind:Ot||!!x,rightShadowBehind:S,onScrollPositionChange:jc,scrollAreaProps:Qe,children:w.jsx(Fc,{children:w.jsxs(E.Table,{ref:$c,horizontalSpacing:k,className:Pe("mantine-datatable-table",{[Bu]:r,"mantine-datatable-vertical-align-top":a==="top","mantine-datatable-vertical-align-bottom":a==="bottom","mantine-datatable-pin-last-column":S,"mantine-datatable-selection-column-visible":Ot,"mantine-datatable-pin-first-column":x,"mantine-datatable-resizable-columns":xn.hasResizableColumns&&Vt},Te?.table),style:{...Ne?.table},"data-striped":Pr&&R||void 0,"data-highlight-on-hover":P||void 0,..._n,children:[F?null:w.jsx(gs,{...xn,children:w.jsx(Xu,{ref:it.header,selectionColumnHeaderRef:it.selectionColumnHeader,className:Te?.header,style:Ne?.header,columns:rt,defaultColumnProps:D,groups:M,sortStatus:W,sortIcons:ae,onSortStatusChange:se,selectionTrigger:z,selectionVisible:Ot,selectionChecked:Or,selectionIndeterminate:Bc&&!Or,onSelectionChange:Ic,selectionCheckboxProps:{...J,...Z},selectorCellShadowVisible:kn,selectionColumnClassName:X,selectionColumnStyle:re,withColumnBorders:_n.withColumnBorders})}),w.jsx("tbody",{ref:gt,children:Pr?I.map((be,Ct)=>{let Pn=Ie(be,L),Mn=Ht?.includes(Pn)||!1,Ls;return q&&V&&(Ls=Wc=>{if(Wc.nativeEvent.shiftKey&&Ar!==null){let At=I.filter(Ct>Ar?(xt,St)=>St>=Ar&&St<=Ct&&(Q?Q(xt,St):!0):(xt,St)=>St>=Ct&&St<=Ar&&(Q?Q(xt,St):!0));q(Mn?$u(V,At,xt=>Ie(xt,L)):mn([...V,...At],xt=>Ie(xt,L)))}else q(Mn?V.filter(At=>Ie(At,L)!==Pn):mn([...V,be],At=>Ie(At,L)));Yc(Ct)}),w.jsx(uc,{record:be,index:Ct,columns:rt,defaultColumnProps:D,defaultColumnRender:O,selectionTrigger:z,selectionVisible:Ot,selectionChecked:Mn,onSelectionChange:Ls,isRecordSelectable:Q,selectionCheckboxProps:J,getSelectionCheckboxProps:U,onClick:le,onDoubleClick:he,onCellClick:ne,onCellDoubleClick:fe,onContextMenu:pe,onCellContextMenu:me,expansion:Nc,color:et,backgroundColor:ot,className:pt,style:wt,customAttributes:He,selectorCellShadowVisible:kn,selectionColumnClassName:X,selectionColumnStyle:re,idAccessor:L,rowFactory:tt},Pn)}):w.jsx(_u,{})}),rt.some(({footer:be})=>be)&&w.jsx(zu,{ref:it.footer,className:Te?.footer,style:Ne?.footer,columns:rt,defaultColumnProps:D,selectionVisible:Ot,selectorCellShadowVisible:kn})]})})}),C&&w.jsx(sc,{className:Te?.pagination,style:Ne?.pagination,horizontalSpacing:k,fetching:g,page:C,onPageChange:Lc,totalRecords:d,recordsPerPage:u,onRecordsPerPageChange:m,recordsPerPageOptions:f,recordsPerPageLabel:i,paginationWithEdges:b,paginationWithControls:T,paginationActiveTextColor:j,paginationActiveBackgroundColor:K,paginationSize:ee,paginationText:te,paginationWrapBreakpoint:H,getPaginationControlProps:ie,getPaginationItemProps:oe,noRecordsText:l,loadingText:ce,recordsLength:Pr,renderPagination:ue}),w.jsx(ec,{fetching:g,backgroundBlur:A,customContent:N,size:$,type:B,color:Y}),w.jsx(xu,{icon:p,text:l,active:!g&&!Pr,children:o})]})})}function Ms(t){const e=Ze.c(41),{fields:r,onClose:n,queryKey:s,apiPath:c,id:h,steps:a}=t,[g,y]=G.useState(0),[_,M]=G.useState(!1),{data:x,isLoading:S}=Wo(c,s,h),{mutateAsync:D,isError:O,error:L,isPending:I}=on(c,s);let z;e[0]!==r?(z=new Set(r.filter(vc).map(yc)),e[0]=r,e[1]=z):z=e[1];let V;e[2]!==z?(V=[...z],e[2]=z,e[3]=V):V=e[3];const q=V;let X;e[4]!==r?(X=r.reduce(mc,{}),e[4]=r,e[5]=X):X=e[5];let re;e[6]!==r?(re=r.filter(gc).reduce(pc,{}),e[6]=r,e[7]=re):re=e[7];let Q;e[8]!==X||e[9]!==re?(Q={mode:"uncontrolled",initialValues:X,validate:re},e[8]=X,e[9]=re,e[10]=Q):Q=e[10];const J=On.useForm(Q);let Z;e[11]!==x||e[12]!==r||e[13]!==J?(Z=()=>{if(x){const v={...x};r.forEach(d=>{const u=d.id;d.type==="boolean"&&v[u]===null?v[u]=!1:d.type==="date"&&v[u]?v[u]=new Date(v[u]):v[u]===null&&(v[u]="")}),J.initialize(v),J.setValues(v)}},e[11]=x,e[12]=r,e[13]=J,e[14]=Z):Z=e[14];let U;e[15]!==x?(U=[x],e[15]=x,e[16]=U):U=e[16],G.useEffect(Z,U);let W;e[17]!==J||e[18]!==h?(W=function(d){const u=J.getValues();return d.conditional&&!d.conditional(u)?null:w.jsxs(G.Fragment,{children:[(d.type===void 0||d.type=="text")&&w.jsx(E.TextInput,{label:d.column.title,placeholder:d.placeholder??"",...J.getInputProps(d.id),type:d.id.includes("email")?"email":void 0,required:d.required},J.key(d.id)),d.type==="number"&&w.jsx(E.NumberInput,{decimalSeparator:",",label:d.column.title,placeholder:d.placeholder??"",...J.getInputProps(d.id),required:d.required},J.key(d.id)),d.type==="date"&&w.jsx(_r,{label:d.column.title,placeholder:d.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...J.getInputProps(d.id),required:d.required},J.key(d.id)),d.type==="boolean"&&w.jsx(E.Checkbox,{mt:"md",label:d.column.title,...J.getInputProps(d.id,{type:"checkbox"}),required:d.required},J.key(d.id)),d.type==="textarea"&&w.jsx(E.Textarea,{label:d.column.title,placeholder:d.placeholder??"",...J.getInputProps(d.id),minRows:3,autosize:!0,required:d.required},J.key(d.id)),d.type==="custom"&&d.render&&d.render({...J.getValues(),id:h},J.setValues,M,{error:J.getInputProps(d.id).error,required:d.required})]},d.id)},e[17]=J,e[18]=h,e[19]=W):W=e[19];const ae=W;let se;e[20]!==O||e[21]!==L?.message||e[22]!==L?.name?(se=O&&w.jsx(E.Alert,{variant:"outline",color:"red",title:L?.name??"Fehler aufgetreten",mb:"lg",children:L?.message??"Fehler aufgetreten"}),e[20]=O,e[21]=L?.message,e[22]=L?.name,e[23]=se):se=e[23];let k;e[24]!==g||e[25]!==r||e[26]!==J||e[27]!==_||e[28]!==h||e[29]!==S||e[30]!==I||e[31]!==O||e[32]!==n||e[33]!==ae||e[34]!==a||e[35]!==q||e[36]!==D?(k=S?w.jsxs(E.Stack,{gap:"md",children:[w.jsx(E.Skeleton,{height:40}),Array(r.length).fill(0).map(fc),w.jsxs(E.Group,{mt:"md",justify:"end",children:[w.jsx(E.Skeleton,{width:100,height:36}),w.jsx(E.Skeleton,{width:100,height:36})]})]}):w.jsxs("form",{onSubmit:J.onSubmit(async v=>{await D({...v,id:h}),q.length&&g<q.length-1?O||y(g+1):O||(J.setInitialValues(v),J.reset(),n())}),children:[q.length?w.jsx(E.Stepper,{active:g,size:"sm",children:q.map(v=>w.jsx(E.Stepper.Step,{...a&&a[v-1]?{label:a[v-1].label}:{},children:r.filter(d=>d.step===v).map(d=>ae(d))},v))}):r.map(v=>ae(v)),!_&&w.jsxs(E.Group,{mt:"md",justify:"end",children:[w.jsx(E.Button,{onClick:()=>q.length?g===0?n():y(g-1):n(),variant:"outline",children:q.length?g===0?"Abbrechen":"Zurück":"Abbrechen"}),w.jsx(E.Button,{type:"submit",loading:I,children:q.length?g===q.length-1?"Speichern":"Weiter":"Speichern"})]})]}),e[24]=g,e[25]=r,e[26]=J,e[27]=_,e[28]=h,e[29]=S,e[30]=I,e[31]=O,e[32]=n,e[33]=ae,e[34]=a,e[35]=q,e[36]=D,e[37]=k):k=e[37];let C;return e[38]!==k||e[39]!==se?(C=w.jsxs(w.Fragment,{children:[se,k]}),e[38]=k,e[39]=se,e[40]=C):C=e[40],C}function fc(t,e){return w.jsx(E.Skeleton,{height:35},`skeleton-field-${e}`)}function pc(t,e){return t[e.id]=(r,n)=>e.conditional&&!e.conditional(n)||r?null:"Pflichtfeld",t}function gc(t){return t.required}function mc(t,e){return t[e.id]=e.type==="boolean"?e.defaultValue??!1:e.defaultValue??"",t}function yc(t){return t.step}function vc(t){return typeof t.step=="number"}function Os({queryKey:t,apiPath:e,onClose:r,selectedRecords:n}){const{mutateAsync:s,isError:c,error:h,isPending:a}=Vo(e,t),[g,y]=G.useState(n),[_,M]=G.useState(!1),x=_||a;return G.useEffect(()=>{g.length||r()},[r,g]),g.length?w.jsxs(w.Fragment,{children:[c&&h.message&&w.jsx(E.Alert,{variant:"outline",color:"red",title:h.name,children:h.message}),w.jsx(E.Text,{children:g.length===1?`Soll ${g.length} Eintrag wirklich gelöscht werden?`:`Sollen ${g.length} Einträge wirklich gelöscht werden?`}),w.jsxs(E.Group,{mt:"md",justify:"end",children:[w.jsx(E.Button,{onClick:r,variant:"outline",disabled:x,children:"Abbrechen"}),w.jsx(E.Button,{color:"red",loading:x,onClick:async()=>{M(!0);try{await Promise.all(g.map(S=>s(S.id))),y([])}finally{M(!1)}},children:"Löschen"})]})]}):w.jsx(w.Fragment,{})}function As(t,e){const r=Ze.c(8);let n;r[0]!==t||r[1]!==e?(n=()=>{const y=localStorage.getItem(`use_persistent_storage_${e}`);return y?JSON.parse(y):t},r[0]=t,r[1]=e,r[2]=n):n=r[2];const[s,c]=G.useState(n);let h;r[3]!==e?(h=y=>{c(y),localStorage.setItem(`use_persistent_storage_${e}`,JSON.stringify(y))},r[3]=e,r[4]=h):h=r[4];const a=h;let g;return r[5]!==a||r[6]!==s?(g=[s,a],r[5]=a,r[6]=s,r[7]=g):g=r[7],g}const bc=(t,e)=>{const r=t.map(g=>g[e]).filter(g=>g!=null&&g!=="");if(r.length===0)return"string";const n=Math.min(100,r.length),s=r.slice(0,n),c={string:0,number:0,date:0},h=[/^\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(g=>{if(typeof g=="number")c.number++;else if(typeof g=="string"){const y=g.trim();if(y!==""&&!isNaN(Number(y))&&!isNaN(parseFloat(y))){c.number++;return}if(h.some(_=>_.test(y))){const _=new Date(y);if(!isNaN(_.getTime())){c.date++;return}}c.string++}else g instanceof Date?c.date++:c.string++});const a=c.string+c.number+c.date;return c.date/a>=.6?"date":c.number/a>=.6?"number":c.string/a>=.6?"string":"mixed"},Es=new Map,Ts=(t,e,r="asc")=>{if(!t||t.length===0)return[];const n=`${String(e)}_${t.length}`;let s=Es.get(n);return s||(s=bc(t,e),Es.set(n,s)),[...t].sort((h,a)=>{const g=h[e],y=a[e],_=g==null||g==="",M=y==null||y==="";if(_&&M)return 0;if(_)return r==="asc"?-1:1;if(M)return r==="asc"?1:-1;let x,S;switch(s){case"date":if(typeof g=="string"){const z=new Date(g.trim());x=isNaN(z.getTime())?null:z.getTime()}else g instanceof Date?x=g.getTime():x=null;if(typeof y=="string"){const z=new Date(y.trim());S=isNaN(z.getTime())?null:z.getTime()}else y instanceof Date?S=y.getTime():S=null;break;case"number":if(typeof g=="number")x=g;else{const z=String(g).trim(),V=parseFloat(z);x=isNaN(V)?null:V}if(typeof y=="number")S=y;else{const z=String(y).trim(),V=parseFloat(z);S=isNaN(V)?null:V}break;case"string":const D=typeof g=="string"?g:String(g),O=typeof y=="string"?y:String(y);x=D.toLowerCase().trim(),S=O.toLowerCase().trim();break;case"mixed":default:const L=String(g),I=String(y);x=L.toLowerCase().trim(),S=I.toLowerCase().trim();break}return x===null&&S===null?0:x===null?r==="asc"?1:-1:S===null||x<S?r==="asc"?-1:1:x>S?r==="asc"?1:-1:0})},js=[10,15,20,50,100,500];function wc(t){const e=Ze.c(113),{title:r,queryKey:n,connectedQueryKeys:s,apiPath:c,buttons:h,fields:a,selection:g,pagination:y,filters:_,actions:M,steps:x,defaultSort:S,onSortChange:D,createButtonText:O,queryParams:L,tabs:I,defaultTab:z,activeTab:V,onActiveTabChange:q,canUpdate:X,canDelete:re,rowExpansion:Q}=t,[J,Z]=G.useState(z||(I&&I.length>0?I[0].value:null)),U=V!==void 0?V:J;let W;e[0]!==V||e[1]!==q?(W=Me=>{V===void 0&&Z(Me),q&&q(Me)},e[0]=V,e[1]=q,e[2]=W):W=e[2];const ae=W,se=I?.find(Me=>Me.value===U)?.queryParams||{},k={...L,...se},C=k?"?"+Object.entries(k).filter(Ec).map(Ac).join("&"):"";let v;e[3]!==U||e[4]!==n?(v=U?[...n,U]:n,e[3]=U,e[4]=n,e[5]=v):v=e[5];const d=v,{data:u,isLoading:m,isError:f,isRefetching:i,refetch:b}=Uo(c+C,d),{queryClient:T}=ct();let j,K;e[6]!==u||e[7]!==s||e[8]!==T?(j=()=>{!u||!Array.isArray(u)||s?.forEach(Me=>T.invalidateQueries({queryKey:Me}))},K=[u,s,T],e[6]=u,e[7]=s,e[8]=T,e[9]=j,e[10]=K):(j=e[9],K=e[10]),G.useEffect(j,K);const ee=!u||!Array.isArray(u)?[]:!_||_.length===0?u:u.filter(Me=>_.every(Oe=>{if(Oe.value===void 0)return!0;const _t=Oe.id;if(Oe.type==="query"){const Te=Me[_t];return Array.isArray(Oe.value)?Array.isArray(Te)?Te.some(ke=>{if(typeof ke=="string"||typeof ke=="number")return Oe.value.includes(String(ke));if(ke&&typeof ke=="object"){if("id"in ke&&Oe.value.includes(ke.id))return!0;for(const Ne in ke){const tt=ke[Ne];if(typeof tt=="string"&&Oe.value.includes(tt)||tt&&typeof tt=="object"&&"id"in tt&&Oe.value.includes(tt.id))return!0}}return!1}):Te&&typeof Te=="object"&&"id"in Te?Oe.value.includes(Te.id):!1:typeof Te=="string"&&Te.includes(Oe.value)}else if(Oe.type==="date"){const Te=Oe.value;if(!Te)return!0;const[ke,Ne]=Te;if(!ke&&!Ne)return!0;const tt=Me[_t];if(typeof tt=="string"){const yt=tt.split(" ")[0];if(ke&&Ne)return yt>=ke&&yt<=Ne;if(ke&&!Ne)return yt>=ke;if(!ke&&Ne)return yt<=Ne}return!0}else if(Oe.type==="boolean")return Me[_t]===Oe.value;return!0})),te=S?.field??a[0].id,H=S?.direction??"desc";let ie;e[11]!==te||e[12]!==H?(ie={columnAccessor:te,direction:H},e[11]=te,e[12]=H,e[13]=ie):ie=e[13];const[oe,ue]=G.useState(ie);let A;e[14]!==D?(A=Me=>{ue(Me),D&&D(String(Me.columnAccessor),Me.direction)},e[14]=D,e[15]=A):A=e[15];const N=A,$=Ts(ee,oe.columnAccessor,oe.direction),[B,Y]=As(js[1],"mantine-table-page-size"),[ce,o]=G.useState(1),l=y?$.slice((ce-1)*B,ce*B):$;let p;e[16]===Symbol.for("react.memo_cache_sentinel")?(p=[],e[16]=p):p=e[16];const[P,R]=G.useState(p);let F;e[17]===Symbol.for("react.memo_cache_sentinel")?(F=()=>{R([])},e[17]=F):F=e[17];let le;e[18]!==U?(le=[U],e[18]=U,e[19]=le):le=e[19],G.useEffect(F,le);const[he,pe]=G.useState(!1),[ne,fe]=G.useState(!1),[me,ge]=G.useState(!1),Se=r?"space-between":"end";let _e;e[20]!==r?(_e=r&&(typeof r=="string"?w.jsx(E.Title,{order:4,children:r}):r),e[20]=r,e[21]=_e):_e=e[21];let Ce;e[22]!==b?(Ce=()=>b(),e[22]=b,e[23]=Ce):Ce=e[23];let ze;e[24]===Symbol.for("react.memo_cache_sentinel")?(ze=w.jsx(Et.IconRefresh,{}),e[24]=ze):ze=e[24];let Ee;e[25]!==Ce?(Ee=w.jsx(E.ActionIcon,{variant:"subtle",onClick:Ce,"aria-label":"Neuladen",children:ze}),e[25]=Ce,e[26]=Ee):Ee=e[26];let xe;e[27]!==M||e[28]!==re||e[29]!==X||e[30]!==a||e[31]!==P||e[32]!==g?(xe=(a.some(Oc)||g)&&(()=>{const Me=a.find(Mc)&&(!X||P.length>0&&X(P[0])),Oe=a.find(Pc)&&(!re||P.length>0&&re(P[0])),_t=(M??[]).length>0,Te=Me||Oe||_t;return w.jsxs(E.Menu,{shadow:"md",children:[w.jsx(E.Menu.Target,{children:w.jsx(E.Button,{variant:"outline",rightSection:w.jsx(Et.IconCaretDownFilled,{size:14}),disabled:!P.length||!Te,children:"Aktionen"})}),w.jsxs(E.Menu.Dropdown,{children:[Me&&w.jsx(E.Menu.Item,{leftSection:w.jsx(Et.IconPencil,{size:14}),onClick:()=>fe(!0),disabled:P.length!==1,children:"Bearbeiten"}),(M??[]).map((ke,Ne)=>G.createElement(E.Menu.Item,{...ke.icon&&{leftSection:ke.icon},key:`custom_action_${Ne}`,onClick:()=>ke.onClick(P)},ke.label)),Oe&&w.jsx(E.Menu.Item,{leftSection:w.jsx(Et.IconTrash,{size:14}),onClick:()=>ge(!0),color:"red",children:"Löschen"})]})]})})(),e[27]=M,e[28]=re,e[29]=X,e[30]=a,e[31]=P,e[32]=g,e[33]=xe):xe=e[33];let nt;e[34]!==O||e[35]!==a||e[36]!==m?(nt=a.find(kc)&&w.jsx(E.Button,{onClick:()=>pe(!0),disabled:m,children:O??"Erstellen"}),e[34]=O,e[35]=a,e[36]=m,e[37]=nt):nt=e[37];let je;e[38]!==h||e[39]!==Ee||e[40]!==xe||e[41]!==nt?(je=w.jsxs(E.Group,{align:"center",gap:"xs",children:[Ee,xe,nt,h]}),e[38]=h,e[39]=Ee,e[40]=xe,e[41]=nt,e[42]=je):je=e[42];let Ve;e[43]!==Se||e[44]!==_e||e[45]!==je?(Ve=w.jsxs(E.Group,{gap:"xs",justify:Se,align:"center",children:[_e,je]}),e[43]=Se,e[44]=_e,e[45]=je,e[46]=Ve):Ve=e[46];let Ye;e[47]!==U||e[48]!==ae||e[49]!==I?(Ye=I&&I.length>0&&w.jsx(E.Tabs,{value:U,onChange:ae,mt:"md",children:w.jsx(E.Tabs.List,{children:I.map(Dc)})}),e[47]=U,e[48]=ae,e[49]=I,e[50]=Ye):Ye=e[50];let et;e[51]!==f?(et=f&&w.jsx(E.Alert,{mt:"md",variant:"light",color:"red",title:"Es ist ein Fehler aufgetreten.",icon:w.jsx(Et.IconInfoCircle,{}),children:"Bitte versuche es später erneut oder sende eine Nachricht an unseren Support."}),e[51]=f,e[52]=et):et=e[52];let ot;e[53]!==m||e[54]!==i?(ot=(m||i)&&w.jsxs(E.Stack,{my:"md",children:[w.jsx(E.Skeleton,{height:40}),Array(5).fill(0).map(Sc)]}),e[53]=m,e[54]=i,e[55]=ot):ot=e[55];let $e;e[56]!==a||e[57]!==N||e[58]!==f||e[59]!==m||e[60]!==i||e[61]!==ce||e[62]!==B||e[63]!==y||e[64]!==l||e[65]!==Q||e[66]!==P||e[67]!==g||e[68]!==o||e[69]!==Y||e[70]!==oe||e[71]!==$?($e=!m&&!i&&w.jsx(hc,{my:"md",striped:!0,minHeight:150,fetching:f,records:l,sortStatus:oe,onSortStatusChange:N,...g&&{selectedRecords:P,onSelectedRecordsChange:R},...y&&l.length&&{totalRecords:$.length,recordsPerPage:B,onPageChange:o,page:ce,recordsPerPageOptions:js,onRecordsPerPageChange:Y,recordsPerPageLabel:"Einträge pro Seite"},...Q&&{rowExpansion:{allowMultiple:Q.allowMultiple??!1,content:Me=>{const{record:Oe}=Me;return Q.content(Oe)},...Q.expanded&&{expanded:Q.expanded}}},columns:a.map(xc),noRecordsText:"Keine Einträge gefunden"}),e[56]=a,e[57]=N,e[58]=f,e[59]=m,e[60]=i,e[61]=ce,e[62]=B,e[63]=y,e[64]=l,e[65]=Q,e[66]=P,e[67]=g,e[68]=o,e[69]=Y,e[70]=oe,e[71]=$,e[72]=$e):$e=e[72];let pt;e[73]===Symbol.for("react.memo_cache_sentinel")?(pt=()=>{fe(!1),R([])},e[73]=pt):pt=e[73];const wt=r??"Bearbeiten";let He;e[74]!==c||e[75]!==a||e[76]!==n||e[77]!==P[0]||e[78]!==P.length||e[79]!==x?(He=P.length>0&&w.jsx(Ms,{fields:a.filter(Cc),queryKey:n,apiPath:c,id:P[0].id,onClose:()=>{fe(!1),R([])},steps:x}),e[74]=c,e[75]=a,e[76]=n,e[77]=P[0],e[78]=P.length,e[79]=x,e[80]=He):He=e[80];let Ge;e[81]!==wt||e[82]!==He||e[83]!==ne?(Ge=w.jsx(E.Modal,{opened:ne,onClose:pt,title:wt,children:He}),e[81]=wt,e[82]=He,e[83]=ne,e[84]=Ge):Ge=e[84];let Qe;e[85]!==c||e[86]!==me||e[87]!==n||e[88]!==P||e[89]!==r?(Qe=P.length>0&&w.jsx(E.Modal,{opened:me,onClose:()=>{ge(!1),R([])},title:r??"Löschen",children:w.jsx(Os,{onClose:()=>{ge(!1),R([])},queryKey:n,apiPath:c,selectedRecords:P})}),e[85]=c,e[86]=me,e[87]=n,e[88]=P,e[89]=r,e[90]=Qe):Qe=e[90];let st;e[91]===Symbol.for("react.memo_cache_sentinel")?(st=()=>{pe(!1)},e[91]=st):st=e[91];const gt=r??"Anlegen";let mt;e[92]===Symbol.for("react.memo_cache_sentinel")?(mt=()=>{pe(!1)},e[92]=mt):mt=e[92];let ve;e[93]!==a?(ve=a.filter(_c),e[93]=a,e[94]=ve):ve=e[94];let De;e[95]!==c||e[96]!==n||e[97]!==x||e[98]!==ve?(De=w.jsx(ps,{queryKey:n,apiPath:c,onClose:mt,fields:ve,steps:x}),e[95]=c,e[96]=n,e[97]=x,e[98]=ve,e[99]=De):De=e[99];let Fe;e[100]!==he||e[101]!==gt||e[102]!==De?(Fe=w.jsx(E.Modal,{opened:he,onClose:st,title:gt,children:De}),e[100]=he,e[101]=gt,e[102]=De,e[103]=Fe):Fe=e[103];let at;return e[104]!==Ve||e[105]!==Ye||e[106]!==et||e[107]!==ot||e[108]!==$e||e[109]!==Ge||e[110]!==Qe||e[111]!==Fe?(at=w.jsxs(w.Fragment,{children:[Ve,Ye,et,ot,$e,Ge,Qe,Fe]}),e[104]=Ve,e[105]=Ye,e[106]=et,e[107]=ot,e[108]=$e,e[109]=Ge,e[110]=Qe,e[111]=Fe,e[112]=at):at=e[112],at}function _c(t){return t.create}function Cc(t){return t.update}function xc(t){return t.column}function Sc(t,e){return w.jsx(E.Skeleton,{height:35},`skeleton-${e}`)}function Dc(t){return w.jsx(E.Tabs.Tab,{value:t.value,leftSection:t.icon,children:t.label},t.value)}function kc(t){return t.create}function Pc(t){return t.delete}function Mc(t){return t.update}function Oc(t){return t.update}function Ac(t){const[e,r]=t;return`${e}=${encodeURIComponent(r??"")}`}function Ec(t){const[,e]=t;return e!=null}function Tc(t){const e=Ze.c(5),{queryClient:r}=ct();let n;e[0]!==t?(n=w.jsx(wc,{...t}),e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==r||e[3]!==n?(s=w.jsx(Gn,{client:r,children:n}),e[2]=r,e[3]=n,e[4]=s):s=e[4],s}we.CreateModal=ps,we.DataTable=Tc,we.DataTableProvider=pl,we.DeleteModal=Os,we.UpdateModal=Ms,we.api=ml,we.createOne=zo,we.deleteOne=Yo,we.getAll=Bo,we.getApiHeaders=bt,we.getOne=Io,we.sortData=Ts,we.updateOne=Fo,we.useAddOne=qo,we.useDataTable=ct,we.useDeleteOne=Vo,we.useGetAll=Uo,we.useGetOne=Wo,we.usePersistentState=As,we.useUpdateOne=on,Object.defineProperty(we,Symbol.toStringTag,{value:"Module"})}));
|
|
19
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),r.useMemoCache(e)}})()),no}var so;function Di(){return so||(so=1,process.env.NODE_ENV==="production"?Yr.exports=xi():Yr.exports=Si()),Yr.exports}Di();var io={},Lt={},ao;function ki(){if(ao)return Lt;ao=1,Lt.byteLength=a,Lt.toByteArray=y,Lt.fromByteArray=x;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 h(S){var D=S.length;if(D%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var O=S.indexOf("=");O===-1&&(O=D);var N=O===D?0:4-O%4;return[O,N]}function a(S){var D=h(S),O=D[0],N=D[1];return(O+N)*3/4-N}function g(S,D,O){return(D+O)*3/4-O}function y(S){var D,O=h(S),N=O[0],z=O[1],F=new r(g(S,N,z)),q=0,U=z>0?N-4:N,ee;for(ee=0;ee<U;ee+=4)D=e[S.charCodeAt(ee)]<<18|e[S.charCodeAt(ee+1)]<<12|e[S.charCodeAt(ee+2)]<<6|e[S.charCodeAt(ee+3)],F[q++]=D>>16&255,F[q++]=D>>8&255,F[q++]=D&255;return z===2&&(D=e[S.charCodeAt(ee)]<<2|e[S.charCodeAt(ee+1)]>>4,F[q++]=D&255),z===1&&(D=e[S.charCodeAt(ee)]<<10|e[S.charCodeAt(ee+1)]<<4|e[S.charCodeAt(ee+2)]>>2,F[q++]=D>>8&255,F[q++]=D&255),F}function _(S){return t[S>>18&63]+t[S>>12&63]+t[S>>6&63]+t[S&63]}function P(S,D,O){for(var N,z=[],F=D;F<O;F+=3)N=(S[F]<<16&16711680)+(S[F+1]<<8&65280)+(S[F+2]&255),z.push(_(N));return z.join("")}function x(S){for(var D,O=S.length,N=O%3,z=[],F=16383,q=0,U=O-N;q<U;q+=F)z.push(P(S,q,q+F>U?U:q+F));return N===1?(D=S[O-1],z.push(t[D>>2]+t[D<<4&63]+"==")):N===2&&(D=(S[O-2]<<8)+S[O-1],z.push(t[D>>10]+t[D>>4&63]+t[D<<2&63]+"=")),z.join("")}return Lt}var Fr={};var lo;function Pi(){return lo||(lo=1,Fr.read=function(t,e,r,n,s){var u,h,a=s*8-n-1,g=(1<<a)-1,y=g>>1,_=-7,P=r?s-1:0,x=r?-1:1,S=t[e+P];for(P+=x,u=S&(1<<-_)-1,S>>=-_,_+=a;_>0;u=u*256+t[e+P],P+=x,_-=8);for(h=u&(1<<-_)-1,u>>=-_,_+=n;_>0;h=h*256+t[e+P],P+=x,_-=8);if(u===0)u=1-y;else{if(u===g)return h?NaN:(S?-1:1)*(1/0);h=h+Math.pow(2,n),u=u-y}return(S?-1:1)*h*Math.pow(2,u-n)},Fr.write=function(t,e,r,n,s,u){var h,a,g,y=u*8-s-1,_=(1<<y)-1,P=_>>1,x=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=n?0:u-1,D=n?1:-1,O=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,h=_):(h=Math.floor(Math.log(e)/Math.LN2),e*(g=Math.pow(2,-h))<1&&(h--,g*=2),h+P>=1?e+=x/g:e+=x*Math.pow(2,1-P),e*g>=2&&(h++,g/=2),h+P>=_?(a=0,h=_):h+P>=1?(a=(e*g-1)*Math.pow(2,s),h=h+P):(a=e*Math.pow(2,P-1)*Math.pow(2,s),h=0));s>=8;t[r+S]=a&255,S+=D,a/=256,s-=8);for(h=h<<s|a,y+=s;y>0;t[r+S]=h&255,S+=D,h/=256,y-=8);t[r+S-D]|=O*128}),Fr}var Wr,uo;function Mi(){if(uo)return Wr;uo=1;var t={}.toString;return Wr=Array.isArray||function(e){return t.call(e)=="[object Array]"},Wr}var co;function Oi(){return co||(co=1,(function(t){var e=ki(),r=Pi(),n=Mi();t.Buffer=a,t.SlowBuffer=z,t.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=Jn.TYPED_ARRAY_SUPPORT!==void 0?Jn.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 a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function h(o,l){if(u()<l)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(o=new Uint8Array(l),o.__proto__=a.prototype):(o===null&&(o=new a(l)),o.length=l),o}function a(o,l,p){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(o,l,p);if(typeof o=="number"){if(typeof l=="string")throw new Error("If encoding is specified then the first argument must be a string");return P(this,o)}return g(this,o,l,p)}a.poolSize=8192,a._augment=function(o){return o.__proto__=a.prototype,o};function g(o,l,p,M){if(typeof l=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&l instanceof ArrayBuffer?D(o,l,p,M):typeof l=="string"?x(o,l,p):O(o,l)}a.from=function(o,l,p){return g(null,o,l,p)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0}));function y(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,l,p,M){return y(l),l<=0?h(o,l):p!==void 0?typeof M=="string"?h(o,l).fill(p,M):h(o,l).fill(p):h(o,l)}a.alloc=function(o,l,p){return _(null,o,l,p)};function P(o,l){if(y(l),o=h(o,l<0?0:N(l)|0),!a.TYPED_ARRAY_SUPPORT)for(var p=0;p<l;++p)o[p]=0;return o}a.allocUnsafe=function(o){return P(null,o)},a.allocUnsafeSlow=function(o){return P(null,o)};function x(o,l,p){if((typeof p!="string"||p==="")&&(p="utf8"),!a.isEncoding(p))throw new TypeError('"encoding" must be a valid string encoding');var M=F(l,p)|0;o=h(o,M);var R=o.write(l,p);return R!==M&&(o=o.slice(0,R)),o}function S(o,l){var p=l.length<0?0:N(l.length)|0;o=h(o,p);for(var M=0;M<p;M+=1)o[M]=l[M]&255;return o}function D(o,l,p,M){if(l.byteLength,p<0||l.byteLength<p)throw new RangeError("'offset' is out of bounds");if(l.byteLength<p+(M||0))throw new RangeError("'length' is out of bounds");return p===void 0&&M===void 0?l=new Uint8Array(l):M===void 0?l=new Uint8Array(l,p):l=new Uint8Array(l,p,M),a.TYPED_ARRAY_SUPPORT?(o=l,o.__proto__=a.prototype):o=S(o,l),o}function O(o,l){if(a.isBuffer(l)){var p=N(l.length)|0;return o=h(o,p),o.length===0||l.copy(o,0,0,p),o}if(l){if(typeof ArrayBuffer<"u"&&l.buffer instanceof ArrayBuffer||"length"in l)return typeof l.length!="number"||ce(l.length)?h(o,0):S(o,l);if(l.type==="Buffer"&&n(l.data))return S(o,l.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 z(o){return+o!=o&&(o=0),a.alloc(+o)}a.isBuffer=function(o){return!!(o!=null&&o._isBuffer)},a.compare=function(o,l){if(!a.isBuffer(o)||!a.isBuffer(l))throw new TypeError("Arguments must be Buffers");if(o===l)return 0;for(var p=o.length,M=l.length,R=0,B=Math.min(p,M);R<B;++R)if(o[R]!==l[R]){p=o[R],M=l[R];break}return p<M?-1:M<p?1:0},a.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}},a.concat=function(o,l){if(!n(o))throw new TypeError('"list" argument must be an Array of Buffers');if(o.length===0)return a.alloc(0);var p;if(l===void 0)for(l=0,p=0;p<o.length;++p)l+=o[p].length;var M=a.allocUnsafe(l),R=0;for(p=0;p<o.length;++p){var B=o[p];if(!a.isBuffer(B))throw new TypeError('"list" argument must be an Array of Buffers');B.copy(M,R),R+=B.length}return M};function F(o,l){if(a.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 p=o.length;if(p===0)return 0;for(var M=!1;;)switch(l){case"ascii":case"latin1":case"binary":return p;case"utf8":case"utf-8":case void 0:return A(o).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p*2;case"hex":return p>>>1;case"base64":return I(o).length;default:if(M)return A(o).length;l=(""+l).toLowerCase(),M=!0}}a.byteLength=F;function q(o,l,p){var M=!1;if((l===void 0||l<0)&&(l=0),l>this.length||((p===void 0||p>this.length)&&(p=this.length),p<=0)||(p>>>=0,l>>>=0,p<=l))return"";for(o||(o="utf8");;)switch(o){case"hex":return m(this,l,p);case"utf8":case"utf-8":return k(this,l,p);case"ascii":return c(this,l,p);case"latin1":case"binary":return d(this,l,p);case"base64":return se(this,l,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f(this,l,p);default:if(M)throw new TypeError("Unknown encoding: "+o);o=(o+"").toLowerCase(),M=!0}}a.prototype._isBuffer=!0;function U(o,l,p){var M=o[l];o[l]=o[p],o[p]=M}a.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 l=0;l<o;l+=2)U(this,l,l+1);return this},a.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 l=0;l<o;l+=4)U(this,l,l+3),U(this,l+1,l+2);return this},a.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 l=0;l<o;l+=8)U(this,l,l+7),U(this,l+1,l+6),U(this,l+2,l+5),U(this,l+3,l+4);return this},a.prototype.toString=function(){var o=this.length|0;return o===0?"":arguments.length===0?k(this,0,o):q.apply(this,arguments)},a.prototype.equals=function(o){if(!a.isBuffer(o))throw new TypeError("Argument must be a Buffer");return this===o?!0:a.compare(this,o)===0},a.prototype.inspect=function(){var o="",l=t.INSPECT_MAX_BYTES;return this.length>0&&(o=this.toString("hex",0,l).match(/.{2}/g).join(" "),this.length>l&&(o+=" ... ")),"<Buffer "+o+">"},a.prototype.compare=function(o,l,p,M,R){if(!a.isBuffer(o))throw new TypeError("Argument must be a Buffer");if(l===void 0&&(l=0),p===void 0&&(p=o?o.length:0),M===void 0&&(M=0),R===void 0&&(R=this.length),l<0||p>o.length||M<0||R>this.length)throw new RangeError("out of range index");if(M>=R&&l>=p)return 0;if(M>=R)return-1;if(l>=p)return 1;if(l>>>=0,p>>>=0,M>>>=0,R>>>=0,this===o)return 0;for(var B=R-M,le=p-l,he=Math.min(B,le),pe=this.slice(M,R),ne=o.slice(l,p),fe=0;fe<he;++fe)if(pe[fe]!==ne[fe]){B=pe[fe],le=ne[fe];break}return B<le?-1:le<B?1:0};function ee(o,l,p,M,R){if(o.length===0)return-1;if(typeof p=="string"?(M=p,p=0):p>2147483647?p=2147483647:p<-2147483648&&(p=-2147483648),p=+p,isNaN(p)&&(p=R?0:o.length-1),p<0&&(p=o.length+p),p>=o.length){if(R)return-1;p=o.length-1}else if(p<0)if(R)p=0;else return-1;if(typeof l=="string"&&(l=a.from(l,M)),a.isBuffer(l))return l.length===0?-1:re(o,l,p,M,R);if(typeof l=="number")return l=l&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?R?Uint8Array.prototype.indexOf.call(o,l,p):Uint8Array.prototype.lastIndexOf.call(o,l,p):re(o,[l],p,M,R);throw new TypeError("val must be string, number or Buffer")}function re(o,l,p,M,R){var B=1,le=o.length,he=l.length;if(M!==void 0&&(M=String(M).toLowerCase(),M==="ucs2"||M==="ucs-2"||M==="utf16le"||M==="utf-16le")){if(o.length<2||l.length<2)return-1;B=2,le/=2,he/=2,p/=2}function pe(xe,Ce){return B===1?xe[Ce]:xe.readUInt16BE(Ce*B)}var ne;if(R){var fe=-1;for(ne=p;ne<le;ne++)if(pe(o,ne)===pe(l,fe===-1?0:ne-fe)){if(fe===-1&&(fe=ne),ne-fe+1===he)return fe*B}else fe!==-1&&(ne-=ne-fe),fe=-1}else for(p+he>le&&(p=le-he),ne=p;ne>=0;ne--){for(var me=!0,ge=0;ge<he;ge++)if(pe(o,ne+ge)!==pe(l,ge)){me=!1;break}if(me)return ne}return-1}a.prototype.includes=function(o,l,p){return this.indexOf(o,l,p)!==-1},a.prototype.indexOf=function(o,l,p){return ee(this,o,l,p,!0)},a.prototype.lastIndexOf=function(o,l,p){return ee(this,o,l,p,!1)};function X(o,l,p,M){p=Number(p)||0;var R=o.length-p;M?(M=Number(M),M>R&&(M=R)):M=R;var B=l.length;if(B%2!==0)throw new TypeError("Invalid hex string");M>B/2&&(M=B/2);for(var le=0;le<M;++le){var he=parseInt(l.substr(le*2,2),16);if(isNaN(he))return le;o[p+le]=he}return le}function V(o,l,p,M){return Y(A(l,o.length-p),o,p,M)}function H(o,l,p,M){return Y(L(l),o,p,M)}function K(o,l,p,M){return H(o,l,p,M)}function W(o,l,p,M){return Y(I(l),o,p,M)}function oe(o,l,p,M){return Y($(l,o.length-p),o,p,M)}a.prototype.write=function(o,l,p,M){if(l===void 0)M="utf8",p=this.length,l=0;else if(p===void 0&&typeof l=="string")M=l,p=this.length,l=0;else if(isFinite(l))l=l|0,isFinite(p)?(p=p|0,M===void 0&&(M="utf8")):(M=p,p=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var R=this.length-l;if((p===void 0||p>R)&&(p=R),o.length>0&&(p<0||l<0)||l>this.length)throw new RangeError("Attempt to write outside buffer bounds");M||(M="utf8");for(var B=!1;;)switch(M){case"hex":return X(this,o,l,p);case"utf8":case"utf-8":return V(this,o,l,p);case"ascii":return H(this,o,l,p);case"latin1":case"binary":return K(this,o,l,p);case"base64":return W(this,o,l,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return oe(this,o,l,p);default:if(B)throw new TypeError("Unknown encoding: "+M);M=(""+M).toLowerCase(),B=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function se(o,l,p){return l===0&&p===o.length?e.fromByteArray(o):e.fromByteArray(o.slice(l,p))}function k(o,l,p){p=Math.min(o.length,p);for(var M=[],R=l;R<p;){var B=o[R],le=null,he=B>239?4:B>223?3:B>191?2:1;if(R+he<=p){var pe,ne,fe,me;switch(he){case 1:B<128&&(le=B);break;case 2:pe=o[R+1],(pe&192)===128&&(me=(B&31)<<6|pe&63,me>127&&(le=me));break;case 3:pe=o[R+1],ne=o[R+2],(pe&192)===128&&(ne&192)===128&&(me=(B&15)<<12|(pe&63)<<6|ne&63,me>2047&&(me<55296||me>57343)&&(le=me));break;case 4:pe=o[R+1],ne=o[R+2],fe=o[R+3],(pe&192)===128&&(ne&192)===128&&(fe&192)===128&&(me=(B&15)<<18|(pe&63)<<12|(ne&63)<<6|fe&63,me>65535&&me<1114112&&(le=me))}}le===null?(le=65533,he=1):le>65535&&(le-=65536,M.push(le>>>10&1023|55296),le=56320|le&1023),M.push(le),R+=he}return b(M)}var C=4096;function b(o){var l=o.length;if(l<=C)return String.fromCharCode.apply(String,o);for(var p="",M=0;M<l;)p+=String.fromCharCode.apply(String,o.slice(M,M+=C));return p}function c(o,l,p){var M="";p=Math.min(o.length,p);for(var R=l;R<p;++R)M+=String.fromCharCode(o[R]&127);return M}function d(o,l,p){var M="";p=Math.min(o.length,p);for(var R=l;R<p;++R)M+=String.fromCharCode(o[R]);return M}function m(o,l,p){var M=o.length;(!l||l<0)&&(l=0),(!p||p<0||p>M)&&(p=M);for(var R="",B=l;B<p;++B)R+=ue(o[B]);return R}function f(o,l,p){for(var M=o.slice(l,p),R="",B=0;B<M.length;B+=2)R+=String.fromCharCode(M[B]+M[B+1]*256);return R}a.prototype.slice=function(o,l){var p=this.length;o=~~o,l=l===void 0?p:~~l,o<0?(o+=p,o<0&&(o=0)):o>p&&(o=p),l<0?(l+=p,l<0&&(l=0)):l>p&&(l=p),l<o&&(l=o);var M;if(a.TYPED_ARRAY_SUPPORT)M=this.subarray(o,l),M.__proto__=a.prototype;else{var R=l-o;M=new a(R,void 0);for(var B=0;B<R;++B)M[B]=this[B+o]}return M};function i(o,l,p){if(o%1!==0||o<0)throw new RangeError("offset is not uint");if(o+l>p)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUIntLE=function(o,l,p){o=o|0,l=l|0,p||i(o,l,this.length);for(var M=this[o],R=1,B=0;++B<l&&(R*=256);)M+=this[o+B]*R;return M},a.prototype.readUIntBE=function(o,l,p){o=o|0,l=l|0,p||i(o,l,this.length);for(var M=this[o+--l],R=1;l>0&&(R*=256);)M+=this[o+--l]*R;return M},a.prototype.readUInt8=function(o,l){return l||i(o,1,this.length),this[o]},a.prototype.readUInt16LE=function(o,l){return l||i(o,2,this.length),this[o]|this[o+1]<<8},a.prototype.readUInt16BE=function(o,l){return l||i(o,2,this.length),this[o]<<8|this[o+1]},a.prototype.readUInt32LE=function(o,l){return l||i(o,4,this.length),(this[o]|this[o+1]<<8|this[o+2]<<16)+this[o+3]*16777216},a.prototype.readUInt32BE=function(o,l){return l||i(o,4,this.length),this[o]*16777216+(this[o+1]<<16|this[o+2]<<8|this[o+3])},a.prototype.readIntLE=function(o,l,p){o=o|0,l=l|0,p||i(o,l,this.length);for(var M=this[o],R=1,B=0;++B<l&&(R*=256);)M+=this[o+B]*R;return R*=128,M>=R&&(M-=Math.pow(2,8*l)),M},a.prototype.readIntBE=function(o,l,p){o=o|0,l=l|0,p||i(o,l,this.length);for(var M=l,R=1,B=this[o+--M];M>0&&(R*=256);)B+=this[o+--M]*R;return R*=128,B>=R&&(B-=Math.pow(2,8*l)),B},a.prototype.readInt8=function(o,l){return l||i(o,1,this.length),this[o]&128?(255-this[o]+1)*-1:this[o]},a.prototype.readInt16LE=function(o,l){l||i(o,2,this.length);var p=this[o]|this[o+1]<<8;return p&32768?p|4294901760:p},a.prototype.readInt16BE=function(o,l){l||i(o,2,this.length);var p=this[o+1]|this[o]<<8;return p&32768?p|4294901760:p},a.prototype.readInt32LE=function(o,l){return l||i(o,4,this.length),this[o]|this[o+1]<<8|this[o+2]<<16|this[o+3]<<24},a.prototype.readInt32BE=function(o,l){return l||i(o,4,this.length),this[o]<<24|this[o+1]<<16|this[o+2]<<8|this[o+3]},a.prototype.readFloatLE=function(o,l){return l||i(o,4,this.length),r.read(this,o,!0,23,4)},a.prototype.readFloatBE=function(o,l){return l||i(o,4,this.length),r.read(this,o,!1,23,4)},a.prototype.readDoubleLE=function(o,l){return l||i(o,8,this.length),r.read(this,o,!0,52,8)},a.prototype.readDoubleBE=function(o,l){return l||i(o,8,this.length),r.read(this,o,!1,52,8)};function v(o,l,p,M,R,B){if(!a.isBuffer(o))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>R||l<B)throw new RangeError('"value" argument is out of bounds');if(p+M>o.length)throw new RangeError("Index out of range")}a.prototype.writeUIntLE=function(o,l,p,M){if(o=+o,l=l|0,p=p|0,!M){var R=Math.pow(2,8*p)-1;v(this,o,l,p,R,0)}var B=1,le=0;for(this[l]=o&255;++le<p&&(B*=256);)this[l+le]=o/B&255;return l+p},a.prototype.writeUIntBE=function(o,l,p,M){if(o=+o,l=l|0,p=p|0,!M){var R=Math.pow(2,8*p)-1;v(this,o,l,p,R,0)}var B=p-1,le=1;for(this[l+B]=o&255;--B>=0&&(le*=256);)this[l+B]=o/le&255;return l+p},a.prototype.writeUInt8=function(o,l,p){return o=+o,l=l|0,p||v(this,o,l,1,255,0),a.TYPED_ARRAY_SUPPORT||(o=Math.floor(o)),this[l]=o&255,l+1};function E(o,l,p,M){l<0&&(l=65535+l+1);for(var R=0,B=Math.min(o.length-p,2);R<B;++R)o[p+R]=(l&255<<8*(M?R:1-R))>>>(M?R:1-R)*8}a.prototype.writeUInt16LE=function(o,l,p){return o=+o,l=l|0,p||v(this,o,l,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[l]=o&255,this[l+1]=o>>>8):E(this,o,l,!0),l+2},a.prototype.writeUInt16BE=function(o,l,p){return o=+o,l=l|0,p||v(this,o,l,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[l]=o>>>8,this[l+1]=o&255):E(this,o,l,!1),l+2};function j(o,l,p,M){l<0&&(l=4294967295+l+1);for(var R=0,B=Math.min(o.length-p,4);R<B;++R)o[p+R]=l>>>(M?R:3-R)*8&255}a.prototype.writeUInt32LE=function(o,l,p){return o=+o,l=l|0,p||v(this,o,l,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[l+3]=o>>>24,this[l+2]=o>>>16,this[l+1]=o>>>8,this[l]=o&255):j(this,o,l,!0),l+4},a.prototype.writeUInt32BE=function(o,l,p){return o=+o,l=l|0,p||v(this,o,l,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[l]=o>>>24,this[l+1]=o>>>16,this[l+2]=o>>>8,this[l+3]=o&255):j(this,o,l,!1),l+4},a.prototype.writeIntLE=function(o,l,p,M){if(o=+o,l=l|0,!M){var R=Math.pow(2,8*p-1);v(this,o,l,p,R-1,-R)}var B=0,le=1,he=0;for(this[l]=o&255;++B<p&&(le*=256);)o<0&&he===0&&this[l+B-1]!==0&&(he=1),this[l+B]=(o/le>>0)-he&255;return l+p},a.prototype.writeIntBE=function(o,l,p,M){if(o=+o,l=l|0,!M){var R=Math.pow(2,8*p-1);v(this,o,l,p,R-1,-R)}var B=p-1,le=1,he=0;for(this[l+B]=o&255;--B>=0&&(le*=256);)o<0&&he===0&&this[l+B+1]!==0&&(he=1),this[l+B]=(o/le>>0)-he&255;return l+p},a.prototype.writeInt8=function(o,l,p){return o=+o,l=l|0,p||v(this,o,l,1,127,-128),a.TYPED_ARRAY_SUPPORT||(o=Math.floor(o)),o<0&&(o=255+o+1),this[l]=o&255,l+1},a.prototype.writeInt16LE=function(o,l,p){return o=+o,l=l|0,p||v(this,o,l,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[l]=o&255,this[l+1]=o>>>8):E(this,o,l,!0),l+2},a.prototype.writeInt16BE=function(o,l,p){return o=+o,l=l|0,p||v(this,o,l,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[l]=o>>>8,this[l+1]=o&255):E(this,o,l,!1),l+2},a.prototype.writeInt32LE=function(o,l,p){return o=+o,l=l|0,p||v(this,o,l,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[l]=o&255,this[l+1]=o>>>8,this[l+2]=o>>>16,this[l+3]=o>>>24):j(this,o,l,!0),l+4},a.prototype.writeInt32BE=function(o,l,p){return o=+o,l=l|0,p||v(this,o,l,4,2147483647,-2147483648),o<0&&(o=4294967295+o+1),a.TYPED_ARRAY_SUPPORT?(this[l]=o>>>24,this[l+1]=o>>>16,this[l+2]=o>>>8,this[l+3]=o&255):j(this,o,l,!1),l+4};function Q(o,l,p,M,R,B){if(p+M>o.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("Index out of range")}function J(o,l,p,M,R){return R||Q(o,l,p,4),r.write(o,l,p,M,23,4),p+4}a.prototype.writeFloatLE=function(o,l,p){return J(this,o,l,!0,p)},a.prototype.writeFloatBE=function(o,l,p){return J(this,o,l,!1,p)};function te(o,l,p,M,R){return R||Q(o,l,p,8),r.write(o,l,p,M,52,8),p+8}a.prototype.writeDoubleLE=function(o,l,p){return te(this,o,l,!0,p)},a.prototype.writeDoubleBE=function(o,l,p){return te(this,o,l,!1,p)},a.prototype.copy=function(o,l,p,M){if(p||(p=0),!M&&M!==0&&(M=this.length),l>=o.length&&(l=o.length),l||(l=0),M>0&&M<p&&(M=p),M===p||o.length===0||this.length===0)return 0;if(l<0)throw new RangeError("targetStart out of bounds");if(p<0||p>=this.length)throw new RangeError("sourceStart out of bounds");if(M<0)throw new RangeError("sourceEnd out of bounds");M>this.length&&(M=this.length),o.length-l<M-p&&(M=o.length-l+p);var R=M-p,B;if(this===o&&p<l&&l<M)for(B=R-1;B>=0;--B)o[B+l]=this[B+p];else if(R<1e3||!a.TYPED_ARRAY_SUPPORT)for(B=0;B<R;++B)o[B+l]=this[B+p];else Uint8Array.prototype.set.call(o,this.subarray(p,p+R),l);return R},a.prototype.fill=function(o,l,p,M){if(typeof o=="string"){if(typeof l=="string"?(M=l,l=0,p=this.length):typeof p=="string"&&(M=p,p=this.length),o.length===1){var R=o.charCodeAt(0);R<256&&(o=R)}if(M!==void 0&&typeof M!="string")throw new TypeError("encoding must be a string");if(typeof M=="string"&&!a.isEncoding(M))throw new TypeError("Unknown encoding: "+M)}else typeof o=="number"&&(o=o&255);if(l<0||this.length<l||this.length<p)throw new RangeError("Out of range index");if(p<=l)return this;l=l>>>0,p=p===void 0?this.length:p>>>0,o||(o=0);var B;if(typeof o=="number")for(B=l;B<p;++B)this[B]=o;else{var le=a.isBuffer(o)?o:A(new a(o,M).toString()),he=le.length;for(B=0;B<p-l;++B)this[B+l]=le[B%he]}return this};var Z=/[^+\/0-9A-Za-z-_]/g;function ae(o){if(o=ie(o).replace(Z,""),o.length<2)return"";for(;o.length%4!==0;)o=o+"=";return o}function ie(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 A(o,l){l=l||1/0;for(var p,M=o.length,R=null,B=[],le=0;le<M;++le){if(p=o.charCodeAt(le),p>55295&&p<57344){if(!R){if(p>56319){(l-=3)>-1&&B.push(239,191,189);continue}else if(le+1===M){(l-=3)>-1&&B.push(239,191,189);continue}R=p;continue}if(p<56320){(l-=3)>-1&&B.push(239,191,189),R=p;continue}p=(R-55296<<10|p-56320)+65536}else R&&(l-=3)>-1&&B.push(239,191,189);if(R=null,p<128){if((l-=1)<0)break;B.push(p)}else if(p<2048){if((l-=2)<0)break;B.push(p>>6|192,p&63|128)}else if(p<65536){if((l-=3)<0)break;B.push(p>>12|224,p>>6&63|128,p&63|128)}else if(p<1114112){if((l-=4)<0)break;B.push(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}else throw new Error("Invalid code point")}return B}function L(o){for(var l=[],p=0;p<o.length;++p)l.push(o.charCodeAt(p)&255);return l}function $(o,l){for(var p,M,R,B=[],le=0;le<o.length&&!((l-=2)<0);++le)p=o.charCodeAt(le),M=p>>8,R=p%256,B.push(R),B.push(M);return B}function I(o){return e.toByteArray(ae(o))}function Y(o,l,p,M){for(var R=0;R<M&&!(R+p>=l.length||R>=o.length);++R)l[R+p]=o[R];return R}function ce(o){return o!==o}})(io)),io}Oi();var vt;if(typeof window<"u"&&window.crypto&&(vt=window.crypto),!vt&&typeof window<"u"&&window.msCrypto&&(vt=window.msCrypto),!vt&&typeof global<"u"&&global.crypto&&(vt=global.crypto),!vt&&typeof require=="function")try{vt=require("crypto")}catch{}var ho={};var Ur=function(t,e){return Ur=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])},Ur(t,e)};function Ai(t,e){Ur(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var qr=function(){return qr=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},qr.apply(this,arguments)};function Ei(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 Ti(t,e,r,n){var s=arguments.length,u=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(h=t[a])&&(u=(s<3?h(u):s>3?h(e,r,u):h(e,r))||u);return s>3&&u&&Object.defineProperty(e,r,u),u}function ji(t,e){return function(r,n){e(r,n,t)}}function $i(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Ri(t,e,r,n){function s(u){return u instanceof r?u:new r(function(h){h(u)})}return new(r||(r=Promise))(function(u,h){function a(_){try{y(n.next(_))}catch(P){h(P)}}function g(_){try{y(n.throw(_))}catch(P){h(P)}}function y(_){_.done?u(_.value):s(_.value).then(a,g)}y((n=n.apply(t,e||[])).next())})}function Ni(t,e){var r={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},n,s,u,h;return h={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function a(y){return function(_){return g([y,_])}}function g(y){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,s&&(u=y[0]&2?s.return:y[0]?s.throw||((u=s.return)&&u.call(s),0):s.next)&&!(u=u.call(s,y[1])).done)return u;switch(s=0,u&&(y=[y[0]&2,u.value]),y[0]){case 0:case 1:u=y;break;case 4:return r.label++,{value:y[1],done:!1};case 5:r.label++,s=y[1],y=[0];continue;case 7:y=r.ops.pop(),r.trys.pop();continue;default:if(u=r.trys,!(u=u.length>0&&u[u.length-1])&&(y[0]===6||y[0]===2)){r=0;continue}if(y[0]===3&&(!u||y[1]>u[0]&&y[1]<u[3])){r.label=y[1];break}if(y[0]===6&&r.label<u[1]){r.label=u[1],u=y;break}if(u&&r.label<u[2]){r.label=u[2],r.ops.push(y);break}u[2]&&r.ops.pop(),r.trys.pop();continue}y=e.call(t,r)}catch(_){y=[6,_],s=0}finally{n=u=0}if(y[0]&5)throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}}function Li(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Bi(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Vr(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 fo(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),s,u=[],h;try{for(;(e===void 0||e-- >0)&&!(s=n.next()).done;)u.push(s.value)}catch(a){h={error:a}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(h)throw h.error}}return u}function Ii(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(fo(arguments[e]));return t}function Yi(){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],h=0,a=u.length;h<a;h++,s++)n[s]=u[h];return n}function Bt(t){return this instanceof Bt?(this.v=t,this):new Bt(t)}function zi(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),s,u=[];return s={},h("next"),h("throw"),h("return"),s[Symbol.asyncIterator]=function(){return this},s;function h(x){n[x]&&(s[x]=function(S){return new Promise(function(D,O){u.push([x,S,D,O])>1||a(x,S)})})}function a(x,S){try{g(n[x](S))}catch(D){P(u[0][3],D)}}function g(x){x.value instanceof Bt?Promise.resolve(x.value.v).then(y,_):P(u[0][2],x)}function y(x){a("next",x)}function _(x){a("throw",x)}function P(x,S){x(S),u.shift(),u.length&&a(u[0][0],u[0][1])}}function Fi(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(h){return(r=!r)?{value:Bt(t[s](h)),done:s==="return"}:u?u(h):h}:u}}function Wi(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 Vr=="function"?Vr(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(h){return new Promise(function(a,g){h=t[u](h),s(a,g,h.done,h.value)})}}function s(u,h,a,g){Promise.resolve(g).then(function(y){u({value:y,done:a})},h)}}function Ui(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function qi(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 Vi(t){return t&&t.__esModule?t:{default:t}}function Hi(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Gi(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 Qi=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return qr},__asyncDelegator:Fi,__asyncGenerator:zi,__asyncValues:Wi,__await:Bt,__awaiter:Ri,__classPrivateFieldGet:Hi,__classPrivateFieldSet:Gi,__createBinding:Li,__decorate:Ti,__exportStar:Bi,__extends:Ai,__generator:Ni,__importDefault:Vi,__importStar:qi,__makeTemplateObject:Ui,__metadata:$i,__param:ji,__read:fo,__rest:Ei,__spread:Ii,__spreadArrays:Yi,__values:Vr},Symbol.toStringTag,{value:"Module"})),po=Br(Qi);var It={},We={},go;function mo(){return go||(go=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 Yt={},yo;function Zi(){if(yo)return Yt;yo=1,Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.RawSha256=void 0;var t=mo(),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 h=this.bufferLength;h<t.BLOCK_SIZE;h++)s.setUint8(h,0);this.hashBuffer(),this.bufferLength=0}for(var h=this.bufferLength;h<t.BLOCK_SIZE-8;h++)s.setUint8(h,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 a=new Uint8Array(t.DIGEST_LENGTH),h=0;h<8;h++)a[h*4]=this.state[h]>>>24&255,a[h*4+1]=this.state[h]>>>16&255,a[h*4+2]=this.state[h]>>>8&255,a[h*4+3]=this.state[h]>>>0&255;return a},r.prototype.hashBuffer=function(){for(var n=this,s=n.buffer,u=n.state,h=u[0],a=u[1],g=u[2],y=u[3],_=u[4],P=u[5],x=u[6],S=u[7],D=0;D<t.BLOCK_SIZE;D++){if(D<16)this.temp[D]=(s[D*4]&255)<<24|(s[D*4+1]&255)<<16|(s[D*4+2]&255)<<8|s[D*4+3]&255;else{var O=this.temp[D-2],N=(O>>>17|O<<15)^(O>>>19|O<<13)^O>>>10;O=this.temp[D-15];var z=(O>>>7|O<<25)^(O>>>18|O<<14)^O>>>3;this.temp[D]=(N+this.temp[D-7]|0)+(z+this.temp[D-16]|0)}var F=(((_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&P^~_&x)|0)+(S+(t.KEY[D]+this.temp[D]|0)|0)|0,q=((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+(h&a^h&g^a&g)|0;S=x,x=P,P=_,_=y+F|0,y=g,g=a,a=h,h=F+q|0}u[0]+=h,u[1]+=a,u[2]+=g,u[3]+=y,u[4]+=_,u[5]+=P,u[6]+=x,u[7]+=S},r})();return Yt.RawSha256=e,Yt}var vo={},zt={};const Ki=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)},Ji=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(h=>h.toString(16)).join("%");e+=decodeURIComponent(u)}else e+=String.fromCharCode((s&15)<<12|(t[++r]&63)<<6|t[++r]&63)}return e};function Xi(t){return new TextEncoder().encode(t)}function ea(t){return new TextDecoder("utf-8").decode(t)}const ta=t=>typeof TextEncoder=="function"?Xi(t):Ki(t),ra=t=>typeof TextDecoder=="function"?ea(t):Ji(t),na=Object.freeze(Object.defineProperty({__proto__:null,fromUtf8:ta,toUtf8:ra},Symbol.toStringTag,{value:"Module"})),oa=Br(na);var bo;function sa(){if(bo)return zt;bo=1,Object.defineProperty(zt,"__esModule",{value:!0}),zt.convertToBuffer=void 0;var t=oa,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 zt.convertToBuffer=r,zt}var Ft={},wo;function ia(){if(wo)return Ft;wo=1,Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.isEmptyData=void 0;function t(e){return typeof e=="string"?e.length===0:e.byteLength===0}return Ft.isEmptyData=t,Ft}var Wt={},_o;function aa(){if(_o)return Wt;_o=1,Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.numToUint8=void 0;function t(e){return new Uint8Array([(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255])}return Wt.numToUint8=t,Wt}var Ut={},Co;function la(){if(Co)return Ut;Co=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.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 Ut.uint32ArrayFrom=t,Ut}var xo;function ua(){return xo||(xo=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=t.numToUint8=t.isEmptyData=t.convertToBuffer=void 0;var e=sa();Object.defineProperty(t,"convertToBuffer",{enumerable:!0,get:function(){return e.convertToBuffer}});var r=ia();Object.defineProperty(t,"isEmptyData",{enumerable:!0,get:function(){return r.isEmptyData}});var n=aa();Object.defineProperty(t,"numToUint8",{enumerable:!0,get:function(){return n.numToUint8}});var s=la();Object.defineProperty(t,"uint32ArrayFrom",{enumerable:!0,get:function(){return s.uint32ArrayFrom}})})(vo)),vo}var So;function ca(){if(So)return It;So=1,Object.defineProperty(It,"__esModule",{value:!0}),It.Sha256=void 0;var t=po,e=mo(),r=Zi(),n=ua(),s=(function(){function h(a){if(this.hash=new r.RawSha256,a){this.outer=new r.RawSha256;var g=u(a),y=new Uint8Array(e.BLOCK_SIZE);y.set(g);for(var _=0;_<e.BLOCK_SIZE;_++)g[_]^=54,y[_]^=92;this.hash.update(g),this.outer.update(y);for(var _=0;_<g.byteLength;_++)g[_]=0}}return h.prototype.update=function(a){if(!((0,n.isEmptyData)(a)||this.error))try{this.hash.update((0,n.convertToBuffer)(a))}catch(g){this.error=g}},h.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()},h.prototype.digest=function(){return(0,t.__awaiter)(this,void 0,void 0,function(){return(0,t.__generator)(this,function(a){return[2,this.digestSync()]})})},h})();It.Sha256=s;function u(h){var a=(0,n.convertToBuffer)(h);if(a.byteLength>e.BLOCK_SIZE){var g=new r.RawSha256;g.update(a),a=g.digest()}var y=new Uint8Array(e.BLOCK_SIZE);return y.set(a),y}return It}var Do;function da(){return Do||(Do=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=po;(0,e.__exportStar)(ca(),t)})(ho)),ho}da();function ye(t,e){t!=null&&this.fromString(t,e)}function Be(){return new ye(null)}var lt,ha=0xdeadbeefcafe,ko=(ha&16777215)==15715070;function fa(t,e,r,n,s,u){for(;--u>=0;){var h=e*this[t++]+r[n]+s;s=Math.floor(h/67108864),r[n++]=h&67108863}return s}function pa(t,e,r,n,s,u){for(var h=e&32767,a=e>>15;--u>=0;){var g=this[t]&32767,y=this[t++]>>15,_=a*g+y*h;g=h*g+((_&32767)<<15)+r[n]+(s&1073741823),s=(g>>>30)+(_>>>15)+a*y+(s>>>30),r[n++]=g&1073741823}return s}function ga(t,e,r,n,s,u){for(var h=e&16383,a=e>>14;--u>=0;){var g=this[t]&16383,y=this[t++]>>14,_=a*g+y*h;g=h*g+((_&16383)<<14)+r[n]+s,s=(g>>28)+(_>>14)+a*y,r[n++]=g&268435455}return s}var Po=typeof navigator<"u";Po&&ko&&navigator.appName=="Microsoft Internet Explorer"?(ye.prototype.am=pa,lt=30):Po&&ko&&navigator.appName!="Netscape"?(ye.prototype.am=fa,lt=26):(ye.prototype.am=ga,lt=28),ye.prototype.DB=lt,ye.prototype.DM=(1<<lt)-1,ye.prototype.DV=1<<lt;var Hr=52;ye.prototype.FV=Math.pow(2,Hr),ye.prototype.F1=Hr-lt,ye.prototype.F2=2*lt-Hr;var ma="0123456789abcdefghijklmnopqrstuvwxyz",rr=new Array,Dt,Ue;for(Dt=48,Ue=0;Ue<=9;++Ue)rr[Dt++]=Ue;for(Dt=97,Ue=10;Ue<36;++Ue)rr[Dt++]=Ue;for(Dt=65,Ue=10;Ue<36;++Ue)rr[Dt++]=Ue;function Mo(t){return ma.charAt(t)}function ya(t,e){var r=rr[t.charCodeAt(e)];return r??-1}function va(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function ba(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 Gr(t){var e=Be();return e.fromInt(t),e}function wa(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 h=ya(t,n);if(h<0){t.charAt(n)=="-"&&(s=!0);continue}s=!1,u==0?this[this.t++]=h:u+r>this.DB?(this[this.t-1]|=(h&(1<<this.DB-u)-1)<<u,this[this.t++]=h>>this.DB-u):this[this.t-1]|=h<<u,u+=r,u>=this.DB&&(u-=this.DB)}this.clamp(),s&&ye.ZERO.subTo(this,this)}function _a(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function Ca(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="",h=this.t,a=this.DB-h*this.DB%e;if(h-- >0)for(a<this.DB&&(n=this[h]>>a)>0&&(s=!0,u=Mo(n));h>=0;)a<e?(n=(this[h]&(1<<a)-1)<<e-a,n|=this[--h]>>(a+=this.DB-e)):(n=this[h]>>(a-=e)&r,a<=0&&(a+=this.DB,--h)),n>0&&(s=!0),s&&(u+=Mo(n));return s?u:"0"}function xa(){var t=Be();return ye.ZERO.subTo(this,t),t}function Sa(){return this.s<0?this.negate():this}function Da(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 Qr(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 ka(){return this.t<=0?0:this.DB*(this.t-1)+Qr(this[this.t-1]^this.s&this.DM)}function Pa(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 Ma(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 Oa(t,e){var r=t%this.DB,n=this.DB-r,s=(1<<n)-1,u=Math.floor(t/this.DB),h=this.s<<r&this.DM,a;for(a=this.t-1;a>=0;--a)e[a+u+1]=this[a]>>n|h,h=(this[a]&s)<<r;for(a=u-1;a>=0;--a)e[a]=0;e[u]=h,e.t=this.t+u+1,e.s=this.s,e.clamp()}function Aa(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 h=r+1;h<this.t;++h)e[h-r-1]|=(this[h]&u)<<s,e[h-r]=this[h]>>n;n>0&&(e[this.t-r-1]|=(this.s&u)<<s),e.t=this.t-r,e.clamp()}function Ea(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 Ta(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 ja(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 $a(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=Be());var u=Be(),h=this.s,a=t.s,g=this.DB-Qr(n[n.t-1]);g>0?(n.lShiftTo(g,u),s.lShiftTo(g,r)):(n.copyTo(u),s.copyTo(r));var y=u.t,_=u[y-1];if(_!=0){var P=_*(1<<this.F1)+(y>1?u[y-2]>>this.F2:0),x=this.FV/P,S=(1<<this.F1)/P,D=1<<this.F2,O=r.t,N=O-y,z=e??Be();for(u.dlShiftTo(N,z),r.compareTo(z)>=0&&(r[r.t++]=1,r.subTo(z,r)),ye.ONE.dlShiftTo(y,z),z.subTo(u,u);u.t<y;)u[u.t++]=0;for(;--N>=0;){var F=r[--O]==_?this.DM:Math.floor(r[O]*x+(r[O-1]+D)*S);if((r[O]+=u.am(0,F,r,N,0,y))<F)for(u.dlShiftTo(N,z),r.subTo(z,r);r[O]<--F;)r.subTo(z,r)}e!=null&&(r.drShiftTo(y,e),h!=a&&ye.ZERO.subTo(e,e)),r.t=y,r.clamp(),g>0&&r.rShiftTo(g,r),h<0&&ye.ZERO.subTo(r,r)}}}function Ra(t){var e=Be();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(ye.ZERO)>0&&t.subTo(e,e),e}function Na(){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 La(t){return this.compareTo(t)==0}function Ba(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 Ia(t){var e=Be();return this.addTo(t,e),e}function Ya(t){var e=Be();return this.subTo(t,e),e}function za(t){var e=Be();return this.multiplyTo(t,e),e}function Fa(t){var e=Be();return this.divRemTo(t,e,null),e}function kt(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 Wa(t){var e=Be();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 Ua(t){var e=Be();return t.copyTo(e),this.reduce(e),e}function qa(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 Va(t,e){t.squareTo(e),this.reduce(e)}function Ha(t,e,r){t.multiplyTo(e,r),this.reduce(r)}kt.prototype.convert=Wa,kt.prototype.revert=Ua,kt.prototype.reduce=qa,kt.prototype.mulTo=Ha,kt.prototype.sqrTo=Va;function Ga(t,e,r){var n=t.bitLength(),s,u=Gr(1),h=new kt(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 a=new Array,g=3,y=s-1,_=(1<<s)-1;if(a[1]=h.convert(this),s>1){var P=Be();for(h.sqrTo(a[1],P);g<=_;)a[g]=Be(),h.mulTo(P,a[g-2],a[g]),g+=2}var x=t.t-1,S,D=!0,O=Be(),N;for(n=Qr(t[x])-1;x>=0;){for(n>=y?S=t[x]>>n-y&_:(S=(t[x]&(1<<n+1)-1)<<y-n,x>0&&(S|=t[x-1]>>this.DB+n-y)),g=s;(S&1)==0;)S>>=1,--g;if((n-=g)<0&&(n+=this.DB,--x),D)a[S].copyTo(u),D=!1;else{for(;g>1;)h.sqrTo(u,O),h.sqrTo(O,u),g-=2;g>0?h.sqrTo(u,O):(N=u,u=O,O=N),h.mulTo(O,a[S],u)}for(;x>=0&&(t[x]&1<<n)==0;)h.sqrTo(u,O),N=u,u=O,O=N,--n<0&&(n=this.DB-1,--x)}var z=h.revert(u);return r(null,z),z}ye.prototype.copyTo=va,ye.prototype.fromInt=ba,ye.prototype.fromString=wa,ye.prototype.clamp=_a,ye.prototype.dlShiftTo=Pa,ye.prototype.drShiftTo=Ma,ye.prototype.lShiftTo=Oa,ye.prototype.rShiftTo=Aa,ye.prototype.subTo=Ea,ye.prototype.multiplyTo=Ta,ye.prototype.squareTo=ja,ye.prototype.divRemTo=$a,ye.prototype.invDigit=Na,ye.prototype.addTo=Ba,ye.prototype.toString=Ca,ye.prototype.negate=xa,ye.prototype.abs=Sa,ye.prototype.compareTo=Da,ye.prototype.bitLength=ka,ye.prototype.mod=Ra,ye.prototype.equals=La,ye.prototype.add=Ia,ye.prototype.subtract=Ya,ye.prototype.multiply=za,ye.prototype.divide=Fa,ye.prototype.modPow=Ga,ye.ZERO=Gr(0),ye.ONE=Gr(1);function Qa(t,e){return e=e||{},new Promise(function(r,n){var s=new XMLHttpRequest,u=[],h=[],a={},g=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:g,headers:{keys:function(){return u},entries:function(){return h},get:function(_){return a[_.toLowerCase()]},has:function(_){return _.toLowerCase()in a}}}};for(var y in s.open(e.method||"get",t,!0),s.onload=function(){s.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(_,P,x){u.push(P=P.toLowerCase()),h.push([P,x]),a[P]=a[P]?a[P]+","+x:x}),r(g())},s.onerror=n,s.withCredentials=e.credentials=="include",e.headers)s.setRequestHeader(y,e.headers[y]);s.send(e.body||null)})}const Za=Object.freeze(Object.defineProperty({__proto__:null,default:Qa},Symbol.toStringTag,{value:"Module"})),Oo=Br(Za);var Ao,Eo;function Ka(){return Eo||(Eo=1,Ao=self.fetch||(self.fetch=Oo.default||Oo)),Ao}Ka();var To={exports:{}};var jo;function Ja(){return jo||(jo=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,h={};u<arguments.length;u++){var a=arguments[u];for(var g in a)h[g]=a[g]}return h}function n(u){return u.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function s(u){function h(){}function a(y,_,P){if(!(typeof document>"u")){P=r({path:"/"},h.defaults,P),typeof P.expires=="number"&&(P.expires=new Date(new Date*1+P.expires*864e5)),P.expires=P.expires?P.expires.toUTCString():"";try{var x=JSON.stringify(_);/^[\{\[]/.test(x)&&(_=x)}catch{}_=u.write?u.write(_,y):encodeURIComponent(String(_)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),y=encodeURIComponent(String(y)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var S="";for(var D in P)P[D]&&(S+="; "+D,P[D]!==!0&&(S+="="+P[D].split(";")[0]));return document.cookie=y+"="+_+S}}function g(y,_){if(!(typeof document>"u")){for(var P={},x=document.cookie?document.cookie.split("; "):[],S=0;S<x.length;S++){var D=x[S].split("="),O=D.slice(1).join("=");!_&&O.charAt(0)==='"'&&(O=O.slice(1,-1));try{var N=n(D[0]);if(O=(u.read||u)(O,N)||n(O),_)try{O=JSON.parse(O)}catch{}if(P[N]=O,y===N)break}catch{}}return y?P[y]:P}}return h.set=a,h.get=function(y){return g(y,!1)},h.getJSON=function(y){return g(y,!0)},h.remove=function(y,_){a(y,"",r(_,{expires:-1}))},h.defaults={},h.withConverter=s,h}return s(function(){})})})(To)),To.exports}Ja();function Xa(){if(!window.MantineCognitoUserPool)throw new Error("Cognito Userpool has not been initialized.");return window.MantineCognitoUserPool}function el(){return Xa().getCurrentUser()}function tl(){return new Promise((t,e)=>{const r=el();r===null&&e(null),r?.getSession((n,s)=>{if(n!==null||s===null)return e(null);t({session:s,authenticatedUser:r})})})}async function rl(){const{session:t}=await tl();return t?.getIdToken().getJwtToken()}G.createContext(void 0);var nl="undefined",ol="object",nr="browser",$o="cpu",Ro="device",Zr="engine",or="os",ut="name",sr="type",Kr="vendor",Je="version",Jr="architecture",Xr="major",en="model",sl="console",il="mobile",al="tablet",ll="smarttv",ul="wearable",cl="embedded",dl=typeof window!==nl,tn=dl&&window.navigator?window.navigator:void 0;tn&&tn.userAgentData&&tn.userAgentData;var ir=function(t){for(var e={},r=0;r<t.length;r++)e[t[r].toUpperCase()]=t[r];return e},ar=function(t){for(var e in t){var r=t[e];typeof r==ol&&r.length==2?this[r[0]]=r[1]:this[r]=void 0}return this};(function(){var t={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return ar.call(t.init,[[nr,[ut,Je,Xr,sr]],[$o,[Jr]],[Ro,[sr,en,Kr]],[Zr,[ut,Je]],[or,[ut,Je]]]),ar.call(t.isIgnore,[[nr,[Je,Xr]],[Zr,[Je]],[or,[Je]]]),ar.call(t.isIgnoreRgx,[[nr,/ ?browser$/i],[or,/ ?os$/i]]),ar.call(t.toString,[[nr,[ut,Je]],[$o,[Jr]],[Ro,[Kr,en]],[Zr,[ut,Je]],[or,[ut,Je]]]),t})(),ir([ut,Je,Xr,sr]),ir([Jr]),ir([en,Kr,sr,sl,il,ll,al,ul,cl]),ir([ut,Je]);var rn={exports:{}},hl=rn.exports,No;function fl(){return No||(No=1,(function(t,e){(function(r,n){t.exports=n()})(hl,()=>(()=>{var r={873:(h,a)=>{var g,y,_=(function(){var P=function(k,C){var b=k,c=z[C],d=null,m=0,f=null,i=[],v={},E=function(A,L){d=(function($){for(var I=new Array($),Y=0;Y<$;Y+=1){I[Y]=new Array($);for(var ce=0;ce<$;ce+=1)I[Y][ce]=null}return I})(m=4*b+17),j(0,0),j(m-7,0),j(0,m-7),J(),Q(),Z(A,L),b>=7&&te(A),f==null&&(f=ie(b,c,i)),ae(f,L)},j=function(A,L){for(var $=-1;$<=7;$+=1)if(!(A+$<=-1||m<=A+$))for(var I=-1;I<=7;I+=1)L+I<=-1||m<=L+I||(d[A+$][L+I]=0<=$&&$<=6&&(I==0||I==6)||0<=I&&I<=6&&($==0||$==6)||2<=$&&$<=4&&2<=I&&I<=4)},Q=function(){for(var A=8;A<m-8;A+=1)d[A][6]==null&&(d[A][6]=A%2==0);for(var L=8;L<m-8;L+=1)d[6][L]==null&&(d[6][L]=L%2==0)},J=function(){for(var A=F.getPatternPosition(b),L=0;L<A.length;L+=1)for(var $=0;$<A.length;$+=1){var I=A[L],Y=A[$];if(d[I][Y]==null)for(var ce=-2;ce<=2;ce+=1)for(var o=-2;o<=2;o+=1)d[I+ce][Y+o]=ce==-2||ce==2||o==-2||o==2||ce==0&&o==0}},te=function(A){for(var L=F.getBCHTypeNumber(b),$=0;$<18;$+=1){var I=!A&&(L>>$&1)==1;d[Math.floor($/3)][$%3+m-8-3]=I}for($=0;$<18;$+=1)I=!A&&(L>>$&1)==1,d[$%3+m-8-3][Math.floor($/3)]=I},Z=function(A,L){for(var $=c<<3|L,I=F.getBCHTypeInfo($),Y=0;Y<15;Y+=1){var ce=!A&&(I>>Y&1)==1;Y<6?d[Y][8]=ce:Y<8?d[Y+1][8]=ce:d[m-15+Y][8]=ce}for(Y=0;Y<15;Y+=1)ce=!A&&(I>>Y&1)==1,Y<8?d[8][m-Y-1]=ce:Y<9?d[8][15-Y-1+1]=ce:d[8][15-Y-1]=ce;d[m-8][8]=!A},ae=function(A,L){for(var $=-1,I=m-1,Y=7,ce=0,o=F.getMaskFunction(L),l=m-1;l>0;l-=2)for(l==6&&(l-=1);;){for(var p=0;p<2;p+=1)if(d[I][l-p]==null){var M=!1;ce<A.length&&(M=(A[ce]>>>Y&1)==1),o(I,l-p)&&(M=!M),d[I][l-p]=M,(Y-=1)==-1&&(ce+=1,Y=7)}if((I+=$)<0||m<=I){I-=$,$=-$;break}}},ie=function(A,L,$){for(var I=ee.getRSBlocks(A,L),Y=re(),ce=0;ce<$.length;ce+=1){var o=$[ce];Y.put(o.getMode(),4),Y.put(o.getLength(),F.getLengthInBits(o.getMode(),A)),o.write(Y)}var l=0;for(ce=0;ce<I.length;ce+=1)l+=I[ce].dataCount;if(Y.getLengthInBits()>8*l)throw"code length overflow. ("+Y.getLengthInBits()+">"+8*l+")";for(Y.getLengthInBits()+4<=8*l&&Y.put(0,4);Y.getLengthInBits()%8!=0;)Y.putBit(!1);for(;!(Y.getLengthInBits()>=8*l||(Y.put(236,8),Y.getLengthInBits()>=8*l));)Y.put(17,8);return(function(p,M){for(var R=0,B=0,le=0,he=new Array(M.length),pe=new Array(M.length),ne=0;ne<M.length;ne+=1){var fe=M[ne].dataCount,me=M[ne].totalCount-fe;B=Math.max(B,fe),le=Math.max(le,me),he[ne]=new Array(fe);for(var ge=0;ge<he[ne].length;ge+=1)he[ne][ge]=255&p.getBuffer()[ge+R];R+=fe;var xe=F.getErrorCorrectPolynomial(me),Ce=U(he[ne],xe.getLength()-1).mod(xe);for(pe[ne]=new Array(xe.getLength()-1),ge=0;ge<pe[ne].length;ge+=1){var Se=ge+Ce.getLength()-pe[ne].length;pe[ne][ge]=Se>=0?Ce.getAt(Se):0}}var Ye=0;for(ge=0;ge<M.length;ge+=1)Ye+=M[ge].totalCount;var Ee=new Array(Ye),_e=0;for(ge=0;ge<B;ge+=1)for(ne=0;ne<M.length;ne+=1)ge<he[ne].length&&(Ee[_e]=he[ne][ge],_e+=1);for(ge=0;ge<le;ge+=1)for(ne=0;ne<M.length;ne+=1)ge<pe[ne].length&&(Ee[_e]=pe[ne][ge],_e+=1);return Ee})(Y,I)};v.addData=function(A,L){var $=null;switch(L=L||"Byte"){case"Numeric":$=X(A);break;case"Alphanumeric":$=V(A);break;case"Byte":$=H(A);break;case"Kanji":$=K(A);break;default:throw"mode:"+L}i.push($),f=null},v.isDark=function(A,L){if(A<0||m<=A||L<0||m<=L)throw A+","+L;return d[A][L]},v.getModuleCount=function(){return m},v.make=function(){if(b<1){for(var A=1;A<40;A++){for(var L=ee.getRSBlocks(A,c),$=re(),I=0;I<i.length;I++){var Y=i[I];$.put(Y.getMode(),4),$.put(Y.getLength(),F.getLengthInBits(Y.getMode(),A)),Y.write($)}var ce=0;for(I=0;I<L.length;I++)ce+=L[I].dataCount;if($.getLengthInBits()<=8*ce)break}b=A}E(!1,(function(){for(var o=0,l=0,p=0;p<8;p+=1){E(!0,p);var M=F.getLostPoint(v);(p==0||o>M)&&(o=M,l=p)}return l})())},v.createTableTag=function(A,L){A=A||2;var $="";$+='<table style="',$+=" border-width: 0px; border-style: none;",$+=" border-collapse: collapse;",$+=" padding: 0px; margin: "+(L=L===void 0?4*A: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: "+A+"px;",$+=" height: "+A+"px;",$+=" background-color: ",$+=v.isDark(I,Y)?"#000000":"#ffffff",$+=";",$+='"/>';$+="</tr>"}return($+="</tbody>")+"</table>"},v.createSvgTag=function(A,L,$,I){var Y={};typeof arguments[0]=="object"&&(A=(Y=arguments[0]).cellSize,L=Y.margin,$=Y.alt,I=Y.title),A=A||2,L=L===void 0?4*A: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 ce,o,l,p,M=v.getModuleCount()*A+2*L,R="";for(p="l"+A+",0 0,"+A+" -"+A+",0 0,-"+A+"z ",R+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',R+=Y.scalable?"":' width="'+M+'px" height="'+M+'px"',R+=' viewBox="0 0 '+M+" "+M+'" ',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(l=o*A+L,ce=0;ce<v.getModuleCount();ce+=1)v.isDark(o,ce)&&(R+="M"+(ce*A+L)+","+l+p);return(R+='" stroke="transparent" fill="black"/>')+"</svg>"},v.createDataURL=function(A,L){A=A||2,L=L===void 0?4*A:L;var $=v.getModuleCount()*A+2*L,I=L,Y=$-L;return se($,$,function(ce,o){if(I<=ce&&ce<Y&&I<=o&&o<Y){var l=Math.floor((ce-I)/A),p=Math.floor((o-I)/A);return v.isDark(p,l)?0:1}return 1})},v.createImgTag=function(A,L,$){A=A||2,L=L===void 0?4*A:L;var I=v.getModuleCount()*A+2*L,Y="";return Y+="<img",Y+=' src="',Y+=v.createDataURL(A,L),Y+='"',Y+=' width="',Y+=I,Y+='"',Y+=' height="',Y+=I,Y+='"',$&&(Y+=' alt="',Y+=ue($),Y+='"'),Y+"/>"};var ue=function(A){for(var L="",$=0;$<A.length;$+=1){var I=A.charAt($);switch(I){case"<":L+="<";break;case">":L+=">";break;case"&":L+="&";break;case'"':L+=""";break;default:L+=I}}return L};return v.createASCII=function(A,L){if((A=A||1)<2)return(function(he){he=he===void 0?2:he;var pe,ne,fe,me,ge,xe=1*v.getModuleCount()+2*he,Ce=he,Se=xe-he,Ye={"██":"█","█ ":"▀"," █":"▄"," ":" "},Ee={"██":"▀","█ ":"▀"," █":" "," ":" "},_e="";for(pe=0;pe<xe;pe+=2){for(fe=Math.floor((pe-Ce)/1),me=Math.floor((pe+1-Ce)/1),ne=0;ne<xe;ne+=1)ge="█",Ce<=ne&&ne<Se&&Ce<=pe&&pe<Se&&v.isDark(fe,Math.floor((ne-Ce)/1))&&(ge=" "),Ce<=ne&&ne<Se&&Ce<=pe+1&&pe+1<Se&&v.isDark(me,Math.floor((ne-Ce)/1))?ge+=" ":ge+="█",_e+=he<1&&pe+1>=Se?Ee[ge]:Ye[ge];_e+=`
|
|
20
|
+
`}return xe%2&&he>0?_e.substring(0,_e.length-xe-1)+Array(xe+1).join("▀"):_e.substring(0,_e.length-1)})(L);A-=1,L=L===void 0?2*A:L;var $,I,Y,ce,o=v.getModuleCount()*A+2*L,l=L,p=o-L,M=Array(A+1).join("██"),R=Array(A+1).join(" "),B="",le="";for($=0;$<o;$+=1){for(Y=Math.floor(($-l)/A),le="",I=0;I<o;I+=1)ce=1,l<=I&&I<p&&l<=$&&$<p&&v.isDark(Y,Math.floor((I-l)/A))&&(ce=0),le+=ce?M:R;for(Y=0;Y<A;Y+=1)B+=le+`
|
|
21
|
+
`}return B.substring(0,B.length-1)},v.renderTo2dContext=function(A,L){L=L||2;for(var $=v.getModuleCount(),I=0;I<$;I++)for(var Y=0;Y<$;Y++)A.fillStyle=v.isDark(I,Y)?"black":"white",A.fillRect(I*L,Y*L,L,L)},v};P.stringToBytes=(P.stringToBytesFuncs={default:function(k){for(var C=[],b=0;b<k.length;b+=1){var c=k.charCodeAt(b);C.push(255&c)}return C}}).default,P.createStringToBytes=function(k,C){var b=(function(){for(var d=oe(k),m=function(){var Q=d.read();if(Q==-1)throw"eof";return Q},f=0,i={};;){var v=d.read();if(v==-1)break;var E=m(),j=m()<<8|m();i[String.fromCharCode(v<<8|E)]=j,f+=1}if(f!=C)throw f+" != "+C;return i})(),c=63;return function(d){for(var m=[],f=0;f<d.length;f+=1){var i=d.charCodeAt(f);if(i<128)m.push(i);else{var v=b[d.charAt(f)];typeof v=="number"?(255&v)==v?m.push(v):(m.push(v>>>8),m.push(255&v)):m.push(c)}}return m}};var x,S,D,O,N,z={L:1,M:0,Q:3,H:2},F=(x=[[],[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,D=7973,N=function(k){for(var C=0;k!=0;)C+=1,k>>>=1;return C},(O={}).getBCHTypeInfo=function(k){for(var C=k<<10;N(C)-N(S)>=0;)C^=S<<N(C)-N(S);return 21522^(k<<10|C)},O.getBCHTypeNumber=function(k){for(var C=k<<12;N(C)-N(D)>=0;)C^=D<<N(C)-N(D);return k<<12|C},O.getPatternPosition=function(k){return x[k-1]},O.getMaskFunction=function(k){switch(k){case 0:return function(C,b){return(C+b)%2==0};case 1:return function(C,b){return C%2==0};case 2:return function(C,b){return b%3==0};case 3:return function(C,b){return(C+b)%3==0};case 4:return function(C,b){return(Math.floor(C/2)+Math.floor(b/3))%2==0};case 5:return function(C,b){return C*b%2+C*b%3==0};case 6:return function(C,b){return(C*b%2+C*b%3)%2==0};case 7:return function(C,b){return(C*b%3+(C+b)%2)%2==0};default:throw"bad maskPattern:"+k}},O.getErrorCorrectPolynomial=function(k){for(var C=U([1],0),b=0;b<k;b+=1)C=C.multiply(U([1,q.gexp(b)],0));return C},O.getLengthInBits=function(k,C){if(1<=C&&C<10)switch(k){case 1:return 10;case 2:return 9;case 4:case 8:return 8;default:throw"mode:"+k}else if(C<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(!(C<41))throw"type:"+C;switch(k){case 1:return 14;case 2:return 13;case 4:return 16;case 8:return 12;default:throw"mode:"+k}}},O.getLostPoint=function(k){for(var C=k.getModuleCount(),b=0,c=0;c<C;c+=1)for(var d=0;d<C;d+=1){for(var m=0,f=k.isDark(c,d),i=-1;i<=1;i+=1)if(!(c+i<0||C<=c+i))for(var v=-1;v<=1;v+=1)d+v<0||C<=d+v||i==0&&v==0||f==k.isDark(c+i,d+v)&&(m+=1);m>5&&(b+=3+m-5)}for(c=0;c<C-1;c+=1)for(d=0;d<C-1;d+=1){var E=0;k.isDark(c,d)&&(E+=1),k.isDark(c+1,d)&&(E+=1),k.isDark(c,d+1)&&(E+=1),k.isDark(c+1,d+1)&&(E+=1),E!=0&&E!=4||(b+=3)}for(c=0;c<C;c+=1)for(d=0;d<C-6;d+=1)k.isDark(c,d)&&!k.isDark(c,d+1)&&k.isDark(c,d+2)&&k.isDark(c,d+3)&&k.isDark(c,d+4)&&!k.isDark(c,d+5)&&k.isDark(c,d+6)&&(b+=40);for(d=0;d<C;d+=1)for(c=0;c<C-6;c+=1)k.isDark(c,d)&&!k.isDark(c+1,d)&&k.isDark(c+2,d)&&k.isDark(c+3,d)&&k.isDark(c+4,d)&&!k.isDark(c+5,d)&&k.isDark(c+6,d)&&(b+=40);var j=0;for(d=0;d<C;d+=1)for(c=0;c<C;c+=1)k.isDark(c,d)&&(j+=1);return b+Math.abs(100*j/C/C-50)/5*10},O),q=(function(){for(var k=new Array(256),C=new Array(256),b=0;b<8;b+=1)k[b]=1<<b;for(b=8;b<256;b+=1)k[b]=k[b-4]^k[b-5]^k[b-6]^k[b-8];for(b=0;b<255;b+=1)C[k[b]]=b;return{glog:function(c){if(c<1)throw"glog("+c+")";return C[c]},gexp:function(c){for(;c<0;)c+=255;for(;c>=256;)c-=255;return k[c]}}})();function U(k,C){if(k.length===void 0)throw k.length+"/"+C;var b=(function(){for(var d=0;d<k.length&&k[d]==0;)d+=1;for(var m=new Array(k.length-d+C),f=0;f<k.length-d;f+=1)m[f]=k[f+d];return m})(),c={getAt:function(d){return b[d]},getLength:function(){return b.length},multiply:function(d){for(var m=new Array(c.getLength()+d.getLength()-1),f=0;f<c.getLength();f+=1)for(var i=0;i<d.getLength();i+=1)m[f+i]^=q.gexp(q.glog(c.getAt(f))+q.glog(d.getAt(i)));return U(m,0)},mod:function(d){if(c.getLength()-d.getLength()<0)return c;for(var m=q.glog(c.getAt(0))-q.glog(d.getAt(0)),f=new Array(c.getLength()),i=0;i<c.getLength();i+=1)f[i]=c.getAt(i);for(i=0;i<d.getLength();i+=1)f[i]^=q.gexp(q.glog(d.getAt(i))+m);return U(f,0).mod(d)}};return c}var ee=(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]],C=function(c,d){var m={};return m.totalCount=c,m.dataCount=d,m},b={getRSBlocks:function(c,d){var m=(function(te,Z){switch(Z){case z.L:return k[4*(te-1)+0];case z.M:return k[4*(te-1)+1];case z.Q:return k[4*(te-1)+2];case z.H:return k[4*(te-1)+3];default:return}})(c,d);if(m===void 0)throw"bad rs block @ typeNumber:"+c+"/errorCorrectionLevel:"+d;for(var f=m.length/3,i=[],v=0;v<f;v+=1)for(var E=m[3*v+0],j=m[3*v+1],Q=m[3*v+2],J=0;J<E;J+=1)i.push(C(j,Q));return i}};return b})(),re=function(){var k=[],C=0,b={getBuffer:function(){return k},getAt:function(c){var d=Math.floor(c/8);return(k[d]>>>7-c%8&1)==1},put:function(c,d){for(var m=0;m<d;m+=1)b.putBit((c>>>d-m-1&1)==1)},getLengthInBits:function(){return C},putBit:function(c){var d=Math.floor(C/8);k.length<=d&&k.push(0),c&&(k[d]|=128>>>C%8),C+=1}};return b},X=function(k){var C=k,b={getMode:function(){return 1},getLength:function(m){return C.length},write:function(m){for(var f=C,i=0;i+2<f.length;)m.put(c(f.substring(i,i+3)),10),i+=3;i<f.length&&(f.length-i==1?m.put(c(f.substring(i,i+1)),4):f.length-i==2&&m.put(c(f.substring(i,i+2)),7))}},c=function(m){for(var f=0,i=0;i<m.length;i+=1)f=10*f+d(m.charAt(i));return f},d=function(m){if("0"<=m&&m<="9")return m.charCodeAt(0)-48;throw"illegal char :"+m};return b},V=function(k){var C=k,b={getMode:function(){return 2},getLength:function(d){return C.length},write:function(d){for(var m=C,f=0;f+1<m.length;)d.put(45*c(m.charAt(f))+c(m.charAt(f+1)),11),f+=2;f<m.length&&d.put(c(m.charAt(f)),6)}},c=function(d){if("0"<=d&&d<="9")return d.charCodeAt(0)-48;if("A"<=d&&d<="Z")return d.charCodeAt(0)-65+10;switch(d){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 :"+d}};return b},H=function(k){var C=P.stringToBytes(k);return{getMode:function(){return 4},getLength:function(b){return C.length},write:function(b){for(var c=0;c<C.length;c+=1)b.put(C[c],8)}}},K=function(k){var C=P.stringToBytesFuncs.SJIS;if(!C)throw"sjis not supported.";(function(){var d=C("友");if(d.length!=2||(d[0]<<8|d[1])!=38726)throw"sjis not supported."})();var b=C(k),c={getMode:function(){return 8},getLength:function(d){return~~(b.length/2)},write:function(d){for(var m=b,f=0;f+1<m.length;){var i=(255&m[f])<<8|255&m[f+1];if(33088<=i&&i<=40956)i-=33088;else{if(!(57408<=i&&i<=60351))throw"illegal char at "+(f+1)+"/"+i;i-=49472}i=192*(i>>>8&255)+(255&i),d.put(i,13),f+=2}if(f<m.length)throw"illegal char at "+(f+1)}};return c},W=function(){var k=[],C={writeByte:function(b){k.push(255&b)},writeShort:function(b){C.writeByte(b),C.writeByte(b>>>8)},writeBytes:function(b,c,d){c=c||0,d=d||b.length;for(var m=0;m<d;m+=1)C.writeByte(b[m+c])},writeString:function(b){for(var c=0;c<b.length;c+=1)C.writeByte(b.charCodeAt(c))},toByteArray:function(){return k},toString:function(){var b="";b+="[";for(var c=0;c<k.length;c+=1)c>0&&(b+=","),b+=k[c];return b+"]"}};return C},oe=function(k){var C=k,b=0,c=0,d=0,m={read:function(){for(;d<8;){if(b>=C.length){if(d==0)return-1;throw"unexpected end of file./"+d}var i=C.charAt(b);if(b+=1,i=="=")return d=0,-1;i.match(/^\s$/)||(c=c<<6|f(i.charCodeAt(0)),d+=6)}var v=c>>>d-8&255;return d-=8,v}},f=function(i){if(65<=i&&i<=90)return i-65;if(97<=i&&i<=122)return i-97+26;if(48<=i&&i<=57)return i-48+52;if(i==43)return 62;if(i==47)return 63;throw"c:"+i};return m},se=function(k,C,b){for(var c=(function(j,Q){var J=j,te=Q,Z=new Array(j*Q),ae={setPixel:function(A,L,$){Z[L*J+A]=$},write:function(A){A.writeString("GIF87a"),A.writeShort(J),A.writeShort(te),A.writeByte(128),A.writeByte(0),A.writeByte(0),A.writeByte(0),A.writeByte(0),A.writeByte(0),A.writeByte(255),A.writeByte(255),A.writeByte(255),A.writeString(","),A.writeShort(0),A.writeShort(0),A.writeShort(J),A.writeShort(te),A.writeByte(0);var L=ie(2);A.writeByte(2);for(var $=0;L.length-$>255;)A.writeByte(255),A.writeBytes(L,$,255),$+=255;A.writeByte(L.length-$),A.writeBytes(L,$,L.length-$),A.writeByte(0),A.writeString(";")}},ie=function(A){for(var L=1<<A,$=1+(1<<A),I=A+1,Y=ue(),ce=0;ce<L;ce+=1)Y.add(String.fromCharCode(ce));Y.add(String.fromCharCode(L)),Y.add(String.fromCharCode($));var o,l,p,M=W(),R=(o=M,l=0,p=0,{write:function(pe,ne){if(pe>>>ne)throw"length over";for(;l+ne>=8;)o.writeByte(255&(pe<<l|p)),ne-=8-l,pe>>>=8-l,p=0,l=0;p|=pe<<l,l+=ne},flush:function(){l>0&&o.writeByte(p)}});R.write(L,I);var B=0,le=String.fromCharCode(Z[B]);for(B+=1;B<Z.length;){var he=String.fromCharCode(Z[B]);B+=1,Y.contains(le+he)?le+=he:(R.write(Y.indexOf(le),I),Y.size()<4095&&(Y.size()==1<<I&&(I+=1),Y.add(le+he)),le=he)}return R.write(Y.indexOf(le),I),R.write($,I),R.flush(),M.toByteArray()},ue=function(){var A={},L=0,$={add:function(I){if($.contains(I))throw"dup key:"+I;A[I]=L,L+=1},size:function(){return L},indexOf:function(I){return A[I]},contains:function(I){return A[I]!==void 0}};return $};return ae})(k,C),d=0;d<C;d+=1)for(var m=0;m<k;m+=1)c.setPixel(m,d,b(m,d));var f=W();c.write(f);for(var i=(function(){var j=0,Q=0,J=0,te="",Z={},ae=function(ue){te+=String.fromCharCode(ie(63&ue))},ie=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 Z.writeByte=function(ue){for(j=j<<8|255&ue,Q+=8,J+=1;Q>=6;)ae(j>>>Q-6),Q-=6},Z.flush=function(){if(Q>0&&(ae(j<<6-Q),j=0,Q=0),J%3!=0)for(var ue=3-J%3,A=0;A<ue;A+=1)te+="="},Z.toString=function(){return te},Z})(),v=f.toByteArray(),E=0;E<v.length;E+=1)i.writeByte(v[E]);return i.flush(),"data:image/gif;base64,"+i};return P})();_.stringToBytesFuncs["UTF-8"]=function(P){return(function(x){for(var S=[],D=0;D<x.length;D++){var O=x.charCodeAt(D);O<128?S.push(O):O<2048?S.push(192|O>>6,128|63&O):O<55296||O>=57344?S.push(224|O>>12,128|O>>6&63,128|63&O):(D++,O=65536+((1023&O)<<10|1023&x.charCodeAt(D)),S.push(240|O>>18,128|O>>12&63,128|O>>6&63,128|63&O))}return S})(P)},(y=typeof(g=function(){return _})=="function"?g.apply(a,[]):g)===void 0||(h.exports=y)}},n={};function s(h){var a=n[h];if(a!==void 0)return a.exports;var g=n[h]={exports:{}};return r[h](g,g.exports,s),g.exports}s.n=h=>{var a=h&&h.__esModule?()=>h.default:()=>h;return s.d(a,{a}),a},s.d=(h,a)=>{for(var g in a)s.o(a,g)&&!s.o(h,g)&&Object.defineProperty(h,g,{enumerable:!0,get:a[g]})},s.o=(h,a)=>Object.prototype.hasOwnProperty.call(h,a);var u={};return(()=>{s.d(u,{default:()=>C});const h=b=>!!b&&typeof b=="object"&&!Array.isArray(b);function a(b,...c){if(!c.length)return b;const d=c.shift();return d!==void 0&&h(b)&&h(d)?(b=Object.assign({},b),Object.keys(d).forEach(m=>{const f=b[m],i=d[m];Array.isArray(f)&&Array.isArray(i)?b[m]=i:h(f)&&h(i)?b[m]=a(Object.assign({},f),i):b[m]=i}),a(b,...c)):b}function g(b,c){const d=document.createElement("a");d.download=c,d.href=b,document.body.appendChild(d),d.click(),document.body.removeChild(d)}const y={L:.07,M:.15,Q:.25,H:.3};class _{constructor({svg:c,type:d,window:m}){this._svg=c,this._type=d,this._window=m}draw(c,d,m,f){let i;switch(this._type){case"dots":i=this._drawDot;break;case"classy":i=this._drawClassy;break;case"classy-rounded":i=this._drawClassyRounded;break;case"rounded":i=this._drawRounded;break;case"extra-rounded":i=this._drawExtraRounded;break;default:i=this._drawSquare}i.call(this,{x:c,y:d,size:m,getNeighbor:f})}_rotateFigure({x:c,y:d,size:m,rotation:f=0,draw:i}){var v;const E=c+m/2,j=d+m/2;i(),(v=this._element)===null||v===void 0||v.setAttribute("transform",`rotate(${180*f/Math.PI},${E},${j})`)}_basicDot(c){const{size:d,x:m,y:f}=c;this._rotateFigure(Object.assign(Object.assign({},c),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(m+d/2)),this._element.setAttribute("cy",String(f+d/2)),this._element.setAttribute("r",String(d/2))}}))}_basicSquare(c){const{size:d,x:m,y:f}=c;this._rotateFigure(Object.assign(Object.assign({},c),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(m)),this._element.setAttribute("y",String(f)),this._element.setAttribute("width",String(d)),this._element.setAttribute("height",String(d))}}))}_basicSideRounded(c){const{size:d,x:m,y:f}=c;this._rotateFigure(Object.assign(Object.assign({},c),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${m} ${f}v ${d}h `+d/2+`a ${d/2} ${d/2}, 0, 0, 0, 0 ${-d}`)}}))}_basicCornerRounded(c){const{size:d,x:m,y:f}=c;this._rotateFigure(Object.assign(Object.assign({},c),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${m} ${f}v ${d}h ${d}v `+-d/2+`a ${d/2} ${d/2}, 0, 0, 0, ${-d/2} ${-d/2}`)}}))}_basicCornerExtraRounded(c){const{size:d,x:m,y:f}=c;this._rotateFigure(Object.assign(Object.assign({},c),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${m} ${f}v ${d}h ${d}a ${d} ${d}, 0, 0, 0, ${-d} ${-d}`)}}))}_basicCornersRounded(c){const{size:d,x:m,y:f}=c;this._rotateFigure(Object.assign(Object.assign({},c),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${m} ${f}v `+d/2+`a ${d/2} ${d/2}, 0, 0, 0, ${d/2} ${d/2}h `+d/2+"v "+-d/2+`a ${d/2} ${d/2}, 0, 0, 0, ${-d/2} ${-d/2}`)}}))}_drawDot({x:c,y:d,size:m}){this._basicDot({x:c,y:d,size:m,rotation:0})}_drawSquare({x:c,y:d,size:m}){this._basicSquare({x:c,y:d,size:m,rotation:0})}_drawRounded({x:c,y:d,size:m,getNeighbor:f}){const i=f?+f(-1,0):0,v=f?+f(1,0):0,E=f?+f(0,-1):0,j=f?+f(0,1):0,Q=i+v+E+j;if(Q!==0)if(Q>2||i&&v||E&&j)this._basicSquare({x:c,y:d,size:m,rotation:0});else{if(Q===2){let J=0;return i&&E?J=Math.PI/2:E&&v?J=Math.PI:v&&j&&(J=-Math.PI/2),void this._basicCornerRounded({x:c,y:d,size:m,rotation:J})}if(Q===1){let J=0;return E?J=Math.PI/2:v?J=Math.PI:j&&(J=-Math.PI/2),void this._basicSideRounded({x:c,y:d,size:m,rotation:J})}}else this._basicDot({x:c,y:d,size:m,rotation:0})}_drawExtraRounded({x:c,y:d,size:m,getNeighbor:f}){const i=f?+f(-1,0):0,v=f?+f(1,0):0,E=f?+f(0,-1):0,j=f?+f(0,1):0,Q=i+v+E+j;if(Q!==0)if(Q>2||i&&v||E&&j)this._basicSquare({x:c,y:d,size:m,rotation:0});else{if(Q===2){let J=0;return i&&E?J=Math.PI/2:E&&v?J=Math.PI:v&&j&&(J=-Math.PI/2),void this._basicCornerExtraRounded({x:c,y:d,size:m,rotation:J})}if(Q===1){let J=0;return E?J=Math.PI/2:v?J=Math.PI:j&&(J=-Math.PI/2),void this._basicSideRounded({x:c,y:d,size:m,rotation:J})}}else this._basicDot({x:c,y:d,size:m,rotation:0})}_drawClassy({x:c,y:d,size:m,getNeighbor:f}){const i=f?+f(-1,0):0,v=f?+f(1,0):0,E=f?+f(0,-1):0,j=f?+f(0,1):0;i+v+E+j!==0?i||E?v||j?this._basicSquare({x:c,y:d,size:m,rotation:0}):this._basicCornerRounded({x:c,y:d,size:m,rotation:Math.PI/2}):this._basicCornerRounded({x:c,y:d,size:m,rotation:-Math.PI/2}):this._basicCornersRounded({x:c,y:d,size:m,rotation:Math.PI/2})}_drawClassyRounded({x:c,y:d,size:m,getNeighbor:f}){const i=f?+f(-1,0):0,v=f?+f(1,0):0,E=f?+f(0,-1):0,j=f?+f(0,1):0;i+v+E+j!==0?i||E?v||j?this._basicSquare({x:c,y:d,size:m,rotation:0}):this._basicCornerExtraRounded({x:c,y:d,size:m,rotation:Math.PI/2}):this._basicCornerExtraRounded({x:c,y:d,size:m,rotation:-Math.PI/2}):this._basicCornersRounded({x:c,y:d,size:m,rotation:Math.PI/2})}}const P={dot:"dot",square:"square",extraRounded:"extra-rounded"},x=Object.values(P);class S{constructor({svg:c,type:d,window:m}){this._svg=c,this._type=d,this._window=m}draw(c,d,m,f){let i;switch(this._type){case P.square:i=this._drawSquare;break;case P.extraRounded:i=this._drawExtraRounded;break;default:i=this._drawDot}i.call(this,{x:c,y:d,size:m,rotation:f})}_rotateFigure({x:c,y:d,size:m,rotation:f=0,draw:i}){var v;const E=c+m/2,j=d+m/2;i(),(v=this._element)===null||v===void 0||v.setAttribute("transform",`rotate(${180*f/Math.PI},${E},${j})`)}_basicDot(c){const{size:d,x:m,y:f}=c,i=d/7;this._rotateFigure(Object.assign(Object.assign({},c),{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 ${m+d/2} ${f}a ${d/2} ${d/2} 0 1 0 0.1 0zm 0 ${i}a ${d/2-i} ${d/2-i} 0 1 1 -0.1 0Z`)}}))}_basicSquare(c){const{size:d,x:m,y:f}=c,i=d/7;this._rotateFigure(Object.assign(Object.assign({},c),{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 ${m} ${f}v ${d}h ${d}v `+-d+`zM ${m+i} ${f+i}h `+(d-2*i)+"v "+(d-2*i)+"h "+(2*i-d)+"z")}}))}_basicExtraRounded(c){const{size:d,x:m,y:f}=c,i=d/7;this._rotateFigure(Object.assign(Object.assign({},c),{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 ${m} ${f+2.5*i}v `+2*i+`a ${2.5*i} ${2.5*i}, 0, 0, 0, ${2.5*i} ${2.5*i}h `+2*i+`a ${2.5*i} ${2.5*i}, 0, 0, 0, ${2.5*i} ${2.5*-i}v `+-2*i+`a ${2.5*i} ${2.5*i}, 0, 0, 0, ${2.5*-i} ${2.5*-i}h `+-2*i+`a ${2.5*i} ${2.5*i}, 0, 0, 0, ${2.5*-i} ${2.5*i}M ${m+2.5*i} ${f+i}h `+2*i+`a ${1.5*i} ${1.5*i}, 0, 0, 1, ${1.5*i} ${1.5*i}v `+2*i+`a ${1.5*i} ${1.5*i}, 0, 0, 1, ${1.5*-i} ${1.5*i}h `+-2*i+`a ${1.5*i} ${1.5*i}, 0, 0, 1, ${1.5*-i} ${1.5*-i}v `+-2*i+`a ${1.5*i} ${1.5*i}, 0, 0, 1, ${1.5*i} ${1.5*-i}`)}}))}_drawDot({x:c,y:d,size:m,rotation:f}){this._basicDot({x:c,y:d,size:m,rotation:f})}_drawSquare({x:c,y:d,size:m,rotation:f}){this._basicSquare({x:c,y:d,size:m,rotation:f})}_drawExtraRounded({x:c,y:d,size:m,rotation:f}){this._basicExtraRounded({x:c,y:d,size:m,rotation:f})}}const D={dot:"dot",square:"square"},O=Object.values(D);class N{constructor({svg:c,type:d,window:m}){this._svg=c,this._type=d,this._window=m}draw(c,d,m,f){let i;i=this._type===D.square?this._drawSquare:this._drawDot,i.call(this,{x:c,y:d,size:m,rotation:f})}_rotateFigure({x:c,y:d,size:m,rotation:f=0,draw:i}){var v;const E=c+m/2,j=d+m/2;i(),(v=this._element)===null||v===void 0||v.setAttribute("transform",`rotate(${180*f/Math.PI},${E},${j})`)}_basicDot(c){const{size:d,x:m,y:f}=c;this._rotateFigure(Object.assign(Object.assign({},c),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(m+d/2)),this._element.setAttribute("cy",String(f+d/2)),this._element.setAttribute("r",String(d/2))}}))}_basicSquare(c){const{size:d,x:m,y:f}=c;this._rotateFigure(Object.assign(Object.assign({},c),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(m)),this._element.setAttribute("y",String(f)),this._element.setAttribute("width",String(d)),this._element.setAttribute("height",String(d))}}))}_drawDot({x:c,y:d,size:m,rotation:f}){this._basicDot({x:c,y:d,size:m,rotation:f})}_drawSquare({x:c,y:d,size:m,rotation:f}){this._basicSquare({x:c,y:d,size:m,rotation:f})}}const z="circle",F=[[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(c,d){this._roundSize=m=>this._options.dotsOptions.roundSize?Math.floor(m):m,this._window=d,this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("width",String(c.width)),this._element.setAttribute("height",String(c.height)),this._element.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),c.dotsOptions.roundSize||this._element.setAttribute("shape-rendering","crispEdges"),this._element.setAttribute("viewBox",`0 0 ${c.width} ${c.height}`),this._defs=this._window.document.createElementNS("http://www.w3.org/2000/svg","defs"),this._element.appendChild(this._defs),this._imageUri=c.image,this._instanceId=U.instanceCount++,this._options=c}get width(){return this._options.width}get height(){return this._options.height}getElement(){return this._element}async drawQR(c){const d=c.getModuleCount(),m=Math.min(this._options.width,this._options.height)-2*this._options.margin,f=this._options.shape===z?m/Math.sqrt(2):m,i=this._roundSize(f/d);let v={hideXDots:0,hideYDots:0,width:0,height:0};if(this._qr=c,this._options.image){if(await this.loadImage(),!this._image)return;const{imageOptions:E,qrOptions:j}=this._options,Q=E.imageSize*y[j.errorCorrectionLevel],J=Math.floor(Q*d*d);v=(function({originalHeight:te,originalWidth:Z,maxHiddenDots:ae,maxHiddenAxisDots:ie,dotSize:ue}){const A={x:0,y:0},L={x:0,y:0};if(te<=0||Z<=0||ae<=0||ue<=0)return{height:0,width:0,hideYDots:0,hideXDots:0};const $=te/Z;return A.x=Math.floor(Math.sqrt(ae/$)),A.x<=0&&(A.x=1),ie&&ie<A.x&&(A.x=ie),A.x%2==0&&A.x--,L.x=A.x*ue,A.y=1+2*Math.ceil((A.x*$-1)/2),L.y=Math.round(L.x*$),(A.y*A.x>ae||ie&&ie<A.y)&&(ie&&ie<A.y?(A.y=ie,A.y%2==0&&A.x--):A.y-=2,L.y=A.y*ue,A.x=1+2*Math.ceil((A.y/$-1)/2),L.x=Math.round(L.y/$)),{height:L.y,width:L.x,hideYDots:A.y,hideXDots:A.x}})({originalWidth:this._image.width,originalHeight:this._image.height,maxHiddenDots:J,maxHiddenAxisDots:d-14,dotSize:i})}this.drawBackground(),this.drawDots((E,j)=>{var Q,J,te,Z,ae,ie;return!(this._options.imageOptions.hideBackgroundDots&&E>=(d-v.hideYDots)/2&&E<(d+v.hideYDots)/2&&j>=(d-v.hideXDots)/2&&j<(d+v.hideXDots)/2||!((Q=F[E])===null||Q===void 0)&&Q[j]||!((J=F[E-d+7])===null||J===void 0)&&J[j]||!((te=F[E])===null||te===void 0)&&te[j-d+7]||!((Z=q[E])===null||Z===void 0)&&Z[j]||!((ae=q[E-d+7])===null||ae===void 0)&&ae[j]||!((ie=q[E])===null||ie===void 0)&&ie[j-d+7])}),this.drawCorners(),this._options.image&&await this.drawImage({width:v.width,height:v.height,count:d,dotSize:i})}drawBackground(){var c,d,m;const f=this._element,i=this._options;if(f){const v=(c=i.backgroundOptions)===null||c===void 0?void 0:c.gradient,E=(d=i.backgroundOptions)===null||d===void 0?void 0:d.color;let j=i.height,Q=i.width;if(v||E){const J=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),!((m=i.backgroundOptions)===null||m===void 0)&&m.round&&(j=Q=Math.min(i.width,i.height),J.setAttribute("rx",String(j/2*i.backgroundOptions.round))),J.setAttribute("x",String(this._roundSize((i.width-Q)/2))),J.setAttribute("y",String(this._roundSize((i.height-j)/2))),J.setAttribute("width",String(Q)),J.setAttribute("height",String(j)),this._backgroundClipPath.appendChild(J),this._createColor({options:v,color:E,additionalRotation:0,x:0,y:0,height:i.height,width:i.width,name:`background-color-${this._instanceId}`})}}}drawDots(c){var d,m;if(!this._qr)throw"QR code is not defined";const f=this._options,i=this._qr.getModuleCount();if(i>f.width||i>f.height)throw"The canvas is too small.";const v=Math.min(f.width,f.height)-2*f.margin,E=f.shape===z?v/Math.sqrt(2):v,j=this._roundSize(E/i),Q=this._roundSize((f.width-i*j)/2),J=this._roundSize((f.height-i*j)/2),te=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:(d=f.dotsOptions)===null||d===void 0?void 0:d.gradient,color:f.dotsOptions.color,additionalRotation:0,x:0,y:0,height:f.height,width:f.width,name:`dot-color-${this._instanceId}`});for(let Z=0;Z<i;Z++)for(let ae=0;ae<i;ae++)c&&!c(Z,ae)||!((m=this._qr)===null||m===void 0)&&m.isDark(Z,ae)&&(te.draw(Q+ae*j,J+Z*j,j,(ie,ue)=>!(ae+ie<0||Z+ue<0||ae+ie>=i||Z+ue>=i)&&!(c&&!c(Z+ue,ae+ie))&&!!this._qr&&this._qr.isDark(Z+ue,ae+ie)),te._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(te._element));if(f.shape===z){const Z=this._roundSize((v/j-i)/2),ae=i+2*Z,ie=Q-Z*j,ue=J-Z*j,A=[],L=this._roundSize(ae/2);for(let $=0;$<ae;$++){A[$]=[];for(let I=0;I<ae;I++)$>=Z-1&&$<=ae-Z&&I>=Z-1&&I<=ae-Z||Math.sqrt(($-L)*($-L)+(I-L)*(I-L))>L?A[$][I]=0:A[$][I]=this._qr.isDark(I-2*Z<0?I:I>=i?I-2*Z:I-Z,$-2*Z<0?$:$>=i?$-2*Z:$-Z)?1:0}for(let $=0;$<ae;$++)for(let I=0;I<ae;I++)A[$][I]&&(te.draw(ie+I*j,ue+$*j,j,(Y,ce)=>{var o;return!!(!((o=A[$+ce])===null||o===void 0)&&o[I+Y])}),te._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(te._element))}}drawCorners(){if(!this._qr)throw"QR code is not defined";const c=this._element,d=this._options;if(!c)throw"Element code is not defined";const m=this._qr.getModuleCount(),f=Math.min(d.width,d.height)-2*d.margin,i=d.shape===z?f/Math.sqrt(2):f,v=this._roundSize(i/m),E=7*v,j=3*v,Q=this._roundSize((d.width-m*v)/2),J=this._roundSize((d.height-m*v)/2);[[0,0,0],[1,0,Math.PI/2],[0,1,-Math.PI/2]].forEach(([te,Z,ae])=>{var ie,ue,A,L,$,I,Y,ce,o,l,p,M,R,B;const le=Q+te*v*(m-7),he=J+Z*v*(m-7);let pe=this._dotsClipPath,ne=this._dotsClipPath;if((!((ie=d.cornersSquareOptions)===null||ie===void 0)&&ie.gradient||!((ue=d.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-${te}-${Z}-${this._instanceId}`),this._defs.appendChild(pe),this._cornersSquareClipPath=this._cornersDotClipPath=ne=pe,this._createColor({options:(A=d.cornersSquareOptions)===null||A===void 0?void 0:A.gradient,color:(L=d.cornersSquareOptions)===null||L===void 0?void 0:L.color,additionalRotation:ae,x:le,y:he,height:E,width:E,name:`corners-square-color-${te}-${Z}-${this._instanceId}`})),(($=d.cornersSquareOptions)===null||$===void 0?void 0:$.type)&&x.includes(d.cornersSquareOptions.type)){const fe=new S({svg:this._element,type:d.cornersSquareOptions.type,window:this._window});fe.draw(le,he,E,ae),fe._element&&pe&&pe.appendChild(fe._element)}else{const fe=new _({svg:this._element,type:((I=d.cornersSquareOptions)===null||I===void 0?void 0:I.type)||d.dotsOptions.type,window:this._window});for(let me=0;me<F.length;me++)for(let ge=0;ge<F[me].length;ge++)!((Y=F[me])===null||Y===void 0)&&Y[ge]&&(fe.draw(le+ge*v,he+me*v,v,(xe,Ce)=>{var Se;return!!(!((Se=F[me+Ce])===null||Se===void 0)&&Se[ge+xe])}),fe._element&&pe&&pe.appendChild(fe._element))}if((!((ce=d.cornersDotOptions)===null||ce===void 0)&&ce.gradient||!((o=d.cornersDotOptions)===null||o===void 0)&&o.color)&&(ne=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),ne.setAttribute("id",`clip-path-corners-dot-color-${te}-${Z}-${this._instanceId}`),this._defs.appendChild(ne),this._cornersDotClipPath=ne,this._createColor({options:(l=d.cornersDotOptions)===null||l===void 0?void 0:l.gradient,color:(p=d.cornersDotOptions)===null||p===void 0?void 0:p.color,additionalRotation:ae,x:le+2*v,y:he+2*v,height:j,width:j,name:`corners-dot-color-${te}-${Z}-${this._instanceId}`})),((M=d.cornersDotOptions)===null||M===void 0?void 0:M.type)&&O.includes(d.cornersDotOptions.type)){const fe=new N({svg:this._element,type:d.cornersDotOptions.type,window:this._window});fe.draw(le+2*v,he+2*v,j,ae),fe._element&&ne&&ne.appendChild(fe._element)}else{const fe=new _({svg:this._element,type:((R=d.cornersDotOptions)===null||R===void 0?void 0:R.type)||d.dotsOptions.type,window:this._window});for(let me=0;me<q.length;me++)for(let ge=0;ge<q[me].length;ge++)!((B=q[me])===null||B===void 0)&&B[ge]&&(fe.draw(le+ge*v,he+me*v,v,(xe,Ce)=>{var Se;return!!(!((Se=q[me+Ce])===null||Se===void 0)&&Se[ge+xe])}),fe._element&&ne&&ne.appendChild(fe._element))}})}loadImage(){return new Promise((c,d)=>{var m;const f=this._options;if(!f.image)return d("Image is not defined");if(!((m=f.nodeCanvas)===null||m===void 0)&&m.loadImage)f.nodeCanvas.loadImage(f.image).then(i=>{var v,E;if(this._image=i,this._options.imageOptions.saveAsBlob){const j=(v=f.nodeCanvas)===null||v===void 0?void 0:v.createCanvas(this._image.width,this._image.height);(E=j?.getContext("2d"))===null||E===void 0||E.drawImage(i,0,0),this._imageUri=j?.toDataURL()}c()}).catch(d);else{const i=new this._window.Image;typeof f.imageOptions.crossOrigin=="string"&&(i.crossOrigin=f.imageOptions.crossOrigin),this._image=i,i.onload=async()=>{this._options.imageOptions.saveAsBlob&&(this._imageUri=await(async function(v,E){return new Promise(j=>{const Q=new E.XMLHttpRequest;Q.onload=function(){const J=new E.FileReader;J.onloadend=function(){j(J.result)},J.readAsDataURL(Q.response)},Q.open("GET",v),Q.responseType="blob",Q.send()})})(f.image||"",this._window)),c()},i.src=f.image}})}async drawImage({width:c,height:d,count:m,dotSize:f}){const i=this._options,v=this._roundSize((i.width-m*f)/2),E=this._roundSize((i.height-m*f)/2),j=v+this._roundSize(i.imageOptions.margin+(m*f-c)/2),Q=E+this._roundSize(i.imageOptions.margin+(m*f-d)/2),J=c-2*i.imageOptions.margin,te=d-2*i.imageOptions.margin,Z=this._window.document.createElementNS("http://www.w3.org/2000/svg","image");Z.setAttribute("href",this._imageUri||""),Z.setAttribute("xlink:href",this._imageUri||""),Z.setAttribute("x",String(j)),Z.setAttribute("y",String(Q)),Z.setAttribute("width",`${J}px`),Z.setAttribute("height",`${te}px`),this._element.appendChild(Z)}_createColor({options:c,color:d,additionalRotation:m,x:f,y:i,height:v,width:E,name:j}){const Q=E>v?E:v,J=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");if(J.setAttribute("x",String(f)),J.setAttribute("y",String(i)),J.setAttribute("height",String(v)),J.setAttribute("width",String(E)),J.setAttribute("clip-path",`url('#clip-path-${j}')`),c){let te;if(c.type==="radial")te=this._window.document.createElementNS("http://www.w3.org/2000/svg","radialGradient"),te.setAttribute("id",j),te.setAttribute("gradientUnits","userSpaceOnUse"),te.setAttribute("fx",String(f+E/2)),te.setAttribute("fy",String(i+v/2)),te.setAttribute("cx",String(f+E/2)),te.setAttribute("cy",String(i+v/2)),te.setAttribute("r",String(Q/2));else{const Z=((c.rotation||0)+m)%(2*Math.PI),ae=(Z+2*Math.PI)%(2*Math.PI);let ie=f+E/2,ue=i+v/2,A=f+E/2,L=i+v/2;ae>=0&&ae<=.25*Math.PI||ae>1.75*Math.PI&&ae<=2*Math.PI?(ie-=E/2,ue-=v/2*Math.tan(Z),A+=E/2,L+=v/2*Math.tan(Z)):ae>.25*Math.PI&&ae<=.75*Math.PI?(ue-=v/2,ie-=E/2/Math.tan(Z),L+=v/2,A+=E/2/Math.tan(Z)):ae>.75*Math.PI&&ae<=1.25*Math.PI?(ie+=E/2,ue+=v/2*Math.tan(Z),A-=E/2,L-=v/2*Math.tan(Z)):ae>1.25*Math.PI&&ae<=1.75*Math.PI&&(ue+=v/2,ie+=E/2/Math.tan(Z),L-=v/2,A-=E/2/Math.tan(Z)),te=this._window.document.createElementNS("http://www.w3.org/2000/svg","linearGradient"),te.setAttribute("id",j),te.setAttribute("gradientUnits","userSpaceOnUse"),te.setAttribute("x1",String(Math.round(ie))),te.setAttribute("y1",String(Math.round(ue))),te.setAttribute("x2",String(Math.round(A))),te.setAttribute("y2",String(Math.round(L)))}c.colorStops.forEach(({offset:Z,color:ae})=>{const ie=this._window.document.createElementNS("http://www.w3.org/2000/svg","stop");ie.setAttribute("offset",100*Z+"%"),ie.setAttribute("stop-color",ae),te.appendChild(ie)}),J.setAttribute("fill",`url('#${j}')`),this._defs.appendChild(te)}else d&&J.setAttribute("fill",d);this._element.appendChild(J)}}U.instanceCount=0;const ee=U,re="canvas",X={};for(let b=0;b<=40;b++)X[b]=b;const V={type:re,shape:"square",width:300,height:300,data:"",margin:0,qrOptions:{typeNumber:X[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 H(b){const c=Object.assign({},b);if(!c.colorStops||!c.colorStops.length)throw"Field 'colorStops' is required in gradient";return c.rotation?c.rotation=Number(c.rotation):c.rotation=0,c.colorStops=c.colorStops.map(d=>Object.assign(Object.assign({},d),{offset:Number(d.offset)})),c}function K(b){const c=Object.assign({},b);return c.width=Number(c.width),c.height=Number(c.height),c.margin=Number(c.margin),c.imageOptions=Object.assign(Object.assign({},c.imageOptions),{hideBackgroundDots:!!c.imageOptions.hideBackgroundDots,imageSize:Number(c.imageOptions.imageSize),margin:Number(c.imageOptions.margin)}),c.margin>Math.min(c.width,c.height)&&(c.margin=Math.min(c.width,c.height)),c.dotsOptions=Object.assign({},c.dotsOptions),c.dotsOptions.gradient&&(c.dotsOptions.gradient=H(c.dotsOptions.gradient)),c.cornersSquareOptions&&(c.cornersSquareOptions=Object.assign({},c.cornersSquareOptions),c.cornersSquareOptions.gradient&&(c.cornersSquareOptions.gradient=H(c.cornersSquareOptions.gradient))),c.cornersDotOptions&&(c.cornersDotOptions=Object.assign({},c.cornersDotOptions),c.cornersDotOptions.gradient&&(c.cornersDotOptions.gradient=H(c.cornersDotOptions.gradient))),c.backgroundOptions&&(c.backgroundOptions=Object.assign({},c.backgroundOptions),c.backgroundOptions.gradient&&(c.backgroundOptions.gradient=H(c.backgroundOptions.gradient))),c}var W=s(873),oe=s.n(W);function se(b){if(!b)throw new Error("Extension must be defined");b[0]==="."&&(b=b.substring(1));const c={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"}[b.toLowerCase()];if(!c)throw new Error(`Extension "${b}" is not supported`);return c}class k{constructor(c){c!=null&&c.jsdom?this._window=new c.jsdom("",{resources:"usable"}).window:this._window=window,this._options=c?K(a(V,c)):V,this.update()}static _clearContainer(c){c&&(c.innerHTML="")}_setupSvg(){if(!this._qr)return;const c=new ee(this._options,this._window);this._svg=c.getElement(),this._svgDrawingPromise=c.drawQR(this._qr).then(()=>{var d;this._svg&&((d=this._extension)===null||d===void 0||d.call(this,c.getElement(),this._options))})}_setupCanvas(){var c,d;this._qr&&(!((c=this._options.nodeCanvas)===null||c===void 0)&&c.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=(d=this._svgDrawingPromise)===null||d===void 0?void 0:d.then(()=>{var m;if(!this._svg)return;const f=this._svg,i=new this._window.XMLSerializer().serializeToString(f),v=btoa(i),E=`data:${se("svg")};base64,${v}`;if(!((m=this._options.nodeCanvas)===null||m===void 0)&&m.loadImage)return this._options.nodeCanvas.loadImage(E).then(j=>{var Q,J;j.width=this._options.width,j.height=this._options.height,(J=(Q=this._nodeCanvas)===null||Q===void 0?void 0:Q.getContext("2d"))===null||J===void 0||J.drawImage(j,0,0)});{const j=new this._window.Image;return new Promise(Q=>{j.onload=()=>{var J,te;(te=(J=this._domCanvas)===null||J===void 0?void 0:J.getContext("2d"))===null||te===void 0||te.drawImage(j,0,0),Q()},j.src=E})}}))}async _getElement(c="png"){if(!this._qr)throw"QR code is empty";return c.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(c){k._clearContainer(this._container),this._options=c?K(a(this._options,c)):this._options,this._options.data&&(this._qr=oe()(this._options.qrOptions.typeNumber,this._options.qrOptions.errorCorrectionLevel),this._qr.addData(this._options.data,this._options.qrOptions.mode||(function(d){switch(!0){case/^[0-9]*$/.test(d):return"Numeric";case/^[0-9A-Z $%*+\-./:]*$/.test(d):return"Alphanumeric";default:return"Byte"}})(this._options.data)),this._qr.make(),this._options.type===re?this._setupCanvas():this._setupSvg(),this.append(this._container))}append(c){if(c){if(typeof c.appendChild!="function")throw"Container should be a single DOM node";this._options.type===re?this._domCanvas&&c.appendChild(this._domCanvas):this._svg&&c.appendChild(this._svg),this._container=c}}applyExtension(c){if(!c)throw"Extension function should be defined.";this._extension=c,this.update()}deleteExtension(){this._extension=void 0,this.update()}async getRawData(c="png"){if(!this._qr)throw"QR code is empty";const d=await this._getElement(c),m=se(c);if(!d)return null;if(c.toLowerCase()==="svg"){const f=`<?xml version="1.0" standalone="no"?>\r
|
|
22
|
+
${new this._window.XMLSerializer().serializeToString(d)}`;return typeof Blob>"u"||this._options.jsdom?Buffer.from(f):new Blob([f],{type:m})}return new Promise(f=>{const i=d;if("toBuffer"in i)if(m==="image/png")f(i.toBuffer(m));else if(m==="image/jpeg")f(i.toBuffer(m));else{if(m!=="application/pdf")throw Error("Unsupported extension");f(i.toBuffer(m))}else"toBlob"in i&&i.toBlob(f,m,1)})}async download(c){if(!this._qr)throw"QR code is empty";if(typeof Blob>"u")throw"Cannot download in Node.js, call getRawData instead.";let d="png",m="qr";typeof c=="string"?(d=c,console.warn("Extension is deprecated as argument for 'download' method, please pass object { name: '...', extension: '...' } as argument")):typeof c=="object"&&c!==null&&(c.name&&(m=c.name),c.extension&&(d=c.extension));const f=await this._getElement(d);if(f)if(d.toLowerCase()==="svg"){let i=new XMLSerializer().serializeToString(f);i=`<?xml version="1.0" standalone="no"?>\r
|
|
23
|
+
`+i,g(`data:${se(d)};charset=utf-8,${encodeURIComponent(i)}`,`${m}.svg`)}else g(f.toDataURL(se(d)),`${m}.${d}`)}}const C=k})(),u.default})())})(rn)),rn.exports}fl();const Lo=G.createContext(void 0);function pl(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 h;e[3]!==r||e[4]!==s?(h=w.jsx(Gn,{client:s,children:r}),e[3]=r,e[4]=s,e[5]=h):h=e[5];let a;return e[6]!==u||e[7]!==h?(a=w.jsx(Lo.Provider,{value:u,children:h}),e[6]=u,e[7]=h,e[8]=a):a=e[8],a}function ct(){const t=G.useContext(Lo);if(!t)throw new Error("useDataTable must be used within a DataTableProvider");return t}function nn(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 Pt(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 gl(){const t=localStorage.getItem("a360.assumed-org");return t?{"X-Assume-Org":t}:{}}async function bt(){return{"Content-Type":"application/json",Authorization:`Bearer ${await rl()??""}`,...gl()}}async function Bo(t){return fetch(t,{method:"GET",headers:await bt()}).then(async e=>(e.status>=400&&await Pt(e),e)).then(e=>e.json()).then(e=>e)}async function Io(t,e){return fetch(`${t}/${e}`,{method:"GET",headers:await bt()}).then(async r=>(r.status>=400&&await Pt(r),r)).then(r=>r.json()).then(r=>r)}async function Yo(t,e){const r=await fetch(`${t}/${e}`,{method:"DELETE",headers:await bt()});r.status>=400&&await Pt(r)}async function zo(t,e){return fetch(t,{method:"POST",headers:await bt(),body:JSON.stringify(e)}).then(async r=>(r.status>=400&&await Pt(r),r)).then(r=>r.status==204?e:r.json()).then(r=>r)}async function ml(t,e,r){return fetch(e,{method:t,headers:await bt(),body:r?JSON.stringify(r):void 0}).then(async n=>(n.status>=400&&await Pt(n),n)).then(n=>{if(n.status!=204)return n.json()}).then(n=>n)}async function Fo(t,e){return fetch(`${t}/${e.id}`,{method:"PUT",headers:await bt(),body:JSON.stringify(e)}).then(async r=>(r.status>=400&&await Pt(r),r)).then(r=>r.status==204?e:r.json()).then(r=>r)}function Wo(t,e,r){const n=Ze.c(13),{baseUrl:s}=ct();let u;if(n[0]!==r||n[1]!==e){let y;n[3]!==r?(y=r?.toString(),n[3]=r,n[4]=y):y=n[4],u=[...e.map(yl),String(y)],n[0]=r,n[1]=e,n[2]=u}else u=n[2];let h;n[5]!==t||n[6]!==s||n[7]!==r?(h=()=>Io(`${s}${t}`,r),n[5]=t,n[6]=s,n[7]=r,n[8]=h):h=n[8];const a=!!r;let g;return n[9]!==u||n[10]!==h||n[11]!==a?(g={queryKey:u,queryFn:h,enabled:a},n[9]=u,n[10]=h,n[11]=a,n[12]=g):g=n[12],Kn(g)}function yl(t){return t.toString()}function Uo(t,e,r){const n=Ze.c(9),s=r===void 0?!0:r,{baseUrl:u}=ct();let h;n[0]!==e?(h=[...e.map(vl)],n[0]=e,n[1]=h):h=n[1];let a;n[2]!==t||n[3]!==u?(a=()=>Bo(`${u}${t}`),n[2]=t,n[3]=u,n[4]=a):a=n[4];let g;return n[5]!==s||n[6]!==h||n[7]!==a?(g={queryKey:h,queryFn:a,enabled:s},n[5]=s,n[6]=h,n[7]=a,n[8]=g):g=n[8],Kn(g)}function vl(t){return t.toString()}function qo(t,e){const r=Ze.c(10),{baseUrl:n,queryClient:s}=ct();let u;r[0]!==e?(u=[...e.map(wl)],r[0]=e,r[1]=u):u=r[1];let h;r[2]!==t||r[3]!==n?(h=g=>zo(`${n}${t}`,g),r[2]=t,r[3]=n,r[4]=h):h=r[4];let a;return r[5]!==s||r[6]!==e||r[7]!==u||r[8]!==h?(a={mutationKey:u,mutationFn:h,onSettled(){return s.invalidateQueries({queryKey:[...e.map(bl)]})},onError(g){nn(g)}},r[5]=s,r[6]=e,r[7]=u,r[8]=h,r[9]=a):a=r[9],Lr(a)}function bl(t){return t.toString()}function wl(t){return t.toString()}function on(t,e){const r=Ze.c(10),{baseUrl:n,queryClient:s}=ct();let u;r[0]!==e?(u=[...e.map(Cl)],r[0]=e,r[1]=u):u=r[1];let h;r[2]!==t||r[3]!==n?(h=g=>Fo(`${n}${t}`,g),r[2]=t,r[3]=n,r[4]=h):h=r[4];let a;return r[5]!==s||r[6]!==e||r[7]!==u||r[8]!==h?(a={mutationKey:u,mutationFn:h,onSettled(){return s.invalidateQueries({queryKey:[...e.map(_l)]})},onError(g){nn(g)}},r[5]=s,r[6]=e,r[7]=u,r[8]=h,r[9]=a):a=r[9],Lr(a)}function _l(t){return t.toString()}function Cl(t){return t.toString()}function Vo(t,e){const r=Ze.c(10),{baseUrl:n,queryClient:s}=ct();let u;r[0]!==e?(u=[...e.map(Sl)],r[0]=e,r[1]=u):u=r[1];let h;r[2]!==t||r[3]!==n?(h=g=>Yo(`${n}${t}`,g),r[2]=t,r[3]=n,r[4]=h):h=r[4];let a;return r[5]!==s||r[6]!==e||r[7]!==u||r[8]!==h?(a={mutationKey:u,mutationFn:h,onSettled(){return s.invalidateQueries({queryKey:[...e.map(xl)]})},onError(g){nn(g)}},r[5]=s,r[6]=e,r[7]=u,r[8]=h,r[9]=a):a=r[9],Lr(a)}function xl(t){return t.toString()}function Sl(t){return t.toString()}var lr={exports:{}},Dl=lr.exports,Ho;function kl(){return Ho||(Ho=1,(function(t,e){(function(r,n){t.exports=n()})(Dl,(function(){var r=1e3,n=6e4,s=36e5,u="millisecond",h="second",a="minute",g="hour",y="day",_="week",P="month",x="quarter",S="year",D="date",O="Invalid Date",N=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,z=/\[([^\]]+)]|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,F={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 C=["th","st","nd","rd"],b=k%100;return"["+k+(C[(b-20)%10]||C[b]||C[0])+"]"}},q=function(k,C,b){var c=String(k);return!c||c.length>=C?k:""+Array(C+1-c.length).join(b)+k},U={s:q,z:function(k){var C=-k.utcOffset(),b=Math.abs(C),c=Math.floor(b/60),d=b%60;return(C<=0?"+":"-")+q(c,2,"0")+":"+q(d,2,"0")},m:function k(C,b){if(C.date()<b.date())return-k(b,C);var c=12*(b.year()-C.year())+(b.month()-C.month()),d=C.clone().add(c,P),m=b-d<0,f=C.clone().add(c+(m?-1:1),P);return+(-(c+(b-d)/(m?d-f:f-d))||0)},a:function(k){return k<0?Math.ceil(k)||0:Math.floor(k)},p:function(k){return{M:P,y:S,w:_,d:y,D,h:g,m:a,s:h,ms:u,Q:x}[k]||String(k||"").toLowerCase().replace(/s$/,"")},u:function(k){return k===void 0}},ee="en",re={};re[ee]=F;var X="$isDayjsObject",V=function(k){return k instanceof oe||!(!k||!k[X])},H=function k(C,b,c){var d;if(!C)return ee;if(typeof C=="string"){var m=C.toLowerCase();re[m]&&(d=m),b&&(re[m]=b,d=m);var f=C.split("-");if(!d&&f.length>1)return k(f[0])}else{var i=C.name;re[i]=C,d=i}return!c&&d&&(ee=d),d||!c&&ee},K=function(k,C){if(V(k))return k.clone();var b=typeof C=="object"?C:{};return b.date=k,b.args=arguments,new oe(b)},W=U;W.l=H,W.i=V,W.w=function(k,C){return K(k,{locale:C.$L,utc:C.$u,x:C.$x,$offset:C.$offset})};var oe=(function(){function k(b){this.$L=H(b.locale,null,!0),this.parse(b),this.$x=this.$x||b.x||{},this[X]=!0}var C=k.prototype;return C.parse=function(b){this.$d=(function(c){var d=c.date,m=c.utc;if(d===null)return new Date(NaN);if(W.u(d))return new Date;if(d instanceof Date)return new Date(d);if(typeof d=="string"&&!/Z$/i.test(d)){var f=d.match(N);if(f){var i=f[2]-1||0,v=(f[7]||"0").substring(0,3);return m?new Date(Date.UTC(f[1],i,f[3]||1,f[4]||0,f[5]||0,f[6]||0,v)):new Date(f[1],i,f[3]||1,f[4]||0,f[5]||0,f[6]||0,v)}}return new Date(d)})(b),this.init()},C.init=function(){var b=this.$d;this.$y=b.getFullYear(),this.$M=b.getMonth(),this.$D=b.getDate(),this.$W=b.getDay(),this.$H=b.getHours(),this.$m=b.getMinutes(),this.$s=b.getSeconds(),this.$ms=b.getMilliseconds()},C.$utils=function(){return W},C.isValid=function(){return this.$d.toString()!==O},C.isSame=function(b,c){var d=K(b);return this.startOf(c)<=d&&d<=this.endOf(c)},C.isAfter=function(b,c){return K(b)<this.startOf(c)},C.isBefore=function(b,c){return this.endOf(c)<K(b)},C.$g=function(b,c,d){return W.u(b)?this[c]:this.set(d,b)},C.unix=function(){return Math.floor(this.valueOf()/1e3)},C.valueOf=function(){return this.$d.getTime()},C.startOf=function(b,c){var d=this,m=!!W.u(c)||c,f=W.p(b),i=function(ae,ie){var ue=W.w(d.$u?Date.UTC(d.$y,ie,ae):new Date(d.$y,ie,ae),d);return m?ue:ue.endOf(y)},v=function(ae,ie){return W.w(d.toDate()[ae].apply(d.toDate("s"),(m?[0,0,0,0]:[23,59,59,999]).slice(ie)),d)},E=this.$W,j=this.$M,Q=this.$D,J="set"+(this.$u?"UTC":"");switch(f){case S:return m?i(1,0):i(31,11);case P:return m?i(1,j):i(0,j+1);case _:var te=this.$locale().weekStart||0,Z=(E<te?E+7:E)-te;return i(m?Q-Z:Q+(6-Z),j);case y:case D:return v(J+"Hours",0);case g:return v(J+"Minutes",1);case a:return v(J+"Seconds",2);case h:return v(J+"Milliseconds",3);default:return this.clone()}},C.endOf=function(b){return this.startOf(b,!1)},C.$set=function(b,c){var d,m=W.p(b),f="set"+(this.$u?"UTC":""),i=(d={},d[y]=f+"Date",d[D]=f+"Date",d[P]=f+"Month",d[S]=f+"FullYear",d[g]=f+"Hours",d[a]=f+"Minutes",d[h]=f+"Seconds",d[u]=f+"Milliseconds",d)[m],v=m===y?this.$D+(c-this.$W):c;if(m===P||m===S){var E=this.clone().set(D,1);E.$d[i](v),E.init(),this.$d=E.set(D,Math.min(this.$D,E.daysInMonth())).$d}else i&&this.$d[i](v);return this.init(),this},C.set=function(b,c){return this.clone().$set(b,c)},C.get=function(b){return this[W.p(b)]()},C.add=function(b,c){var d,m=this;b=Number(b);var f=W.p(c),i=function(j){var Q=K(m);return W.w(Q.date(Q.date()+Math.round(j*b)),m)};if(f===P)return this.set(P,this.$M+b);if(f===S)return this.set(S,this.$y+b);if(f===y)return i(1);if(f===_)return i(7);var v=(d={},d[a]=n,d[g]=s,d[h]=r,d)[f]||1,E=this.$d.getTime()+b*v;return W.w(E,this)},C.subtract=function(b,c){return this.add(-1*b,c)},C.format=function(b){var c=this,d=this.$locale();if(!this.isValid())return d.invalidDate||O;var m=b||"YYYY-MM-DDTHH:mm:ssZ",f=W.z(this),i=this.$H,v=this.$m,E=this.$M,j=d.weekdays,Q=d.months,J=d.meridiem,te=function(ie,ue,A,L){return ie&&(ie[ue]||ie(c,m))||A[ue].slice(0,L)},Z=function(ie){return W.s(i%12||12,ie,"0")},ae=J||function(ie,ue,A){var L=ie<12?"AM":"PM";return A?L.toLowerCase():L};return m.replace(z,(function(ie,ue){return ue||(function(A){switch(A){case"YY":return String(c.$y).slice(-2);case"YYYY":return W.s(c.$y,4,"0");case"M":return E+1;case"MM":return W.s(E+1,2,"0");case"MMM":return te(d.monthsShort,E,Q,3);case"MMMM":return te(Q,E);case"D":return c.$D;case"DD":return W.s(c.$D,2,"0");case"d":return String(c.$W);case"dd":return te(d.weekdaysMin,c.$W,j,2);case"ddd":return te(d.weekdaysShort,c.$W,j,3);case"dddd":return j[c.$W];case"H":return String(i);case"HH":return W.s(i,2,"0");case"h":return Z(1);case"hh":return Z(2);case"a":return ae(i,v,!0);case"A":return ae(i,v,!1);case"m":return String(v);case"mm":return W.s(v,2,"0");case"s":return String(c.$s);case"ss":return W.s(c.$s,2,"0");case"SSS":return W.s(c.$ms,3,"0");case"Z":return f}return null})(ie)||f.replace(":","")}))},C.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},C.diff=function(b,c,d){var m,f=this,i=W.p(c),v=K(b),E=(v.utcOffset()-this.utcOffset())*n,j=this-v,Q=function(){return W.m(f,v)};switch(i){case S:m=Q()/12;break;case P:m=Q();break;case x:m=Q()/3;break;case _:m=(j-E)/6048e5;break;case y:m=(j-E)/864e5;break;case g:m=j/s;break;case a:m=j/n;break;case h:m=j/r;break;default:m=j}return d?m:W.a(m)},C.daysInMonth=function(){return this.endOf(P).$D},C.$locale=function(){return re[this.$L]},C.locale=function(b,c){if(!b)return this.$L;var d=this.clone(),m=H(b,c,!0);return m&&(d.$L=m),d},C.clone=function(){return W.w(this.$d,this)},C.toDate=function(){return new Date(this.valueOf())},C.toJSON=function(){return this.isValid()?this.toISOString():null},C.toISOString=function(){return this.$d.toISOString()},C.toString=function(){return this.$d.toUTCString()},k})(),se=oe.prototype;return K.prototype=se,[["$ms",u],["$s",h],["$m",a],["$H",g],["$W",y],["$M",P],["$y",S],["$D",D]].forEach((function(k){se[k[1]]=function(C){return this.$g(C,k[0],k[1])}})),K.extend=function(k,C){return k.$i||(k(C,oe,K),k.$i=!0),K},K.locale=H,K.isDayjs=V,K.unix=function(k){return K(1e3*k)},K.en=re[ee],K.Ls=re,K.p={},K}))})(lr)),lr.exports}var Pl=kl();const de=An(Pl);function Ml({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 Go({controlsRef:t,direction:e,levelIndex:r,rowIndex:n,cellIndex:s,size:u}){const h=Ml({direction:e,size:u,rowIndex:n,cellIndex:s,levelIndex:r});if(!h)return;const a=t.current?.[h.levelIndex]?.[h.rowIndex]?.[h.cellIndex];a&&(a.disabled||a.getAttribute("data-hidden")||a.getAttribute("data-outside")?Go({controlsRef:t,direction:e,levelIndex:h.levelIndex,cellIndex:h.cellIndex,rowIndex:h.rowIndex,size:u}):a.focus())}function Ol(t){switch(t){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function Al(t){return t.current?.map(e=>e.map(r=>r.length))}function sn({controlsRef:t,levelIndex:e,rowIndex:r,cellIndex:n,event:s}){const u=Ol(s.key);if(u){s.preventDefault();const h=Al(t);Go({controlsRef:t,direction:u,levelIndex:e,rowIndex:r,cellIndex:n,size:h})}}function qe(t){return t==null||t===""?t:de(t).format("YYYY-MM-DD")}function Qo(t){return t==null||t===""?t:de(t).format("YYYY-MM-DD HH:mm:ss")}const El={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},Tl=G.createContext(El);function dt(){const t=G.useContext(Tl),e=G.useCallback(u=>u||t.locale,[t.locale]),r=G.useCallback(u=>typeof u=="number"?u:t.firstDayOfWeek,[t.firstDayOfWeek]),n=G.useCallback(u=>Array.isArray(u)?u:t.weekendDays,[t.weekendDays]),s=G.useCallback(u=>typeof u=="string"?u:t.labelSeparator,[t.labelSeparator]);return{...t,getLocale:e,getFirstDayOfWeek:r,getWeekendDays:n,getLabelSeparator:s}}function jl({value:t,type:e,withTime:r}){const n=r?Qo: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 Zo({value:t,type:e,name:r,form:n,withTime:s=!1}){return w.jsx("input",{type:"hidden",value:jl({value:t,type:e,withTime:s}),name:r,form:n})}Zo.displayName="@mantine/dates/HiddenDatesInput";function Ko(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=Ko(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Pe(){for(var t,e,r=0,n="",s=arguments.length;r<s;r++)(t=arguments[r])&&(e=Ko(t))&&(n&&(n+=" "),n+=e);return n}var Jo={day:"m_396ce5cb"};const $l=T.createVarsResolver((t,{size:e})=>({day:{"--day-size":T.getSize(e,"day-size")}})),an=T.factory((t,e)=>{const r=T.useProps("Day",null,t),{classNames:n,className:s,style:u,styles:h,unstyled:a,vars:g,date:y,disabled:_,__staticSelector:P,weekend:x,outside:S,selected:D,renderDay:O,inRange:N,firstInRange:z,lastInRange:F,hidden:q,static:U,highlightToday:ee,attributes:re,...X}=r,V=T.useStyles({name:P||"Day",classes:Jo,props:r,className:s,style:u,classNames:n,styles:h,unstyled:a,attributes:re,vars:g,varsResolver:$l,rootSelector:"day"});return w.jsx(T.UnstyledButton,{...V("day",{style:q?{display:"none"}:void 0}),component:U?"div":"button",ref:e,disabled:_,"data-today":de(y).isSame(new Date,"day")||void 0,"data-hidden":q||void 0,"data-highlight-today":ee||void 0,"data-disabled":_||void 0,"data-weekend":!_&&!S&&x||void 0,"data-outside":!_&&S||void 0,"data-selected":!_&&D||void 0,"data-in-range":N&&!_||void 0,"data-first-in-range":z&&!_||void 0,"data-last-in-range":F&&!_||void 0,"data-static":U||void 0,unstyled:a,...X,children:O?.(y)||de(y).date()})});an.classes=Jo,an.displayName="@mantine/dates/Day";function Rl({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 Xo={weekday:"m_18a3eca"};const Nl=T.createVarsResolver((t,{size:e})=>({weekdaysRow:{"--wr-fz":T.getFontSize(e),"--wr-spacing":T.getSpacing(e)}})),ln=T.factory((t,e)=>{const r=T.useProps("WeekdaysRow",null,t),{classNames:n,className:s,style:u,styles:h,unstyled:a,vars:g,locale:y,firstDayOfWeek:_,weekdayFormat:P,cellComponent:x="th",__staticSelector:S,withWeekNumbers:D,attributes:O,...N}=r,z=T.useStyles({name:S||"WeekdaysRow",classes:Xo,props:r,className:s,style:u,classNames:n,styles:h,unstyled:a,attributes:O,vars:g,varsResolver:Nl,rootSelector:"weekdaysRow"}),F=dt(),q=Rl({locale:F.getLocale(y),format:P,firstDayOfWeek:F.getFirstDayOfWeek(_)}).map((U,ee)=>w.jsx(x,{...z("weekday"),children:U},ee));return w.jsxs(T.Box,{component:"tr",ref:e,...z("weekdaysRow"),...N,children:[D&&w.jsx(x,{...z("weekday"),children:"#"}),q]})});ln.classes=Xo,ln.displayName="@mantine/dates/WeekdaysRow";function Ll(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 Bl(t,e=1){let r=de(t);for(;r.day()!==e;)r=r.subtract(1,"day");return r.format("YYYY-MM-DD")}function Il({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"),h=s.add(+s.daysInMonth()-1,"day").format("YYYY-MM-DD"),a=Ll(h,e),g=[];let y=de(Bl(u,e));for(;de(y).isBefore(a,"day");){const _=[];for(let P=0;P<7;P+=1)_.push(y.format("YYYY-MM-DD")),y=y.add(1,"day");g.push(_)}if(r&&g.length<6){const _=g[g.length-1],P=_[_.length-1];let x=de(P).add(1,"day");for(;g.length<6;){const S=[];for(let D=0;D<7;D+=1)S.push(x.format("YYYY-MM-DD")),x=x.add(1,"day");g.push(S)}}return g}function un(t,e){return de(t).format("YYYY-MM")===de(e).format("YYYY-MM")}function es(t,e){return e?de(t).isAfter(de(e).subtract(1,"day"),"day"):!0}function ts(t,e){return e?de(t).isBefore(de(e).add(1,"day"),"day"):!0}function Yl({dates:t,minDate:e,maxDate:r,getDayProps:n,excludeDate:s,hideOutsideDates:u,month:h}){const a=t.flat().filter(_=>ts(_,r)&&es(_,e)&&!s?.(_)&&!n?.(_)?.disabled&&(!u||un(_,h))),g=a.find(_=>n?.(_)?.selected);if(g)return g;const y=a.find(_=>de().isSame(_,"date"));return y||a[0]}var ur={exports:{}},zl=ur.exports,rs;function Fl(){return rs||(rs=1,(function(t,e){(function(r,n){t.exports=n()})(zl,(function(){var r="day";return function(n,s,u){var h=function(y){return y.add(4-y.isoWeekday(),r)},a=s.prototype;a.isoWeekYear=function(){return h(this).year()},a.isoWeek=function(y){if(!this.$utils().u(y))return this.add(7*(y-this.isoWeek()),r);var _,P,x,S,D=h(this),O=(_=this.isoWeekYear(),P=this.$u,x=(P?u.utc:u)().year(_).startOf("year"),S=4-x.isoWeekday(),x.isoWeekday()>4&&(S+=7),x.add(S,r));return D.diff(O,"week")+1},a.isoWeekday=function(y){return this.$utils().u(y)?this.day()||7:this.day(this.day()%7?y:y-7)};var g=a.startOf;a.startOf=function(y,_){var P=this.$utils(),x=!!P.u(_)||_;return P.p(y)==="isoweek"?x?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):g.bind(this)(y,_)}}}))})(ur)),ur.exports}var Wl=Fl();const Ul=An(Wl);de.extend(Ul);function ql(t){const e=t.find(r=>de(r).day()===1);return de(e).isoWeek()}var ns={month:"m_cc9820d3",monthCell:"m_8f457cd5",weekNumber:"m_6cff9dea"};const Vl={withCellSpacing:!0},Hl=T.createVarsResolver((t,{size:e})=>({weekNumber:{"--wn-fz":T.getFontSize(e),"--wn-size":T.getSize(e,"wn-size")}})),cr=T.factory((t,e)=>{const r=T.useProps("Month",Vl,t),{classNames:n,className:s,style:u,styles:h,unstyled:a,vars:g,__staticSelector:y,locale:_,firstDayOfWeek:P,weekdayFormat:x,month:S,weekendDays:D,getDayProps:O,excludeDate:N,minDate:z,maxDate:F,renderDay:q,hideOutsideDates:U,hideWeekdays:ee,getDayAriaLabel:re,static:X,__getDayRef:V,__onDayKeyDown:H,__onDayClick:K,__onDayMouseEnter:W,__preventFocus:oe,__stopPropagation:se,withCellSpacing:k,size:C,highlightToday:b,withWeekNumbers:c,attributes:d,...m}=r,f=T.useStyles({name:y||"Month",classes:ns,props:r,className:s,style:u,classNames:n,styles:h,unstyled:a,attributes:d,vars:g,varsResolver:Hl,rootSelector:"month"}),i=dt(),v=Il({month:S,firstDayOfWeek:i.getFirstDayOfWeek(P),consistentWeeks:i.consistentWeeks}),E=Yl({dates:v,minDate:qe(z),maxDate:qe(F),getDayProps:O,excludeDate:N,hideOutsideDates:U,month:S}),{resolvedClassNames:j,resolvedStyles:Q}=T.useResolvedStylesApi({classNames:n,styles:h,props:r}),J=v.map((te,Z)=>{const ae=te.map((ie,ue)=>{const A=!un(ie,S),L=re?.(ie)||de(ie).locale(_||i.locale).format("D MMMM YYYY"),$=O?.(ie),I=de(ie).isSame(E,"date");return w.jsx("td",{...f("monthCell"),"data-with-spacing":k||void 0,children:w.jsx(an,{__staticSelector:y||"Month",classNames:j,styles:Q,unstyled:a,"data-mantine-stop-propagation":se||void 0,highlightToday:b,renderDay:q,date:ie,size:C,weekend:i.getWeekendDays(D).includes(de(ie).get("day")),outside:A,hidden:U?A:!1,"aria-label":L,static:X,disabled:N?.(ie)||!ts(ie,qe(F))||!es(ie,qe(z)),ref:Y=>{Y&&V?.(Z,ue,Y)},...$,onKeyDown:Y=>{$?.onKeyDown?.(Y),H?.(Y,{rowIndex:Z,cellIndex:ue,date:ie})},onMouseEnter:Y=>{$?.onMouseEnter?.(Y),W?.(Y,ie)},onClick:Y=>{$?.onClick?.(Y),K?.(Y,ie)},onMouseDown:Y=>{$?.onMouseDown?.(Y),oe&&Y.preventDefault()},tabIndex:oe||!I?-1:0})},ie.toString())});return w.jsxs("tr",{...f("monthRow"),children:[c&&w.jsx("td",{...f("weekNumber"),children:ql(te)}),ae]},Z)});return w.jsxs(T.Box,{component:"table",...f("month"),size:C,ref:e,...m,children:[!ee&&w.jsx("thead",{...f("monthThead"),children:w.jsx(ln,{__staticSelector:y||"Month",locale:_,firstDayOfWeek:P,weekdayFormat:x,size:C,classNames:j,styles:Q,unstyled:a,withWeekNumbers:c})}),w.jsx("tbody",{...f("monthTbody"),children:J})]})});cr.classes=ns,cr.displayName="@mantine/dates/Month";var os={pickerControl:"m_dc6a3c71"};const Gl=T.createVarsResolver((t,{size:e})=>({pickerControl:{"--dpc-fz":T.getFontSize(e),"--dpc-size":T.getSize(e,"dpc-size")}})),dr=T.factory((t,e)=>{const r=T.useProps("PickerControl",null,t),{classNames:n,className:s,style:u,styles:h,unstyled:a,vars:g,firstInRange:y,lastInRange:_,inRange:P,__staticSelector:x,selected:S,disabled:D,attributes:O,...N}=r,z=T.useStyles({name:x||"PickerControl",classes:os,props:r,className:s,style:u,classNames:n,styles:h,unstyled:a,attributes:O,vars:g,varsResolver:Gl,rootSelector:"pickerControl"});return w.jsx(T.UnstyledButton,{...z("pickerControl"),ref:e,unstyled:a,"data-picker-control":!0,"data-selected":S&&!D||void 0,"data-disabled":D||void 0,"data-in-range":P&&!D&&!S||void 0,"data-first-in-range":y&&!D||void 0,"data-last-in-range":_&&!D||void 0,disabled:D,...N})});dr.classes=os,dr.displayName="@mantine/dates/PickerControl";function ss({year:t,minDate:e,maxDate:r}){return!e&&!r?!1:!!(e&&de(t).isBefore(e,"year")||r&&de(t).isAfter(r,"year"))}function Ql({years:t,minDate:e,maxDate:r,getYearControlProps:n}){const s=t.flat().filter(a=>!ss({year:a,minDate:e,maxDate:r})&&!n?.(a)?.disabled),u=s.find(a=>n?.(a)?.selected);if(u)return u;const h=s.find(a=>de().isSame(a,"year"));return h||s[0]}function is(t){const e=de(t).year(),r=e-e%10;let n=0;const s=[[],[],[],[]];for(let u=0;u<4;u+=1){const h=u===3?1:3;for(let a=0;a<h;a+=1)s[u].push(de(new Date(r+n,0)).format("YYYY-MM-DD")),n+=1}return s}var as={yearsList:"m_9206547b",yearsListCell:"m_c5a19c7d"};const Zl={yearsListFormat:"YYYY",withCellSpacing:!0},hr=T.factory((t,e)=>{const r=T.useProps("YearsList",Zl,t),{classNames:n,className:s,style:u,styles:h,unstyled:a,vars:g,decade:y,yearsListFormat:_,locale:P,minDate:x,maxDate:S,getYearControlProps:D,__staticSelector:O,__getControlRef:N,__onControlKeyDown:z,__onControlClick:F,__onControlMouseEnter:q,__preventFocus:U,__stopPropagation:ee,withCellSpacing:re,size:X,attributes:V,...H}=r,K=T.useStyles({name:O||"YearsList",classes:as,props:r,className:s,style:u,classNames:n,styles:h,unstyled:a,attributes:V,vars:g,rootSelector:"yearsList"}),W=dt(),oe=is(y),se=Ql({years:oe,minDate:x,maxDate:S,getYearControlProps:D}),k=oe.map((C,b)=>{const c=C.map((d,m)=>{const f=D?.(d),i=de(d).isSame(se,"year");return w.jsx("td",{...K("yearsListCell"),"data-with-spacing":re||void 0,children:w.jsx(dr,{...K("yearsListControl"),size:X,unstyled:a,"data-mantine-stop-propagation":ee||void 0,disabled:ss({year:d,minDate:x,maxDate:S}),ref:v=>{v&&N?.(b,m,v)},...f,onKeyDown:v=>{f?.onKeyDown?.(v),z?.(v,{rowIndex:b,cellIndex:m,date:d})},onClick:v=>{f?.onClick?.(v),F?.(v,d)},onMouseEnter:v=>{f?.onMouseEnter?.(v),q?.(v,d)},onMouseDown:v=>{f?.onMouseDown?.(v),U&&v.preventDefault()},tabIndex:U||!i?-1:0,children:de(d).locale(W.getLocale(P)).format(_)})},m)});return w.jsx("tr",{...K("yearsListRow"),children:c},b)});return w.jsx(T.Box,{component:"table",ref:e,size:X,...K("yearsList"),...H,children:w.jsx("tbody",{children:k})})});hr.classes=as,hr.displayName="@mantine/dates/YearsList";function ls({month:t,minDate:e,maxDate:r}){return!e&&!r?!1:!!(e&&de(t).isBefore(e,"month")||r&&de(t).isAfter(r,"month"))}function Kl({months:t,minDate:e,maxDate:r,getMonthControlProps:n}){const s=t.flat().filter(a=>!ls({month:a,minDate:e,maxDate:r})&&!n?.(a)?.disabled),u=s.find(a=>n?.(a)?.selected);if(u)return u;const h=s.find(a=>de().isSame(a,"month"));return h||s[0]}function Jl(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 us={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const Xl={monthsListFormat:"MMM",withCellSpacing:!0},fr=T.factory((t,e)=>{const r=T.useProps("MonthsList",Xl,t),{classNames:n,className:s,style:u,styles:h,unstyled:a,vars:g,__staticSelector:y,year:_,monthsListFormat:P,locale:x,minDate:S,maxDate:D,getMonthControlProps:O,__getControlRef:N,__onControlKeyDown:z,__onControlClick:F,__onControlMouseEnter:q,__preventFocus:U,__stopPropagation:ee,withCellSpacing:re,size:X,attributes:V,...H}=r,K=T.useStyles({name:y||"MonthsList",classes:us,props:r,className:s,style:u,classNames:n,styles:h,unstyled:a,attributes:V,vars:g,rootSelector:"monthsList"}),W=dt(),oe=Jl(_),se=Kl({months:oe,minDate:qe(S),maxDate:qe(D),getMonthControlProps:O}),k=oe.map((C,b)=>{const c=C.map((d,m)=>{const f=O?.(d),i=de(d).isSame(se,"month");return w.jsx("td",{...K("monthsListCell"),"data-with-spacing":re||void 0,children:w.jsx(dr,{...K("monthsListControl"),size:X,unstyled:a,__staticSelector:y||"MonthsList","data-mantine-stop-propagation":ee||void 0,disabled:ls({month:d,minDate:qe(S),maxDate:qe(D)}),ref:v=>{v&&N?.(b,m,v)},...f,onKeyDown:v=>{f?.onKeyDown?.(v),z?.(v,{rowIndex:b,cellIndex:m,date:d})},onClick:v=>{f?.onClick?.(v),F?.(v,d)},onMouseEnter:v=>{f?.onMouseEnter?.(v),q?.(v,d)},onMouseDown:v=>{f?.onMouseDown?.(v),U&&v.preventDefault()},tabIndex:U||!i?-1:0,children:de(d).locale(W.getLocale(x)).format(P)})},m)});return w.jsx("tr",{...K("monthsListRow"),children:c},b)});return w.jsx(T.Box,{component:"table",ref:e,size:X,...K("monthsList"),...H,children:w.jsx("tbody",{children:k})})});fr.classes=us,fr.displayName="@mantine/dates/MonthsList";var cs={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderControlIcon:"m_367dc749"};const eu={hasNextLevel:!0,withNext:!0,withPrevious:!0,headerControlsOrder:["previous","level","next"]},tu=T.createVarsResolver((t,{size:e})=>({calendarHeader:{"--dch-control-size":T.getSize(e,"dch-control-size"),"--dch-fz":T.getFontSize(e)}})),ht=T.factory((t,e)=>{const r=T.useProps("CalendarHeader",eu,t),{classNames:n,className:s,style:u,styles:h,unstyled:a,vars:g,nextIcon:y,previousIcon:_,nextLabel:P,previousLabel:x,onNext:S,onPrevious:D,onLevelClick:O,label:N,nextDisabled:z,previousDisabled:F,hasNextLevel:q,levelControlAriaLabel:U,withNext:ee,withPrevious:re,headerControlsOrder:X,__staticSelector:V,__preventFocus:H,__stopPropagation:K,attributes:W,...oe}=r,se=T.useStyles({name:V||"CalendarHeader",classes:cs,props:r,className:s,style:u,classNames:n,styles:h,unstyled:a,attributes:W,vars:g,varsResolver:tu,rootSelector:"calendarHeader"}),k=H?m=>m.preventDefault():void 0,C=re&&G.createElement(T.UnstyledButton,{...se("calendarHeaderControl"),key:"previous","data-direction":"previous","aria-label":x,onClick:D,unstyled:a,onMouseDown:k,disabled:F,"data-disabled":F||void 0,tabIndex:H||F?-1:0,"data-mantine-stop-propagation":K||void 0},_||w.jsx(T.AccordionChevron,{...se("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})),b=G.createElement(T.UnstyledButton,{component:q?"button":"div",...se("calendarHeaderLevel"),key:"level",onClick:q?O:void 0,unstyled:a,onMouseDown:q?k:void 0,disabled:!q,"data-static":!q||void 0,"aria-label":U,tabIndex:H||!q?-1:0,"data-mantine-stop-propagation":K||void 0},N),c=ee&&G.createElement(T.UnstyledButton,{...se("calendarHeaderControl"),key:"next","data-direction":"next","aria-label":P,onClick:S,unstyled:a,onMouseDown:k,disabled:z,"data-disabled":z||void 0,tabIndex:H||z?-1:0,"data-mantine-stop-propagation":K||void 0},y||w.jsx(T.AccordionChevron,{...se("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})),d=X.map(m=>m==="previous"?C:m==="level"?b:m==="next"?c:null);return w.jsx(T.Box,{...se("calendarHeader"),ref:e,...oe,children:d})});ht.classes=cs,ht.displayName="@mantine/dates/CalendarHeader";function ru(t){const e=is(t);return[e[0][0],e[3][0]]}const nu={decadeLabelFormat:"YYYY"},pr=T.factory((t,e)=>{const r=T.useProps("DecadeLevel",nu,t),{decade:n,locale:s,minDate:u,maxDate:h,yearsListFormat:a,getYearControlProps:g,__getControlRef:y,__onControlKeyDown:_,__onControlClick:P,__onControlMouseEnter:x,withCellSpacing:S,__preventFocus:D,nextIcon:O,previousIcon:N,nextLabel:z,previousLabel:F,onNext:q,onPrevious:U,nextDisabled:ee,previousDisabled:re,levelControlAriaLabel:X,withNext:V,withPrevious:H,headerControlsOrder:K,decadeLabelFormat:W,classNames:oe,styles:se,unstyled:k,__staticSelector:C,__stopPropagation:b,size:c,attributes:d,...m}=r,f=dt(),[i,v]=ru(n),E={__staticSelector:C||"DecadeLevel",classNames:oe,styles:se,unstyled:k,size:c,attributes:d},j=typeof ee=="boolean"?ee:h?!de(v).endOf("year").isBefore(h):!1,Q=typeof re=="boolean"?re:u?!de(i).startOf("year").isAfter(u):!1,J=(te,Z)=>de(te).locale(s||f.locale).format(Z);return w.jsxs(T.Box,{"data-decade-level":!0,size:c,ref:e,...m,children:[w.jsx(ht,{label:typeof W=="function"?W(i,v):`${J(i,W)} – ${J(v,W)}`,__preventFocus:D,__stopPropagation:b,nextIcon:O,previousIcon:N,nextLabel:z,previousLabel:F,onNext:q,onPrevious:U,nextDisabled:j,previousDisabled:Q,hasNextLevel:!1,levelControlAriaLabel:X,withNext:V,withPrevious:H,headerControlsOrder:K,...E}),w.jsx(hr,{decade:n,locale:s,minDate:u,maxDate:h,yearsListFormat:a,getYearControlProps:g,__getControlRef:y,__onControlKeyDown:_,__onControlClick:P,__onControlMouseEnter:x,__preventFocus:D,__stopPropagation:b,withCellSpacing:S,...E})]})});pr.classes={...hr.classes,...ht.classes},pr.displayName="@mantine/dates/DecadeLevel";const ou={yearLabelFormat:"YYYY"},gr=T.factory((t,e)=>{const r=T.useProps("YearLevel",ou,t),{year:n,locale:s,minDate:u,maxDate:h,monthsListFormat:a,getMonthControlProps:g,__getControlRef:y,__onControlKeyDown:_,__onControlClick:P,__onControlMouseEnter:x,withCellSpacing:S,__preventFocus:D,nextIcon:O,previousIcon:N,nextLabel:z,previousLabel:F,onNext:q,onPrevious:U,onLevelClick:ee,nextDisabled:re,previousDisabled:X,hasNextLevel:V,levelControlAriaLabel:H,withNext:K,withPrevious:W,headerControlsOrder:oe,yearLabelFormat:se,__staticSelector:k,__stopPropagation:C,size:b,classNames:c,styles:d,unstyled:m,attributes:f,...i}=r,v=dt(),E={__staticSelector:k||"YearLevel",classNames:c,styles:d,unstyled:m,size:b,attributes:f},j=typeof re=="boolean"?re:h?!de(n).endOf("year").isBefore(h):!1,Q=typeof X=="boolean"?X:u?!de(n).startOf("year").isAfter(u):!1;return w.jsxs(T.Box,{"data-year-level":!0,size:b,ref:e,...i,children:[w.jsx(ht,{label:typeof se=="function"?se(n):de(n).locale(s||v.locale).format(se),__preventFocus:D,__stopPropagation:C,nextIcon:O,previousIcon:N,nextLabel:z,previousLabel:F,onNext:q,onPrevious:U,onLevelClick:ee,nextDisabled:j,previousDisabled:Q,hasNextLevel:V,levelControlAriaLabel:H,withNext:K,withPrevious:W,headerControlsOrder:oe,...E}),w.jsx(fr,{year:n,locale:s,minDate:u,maxDate:h,monthsListFormat:a,getMonthControlProps:g,__getControlRef:y,__onControlKeyDown:_,__onControlClick:P,__onControlMouseEnter:x,__preventFocus:D,__stopPropagation:C,withCellSpacing:S,...E})]})});gr.classes={...ht.classes,...fr.classes},gr.displayName="@mantine/dates/YearLevel";const su={monthLabelFormat:"MMMM YYYY"},mr=T.factory((t,e)=>{const r=T.useProps("MonthLevel",su,t),{month:n,locale:s,firstDayOfWeek:u,weekdayFormat:h,weekendDays:a,getDayProps:g,excludeDate:y,minDate:_,maxDate:P,renderDay:x,hideOutsideDates:S,hideWeekdays:D,getDayAriaLabel:O,__getDayRef:N,__onDayKeyDown:z,__onDayClick:F,__onDayMouseEnter:q,withCellSpacing:U,highlightToday:ee,withWeekNumbers:re,__preventFocus:X,__stopPropagation:V,nextIcon:H,previousIcon:K,nextLabel:W,previousLabel:oe,onNext:se,onPrevious:k,onLevelClick:C,nextDisabled:b,previousDisabled:c,hasNextLevel:d,levelControlAriaLabel:m,withNext:f,withPrevious:i,headerControlsOrder:v,monthLabelFormat:E,classNames:j,styles:Q,unstyled:J,__staticSelector:te,size:Z,static:ae,attributes:ie,...ue}=r,A=dt(),L={__staticSelector:te||"MonthLevel",classNames:j,styles:Q,unstyled:J,size:Z,attributes:ie},$=typeof b=="boolean"?b:P?!de(n).endOf("month").isBefore(P):!1,I=typeof c=="boolean"?c:_?!de(n).startOf("month").isAfter(_):!1;return w.jsxs(T.Box,{"data-month-level":!0,size:Z,ref:e,...ue,children:[w.jsx(ht,{label:typeof E=="function"?E(n):de(n).locale(s||A.locale).format(E),__preventFocus:X,__stopPropagation:V,nextIcon:H,previousIcon:K,nextLabel:W,previousLabel:oe,onNext:se,onPrevious:k,onLevelClick:C,nextDisabled:$,previousDisabled:I,hasNextLevel:d,levelControlAriaLabel:m,withNext:f,withPrevious:i,headerControlsOrder:v,...L}),w.jsx(cr,{month:n,locale:s,firstDayOfWeek:u,weekdayFormat:h,weekendDays:a,getDayProps:g,excludeDate:y,minDate:_,maxDate:P,renderDay:x,hideOutsideDates:S,hideWeekdays:D,getDayAriaLabel:O,__getDayRef:N,__onDayKeyDown:z,__onDayClick:F,__onDayMouseEnter:q,__preventFocus:X,__stopPropagation:V,static:ae,withCellSpacing:U,highlightToday:ee,withWeekNumbers:re,...L})]})});mr.classes={...cr.classes,...ht.classes},mr.displayName="@mantine/dates/MonthLevel";var ds={levelsGroup:"m_30b26e33"};const ft=T.factory((t,e)=>{const r=T.useProps("LevelsGroup",null,t),{classNames:n,className:s,style:u,styles:h,unstyled:a,vars:g,__staticSelector:y,attributes:_,...P}=r,x=T.useStyles({name:y||"LevelsGroup",classes:ds,props:r,className:s,style:u,classNames:n,styles:h,unstyled:a,attributes:_,vars:g,rootSelector:"levelsGroup"});return w.jsx(T.Box,{ref:e,...x("levelsGroup"),...P})});ft.classes=ds,ft.displayName="@mantine/dates/LevelsGroup";const iu={numberOfColumns:1},yr=T.factory((t,e)=>{const r=T.useProps("DecadeLevelGroup",iu,t),{decade:n,locale:s,minDate:u,maxDate:h,yearsListFormat:a,getYearControlProps:g,__onControlClick:y,__onControlMouseEnter:_,withCellSpacing:P,__preventFocus:x,nextIcon:S,previousIcon:D,nextLabel:O,previousLabel:N,onNext:z,onPrevious:F,nextDisabled:q,previousDisabled:U,headerControlsOrder:ee,classNames:re,styles:X,unstyled:V,__staticSelector:H,__stopPropagation:K,numberOfColumns:W,levelControlAriaLabel:oe,decadeLabelFormat:se,size:k,vars:C,attributes:b,...c}=r,d=G.useRef([]),m=Array(W).fill(0).map((f,i)=>{const v=de(n).add(i*10,"years").format("YYYY-MM-DD");return w.jsx(pr,{size:k,yearsListFormat:a,decade:v,withNext:i===W-1,withPrevious:i===0,decadeLabelFormat:se,__onControlClick:y,__onControlMouseEnter:_,__onControlKeyDown:(E,j)=>sn({levelIndex:i,rowIndex:j.rowIndex,cellIndex:j.cellIndex,event:E,controlsRef:d}),__getControlRef:(E,j,Q)=>{Array.isArray(d.current[i])||(d.current[i]=[]),Array.isArray(d.current[i][E])||(d.current[i][E]=[]),d.current[i][E][j]=Q},levelControlAriaLabel:typeof oe=="function"?oe(v):oe,locale:s,minDate:u,maxDate:h,__preventFocus:x,__stopPropagation:K,nextIcon:S,previousIcon:D,nextLabel:O,previousLabel:N,onNext:z,onPrevious:F,nextDisabled:q,previousDisabled:U,getYearControlProps:g,__staticSelector:H||"DecadeLevelGroup",classNames:re,styles:X,unstyled:V,withCellSpacing:P,headerControlsOrder:ee,attributes:b},i)});return w.jsx(ft,{classNames:re,styles:X,__staticSelector:H||"DecadeLevelGroup",ref:e,size:k,unstyled:V,attributes:b,...c,children:m})});yr.classes={...ft.classes,...pr.classes},yr.displayName="@mantine/dates/DecadeLevelGroup";const au={numberOfColumns:1},vr=T.factory((t,e)=>{const r=T.useProps("YearLevelGroup",au,t),{year:n,locale:s,minDate:u,maxDate:h,monthsListFormat:a,getMonthControlProps:g,__onControlClick:y,__onControlMouseEnter:_,withCellSpacing:P,__preventFocus:x,nextIcon:S,previousIcon:D,nextLabel:O,previousLabel:N,onNext:z,onPrevious:F,onLevelClick:q,nextDisabled:U,previousDisabled:ee,hasNextLevel:re,headerControlsOrder:X,classNames:V,styles:H,unstyled:K,__staticSelector:W,__stopPropagation:oe,numberOfColumns:se,levelControlAriaLabel:k,yearLabelFormat:C,size:b,vars:c,attributes:d,...m}=r,f=G.useRef([]),i=Array(se).fill(0).map((v,E)=>{const j=de(n).add(E,"years").format("YYYY-MM-DD");return w.jsx(gr,{size:b,monthsListFormat:a,year:j,withNext:E===se-1,withPrevious:E===0,yearLabelFormat:C,__stopPropagation:oe,__onControlClick:y,__onControlMouseEnter:_,__onControlKeyDown:(Q,J)=>sn({levelIndex:E,rowIndex:J.rowIndex,cellIndex:J.cellIndex,event:Q,controlsRef:f}),__getControlRef:(Q,J,te)=>{Array.isArray(f.current[E])||(f.current[E]=[]),Array.isArray(f.current[E][Q])||(f.current[E][Q]=[]),f.current[E][Q][J]=te},levelControlAriaLabel:typeof k=="function"?k(j):k,locale:s,minDate:u,maxDate:h,__preventFocus:x,nextIcon:S,previousIcon:D,nextLabel:O,previousLabel:N,onNext:z,onPrevious:F,onLevelClick:q,nextDisabled:U,previousDisabled:ee,hasNextLevel:re,getMonthControlProps:g,classNames:V,styles:H,unstyled:K,__staticSelector:W||"YearLevelGroup",withCellSpacing:P,headerControlsOrder:X,attributes:d},E)});return w.jsx(ft,{classNames:V,styles:H,__staticSelector:W||"YearLevelGroup",ref:e,size:b,unstyled:K,attributes:d,...m,children:i})});vr.classes={...gr.classes,...ft.classes},vr.displayName="@mantine/dates/YearLevelGroup";const lu={numberOfColumns:1},br=T.factory((t,e)=>{const r=T.useProps("MonthLevelGroup",lu,t),{month:n,locale:s,firstDayOfWeek:u,weekdayFormat:h,weekendDays:a,getDayProps:g,excludeDate:y,minDate:_,maxDate:P,renderDay:x,hideOutsideDates:S,hideWeekdays:D,getDayAriaLabel:O,__onDayClick:N,__onDayMouseEnter:z,withCellSpacing:F,highlightToday:q,withWeekNumbers:U,__preventFocus:ee,nextIcon:re,previousIcon:X,nextLabel:V,previousLabel:H,onNext:K,onPrevious:W,onLevelClick:oe,nextDisabled:se,previousDisabled:k,hasNextLevel:C,headerControlsOrder:b,classNames:c,styles:d,unstyled:m,numberOfColumns:f,levelControlAriaLabel:i,monthLabelFormat:v,__staticSelector:E,__stopPropagation:j,size:Q,static:J,vars:te,attributes:Z,...ae}=r,ie=G.useRef([]),ue=Array(f).fill(0).map((A,L)=>{const $=de(n).add(L,"months").format("YYYY-MM-DD");return w.jsx(mr,{month:$,withNext:L===f-1,withPrevious:L===0,monthLabelFormat:v,__stopPropagation:j,__onDayClick:N,__onDayMouseEnter:z,__onDayKeyDown:(I,Y)=>sn({levelIndex:L,rowIndex:Y.rowIndex,cellIndex:Y.cellIndex,event:I,controlsRef:ie}),__getDayRef:(I,Y,ce)=>{Array.isArray(ie.current[L])||(ie.current[L]=[]),Array.isArray(ie.current[L][I])||(ie.current[L][I]=[]),ie.current[L][I][Y]=ce},levelControlAriaLabel:typeof i=="function"?i($):i,locale:s,firstDayOfWeek:u,weekdayFormat:h,weekendDays:a,getDayProps:g,excludeDate:y,minDate:_,maxDate:P,renderDay:x,hideOutsideDates:S,hideWeekdays:D,getDayAriaLabel:O,__preventFocus:ee,nextIcon:re,previousIcon:X,nextLabel:V,previousLabel:H,onNext:K,onPrevious:W,onLevelClick:oe,nextDisabled:se,previousDisabled:k,hasNextLevel:C,classNames:c,styles:d,unstyled:m,__staticSelector:E||"MonthLevelGroup",size:Q,static:J,withCellSpacing:F,highlightToday:q,withWeekNumbers:U,headerControlsOrder:b,attributes:Z},L)});return w.jsx(ft,{classNames:c,styles:d,__staticSelector:E||"MonthLevelGroup",ref:e,size:Q,attributes:Z,...ae,children:ue})});br.classes={...ft.classes,...mr.classes},br.displayName="@mantine/dates/MonthLevelGroup";const hs=t=>t==="range"?[null,null]:t==="multiple"?[]:null,fs=(t,e)=>{const r=e?Qo:qe;return Array.isArray(t)?t.map(r):r(t)};function cn({type:t,value:e,defaultValue:r,onChange:n,withTime:s=!1}){const u=G.useRef(t),[h,a,g]=Le.useUncontrolled({value:fs(e,s),defaultValue:fs(r,s),finalValue:hs(t),onChange:n});let y=h;return u.current!==t&&(u.current=t,e===void 0&&(y=r!==void 0?r:hs(t),a(y))),[y,a,g]}function dn(t,e){return t?t==="month"?0:t==="year"?1:2:e||0}function uu(t){return t===0?"month":t===1?"year":"decade"}function qt(t,e,r){return uu(Le.clamp(dn(t,0),dn(e,0),dn(r,2)))}const cu={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0,enableKeyboardNavigation:!0},wr=T.factory((t,e)=>{const r=T.useProps("Calendar",cu,t),{vars:n,maxLevel:s,minLevel:u,defaultLevel:h,level:a,onLevelChange:g,date:y,defaultDate:_,onDateChange:P,numberOfColumns:x,columnsToScroll:S,ariaLabels:D,nextLabel:O,previousLabel:N,onYearSelect:z,onMonthSelect:F,onYearMouseEnter:q,onMonthMouseEnter:U,headerControlsOrder:ee,__updateDateOnYearSelect:re,__updateDateOnMonthSelect:X,__setDateRef:V,__setLevelRef:H,firstDayOfWeek:K,weekdayFormat:W,weekendDays:oe,getDayProps:se,excludeDate:k,renderDay:C,hideOutsideDates:b,hideWeekdays:c,getDayAriaLabel:d,monthLabelFormat:m,nextIcon:f,previousIcon:i,__onDayClick:v,__onDayMouseEnter:E,withCellSpacing:j,highlightToday:Q,withWeekNumbers:J,monthsListFormat:te,getMonthControlProps:Z,yearLabelFormat:ae,yearsListFormat:ie,getYearControlProps:ue,decadeLabelFormat:A,classNames:L,styles:$,unstyled:I,minDate:Y,maxDate:ce,locale:o,__staticSelector:l,size:p,__preventFocus:M,__stopPropagation:R,onNextDecade:B,onPreviousDecade:le,onNextYear:he,onPreviousYear:pe,onNextMonth:ne,onPreviousMonth:fe,static:me,enableKeyboardNavigation:ge,attributes:xe,...Ce}=r,{resolvedClassNames:Se,resolvedStyles:Ye}=T.useResolvedStylesApi({classNames:L,styles:$,props:r}),[Ee,_e]=Le.useUncontrolled({value:a?qt(a,u,s):void 0,defaultValue:h?qt(h,u,s):void 0,finalValue:qt(void 0,u,s),onChange:g}),[nt,je]=cn({type:"default",value:qe(y),defaultValue:qe(_),onChange:P});G.useImperativeHandle(V,()=>ve=>{je(ve)}),G.useImperativeHandle(H,()=>ve=>{_e(ve)});const Ve={__staticSelector:l||"Calendar",styles:Ye,classNames:Se,unstyled:I,size:p,attributes:xe},ze=S||x||1,et=new Date,ot=Y&&de(et).isAfter(Y)?Y:de(et).format("YYYY-MM-DD"),$e=nt||ot,pt=()=>{const ve=de($e).add(ze,"month").format("YYYY-MM-DD");ne?.(ve),je(ve)},wt=()=>{const ve=de($e).subtract(ze,"month").format("YYYY-MM-DD");fe?.(ve),je(ve)},He=()=>{const ve=de($e).add(ze,"year").format("YYYY-MM-DD");he?.(ve),je(ve)},Ge=()=>{const ve=de($e).subtract(ze,"year").format("YYYY-MM-DD");pe?.(ve),je(ve)},Qe=()=>{const ve=de($e).add(10*ze,"year").format("YYYY-MM-DD");B?.(ve),je(ve)},st=()=>{const ve=de($e).subtract(10*ze,"year").format("YYYY-MM-DD");le?.(ve),je(ve)},gt=G.useRef(null);G.useEffect(()=>{if(!ge||me)return;const ve=De=>{if(!gt.current?.contains(document.activeElement))return;const Fe=De.ctrlKey||De.metaKey,at=De.shiftKey;switch(De.key){case"ArrowUp":Fe&&at?(De.preventDefault(),st()):Fe&&(De.preventDefault(),Ge());break;case"ArrowDown":Fe&&at?(De.preventDefault(),Qe()):Fe&&(De.preventDefault(),He());break;case"y":case"Y":Ee==="month"&&(De.preventDefault(),_e("year"));break}};return document.addEventListener("keydown",ve),()=>{document.removeEventListener("keydown",ve)}},[ge,me,Ee,He,Ge,Qe,st]);const mt=ve=>{gt.current=ve,typeof e=="function"?e(ve):e&&(e.current=ve)};return w.jsxs(T.Box,{ref:mt,size:p,"data-calendar":!0,...Ce,children:[Ee==="month"&&w.jsx(br,{month:$e,minDate:Y,maxDate:ce,firstDayOfWeek:K,weekdayFormat:W,weekendDays:oe,getDayProps:se,excludeDate:k,renderDay:C,hideOutsideDates:b,hideWeekdays:c,getDayAriaLabel:d,onNext:pt,onPrevious:wt,hasNextLevel:s!=="month",onLevelClick:()=>_e("year"),numberOfColumns:x,locale:o,levelControlAriaLabel:D?.monthLevelControl,nextLabel:D?.nextMonth??O,nextIcon:f,previousLabel:D?.previousMonth??N,previousIcon:i,monthLabelFormat:m,__onDayClick:v,__onDayMouseEnter:E,__preventFocus:M,__stopPropagation:R,static:me,withCellSpacing:j,highlightToday:Q,withWeekNumbers:J,headerControlsOrder:ee,...Ve}),Ee==="year"&&w.jsx(vr,{year:$e,numberOfColumns:x,minDate:Y,maxDate:ce,monthsListFormat:te,getMonthControlProps:Z,locale:o,onNext:He,onPrevious:Ge,hasNextLevel:s!=="month"&&s!=="year",onLevelClick:()=>_e("decade"),levelControlAriaLabel:D?.yearLevelControl,nextLabel:D?.nextYear??O,nextIcon:f,previousLabel:D?.previousYear??N,previousIcon:i,yearLabelFormat:ae,__onControlMouseEnter:U,__onControlClick:(ve,De)=>{X&&je(De),_e(qt("month",u,s)),F?.(De)},__preventFocus:M,__stopPropagation:R,withCellSpacing:j,headerControlsOrder:ee,...Ve}),Ee==="decade"&&w.jsx(yr,{decade:$e,minDate:Y,maxDate:ce,yearsListFormat:ie,getYearControlProps:ue,locale:o,onNext:Qe,onPrevious:st,numberOfColumns:x,nextLabel:D?.nextDecade??O,nextIcon:f,previousLabel:D?.previousDecade??N,previousIcon:i,decadeLabelFormat:A,__onControlMouseEnter:q,__onControlClick:(ve,De)=>{re&&je(De),_e(qt("year",u,s)),z?.(De)},__preventFocus:M,__stopPropagation:R,withCellSpacing:j,headerControlsOrder:ee,...Ve})]})});wr.classes={...yr.classes,...vr.classes,...br.classes},wr.displayName="@mantine/dates/Calendar";function du(t){const{maxLevel:e,minLevel:r,defaultLevel:n,level:s,onLevelChange:u,nextIcon:h,previousIcon:a,date:g,defaultDate:y,onDateChange:_,numberOfColumns:P,columnsToScroll:x,ariaLabels:S,nextLabel:D,previousLabel:O,onYearSelect:N,onMonthSelect:z,onYearMouseEnter:F,onMonthMouseEnter:q,onNextMonth:U,onPreviousMonth:ee,onNextYear:re,onPreviousYear:X,onNextDecade:V,onPreviousDecade:H,withCellSpacing:K,highlightToday:W,__updateDateOnYearSelect:oe,__updateDateOnMonthSelect:se,__setDateRef:k,__setLevelRef:C,withWeekNumbers:b,headerControlsOrder:c,firstDayOfWeek:d,weekdayFormat:m,weekendDays:f,getDayProps:i,excludeDate:v,renderDay:E,hideOutsideDates:j,hideWeekdays:Q,getDayAriaLabel:J,monthLabelFormat:te,monthsListFormat:Z,getMonthControlProps:ae,yearLabelFormat:ie,yearsListFormat:ue,getYearControlProps:A,decadeLabelFormat:L,allowSingleDateInRange:$,allowDeselect:I,minDate:Y,maxDate:ce,locale:o,...l}=t;return{calendarProps:{maxLevel:e,minLevel:r,defaultLevel:n,level:s,onLevelChange:u,nextIcon:h,previousIcon:a,date:g,defaultDate:y,onDateChange:_,numberOfColumns:P,columnsToScroll:x,ariaLabels:S,nextLabel:D,previousLabel:O,onYearSelect:N,onMonthSelect:z,onYearMouseEnter:F,onMonthMouseEnter:q,onNextMonth:U,onPreviousMonth:ee,onNextYear:re,onPreviousYear:X,onNextDecade:V,onPreviousDecade:H,withCellSpacing:K,highlightToday:W,__updateDateOnYearSelect:oe,__updateDateOnMonthSelect:se,__setDateRef:k,withWeekNumbers:b,headerControlsOrder:c,firstDayOfWeek:d,weekdayFormat:m,weekendDays:f,getDayProps:i,excludeDate:v,renderDay:E,hideOutsideDates:j,hideWeekdays:Q,getDayAriaLabel:J,monthLabelFormat:te,monthsListFormat:Z,getMonthControlProps:ae,yearLabelFormat:ie,yearsListFormat:ue,getYearControlProps:A,decadeLabelFormat:L,allowSingleDateInRange:$,allowDeselect:I,minDate:Y,maxDate:ce,locale:o},others:l}}function hu(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 fu({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 pu={valueFormat:"MMMM D, YYYY",fixOnBlur:!0,size:"sm"},_r=T.factory((t,e)=>{const r=T.useInputProps("DateInput",pu,t),{inputProps:n,wrapperProps:s,value:u,defaultValue:h,onChange:a,clearable:g,clearButtonProps:y,popoverProps:_,getDayProps:P,locale:x,valueFormat:S,dateParser:D,minDate:O,maxDate:N,fixOnBlur:z,onFocus:F,onBlur:q,onClick:U,onKeyDown:ee,readOnly:re,name:X,form:V,rightSection:H,unstyled:K,classNames:W,styles:oe,allowDeselect:se,date:k,defaultDate:C,onDateChange:b,getMonthControlProps:c,getYearControlProps:d,disabled:m,...f}=r,i=G.useRef(null),v=G.useRef(null),[E,j]=G.useState(!1),{calendarProps:Q,others:J}=du(f),te=dt(),ae=D||(ne=>{const fe=de(ne,S,te.getLocale(x)).toDate();return Number.isNaN(fe.getTime())?hu(ne):de(fe).format("YYYY-MM-DD")}),ie=se!==void 0?se:g,ue=ne=>ne?de(ne).locale(te.getLocale(x)).format(S):"",[A,L,$]=cn({type:"default",value:u,defaultValue:h,onChange:a}),[I,Y]=cn({type:"default",value:k,defaultValue:h||C,onChange:b});G.useEffect(()=>{$&&u!==null&&Y(u)},[$,u]);const[ce,o]=G.useState(ue(A));G.useEffect(()=>{o(ue(A))},[te.getLocale(x)]);const l=ne=>{const fe=ne.currentTarget.value;if(o(fe),j(!0),fe.trim()===""&&(se||g))L(null);else{const me=ae(fe);me&&fu({date:me,minDate:O,maxDate:N})&&(L(me),Y(me))}},p=ne=>{q?.(ne),j(!1),z&&o(ue(A))},M=ne=>{F?.(ne),j(!0)},R=ne=>{U?.(ne),j(!0)},B=ne=>{ne.key==="Escape"&&j(!1),ee?.(ne)},le=ne=>({...P?.(ne),selected:de(A).isSame(ne,"day"),onClick:fe=>{P?.(ne).onClick?.(fe);const me=ie&&de(A).isSame(ne,"day")?null:ne;L(me),!$&&me&&o(ue(me)),j(!1)}}),he=w.jsx(T.Input.ClearButton,{onClick:()=>{L(null),!$&&o(""),j(!1)},unstyled:K,...y}),pe=g&&!!A&&!re&&!m;return Le.useDidUpdate(()=>{A!==void 0&&!E&&o(ue(A))},[A]),Le.useClickOutside(()=>j(!1),void 0,[i.current,v.current]),w.jsxs(w.Fragment,{children:[w.jsx(T.Input.Wrapper,{...s,__staticSelector:"DateInput",ref:i,children:w.jsxs(T.Popover,{opened:E,trapFocus:!1,position:"bottom-start",disabled:re||m,withRoles:!1,unstyled:K,..._,children:[w.jsx(T.Popover.Target,{children:w.jsx(T.Input,{"data-dates-input":!0,"data-read-only":re||void 0,autoComplete:"off",ref:e,value:ce,onChange:l,onBlur:p,onFocus:M,onClick:R,onKeyDown:B,readOnly:re,rightSection:H,__clearSection:he,__clearable:pe,...n,...J,disabled:m,__staticSelector:"DateInput"})}),w.jsx(T.Popover.Dropdown,{onMouseDown:ne=>ne.preventDefault(),"data-dates-dropdown":!0,ref:v,children:w.jsx(wr,{__staticSelector:"DateInput",...Q,classNames:W,styles:oe,unstyled:K,__preventFocus:!0,minDate:O,maxDate:N,locale:x,getDayProps:le,size:n.size,date:I,onDateChange:Y,getMonthControlProps:ne=>({selected:typeof A=="string"?un(ne,A):!1,...c?.(ne)}),getYearControlProps:ne=>({selected:typeof A=="string"?de(ne).isSame(A,"year"):!1,...d?.(ne)}),attributes:s.attributes})})]})}),w.jsx(Zo,{name:X,form:V,value:A,type:"default"})]})});_r.classes={...T.Input.classes,...wr.classes},_r.displayName="@mantine/dates/DateInput";function ps(t){const e=Ze.c(47),{fields:r,onClose:n,queryKey:s,apiPath:u,steps:h,onCreated:a}=t,[g,y]=G.useState(0),[_,P]=G.useState(!1),[x,S]=G.useState(),{mutateAsync:D,isError:O,error:N,isPending:z}=qo(u,s),{mutateAsync:F,isPending:q}=on(u,s),U=z||q;let ee;e[0]!==r?(ee=new Set(r.filter(bu).map(vu)),e[0]=r,e[1]=ee):ee=e[1];let re;e[2]!==ee?(re=[...ee],e[2]=ee,e[3]=re):re=e[3];const X=re;let V;e[4]!==r?(V=r.reduce(yu,{}),e[4]=r,e[5]=V):V=e[5];let H;e[6]!==r?(H=r.filter(mu).reduce(gu,{}),e[6]=r,e[7]=H):H=e[7];let K;e[8]!==V||e[9]!==H?(K={mode:"uncontrolled",initialValues:V,validate:H},e[8]=V,e[9]=H,e[10]=K):K=e[10];const W=On.useForm(K);let oe;e[11]!==W||e[12]!==x?(oe=function(i){const v=W.getValues();return i.conditional&&!i.conditional(v)?null:w.jsxs(G.Fragment,{children:[(i.type===void 0||i.type=="text")&&w.jsx(T.TextInput,{label:i.column.title,placeholder:i.placeholder??"",...W.getInputProps(i.id),type:i.id.includes("email")?"email":void 0,required:i.required},W.key(i.id)),i.type==="number"&&w.jsx(T.NumberInput,{decimalSeparator:",",label:i.column.title,placeholder:i.placeholder??"",...W.getInputProps(i.id),required:i.required},W.key(i.id)),i.type==="date"&&w.jsx(_r,{label:i.column.title,placeholder:i.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...W.getInputProps(i.id),required:i.required},W.key(i.id)),i.type==="boolean"&&w.jsx(T.Checkbox,{mt:"md",label:i.column.title,...W.getInputProps(i.id,{type:"checkbox"}),required:i.required},W.key(i.id)),i.type==="textarea"&&w.jsx(T.Textarea,{label:i.column.title,placeholder:i.placeholder??"",...W.getInputProps(i.id),minRows:3,autosize:!0,required:i.required},W.key(i.id)),i.type==="custom"&&i.render&&i.render({...W.getValues(),...x&&{id:x}},W.setValues,P,{error:W.getInputProps(i.id).error,required:i.required})]},i.id)},e[11]=W,e[12]=x,e[13]=oe):oe=e[13];const se=oe;let k;e[14]!==N?.message||e[15]!==N?.name||e[16]!==O?(k=O&&w.jsx(T.Alert,{variant:"outline",color:"red",title:N?.name??"Fehler aufgetreten",mb:"lg",children:N?.message??"Fehler aufgetreten"}),e[14]=N?.message,e[15]=N?.name,e[16]=O,e[17]=k):k=e[17];let C;e[18]!==g||e[19]!==D||e[20]!==W||e[21]!==O||e[22]!==n||e[23]!==a||e[24]!==x||e[25]!==X.length||e[26]!==F?(C=W.onSubmit(async f=>{if(x)await F({...f,id:x});else{const i=await D(f);S(i.id),a?.(i.id)}X.length&&g<X.length-1?O||y(g+1):O||(W.setInitialValues(f),W.reset(),n())}),e[18]=g,e[19]=D,e[20]=W,e[21]=O,e[22]=n,e[23]=a,e[24]=x,e[25]=X.length,e[26]=F,e[27]=C):C=e[27];let b;e[28]!==g||e[29]!==r||e[30]!==se||e[31]!==h||e[32]!==X?(b=X.length?w.jsx(T.Stepper,{active:g,size:"sm",children:X.map(f=>w.jsx(T.Stepper.Step,{...h&&h[f-1]?{label:h[f-1].label}:{},children:r.filter(i=>i.step===f).map(i=>se(i))},f))}):r.map(f=>se(f)),e[28]=g,e[29]=r,e[30]=se,e[31]=h,e[32]=X,e[33]=b):b=e[33];let c;e[34]!==g||e[35]!==_||e[36]!==U||e[37]!==n||e[38]!==X.length?(c=!_&&w.jsxs(T.Group,{mt:"md",justify:"end",children:[w.jsx(T.Button,{onClick:()=>X.length?g===0?n():y(g-1):n(),variant:"outline",children:X.length?g===0?"Abbrechen":"Zurück":"Abbrechen"}),w.jsx(T.Button,{type:"submit",loading:U,children:X.length?g===X.length-1?"Speichern":"Weiter":"Speichern"})]}),e[34]=g,e[35]=_,e[36]=U,e[37]=n,e[38]=X.length,e[39]=c):c=e[39];let d;e[40]!==c||e[41]!==C||e[42]!==b?(d=w.jsxs("form",{onSubmit:C,children:[b,c]}),e[40]=c,e[41]=C,e[42]=b,e[43]=d):d=e[43];let m;return e[44]!==d||e[45]!==k?(m=w.jsxs(w.Fragment,{children:[k,d]}),e[44]=d,e[45]=k,e[46]=m):m=e[46],m}function gu(t,e){return t[e.id]=(r,n)=>e.conditional&&!e.conditional(n)||r?null:"Pflichtfeld",t}function mu(t){return t.required}function yu(t,e){return t[e.id]=e.type==="boolean"?!1:e.defaultValue??"",t}function vu(t){return t.step}function bu(t){return typeof t.step=="number"}var[wu,hn]=T.createSafeContext("useDataTableColumnsContext must be used within DataTableColumnProvider"),gs=t=>{let{children:e,columnsOrder:r,setColumnsOrder:n,columnsToggle:s,setColumnsToggle:u,resetColumnsOrder:h,resetColumnsToggle:a,setColumnWidth:g,setMultipleColumnWidths:y,resetColumnsWidth:_}=t,[P,x]=G.useState(""),[S,D]=G.useState("");return w.jsx(wu,{value:{sourceColumn:P,setSourceColumn:x,targetColumn:S,setTargetColumn:D,columnsToggle:s,setColumnsToggle:u,swapColumns:()=>{if(!r||!n||!P||!S)return;let O=r.indexOf(P),N=r.indexOf(S);if(O!==-1&&N!==-1){let z=r.splice(O,1)[0];r.splice(N,0,z),n([...r])}},resetColumnsOrder:h,resetColumnsToggle:a,setColumnWidth:g,setMultipleColumnWidths:y,resetColumnsWidth:_},children:e})};function _u(){return w.jsx("tr",{className:"mantine-datatable-empty-row",children:w.jsx("td",{})})}function Cu(){return w.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.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"}),w.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"}),w.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"}),w.jsx("path",{d:"M3 3l18 18"})]})}function xu({icon:t,text:e,active:r,children:n}){return w.jsx(T.Center,{className:"mantine-datatable-empty-state","data-active":r||void 0,children:n||w.jsxs(w.Fragment,{children:[t||w.jsx("div",{className:"mantine-datatable-empty-state-icon",children:w.jsx(Cu,{})}),w.jsx(T.Text,{component:"div",size:"sm",c:"dimmed",children:e})]})})}function Su({key:t,columns:e=[],getInitialValueInEffect:r=!0}){function n(P,x){let S=[];return P.forEach(D=>{x.find(O=>O.accessor===D)&&S.push(D)}),x.forEach(D=>{S.includes(D.accessor)||S.push(D.accessor)}),S}let s=e&&e.map(P=>P.accessor)||[],[u,h]=Le.useLocalStorage({key:t?`${t}-columns-order`:"",defaultValue:t?s:void 0,getInitialValueInEffect:r});function a(P){t&&h(P)}let g=()=>{a(s)};if(!t)return{columnsOrder:u,setColumnsOrder:a,resetColumnsOrder:g};let y=n(u,e),_=JSON.stringify(u);return JSON.stringify(y)!==_&&a(y),{columnsOrder:y,setColumnsOrder:a,resetColumnsOrder:g}}function Du({key:t,columns:e=[],getInitialValueInEffect:r=!0,headerRef:n,onFixedLayoutChange:s}){let u=G.useRef(!1),h=G.useRef({}),[a,g]=G.useState(!0),y=G.useMemo(()=>e.some(H=>H.resizable&&!H.hidden&&H.accessor!=="__selection__"),[e]),_=G.useMemo(()=>e.filter(H=>H.resizable&&!H.hidden&&H.accessor!=="__selection__"),[e]),P=G.useMemo(()=>_.some(H=>H.width===void 0||H.width===""||H.width==="initial"),[_]),x=G.useCallback(()=>e.filter(H=>H.accessor!=="__selection__").map(H=>({[H.accessor]:H.width??"auto"})),[e]),[S,D]=Le.useLocalStorage({key:t?`${t}-columns-width`:"",defaultValue:t?x():void 0,getInitialValueInEffect:!1}),[O,N]=G.useState(()=>x());G.useEffect(()=>{g(!1)},[]);let z=G.useCallback(()=>{if(!n?.current||a)return{};let H=n.current,K=Array.from(H.querySelectorAll("th[data-accessor]")),W={};return K.forEach(oe=>{let se=oe.getAttribute("data-accessor");if(!se||se==="__selection__")return;let k=_.find(C=>C.accessor===se);if(k&&(k.width===void 0||k.width===""||k.width==="initial")){let C=oe.getBoundingClientRect();W[se]=Math.round(C.width)}}),W},[n,_,a]),F=G.useCallback(H=>{let K=H.filter(oe=>oe.accessor!=="__selection__"),W=O.map(oe=>{let se=Object.keys(oe)[0],k=K.find(C=>C.accessor===se);return k?{[se]:k.width}:oe});N(W),t&&D(W)},[O,t,D]),q=G.useCallback(H=>{F(H)},[F]),U=G.useCallback(()=>{if(!(!n?.current||!s||a))if(P)s(!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{let H=z();h.current={...h.current,...H};let K=e.filter(W=>W.accessor!=="__selection__").map(W=>{let oe=W.accessor,se=S?.find(C=>Object.keys(C)[0]===oe);if(se&&se[oe]!=="auto")return{[oe]:se[oe]};let k=H[oe];return k?{[oe]:`${k}px`}:{[oe]:W.width??"auto"}});N(K),setTimeout(()=>{s(!0),u.current=!0},10)})});else{let H=e.filter(K=>K.accessor!=="__selection__").map(K=>({[K.accessor]:K.width??"auto"}));N(H),s(!0),u.current=!0}},[n,s,a,P,z,e,S]),ee=U;G.useEffect(()=>{if(!y||!s||a){s?.(!1);return}u.current=!1;let H=setTimeout(()=>{U()},50);return()=>clearTimeout(H)},[y,s,a,U]),G.useEffect(()=>{a||!t||!r||S&&S.length>0&&N(S)},[a,t,r,S]);let re=G.useCallback(()=>{t&&D(x()),h.current={},u.current=!1,s&&(s(!1),setTimeout(()=>{U()},10))},[t,D,x,s,U]),X=G.useCallback((H,K)=>{F([{accessor:H,width:K}])},[F]),V=G.useMemo(()=>y?O.filter(H=>{let K=Object.keys(H)[0];return _.some(W=>W.accessor===K)}).every(H=>{let K=Object.values(H)[0];return K==="auto"||K==="initial"}):!1,[y,O,_]);return{columnsWidth:O,setColumnsWidth:F,setColumnWidth:X,setMultipleColumnWidths:q,resetColumnsWidth:re,hasResizableColumns:y,allResizableWidthsInitial:V,measureAndSetColumnWidths:ee}}function ku({key:t,columns:e=[],getInitialValueInEffect:r=!0}){function n(P,x){let S=[];return P.forEach(D=>{x.find(O=>O.accessor===D.accessor)&&S.push(D)}),x.forEach(D=>{S.find(O=>O.accessor===D.accessor)||S.push({accessor:D.accessor,defaultToggle:D.defaultToggle||!0,toggleable:D.toggleable,toggled:D.defaultToggle===void 0?!0:D.defaultToggle})}),S}let s=e&&e.map(P=>({accessor:P.accessor,defaultToggle:P.defaultToggle||!0,toggleable:P.toggleable,toggled:P.defaultToggle===void 0?!0:P.defaultToggle})),[u,h]=Le.useLocalStorage({key:t?`${t}-columns-toggle`:"",defaultValue:t?s:void 0,getInitialValueInEffect:r});function a(P){t&&h(P)}let g=()=>{a(s)};if(!t)return{columnsToggle:u,setColumnsToggle:a,resetColumnsToggle:g};let y=n(u,e),_=JSON.stringify(u);return JSON.stringify(y)!==_&&a(y),{columnsToggle:y,setColumnsToggle:a,resetColumnsToggle:g}}var Pu=({key:t,columns:e=[],getInitialValueInEffect:r=!0,headerRef:n,scrollViewportRef:s,onFixedLayoutChange:u})=>{let{columnsOrder:h,setColumnsOrder:a,resetColumnsOrder:g}=Su({key:t,columns:e,getInitialValueInEffect:r}),{columnsToggle:y,setColumnsToggle:_,resetColumnsToggle:P}=ku({key:t,columns:e,getInitialValueInEffect:r}),{columnsWidth:x,setColumnsWidth:S,setColumnWidth:D,setMultipleColumnWidths:O,resetColumnsWidth:N,hasResizableColumns:z,allResizableWidthsInitial:F,measureAndSetColumnWidths:q}=Du({key:t,columns:e,getInitialValueInEffect:r,headerRef:n,onFixedLayoutChange:u});return{effectiveColumns:G.useMemo(()=>h?h.map(U=>e.find(ee=>ee.accessor===U)).map(U=>({...U,hidden:U?.hidden||!y.find(ee=>ee.accessor===U?.accessor)?.toggled})).map(U=>U?.accessor==="__selection__"?U:{...U,width:x.find(ee=>ee[U?.accessor])?.[U?.accessor]}):e,[e,h,y,x]),setColumnsOrder:a,columnsOrder:h,resetColumnsOrder:g,columnsToggle:y,setColumnsToggle:_,resetColumnsToggle:P,columnsWidth:x,setColumnsWidth:S,setColumnWidth:D,setMultipleColumnWidths:O,resetColumnsWidth:N,hasResizableColumns:z,allResizableWidthsInitial:F,measureAndSetColumnWidths:q}},ms=typeof window<"u"?G.useLayoutEffect:G.useEffect;function ys(t){let e=G.useRef(t);return e.current=t,e}var vs="--mantine-datatable-header-height",bs="--mantine-datatable-footer-height",ws="--mantine-datatable-selection-column-width",_s="--mantine-datatable-last-row-border-bottom";function Xe(t,e,r){t?.style.setProperty(e,r)}function fn(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 pn(t,e,r){if(t){let n=new ResizeObserver(s=>{let u=s[0];u&&e(fn(u))});return n.observe(t),()=>{n.disconnect(),r()}}}function Mu({scrollCallbacks:t,withRowBorders:e}){let r={root:G.useRef(null),table:G.useRef(null),scrollViewport:G.useRef(null),header:G.useRef(null),footer:G.useRef(null),selectionColumnHeader:G.useRef(null)},{root:n,table:s,scrollViewport:u,header:h,footer:a,selectionColumnHeader:g}=r,y=ys({withRowBorders:e}),_=ys(t),P=G.useRef(()=>{}),x=G.useRef(()=>{}),S=G.useCallback(D=>{_.current.onScroll?.(D),P.current()},[]);return G.useEffect(()=>pn(h.current,D=>{Xe(n.current,vs,`${D.height}px`)},()=>Xe(n.current,vs,"0")),[h.current]),G.useEffect(()=>pn(a.current,D=>{Xe(n.current,bs,`${D.height}px`)},()=>Xe(n.current,bs,"0")),[a.current]),G.useEffect(()=>pn(g.current,D=>{Xe(n.current,ws,`${D.width}px`)},()=>Xe(n.current,ws,"0")),[g.current]),ms(()=>{if(typeof window===void 0)return;let D={top:!0,bottom:!0,left:!0,right:!0},O={width:0,height:0},N={width:0,height:0};function z(re,X){let V=D[re];return D[re]=X,Xe(n.current,`--mantine-datatable-${re}-shadow-opacity`,X?"0":"1"),V}function F(){let re=O.height-N.height,X=re<0;Xe(n.current,"--mantine-datatable-footer-position",X?"relative":"sticky"),Xe(n.current,"--mantine-datatable-footer-bottom",X?`${re}px`:"0")}function q(){y.current.withRowBorders&&O.height<N.height?Xe(n.current,_s,`${T.rem("1px")} solid var(--mantine-datatable-border-color)`):Xe(n.current,_s,"unset")}x.current=q;function U(){let re=_.current,X=u.current,V=X?.scrollTop??0,H=X?.scrollLeft??0,K=V===0,W=O.height-V-N.height<1,oe=z("top",K),se=z("bottom",W);K&&K!==oe&&re.onScrollToTop?.(),W&&W!==se&&re.onScrollToBottom?.();let k=X?getComputedStyle(X).direction==="rtl":!1,C=(X?.scrollWidth??0)-N.width,b,c;if(k){let f=Math.abs(H);c=f<1,b=C-f<1}else b=H<1,c=O.width-H-N.width<1;let d=z("left",b),m=z("right",c);b&&b!==d&&re.onScrollToLeft?.(),c&&c!==m&&re.onScrollToRight?.()}P.current=U;let ee=new ResizeObserver(re=>{for(let X of re)switch(X.target.tagName){case"TABLE":{O=fn(X);break}case"DIV":{N=fn(X);break}}U(),F(),q()});return ee.observe(s.current),ee.observe(u.current),()=>{ee.disconnect()}},[]),ms(()=>{x.current()},[e]),{refs:r,onScroll:S}}function Ou(t){let[e,r]=G.useState(null),n=t?.join(":")||"";return G.useEffect(()=>{r(null)},[n]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:r}}function Au(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 Eu(t,e){return e||(typeof window<"u"&&"matchMedia"in window?t.map(r=>window.matchMedia(r).matches):t.map(()=>!1))}function Tu(t,e,{getInitialValueInEffect:r}={getInitialValueInEffect:!0}){let[n,s]=G.useState(r?e:Eu(t,e)),u=G.useRef(null);return G.useEffect(()=>{if("matchMedia"in window)return u.current=t.map(h=>window.matchMedia(h)),s(u.current.map(h=>h.matches)),Au(u.current,h=>{s(h)})},[t]),n}function ju(t){let e=T.useMantineTheme(),r=G.useMemo(()=>t.map(s=>(typeof s=="function"?s(e):s)??""),[t,e]),n=G.useMemo(()=>t.map(()=>!0),[t]);return Tu(r,n)}function Cr(t){let e=T.useMantineTheme(),r=typeof t=="function"?t(e):t;return Le.useMediaQuery(r||"",!0)}function gn(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 $u(t,e,r){return t.filter(n=>!e.map(r).includes(r(n)))}function mn(t,e){return t.filter((r,n,s)=>n===s.findIndex(u=>e(r)===e(u)))}function Cs(t,e){return e?e.match(/([^[.\]])+/g).reduce((r,n)=>r&&r[n],t):void 0}function Ie(t,e){return typeof e=="string"?Cs(t,e):e(t)}function xs(t){return!t||t.length===0?0:Math.max(...t.map(e=>e.groups&&e.groups.length>0?1+xs(e.groups):1))}function yn(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(...yn(r.groups));return e.filter(r=>r!=null)}function vn(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+vn(n,e),0):0}function Ss(t,e,r=0){if(r===e)return[...t];let n=[];for(let s of t)s.groups&&s.groups.length>0&&n.push(...Ss(s.groups,e,r+1));return n}function Ru(t,e,r){return r?!t||e:!1}function Nu({rowExpansion:t,records:e,idAccessor:r}){let n=[];if(t&&e){let{trigger:a,allowMultiple:g,initiallyExpanded:y}=t;e&&a==="always"?n=e.map(_=>Ie(_,r)):y&&(n=e.filter((_,P)=>y({record:_,index:P})).map(_=>Ie(_,r)),g||(n=[n[0]]))}let s,u,h=G.useState(n);if(t){let{expandable:a,trigger:g,allowMultiple:y,collapseProps:_,content:P}=t;t.expanded?{recordIds:s,onRecordIdsChange:u}=t.expanded:[s,u]=h;let x=S=>u?.(s.filter(D=>D!==Ie(S,r)));return{expandOnClick:g!=="always"&&g!=="never",isRowExpanded:S=>g==="always"?!0:s.includes(Ie(S,r)),isExpandable:({record:S,index:D})=>a?a({record:S,index:D}):!0,expandRow:S=>{let D=Ie(S,r);u?.(y?[...s,D]:[D])},collapseRow:x,collapseProps:_,content:({record:S,index:D})=>()=>P({record:S,index:D,collapse:()=>x(S)})}}}function Lu(t,e){let[r,n]=G.useState(t),[s,u]=G.useState(t),h=Le.useTimeout(()=>n(!0),0),a=Le.useTimeout(()=>u(!1),e||200);return G.useEffect(()=>{t?(a.clear(),u(!0),h.start()):(h.clear(),n(!1),a.start())},[h,a,t]),{expanded:r,visible:s}}var bn="mantine-datatable-nowrap",wn="mantine-datatable-ellipsis",Mt="mantine-datatable-pointer-cursor",Ds="mantine-datatable-context-menu-cursor",Bu="mantine-datatable-text-selection-disabled",xr="mantine-datatable-text-align-left",Sr="mantine-datatable-text-align-center",Dr="mantine-datatable-text-align-right";function Iu({className:t,style:e,visibleMediaQuery:r,title:n,noWrap:s,ellipsis:u,textAlign:h,width:a}){return Cr(r)?w.jsx(T.TableTh,{className:Pe({[bn]:s||u,[wn]:u,[xr]:h==="left",[Sr]:h==="center",[Dr]:h==="right"},t),style:[{width:a,minWidth:a,maxWidth:a},e],children:n}):null}function Yu({shadowVisible:t}){return w.jsx(T.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":t||void 0})}function zu({className:t,style:e,columns:r,defaultColumnProps:n,selectionVisible:s,selectorCellShadowVisible:u,ref:h}){return w.jsx(T.TableTfoot,{ref:h,className:Pe("mantine-datatable-footer",t),style:e,children:w.jsxs(T.TableTr,{children:[s&&w.jsx(Yu,{shadowVisible:u}),r.map(({hidden:a,...g})=>{if(a)return null;let{accessor:y,visibleMediaQuery:_,textAlign:P,width:x,footer:S,footerClassName:D,footerStyle:O,noWrap:N,ellipsis:z}={...n,...g};return w.jsx(Iu,{className:D,style:O,visibleMediaQuery:_,textAlign:P,width:x,title:S,noWrap:N,ellipsis:z},y)})]})})}function Fu({group:{id:t,columns:e,groups:r,title:n,textAlign:s,className:u,style:h},maxDepth:a,currentDepth:g,previousGroups:y,isLastGroup:_,withColumnBorders:P=!1,totalTableColumns:x}){let S=G.useMemo(()=>e&&e.length>0?e:r&&r.length>0?yn([{id:t,columns:e,groups:r}]):[],[e,r,t]),D=G.useMemo(()=>S.map(({visibleMediaQuery:ee})=>ee),[S]),O=ju(D),N=G.useMemo(()=>vn({columns:e,groups:r},O),[t,e,r,O]),z=G.useMemo(()=>y.reduce((ee,re)=>ee+vn(re,O),0),[y,O]),F=r&&r.length>0?1:a-g,q=z+N<x,U=Ru(_,q,P);return N>0?w.jsx(T.TableTh,{colSpan:N,rowSpan:F>1?F:void 0,className:Pe("mantine-datatable-column-group-header-cell",{[xr]:s==="left",[Sr]:s==="center",[Dr]:s==="right","mantine-datatable-column-group-header-cell--needs-border":U},u),style:h,children:n??gn(t)}):null}function Wu(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.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 Uu(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.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:h}]=Le.useDisclosure(!1),a=e?Uu:Wu,g=Le.useClickOutside(u);return n&&(g=void 0),w.jsxs(T.Popover,{withArrow:!0,shadow:"md",opened:s,onClose:u,trapFocus:!0,...r,children:[w.jsx(T.PopoverTarget,{children:w.jsx(T.ActionIcon,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":e||void 0,size:"sm",variant:"default",onClick:y=>{y.preventDefault(),h()},onKeyDown:y=>y.stopPropagation(),children:w.jsx(a,{})})}),w.jsx(T.PopoverDropdown,{ref:g,onClick:y=>y.stopPropagation(),onKeyDown:y=>y.stopPropagation(),children:typeof t=="function"?t({close:u}):t})]})}var Vu=t=>{let{accessor:e,columnRef:r}=t,[n,s]=G.useState(!1),u=G.useRef(0),h=G.useRef({current:0,next:0}),{dir:a}=T.useDirection(),g=a==="rtl",{setMultipleColumnWidths:y}=hn(),_=G.useCallback(x=>{if(x.preventDefault(),x.stopPropagation(),!r.current)return;let S=r.current,D=S.nextElementSibling;for(;D;){let ee=D.getAttribute("data-accessor");if(ee&&ee!=="__selection__")break;D=D.nextElementSibling}if(!D)return;let O=D.getAttribute("data-accessor");if(!O)return;let N=O==="__selection__";s(!0),u.current=x.clientX;let z=S.offsetWidth,F=D.offsetWidth;h.current={current:z,next:F};let q=ee=>{if(!r.current)return;let re=r.current,X=re.nextElementSibling;if(!X)return;let V=ee.clientX-u.current;g&&(V=-V);let H=50,K=h.current.current-H,W=h.current.next-H,oe=Math.max(-K,Math.min(V,W)),se=h.current.current+oe,k=h.current.next-oe;re.style.width=`${se}px`,X.style.width=`${k}px`,re.style.minWidth=`${se}px`,re.style.maxWidth=`${se}px`,X.style.minWidth=`${k}px`,X.style.maxWidth=`${k}px`},U=()=>{if(!r.current)return;let ee=r.current,re=ee.nextElementSibling;s(!1),document.body.style.cursor="initial",document.body.style.userSelect="initial";let X=parseInt(ee.style.width)||ee.offsetWidth,V=re?parseInt(re.style.width)||re.offsetWidth:0,H=[{accessor:e,width:`${X}px`}];if(re&&!N){let K=re.getAttribute("data-accessor");K&&H.push({accessor:K,width:`${V}px`})}setTimeout(()=>{y(H)},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,g,y]),P=G.useCallback(()=>{if(!r.current)return;let x=r.current,S=x.nextElementSibling;x.style.width="",x.style.minWidth="",x.style.maxWidth="";let D=[{accessor:e,width:"auto"}];if(S){S.style.width="",S.style.minWidth="",S.style.maxWidth="";let O=S.getAttribute("data-accessor");O&&O!=="__selection__"&&D.push({accessor:O,width:"auto"})}setTimeout(()=>{y(D)},0)},[e,r,y]);return w.jsx("div",{className:"mantine-datatable-header-resizable-handle",style:{cursor:n?"col-resize":void 0},onMouseDown:_,onDoubleClick:P,onClick:x=>x.stopPropagation(),title:"Drag to resize column, double-click to reset"})};function Hu(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.jsx("path",{d:"M12 5l0 14"}),w.jsx("path",{d:"M16 9l-4 -4"}),w.jsx("path",{d:"M8 9l4 -4"})]})}function Gu(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.jsx("path",{d:"M8 7l4 -4l4 4"}),w.jsx("path",{d:"M8 17l4 4l4 -4"}),w.jsx("path",{d:"M12 3l0 18"})]})}function Qu(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.jsx("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),w.jsx("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),w.jsx("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),w.jsx("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),w.jsx("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),w.jsx("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]})}function Zu(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.jsx("path",{d:"M18 6l-12 12"}),w.jsx("path",{d:"M6 6l12 12"})]})}function Ku({className:t,style:e,accessor:r,visibleMediaQuery:n,title:s,sortable:u,draggable:h,toggleable:a,resizable:g,sortIcons:y,textAlign:_,width:P,sortStatus:x,onSortStatusChange:S,filter:D,filterPopoverProps:O,filterPopoverDisableClickOutside:N,filtering:z,sortKey:F}){let{setSourceColumn:q,setTargetColumn:U,swapColumns:ee,setColumnsToggle:re}=hn(),[X,V]=G.useState(!1),H=G.useRef(null);if(!Cr(n))return null;let K=s??gn(r),W=typeof K=="string"?K:void 0,oe=u&&S?m=>{m?.defaultPrevented||S({sortKey:F,columnAccessor:r,direction:x?.columnAccessor===r?x.direction==="asc"?"desc":"asc":x?.direction??"asc"})}:void 0,se=m=>{m.stopPropagation(),q(r),V(!1)},k=m=>{m.preventDefault(),U(r),V(!0)},C=()=>{U(r),V(!1),ee()},b=()=>{V(!0)},c=()=>{V(!1)},d=m=>{m.stopPropagation(),re(f=>f.map(i=>i.accessor===r?{...i,toggled:!1}:i))};return w.jsxs(T.TableTh,{"data-accessor":r,className:Pe({"mantine-datatable-header-cell-sortable":u,"mantine-datatable-header-cell-toggleable":a,"mantine-datatable-header-cell-resizable":g},t),style:[{width:P,...g?{}:{minWidth:P,maxWidth:P}},e],role:u?"button":void 0,tabIndex:u?0:void 0,onClick:oe,onKeyDown:m=>m.key==="Enter"&&oe?.(),ref:H,children:[w.jsxs(T.Group,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[w.jsxs(T.Flex,{align:"center",w:"100%",className:Pe({"mantine-datatable-header-cell-draggable":h,"mantine-datatable-header-cell-drag-over":X}),draggable:h,onDragStart:h?se:void 0,onDragEnter:h?b:void 0,onDragOver:h?k:void 0,onDrop:h?C:void 0,onDragLeave:h?c:void 0,children:[h?w.jsx(T.Center,{role:"img","aria-label":"Drag column",children:w.jsx(T.ActionIcon,{className:"mantine-datatable-header-cell-draggable-action-icon",variant:"subtle",size:"xs",onClick:m=>{m.stopPropagation()},children:w.jsx(Qu,{})})}):null,w.jsx(T.Box,{className:Pe("mantine-datatable-header-cell-sortable-text",{[xr]:_==="left",[Sr]:_==="center",[Dr]:_==="right"},bn,wn),title:W,children:K})]}),a?w.jsx(T.Center,{className:"mantine-datatable-header-cell-toggleable-icon",role:"img","aria-label":"Toggle column",children:w.jsx(T.ActionIcon,{size:"xs",variant:"light",onClick:d,children:w.jsx(Zu,{})})}):null,u||x?.columnAccessor===r?w.jsx(w.Fragment,{children:x?.columnAccessor===r?w.jsx(T.Center,{className:Pe("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":x.direction==="desc"}),role:"img","aria-label":`Sorted ${x.direction==="desc"?"descending":"ascending"}`,children:y?.sorted||w.jsx(Hu,{})}):w.jsx(T.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:y?.unsorted||w.jsx(Gu,{})})}):null,D?w.jsx(qu,{filterPopoverProps:O,isActive:!!z,filterPopoverDisableClickOutside:N,children:D}):null]}),g&&r!=="__selection__"?w.jsx(Vu,{accessor:r,columnRef:H}):null]})}function Ju({className:t,style:e,trigger:r,shadowVisible:n,checked:s,indeterminate:u,checkboxProps:h,onChange:a,rowSpan:g,ref:y}){let _=!h.disabled;return w.jsx(T.TableTh,{ref:y,className:Pe("mantine-datatable-header-selector-cell",{[Mt]:r==="cell"&&_},t),style:e,rowSpan:g,"data-shadow-visible":n||void 0,"data-accessor":"__selection__",onClick:r==="cell"&&_?a:void 0,children:w.jsx(T.Checkbox,{classNames:_?{input:Mt}:void 0,checked:s,indeterminate:u,onChange:a,...h,disabled:!(a||h.onChange)||h.disabled})})}function Xu({selectionColumnHeaderRef:t,className:e,style:r,sortStatus:n,sortIcons:s,onSortStatusChange:u,columns:h,defaultColumnProps:a,groups:g,selectionTrigger:y,selectionVisible:_,selectionChecked:P,selectionIndeterminate:x,onSelectionChange:S,selectionCheckboxProps:D,selectorCellShadowVisible:O,selectionColumnClassName:N,selectionColumnStyle:z,withColumnBorders:F=!1,ref:q}){let U=g?xs(g):0,ee=U>0?U+1:1,re=_?w.jsx(Ju,{ref:t,className:N,style:z,trigger:y,shadowVisible:O,checked:P,indeterminate:x,checkboxProps:D,onChange:S,rowSpan:g?ee:void 0}):null,{columnsToggle:X,setColumnsToggle:V}=hn(),[H,K]=G.useState(!1),W=h.some(k=>k.toggleable),oe=W?Object.fromEntries(h.map(({accessor:k,title:C})=>[k,C??gn(String(k))])):void 0,se=w.jsxs(T.TableThead,{className:Pe("mantine-datatable-header",e),style:r,ref:q,onContextMenu:W?k=>{k.preventDefault(),K(C=>!C)}:void 0,children:[g&&Array.from({length:U},(k,C)=>{let b=Ss(g,C);return w.jsxs(T.TableTr,{children:[C===0&&re,b.map((c,d)=>w.jsx(Fu,{group:c,maxDepth:U,currentDepth:C,previousGroups:b.slice(0,d),isLastGroup:d===b.length-1,withColumnBorders:F,totalTableColumns:h.length},c.id))]},`group-depth-${C}`)}),w.jsxs(T.TableTr,{children:[!g&&re,h.map(({hidden:k,...C},b)=>{if(k)return null;let{accessor:c,visibleMediaQuery:d,textAlign:m,width:f,title:i,sortable:v,draggable:E,toggleable:j,resizable:Q,titleClassName:J,titleStyle:te,filter:Z,filterPopoverProps:ae,filterPopoverDisableClickOutside:ie,filtering:ue,sortKey:A}={...a,...C};return w.jsx(Ku,{accessor:c,className:J,style:te,visibleMediaQuery:d,textAlign:m,width:f,title:i,sortable:v,draggable:E,toggleable:j,resizable:Q&&b<h.length-1,sortStatus:n,sortIcons:s,sortKey:A,onSortStatusChange:u,filter:Z,filterPopoverProps:ae,filterPopoverDisableClickOutside:ie,filtering:ue},c)})]})]});return W?w.jsxs(T.Popover,{position:"bottom",withArrow:!0,shadow:"md",opened:H,onChange:K,children:[w.jsx(T.PopoverTarget,{children:se}),w.jsx(T.PopoverDropdown,{children:w.jsx(T.Stack,{children:X.filter(k=>k.toggleable).map(k=>w.jsx(T.Group,{children:w.jsx(T.Checkbox,{classNames:{label:"mantine-datatable-header-column-toggle-checkbox-label"},size:"xs",label:oe[k.accessor],checked:k.toggled,onChange:C=>{V(X.map(b=>b.accessor===k.accessor?{...b,toggled:C.currentTarget.checked}:b))}})},k.accessor))})})]}):se}function ec({fetching:t,customContent:e,backgroundBlur:r,size:n,type:s,color:u}){return w.jsx(T.Center,{className:Pe("mantine-datatable-loader",{"mantine-datatable-loader-fetching":t}),style:[{backdropFilter:r?`blur(${r}px)`:void 0}],children:t&&(e||w.jsx(T.Loader,{size:n,type:s,color:u}))})}function Ae(t,e,r){return t?T.parseThemeColor({color:typeof t=="object"?t[r]:t,theme:e}).value:void 0}function tc({theme:t,c:e,backgroundColor:r,borderColor:n,rowBorderColor:s,stripedColor:u,highlightOnHoverColor:h}){return{"--mantine-datatable-color-light":Ae(e,t,"light"),"--mantine-datatable-color-dark":Ae(e,t,"dark"),"--mantine-datatable-background-color-light":Ae(r,t,"light"),"--mantine-datatable-background-color-dark":Ae(r,t,"dark"),"--mantine-datatable-border-color-light":Ae(n,t,"light"),"--mantine-datatable-border-color-dark":Ae(n,t,"dark"),"--mantine-datatable-row-border-color-light":Ae(s,t,"light"),"--mantine-datatable-row-border-color-dark":Ae(s,t,"dark"),"--mantine-datatable-striped-color-light":Ae(u,t,"light"),"--mantine-datatable-striped-color-dark":Ae(u,t,"dark"),"--mantine-datatable-highlight-on-hover-color-light":Ae(h,t,"light"),"--mantine-datatable-highlight-on-hover-color-dark":Ae(h,t,"dark")}}function ks({theme:t,paginationActiveTextColor:e,paginationActiveBackgroundColor:r}){return{"--mantine-datatable-pagination-active-text-color-light":Ae(e,t,"light"),"--mantine-datatable-pagination-active-text-color-dark":Ae(e,t,"dark"),"--mantine-datatable-pagination-active-background-color-light":Ae(r,t,"light"),"--mantine-datatable-pagination-active-background-color-dark":Ae(r,t,"dark")}}function rc({theme:t,color:e,backgroundColor:r}){return{"--mantine-datatable-row-color-light":Ae(e,t,"light"),"--mantine-datatable-row-color-dark":Ae(e,t,"dark"),"--mantine-datatable-row-background-color-light":Ae(r,t,"light"),"--mantine-datatable-row-background-color-dark":Ae(r,t,"dark")}}function nc(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.jsx("path",{d:"M8 9l4 -4l4 4"}),w.jsx("path",{d:"M16 15l-4 4l-4 -4"})]})}var Ps={xs:T.rem(22),sm:T.rem(26),md:T.rem(32),lg:T.rem(38),xl:T.rem(44)};function oc({size:t,label:e,values:r,value:n,activeTextColor:s,activeBackgroundColor:u,onChange:h}){return w.jsxs(T.Group,{gap:"xs",children:[w.jsx(T.Text,{component:"div",size:t,children:e}),w.jsxs(T.Menu,{withinPortal:!0,withArrow:!0,offset:2,classNames:{arrow:"mantine-datatable-page-size-selector-menu-arrow"},children:[w.jsx(T.MenuTarget,{children:w.jsx(T.Button,{size:t,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:w.jsx(nc,{}),style:[{fontWeight:"normal"},a=>({height:Ps[t],paddingLeft:a.spacing[t],paddingRight:a.spacing[t]})],children:n})}),w.jsx(T.MenuDropdown,{children:r.map(a=>{let g=a===n;return w.jsx(T.MenuItem,{className:Pe({"mantine-datatable-page-size-selector-active":g}),style:[{height:Ps[t]},g&&(s||u)?y=>ks({theme:y,paginationActiveTextColor:s,paginationActiveBackgroundColor:u}):void 0],disabled:g,onClick:()=>h(a),children:w.jsx(T.Text,{component:"div",size:t,children:a})},a)})})]})]})}function sc({className:t,style:e,fetching:r,page:n,onPageChange:s,paginationWithEdges:u,paginationWithControls:h,paginationActiveTextColor:a,paginationActiveBackgroundColor:g,paginationSize:y,loadingText:_,noRecordsText:P,paginationText:x,totalRecords:S,recordsPerPage:D,onRecordsPerPageChange:O,recordsPerPageLabel:N,recordsPerPageOptions:z,recordsLength:F,horizontalSpacing:q,paginationWrapBreakpoint:U,getPaginationControlProps:ee,getPaginationItemProps:re,renderPagination:X}){let V;if(S){let C=(n-1)*D+1,b=C+(F||0)-1;V=x({from:C,to:b,totalRecords:S})}else V=r?_:P;let H=S&&D?Math.max(1,Math.ceil(S/D)):1,K=S?(n-1)*(D??0)+1:void 0,W=S?(K??1)+(F??0)-1:void 0,oe=!Cr(({breakpoints:C})=>`(min-width: ${typeof U=="number"?`${T.rem(U)}rem`:C[U]||U})`),se={Text:C=>w.jsx(T.Text,{component:"div",className:"mantine-datatable-pagination-text",size:y,...C,children:V}),PageSizeSelector:C=>z?w.jsx(oc,{activeTextColor:a,activeBackgroundColor:g,size:y,label:N,values:z,value:D,onChange:O,...C}):w.jsx(w.Fragment,{}),Pagination:C=>w.jsx(T.Pagination,{classNames:{root:Pe("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":r||!F}),control:"mantine-datatable-pagination-pages-control"},style:a||g?b=>ks({theme:b,paginationActiveTextColor:a,paginationActiveBackgroundColor:g}):void 0,withEdges:u,withControls:h,value:n,onChange:s,size:y,total:H,getControlProps:ee,getItemProps:re,...C})},k={state:{paginationSize:y,page:n,totalPages:H,totalRecords:S,recordsPerPage:D,recordsLength:F,fetching:r,from:K,to:W,isWrapped:oe},actions:{setPage:C=>s?.(C),setRecordsPerPage:O?C=>O(C):void 0},Controls:se};return w.jsx(T.Box,{px:q??"xs",py:"xs",className:Pe("mantine-datatable-pagination",t),style:[{flexDirection:oe?"column":"row"},e],children:typeof X=="function"?X(k):w.jsxs(w.Fragment,{children:[w.jsx(se.Text,{}),w.jsx(se.PageSizeSelector,{}),w.jsx(se.Pagination,{})]})})}function ic({className:t,style:e,visibleMediaQuery:r,record:n,index:s,onClick:u,onDoubleClick:h,onContextMenu:a,noWrap:g,ellipsis:y,textAlign:_,width:P,accessor:x,render:S,defaultRender:D,customCellAttributes:O}){return Cr(r)?w.jsx(T.TableTd,{className:Pe({[bn]:g||y,[wn]:y,[Mt]:u||h,[Ds]:a,[xr]:_==="left",[Sr]:_==="center",[Dr]:_==="right"},t),style:[{width:P,minWidth:P,maxWidth:P},e],onClick:u,onDoubleClick:h,onContextMenu:a,...O?.(n,s),children:S?S(n,s):D?D(n,s,x):Cs(n,x)}):null}function ac({open:t,colSpan:e,content:r,collapseProps:n}){let{expanded:s,visible:u}=Lu(t,n?.transitionDuration);return u?w.jsxs(w.Fragment,{children:[w.jsx(T.TableTr,{}),w.jsx(T.TableTr,{children:w.jsx(T.TableTd,{className:"mantine-datatable-row-expansion-cell",colSpan:e,children:w.jsx(T.Collapse,{in:s,...n,children:w.jsx("div",{className:"mantine-datatable-row-expansion-cell-content",children:r()})})})})]}):null}function lc({className:t,style:e,record:r,index:n,trigger:s,onChange:u,withRightShadow:h,checkboxProps:a,getCheckboxProps:g,...y}){let _={...a,...g(r,n)},P=!y.disabled&&!_.disabled,x=S=>{S.stopPropagation(),s==="cell"&&P&&u?.(S)};return w.jsx(T.TableTd,{className:Pe("mantine-datatable-row-selector-cell",{[Mt]:s==="cell"&&P},t),style:e,"data-shadow-visible":h||void 0,onClick:x,children:w.jsx(T.Checkbox,{classNames:P?{input:Mt}:void 0,onChange:u,...y,..._})})}function uc({record:t,index:e,columns:r,defaultColumnProps:n,defaultColumnRender:s,selectionTrigger:u,selectionVisible:h,selectionChecked:a,onSelectionChange:g,isRecordSelectable:y,selectionCheckboxProps:_,getSelectionCheckboxProps:P,onClick:x,onDoubleClick:S,onContextMenu:D,onCellClick:O,onCellDoubleClick:N,onCellContextMenu:z,expansion:F,customAttributes:q,color:U,backgroundColor:ee,className:re,style:X,selectorCellShadowVisible:V,selectionColumnClassName:H,selectionColumnStyle:K,rowFactory:W}){let oe=w.jsxs(w.Fragment,{children:[h&&w.jsx(lc,{className:H,style:K,record:t,index:e,trigger:u,withRightShadow:V,checked:a,disabled:!g||(y?!y(t,e):!1),onChange:g,checkboxProps:_,getCheckboxProps:P}),r.map(({hidden:C,hiddenContent:b,...c},d)=>{if(C||b)return null;let{accessor:m,visibleMediaQuery:f,textAlign:i,noWrap:v,ellipsis:E,width:j,render:Q,cellsClassName:J,cellsStyle:te,customCellAttributes:Z}={...n,...c};return w.jsx(ic,{className:typeof J=="function"?J(t,e):J,style:te?.(t,e),visibleMediaQuery:f,record:t,index:e,onClick:O?ae=>O({event:ae,record:t,index:e,column:c,columnIndex:d}):void 0,onDoubleClick:N?ae=>N({event:ae,record:t,index:e,column:c,columnIndex:d}):void 0,onContextMenu:z?ae=>z({event:ae,record:t,index:e,column:c,columnIndex:d}):void 0,accessor:m,textAlign:i,noWrap:v,ellipsis:E,width:j,render:Q,defaultRender:s,customCellAttributes:Z},m)})]}),se=F&&w.jsx(ac,{colSpan:r.filter(({hidden:C})=>!C).length+(h?1:0),open:F.isRowExpanded(t),content:F.content({record:t,index:e}),collapseProps:F.collapseProps}),k=cc({record:t,index:e,selectionChecked:a,onClick:x,onDoubleClick:S,onContextMenu:D,expansion:F,customAttributes:q,color:U,backgroundColor:ee,className:re,style:X});return W?W({record:t,index:e,rowProps:k,children:oe,expandedElement:se}):w.jsxs(w.Fragment,{children:[w.jsx(T.TableTr,{...k,children:oe}),se]})}function cc({record:t,index:e,selectionChecked:r,onClick:n,onDoubleClick:s,onContextMenu:u,expansion:h,customAttributes:a,color:g,backgroundColor:y,className:_,style:P}){return{className:Pe("mantine-datatable-row",{[Mt]:n||s||h?.isExpandable({record:t,index:e})&&h?.expandOnClick},{[Ds]:u},typeof _=="function"?_(t,e):_),"data-selected":r||void 0,onClick:x=>{if(h){let{isExpandable:S,isRowExpanded:D,expandOnClick:O,expandRow:N,collapseRow:z}=h;S({record:t,index:e})&&O&&(D(t)?z(t):N(t))}n?.({event:x,record:t,index:e})},onDoubleClick:s?x=>s({event:x,record:t,index:e}):void 0,onContextMenu:u?x=>u({event:x,record:t,index:e}):void 0,style:[g||y?x=>{let S=g?.(t,e),D=y?.(t,e);return rc({theme:x,color:S,backgroundColor:D})}:void 0,P?.(t,e)],...a?.(t,e)??{}}}function dc({leftShadowBehind:t,rightShadowBehind:e,onScrollPositionChange:r,children:n,viewportRef:s,scrollAreaProps:u}){return w.jsxs(T.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,w.jsx(T.Box,{className:Pe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow")}),w.jsx("div",{className:Pe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-behind":t})}),w.jsx("div",{className:Pe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-behind":e})}),w.jsx(T.Box,{className:Pe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow")})]})}function hc({withTableBorder:t,borderRadius:e,textSelectionDisabled:r,height:n="100%",minHeight:s,maxHeight:u,shadow:h,verticalAlign:a="center",fetching:g,columns:y,storeColumnsKey:_,groups:P,pinFirstColumn:x,pinLastColumn:S,defaultColumnProps:D,defaultColumnRender:O,idAccessor:N="id",records:z,selectionTrigger:F="checkbox",selectedRecords:q,onSelectedRecordsChange:U,selectionColumnClassName:ee,selectionColumnStyle:re,isRecordSelectable:X,selectionCheckboxProps:V,allRecordsSelectionCheckboxProps:H={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:K=(rt,Vt)=>({"aria-label":`Select record ${Vt+1}`}),sortStatus:W,sortIcons:oe,onSortStatusChange:se,horizontalSpacing:k,page:C,onPageChange:b,totalRecords:c,recordsPerPage:d,onRecordsPerPageChange:m,recordsPerPageOptions:f,recordsPerPageLabel:i="Records per page",paginationWithEdges:v,paginationWithControls:E,paginationActiveTextColor:j,paginationActiveBackgroundColor:Q,paginationSize:J="sm",paginationText:te=({from:rt,to:Vt,totalRecords:Cn})=>`${rt} - ${Vt} / ${Cn}`,paginationWrapBreakpoint:Z="sm",getPaginationControlProps:ae=rt=>rt==="previous"?{"aria-label":"Previous page"}:rt==="next"?{"aria-label":"Next page"}:{},getPaginationItemProps:ie,renderPagination:ue,loaderBackgroundBlur:A,customLoader:L,loaderSize:$,loaderType:I,loaderColor:Y,loadingText:ce="...",emptyState:o,noRecordsText:l="No records",noRecordsIcon:p,highlightOnHover:M,striped:R,noHeader:B,onRowClick:le,onRowDoubleClick:he,onRowContextMenu:pe,onCellClick:ne,onCellDoubleClick:fe,onCellContextMenu:me,onScroll:ge,onScrollToTop:xe,onScrollToBottom:Ce,onScrollToLeft:Se,onScrollToRight:Ye,c:Ee,backgroundColor:_e,borderColor:nt,rowBorderColor:je,stripedColor:Ve,highlightOnHoverColor:ze,rowColor:et,rowBackgroundColor:ot,rowExpansion:$e,rowClassName:pt,rowStyle:wt,customRowAttributes:He,scrollViewportRef:Ge,scrollAreaProps:Qe,tableRef:st,bodyRef:gt,m:mt,my:ve,mx:De,mt:Fe,mb:at,ml:Me,mr:Oe,className:_t,classNames:Te,style:ke,styles:Ne,rowFactory:tt,tableWrapper:yt,..._n}){let rt=G.useMemo(()=>P?yn(P):y,[y,P]),[Vt,Cn]=G.useState(!1),{refs:it,onScroll:jc}=Mu({scrollCallbacks:{onScroll:ge,onScrollToTop:xe,onScrollToBottom:Ce,onScrollToLeft:Se,onScrollToRight:Ye},withRowBorders:_n.withRowBorders}),xn=Pu({key:_,columns:rt,headerRef:it.header,scrollViewportRef:it.scrollViewport,onFixedLayoutChange:Cn}),$c=Le.useMergedRef(it.table,st),Rc=Le.useMergedRef(it.scrollViewport,Ge),Nc=Nu({rowExpansion:$e,records:z,idAccessor:N}),kr=G.useRef(!1),$s=G.useRef(C),Sn=G.useRef(z),Lc=G.useCallback(be=>{kr.current=!0,Sn.current=z,b(be)},[b,z]);G.useEffect(()=>{$s.current!==C&&(kr.current=!0,Sn.current=z,$s.current=C)},[C,z]);let Pr=z?.length;G.useLayoutEffect(()=>{if(!kr.current||g||z===Sn.current)return;let be=it.scrollViewport.current;if(!be)return;let Ct=requestAnimationFrame(()=>{be.scrollTo({top:0,left:0}),kr.current=!1});return()=>cancelAnimationFrame(Ct)},[g,z,it.scrollViewport]);let Rs=z?.map(be=>Ie(be,N)),Ot=!!q,Ht=q?.map(be=>Ie(be,N)),Ns=Rs!==void 0&&Ht!==void 0&&Ht.length>0,Dn=X?z?.filter(X):z,Mr=Dn?.map(be=>Ie(be,N)),Or=Ns&&Mr.every(be=>Ht.includes(be)),Bc=Ns&&Mr.some(be=>Ht.includes(be)),Ic=G.useCallback(()=>{q&&U&&U(Or?q.filter(be=>!Mr.includes(Ie(be,N))):mn([...q,...Dn],be=>Ie(be,N)))},[Or,N,U,Mr,Dn,q]),{lastSelectionChangeIndex:Ar,setLastSelectionChangeIndex:Yc}=Ou(Rs),kn=Ot&&!x,zc={m:mt,my:ve,mx:De,mt:Fe,mb:at,ml:Me,mr:Oe},Fc=G.useCallback(({children:be})=>yt?yt({children:be}):be,[yt]);return w.jsx(gs,{...xn,children:w.jsxs(T.Box,{ref:it.root,...zc,className:Pe("mantine-datatable",{"mantine-datatable-with-border":t},_t,Te?.root),style:[be=>({...tc({theme:be,c:Ee,backgroundColor:_e,borderColor:nt,rowBorderColor:je,stripedColor:Ve,highlightOnHoverColor:ze}),borderRadius:be.radius[e]||e,boxShadow:be.shadows[h]||h,height:n,minHeight:s,maxHeight:u}),ke,Ne?.root,{position:"relative"}],children:[w.jsx(dc,{viewportRef:Rc,leftShadowBehind:Ot||!!x,rightShadowBehind:S,onScrollPositionChange:jc,scrollAreaProps:Qe,children:w.jsx(Fc,{children:w.jsxs(T.Table,{ref:$c,horizontalSpacing:k,className:Pe("mantine-datatable-table",{[Bu]:r,"mantine-datatable-vertical-align-top":a==="top","mantine-datatable-vertical-align-bottom":a==="bottom","mantine-datatable-pin-last-column":S,"mantine-datatable-selection-column-visible":Ot,"mantine-datatable-pin-first-column":x,"mantine-datatable-resizable-columns":xn.hasResizableColumns&&Vt},Te?.table),style:{...Ne?.table},"data-striped":Pr&&R||void 0,"data-highlight-on-hover":M||void 0,..._n,children:[B?null:w.jsx(gs,{...xn,children:w.jsx(Xu,{ref:it.header,selectionColumnHeaderRef:it.selectionColumnHeader,className:Te?.header,style:Ne?.header,columns:rt,defaultColumnProps:D,groups:P,sortStatus:W,sortIcons:oe,onSortStatusChange:se,selectionTrigger:F,selectionVisible:Ot,selectionChecked:Or,selectionIndeterminate:Bc&&!Or,onSelectionChange:Ic,selectionCheckboxProps:{...V,...H},selectorCellShadowVisible:kn,selectionColumnClassName:ee,selectionColumnStyle:re,withColumnBorders:_n.withColumnBorders})}),w.jsx("tbody",{ref:gt,children:Pr?z.map((be,Ct)=>{let Pn=Ie(be,N),Mn=Ht?.includes(Pn)||!1,Ls;return U&&q&&(Ls=Wc=>{if(Wc.nativeEvent.shiftKey&&Ar!==null){let At=z.filter(Ct>Ar?(xt,St)=>St>=Ar&&St<=Ct&&(X?X(xt,St):!0):(xt,St)=>St>=Ct&&St<=Ar&&(X?X(xt,St):!0));U(Mn?$u(q,At,xt=>Ie(xt,N)):mn([...q,...At],xt=>Ie(xt,N)))}else U(Mn?q.filter(At=>Ie(At,N)!==Pn):mn([...q,be],At=>Ie(At,N)));Yc(Ct)}),w.jsx(uc,{record:be,index:Ct,columns:rt,defaultColumnProps:D,defaultColumnRender:O,selectionTrigger:F,selectionVisible:Ot,selectionChecked:Mn,onSelectionChange:Ls,isRecordSelectable:X,selectionCheckboxProps:V,getSelectionCheckboxProps:K,onClick:le,onDoubleClick:he,onCellClick:ne,onCellDoubleClick:fe,onContextMenu:pe,onCellContextMenu:me,expansion:Nc,color:et,backgroundColor:ot,className:pt,style:wt,customAttributes:He,selectorCellShadowVisible:kn,selectionColumnClassName:ee,selectionColumnStyle:re,idAccessor:N,rowFactory:tt},Pn)}):w.jsx(_u,{})}),rt.some(({footer:be})=>be)&&w.jsx(zu,{ref:it.footer,className:Te?.footer,style:Ne?.footer,columns:rt,defaultColumnProps:D,selectionVisible:Ot,selectorCellShadowVisible:kn})]})})}),C&&w.jsx(sc,{className:Te?.pagination,style:Ne?.pagination,horizontalSpacing:k,fetching:g,page:C,onPageChange:Lc,totalRecords:c,recordsPerPage:d,onRecordsPerPageChange:m,recordsPerPageOptions:f,recordsPerPageLabel:i,paginationWithEdges:v,paginationWithControls:E,paginationActiveTextColor:j,paginationActiveBackgroundColor:Q,paginationSize:J,paginationText:te,paginationWrapBreakpoint:Z,getPaginationControlProps:ae,getPaginationItemProps:ie,noRecordsText:l,loadingText:ce,recordsLength:Pr,renderPagination:ue}),w.jsx(ec,{fetching:g,backgroundBlur:A,customContent:L,size:$,type:I,color:Y}),w.jsx(xu,{icon:p,text:l,active:!g&&!Pr,children:o})]})})}function Ms(t){const e=Ze.c(41),{fields:r,onClose:n,queryKey:s,apiPath:u,id:h,steps:a}=t,[g,y]=G.useState(0),[_,P]=G.useState(!1),{data:x,isLoading:S}=Wo(u,s,h),{mutateAsync:D,isError:O,error:N,isPending:z}=on(u,s);let F;e[0]!==r?(F=new Set(r.filter(vc).map(yc)),e[0]=r,e[1]=F):F=e[1];let q;e[2]!==F?(q=[...F],e[2]=F,e[3]=q):q=e[3];const U=q;let ee;e[4]!==r?(ee=r.reduce(mc,{}),e[4]=r,e[5]=ee):ee=e[5];let re;e[6]!==r?(re=r.filter(gc).reduce(pc,{}),e[6]=r,e[7]=re):re=e[7];let X;e[8]!==ee||e[9]!==re?(X={mode:"uncontrolled",initialValues:ee,validate:re},e[8]=ee,e[9]=re,e[10]=X):X=e[10];const V=On.useForm(X);let H;e[11]!==x||e[12]!==r||e[13]!==V?(H=()=>{if(x){const b={...x};r.forEach(c=>{const d=c.id;c.type==="boolean"&&b[d]===null?b[d]=!1:c.type==="date"&&b[d]?b[d]=new Date(b[d]):b[d]===null&&(b[d]="")}),V.initialize(b),V.setValues(b)}},e[11]=x,e[12]=r,e[13]=V,e[14]=H):H=e[14];let K;e[15]!==x?(K=[x],e[15]=x,e[16]=K):K=e[16],G.useEffect(H,K);let W;e[17]!==V||e[18]!==h?(W=function(c){const d=V.getValues();return c.conditional&&!c.conditional(d)?null:w.jsxs(G.Fragment,{children:[(c.type===void 0||c.type=="text")&&w.jsx(T.TextInput,{label:c.column.title,placeholder:c.placeholder??"",...V.getInputProps(c.id),type:c.id.includes("email")?"email":void 0,required:c.required},V.key(c.id)),c.type==="number"&&w.jsx(T.NumberInput,{decimalSeparator:",",label:c.column.title,placeholder:c.placeholder??"",...V.getInputProps(c.id),required:c.required},V.key(c.id)),c.type==="date"&&w.jsx(_r,{label:c.column.title,placeholder:c.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...V.getInputProps(c.id),required:c.required},V.key(c.id)),c.type==="boolean"&&w.jsx(T.Checkbox,{mt:"md",label:c.column.title,...V.getInputProps(c.id,{type:"checkbox"}),required:c.required},V.key(c.id)),c.type==="textarea"&&w.jsx(T.Textarea,{label:c.column.title,placeholder:c.placeholder??"",...V.getInputProps(c.id),minRows:3,autosize:!0,required:c.required},V.key(c.id)),c.type==="custom"&&c.render&&c.render({...V.getValues(),id:h},V.setValues,P,{error:V.getInputProps(c.id).error,required:c.required})]},c.id)},e[17]=V,e[18]=h,e[19]=W):W=e[19];const oe=W;let se;e[20]!==O||e[21]!==N?.message||e[22]!==N?.name?(se=O&&w.jsx(T.Alert,{variant:"outline",color:"red",title:N?.name??"Fehler aufgetreten",mb:"lg",children:N?.message??"Fehler aufgetreten"}),e[20]=O,e[21]=N?.message,e[22]=N?.name,e[23]=se):se=e[23];let k;e[24]!==g||e[25]!==r||e[26]!==V||e[27]!==_||e[28]!==h||e[29]!==S||e[30]!==z||e[31]!==O||e[32]!==n||e[33]!==oe||e[34]!==a||e[35]!==U||e[36]!==D?(k=S?w.jsxs(T.Stack,{gap:"md",children:[w.jsx(T.Skeleton,{height:40}),Array(r.length).fill(0).map(fc),w.jsxs(T.Group,{mt:"md",justify:"end",children:[w.jsx(T.Skeleton,{width:100,height:36}),w.jsx(T.Skeleton,{width:100,height:36})]})]}):w.jsxs("form",{onSubmit:V.onSubmit(async b=>{await D({...b,id:h}),U.length&&g<U.length-1?O||y(g+1):O||(V.setInitialValues(b),V.reset(),n())}),children:[U.length?w.jsx(T.Stepper,{active:g,size:"sm",children:U.map(b=>w.jsx(T.Stepper.Step,{...a&&a[b-1]?{label:a[b-1].label}:{},children:r.filter(c=>c.step===b).map(c=>oe(c))},b))}):r.map(b=>oe(b)),!_&&w.jsxs(T.Group,{mt:"md",justify:"end",children:[w.jsx(T.Button,{onClick:()=>U.length?g===0?n():y(g-1):n(),variant:"outline",children:U.length?g===0?"Abbrechen":"Zurück":"Abbrechen"}),w.jsx(T.Button,{type:"submit",loading:z,children:U.length?g===U.length-1?"Speichern":"Weiter":"Speichern"})]})]}),e[24]=g,e[25]=r,e[26]=V,e[27]=_,e[28]=h,e[29]=S,e[30]=z,e[31]=O,e[32]=n,e[33]=oe,e[34]=a,e[35]=U,e[36]=D,e[37]=k):k=e[37];let C;return e[38]!==k||e[39]!==se?(C=w.jsxs(w.Fragment,{children:[se,k]}),e[38]=k,e[39]=se,e[40]=C):C=e[40],C}function fc(t,e){return w.jsx(T.Skeleton,{height:35},`skeleton-field-${e}`)}function pc(t,e){return t[e.id]=(r,n)=>e.conditional&&!e.conditional(n)||r?null:"Pflichtfeld",t}function gc(t){return t.required}function mc(t,e){return t[e.id]=e.type==="boolean"?e.defaultValue??!1:e.defaultValue??"",t}function yc(t){return t.step}function vc(t){return typeof t.step=="number"}function Os({queryKey:t,apiPath:e,onClose:r,selectedRecords:n}){const{mutateAsync:s,isError:u,error:h,isPending:a}=Vo(e,t),[g,y]=G.useState(n),[_,P]=G.useState(!1),x=_||a;return G.useEffect(()=>{g.length||r()},[r,g]),g.length?w.jsxs(w.Fragment,{children:[u&&h.message&&w.jsx(T.Alert,{variant:"outline",color:"red",title:h.name,children:h.message}),w.jsx(T.Text,{children:g.length===1?`Soll ${g.length} Eintrag wirklich gelöscht werden?`:`Sollen ${g.length} Einträge wirklich gelöscht werden?`}),w.jsxs(T.Group,{mt:"md",justify:"end",children:[w.jsx(T.Button,{onClick:r,variant:"outline",disabled:x,children:"Abbrechen"}),w.jsx(T.Button,{color:"red",loading:x,onClick:async()=>{P(!0);try{await Promise.all(g.map(S=>s(S.id))),y([])}finally{P(!1)}},children:"Löschen"})]})]}):w.jsx(w.Fragment,{})}function As(t,e){const r=Ze.c(8);let n;r[0]!==t||r[1]!==e?(n=()=>{const y=localStorage.getItem(`use_persistent_storage_${e}`);return y?JSON.parse(y):t},r[0]=t,r[1]=e,r[2]=n):n=r[2];const[s,u]=G.useState(n);let h;r[3]!==e?(h=y=>{u(y),localStorage.setItem(`use_persistent_storage_${e}`,JSON.stringify(y))},r[3]=e,r[4]=h):h=r[4];const a=h;let g;return r[5]!==a||r[6]!==s?(g=[s,a],r[5]=a,r[6]=s,r[7]=g):g=r[7],g}const bc=(t,e)=>{const r=t.map(g=>g[e]).filter(g=>g!=null&&g!=="");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},h=[/^\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(g=>{if(typeof g=="number")u.number++;else if(typeof g=="string"){const y=g.trim();if(y!==""&&!isNaN(Number(y))&&!isNaN(parseFloat(y))){u.number++;return}if(h.some(_=>_.test(y))){const _=new Date(y);if(!isNaN(_.getTime())){u.date++;return}}u.string++}else g instanceof Date?u.date++:u.string++});const a=u.string+u.number+u.date;return u.date/a>=.6?"date":u.number/a>=.6?"number":u.string/a>=.6?"string":"mixed"},Es=new Map,Ts=(t,e,r="asc")=>{if(!t||t.length===0)return[];const n=`${String(e)}_${t.length}`;let s=Es.get(n);return s||(s=bc(t,e),Es.set(n,s)),[...t].sort((h,a)=>{const g=h[e],y=a[e],_=g==null||g==="",P=y==null||y==="";if(_&&P)return 0;if(_)return r==="asc"?-1:1;if(P)return r==="asc"?1:-1;let x,S;switch(s){case"date":if(typeof g=="string"){const F=new Date(g.trim());x=isNaN(F.getTime())?null:F.getTime()}else g instanceof Date?x=g.getTime():x=null;if(typeof y=="string"){const F=new Date(y.trim());S=isNaN(F.getTime())?null:F.getTime()}else y instanceof Date?S=y.getTime():S=null;break;case"number":if(typeof g=="number")x=g;else{const F=String(g).trim(),q=parseFloat(F);x=isNaN(q)?null:q}if(typeof y=="number")S=y;else{const F=String(y).trim(),q=parseFloat(F);S=isNaN(q)?null:q}break;case"string":const D=typeof g=="string"?g:String(g),O=typeof y=="string"?y:String(y);x=D.toLowerCase().trim(),S=O.toLowerCase().trim();break;case"mixed":default:const N=String(g),z=String(y);x=N.toLowerCase().trim(),S=z.toLowerCase().trim();break}return x===null&&S===null?0:x===null?r==="asc"?1:-1:S===null||x<S?r==="asc"?-1:1:x>S?r==="asc"?1:-1:0})},js=[10,15,50,100,500];function wc(t){const e=Ze.c(111),{title:r,queryKey:n,connectedQueryKeys:s,apiPath:u,buttons:h,fields:a,selection:g,pagination:y,filters:_,actions:P,steps:x,defaultSort:S,onSortChange:D,createButtonText:O,queryParams:N,tabs:z,defaultTab:F,activeTab:q,onActiveTabChange:U,canUpdate:ee,canDelete:re,showRefresh:X,rowExpansion:V}=t,H=X===void 0?!0:X,[K,W]=G.useState(F||(z&&z.length>0?z[0].value:null)),oe=q!==void 0?q:K;let se;e[0]!==q||e[1]!==U?(se=Me=>{q===void 0&&W(Me),U&&U(Me)},e[0]=q,e[1]=U,e[2]=se):se=e[2];const k=se,C=z?.find(Me=>Me.value===oe)?.queryParams||{},b={...N,...C},c=b?"?"+Object.entries(b).filter(Ec).map(Ac).join("&"):"";let d;e[3]!==oe||e[4]!==n?(d=oe?[...n,oe]:n,e[3]=oe,e[4]=n,e[5]=d):d=e[5];const m=d,{data:f,isLoading:i,isError:v,isRefetching:E,refetch:j}=Uo(u+c,m),{queryClient:Q}=ct();let J,te;e[6]!==f||e[7]!==s||e[8]!==Q?(J=()=>{!f||!Array.isArray(f)||s?.forEach(Me=>Q.invalidateQueries({queryKey:Me}))},te=[f,s,Q],e[6]=f,e[7]=s,e[8]=Q,e[9]=J,e[10]=te):(J=e[9],te=e[10]),G.useEffect(J,te);const Z=!f||!Array.isArray(f)?[]:!_||_.length===0?f:f.filter(Me=>_.every(Oe=>{if(Oe.value===void 0)return!0;const _t=Oe.id;if(Oe.type==="query"){const Te=Me[_t];return Array.isArray(Oe.value)?Array.isArray(Te)?Te.some(ke=>{if(typeof ke=="string"||typeof ke=="number")return Oe.value.includes(String(ke));if(ke&&typeof ke=="object"){if("id"in ke&&Oe.value.includes(ke.id))return!0;for(const Ne in ke){const tt=ke[Ne];if(typeof tt=="string"&&Oe.value.includes(tt)||tt&&typeof tt=="object"&&"id"in tt&&Oe.value.includes(tt.id))return!0}}return!1}):Te&&typeof Te=="object"&&"id"in Te?Oe.value.includes(Te.id):!1:typeof Te=="string"&&Te.includes(Oe.value)}else if(Oe.type==="date"){const Te=Oe.value;if(!Te)return!0;const[ke,Ne]=Te;if(!ke&&!Ne)return!0;const tt=Me[_t];if(typeof tt=="string"){const yt=tt.split(" ")[0];if(ke&&Ne)return yt>=ke&&yt<=Ne;if(ke&&!Ne)return yt>=ke;if(!ke&&Ne)return yt<=Ne}return!0}else if(Oe.type==="boolean")return Me[_t]===Oe.value;return!0})),ae=S?.field??a[0].id,ie=S?.direction??"desc";let ue;e[11]!==ae||e[12]!==ie?(ue={columnAccessor:ae,direction:ie},e[11]=ae,e[12]=ie,e[13]=ue):ue=e[13];const[A,L]=G.useState(ue);let $;e[14]!==D?($=Me=>{L(Me),D&&D(String(Me.columnAccessor),Me.direction)},e[14]=D,e[15]=$):$=e[15];const I=$,Y=Ts(Z,A.columnAccessor,A.direction),[ce,o]=As(js[1],"mantine-table-page-size"),[l,p]=G.useState(1),M=y?Y.slice((l-1)*ce,l*ce):Y;let R;e[16]===Symbol.for("react.memo_cache_sentinel")?(R=[],e[16]=R):R=e[16];const[B,le]=G.useState(R);let he;e[17]===Symbol.for("react.memo_cache_sentinel")?(he=()=>{le([])},e[17]=he):he=e[17];let pe;e[18]!==oe?(pe=[oe],e[18]=oe,e[19]=pe):pe=e[19],G.useEffect(he,pe);const[ne,fe]=G.useState(!1),[me,ge]=G.useState(!1),[xe,Ce]=G.useState(!1),Se=r?"space-between":"end";let Ye;e[20]!==r?(Ye=r&&(typeof r=="string"?w.jsx(T.Title,{order:4,children:r}):r),e[20]=r,e[21]=Ye):Ye=e[21];let Ee;e[22]!==j||e[23]!==H?(Ee=H&&w.jsx(T.ActionIcon,{variant:"subtle",onClick:()=>j(),"aria-label":"Neuladen",children:w.jsx(Et.IconRefresh,{})}),e[22]=j,e[23]=H,e[24]=Ee):Ee=e[24];let _e;e[25]!==P||e[26]!==re||e[27]!==ee||e[28]!==a||e[29]!==B||e[30]!==g?(_e=(a.some(Oc)||g)&&(()=>{const Me=a.find(Mc)&&(!ee||B.length>0&&ee(B[0])),Oe=a.find(Pc)&&(!re||B.length>0&&re(B[0])),_t=(P??[]).length>0,Te=Me||Oe||_t;return w.jsxs(T.Menu,{shadow:"md",children:[w.jsx(T.Menu.Target,{children:w.jsx(T.Button,{variant:"outline",rightSection:w.jsx(Et.IconCaretDownFilled,{size:14}),disabled:!B.length||!Te,children:"Aktionen"})}),w.jsxs(T.Menu.Dropdown,{children:[Me&&w.jsx(T.Menu.Item,{leftSection:w.jsx(Et.IconPencil,{size:14}),onClick:()=>ge(!0),disabled:B.length!==1,children:"Bearbeiten"}),(P??[]).map((ke,Ne)=>G.createElement(T.Menu.Item,{...ke.icon&&{leftSection:ke.icon},key:`custom_action_${Ne}`,onClick:()=>ke.onClick(B)},ke.label)),Oe&&w.jsx(T.Menu.Item,{leftSection:w.jsx(Et.IconTrash,{size:14}),onClick:()=>Ce(!0),color:"red",children:"Löschen"})]})]})})(),e[25]=P,e[26]=re,e[27]=ee,e[28]=a,e[29]=B,e[30]=g,e[31]=_e):_e=e[31];let nt;e[32]!==O||e[33]!==a||e[34]!==i?(nt=a.find(kc)&&w.jsx(T.Button,{onClick:()=>fe(!0),disabled:i,children:O??"Erstellen"}),e[32]=O,e[33]=a,e[34]=i,e[35]=nt):nt=e[35];let je;e[36]!==h||e[37]!==Ee||e[38]!==_e||e[39]!==nt?(je=w.jsxs(T.Group,{align:"center",gap:"xs",children:[Ee,_e,nt,h]}),e[36]=h,e[37]=Ee,e[38]=_e,e[39]=nt,e[40]=je):je=e[40];let Ve;e[41]!==Se||e[42]!==Ye||e[43]!==je?(Ve=w.jsxs(T.Group,{gap:"xs",justify:Se,align:"center",children:[Ye,je]}),e[41]=Se,e[42]=Ye,e[43]=je,e[44]=Ve):Ve=e[44];let ze;e[45]!==oe||e[46]!==k||e[47]!==z?(ze=z&&z.length>0&&w.jsx(T.Tabs,{value:oe,onChange:k,mt:"md",children:w.jsx(T.Tabs.List,{children:z.map(Dc)})}),e[45]=oe,e[46]=k,e[47]=z,e[48]=ze):ze=e[48];let et;e[49]!==v?(et=v&&w.jsx(T.Alert,{mt:"md",variant:"light",color:"red",title:"Es ist ein Fehler aufgetreten.",icon:w.jsx(Et.IconInfoCircle,{}),children:"Bitte versuche es später erneut oder sende eine Nachricht an unseren Support."}),e[49]=v,e[50]=et):et=e[50];let ot;e[51]!==i||e[52]!==E?(ot=(i||E)&&w.jsxs(T.Stack,{my:"md",children:[w.jsx(T.Skeleton,{height:40}),Array(5).fill(0).map(Sc)]}),e[51]=i,e[52]=E,e[53]=ot):ot=e[53];let $e;e[54]!==a||e[55]!==I||e[56]!==v||e[57]!==i||e[58]!==E||e[59]!==l||e[60]!==ce||e[61]!==y||e[62]!==M||e[63]!==V||e[64]!==B||e[65]!==g||e[66]!==p||e[67]!==o||e[68]!==A||e[69]!==Y?($e=!i&&!E&&w.jsx(hc,{my:"md",striped:!0,minHeight:150,fetching:v,records:M,sortStatus:A,onSortStatusChange:I,...g&&{selectedRecords:B,onSelectedRecordsChange:le},...y&&M.length&&{totalRecords:Y.length,recordsPerPage:ce,onPageChange:p,page:l,recordsPerPageOptions:js,onRecordsPerPageChange:o,recordsPerPageLabel:"Einträge pro Seite"},...V&&{rowExpansion:{allowMultiple:V.allowMultiple??!1,content:Me=>{const{record:Oe}=Me;return V.content(Oe)},...V.expanded&&{expanded:V.expanded}}},columns:a.map(xc),noRecordsText:"Keine Einträge gefunden"}),e[54]=a,e[55]=I,e[56]=v,e[57]=i,e[58]=E,e[59]=l,e[60]=ce,e[61]=y,e[62]=M,e[63]=V,e[64]=B,e[65]=g,e[66]=p,e[67]=o,e[68]=A,e[69]=Y,e[70]=$e):$e=e[70];let pt;e[71]===Symbol.for("react.memo_cache_sentinel")?(pt=()=>{ge(!1),le([])},e[71]=pt):pt=e[71];const wt=r??"Bearbeiten";let He;e[72]!==u||e[73]!==a||e[74]!==n||e[75]!==B[0]||e[76]!==B.length||e[77]!==x?(He=B.length>0&&w.jsx(Ms,{fields:a.filter(Cc),queryKey:n,apiPath:u,id:B[0].id,onClose:()=>{ge(!1),le([])},steps:x}),e[72]=u,e[73]=a,e[74]=n,e[75]=B[0],e[76]=B.length,e[77]=x,e[78]=He):He=e[78];let Ge;e[79]!==wt||e[80]!==He||e[81]!==me?(Ge=w.jsx(T.Modal,{opened:me,onClose:pt,title:wt,children:He}),e[79]=wt,e[80]=He,e[81]=me,e[82]=Ge):Ge=e[82];let Qe;e[83]!==u||e[84]!==xe||e[85]!==n||e[86]!==B||e[87]!==r?(Qe=B.length>0&&w.jsx(T.Modal,{opened:xe,onClose:()=>{Ce(!1),le([])},title:r??"Löschen",children:w.jsx(Os,{onClose:()=>{Ce(!1),le([])},queryKey:n,apiPath:u,selectedRecords:B})}),e[83]=u,e[84]=xe,e[85]=n,e[86]=B,e[87]=r,e[88]=Qe):Qe=e[88];let st;e[89]===Symbol.for("react.memo_cache_sentinel")?(st=()=>{fe(!1)},e[89]=st):st=e[89];const gt=r??"Anlegen";let mt;e[90]===Symbol.for("react.memo_cache_sentinel")?(mt=()=>{fe(!1)},e[90]=mt):mt=e[90];let ve;e[91]!==a?(ve=a.filter(_c),e[91]=a,e[92]=ve):ve=e[92];let De;e[93]!==u||e[94]!==n||e[95]!==x||e[96]!==ve?(De=w.jsx(ps,{queryKey:n,apiPath:u,onClose:mt,fields:ve,steps:x}),e[93]=u,e[94]=n,e[95]=x,e[96]=ve,e[97]=De):De=e[97];let Fe;e[98]!==ne||e[99]!==gt||e[100]!==De?(Fe=w.jsx(T.Modal,{opened:ne,onClose:st,title:gt,children:De}),e[98]=ne,e[99]=gt,e[100]=De,e[101]=Fe):Fe=e[101];let at;return e[102]!==Ve||e[103]!==ze||e[104]!==et||e[105]!==ot||e[106]!==$e||e[107]!==Ge||e[108]!==Qe||e[109]!==Fe?(at=w.jsxs(w.Fragment,{children:[Ve,ze,et,ot,$e,Ge,Qe,Fe]}),e[102]=Ve,e[103]=ze,e[104]=et,e[105]=ot,e[106]=$e,e[107]=Ge,e[108]=Qe,e[109]=Fe,e[110]=at):at=e[110],at}function _c(t){return t.create}function Cc(t){return t.update}function xc(t){return t.column}function Sc(t,e){return w.jsx(T.Skeleton,{height:35},`skeleton-${e}`)}function Dc(t){return w.jsx(T.Tabs.Tab,{value:t.value,leftSection:t.icon,children:t.label},t.value)}function kc(t){return t.create}function Pc(t){return t.delete}function Mc(t){return t.update}function Oc(t){return t.update}function Ac(t){const[e,r]=t;return`${e}=${encodeURIComponent(r??"")}`}function Ec(t){const[,e]=t;return e!=null}function Tc(t){const e=Ze.c(5),{queryClient:r}=ct();let n;e[0]!==t?(n=w.jsx(wc,{...t}),e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==r||e[3]!==n?(s=w.jsx(Gn,{client:r,children:n}),e[2]=r,e[3]=n,e[4]=s):s=e[4],s}we.CreateModal=ps,we.DataTable=Tc,we.DataTableProvider=pl,we.DeleteModal=Os,we.UpdateModal=Ms,we.api=ml,we.createOne=zo,we.deleteOne=Yo,we.getAll=Bo,we.getApiHeaders=bt,we.getOne=Io,we.sortData=Ts,we.updateOne=Fo,we.useAddOne=qo,we.useDataTable=ct,we.useDeleteOne=Vo,we.useGetAll=Uo,we.useGetOne=Wo,we.usePersistentState=As,we.useUpdateOne=on,Object.defineProperty(we,Symbol.toStringTag,{value:"Module"})}));
|
|
24
24
|
//# sourceMappingURL=index.umd.js.map
|