@espresso-lab/mantine-data-table 1.9.31 → 1.9.32

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/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(we,re){typeof exports=="object"&&typeof module<"u"?re(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"],re):(we=typeof globalThis<"u"?globalThis:we||self,re(we.MantineDataTable={},we.React,we.MantineCore,we.MantineForm,we.TablerIconsReact,we.MantineHooks))})(this,function(we,re,T,bn,Dt,Ne){"use strict";function ks(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=ks(re);function wn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var qt={exports:{}},kr={};/**
1
+ (function(we,re){typeof exports=="object"&&typeof module<"u"?re(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"],re):(we=typeof globalThis<"u"?globalThis:we||self,re(we.MantineDataTable={},we.React,we.MantineCore,we.MantineForm,we.TablerIconsReact,we.MantineHooks))})(this,function(we,re,E,wn,Dt,Re){"use strict";function Ms(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 Ne=Ms(re);function _n(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var qt={exports:{}},Mr={};/**
2
2
  * @license React
3
3
  * react-compiler-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var _n;function Ms(){if(_n)return kr;_n=1;var t=re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return kr.c=function(e){return t.H.useMemoCache(e)},kr}var Mr={};/**
9
+ */var xn;function Ps(){if(xn)return Mr;xn=1;var t=re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return Mr.c=function(e){return t.H.useMemoCache(e)},Mr}var Pr={};/**
10
10
  * @license React
11
11
  * react-compiler-runtime.development.js
12
12
  *
@@ -14,11 +14,11 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var xn;function Ps(){return xn||(xn=1,process.env.NODE_ENV!=="production"&&function(){var t=re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;Mr.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:
17
+ */var Cn;function Os(){return Cn||(Cn=1,process.env.NODE_ENV!=="production"&&function(){var t=re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;Pr.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:
18
18
  1. You might have mismatching versions of React and the renderer (such as React DOM)
19
19
  2. You might be breaking the Rules of Hooks
20
20
  3. You might have more than one copy of React in the same app
21
- See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),r.useMemoCache(e)}}()),Mr}var Cn;function Os(){return Cn||(Cn=1,process.env.NODE_ENV==="production"?qt.exports=Ms():qt.exports=Ps()),qt.exports}var Ge=Os(),Wt=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(){}},kt=typeof window>"u"||"Deno"in globalThis;function Vt(){}function Sn(t){return typeof t=="number"&&t>=0&&t!==1/0}function As(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Mt(t,e){return typeof t=="function"?t(e):t}function Qe(t,e){return typeof t=="function"?t(e):t}function Dn(t){return JSON.stringify(t,(e,r)=>Or(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function Pr(t,e){if(t===e)return t;const r=kn(t)&&kn(e);if(r||Or(t)&&Or(e)){const n=r?t:Object.keys(t),s=n.length,d=r?e:Object.keys(e),f=d.length,i=r?[]:{},m=new Set(n);let y=0;for(let _=0;_<f;_++){const M=r?_:d[_];(!r&&m.has(M)||r)&&t[M]===void 0&&e[M]===void 0?(i[M]=void 0,y++):(i[M]=Pr(t[M],e[M]),i[M]===t[M]&&t[M]!==void 0&&y++)}return s===f&&y===s?t:i}return e}function Ht(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 kn(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Or(t){if(!Mn(t))return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return!(!Mn(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Mn(t){return Object.prototype.toString.call(t)==="[object Object]"}function Pn(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 Pr(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 Pr(t,e)}return e}function On(t,e){return typeof t=="function"?t(...e):!!t}var Ts=class extends Wt{#t;#e;#r;constructor(){super(),this.#r=t=>{if(!kt&&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"}},Es=new Ts,js=class extends Wt{#t=!0;#e;#r;constructor(){super(),this.#r=t=>{if(!kt&&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}},Rs=new js;function An(){let t,e;const r=new Promise((s,d)=>{t=s,e=d});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}function Ns(t){return(t??"online")==="online"?Rs.isOnline():!0}var $s=t=>setTimeout(t,0);function Ls(){let t=[],e=0,r=i=>{i()},n=i=>{i()},s=$s;const d=i=>{e?t.push(i):s(()=>{r(i)})},f=()=>{const i=t;t=[],i.length&&s(()=>{n(()=>{i.forEach(m=>{r(m)})})})};return{batch:i=>{let m;e++;try{m=i()}finally{e--,e||f()}return m},batchCalls:i=>(...m)=>{d(()=>{i(...m)})},schedule:d,setNotifyFunction:i=>{r=i},setBatchNotifyFunction:i=>{n=i},setScheduler:i=>{s=i}}}var Gt=Ls();function Bs(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ns(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Ys(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Is=class extends Wt{constructor(t,e){super(),this.options=e,this.#t=t,this.#a=null,this.#i=An(),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),Tn(this.#e,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ar(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ar(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 Qe(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#x(),this.#e.setOptions(this.options),e._defaulted&&!Ht(this.options,e)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const n=this.hasListeners();n&&En(this.#e,r,this.options,e)&&this.#d(),this.updateResult(),n&&(this.#e!==r||Qe(this.options.enabled,this.#e)!==Qe(e.enabled,this.#e)||Mt(this.options.staleTime,this.#e)!==Mt(e.staleTime,this.#e))&&this.#m();const s=this.#y();n&&(this.#e!==r||Qe(this.options.enabled,this.#e)!==Qe(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 Fs(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.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(r,n))})}trackProp(t){this.#p.add(t)}getCurrentQuery(){return this.#e}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#t.defaultQueryOptions(t),r=this.#t.getQueryCache().build(this.#t,e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return this.#d({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#d(t){this.#x();let e=this.#e.fetch(this.options,t);return t?.throwOnError||(e=e.catch(Vt)),e}#m(){this.#w();const t=Mt(this.options.staleTime,this.#e);if(kt||this.#n.isStale||!Sn(t))return;const r=As(this.#n.dataUpdatedAt,t)+1;this.#u=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,!(kt||Qe(this.options.enabled,this.#e)===!1||!Sn(this.#l)||this.#l===0)&&(this.#c=setInterval(()=>{(this.options.refetchIntervalInBackground||Es.isFocused())&&this.#d()},this.#l))}#b(){this.#m(),this.#v(this.#y())}#w(){this.#u&&(clearTimeout(this.#u),this.#u=void 0)}#_(){this.#c&&(clearInterval(this.#c),this.#c=void 0)}createResult(t,e){const r=this.#e,n=this.options,s=this.#n,d=this.#o,f=this.#s,m=t!==r?t.state:this.#r,{state:y}=t;let _={...y},M=!1,x;if(e._optimisticResults){const $=this.hasListeners(),te=!$&&Tn(t,e),X=$&&En(t,r,e,n);(te||X)&&(_={..._,...Bs(y.data,t.options)}),e._optimisticResults==="isRestoring"&&(_.fetchStatus="idle")}let{error:D,errorUpdatedAt:P,status:A}=_;x=_.data;let B=!1;if(e.placeholderData!==void 0&&x===void 0&&A==="pending"){let $;s?.isPlaceholderData&&e.placeholderData===f?.placeholderData?($=s.data,B=!0):$=typeof e.placeholderData=="function"?e.placeholderData(this.#f?.state.data,this.#f):e.placeholderData,$!==void 0&&(A="success",x=Pn(s?.data,$,e),M=!0)}if(e.select&&x!==void 0&&!B)if(s&&x===d?.data&&e.select===this.#g)x=this.#h;else try{this.#g=e.select,x=e.select(x),x=Pn(s?.data,x,e),this.#h=x,this.#a=null}catch($){this.#a=$}this.#a&&(D=this.#a,x=this.#h,P=Date.now(),A="error");const Q=_.fetchStatus==="fetching",W=A==="pending",G=A==="error",J=W&&Q,z=x!==void 0,F={status:A,fetchStatus:_.fetchStatus,isPending:W,isSuccess:A==="success",isError:G,isInitialLoading:J,isLoading:J,data:x,dataUpdatedAt:_.dataUpdatedAt,error:D,errorUpdatedAt:P,failureCount:_.fetchFailureCount,failureReason:_.fetchFailureReason,errorUpdateCount:_.errorUpdateCount,isFetched:_.dataUpdateCount>0||_.errorUpdateCount>0,isFetchedAfterMount:_.dataUpdateCount>m.dataUpdateCount||_.errorUpdateCount>m.errorUpdateCount,isFetching:Q,isRefetching:Q&&!W,isLoadingError:G&&!z,isPaused:_.fetchStatus==="paused",isPlaceholderData:M,isRefetchError:G&&z,isStale:Tr(t,e),refetch:this.refetch,promise:this.#i,isEnabled:Qe(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const $=q=>{F.status==="error"?q.reject(F.error):F.data!==void 0&&q.resolve(F.data)},te=()=>{const q=this.#i=F.promise=An();$(q)},X=this.#i;switch(X.status){case"pending":t.queryHash===r.queryHash&&$(X);break;case"fulfilled":(F.status==="error"||F.data!==X.value)&&te();break;case"rejected":(F.status!=="error"||F.error!==X.reason)&&te();break}}return F}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),Ht(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 d=new Set(s??this.#p);return this.options.throwOnError&&d.add("error"),Object.keys(this.#n).some(f=>{const i=f;return this.#n[i]!==t[i]&&d.has(i)})};this.#C({listeners:r()})}#x(){const t=this.#t.getQueryCache().build(this.#t,this.options);if(t===this.#e)return;const e=this.#e;this.#e=t,this.#r=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#C(t){Gt.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#n)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function zs(t,e){return Qe(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Tn(t,e){return zs(t,e)||t.state.data!==void 0&&Ar(t,e,e.refetchOnMount)}function Ar(t,e,r){if(Qe(e.enabled,t)!==!1&&Mt(e.staleTime,t)!=="static"){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&Tr(t,e)}return!1}function En(t,e,r,n){return(t!==e||Qe(n.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&Tr(t,r)}function Tr(t,e){return Qe(e.enabled,t)!==!1&&t.isStaleByTime(Mt(e.staleTime,t))}function Fs(t,e){return!Ht(t.getCurrentResult(),e)}var Us=class extends Wt{#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),Ht(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),e?.mutationKey&&this.options.mutationKey&&Dn(e.mutationKey)!==Dn(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??Ys();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){Gt.batch(()=>{if(this.#n&&this.hasListeners()){const e=this.#e.variables,r=this.#e.context;t?.type==="success"?(this.#n.onSuccess?.(t.data,e,r),this.#n.onSettled?.(t.data,null,e,r)):t?.type==="error"&&(this.#n.onError?.(t.error,e,r),this.#n.onSettled?.(void 0,t.error,e,r))}this.listeners.forEach(e=>{e(this.#e)})})}},Qt={exports:{}},Pt={};/**
21
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),r.useMemoCache(e)}}()),Pr}var Sn;function As(){return Sn||(Sn=1,process.env.NODE_ENV==="production"?qt.exports=Ps():qt.exports=Os()),qt.exports}var Ge=As(),Wt=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(){}},Es={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Ts=class{#t=Es;#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)}},Vt=new Ts;function js(t){setTimeout(t,0)}var kt=typeof window>"u"||"Deno"in globalThis;function Ht(){}function Dn(t){return typeof t=="number"&&t>=0&&t!==1/0}function Ns(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Mt(t,e){return typeof t=="function"?t(e):t}function Qe(t,e){return typeof t=="function"?t(e):t}function kn(t){return JSON.stringify(t,(e,r)=>Ar(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}var Rs=Object.prototype.hasOwnProperty;function Or(t,e){if(t===e)return t;const r=Mn(t)&&Mn(e);if(!r&&!(Ar(t)&&Ar(e)))return e;const s=(r?t:Object.keys(t)).length,d=r?e:Object.keys(e),f=d.length,i=r?new Array(f):{};let m=0;for(let y=0;y<f;y++){const _=r?y:d[y],M=t[_],x=e[_];if(M===x){i[_]=M,(r?y<s:Rs.call(t,_))&&m++;continue}if(M===null||x===null||typeof M!="object"||typeof x!="object"){i[_]=x;continue}const S=Or(M,x);i[_]=S,S===M&&m++}return s===f&&m===s?t:i}function Gt(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 Mn(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Ar(t){if(!Pn(t))return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return!(!Pn(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Pn(t){return Object.prototype.toString.call(t)==="[object Object]"}function On(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 Or(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 Or(t,e)}return e}function An(t,e){return typeof t=="function"?t(...e):!!t}var $s=class extends Wt{#t;#e;#r;constructor(){super(),this.#r=t=>{if(!kt&&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"}},Ls=new $s;function En(){let t,e;const r=new Promise((s,d)=>{t=s,e=d});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 Bs=js;function Is(){let t=[],e=0,r=i=>{i()},n=i=>{i()},s=Bs;const d=i=>{e?t.push(i):s(()=>{r(i)})},f=()=>{const i=t;t=[],i.length&&s(()=>{n(()=>{i.forEach(m=>{r(m)})})})};return{batch:i=>{let m;e++;try{m=i()}finally{e--,e||f()}return m},batchCalls:i=>(...m)=>{d(()=>{i(...m)})},schedule:d,setNotifyFunction:i=>{r=i},setBatchNotifyFunction:i=>{n=i},setScheduler:i=>{s=i}}}var Qt=Is(),Ys=class extends Wt{#t=!0;#e;#r;constructor(){super(),this.#r=t=>{if(!kt&&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}},zs=new Ys;function Fs(t){return(t??"online")==="online"?zs.isOnline():!0}function Us(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Fs(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}var qs=class extends Wt{constructor(t,e){super(),this.options=e,this.#t=t,this.#a=null,this.#i=En(),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),Tn(this.#e,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Er(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Er(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 Qe(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#x(),this.#e.setOptions(this.options),e._defaulted&&!Gt(this.options,e)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const n=this.hasListeners();n&&jn(this.#e,r,this.options,e)&&this.#d(),this.updateResult(),n&&(this.#e!==r||Qe(this.options.enabled,this.#e)!==Qe(e.enabled,this.#e)||Mt(this.options.staleTime,this.#e)!==Mt(e.staleTime,this.#e))&&this.#m();const s=this.#y();n&&(this.#e!==r||Qe(this.options.enabled,this.#e)!==Qe(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 Vs(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.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(r,n))})}trackProp(t){this.#p.add(t)}getCurrentQuery(){return this.#e}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#t.defaultQueryOptions(t),r=this.#t.getQueryCache().build(this.#t,e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return this.#d({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#d(t){this.#x();let e=this.#e.fetch(this.options,t);return t?.throwOnError||(e=e.catch(Ht)),e}#m(){this.#w();const t=Mt(this.options.staleTime,this.#e);if(kt||this.#n.isStale||!Dn(t))return;const r=Ns(this.#n.dataUpdatedAt,t)+1;this.#u=Vt.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,!(kt||Qe(this.options.enabled,this.#e)===!1||!Dn(this.#l)||this.#l===0)&&(this.#c=Vt.setInterval(()=>{(this.options.refetchIntervalInBackground||Ls.isFocused())&&this.#d()},this.#l))}#b(){this.#m(),this.#v(this.#y())}#w(){this.#u&&(Vt.clearTimeout(this.#u),this.#u=void 0)}#_(){this.#c&&(Vt.clearInterval(this.#c),this.#c=void 0)}createResult(t,e){const r=this.#e,n=this.options,s=this.#n,d=this.#o,f=this.#s,m=t!==r?t.state:this.#r,{state:y}=t;let _={...y},M=!1,x;if(e._optimisticResults){const $=this.hasListeners(),te=!$&&Tn(t,e),X=$&&jn(t,r,e,n);(te||X)&&(_={..._,...Us(y.data,t.options)}),e._optimisticResults==="isRestoring"&&(_.fetchStatus="idle")}let{error:S,errorUpdatedAt:P,status:A}=_;x=_.data;let B=!1;if(e.placeholderData!==void 0&&x===void 0&&A==="pending"){let $;s?.isPlaceholderData&&e.placeholderData===f?.placeholderData?($=s.data,B=!0):$=typeof e.placeholderData=="function"?e.placeholderData(this.#f?.state.data,this.#f):e.placeholderData,$!==void 0&&(A="success",x=On(s?.data,$,e),M=!0)}if(e.select&&x!==void 0&&!B)if(s&&x===d?.data&&e.select===this.#g)x=this.#h;else try{this.#g=e.select,x=e.select(x),x=On(s?.data,x,e),this.#h=x,this.#a=null}catch($){this.#a=$}this.#a&&(S=this.#a,x=this.#h,P=Date.now(),A="error");const Q=_.fetchStatus==="fetching",W=A==="pending",G=A==="error",J=W&&Q,z=x!==void 0,F={status:A,fetchStatus:_.fetchStatus,isPending:W,isSuccess:A==="success",isError:G,isInitialLoading:J,isLoading:J,data:x,dataUpdatedAt:_.dataUpdatedAt,error:S,errorUpdatedAt:P,failureCount:_.fetchFailureCount,failureReason:_.fetchFailureReason,errorUpdateCount:_.errorUpdateCount,isFetched:_.dataUpdateCount>0||_.errorUpdateCount>0,isFetchedAfterMount:_.dataUpdateCount>m.dataUpdateCount||_.errorUpdateCount>m.errorUpdateCount,isFetching:Q,isRefetching:Q&&!W,isLoadingError:G&&!z,isPaused:_.fetchStatus==="paused",isPlaceholderData:M,isRefetchError:G&&z,isStale:Tr(t,e),refetch:this.refetch,promise:this.#i,isEnabled:Qe(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const $=q=>{F.status==="error"?q.reject(F.error):F.data!==void 0&&q.resolve(F.data)},te=()=>{const q=this.#i=F.promise=En();$(q)},X=this.#i;switch(X.status){case"pending":t.queryHash===r.queryHash&&$(X);break;case"fulfilled":(F.status==="error"||F.data!==X.value)&&te();break;case"rejected":(F.status!=="error"||F.error!==X.reason)&&te();break}}return F}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),Gt(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 d=new Set(s??this.#p);return this.options.throwOnError&&d.add("error"),Object.keys(this.#n).some(f=>{const i=f;return this.#n[i]!==t[i]&&d.has(i)})};this.#C({listeners:r()})}#x(){const t=this.#t.getQueryCache().build(this.#t,this.options);if(t===this.#e)return;const e=this.#e;this.#e=t,this.#r=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#C(t){Qt.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#n)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function Ws(t,e){return Qe(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Tn(t,e){return Ws(t,e)||t.state.data!==void 0&&Er(t,e,e.refetchOnMount)}function Er(t,e,r){if(Qe(e.enabled,t)!==!1&&Mt(e.staleTime,t)!=="static"){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&Tr(t,e)}return!1}function jn(t,e,r,n){return(t!==e||Qe(n.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&Tr(t,r)}function Tr(t,e){return Qe(e.enabled,t)!==!1&&t.isStaleByTime(Mt(e.staleTime,t))}function Vs(t,e){return!Gt(t.getCurrentResult(),e)}function Hs(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Gs=class extends Wt{#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),Gt(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),e?.mutationKey&&this.options.mutationKey&&kn(e.mutationKey)!==kn(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??Hs();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){Qt.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)})})}},Kt={exports:{}},Pt={};/**
22
22
  * @license React
23
23
  * react-jsx-runtime.production.js
24
24
  *
@@ -26,7 +26,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
26
26
  *
27
27
  * This source code is licensed under the MIT license found in the
28
28
  * LICENSE file in the root directory of this source tree.
29
- */var jn;function qs(){if(jn)return Pt;jn=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,s,d){var f=null;if(d!==void 0&&(f=""+d),s.key!==void 0&&(f=""+s.key),"key"in s){d={};for(var i in s)i!=="key"&&(d[i]=s[i])}else d=s;return s=d.ref,{$$typeof:t,type:n,key:f,ref:s!==void 0?s:null,props:d}}return Pt.Fragment=e,Pt.jsx=r,Pt.jsxs=r,Pt}var Ot={};/**
29
+ */var Nn;function Qs(){if(Nn)return Pt;Nn=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,s,d){var f=null;if(d!==void 0&&(f=""+d),s.key!==void 0&&(f=""+s.key),"key"in s){d={};for(var i in s)i!=="key"&&(d[i]=s[i])}else d=s;return s=d.ref,{$$typeof:t,type:n,key:f,ref:s!==void 0?s:null,props:d}}return Pt.Fragment=e,Pt.jsx=r,Pt.jsxs=r,Pt}var Ot={};/**
30
30
  * @license React
31
31
  * react-jsx-runtime.development.js
32
32
  *
@@ -34,12 +34,12 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
34
34
  *
35
35
  * This source code is licensed under the MIT license found in the
36
36
  * LICENSE file in the root directory of this source tree.
37
- */var Rn;function Ws(){return Rn||(Rn=1,process.env.NODE_ENV!=="production"&&function(){function t(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===X?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case A:return"Fragment";case Q:return"Profiler";case B:return"StrictMode";case z:return"Suspense";case H:return"SuspenseList";case te:return"Activity"}if(typeof l=="object")switch(typeof l.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),l.$$typeof){case P:return"Portal";case G:return(l.displayName||"Context")+".Provider";case W:return(l._context.displayName||"Context")+".Consumer";case J:var h=l.render;return l=l.displayName,l||(l=h.displayName||h.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case F:return h=l.displayName||null,h!==null?h:t(l.type)||"Memo";case $:h=l._payload,l=l._init;try{return t(l(h))}catch{}}return null}function e(l){return""+l}function r(l){try{e(l);var h=!1}catch{h=!0}if(h){h=console;var b=h.error,E=typeof Symbol=="function"&&Symbol.toStringTag&&l[Symbol.toStringTag]||l.constructor.name||"Object";return b.call(h,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",E),e(l)}}function n(l){if(l===A)return"<>";if(typeof l=="object"&&l!==null&&l.$$typeof===$)return"<...>";try{var h=t(l);return h?"<"+h+">":"<...>"}catch{return"<...>"}}function s(){var l=q.A;return l===null?null:l.getOwner()}function d(){return Error("react-stack-top-frame")}function f(l){if(ue.call(l,"key")){var h=Object.getOwnPropertyDescriptor(l,"key").get;if(h&&h.isReactWarning)return!1}return l.key!==void 0}function i(l,h){function b(){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)",h))}b.isReactWarning=!0,Object.defineProperty(l,"key",{get:b,configurable:!0})}function m(){var l=t(this.type);return v[l]||(v[l]=!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.")),l=this.props.ref,l!==void 0?l:null}function y(l,h,b,E,N,K,Z,ne){return b=K.ref,l={$$typeof:D,type:l,key:h,props:K,_owner:N},(b!==void 0?b:null)!==null?Object.defineProperty(l,"ref",{enumerable:!1,get:m}):Object.defineProperty(l,"ref",{enumerable:!1,value:null}),l._store={},Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(l,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(l,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Z}),Object.defineProperty(l,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ne}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}function _(l,h,b,E,N,K,Z,ne){var V=h.children;if(V!==void 0)if(E)if(de(V)){for(E=0;E<V.length;E++)M(V[E]);Object.freeze&&Object.freeze(V)}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(V);if(ue.call(h,"key")){V=t(l);var oe=Object.keys(h).filter(function(ie){return ie!=="key"});E=0<oe.length?"{key: someKey, "+oe.join(": ..., ")+": ...}":"{key: someKey}",g[V+E]||(oe=0<oe.length?"{"+oe.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
37
+ */var Rn;function Ks(){return Rn||(Rn=1,process.env.NODE_ENV!=="production"&&function(){function t(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===X?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case A:return"Fragment";case Q:return"Profiler";case B:return"StrictMode";case z:return"Suspense";case H:return"SuspenseList";case te:return"Activity"}if(typeof l=="object")switch(typeof l.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),l.$$typeof){case P:return"Portal";case G:return(l.displayName||"Context")+".Provider";case W:return(l._context.displayName||"Context")+".Consumer";case J:var h=l.render;return l=l.displayName,l||(l=h.displayName||h.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case F:return h=l.displayName||null,h!==null?h:t(l.type)||"Memo";case $:h=l._payload,l=l._init;try{return t(l(h))}catch{}}return null}function e(l){return""+l}function r(l){try{e(l);var h=!1}catch{h=!0}if(h){h=console;var b=h.error,T=typeof Symbol=="function"&&Symbol.toStringTag&&l[Symbol.toStringTag]||l.constructor.name||"Object";return b.call(h,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",T),e(l)}}function n(l){if(l===A)return"<>";if(typeof l=="object"&&l!==null&&l.$$typeof===$)return"<...>";try{var h=t(l);return h?"<"+h+">":"<...>"}catch{return"<...>"}}function s(){var l=q.A;return l===null?null:l.getOwner()}function d(){return Error("react-stack-top-frame")}function f(l){if(ue.call(l,"key")){var h=Object.getOwnPropertyDescriptor(l,"key").get;if(h&&h.isReactWarning)return!1}return l.key!==void 0}function i(l,h){function b(){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)",h))}b.isReactWarning=!0,Object.defineProperty(l,"key",{get:b,configurable:!0})}function m(){var l=t(this.type);return v[l]||(v[l]=!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.")),l=this.props.ref,l!==void 0?l:null}function y(l,h,b,T,R,K,Z,ne){return b=K.ref,l={$$typeof:S,type:l,key:h,props:K,_owner:R},(b!==void 0?b:null)!==null?Object.defineProperty(l,"ref",{enumerable:!1,get:m}):Object.defineProperty(l,"ref",{enumerable:!1,value:null}),l._store={},Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(l,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(l,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Z}),Object.defineProperty(l,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ne}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}function _(l,h,b,T,R,K,Z,ne){var V=h.children;if(V!==void 0)if(T)if(de(V)){for(T=0;T<V.length;T++)M(V[T]);Object.freeze&&Object.freeze(V)}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(V);if(ue.call(h,"key")){V=t(l);var oe=Object.keys(h).filter(function(ie){return ie!=="key"});T=0<oe.length?"{key: someKey, "+oe.join(": ..., ")+": ...}":"{key: someKey}",g[V+T]||(oe=0<oe.length?"{"+oe.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
38
38
  let props = %s;
39
39
  <%s {...props} />
40
40
  React keys must be passed directly to JSX without using spread:
41
41
  let props = %s;
42
- <%s key={someKey} {...props} />`,E,V,oe,V),g[V+E]=!0)}if(V=null,b!==void 0&&(r(b),V=""+b),f(h)&&(r(h.key),V=""+h.key),"key"in h){b={};for(var ee in h)ee!=="key"&&(b[ee]=h[ee])}else b=h;return V&&i(b,typeof l=="function"?l.displayName||l.name||"Unknown":l),y(l,V,K,N,s(),b,Z,ne)}function M(l){typeof l=="object"&&l!==null&&l.$$typeof===D&&l._store&&(l._store.validated=1)}var x=re,D=Symbol.for("react.transitional.element"),P=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),Q=Symbol.for("react.profiler"),W=Symbol.for("react.consumer"),G=Symbol.for("react.context"),J=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),X=Symbol.for("react.client.reference"),q=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue=Object.prototype.hasOwnProperty,de=Array.isArray,S=console.createTask?console.createTask:function(){return null};x={react_stack_bottom_frame:function(l){return l()}};var C,v={},u=x.react_stack_bottom_frame.bind(x,d)(),c=S(n(d)),g={};Ot.Fragment=A,Ot.jsx=function(l,h,b,E,N){var K=1e4>q.recentlyCreatedOwnerStacks++;return _(l,h,b,!1,E,N,K?Error("react-stack-top-frame"):u,K?S(n(l)):c)},Ot.jsxs=function(l,h,b,E,N){var K=1e4>q.recentlyCreatedOwnerStacks++;return _(l,h,b,!0,E,N,K?Error("react-stack-top-frame"):u,K?S(n(l)):c)}}()),Ot}var Nn;function Vs(){return Nn||(Nn=1,process.env.NODE_ENV==="production"?Qt.exports=qs():Qt.exports=Ws()),Qt.exports}var w=Vs(),$n=Re.createContext(void 0),Ln=t=>{const e=Re.useContext($n);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Bn=({client:t,children:e})=>(Re.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),w.jsx($n.Provider,{value:t,children:e})),Yn=Re.createContext(!1),Hs=()=>Re.useContext(Yn);Yn.Provider;function Gs(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Qs=Re.createContext(Gs()),Ks=()=>Re.useContext(Qs),Zs=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},Js=t=>{Re.useEffect(()=>{t.clearReset()},[t])},Xs=({result:t,errorResetBoundary:e,throwOnError:r,query:n,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&n&&(s&&t.data===void 0||On(r,[t.error,n])),ei=t=>{if(t.suspense){const e=n=>n==="static"?n:Math.max(n??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...n)=>e(r(...n)):e(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},ti=(t,e)=>t.isLoading&&t.isFetching&&!e,ri=(t,e)=>t?.suspense&&e.isPending,In=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});function ni(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=Hs(),s=Ks(),d=Ln(),f=d.defaultQueryOptions(t);d.getDefaultOptions().queries?._experimental_beforeQuery?.(f),process.env.NODE_ENV!=="production"&&(f.queryFn||console.error(`[${f.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`)),f._optimisticResults=n?"isRestoring":"optimistic",ei(f),Zs(f,s),Js(s);const i=!d.getQueryCache().get(f.queryHash),[m]=Re.useState(()=>new e(d,f)),y=m.getOptimisticResult(f),_=!n&&t.subscribed!==!1;if(Re.useSyncExternalStore(Re.useCallback(M=>{const x=_?m.subscribe(Gt.batchCalls(M)):Vt;return m.updateResult(),x},[m,_]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),Re.useEffect(()=>{m.setOptions(f)},[f,m]),ri(f,y))throw In(f,m,s);if(Xs({result:y,errorResetBoundary:s,throwOnError:f.throwOnError,query:d.getQueryCache().get(f.queryHash),suspense:f.suspense}))throw y.error;return d.getDefaultOptions().queries?._experimental_afterQuery?.(f,y),f.experimental_prefetchInRender&&!kt&&ti(y,n)&&(i?In(f,m,s):d.getQueryCache().get(f.queryHash)?.promise)?.catch(Vt).finally(()=>{m.updateResult()}),f.notifyOnChangeProps?y:m.trackResult(y)}function zn(t,e){return ni(t,Is)}function Er(t,e){const r=Ln(),[n]=Re.useState(()=>new Us(r,t));Re.useEffect(()=>{n.setOptions(t)},[n,t]);const s=Re.useSyncExternalStore(Re.useCallback(f=>n.subscribe(Gt.batchCalls(f)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),d=Re.useCallback((f,i)=>{n.mutate(f,i).catch(Vt)},[n]);if(s.error&&On(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:d,mutateAsync:s.mutate}}var Fn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function jr(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 Rr={exports:{}},At={};/**
42
+ <%s key={someKey} {...props} />`,T,V,oe,V),g[V+T]=!0)}if(V=null,b!==void 0&&(r(b),V=""+b),f(h)&&(r(h.key),V=""+h.key),"key"in h){b={};for(var ee in h)ee!=="key"&&(b[ee]=h[ee])}else b=h;return V&&i(b,typeof l=="function"?l.displayName||l.name||"Unknown":l),y(l,V,K,R,s(),b,Z,ne)}function M(l){typeof l=="object"&&l!==null&&l.$$typeof===S&&l._store&&(l._store.validated=1)}var x=re,S=Symbol.for("react.transitional.element"),P=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),Q=Symbol.for("react.profiler"),W=Symbol.for("react.consumer"),G=Symbol.for("react.context"),J=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),X=Symbol.for("react.client.reference"),q=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue=Object.prototype.hasOwnProperty,de=Array.isArray,D=console.createTask?console.createTask:function(){return null};x={react_stack_bottom_frame:function(l){return l()}};var C,v={},u=x.react_stack_bottom_frame.bind(x,d)(),c=D(n(d)),g={};Ot.Fragment=A,Ot.jsx=function(l,h,b,T,R){var K=1e4>q.recentlyCreatedOwnerStacks++;return _(l,h,b,!1,T,R,K?Error("react-stack-top-frame"):u,K?D(n(l)):c)},Ot.jsxs=function(l,h,b,T,R){var K=1e4>q.recentlyCreatedOwnerStacks++;return _(l,h,b,!0,T,R,K?Error("react-stack-top-frame"):u,K?D(n(l)):c)}}()),Ot}var $n;function Zs(){return $n||($n=1,process.env.NODE_ENV==="production"?Kt.exports=Qs():Kt.exports=Ks()),Kt.exports}var w=Zs(),Ln=Ne.createContext(void 0),Bn=t=>{const e=Ne.useContext(Ln);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},In=({client:t,children:e})=>(Ne.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),w.jsx(Ln.Provider,{value:t,children:e})),Yn=Ne.createContext(!1),Js=()=>Ne.useContext(Yn);Yn.Provider;function Xs(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var ei=Ne.createContext(Xs()),ti=()=>Ne.useContext(ei),ri=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},ni=t=>{Ne.useEffect(()=>{t.clearReset()},[t])},oi=({result:t,errorResetBoundary:e,throwOnError:r,query:n,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&n&&(s&&t.data===void 0||An(r,[t.error,n])),si=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))}},ii=(t,e)=>t.isLoading&&t.isFetching&&!e,ai=(t,e)=>t?.suspense&&e.isPending,zn=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});function li(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=Js(),s=ti(),d=Bn(),f=d.defaultQueryOptions(t);d.getDefaultOptions().queries?._experimental_beforeQuery?.(f),process.env.NODE_ENV!=="production"&&(f.queryFn||console.error(`[${f.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`)),f._optimisticResults=n?"isRestoring":"optimistic",si(f),ri(f,s),ni(s);const i=!d.getQueryCache().get(f.queryHash),[m]=Ne.useState(()=>new e(d,f)),y=m.getOptimisticResult(f),_=!n&&t.subscribed!==!1;if(Ne.useSyncExternalStore(Ne.useCallback(M=>{const x=_?m.subscribe(Qt.batchCalls(M)):Ht;return m.updateResult(),x},[m,_]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),Ne.useEffect(()=>{m.setOptions(f)},[f,m]),ai(f,y))throw zn(f,m,s);if(oi({result:y,errorResetBoundary:s,throwOnError:f.throwOnError,query:d.getQueryCache().get(f.queryHash),suspense:f.suspense}))throw y.error;return d.getDefaultOptions().queries?._experimental_afterQuery?.(f,y),f.experimental_prefetchInRender&&!kt&&ii(y,n)&&(i?zn(f,m,s):d.getQueryCache().get(f.queryHash)?.promise)?.catch(Ht).finally(()=>{m.updateResult()}),f.notifyOnChangeProps?y:m.trackResult(y)}function Fn(t,e){return li(t,qs)}function jr(t,e){const r=Bn(),[n]=Ne.useState(()=>new Gs(r,t));Ne.useEffect(()=>{n.setOptions(t)},[n,t]);const s=Ne.useSyncExternalStore(Ne.useCallback(f=>n.subscribe(Qt.batchCalls(f)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),d=Ne.useCallback((f,i)=>{n.mutate(f,i).catch(Ht)},[n]);if(s.error&&An(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:d,mutateAsync:s.mutate}}var Un=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Nr(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 Rr={exports:{}},At={};/**
43
43
  * @license React
44
44
  * react-jsx-runtime.production.js
45
45
  *
@@ -47,7 +47,7 @@ React keys must be passed directly to JSX without using spread:
47
47
  *
48
48
  * This source code is licensed under the MIT license found in the
49
49
  * LICENSE file in the root directory of this source tree.
50
- */var Un;function oi(){if(Un)return At;Un=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,s,d){var f=null;if(d!==void 0&&(f=""+d),s.key!==void 0&&(f=""+s.key),"key"in s){d={};for(var i in s)i!=="key"&&(d[i]=s[i])}else d=s;return s=d.ref,{$$typeof:t,type:n,key:f,ref:s!==void 0?s:null,props:d}}return At.Fragment=e,At.jsx=r,At.jsxs=r,At}var Kt={};/**
50
+ */var qn;function ui(){if(qn)return At;qn=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,s,d){var f=null;if(d!==void 0&&(f=""+d),s.key!==void 0&&(f=""+s.key),"key"in s){d={};for(var i in s)i!=="key"&&(d[i]=s[i])}else d=s;return s=d.ref,{$$typeof:t,type:n,key:f,ref:s!==void 0?s:null,props:d}}return At.Fragment=e,At.jsx=r,At.jsxs=r,At}var Zt={};/**
51
51
  * @license React
52
52
  * react-jsx-runtime.development.js
53
53
  *
@@ -55,12 +55,12 @@ React keys must be passed directly to JSX without using spread:
55
55
  *
56
56
  * This source code is licensed under the MIT license found in the
57
57
  * LICENSE file in the root directory of this source tree.
58
- */var qn;function si(){return qn||(qn=1,process.env.NODE_ENV!=="production"&&function(){function t(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===X?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case A:return"Fragment";case Q:return"Profiler";case B:return"StrictMode";case z:return"Suspense";case H:return"SuspenseList";case te:return"Activity"}if(typeof l=="object")switch(typeof l.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),l.$$typeof){case P:return"Portal";case G:return(l.displayName||"Context")+".Provider";case W:return(l._context.displayName||"Context")+".Consumer";case J:var h=l.render;return l=l.displayName,l||(l=h.displayName||h.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case F:return h=l.displayName||null,h!==null?h:t(l.type)||"Memo";case $:h=l._payload,l=l._init;try{return t(l(h))}catch{}}return null}function e(l){return""+l}function r(l){try{e(l);var h=!1}catch{h=!0}if(h){h=console;var b=h.error,E=typeof Symbol=="function"&&Symbol.toStringTag&&l[Symbol.toStringTag]||l.constructor.name||"Object";return b.call(h,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",E),e(l)}}function n(l){if(l===A)return"<>";if(typeof l=="object"&&l!==null&&l.$$typeof===$)return"<...>";try{var h=t(l);return h?"<"+h+">":"<...>"}catch{return"<...>"}}function s(){var l=q.A;return l===null?null:l.getOwner()}function d(){return Error("react-stack-top-frame")}function f(l){if(ue.call(l,"key")){var h=Object.getOwnPropertyDescriptor(l,"key").get;if(h&&h.isReactWarning)return!1}return l.key!==void 0}function i(l,h){function b(){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)",h))}b.isReactWarning=!0,Object.defineProperty(l,"key",{get:b,configurable:!0})}function m(){var l=t(this.type);return v[l]||(v[l]=!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.")),l=this.props.ref,l!==void 0?l:null}function y(l,h,b,E,N,K,Z,ne){return b=K.ref,l={$$typeof:D,type:l,key:h,props:K,_owner:N},(b!==void 0?b:null)!==null?Object.defineProperty(l,"ref",{enumerable:!1,get:m}):Object.defineProperty(l,"ref",{enumerable:!1,value:null}),l._store={},Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(l,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(l,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Z}),Object.defineProperty(l,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ne}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}function _(l,h,b,E,N,K,Z,ne){var V=h.children;if(V!==void 0)if(E)if(de(V)){for(E=0;E<V.length;E++)M(V[E]);Object.freeze&&Object.freeze(V)}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(V);if(ue.call(h,"key")){V=t(l);var oe=Object.keys(h).filter(function(ie){return ie!=="key"});E=0<oe.length?"{key: someKey, "+oe.join(": ..., ")+": ...}":"{key: someKey}",g[V+E]||(oe=0<oe.length?"{"+oe.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
58
+ */var Wn;function ci(){return Wn||(Wn=1,process.env.NODE_ENV!=="production"&&function(){function t(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===X?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case A:return"Fragment";case Q:return"Profiler";case B:return"StrictMode";case z:return"Suspense";case H:return"SuspenseList";case te:return"Activity"}if(typeof l=="object")switch(typeof l.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),l.$$typeof){case P:return"Portal";case G:return(l.displayName||"Context")+".Provider";case W:return(l._context.displayName||"Context")+".Consumer";case J:var h=l.render;return l=l.displayName,l||(l=h.displayName||h.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case F:return h=l.displayName||null,h!==null?h:t(l.type)||"Memo";case $:h=l._payload,l=l._init;try{return t(l(h))}catch{}}return null}function e(l){return""+l}function r(l){try{e(l);var h=!1}catch{h=!0}if(h){h=console;var b=h.error,T=typeof Symbol=="function"&&Symbol.toStringTag&&l[Symbol.toStringTag]||l.constructor.name||"Object";return b.call(h,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",T),e(l)}}function n(l){if(l===A)return"<>";if(typeof l=="object"&&l!==null&&l.$$typeof===$)return"<...>";try{var h=t(l);return h?"<"+h+">":"<...>"}catch{return"<...>"}}function s(){var l=q.A;return l===null?null:l.getOwner()}function d(){return Error("react-stack-top-frame")}function f(l){if(ue.call(l,"key")){var h=Object.getOwnPropertyDescriptor(l,"key").get;if(h&&h.isReactWarning)return!1}return l.key!==void 0}function i(l,h){function b(){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)",h))}b.isReactWarning=!0,Object.defineProperty(l,"key",{get:b,configurable:!0})}function m(){var l=t(this.type);return v[l]||(v[l]=!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.")),l=this.props.ref,l!==void 0?l:null}function y(l,h,b,T,R,K,Z,ne){return b=K.ref,l={$$typeof:S,type:l,key:h,props:K,_owner:R},(b!==void 0?b:null)!==null?Object.defineProperty(l,"ref",{enumerable:!1,get:m}):Object.defineProperty(l,"ref",{enumerable:!1,value:null}),l._store={},Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(l,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(l,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Z}),Object.defineProperty(l,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ne}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}function _(l,h,b,T,R,K,Z,ne){var V=h.children;if(V!==void 0)if(T)if(de(V)){for(T=0;T<V.length;T++)M(V[T]);Object.freeze&&Object.freeze(V)}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(V);if(ue.call(h,"key")){V=t(l);var oe=Object.keys(h).filter(function(ie){return ie!=="key"});T=0<oe.length?"{key: someKey, "+oe.join(": ..., ")+": ...}":"{key: someKey}",g[V+T]||(oe=0<oe.length?"{"+oe.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
59
59
  let props = %s;
60
60
  <%s {...props} />
61
61
  React keys must be passed directly to JSX without using spread:
62
62
  let props = %s;
63
- <%s key={someKey} {...props} />`,E,V,oe,V),g[V+E]=!0)}if(V=null,b!==void 0&&(r(b),V=""+b),f(h)&&(r(h.key),V=""+h.key),"key"in h){b={};for(var ee in h)ee!=="key"&&(b[ee]=h[ee])}else b=h;return V&&i(b,typeof l=="function"?l.displayName||l.name||"Unknown":l),y(l,V,K,N,s(),b,Z,ne)}function M(l){typeof l=="object"&&l!==null&&l.$$typeof===D&&l._store&&(l._store.validated=1)}var x=re,D=Symbol.for("react.transitional.element"),P=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),Q=Symbol.for("react.profiler"),W=Symbol.for("react.consumer"),G=Symbol.for("react.context"),J=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),X=Symbol.for("react.client.reference"),q=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue=Object.prototype.hasOwnProperty,de=Array.isArray,S=console.createTask?console.createTask:function(){return null};x={react_stack_bottom_frame:function(l){return l()}};var C,v={},u=x.react_stack_bottom_frame.bind(x,d)(),c=S(n(d)),g={};Kt.Fragment=A,Kt.jsx=function(l,h,b,E,N){var K=1e4>q.recentlyCreatedOwnerStacks++;return _(l,h,b,!1,E,N,K?Error("react-stack-top-frame"):u,K?S(n(l)):c)},Kt.jsxs=function(l,h,b,E,N){var K=1e4>q.recentlyCreatedOwnerStacks++;return _(l,h,b,!0,E,N,K?Error("react-stack-top-frame"):u,K?S(n(l)):c)}}()),Kt}var Wn;function ii(){return Wn||(Wn=1,process.env.NODE_ENV==="production"?Rr.exports=oi():Rr.exports=si()),Rr.exports}ii();var Nr={exports:{}},$r={};/**
63
+ <%s key={someKey} {...props} />`,T,V,oe,V),g[V+T]=!0)}if(V=null,b!==void 0&&(r(b),V=""+b),f(h)&&(r(h.key),V=""+h.key),"key"in h){b={};for(var ee in h)ee!=="key"&&(b[ee]=h[ee])}else b=h;return V&&i(b,typeof l=="function"?l.displayName||l.name||"Unknown":l),y(l,V,K,R,s(),b,Z,ne)}function M(l){typeof l=="object"&&l!==null&&l.$$typeof===S&&l._store&&(l._store.validated=1)}var x=re,S=Symbol.for("react.transitional.element"),P=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),Q=Symbol.for("react.profiler"),W=Symbol.for("react.consumer"),G=Symbol.for("react.context"),J=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),X=Symbol.for("react.client.reference"),q=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue=Object.prototype.hasOwnProperty,de=Array.isArray,D=console.createTask?console.createTask:function(){return null};x={react_stack_bottom_frame:function(l){return l()}};var C,v={},u=x.react_stack_bottom_frame.bind(x,d)(),c=D(n(d)),g={};Zt.Fragment=A,Zt.jsx=function(l,h,b,T,R){var K=1e4>q.recentlyCreatedOwnerStacks++;return _(l,h,b,!1,T,R,K?Error("react-stack-top-frame"):u,K?D(n(l)):c)},Zt.jsxs=function(l,h,b,T,R){var K=1e4>q.recentlyCreatedOwnerStacks++;return _(l,h,b,!0,T,R,K?Error("react-stack-top-frame"):u,K?D(n(l)):c)}}()),Zt}var Vn;function di(){return Vn||(Vn=1,process.env.NODE_ENV==="production"?Rr.exports=ui():Rr.exports=ci()),Rr.exports}di();var $r={exports:{}},Lr={};/**
64
64
  * @license React
65
65
  * react-compiler-runtime.production.js
66
66
  *
@@ -68,7 +68,7 @@ React keys must be passed directly to JSX without using spread:
68
68
  *
69
69
  * This source code is licensed under the MIT license found in the
70
70
  * LICENSE file in the root directory of this source tree.
71
- */var Vn;function ai(){if(Vn)return $r;Vn=1;var t=re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return $r.c=function(e){return t.H.useMemoCache(e)},$r}var Hn={};/**
71
+ */var Hn;function hi(){if(Hn)return Lr;Hn=1;var t=re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return Lr.c=function(e){return t.H.useMemoCache(e)},Lr}var Gn={};/**
72
72
  * @license React
73
73
  * react-compiler-runtime.development.js
74
74
  *
@@ -76,19 +76,19 @@ React keys must be passed directly to JSX without using spread:
76
76
  *
77
77
  * This source code is licensed under the MIT license found in the
78
78
  * LICENSE file in the root directory of this source tree.
79
- */var Gn;function li(){return Gn||(Gn=1,process.env.NODE_ENV!=="production"&&function(){var t=re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;Hn.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:
79
+ */var Qn;function fi(){return Qn||(Qn=1,process.env.NODE_ENV!=="production"&&function(){var t=re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;Gn.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:
80
80
  1. You might have mismatching versions of React and the renderer (such as React DOM)
81
81
  2. You might be breaking the Rules of Hooks
82
82
  3. You might have more than one copy of React in the same app
83
- See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),r.useMemoCache(e)}}()),Hn}var Qn;function ui(){return Qn||(Qn=1,process.env.NODE_ENV==="production"?Nr.exports=ai():Nr.exports=li()),Nr.exports}ui();/*!
83
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),r.useMemoCache(e)}}()),Gn}var Kn;function pi(){return Kn||(Kn=1,process.env.NODE_ENV==="production"?$r.exports=hi():$r.exports=fi()),$r.exports}pi();/*!
84
84
  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
85
85
  * SPDX-License-Identifier: Apache-2.0
86
- */var Kn={},Tt={},Zn;function ci(){if(Zn)return Tt;Zn=1,Tt.byteLength=i,Tt.toByteArray=y,Tt.fromByteArray=x;for(var t=[],e=[],r=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,d=n.length;s<d;++s)t[s]=n[s],e[n.charCodeAt(s)]=s;e[45]=62,e[95]=63;function f(D){var P=D.length;if(P%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var A=D.indexOf("=");A===-1&&(A=P);var B=A===P?0:4-A%4;return[A,B]}function i(D){var P=f(D),A=P[0],B=P[1];return(A+B)*3/4-B}function m(D,P,A){return(P+A)*3/4-A}function y(D){var P,A=f(D),B=A[0],Q=A[1],W=new r(m(D,B,Q)),G=0,J=Q>0?B-4:B,z;for(z=0;z<J;z+=4)P=e[D.charCodeAt(z)]<<18|e[D.charCodeAt(z+1)]<<12|e[D.charCodeAt(z+2)]<<6|e[D.charCodeAt(z+3)],W[G++]=P>>16&255,W[G++]=P>>8&255,W[G++]=P&255;return Q===2&&(P=e[D.charCodeAt(z)]<<2|e[D.charCodeAt(z+1)]>>4,W[G++]=P&255),Q===1&&(P=e[D.charCodeAt(z)]<<10|e[D.charCodeAt(z+1)]<<4|e[D.charCodeAt(z+2)]>>2,W[G++]=P>>8&255,W[G++]=P&255),W}function _(D){return t[D>>18&63]+t[D>>12&63]+t[D>>6&63]+t[D&63]}function M(D,P,A){for(var B,Q=[],W=P;W<A;W+=3)B=(D[W]<<16&16711680)+(D[W+1]<<8&65280)+(D[W+2]&255),Q.push(_(B));return Q.join("")}function x(D){for(var P,A=D.length,B=A%3,Q=[],W=16383,G=0,J=A-B;G<J;G+=W)Q.push(M(D,G,G+W>J?J:G+W));return B===1?(P=D[A-1],Q.push(t[P>>2]+t[P<<4&63]+"==")):B===2&&(P=(D[A-2]<<8)+D[A-1],Q.push(t[P>>10]+t[P>>4&63]+t[P<<2&63]+"=")),Q.join("")}return Tt}var Lr={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var Jn;function di(){return Jn||(Jn=1,Lr.read=function(t,e,r,n,s){var d,f,i=s*8-n-1,m=(1<<i)-1,y=m>>1,_=-7,M=r?s-1:0,x=r?-1:1,D=t[e+M];for(M+=x,d=D&(1<<-_)-1,D>>=-_,_+=i;_>0;d=d*256+t[e+M],M+=x,_-=8);for(f=d&(1<<-_)-1,d>>=-_,_+=n;_>0;f=f*256+t[e+M],M+=x,_-=8);if(d===0)d=1-y;else{if(d===m)return f?NaN:(D?-1:1)*(1/0);f=f+Math.pow(2,n),d=d-y}return(D?-1:1)*f*Math.pow(2,d-n)},Lr.write=function(t,e,r,n,s,d){var f,i,m,y=d*8-s-1,_=(1<<y)-1,M=_>>1,x=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,D=n?0:d-1,P=n?1:-1,A=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(i=isNaN(e)?1:0,f=_):(f=Math.floor(Math.log(e)/Math.LN2),e*(m=Math.pow(2,-f))<1&&(f--,m*=2),f+M>=1?e+=x/m:e+=x*Math.pow(2,1-M),e*m>=2&&(f++,m/=2),f+M>=_?(i=0,f=_):f+M>=1?(i=(e*m-1)*Math.pow(2,s),f=f+M):(i=e*Math.pow(2,M-1)*Math.pow(2,s),f=0));s>=8;t[r+D]=i&255,D+=P,i/=256,s-=8);for(f=f<<s|i,y+=s;y>0;t[r+D]=f&255,D+=P,f/=256,y-=8);t[r+D-P]|=A*128}),Lr}var Br,Xn;function hi(){if(Xn)return Br;Xn=1;var t={}.toString;return Br=Array.isArray||function(e){return t.call(e)=="[object Array]"},Br}/*!
86
+ */var Zn={},Et={},Jn;function gi(){if(Jn)return Et;Jn=1,Et.byteLength=i,Et.toByteArray=y,Et.fromByteArray=x;for(var t=[],e=[],r=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,d=n.length;s<d;++s)t[s]=n[s],e[n.charCodeAt(s)]=s;e[45]=62,e[95]=63;function f(S){var P=S.length;if(P%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var A=S.indexOf("=");A===-1&&(A=P);var B=A===P?0:4-A%4;return[A,B]}function i(S){var P=f(S),A=P[0],B=P[1];return(A+B)*3/4-B}function m(S,P,A){return(P+A)*3/4-A}function y(S){var P,A=f(S),B=A[0],Q=A[1],W=new r(m(S,B,Q)),G=0,J=Q>0?B-4:B,z;for(z=0;z<J;z+=4)P=e[S.charCodeAt(z)]<<18|e[S.charCodeAt(z+1)]<<12|e[S.charCodeAt(z+2)]<<6|e[S.charCodeAt(z+3)],W[G++]=P>>16&255,W[G++]=P>>8&255,W[G++]=P&255;return Q===2&&(P=e[S.charCodeAt(z)]<<2|e[S.charCodeAt(z+1)]>>4,W[G++]=P&255),Q===1&&(P=e[S.charCodeAt(z)]<<10|e[S.charCodeAt(z+1)]<<4|e[S.charCodeAt(z+2)]>>2,W[G++]=P>>8&255,W[G++]=P&255),W}function _(S){return t[S>>18&63]+t[S>>12&63]+t[S>>6&63]+t[S&63]}function M(S,P,A){for(var B,Q=[],W=P;W<A;W+=3)B=(S[W]<<16&16711680)+(S[W+1]<<8&65280)+(S[W+2]&255),Q.push(_(B));return Q.join("")}function x(S){for(var P,A=S.length,B=A%3,Q=[],W=16383,G=0,J=A-B;G<J;G+=W)Q.push(M(S,G,G+W>J?J:G+W));return B===1?(P=S[A-1],Q.push(t[P>>2]+t[P<<4&63]+"==")):B===2&&(P=(S[A-2]<<8)+S[A-1],Q.push(t[P>>10]+t[P>>4&63]+t[P<<2&63]+"=")),Q.join("")}return Et}var Br={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var Xn;function mi(){return Xn||(Xn=1,Br.read=function(t,e,r,n,s){var d,f,i=s*8-n-1,m=(1<<i)-1,y=m>>1,_=-7,M=r?s-1:0,x=r?-1:1,S=t[e+M];for(M+=x,d=S&(1<<-_)-1,S>>=-_,_+=i;_>0;d=d*256+t[e+M],M+=x,_-=8);for(f=d&(1<<-_)-1,d>>=-_,_+=n;_>0;f=f*256+t[e+M],M+=x,_-=8);if(d===0)d=1-y;else{if(d===m)return f?NaN:(S?-1:1)*(1/0);f=f+Math.pow(2,n),d=d-y}return(S?-1:1)*f*Math.pow(2,d-n)},Br.write=function(t,e,r,n,s,d){var f,i,m,y=d*8-s-1,_=(1<<y)-1,M=_>>1,x=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=n?0:d-1,P=n?1:-1,A=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(i=isNaN(e)?1:0,f=_):(f=Math.floor(Math.log(e)/Math.LN2),e*(m=Math.pow(2,-f))<1&&(f--,m*=2),f+M>=1?e+=x/m:e+=x*Math.pow(2,1-M),e*m>=2&&(f++,m/=2),f+M>=_?(i=0,f=_):f+M>=1?(i=(e*m-1)*Math.pow(2,s),f=f+M):(i=e*Math.pow(2,M-1)*Math.pow(2,s),f=0));s>=8;t[r+S]=i&255,S+=P,i/=256,s-=8);for(f=f<<s|i,y+=s;y>0;t[r+S]=f&255,S+=P,f/=256,y-=8);t[r+S-P]|=A*128}),Br}var Ir,eo;function yi(){if(eo)return Ir;eo=1;var t={}.toString;return Ir=Array.isArray||function(e){return t.call(e)=="[object Array]"},Ir}/*!
87
87
  * The buffer module from node.js, for the browser.
88
88
  *
89
89
  * @author Feross Aboukhadijeh <http://feross.org>
90
90
  * @license MIT
91
- */var eo;function fi(){return eo||(eo=1,function(t){var e=ci(),r=di(),n=hi();t.Buffer=i,t.SlowBuffer=Q,t.INSPECT_MAX_BYTES=50,i.TYPED_ARRAY_SUPPORT=Fn.TYPED_ARRAY_SUPPORT!==void 0?Fn.TYPED_ARRAY_SUPPORT:s(),t.kMaxLength=d();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 d(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(o,a){if(d()<a)throw new RangeError("Invalid typed array length");return i.TYPED_ARRAY_SUPPORT?(o=new Uint8Array(a),o.__proto__=i.prototype):(o===null&&(o=new i(a)),o.length=a),o}function i(o,a,p){if(!i.TYPED_ARRAY_SUPPORT&&!(this instanceof i))return new i(o,a,p);if(typeof o=="number"){if(typeof a=="string")throw new Error("If encoding is specified then the first argument must be a string");return M(this,o)}return m(this,o,a,p)}i.poolSize=8192,i._augment=function(o){return o.__proto__=i.prototype,o};function m(o,a,p,k){if(typeof a=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&a instanceof ArrayBuffer?P(o,a,p,k):typeof a=="string"?x(o,a,p):A(o,a)}i.from=function(o,a,p){return m(null,o,a,p)},i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0}));function 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,a,p,k){return y(a),a<=0?f(o,a):p!==void 0?typeof k=="string"?f(o,a).fill(p,k):f(o,a).fill(p):f(o,a)}i.alloc=function(o,a,p){return _(null,o,a,p)};function M(o,a){if(y(a),o=f(o,a<0?0:B(a)|0),!i.TYPED_ARRAY_SUPPORT)for(var p=0;p<a;++p)o[p]=0;return o}i.allocUnsafe=function(o){return M(null,o)},i.allocUnsafeSlow=function(o){return M(null,o)};function x(o,a,p){if((typeof p!="string"||p==="")&&(p="utf8"),!i.isEncoding(p))throw new TypeError('"encoding" must be a valid string encoding');var k=W(a,p)|0;o=f(o,k);var R=o.write(a,p);return R!==k&&(o=o.slice(0,R)),o}function D(o,a){var p=a.length<0?0:B(a.length)|0;o=f(o,p);for(var k=0;k<p;k+=1)o[k]=a[k]&255;return o}function P(o,a,p,k){if(a.byteLength,p<0||a.byteLength<p)throw new RangeError("'offset' is out of bounds");if(a.byteLength<p+(k||0))throw new RangeError("'length' is out of bounds");return p===void 0&&k===void 0?a=new Uint8Array(a):k===void 0?a=new Uint8Array(a,p):a=new Uint8Array(a,p,k),i.TYPED_ARRAY_SUPPORT?(o=a,o.__proto__=i.prototype):o=D(o,a),o}function A(o,a){if(i.isBuffer(a)){var p=B(a.length)|0;return o=f(o,p),o.length===0||a.copy(o,0,0,p),o}if(a){if(typeof ArrayBuffer<"u"&&a.buffer instanceof ArrayBuffer||"length"in a)return typeof a.length!="number"||ce(a.length)?f(o,0):D(o,a);if(a.type==="Buffer"&&n(a.data))return D(o,a.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function B(o){if(o>=d())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d().toString(16)+" bytes");return o|0}function Q(o){return+o!=o&&(o=0),i.alloc(+o)}i.isBuffer=function(o){return!!(o!=null&&o._isBuffer)},i.compare=function(o,a){if(!i.isBuffer(o)||!i.isBuffer(a))throw new TypeError("Arguments must be Buffers");if(o===a)return 0;for(var p=o.length,k=a.length,R=0,U=Math.min(p,k);R<U;++R)if(o[R]!==a[R]){p=o[R],k=a[R];break}return p<k?-1:k<p?1:0},i.isEncoding=function(o){switch(String(o).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(o,a){if(!n(o))throw new TypeError('"list" argument must be an Array of Buffers');if(o.length===0)return i.alloc(0);var p;if(a===void 0)for(a=0,p=0;p<o.length;++p)a+=o[p].length;var k=i.allocUnsafe(a),R=0;for(p=0;p<o.length;++p){var U=o[p];if(!i.isBuffer(U))throw new TypeError('"list" argument must be an Array of Buffers');U.copy(k,R),R+=U.length}return k};function W(o,a){if(i.isBuffer(o))return o.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(o)||o instanceof ArrayBuffer))return o.byteLength;typeof o!="string"&&(o=""+o);var p=o.length;if(p===0)return 0;for(var k=!1;;)switch(a){case"ascii":case"latin1":case"binary":return p;case"utf8":case"utf-8":case void 0:return O(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(k)return O(o).length;a=(""+a).toLowerCase(),k=!0}}i.byteLength=W;function G(o,a,p){var k=!1;if((a===void 0||a<0)&&(a=0),a>this.length||((p===void 0||p>this.length)&&(p=this.length),p<=0)||(p>>>=0,a>>>=0,p<=a))return"";for(o||(o="utf8");;)switch(o){case"hex":return g(this,a,p);case"utf8":case"utf-8":return S(this,a,p);case"ascii":return u(this,a,p);case"latin1":case"binary":return c(this,a,p);case"base64":return de(this,a,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l(this,a,p);default:if(k)throw new TypeError("Unknown encoding: "+o);o=(o+"").toLowerCase(),k=!0}}i.prototype._isBuffer=!0;function J(o,a,p){var k=o[a];o[a]=o[p],o[p]=k}i.prototype.swap16=function(){var o=this.length;if(o%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var a=0;a<o;a+=2)J(this,a,a+1);return this},i.prototype.swap32=function(){var o=this.length;if(o%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var a=0;a<o;a+=4)J(this,a,a+3),J(this,a+1,a+2);return this},i.prototype.swap64=function(){var o=this.length;if(o%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var a=0;a<o;a+=8)J(this,a,a+7),J(this,a+1,a+6),J(this,a+2,a+5),J(this,a+3,a+4);return this},i.prototype.toString=function(){var o=this.length|0;return o===0?"":arguments.length===0?S(this,0,o):G.apply(this,arguments)},i.prototype.equals=function(o){if(!i.isBuffer(o))throw new TypeError("Argument must be a Buffer");return this===o?!0:i.compare(this,o)===0},i.prototype.inspect=function(){var o="",a=t.INSPECT_MAX_BYTES;return this.length>0&&(o=this.toString("hex",0,a).match(/.{2}/g).join(" "),this.length>a&&(o+=" ... ")),"<Buffer "+o+">"},i.prototype.compare=function(o,a,p,k,R){if(!i.isBuffer(o))throw new TypeError("Argument must be a Buffer");if(a===void 0&&(a=0),p===void 0&&(p=o?o.length:0),k===void 0&&(k=0),R===void 0&&(R=this.length),a<0||p>o.length||k<0||R>this.length)throw new RangeError("out of range index");if(k>=R&&a>=p)return 0;if(k>=R)return-1;if(a>=p)return 1;if(a>>>=0,p>>>=0,k>>>=0,R>>>=0,this===o)return 0;for(var U=R-k,le=p-a,se=Math.min(U,le),fe=this.slice(k,R),ae=o.slice(a,p),ge=0;ge<se;++ge)if(fe[ge]!==ae[ge]){U=fe[ge],le=ae[ge];break}return U<le?-1:le<U?1:0};function z(o,a,p,k,R){if(o.length===0)return-1;if(typeof p=="string"?(k=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 a=="string"&&(a=i.from(a,k)),i.isBuffer(a))return a.length===0?-1:H(o,a,p,k,R);if(typeof a=="number")return a=a&255,i.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?R?Uint8Array.prototype.indexOf.call(o,a,p):Uint8Array.prototype.lastIndexOf.call(o,a,p):H(o,[a],p,k,R);throw new TypeError("val must be string, number or Buffer")}function H(o,a,p,k,R){var U=1,le=o.length,se=a.length;if(k!==void 0&&(k=String(k).toLowerCase(),k==="ucs2"||k==="ucs-2"||k==="utf16le"||k==="utf-16le")){if(o.length<2||a.length<2)return-1;U=2,le/=2,se/=2,p/=2}function fe(xe,_e){return U===1?xe[_e]:xe.readUInt16BE(_e*U)}var ae;if(R){var ge=-1;for(ae=p;ae<le;ae++)if(fe(o,ae)===fe(a,ge===-1?0:ae-ge)){if(ge===-1&&(ge=ae),ae-ge+1===se)return ge*U}else ge!==-1&&(ae-=ae-ge),ge=-1}else for(p+se>le&&(p=le-se),ae=p;ae>=0;ae--){for(var ve=!0,pe=0;pe<se;pe++)if(fe(o,ae+pe)!==fe(a,pe)){ve=!1;break}if(ve)return ae}return-1}i.prototype.includes=function(o,a,p){return this.indexOf(o,a,p)!==-1},i.prototype.indexOf=function(o,a,p){return z(this,o,a,p,!0)},i.prototype.lastIndexOf=function(o,a,p){return z(this,o,a,p,!1)};function F(o,a,p,k){p=Number(p)||0;var R=o.length-p;k?(k=Number(k),k>R&&(k=R)):k=R;var U=a.length;if(U%2!==0)throw new TypeError("Invalid hex string");k>U/2&&(k=U/2);for(var le=0;le<k;++le){var se=parseInt(a.substr(le*2,2),16);if(isNaN(se))return le;o[p+le]=se}return le}function $(o,a,p,k){return Y(O(a,o.length-p),o,p,k)}function te(o,a,p,k){return Y(L(a),o,p,k)}function X(o,a,p,k){return te(o,a,p,k)}function q(o,a,p,k){return Y(I(a),o,p,k)}function ue(o,a,p,k){return Y(j(a,o.length-p),o,p,k)}i.prototype.write=function(o,a,p,k){if(a===void 0)k="utf8",p=this.length,a=0;else if(p===void 0&&typeof a=="string")k=a,p=this.length,a=0;else if(isFinite(a))a=a|0,isFinite(p)?(p=p|0,k===void 0&&(k="utf8")):(k=p,p=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var R=this.length-a;if((p===void 0||p>R)&&(p=R),o.length>0&&(p<0||a<0)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds");k||(k="utf8");for(var U=!1;;)switch(k){case"hex":return F(this,o,a,p);case"utf8":case"utf-8":return $(this,o,a,p);case"ascii":return te(this,o,a,p);case"latin1":case"binary":return X(this,o,a,p);case"base64":return q(this,o,a,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ue(this,o,a,p);default:if(U)throw new TypeError("Unknown encoding: "+k);k=(""+k).toLowerCase(),U=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function de(o,a,p){return a===0&&p===o.length?e.fromByteArray(o):e.fromByteArray(o.slice(a,p))}function S(o,a,p){p=Math.min(o.length,p);for(var k=[],R=a;R<p;){var U=o[R],le=null,se=U>239?4:U>223?3:U>191?2:1;if(R+se<=p){var fe,ae,ge,ve;switch(se){case 1:U<128&&(le=U);break;case 2:fe=o[R+1],(fe&192)===128&&(ve=(U&31)<<6|fe&63,ve>127&&(le=ve));break;case 3:fe=o[R+1],ae=o[R+2],(fe&192)===128&&(ae&192)===128&&(ve=(U&15)<<12|(fe&63)<<6|ae&63,ve>2047&&(ve<55296||ve>57343)&&(le=ve));break;case 4:fe=o[R+1],ae=o[R+2],ge=o[R+3],(fe&192)===128&&(ae&192)===128&&(ge&192)===128&&(ve=(U&15)<<18|(fe&63)<<12|(ae&63)<<6|ge&63,ve>65535&&ve<1114112&&(le=ve))}}le===null?(le=65533,se=1):le>65535&&(le-=65536,k.push(le>>>10&1023|55296),le=56320|le&1023),k.push(le),R+=se}return v(k)}var C=4096;function v(o){var a=o.length;if(a<=C)return String.fromCharCode.apply(String,o);for(var p="",k=0;k<a;)p+=String.fromCharCode.apply(String,o.slice(k,k+=C));return p}function u(o,a,p){var k="";p=Math.min(o.length,p);for(var R=a;R<p;++R)k+=String.fromCharCode(o[R]&127);return k}function c(o,a,p){var k="";p=Math.min(o.length,p);for(var R=a;R<p;++R)k+=String.fromCharCode(o[R]);return k}function g(o,a,p){var k=o.length;(!a||a<0)&&(a=0),(!p||p<0||p>k)&&(p=k);for(var R="",U=a;U<p;++U)R+=ie(o[U]);return R}function l(o,a,p){for(var k=o.slice(a,p),R="",U=0;U<k.length;U+=2)R+=String.fromCharCode(k[U]+k[U+1]*256);return R}i.prototype.slice=function(o,a){var p=this.length;o=~~o,a=a===void 0?p:~~a,o<0?(o+=p,o<0&&(o=0)):o>p&&(o=p),a<0?(a+=p,a<0&&(a=0)):a>p&&(a=p),a<o&&(a=o);var k;if(i.TYPED_ARRAY_SUPPORT)k=this.subarray(o,a),k.__proto__=i.prototype;else{var R=a-o;k=new i(R,void 0);for(var U=0;U<R;++U)k[U]=this[U+o]}return k};function h(o,a,p){if(o%1!==0||o<0)throw new RangeError("offset is not uint");if(o+a>p)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUIntLE=function(o,a,p){o=o|0,a=a|0,p||h(o,a,this.length);for(var k=this[o],R=1,U=0;++U<a&&(R*=256);)k+=this[o+U]*R;return k},i.prototype.readUIntBE=function(o,a,p){o=o|0,a=a|0,p||h(o,a,this.length);for(var k=this[o+--a],R=1;a>0&&(R*=256);)k+=this[o+--a]*R;return k},i.prototype.readUInt8=function(o,a){return a||h(o,1,this.length),this[o]},i.prototype.readUInt16LE=function(o,a){return a||h(o,2,this.length),this[o]|this[o+1]<<8},i.prototype.readUInt16BE=function(o,a){return a||h(o,2,this.length),this[o]<<8|this[o+1]},i.prototype.readUInt32LE=function(o,a){return a||h(o,4,this.length),(this[o]|this[o+1]<<8|this[o+2]<<16)+this[o+3]*16777216},i.prototype.readUInt32BE=function(o,a){return a||h(o,4,this.length),this[o]*16777216+(this[o+1]<<16|this[o+2]<<8|this[o+3])},i.prototype.readIntLE=function(o,a,p){o=o|0,a=a|0,p||h(o,a,this.length);for(var k=this[o],R=1,U=0;++U<a&&(R*=256);)k+=this[o+U]*R;return R*=128,k>=R&&(k-=Math.pow(2,8*a)),k},i.prototype.readIntBE=function(o,a,p){o=o|0,a=a|0,p||h(o,a,this.length);for(var k=a,R=1,U=this[o+--k];k>0&&(R*=256);)U+=this[o+--k]*R;return R*=128,U>=R&&(U-=Math.pow(2,8*a)),U},i.prototype.readInt8=function(o,a){return a||h(o,1,this.length),this[o]&128?(255-this[o]+1)*-1:this[o]},i.prototype.readInt16LE=function(o,a){a||h(o,2,this.length);var p=this[o]|this[o+1]<<8;return p&32768?p|4294901760:p},i.prototype.readInt16BE=function(o,a){a||h(o,2,this.length);var p=this[o+1]|this[o]<<8;return p&32768?p|4294901760:p},i.prototype.readInt32LE=function(o,a){return a||h(o,4,this.length),this[o]|this[o+1]<<8|this[o+2]<<16|this[o+3]<<24},i.prototype.readInt32BE=function(o,a){return a||h(o,4,this.length),this[o]<<24|this[o+1]<<16|this[o+2]<<8|this[o+3]},i.prototype.readFloatLE=function(o,a){return a||h(o,4,this.length),r.read(this,o,!0,23,4)},i.prototype.readFloatBE=function(o,a){return a||h(o,4,this.length),r.read(this,o,!1,23,4)},i.prototype.readDoubleLE=function(o,a){return a||h(o,8,this.length),r.read(this,o,!0,52,8)},i.prototype.readDoubleBE=function(o,a){return a||h(o,8,this.length),r.read(this,o,!1,52,8)};function b(o,a,p,k,R,U){if(!i.isBuffer(o))throw new TypeError('"buffer" argument must be a Buffer instance');if(a>R||a<U)throw new RangeError('"value" argument is out of bounds');if(p+k>o.length)throw new RangeError("Index out of range")}i.prototype.writeUIntLE=function(o,a,p,k){if(o=+o,a=a|0,p=p|0,!k){var R=Math.pow(2,8*p)-1;b(this,o,a,p,R,0)}var U=1,le=0;for(this[a]=o&255;++le<p&&(U*=256);)this[a+le]=o/U&255;return a+p},i.prototype.writeUIntBE=function(o,a,p,k){if(o=+o,a=a|0,p=p|0,!k){var R=Math.pow(2,8*p)-1;b(this,o,a,p,R,0)}var U=p-1,le=1;for(this[a+U]=o&255;--U>=0&&(le*=256);)this[a+U]=o/le&255;return a+p},i.prototype.writeUInt8=function(o,a,p){return o=+o,a=a|0,p||b(this,o,a,1,255,0),i.TYPED_ARRAY_SUPPORT||(o=Math.floor(o)),this[a]=o&255,a+1};function E(o,a,p,k){a<0&&(a=65535+a+1);for(var R=0,U=Math.min(o.length-p,2);R<U;++R)o[p+R]=(a&255<<8*(k?R:1-R))>>>(k?R:1-R)*8}i.prototype.writeUInt16LE=function(o,a,p){return o=+o,a=a|0,p||b(this,o,a,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[a]=o&255,this[a+1]=o>>>8):E(this,o,a,!0),a+2},i.prototype.writeUInt16BE=function(o,a,p){return o=+o,a=a|0,p||b(this,o,a,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[a]=o>>>8,this[a+1]=o&255):E(this,o,a,!1),a+2};function N(o,a,p,k){a<0&&(a=4294967295+a+1);for(var R=0,U=Math.min(o.length-p,4);R<U;++R)o[p+R]=a>>>(k?R:3-R)*8&255}i.prototype.writeUInt32LE=function(o,a,p){return o=+o,a=a|0,p||b(this,o,a,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[a+3]=o>>>24,this[a+2]=o>>>16,this[a+1]=o>>>8,this[a]=o&255):N(this,o,a,!0),a+4},i.prototype.writeUInt32BE=function(o,a,p){return o=+o,a=a|0,p||b(this,o,a,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[a]=o>>>24,this[a+1]=o>>>16,this[a+2]=o>>>8,this[a+3]=o&255):N(this,o,a,!1),a+4},i.prototype.writeIntLE=function(o,a,p,k){if(o=+o,a=a|0,!k){var R=Math.pow(2,8*p-1);b(this,o,a,p,R-1,-R)}var U=0,le=1,se=0;for(this[a]=o&255;++U<p&&(le*=256);)o<0&&se===0&&this[a+U-1]!==0&&(se=1),this[a+U]=(o/le>>0)-se&255;return a+p},i.prototype.writeIntBE=function(o,a,p,k){if(o=+o,a=a|0,!k){var R=Math.pow(2,8*p-1);b(this,o,a,p,R-1,-R)}var U=p-1,le=1,se=0;for(this[a+U]=o&255;--U>=0&&(le*=256);)o<0&&se===0&&this[a+U+1]!==0&&(se=1),this[a+U]=(o/le>>0)-se&255;return a+p},i.prototype.writeInt8=function(o,a,p){return o=+o,a=a|0,p||b(this,o,a,1,127,-128),i.TYPED_ARRAY_SUPPORT||(o=Math.floor(o)),o<0&&(o=255+o+1),this[a]=o&255,a+1},i.prototype.writeInt16LE=function(o,a,p){return o=+o,a=a|0,p||b(this,o,a,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[a]=o&255,this[a+1]=o>>>8):E(this,o,a,!0),a+2},i.prototype.writeInt16BE=function(o,a,p){return o=+o,a=a|0,p||b(this,o,a,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[a]=o>>>8,this[a+1]=o&255):E(this,o,a,!1),a+2},i.prototype.writeInt32LE=function(o,a,p){return o=+o,a=a|0,p||b(this,o,a,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[a]=o&255,this[a+1]=o>>>8,this[a+2]=o>>>16,this[a+3]=o>>>24):N(this,o,a,!0),a+4},i.prototype.writeInt32BE=function(o,a,p){return o=+o,a=a|0,p||b(this,o,a,4,2147483647,-2147483648),o<0&&(o=4294967295+o+1),i.TYPED_ARRAY_SUPPORT?(this[a]=o>>>24,this[a+1]=o>>>16,this[a+2]=o>>>8,this[a+3]=o&255):N(this,o,a,!1),a+4};function K(o,a,p,k,R,U){if(p+k>o.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("Index out of range")}function Z(o,a,p,k,R){return R||K(o,a,p,4),r.write(o,a,p,k,23,4),p+4}i.prototype.writeFloatLE=function(o,a,p){return Z(this,o,a,!0,p)},i.prototype.writeFloatBE=function(o,a,p){return Z(this,o,a,!1,p)};function ne(o,a,p,k,R){return R||K(o,a,p,8),r.write(o,a,p,k,52,8),p+8}i.prototype.writeDoubleLE=function(o,a,p){return ne(this,o,a,!0,p)},i.prototype.writeDoubleBE=function(o,a,p){return ne(this,o,a,!1,p)},i.prototype.copy=function(o,a,p,k){if(p||(p=0),!k&&k!==0&&(k=this.length),a>=o.length&&(a=o.length),a||(a=0),k>0&&k<p&&(k=p),k===p||o.length===0||this.length===0)return 0;if(a<0)throw new RangeError("targetStart out of bounds");if(p<0||p>=this.length)throw new RangeError("sourceStart out of bounds");if(k<0)throw new RangeError("sourceEnd out of bounds");k>this.length&&(k=this.length),o.length-a<k-p&&(k=o.length-a+p);var R=k-p,U;if(this===o&&p<a&&a<k)for(U=R-1;U>=0;--U)o[U+a]=this[U+p];else if(R<1e3||!i.TYPED_ARRAY_SUPPORT)for(U=0;U<R;++U)o[U+a]=this[U+p];else Uint8Array.prototype.set.call(o,this.subarray(p,p+R),a);return R},i.prototype.fill=function(o,a,p,k){if(typeof o=="string"){if(typeof a=="string"?(k=a,a=0,p=this.length):typeof p=="string"&&(k=p,p=this.length),o.length===1){var R=o.charCodeAt(0);R<256&&(o=R)}if(k!==void 0&&typeof k!="string")throw new TypeError("encoding must be a string");if(typeof k=="string"&&!i.isEncoding(k))throw new TypeError("Unknown encoding: "+k)}else typeof o=="number"&&(o=o&255);if(a<0||this.length<a||this.length<p)throw new RangeError("Out of range index");if(p<=a)return this;a=a>>>0,p=p===void 0?this.length:p>>>0,o||(o=0);var U;if(typeof o=="number")for(U=a;U<p;++U)this[U]=o;else{var le=i.isBuffer(o)?o:O(new i(o,k).toString()),se=le.length;for(U=0;U<p-a;++U)this[U+a]=le[U%se]}return this};var V=/[^+\/0-9A-Za-z-_]/g;function oe(o){if(o=ee(o).replace(V,""),o.length<2)return"";for(;o.length%4!==0;)o=o+"=";return o}function ee(o){return o.trim?o.trim():o.replace(/^\s+|\s+$/g,"")}function ie(o){return o<16?"0"+o.toString(16):o.toString(16)}function O(o,a){a=a||1/0;for(var p,k=o.length,R=null,U=[],le=0;le<k;++le){if(p=o.charCodeAt(le),p>55295&&p<57344){if(!R){if(p>56319){(a-=3)>-1&&U.push(239,191,189);continue}else if(le+1===k){(a-=3)>-1&&U.push(239,191,189);continue}R=p;continue}if(p<56320){(a-=3)>-1&&U.push(239,191,189),R=p;continue}p=(R-55296<<10|p-56320)+65536}else R&&(a-=3)>-1&&U.push(239,191,189);if(R=null,p<128){if((a-=1)<0)break;U.push(p)}else if(p<2048){if((a-=2)<0)break;U.push(p>>6|192,p&63|128)}else if(p<65536){if((a-=3)<0)break;U.push(p>>12|224,p>>6&63|128,p&63|128)}else if(p<1114112){if((a-=4)<0)break;U.push(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}else throw new Error("Invalid code point")}return U}function L(o){for(var a=[],p=0;p<o.length;++p)a.push(o.charCodeAt(p)&255);return a}function j(o,a){for(var p,k,R,U=[],le=0;le<o.length&&!((a-=2)<0);++le)p=o.charCodeAt(le),k=p>>8,R=p%256,U.push(R),U.push(k);return U}function I(o){return e.toByteArray(oe(o))}function Y(o,a,p,k){for(var R=0;R<k&&!(R+p>=a.length||R>=o.length);++R)a[R+p]=o[R];return R}function ce(o){return o!==o}}(Kn)),Kn}fi();var ft;if(typeof window<"u"&&window.crypto&&(ft=window.crypto),!ft&&typeof window<"u"&&window.msCrypto&&(ft=window.msCrypto),!ft&&typeof global<"u"&&global.crypto&&(ft=global.crypto),!ft&&typeof require=="function")try{ft=require("crypto")}catch{}var to={};/*! *****************************************************************************
91
+ */var to;function vi(){return to||(to=1,function(t){var e=gi(),r=mi(),n=yi();t.Buffer=i,t.SlowBuffer=Q,t.INSPECT_MAX_BYTES=50,i.TYPED_ARRAY_SUPPORT=Un.TYPED_ARRAY_SUPPORT!==void 0?Un.TYPED_ARRAY_SUPPORT:s(),t.kMaxLength=d();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 d(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(o,a){if(d()<a)throw new RangeError("Invalid typed array length");return i.TYPED_ARRAY_SUPPORT?(o=new Uint8Array(a),o.__proto__=i.prototype):(o===null&&(o=new i(a)),o.length=a),o}function i(o,a,p){if(!i.TYPED_ARRAY_SUPPORT&&!(this instanceof i))return new i(o,a,p);if(typeof o=="number"){if(typeof a=="string")throw new Error("If encoding is specified then the first argument must be a string");return M(this,o)}return m(this,o,a,p)}i.poolSize=8192,i._augment=function(o){return o.__proto__=i.prototype,o};function m(o,a,p,k){if(typeof a=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&a instanceof ArrayBuffer?P(o,a,p,k):typeof a=="string"?x(o,a,p):A(o,a)}i.from=function(o,a,p){return m(null,o,a,p)},i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0}));function 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,a,p,k){return y(a),a<=0?f(o,a):p!==void 0?typeof k=="string"?f(o,a).fill(p,k):f(o,a).fill(p):f(o,a)}i.alloc=function(o,a,p){return _(null,o,a,p)};function M(o,a){if(y(a),o=f(o,a<0?0:B(a)|0),!i.TYPED_ARRAY_SUPPORT)for(var p=0;p<a;++p)o[p]=0;return o}i.allocUnsafe=function(o){return M(null,o)},i.allocUnsafeSlow=function(o){return M(null,o)};function x(o,a,p){if((typeof p!="string"||p==="")&&(p="utf8"),!i.isEncoding(p))throw new TypeError('"encoding" must be a valid string encoding');var k=W(a,p)|0;o=f(o,k);var N=o.write(a,p);return N!==k&&(o=o.slice(0,N)),o}function S(o,a){var p=a.length<0?0:B(a.length)|0;o=f(o,p);for(var k=0;k<p;k+=1)o[k]=a[k]&255;return o}function P(o,a,p,k){if(a.byteLength,p<0||a.byteLength<p)throw new RangeError("'offset' is out of bounds");if(a.byteLength<p+(k||0))throw new RangeError("'length' is out of bounds");return p===void 0&&k===void 0?a=new Uint8Array(a):k===void 0?a=new Uint8Array(a,p):a=new Uint8Array(a,p,k),i.TYPED_ARRAY_SUPPORT?(o=a,o.__proto__=i.prototype):o=S(o,a),o}function A(o,a){if(i.isBuffer(a)){var p=B(a.length)|0;return o=f(o,p),o.length===0||a.copy(o,0,0,p),o}if(a){if(typeof ArrayBuffer<"u"&&a.buffer instanceof ArrayBuffer||"length"in a)return typeof a.length!="number"||ce(a.length)?f(o,0):S(o,a);if(a.type==="Buffer"&&n(a.data))return S(o,a.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function B(o){if(o>=d())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d().toString(16)+" bytes");return o|0}function Q(o){return+o!=o&&(o=0),i.alloc(+o)}i.isBuffer=function(o){return!!(o!=null&&o._isBuffer)},i.compare=function(o,a){if(!i.isBuffer(o)||!i.isBuffer(a))throw new TypeError("Arguments must be Buffers");if(o===a)return 0;for(var p=o.length,k=a.length,N=0,U=Math.min(p,k);N<U;++N)if(o[N]!==a[N]){p=o[N],k=a[N];break}return p<k?-1:k<p?1:0},i.isEncoding=function(o){switch(String(o).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(o,a){if(!n(o))throw new TypeError('"list" argument must be an Array of Buffers');if(o.length===0)return i.alloc(0);var p;if(a===void 0)for(a=0,p=0;p<o.length;++p)a+=o[p].length;var k=i.allocUnsafe(a),N=0;for(p=0;p<o.length;++p){var U=o[p];if(!i.isBuffer(U))throw new TypeError('"list" argument must be an Array of Buffers');U.copy(k,N),N+=U.length}return k};function W(o,a){if(i.isBuffer(o))return o.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(o)||o instanceof ArrayBuffer))return o.byteLength;typeof o!="string"&&(o=""+o);var p=o.length;if(p===0)return 0;for(var k=!1;;)switch(a){case"ascii":case"latin1":case"binary":return p;case"utf8":case"utf-8":case void 0:return O(o).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p*2;case"hex":return p>>>1;case"base64":return Y(o).length;default:if(k)return O(o).length;a=(""+a).toLowerCase(),k=!0}}i.byteLength=W;function G(o,a,p){var k=!1;if((a===void 0||a<0)&&(a=0),a>this.length||((p===void 0||p>this.length)&&(p=this.length),p<=0)||(p>>>=0,a>>>=0,p<=a))return"";for(o||(o="utf8");;)switch(o){case"hex":return g(this,a,p);case"utf8":case"utf-8":return D(this,a,p);case"ascii":return u(this,a,p);case"latin1":case"binary":return c(this,a,p);case"base64":return de(this,a,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l(this,a,p);default:if(k)throw new TypeError("Unknown encoding: "+o);o=(o+"").toLowerCase(),k=!0}}i.prototype._isBuffer=!0;function J(o,a,p){var k=o[a];o[a]=o[p],o[p]=k}i.prototype.swap16=function(){var o=this.length;if(o%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var a=0;a<o;a+=2)J(this,a,a+1);return this},i.prototype.swap32=function(){var o=this.length;if(o%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var a=0;a<o;a+=4)J(this,a,a+3),J(this,a+1,a+2);return this},i.prototype.swap64=function(){var o=this.length;if(o%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var a=0;a<o;a+=8)J(this,a,a+7),J(this,a+1,a+6),J(this,a+2,a+5),J(this,a+3,a+4);return this},i.prototype.toString=function(){var o=this.length|0;return o===0?"":arguments.length===0?D(this,0,o):G.apply(this,arguments)},i.prototype.equals=function(o){if(!i.isBuffer(o))throw new TypeError("Argument must be a Buffer");return this===o?!0:i.compare(this,o)===0},i.prototype.inspect=function(){var o="",a=t.INSPECT_MAX_BYTES;return this.length>0&&(o=this.toString("hex",0,a).match(/.{2}/g).join(" "),this.length>a&&(o+=" ... ")),"<Buffer "+o+">"},i.prototype.compare=function(o,a,p,k,N){if(!i.isBuffer(o))throw new TypeError("Argument must be a Buffer");if(a===void 0&&(a=0),p===void 0&&(p=o?o.length:0),k===void 0&&(k=0),N===void 0&&(N=this.length),a<0||p>o.length||k<0||N>this.length)throw new RangeError("out of range index");if(k>=N&&a>=p)return 0;if(k>=N)return-1;if(a>=p)return 1;if(a>>>=0,p>>>=0,k>>>=0,N>>>=0,this===o)return 0;for(var U=N-k,le=p-a,se=Math.min(U,le),fe=this.slice(k,N),ae=o.slice(a,p),ge=0;ge<se;++ge)if(fe[ge]!==ae[ge]){U=fe[ge],le=ae[ge];break}return U<le?-1:le<U?1:0};function z(o,a,p,k,N){if(o.length===0)return-1;if(typeof p=="string"?(k=p,p=0):p>2147483647?p=2147483647:p<-2147483648&&(p=-2147483648),p=+p,isNaN(p)&&(p=N?0:o.length-1),p<0&&(p=o.length+p),p>=o.length){if(N)return-1;p=o.length-1}else if(p<0)if(N)p=0;else return-1;if(typeof a=="string"&&(a=i.from(a,k)),i.isBuffer(a))return a.length===0?-1:H(o,a,p,k,N);if(typeof a=="number")return a=a&255,i.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?N?Uint8Array.prototype.indexOf.call(o,a,p):Uint8Array.prototype.lastIndexOf.call(o,a,p):H(o,[a],p,k,N);throw new TypeError("val must be string, number or Buffer")}function H(o,a,p,k,N){var U=1,le=o.length,se=a.length;if(k!==void 0&&(k=String(k).toLowerCase(),k==="ucs2"||k==="ucs-2"||k==="utf16le"||k==="utf-16le")){if(o.length<2||a.length<2)return-1;U=2,le/=2,se/=2,p/=2}function fe(xe,_e){return U===1?xe[_e]:xe.readUInt16BE(_e*U)}var ae;if(N){var ge=-1;for(ae=p;ae<le;ae++)if(fe(o,ae)===fe(a,ge===-1?0:ae-ge)){if(ge===-1&&(ge=ae),ae-ge+1===se)return ge*U}else ge!==-1&&(ae-=ae-ge),ge=-1}else for(p+se>le&&(p=le-se),ae=p;ae>=0;ae--){for(var ve=!0,pe=0;pe<se;pe++)if(fe(o,ae+pe)!==fe(a,pe)){ve=!1;break}if(ve)return ae}return-1}i.prototype.includes=function(o,a,p){return this.indexOf(o,a,p)!==-1},i.prototype.indexOf=function(o,a,p){return z(this,o,a,p,!0)},i.prototype.lastIndexOf=function(o,a,p){return z(this,o,a,p,!1)};function F(o,a,p,k){p=Number(p)||0;var N=o.length-p;k?(k=Number(k),k>N&&(k=N)):k=N;var U=a.length;if(U%2!==0)throw new TypeError("Invalid hex string");k>U/2&&(k=U/2);for(var le=0;le<k;++le){var se=parseInt(a.substr(le*2,2),16);if(isNaN(se))return le;o[p+le]=se}return le}function $(o,a,p,k){return I(O(a,o.length-p),o,p,k)}function te(o,a,p,k){return I(L(a),o,p,k)}function X(o,a,p,k){return te(o,a,p,k)}function q(o,a,p,k){return I(Y(a),o,p,k)}function ue(o,a,p,k){return I(j(a,o.length-p),o,p,k)}i.prototype.write=function(o,a,p,k){if(a===void 0)k="utf8",p=this.length,a=0;else if(p===void 0&&typeof a=="string")k=a,p=this.length,a=0;else if(isFinite(a))a=a|0,isFinite(p)?(p=p|0,k===void 0&&(k="utf8")):(k=p,p=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var N=this.length-a;if((p===void 0||p>N)&&(p=N),o.length>0&&(p<0||a<0)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds");k||(k="utf8");for(var U=!1;;)switch(k){case"hex":return F(this,o,a,p);case"utf8":case"utf-8":return $(this,o,a,p);case"ascii":return te(this,o,a,p);case"latin1":case"binary":return X(this,o,a,p);case"base64":return q(this,o,a,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ue(this,o,a,p);default:if(U)throw new TypeError("Unknown encoding: "+k);k=(""+k).toLowerCase(),U=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function de(o,a,p){return a===0&&p===o.length?e.fromByteArray(o):e.fromByteArray(o.slice(a,p))}function D(o,a,p){p=Math.min(o.length,p);for(var k=[],N=a;N<p;){var U=o[N],le=null,se=U>239?4:U>223?3:U>191?2:1;if(N+se<=p){var fe,ae,ge,ve;switch(se){case 1:U<128&&(le=U);break;case 2:fe=o[N+1],(fe&192)===128&&(ve=(U&31)<<6|fe&63,ve>127&&(le=ve));break;case 3:fe=o[N+1],ae=o[N+2],(fe&192)===128&&(ae&192)===128&&(ve=(U&15)<<12|(fe&63)<<6|ae&63,ve>2047&&(ve<55296||ve>57343)&&(le=ve));break;case 4:fe=o[N+1],ae=o[N+2],ge=o[N+3],(fe&192)===128&&(ae&192)===128&&(ge&192)===128&&(ve=(U&15)<<18|(fe&63)<<12|(ae&63)<<6|ge&63,ve>65535&&ve<1114112&&(le=ve))}}le===null?(le=65533,se=1):le>65535&&(le-=65536,k.push(le>>>10&1023|55296),le=56320|le&1023),k.push(le),N+=se}return v(k)}var C=4096;function v(o){var a=o.length;if(a<=C)return String.fromCharCode.apply(String,o);for(var p="",k=0;k<a;)p+=String.fromCharCode.apply(String,o.slice(k,k+=C));return p}function u(o,a,p){var k="";p=Math.min(o.length,p);for(var N=a;N<p;++N)k+=String.fromCharCode(o[N]&127);return k}function c(o,a,p){var k="";p=Math.min(o.length,p);for(var N=a;N<p;++N)k+=String.fromCharCode(o[N]);return k}function g(o,a,p){var k=o.length;(!a||a<0)&&(a=0),(!p||p<0||p>k)&&(p=k);for(var N="",U=a;U<p;++U)N+=ie(o[U]);return N}function l(o,a,p){for(var k=o.slice(a,p),N="",U=0;U<k.length;U+=2)N+=String.fromCharCode(k[U]+k[U+1]*256);return N}i.prototype.slice=function(o,a){var p=this.length;o=~~o,a=a===void 0?p:~~a,o<0?(o+=p,o<0&&(o=0)):o>p&&(o=p),a<0?(a+=p,a<0&&(a=0)):a>p&&(a=p),a<o&&(a=o);var k;if(i.TYPED_ARRAY_SUPPORT)k=this.subarray(o,a),k.__proto__=i.prototype;else{var N=a-o;k=new i(N,void 0);for(var U=0;U<N;++U)k[U]=this[U+o]}return k};function h(o,a,p){if(o%1!==0||o<0)throw new RangeError("offset is not uint");if(o+a>p)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUIntLE=function(o,a,p){o=o|0,a=a|0,p||h(o,a,this.length);for(var k=this[o],N=1,U=0;++U<a&&(N*=256);)k+=this[o+U]*N;return k},i.prototype.readUIntBE=function(o,a,p){o=o|0,a=a|0,p||h(o,a,this.length);for(var k=this[o+--a],N=1;a>0&&(N*=256);)k+=this[o+--a]*N;return k},i.prototype.readUInt8=function(o,a){return a||h(o,1,this.length),this[o]},i.prototype.readUInt16LE=function(o,a){return a||h(o,2,this.length),this[o]|this[o+1]<<8},i.prototype.readUInt16BE=function(o,a){return a||h(o,2,this.length),this[o]<<8|this[o+1]},i.prototype.readUInt32LE=function(o,a){return a||h(o,4,this.length),(this[o]|this[o+1]<<8|this[o+2]<<16)+this[o+3]*16777216},i.prototype.readUInt32BE=function(o,a){return a||h(o,4,this.length),this[o]*16777216+(this[o+1]<<16|this[o+2]<<8|this[o+3])},i.prototype.readIntLE=function(o,a,p){o=o|0,a=a|0,p||h(o,a,this.length);for(var k=this[o],N=1,U=0;++U<a&&(N*=256);)k+=this[o+U]*N;return N*=128,k>=N&&(k-=Math.pow(2,8*a)),k},i.prototype.readIntBE=function(o,a,p){o=o|0,a=a|0,p||h(o,a,this.length);for(var k=a,N=1,U=this[o+--k];k>0&&(N*=256);)U+=this[o+--k]*N;return N*=128,U>=N&&(U-=Math.pow(2,8*a)),U},i.prototype.readInt8=function(o,a){return a||h(o,1,this.length),this[o]&128?(255-this[o]+1)*-1:this[o]},i.prototype.readInt16LE=function(o,a){a||h(o,2,this.length);var p=this[o]|this[o+1]<<8;return p&32768?p|4294901760:p},i.prototype.readInt16BE=function(o,a){a||h(o,2,this.length);var p=this[o+1]|this[o]<<8;return p&32768?p|4294901760:p},i.prototype.readInt32LE=function(o,a){return a||h(o,4,this.length),this[o]|this[o+1]<<8|this[o+2]<<16|this[o+3]<<24},i.prototype.readInt32BE=function(o,a){return a||h(o,4,this.length),this[o]<<24|this[o+1]<<16|this[o+2]<<8|this[o+3]},i.prototype.readFloatLE=function(o,a){return a||h(o,4,this.length),r.read(this,o,!0,23,4)},i.prototype.readFloatBE=function(o,a){return a||h(o,4,this.length),r.read(this,o,!1,23,4)},i.prototype.readDoubleLE=function(o,a){return a||h(o,8,this.length),r.read(this,o,!0,52,8)},i.prototype.readDoubleBE=function(o,a){return a||h(o,8,this.length),r.read(this,o,!1,52,8)};function b(o,a,p,k,N,U){if(!i.isBuffer(o))throw new TypeError('"buffer" argument must be a Buffer instance');if(a>N||a<U)throw new RangeError('"value" argument is out of bounds');if(p+k>o.length)throw new RangeError("Index out of range")}i.prototype.writeUIntLE=function(o,a,p,k){if(o=+o,a=a|0,p=p|0,!k){var N=Math.pow(2,8*p)-1;b(this,o,a,p,N,0)}var U=1,le=0;for(this[a]=o&255;++le<p&&(U*=256);)this[a+le]=o/U&255;return a+p},i.prototype.writeUIntBE=function(o,a,p,k){if(o=+o,a=a|0,p=p|0,!k){var N=Math.pow(2,8*p)-1;b(this,o,a,p,N,0)}var U=p-1,le=1;for(this[a+U]=o&255;--U>=0&&(le*=256);)this[a+U]=o/le&255;return a+p},i.prototype.writeUInt8=function(o,a,p){return o=+o,a=a|0,p||b(this,o,a,1,255,0),i.TYPED_ARRAY_SUPPORT||(o=Math.floor(o)),this[a]=o&255,a+1};function T(o,a,p,k){a<0&&(a=65535+a+1);for(var N=0,U=Math.min(o.length-p,2);N<U;++N)o[p+N]=(a&255<<8*(k?N:1-N))>>>(k?N:1-N)*8}i.prototype.writeUInt16LE=function(o,a,p){return o=+o,a=a|0,p||b(this,o,a,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[a]=o&255,this[a+1]=o>>>8):T(this,o,a,!0),a+2},i.prototype.writeUInt16BE=function(o,a,p){return o=+o,a=a|0,p||b(this,o,a,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[a]=o>>>8,this[a+1]=o&255):T(this,o,a,!1),a+2};function R(o,a,p,k){a<0&&(a=4294967295+a+1);for(var N=0,U=Math.min(o.length-p,4);N<U;++N)o[p+N]=a>>>(k?N:3-N)*8&255}i.prototype.writeUInt32LE=function(o,a,p){return o=+o,a=a|0,p||b(this,o,a,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[a+3]=o>>>24,this[a+2]=o>>>16,this[a+1]=o>>>8,this[a]=o&255):R(this,o,a,!0),a+4},i.prototype.writeUInt32BE=function(o,a,p){return o=+o,a=a|0,p||b(this,o,a,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[a]=o>>>24,this[a+1]=o>>>16,this[a+2]=o>>>8,this[a+3]=o&255):R(this,o,a,!1),a+4},i.prototype.writeIntLE=function(o,a,p,k){if(o=+o,a=a|0,!k){var N=Math.pow(2,8*p-1);b(this,o,a,p,N-1,-N)}var U=0,le=1,se=0;for(this[a]=o&255;++U<p&&(le*=256);)o<0&&se===0&&this[a+U-1]!==0&&(se=1),this[a+U]=(o/le>>0)-se&255;return a+p},i.prototype.writeIntBE=function(o,a,p,k){if(o=+o,a=a|0,!k){var N=Math.pow(2,8*p-1);b(this,o,a,p,N-1,-N)}var U=p-1,le=1,se=0;for(this[a+U]=o&255;--U>=0&&(le*=256);)o<0&&se===0&&this[a+U+1]!==0&&(se=1),this[a+U]=(o/le>>0)-se&255;return a+p},i.prototype.writeInt8=function(o,a,p){return o=+o,a=a|0,p||b(this,o,a,1,127,-128),i.TYPED_ARRAY_SUPPORT||(o=Math.floor(o)),o<0&&(o=255+o+1),this[a]=o&255,a+1},i.prototype.writeInt16LE=function(o,a,p){return o=+o,a=a|0,p||b(this,o,a,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[a]=o&255,this[a+1]=o>>>8):T(this,o,a,!0),a+2},i.prototype.writeInt16BE=function(o,a,p){return o=+o,a=a|0,p||b(this,o,a,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[a]=o>>>8,this[a+1]=o&255):T(this,o,a,!1),a+2},i.prototype.writeInt32LE=function(o,a,p){return o=+o,a=a|0,p||b(this,o,a,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[a]=o&255,this[a+1]=o>>>8,this[a+2]=o>>>16,this[a+3]=o>>>24):R(this,o,a,!0),a+4},i.prototype.writeInt32BE=function(o,a,p){return o=+o,a=a|0,p||b(this,o,a,4,2147483647,-2147483648),o<0&&(o=4294967295+o+1),i.TYPED_ARRAY_SUPPORT?(this[a]=o>>>24,this[a+1]=o>>>16,this[a+2]=o>>>8,this[a+3]=o&255):R(this,o,a,!1),a+4};function K(o,a,p,k,N,U){if(p+k>o.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("Index out of range")}function Z(o,a,p,k,N){return N||K(o,a,p,4),r.write(o,a,p,k,23,4),p+4}i.prototype.writeFloatLE=function(o,a,p){return Z(this,o,a,!0,p)},i.prototype.writeFloatBE=function(o,a,p){return Z(this,o,a,!1,p)};function ne(o,a,p,k,N){return N||K(o,a,p,8),r.write(o,a,p,k,52,8),p+8}i.prototype.writeDoubleLE=function(o,a,p){return ne(this,o,a,!0,p)},i.prototype.writeDoubleBE=function(o,a,p){return ne(this,o,a,!1,p)},i.prototype.copy=function(o,a,p,k){if(p||(p=0),!k&&k!==0&&(k=this.length),a>=o.length&&(a=o.length),a||(a=0),k>0&&k<p&&(k=p),k===p||o.length===0||this.length===0)return 0;if(a<0)throw new RangeError("targetStart out of bounds");if(p<0||p>=this.length)throw new RangeError("sourceStart out of bounds");if(k<0)throw new RangeError("sourceEnd out of bounds");k>this.length&&(k=this.length),o.length-a<k-p&&(k=o.length-a+p);var N=k-p,U;if(this===o&&p<a&&a<k)for(U=N-1;U>=0;--U)o[U+a]=this[U+p];else if(N<1e3||!i.TYPED_ARRAY_SUPPORT)for(U=0;U<N;++U)o[U+a]=this[U+p];else Uint8Array.prototype.set.call(o,this.subarray(p,p+N),a);return N},i.prototype.fill=function(o,a,p,k){if(typeof o=="string"){if(typeof a=="string"?(k=a,a=0,p=this.length):typeof p=="string"&&(k=p,p=this.length),o.length===1){var N=o.charCodeAt(0);N<256&&(o=N)}if(k!==void 0&&typeof k!="string")throw new TypeError("encoding must be a string");if(typeof k=="string"&&!i.isEncoding(k))throw new TypeError("Unknown encoding: "+k)}else typeof o=="number"&&(o=o&255);if(a<0||this.length<a||this.length<p)throw new RangeError("Out of range index");if(p<=a)return this;a=a>>>0,p=p===void 0?this.length:p>>>0,o||(o=0);var U;if(typeof o=="number")for(U=a;U<p;++U)this[U]=o;else{var le=i.isBuffer(o)?o:O(new i(o,k).toString()),se=le.length;for(U=0;U<p-a;++U)this[U+a]=le[U%se]}return this};var V=/[^+\/0-9A-Za-z-_]/g;function oe(o){if(o=ee(o).replace(V,""),o.length<2)return"";for(;o.length%4!==0;)o=o+"=";return o}function ee(o){return o.trim?o.trim():o.replace(/^\s+|\s+$/g,"")}function ie(o){return o<16?"0"+o.toString(16):o.toString(16)}function O(o,a){a=a||1/0;for(var p,k=o.length,N=null,U=[],le=0;le<k;++le){if(p=o.charCodeAt(le),p>55295&&p<57344){if(!N){if(p>56319){(a-=3)>-1&&U.push(239,191,189);continue}else if(le+1===k){(a-=3)>-1&&U.push(239,191,189);continue}N=p;continue}if(p<56320){(a-=3)>-1&&U.push(239,191,189),N=p;continue}p=(N-55296<<10|p-56320)+65536}else N&&(a-=3)>-1&&U.push(239,191,189);if(N=null,p<128){if((a-=1)<0)break;U.push(p)}else if(p<2048){if((a-=2)<0)break;U.push(p>>6|192,p&63|128)}else if(p<65536){if((a-=3)<0)break;U.push(p>>12|224,p>>6&63|128,p&63|128)}else if(p<1114112){if((a-=4)<0)break;U.push(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}else throw new Error("Invalid code point")}return U}function L(o){for(var a=[],p=0;p<o.length;++p)a.push(o.charCodeAt(p)&255);return a}function j(o,a){for(var p,k,N,U=[],le=0;le<o.length&&!((a-=2)<0);++le)p=o.charCodeAt(le),k=p>>8,N=p%256,U.push(N),U.push(k);return U}function Y(o){return e.toByteArray(oe(o))}function I(o,a,p,k){for(var N=0;N<k&&!(N+p>=a.length||N>=o.length);++N)a[N+p]=o[N];return N}function ce(o){return o!==o}}(Zn)),Zn}vi();var ft;if(typeof window<"u"&&window.crypto&&(ft=window.crypto),!ft&&typeof window<"u"&&window.msCrypto&&(ft=window.msCrypto),!ft&&typeof global<"u"&&global.crypto&&(ft=global.crypto),!ft&&typeof require=="function")try{ft=require("crypto")}catch{}var ro={};/*! *****************************************************************************
92
92
  Copyright (c) Microsoft Corporation.
93
93
 
94
94
  Permission to use, copy, modify, and/or distribute this software for any
@@ -101,18 +101,18 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
101
101
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
102
102
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
103
103
  PERFORMANCE OF THIS SOFTWARE.
104
- ***************************************************************************** */var Yr=function(t,e){return Yr=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])},Yr(t,e)};function pi(t,e){Yr(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Ir=function(){return Ir=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},Ir.apply(this,arguments)};function gi(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 mi(t,e,r,n){var s=arguments.length,d=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(t,e,r,n);else for(var i=t.length-1;i>=0;i--)(f=t[i])&&(d=(s<3?f(d):s>3?f(e,r,d):f(e,r))||d);return s>3&&d&&Object.defineProperty(e,r,d),d}function yi(t,e){return function(r,n){e(r,n,t)}}function vi(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function bi(t,e,r,n){function s(d){return d instanceof r?d:new r(function(f){f(d)})}return new(r||(r=Promise))(function(d,f){function i(_){try{y(n.next(_))}catch(M){f(M)}}function m(_){try{y(n.throw(_))}catch(M){f(M)}}function y(_){_.done?d(_.value):s(_.value).then(i,m)}y((n=n.apply(t,e||[])).next())})}function wi(t,e){var r={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},n,s,d,f;return f={next:i(0),throw:i(1),return:i(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function i(y){return function(_){return m([y,_])}}function m(y){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,s&&(d=y[0]&2?s.return:y[0]?s.throw||((d=s.return)&&d.call(s),0):s.next)&&!(d=d.call(s,y[1])).done)return d;switch(s=0,d&&(y=[y[0]&2,d.value]),y[0]){case 0:case 1:d=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(d=r.trys,!(d=d.length>0&&d[d.length-1])&&(y[0]===6||y[0]===2)){r=0;continue}if(y[0]===3&&(!d||y[1]>d[0]&&y[1]<d[3])){r.label=y[1];break}if(y[0]===6&&r.label<d[1]){r.label=d[1],d=y;break}if(d&&r.label<d[2]){r.label=d[2],r.ops.push(y);break}d[2]&&r.ops.pop(),r.trys.pop();continue}y=e.call(t,r)}catch(_){y=[6,_],s=0}finally{n=d=0}if(y[0]&5)throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}}function _i(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function xi(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function zr(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 ro(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),s,d=[],f;try{for(;(e===void 0||e-- >0)&&!(s=n.next()).done;)d.push(s.value)}catch(i){f={error:i}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(f)throw f.error}}return d}function Ci(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(ro(arguments[e]));return t}function Si(){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 d=arguments[e],f=0,i=d.length;f<i;f++,s++)n[s]=d[f];return n}function Et(t){return this instanceof Et?(this.v=t,this):new Et(t)}function Di(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),s,d=[];return s={},f("next"),f("throw"),f("return"),s[Symbol.asyncIterator]=function(){return this},s;function f(x){n[x]&&(s[x]=function(D){return new Promise(function(P,A){d.push([x,D,P,A])>1||i(x,D)})})}function i(x,D){try{m(n[x](D))}catch(P){M(d[0][3],P)}}function m(x){x.value instanceof Et?Promise.resolve(x.value.v).then(y,_):M(d[0][2],x)}function y(x){i("next",x)}function _(x){i("throw",x)}function M(x,D){x(D),d.shift(),d.length&&i(d[0][0],d[0][1])}}function ki(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,d){e[s]=t[s]?function(f){return(r=!r)?{value:Et(t[s](f)),done:s==="return"}:d?d(f):f}:d}}function Mi(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 zr=="function"?zr(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(d){r[d]=t[d]&&function(f){return new Promise(function(i,m){f=t[d](f),s(i,m,f.done,f.value)})}}function s(d,f,i,m){Promise.resolve(m).then(function(y){d({value:y,done:i})},f)}}function Pi(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Oi(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 Ai(t){return t&&t.__esModule?t:{default:t}}function Ti(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Ei(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 ji=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Ir},__asyncDelegator:ki,__asyncGenerator:Di,__asyncValues:Mi,__await:Et,__awaiter:bi,__classPrivateFieldGet:Ti,__classPrivateFieldSet:Ei,__createBinding:_i,__decorate:mi,__exportStar:xi,__extends:pi,__generator:wi,__importDefault:Ai,__importStar:Oi,__makeTemplateObject:Pi,__metadata:vi,__param:yi,__read:ro,__rest:gi,__spread:Ci,__spreadArrays:Si,__values:zr},Symbol.toStringTag,{value:"Module"})),no=jr(ji);var jt={},ze={},oo;function so(){return oo||(oo=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.MAX_HASHABLE_LENGTH=ze.INIT=ze.KEY=ze.DIGEST_LENGTH=ze.BLOCK_SIZE=void 0,ze.BLOCK_SIZE=64,ze.DIGEST_LENGTH=32,ze.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]),ze.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],ze.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1),ze}var Rt={},io;function Ri(){if(io)return Rt;io=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.RawSha256=void 0;var t=so(),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,d=n.byteLength;if(this.bytesHashed+=d,this.bytesHashed*8>t.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;d>0;)this.buffer[this.bufferLength++]=n[s++],d--,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),d=this.bufferLength;if(s.setUint8(this.bufferLength++,128),d%t.BLOCK_SIZE>=t.BLOCK_SIZE-8){for(var f=this.bufferLength;f<t.BLOCK_SIZE;f++)s.setUint8(f,0);this.hashBuffer(),this.bufferLength=0}for(var f=this.bufferLength;f<t.BLOCK_SIZE-8;f++)s.setUint8(f,0);s.setUint32(t.BLOCK_SIZE-8,Math.floor(n/4294967296),!0),s.setUint32(t.BLOCK_SIZE-4,n),this.hashBuffer(),this.finished=!0}for(var i=new Uint8Array(t.DIGEST_LENGTH),f=0;f<8;f++)i[f*4]=this.state[f]>>>24&255,i[f*4+1]=this.state[f]>>>16&255,i[f*4+2]=this.state[f]>>>8&255,i[f*4+3]=this.state[f]>>>0&255;return i},r.prototype.hashBuffer=function(){for(var n=this,s=n.buffer,d=n.state,f=d[0],i=d[1],m=d[2],y=d[3],_=d[4],M=d[5],x=d[6],D=d[7],P=0;P<t.BLOCK_SIZE;P++){if(P<16)this.temp[P]=(s[P*4]&255)<<24|(s[P*4+1]&255)<<16|(s[P*4+2]&255)<<8|s[P*4+3]&255;else{var A=this.temp[P-2],B=(A>>>17|A<<15)^(A>>>19|A<<13)^A>>>10;A=this.temp[P-15];var Q=(A>>>7|A<<25)^(A>>>18|A<<14)^A>>>3;this.temp[P]=(B+this.temp[P-7]|0)+(Q+this.temp[P-16]|0)}var W=(((_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&M^~_&x)|0)+(D+(t.KEY[P]+this.temp[P]|0)|0)|0,G=((f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10))+(f&i^f&m^i&m)|0;D=x,x=M,M=_,_=y+W|0,y=m,m=i,i=f,f=W+G|0}d[0]+=f,d[1]+=i,d[2]+=m,d[3]+=y,d[4]+=_,d[5]+=M,d[6]+=x,d[7]+=D},r}();return Rt.RawSha256=e,Rt}var ao={},Nt={};const Ni=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 d=65536+((s&1023)<<10)+(t.charCodeAt(++r)&1023);e.push(d>>18|240,d>>12&63|128,d>>6&63|128,d&63|128)}else e.push(s>>12|224,s>>6&63|128,s&63|128)}return Uint8Array.from(e)},$i=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 d=t[++r];e+=String.fromCharCode((s&31)<<6|d&63)}else if(240<=s&&s<365){const d="%"+[s,t[++r],t[++r],t[++r]].map(f=>f.toString(16)).join("%");e+=decodeURIComponent(d)}else e+=String.fromCharCode((s&15)<<12|(t[++r]&63)<<6|t[++r]&63)}return e};function Li(t){return new TextEncoder().encode(t)}function Bi(t){return new TextDecoder("utf-8").decode(t)}const Yi=t=>typeof TextEncoder=="function"?Li(t):Ni(t),Ii=t=>typeof TextDecoder=="function"?Bi(t):$i(t),zi=Object.freeze(Object.defineProperty({__proto__:null,fromUtf8:Yi,toUtf8:Ii},Symbol.toStringTag,{value:"Module"})),Fi=jr(zi);var lo;function Ui(){if(lo)return Nt;lo=1,Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.convertToBuffer=void 0;var t=Fi,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 Nt.convertToBuffer=r,Nt}var $t={},uo;function qi(){if(uo)return $t;uo=1,Object.defineProperty($t,"__esModule",{value:!0}),$t.isEmptyData=void 0;function t(e){return typeof e=="string"?e.length===0:e.byteLength===0}return $t.isEmptyData=t,$t}var Lt={},co;function Wi(){if(co)return Lt;co=1,Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.numToUint8=void 0;function t(e){return new Uint8Array([(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255])}return Lt.numToUint8=t,Lt}var Bt={},ho;function Vi(){if(ho)return Bt;ho=1,Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.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 Bt.uint32ArrayFrom=t,Bt}var fo;function Hi(){return fo||(fo=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=t.numToUint8=t.isEmptyData=t.convertToBuffer=void 0;var e=Ui();Object.defineProperty(t,"convertToBuffer",{enumerable:!0,get:function(){return e.convertToBuffer}});var r=qi();Object.defineProperty(t,"isEmptyData",{enumerable:!0,get:function(){return r.isEmptyData}});var n=Wi();Object.defineProperty(t,"numToUint8",{enumerable:!0,get:function(){return n.numToUint8}});var s=Vi();Object.defineProperty(t,"uint32ArrayFrom",{enumerable:!0,get:function(){return s.uint32ArrayFrom}})}(ao)),ao}var po;function Gi(){if(po)return jt;po=1,Object.defineProperty(jt,"__esModule",{value:!0}),jt.Sha256=void 0;var t=no,e=so(),r=Ri(),n=Hi(),s=function(){function f(i){if(this.hash=new r.RawSha256,i){this.outer=new r.RawSha256;var m=d(i),y=new Uint8Array(e.BLOCK_SIZE);y.set(m);for(var _=0;_<e.BLOCK_SIZE;_++)m[_]^=54,y[_]^=92;this.hash.update(m),this.outer.update(y);for(var _=0;_<m.byteLength;_++)m[_]=0}}return f.prototype.update=function(i){if(!((0,n.isEmptyData)(i)||this.error))try{this.hash.update((0,n.convertToBuffer)(i))}catch(m){this.error=m}},f.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()},f.prototype.digest=function(){return(0,t.__awaiter)(this,void 0,void 0,function(){return(0,t.__generator)(this,function(i){return[2,this.digestSync()]})})},f}();jt.Sha256=s;function d(f){var i=(0,n.convertToBuffer)(f);if(i.byteLength>e.BLOCK_SIZE){var m=new r.RawSha256;m.update(i),i=m.digest()}var y=new Uint8Array(e.BLOCK_SIZE);return y.set(i),y}return jt}var go;function Qi(){return go||(go=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=no;(0,e.__exportStar)(Gi(),t)}(to)),to}Qi();function ye(t,e){t!=null&&this.fromString(t,e)}function $e(){return new ye(null)}var st,Ki=0xdeadbeefcafe,mo=(Ki&16777215)==15715070;function Zi(t,e,r,n,s,d){for(;--d>=0;){var f=e*this[t++]+r[n]+s;s=Math.floor(f/67108864),r[n++]=f&67108863}return s}function Ji(t,e,r,n,s,d){for(var f=e&32767,i=e>>15;--d>=0;){var m=this[t]&32767,y=this[t++]>>15,_=i*m+y*f;m=f*m+((_&32767)<<15)+r[n]+(s&1073741823),s=(m>>>30)+(_>>>15)+i*y+(s>>>30),r[n++]=m&1073741823}return s}function Xi(t,e,r,n,s,d){for(var f=e&16383,i=e>>14;--d>=0;){var m=this[t]&16383,y=this[t++]>>14,_=i*m+y*f;m=f*m+((_&16383)<<14)+r[n]+s,s=(m>>28)+(_>>14)+i*y,r[n++]=m&268435455}return s}var yo=typeof navigator<"u";yo&&mo&&navigator.appName=="Microsoft Internet Explorer"?(ye.prototype.am=Ji,st=30):yo&&mo&&navigator.appName!="Netscape"?(ye.prototype.am=Zi,st=26):(ye.prototype.am=Xi,st=28),ye.prototype.DB=st,ye.prototype.DM=(1<<st)-1,ye.prototype.DV=1<<st;var Fr=52;ye.prototype.FV=Math.pow(2,Fr),ye.prototype.F1=Fr-st,ye.prototype.F2=2*st-Fr;var ea="0123456789abcdefghijklmnopqrstuvwxyz",Zt=new Array,vt,Fe;for(vt=48,Fe=0;Fe<=9;++Fe)Zt[vt++]=Fe;for(vt=97,Fe=10;Fe<36;++Fe)Zt[vt++]=Fe;for(vt=65,Fe=10;Fe<36;++Fe)Zt[vt++]=Fe;function vo(t){return ea.charAt(t)}function ta(t,e){var r=Zt[t.charCodeAt(e)];return r??-1}function ra(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function na(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 Ur(t){var e=$e();return e.fromInt(t),e}function oa(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,d=0;--n>=0;){var f=ta(t,n);if(f<0){t.charAt(n)=="-"&&(s=!0);continue}s=!1,d==0?this[this.t++]=f:d+r>this.DB?(this[this.t-1]|=(f&(1<<this.DB-d)-1)<<d,this[this.t++]=f>>this.DB-d):this[this.t-1]|=f<<d,d+=r,d>=this.DB&&(d-=this.DB)}this.clamp(),s&&ye.ZERO.subTo(this,this)}function sa(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function ia(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,d="",f=this.t,i=this.DB-f*this.DB%e;if(f-- >0)for(i<this.DB&&(n=this[f]>>i)>0&&(s=!0,d=vo(n));f>=0;)i<e?(n=(this[f]&(1<<i)-1)<<e-i,n|=this[--f]>>(i+=this.DB-e)):(n=this[f]>>(i-=e)&r,i<=0&&(i+=this.DB,--f)),n>0&&(s=!0),s&&(d+=vo(n));return s?d:"0"}function aa(){var t=$e();return ye.ZERO.subTo(this,t),t}function la(){return this.s<0?this.negate():this}function ua(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 ca(){return this.t<=0?0:this.DB*(this.t-1)+qr(this[this.t-1]^this.s&this.DM)}function da(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 ha(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 fa(t,e){var r=t%this.DB,n=this.DB-r,s=(1<<n)-1,d=Math.floor(t/this.DB),f=this.s<<r&this.DM,i;for(i=this.t-1;i>=0;--i)e[i+d+1]=this[i]>>n|f,f=(this[i]&s)<<r;for(i=d-1;i>=0;--i)e[i]=0;e[d]=f,e.t=this.t+d+1,e.s=this.s,e.clamp()}function pa(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,d=(1<<n)-1;e[0]=this[r]>>n;for(var f=r+1;f<this.t;++f)e[f-r-1]|=(this[f]&d)<<s,e[f-r]=this[f]>>n;n>0&&(e[this.t-r-1]|=(this.s&d)<<s),e.t=this.t-r,e.clamp()}function ga(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 ma(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 ya(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 va(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=$e());var d=$e(),f=this.s,i=t.s,m=this.DB-qr(n[n.t-1]);m>0?(n.lShiftTo(m,d),s.lShiftTo(m,r)):(n.copyTo(d),s.copyTo(r));var y=d.t,_=d[y-1];if(_!=0){var M=_*(1<<this.F1)+(y>1?d[y-2]>>this.F2:0),x=this.FV/M,D=(1<<this.F1)/M,P=1<<this.F2,A=r.t,B=A-y,Q=e??$e();for(d.dlShiftTo(B,Q),r.compareTo(Q)>=0&&(r[r.t++]=1,r.subTo(Q,r)),ye.ONE.dlShiftTo(y,Q),Q.subTo(d,d);d.t<y;)d[d.t++]=0;for(;--B>=0;){var W=r[--A]==_?this.DM:Math.floor(r[A]*x+(r[A-1]+P)*D);if((r[A]+=d.am(0,W,r,B,0,y))<W)for(d.dlShiftTo(B,Q),r.subTo(Q,r);r[A]<--W;)r.subTo(Q,r)}e!=null&&(r.drShiftTo(y,e),f!=i&&ye.ZERO.subTo(e,e)),r.t=y,r.clamp(),m>0&&r.rShiftTo(m,r),f<0&&ye.ZERO.subTo(r,r)}}}function ba(t){var e=$e();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(ye.ZERO)>0&&t.subTo(e,e),e}function wa(){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 _a(t){return this.compareTo(t)==0}function xa(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 Ca(t){var e=$e();return this.addTo(t,e),e}function Sa(t){var e=$e();return this.subTo(t,e),e}function Da(t){var e=$e();return this.multiplyTo(t,e),e}function ka(t){var e=$e();return this.divRemTo(t,e,null),e}function bt(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 Ma(t){var e=$e();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 Pa(t){var e=$e();return t.copyTo(e),this.reduce(e),e}function Oa(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 Aa(t,e){t.squareTo(e),this.reduce(e)}function Ta(t,e,r){t.multiplyTo(e,r),this.reduce(r)}bt.prototype.convert=Ma,bt.prototype.revert=Pa,bt.prototype.reduce=Oa,bt.prototype.mulTo=Ta,bt.prototype.sqrTo=Aa;function Ea(t,e,r){var n=t.bitLength(),s,d=Ur(1),f=new bt(e);if(n<=0)return d;n<18?s=1:n<48?s=3:n<144?s=4:n<768?s=5:s=6;var i=new Array,m=3,y=s-1,_=(1<<s)-1;if(i[1]=f.convert(this),s>1){var M=$e();for(f.sqrTo(i[1],M);m<=_;)i[m]=$e(),f.mulTo(M,i[m-2],i[m]),m+=2}var x=t.t-1,D,P=!0,A=$e(),B;for(n=qr(t[x])-1;x>=0;){for(n>=y?D=t[x]>>n-y&_:(D=(t[x]&(1<<n+1)-1)<<y-n,x>0&&(D|=t[x-1]>>this.DB+n-y)),m=s;(D&1)==0;)D>>=1,--m;if((n-=m)<0&&(n+=this.DB,--x),P)i[D].copyTo(d),P=!1;else{for(;m>1;)f.sqrTo(d,A),f.sqrTo(A,d),m-=2;m>0?f.sqrTo(d,A):(B=d,d=A,A=B),f.mulTo(A,i[D],d)}for(;x>=0&&(t[x]&1<<n)==0;)f.sqrTo(d,A),B=d,d=A,A=B,--n<0&&(n=this.DB-1,--x)}var Q=f.revert(d);return r(null,Q),Q}ye.prototype.copyTo=ra,ye.prototype.fromInt=na,ye.prototype.fromString=oa,ye.prototype.clamp=sa,ye.prototype.dlShiftTo=da,ye.prototype.drShiftTo=ha,ye.prototype.lShiftTo=fa,ye.prototype.rShiftTo=pa,ye.prototype.subTo=ga,ye.prototype.multiplyTo=ma,ye.prototype.squareTo=ya,ye.prototype.divRemTo=va,ye.prototype.invDigit=wa,ye.prototype.addTo=xa,ye.prototype.toString=ia,ye.prototype.negate=aa,ye.prototype.abs=la,ye.prototype.compareTo=ua,ye.prototype.bitLength=ca,ye.prototype.mod=ba,ye.prototype.equals=_a,ye.prototype.add=Ca,ye.prototype.subtract=Sa,ye.prototype.multiply=Da,ye.prototype.divide=ka,ye.prototype.modPow=Ea,ye.ZERO=Ur(0),ye.ONE=Ur(1);function ja(t,e){return e=e||{},new Promise(function(r,n){var s=new XMLHttpRequest,d=[],f=[],i={},m=function(){return{ok:(s.status/100|0)==2,statusText:s.statusText,status:s.status,url:s.responseURL,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(s.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([s.response]))},clone:m,headers:{keys:function(){return d},entries:function(){return f},get:function(_){return i[_.toLowerCase()]},has:function(_){return _.toLowerCase()in i}}}};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){d.push(M=M.toLowerCase()),f.push([M,x]),i[M]=i[M]?i[M]+","+x:x}),r(m())},s.onerror=n,s.withCredentials=e.credentials=="include",e.headers)s.setRequestHeader(y,e.headers[y]);s.send(e.body||null)})}const Ra=Object.freeze(Object.defineProperty({__proto__:null,default:ja},Symbol.toStringTag,{value:"Module"})),bo=jr(Ra);var wo,_o;function Na(){return _o||(_o=1,wo=self.fetch||(self.fetch=bo.default||bo)),wo}Na();/*!
104
+ ***************************************************************************** */var Yr=function(t,e){return Yr=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])},Yr(t,e)};function bi(t,e){Yr(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var zr=function(){return zr=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},zr.apply(this,arguments)};function wi(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 _i(t,e,r,n){var s=arguments.length,d=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(t,e,r,n);else for(var i=t.length-1;i>=0;i--)(f=t[i])&&(d=(s<3?f(d):s>3?f(e,r,d):f(e,r))||d);return s>3&&d&&Object.defineProperty(e,r,d),d}function xi(t,e){return function(r,n){e(r,n,t)}}function Ci(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Si(t,e,r,n){function s(d){return d instanceof r?d:new r(function(f){f(d)})}return new(r||(r=Promise))(function(d,f){function i(_){try{y(n.next(_))}catch(M){f(M)}}function m(_){try{y(n.throw(_))}catch(M){f(M)}}function y(_){_.done?d(_.value):s(_.value).then(i,m)}y((n=n.apply(t,e||[])).next())})}function Di(t,e){var r={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},n,s,d,f;return f={next:i(0),throw:i(1),return:i(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function i(y){return function(_){return m([y,_])}}function m(y){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,s&&(d=y[0]&2?s.return:y[0]?s.throw||((d=s.return)&&d.call(s),0):s.next)&&!(d=d.call(s,y[1])).done)return d;switch(s=0,d&&(y=[y[0]&2,d.value]),y[0]){case 0:case 1:d=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(d=r.trys,!(d=d.length>0&&d[d.length-1])&&(y[0]===6||y[0]===2)){r=0;continue}if(y[0]===3&&(!d||y[1]>d[0]&&y[1]<d[3])){r.label=y[1];break}if(y[0]===6&&r.label<d[1]){r.label=d[1],d=y;break}if(d&&r.label<d[2]){r.label=d[2],r.ops.push(y);break}d[2]&&r.ops.pop(),r.trys.pop();continue}y=e.call(t,r)}catch(_){y=[6,_],s=0}finally{n=d=0}if(y[0]&5)throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}}function ki(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Mi(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Fr(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 no(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),s,d=[],f;try{for(;(e===void 0||e-- >0)&&!(s=n.next()).done;)d.push(s.value)}catch(i){f={error:i}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(f)throw f.error}}return d}function Pi(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(no(arguments[e]));return t}function Oi(){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 d=arguments[e],f=0,i=d.length;f<i;f++,s++)n[s]=d[f];return n}function Tt(t){return this instanceof Tt?(this.v=t,this):new Tt(t)}function Ai(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),s,d=[];return s={},f("next"),f("throw"),f("return"),s[Symbol.asyncIterator]=function(){return this},s;function f(x){n[x]&&(s[x]=function(S){return new Promise(function(P,A){d.push([x,S,P,A])>1||i(x,S)})})}function i(x,S){try{m(n[x](S))}catch(P){M(d[0][3],P)}}function m(x){x.value instanceof Tt?Promise.resolve(x.value.v).then(y,_):M(d[0][2],x)}function y(x){i("next",x)}function _(x){i("throw",x)}function M(x,S){x(S),d.shift(),d.length&&i(d[0][0],d[0][1])}}function Ei(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,d){e[s]=t[s]?function(f){return(r=!r)?{value:Tt(t[s](f)),done:s==="return"}:d?d(f):f}:d}}function Ti(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 Fr=="function"?Fr(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(d){r[d]=t[d]&&function(f){return new Promise(function(i,m){f=t[d](f),s(i,m,f.done,f.value)})}}function s(d,f,i,m){Promise.resolve(m).then(function(y){d({value:y,done:i})},f)}}function ji(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Ni(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 Ri(t){return t&&t.__esModule?t:{default:t}}function $i(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Li(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 Bi=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return zr},__asyncDelegator:Ei,__asyncGenerator:Ai,__asyncValues:Ti,__await:Tt,__awaiter:Si,__classPrivateFieldGet:$i,__classPrivateFieldSet:Li,__createBinding:ki,__decorate:_i,__exportStar:Mi,__extends:bi,__generator:Di,__importDefault:Ri,__importStar:Ni,__makeTemplateObject:ji,__metadata:Ci,__param:xi,__read:no,__rest:wi,__spread:Pi,__spreadArrays:Oi,__values:Fr},Symbol.toStringTag,{value:"Module"})),oo=Nr(Bi);var jt={},ze={},so;function io(){return so||(so=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.MAX_HASHABLE_LENGTH=ze.INIT=ze.KEY=ze.DIGEST_LENGTH=ze.BLOCK_SIZE=void 0,ze.BLOCK_SIZE=64,ze.DIGEST_LENGTH=32,ze.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]),ze.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],ze.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1),ze}var Nt={},ao;function Ii(){if(ao)return Nt;ao=1,Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.RawSha256=void 0;var t=io(),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,d=n.byteLength;if(this.bytesHashed+=d,this.bytesHashed*8>t.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;d>0;)this.buffer[this.bufferLength++]=n[s++],d--,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),d=this.bufferLength;if(s.setUint8(this.bufferLength++,128),d%t.BLOCK_SIZE>=t.BLOCK_SIZE-8){for(var f=this.bufferLength;f<t.BLOCK_SIZE;f++)s.setUint8(f,0);this.hashBuffer(),this.bufferLength=0}for(var f=this.bufferLength;f<t.BLOCK_SIZE-8;f++)s.setUint8(f,0);s.setUint32(t.BLOCK_SIZE-8,Math.floor(n/4294967296),!0),s.setUint32(t.BLOCK_SIZE-4,n),this.hashBuffer(),this.finished=!0}for(var i=new Uint8Array(t.DIGEST_LENGTH),f=0;f<8;f++)i[f*4]=this.state[f]>>>24&255,i[f*4+1]=this.state[f]>>>16&255,i[f*4+2]=this.state[f]>>>8&255,i[f*4+3]=this.state[f]>>>0&255;return i},r.prototype.hashBuffer=function(){for(var n=this,s=n.buffer,d=n.state,f=d[0],i=d[1],m=d[2],y=d[3],_=d[4],M=d[5],x=d[6],S=d[7],P=0;P<t.BLOCK_SIZE;P++){if(P<16)this.temp[P]=(s[P*4]&255)<<24|(s[P*4+1]&255)<<16|(s[P*4+2]&255)<<8|s[P*4+3]&255;else{var A=this.temp[P-2],B=(A>>>17|A<<15)^(A>>>19|A<<13)^A>>>10;A=this.temp[P-15];var Q=(A>>>7|A<<25)^(A>>>18|A<<14)^A>>>3;this.temp[P]=(B+this.temp[P-7]|0)+(Q+this.temp[P-16]|0)}var W=(((_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&M^~_&x)|0)+(S+(t.KEY[P]+this.temp[P]|0)|0)|0,G=((f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10))+(f&i^f&m^i&m)|0;S=x,x=M,M=_,_=y+W|0,y=m,m=i,i=f,f=W+G|0}d[0]+=f,d[1]+=i,d[2]+=m,d[3]+=y,d[4]+=_,d[5]+=M,d[6]+=x,d[7]+=S},r}();return Nt.RawSha256=e,Nt}var lo={},Rt={};const Yi=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 d=65536+((s&1023)<<10)+(t.charCodeAt(++r)&1023);e.push(d>>18|240,d>>12&63|128,d>>6&63|128,d&63|128)}else e.push(s>>12|224,s>>6&63|128,s&63|128)}return Uint8Array.from(e)},zi=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 d=t[++r];e+=String.fromCharCode((s&31)<<6|d&63)}else if(240<=s&&s<365){const d="%"+[s,t[++r],t[++r],t[++r]].map(f=>f.toString(16)).join("%");e+=decodeURIComponent(d)}else e+=String.fromCharCode((s&15)<<12|(t[++r]&63)<<6|t[++r]&63)}return e};function Fi(t){return new TextEncoder().encode(t)}function Ui(t){return new TextDecoder("utf-8").decode(t)}const qi=t=>typeof TextEncoder=="function"?Fi(t):Yi(t),Wi=t=>typeof TextDecoder=="function"?Ui(t):zi(t),Vi=Object.freeze(Object.defineProperty({__proto__:null,fromUtf8:qi,toUtf8:Wi},Symbol.toStringTag,{value:"Module"})),Hi=Nr(Vi);var uo;function Gi(){if(uo)return Rt;uo=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.convertToBuffer=void 0;var t=Hi,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 Rt.convertToBuffer=r,Rt}var $t={},co;function Qi(){if(co)return $t;co=1,Object.defineProperty($t,"__esModule",{value:!0}),$t.isEmptyData=void 0;function t(e){return typeof e=="string"?e.length===0:e.byteLength===0}return $t.isEmptyData=t,$t}var Lt={},ho;function Ki(){if(ho)return Lt;ho=1,Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.numToUint8=void 0;function t(e){return new Uint8Array([(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255])}return Lt.numToUint8=t,Lt}var Bt={},fo;function Zi(){if(fo)return Bt;fo=1,Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.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 Bt.uint32ArrayFrom=t,Bt}var po;function Ji(){return po||(po=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=t.numToUint8=t.isEmptyData=t.convertToBuffer=void 0;var e=Gi();Object.defineProperty(t,"convertToBuffer",{enumerable:!0,get:function(){return e.convertToBuffer}});var r=Qi();Object.defineProperty(t,"isEmptyData",{enumerable:!0,get:function(){return r.isEmptyData}});var n=Ki();Object.defineProperty(t,"numToUint8",{enumerable:!0,get:function(){return n.numToUint8}});var s=Zi();Object.defineProperty(t,"uint32ArrayFrom",{enumerable:!0,get:function(){return s.uint32ArrayFrom}})}(lo)),lo}var go;function Xi(){if(go)return jt;go=1,Object.defineProperty(jt,"__esModule",{value:!0}),jt.Sha256=void 0;var t=oo,e=io(),r=Ii(),n=Ji(),s=function(){function f(i){if(this.hash=new r.RawSha256,i){this.outer=new r.RawSha256;var m=d(i),y=new Uint8Array(e.BLOCK_SIZE);y.set(m);for(var _=0;_<e.BLOCK_SIZE;_++)m[_]^=54,y[_]^=92;this.hash.update(m),this.outer.update(y);for(var _=0;_<m.byteLength;_++)m[_]=0}}return f.prototype.update=function(i){if(!((0,n.isEmptyData)(i)||this.error))try{this.hash.update((0,n.convertToBuffer)(i))}catch(m){this.error=m}},f.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()},f.prototype.digest=function(){return(0,t.__awaiter)(this,void 0,void 0,function(){return(0,t.__generator)(this,function(i){return[2,this.digestSync()]})})},f}();jt.Sha256=s;function d(f){var i=(0,n.convertToBuffer)(f);if(i.byteLength>e.BLOCK_SIZE){var m=new r.RawSha256;m.update(i),i=m.digest()}var y=new Uint8Array(e.BLOCK_SIZE);return y.set(i),y}return jt}var mo;function ea(){return mo||(mo=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=oo;(0,e.__exportStar)(Xi(),t)}(ro)),ro}ea();function ye(t,e){t!=null&&this.fromString(t,e)}function $e(){return new ye(null)}var st,ta=0xdeadbeefcafe,yo=(ta&16777215)==15715070;function ra(t,e,r,n,s,d){for(;--d>=0;){var f=e*this[t++]+r[n]+s;s=Math.floor(f/67108864),r[n++]=f&67108863}return s}function na(t,e,r,n,s,d){for(var f=e&32767,i=e>>15;--d>=0;){var m=this[t]&32767,y=this[t++]>>15,_=i*m+y*f;m=f*m+((_&32767)<<15)+r[n]+(s&1073741823),s=(m>>>30)+(_>>>15)+i*y+(s>>>30),r[n++]=m&1073741823}return s}function oa(t,e,r,n,s,d){for(var f=e&16383,i=e>>14;--d>=0;){var m=this[t]&16383,y=this[t++]>>14,_=i*m+y*f;m=f*m+((_&16383)<<14)+r[n]+s,s=(m>>28)+(_>>14)+i*y,r[n++]=m&268435455}return s}var vo=typeof navigator<"u";vo&&yo&&navigator.appName=="Microsoft Internet Explorer"?(ye.prototype.am=na,st=30):vo&&yo&&navigator.appName!="Netscape"?(ye.prototype.am=ra,st=26):(ye.prototype.am=oa,st=28),ye.prototype.DB=st,ye.prototype.DM=(1<<st)-1,ye.prototype.DV=1<<st;var Ur=52;ye.prototype.FV=Math.pow(2,Ur),ye.prototype.F1=Ur-st,ye.prototype.F2=2*st-Ur;var sa="0123456789abcdefghijklmnopqrstuvwxyz",Jt=new Array,vt,Fe;for(vt=48,Fe=0;Fe<=9;++Fe)Jt[vt++]=Fe;for(vt=97,Fe=10;Fe<36;++Fe)Jt[vt++]=Fe;for(vt=65,Fe=10;Fe<36;++Fe)Jt[vt++]=Fe;function bo(t){return sa.charAt(t)}function ia(t,e){var r=Jt[t.charCodeAt(e)];return r??-1}function aa(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function la(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 qr(t){var e=$e();return e.fromInt(t),e}function ua(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,d=0;--n>=0;){var f=ia(t,n);if(f<0){t.charAt(n)=="-"&&(s=!0);continue}s=!1,d==0?this[this.t++]=f:d+r>this.DB?(this[this.t-1]|=(f&(1<<this.DB-d)-1)<<d,this[this.t++]=f>>this.DB-d):this[this.t-1]|=f<<d,d+=r,d>=this.DB&&(d-=this.DB)}this.clamp(),s&&ye.ZERO.subTo(this,this)}function ca(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function da(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,d="",f=this.t,i=this.DB-f*this.DB%e;if(f-- >0)for(i<this.DB&&(n=this[f]>>i)>0&&(s=!0,d=bo(n));f>=0;)i<e?(n=(this[f]&(1<<i)-1)<<e-i,n|=this[--f]>>(i+=this.DB-e)):(n=this[f]>>(i-=e)&r,i<=0&&(i+=this.DB,--f)),n>0&&(s=!0),s&&(d+=bo(n));return s?d:"0"}function ha(){var t=$e();return ye.ZERO.subTo(this,t),t}function fa(){return this.s<0?this.negate():this}function pa(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 Wr(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 ga(){return this.t<=0?0:this.DB*(this.t-1)+Wr(this[this.t-1]^this.s&this.DM)}function ma(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 ya(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 va(t,e){var r=t%this.DB,n=this.DB-r,s=(1<<n)-1,d=Math.floor(t/this.DB),f=this.s<<r&this.DM,i;for(i=this.t-1;i>=0;--i)e[i+d+1]=this[i]>>n|f,f=(this[i]&s)<<r;for(i=d-1;i>=0;--i)e[i]=0;e[d]=f,e.t=this.t+d+1,e.s=this.s,e.clamp()}function ba(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,d=(1<<n)-1;e[0]=this[r]>>n;for(var f=r+1;f<this.t;++f)e[f-r-1]|=(this[f]&d)<<s,e[f-r]=this[f]>>n;n>0&&(e[this.t-r-1]|=(this.s&d)<<s),e.t=this.t-r,e.clamp()}function wa(t,e){for(var r=0,n=0,s=Math.min(t.t,this.t);r<s;)n+=this[r]-t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n-=t[r],e[r++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[r++]=this.DV+n:n>0&&(e[r++]=n),e.t=r,e.clamp()}function _a(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 xa(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 Ca(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=$e());var d=$e(),f=this.s,i=t.s,m=this.DB-Wr(n[n.t-1]);m>0?(n.lShiftTo(m,d),s.lShiftTo(m,r)):(n.copyTo(d),s.copyTo(r));var y=d.t,_=d[y-1];if(_!=0){var M=_*(1<<this.F1)+(y>1?d[y-2]>>this.F2:0),x=this.FV/M,S=(1<<this.F1)/M,P=1<<this.F2,A=r.t,B=A-y,Q=e??$e();for(d.dlShiftTo(B,Q),r.compareTo(Q)>=0&&(r[r.t++]=1,r.subTo(Q,r)),ye.ONE.dlShiftTo(y,Q),Q.subTo(d,d);d.t<y;)d[d.t++]=0;for(;--B>=0;){var W=r[--A]==_?this.DM:Math.floor(r[A]*x+(r[A-1]+P)*S);if((r[A]+=d.am(0,W,r,B,0,y))<W)for(d.dlShiftTo(B,Q),r.subTo(Q,r);r[A]<--W;)r.subTo(Q,r)}e!=null&&(r.drShiftTo(y,e),f!=i&&ye.ZERO.subTo(e,e)),r.t=y,r.clamp(),m>0&&r.rShiftTo(m,r),f<0&&ye.ZERO.subTo(r,r)}}}function Sa(t){var e=$e();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(ye.ZERO)>0&&t.subTo(e,e),e}function Da(){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 ka(t){return this.compareTo(t)==0}function Ma(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 Pa(t){var e=$e();return this.addTo(t,e),e}function Oa(t){var e=$e();return this.subTo(t,e),e}function Aa(t){var e=$e();return this.multiplyTo(t,e),e}function Ea(t){var e=$e();return this.divRemTo(t,e,null),e}function bt(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 Ta(t){var e=$e();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 ja(t){var e=$e();return t.copyTo(e),this.reduce(e),e}function Na(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 Ra(t,e){t.squareTo(e),this.reduce(e)}function $a(t,e,r){t.multiplyTo(e,r),this.reduce(r)}bt.prototype.convert=Ta,bt.prototype.revert=ja,bt.prototype.reduce=Na,bt.prototype.mulTo=$a,bt.prototype.sqrTo=Ra;function La(t,e,r){var n=t.bitLength(),s,d=qr(1),f=new bt(e);if(n<=0)return d;n<18?s=1:n<48?s=3:n<144?s=4:n<768?s=5:s=6;var i=new Array,m=3,y=s-1,_=(1<<s)-1;if(i[1]=f.convert(this),s>1){var M=$e();for(f.sqrTo(i[1],M);m<=_;)i[m]=$e(),f.mulTo(M,i[m-2],i[m]),m+=2}var x=t.t-1,S,P=!0,A=$e(),B;for(n=Wr(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)),m=s;(S&1)==0;)S>>=1,--m;if((n-=m)<0&&(n+=this.DB,--x),P)i[S].copyTo(d),P=!1;else{for(;m>1;)f.sqrTo(d,A),f.sqrTo(A,d),m-=2;m>0?f.sqrTo(d,A):(B=d,d=A,A=B),f.mulTo(A,i[S],d)}for(;x>=0&&(t[x]&1<<n)==0;)f.sqrTo(d,A),B=d,d=A,A=B,--n<0&&(n=this.DB-1,--x)}var Q=f.revert(d);return r(null,Q),Q}ye.prototype.copyTo=aa,ye.prototype.fromInt=la,ye.prototype.fromString=ua,ye.prototype.clamp=ca,ye.prototype.dlShiftTo=ma,ye.prototype.drShiftTo=ya,ye.prototype.lShiftTo=va,ye.prototype.rShiftTo=ba,ye.prototype.subTo=wa,ye.prototype.multiplyTo=_a,ye.prototype.squareTo=xa,ye.prototype.divRemTo=Ca,ye.prototype.invDigit=Da,ye.prototype.addTo=Ma,ye.prototype.toString=da,ye.prototype.negate=ha,ye.prototype.abs=fa,ye.prototype.compareTo=pa,ye.prototype.bitLength=ga,ye.prototype.mod=Sa,ye.prototype.equals=ka,ye.prototype.add=Pa,ye.prototype.subtract=Oa,ye.prototype.multiply=Aa,ye.prototype.divide=Ea,ye.prototype.modPow=La,ye.ZERO=qr(0),ye.ONE=qr(1);function Ba(t,e){return e=e||{},new Promise(function(r,n){var s=new XMLHttpRequest,d=[],f=[],i={},m=function(){return{ok:(s.status/100|0)==2,statusText:s.statusText,status:s.status,url:s.responseURL,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(s.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([s.response]))},clone:m,headers:{keys:function(){return d},entries:function(){return f},get:function(_){return i[_.toLowerCase()]},has:function(_){return _.toLowerCase()in i}}}};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){d.push(M=M.toLowerCase()),f.push([M,x]),i[M]=i[M]?i[M]+","+x:x}),r(m())},s.onerror=n,s.withCredentials=e.credentials=="include",e.headers)s.setRequestHeader(y,e.headers[y]);s.send(e.body||null)})}const Ia=Object.freeze(Object.defineProperty({__proto__:null,default:Ba},Symbol.toStringTag,{value:"Module"})),wo=Nr(Ia);var _o,xo;function Ya(){return xo||(xo=1,_o=self.fetch||(self.fetch=wo.default||wo)),_o}Ya();/*!
105
105
  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
106
106
  * SPDX-License-Identifier: Apache-2.0
107
- */var xo={exports:{}};/*!
107
+ */var Co={exports:{}};/*!
108
108
  * JavaScript Cookie v2.2.1
109
109
  * https://github.com/js-cookie/js-cookie
110
110
  *
111
111
  * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
112
112
  * Released under the MIT license
113
- */var Co;function $a(){return Co||(Co=1,function(t,e){(function(r){var n;if(t.exports=r(),n=!0,!n){var s=window.Cookies,d=window.Cookies=r();d.noConflict=function(){return window.Cookies=s,d}}})(function(){function r(){for(var d=0,f={};d<arguments.length;d++){var i=arguments[d];for(var m in i)f[m]=i[m]}return f}function n(d){return d.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function s(d){function f(){}function i(y,_,M){if(!(typeof document>"u")){M=r({path:"/"},f.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{}_=d.write?d.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 D="";for(var P in M)M[P]&&(D+="; "+P,M[P]!==!0&&(D+="="+M[P].split(";")[0]));return document.cookie=y+"="+_+D}}function m(y,_){if(!(typeof document>"u")){for(var M={},x=document.cookie?document.cookie.split("; "):[],D=0;D<x.length;D++){var P=x[D].split("="),A=P.slice(1).join("=");!_&&A.charAt(0)==='"'&&(A=A.slice(1,-1));try{var B=n(P[0]);if(A=(d.read||d)(A,B)||n(A),_)try{A=JSON.parse(A)}catch{}if(M[B]=A,y===B)break}catch{}}return y?M[y]:M}}return f.set=i,f.get=function(y){return m(y,!1)},f.getJSON=function(y){return m(y,!0)},f.remove=function(y,_){i(y,"",r(_,{expires:-1}))},f.defaults={},f.withConverter=s,f}return s(function(){})})}(xo)),xo.exports}$a();function La(){if(!window.MantineCognitoUserPool)throw new Error("Cognito Userpool has not been initialized.");return window.MantineCognitoUserPool}function Ba(){return La().getCurrentUser()}function Ya(){return new Promise((t,e)=>{const r=Ba();r===null&&e(null),r?.getSession((n,s)=>{if(n!==null||s===null)return e(null);t({session:s,authenticatedUser:r})})})}async function Ia(){const{session:t}=await Ya();return t?.getIdToken().getJwtToken()}re.createContext(void 0);var za="undefined",Fa="object",Jt="browser",So="cpu",Do="device",Wr="engine",Xt="os",it="name",er="type",Vr="vendor",Ke="version",Hr="architecture",Gr="major",Qr="model",Ua="console",qa="mobile",Wa="tablet",Va="smarttv",Ha="wearable",Ga="embedded",Qa=typeof window!==za,Kr=Qa&&window.navigator?window.navigator:void 0;Kr&&Kr.userAgentData&&Kr.userAgentData;var tr=function(t){for(var e={},r=0;r<t.length;r++)e[t[r].toUpperCase()]=t[r];return e},rr=function(t){for(var e in t){var r=t[e];typeof r==Fa&&r.length==2?this[r[0]]=r[1]:this[r]=void 0}return this};(function(){var t={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return rr.call(t.init,[[Jt,[it,Ke,Gr,er]],[So,[Hr]],[Do,[er,Qr,Vr]],[Wr,[it,Ke]],[Xt,[it,Ke]]]),rr.call(t.isIgnore,[[Jt,[Ke,Gr]],[Wr,[Ke]],[Xt,[Ke]]]),rr.call(t.isIgnoreRgx,[[Jt,/ ?browser$/i],[Xt,/ ?os$/i]]),rr.call(t.toString,[[Jt,[it,Ke]],[So,[Hr]],[Do,[Vr,Qr]],[Wr,[it,Ke]],[Xt,[it,Ke]]]),t})(),tr([it,Ke,Gr,er]),tr([Hr]),tr([Qr,Vr,er,Ua,qa,Va,Wa,Ha,Ga]),tr([it,Ke]);var Zr={exports:{}},Ka=Zr.exports,ko;function Za(){return ko||(ko=1,function(t,e){(function(r,n){t.exports=n()})(Ka,()=>(()=>{var r={873:(f,i)=>{var m,y,_=function(){var M=function(S,C){var v=S,u=Q[C],c=null,g=0,l=null,h=[],b={},E=function(O,L){c=function(j){for(var I=new Array(j),Y=0;Y<j;Y+=1){I[Y]=new Array(j);for(var ce=0;ce<j;ce+=1)I[Y][ce]=null}return I}(g=4*v+17),N(0,0),N(g-7,0),N(0,g-7),Z(),K(),V(O,L),v>=7&&ne(O),l==null&&(l=ee(v,u,h)),oe(l,L)},N=function(O,L){for(var j=-1;j<=7;j+=1)if(!(O+j<=-1||g<=O+j))for(var I=-1;I<=7;I+=1)L+I<=-1||g<=L+I||(c[O+j][L+I]=0<=j&&j<=6&&(I==0||I==6)||0<=I&&I<=6&&(j==0||j==6)||2<=j&&j<=4&&2<=I&&I<=4)},K=function(){for(var O=8;O<g-8;O+=1)c[O][6]==null&&(c[O][6]=O%2==0);for(var L=8;L<g-8;L+=1)c[6][L]==null&&(c[6][L]=L%2==0)},Z=function(){for(var O=W.getPatternPosition(v),L=0;L<O.length;L+=1)for(var j=0;j<O.length;j+=1){var I=O[L],Y=O[j];if(c[I][Y]==null)for(var ce=-2;ce<=2;ce+=1)for(var o=-2;o<=2;o+=1)c[I+ce][Y+o]=ce==-2||ce==2||o==-2||o==2||ce==0&&o==0}},ne=function(O){for(var L=W.getBCHTypeNumber(v),j=0;j<18;j+=1){var I=!O&&(L>>j&1)==1;c[Math.floor(j/3)][j%3+g-8-3]=I}for(j=0;j<18;j+=1)I=!O&&(L>>j&1)==1,c[j%3+g-8-3][Math.floor(j/3)]=I},V=function(O,L){for(var j=u<<3|L,I=W.getBCHTypeInfo(j),Y=0;Y<15;Y+=1){var ce=!O&&(I>>Y&1)==1;Y<6?c[Y][8]=ce:Y<8?c[Y+1][8]=ce:c[g-15+Y][8]=ce}for(Y=0;Y<15;Y+=1)ce=!O&&(I>>Y&1)==1,Y<8?c[8][g-Y-1]=ce:Y<9?c[8][15-Y-1+1]=ce:c[8][15-Y-1]=ce;c[g-8][8]=!O},oe=function(O,L){for(var j=-1,I=g-1,Y=7,ce=0,o=W.getMaskFunction(L),a=g-1;a>0;a-=2)for(a==6&&(a-=1);;){for(var p=0;p<2;p+=1)if(c[I][a-p]==null){var k=!1;ce<O.length&&(k=(O[ce]>>>Y&1)==1),o(I,a-p)&&(k=!k),c[I][a-p]=k,(Y-=1)==-1&&(ce+=1,Y=7)}if((I+=j)<0||g<=I){I-=j,j=-j;break}}},ee=function(O,L,j){for(var I=z.getRSBlocks(O,L),Y=H(),ce=0;ce<j.length;ce+=1){var o=j[ce];Y.put(o.getMode(),4),Y.put(o.getLength(),W.getLengthInBits(o.getMode(),O)),o.write(Y)}var a=0;for(ce=0;ce<I.length;ce+=1)a+=I[ce].dataCount;if(Y.getLengthInBits()>8*a)throw"code length overflow. ("+Y.getLengthInBits()+">"+8*a+")";for(Y.getLengthInBits()+4<=8*a&&Y.put(0,4);Y.getLengthInBits()%8!=0;)Y.putBit(!1);for(;!(Y.getLengthInBits()>=8*a||(Y.put(236,8),Y.getLengthInBits()>=8*a));)Y.put(17,8);return function(p,k){for(var R=0,U=0,le=0,se=new Array(k.length),fe=new Array(k.length),ae=0;ae<k.length;ae+=1){var ge=k[ae].dataCount,ve=k[ae].totalCount-ge;U=Math.max(U,ge),le=Math.max(le,ve),se[ae]=new Array(ge);for(var pe=0;pe<se[ae].length;pe+=1)se[ae][pe]=255&p.getBuffer()[pe+R];R+=ge;var xe=W.getErrorCorrectPolynomial(ve),_e=J(se[ae],xe.getLength()-1).mod(xe);for(fe[ae]=new Array(xe.getLength()-1),pe=0;pe<fe[ae].length;pe+=1){var Ce=pe+_e.getLength()-fe[ae].length;fe[ae][pe]=Ce>=0?_e.getAt(Ce):0}}var Be=0;for(pe=0;pe<k.length;pe+=1)Be+=k[pe].totalCount;var Oe=new Array(Be),Se=0;for(pe=0;pe<U;pe+=1)for(ae=0;ae<k.length;ae+=1)pe<se[ae].length&&(Oe[Se]=se[ae][pe],Se+=1);for(pe=0;pe<le;pe+=1)for(ae=0;ae<k.length;ae+=1)pe<fe[ae].length&&(Oe[Se]=fe[ae][pe],Se+=1);return Oe}(Y,I)};b.addData=function(O,L){var j=null;switch(L=L||"Byte"){case"Numeric":j=F(O);break;case"Alphanumeric":j=$(O);break;case"Byte":j=te(O);break;case"Kanji":j=X(O);break;default:throw"mode:"+L}h.push(j),l=null},b.isDark=function(O,L){if(O<0||g<=O||L<0||g<=L)throw O+","+L;return c[O][L]},b.getModuleCount=function(){return g},b.make=function(){if(v<1){for(var O=1;O<40;O++){for(var L=z.getRSBlocks(O,u),j=H(),I=0;I<h.length;I++){var Y=h[I];j.put(Y.getMode(),4),j.put(Y.getLength(),W.getLengthInBits(Y.getMode(),O)),Y.write(j)}var ce=0;for(I=0;I<L.length;I++)ce+=L[I].dataCount;if(j.getLengthInBits()<=8*ce)break}v=O}E(!1,function(){for(var o=0,a=0,p=0;p<8;p+=1){E(!0,p);var k=W.getLostPoint(b);(p==0||o>k)&&(o=k,a=p)}return a}())},b.createTableTag=function(O,L){O=O||2;var j="";j+='<table style="',j+=" border-width: 0px; border-style: none;",j+=" border-collapse: collapse;",j+=" padding: 0px; margin: "+(L=L===void 0?4*O:L)+"px;",j+='">',j+="<tbody>";for(var I=0;I<b.getModuleCount();I+=1){j+="<tr>";for(var Y=0;Y<b.getModuleCount();Y+=1)j+='<td style="',j+=" border-width: 0px; border-style: none;",j+=" border-collapse: collapse;",j+=" padding: 0px; margin: 0px;",j+=" width: "+O+"px;",j+=" height: "+O+"px;",j+=" background-color: ",j+=b.isDark(I,Y)?"#000000":"#ffffff",j+=";",j+='"/>';j+="</tr>"}return(j+="</tbody>")+"</table>"},b.createSvgTag=function(O,L,j,I){var Y={};typeof arguments[0]=="object"&&(O=(Y=arguments[0]).cellSize,L=Y.margin,j=Y.alt,I=Y.title),O=O||2,L=L===void 0?4*O:L,(j=typeof j=="string"?{text:j}:j||{}).text=j.text||null,j.id=j.text?j.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,a,p,k=b.getModuleCount()*O+2*L,R="";for(p="l"+O+",0 0,"+O+" -"+O+",0 0,-"+O+"z ",R+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',R+=Y.scalable?"":' width="'+k+'px" height="'+k+'px"',R+=' viewBox="0 0 '+k+" "+k+'" ',R+=' preserveAspectRatio="xMinYMin meet"',R+=I.text||j.text?' role="img" aria-labelledby="'+ie([I.id,j.id].join(" ").trim())+'"':"",R+=">",R+=I.text?'<title id="'+ie(I.id)+'">'+ie(I.text)+"</title>":"",R+=j.text?'<description id="'+ie(j.id)+'">'+ie(j.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(a=o*O+L,ce=0;ce<b.getModuleCount();ce+=1)b.isDark(o,ce)&&(R+="M"+(ce*O+L)+","+a+p);return(R+='" stroke="transparent" fill="black"/>')+"</svg>"},b.createDataURL=function(O,L){O=O||2,L=L===void 0?4*O:L;var j=b.getModuleCount()*O+2*L,I=L,Y=j-L;return de(j,j,function(ce,o){if(I<=ce&&ce<Y&&I<=o&&o<Y){var a=Math.floor((ce-I)/O),p=Math.floor((o-I)/O);return b.isDark(p,a)?0:1}return 1})},b.createImgTag=function(O,L,j){O=O||2,L=L===void 0?4*O:L;var I=b.getModuleCount()*O+2*L,Y="";return Y+="<img",Y+=' src="',Y+=b.createDataURL(O,L),Y+='"',Y+=' width="',Y+=I,Y+='"',Y+=' height="',Y+=I,Y+='"',j&&(Y+=' alt="',Y+=ie(j),Y+='"'),Y+"/>"};var ie=function(O){for(var L="",j=0;j<O.length;j+=1){var I=O.charAt(j);switch(I){case"<":L+="&lt;";break;case">":L+="&gt;";break;case"&":L+="&amp;";break;case'"':L+="&quot;";break;default:L+=I}}return L};return b.createASCII=function(O,L){if((O=O||1)<2)return function(se){se=se===void 0?2:se;var fe,ae,ge,ve,pe,xe=1*b.getModuleCount()+2*se,_e=se,Ce=xe-se,Be={"██":"█","█ ":"▀"," █":"▄"," ":" "},Oe={"██":"▀","█ ":"▀"," █":" "," ":" "},Se="";for(fe=0;fe<xe;fe+=2){for(ge=Math.floor((fe-_e)/1),ve=Math.floor((fe+1-_e)/1),ae=0;ae<xe;ae+=1)pe="█",_e<=ae&&ae<Ce&&_e<=fe&&fe<Ce&&b.isDark(ge,Math.floor((ae-_e)/1))&&(pe=" "),_e<=ae&&ae<Ce&&_e<=fe+1&&fe+1<Ce&&b.isDark(ve,Math.floor((ae-_e)/1))?pe+=" ":pe+="█",Se+=se<1&&fe+1>=Ce?Oe[pe]:Be[pe];Se+=`
114
- `}return xe%2&&se>0?Se.substring(0,Se.length-xe-1)+Array(xe+1).join("▀"):Se.substring(0,Se.length-1)}(L);O-=1,L=L===void 0?2*O:L;var j,I,Y,ce,o=b.getModuleCount()*O+2*L,a=L,p=o-L,k=Array(O+1).join("██"),R=Array(O+1).join(" "),U="",le="";for(j=0;j<o;j+=1){for(Y=Math.floor((j-a)/O),le="",I=0;I<o;I+=1)ce=1,a<=I&&I<p&&a<=j&&j<p&&b.isDark(Y,Math.floor((I-a)/O))&&(ce=0),le+=ce?k:R;for(Y=0;Y<O;Y+=1)U+=le+`
115
- `}return U.substring(0,U.length-1)},b.renderTo2dContext=function(O,L){L=L||2;for(var j=b.getModuleCount(),I=0;I<j;I++)for(var Y=0;Y<j;Y++)O.fillStyle=b.isDark(I,Y)?"black":"white",O.fillRect(I*L,Y*L,L,L)},b};M.stringToBytes=(M.stringToBytesFuncs={default:function(S){for(var C=[],v=0;v<S.length;v+=1){var u=S.charCodeAt(v);C.push(255&u)}return C}}).default,M.createStringToBytes=function(S,C){var v=function(){for(var c=ue(S),g=function(){var K=c.read();if(K==-1)throw"eof";return K},l=0,h={};;){var b=c.read();if(b==-1)break;var E=g(),N=g()<<8|g();h[String.fromCharCode(b<<8|E)]=N,l+=1}if(l!=C)throw l+" != "+C;return h}(),u=63;return function(c){for(var g=[],l=0;l<c.length;l+=1){var h=c.charCodeAt(l);if(h<128)g.push(h);else{var b=v[c.charAt(l)];typeof b=="number"?(255&b)==b?g.push(b):(g.push(b>>>8),g.push(255&b)):g.push(u)}}return g}};var x,D,P,A,B,Q={L:1,M:0,Q:3,H:2},W=(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]],D=1335,P=7973,B=function(S){for(var C=0;S!=0;)C+=1,S>>>=1;return C},(A={}).getBCHTypeInfo=function(S){for(var C=S<<10;B(C)-B(D)>=0;)C^=D<<B(C)-B(D);return 21522^(S<<10|C)},A.getBCHTypeNumber=function(S){for(var C=S<<12;B(C)-B(P)>=0;)C^=P<<B(C)-B(P);return S<<12|C},A.getPatternPosition=function(S){return x[S-1]},A.getMaskFunction=function(S){switch(S){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:"+S}},A.getErrorCorrectPolynomial=function(S){for(var C=J([1],0),v=0;v<S;v+=1)C=C.multiply(J([1,G.gexp(v)],0));return C},A.getLengthInBits=function(S,C){if(1<=C&&C<10)switch(S){case 1:return 10;case 2:return 9;case 4:case 8:return 8;default:throw"mode:"+S}else if(C<27)switch(S){case 1:return 12;case 2:return 11;case 4:return 16;case 8:return 10;default:throw"mode:"+S}else{if(!(C<41))throw"type:"+C;switch(S){case 1:return 14;case 2:return 13;case 4:return 16;case 8:return 12;default:throw"mode:"+S}}},A.getLostPoint=function(S){for(var C=S.getModuleCount(),v=0,u=0;u<C;u+=1)for(var c=0;c<C;c+=1){for(var g=0,l=S.isDark(u,c),h=-1;h<=1;h+=1)if(!(u+h<0||C<=u+h))for(var b=-1;b<=1;b+=1)c+b<0||C<=c+b||h==0&&b==0||l==S.isDark(u+h,c+b)&&(g+=1);g>5&&(v+=3+g-5)}for(u=0;u<C-1;u+=1)for(c=0;c<C-1;c+=1){var E=0;S.isDark(u,c)&&(E+=1),S.isDark(u+1,c)&&(E+=1),S.isDark(u,c+1)&&(E+=1),S.isDark(u+1,c+1)&&(E+=1),E!=0&&E!=4||(v+=3)}for(u=0;u<C;u+=1)for(c=0;c<C-6;c+=1)S.isDark(u,c)&&!S.isDark(u,c+1)&&S.isDark(u,c+2)&&S.isDark(u,c+3)&&S.isDark(u,c+4)&&!S.isDark(u,c+5)&&S.isDark(u,c+6)&&(v+=40);for(c=0;c<C;c+=1)for(u=0;u<C-6;u+=1)S.isDark(u,c)&&!S.isDark(u+1,c)&&S.isDark(u+2,c)&&S.isDark(u+3,c)&&S.isDark(u+4,c)&&!S.isDark(u+5,c)&&S.isDark(u+6,c)&&(v+=40);var N=0;for(c=0;c<C;c+=1)for(u=0;u<C;u+=1)S.isDark(u,c)&&(N+=1);return v+Math.abs(100*N/C/C-50)/5*10},A),G=function(){for(var S=new Array(256),C=new Array(256),v=0;v<8;v+=1)S[v]=1<<v;for(v=8;v<256;v+=1)S[v]=S[v-4]^S[v-5]^S[v-6]^S[v-8];for(v=0;v<255;v+=1)C[S[v]]=v;return{glog:function(u){if(u<1)throw"glog("+u+")";return C[u]},gexp:function(u){for(;u<0;)u+=255;for(;u>=256;)u-=255;return S[u]}}}();function J(S,C){if(S.length===void 0)throw S.length+"/"+C;var v=function(){for(var c=0;c<S.length&&S[c]==0;)c+=1;for(var g=new Array(S.length-c+C),l=0;l<S.length-c;l+=1)g[l]=S[l+c];return g}(),u={getAt:function(c){return v[c]},getLength:function(){return v.length},multiply:function(c){for(var g=new Array(u.getLength()+c.getLength()-1),l=0;l<u.getLength();l+=1)for(var h=0;h<c.getLength();h+=1)g[l+h]^=G.gexp(G.glog(u.getAt(l))+G.glog(c.getAt(h)));return J(g,0)},mod:function(c){if(u.getLength()-c.getLength()<0)return u;for(var g=G.glog(u.getAt(0))-G.glog(c.getAt(0)),l=new Array(u.getLength()),h=0;h<u.getLength();h+=1)l[h]=u.getAt(h);for(h=0;h<c.getLength();h+=1)l[h]^=G.gexp(G.glog(c.getAt(h))+g);return J(l,0).mod(c)}};return u}var z=function(){var S=[[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(u,c){var g={};return g.totalCount=u,g.dataCount=c,g},v={getRSBlocks:function(u,c){var g=function(ne,V){switch(V){case Q.L:return S[4*(ne-1)+0];case Q.M:return S[4*(ne-1)+1];case Q.Q:return S[4*(ne-1)+2];case Q.H:return S[4*(ne-1)+3];default:return}}(u,c);if(g===void 0)throw"bad rs block @ typeNumber:"+u+"/errorCorrectionLevel:"+c;for(var l=g.length/3,h=[],b=0;b<l;b+=1)for(var E=g[3*b+0],N=g[3*b+1],K=g[3*b+2],Z=0;Z<E;Z+=1)h.push(C(N,K));return h}};return v}(),H=function(){var S=[],C=0,v={getBuffer:function(){return S},getAt:function(u){var c=Math.floor(u/8);return(S[c]>>>7-u%8&1)==1},put:function(u,c){for(var g=0;g<c;g+=1)v.putBit((u>>>c-g-1&1)==1)},getLengthInBits:function(){return C},putBit:function(u){var c=Math.floor(C/8);S.length<=c&&S.push(0),u&&(S[c]|=128>>>C%8),C+=1}};return v},F=function(S){var C=S,v={getMode:function(){return 1},getLength:function(g){return C.length},write:function(g){for(var l=C,h=0;h+2<l.length;)g.put(u(l.substring(h,h+3)),10),h+=3;h<l.length&&(l.length-h==1?g.put(u(l.substring(h,h+1)),4):l.length-h==2&&g.put(u(l.substring(h,h+2)),7))}},u=function(g){for(var l=0,h=0;h<g.length;h+=1)l=10*l+c(g.charAt(h));return l},c=function(g){if("0"<=g&&g<="9")return g.charCodeAt(0)-48;throw"illegal char :"+g};return v},$=function(S){var C=S,v={getMode:function(){return 2},getLength:function(c){return C.length},write:function(c){for(var g=C,l=0;l+1<g.length;)c.put(45*u(g.charAt(l))+u(g.charAt(l+1)),11),l+=2;l<g.length&&c.put(u(g.charAt(l)),6)}},u=function(c){if("0"<=c&&c<="9")return c.charCodeAt(0)-48;if("A"<=c&&c<="Z")return c.charCodeAt(0)-65+10;switch(c){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 :"+c}};return v},te=function(S){var C=M.stringToBytes(S);return{getMode:function(){return 4},getLength:function(v){return C.length},write:function(v){for(var u=0;u<C.length;u+=1)v.put(C[u],8)}}},X=function(S){var C=M.stringToBytesFuncs.SJIS;if(!C)throw"sjis not supported.";(function(){var c=C("友");if(c.length!=2||(c[0]<<8|c[1])!=38726)throw"sjis not supported."})();var v=C(S),u={getMode:function(){return 8},getLength:function(c){return~~(v.length/2)},write:function(c){for(var g=v,l=0;l+1<g.length;){var h=(255&g[l])<<8|255&g[l+1];if(33088<=h&&h<=40956)h-=33088;else{if(!(57408<=h&&h<=60351))throw"illegal char at "+(l+1)+"/"+h;h-=49472}h=192*(h>>>8&255)+(255&h),c.put(h,13),l+=2}if(l<g.length)throw"illegal char at "+(l+1)}};return u},q=function(){var S=[],C={writeByte:function(v){S.push(255&v)},writeShort:function(v){C.writeByte(v),C.writeByte(v>>>8)},writeBytes:function(v,u,c){u=u||0,c=c||v.length;for(var g=0;g<c;g+=1)C.writeByte(v[g+u])},writeString:function(v){for(var u=0;u<v.length;u+=1)C.writeByte(v.charCodeAt(u))},toByteArray:function(){return S},toString:function(){var v="";v+="[";for(var u=0;u<S.length;u+=1)u>0&&(v+=","),v+=S[u];return v+"]"}};return C},ue=function(S){var C=S,v=0,u=0,c=0,g={read:function(){for(;c<8;){if(v>=C.length){if(c==0)return-1;throw"unexpected end of file./"+c}var h=C.charAt(v);if(v+=1,h=="=")return c=0,-1;h.match(/^\s$/)||(u=u<<6|l(h.charCodeAt(0)),c+=6)}var b=u>>>c-8&255;return c-=8,b}},l=function(h){if(65<=h&&h<=90)return h-65;if(97<=h&&h<=122)return h-97+26;if(48<=h&&h<=57)return h-48+52;if(h==43)return 62;if(h==47)return 63;throw"c:"+h};return g},de=function(S,C,v){for(var u=function(N,K){var Z=N,ne=K,V=new Array(N*K),oe={setPixel:function(O,L,j){V[L*Z+O]=j},write:function(O){O.writeString("GIF87a"),O.writeShort(Z),O.writeShort(ne),O.writeByte(128),O.writeByte(0),O.writeByte(0),O.writeByte(0),O.writeByte(0),O.writeByte(0),O.writeByte(255),O.writeByte(255),O.writeByte(255),O.writeString(","),O.writeShort(0),O.writeShort(0),O.writeShort(Z),O.writeShort(ne),O.writeByte(0);var L=ee(2);O.writeByte(2);for(var j=0;L.length-j>255;)O.writeByte(255),O.writeBytes(L,j,255),j+=255;O.writeByte(L.length-j),O.writeBytes(L,j,L.length-j),O.writeByte(0),O.writeString(";")}},ee=function(O){for(var L=1<<O,j=1+(1<<O),I=O+1,Y=ie(),ce=0;ce<L;ce+=1)Y.add(String.fromCharCode(ce));Y.add(String.fromCharCode(L)),Y.add(String.fromCharCode(j));var o,a,p,k=q(),R=(o=k,a=0,p=0,{write:function(fe,ae){if(fe>>>ae)throw"length over";for(;a+ae>=8;)o.writeByte(255&(fe<<a|p)),ae-=8-a,fe>>>=8-a,p=0,a=0;p|=fe<<a,a+=ae},flush:function(){a>0&&o.writeByte(p)}});R.write(L,I);var U=0,le=String.fromCharCode(V[U]);for(U+=1;U<V.length;){var se=String.fromCharCode(V[U]);U+=1,Y.contains(le+se)?le+=se:(R.write(Y.indexOf(le),I),Y.size()<4095&&(Y.size()==1<<I&&(I+=1),Y.add(le+se)),le=se)}return R.write(Y.indexOf(le),I),R.write(j,I),R.flush(),k.toByteArray()},ie=function(){var O={},L=0,j={add:function(I){if(j.contains(I))throw"dup key:"+I;O[I]=L,L+=1},size:function(){return L},indexOf:function(I){return O[I]},contains:function(I){return O[I]!==void 0}};return j};return oe}(S,C),c=0;c<C;c+=1)for(var g=0;g<S;g+=1)u.setPixel(g,c,v(g,c));var l=q();u.write(l);for(var h=function(){var N=0,K=0,Z=0,ne="",V={},oe=function(ie){ne+=String.fromCharCode(ee(63&ie))},ee=function(ie){if(!(ie<0)){if(ie<26)return 65+ie;if(ie<52)return ie-26+97;if(ie<62)return ie-52+48;if(ie==62)return 43;if(ie==63)return 47}throw"n:"+ie};return V.writeByte=function(ie){for(N=N<<8|255&ie,K+=8,Z+=1;K>=6;)oe(N>>>K-6),K-=6},V.flush=function(){if(K>0&&(oe(N<<6-K),N=0,K=0),Z%3!=0)for(var ie=3-Z%3,O=0;O<ie;O+=1)ne+="="},V.toString=function(){return ne},V}(),b=l.toByteArray(),E=0;E<b.length;E+=1)h.writeByte(b[E]);return h.flush(),"data:image/gif;base64,"+h};return M}();_.stringToBytesFuncs["UTF-8"]=function(M){return function(x){for(var D=[],P=0;P<x.length;P++){var A=x.charCodeAt(P);A<128?D.push(A):A<2048?D.push(192|A>>6,128|63&A):A<55296||A>=57344?D.push(224|A>>12,128|A>>6&63,128|63&A):(P++,A=65536+((1023&A)<<10|1023&x.charCodeAt(P)),D.push(240|A>>18,128|A>>12&63,128|A>>6&63,128|63&A))}return D}(M)},(y=typeof(m=function(){return _})=="function"?m.apply(i,[]):m)===void 0||(f.exports=y)}},n={};function s(f){var i=n[f];if(i!==void 0)return i.exports;var m=n[f]={exports:{}};return r[f](m,m.exports,s),m.exports}s.n=f=>{var i=f&&f.__esModule?()=>f.default:()=>f;return s.d(i,{a:i}),i},s.d=(f,i)=>{for(var m in i)s.o(i,m)&&!s.o(f,m)&&Object.defineProperty(f,m,{enumerable:!0,get:i[m]})},s.o=(f,i)=>Object.prototype.hasOwnProperty.call(f,i);var d={};return(()=>{s.d(d,{default:()=>C});const f=v=>!!v&&typeof v=="object"&&!Array.isArray(v);function i(v,...u){if(!u.length)return v;const c=u.shift();return c!==void 0&&f(v)&&f(c)?(v=Object.assign({},v),Object.keys(c).forEach(g=>{const l=v[g],h=c[g];Array.isArray(l)&&Array.isArray(h)?v[g]=h:f(l)&&f(h)?v[g]=i(Object.assign({},l),h):v[g]=h}),i(v,...u)):v}function m(v,u){const c=document.createElement("a");c.download=u,c.href=v,document.body.appendChild(c),c.click(),document.body.removeChild(c)}const y={L:.07,M:.15,Q:.25,H:.3};class _{constructor({svg:u,type:c,window:g}){this._svg=u,this._type=c,this._window=g}draw(u,c,g,l){let h;switch(this._type){case"dots":h=this._drawDot;break;case"classy":h=this._drawClassy;break;case"classy-rounded":h=this._drawClassyRounded;break;case"rounded":h=this._drawRounded;break;case"extra-rounded":h=this._drawExtraRounded;break;default:h=this._drawSquare}h.call(this,{x:u,y:c,size:g,getNeighbor:l})}_rotateFigure({x:u,y:c,size:g,rotation:l=0,draw:h}){var b;const E=u+g/2,N=c+g/2;h(),(b=this._element)===null||b===void 0||b.setAttribute("transform",`rotate(${180*l/Math.PI},${E},${N})`)}_basicDot(u){const{size:c,x:g,y:l}=u;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(g+c/2)),this._element.setAttribute("cy",String(l+c/2)),this._element.setAttribute("r",String(c/2))}}))}_basicSquare(u){const{size:c,x:g,y:l}=u;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(g)),this._element.setAttribute("y",String(l)),this._element.setAttribute("width",String(c)),this._element.setAttribute("height",String(c))}}))}_basicSideRounded(u){const{size:c,x:g,y:l}=u;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${g} ${l}v ${c}h `+c/2+`a ${c/2} ${c/2}, 0, 0, 0, 0 ${-c}`)}}))}_basicCornerRounded(u){const{size:c,x:g,y:l}=u;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${g} ${l}v ${c}h ${c}v `+-c/2+`a ${c/2} ${c/2}, 0, 0, 0, ${-c/2} ${-c/2}`)}}))}_basicCornerExtraRounded(u){const{size:c,x:g,y:l}=u;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${g} ${l}v ${c}h ${c}a ${c} ${c}, 0, 0, 0, ${-c} ${-c}`)}}))}_basicCornersRounded(u){const{size:c,x:g,y:l}=u;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${g} ${l}v `+c/2+`a ${c/2} ${c/2}, 0, 0, 0, ${c/2} ${c/2}h `+c/2+"v "+-c/2+`a ${c/2} ${c/2}, 0, 0, 0, ${-c/2} ${-c/2}`)}}))}_drawDot({x:u,y:c,size:g}){this._basicDot({x:u,y:c,size:g,rotation:0})}_drawSquare({x:u,y:c,size:g}){this._basicSquare({x:u,y:c,size:g,rotation:0})}_drawRounded({x:u,y:c,size:g,getNeighbor:l}){const h=l?+l(-1,0):0,b=l?+l(1,0):0,E=l?+l(0,-1):0,N=l?+l(0,1):0,K=h+b+E+N;if(K!==0)if(K>2||h&&b||E&&N)this._basicSquare({x:u,y:c,size:g,rotation:0});else{if(K===2){let Z=0;return h&&E?Z=Math.PI/2:E&&b?Z=Math.PI:b&&N&&(Z=-Math.PI/2),void this._basicCornerRounded({x:u,y:c,size:g,rotation:Z})}if(K===1){let Z=0;return E?Z=Math.PI/2:b?Z=Math.PI:N&&(Z=-Math.PI/2),void this._basicSideRounded({x:u,y:c,size:g,rotation:Z})}}else this._basicDot({x:u,y:c,size:g,rotation:0})}_drawExtraRounded({x:u,y:c,size:g,getNeighbor:l}){const h=l?+l(-1,0):0,b=l?+l(1,0):0,E=l?+l(0,-1):0,N=l?+l(0,1):0,K=h+b+E+N;if(K!==0)if(K>2||h&&b||E&&N)this._basicSquare({x:u,y:c,size:g,rotation:0});else{if(K===2){let Z=0;return h&&E?Z=Math.PI/2:E&&b?Z=Math.PI:b&&N&&(Z=-Math.PI/2),void this._basicCornerExtraRounded({x:u,y:c,size:g,rotation:Z})}if(K===1){let Z=0;return E?Z=Math.PI/2:b?Z=Math.PI:N&&(Z=-Math.PI/2),void this._basicSideRounded({x:u,y:c,size:g,rotation:Z})}}else this._basicDot({x:u,y:c,size:g,rotation:0})}_drawClassy({x:u,y:c,size:g,getNeighbor:l}){const h=l?+l(-1,0):0,b=l?+l(1,0):0,E=l?+l(0,-1):0,N=l?+l(0,1):0;h+b+E+N!==0?h||E?b||N?this._basicSquare({x:u,y:c,size:g,rotation:0}):this._basicCornerRounded({x:u,y:c,size:g,rotation:Math.PI/2}):this._basicCornerRounded({x:u,y:c,size:g,rotation:-Math.PI/2}):this._basicCornersRounded({x:u,y:c,size:g,rotation:Math.PI/2})}_drawClassyRounded({x:u,y:c,size:g,getNeighbor:l}){const h=l?+l(-1,0):0,b=l?+l(1,0):0,E=l?+l(0,-1):0,N=l?+l(0,1):0;h+b+E+N!==0?h||E?b||N?this._basicSquare({x:u,y:c,size:g,rotation:0}):this._basicCornerExtraRounded({x:u,y:c,size:g,rotation:Math.PI/2}):this._basicCornerExtraRounded({x:u,y:c,size:g,rotation:-Math.PI/2}):this._basicCornersRounded({x:u,y:c,size:g,rotation:Math.PI/2})}}const M={dot:"dot",square:"square",extraRounded:"extra-rounded"},x=Object.values(M);class D{constructor({svg:u,type:c,window:g}){this._svg=u,this._type=c,this._window=g}draw(u,c,g,l){let h;switch(this._type){case M.square:h=this._drawSquare;break;case M.extraRounded:h=this._drawExtraRounded;break;default:h=this._drawDot}h.call(this,{x:u,y:c,size:g,rotation:l})}_rotateFigure({x:u,y:c,size:g,rotation:l=0,draw:h}){var b;const E=u+g/2,N=c+g/2;h(),(b=this._element)===null||b===void 0||b.setAttribute("transform",`rotate(${180*l/Math.PI},${E},${N})`)}_basicDot(u){const{size:c,x:g,y:l}=u,h=c/7;this._rotateFigure(Object.assign(Object.assign({},u),{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 ${g+c/2} ${l}a ${c/2} ${c/2} 0 1 0 0.1 0zm 0 ${h}a ${c/2-h} ${c/2-h} 0 1 1 -0.1 0Z`)}}))}_basicSquare(u){const{size:c,x:g,y:l}=u,h=c/7;this._rotateFigure(Object.assign(Object.assign({},u),{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 ${g} ${l}v ${c}h ${c}v `+-c+`zM ${g+h} ${l+h}h `+(c-2*h)+"v "+(c-2*h)+"h "+(2*h-c)+"z")}}))}_basicExtraRounded(u){const{size:c,x:g,y:l}=u,h=c/7;this._rotateFigure(Object.assign(Object.assign({},u),{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 ${g} ${l+2.5*h}v `+2*h+`a ${2.5*h} ${2.5*h}, 0, 0, 0, ${2.5*h} ${2.5*h}h `+2*h+`a ${2.5*h} ${2.5*h}, 0, 0, 0, ${2.5*h} ${2.5*-h}v `+-2*h+`a ${2.5*h} ${2.5*h}, 0, 0, 0, ${2.5*-h} ${2.5*-h}h `+-2*h+`a ${2.5*h} ${2.5*h}, 0, 0, 0, ${2.5*-h} ${2.5*h}M ${g+2.5*h} ${l+h}h `+2*h+`a ${1.5*h} ${1.5*h}, 0, 0, 1, ${1.5*h} ${1.5*h}v `+2*h+`a ${1.5*h} ${1.5*h}, 0, 0, 1, ${1.5*-h} ${1.5*h}h `+-2*h+`a ${1.5*h} ${1.5*h}, 0, 0, 1, ${1.5*-h} ${1.5*-h}v `+-2*h+`a ${1.5*h} ${1.5*h}, 0, 0, 1, ${1.5*h} ${1.5*-h}`)}}))}_drawDot({x:u,y:c,size:g,rotation:l}){this._basicDot({x:u,y:c,size:g,rotation:l})}_drawSquare({x:u,y:c,size:g,rotation:l}){this._basicSquare({x:u,y:c,size:g,rotation:l})}_drawExtraRounded({x:u,y:c,size:g,rotation:l}){this._basicExtraRounded({x:u,y:c,size:g,rotation:l})}}const P={dot:"dot",square:"square"},A=Object.values(P);class B{constructor({svg:u,type:c,window:g}){this._svg=u,this._type=c,this._window=g}draw(u,c,g,l){let h;h=this._type===P.square?this._drawSquare:this._drawDot,h.call(this,{x:u,y:c,size:g,rotation:l})}_rotateFigure({x:u,y:c,size:g,rotation:l=0,draw:h}){var b;const E=u+g/2,N=c+g/2;h(),(b=this._element)===null||b===void 0||b.setAttribute("transform",`rotate(${180*l/Math.PI},${E},${N})`)}_basicDot(u){const{size:c,x:g,y:l}=u;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(g+c/2)),this._element.setAttribute("cy",String(l+c/2)),this._element.setAttribute("r",String(c/2))}}))}_basicSquare(u){const{size:c,x:g,y:l}=u;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(g)),this._element.setAttribute("y",String(l)),this._element.setAttribute("width",String(c)),this._element.setAttribute("height",String(c))}}))}_drawDot({x:u,y:c,size:g,rotation:l}){this._basicDot({x:u,y:c,size:g,rotation:l})}_drawSquare({x:u,y:c,size:g,rotation:l}){this._basicSquare({x:u,y:c,size:g,rotation:l})}}const Q="circle",W=[[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]],G=[[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 J{constructor(u,c){this._roundSize=g=>this._options.dotsOptions.roundSize?Math.floor(g):g,this._window=c,this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("width",String(u.width)),this._element.setAttribute("height",String(u.height)),this._element.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),u.dotsOptions.roundSize||this._element.setAttribute("shape-rendering","crispEdges"),this._element.setAttribute("viewBox",`0 0 ${u.width} ${u.height}`),this._defs=this._window.document.createElementNS("http://www.w3.org/2000/svg","defs"),this._element.appendChild(this._defs),this._imageUri=u.image,this._instanceId=J.instanceCount++,this._options=u}get width(){return this._options.width}get height(){return this._options.height}getElement(){return this._element}async drawQR(u){const c=u.getModuleCount(),g=Math.min(this._options.width,this._options.height)-2*this._options.margin,l=this._options.shape===Q?g/Math.sqrt(2):g,h=this._roundSize(l/c);let b={hideXDots:0,hideYDots:0,width:0,height:0};if(this._qr=u,this._options.image){if(await this.loadImage(),!this._image)return;const{imageOptions:E,qrOptions:N}=this._options,K=E.imageSize*y[N.errorCorrectionLevel],Z=Math.floor(K*c*c);b=function({originalHeight:ne,originalWidth:V,maxHiddenDots:oe,maxHiddenAxisDots:ee,dotSize:ie}){const O={x:0,y:0},L={x:0,y:0};if(ne<=0||V<=0||oe<=0||ie<=0)return{height:0,width:0,hideYDots:0,hideXDots:0};const j=ne/V;return O.x=Math.floor(Math.sqrt(oe/j)),O.x<=0&&(O.x=1),ee&&ee<O.x&&(O.x=ee),O.x%2==0&&O.x--,L.x=O.x*ie,O.y=1+2*Math.ceil((O.x*j-1)/2),L.y=Math.round(L.x*j),(O.y*O.x>oe||ee&&ee<O.y)&&(ee&&ee<O.y?(O.y=ee,O.y%2==0&&O.x--):O.y-=2,L.y=O.y*ie,O.x=1+2*Math.ceil((O.y/j-1)/2),L.x=Math.round(L.y/j)),{height:L.y,width:L.x,hideYDots:O.y,hideXDots:O.x}}({originalWidth:this._image.width,originalHeight:this._image.height,maxHiddenDots:Z,maxHiddenAxisDots:c-14,dotSize:h})}this.drawBackground(),this.drawDots((E,N)=>{var K,Z,ne,V,oe,ee;return!(this._options.imageOptions.hideBackgroundDots&&E>=(c-b.hideYDots)/2&&E<(c+b.hideYDots)/2&&N>=(c-b.hideXDots)/2&&N<(c+b.hideXDots)/2||!((K=W[E])===null||K===void 0)&&K[N]||!((Z=W[E-c+7])===null||Z===void 0)&&Z[N]||!((ne=W[E])===null||ne===void 0)&&ne[N-c+7]||!((V=G[E])===null||V===void 0)&&V[N]||!((oe=G[E-c+7])===null||oe===void 0)&&oe[N]||!((ee=G[E])===null||ee===void 0)&&ee[N-c+7])}),this.drawCorners(),this._options.image&&await this.drawImage({width:b.width,height:b.height,count:c,dotSize:h})}drawBackground(){var u,c,g;const l=this._element,h=this._options;if(l){const b=(u=h.backgroundOptions)===null||u===void 0?void 0:u.gradient,E=(c=h.backgroundOptions)===null||c===void 0?void 0:c.color;let N=h.height,K=h.width;if(b||E){const Z=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");this._backgroundClipPath=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._backgroundClipPath.setAttribute("id",`clip-path-background-color-${this._instanceId}`),this._defs.appendChild(this._backgroundClipPath),!((g=h.backgroundOptions)===null||g===void 0)&&g.round&&(N=K=Math.min(h.width,h.height),Z.setAttribute("rx",String(N/2*h.backgroundOptions.round))),Z.setAttribute("x",String(this._roundSize((h.width-K)/2))),Z.setAttribute("y",String(this._roundSize((h.height-N)/2))),Z.setAttribute("width",String(K)),Z.setAttribute("height",String(N)),this._backgroundClipPath.appendChild(Z),this._createColor({options:b,color:E,additionalRotation:0,x:0,y:0,height:h.height,width:h.width,name:`background-color-${this._instanceId}`})}}}drawDots(u){var c,g;if(!this._qr)throw"QR code is not defined";const l=this._options,h=this._qr.getModuleCount();if(h>l.width||h>l.height)throw"The canvas is too small.";const b=Math.min(l.width,l.height)-2*l.margin,E=l.shape===Q?b/Math.sqrt(2):b,N=this._roundSize(E/h),K=this._roundSize((l.width-h*N)/2),Z=this._roundSize((l.height-h*N)/2),ne=new _({svg:this._element,type:l.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:(c=l.dotsOptions)===null||c===void 0?void 0:c.gradient,color:l.dotsOptions.color,additionalRotation:0,x:0,y:0,height:l.height,width:l.width,name:`dot-color-${this._instanceId}`});for(let V=0;V<h;V++)for(let oe=0;oe<h;oe++)u&&!u(V,oe)||!((g=this._qr)===null||g===void 0)&&g.isDark(V,oe)&&(ne.draw(K+oe*N,Z+V*N,N,(ee,ie)=>!(oe+ee<0||V+ie<0||oe+ee>=h||V+ie>=h)&&!(u&&!u(V+ie,oe+ee))&&!!this._qr&&this._qr.isDark(V+ie,oe+ee)),ne._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(ne._element));if(l.shape===Q){const V=this._roundSize((b/N-h)/2),oe=h+2*V,ee=K-V*N,ie=Z-V*N,O=[],L=this._roundSize(oe/2);for(let j=0;j<oe;j++){O[j]=[];for(let I=0;I<oe;I++)j>=V-1&&j<=oe-V&&I>=V-1&&I<=oe-V||Math.sqrt((j-L)*(j-L)+(I-L)*(I-L))>L?O[j][I]=0:O[j][I]=this._qr.isDark(I-2*V<0?I:I>=h?I-2*V:I-V,j-2*V<0?j:j>=h?j-2*V:j-V)?1:0}for(let j=0;j<oe;j++)for(let I=0;I<oe;I++)O[j][I]&&(ne.draw(ee+I*N,ie+j*N,N,(Y,ce)=>{var o;return!!(!((o=O[j+ce])===null||o===void 0)&&o[I+Y])}),ne._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(ne._element))}}drawCorners(){if(!this._qr)throw"QR code is not defined";const u=this._element,c=this._options;if(!u)throw"Element code is not defined";const g=this._qr.getModuleCount(),l=Math.min(c.width,c.height)-2*c.margin,h=c.shape===Q?l/Math.sqrt(2):l,b=this._roundSize(h/g),E=7*b,N=3*b,K=this._roundSize((c.width-g*b)/2),Z=this._roundSize((c.height-g*b)/2);[[0,0,0],[1,0,Math.PI/2],[0,1,-Math.PI/2]].forEach(([ne,V,oe])=>{var ee,ie,O,L,j,I,Y,ce,o,a,p,k,R,U;const le=K+ne*b*(g-7),se=Z+V*b*(g-7);let fe=this._dotsClipPath,ae=this._dotsClipPath;if((!((ee=c.cornersSquareOptions)===null||ee===void 0)&&ee.gradient||!((ie=c.cornersSquareOptions)===null||ie===void 0)&&ie.color)&&(fe=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),fe.setAttribute("id",`clip-path-corners-square-color-${ne}-${V}-${this._instanceId}`),this._defs.appendChild(fe),this._cornersSquareClipPath=this._cornersDotClipPath=ae=fe,this._createColor({options:(O=c.cornersSquareOptions)===null||O===void 0?void 0:O.gradient,color:(L=c.cornersSquareOptions)===null||L===void 0?void 0:L.color,additionalRotation:oe,x:le,y:se,height:E,width:E,name:`corners-square-color-${ne}-${V}-${this._instanceId}`})),((j=c.cornersSquareOptions)===null||j===void 0?void 0:j.type)&&x.includes(c.cornersSquareOptions.type)){const ge=new D({svg:this._element,type:c.cornersSquareOptions.type,window:this._window});ge.draw(le,se,E,oe),ge._element&&fe&&fe.appendChild(ge._element)}else{const ge=new _({svg:this._element,type:((I=c.cornersSquareOptions)===null||I===void 0?void 0:I.type)||c.dotsOptions.type,window:this._window});for(let ve=0;ve<W.length;ve++)for(let pe=0;pe<W[ve].length;pe++)!((Y=W[ve])===null||Y===void 0)&&Y[pe]&&(ge.draw(le+pe*b,se+ve*b,b,(xe,_e)=>{var Ce;return!!(!((Ce=W[ve+_e])===null||Ce===void 0)&&Ce[pe+xe])}),ge._element&&fe&&fe.appendChild(ge._element))}if((!((ce=c.cornersDotOptions)===null||ce===void 0)&&ce.gradient||!((o=c.cornersDotOptions)===null||o===void 0)&&o.color)&&(ae=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),ae.setAttribute("id",`clip-path-corners-dot-color-${ne}-${V}-${this._instanceId}`),this._defs.appendChild(ae),this._cornersDotClipPath=ae,this._createColor({options:(a=c.cornersDotOptions)===null||a===void 0?void 0:a.gradient,color:(p=c.cornersDotOptions)===null||p===void 0?void 0:p.color,additionalRotation:oe,x:le+2*b,y:se+2*b,height:N,width:N,name:`corners-dot-color-${ne}-${V}-${this._instanceId}`})),((k=c.cornersDotOptions)===null||k===void 0?void 0:k.type)&&A.includes(c.cornersDotOptions.type)){const ge=new B({svg:this._element,type:c.cornersDotOptions.type,window:this._window});ge.draw(le+2*b,se+2*b,N,oe),ge._element&&ae&&ae.appendChild(ge._element)}else{const ge=new _({svg:this._element,type:((R=c.cornersDotOptions)===null||R===void 0?void 0:R.type)||c.dotsOptions.type,window:this._window});for(let ve=0;ve<G.length;ve++)for(let pe=0;pe<G[ve].length;pe++)!((U=G[ve])===null||U===void 0)&&U[pe]&&(ge.draw(le+pe*b,se+ve*b,b,(xe,_e)=>{var Ce;return!!(!((Ce=G[ve+_e])===null||Ce===void 0)&&Ce[pe+xe])}),ge._element&&ae&&ae.appendChild(ge._element))}})}loadImage(){return new Promise((u,c)=>{var g;const l=this._options;if(!l.image)return c("Image is not defined");if(!((g=l.nodeCanvas)===null||g===void 0)&&g.loadImage)l.nodeCanvas.loadImage(l.image).then(h=>{var b,E;if(this._image=h,this._options.imageOptions.saveAsBlob){const N=(b=l.nodeCanvas)===null||b===void 0?void 0:b.createCanvas(this._image.width,this._image.height);(E=N?.getContext("2d"))===null||E===void 0||E.drawImage(h,0,0),this._imageUri=N?.toDataURL()}u()}).catch(c);else{const h=new this._window.Image;typeof l.imageOptions.crossOrigin=="string"&&(h.crossOrigin=l.imageOptions.crossOrigin),this._image=h,h.onload=async()=>{this._options.imageOptions.saveAsBlob&&(this._imageUri=await async function(b,E){return new Promise(N=>{const K=new E.XMLHttpRequest;K.onload=function(){const Z=new E.FileReader;Z.onloadend=function(){N(Z.result)},Z.readAsDataURL(K.response)},K.open("GET",b),K.responseType="blob",K.send()})}(l.image||"",this._window)),u()},h.src=l.image}})}async drawImage({width:u,height:c,count:g,dotSize:l}){const h=this._options,b=this._roundSize((h.width-g*l)/2),E=this._roundSize((h.height-g*l)/2),N=b+this._roundSize(h.imageOptions.margin+(g*l-u)/2),K=E+this._roundSize(h.imageOptions.margin+(g*l-c)/2),Z=u-2*h.imageOptions.margin,ne=c-2*h.imageOptions.margin,V=this._window.document.createElementNS("http://www.w3.org/2000/svg","image");V.setAttribute("href",this._imageUri||""),V.setAttribute("xlink:href",this._imageUri||""),V.setAttribute("x",String(N)),V.setAttribute("y",String(K)),V.setAttribute("width",`${Z}px`),V.setAttribute("height",`${ne}px`),this._element.appendChild(V)}_createColor({options:u,color:c,additionalRotation:g,x:l,y:h,height:b,width:E,name:N}){const K=E>b?E:b,Z=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");if(Z.setAttribute("x",String(l)),Z.setAttribute("y",String(h)),Z.setAttribute("height",String(b)),Z.setAttribute("width",String(E)),Z.setAttribute("clip-path",`url('#clip-path-${N}')`),u){let ne;if(u.type==="radial")ne=this._window.document.createElementNS("http://www.w3.org/2000/svg","radialGradient"),ne.setAttribute("id",N),ne.setAttribute("gradientUnits","userSpaceOnUse"),ne.setAttribute("fx",String(l+E/2)),ne.setAttribute("fy",String(h+b/2)),ne.setAttribute("cx",String(l+E/2)),ne.setAttribute("cy",String(h+b/2)),ne.setAttribute("r",String(K/2));else{const V=((u.rotation||0)+g)%(2*Math.PI),oe=(V+2*Math.PI)%(2*Math.PI);let ee=l+E/2,ie=h+b/2,O=l+E/2,L=h+b/2;oe>=0&&oe<=.25*Math.PI||oe>1.75*Math.PI&&oe<=2*Math.PI?(ee-=E/2,ie-=b/2*Math.tan(V),O+=E/2,L+=b/2*Math.tan(V)):oe>.25*Math.PI&&oe<=.75*Math.PI?(ie-=b/2,ee-=E/2/Math.tan(V),L+=b/2,O+=E/2/Math.tan(V)):oe>.75*Math.PI&&oe<=1.25*Math.PI?(ee+=E/2,ie+=b/2*Math.tan(V),O-=E/2,L-=b/2*Math.tan(V)):oe>1.25*Math.PI&&oe<=1.75*Math.PI&&(ie+=b/2,ee+=E/2/Math.tan(V),L-=b/2,O-=E/2/Math.tan(V)),ne=this._window.document.createElementNS("http://www.w3.org/2000/svg","linearGradient"),ne.setAttribute("id",N),ne.setAttribute("gradientUnits","userSpaceOnUse"),ne.setAttribute("x1",String(Math.round(ee))),ne.setAttribute("y1",String(Math.round(ie))),ne.setAttribute("x2",String(Math.round(O))),ne.setAttribute("y2",String(Math.round(L)))}u.colorStops.forEach(({offset:V,color:oe})=>{const ee=this._window.document.createElementNS("http://www.w3.org/2000/svg","stop");ee.setAttribute("offset",100*V+"%"),ee.setAttribute("stop-color",oe),ne.appendChild(ee)}),Z.setAttribute("fill",`url('#${N}')`),this._defs.appendChild(ne)}else c&&Z.setAttribute("fill",c);this._element.appendChild(Z)}}J.instanceCount=0;const z=J,H="canvas",F={};for(let v=0;v<=40;v++)F[v]=v;const $={type:H,shape:"square",width:300,height:300,data:"",margin:0,qrOptions:{typeNumber:F[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 te(v){const u=Object.assign({},v);if(!u.colorStops||!u.colorStops.length)throw"Field 'colorStops' is required in gradient";return u.rotation?u.rotation=Number(u.rotation):u.rotation=0,u.colorStops=u.colorStops.map(c=>Object.assign(Object.assign({},c),{offset:Number(c.offset)})),u}function X(v){const u=Object.assign({},v);return u.width=Number(u.width),u.height=Number(u.height),u.margin=Number(u.margin),u.imageOptions=Object.assign(Object.assign({},u.imageOptions),{hideBackgroundDots:!!u.imageOptions.hideBackgroundDots,imageSize:Number(u.imageOptions.imageSize),margin:Number(u.imageOptions.margin)}),u.margin>Math.min(u.width,u.height)&&(u.margin=Math.min(u.width,u.height)),u.dotsOptions=Object.assign({},u.dotsOptions),u.dotsOptions.gradient&&(u.dotsOptions.gradient=te(u.dotsOptions.gradient)),u.cornersSquareOptions&&(u.cornersSquareOptions=Object.assign({},u.cornersSquareOptions),u.cornersSquareOptions.gradient&&(u.cornersSquareOptions.gradient=te(u.cornersSquareOptions.gradient))),u.cornersDotOptions&&(u.cornersDotOptions=Object.assign({},u.cornersDotOptions),u.cornersDotOptions.gradient&&(u.cornersDotOptions.gradient=te(u.cornersDotOptions.gradient))),u.backgroundOptions&&(u.backgroundOptions=Object.assign({},u.backgroundOptions),u.backgroundOptions.gradient&&(u.backgroundOptions.gradient=te(u.backgroundOptions.gradient))),u}var q=s(873),ue=s.n(q);function de(v){if(!v)throw new Error("Extension must be defined");v[0]==="."&&(v=v.substring(1));const u={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(!u)throw new Error(`Extension "${v}" is not supported`);return u}class S{constructor(u){u!=null&&u.jsdom?this._window=new u.jsdom("",{resources:"usable"}).window:this._window=window,this._options=u?X(i($,u)):$,this.update()}static _clearContainer(u){u&&(u.innerHTML="")}_setupSvg(){if(!this._qr)return;const u=new z(this._options,this._window);this._svg=u.getElement(),this._svgDrawingPromise=u.drawQR(this._qr).then(()=>{var c;this._svg&&((c=this._extension)===null||c===void 0||c.call(this,u.getElement(),this._options))})}_setupCanvas(){var u,c;this._qr&&(!((u=this._options.nodeCanvas)===null||u===void 0)&&u.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=(c=this._svgDrawingPromise)===null||c===void 0?void 0:c.then(()=>{var g;if(!this._svg)return;const l=this._svg,h=new this._window.XMLSerializer().serializeToString(l),b=btoa(h),E=`data:${de("svg")};base64,${b}`;if(!((g=this._options.nodeCanvas)===null||g===void 0)&&g.loadImage)return this._options.nodeCanvas.loadImage(E).then(N=>{var K,Z;N.width=this._options.width,N.height=this._options.height,(Z=(K=this._nodeCanvas)===null||K===void 0?void 0:K.getContext("2d"))===null||Z===void 0||Z.drawImage(N,0,0)});{const N=new this._window.Image;return new Promise(K=>{N.onload=()=>{var Z,ne;(ne=(Z=this._domCanvas)===null||Z===void 0?void 0:Z.getContext("2d"))===null||ne===void 0||ne.drawImage(N,0,0),K()},N.src=E})}}))}async _getElement(u="png"){if(!this._qr)throw"QR code is empty";return u.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(u){S._clearContainer(this._container),this._options=u?X(i(this._options,u)):this._options,this._options.data&&(this._qr=ue()(this._options.qrOptions.typeNumber,this._options.qrOptions.errorCorrectionLevel),this._qr.addData(this._options.data,this._options.qrOptions.mode||function(c){switch(!0){case/^[0-9]*$/.test(c):return"Numeric";case/^[0-9A-Z $%*+\-./:]*$/.test(c):return"Alphanumeric";default:return"Byte"}}(this._options.data)),this._qr.make(),this._options.type===H?this._setupCanvas():this._setupSvg(),this.append(this._container))}append(u){if(u){if(typeof u.appendChild!="function")throw"Container should be a single DOM node";this._options.type===H?this._domCanvas&&u.appendChild(this._domCanvas):this._svg&&u.appendChild(this._svg),this._container=u}}applyExtension(u){if(!u)throw"Extension function should be defined.";this._extension=u,this.update()}deleteExtension(){this._extension=void 0,this.update()}async getRawData(u="png"){if(!this._qr)throw"QR code is empty";const c=await this._getElement(u),g=de(u);if(!c)return null;if(u.toLowerCase()==="svg"){const l=`<?xml version="1.0" standalone="no"?>\r
113
+ */var So;function za(){return So||(So=1,function(t,e){(function(r){var n;if(t.exports=r(),n=!0,!n){var s=window.Cookies,d=window.Cookies=r();d.noConflict=function(){return window.Cookies=s,d}}})(function(){function r(){for(var d=0,f={};d<arguments.length;d++){var i=arguments[d];for(var m in i)f[m]=i[m]}return f}function n(d){return d.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function s(d){function f(){}function i(y,_,M){if(!(typeof document>"u")){M=r({path:"/"},f.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{}_=d.write?d.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 P in M)M[P]&&(S+="; "+P,M[P]!==!0&&(S+="="+M[P].split(";")[0]));return document.cookie=y+"="+_+S}}function m(y,_){if(!(typeof document>"u")){for(var M={},x=document.cookie?document.cookie.split("; "):[],S=0;S<x.length;S++){var P=x[S].split("="),A=P.slice(1).join("=");!_&&A.charAt(0)==='"'&&(A=A.slice(1,-1));try{var B=n(P[0]);if(A=(d.read||d)(A,B)||n(A),_)try{A=JSON.parse(A)}catch{}if(M[B]=A,y===B)break}catch{}}return y?M[y]:M}}return f.set=i,f.get=function(y){return m(y,!1)},f.getJSON=function(y){return m(y,!0)},f.remove=function(y,_){i(y,"",r(_,{expires:-1}))},f.defaults={},f.withConverter=s,f}return s(function(){})})}(Co)),Co.exports}za();function Fa(){if(!window.MantineCognitoUserPool)throw new Error("Cognito Userpool has not been initialized.");return window.MantineCognitoUserPool}function Ua(){return Fa().getCurrentUser()}function qa(){return new Promise((t,e)=>{const r=Ua();r===null&&e(null),r?.getSession((n,s)=>{if(n!==null||s===null)return e(null);t({session:s,authenticatedUser:r})})})}async function Wa(){const{session:t}=await qa();return t?.getIdToken().getJwtToken()}re.createContext(void 0);var Va="undefined",Ha="object",Xt="browser",Do="cpu",ko="device",Vr="engine",er="os",it="name",tr="type",Hr="vendor",Ke="version",Gr="architecture",Qr="major",Kr="model",Ga="console",Qa="mobile",Ka="tablet",Za="smarttv",Ja="wearable",Xa="embedded",el=typeof window!==Va,Zr=el&&window.navigator?window.navigator:void 0;Zr&&Zr.userAgentData&&Zr.userAgentData;var rr=function(t){for(var e={},r=0;r<t.length;r++)e[t[r].toUpperCase()]=t[r];return e},nr=function(t){for(var e in t){var r=t[e];typeof r==Ha&&r.length==2?this[r[0]]=r[1]:this[r]=void 0}return this};(function(){var t={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return nr.call(t.init,[[Xt,[it,Ke,Qr,tr]],[Do,[Gr]],[ko,[tr,Kr,Hr]],[Vr,[it,Ke]],[er,[it,Ke]]]),nr.call(t.isIgnore,[[Xt,[Ke,Qr]],[Vr,[Ke]],[er,[Ke]]]),nr.call(t.isIgnoreRgx,[[Xt,/ ?browser$/i],[er,/ ?os$/i]]),nr.call(t.toString,[[Xt,[it,Ke]],[Do,[Gr]],[ko,[Hr,Kr]],[Vr,[it,Ke]],[er,[it,Ke]]]),t})(),rr([it,Ke,Qr,tr]),rr([Gr]),rr([Kr,Hr,tr,Ga,Qa,Za,Ka,Ja,Xa]),rr([it,Ke]);var Jr={exports:{}},tl=Jr.exports,Mo;function rl(){return Mo||(Mo=1,function(t,e){(function(r,n){t.exports=n()})(tl,()=>(()=>{var r={873:(f,i)=>{var m,y,_=function(){var M=function(D,C){var v=D,u=Q[C],c=null,g=0,l=null,h=[],b={},T=function(O,L){c=function(j){for(var Y=new Array(j),I=0;I<j;I+=1){Y[I]=new Array(j);for(var ce=0;ce<j;ce+=1)Y[I][ce]=null}return Y}(g=4*v+17),R(0,0),R(g-7,0),R(0,g-7),Z(),K(),V(O,L),v>=7&&ne(O),l==null&&(l=ee(v,u,h)),oe(l,L)},R=function(O,L){for(var j=-1;j<=7;j+=1)if(!(O+j<=-1||g<=O+j))for(var Y=-1;Y<=7;Y+=1)L+Y<=-1||g<=L+Y||(c[O+j][L+Y]=0<=j&&j<=6&&(Y==0||Y==6)||0<=Y&&Y<=6&&(j==0||j==6)||2<=j&&j<=4&&2<=Y&&Y<=4)},K=function(){for(var O=8;O<g-8;O+=1)c[O][6]==null&&(c[O][6]=O%2==0);for(var L=8;L<g-8;L+=1)c[6][L]==null&&(c[6][L]=L%2==0)},Z=function(){for(var O=W.getPatternPosition(v),L=0;L<O.length;L+=1)for(var j=0;j<O.length;j+=1){var Y=O[L],I=O[j];if(c[Y][I]==null)for(var ce=-2;ce<=2;ce+=1)for(var o=-2;o<=2;o+=1)c[Y+ce][I+o]=ce==-2||ce==2||o==-2||o==2||ce==0&&o==0}},ne=function(O){for(var L=W.getBCHTypeNumber(v),j=0;j<18;j+=1){var Y=!O&&(L>>j&1)==1;c[Math.floor(j/3)][j%3+g-8-3]=Y}for(j=0;j<18;j+=1)Y=!O&&(L>>j&1)==1,c[j%3+g-8-3][Math.floor(j/3)]=Y},V=function(O,L){for(var j=u<<3|L,Y=W.getBCHTypeInfo(j),I=0;I<15;I+=1){var ce=!O&&(Y>>I&1)==1;I<6?c[I][8]=ce:I<8?c[I+1][8]=ce:c[g-15+I][8]=ce}for(I=0;I<15;I+=1)ce=!O&&(Y>>I&1)==1,I<8?c[8][g-I-1]=ce:I<9?c[8][15-I-1+1]=ce:c[8][15-I-1]=ce;c[g-8][8]=!O},oe=function(O,L){for(var j=-1,Y=g-1,I=7,ce=0,o=W.getMaskFunction(L),a=g-1;a>0;a-=2)for(a==6&&(a-=1);;){for(var p=0;p<2;p+=1)if(c[Y][a-p]==null){var k=!1;ce<O.length&&(k=(O[ce]>>>I&1)==1),o(Y,a-p)&&(k=!k),c[Y][a-p]=k,(I-=1)==-1&&(ce+=1,I=7)}if((Y+=j)<0||g<=Y){Y-=j,j=-j;break}}},ee=function(O,L,j){for(var Y=z.getRSBlocks(O,L),I=H(),ce=0;ce<j.length;ce+=1){var o=j[ce];I.put(o.getMode(),4),I.put(o.getLength(),W.getLengthInBits(o.getMode(),O)),o.write(I)}var a=0;for(ce=0;ce<Y.length;ce+=1)a+=Y[ce].dataCount;if(I.getLengthInBits()>8*a)throw"code length overflow. ("+I.getLengthInBits()+">"+8*a+")";for(I.getLengthInBits()+4<=8*a&&I.put(0,4);I.getLengthInBits()%8!=0;)I.putBit(!1);for(;!(I.getLengthInBits()>=8*a||(I.put(236,8),I.getLengthInBits()>=8*a));)I.put(17,8);return function(p,k){for(var N=0,U=0,le=0,se=new Array(k.length),fe=new Array(k.length),ae=0;ae<k.length;ae+=1){var ge=k[ae].dataCount,ve=k[ae].totalCount-ge;U=Math.max(U,ge),le=Math.max(le,ve),se[ae]=new Array(ge);for(var pe=0;pe<se[ae].length;pe+=1)se[ae][pe]=255&p.getBuffer()[pe+N];N+=ge;var xe=W.getErrorCorrectPolynomial(ve),_e=J(se[ae],xe.getLength()-1).mod(xe);for(fe[ae]=new Array(xe.getLength()-1),pe=0;pe<fe[ae].length;pe+=1){var Ce=pe+_e.getLength()-fe[ae].length;fe[ae][pe]=Ce>=0?_e.getAt(Ce):0}}var Be=0;for(pe=0;pe<k.length;pe+=1)Be+=k[pe].totalCount;var Oe=new Array(Be),Se=0;for(pe=0;pe<U;pe+=1)for(ae=0;ae<k.length;ae+=1)pe<se[ae].length&&(Oe[Se]=se[ae][pe],Se+=1);for(pe=0;pe<le;pe+=1)for(ae=0;ae<k.length;ae+=1)pe<fe[ae].length&&(Oe[Se]=fe[ae][pe],Se+=1);return Oe}(I,Y)};b.addData=function(O,L){var j=null;switch(L=L||"Byte"){case"Numeric":j=F(O);break;case"Alphanumeric":j=$(O);break;case"Byte":j=te(O);break;case"Kanji":j=X(O);break;default:throw"mode:"+L}h.push(j),l=null},b.isDark=function(O,L){if(O<0||g<=O||L<0||g<=L)throw O+","+L;return c[O][L]},b.getModuleCount=function(){return g},b.make=function(){if(v<1){for(var O=1;O<40;O++){for(var L=z.getRSBlocks(O,u),j=H(),Y=0;Y<h.length;Y++){var I=h[Y];j.put(I.getMode(),4),j.put(I.getLength(),W.getLengthInBits(I.getMode(),O)),I.write(j)}var ce=0;for(Y=0;Y<L.length;Y++)ce+=L[Y].dataCount;if(j.getLengthInBits()<=8*ce)break}v=O}T(!1,function(){for(var o=0,a=0,p=0;p<8;p+=1){T(!0,p);var k=W.getLostPoint(b);(p==0||o>k)&&(o=k,a=p)}return a}())},b.createTableTag=function(O,L){O=O||2;var j="";j+='<table style="',j+=" border-width: 0px; border-style: none;",j+=" border-collapse: collapse;",j+=" padding: 0px; margin: "+(L=L===void 0?4*O:L)+"px;",j+='">',j+="<tbody>";for(var Y=0;Y<b.getModuleCount();Y+=1){j+="<tr>";for(var I=0;I<b.getModuleCount();I+=1)j+='<td style="',j+=" border-width: 0px; border-style: none;",j+=" border-collapse: collapse;",j+=" padding: 0px; margin: 0px;",j+=" width: "+O+"px;",j+=" height: "+O+"px;",j+=" background-color: ",j+=b.isDark(Y,I)?"#000000":"#ffffff",j+=";",j+='"/>';j+="</tr>"}return(j+="</tbody>")+"</table>"},b.createSvgTag=function(O,L,j,Y){var I={};typeof arguments[0]=="object"&&(O=(I=arguments[0]).cellSize,L=I.margin,j=I.alt,Y=I.title),O=O||2,L=L===void 0?4*O:L,(j=typeof j=="string"?{text:j}:j||{}).text=j.text||null,j.id=j.text?j.id||"qrcode-description":null,(Y=typeof Y=="string"?{text:Y}:Y||{}).text=Y.text||null,Y.id=Y.text?Y.id||"qrcode-title":null;var ce,o,a,p,k=b.getModuleCount()*O+2*L,N="";for(p="l"+O+",0 0,"+O+" -"+O+",0 0,-"+O+"z ",N+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',N+=I.scalable?"":' width="'+k+'px" height="'+k+'px"',N+=' viewBox="0 0 '+k+" "+k+'" ',N+=' preserveAspectRatio="xMinYMin meet"',N+=Y.text||j.text?' role="img" aria-labelledby="'+ie([Y.id,j.id].join(" ").trim())+'"':"",N+=">",N+=Y.text?'<title id="'+ie(Y.id)+'">'+ie(Y.text)+"</title>":"",N+=j.text?'<description id="'+ie(j.id)+'">'+ie(j.text)+"</description>":"",N+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',N+='<path d="',o=0;o<b.getModuleCount();o+=1)for(a=o*O+L,ce=0;ce<b.getModuleCount();ce+=1)b.isDark(o,ce)&&(N+="M"+(ce*O+L)+","+a+p);return(N+='" stroke="transparent" fill="black"/>')+"</svg>"},b.createDataURL=function(O,L){O=O||2,L=L===void 0?4*O:L;var j=b.getModuleCount()*O+2*L,Y=L,I=j-L;return de(j,j,function(ce,o){if(Y<=ce&&ce<I&&Y<=o&&o<I){var a=Math.floor((ce-Y)/O),p=Math.floor((o-Y)/O);return b.isDark(p,a)?0:1}return 1})},b.createImgTag=function(O,L,j){O=O||2,L=L===void 0?4*O:L;var Y=b.getModuleCount()*O+2*L,I="";return I+="<img",I+=' src="',I+=b.createDataURL(O,L),I+='"',I+=' width="',I+=Y,I+='"',I+=' height="',I+=Y,I+='"',j&&(I+=' alt="',I+=ie(j),I+='"'),I+"/>"};var ie=function(O){for(var L="",j=0;j<O.length;j+=1){var Y=O.charAt(j);switch(Y){case"<":L+="&lt;";break;case">":L+="&gt;";break;case"&":L+="&amp;";break;case'"':L+="&quot;";break;default:L+=Y}}return L};return b.createASCII=function(O,L){if((O=O||1)<2)return function(se){se=se===void 0?2:se;var fe,ae,ge,ve,pe,xe=1*b.getModuleCount()+2*se,_e=se,Ce=xe-se,Be={"██":"█","█ ":"▀"," █":"▄"," ":" "},Oe={"██":"▀","█ ":"▀"," █":" "," ":" "},Se="";for(fe=0;fe<xe;fe+=2){for(ge=Math.floor((fe-_e)/1),ve=Math.floor((fe+1-_e)/1),ae=0;ae<xe;ae+=1)pe="█",_e<=ae&&ae<Ce&&_e<=fe&&fe<Ce&&b.isDark(ge,Math.floor((ae-_e)/1))&&(pe=" "),_e<=ae&&ae<Ce&&_e<=fe+1&&fe+1<Ce&&b.isDark(ve,Math.floor((ae-_e)/1))?pe+=" ":pe+="█",Se+=se<1&&fe+1>=Ce?Oe[pe]:Be[pe];Se+=`
114
+ `}return xe%2&&se>0?Se.substring(0,Se.length-xe-1)+Array(xe+1).join("▀"):Se.substring(0,Se.length-1)}(L);O-=1,L=L===void 0?2*O:L;var j,Y,I,ce,o=b.getModuleCount()*O+2*L,a=L,p=o-L,k=Array(O+1).join("██"),N=Array(O+1).join(" "),U="",le="";for(j=0;j<o;j+=1){for(I=Math.floor((j-a)/O),le="",Y=0;Y<o;Y+=1)ce=1,a<=Y&&Y<p&&a<=j&&j<p&&b.isDark(I,Math.floor((Y-a)/O))&&(ce=0),le+=ce?k:N;for(I=0;I<O;I+=1)U+=le+`
115
+ `}return U.substring(0,U.length-1)},b.renderTo2dContext=function(O,L){L=L||2;for(var j=b.getModuleCount(),Y=0;Y<j;Y++)for(var I=0;I<j;I++)O.fillStyle=b.isDark(Y,I)?"black":"white",O.fillRect(Y*L,I*L,L,L)},b};M.stringToBytes=(M.stringToBytesFuncs={default:function(D){for(var C=[],v=0;v<D.length;v+=1){var u=D.charCodeAt(v);C.push(255&u)}return C}}).default,M.createStringToBytes=function(D,C){var v=function(){for(var c=ue(D),g=function(){var K=c.read();if(K==-1)throw"eof";return K},l=0,h={};;){var b=c.read();if(b==-1)break;var T=g(),R=g()<<8|g();h[String.fromCharCode(b<<8|T)]=R,l+=1}if(l!=C)throw l+" != "+C;return h}(),u=63;return function(c){for(var g=[],l=0;l<c.length;l+=1){var h=c.charCodeAt(l);if(h<128)g.push(h);else{var b=v[c.charAt(l)];typeof b=="number"?(255&b)==b?g.push(b):(g.push(b>>>8),g.push(255&b)):g.push(u)}}return g}};var x,S,P,A,B,Q={L:1,M:0,Q:3,H:2},W=(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,P=7973,B=function(D){for(var C=0;D!=0;)C+=1,D>>>=1;return C},(A={}).getBCHTypeInfo=function(D){for(var C=D<<10;B(C)-B(S)>=0;)C^=S<<B(C)-B(S);return 21522^(D<<10|C)},A.getBCHTypeNumber=function(D){for(var C=D<<12;B(C)-B(P)>=0;)C^=P<<B(C)-B(P);return D<<12|C},A.getPatternPosition=function(D){return x[D-1]},A.getMaskFunction=function(D){switch(D){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:"+D}},A.getErrorCorrectPolynomial=function(D){for(var C=J([1],0),v=0;v<D;v+=1)C=C.multiply(J([1,G.gexp(v)],0));return C},A.getLengthInBits=function(D,C){if(1<=C&&C<10)switch(D){case 1:return 10;case 2:return 9;case 4:case 8:return 8;default:throw"mode:"+D}else if(C<27)switch(D){case 1:return 12;case 2:return 11;case 4:return 16;case 8:return 10;default:throw"mode:"+D}else{if(!(C<41))throw"type:"+C;switch(D){case 1:return 14;case 2:return 13;case 4:return 16;case 8:return 12;default:throw"mode:"+D}}},A.getLostPoint=function(D){for(var C=D.getModuleCount(),v=0,u=0;u<C;u+=1)for(var c=0;c<C;c+=1){for(var g=0,l=D.isDark(u,c),h=-1;h<=1;h+=1)if(!(u+h<0||C<=u+h))for(var b=-1;b<=1;b+=1)c+b<0||C<=c+b||h==0&&b==0||l==D.isDark(u+h,c+b)&&(g+=1);g>5&&(v+=3+g-5)}for(u=0;u<C-1;u+=1)for(c=0;c<C-1;c+=1){var T=0;D.isDark(u,c)&&(T+=1),D.isDark(u+1,c)&&(T+=1),D.isDark(u,c+1)&&(T+=1),D.isDark(u+1,c+1)&&(T+=1),T!=0&&T!=4||(v+=3)}for(u=0;u<C;u+=1)for(c=0;c<C-6;c+=1)D.isDark(u,c)&&!D.isDark(u,c+1)&&D.isDark(u,c+2)&&D.isDark(u,c+3)&&D.isDark(u,c+4)&&!D.isDark(u,c+5)&&D.isDark(u,c+6)&&(v+=40);for(c=0;c<C;c+=1)for(u=0;u<C-6;u+=1)D.isDark(u,c)&&!D.isDark(u+1,c)&&D.isDark(u+2,c)&&D.isDark(u+3,c)&&D.isDark(u+4,c)&&!D.isDark(u+5,c)&&D.isDark(u+6,c)&&(v+=40);var R=0;for(c=0;c<C;c+=1)for(u=0;u<C;u+=1)D.isDark(u,c)&&(R+=1);return v+Math.abs(100*R/C/C-50)/5*10},A),G=function(){for(var D=new Array(256),C=new Array(256),v=0;v<8;v+=1)D[v]=1<<v;for(v=8;v<256;v+=1)D[v]=D[v-4]^D[v-5]^D[v-6]^D[v-8];for(v=0;v<255;v+=1)C[D[v]]=v;return{glog:function(u){if(u<1)throw"glog("+u+")";return C[u]},gexp:function(u){for(;u<0;)u+=255;for(;u>=256;)u-=255;return D[u]}}}();function J(D,C){if(D.length===void 0)throw D.length+"/"+C;var v=function(){for(var c=0;c<D.length&&D[c]==0;)c+=1;for(var g=new Array(D.length-c+C),l=0;l<D.length-c;l+=1)g[l]=D[l+c];return g}(),u={getAt:function(c){return v[c]},getLength:function(){return v.length},multiply:function(c){for(var g=new Array(u.getLength()+c.getLength()-1),l=0;l<u.getLength();l+=1)for(var h=0;h<c.getLength();h+=1)g[l+h]^=G.gexp(G.glog(u.getAt(l))+G.glog(c.getAt(h)));return J(g,0)},mod:function(c){if(u.getLength()-c.getLength()<0)return u;for(var g=G.glog(u.getAt(0))-G.glog(c.getAt(0)),l=new Array(u.getLength()),h=0;h<u.getLength();h+=1)l[h]=u.getAt(h);for(h=0;h<c.getLength();h+=1)l[h]^=G.gexp(G.glog(c.getAt(h))+g);return J(l,0).mod(c)}};return u}var z=function(){var D=[[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(u,c){var g={};return g.totalCount=u,g.dataCount=c,g},v={getRSBlocks:function(u,c){var g=function(ne,V){switch(V){case Q.L:return D[4*(ne-1)+0];case Q.M:return D[4*(ne-1)+1];case Q.Q:return D[4*(ne-1)+2];case Q.H:return D[4*(ne-1)+3];default:return}}(u,c);if(g===void 0)throw"bad rs block @ typeNumber:"+u+"/errorCorrectionLevel:"+c;for(var l=g.length/3,h=[],b=0;b<l;b+=1)for(var T=g[3*b+0],R=g[3*b+1],K=g[3*b+2],Z=0;Z<T;Z+=1)h.push(C(R,K));return h}};return v}(),H=function(){var D=[],C=0,v={getBuffer:function(){return D},getAt:function(u){var c=Math.floor(u/8);return(D[c]>>>7-u%8&1)==1},put:function(u,c){for(var g=0;g<c;g+=1)v.putBit((u>>>c-g-1&1)==1)},getLengthInBits:function(){return C},putBit:function(u){var c=Math.floor(C/8);D.length<=c&&D.push(0),u&&(D[c]|=128>>>C%8),C+=1}};return v},F=function(D){var C=D,v={getMode:function(){return 1},getLength:function(g){return C.length},write:function(g){for(var l=C,h=0;h+2<l.length;)g.put(u(l.substring(h,h+3)),10),h+=3;h<l.length&&(l.length-h==1?g.put(u(l.substring(h,h+1)),4):l.length-h==2&&g.put(u(l.substring(h,h+2)),7))}},u=function(g){for(var l=0,h=0;h<g.length;h+=1)l=10*l+c(g.charAt(h));return l},c=function(g){if("0"<=g&&g<="9")return g.charCodeAt(0)-48;throw"illegal char :"+g};return v},$=function(D){var C=D,v={getMode:function(){return 2},getLength:function(c){return C.length},write:function(c){for(var g=C,l=0;l+1<g.length;)c.put(45*u(g.charAt(l))+u(g.charAt(l+1)),11),l+=2;l<g.length&&c.put(u(g.charAt(l)),6)}},u=function(c){if("0"<=c&&c<="9")return c.charCodeAt(0)-48;if("A"<=c&&c<="Z")return c.charCodeAt(0)-65+10;switch(c){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 :"+c}};return v},te=function(D){var C=M.stringToBytes(D);return{getMode:function(){return 4},getLength:function(v){return C.length},write:function(v){for(var u=0;u<C.length;u+=1)v.put(C[u],8)}}},X=function(D){var C=M.stringToBytesFuncs.SJIS;if(!C)throw"sjis not supported.";(function(){var c=C("友");if(c.length!=2||(c[0]<<8|c[1])!=38726)throw"sjis not supported."})();var v=C(D),u={getMode:function(){return 8},getLength:function(c){return~~(v.length/2)},write:function(c){for(var g=v,l=0;l+1<g.length;){var h=(255&g[l])<<8|255&g[l+1];if(33088<=h&&h<=40956)h-=33088;else{if(!(57408<=h&&h<=60351))throw"illegal char at "+(l+1)+"/"+h;h-=49472}h=192*(h>>>8&255)+(255&h),c.put(h,13),l+=2}if(l<g.length)throw"illegal char at "+(l+1)}};return u},q=function(){var D=[],C={writeByte:function(v){D.push(255&v)},writeShort:function(v){C.writeByte(v),C.writeByte(v>>>8)},writeBytes:function(v,u,c){u=u||0,c=c||v.length;for(var g=0;g<c;g+=1)C.writeByte(v[g+u])},writeString:function(v){for(var u=0;u<v.length;u+=1)C.writeByte(v.charCodeAt(u))},toByteArray:function(){return D},toString:function(){var v="";v+="[";for(var u=0;u<D.length;u+=1)u>0&&(v+=","),v+=D[u];return v+"]"}};return C},ue=function(D){var C=D,v=0,u=0,c=0,g={read:function(){for(;c<8;){if(v>=C.length){if(c==0)return-1;throw"unexpected end of file./"+c}var h=C.charAt(v);if(v+=1,h=="=")return c=0,-1;h.match(/^\s$/)||(u=u<<6|l(h.charCodeAt(0)),c+=6)}var b=u>>>c-8&255;return c-=8,b}},l=function(h){if(65<=h&&h<=90)return h-65;if(97<=h&&h<=122)return h-97+26;if(48<=h&&h<=57)return h-48+52;if(h==43)return 62;if(h==47)return 63;throw"c:"+h};return g},de=function(D,C,v){for(var u=function(R,K){var Z=R,ne=K,V=new Array(R*K),oe={setPixel:function(O,L,j){V[L*Z+O]=j},write:function(O){O.writeString("GIF87a"),O.writeShort(Z),O.writeShort(ne),O.writeByte(128),O.writeByte(0),O.writeByte(0),O.writeByte(0),O.writeByte(0),O.writeByte(0),O.writeByte(255),O.writeByte(255),O.writeByte(255),O.writeString(","),O.writeShort(0),O.writeShort(0),O.writeShort(Z),O.writeShort(ne),O.writeByte(0);var L=ee(2);O.writeByte(2);for(var j=0;L.length-j>255;)O.writeByte(255),O.writeBytes(L,j,255),j+=255;O.writeByte(L.length-j),O.writeBytes(L,j,L.length-j),O.writeByte(0),O.writeString(";")}},ee=function(O){for(var L=1<<O,j=1+(1<<O),Y=O+1,I=ie(),ce=0;ce<L;ce+=1)I.add(String.fromCharCode(ce));I.add(String.fromCharCode(L)),I.add(String.fromCharCode(j));var o,a,p,k=q(),N=(o=k,a=0,p=0,{write:function(fe,ae){if(fe>>>ae)throw"length over";for(;a+ae>=8;)o.writeByte(255&(fe<<a|p)),ae-=8-a,fe>>>=8-a,p=0,a=0;p|=fe<<a,a+=ae},flush:function(){a>0&&o.writeByte(p)}});N.write(L,Y);var U=0,le=String.fromCharCode(V[U]);for(U+=1;U<V.length;){var se=String.fromCharCode(V[U]);U+=1,I.contains(le+se)?le+=se:(N.write(I.indexOf(le),Y),I.size()<4095&&(I.size()==1<<Y&&(Y+=1),I.add(le+se)),le=se)}return N.write(I.indexOf(le),Y),N.write(j,Y),N.flush(),k.toByteArray()},ie=function(){var O={},L=0,j={add:function(Y){if(j.contains(Y))throw"dup key:"+Y;O[Y]=L,L+=1},size:function(){return L},indexOf:function(Y){return O[Y]},contains:function(Y){return O[Y]!==void 0}};return j};return oe}(D,C),c=0;c<C;c+=1)for(var g=0;g<D;g+=1)u.setPixel(g,c,v(g,c));var l=q();u.write(l);for(var h=function(){var R=0,K=0,Z=0,ne="",V={},oe=function(ie){ne+=String.fromCharCode(ee(63&ie))},ee=function(ie){if(!(ie<0)){if(ie<26)return 65+ie;if(ie<52)return ie-26+97;if(ie<62)return ie-52+48;if(ie==62)return 43;if(ie==63)return 47}throw"n:"+ie};return V.writeByte=function(ie){for(R=R<<8|255&ie,K+=8,Z+=1;K>=6;)oe(R>>>K-6),K-=6},V.flush=function(){if(K>0&&(oe(R<<6-K),R=0,K=0),Z%3!=0)for(var ie=3-Z%3,O=0;O<ie;O+=1)ne+="="},V.toString=function(){return ne},V}(),b=l.toByteArray(),T=0;T<b.length;T+=1)h.writeByte(b[T]);return h.flush(),"data:image/gif;base64,"+h};return M}();_.stringToBytesFuncs["UTF-8"]=function(M){return function(x){for(var S=[],P=0;P<x.length;P++){var A=x.charCodeAt(P);A<128?S.push(A):A<2048?S.push(192|A>>6,128|63&A):A<55296||A>=57344?S.push(224|A>>12,128|A>>6&63,128|63&A):(P++,A=65536+((1023&A)<<10|1023&x.charCodeAt(P)),S.push(240|A>>18,128|A>>12&63,128|A>>6&63,128|63&A))}return S}(M)},(y=typeof(m=function(){return _})=="function"?m.apply(i,[]):m)===void 0||(f.exports=y)}},n={};function s(f){var i=n[f];if(i!==void 0)return i.exports;var m=n[f]={exports:{}};return r[f](m,m.exports,s),m.exports}s.n=f=>{var i=f&&f.__esModule?()=>f.default:()=>f;return s.d(i,{a:i}),i},s.d=(f,i)=>{for(var m in i)s.o(i,m)&&!s.o(f,m)&&Object.defineProperty(f,m,{enumerable:!0,get:i[m]})},s.o=(f,i)=>Object.prototype.hasOwnProperty.call(f,i);var d={};return(()=>{s.d(d,{default:()=>C});const f=v=>!!v&&typeof v=="object"&&!Array.isArray(v);function i(v,...u){if(!u.length)return v;const c=u.shift();return c!==void 0&&f(v)&&f(c)?(v=Object.assign({},v),Object.keys(c).forEach(g=>{const l=v[g],h=c[g];Array.isArray(l)&&Array.isArray(h)?v[g]=h:f(l)&&f(h)?v[g]=i(Object.assign({},l),h):v[g]=h}),i(v,...u)):v}function m(v,u){const c=document.createElement("a");c.download=u,c.href=v,document.body.appendChild(c),c.click(),document.body.removeChild(c)}const y={L:.07,M:.15,Q:.25,H:.3};class _{constructor({svg:u,type:c,window:g}){this._svg=u,this._type=c,this._window=g}draw(u,c,g,l){let h;switch(this._type){case"dots":h=this._drawDot;break;case"classy":h=this._drawClassy;break;case"classy-rounded":h=this._drawClassyRounded;break;case"rounded":h=this._drawRounded;break;case"extra-rounded":h=this._drawExtraRounded;break;default:h=this._drawSquare}h.call(this,{x:u,y:c,size:g,getNeighbor:l})}_rotateFigure({x:u,y:c,size:g,rotation:l=0,draw:h}){var b;const T=u+g/2,R=c+g/2;h(),(b=this._element)===null||b===void 0||b.setAttribute("transform",`rotate(${180*l/Math.PI},${T},${R})`)}_basicDot(u){const{size:c,x:g,y:l}=u;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(g+c/2)),this._element.setAttribute("cy",String(l+c/2)),this._element.setAttribute("r",String(c/2))}}))}_basicSquare(u){const{size:c,x:g,y:l}=u;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(g)),this._element.setAttribute("y",String(l)),this._element.setAttribute("width",String(c)),this._element.setAttribute("height",String(c))}}))}_basicSideRounded(u){const{size:c,x:g,y:l}=u;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${g} ${l}v ${c}h `+c/2+`a ${c/2} ${c/2}, 0, 0, 0, 0 ${-c}`)}}))}_basicCornerRounded(u){const{size:c,x:g,y:l}=u;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${g} ${l}v ${c}h ${c}v `+-c/2+`a ${c/2} ${c/2}, 0, 0, 0, ${-c/2} ${-c/2}`)}}))}_basicCornerExtraRounded(u){const{size:c,x:g,y:l}=u;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${g} ${l}v ${c}h ${c}a ${c} ${c}, 0, 0, 0, ${-c} ${-c}`)}}))}_basicCornersRounded(u){const{size:c,x:g,y:l}=u;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${g} ${l}v `+c/2+`a ${c/2} ${c/2}, 0, 0, 0, ${c/2} ${c/2}h `+c/2+"v "+-c/2+`a ${c/2} ${c/2}, 0, 0, 0, ${-c/2} ${-c/2}`)}}))}_drawDot({x:u,y:c,size:g}){this._basicDot({x:u,y:c,size:g,rotation:0})}_drawSquare({x:u,y:c,size:g}){this._basicSquare({x:u,y:c,size:g,rotation:0})}_drawRounded({x:u,y:c,size:g,getNeighbor:l}){const h=l?+l(-1,0):0,b=l?+l(1,0):0,T=l?+l(0,-1):0,R=l?+l(0,1):0,K=h+b+T+R;if(K!==0)if(K>2||h&&b||T&&R)this._basicSquare({x:u,y:c,size:g,rotation:0});else{if(K===2){let Z=0;return h&&T?Z=Math.PI/2:T&&b?Z=Math.PI:b&&R&&(Z=-Math.PI/2),void this._basicCornerRounded({x:u,y:c,size:g,rotation:Z})}if(K===1){let Z=0;return T?Z=Math.PI/2:b?Z=Math.PI:R&&(Z=-Math.PI/2),void this._basicSideRounded({x:u,y:c,size:g,rotation:Z})}}else this._basicDot({x:u,y:c,size:g,rotation:0})}_drawExtraRounded({x:u,y:c,size:g,getNeighbor:l}){const h=l?+l(-1,0):0,b=l?+l(1,0):0,T=l?+l(0,-1):0,R=l?+l(0,1):0,K=h+b+T+R;if(K!==0)if(K>2||h&&b||T&&R)this._basicSquare({x:u,y:c,size:g,rotation:0});else{if(K===2){let Z=0;return h&&T?Z=Math.PI/2:T&&b?Z=Math.PI:b&&R&&(Z=-Math.PI/2),void this._basicCornerExtraRounded({x:u,y:c,size:g,rotation:Z})}if(K===1){let Z=0;return T?Z=Math.PI/2:b?Z=Math.PI:R&&(Z=-Math.PI/2),void this._basicSideRounded({x:u,y:c,size:g,rotation:Z})}}else this._basicDot({x:u,y:c,size:g,rotation:0})}_drawClassy({x:u,y:c,size:g,getNeighbor:l}){const h=l?+l(-1,0):0,b=l?+l(1,0):0,T=l?+l(0,-1):0,R=l?+l(0,1):0;h+b+T+R!==0?h||T?b||R?this._basicSquare({x:u,y:c,size:g,rotation:0}):this._basicCornerRounded({x:u,y:c,size:g,rotation:Math.PI/2}):this._basicCornerRounded({x:u,y:c,size:g,rotation:-Math.PI/2}):this._basicCornersRounded({x:u,y:c,size:g,rotation:Math.PI/2})}_drawClassyRounded({x:u,y:c,size:g,getNeighbor:l}){const h=l?+l(-1,0):0,b=l?+l(1,0):0,T=l?+l(0,-1):0,R=l?+l(0,1):0;h+b+T+R!==0?h||T?b||R?this._basicSquare({x:u,y:c,size:g,rotation:0}):this._basicCornerExtraRounded({x:u,y:c,size:g,rotation:Math.PI/2}):this._basicCornerExtraRounded({x:u,y:c,size:g,rotation:-Math.PI/2}):this._basicCornersRounded({x:u,y:c,size:g,rotation:Math.PI/2})}}const M={dot:"dot",square:"square",extraRounded:"extra-rounded"},x=Object.values(M);class S{constructor({svg:u,type:c,window:g}){this._svg=u,this._type=c,this._window=g}draw(u,c,g,l){let h;switch(this._type){case M.square:h=this._drawSquare;break;case M.extraRounded:h=this._drawExtraRounded;break;default:h=this._drawDot}h.call(this,{x:u,y:c,size:g,rotation:l})}_rotateFigure({x:u,y:c,size:g,rotation:l=0,draw:h}){var b;const T=u+g/2,R=c+g/2;h(),(b=this._element)===null||b===void 0||b.setAttribute("transform",`rotate(${180*l/Math.PI},${T},${R})`)}_basicDot(u){const{size:c,x:g,y:l}=u,h=c/7;this._rotateFigure(Object.assign(Object.assign({},u),{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 ${g+c/2} ${l}a ${c/2} ${c/2} 0 1 0 0.1 0zm 0 ${h}a ${c/2-h} ${c/2-h} 0 1 1 -0.1 0Z`)}}))}_basicSquare(u){const{size:c,x:g,y:l}=u,h=c/7;this._rotateFigure(Object.assign(Object.assign({},u),{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 ${g} ${l}v ${c}h ${c}v `+-c+`zM ${g+h} ${l+h}h `+(c-2*h)+"v "+(c-2*h)+"h "+(2*h-c)+"z")}}))}_basicExtraRounded(u){const{size:c,x:g,y:l}=u,h=c/7;this._rotateFigure(Object.assign(Object.assign({},u),{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 ${g} ${l+2.5*h}v `+2*h+`a ${2.5*h} ${2.5*h}, 0, 0, 0, ${2.5*h} ${2.5*h}h `+2*h+`a ${2.5*h} ${2.5*h}, 0, 0, 0, ${2.5*h} ${2.5*-h}v `+-2*h+`a ${2.5*h} ${2.5*h}, 0, 0, 0, ${2.5*-h} ${2.5*-h}h `+-2*h+`a ${2.5*h} ${2.5*h}, 0, 0, 0, ${2.5*-h} ${2.5*h}M ${g+2.5*h} ${l+h}h `+2*h+`a ${1.5*h} ${1.5*h}, 0, 0, 1, ${1.5*h} ${1.5*h}v `+2*h+`a ${1.5*h} ${1.5*h}, 0, 0, 1, ${1.5*-h} ${1.5*h}h `+-2*h+`a ${1.5*h} ${1.5*h}, 0, 0, 1, ${1.5*-h} ${1.5*-h}v `+-2*h+`a ${1.5*h} ${1.5*h}, 0, 0, 1, ${1.5*h} ${1.5*-h}`)}}))}_drawDot({x:u,y:c,size:g,rotation:l}){this._basicDot({x:u,y:c,size:g,rotation:l})}_drawSquare({x:u,y:c,size:g,rotation:l}){this._basicSquare({x:u,y:c,size:g,rotation:l})}_drawExtraRounded({x:u,y:c,size:g,rotation:l}){this._basicExtraRounded({x:u,y:c,size:g,rotation:l})}}const P={dot:"dot",square:"square"},A=Object.values(P);class B{constructor({svg:u,type:c,window:g}){this._svg=u,this._type=c,this._window=g}draw(u,c,g,l){let h;h=this._type===P.square?this._drawSquare:this._drawDot,h.call(this,{x:u,y:c,size:g,rotation:l})}_rotateFigure({x:u,y:c,size:g,rotation:l=0,draw:h}){var b;const T=u+g/2,R=c+g/2;h(),(b=this._element)===null||b===void 0||b.setAttribute("transform",`rotate(${180*l/Math.PI},${T},${R})`)}_basicDot(u){const{size:c,x:g,y:l}=u;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(g+c/2)),this._element.setAttribute("cy",String(l+c/2)),this._element.setAttribute("r",String(c/2))}}))}_basicSquare(u){const{size:c,x:g,y:l}=u;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(g)),this._element.setAttribute("y",String(l)),this._element.setAttribute("width",String(c)),this._element.setAttribute("height",String(c))}}))}_drawDot({x:u,y:c,size:g,rotation:l}){this._basicDot({x:u,y:c,size:g,rotation:l})}_drawSquare({x:u,y:c,size:g,rotation:l}){this._basicSquare({x:u,y:c,size:g,rotation:l})}}const Q="circle",W=[[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]],G=[[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 J{constructor(u,c){this._roundSize=g=>this._options.dotsOptions.roundSize?Math.floor(g):g,this._window=c,this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("width",String(u.width)),this._element.setAttribute("height",String(u.height)),this._element.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),u.dotsOptions.roundSize||this._element.setAttribute("shape-rendering","crispEdges"),this._element.setAttribute("viewBox",`0 0 ${u.width} ${u.height}`),this._defs=this._window.document.createElementNS("http://www.w3.org/2000/svg","defs"),this._element.appendChild(this._defs),this._imageUri=u.image,this._instanceId=J.instanceCount++,this._options=u}get width(){return this._options.width}get height(){return this._options.height}getElement(){return this._element}async drawQR(u){const c=u.getModuleCount(),g=Math.min(this._options.width,this._options.height)-2*this._options.margin,l=this._options.shape===Q?g/Math.sqrt(2):g,h=this._roundSize(l/c);let b={hideXDots:0,hideYDots:0,width:0,height:0};if(this._qr=u,this._options.image){if(await this.loadImage(),!this._image)return;const{imageOptions:T,qrOptions:R}=this._options,K=T.imageSize*y[R.errorCorrectionLevel],Z=Math.floor(K*c*c);b=function({originalHeight:ne,originalWidth:V,maxHiddenDots:oe,maxHiddenAxisDots:ee,dotSize:ie}){const O={x:0,y:0},L={x:0,y:0};if(ne<=0||V<=0||oe<=0||ie<=0)return{height:0,width:0,hideYDots:0,hideXDots:0};const j=ne/V;return O.x=Math.floor(Math.sqrt(oe/j)),O.x<=0&&(O.x=1),ee&&ee<O.x&&(O.x=ee),O.x%2==0&&O.x--,L.x=O.x*ie,O.y=1+2*Math.ceil((O.x*j-1)/2),L.y=Math.round(L.x*j),(O.y*O.x>oe||ee&&ee<O.y)&&(ee&&ee<O.y?(O.y=ee,O.y%2==0&&O.x--):O.y-=2,L.y=O.y*ie,O.x=1+2*Math.ceil((O.y/j-1)/2),L.x=Math.round(L.y/j)),{height:L.y,width:L.x,hideYDots:O.y,hideXDots:O.x}}({originalWidth:this._image.width,originalHeight:this._image.height,maxHiddenDots:Z,maxHiddenAxisDots:c-14,dotSize:h})}this.drawBackground(),this.drawDots((T,R)=>{var K,Z,ne,V,oe,ee;return!(this._options.imageOptions.hideBackgroundDots&&T>=(c-b.hideYDots)/2&&T<(c+b.hideYDots)/2&&R>=(c-b.hideXDots)/2&&R<(c+b.hideXDots)/2||!((K=W[T])===null||K===void 0)&&K[R]||!((Z=W[T-c+7])===null||Z===void 0)&&Z[R]||!((ne=W[T])===null||ne===void 0)&&ne[R-c+7]||!((V=G[T])===null||V===void 0)&&V[R]||!((oe=G[T-c+7])===null||oe===void 0)&&oe[R]||!((ee=G[T])===null||ee===void 0)&&ee[R-c+7])}),this.drawCorners(),this._options.image&&await this.drawImage({width:b.width,height:b.height,count:c,dotSize:h})}drawBackground(){var u,c,g;const l=this._element,h=this._options;if(l){const b=(u=h.backgroundOptions)===null||u===void 0?void 0:u.gradient,T=(c=h.backgroundOptions)===null||c===void 0?void 0:c.color;let R=h.height,K=h.width;if(b||T){const Z=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");this._backgroundClipPath=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._backgroundClipPath.setAttribute("id",`clip-path-background-color-${this._instanceId}`),this._defs.appendChild(this._backgroundClipPath),!((g=h.backgroundOptions)===null||g===void 0)&&g.round&&(R=K=Math.min(h.width,h.height),Z.setAttribute("rx",String(R/2*h.backgroundOptions.round))),Z.setAttribute("x",String(this._roundSize((h.width-K)/2))),Z.setAttribute("y",String(this._roundSize((h.height-R)/2))),Z.setAttribute("width",String(K)),Z.setAttribute("height",String(R)),this._backgroundClipPath.appendChild(Z),this._createColor({options:b,color:T,additionalRotation:0,x:0,y:0,height:h.height,width:h.width,name:`background-color-${this._instanceId}`})}}}drawDots(u){var c,g;if(!this._qr)throw"QR code is not defined";const l=this._options,h=this._qr.getModuleCount();if(h>l.width||h>l.height)throw"The canvas is too small.";const b=Math.min(l.width,l.height)-2*l.margin,T=l.shape===Q?b/Math.sqrt(2):b,R=this._roundSize(T/h),K=this._roundSize((l.width-h*R)/2),Z=this._roundSize((l.height-h*R)/2),ne=new _({svg:this._element,type:l.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:(c=l.dotsOptions)===null||c===void 0?void 0:c.gradient,color:l.dotsOptions.color,additionalRotation:0,x:0,y:0,height:l.height,width:l.width,name:`dot-color-${this._instanceId}`});for(let V=0;V<h;V++)for(let oe=0;oe<h;oe++)u&&!u(V,oe)||!((g=this._qr)===null||g===void 0)&&g.isDark(V,oe)&&(ne.draw(K+oe*R,Z+V*R,R,(ee,ie)=>!(oe+ee<0||V+ie<0||oe+ee>=h||V+ie>=h)&&!(u&&!u(V+ie,oe+ee))&&!!this._qr&&this._qr.isDark(V+ie,oe+ee)),ne._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(ne._element));if(l.shape===Q){const V=this._roundSize((b/R-h)/2),oe=h+2*V,ee=K-V*R,ie=Z-V*R,O=[],L=this._roundSize(oe/2);for(let j=0;j<oe;j++){O[j]=[];for(let Y=0;Y<oe;Y++)j>=V-1&&j<=oe-V&&Y>=V-1&&Y<=oe-V||Math.sqrt((j-L)*(j-L)+(Y-L)*(Y-L))>L?O[j][Y]=0:O[j][Y]=this._qr.isDark(Y-2*V<0?Y:Y>=h?Y-2*V:Y-V,j-2*V<0?j:j>=h?j-2*V:j-V)?1:0}for(let j=0;j<oe;j++)for(let Y=0;Y<oe;Y++)O[j][Y]&&(ne.draw(ee+Y*R,ie+j*R,R,(I,ce)=>{var o;return!!(!((o=O[j+ce])===null||o===void 0)&&o[Y+I])}),ne._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(ne._element))}}drawCorners(){if(!this._qr)throw"QR code is not defined";const u=this._element,c=this._options;if(!u)throw"Element code is not defined";const g=this._qr.getModuleCount(),l=Math.min(c.width,c.height)-2*c.margin,h=c.shape===Q?l/Math.sqrt(2):l,b=this._roundSize(h/g),T=7*b,R=3*b,K=this._roundSize((c.width-g*b)/2),Z=this._roundSize((c.height-g*b)/2);[[0,0,0],[1,0,Math.PI/2],[0,1,-Math.PI/2]].forEach(([ne,V,oe])=>{var ee,ie,O,L,j,Y,I,ce,o,a,p,k,N,U;const le=K+ne*b*(g-7),se=Z+V*b*(g-7);let fe=this._dotsClipPath,ae=this._dotsClipPath;if((!((ee=c.cornersSquareOptions)===null||ee===void 0)&&ee.gradient||!((ie=c.cornersSquareOptions)===null||ie===void 0)&&ie.color)&&(fe=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),fe.setAttribute("id",`clip-path-corners-square-color-${ne}-${V}-${this._instanceId}`),this._defs.appendChild(fe),this._cornersSquareClipPath=this._cornersDotClipPath=ae=fe,this._createColor({options:(O=c.cornersSquareOptions)===null||O===void 0?void 0:O.gradient,color:(L=c.cornersSquareOptions)===null||L===void 0?void 0:L.color,additionalRotation:oe,x:le,y:se,height:T,width:T,name:`corners-square-color-${ne}-${V}-${this._instanceId}`})),((j=c.cornersSquareOptions)===null||j===void 0?void 0:j.type)&&x.includes(c.cornersSquareOptions.type)){const ge=new S({svg:this._element,type:c.cornersSquareOptions.type,window:this._window});ge.draw(le,se,T,oe),ge._element&&fe&&fe.appendChild(ge._element)}else{const ge=new _({svg:this._element,type:((Y=c.cornersSquareOptions)===null||Y===void 0?void 0:Y.type)||c.dotsOptions.type,window:this._window});for(let ve=0;ve<W.length;ve++)for(let pe=0;pe<W[ve].length;pe++)!((I=W[ve])===null||I===void 0)&&I[pe]&&(ge.draw(le+pe*b,se+ve*b,b,(xe,_e)=>{var Ce;return!!(!((Ce=W[ve+_e])===null||Ce===void 0)&&Ce[pe+xe])}),ge._element&&fe&&fe.appendChild(ge._element))}if((!((ce=c.cornersDotOptions)===null||ce===void 0)&&ce.gradient||!((o=c.cornersDotOptions)===null||o===void 0)&&o.color)&&(ae=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),ae.setAttribute("id",`clip-path-corners-dot-color-${ne}-${V}-${this._instanceId}`),this._defs.appendChild(ae),this._cornersDotClipPath=ae,this._createColor({options:(a=c.cornersDotOptions)===null||a===void 0?void 0:a.gradient,color:(p=c.cornersDotOptions)===null||p===void 0?void 0:p.color,additionalRotation:oe,x:le+2*b,y:se+2*b,height:R,width:R,name:`corners-dot-color-${ne}-${V}-${this._instanceId}`})),((k=c.cornersDotOptions)===null||k===void 0?void 0:k.type)&&A.includes(c.cornersDotOptions.type)){const ge=new B({svg:this._element,type:c.cornersDotOptions.type,window:this._window});ge.draw(le+2*b,se+2*b,R,oe),ge._element&&ae&&ae.appendChild(ge._element)}else{const ge=new _({svg:this._element,type:((N=c.cornersDotOptions)===null||N===void 0?void 0:N.type)||c.dotsOptions.type,window:this._window});for(let ve=0;ve<G.length;ve++)for(let pe=0;pe<G[ve].length;pe++)!((U=G[ve])===null||U===void 0)&&U[pe]&&(ge.draw(le+pe*b,se+ve*b,b,(xe,_e)=>{var Ce;return!!(!((Ce=G[ve+_e])===null||Ce===void 0)&&Ce[pe+xe])}),ge._element&&ae&&ae.appendChild(ge._element))}})}loadImage(){return new Promise((u,c)=>{var g;const l=this._options;if(!l.image)return c("Image is not defined");if(!((g=l.nodeCanvas)===null||g===void 0)&&g.loadImage)l.nodeCanvas.loadImage(l.image).then(h=>{var b,T;if(this._image=h,this._options.imageOptions.saveAsBlob){const R=(b=l.nodeCanvas)===null||b===void 0?void 0:b.createCanvas(this._image.width,this._image.height);(T=R?.getContext("2d"))===null||T===void 0||T.drawImage(h,0,0),this._imageUri=R?.toDataURL()}u()}).catch(c);else{const h=new this._window.Image;typeof l.imageOptions.crossOrigin=="string"&&(h.crossOrigin=l.imageOptions.crossOrigin),this._image=h,h.onload=async()=>{this._options.imageOptions.saveAsBlob&&(this._imageUri=await async function(b,T){return new Promise(R=>{const K=new T.XMLHttpRequest;K.onload=function(){const Z=new T.FileReader;Z.onloadend=function(){R(Z.result)},Z.readAsDataURL(K.response)},K.open("GET",b),K.responseType="blob",K.send()})}(l.image||"",this._window)),u()},h.src=l.image}})}async drawImage({width:u,height:c,count:g,dotSize:l}){const h=this._options,b=this._roundSize((h.width-g*l)/2),T=this._roundSize((h.height-g*l)/2),R=b+this._roundSize(h.imageOptions.margin+(g*l-u)/2),K=T+this._roundSize(h.imageOptions.margin+(g*l-c)/2),Z=u-2*h.imageOptions.margin,ne=c-2*h.imageOptions.margin,V=this._window.document.createElementNS("http://www.w3.org/2000/svg","image");V.setAttribute("href",this._imageUri||""),V.setAttribute("xlink:href",this._imageUri||""),V.setAttribute("x",String(R)),V.setAttribute("y",String(K)),V.setAttribute("width",`${Z}px`),V.setAttribute("height",`${ne}px`),this._element.appendChild(V)}_createColor({options:u,color:c,additionalRotation:g,x:l,y:h,height:b,width:T,name:R}){const K=T>b?T:b,Z=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");if(Z.setAttribute("x",String(l)),Z.setAttribute("y",String(h)),Z.setAttribute("height",String(b)),Z.setAttribute("width",String(T)),Z.setAttribute("clip-path",`url('#clip-path-${R}')`),u){let ne;if(u.type==="radial")ne=this._window.document.createElementNS("http://www.w3.org/2000/svg","radialGradient"),ne.setAttribute("id",R),ne.setAttribute("gradientUnits","userSpaceOnUse"),ne.setAttribute("fx",String(l+T/2)),ne.setAttribute("fy",String(h+b/2)),ne.setAttribute("cx",String(l+T/2)),ne.setAttribute("cy",String(h+b/2)),ne.setAttribute("r",String(K/2));else{const V=((u.rotation||0)+g)%(2*Math.PI),oe=(V+2*Math.PI)%(2*Math.PI);let ee=l+T/2,ie=h+b/2,O=l+T/2,L=h+b/2;oe>=0&&oe<=.25*Math.PI||oe>1.75*Math.PI&&oe<=2*Math.PI?(ee-=T/2,ie-=b/2*Math.tan(V),O+=T/2,L+=b/2*Math.tan(V)):oe>.25*Math.PI&&oe<=.75*Math.PI?(ie-=b/2,ee-=T/2/Math.tan(V),L+=b/2,O+=T/2/Math.tan(V)):oe>.75*Math.PI&&oe<=1.25*Math.PI?(ee+=T/2,ie+=b/2*Math.tan(V),O-=T/2,L-=b/2*Math.tan(V)):oe>1.25*Math.PI&&oe<=1.75*Math.PI&&(ie+=b/2,ee+=T/2/Math.tan(V),L-=b/2,O-=T/2/Math.tan(V)),ne=this._window.document.createElementNS("http://www.w3.org/2000/svg","linearGradient"),ne.setAttribute("id",R),ne.setAttribute("gradientUnits","userSpaceOnUse"),ne.setAttribute("x1",String(Math.round(ee))),ne.setAttribute("y1",String(Math.round(ie))),ne.setAttribute("x2",String(Math.round(O))),ne.setAttribute("y2",String(Math.round(L)))}u.colorStops.forEach(({offset:V,color:oe})=>{const ee=this._window.document.createElementNS("http://www.w3.org/2000/svg","stop");ee.setAttribute("offset",100*V+"%"),ee.setAttribute("stop-color",oe),ne.appendChild(ee)}),Z.setAttribute("fill",`url('#${R}')`),this._defs.appendChild(ne)}else c&&Z.setAttribute("fill",c);this._element.appendChild(Z)}}J.instanceCount=0;const z=J,H="canvas",F={};for(let v=0;v<=40;v++)F[v]=v;const $={type:H,shape:"square",width:300,height:300,data:"",margin:0,qrOptions:{typeNumber:F[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 te(v){const u=Object.assign({},v);if(!u.colorStops||!u.colorStops.length)throw"Field 'colorStops' is required in gradient";return u.rotation?u.rotation=Number(u.rotation):u.rotation=0,u.colorStops=u.colorStops.map(c=>Object.assign(Object.assign({},c),{offset:Number(c.offset)})),u}function X(v){const u=Object.assign({},v);return u.width=Number(u.width),u.height=Number(u.height),u.margin=Number(u.margin),u.imageOptions=Object.assign(Object.assign({},u.imageOptions),{hideBackgroundDots:!!u.imageOptions.hideBackgroundDots,imageSize:Number(u.imageOptions.imageSize),margin:Number(u.imageOptions.margin)}),u.margin>Math.min(u.width,u.height)&&(u.margin=Math.min(u.width,u.height)),u.dotsOptions=Object.assign({},u.dotsOptions),u.dotsOptions.gradient&&(u.dotsOptions.gradient=te(u.dotsOptions.gradient)),u.cornersSquareOptions&&(u.cornersSquareOptions=Object.assign({},u.cornersSquareOptions),u.cornersSquareOptions.gradient&&(u.cornersSquareOptions.gradient=te(u.cornersSquareOptions.gradient))),u.cornersDotOptions&&(u.cornersDotOptions=Object.assign({},u.cornersDotOptions),u.cornersDotOptions.gradient&&(u.cornersDotOptions.gradient=te(u.cornersDotOptions.gradient))),u.backgroundOptions&&(u.backgroundOptions=Object.assign({},u.backgroundOptions),u.backgroundOptions.gradient&&(u.backgroundOptions.gradient=te(u.backgroundOptions.gradient))),u}var q=s(873),ue=s.n(q);function de(v){if(!v)throw new Error("Extension must be defined");v[0]==="."&&(v=v.substring(1));const u={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(!u)throw new Error(`Extension "${v}" is not supported`);return u}class D{constructor(u){u!=null&&u.jsdom?this._window=new u.jsdom("",{resources:"usable"}).window:this._window=window,this._options=u?X(i($,u)):$,this.update()}static _clearContainer(u){u&&(u.innerHTML="")}_setupSvg(){if(!this._qr)return;const u=new z(this._options,this._window);this._svg=u.getElement(),this._svgDrawingPromise=u.drawQR(this._qr).then(()=>{var c;this._svg&&((c=this._extension)===null||c===void 0||c.call(this,u.getElement(),this._options))})}_setupCanvas(){var u,c;this._qr&&(!((u=this._options.nodeCanvas)===null||u===void 0)&&u.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=(c=this._svgDrawingPromise)===null||c===void 0?void 0:c.then(()=>{var g;if(!this._svg)return;const l=this._svg,h=new this._window.XMLSerializer().serializeToString(l),b=btoa(h),T=`data:${de("svg")};base64,${b}`;if(!((g=this._options.nodeCanvas)===null||g===void 0)&&g.loadImage)return this._options.nodeCanvas.loadImage(T).then(R=>{var K,Z;R.width=this._options.width,R.height=this._options.height,(Z=(K=this._nodeCanvas)===null||K===void 0?void 0:K.getContext("2d"))===null||Z===void 0||Z.drawImage(R,0,0)});{const R=new this._window.Image;return new Promise(K=>{R.onload=()=>{var Z,ne;(ne=(Z=this._domCanvas)===null||Z===void 0?void 0:Z.getContext("2d"))===null||ne===void 0||ne.drawImage(R,0,0),K()},R.src=T})}}))}async _getElement(u="png"){if(!this._qr)throw"QR code is empty";return u.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(u){D._clearContainer(this._container),this._options=u?X(i(this._options,u)):this._options,this._options.data&&(this._qr=ue()(this._options.qrOptions.typeNumber,this._options.qrOptions.errorCorrectionLevel),this._qr.addData(this._options.data,this._options.qrOptions.mode||function(c){switch(!0){case/^[0-9]*$/.test(c):return"Numeric";case/^[0-9A-Z $%*+\-./:]*$/.test(c):return"Alphanumeric";default:return"Byte"}}(this._options.data)),this._qr.make(),this._options.type===H?this._setupCanvas():this._setupSvg(),this.append(this._container))}append(u){if(u){if(typeof u.appendChild!="function")throw"Container should be a single DOM node";this._options.type===H?this._domCanvas&&u.appendChild(this._domCanvas):this._svg&&u.appendChild(this._svg),this._container=u}}applyExtension(u){if(!u)throw"Extension function should be defined.";this._extension=u,this.update()}deleteExtension(){this._extension=void 0,this.update()}async getRawData(u="png"){if(!this._qr)throw"QR code is empty";const c=await this._getElement(u),g=de(u);if(!c)return null;if(u.toLowerCase()==="svg"){const l=`<?xml version="1.0" standalone="no"?>\r
116
116
  ${new this._window.XMLSerializer().serializeToString(c)}`;return typeof Blob>"u"||this._options.jsdom?Buffer.from(l):new Blob([l],{type:g})}return new Promise(l=>{const h=c;if("toBuffer"in h)if(g==="image/png")l(h.toBuffer(g));else if(g==="image/jpeg")l(h.toBuffer(g));else{if(g!=="application/pdf")throw Error("Unsupported extension");l(h.toBuffer(g))}else"toBlob"in h&&h.toBlob(l,g,1)})}async download(u){if(!this._qr)throw"QR code is empty";if(typeof Blob>"u")throw"Cannot download in Node.js, call getRawData instead.";let c="png",g="qr";typeof u=="string"?(c=u,console.warn("Extension is deprecated as argument for 'download' method, please pass object { name: '...', extension: '...' } as argument")):typeof u=="object"&&u!==null&&(u.name&&(g=u.name),u.extension&&(c=u.extension));const l=await this._getElement(c);if(l)if(c.toLowerCase()==="svg"){let h=new XMLSerializer().serializeToString(l);h=`<?xml version="1.0" standalone="no"?>\r
117
- `+h,m(`data:${de(c)};charset=utf-8,${encodeURIComponent(h)}`,`${g}.svg`)}else m(l.toDataURL(de(c)),`${g}.${c}`)}}const C=S})(),d.default})())}(Zr)),Zr.exports}Za();const Mo=re.createContext(void 0);function Ja(t){const e=Ge.c(9),{children:r,baseUrl:n,queryClient:s}=t;let d;e[0]!==n||e[1]!==s?(d={baseUrl:n,queryClient:s},e[0]=n,e[1]=s,e[2]=d):d=e[2];let f;e[3]!==r||e[4]!==s?(f=w.jsx(Bn,{client:s,children:r}),e[3]=r,e[4]=s,e[5]=f):f=e[5];let i;return e[6]!==d||e[7]!==f?(i=w.jsx(Mo.Provider,{value:d,children:f}),e[6]=d,e[7]=f,e[8]=i):i=e[8],i}function at(){const t=re.useContext(Mo);if(!t)throw new Error("useDataTable must be used within a DataTableProvider");return t}function Jr(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 wt(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 Xa(){const t=localStorage.getItem("a360.assumed-org");return t?{"X-Assume-Org":t}:{}}async function pt(){return{"Content-Type":"application/json",Authorization:`Bearer ${await Ia()??""}`,...Xa()}}async function Po(t){return fetch(t,{method:"GET",headers:await pt()}).then(async e=>(e.status>=400&&await wt(e),e)).then(e=>e.json()).then(e=>e)}async function Oo(t,e){return fetch(`${t}/${e}`,{method:"GET",headers:await pt()}).then(async r=>(r.status>=400&&await wt(r),r)).then(r=>r.json()).then(r=>r)}async function Ao(t,e){const r=await fetch(`${t}/${e}`,{method:"DELETE",headers:await pt()});r.status>=400&&await wt(r)}async function To(t,e){return fetch(t,{method:"POST",headers:await pt(),body:JSON.stringify(e)}).then(async r=>(r.status>=400&&await wt(r),r)).then(r=>r.status==204?e:r.json()).then(r=>r)}async function el(t,e,r){return fetch(e,{method:t,headers:await pt(),body:r?JSON.stringify(r):void 0}).then(async n=>(n.status>=400&&await wt(n),n)).then(n=>{if(n.status!=204)return n.json()}).then(n=>n)}async function Eo(t,e){return fetch(`${t}/${e.id}`,{method:"PUT",headers:await pt(),body:JSON.stringify(e)}).then(async r=>(r.status>=400&&await wt(r),r)).then(r=>r.status==204?e:r.json()).then(r=>r)}function jo(t,e,r){const n=Ge.c(13),{baseUrl:s}=at();let d;if(n[0]!==r||n[1]!==e){let y;n[3]!==r?(y=r?.toString(),n[3]=r,n[4]=y):y=n[4],d=[...e.map(tl),String(y)],n[0]=r,n[1]=e,n[2]=d}else d=n[2];let f;n[5]!==t||n[6]!==s||n[7]!==r?(f=()=>Oo(`${s}${t}`,r),n[5]=t,n[6]=s,n[7]=r,n[8]=f):f=n[8];const i=!!r;let m;return n[9]!==d||n[10]!==f||n[11]!==i?(m={queryKey:d,queryFn:f,enabled:i},n[9]=d,n[10]=f,n[11]=i,n[12]=m):m=n[12],zn(m)}function tl(t){return t.toString()}function Ro(t,e,r){const n=Ge.c(9),s=r===void 0?!0:r,{baseUrl:d}=at();let f;n[0]!==e?(f=[...e.map(rl)],n[0]=e,n[1]=f):f=n[1];let i;n[2]!==t||n[3]!==d?(i=()=>Po(`${d}${t}`),n[2]=t,n[3]=d,n[4]=i):i=n[4];let m;return n[5]!==s||n[6]!==f||n[7]!==i?(m={queryKey:f,queryFn:i,enabled:s},n[5]=s,n[6]=f,n[7]=i,n[8]=m):m=n[8],zn(m)}function rl(t){return t.toString()}function No(t,e){const r=Ge.c(10),{baseUrl:n,queryClient:s}=at();let d;r[0]!==e?(d=[...e.map(ol)],r[0]=e,r[1]=d):d=r[1];let f;r[2]!==t||r[3]!==n?(f=m=>To(`${n}${t}`,m),r[2]=t,r[3]=n,r[4]=f):f=r[4];let i;return r[5]!==s||r[6]!==e||r[7]!==d||r[8]!==f?(i={mutationKey:d,mutationFn:f,onSettled(){return s.invalidateQueries({queryKey:[...e.map(nl)]})},onError(m){Jr(m)}},r[5]=s,r[6]=e,r[7]=d,r[8]=f,r[9]=i):i=r[9],Er(i)}function nl(t){return t.toString()}function ol(t){return t.toString()}function Xr(t,e){const r=Ge.c(10),{baseUrl:n,queryClient:s}=at();let d;r[0]!==e?(d=[...e.map(il)],r[0]=e,r[1]=d):d=r[1];let f;r[2]!==t||r[3]!==n?(f=m=>Eo(`${n}${t}`,m),r[2]=t,r[3]=n,r[4]=f):f=r[4];let i;return r[5]!==s||r[6]!==e||r[7]!==d||r[8]!==f?(i={mutationKey:d,mutationFn:f,onSettled(){return s.invalidateQueries({queryKey:[...e.map(sl)]})},onError(m){Jr(m)}},r[5]=s,r[6]=e,r[7]=d,r[8]=f,r[9]=i):i=r[9],Er(i)}function sl(t){return t.toString()}function il(t){return t.toString()}function $o(t,e){const r=Ge.c(10),{baseUrl:n,queryClient:s}=at();let d;r[0]!==e?(d=[...e.map(ll)],r[0]=e,r[1]=d):d=r[1];let f;r[2]!==t||r[3]!==n?(f=m=>Ao(`${n}${t}`,m),r[2]=t,r[3]=n,r[4]=f):f=r[4];let i;return r[5]!==s||r[6]!==e||r[7]!==d||r[8]!==f?(i={mutationKey:d,mutationFn:f,onSettled(){return s.invalidateQueries({queryKey:[...e.map(al)]})},onError(m){Jr(m)}},r[5]=s,r[6]=e,r[7]=d,r[8]=f,r[9]=i):i=r[9],Er(i)}function al(t){return t.toString()}function ll(t){return t.toString()}var nr={exports:{}},ul=nr.exports,Lo;function cl(){return Lo||(Lo=1,function(t,e){(function(r,n){t.exports=n()})(ul,function(){var r=1e3,n=6e4,s=36e5,d="millisecond",f="second",i="minute",m="hour",y="day",_="week",M="month",x="quarter",D="year",P="date",A="Invalid Date",B=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,Q=/\[([^\]]+)]|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,W={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(S){var C=["th","st","nd","rd"],v=S%100;return"["+S+(C[(v-20)%10]||C[v]||C[0])+"]"}},G=function(S,C,v){var u=String(S);return!u||u.length>=C?S:""+Array(C+1-u.length).join(v)+S},J={s:G,z:function(S){var C=-S.utcOffset(),v=Math.abs(C),u=Math.floor(v/60),c=v%60;return(C<=0?"+":"-")+G(u,2,"0")+":"+G(c,2,"0")},m:function S(C,v){if(C.date()<v.date())return-S(v,C);var u=12*(v.year()-C.year())+(v.month()-C.month()),c=C.clone().add(u,M),g=v-c<0,l=C.clone().add(u+(g?-1:1),M);return+(-(u+(v-c)/(g?c-l:l-c))||0)},a:function(S){return S<0?Math.ceil(S)||0:Math.floor(S)},p:function(S){return{M,y:D,w:_,d:y,D:P,h:m,m:i,s:f,ms:d,Q:x}[S]||String(S||"").toLowerCase().replace(/s$/,"")},u:function(S){return S===void 0}},z="en",H={};H[z]=W;var F="$isDayjsObject",$=function(S){return S instanceof ue||!(!S||!S[F])},te=function S(C,v,u){var c;if(!C)return z;if(typeof C=="string"){var g=C.toLowerCase();H[g]&&(c=g),v&&(H[g]=v,c=g);var l=C.split("-");if(!c&&l.length>1)return S(l[0])}else{var h=C.name;H[h]=C,c=h}return!u&&c&&(z=c),c||!u&&z},X=function(S,C){if($(S))return S.clone();var v=typeof C=="object"?C:{};return v.date=S,v.args=arguments,new ue(v)},q=J;q.l=te,q.i=$,q.w=function(S,C){return X(S,{locale:C.$L,utc:C.$u,x:C.$x,$offset:C.$offset})};var ue=function(){function S(v){this.$L=te(v.locale,null,!0),this.parse(v),this.$x=this.$x||v.x||{},this[F]=!0}var C=S.prototype;return C.parse=function(v){this.$d=function(u){var c=u.date,g=u.utc;if(c===null)return new Date(NaN);if(q.u(c))return new Date;if(c instanceof Date)return new Date(c);if(typeof c=="string"&&!/Z$/i.test(c)){var l=c.match(B);if(l){var h=l[2]-1||0,b=(l[7]||"0").substring(0,3);return g?new Date(Date.UTC(l[1],h,l[3]||1,l[4]||0,l[5]||0,l[6]||0,b)):new Date(l[1],h,l[3]||1,l[4]||0,l[5]||0,l[6]||0,b)}}return new Date(c)}(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 q},C.isValid=function(){return this.$d.toString()!==A},C.isSame=function(v,u){var c=X(v);return this.startOf(u)<=c&&c<=this.endOf(u)},C.isAfter=function(v,u){return X(v)<this.startOf(u)},C.isBefore=function(v,u){return this.endOf(u)<X(v)},C.$g=function(v,u,c){return q.u(v)?this[u]:this.set(c,v)},C.unix=function(){return Math.floor(this.valueOf()/1e3)},C.valueOf=function(){return this.$d.getTime()},C.startOf=function(v,u){var c=this,g=!!q.u(u)||u,l=q.p(v),h=function(oe,ee){var ie=q.w(c.$u?Date.UTC(c.$y,ee,oe):new Date(c.$y,ee,oe),c);return g?ie:ie.endOf(y)},b=function(oe,ee){return q.w(c.toDate()[oe].apply(c.toDate("s"),(g?[0,0,0,0]:[23,59,59,999]).slice(ee)),c)},E=this.$W,N=this.$M,K=this.$D,Z="set"+(this.$u?"UTC":"");switch(l){case D:return g?h(1,0):h(31,11);case M:return g?h(1,N):h(0,N+1);case _:var ne=this.$locale().weekStart||0,V=(E<ne?E+7:E)-ne;return h(g?K-V:K+(6-V),N);case y:case P:return b(Z+"Hours",0);case m:return b(Z+"Minutes",1);case i:return b(Z+"Seconds",2);case f:return b(Z+"Milliseconds",3);default:return this.clone()}},C.endOf=function(v){return this.startOf(v,!1)},C.$set=function(v,u){var c,g=q.p(v),l="set"+(this.$u?"UTC":""),h=(c={},c[y]=l+"Date",c[P]=l+"Date",c[M]=l+"Month",c[D]=l+"FullYear",c[m]=l+"Hours",c[i]=l+"Minutes",c[f]=l+"Seconds",c[d]=l+"Milliseconds",c)[g],b=g===y?this.$D+(u-this.$W):u;if(g===M||g===D){var E=this.clone().set(P,1);E.$d[h](b),E.init(),this.$d=E.set(P,Math.min(this.$D,E.daysInMonth())).$d}else h&&this.$d[h](b);return this.init(),this},C.set=function(v,u){return this.clone().$set(v,u)},C.get=function(v){return this[q.p(v)]()},C.add=function(v,u){var c,g=this;v=Number(v);var l=q.p(u),h=function(N){var K=X(g);return q.w(K.date(K.date()+Math.round(N*v)),g)};if(l===M)return this.set(M,this.$M+v);if(l===D)return this.set(D,this.$y+v);if(l===y)return h(1);if(l===_)return h(7);var b=(c={},c[i]=n,c[m]=s,c[f]=r,c)[l]||1,E=this.$d.getTime()+v*b;return q.w(E,this)},C.subtract=function(v,u){return this.add(-1*v,u)},C.format=function(v){var u=this,c=this.$locale();if(!this.isValid())return c.invalidDate||A;var g=v||"YYYY-MM-DDTHH:mm:ssZ",l=q.z(this),h=this.$H,b=this.$m,E=this.$M,N=c.weekdays,K=c.months,Z=c.meridiem,ne=function(ee,ie,O,L){return ee&&(ee[ie]||ee(u,g))||O[ie].slice(0,L)},V=function(ee){return q.s(h%12||12,ee,"0")},oe=Z||function(ee,ie,O){var L=ee<12?"AM":"PM";return O?L.toLowerCase():L};return g.replace(Q,function(ee,ie){return ie||function(O){switch(O){case"YY":return String(u.$y).slice(-2);case"YYYY":return q.s(u.$y,4,"0");case"M":return E+1;case"MM":return q.s(E+1,2,"0");case"MMM":return ne(c.monthsShort,E,K,3);case"MMMM":return ne(K,E);case"D":return u.$D;case"DD":return q.s(u.$D,2,"0");case"d":return String(u.$W);case"dd":return ne(c.weekdaysMin,u.$W,N,2);case"ddd":return ne(c.weekdaysShort,u.$W,N,3);case"dddd":return N[u.$W];case"H":return String(h);case"HH":return q.s(h,2,"0");case"h":return V(1);case"hh":return V(2);case"a":return oe(h,b,!0);case"A":return oe(h,b,!1);case"m":return String(b);case"mm":return q.s(b,2,"0");case"s":return String(u.$s);case"ss":return q.s(u.$s,2,"0");case"SSS":return q.s(u.$ms,3,"0");case"Z":return l}return null}(ee)||l.replace(":","")})},C.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},C.diff=function(v,u,c){var g,l=this,h=q.p(u),b=X(v),E=(b.utcOffset()-this.utcOffset())*n,N=this-b,K=function(){return q.m(l,b)};switch(h){case D:g=K()/12;break;case M:g=K();break;case x:g=K()/3;break;case _:g=(N-E)/6048e5;break;case y:g=(N-E)/864e5;break;case m:g=N/s;break;case i:g=N/n;break;case f:g=N/r;break;default:g=N}return c?g:q.a(g)},C.daysInMonth=function(){return this.endOf(M).$D},C.$locale=function(){return H[this.$L]},C.locale=function(v,u){if(!v)return this.$L;var c=this.clone(),g=te(v,u,!0);return g&&(c.$L=g),c},C.clone=function(){return q.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()},S}(),de=ue.prototype;return X.prototype=de,[["$ms",d],["$s",f],["$m",i],["$H",m],["$W",y],["$M",M],["$y",D],["$D",P]].forEach(function(S){de[S[1]]=function(C){return this.$g(C,S[0],S[1])}}),X.extend=function(S,C){return S.$i||(S(C,ue,X),S.$i=!0),X},X.locale=te,X.isDayjs=$,X.unix=function(S){return X(1e3*S)},X.en=H[z],X.Ls=H,X.p={},X})}(nr)),nr.exports}var dl=cl();const he=wn(dl);function hl({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 Bo({controlsRef:t,direction:e,levelIndex:r,rowIndex:n,cellIndex:s,size:d}){const f=hl({direction:e,size:d,rowIndex:n,cellIndex:s,levelIndex:r});if(!f)return;const i=t.current?.[f.levelIndex]?.[f.rowIndex]?.[f.cellIndex];i&&(i.disabled||i.getAttribute("data-hidden")||i.getAttribute("data-outside")?Bo({controlsRef:t,direction:e,levelIndex:f.levelIndex,cellIndex:f.cellIndex,rowIndex:f.rowIndex,size:d}):i.focus())}function fl(t){switch(t){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function pl(t){return t.current?.map(e=>e.map(r=>r.length))}function en({controlsRef:t,levelIndex:e,rowIndex:r,cellIndex:n,event:s}){const d=fl(s.key);if(d){s.preventDefault();const f=pl(t);Bo({controlsRef:t,direction:d,levelIndex:e,rowIndex:r,cellIndex:n,size:f})}}function Ue(t){return t==null||t===""?t:he(t).format("YYYY-MM-DD")}function Yo(t){return t==null||t===""?t:he(t).format("YYYY-MM-DD HH:mm:ss")}const gl={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},ml=re.createContext(gl);function lt(){const t=re.useContext(ml),e=re.useCallback(d=>d||t.locale,[t.locale]),r=re.useCallback(d=>typeof d=="number"?d:t.firstDayOfWeek,[t.firstDayOfWeek]),n=re.useCallback(d=>Array.isArray(d)?d:t.weekendDays,[t.weekendDays]),s=re.useCallback(d=>typeof d=="string"?d:t.labelSeparator,[t.labelSeparator]);return{...t,getLocale:e,getFirstDayOfWeek:r,getWeekendDays:n,getLabelSeparator:s}}function yl({value:t,type:e,withTime:r}){const n=r?Yo:Ue;if(e==="range"&&Array.isArray(t)){const s=n(t[0]),d=n(t[1]);return s?d?`${s} – ${d}`:`${s} –`:""}return e==="multiple"&&Array.isArray(t)?t.filter(Boolean).join(", "):!Array.isArray(t)&&t?n(t):""}function Io({value:t,type:e,name:r,form:n,withTime:s=!1}){return w.jsx("input",{type:"hidden",value:yl({value:t,type:e,withTime:s}),name:r,form:n})}Io.displayName="@mantine/dates/HiddenDatesInput";function zo(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=zo(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function De(){for(var t,e,r=0,n="",s=arguments.length;r<s;r++)(t=arguments[r])&&(e=zo(t))&&(n&&(n+=" "),n+=e);return n}var Fo={day:"m_396ce5cb"};const vl=T.createVarsResolver((t,{size:e})=>({day:{"--day-size":T.getSize(e,"day-size")}})),tn=T.factory((t,e)=>{const r=T.useProps("Day",null,t),{classNames:n,className:s,style:d,styles:f,unstyled:i,vars:m,date:y,disabled:_,__staticSelector:M,weekend:x,outside:D,selected:P,renderDay:A,inRange:B,firstInRange:Q,lastInRange:W,hidden:G,static:J,highlightToday:z,attributes:H,...F}=r,$=T.useStyles({name:M||"Day",classes:Fo,props:r,className:s,style:d,classNames:n,styles:f,unstyled:i,attributes:H,vars:m,varsResolver:vl,rootSelector:"day"});return w.jsx(T.UnstyledButton,{...$("day",{style:G?{display:"none"}:void 0}),component:J?"div":"button",ref:e,disabled:_,"data-today":he(y).isSame(new Date,"day")||void 0,"data-hidden":G||void 0,"data-highlight-today":z||void 0,"data-disabled":_||void 0,"data-weekend":!_&&!D&&x||void 0,"data-outside":!_&&D||void 0,"data-selected":!_&&P||void 0,"data-in-range":B&&!_||void 0,"data-first-in-range":Q&&!_||void 0,"data-last-in-range":W&&!_||void 0,"data-static":J||void 0,unstyled:i,...F,children:A?.(y)||he(y).date()})});tn.classes=Fo,tn.displayName="@mantine/dates/Day";function bl({locale:t,format:e="dd",firstDayOfWeek:r=1}){const n=he().day(r),s=[];for(let d=0;d<7;d+=1)typeof e=="string"?s.push(he(n).add(d,"days").locale(t).format(e)):s.push(e(he(n).add(d,"days").format("YYYY-MM-DD")));return s}var Uo={weekday:"m_18a3eca"};const wl=T.createVarsResolver((t,{size:e})=>({weekdaysRow:{"--wr-fz":T.getFontSize(e),"--wr-spacing":T.getSpacing(e)}})),rn=T.factory((t,e)=>{const r=T.useProps("WeekdaysRow",null,t),{classNames:n,className:s,style:d,styles:f,unstyled:i,vars:m,locale:y,firstDayOfWeek:_,weekdayFormat:M,cellComponent:x="th",__staticSelector:D,withWeekNumbers:P,attributes:A,...B}=r,Q=T.useStyles({name:D||"WeekdaysRow",classes:Uo,props:r,className:s,style:d,classNames:n,styles:f,unstyled:i,attributes:A,vars:m,varsResolver:wl,rootSelector:"weekdaysRow"}),W=lt(),G=bl({locale:W.getLocale(y),format:M,firstDayOfWeek:W.getFirstDayOfWeek(_)}).map((J,z)=>w.jsx(x,{...Q("weekday"),children:J},z));return w.jsxs(T.Box,{component:"tr",ref:e,...Q("weekdaysRow"),...B,children:[P&&w.jsx(x,{...Q("weekday"),children:"#"}),G]})});rn.classes=Uo,rn.displayName="@mantine/dates/WeekdaysRow";function _l(t,e=1){let r=he(t);const n=e===0?6:e-1;for(;r.day()!==n;)r=r.add(1,"day");return r.format("YYYY-MM-DD")}function xl(t,e=1){let r=he(t);for(;r.day()!==e;)r=r.subtract(1,"day");return r.format("YYYY-MM-DD")}function Cl({month:t,firstDayOfWeek:e=1,consistentWeeks:r}){const n=he(t).subtract(he(t).date()-1,"day"),s=he(n.format("YYYY-M-D")),d=s.format("YYYY-MM-DD"),f=s.add(+s.daysInMonth()-1,"day").format("YYYY-MM-DD"),i=_l(f,e),m=[];let y=he(xl(d,e));for(;he(y).isBefore(i,"day");){const _=[];for(let M=0;M<7;M+=1)_.push(y.format("YYYY-MM-DD")),y=y.add(1,"day");m.push(_)}if(r&&m.length<6){const _=m[m.length-1],M=_[_.length-1];let x=he(M).add(1,"day");for(;m.length<6;){const D=[];for(let P=0;P<7;P+=1)D.push(x.format("YYYY-MM-DD")),x=x.add(1,"day");m.push(D)}}return m}function nn(t,e){return he(t).format("YYYY-MM")===he(e).format("YYYY-MM")}function qo(t,e){return e?he(t).isAfter(he(e).subtract(1,"day"),"day"):!0}function Wo(t,e){return e?he(t).isBefore(he(e).add(1,"day"),"day"):!0}function Sl({dates:t,minDate:e,maxDate:r,getDayProps:n,excludeDate:s,hideOutsideDates:d,month:f}){const i=t.flat().filter(_=>Wo(_,r)&&qo(_,e)&&!s?.(_)&&!n?.(_)?.disabled&&(!d||nn(_,f))),m=i.find(_=>n?.(_)?.selected);if(m)return m;const y=i.find(_=>he().isSame(_,"date"));return y||i[0]}var or={exports:{}},Dl=or.exports,Vo;function kl(){return Vo||(Vo=1,function(t,e){(function(r,n){t.exports=n()})(Dl,function(){var r="day";return function(n,s,d){var f=function(y){return y.add(4-y.isoWeekday(),r)},i=s.prototype;i.isoWeekYear=function(){return f(this).year()},i.isoWeek=function(y){if(!this.$utils().u(y))return this.add(7*(y-this.isoWeek()),r);var _,M,x,D,P=f(this),A=(_=this.isoWeekYear(),M=this.$u,x=(M?d.utc:d)().year(_).startOf("year"),D=4-x.isoWeekday(),x.isoWeekday()>4&&(D+=7),x.add(D,r));return P.diff(A,"week")+1},i.isoWeekday=function(y){return this.$utils().u(y)?this.day()||7:this.day(this.day()%7?y:y-7)};var m=i.startOf;i.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"):m.bind(this)(y,_)}}})}(or)),or.exports}var Ml=kl();const Pl=wn(Ml);he.extend(Pl);function Ol(t){const e=t.find(r=>he(r).day()===1);return he(e).isoWeek()}var Ho={month:"m_cc9820d3",monthCell:"m_8f457cd5",weekNumber:"m_6cff9dea"};const Al={withCellSpacing:!0},Tl=T.createVarsResolver((t,{size:e})=>({weekNumber:{"--wn-fz":T.getFontSize(e),"--wn-size":T.getSize(e,"wn-size")}})),sr=T.factory((t,e)=>{const r=T.useProps("Month",Al,t),{classNames:n,className:s,style:d,styles:f,unstyled:i,vars:m,__staticSelector:y,locale:_,firstDayOfWeek:M,weekdayFormat:x,month:D,weekendDays:P,getDayProps:A,excludeDate:B,minDate:Q,maxDate:W,renderDay:G,hideOutsideDates:J,hideWeekdays:z,getDayAriaLabel:H,static:F,__getDayRef:$,__onDayKeyDown:te,__onDayClick:X,__onDayMouseEnter:q,__preventFocus:ue,__stopPropagation:de,withCellSpacing:S,size:C,highlightToday:v,withWeekNumbers:u,attributes:c,...g}=r,l=T.useStyles({name:y||"Month",classes:Ho,props:r,className:s,style:d,classNames:n,styles:f,unstyled:i,attributes:c,vars:m,varsResolver:Tl,rootSelector:"month"}),h=lt(),b=Cl({month:D,firstDayOfWeek:h.getFirstDayOfWeek(M),consistentWeeks:h.consistentWeeks}),E=Sl({dates:b,minDate:Ue(Q),maxDate:Ue(W),getDayProps:A,excludeDate:B,hideOutsideDates:J,month:D}),{resolvedClassNames:N,resolvedStyles:K}=T.useResolvedStylesApi({classNames:n,styles:f,props:r}),Z=b.map((ne,V)=>{const oe=ne.map((ee,ie)=>{const O=!nn(ee,D),L=H?.(ee)||he(ee).locale(_||h.locale).format("D MMMM YYYY"),j=A?.(ee),I=he(ee).isSame(E,"date");return w.jsx("td",{...l("monthCell"),"data-with-spacing":S||void 0,children:w.jsx(tn,{__staticSelector:y||"Month",classNames:N,styles:K,unstyled:i,"data-mantine-stop-propagation":de||void 0,highlightToday:v,renderDay:G,date:ee,size:C,weekend:h.getWeekendDays(P).includes(he(ee).get("day")),outside:O,hidden:J?O:!1,"aria-label":L,static:F,disabled:B?.(ee)||!Wo(ee,Ue(W))||!qo(ee,Ue(Q)),ref:Y=>{Y&&$?.(V,ie,Y)},...j,onKeyDown:Y=>{j?.onKeyDown?.(Y),te?.(Y,{rowIndex:V,cellIndex:ie,date:ee})},onMouseEnter:Y=>{j?.onMouseEnter?.(Y),q?.(Y,ee)},onClick:Y=>{j?.onClick?.(Y),X?.(Y,ee)},onMouseDown:Y=>{j?.onMouseDown?.(Y),ue&&Y.preventDefault()},tabIndex:ue||!I?-1:0})},ee.toString())});return w.jsxs("tr",{...l("monthRow"),children:[u&&w.jsx("td",{...l("weekNumber"),children:Ol(ne)}),oe]},V)});return w.jsxs(T.Box,{component:"table",...l("month"),size:C,ref:e,...g,children:[!z&&w.jsx("thead",{...l("monthThead"),children:w.jsx(rn,{__staticSelector:y||"Month",locale:_,firstDayOfWeek:M,weekdayFormat:x,size:C,classNames:N,styles:K,unstyled:i,withWeekNumbers:u})}),w.jsx("tbody",{...l("monthTbody"),children:Z})]})});sr.classes=Ho,sr.displayName="@mantine/dates/Month";var Go={pickerControl:"m_dc6a3c71"};const El=T.createVarsResolver((t,{size:e})=>({pickerControl:{"--dpc-fz":T.getFontSize(e),"--dpc-size":T.getSize(e,"dpc-size")}})),ir=T.factory((t,e)=>{const r=T.useProps("PickerControl",null,t),{classNames:n,className:s,style:d,styles:f,unstyled:i,vars:m,firstInRange:y,lastInRange:_,inRange:M,__staticSelector:x,selected:D,disabled:P,attributes:A,...B}=r,Q=T.useStyles({name:x||"PickerControl",classes:Go,props:r,className:s,style:d,classNames:n,styles:f,unstyled:i,attributes:A,vars:m,varsResolver:El,rootSelector:"pickerControl"});return w.jsx(T.UnstyledButton,{...Q("pickerControl"),ref:e,unstyled:i,"data-picker-control":!0,"data-selected":D&&!P||void 0,"data-disabled":P||void 0,"data-in-range":M&&!P&&!D||void 0,"data-first-in-range":y&&!P||void 0,"data-last-in-range":_&&!P||void 0,disabled:P,...B})});ir.classes=Go,ir.displayName="@mantine/dates/PickerControl";function Qo({year:t,minDate:e,maxDate:r}){return!e&&!r?!1:!!(e&&he(t).isBefore(e,"year")||r&&he(t).isAfter(r,"year"))}function jl({years:t,minDate:e,maxDate:r,getYearControlProps:n}){const s=t.flat().filter(i=>!Qo({year:i,minDate:e,maxDate:r})&&!n?.(i)?.disabled),d=s.find(i=>n?.(i)?.selected);if(d)return d;const f=s.find(i=>he().isSame(i,"year"));return f||s[0]}function Ko(t){const e=he(t).year(),r=e-e%10;let n=0;const s=[[],[],[],[]];for(let d=0;d<4;d+=1){const f=d===3?1:3;for(let i=0;i<f;i+=1)s[d].push(he(new Date(r+n,0)).format("YYYY-MM-DD")),n+=1}return s}var Zo={yearsList:"m_9206547b",yearsListCell:"m_c5a19c7d"};const Rl={yearsListFormat:"YYYY",withCellSpacing:!0},ar=T.factory((t,e)=>{const r=T.useProps("YearsList",Rl,t),{classNames:n,className:s,style:d,styles:f,unstyled:i,vars:m,decade:y,yearsListFormat:_,locale:M,minDate:x,maxDate:D,getYearControlProps:P,__staticSelector:A,__getControlRef:B,__onControlKeyDown:Q,__onControlClick:W,__onControlMouseEnter:G,__preventFocus:J,__stopPropagation:z,withCellSpacing:H,size:F,attributes:$,...te}=r,X=T.useStyles({name:A||"YearsList",classes:Zo,props:r,className:s,style:d,classNames:n,styles:f,unstyled:i,attributes:$,vars:m,rootSelector:"yearsList"}),q=lt(),ue=Ko(y),de=jl({years:ue,minDate:x,maxDate:D,getYearControlProps:P}),S=ue.map((C,v)=>{const u=C.map((c,g)=>{const l=P?.(c),h=he(c).isSame(de,"year");return w.jsx("td",{...X("yearsListCell"),"data-with-spacing":H||void 0,children:w.jsx(ir,{...X("yearsListControl"),size:F,unstyled:i,"data-mantine-stop-propagation":z||void 0,disabled:Qo({year:c,minDate:x,maxDate:D}),ref:b=>{b&&B?.(v,g,b)},...l,onKeyDown:b=>{l?.onKeyDown?.(b),Q?.(b,{rowIndex:v,cellIndex:g,date:c})},onClick:b=>{l?.onClick?.(b),W?.(b,c)},onMouseEnter:b=>{l?.onMouseEnter?.(b),G?.(b,c)},onMouseDown:b=>{l?.onMouseDown?.(b),J&&b.preventDefault()},tabIndex:J||!h?-1:0,children:he(c).locale(q.getLocale(M)).format(_)})},g)});return w.jsx("tr",{...X("yearsListRow"),children:u},v)});return w.jsx(T.Box,{component:"table",ref:e,size:F,...X("yearsList"),...te,children:w.jsx("tbody",{children:S})})});ar.classes=Zo,ar.displayName="@mantine/dates/YearsList";function Jo({month:t,minDate:e,maxDate:r}){return!e&&!r?!1:!!(e&&he(t).isBefore(e,"month")||r&&he(t).isAfter(r,"month"))}function Nl({months:t,minDate:e,maxDate:r,getMonthControlProps:n}){const s=t.flat().filter(i=>!Jo({month:i,minDate:e,maxDate:r})&&!n?.(i)?.disabled),d=s.find(i=>n?.(i)?.selected);if(d)return d;const f=s.find(i=>he().isSame(i,"month"));return f||s[0]}function $l(t){const e=he(t).startOf("year").toDate(),r=[[],[],[],[]];let n=0;for(let s=0;s<4;s+=1)for(let d=0;d<3;d+=1)r[s].push(he(e).add(n,"months").format("YYYY-MM-DD")),n+=1;return r}var Xo={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const Ll={monthsListFormat:"MMM",withCellSpacing:!0},lr=T.factory((t,e)=>{const r=T.useProps("MonthsList",Ll,t),{classNames:n,className:s,style:d,styles:f,unstyled:i,vars:m,__staticSelector:y,year:_,monthsListFormat:M,locale:x,minDate:D,maxDate:P,getMonthControlProps:A,__getControlRef:B,__onControlKeyDown:Q,__onControlClick:W,__onControlMouseEnter:G,__preventFocus:J,__stopPropagation:z,withCellSpacing:H,size:F,attributes:$,...te}=r,X=T.useStyles({name:y||"MonthsList",classes:Xo,props:r,className:s,style:d,classNames:n,styles:f,unstyled:i,attributes:$,vars:m,rootSelector:"monthsList"}),q=lt(),ue=$l(_),de=Nl({months:ue,minDate:Ue(D),maxDate:Ue(P),getMonthControlProps:A}),S=ue.map((C,v)=>{const u=C.map((c,g)=>{const l=A?.(c),h=he(c).isSame(de,"month");return w.jsx("td",{...X("monthsListCell"),"data-with-spacing":H||void 0,children:w.jsx(ir,{...X("monthsListControl"),size:F,unstyled:i,__staticSelector:y||"MonthsList","data-mantine-stop-propagation":z||void 0,disabled:Jo({month:c,minDate:Ue(D),maxDate:Ue(P)}),ref:b=>{b&&B?.(v,g,b)},...l,onKeyDown:b=>{l?.onKeyDown?.(b),Q?.(b,{rowIndex:v,cellIndex:g,date:c})},onClick:b=>{l?.onClick?.(b),W?.(b,c)},onMouseEnter:b=>{l?.onMouseEnter?.(b),G?.(b,c)},onMouseDown:b=>{l?.onMouseDown?.(b),J&&b.preventDefault()},tabIndex:J||!h?-1:0,children:he(c).locale(q.getLocale(x)).format(M)})},g)});return w.jsx("tr",{...X("monthsListRow"),children:u},v)});return w.jsx(T.Box,{component:"table",ref:e,size:F,...X("monthsList"),...te,children:w.jsx("tbody",{children:S})})});lr.classes=Xo,lr.displayName="@mantine/dates/MonthsList";var es={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderControlIcon:"m_367dc749"};const Bl={hasNextLevel:!0,withNext:!0,withPrevious:!0,headerControlsOrder:["previous","level","next"]},Yl=T.createVarsResolver((t,{size:e})=>({calendarHeader:{"--dch-control-size":T.getSize(e,"dch-control-size"),"--dch-fz":T.getFontSize(e)}})),ut=T.factory((t,e)=>{const r=T.useProps("CalendarHeader",Bl,t),{classNames:n,className:s,style:d,styles:f,unstyled:i,vars:m,nextIcon:y,previousIcon:_,nextLabel:M,previousLabel:x,onNext:D,onPrevious:P,onLevelClick:A,label:B,nextDisabled:Q,previousDisabled:W,hasNextLevel:G,levelControlAriaLabel:J,withNext:z,withPrevious:H,headerControlsOrder:F,__staticSelector:$,__preventFocus:te,__stopPropagation:X,attributes:q,...ue}=r,de=T.useStyles({name:$||"CalendarHeader",classes:es,props:r,className:s,style:d,classNames:n,styles:f,unstyled:i,attributes:q,vars:m,varsResolver:Yl,rootSelector:"calendarHeader"}),S=te?g=>g.preventDefault():void 0,C=H&&re.createElement(T.UnstyledButton,{...de("calendarHeaderControl"),key:"previous","data-direction":"previous","aria-label":x,onClick:P,unstyled:i,onMouseDown:S,disabled:W,"data-disabled":W||void 0,tabIndex:te||W?-1:0,"data-mantine-stop-propagation":X||void 0},_||w.jsx(T.AccordionChevron,{...de("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})),v=re.createElement(T.UnstyledButton,{component:G?"button":"div",...de("calendarHeaderLevel"),key:"level",onClick:G?A:void 0,unstyled:i,onMouseDown:G?S:void 0,disabled:!G,"data-static":!G||void 0,"aria-label":J,tabIndex:te||!G?-1:0,"data-mantine-stop-propagation":X||void 0},B),u=z&&re.createElement(T.UnstyledButton,{...de("calendarHeaderControl"),key:"next","data-direction":"next","aria-label":M,onClick:D,unstyled:i,onMouseDown:S,disabled:Q,"data-disabled":Q||void 0,tabIndex:te||Q?-1:0,"data-mantine-stop-propagation":X||void 0},y||w.jsx(T.AccordionChevron,{...de("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})),c=F.map(g=>g==="previous"?C:g==="level"?v:g==="next"?u:null);return w.jsx(T.Box,{...de("calendarHeader"),ref:e,...ue,children:c})});ut.classes=es,ut.displayName="@mantine/dates/CalendarHeader";function Il(t){const e=Ko(t);return[e[0][0],e[3][0]]}const zl={decadeLabelFormat:"YYYY"},ur=T.factory((t,e)=>{const r=T.useProps("DecadeLevel",zl,t),{decade:n,locale:s,minDate:d,maxDate:f,yearsListFormat:i,getYearControlProps:m,__getControlRef:y,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:x,withCellSpacing:D,__preventFocus:P,nextIcon:A,previousIcon:B,nextLabel:Q,previousLabel:W,onNext:G,onPrevious:J,nextDisabled:z,previousDisabled:H,levelControlAriaLabel:F,withNext:$,withPrevious:te,headerControlsOrder:X,decadeLabelFormat:q,classNames:ue,styles:de,unstyled:S,__staticSelector:C,__stopPropagation:v,size:u,attributes:c,...g}=r,l=lt(),[h,b]=Il(n),E={__staticSelector:C||"DecadeLevel",classNames:ue,styles:de,unstyled:S,size:u,attributes:c},N=typeof z=="boolean"?z:f?!he(b).endOf("year").isBefore(f):!1,K=typeof H=="boolean"?H:d?!he(h).startOf("year").isAfter(d):!1,Z=(ne,V)=>he(ne).locale(s||l.locale).format(V);return w.jsxs(T.Box,{"data-decade-level":!0,size:u,ref:e,...g,children:[w.jsx(ut,{label:typeof q=="function"?q(h,b):`${Z(h,q)} – ${Z(b,q)}`,__preventFocus:P,__stopPropagation:v,nextIcon:A,previousIcon:B,nextLabel:Q,previousLabel:W,onNext:G,onPrevious:J,nextDisabled:N,previousDisabled:K,hasNextLevel:!1,levelControlAriaLabel:F,withNext:$,withPrevious:te,headerControlsOrder:X,...E}),w.jsx(ar,{decade:n,locale:s,minDate:d,maxDate:f,yearsListFormat:i,getYearControlProps:m,__getControlRef:y,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:x,__preventFocus:P,__stopPropagation:v,withCellSpacing:D,...E})]})});ur.classes={...ar.classes,...ut.classes},ur.displayName="@mantine/dates/DecadeLevel";const Fl={yearLabelFormat:"YYYY"},cr=T.factory((t,e)=>{const r=T.useProps("YearLevel",Fl,t),{year:n,locale:s,minDate:d,maxDate:f,monthsListFormat:i,getMonthControlProps:m,__getControlRef:y,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:x,withCellSpacing:D,__preventFocus:P,nextIcon:A,previousIcon:B,nextLabel:Q,previousLabel:W,onNext:G,onPrevious:J,onLevelClick:z,nextDisabled:H,previousDisabled:F,hasNextLevel:$,levelControlAriaLabel:te,withNext:X,withPrevious:q,headerControlsOrder:ue,yearLabelFormat:de,__staticSelector:S,__stopPropagation:C,size:v,classNames:u,styles:c,unstyled:g,attributes:l,...h}=r,b=lt(),E={__staticSelector:S||"YearLevel",classNames:u,styles:c,unstyled:g,size:v,attributes:l},N=typeof H=="boolean"?H:f?!he(n).endOf("year").isBefore(f):!1,K=typeof F=="boolean"?F:d?!he(n).startOf("year").isAfter(d):!1;return w.jsxs(T.Box,{"data-year-level":!0,size:v,ref:e,...h,children:[w.jsx(ut,{label:typeof de=="function"?de(n):he(n).locale(s||b.locale).format(de),__preventFocus:P,__stopPropagation:C,nextIcon:A,previousIcon:B,nextLabel:Q,previousLabel:W,onNext:G,onPrevious:J,onLevelClick:z,nextDisabled:N,previousDisabled:K,hasNextLevel:$,levelControlAriaLabel:te,withNext:X,withPrevious:q,headerControlsOrder:ue,...E}),w.jsx(lr,{year:n,locale:s,minDate:d,maxDate:f,monthsListFormat:i,getMonthControlProps:m,__getControlRef:y,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:x,__preventFocus:P,__stopPropagation:C,withCellSpacing:D,...E})]})});cr.classes={...ut.classes,...lr.classes},cr.displayName="@mantine/dates/YearLevel";const Ul={monthLabelFormat:"MMMM YYYY"},dr=T.factory((t,e)=>{const r=T.useProps("MonthLevel",Ul,t),{month:n,locale:s,firstDayOfWeek:d,weekdayFormat:f,weekendDays:i,getDayProps:m,excludeDate:y,minDate:_,maxDate:M,renderDay:x,hideOutsideDates:D,hideWeekdays:P,getDayAriaLabel:A,__getDayRef:B,__onDayKeyDown:Q,__onDayClick:W,__onDayMouseEnter:G,withCellSpacing:J,highlightToday:z,withWeekNumbers:H,__preventFocus:F,__stopPropagation:$,nextIcon:te,previousIcon:X,nextLabel:q,previousLabel:ue,onNext:de,onPrevious:S,onLevelClick:C,nextDisabled:v,previousDisabled:u,hasNextLevel:c,levelControlAriaLabel:g,withNext:l,withPrevious:h,headerControlsOrder:b,monthLabelFormat:E,classNames:N,styles:K,unstyled:Z,__staticSelector:ne,size:V,static:oe,attributes:ee,...ie}=r,O=lt(),L={__staticSelector:ne||"MonthLevel",classNames:N,styles:K,unstyled:Z,size:V,attributes:ee},j=typeof v=="boolean"?v:M?!he(n).endOf("month").isBefore(M):!1,I=typeof u=="boolean"?u:_?!he(n).startOf("month").isAfter(_):!1;return w.jsxs(T.Box,{"data-month-level":!0,size:V,ref:e,...ie,children:[w.jsx(ut,{label:typeof E=="function"?E(n):he(n).locale(s||O.locale).format(E),__preventFocus:F,__stopPropagation:$,nextIcon:te,previousIcon:X,nextLabel:q,previousLabel:ue,onNext:de,onPrevious:S,onLevelClick:C,nextDisabled:j,previousDisabled:I,hasNextLevel:c,levelControlAriaLabel:g,withNext:l,withPrevious:h,headerControlsOrder:b,...L}),w.jsx(sr,{month:n,locale:s,firstDayOfWeek:d,weekdayFormat:f,weekendDays:i,getDayProps:m,excludeDate:y,minDate:_,maxDate:M,renderDay:x,hideOutsideDates:D,hideWeekdays:P,getDayAriaLabel:A,__getDayRef:B,__onDayKeyDown:Q,__onDayClick:W,__onDayMouseEnter:G,__preventFocus:F,__stopPropagation:$,static:oe,withCellSpacing:J,highlightToday:z,withWeekNumbers:H,...L})]})});dr.classes={...sr.classes,...ut.classes},dr.displayName="@mantine/dates/MonthLevel";var ts={levelsGroup:"m_30b26e33"};const ct=T.factory((t,e)=>{const r=T.useProps("LevelsGroup",null,t),{classNames:n,className:s,style:d,styles:f,unstyled:i,vars:m,__staticSelector:y,attributes:_,...M}=r,x=T.useStyles({name:y||"LevelsGroup",classes:ts,props:r,className:s,style:d,classNames:n,styles:f,unstyled:i,attributes:_,vars:m,rootSelector:"levelsGroup"});return w.jsx(T.Box,{ref:e,...x("levelsGroup"),...M})});ct.classes=ts,ct.displayName="@mantine/dates/LevelsGroup";const ql={numberOfColumns:1},hr=T.factory((t,e)=>{const r=T.useProps("DecadeLevelGroup",ql,t),{decade:n,locale:s,minDate:d,maxDate:f,yearsListFormat:i,getYearControlProps:m,__onControlClick:y,__onControlMouseEnter:_,withCellSpacing:M,__preventFocus:x,nextIcon:D,previousIcon:P,nextLabel:A,previousLabel:B,onNext:Q,onPrevious:W,nextDisabled:G,previousDisabled:J,headerControlsOrder:z,classNames:H,styles:F,unstyled:$,__staticSelector:te,__stopPropagation:X,numberOfColumns:q,levelControlAriaLabel:ue,decadeLabelFormat:de,size:S,vars:C,attributes:v,...u}=r,c=re.useRef([]),g=Array(q).fill(0).map((l,h)=>{const b=he(n).add(h*10,"years").format("YYYY-MM-DD");return w.jsx(ur,{size:S,yearsListFormat:i,decade:b,withNext:h===q-1,withPrevious:h===0,decadeLabelFormat:de,__onControlClick:y,__onControlMouseEnter:_,__onControlKeyDown:(E,N)=>en({levelIndex:h,rowIndex:N.rowIndex,cellIndex:N.cellIndex,event:E,controlsRef:c}),__getControlRef:(E,N,K)=>{Array.isArray(c.current[h])||(c.current[h]=[]),Array.isArray(c.current[h][E])||(c.current[h][E]=[]),c.current[h][E][N]=K},levelControlAriaLabel:typeof ue=="function"?ue(b):ue,locale:s,minDate:d,maxDate:f,__preventFocus:x,__stopPropagation:X,nextIcon:D,previousIcon:P,nextLabel:A,previousLabel:B,onNext:Q,onPrevious:W,nextDisabled:G,previousDisabled:J,getYearControlProps:m,__staticSelector:te||"DecadeLevelGroup",classNames:H,styles:F,unstyled:$,withCellSpacing:M,headerControlsOrder:z,attributes:v},h)});return w.jsx(ct,{classNames:H,styles:F,__staticSelector:te||"DecadeLevelGroup",ref:e,size:S,unstyled:$,attributes:v,...u,children:g})});hr.classes={...ct.classes,...ur.classes},hr.displayName="@mantine/dates/DecadeLevelGroup";const Wl={numberOfColumns:1},fr=T.factory((t,e)=>{const r=T.useProps("YearLevelGroup",Wl,t),{year:n,locale:s,minDate:d,maxDate:f,monthsListFormat:i,getMonthControlProps:m,__onControlClick:y,__onControlMouseEnter:_,withCellSpacing:M,__preventFocus:x,nextIcon:D,previousIcon:P,nextLabel:A,previousLabel:B,onNext:Q,onPrevious:W,onLevelClick:G,nextDisabled:J,previousDisabled:z,hasNextLevel:H,headerControlsOrder:F,classNames:$,styles:te,unstyled:X,__staticSelector:q,__stopPropagation:ue,numberOfColumns:de,levelControlAriaLabel:S,yearLabelFormat:C,size:v,vars:u,attributes:c,...g}=r,l=re.useRef([]),h=Array(de).fill(0).map((b,E)=>{const N=he(n).add(E,"years").format("YYYY-MM-DD");return w.jsx(cr,{size:v,monthsListFormat:i,year:N,withNext:E===de-1,withPrevious:E===0,yearLabelFormat:C,__stopPropagation:ue,__onControlClick:y,__onControlMouseEnter:_,__onControlKeyDown:(K,Z)=>en({levelIndex:E,rowIndex:Z.rowIndex,cellIndex:Z.cellIndex,event:K,controlsRef:l}),__getControlRef:(K,Z,ne)=>{Array.isArray(l.current[E])||(l.current[E]=[]),Array.isArray(l.current[E][K])||(l.current[E][K]=[]),l.current[E][K][Z]=ne},levelControlAriaLabel:typeof S=="function"?S(N):S,locale:s,minDate:d,maxDate:f,__preventFocus:x,nextIcon:D,previousIcon:P,nextLabel:A,previousLabel:B,onNext:Q,onPrevious:W,onLevelClick:G,nextDisabled:J,previousDisabled:z,hasNextLevel:H,getMonthControlProps:m,classNames:$,styles:te,unstyled:X,__staticSelector:q||"YearLevelGroup",withCellSpacing:M,headerControlsOrder:F,attributes:c},E)});return w.jsx(ct,{classNames:$,styles:te,__staticSelector:q||"YearLevelGroup",ref:e,size:v,unstyled:X,attributes:c,...g,children:h})});fr.classes={...cr.classes,...ct.classes},fr.displayName="@mantine/dates/YearLevelGroup";const Vl={numberOfColumns:1},pr=T.factory((t,e)=>{const r=T.useProps("MonthLevelGroup",Vl,t),{month:n,locale:s,firstDayOfWeek:d,weekdayFormat:f,weekendDays:i,getDayProps:m,excludeDate:y,minDate:_,maxDate:M,renderDay:x,hideOutsideDates:D,hideWeekdays:P,getDayAriaLabel:A,__onDayClick:B,__onDayMouseEnter:Q,withCellSpacing:W,highlightToday:G,withWeekNumbers:J,__preventFocus:z,nextIcon:H,previousIcon:F,nextLabel:$,previousLabel:te,onNext:X,onPrevious:q,onLevelClick:ue,nextDisabled:de,previousDisabled:S,hasNextLevel:C,headerControlsOrder:v,classNames:u,styles:c,unstyled:g,numberOfColumns:l,levelControlAriaLabel:h,monthLabelFormat:b,__staticSelector:E,__stopPropagation:N,size:K,static:Z,vars:ne,attributes:V,...oe}=r,ee=re.useRef([]),ie=Array(l).fill(0).map((O,L)=>{const j=he(n).add(L,"months").format("YYYY-MM-DD");return w.jsx(dr,{month:j,withNext:L===l-1,withPrevious:L===0,monthLabelFormat:b,__stopPropagation:N,__onDayClick:B,__onDayMouseEnter:Q,__onDayKeyDown:(I,Y)=>en({levelIndex:L,rowIndex:Y.rowIndex,cellIndex:Y.cellIndex,event:I,controlsRef:ee}),__getDayRef:(I,Y,ce)=>{Array.isArray(ee.current[L])||(ee.current[L]=[]),Array.isArray(ee.current[L][I])||(ee.current[L][I]=[]),ee.current[L][I][Y]=ce},levelControlAriaLabel:typeof h=="function"?h(j):h,locale:s,firstDayOfWeek:d,weekdayFormat:f,weekendDays:i,getDayProps:m,excludeDate:y,minDate:_,maxDate:M,renderDay:x,hideOutsideDates:D,hideWeekdays:P,getDayAriaLabel:A,__preventFocus:z,nextIcon:H,previousIcon:F,nextLabel:$,previousLabel:te,onNext:X,onPrevious:q,onLevelClick:ue,nextDisabled:de,previousDisabled:S,hasNextLevel:C,classNames:u,styles:c,unstyled:g,__staticSelector:E||"MonthLevelGroup",size:K,static:Z,withCellSpacing:W,highlightToday:G,withWeekNumbers:J,headerControlsOrder:v,attributes:V},L)});return w.jsx(ct,{classNames:u,styles:c,__staticSelector:E||"MonthLevelGroup",ref:e,size:K,attributes:V,...oe,children:ie})});pr.classes={...ct.classes,...dr.classes},pr.displayName="@mantine/dates/MonthLevelGroup";const rs=t=>t==="range"?[null,null]:t==="multiple"?[]:null,ns=(t,e)=>{const r=e?Yo:Ue;return Array.isArray(t)?t.map(r):r(t)};function on({type:t,value:e,defaultValue:r,onChange:n,withTime:s=!1}){const d=re.useRef(t),[f,i,m]=Ne.useUncontrolled({value:ns(e,s),defaultValue:ns(r,s),finalValue:rs(t),onChange:n});let y=f;return d.current!==t&&(d.current=t,e===void 0&&(y=r!==void 0?r:rs(t),i(y))),[y,i,m]}function sn(t,e){return t?t==="month"?0:t==="year"?1:2:e||0}function Hl(t){return t===0?"month":t===1?"year":"decade"}function Yt(t,e,r){return Hl(Ne.clamp(sn(t,0),sn(e,0),sn(r,2)))}const Gl={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0,enableKeyboardNavigation:!0},gr=T.factory((t,e)=>{const r=T.useProps("Calendar",Gl,t),{vars:n,maxLevel:s,minLevel:d,defaultLevel:f,level:i,onLevelChange:m,date:y,defaultDate:_,onDateChange:M,numberOfColumns:x,columnsToScroll:D,ariaLabels:P,nextLabel:A,previousLabel:B,onYearSelect:Q,onMonthSelect:W,onYearMouseEnter:G,onMonthMouseEnter:J,headerControlsOrder:z,__updateDateOnYearSelect:H,__updateDateOnMonthSelect:F,__setDateRef:$,__setLevelRef:te,firstDayOfWeek:X,weekdayFormat:q,weekendDays:ue,getDayProps:de,excludeDate:S,renderDay:C,hideOutsideDates:v,hideWeekdays:u,getDayAriaLabel:c,monthLabelFormat:g,nextIcon:l,previousIcon:h,__onDayClick:b,__onDayMouseEnter:E,withCellSpacing:N,highlightToday:K,withWeekNumbers:Z,monthsListFormat:ne,getMonthControlProps:V,yearLabelFormat:oe,yearsListFormat:ee,getYearControlProps:ie,decadeLabelFormat:O,classNames:L,styles:j,unstyled:I,minDate:Y,maxDate:ce,locale:o,__staticSelector:a,size:p,__preventFocus:k,__stopPropagation:R,onNextDecade:U,onPreviousDecade:le,onNextYear:se,onPreviousYear:fe,onNextMonth:ae,onPreviousMonth:ge,static:ve,enableKeyboardNavigation:pe,attributes:xe,..._e}=r,{resolvedClassNames:Ce,resolvedStyles:Be}=T.useResolvedStylesApi({classNames:L,styles:j,props:r}),[Oe,Se]=Ne.useUncontrolled({value:i?Yt(i,d,s):void 0,defaultValue:f?Yt(f,d,s):void 0,finalValue:Yt(void 0,d,s),onChange:m}),[Xe,Ee]=on({type:"default",value:Ue(y),defaultValue:Ue(_),onChange:M});re.useImperativeHandle($,()=>me=>{Ee(me)}),re.useImperativeHandle(te,()=>me=>{Se(me)});const et={__staticSelector:a||"Calendar",styles:Be,classNames:Ce,unstyled:I,size:p,attributes:xe},qe=D||x||1,Je=new Date,tt=Y&&he(Je).isAfter(Y)?Y:he(Je).format("YYYY-MM-DD"),je=Xe||tt,dt=()=>{const me=he(je).add(qe,"month").format("YYYY-MM-DD");ae?.(me),Ee(me)},gt=()=>{const me=he(je).subtract(qe,"month").format("YYYY-MM-DD");ge?.(me),Ee(me)},rt=()=>{const me=he(je).add(qe,"year").format("YYYY-MM-DD");se?.(me),Ee(me)},We=()=>{const me=he(je).subtract(qe,"year").format("YYYY-MM-DD");fe?.(me),Ee(me)},Ve=()=>{const me=he(je).add(10*qe,"year").format("YYYY-MM-DD");U?.(me),Ee(me)},He=()=>{const me=he(je).subtract(10*qe,"year").format("YYYY-MM-DD");le?.(me),Ee(me)},ot=re.useRef(null);re.useEffect(()=>{if(!pe||ve)return;const me=ke=>{if(!ot.current?.contains(document.activeElement))return;const Te=ke.ctrlKey||ke.metaKey,Me=ke.shiftKey;switch(ke.key){case"ArrowUp":Te&&Me?(ke.preventDefault(),He()):Te&&(ke.preventDefault(),We());break;case"ArrowDown":Te&&Me?(ke.preventDefault(),Ve()):Te&&(ke.preventDefault(),rt());break;case"y":case"Y":Oe==="month"&&(ke.preventDefault(),Se("year"));break}};return document.addEventListener("keydown",me),()=>{document.removeEventListener("keydown",me)}},[pe,ve,Oe,rt,We,Ve,He]);const Ae=me=>{ot.current=me,typeof e=="function"?e(me):e&&(e.current=me)};return w.jsxs(T.Box,{ref:Ae,size:p,"data-calendar":!0,..._e,children:[Oe==="month"&&w.jsx(pr,{month:je,minDate:Y,maxDate:ce,firstDayOfWeek:X,weekdayFormat:q,weekendDays:ue,getDayProps:de,excludeDate:S,renderDay:C,hideOutsideDates:v,hideWeekdays:u,getDayAriaLabel:c,onNext:dt,onPrevious:gt,hasNextLevel:s!=="month",onLevelClick:()=>Se("year"),numberOfColumns:x,locale:o,levelControlAriaLabel:P?.monthLevelControl,nextLabel:P?.nextMonth??A,nextIcon:l,previousLabel:P?.previousMonth??B,previousIcon:h,monthLabelFormat:g,__onDayClick:b,__onDayMouseEnter:E,__preventFocus:k,__stopPropagation:R,static:ve,withCellSpacing:N,highlightToday:K,withWeekNumbers:Z,headerControlsOrder:z,...et}),Oe==="year"&&w.jsx(fr,{year:je,numberOfColumns:x,minDate:Y,maxDate:ce,monthsListFormat:ne,getMonthControlProps:V,locale:o,onNext:rt,onPrevious:We,hasNextLevel:s!=="month"&&s!=="year",onLevelClick:()=>Se("decade"),levelControlAriaLabel:P?.yearLevelControl,nextLabel:P?.nextYear??A,nextIcon:l,previousLabel:P?.previousYear??B,previousIcon:h,yearLabelFormat:oe,__onControlMouseEnter:J,__onControlClick:(me,ke)=>{F&&Ee(ke),Se(Yt("month",d,s)),W?.(ke)},__preventFocus:k,__stopPropagation:R,withCellSpacing:N,headerControlsOrder:z,...et}),Oe==="decade"&&w.jsx(hr,{decade:je,minDate:Y,maxDate:ce,yearsListFormat:ee,getYearControlProps:ie,locale:o,onNext:Ve,onPrevious:He,numberOfColumns:x,nextLabel:P?.nextDecade??A,nextIcon:l,previousLabel:P?.previousDecade??B,previousIcon:h,decadeLabelFormat:O,__onControlMouseEnter:G,__onControlClick:(me,ke)=>{H&&Ee(ke),Se(Yt("year",d,s)),Q?.(ke)},__preventFocus:k,__stopPropagation:R,withCellSpacing:N,headerControlsOrder:z,...et})]})});gr.classes={...hr.classes,...fr.classes,...pr.classes},gr.displayName="@mantine/dates/Calendar";function Ql(t){const{maxLevel:e,minLevel:r,defaultLevel:n,level:s,onLevelChange:d,nextIcon:f,previousIcon:i,date:m,defaultDate:y,onDateChange:_,numberOfColumns:M,columnsToScroll:x,ariaLabels:D,nextLabel:P,previousLabel:A,onYearSelect:B,onMonthSelect:Q,onYearMouseEnter:W,onMonthMouseEnter:G,onNextMonth:J,onPreviousMonth:z,onNextYear:H,onPreviousYear:F,onNextDecade:$,onPreviousDecade:te,withCellSpacing:X,highlightToday:q,__updateDateOnYearSelect:ue,__updateDateOnMonthSelect:de,__setDateRef:S,__setLevelRef:C,withWeekNumbers:v,headerControlsOrder:u,firstDayOfWeek:c,weekdayFormat:g,weekendDays:l,getDayProps:h,excludeDate:b,renderDay:E,hideOutsideDates:N,hideWeekdays:K,getDayAriaLabel:Z,monthLabelFormat:ne,monthsListFormat:V,getMonthControlProps:oe,yearLabelFormat:ee,yearsListFormat:ie,getYearControlProps:O,decadeLabelFormat:L,allowSingleDateInRange:j,allowDeselect:I,minDate:Y,maxDate:ce,locale:o,...a}=t;return{calendarProps:{maxLevel:e,minLevel:r,defaultLevel:n,level:s,onLevelChange:d,nextIcon:f,previousIcon:i,date:m,defaultDate:y,onDateChange:_,numberOfColumns:M,columnsToScroll:x,ariaLabels:D,nextLabel:P,previousLabel:A,onYearSelect:B,onMonthSelect:Q,onYearMouseEnter:W,onMonthMouseEnter:G,onNextMonth:J,onPreviousMonth:z,onNextYear:H,onPreviousYear:F,onNextDecade:$,onPreviousDecade:te,withCellSpacing:X,highlightToday:q,__updateDateOnYearSelect:ue,__updateDateOnMonthSelect:de,__setDateRef:S,withWeekNumbers:v,headerControlsOrder:u,firstDayOfWeek:c,weekdayFormat:g,weekendDays:l,getDayProps:h,excludeDate:b,renderDay:E,hideOutsideDates:N,hideWeekdays:K,getDayAriaLabel:Z,monthLabelFormat:ne,monthsListFormat:V,getMonthControlProps:oe,yearLabelFormat:ee,yearsListFormat:ie,getYearControlProps:O,decadeLabelFormat:L,allowSingleDateInRange:j,allowDeselect:I,minDate:Y,maxDate:ce,locale:o},others:a}}function Kl(t){if(t===null)return null;const e=new Date(t);return Number.isNaN(e.getTime())||!t?null:he(e).format("YYYY-MM-DD")}function Zl({date:t,maxDate:e,minDate:r}){return!(t==null||Number.isNaN(new Date(t).getTime())||e&&he(t).isAfter(e,"date")||r&&he(t).isBefore(r,"date"))}const Jl={valueFormat:"MMMM D, YYYY",fixOnBlur:!0},mr=T.factory((t,e)=>{const r=T.useInputProps("DateInput",Jl,t),{inputProps:n,wrapperProps:s,value:d,defaultValue:f,onChange:i,clearable:m,clearButtonProps:y,popoverProps:_,getDayProps:M,locale:x,valueFormat:D,dateParser:P,minDate:A,maxDate:B,fixOnBlur:Q,onFocus:W,onBlur:G,onClick:J,onKeyDown:z,readOnly:H,name:F,form:$,rightSection:te,unstyled:X,classNames:q,styles:ue,allowDeselect:de,date:S,defaultDate:C,onDateChange:v,getMonthControlProps:u,getYearControlProps:c,...g}=r,l=re.useRef(null),h=re.useRef(null),[b,E]=re.useState(!1),{calendarProps:N,others:K}=Ql(g),Z=lt(),V=P||(se=>{const fe=he(se,D,Z.getLocale(x)).toDate();return Number.isNaN(fe.getTime())?Kl(se):he(fe).format("YYYY-MM-DD")}),oe=de!==void 0?de:m,ee=se=>se?he(se).locale(Z.getLocale(x)).format(D):"",[ie,O,L]=on({type:"default",value:d,defaultValue:f,onChange:i}),[j,I]=on({type:"default",value:S,defaultValue:f||C,onChange:v});re.useEffect(()=>{L&&d!==null&&I(d)},[L,d]);const[Y,ce]=re.useState(ee(ie));re.useEffect(()=>{ce(ee(ie))},[Z.getLocale(x)]);const o=se=>{const fe=se.currentTarget.value;if(ce(fe),E(!0),fe.trim()===""&&m)O(null);else{const ae=V(fe);ae&&Zl({date:ae,minDate:A,maxDate:B})&&(O(ae),I(ae))}},a=se=>{G?.(se),E(!1),Q&&ce(ee(ie))},p=se=>{W?.(se),E(!0)},k=se=>{J?.(se),E(!0)},R=se=>{se.key==="Escape"&&E(!1),z?.(se)},U=se=>({...M?.(se),selected:he(ie).isSame(se,"day"),onClick:fe=>{M?.(se).onClick?.(fe);const ae=m&&oe&&he(ie).isSame(se,"day")?null:se;O(ae),!L&&ae&&ce(ee(ae)),E(!1)}}),le=te||(m&&ie&&!H?w.jsx(T.CloseButton,{variant:"transparent",onMouseDown:se=>se.preventDefault(),tabIndex:-1,onClick:()=>{O(null),!L&&ce(""),E(!1)},unstyled:X,size:n.size||"sm",...y}):null);return Ne.useDidUpdate(()=>{ie!==void 0&&!b&&ce(ee(ie))},[ie]),Ne.useClickOutside(()=>E(!1),void 0,[l.current,h.current]),w.jsxs(w.Fragment,{children:[w.jsx(T.Input.Wrapper,{...s,__staticSelector:"DateInput",ref:l,children:w.jsxs(T.Popover,{opened:b,trapFocus:!1,position:"bottom-start",disabled:H,withRoles:!1,unstyled:X,..._,children:[w.jsx(T.Popover.Target,{children:w.jsx(T.Input,{"data-dates-input":!0,"data-read-only":H||void 0,autoComplete:"off",ref:e,value:Y,onChange:o,onBlur:a,onFocus:p,onClick:k,onKeyDown:R,readOnly:H,rightSection:le,...n,...K,__staticSelector:"DateInput"})}),w.jsx(T.Popover.Dropdown,{onMouseDown:se=>se.preventDefault(),"data-dates-dropdown":!0,ref:h,children:w.jsx(gr,{__staticSelector:"DateInput",...N,classNames:q,styles:ue,unstyled:X,__preventFocus:!0,minDate:A,maxDate:B,locale:x,getDayProps:U,size:n.size,date:j,onDateChange:I,getMonthControlProps:se=>({selected:typeof ie=="string"?nn(se,ie):!1,...u?.(se)}),getYearControlProps:se=>({selected:typeof ie=="string"?he(se).isSame(ie,"year"):!1,...c?.(se)}),attributes:s.attributes})})]})}),w.jsx(Io,{name:F,form:$,value:ie,type:"default"})]})});mr.classes={...T.Input.classes,...gr.classes},mr.displayName="@mantine/dates/DateInput";function os(t){const e=Ge.c(47),{fields:r,onClose:n,queryKey:s,apiPath:d,steps:f,onCreated:i}=t,[m,y]=re.useState(0),[_,M]=re.useState(!1),[x,D]=re.useState(),{mutateAsync:P,isError:A,error:B,isPending:Q}=No(d,s),{mutateAsync:W,isPending:G}=Xr(d,s),J=Q||G;let z;e[0]!==r?(z=new Set(r.filter(nu).map(ru)),e[0]=r,e[1]=z):z=e[1];let H;e[2]!==z?(H=[...z],e[2]=z,e[3]=H):H=e[3];const F=H;let $;e[4]!==r?($=r.reduce(tu,{}),e[4]=r,e[5]=$):$=e[5];let te;e[6]!==r?(te=r.filter(eu).reduce(Xl,{}),e[6]=r,e[7]=te):te=e[7];let X;e[8]!==$||e[9]!==te?(X={mode:"uncontrolled",initialValues:$,validate:te},e[8]=$,e[9]=te,e[10]=X):X=e[10];const q=bn.useForm(X);let ue;e[11]!==q||e[12]!==x?(ue=function(h){const b=q.getValues();return h.conditional&&!h.conditional(b)?null:w.jsxs(re.Fragment,{children:[(h.type===void 0||h.type=="text")&&w.jsx(T.TextInput,{label:h.column.title,placeholder:h.placeholder??"",...q.getInputProps(h.id),type:h.id.includes("email")?"email":void 0,required:h.required},q.key(h.id)),h.type==="number"&&w.jsx(T.NumberInput,{decimalSeparator:",",label:h.column.title,placeholder:h.placeholder??"",...q.getInputProps(h.id),required:h.required},q.key(h.id)),h.type==="date"&&w.jsx(mr,{label:h.column.title,placeholder:h.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...q.getInputProps(h.id),required:h.required},q.key(h.id)),h.type==="boolean"&&w.jsx(T.Checkbox,{mt:"md",label:h.column.title,...q.getInputProps(h.id,{type:"checkbox"}),required:h.required},q.key(h.id)),h.type==="textarea"&&w.jsx(T.Textarea,{label:h.column.title,placeholder:h.placeholder??"",...q.getInputProps(h.id),minRows:3,autosize:!0,required:h.required},q.key(h.id)),h.type==="custom"&&h.render&&h.render({...q.getValues(),...x&&{id:x}},q.setValues,M,{error:q.getInputProps(h.id).error,required:h.required})]},h.id)},e[11]=q,e[12]=x,e[13]=ue):ue=e[13];const de=ue;let S;e[14]!==B?.message||e[15]!==B?.name||e[16]!==A?(S=A&&w.jsx(T.Alert,{variant:"outline",color:"red",title:B?.name??"Fehler aufgetreten",mb:"lg",children:B?.message??"Fehler aufgetreten"}),e[14]=B?.message,e[15]=B?.name,e[16]=A,e[17]=S):S=e[17];let C;e[18]!==m||e[19]!==P||e[20]!==q||e[21]!==A||e[22]!==n||e[23]!==i||e[24]!==x||e[25]!==F.length||e[26]!==W?(C=q.onSubmit(async l=>{if(x)await W({...l,id:x});else{const h=await P(l);D(h.id),i?.(h.id)}F.length&&m<F.length-1?A||y(m+1):A||(q.setInitialValues(l),q.reset(),n())}),e[18]=m,e[19]=P,e[20]=q,e[21]=A,e[22]=n,e[23]=i,e[24]=x,e[25]=F.length,e[26]=W,e[27]=C):C=e[27];let v;e[28]!==m||e[29]!==r||e[30]!==de||e[31]!==f||e[32]!==F?(v=F.length?w.jsx(T.Stepper,{active:m,size:"sm",children:F.map(l=>w.jsx(T.Stepper.Step,{...f&&f[l-1]?{label:f[l-1].label}:{},children:r.filter(h=>h.step===l).map(h=>de(h))},l))}):r.map(l=>de(l)),e[28]=m,e[29]=r,e[30]=de,e[31]=f,e[32]=F,e[33]=v):v=e[33];let u;e[34]!==m||e[35]!==_||e[36]!==J||e[37]!==n||e[38]!==F.length?(u=!_&&w.jsxs(T.Group,{mt:"md",justify:"end",children:[w.jsx(T.Button,{onClick:()=>F.length?m===0?n():y(m-1):n(),variant:"outline",children:F.length?m===0?"Abbrechen":"Zurück":"Abbrechen"}),w.jsx(T.Button,{type:"submit",loading:J,children:F.length?m===F.length-1?"Speichern":"Weiter":"Speichern"})]}),e[34]=m,e[35]=_,e[36]=J,e[37]=n,e[38]=F.length,e[39]=u):u=e[39];let c;e[40]!==u||e[41]!==C||e[42]!==v?(c=w.jsxs("form",{onSubmit:C,children:[v,u]}),e[40]=u,e[41]=C,e[42]=v,e[43]=c):c=e[43];let g;return e[44]!==c||e[45]!==S?(g=w.jsxs(w.Fragment,{children:[S,c]}),e[44]=c,e[45]=S,e[46]=g):g=e[46],g}function Xl(t,e){return t[e.id]=(r,n)=>e.conditional&&!e.conditional(n)||r?null:"Pflichtfeld",t}function eu(t){return t.required}function tu(t,e){return t[e.id]=e.type==="boolean"?!1:e.defaultValue??"",t}function ru(t){return t.step}function nu(t){return typeof t.step=="number"}var[ou,an]=T.createSafeContext("useDataTableColumnsContext must be used within DataTableColumnProvider"),ss=t=>{let{children:e,columnsOrder:r,setColumnsOrder:n,columnsToggle:s,setColumnsToggle:d,resetColumnsOrder:f,resetColumnsToggle:i,setColumnWidth:m,setMultipleColumnWidths:y,resetColumnsWidth:_}=t,[M,x]=re.useState(""),[D,P]=re.useState("");return w.jsx(ou,{value:{sourceColumn:M,setSourceColumn:x,targetColumn:D,setTargetColumn:P,columnsToggle:s,setColumnsToggle:d,swapColumns:()=>{if(!r||!n||!M||!D)return;let A=r.indexOf(M),B=r.indexOf(D);if(A!==-1&&B!==-1){let Q=r.splice(A,1)[0];r.splice(B,0,Q),n([...r])}},resetColumnsOrder:f,resetColumnsToggle:i,setColumnWidth:m,setMultipleColumnWidths:y,resetColumnsWidth:_},children:e})};function su(){return w.jsx("tr",{className:"mantine-datatable-empty-row",children:w.jsx("td",{})})}function iu(){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 au({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(iu,{})}),w.jsx(T.Text,{component:"div",size:"sm",c:"dimmed",children:e})]})})}var lu=({key:t,columns:e=[],getInitialValueInEffect:r=!0})=>{function n(z,H){let F=[];return z.forEach($=>{H.find(te=>te.accessor===$)&&F.push($)}),H.forEach($=>{F.includes($.accessor)||F.push($.accessor)}),F}function s(z,H){let F=[];return z.forEach($=>{H.find(te=>te.accessor===$.accessor)&&F.push($)}),H.forEach($=>{F.find(te=>te.accessor===$.accessor)||F.push({accessor:$.accessor,defaultToggle:$.defaultToggle||!0,toggleable:$.toggleable,toggled:$.defaultToggle===void 0?!0:$.defaultToggle})}),F}function d(z,H){let F=[];return z.forEach($=>{let te=Object.keys($)[0];H.find(X=>X.accessor===te)&&F.push($)}),H.forEach($=>{let te=$.accessor;if(!F.find(X=>Object.keys(X)[0]===te)){let X={};X[te]="",F.push(X)}}),F}function f(){let[z,H]=Ne.useLocalStorage({key:t?`${t}-columns-order`:"",defaultValue:t?y:void 0,getInitialValueInEffect:r});function F(X){t&&H(X)}if(!t)return[z,F];let $=n(z,e),te=JSON.stringify(z);return JSON.stringify($)!==te&&F($),[$,F]}function i(){let[z,H]=Ne.useLocalStorage({key:t?`${t}-columns-toggle`:"",defaultValue:t?M:void 0,getInitialValueInEffect:r});function F(X){t&&H(X)}if(!t)return[z,F];let $=s(z,e),te=JSON.stringify(z);return JSON.stringify($)!==te&&F($),[s(z,e),F]}function m(){let[z,H]=Ne.useLocalStorage({key:t?`${t}-columns-width`:"",defaultValue:t?_:void 0,getInitialValueInEffect:r});function F(X){t&&H(X)}if(!t)return[z,F];let $=d(z,e),te=JSON.stringify(z);return JSON.stringify($)!==te&&F($),[d(z,e),F]}let y=e&&e.map(z=>z.accessor)||[],_=e&&e.map(z=>({[z.accessor]:z.width??"initial"}))||[],M=e&&e.map(z=>({accessor:z.accessor,defaultToggle:z.defaultToggle||!0,toggleable:z.toggleable,toggled:z.defaultToggle===void 0?!0:z.defaultToggle})),[x,D]=f(),[P,A]=i(),[B,Q]=m(),W=()=>D(y),G=()=>{A(M)},J=()=>Q(_);return{effectiveColumns:re.useMemo(()=>x?x.map(z=>e.find(H=>H.accessor===z)).map(z=>({...z,hidden:z?.hidden||!P.find(H=>H.accessor===z?.accessor)?.toggled})).map(z=>({...z,width:B.find(H=>H[z?.accessor])?.[z?.accessor]})):e,[e,x,P,B]),setColumnsOrder:D,columnsOrder:x,resetColumnsOrder:W,columnsToggle:P,setColumnsToggle:A,resetColumnsToggle:G,columnsWidth:B,setColumnsWidth:Q,setColumnWidth:(z,H)=>{let F=B.map($=>$[z]?{[z]:H}:$);Q(F)},setMultipleColumnWidths:z=>{let H=B.map(F=>{let $=Object.keys(F)[0],te=z.find(X=>X.accessor===$);return te?{[$]:te.width}:F});Q(H)},resetColumnsWidth:J}},is=typeof window<"u"?re.useLayoutEffect:re.useEffect;function as(t){let e=re.useRef(t);return e.current=t,e}var ls="--mantine-datatable-header-height",us="--mantine-datatable-footer-height",cs="--mantine-datatable-selection-column-width",ds="--mantine-datatable-last-row-border-bottom";function Ze(t,e,r){t?.style.setProperty(e,r)}function ln(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 un(t,e,r){if(t){let n=new ResizeObserver(s=>{let d=s[0];d&&e(ln(d))});return n.observe(t),()=>{n.disconnect(),r()}}}function uu({scrollCallbacks:t,withRowBorders:e}){let r={root:re.useRef(null),table:re.useRef(null),scrollViewport:re.useRef(null),header:re.useRef(null),footer:re.useRef(null),selectionColumnHeader:re.useRef(null)},{root:n,table:s,scrollViewport:d,header:f,footer:i,selectionColumnHeader:m}=r,y=as({withRowBorders:e}),_=as(t),M=re.useRef(()=>{}),x=re.useRef(()=>{}),D=re.useCallback(P=>{_.current.onScroll?.(P),M.current()},[]);return re.useEffect(()=>un(f.current,P=>{Ze(n.current,ls,`${P.height}px`)},()=>Ze(n.current,ls,"0")),[f.current]),re.useEffect(()=>un(i.current,P=>{Ze(n.current,us,`${P.height}px`)},()=>Ze(n.current,us,"0")),[i.current]),re.useEffect(()=>un(m.current,P=>{Ze(n.current,cs,`${P.width}px`)},()=>Ze(n.current,cs,"0")),[m.current]),is(()=>{if(typeof window===void 0)return;let P={top:!0,bottom:!0,left:!0,right:!0},A={width:0,height:0},B={width:0,height:0};function Q(H,F){let $=P[H];return P[H]=F,Ze(n.current,`--mantine-datatable-${H}-shadow-opacity`,F?"0":"1"),$}function W(){let H=A.height-B.height,F=H<0;Ze(n.current,"--mantine-datatable-footer-position",F?"relative":"sticky"),Ze(n.current,"--mantine-datatable-footer-bottom",F?`${H}px`:"0")}function G(){y.current.withRowBorders&&A.height<B.height?Ze(n.current,ds,`${T.rem("1px")} solid var(--mantine-datatable-border-color)`):Ze(n.current,ds,"unset")}x.current=G;function J(){let H=_.current,F=d.current?.scrollTop??0,$=d.current?.scrollLeft??0,te=F===0,X=A.height-F-B.height<1,q=Q("top",te),ue=Q("bottom",X);te&&te!==q&&H.onScrollToTop?.(),X&&X!==ue&&H.onScrollToBottom?.();let de=$===0,S=A.width-$-B.width<1,C=Q("left",de),v=Q("right",S);de&&de!==C&&H.onScrollToLeft?.(),S&&S!==v&&H.onScrollToRight?.()}M.current=J;let z=new ResizeObserver(H=>{for(let F of H)switch(F.target.tagName){case"TABLE":{A=ln(F);break}case"DIV":{B=ln(F);break}}J(),W(),G()});return z.observe(s.current),z.observe(d.current),()=>{z.disconnect()}},[]),is(()=>{x.current()},[e]),{refs:r,onScroll:D}}function cu(t){let[e,r]=re.useState(null),n=t?.join(":")||"";return re.useEffect(()=>{r(null)},[n]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:r}}function du(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 hu(t,e){return e||(typeof window<"u"&&"matchMedia"in window?t.map(r=>window.matchMedia(r).matches):t.map(()=>!1))}function fu(t,e,{getInitialValueInEffect:r}={getInitialValueInEffect:!0}){let[n,s]=re.useState(r?e:hu(t,e)),d=re.useRef(null);return re.useEffect(()=>{if("matchMedia"in window)return d.current=t.map(f=>window.matchMedia(f)),s(d.current.map(f=>f.matches)),du(d.current,f=>{s(f)})},[t]),n}function pu(t){let e=T.useMantineTheme(),r=re.useMemo(()=>t.map(s=>(typeof s=="function"?s(e):s)??""),[t,e]),n=re.useMemo(()=>t.map(()=>!0),[t]);return fu(r,n)}function yr(t){let e=T.useMantineTheme(),r=typeof t=="function"?t(e):t;return Ne.useMediaQuery(r||"",!0)}function cn(t){let e=t.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function gu(t,e,r){return t.filter(n=>!e.map(r).includes(r(n)))}function dn(t,e){return t.filter((r,n,s)=>n===s.findIndex(d=>e(r)===e(d)))}function hs(t,e){return e?e.match(/([^[.\]])+/g).reduce((r,n)=>r&&r[n],t):void 0}function Le(t,e){return typeof e=="string"?hs(t,e):e(t)}function mu({rowExpansion:t,records:e,idAccessor:r}){let n=[];if(t&&e){let{trigger:i,allowMultiple:m,initiallyExpanded:y}=t;e&&i==="always"?n=e.map(_=>Le(_,r)):y&&(n=e.filter((_,M)=>y({record:_,index:M})).map(_=>Le(_,r)),m||(n=[n[0]]))}let s,d,f=re.useState(n);if(t){let{expandable:i,trigger:m,allowMultiple:y,collapseProps:_,content:M}=t;t.expanded?{recordIds:s,onRecordIdsChange:d}=t.expanded:[s,d]=f;let x=D=>d?.(s.filter(P=>P!==Le(D,r)));return{expandOnClick:m!=="always"&&m!=="never",isRowExpanded:D=>m==="always"?!0:s.includes(Le(D,r)),isExpandable:({record:D,index:P})=>i?i({record:D,index:P}):!0,expandRow:D=>{let P=Le(D,r);d?.(y?[...s,P]:[P])},collapseRow:x,collapseProps:_,content:({record:D,index:P})=>()=>M({record:D,index:P,collapse:()=>x(D)})}}}function yu(t,e){let[r,n]=re.useState(t),[s,d]=re.useState(t),f=Ne.useTimeout(()=>n(!0),0),i=Ne.useTimeout(()=>d(!1),e||200);return re.useEffect(()=>{t?(i.clear(),d(!0),f.start()):(f.clear(),n(!1),i.start())},[f,i,t]),{expanded:r,visible:s}}var hn="mantine-datatable-nowrap",fn="mantine-datatable-ellipsis",_t="mantine-datatable-pointer-cursor",fs="mantine-datatable-context-menu-cursor",vu="mantine-datatable-text-selection-disabled",vr="mantine-datatable-text-align-left",br="mantine-datatable-text-align-center",wr="mantine-datatable-text-align-right";function bu({className:t,style:e,visibleMediaQuery:r,title:n,noWrap:s,ellipsis:d,textAlign:f,width:i}){return yr(r)?w.jsx(T.TableTh,{className:De({[hn]:s||d,[fn]:d,[vr]:f==="left",[br]:f==="center",[wr]:f==="right"},t),style:[{width:i,minWidth:i,maxWidth:i},e],children:n}):null}function wu({shadowVisible:t}){return w.jsx(T.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":t||void 0})}function _u({className:t,style:e,columns:r,defaultColumnProps:n,selectionVisible:s,selectorCellShadowVisible:d,ref:f}){return w.jsx(T.TableTfoot,{ref:f,className:De("mantine-datatable-footer",t),style:e,children:w.jsxs(T.TableTr,{children:[s&&w.jsx(wu,{shadowVisible:d}),r.map(({hidden:i,...m})=>{if(i)return null;let{accessor:y,visibleMediaQuery:_,textAlign:M,width:x,footer:D,footerClassName:P,footerStyle:A,noWrap:B,ellipsis:Q}={...n,...m};return w.jsx(bu,{className:P,style:A,visibleMediaQuery:_,textAlign:M,width:x,title:D,noWrap:B,ellipsis:Q},y)})]})})}function xu({group:{id:t,columns:e,title:r,textAlign:n,className:s,style:d}}){let f=re.useMemo(()=>e.map(({visibleMediaQuery:y})=>y),[e]),i=pu(f),m=re.useMemo(()=>e.filter(({hidden:y},_)=>!y&&i?.[_]).length,[e,i]);return m>0?w.jsx(T.TableTh,{colSpan:m,className:De("mantine-datatable-column-group-header-cell",{[vr]:n==="left",[br]:n==="center",[wr]:n==="right"},s),style:d,children:r??cn(t)}):null}function Cu(){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 Su(){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 Du({children:t,isActive:e,filterPopoverProps:r,filterPopoverDisableClickOutside:n}){let[s,{close:d,toggle:f}]=Ne.useDisclosure(!1),i=e?Su:Cu,m=Ne.useClickOutside(d);return n&&(m=void 0),w.jsxs(T.Popover,{withArrow:!0,shadow:"md",opened:s,onClose:d,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(),f()},onKeyDown:y=>y.stopPropagation(),children:w.jsx(i,{})})}),w.jsx(T.PopoverDropdown,{ref:m,onClick:y=>y.stopPropagation(),onKeyDown:y=>y.stopPropagation(),children:typeof t=="function"?t({close:d}):t})]})}var ku=t=>{let{accessor:e,columnRef:r}=t,[n,s]=re.useState(!1),d=re.useRef(0),f=re.useRef({current:0,next:0}),{setMultipleColumnWidths:i}=an(),m=re.useCallback(_=>{if(_.preventDefault(),_.stopPropagation(),!r.current)return;let M=r.current,x=M.nextElementSibling;for(;x;){let G=x.getAttribute("data-accessor");if(G&&G!=="__selection__")break;x=x.nextElementSibling}if(!x)return;let D=x.getAttribute("data-accessor");if(!D)return;let P=D==="__selection__";s(!0),d.current=_.clientX;let A=M.offsetWidth,B=x.offsetWidth;f.current={current:A,next:B};let Q=G=>{if(!r.current)return;let J=r.current,z=J.nextElementSibling;if(!z)return;let H=G.clientX-d.current,F=50,$=f.current.current-F,te=f.current.next-F,X=Math.max(-$,Math.min(H,te)),q=f.current.current+X,ue=f.current.next-X;J.style.width=`${q}px`,z.style.width=`${ue}px`,J.style.minWidth=`${q}px`,J.style.maxWidth=`${q}px`,z.style.minWidth=`${ue}px`,z.style.maxWidth=`${ue}px`},W=()=>{if(!r.current)return;let G=r.current,J=G.nextElementSibling;s(!1),document.body.style.cursor="initial",document.body.style.userSelect="initial";let z=parseInt(G.style.width)||G.offsetWidth,H=J?parseInt(J.style.width)||J.offsetWidth:0,F=[{accessor:e,width:`${z}px`}];if(J&&!P){let $=J.getAttribute("data-accessor");$&&F.push({accessor:$,width:`${H}px`})}setTimeout(()=>{i(F)},0),document.removeEventListener("mousemove",Q),document.removeEventListener("mouseup",W)};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",Q),document.addEventListener("mouseup",W)},[e,i]),y=re.useCallback(()=>{if(!r.current)return;let _=r.current,M=_.nextElementSibling;_.style.width="",_.style.minWidth="",_.style.maxWidth="";let x=[{accessor:e,width:"initial"}];if(M){M.style.width="",M.style.minWidth="",M.style.maxWidth="";let D=M.getAttribute("data-accessor");D&&D!=="__selection__"&&x.push({accessor:D,width:"initial"})}setTimeout(()=>{i(x)},0)},[e,i]);return w.jsx("div",{className:"mantine-datatable-header-resizable-handle",style:{cursor:n?"col-resize":void 0},onMouseDown:m,onDoubleClick:y,onClick:_=>_.stopPropagation(),title:"Drag to resize column, double-click to reset"})};function Mu(){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 Pu(){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 Ou(){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 Au(){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 Tu({className:t,style:e,accessor:r,visibleMediaQuery:n,title:s,sortable:d,draggable:f,toggleable:i,resizable:m,sortIcons:y,textAlign:_,width:M,sortStatus:x,onSortStatusChange:D,filter:P,filterPopoverProps:A,filterPopoverDisableClickOutside:B,filtering:Q,sortKey:W}){let{setSourceColumn:G,setTargetColumn:J,swapColumns:z,setColumnsToggle:H}=an(),[F,$]=re.useState(!1),te=re.useRef(null);if(!yr(n))return null;let X=s??cn(r),q=typeof X=="string"?X:void 0,ue=d&&D?g=>{g?.defaultPrevented||D({sortKey:W,columnAccessor:r,direction:x?.columnAccessor===r?x.direction==="asc"?"desc":"asc":x?.direction??"asc"})}:void 0,de=g=>{g.stopPropagation(),G(r),$(!1)},S=g=>{g.preventDefault(),J(r),$(!0)},C=()=>{J(r),$(!1),z()},v=()=>{$(!0)},u=()=>{$(!1)},c=g=>{g.stopPropagation(),H(l=>l.map(h=>h.accessor===r?{...h,toggled:!1}:h))};return w.jsxs(T.TableTh,{"data-accessor":r,className:De({"mantine-datatable-header-cell-sortable":d,"mantine-datatable-header-cell-toggleable":i,"mantine-datatable-header-cell-resizable":m},t),style:[{width:M,...m?{minWidth:"1px"}:{minWidth:M,maxWidth:M}},e],role:d?"button":void 0,tabIndex:d?0:void 0,onClick:ue,onKeyDown:g=>g.key==="Enter"&&ue?.(),ref:te,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:De({"mantine-datatable-header-cell-draggable":f,"mantine-datatable-header-cell-drag-over":F}),draggable:f,onDragStart:f?de:void 0,onDragEnter:f?v:void 0,onDragOver:f?S:void 0,onDrop:f?C:void 0,onDragLeave:f?u:void 0,children:[f?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:g=>{g.stopPropagation()},children:w.jsx(Ou,{})})}):null,w.jsx(T.Box,{className:De("mantine-datatable-header-cell-sortable-text",{[vr]:_==="left",[br]:_==="center",[wr]:_==="right"},hn,fn),title:q,children:X})]}),i?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:c,children:w.jsx(Au,{})})}):null,d||x?.columnAccessor===r?w.jsx(w.Fragment,{children:x?.columnAccessor===r?w.jsx(T.Center,{className:De("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(Mu,{})}):w.jsx(T.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:y?.unsorted||w.jsx(Pu,{})})}):null,P?w.jsx(Du,{filterPopoverProps:A,isActive:!!Q,filterPopoverDisableClickOutside:B,children:P}):null]}),m&&r!=="__selection__"?w.jsx(ku,{accessor:r,columnRef:te}):null]})}function Eu({className:t,style:e,trigger:r,shadowVisible:n,checked:s,indeterminate:d,checkboxProps:f,onChange:i,rowSpan:m,ref:y}){let _=!f.disabled;return w.jsx(T.TableTh,{ref:y,className:De("mantine-datatable-header-selector-cell",{[_t]:r==="cell"&&_},t),style:e,rowSpan:m,"data-shadow-visible":n||void 0,"data-accessor":"__selection__",onClick:r==="cell"&&_?i:void 0,children:w.jsx(T.Checkbox,{classNames:_?{input:_t}:void 0,checked:s,indeterminate:d,onChange:i,...f,disabled:!(i||f.onChange)||f.disabled})})}function ju({selectionColumnHeaderRef:t,className:e,style:r,sortStatus:n,sortIcons:s,onSortStatusChange:d,columns:f,defaultColumnProps:i,groups:m,selectionTrigger:y,selectionVisible:_,selectionChecked:M,selectionIndeterminate:x,onSelectionChange:D,selectionCheckboxProps:P,selectorCellShadowVisible:A,selectionColumnClassName:B,selectionColumnStyle:Q,ref:W}){let G=_?w.jsx(Eu,{ref:t,className:B,style:Q,trigger:y,shadowVisible:A,checked:M,indeterminate:x,checkboxProps:P,onChange:D,rowSpan:m?2:void 0}):null,{columnsToggle:J,setColumnsToggle:z}=an(),[H,F]=re.useState(!1),$=f.some(q=>q.toggleable),te=$?Object.fromEntries(f.map(({accessor:q,title:ue})=>[q,ue??cn(String(q))])):void 0,X=w.jsxs(T.TableThead,{className:De("mantine-datatable-header",e),style:r,ref:W,onContextMenu:$?q=>{q.preventDefault(),F(ue=>!ue)}:void 0,children:[m&&w.jsxs(T.TableTr,{children:[G,m.map(q=>w.jsx(xu,{group:q},q.id))]}),w.jsxs(T.TableTr,{children:[!m&&G,f.map(({hidden:q,...ue},de)=>{if(q)return null;let{accessor:S,visibleMediaQuery:C,textAlign:v,width:u,title:c,sortable:g,draggable:l,toggleable:h,resizable:b,titleClassName:E,titleStyle:N,filter:K,filterPopoverProps:Z,filterPopoverDisableClickOutside:ne,filtering:V,sortKey:oe}={...i,...ue};return w.jsx(Tu,{accessor:S,className:E,style:N,visibleMediaQuery:C,textAlign:v,width:u,title:c,sortable:g,draggable:l,toggleable:h,resizable:b&&de<f.length-1,sortStatus:n,sortIcons:s,sortKey:oe,onSortStatusChange:d,filter:K,filterPopoverProps:Z,filterPopoverDisableClickOutside:ne,filtering:V},S)})]})]});return $?w.jsxs(T.Popover,{position:"bottom",withArrow:!0,shadow:"md",opened:H,onChange:F,children:[w.jsx(T.PopoverTarget,{children:X}),w.jsx(T.PopoverDropdown,{children:w.jsx(T.Stack,{children:J.filter(q=>q.toggleable).map(q=>w.jsx(T.Group,{children:w.jsx(T.Checkbox,{classNames:{label:"mantine-datatable-header-column-toggle-checkbox-label"},size:"xs",label:te[q.accessor],checked:q.toggled,onChange:ue=>{z(J.map(de=>de.accessor===q.accessor?{...de,toggled:ue.currentTarget.checked}:de))}})},q.accessor))})})]}):X}function Ru({fetching:t,customContent:e,backgroundBlur:r,size:n,type:s,color:d}){return w.jsx(T.Center,{className:De("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:d}))})}function Pe(t,e,r){return t?T.parseThemeColor({color:typeof t=="object"?t[r]:t,theme:e}).value:void 0}function Nu({theme:t,c:e,backgroundColor:r,borderColor:n,rowBorderColor:s,stripedColor:d,highlightOnHoverColor:f}){return{"--mantine-datatable-color-light":Pe(e,t,"light"),"--mantine-datatable-color-dark":Pe(e,t,"dark"),"--mantine-datatable-background-color-light":Pe(r,t,"light"),"--mantine-datatable-background-color-dark":Pe(r,t,"dark"),"--mantine-datatable-border-color-light":Pe(n,t,"light"),"--mantine-datatable-border-color-dark":Pe(n,t,"dark"),"--mantine-datatable-row-border-color-light":Pe(s,t,"light"),"--mantine-datatable-row-border-color-dark":Pe(s,t,"dark"),"--mantine-datatable-striped-color-light":Pe(d,t,"light"),"--mantine-datatable-striped-color-dark":Pe(d,t,"dark"),"--mantine-datatable-highlight-on-hover-color-light":Pe(f,t,"light"),"--mantine-datatable-highlight-on-hover-color-dark":Pe(f,t,"dark")}}function ps({theme:t,paginationActiveTextColor:e,paginationActiveBackgroundColor:r}){return{"--mantine-datatable-pagination-active-text-color-light":Pe(e,t,"light"),"--mantine-datatable-pagination-active-text-color-dark":Pe(e,t,"dark"),"--mantine-datatable-pagination-active-background-color-light":Pe(r,t,"light"),"--mantine-datatable-pagination-active-background-color-dark":Pe(r,t,"dark")}}function $u({theme:t,color:e,backgroundColor:r}){return{"--mantine-datatable-row-color-light":Pe(e,t,"light"),"--mantine-datatable-row-color-dark":Pe(e,t,"dark"),"--mantine-datatable-row-background-color-light":Pe(r,t,"light"),"--mantine-datatable-row-background-color-dark":Pe(r,t,"dark")}}function Lu(){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 gs={xs:T.rem(22),sm:T.rem(26),md:T.rem(32),lg:T.rem(38),xl:T.rem(44)};function Bu({size:t,label:e,values:r,value:n,activeTextColor:s,activeBackgroundColor:d,onChange:f}){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(Lu,{}),style:[{fontWeight:"normal"},i=>({height:gs[t],paddingLeft:i.spacing[t],paddingRight:i.spacing[t]})],children:n})}),w.jsx(T.MenuDropdown,{children:r.map(i=>{let m=i===n;return w.jsx(T.MenuItem,{className:De({"mantine-datatable-page-size-selector-active":m}),style:[{height:gs[t]},m&&(s||d)?y=>ps({theme:y,paginationActiveTextColor:s,paginationActiveBackgroundColor:d}):void 0],disabled:m,onClick:()=>f(i),children:w.jsx(T.Text,{component:"div",size:t,children:i})},i)})})]})]})}function Yu({className:t,style:e,fetching:r,page:n,onPageChange:s,paginationWithEdges:d,paginationWithControls:f,paginationActiveTextColor:i,paginationActiveBackgroundColor:m,paginationSize:y,loadingText:_,noRecordsText:M,paginationText:x,totalRecords:D,recordsPerPage:P,onRecordsPerPageChange:A,recordsPerPageLabel:B,recordsPerPageOptions:Q,recordsLength:W,horizontalSpacing:G,paginationWrapBreakpoint:J,getPaginationControlProps:z}){let H;if(D){let $=(n-1)*P+1,te=$+(W||0)-1;H=x({from:$,to:te,totalRecords:D})}else H=r?_:M;let F=yr(({breakpoints:$})=>`(min-width: ${typeof J=="number"?`${T.rem(J)}rem`:$[J]||J})`);return w.jsxs(T.Box,{px:G??"xs",py:"xs",className:De("mantine-datatable-pagination",t),style:[{flexDirection:F?"row":"column"},e],children:[w.jsx(T.Text,{component:"div",className:"mantine-datatable-pagination-text",size:y,children:H}),Q&&w.jsx(Bu,{activeTextColor:i,activeBackgroundColor:m,size:y,label:B,values:Q,value:P,onChange:A}),w.jsx(T.Pagination,{classNames:{root:De("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":r||!W}),control:"mantine-datatable-pagination-pages-control"},style:i||m?$=>ps({theme:$,paginationActiveTextColor:i,paginationActiveBackgroundColor:m}):void 0,withEdges:d,withControls:f,value:n,onChange:s,size:y,total:Math.ceil(D/P),getControlProps:z})]})}function Iu({className:t,style:e,visibleMediaQuery:r,record:n,index:s,onClick:d,onDoubleClick:f,onContextMenu:i,noWrap:m,ellipsis:y,textAlign:_,width:M,accessor:x,render:D,defaultRender:P,customCellAttributes:A}){return yr(r)?w.jsx(T.TableTd,{className:De({[hn]:m||y,[fn]:y,[_t]:d||f,[fs]:i,[vr]:_==="left",[br]:_==="center",[wr]:_==="right"},t),style:[{width:M,minWidth:M,maxWidth:M},e],onClick:d,onDoubleClick:f,onContextMenu:i,...A?.(n,s),children:D?D(n,s):P?P(n,s,x):hs(n,x)}):null}function zu({open:t,colSpan:e,content:r,collapseProps:n}){let{expanded:s,visible:d}=yu(t,n?.transitionDuration);return d?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 Fu({className:t,style:e,record:r,index:n,trigger:s,onChange:d,withRightShadow:f,checkboxProps:i,getCheckboxProps:m,...y}){let _={...i,...m(r,n)},M=!y.disabled&&!_.disabled,x=D=>{D.stopPropagation(),s==="cell"&&M&&d?.(D)};return w.jsx(T.TableTd,{className:De("mantine-datatable-row-selector-cell",{[_t]:s==="cell"&&M},t),style:e,"data-shadow-visible":f||void 0,onClick:x,children:w.jsx(T.Checkbox,{classNames:M?{input:_t}:void 0,onChange:d,...y,..._})})}function Uu({record:t,index:e,columns:r,defaultColumnProps:n,defaultColumnRender:s,selectionTrigger:d,selectionVisible:f,selectionChecked:i,onSelectionChange:m,isRecordSelectable:y,selectionCheckboxProps:_,getSelectionCheckboxProps:M,onClick:x,onDoubleClick:D,onContextMenu:P,onCellClick:A,onCellDoubleClick:B,onCellContextMenu:Q,expansion:W,customAttributes:G,color:J,backgroundColor:z,className:H,style:F,selectorCellShadowVisible:$,selectionColumnClassName:te,selectionColumnStyle:X,rowFactory:q}){let ue=w.jsxs(w.Fragment,{children:[f&&w.jsx(Fu,{className:te,style:X,record:t,index:e,trigger:d,withRightShadow:$,checked:i,disabled:!m||(y?!y(t,e):!1),onChange:m,checkboxProps:_,getCheckboxProps:M}),r.map(({hidden:C,hiddenContent:v,...u},c)=>{if(C||v)return null;let{accessor:g,visibleMediaQuery:l,textAlign:h,noWrap:b,ellipsis:E,width:N,render:K,cellsClassName:Z,cellsStyle:ne,customCellAttributes:V}={...n,...u};return w.jsx(Iu,{className:typeof Z=="function"?Z(t,e):Z,style:ne?.(t,e),visibleMediaQuery:l,record:t,index:e,onClick:A?oe=>A({event:oe,record:t,index:e,column:u,columnIndex:c}):void 0,onDoubleClick:B?oe=>B({event:oe,record:t,index:e,column:u,columnIndex:c}):void 0,onContextMenu:Q?oe=>Q({event:oe,record:t,index:e,column:u,columnIndex:c}):void 0,accessor:g,textAlign:h,noWrap:b,ellipsis:E,width:N,render:K,defaultRender:s,customCellAttributes:V},g)})]}),de=W&&w.jsx(zu,{colSpan:r.filter(({hidden:C})=>!C).length+(f?1:0),open:W.isRowExpanded(t),content:W.content({record:t,index:e}),collapseProps:W.collapseProps}),S=qu({record:t,index:e,selectionChecked:i,onClick:x,onDoubleClick:D,onContextMenu:P,expansion:W,customAttributes:G,color:J,backgroundColor:z,className:H,style:F});return q?q({record:t,index:e,rowProps:S,children:ue,expandedElement:de}):w.jsxs(w.Fragment,{children:[w.jsx(T.TableTr,{...S,children:ue}),de]})}function qu({record:t,index:e,selectionChecked:r,onClick:n,onDoubleClick:s,onContextMenu:d,expansion:f,customAttributes:i,color:m,backgroundColor:y,className:_,style:M}){return{className:De("mantine-datatable-row",{[_t]:n||s||f?.isExpandable({record:t,index:e})&&f?.expandOnClick},{[fs]:d},typeof _=="function"?_(t,e):_),"data-selected":r||void 0,onClick:x=>{if(f){let{isExpandable:D,isRowExpanded:P,expandOnClick:A,expandRow:B,collapseRow:Q}=f;D({record:t,index:e})&&A&&(P(t)?Q(t):B(t))}n?.({event:x,record:t,index:e})},onDoubleClick:s?x=>s({event:x,record:t,index:e}):void 0,onContextMenu:d?x=>d({event:x,record:t,index:e}):void 0,style:[m||y?x=>{let D=m?.(t,e),P=y?.(t,e);return $u({theme:x,color:D,backgroundColor:P})}:void 0,M?.(t,e)],...i?.(t,e)??{}}}function Wu({leftShadowBehind:t,rightShadowBehind:e,onScrollPositionChange:r,children:n,viewportRef:s,scrollAreaProps:d}){return w.jsxs(T.ScrollArea,{...d,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:De("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow")}),w.jsx("div",{className:De("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-behind":t})}),w.jsx("div",{className:De("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-behind":e})}),w.jsx(T.Box,{className:De("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow")})]})}function Vu({withTableBorder:t,borderRadius:e,textSelectionDisabled:r,height:n="100%",minHeight:s,maxHeight:d,shadow:f,verticalAlign:i="center",fetching:m,columns:y,storeColumnsKey:_,groups:M,pinFirstColumn:x,pinLastColumn:D,defaultColumnProps:P,defaultColumnRender:A,idAccessor:B="id",records:Q,selectionTrigger:W="checkbox",selectedRecords:G,onSelectedRecordsChange:J,selectionColumnClassName:z,selectionColumnStyle:H,isRecordSelectable:F,selectionCheckboxProps:$,allRecordsSelectionCheckboxProps:te={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:X=(Ie,zt)=>({"aria-label":`Select record ${zt+1}`}),sortStatus:q,sortIcons:ue,onSortStatusChange:de,horizontalSpacing:S,page:C,onPageChange:v,totalRecords:u,recordsPerPage:c,onRecordsPerPageChange:g,recordsPerPageOptions:l,recordsPerPageLabel:h="Records per page",paginationWithEdges:b,paginationWithControls:E,paginationActiveTextColor:N,paginationActiveBackgroundColor:K,paginationSize:Z="sm",paginationText:ne=({from:Ie,to:zt,totalRecords:_r})=>`${Ie} - ${zt} / ${_r}`,paginationWrapBreakpoint:V="sm",getPaginationControlProps:oe=Ie=>Ie==="previous"?{"aria-label":"Previous page"}:Ie==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:ee,customLoader:ie,loaderSize:O,loaderType:L,loaderColor:j,loadingText:I="...",emptyState:Y,noRecordsText:ce="No records",noRecordsIcon:o,highlightOnHover:a,striped:p,noHeader:k,onRowClick:R,onRowDoubleClick:U,onRowContextMenu:le,onCellClick:se,onCellDoubleClick:fe,onCellContextMenu:ae,onScroll:ge,onScrollToTop:ve,onScrollToBottom:pe,onScrollToLeft:xe,onScrollToRight:_e,c:Ce,backgroundColor:Be,borderColor:Oe,rowBorderColor:Se,stripedColor:Xe,highlightOnHoverColor:Ee,rowColor:et,rowBackgroundColor:qe,rowExpansion:Je,rowClassName:tt,rowStyle:je,customRowAttributes:dt,scrollViewportRef:gt,scrollAreaProps:rt,tableRef:We,bodyRef:Ve,m:He,my:ot,mx:Ae,mt:me,mb:ke,ml:Te,mr:Me,className:nt,classNames:Ye,style:xt,styles:It,rowFactory:fc,tableWrapper:pn,...xs}){let Ie=re.useMemo(()=>M?.flatMap(be=>be.columns)??y,[y,M]),zt=re.useMemo(()=>Ie.some(be=>be.resizable),[Ie]),_r=lu({key:_,columns:Ie}),{refs:ht,onScroll:pc}=uu({scrollCallbacks:{onScroll:ge,onScrollToTop:ve,onScrollToBottom:pe,onScrollToLeft:xe,onScrollToRight:_e},withRowBorders:xs.withRowBorders}),gc=Ne.useMergedRef(ht.table,We),mc=Ne.useMergedRef(ht.scrollViewport,gt),yc=mu({rowExpansion:Je,records:Q,idAccessor:B}),vc=re.useCallback(be=>{ht.scrollViewport.current?.scrollTo({top:0,left:0}),v(be)},[v,ht.scrollViewport]),xr=Q?.length,Cs=Q?.map(be=>Le(be,B)),Ct=!!G,Ft=G?.map(be=>Le(be,B)),Ss=Cs!==void 0&&Ft!==void 0&&Ft.length>0,gn=F?Q?.filter(F):Q,Cr=gn?.map(be=>Le(be,B)),Sr=Ss&&Cr.every(be=>Ft.includes(be)),bc=Ss&&Cr.some(be=>Ft.includes(be)),wc=re.useCallback(()=>{G&&J&&J(Sr?G.filter(be=>!Cr.includes(Le(be,B))):dn([...G,...gn],be=>Le(be,B)))},[Sr,B,J,Cr,gn,G]),{lastSelectionChangeIndex:Dr,setLastSelectionChangeIndex:_c}=cu(Cs),mn=Ct&&!x,xc={m:He,my:ot,mx:Ae,mt:me,mb:ke,ml:Te,mr:Me},Cc=re.useCallback(({children:be})=>pn?pn({children:be}):be,[pn]);return w.jsx(ss,{..._r,children:w.jsxs(T.Box,{ref:ht.root,...xc,className:De("mantine-datatable",{"mantine-datatable-with-border":t},nt,Ye?.root),style:[be=>({...Nu({theme:be,c:Ce,backgroundColor:Be,borderColor:Oe,rowBorderColor:Se,stripedColor:Xe,highlightOnHoverColor:Ee}),borderRadius:be.radius[e]||e,boxShadow:be.shadows[f]||f,height:n,minHeight:s,maxHeight:d}),xt,It?.root,{position:"relative"}],children:[w.jsx(Wu,{viewportRef:mc,leftShadowBehind:Ct||!!x,rightShadowBehind:D,onScrollPositionChange:pc,scrollAreaProps:rt,children:w.jsx(Cc,{children:w.jsxs(T.Table,{ref:gc,horizontalSpacing:S,className:De("mantine-datatable-table",{[vu]:r,"mantine-datatable-vertical-align-top":i==="top","mantine-datatable-vertical-align-bottom":i==="bottom","mantine-datatable-pin-last-column":D,"mantine-datatable-selection-column-visible":Ct,"mantine-datatable-pin-first-column":x,"mantine-datatable-resizable-columns":zt},Ye?.table),style:{...It?.table},"data-striped":xr&&p||void 0,"data-highlight-on-hover":a||void 0,...xs,children:[k?null:w.jsx(ss,{..._r,children:w.jsx(ju,{ref:ht.header,selectionColumnHeaderRef:ht.selectionColumnHeader,className:Ye?.header,style:It?.header,columns:Ie,defaultColumnProps:P,groups:M,sortStatus:q,sortIcons:ue,onSortStatusChange:de,selectionTrigger:W,selectionVisible:Ct,selectionChecked:Sr,selectionIndeterminate:bc&&!Sr,onSelectionChange:wc,selectionCheckboxProps:{...$,...te},selectorCellShadowVisible:mn,selectionColumnClassName:z,selectionColumnStyle:H})}),w.jsx("tbody",{ref:Ve,children:xr?Q.map((be,Ut)=>{let yn=Le(be,B),vn=Ft?.includes(yn)||!1,Ds;return J&&G&&(Ds=Sc=>{if(Sc.nativeEvent.shiftKey&&Dr!==null){let St=Q.filter(Ut>Dr?(mt,yt)=>yt>=Dr&&yt<=Ut&&(F?F(mt,yt):!0):(mt,yt)=>yt>=Ut&&yt<=Dr&&(F?F(mt,yt):!0));J(vn?gu(G,St,mt=>Le(mt,B)):dn([...G,...St],mt=>Le(mt,B)))}else J(vn?G.filter(St=>Le(St,B)!==yn):dn([...G,be],St=>Le(St,B)));_c(Ut)}),w.jsx(Uu,{record:be,index:Ut,columns:Ie,defaultColumnProps:P,defaultColumnRender:A,selectionTrigger:W,selectionVisible:Ct,selectionChecked:vn,onSelectionChange:Ds,isRecordSelectable:F,selectionCheckboxProps:$,getSelectionCheckboxProps:X,onClick:R,onDoubleClick:U,onCellClick:se,onCellDoubleClick:fe,onContextMenu:le,onCellContextMenu:ae,expansion:yc,color:et,backgroundColor:qe,className:tt,style:je,customAttributes:dt,selectorCellShadowVisible:mn,selectionColumnClassName:z,selectionColumnStyle:H,idAccessor:B,rowFactory:fc},yn)}):w.jsx(su,{})}),Ie.some(({footer:be})=>be)&&w.jsx(_u,{ref:ht.footer,className:Ye?.footer,style:It?.footer,columns:Ie,defaultColumnProps:P,selectionVisible:Ct,selectorCellShadowVisible:mn})]})})}),C&&w.jsx(Yu,{className:Ye?.pagination,style:It?.pagination,horizontalSpacing:S,fetching:m,page:C,onPageChange:vc,totalRecords:u,recordsPerPage:c,onRecordsPerPageChange:g,recordsPerPageOptions:l,recordsPerPageLabel:h,paginationWithEdges:b,paginationWithControls:E,paginationActiveTextColor:N,paginationActiveBackgroundColor:K,paginationSize:Z,paginationText:ne,paginationWrapBreakpoint:V,getPaginationControlProps:oe,noRecordsText:ce,loadingText:I,recordsLength:xr}),w.jsx(Ru,{fetching:m,backgroundBlur:ee,customContent:ie,size:O,type:L,color:j}),w.jsx(au,{icon:o,text:ce,active:!m&&!xr,children:Y})]})})}function ms(t){const e=Ge.c(41),{fields:r,onClose:n,queryKey:s,apiPath:d,id:f,steps:i}=t,[m,y]=re.useState(0),[_,M]=re.useState(!1),{data:x,isLoading:D}=jo(d,s,f),{mutateAsync:P,isError:A,error:B,isPending:Q}=Xr(d,s);let W;e[0]!==r?(W=new Set(r.filter(Ju).map(Zu)),e[0]=r,e[1]=W):W=e[1];let G;e[2]!==W?(G=[...W],e[2]=W,e[3]=G):G=e[3];const J=G;let z;e[4]!==r?(z=r.reduce(Ku,{}),e[4]=r,e[5]=z):z=e[5];let H;e[6]!==r?(H=r.filter(Qu).reduce(Gu,{}),e[6]=r,e[7]=H):H=e[7];let F;e[8]!==z||e[9]!==H?(F={mode:"uncontrolled",initialValues:z,validate:H},e[8]=z,e[9]=H,e[10]=F):F=e[10];const $=bn.useForm(F);let te;e[11]!==x||e[12]!==r||e[13]!==$?(te=()=>{if(x){const v={...x};r.forEach(u=>{const c=u.id;u.type==="boolean"&&v[c]===null?v[c]=!1:u.type==="date"&&v[c]?v[c]=new Date(v[c]):v[c]===null&&(v[c]="")}),$.initialize(v),$.setValues(v)}},e[11]=x,e[12]=r,e[13]=$,e[14]=te):te=e[14];let X;e[15]!==x?(X=[x],e[15]=x,e[16]=X):X=e[16],re.useEffect(te,X);let q;e[17]!==$||e[18]!==f?(q=function(u){const c=$.getValues();return u.conditional&&!u.conditional(c)?null:w.jsxs(re.Fragment,{children:[(u.type===void 0||u.type=="text")&&w.jsx(T.TextInput,{label:u.column.title,placeholder:u.placeholder??"",...$.getInputProps(u.id),type:u.id.includes("email")?"email":void 0,required:u.required},$.key(u.id)),u.type==="number"&&w.jsx(T.NumberInput,{decimalSeparator:",",label:u.column.title,placeholder:u.placeholder??"",...$.getInputProps(u.id),required:u.required},$.key(u.id)),u.type==="date"&&w.jsx(mr,{label:u.column.title,placeholder:u.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...$.getInputProps(u.id),required:u.required},$.key(u.id)),u.type==="boolean"&&w.jsx(T.Checkbox,{mt:"md",label:u.column.title,...$.getInputProps(u.id,{type:"checkbox"}),required:u.required},$.key(u.id)),u.type==="textarea"&&w.jsx(T.Textarea,{label:u.column.title,placeholder:u.placeholder??"",...$.getInputProps(u.id),minRows:3,autosize:!0,required:u.required},$.key(u.id)),u.type==="custom"&&u.render&&u.render({...$.getValues(),id:f},$.setValues,M,{error:$.getInputProps(u.id).error,required:u.required})]},u.id)},e[17]=$,e[18]=f,e[19]=q):q=e[19];const ue=q;let de;e[20]!==A||e[21]!==B?.message||e[22]!==B?.name?(de=A&&w.jsx(T.Alert,{variant:"outline",color:"red",title:B?.name??"Fehler aufgetreten",mb:"lg",children:B?.message??"Fehler aufgetreten"}),e[20]=A,e[21]=B?.message,e[22]=B?.name,e[23]=de):de=e[23];let S;e[24]!==m||e[25]!==r||e[26]!==$||e[27]!==_||e[28]!==f||e[29]!==D||e[30]!==Q||e[31]!==A||e[32]!==n||e[33]!==ue||e[34]!==i||e[35]!==J||e[36]!==P?(S=D?w.jsxs(T.Stack,{gap:"md",children:[w.jsx(T.Skeleton,{height:40}),Array(r.length).fill(0).map(Hu),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:$.onSubmit(async v=>{await P({...v,id:f}),J.length&&m<J.length-1?A||y(m+1):A||($.setInitialValues(v),$.reset(),n())}),children:[J.length?w.jsx(T.Stepper,{active:m,size:"sm",children:J.map(v=>w.jsx(T.Stepper.Step,{...i&&i[v-1]?{label:i[v-1].label}:{},children:r.filter(u=>u.step===v).map(u=>ue(u))},v))}):r.map(v=>ue(v)),!_&&w.jsxs(T.Group,{mt:"md",justify:"end",children:[w.jsx(T.Button,{onClick:()=>J.length?m===0?n():y(m-1):n(),variant:"outline",children:J.length?m===0?"Abbrechen":"Zurück":"Abbrechen"}),w.jsx(T.Button,{type:"submit",loading:Q,children:J.length?m===J.length-1?"Speichern":"Weiter":"Speichern"})]})]}),e[24]=m,e[25]=r,e[26]=$,e[27]=_,e[28]=f,e[29]=D,e[30]=Q,e[31]=A,e[32]=n,e[33]=ue,e[34]=i,e[35]=J,e[36]=P,e[37]=S):S=e[37];let C;return e[38]!==S||e[39]!==de?(C=w.jsxs(w.Fragment,{children:[de,S]}),e[38]=S,e[39]=de,e[40]=C):C=e[40],C}function Hu(t,e){return w.jsx(T.Skeleton,{height:35},`skeleton-field-${e}`)}function Gu(t,e){return t[e.id]=(r,n)=>e.conditional&&!e.conditional(n)||r?null:"Pflichtfeld",t}function Qu(t){return t.required}function Ku(t,e){return t[e.id]=e.type==="boolean"?e.defaultValue??!1:e.defaultValue??"",t}function Zu(t){return t.step}function Ju(t){return typeof t.step=="number"}function ys({queryKey:t,apiPath:e,onClose:r,selectedRecords:n}){const{mutateAsync:s,isError:d,error:f,isPending:i}=$o(e,t),[m,y]=re.useState(n),[_,M]=re.useState(!1),x=_||i;return re.useEffect(()=>{m.length||r()},[r,m]),m.length?w.jsxs(w.Fragment,{children:[d&&f.message&&w.jsx(T.Alert,{variant:"outline",color:"red",title:f.name,children:f.message}),w.jsx(T.Text,{children:m.length===1?`Soll ${m.length} Eintrag wirklich gelöscht werden?`:`Sollen ${m.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()=>{M(!0);try{await Promise.all(m.map(D=>s(D.id))),y([])}finally{M(!1)}},children:"Löschen"})]})]}):w.jsx(w.Fragment,{})}function vs(t,e){const r=Ge.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,d]=re.useState(n);let f;r[3]!==e?(f=y=>{d(y),localStorage.setItem(`use_persistent_storage_${e}`,JSON.stringify(y))},r[3]=e,r[4]=f):f=r[4];const i=f;let m;return r[5]!==i||r[6]!==s?(m=[s,i],r[5]=i,r[6]=s,r[7]=m):m=r[7],m}const Xu=(t,e)=>{const r=t.map(m=>m[e]).filter(m=>m!=null&&m!=="");if(r.length===0)return"string";const n=Math.min(100,r.length),s=r.slice(0,n),d={string:0,number:0,date:0},f=[/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,/^\d{4}-\d{2}-\d{2}$/,/^\d{1,2}\/\d{1,2}\/\d{4}$/,/^\d{1,2}\.\d{1,2}\.\d{4}$/];s.forEach(m=>{if(typeof m=="number")d.number++;else if(typeof m=="string"){const y=m.trim();if(y!==""&&!isNaN(Number(y))&&!isNaN(parseFloat(y))){d.number++;return}if(f.some(_=>_.test(y))){const _=new Date(y);if(!isNaN(_.getTime())){d.date++;return}}d.string++}else m instanceof Date?d.date++:d.string++});const i=d.string+d.number+d.date;return d.date/i>=.6?"date":d.number/i>=.6?"number":d.string/i>=.6?"string":"mixed"},bs=new Map,ws=(t,e,r="asc")=>{if(!t||t.length===0)return[];const n=`${String(e)}_${t.length}`;let s=bs.get(n);return s||(s=Xu(t,e),bs.set(n,s)),[...t].sort((f,i)=>{const m=f[e],y=i[e],_=m==null||m==="",M=y==null||y==="";if(_&&M)return 0;if(_)return r==="asc"?-1:1;if(M)return r==="asc"?1:-1;let x,D;switch(s){case"date":if(typeof m=="string"){const W=new Date(m.trim());x=isNaN(W.getTime())?null:W.getTime()}else m instanceof Date?x=m.getTime():x=null;if(typeof y=="string"){const W=new Date(y.trim());D=isNaN(W.getTime())?null:W.getTime()}else y instanceof Date?D=y.getTime():D=null;break;case"number":if(typeof m=="number")x=m;else{const W=String(m).trim(),G=parseFloat(W);x=isNaN(G)?null:G}if(typeof y=="number")D=y;else{const W=String(y).trim(),G=parseFloat(W);D=isNaN(G)?null:G}break;case"string":const P=typeof m=="string"?m:String(m),A=typeof y=="string"?y:String(y);x=P.toLowerCase().trim(),D=A.toLowerCase().trim();break;case"mixed":default:const B=String(m),Q=String(y);x=B.toLowerCase().trim(),D=Q.toLowerCase().trim();break}return x===null&&D===null?0:x===null?r==="asc"?-1:1:D===null?r==="asc"?1:-1:x<D?r==="asc"?-1:1:x>D?r==="asc"?1:-1:0})},_s=[10,15,20,50,100,500];function ec(t){const e=Ge.c(110),{title:r,queryKey:n,connectedQueryKeys:s,apiPath:d,buttons:f,fields:i,selection:m,pagination:y,filters:_,actions:M,steps:x,defaultSort:D,createButtonText:P,queryParams:A,tabs:B,defaultTab:Q,activeTab:W,onActiveTabChange:G}=t,[J,z]=re.useState(Q||(B&&B.length>0?B[0].value:null)),H=W!==void 0?W:J;let F;e[0]!==W||e[1]!==G?(F=Ae=>{W===void 0&&z(Ae),G&&G(Ae)},e[0]=W,e[1]=G,e[2]=F):F=e[2];const $=F,te=B?.find(Ae=>Ae.value===H)?.queryParams||{},X={...A,...te},q=X?"?"+Object.entries(X).filter(dc).map(cc).join("&"):"";let ue;e[3]!==H||e[4]!==n?(ue=H?[...n,H]:n,e[3]=H,e[4]=n,e[5]=ue):ue=e[5];const de=ue,{data:S,isLoading:C,isError:v,isRefetching:u,refetch:c}=Ro(d+q,de),{queryClient:g}=at();let l,h;e[6]!==S||e[7]!==s||e[8]!==g?(l=()=>{!S||!Array.isArray(S)||s?.forEach(Ae=>g.invalidateQueries({queryKey:Ae}))},h=[S,s,g],e[6]=S,e[7]=s,e[8]=g,e[9]=l,e[10]=h):(l=e[9],h=e[10]),re.useEffect(l,h);let b;e[11]!==S||e[12]!==_?(b=!S||!Array.isArray(S)?[]:!_||_.length===0?S:S.filter(Ae=>_.every(me=>{if(me.value===void 0)return!0;const ke=me.id;if(me.type==="query"){const Te=Ae[ke];return Array.isArray(me.value)?Array.isArray(Te)?Te.some(Me=>{if(typeof Me=="string"||typeof Me=="number")return me.value.includes(String(Me));if(Me&&typeof Me=="object"){if("id"in Me&&me.value.includes(Me.id))return!0;for(const nt in Me){const Ye=Me[nt];if(typeof Ye=="string"&&me.value.includes(Ye)||Ye&&typeof Ye=="object"&&"id"in Ye&&me.value.includes(Ye.id))return!0}}return!1}):Te&&typeof Te=="object"&&"id"in Te?me.value.includes(Te.id):!1:typeof Te=="string"&&Te.includes(me.value)}else if(me.type==="date"){const Te=me.value;if(!Te)return!0;const[Me,nt]=Te;if(!Me&&!nt)return!0;const Ye=Ae[ke];if(typeof Ye=="string"){const xt=Ye.split(" ")[0];if(Me&&nt)return xt>=Me&&xt<=nt;if(Me&&!nt)return xt>=Me;if(!Me&&nt)return xt<=nt}return!0}else if(me.type==="boolean")return Ae[ke]===me.value;return!0})),e[11]=S,e[12]=_,e[13]=b):b=e[13];const E=b,N=D?.field??i[0].id,K=D?.direction??"desc";let Z;e[14]!==N||e[15]!==K?(Z={columnAccessor:N,direction:K},e[14]=N,e[15]=K,e[16]=Z):Z=e[16];const[ne,V]=re.useState(Z),oe=ws(E,ne.columnAccessor,ne.direction),[ee,ie]=vs(_s[1],"mantine-table-page-size"),[O,L]=re.useState(1),j=y?oe.slice((O-1)*ee,O*ee):oe;let I;e[17]===Symbol.for("react.memo_cache_sentinel")?(I=[],e[17]=I):I=e[17];const[Y,ce]=re.useState(I);let o;e[18]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{ce([])},e[18]=o):o=e[18];let a;e[19]!==H?(a=[H],e[19]=H,e[20]=a):a=e[20],re.useEffect(o,a);const[p,k]=re.useState(!1),[R,U]=re.useState(!1),[le,se]=re.useState(!1),fe=r?"space-between":"end";let ae;e[21]!==r?(ae=r&&(typeof r=="string"?w.jsx(T.Title,{order:4,children:r}):r),e[21]=r,e[22]=ae):ae=e[22];let ge;e[23]!==c?(ge=()=>c(),e[23]=c,e[24]=ge):ge=e[24];let ve;e[25]===Symbol.for("react.memo_cache_sentinel")?(ve=w.jsx(Dt.IconRefresh,{}),e[25]=ve):ve=e[25];let pe;e[26]!==ge?(pe=w.jsx(T.ActionIcon,{variant:"subtle",onClick:ge,"aria-label":"Neuladen",children:ve}),e[26]=ge,e[27]=pe):pe=e[27];let xe;e[28]!==M||e[29]!==i||e[30]!==Y||e[31]!==m?(xe=(i.some(uc)||m)&&w.jsxs(T.Menu,{shadow:"md",children:[w.jsx(T.Menu.Target,{children:w.jsx(T.Button,{variant:"outline",rightSection:w.jsx(Dt.IconCaretDownFilled,{size:14}),disabled:!Y.length,children:"Aktionen"})}),w.jsxs(T.Menu.Dropdown,{children:[i.find(lc)&&w.jsx(T.Menu.Item,{leftSection:w.jsx(Dt.IconPencil,{size:14}),onClick:()=>U(!0),disabled:Y.length!==1,children:"Bearbeiten"}),(M??[]).map((Ae,me)=>re.createElement(T.Menu.Item,{...Ae.icon&&{leftSection:Ae.icon},key:`custom_action_${me}`,onClick:()=>Ae.onClick(Y)},Ae.label)),i.find(ac)&&w.jsx(T.Menu.Item,{leftSection:w.jsx(Dt.IconTrash,{size:14}),onClick:()=>se(!0),color:"red",children:"Löschen"})]})]}),e[28]=M,e[29]=i,e[30]=Y,e[31]=m,e[32]=xe):xe=e[32];let _e;e[33]!==P||e[34]!==i||e[35]!==C?(_e=i.find(ic)&&w.jsx(T.Button,{onClick:()=>k(!0),disabled:C,children:P??"Erstellen"}),e[33]=P,e[34]=i,e[35]=C,e[36]=_e):_e=e[36];let Ce;e[37]!==f||e[38]!==pe||e[39]!==xe||e[40]!==_e?(Ce=w.jsxs(T.Group,{align:"center",gap:"xs",children:[pe,xe,_e,f]}),e[37]=f,e[38]=pe,e[39]=xe,e[40]=_e,e[41]=Ce):Ce=e[41];let Be;e[42]!==fe||e[43]!==ae||e[44]!==Ce?(Be=w.jsxs(T.Group,{gap:"xs",justify:fe,align:"center",children:[ae,Ce]}),e[42]=fe,e[43]=ae,e[44]=Ce,e[45]=Be):Be=e[45];let Oe;e[46]!==H||e[47]!==$||e[48]!==B?(Oe=B&&B.length>0&&w.jsx(T.Tabs,{value:H,onChange:$,mt:"md",children:w.jsx(T.Tabs.List,{children:B.map(sc)})}),e[46]=H,e[47]=$,e[48]=B,e[49]=Oe):Oe=e[49];let Se;e[50]!==v?(Se=v&&w.jsx(T.Alert,{mt:"md",variant:"light",color:"red",title:"Es ist ein Fehler aufgetreten.",icon:w.jsx(Dt.IconInfoCircle,{}),children:"Bitte versuche es später erneut oder sende eine Nachricht an unseren Support."}),e[50]=v,e[51]=Se):Se=e[51];let Xe;e[52]!==C||e[53]!==u?(Xe=(C||u)&&w.jsxs(T.Stack,{my:"md",children:[w.jsx(T.Skeleton,{height:40}),Array(5).fill(0).map(oc)]}),e[52]=C,e[53]=u,e[54]=Xe):Xe=e[54];let Ee;e[55]!==i||e[56]!==v||e[57]!==C||e[58]!==u||e[59]!==O||e[60]!==ee||e[61]!==y||e[62]!==j||e[63]!==Y||e[64]!==m||e[65]!==L||e[66]!==ie||e[67]!==ne||e[68]!==oe?(Ee=!C&&!u&&w.jsx(Vu,{my:"md",striped:!0,minHeight:150,fetching:v,records:j,sortStatus:ne,onSortStatusChange:V,...m&&{selectedRecords:Y,onSelectedRecordsChange:ce},...y&&j.length&&{totalRecords:oe.length,recordsPerPage:ee,onPageChange:L,page:O,recordsPerPageOptions:_s,onRecordsPerPageChange:ie,recordsPerPageLabel:"Einträge pro Seite"},columns:i.map(nc),noRecordsText:"Keine Einträge gefunden"}),e[55]=i,e[56]=v,e[57]=C,e[58]=u,e[59]=O,e[60]=ee,e[61]=y,e[62]=j,e[63]=Y,e[64]=m,e[65]=L,e[66]=ie,e[67]=ne,e[68]=oe,e[69]=Ee):Ee=e[69];let et;e[70]===Symbol.for("react.memo_cache_sentinel")?(et=()=>{U(!1),ce([])},e[70]=et):et=e[70];const qe=r??"Bearbeiten";let Je;e[71]!==d||e[72]!==i||e[73]!==n||e[74]!==Y[0]||e[75]!==Y.length||e[76]!==x?(Je=Y.length>0&&w.jsx(ms,{fields:i.filter(rc),queryKey:n,apiPath:d,id:Y[0].id,onClose:()=>{U(!1),ce([])},steps:x}),e[71]=d,e[72]=i,e[73]=n,e[74]=Y[0],e[75]=Y.length,e[76]=x,e[77]=Je):Je=e[77];let tt;e[78]!==qe||e[79]!==Je||e[80]!==R?(tt=w.jsx(T.Modal,{opened:R,onClose:et,title:qe,children:Je}),e[78]=qe,e[79]=Je,e[80]=R,e[81]=tt):tt=e[81];let je;e[82]!==d||e[83]!==le||e[84]!==n||e[85]!==Y||e[86]!==r?(je=Y.length>0&&w.jsx(T.Modal,{opened:le,onClose:()=>{se(!1),ce([])},title:r??"Löschen",children:w.jsx(ys,{onClose:()=>{se(!1),ce([])},queryKey:n,apiPath:d,selectedRecords:Y})}),e[82]=d,e[83]=le,e[84]=n,e[85]=Y,e[86]=r,e[87]=je):je=e[87];let dt;e[88]===Symbol.for("react.memo_cache_sentinel")?(dt=()=>{k(!1)},e[88]=dt):dt=e[88];const gt=r??"Anlegen";let rt;e[89]===Symbol.for("react.memo_cache_sentinel")?(rt=()=>{k(!1)},e[89]=rt):rt=e[89];let We;e[90]!==i?(We=i.filter(tc),e[90]=i,e[91]=We):We=e[91];let Ve;e[92]!==d||e[93]!==n||e[94]!==x||e[95]!==We?(Ve=w.jsx(os,{queryKey:n,apiPath:d,onClose:rt,fields:We,steps:x}),e[92]=d,e[93]=n,e[94]=x,e[95]=We,e[96]=Ve):Ve=e[96];let He;e[97]!==p||e[98]!==gt||e[99]!==Ve?(He=w.jsx(T.Modal,{opened:p,onClose:dt,title:gt,children:Ve}),e[97]=p,e[98]=gt,e[99]=Ve,e[100]=He):He=e[100];let ot;return e[101]!==Be||e[102]!==Oe||e[103]!==Se||e[104]!==Xe||e[105]!==Ee||e[106]!==tt||e[107]!==je||e[108]!==He?(ot=w.jsxs(w.Fragment,{children:[Be,Oe,Se,Xe,Ee,tt,je,He]}),e[101]=Be,e[102]=Oe,e[103]=Se,e[104]=Xe,e[105]=Ee,e[106]=tt,e[107]=je,e[108]=He,e[109]=ot):ot=e[109],ot}function tc(t){return t.create}function rc(t){return t.update}function nc(t){return t.column}function oc(t,e){return w.jsx(T.Skeleton,{height:35},`skeleton-${e}`)}function sc(t){return w.jsx(T.Tabs.Tab,{value:t.value,leftSection:t.icon,children:t.label},t.value)}function ic(t){return t.create}function ac(t){return t.delete}function lc(t){return t.update}function uc(t){return t.update}function cc(t){const[e,r]=t;return`${e}=${encodeURIComponent(r??"")}`}function dc(t){const[,e]=t;return e!=null}function hc(t){const e=Ge.c(5),{queryClient:r}=at();let n;e[0]!==t?(n=w.jsx(ec,{...t}),e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==r||e[3]!==n?(s=w.jsx(Bn,{client:r,children:n}),e[2]=r,e[3]=n,e[4]=s):s=e[4],s}we.CreateModal=os,we.DataTable=hc,we.DataTableProvider=Ja,we.DeleteModal=ys,we.UpdateModal=ms,we.api=el,we.createOne=To,we.deleteOne=Ao,we.getAll=Po,we.getApiHeaders=pt,we.getOne=Oo,we.sortData=ws,we.updateOne=Eo,we.useAddOne=No,we.useDataTable=at,we.useDeleteOne=$o,we.useGetAll=Ro,we.useGetOne=jo,we.usePersistentState=vs,we.useUpdateOne=Xr,Object.defineProperty(we,Symbol.toStringTag,{value:"Module"})});
117
+ `+h,m(`data:${de(c)};charset=utf-8,${encodeURIComponent(h)}`,`${g}.svg`)}else m(l.toDataURL(de(c)),`${g}.${c}`)}}const C=D})(),d.default})())}(Jr)),Jr.exports}rl();const Po=re.createContext(void 0);function nl(t){const e=Ge.c(9),{children:r,baseUrl:n,queryClient:s}=t;let d;e[0]!==n||e[1]!==s?(d={baseUrl:n,queryClient:s},e[0]=n,e[1]=s,e[2]=d):d=e[2];let f;e[3]!==r||e[4]!==s?(f=w.jsx(In,{client:s,children:r}),e[3]=r,e[4]=s,e[5]=f):f=e[5];let i;return e[6]!==d||e[7]!==f?(i=w.jsx(Po.Provider,{value:d,children:f}),e[6]=d,e[7]=f,e[8]=i):i=e[8],i}function at(){const t=re.useContext(Po);if(!t)throw new Error("useDataTable must be used within a DataTableProvider");return t}function Xr(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 wt(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 ol(){const t=localStorage.getItem("a360.assumed-org");return t?{"X-Assume-Org":t}:{}}async function pt(){return{"Content-Type":"application/json",Authorization:`Bearer ${await Wa()??""}`,...ol()}}async function Oo(t){return fetch(t,{method:"GET",headers:await pt()}).then(async e=>(e.status>=400&&await wt(e),e)).then(e=>e.json()).then(e=>e)}async function Ao(t,e){return fetch(`${t}/${e}`,{method:"GET",headers:await pt()}).then(async r=>(r.status>=400&&await wt(r),r)).then(r=>r.json()).then(r=>r)}async function Eo(t,e){const r=await fetch(`${t}/${e}`,{method:"DELETE",headers:await pt()});r.status>=400&&await wt(r)}async function To(t,e){return fetch(t,{method:"POST",headers:await pt(),body:JSON.stringify(e)}).then(async r=>(r.status>=400&&await wt(r),r)).then(r=>r.status==204?e:r.json()).then(r=>r)}async function sl(t,e,r){return fetch(e,{method:t,headers:await pt(),body:r?JSON.stringify(r):void 0}).then(async n=>(n.status>=400&&await wt(n),n)).then(n=>{if(n.status!=204)return n.json()}).then(n=>n)}async function jo(t,e){return fetch(`${t}/${e.id}`,{method:"PUT",headers:await pt(),body:JSON.stringify(e)}).then(async r=>(r.status>=400&&await wt(r),r)).then(r=>r.status==204?e:r.json()).then(r=>r)}function No(t,e,r){const n=Ge.c(13),{baseUrl:s}=at();let d;if(n[0]!==r||n[1]!==e){let y;n[3]!==r?(y=r?.toString(),n[3]=r,n[4]=y):y=n[4],d=[...e.map(il),String(y)],n[0]=r,n[1]=e,n[2]=d}else d=n[2];let f;n[5]!==t||n[6]!==s||n[7]!==r?(f=()=>Ao(`${s}${t}`,r),n[5]=t,n[6]=s,n[7]=r,n[8]=f):f=n[8];const i=!!r;let m;return n[9]!==d||n[10]!==f||n[11]!==i?(m={queryKey:d,queryFn:f,enabled:i},n[9]=d,n[10]=f,n[11]=i,n[12]=m):m=n[12],Fn(m)}function il(t){return t.toString()}function Ro(t,e,r){const n=Ge.c(9),s=r===void 0?!0:r,{baseUrl:d}=at();let f;n[0]!==e?(f=[...e.map(al)],n[0]=e,n[1]=f):f=n[1];let i;n[2]!==t||n[3]!==d?(i=()=>Oo(`${d}${t}`),n[2]=t,n[3]=d,n[4]=i):i=n[4];let m;return n[5]!==s||n[6]!==f||n[7]!==i?(m={queryKey:f,queryFn:i,enabled:s},n[5]=s,n[6]=f,n[7]=i,n[8]=m):m=n[8],Fn(m)}function al(t){return t.toString()}function $o(t,e){const r=Ge.c(10),{baseUrl:n,queryClient:s}=at();let d;r[0]!==e?(d=[...e.map(ul)],r[0]=e,r[1]=d):d=r[1];let f;r[2]!==t||r[3]!==n?(f=m=>To(`${n}${t}`,m),r[2]=t,r[3]=n,r[4]=f):f=r[4];let i;return r[5]!==s||r[6]!==e||r[7]!==d||r[8]!==f?(i={mutationKey:d,mutationFn:f,onSettled(){return s.invalidateQueries({queryKey:[...e.map(ll)]})},onError(m){Xr(m)}},r[5]=s,r[6]=e,r[7]=d,r[8]=f,r[9]=i):i=r[9],jr(i)}function ll(t){return t.toString()}function ul(t){return t.toString()}function en(t,e){const r=Ge.c(10),{baseUrl:n,queryClient:s}=at();let d;r[0]!==e?(d=[...e.map(dl)],r[0]=e,r[1]=d):d=r[1];let f;r[2]!==t||r[3]!==n?(f=m=>jo(`${n}${t}`,m),r[2]=t,r[3]=n,r[4]=f):f=r[4];let i;return r[5]!==s||r[6]!==e||r[7]!==d||r[8]!==f?(i={mutationKey:d,mutationFn:f,onSettled(){return s.invalidateQueries({queryKey:[...e.map(cl)]})},onError(m){Xr(m)}},r[5]=s,r[6]=e,r[7]=d,r[8]=f,r[9]=i):i=r[9],jr(i)}function cl(t){return t.toString()}function dl(t){return t.toString()}function Lo(t,e){const r=Ge.c(10),{baseUrl:n,queryClient:s}=at();let d;r[0]!==e?(d=[...e.map(fl)],r[0]=e,r[1]=d):d=r[1];let f;r[2]!==t||r[3]!==n?(f=m=>Eo(`${n}${t}`,m),r[2]=t,r[3]=n,r[4]=f):f=r[4];let i;return r[5]!==s||r[6]!==e||r[7]!==d||r[8]!==f?(i={mutationKey:d,mutationFn:f,onSettled(){return s.invalidateQueries({queryKey:[...e.map(hl)]})},onError(m){Xr(m)}},r[5]=s,r[6]=e,r[7]=d,r[8]=f,r[9]=i):i=r[9],jr(i)}function hl(t){return t.toString()}function fl(t){return t.toString()}var or={exports:{}},pl=or.exports,Bo;function gl(){return Bo||(Bo=1,function(t,e){(function(r,n){t.exports=n()})(pl,function(){var r=1e3,n=6e4,s=36e5,d="millisecond",f="second",i="minute",m="hour",y="day",_="week",M="month",x="quarter",S="year",P="date",A="Invalid Date",B=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,Q=/\[([^\]]+)]|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,W={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(D){var C=["th","st","nd","rd"],v=D%100;return"["+D+(C[(v-20)%10]||C[v]||C[0])+"]"}},G=function(D,C,v){var u=String(D);return!u||u.length>=C?D:""+Array(C+1-u.length).join(v)+D},J={s:G,z:function(D){var C=-D.utcOffset(),v=Math.abs(C),u=Math.floor(v/60),c=v%60;return(C<=0?"+":"-")+G(u,2,"0")+":"+G(c,2,"0")},m:function D(C,v){if(C.date()<v.date())return-D(v,C);var u=12*(v.year()-C.year())+(v.month()-C.month()),c=C.clone().add(u,M),g=v-c<0,l=C.clone().add(u+(g?-1:1),M);return+(-(u+(v-c)/(g?c-l:l-c))||0)},a:function(D){return D<0?Math.ceil(D)||0:Math.floor(D)},p:function(D){return{M,y:S,w:_,d:y,D:P,h:m,m:i,s:f,ms:d,Q:x}[D]||String(D||"").toLowerCase().replace(/s$/,"")},u:function(D){return D===void 0}},z="en",H={};H[z]=W;var F="$isDayjsObject",$=function(D){return D instanceof ue||!(!D||!D[F])},te=function D(C,v,u){var c;if(!C)return z;if(typeof C=="string"){var g=C.toLowerCase();H[g]&&(c=g),v&&(H[g]=v,c=g);var l=C.split("-");if(!c&&l.length>1)return D(l[0])}else{var h=C.name;H[h]=C,c=h}return!u&&c&&(z=c),c||!u&&z},X=function(D,C){if($(D))return D.clone();var v=typeof C=="object"?C:{};return v.date=D,v.args=arguments,new ue(v)},q=J;q.l=te,q.i=$,q.w=function(D,C){return X(D,{locale:C.$L,utc:C.$u,x:C.$x,$offset:C.$offset})};var ue=function(){function D(v){this.$L=te(v.locale,null,!0),this.parse(v),this.$x=this.$x||v.x||{},this[F]=!0}var C=D.prototype;return C.parse=function(v){this.$d=function(u){var c=u.date,g=u.utc;if(c===null)return new Date(NaN);if(q.u(c))return new Date;if(c instanceof Date)return new Date(c);if(typeof c=="string"&&!/Z$/i.test(c)){var l=c.match(B);if(l){var h=l[2]-1||0,b=(l[7]||"0").substring(0,3);return g?new Date(Date.UTC(l[1],h,l[3]||1,l[4]||0,l[5]||0,l[6]||0,b)):new Date(l[1],h,l[3]||1,l[4]||0,l[5]||0,l[6]||0,b)}}return new Date(c)}(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 q},C.isValid=function(){return this.$d.toString()!==A},C.isSame=function(v,u){var c=X(v);return this.startOf(u)<=c&&c<=this.endOf(u)},C.isAfter=function(v,u){return X(v)<this.startOf(u)},C.isBefore=function(v,u){return this.endOf(u)<X(v)},C.$g=function(v,u,c){return q.u(v)?this[u]:this.set(c,v)},C.unix=function(){return Math.floor(this.valueOf()/1e3)},C.valueOf=function(){return this.$d.getTime()},C.startOf=function(v,u){var c=this,g=!!q.u(u)||u,l=q.p(v),h=function(oe,ee){var ie=q.w(c.$u?Date.UTC(c.$y,ee,oe):new Date(c.$y,ee,oe),c);return g?ie:ie.endOf(y)},b=function(oe,ee){return q.w(c.toDate()[oe].apply(c.toDate("s"),(g?[0,0,0,0]:[23,59,59,999]).slice(ee)),c)},T=this.$W,R=this.$M,K=this.$D,Z="set"+(this.$u?"UTC":"");switch(l){case S:return g?h(1,0):h(31,11);case M:return g?h(1,R):h(0,R+1);case _:var ne=this.$locale().weekStart||0,V=(T<ne?T+7:T)-ne;return h(g?K-V:K+(6-V),R);case y:case P:return b(Z+"Hours",0);case m:return b(Z+"Minutes",1);case i:return b(Z+"Seconds",2);case f:return b(Z+"Milliseconds",3);default:return this.clone()}},C.endOf=function(v){return this.startOf(v,!1)},C.$set=function(v,u){var c,g=q.p(v),l="set"+(this.$u?"UTC":""),h=(c={},c[y]=l+"Date",c[P]=l+"Date",c[M]=l+"Month",c[S]=l+"FullYear",c[m]=l+"Hours",c[i]=l+"Minutes",c[f]=l+"Seconds",c[d]=l+"Milliseconds",c)[g],b=g===y?this.$D+(u-this.$W):u;if(g===M||g===S){var T=this.clone().set(P,1);T.$d[h](b),T.init(),this.$d=T.set(P,Math.min(this.$D,T.daysInMonth())).$d}else h&&this.$d[h](b);return this.init(),this},C.set=function(v,u){return this.clone().$set(v,u)},C.get=function(v){return this[q.p(v)]()},C.add=function(v,u){var c,g=this;v=Number(v);var l=q.p(u),h=function(R){var K=X(g);return q.w(K.date(K.date()+Math.round(R*v)),g)};if(l===M)return this.set(M,this.$M+v);if(l===S)return this.set(S,this.$y+v);if(l===y)return h(1);if(l===_)return h(7);var b=(c={},c[i]=n,c[m]=s,c[f]=r,c)[l]||1,T=this.$d.getTime()+v*b;return q.w(T,this)},C.subtract=function(v,u){return this.add(-1*v,u)},C.format=function(v){var u=this,c=this.$locale();if(!this.isValid())return c.invalidDate||A;var g=v||"YYYY-MM-DDTHH:mm:ssZ",l=q.z(this),h=this.$H,b=this.$m,T=this.$M,R=c.weekdays,K=c.months,Z=c.meridiem,ne=function(ee,ie,O,L){return ee&&(ee[ie]||ee(u,g))||O[ie].slice(0,L)},V=function(ee){return q.s(h%12||12,ee,"0")},oe=Z||function(ee,ie,O){var L=ee<12?"AM":"PM";return O?L.toLowerCase():L};return g.replace(Q,function(ee,ie){return ie||function(O){switch(O){case"YY":return String(u.$y).slice(-2);case"YYYY":return q.s(u.$y,4,"0");case"M":return T+1;case"MM":return q.s(T+1,2,"0");case"MMM":return ne(c.monthsShort,T,K,3);case"MMMM":return ne(K,T);case"D":return u.$D;case"DD":return q.s(u.$D,2,"0");case"d":return String(u.$W);case"dd":return ne(c.weekdaysMin,u.$W,R,2);case"ddd":return ne(c.weekdaysShort,u.$W,R,3);case"dddd":return R[u.$W];case"H":return String(h);case"HH":return q.s(h,2,"0");case"h":return V(1);case"hh":return V(2);case"a":return oe(h,b,!0);case"A":return oe(h,b,!1);case"m":return String(b);case"mm":return q.s(b,2,"0");case"s":return String(u.$s);case"ss":return q.s(u.$s,2,"0");case"SSS":return q.s(u.$ms,3,"0");case"Z":return l}return null}(ee)||l.replace(":","")})},C.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},C.diff=function(v,u,c){var g,l=this,h=q.p(u),b=X(v),T=(b.utcOffset()-this.utcOffset())*n,R=this-b,K=function(){return q.m(l,b)};switch(h){case S:g=K()/12;break;case M:g=K();break;case x:g=K()/3;break;case _:g=(R-T)/6048e5;break;case y:g=(R-T)/864e5;break;case m:g=R/s;break;case i:g=R/n;break;case f:g=R/r;break;default:g=R}return c?g:q.a(g)},C.daysInMonth=function(){return this.endOf(M).$D},C.$locale=function(){return H[this.$L]},C.locale=function(v,u){if(!v)return this.$L;var c=this.clone(),g=te(v,u,!0);return g&&(c.$L=g),c},C.clone=function(){return q.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()},D}(),de=ue.prototype;return X.prototype=de,[["$ms",d],["$s",f],["$m",i],["$H",m],["$W",y],["$M",M],["$y",S],["$D",P]].forEach(function(D){de[D[1]]=function(C){return this.$g(C,D[0],D[1])}}),X.extend=function(D,C){return D.$i||(D(C,ue,X),D.$i=!0),X},X.locale=te,X.isDayjs=$,X.unix=function(D){return X(1e3*D)},X.en=H[z],X.Ls=H,X.p={},X})}(or)),or.exports}var ml=gl();const he=_n(ml);function yl({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 Io({controlsRef:t,direction:e,levelIndex:r,rowIndex:n,cellIndex:s,size:d}){const f=yl({direction:e,size:d,rowIndex:n,cellIndex:s,levelIndex:r});if(!f)return;const i=t.current?.[f.levelIndex]?.[f.rowIndex]?.[f.cellIndex];i&&(i.disabled||i.getAttribute("data-hidden")||i.getAttribute("data-outside")?Io({controlsRef:t,direction:e,levelIndex:f.levelIndex,cellIndex:f.cellIndex,rowIndex:f.rowIndex,size:d}):i.focus())}function vl(t){switch(t){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function bl(t){return t.current?.map(e=>e.map(r=>r.length))}function tn({controlsRef:t,levelIndex:e,rowIndex:r,cellIndex:n,event:s}){const d=vl(s.key);if(d){s.preventDefault();const f=bl(t);Io({controlsRef:t,direction:d,levelIndex:e,rowIndex:r,cellIndex:n,size:f})}}function Ue(t){return t==null||t===""?t:he(t).format("YYYY-MM-DD")}function Yo(t){return t==null||t===""?t:he(t).format("YYYY-MM-DD HH:mm:ss")}const wl={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},_l=re.createContext(wl);function lt(){const t=re.useContext(_l),e=re.useCallback(d=>d||t.locale,[t.locale]),r=re.useCallback(d=>typeof d=="number"?d:t.firstDayOfWeek,[t.firstDayOfWeek]),n=re.useCallback(d=>Array.isArray(d)?d:t.weekendDays,[t.weekendDays]),s=re.useCallback(d=>typeof d=="string"?d:t.labelSeparator,[t.labelSeparator]);return{...t,getLocale:e,getFirstDayOfWeek:r,getWeekendDays:n,getLabelSeparator:s}}function xl({value:t,type:e,withTime:r}){const n=r?Yo:Ue;if(e==="range"&&Array.isArray(t)){const s=n(t[0]),d=n(t[1]);return s?d?`${s} – ${d}`:`${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:xl({value:t,type:e,withTime:s}),name:r,form:n})}zo.displayName="@mantine/dates/HiddenDatesInput";function Fo(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=Fo(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function De(){for(var t,e,r=0,n="",s=arguments.length;r<s;r++)(t=arguments[r])&&(e=Fo(t))&&(n&&(n+=" "),n+=e);return n}var Uo={day:"m_396ce5cb"};const Cl=E.createVarsResolver((t,{size:e})=>({day:{"--day-size":E.getSize(e,"day-size")}})),rn=E.factory((t,e)=>{const r=E.useProps("Day",null,t),{classNames:n,className:s,style:d,styles:f,unstyled:i,vars:m,date:y,disabled:_,__staticSelector:M,weekend:x,outside:S,selected:P,renderDay:A,inRange:B,firstInRange:Q,lastInRange:W,hidden:G,static:J,highlightToday:z,attributes:H,...F}=r,$=E.useStyles({name:M||"Day",classes:Uo,props:r,className:s,style:d,classNames:n,styles:f,unstyled:i,attributes:H,vars:m,varsResolver:Cl,rootSelector:"day"});return w.jsx(E.UnstyledButton,{...$("day",{style:G?{display:"none"}:void 0}),component:J?"div":"button",ref:e,disabled:_,"data-today":he(y).isSame(new Date,"day")||void 0,"data-hidden":G||void 0,"data-highlight-today":z||void 0,"data-disabled":_||void 0,"data-weekend":!_&&!S&&x||void 0,"data-outside":!_&&S||void 0,"data-selected":!_&&P||void 0,"data-in-range":B&&!_||void 0,"data-first-in-range":Q&&!_||void 0,"data-last-in-range":W&&!_||void 0,"data-static":J||void 0,unstyled:i,...F,children:A?.(y)||he(y).date()})});rn.classes=Uo,rn.displayName="@mantine/dates/Day";function Sl({locale:t,format:e="dd",firstDayOfWeek:r=1}){const n=he().day(r),s=[];for(let d=0;d<7;d+=1)typeof e=="string"?s.push(he(n).add(d,"days").locale(t).format(e)):s.push(e(he(n).add(d,"days").format("YYYY-MM-DD")));return s}var qo={weekday:"m_18a3eca"};const Dl=E.createVarsResolver((t,{size:e})=>({weekdaysRow:{"--wr-fz":E.getFontSize(e),"--wr-spacing":E.getSpacing(e)}})),nn=E.factory((t,e)=>{const r=E.useProps("WeekdaysRow",null,t),{classNames:n,className:s,style:d,styles:f,unstyled:i,vars:m,locale:y,firstDayOfWeek:_,weekdayFormat:M,cellComponent:x="th",__staticSelector:S,withWeekNumbers:P,attributes:A,...B}=r,Q=E.useStyles({name:S||"WeekdaysRow",classes:qo,props:r,className:s,style:d,classNames:n,styles:f,unstyled:i,attributes:A,vars:m,varsResolver:Dl,rootSelector:"weekdaysRow"}),W=lt(),G=Sl({locale:W.getLocale(y),format:M,firstDayOfWeek:W.getFirstDayOfWeek(_)}).map((J,z)=>w.jsx(x,{...Q("weekday"),children:J},z));return w.jsxs(E.Box,{component:"tr",ref:e,...Q("weekdaysRow"),...B,children:[P&&w.jsx(x,{...Q("weekday"),children:"#"}),G]})});nn.classes=qo,nn.displayName="@mantine/dates/WeekdaysRow";function kl(t,e=1){let r=he(t);const n=e===0?6:e-1;for(;r.day()!==n;)r=r.add(1,"day");return r.format("YYYY-MM-DD")}function Ml(t,e=1){let r=he(t);for(;r.day()!==e;)r=r.subtract(1,"day");return r.format("YYYY-MM-DD")}function Pl({month:t,firstDayOfWeek:e=1,consistentWeeks:r}){const n=he(t).subtract(he(t).date()-1,"day"),s=he(n.format("YYYY-M-D")),d=s.format("YYYY-MM-DD"),f=s.add(+s.daysInMonth()-1,"day").format("YYYY-MM-DD"),i=kl(f,e),m=[];let y=he(Ml(d,e));for(;he(y).isBefore(i,"day");){const _=[];for(let M=0;M<7;M+=1)_.push(y.format("YYYY-MM-DD")),y=y.add(1,"day");m.push(_)}if(r&&m.length<6){const _=m[m.length-1],M=_[_.length-1];let x=he(M).add(1,"day");for(;m.length<6;){const S=[];for(let P=0;P<7;P+=1)S.push(x.format("YYYY-MM-DD")),x=x.add(1,"day");m.push(S)}}return m}function on(t,e){return he(t).format("YYYY-MM")===he(e).format("YYYY-MM")}function Wo(t,e){return e?he(t).isAfter(he(e).subtract(1,"day"),"day"):!0}function Vo(t,e){return e?he(t).isBefore(he(e).add(1,"day"),"day"):!0}function Ol({dates:t,minDate:e,maxDate:r,getDayProps:n,excludeDate:s,hideOutsideDates:d,month:f}){const i=t.flat().filter(_=>Vo(_,r)&&Wo(_,e)&&!s?.(_)&&!n?.(_)?.disabled&&(!d||on(_,f))),m=i.find(_=>n?.(_)?.selected);if(m)return m;const y=i.find(_=>he().isSame(_,"date"));return y||i[0]}var sr={exports:{}},Al=sr.exports,Ho;function El(){return Ho||(Ho=1,function(t,e){(function(r,n){t.exports=n()})(Al,function(){var r="day";return function(n,s,d){var f=function(y){return y.add(4-y.isoWeekday(),r)},i=s.prototype;i.isoWeekYear=function(){return f(this).year()},i.isoWeek=function(y){if(!this.$utils().u(y))return this.add(7*(y-this.isoWeek()),r);var _,M,x,S,P=f(this),A=(_=this.isoWeekYear(),M=this.$u,x=(M?d.utc:d)().year(_).startOf("year"),S=4-x.isoWeekday(),x.isoWeekday()>4&&(S+=7),x.add(S,r));return P.diff(A,"week")+1},i.isoWeekday=function(y){return this.$utils().u(y)?this.day()||7:this.day(this.day()%7?y:y-7)};var m=i.startOf;i.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"):m.bind(this)(y,_)}}})}(sr)),sr.exports}var Tl=El();const jl=_n(Tl);he.extend(jl);function Nl(t){const e=t.find(r=>he(r).day()===1);return he(e).isoWeek()}var Go={month:"m_cc9820d3",monthCell:"m_8f457cd5",weekNumber:"m_6cff9dea"};const Rl={withCellSpacing:!0},$l=E.createVarsResolver((t,{size:e})=>({weekNumber:{"--wn-fz":E.getFontSize(e),"--wn-size":E.getSize(e,"wn-size")}})),ir=E.factory((t,e)=>{const r=E.useProps("Month",Rl,t),{classNames:n,className:s,style:d,styles:f,unstyled:i,vars:m,__staticSelector:y,locale:_,firstDayOfWeek:M,weekdayFormat:x,month:S,weekendDays:P,getDayProps:A,excludeDate:B,minDate:Q,maxDate:W,renderDay:G,hideOutsideDates:J,hideWeekdays:z,getDayAriaLabel:H,static:F,__getDayRef:$,__onDayKeyDown:te,__onDayClick:X,__onDayMouseEnter:q,__preventFocus:ue,__stopPropagation:de,withCellSpacing:D,size:C,highlightToday:v,withWeekNumbers:u,attributes:c,...g}=r,l=E.useStyles({name:y||"Month",classes:Go,props:r,className:s,style:d,classNames:n,styles:f,unstyled:i,attributes:c,vars:m,varsResolver:$l,rootSelector:"month"}),h=lt(),b=Pl({month:S,firstDayOfWeek:h.getFirstDayOfWeek(M),consistentWeeks:h.consistentWeeks}),T=Ol({dates:b,minDate:Ue(Q),maxDate:Ue(W),getDayProps:A,excludeDate:B,hideOutsideDates:J,month:S}),{resolvedClassNames:R,resolvedStyles:K}=E.useResolvedStylesApi({classNames:n,styles:f,props:r}),Z=b.map((ne,V)=>{const oe=ne.map((ee,ie)=>{const O=!on(ee,S),L=H?.(ee)||he(ee).locale(_||h.locale).format("D MMMM YYYY"),j=A?.(ee),Y=he(ee).isSame(T,"date");return w.jsx("td",{...l("monthCell"),"data-with-spacing":D||void 0,children:w.jsx(rn,{__staticSelector:y||"Month",classNames:R,styles:K,unstyled:i,"data-mantine-stop-propagation":de||void 0,highlightToday:v,renderDay:G,date:ee,size:C,weekend:h.getWeekendDays(P).includes(he(ee).get("day")),outside:O,hidden:J?O:!1,"aria-label":L,static:F,disabled:B?.(ee)||!Vo(ee,Ue(W))||!Wo(ee,Ue(Q)),ref:I=>{I&&$?.(V,ie,I)},...j,onKeyDown:I=>{j?.onKeyDown?.(I),te?.(I,{rowIndex:V,cellIndex:ie,date:ee})},onMouseEnter:I=>{j?.onMouseEnter?.(I),q?.(I,ee)},onClick:I=>{j?.onClick?.(I),X?.(I,ee)},onMouseDown:I=>{j?.onMouseDown?.(I),ue&&I.preventDefault()},tabIndex:ue||!Y?-1:0})},ee.toString())});return w.jsxs("tr",{...l("monthRow"),children:[u&&w.jsx("td",{...l("weekNumber"),children:Nl(ne)}),oe]},V)});return w.jsxs(E.Box,{component:"table",...l("month"),size:C,ref:e,...g,children:[!z&&w.jsx("thead",{...l("monthThead"),children:w.jsx(nn,{__staticSelector:y||"Month",locale:_,firstDayOfWeek:M,weekdayFormat:x,size:C,classNames:R,styles:K,unstyled:i,withWeekNumbers:u})}),w.jsx("tbody",{...l("monthTbody"),children:Z})]})});ir.classes=Go,ir.displayName="@mantine/dates/Month";var Qo={pickerControl:"m_dc6a3c71"};const Ll=E.createVarsResolver((t,{size:e})=>({pickerControl:{"--dpc-fz":E.getFontSize(e),"--dpc-size":E.getSize(e,"dpc-size")}})),ar=E.factory((t,e)=>{const r=E.useProps("PickerControl",null,t),{classNames:n,className:s,style:d,styles:f,unstyled:i,vars:m,firstInRange:y,lastInRange:_,inRange:M,__staticSelector:x,selected:S,disabled:P,attributes:A,...B}=r,Q=E.useStyles({name:x||"PickerControl",classes:Qo,props:r,className:s,style:d,classNames:n,styles:f,unstyled:i,attributes:A,vars:m,varsResolver:Ll,rootSelector:"pickerControl"});return w.jsx(E.UnstyledButton,{...Q("pickerControl"),ref:e,unstyled:i,"data-picker-control":!0,"data-selected":S&&!P||void 0,"data-disabled":P||void 0,"data-in-range":M&&!P&&!S||void 0,"data-first-in-range":y&&!P||void 0,"data-last-in-range":_&&!P||void 0,disabled:P,...B})});ar.classes=Qo,ar.displayName="@mantine/dates/PickerControl";function Ko({year:t,minDate:e,maxDate:r}){return!e&&!r?!1:!!(e&&he(t).isBefore(e,"year")||r&&he(t).isAfter(r,"year"))}function Bl({years:t,minDate:e,maxDate:r,getYearControlProps:n}){const s=t.flat().filter(i=>!Ko({year:i,minDate:e,maxDate:r})&&!n?.(i)?.disabled),d=s.find(i=>n?.(i)?.selected);if(d)return d;const f=s.find(i=>he().isSame(i,"year"));return f||s[0]}function Zo(t){const e=he(t).year(),r=e-e%10;let n=0;const s=[[],[],[],[]];for(let d=0;d<4;d+=1){const f=d===3?1:3;for(let i=0;i<f;i+=1)s[d].push(he(new Date(r+n,0)).format("YYYY-MM-DD")),n+=1}return s}var Jo={yearsList:"m_9206547b",yearsListCell:"m_c5a19c7d"};const Il={yearsListFormat:"YYYY",withCellSpacing:!0},lr=E.factory((t,e)=>{const r=E.useProps("YearsList",Il,t),{classNames:n,className:s,style:d,styles:f,unstyled:i,vars:m,decade:y,yearsListFormat:_,locale:M,minDate:x,maxDate:S,getYearControlProps:P,__staticSelector:A,__getControlRef:B,__onControlKeyDown:Q,__onControlClick:W,__onControlMouseEnter:G,__preventFocus:J,__stopPropagation:z,withCellSpacing:H,size:F,attributes:$,...te}=r,X=E.useStyles({name:A||"YearsList",classes:Jo,props:r,className:s,style:d,classNames:n,styles:f,unstyled:i,attributes:$,vars:m,rootSelector:"yearsList"}),q=lt(),ue=Zo(y),de=Bl({years:ue,minDate:x,maxDate:S,getYearControlProps:P}),D=ue.map((C,v)=>{const u=C.map((c,g)=>{const l=P?.(c),h=he(c).isSame(de,"year");return w.jsx("td",{...X("yearsListCell"),"data-with-spacing":H||void 0,children:w.jsx(ar,{...X("yearsListControl"),size:F,unstyled:i,"data-mantine-stop-propagation":z||void 0,disabled:Ko({year:c,minDate:x,maxDate:S}),ref:b=>{b&&B?.(v,g,b)},...l,onKeyDown:b=>{l?.onKeyDown?.(b),Q?.(b,{rowIndex:v,cellIndex:g,date:c})},onClick:b=>{l?.onClick?.(b),W?.(b,c)},onMouseEnter:b=>{l?.onMouseEnter?.(b),G?.(b,c)},onMouseDown:b=>{l?.onMouseDown?.(b),J&&b.preventDefault()},tabIndex:J||!h?-1:0,children:he(c).locale(q.getLocale(M)).format(_)})},g)});return w.jsx("tr",{...X("yearsListRow"),children:u},v)});return w.jsx(E.Box,{component:"table",ref:e,size:F,...X("yearsList"),...te,children:w.jsx("tbody",{children:D})})});lr.classes=Jo,lr.displayName="@mantine/dates/YearsList";function Xo({month:t,minDate:e,maxDate:r}){return!e&&!r?!1:!!(e&&he(t).isBefore(e,"month")||r&&he(t).isAfter(r,"month"))}function Yl({months:t,minDate:e,maxDate:r,getMonthControlProps:n}){const s=t.flat().filter(i=>!Xo({month:i,minDate:e,maxDate:r})&&!n?.(i)?.disabled),d=s.find(i=>n?.(i)?.selected);if(d)return d;const f=s.find(i=>he().isSame(i,"month"));return f||s[0]}function zl(t){const e=he(t).startOf("year").toDate(),r=[[],[],[],[]];let n=0;for(let s=0;s<4;s+=1)for(let d=0;d<3;d+=1)r[s].push(he(e).add(n,"months").format("YYYY-MM-DD")),n+=1;return r}var es={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const Fl={monthsListFormat:"MMM",withCellSpacing:!0},ur=E.factory((t,e)=>{const r=E.useProps("MonthsList",Fl,t),{classNames:n,className:s,style:d,styles:f,unstyled:i,vars:m,__staticSelector:y,year:_,monthsListFormat:M,locale:x,minDate:S,maxDate:P,getMonthControlProps:A,__getControlRef:B,__onControlKeyDown:Q,__onControlClick:W,__onControlMouseEnter:G,__preventFocus:J,__stopPropagation:z,withCellSpacing:H,size:F,attributes:$,...te}=r,X=E.useStyles({name:y||"MonthsList",classes:es,props:r,className:s,style:d,classNames:n,styles:f,unstyled:i,attributes:$,vars:m,rootSelector:"monthsList"}),q=lt(),ue=zl(_),de=Yl({months:ue,minDate:Ue(S),maxDate:Ue(P),getMonthControlProps:A}),D=ue.map((C,v)=>{const u=C.map((c,g)=>{const l=A?.(c),h=he(c).isSame(de,"month");return w.jsx("td",{...X("monthsListCell"),"data-with-spacing":H||void 0,children:w.jsx(ar,{...X("monthsListControl"),size:F,unstyled:i,__staticSelector:y||"MonthsList","data-mantine-stop-propagation":z||void 0,disabled:Xo({month:c,minDate:Ue(S),maxDate:Ue(P)}),ref:b=>{b&&B?.(v,g,b)},...l,onKeyDown:b=>{l?.onKeyDown?.(b),Q?.(b,{rowIndex:v,cellIndex:g,date:c})},onClick:b=>{l?.onClick?.(b),W?.(b,c)},onMouseEnter:b=>{l?.onMouseEnter?.(b),G?.(b,c)},onMouseDown:b=>{l?.onMouseDown?.(b),J&&b.preventDefault()},tabIndex:J||!h?-1:0,children:he(c).locale(q.getLocale(x)).format(M)})},g)});return w.jsx("tr",{...X("monthsListRow"),children:u},v)});return w.jsx(E.Box,{component:"table",ref:e,size:F,...X("monthsList"),...te,children:w.jsx("tbody",{children:D})})});ur.classes=es,ur.displayName="@mantine/dates/MonthsList";var ts={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderControlIcon:"m_367dc749"};const Ul={hasNextLevel:!0,withNext:!0,withPrevious:!0,headerControlsOrder:["previous","level","next"]},ql=E.createVarsResolver((t,{size:e})=>({calendarHeader:{"--dch-control-size":E.getSize(e,"dch-control-size"),"--dch-fz":E.getFontSize(e)}})),ut=E.factory((t,e)=>{const r=E.useProps("CalendarHeader",Ul,t),{classNames:n,className:s,style:d,styles:f,unstyled:i,vars:m,nextIcon:y,previousIcon:_,nextLabel:M,previousLabel:x,onNext:S,onPrevious:P,onLevelClick:A,label:B,nextDisabled:Q,previousDisabled:W,hasNextLevel:G,levelControlAriaLabel:J,withNext:z,withPrevious:H,headerControlsOrder:F,__staticSelector:$,__preventFocus:te,__stopPropagation:X,attributes:q,...ue}=r,de=E.useStyles({name:$||"CalendarHeader",classes:ts,props:r,className:s,style:d,classNames:n,styles:f,unstyled:i,attributes:q,vars:m,varsResolver:ql,rootSelector:"calendarHeader"}),D=te?g=>g.preventDefault():void 0,C=H&&re.createElement(E.UnstyledButton,{...de("calendarHeaderControl"),key:"previous","data-direction":"previous","aria-label":x,onClick:P,unstyled:i,onMouseDown:D,disabled:W,"data-disabled":W||void 0,tabIndex:te||W?-1:0,"data-mantine-stop-propagation":X||void 0},_||w.jsx(E.AccordionChevron,{...de("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})),v=re.createElement(E.UnstyledButton,{component:G?"button":"div",...de("calendarHeaderLevel"),key:"level",onClick:G?A:void 0,unstyled:i,onMouseDown:G?D:void 0,disabled:!G,"data-static":!G||void 0,"aria-label":J,tabIndex:te||!G?-1:0,"data-mantine-stop-propagation":X||void 0},B),u=z&&re.createElement(E.UnstyledButton,{...de("calendarHeaderControl"),key:"next","data-direction":"next","aria-label":M,onClick:S,unstyled:i,onMouseDown:D,disabled:Q,"data-disabled":Q||void 0,tabIndex:te||Q?-1:0,"data-mantine-stop-propagation":X||void 0},y||w.jsx(E.AccordionChevron,{...de("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})),c=F.map(g=>g==="previous"?C:g==="level"?v:g==="next"?u:null);return w.jsx(E.Box,{...de("calendarHeader"),ref:e,...ue,children:c})});ut.classes=ts,ut.displayName="@mantine/dates/CalendarHeader";function Wl(t){const e=Zo(t);return[e[0][0],e[3][0]]}const Vl={decadeLabelFormat:"YYYY"},cr=E.factory((t,e)=>{const r=E.useProps("DecadeLevel",Vl,t),{decade:n,locale:s,minDate:d,maxDate:f,yearsListFormat:i,getYearControlProps:m,__getControlRef:y,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:x,withCellSpacing:S,__preventFocus:P,nextIcon:A,previousIcon:B,nextLabel:Q,previousLabel:W,onNext:G,onPrevious:J,nextDisabled:z,previousDisabled:H,levelControlAriaLabel:F,withNext:$,withPrevious:te,headerControlsOrder:X,decadeLabelFormat:q,classNames:ue,styles:de,unstyled:D,__staticSelector:C,__stopPropagation:v,size:u,attributes:c,...g}=r,l=lt(),[h,b]=Wl(n),T={__staticSelector:C||"DecadeLevel",classNames:ue,styles:de,unstyled:D,size:u,attributes:c},R=typeof z=="boolean"?z:f?!he(b).endOf("year").isBefore(f):!1,K=typeof H=="boolean"?H:d?!he(h).startOf("year").isAfter(d):!1,Z=(ne,V)=>he(ne).locale(s||l.locale).format(V);return w.jsxs(E.Box,{"data-decade-level":!0,size:u,ref:e,...g,children:[w.jsx(ut,{label:typeof q=="function"?q(h,b):`${Z(h,q)} – ${Z(b,q)}`,__preventFocus:P,__stopPropagation:v,nextIcon:A,previousIcon:B,nextLabel:Q,previousLabel:W,onNext:G,onPrevious:J,nextDisabled:R,previousDisabled:K,hasNextLevel:!1,levelControlAriaLabel:F,withNext:$,withPrevious:te,headerControlsOrder:X,...T}),w.jsx(lr,{decade:n,locale:s,minDate:d,maxDate:f,yearsListFormat:i,getYearControlProps:m,__getControlRef:y,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:x,__preventFocus:P,__stopPropagation:v,withCellSpacing:S,...T})]})});cr.classes={...lr.classes,...ut.classes},cr.displayName="@mantine/dates/DecadeLevel";const Hl={yearLabelFormat:"YYYY"},dr=E.factory((t,e)=>{const r=E.useProps("YearLevel",Hl,t),{year:n,locale:s,minDate:d,maxDate:f,monthsListFormat:i,getMonthControlProps:m,__getControlRef:y,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:x,withCellSpacing:S,__preventFocus:P,nextIcon:A,previousIcon:B,nextLabel:Q,previousLabel:W,onNext:G,onPrevious:J,onLevelClick:z,nextDisabled:H,previousDisabled:F,hasNextLevel:$,levelControlAriaLabel:te,withNext:X,withPrevious:q,headerControlsOrder:ue,yearLabelFormat:de,__staticSelector:D,__stopPropagation:C,size:v,classNames:u,styles:c,unstyled:g,attributes:l,...h}=r,b=lt(),T={__staticSelector:D||"YearLevel",classNames:u,styles:c,unstyled:g,size:v,attributes:l},R=typeof H=="boolean"?H:f?!he(n).endOf("year").isBefore(f):!1,K=typeof F=="boolean"?F:d?!he(n).startOf("year").isAfter(d):!1;return w.jsxs(E.Box,{"data-year-level":!0,size:v,ref:e,...h,children:[w.jsx(ut,{label:typeof de=="function"?de(n):he(n).locale(s||b.locale).format(de),__preventFocus:P,__stopPropagation:C,nextIcon:A,previousIcon:B,nextLabel:Q,previousLabel:W,onNext:G,onPrevious:J,onLevelClick:z,nextDisabled:R,previousDisabled:K,hasNextLevel:$,levelControlAriaLabel:te,withNext:X,withPrevious:q,headerControlsOrder:ue,...T}),w.jsx(ur,{year:n,locale:s,minDate:d,maxDate:f,monthsListFormat:i,getMonthControlProps:m,__getControlRef:y,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:x,__preventFocus:P,__stopPropagation:C,withCellSpacing:S,...T})]})});dr.classes={...ut.classes,...ur.classes},dr.displayName="@mantine/dates/YearLevel";const Gl={monthLabelFormat:"MMMM YYYY"},hr=E.factory((t,e)=>{const r=E.useProps("MonthLevel",Gl,t),{month:n,locale:s,firstDayOfWeek:d,weekdayFormat:f,weekendDays:i,getDayProps:m,excludeDate:y,minDate:_,maxDate:M,renderDay:x,hideOutsideDates:S,hideWeekdays:P,getDayAriaLabel:A,__getDayRef:B,__onDayKeyDown:Q,__onDayClick:W,__onDayMouseEnter:G,withCellSpacing:J,highlightToday:z,withWeekNumbers:H,__preventFocus:F,__stopPropagation:$,nextIcon:te,previousIcon:X,nextLabel:q,previousLabel:ue,onNext:de,onPrevious:D,onLevelClick:C,nextDisabled:v,previousDisabled:u,hasNextLevel:c,levelControlAriaLabel:g,withNext:l,withPrevious:h,headerControlsOrder:b,monthLabelFormat:T,classNames:R,styles:K,unstyled:Z,__staticSelector:ne,size:V,static:oe,attributes:ee,...ie}=r,O=lt(),L={__staticSelector:ne||"MonthLevel",classNames:R,styles:K,unstyled:Z,size:V,attributes:ee},j=typeof v=="boolean"?v:M?!he(n).endOf("month").isBefore(M):!1,Y=typeof u=="boolean"?u:_?!he(n).startOf("month").isAfter(_):!1;return w.jsxs(E.Box,{"data-month-level":!0,size:V,ref:e,...ie,children:[w.jsx(ut,{label:typeof T=="function"?T(n):he(n).locale(s||O.locale).format(T),__preventFocus:F,__stopPropagation:$,nextIcon:te,previousIcon:X,nextLabel:q,previousLabel:ue,onNext:de,onPrevious:D,onLevelClick:C,nextDisabled:j,previousDisabled:Y,hasNextLevel:c,levelControlAriaLabel:g,withNext:l,withPrevious:h,headerControlsOrder:b,...L}),w.jsx(ir,{month:n,locale:s,firstDayOfWeek:d,weekdayFormat:f,weekendDays:i,getDayProps:m,excludeDate:y,minDate:_,maxDate:M,renderDay:x,hideOutsideDates:S,hideWeekdays:P,getDayAriaLabel:A,__getDayRef:B,__onDayKeyDown:Q,__onDayClick:W,__onDayMouseEnter:G,__preventFocus:F,__stopPropagation:$,static:oe,withCellSpacing:J,highlightToday:z,withWeekNumbers:H,...L})]})});hr.classes={...ir.classes,...ut.classes},hr.displayName="@mantine/dates/MonthLevel";var rs={levelsGroup:"m_30b26e33"};const ct=E.factory((t,e)=>{const r=E.useProps("LevelsGroup",null,t),{classNames:n,className:s,style:d,styles:f,unstyled:i,vars:m,__staticSelector:y,attributes:_,...M}=r,x=E.useStyles({name:y||"LevelsGroup",classes:rs,props:r,className:s,style:d,classNames:n,styles:f,unstyled:i,attributes:_,vars:m,rootSelector:"levelsGroup"});return w.jsx(E.Box,{ref:e,...x("levelsGroup"),...M})});ct.classes=rs,ct.displayName="@mantine/dates/LevelsGroup";const Ql={numberOfColumns:1},fr=E.factory((t,e)=>{const r=E.useProps("DecadeLevelGroup",Ql,t),{decade:n,locale:s,minDate:d,maxDate:f,yearsListFormat:i,getYearControlProps:m,__onControlClick:y,__onControlMouseEnter:_,withCellSpacing:M,__preventFocus:x,nextIcon:S,previousIcon:P,nextLabel:A,previousLabel:B,onNext:Q,onPrevious:W,nextDisabled:G,previousDisabled:J,headerControlsOrder:z,classNames:H,styles:F,unstyled:$,__staticSelector:te,__stopPropagation:X,numberOfColumns:q,levelControlAriaLabel:ue,decadeLabelFormat:de,size:D,vars:C,attributes:v,...u}=r,c=re.useRef([]),g=Array(q).fill(0).map((l,h)=>{const b=he(n).add(h*10,"years").format("YYYY-MM-DD");return w.jsx(cr,{size:D,yearsListFormat:i,decade:b,withNext:h===q-1,withPrevious:h===0,decadeLabelFormat:de,__onControlClick:y,__onControlMouseEnter:_,__onControlKeyDown:(T,R)=>tn({levelIndex:h,rowIndex:R.rowIndex,cellIndex:R.cellIndex,event:T,controlsRef:c}),__getControlRef:(T,R,K)=>{Array.isArray(c.current[h])||(c.current[h]=[]),Array.isArray(c.current[h][T])||(c.current[h][T]=[]),c.current[h][T][R]=K},levelControlAriaLabel:typeof ue=="function"?ue(b):ue,locale:s,minDate:d,maxDate:f,__preventFocus:x,__stopPropagation:X,nextIcon:S,previousIcon:P,nextLabel:A,previousLabel:B,onNext:Q,onPrevious:W,nextDisabled:G,previousDisabled:J,getYearControlProps:m,__staticSelector:te||"DecadeLevelGroup",classNames:H,styles:F,unstyled:$,withCellSpacing:M,headerControlsOrder:z,attributes:v},h)});return w.jsx(ct,{classNames:H,styles:F,__staticSelector:te||"DecadeLevelGroup",ref:e,size:D,unstyled:$,attributes:v,...u,children:g})});fr.classes={...ct.classes,...cr.classes},fr.displayName="@mantine/dates/DecadeLevelGroup";const Kl={numberOfColumns:1},pr=E.factory((t,e)=>{const r=E.useProps("YearLevelGroup",Kl,t),{year:n,locale:s,minDate:d,maxDate:f,monthsListFormat:i,getMonthControlProps:m,__onControlClick:y,__onControlMouseEnter:_,withCellSpacing:M,__preventFocus:x,nextIcon:S,previousIcon:P,nextLabel:A,previousLabel:B,onNext:Q,onPrevious:W,onLevelClick:G,nextDisabled:J,previousDisabled:z,hasNextLevel:H,headerControlsOrder:F,classNames:$,styles:te,unstyled:X,__staticSelector:q,__stopPropagation:ue,numberOfColumns:de,levelControlAriaLabel:D,yearLabelFormat:C,size:v,vars:u,attributes:c,...g}=r,l=re.useRef([]),h=Array(de).fill(0).map((b,T)=>{const R=he(n).add(T,"years").format("YYYY-MM-DD");return w.jsx(dr,{size:v,monthsListFormat:i,year:R,withNext:T===de-1,withPrevious:T===0,yearLabelFormat:C,__stopPropagation:ue,__onControlClick:y,__onControlMouseEnter:_,__onControlKeyDown:(K,Z)=>tn({levelIndex:T,rowIndex:Z.rowIndex,cellIndex:Z.cellIndex,event:K,controlsRef:l}),__getControlRef:(K,Z,ne)=>{Array.isArray(l.current[T])||(l.current[T]=[]),Array.isArray(l.current[T][K])||(l.current[T][K]=[]),l.current[T][K][Z]=ne},levelControlAriaLabel:typeof D=="function"?D(R):D,locale:s,minDate:d,maxDate:f,__preventFocus:x,nextIcon:S,previousIcon:P,nextLabel:A,previousLabel:B,onNext:Q,onPrevious:W,onLevelClick:G,nextDisabled:J,previousDisabled:z,hasNextLevel:H,getMonthControlProps:m,classNames:$,styles:te,unstyled:X,__staticSelector:q||"YearLevelGroup",withCellSpacing:M,headerControlsOrder:F,attributes:c},T)});return w.jsx(ct,{classNames:$,styles:te,__staticSelector:q||"YearLevelGroup",ref:e,size:v,unstyled:X,attributes:c,...g,children:h})});pr.classes={...dr.classes,...ct.classes},pr.displayName="@mantine/dates/YearLevelGroup";const Zl={numberOfColumns:1},gr=E.factory((t,e)=>{const r=E.useProps("MonthLevelGroup",Zl,t),{month:n,locale:s,firstDayOfWeek:d,weekdayFormat:f,weekendDays:i,getDayProps:m,excludeDate:y,minDate:_,maxDate:M,renderDay:x,hideOutsideDates:S,hideWeekdays:P,getDayAriaLabel:A,__onDayClick:B,__onDayMouseEnter:Q,withCellSpacing:W,highlightToday:G,withWeekNumbers:J,__preventFocus:z,nextIcon:H,previousIcon:F,nextLabel:$,previousLabel:te,onNext:X,onPrevious:q,onLevelClick:ue,nextDisabled:de,previousDisabled:D,hasNextLevel:C,headerControlsOrder:v,classNames:u,styles:c,unstyled:g,numberOfColumns:l,levelControlAriaLabel:h,monthLabelFormat:b,__staticSelector:T,__stopPropagation:R,size:K,static:Z,vars:ne,attributes:V,...oe}=r,ee=re.useRef([]),ie=Array(l).fill(0).map((O,L)=>{const j=he(n).add(L,"months").format("YYYY-MM-DD");return w.jsx(hr,{month:j,withNext:L===l-1,withPrevious:L===0,monthLabelFormat:b,__stopPropagation:R,__onDayClick:B,__onDayMouseEnter:Q,__onDayKeyDown:(Y,I)=>tn({levelIndex:L,rowIndex:I.rowIndex,cellIndex:I.cellIndex,event:Y,controlsRef:ee}),__getDayRef:(Y,I,ce)=>{Array.isArray(ee.current[L])||(ee.current[L]=[]),Array.isArray(ee.current[L][Y])||(ee.current[L][Y]=[]),ee.current[L][Y][I]=ce},levelControlAriaLabel:typeof h=="function"?h(j):h,locale:s,firstDayOfWeek:d,weekdayFormat:f,weekendDays:i,getDayProps:m,excludeDate:y,minDate:_,maxDate:M,renderDay:x,hideOutsideDates:S,hideWeekdays:P,getDayAriaLabel:A,__preventFocus:z,nextIcon:H,previousIcon:F,nextLabel:$,previousLabel:te,onNext:X,onPrevious:q,onLevelClick:ue,nextDisabled:de,previousDisabled:D,hasNextLevel:C,classNames:u,styles:c,unstyled:g,__staticSelector:T||"MonthLevelGroup",size:K,static:Z,withCellSpacing:W,highlightToday:G,withWeekNumbers:J,headerControlsOrder:v,attributes:V},L)});return w.jsx(ct,{classNames:u,styles:c,__staticSelector:T||"MonthLevelGroup",ref:e,size:K,attributes:V,...oe,children:ie})});gr.classes={...ct.classes,...hr.classes},gr.displayName="@mantine/dates/MonthLevelGroup";const ns=t=>t==="range"?[null,null]:t==="multiple"?[]:null,os=(t,e)=>{const r=e?Yo:Ue;return Array.isArray(t)?t.map(r):r(t)};function sn({type:t,value:e,defaultValue:r,onChange:n,withTime:s=!1}){const d=re.useRef(t),[f,i,m]=Re.useUncontrolled({value:os(e,s),defaultValue:os(r,s),finalValue:ns(t),onChange:n});let y=f;return d.current!==t&&(d.current=t,e===void 0&&(y=r!==void 0?r:ns(t),i(y))),[y,i,m]}function an(t,e){return t?t==="month"?0:t==="year"?1:2:e||0}function Jl(t){return t===0?"month":t===1?"year":"decade"}function It(t,e,r){return Jl(Re.clamp(an(t,0),an(e,0),an(r,2)))}const Xl={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0,enableKeyboardNavigation:!0},mr=E.factory((t,e)=>{const r=E.useProps("Calendar",Xl,t),{vars:n,maxLevel:s,minLevel:d,defaultLevel:f,level:i,onLevelChange:m,date:y,defaultDate:_,onDateChange:M,numberOfColumns:x,columnsToScroll:S,ariaLabels:P,nextLabel:A,previousLabel:B,onYearSelect:Q,onMonthSelect:W,onYearMouseEnter:G,onMonthMouseEnter:J,headerControlsOrder:z,__updateDateOnYearSelect:H,__updateDateOnMonthSelect:F,__setDateRef:$,__setLevelRef:te,firstDayOfWeek:X,weekdayFormat:q,weekendDays:ue,getDayProps:de,excludeDate:D,renderDay:C,hideOutsideDates:v,hideWeekdays:u,getDayAriaLabel:c,monthLabelFormat:g,nextIcon:l,previousIcon:h,__onDayClick:b,__onDayMouseEnter:T,withCellSpacing:R,highlightToday:K,withWeekNumbers:Z,monthsListFormat:ne,getMonthControlProps:V,yearLabelFormat:oe,yearsListFormat:ee,getYearControlProps:ie,decadeLabelFormat:O,classNames:L,styles:j,unstyled:Y,minDate:I,maxDate:ce,locale:o,__staticSelector:a,size:p,__preventFocus:k,__stopPropagation:N,onNextDecade:U,onPreviousDecade:le,onNextYear:se,onPreviousYear:fe,onNextMonth:ae,onPreviousMonth:ge,static:ve,enableKeyboardNavigation:pe,attributes:xe,..._e}=r,{resolvedClassNames:Ce,resolvedStyles:Be}=E.useResolvedStylesApi({classNames:L,styles:j,props:r}),[Oe,Se]=Re.useUncontrolled({value:i?It(i,d,s):void 0,defaultValue:f?It(f,d,s):void 0,finalValue:It(void 0,d,s),onChange:m}),[Xe,Te]=sn({type:"default",value:Ue(y),defaultValue:Ue(_),onChange:M});re.useImperativeHandle($,()=>me=>{Te(me)}),re.useImperativeHandle(te,()=>me=>{Se(me)});const et={__staticSelector:a||"Calendar",styles:Be,classNames:Ce,unstyled:Y,size:p,attributes:xe},qe=S||x||1,Je=new Date,tt=I&&he(Je).isAfter(I)?I:he(Je).format("YYYY-MM-DD"),je=Xe||tt,dt=()=>{const me=he(je).add(qe,"month").format("YYYY-MM-DD");ae?.(me),Te(me)},gt=()=>{const me=he(je).subtract(qe,"month").format("YYYY-MM-DD");ge?.(me),Te(me)},rt=()=>{const me=he(je).add(qe,"year").format("YYYY-MM-DD");se?.(me),Te(me)},We=()=>{const me=he(je).subtract(qe,"year").format("YYYY-MM-DD");fe?.(me),Te(me)},Ve=()=>{const me=he(je).add(10*qe,"year").format("YYYY-MM-DD");U?.(me),Te(me)},He=()=>{const me=he(je).subtract(10*qe,"year").format("YYYY-MM-DD");le?.(me),Te(me)},ot=re.useRef(null);re.useEffect(()=>{if(!pe||ve)return;const me=ke=>{if(!ot.current?.contains(document.activeElement))return;const Ee=ke.ctrlKey||ke.metaKey,Me=ke.shiftKey;switch(ke.key){case"ArrowUp":Ee&&Me?(ke.preventDefault(),He()):Ee&&(ke.preventDefault(),We());break;case"ArrowDown":Ee&&Me?(ke.preventDefault(),Ve()):Ee&&(ke.preventDefault(),rt());break;case"y":case"Y":Oe==="month"&&(ke.preventDefault(),Se("year"));break}};return document.addEventListener("keydown",me),()=>{document.removeEventListener("keydown",me)}},[pe,ve,Oe,rt,We,Ve,He]);const Ae=me=>{ot.current=me,typeof e=="function"?e(me):e&&(e.current=me)};return w.jsxs(E.Box,{ref:Ae,size:p,"data-calendar":!0,..._e,children:[Oe==="month"&&w.jsx(gr,{month:je,minDate:I,maxDate:ce,firstDayOfWeek:X,weekdayFormat:q,weekendDays:ue,getDayProps:de,excludeDate:D,renderDay:C,hideOutsideDates:v,hideWeekdays:u,getDayAriaLabel:c,onNext:dt,onPrevious:gt,hasNextLevel:s!=="month",onLevelClick:()=>Se("year"),numberOfColumns:x,locale:o,levelControlAriaLabel:P?.monthLevelControl,nextLabel:P?.nextMonth??A,nextIcon:l,previousLabel:P?.previousMonth??B,previousIcon:h,monthLabelFormat:g,__onDayClick:b,__onDayMouseEnter:T,__preventFocus:k,__stopPropagation:N,static:ve,withCellSpacing:R,highlightToday:K,withWeekNumbers:Z,headerControlsOrder:z,...et}),Oe==="year"&&w.jsx(pr,{year:je,numberOfColumns:x,minDate:I,maxDate:ce,monthsListFormat:ne,getMonthControlProps:V,locale:o,onNext:rt,onPrevious:We,hasNextLevel:s!=="month"&&s!=="year",onLevelClick:()=>Se("decade"),levelControlAriaLabel:P?.yearLevelControl,nextLabel:P?.nextYear??A,nextIcon:l,previousLabel:P?.previousYear??B,previousIcon:h,yearLabelFormat:oe,__onControlMouseEnter:J,__onControlClick:(me,ke)=>{F&&Te(ke),Se(It("month",d,s)),W?.(ke)},__preventFocus:k,__stopPropagation:N,withCellSpacing:R,headerControlsOrder:z,...et}),Oe==="decade"&&w.jsx(fr,{decade:je,minDate:I,maxDate:ce,yearsListFormat:ee,getYearControlProps:ie,locale:o,onNext:Ve,onPrevious:He,numberOfColumns:x,nextLabel:P?.nextDecade??A,nextIcon:l,previousLabel:P?.previousDecade??B,previousIcon:h,decadeLabelFormat:O,__onControlMouseEnter:G,__onControlClick:(me,ke)=>{H&&Te(ke),Se(It("year",d,s)),Q?.(ke)},__preventFocus:k,__stopPropagation:N,withCellSpacing:R,headerControlsOrder:z,...et})]})});mr.classes={...fr.classes,...pr.classes,...gr.classes},mr.displayName="@mantine/dates/Calendar";function eu(t){const{maxLevel:e,minLevel:r,defaultLevel:n,level:s,onLevelChange:d,nextIcon:f,previousIcon:i,date:m,defaultDate:y,onDateChange:_,numberOfColumns:M,columnsToScroll:x,ariaLabels:S,nextLabel:P,previousLabel:A,onYearSelect:B,onMonthSelect:Q,onYearMouseEnter:W,onMonthMouseEnter:G,onNextMonth:J,onPreviousMonth:z,onNextYear:H,onPreviousYear:F,onNextDecade:$,onPreviousDecade:te,withCellSpacing:X,highlightToday:q,__updateDateOnYearSelect:ue,__updateDateOnMonthSelect:de,__setDateRef:D,__setLevelRef:C,withWeekNumbers:v,headerControlsOrder:u,firstDayOfWeek:c,weekdayFormat:g,weekendDays:l,getDayProps:h,excludeDate:b,renderDay:T,hideOutsideDates:R,hideWeekdays:K,getDayAriaLabel:Z,monthLabelFormat:ne,monthsListFormat:V,getMonthControlProps:oe,yearLabelFormat:ee,yearsListFormat:ie,getYearControlProps:O,decadeLabelFormat:L,allowSingleDateInRange:j,allowDeselect:Y,minDate:I,maxDate:ce,locale:o,...a}=t;return{calendarProps:{maxLevel:e,minLevel:r,defaultLevel:n,level:s,onLevelChange:d,nextIcon:f,previousIcon:i,date:m,defaultDate:y,onDateChange:_,numberOfColumns:M,columnsToScroll:x,ariaLabels:S,nextLabel:P,previousLabel:A,onYearSelect:B,onMonthSelect:Q,onYearMouseEnter:W,onMonthMouseEnter:G,onNextMonth:J,onPreviousMonth:z,onNextYear:H,onPreviousYear:F,onNextDecade:$,onPreviousDecade:te,withCellSpacing:X,highlightToday:q,__updateDateOnYearSelect:ue,__updateDateOnMonthSelect:de,__setDateRef:D,withWeekNumbers:v,headerControlsOrder:u,firstDayOfWeek:c,weekdayFormat:g,weekendDays:l,getDayProps:h,excludeDate:b,renderDay:T,hideOutsideDates:R,hideWeekdays:K,getDayAriaLabel:Z,monthLabelFormat:ne,monthsListFormat:V,getMonthControlProps:oe,yearLabelFormat:ee,yearsListFormat:ie,getYearControlProps:O,decadeLabelFormat:L,allowSingleDateInRange:j,allowDeselect:Y,minDate:I,maxDate:ce,locale:o},others:a}}function tu(t){if(t===null)return null;const e=new Date(t);return Number.isNaN(e.getTime())||!t?null:he(e).format("YYYY-MM-DD")}function ru({date:t,maxDate:e,minDate:r}){return!(t==null||Number.isNaN(new Date(t).getTime())||e&&he(t).isAfter(e,"date")||r&&he(t).isBefore(r,"date"))}const nu={valueFormat:"MMMM D, YYYY",fixOnBlur:!0},yr=E.factory((t,e)=>{const r=E.useInputProps("DateInput",nu,t),{inputProps:n,wrapperProps:s,value:d,defaultValue:f,onChange:i,clearable:m,clearButtonProps:y,popoverProps:_,getDayProps:M,locale:x,valueFormat:S,dateParser:P,minDate:A,maxDate:B,fixOnBlur:Q,onFocus:W,onBlur:G,onClick:J,onKeyDown:z,readOnly:H,name:F,form:$,rightSection:te,unstyled:X,classNames:q,styles:ue,allowDeselect:de,date:D,defaultDate:C,onDateChange:v,getMonthControlProps:u,getYearControlProps:c,...g}=r,l=re.useRef(null),h=re.useRef(null),[b,T]=re.useState(!1),{calendarProps:R,others:K}=eu(g),Z=lt(),V=P||(se=>{const fe=he(se,S,Z.getLocale(x)).toDate();return Number.isNaN(fe.getTime())?tu(se):he(fe).format("YYYY-MM-DD")}),oe=de!==void 0?de:m,ee=se=>se?he(se).locale(Z.getLocale(x)).format(S):"",[ie,O,L]=sn({type:"default",value:d,defaultValue:f,onChange:i}),[j,Y]=sn({type:"default",value:D,defaultValue:f||C,onChange:v});re.useEffect(()=>{L&&d!==null&&Y(d)},[L,d]);const[I,ce]=re.useState(ee(ie));re.useEffect(()=>{ce(ee(ie))},[Z.getLocale(x)]);const o=se=>{const fe=se.currentTarget.value;if(ce(fe),T(!0),fe.trim()===""&&m)O(null);else{const ae=V(fe);ae&&ru({date:ae,minDate:A,maxDate:B})&&(O(ae),Y(ae))}},a=se=>{G?.(se),T(!1),Q&&ce(ee(ie))},p=se=>{W?.(se),T(!0)},k=se=>{J?.(se),T(!0)},N=se=>{se.key==="Escape"&&T(!1),z?.(se)},U=se=>({...M?.(se),selected:he(ie).isSame(se,"day"),onClick:fe=>{M?.(se).onClick?.(fe);const ae=m&&oe&&he(ie).isSame(se,"day")?null:se;O(ae),!L&&ae&&ce(ee(ae)),T(!1)}}),le=te||(m&&ie&&!H?w.jsx(E.CloseButton,{variant:"transparent",onMouseDown:se=>se.preventDefault(),tabIndex:-1,onClick:()=>{O(null),!L&&ce(""),T(!1)},unstyled:X,size:n.size||"sm",...y}):null);return Re.useDidUpdate(()=>{ie!==void 0&&!b&&ce(ee(ie))},[ie]),Re.useClickOutside(()=>T(!1),void 0,[l.current,h.current]),w.jsxs(w.Fragment,{children:[w.jsx(E.Input.Wrapper,{...s,__staticSelector:"DateInput",ref:l,children:w.jsxs(E.Popover,{opened:b,trapFocus:!1,position:"bottom-start",disabled:H,withRoles:!1,unstyled:X,..._,children:[w.jsx(E.Popover.Target,{children:w.jsx(E.Input,{"data-dates-input":!0,"data-read-only":H||void 0,autoComplete:"off",ref:e,value:I,onChange:o,onBlur:a,onFocus:p,onClick:k,onKeyDown:N,readOnly:H,rightSection:le,...n,...K,__staticSelector:"DateInput"})}),w.jsx(E.Popover.Dropdown,{onMouseDown:se=>se.preventDefault(),"data-dates-dropdown":!0,ref:h,children:w.jsx(mr,{__staticSelector:"DateInput",...R,classNames:q,styles:ue,unstyled:X,__preventFocus:!0,minDate:A,maxDate:B,locale:x,getDayProps:U,size:n.size,date:j,onDateChange:Y,getMonthControlProps:se=>({selected:typeof ie=="string"?on(se,ie):!1,...u?.(se)}),getYearControlProps:se=>({selected:typeof ie=="string"?he(se).isSame(ie,"year"):!1,...c?.(se)}),attributes:s.attributes})})]})}),w.jsx(zo,{name:F,form:$,value:ie,type:"default"})]})});yr.classes={...E.Input.classes,...mr.classes},yr.displayName="@mantine/dates/DateInput";function ss(t){const e=Ge.c(47),{fields:r,onClose:n,queryKey:s,apiPath:d,steps:f,onCreated:i}=t,[m,y]=re.useState(0),[_,M]=re.useState(!1),[x,S]=re.useState(),{mutateAsync:P,isError:A,error:B,isPending:Q}=$o(d,s),{mutateAsync:W,isPending:G}=en(d,s),J=Q||G;let z;e[0]!==r?(z=new Set(r.filter(lu).map(au)),e[0]=r,e[1]=z):z=e[1];let H;e[2]!==z?(H=[...z],e[2]=z,e[3]=H):H=e[3];const F=H;let $;e[4]!==r?($=r.reduce(iu,{}),e[4]=r,e[5]=$):$=e[5];let te;e[6]!==r?(te=r.filter(su).reduce(ou,{}),e[6]=r,e[7]=te):te=e[7];let X;e[8]!==$||e[9]!==te?(X={mode:"uncontrolled",initialValues:$,validate:te},e[8]=$,e[9]=te,e[10]=X):X=e[10];const q=wn.useForm(X);let ue;e[11]!==q||e[12]!==x?(ue=function(h){const b=q.getValues();return h.conditional&&!h.conditional(b)?null:w.jsxs(re.Fragment,{children:[(h.type===void 0||h.type=="text")&&w.jsx(E.TextInput,{label:h.column.title,placeholder:h.placeholder??"",...q.getInputProps(h.id),type:h.id.includes("email")?"email":void 0,required:h.required},q.key(h.id)),h.type==="number"&&w.jsx(E.NumberInput,{decimalSeparator:",",label:h.column.title,placeholder:h.placeholder??"",...q.getInputProps(h.id),required:h.required},q.key(h.id)),h.type==="date"&&w.jsx(yr,{label:h.column.title,placeholder:h.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...q.getInputProps(h.id),required:h.required},q.key(h.id)),h.type==="boolean"&&w.jsx(E.Checkbox,{mt:"md",label:h.column.title,...q.getInputProps(h.id,{type:"checkbox"}),required:h.required},q.key(h.id)),h.type==="textarea"&&w.jsx(E.Textarea,{label:h.column.title,placeholder:h.placeholder??"",...q.getInputProps(h.id),minRows:3,autosize:!0,required:h.required},q.key(h.id)),h.type==="custom"&&h.render&&h.render({...q.getValues(),...x&&{id:x}},q.setValues,M,{error:q.getInputProps(h.id).error,required:h.required})]},h.id)},e[11]=q,e[12]=x,e[13]=ue):ue=e[13];const de=ue;let D;e[14]!==B?.message||e[15]!==B?.name||e[16]!==A?(D=A&&w.jsx(E.Alert,{variant:"outline",color:"red",title:B?.name??"Fehler aufgetreten",mb:"lg",children:B?.message??"Fehler aufgetreten"}),e[14]=B?.message,e[15]=B?.name,e[16]=A,e[17]=D):D=e[17];let C;e[18]!==m||e[19]!==P||e[20]!==q||e[21]!==A||e[22]!==n||e[23]!==i||e[24]!==x||e[25]!==F.length||e[26]!==W?(C=q.onSubmit(async l=>{if(x)await W({...l,id:x});else{const h=await P(l);S(h.id),i?.(h.id)}F.length&&m<F.length-1?A||y(m+1):A||(q.setInitialValues(l),q.reset(),n())}),e[18]=m,e[19]=P,e[20]=q,e[21]=A,e[22]=n,e[23]=i,e[24]=x,e[25]=F.length,e[26]=W,e[27]=C):C=e[27];let v;e[28]!==m||e[29]!==r||e[30]!==de||e[31]!==f||e[32]!==F?(v=F.length?w.jsx(E.Stepper,{active:m,size:"sm",children:F.map(l=>w.jsx(E.Stepper.Step,{...f&&f[l-1]?{label:f[l-1].label}:{},children:r.filter(h=>h.step===l).map(h=>de(h))},l))}):r.map(l=>de(l)),e[28]=m,e[29]=r,e[30]=de,e[31]=f,e[32]=F,e[33]=v):v=e[33];let u;e[34]!==m||e[35]!==_||e[36]!==J||e[37]!==n||e[38]!==F.length?(u=!_&&w.jsxs(E.Group,{mt:"md",justify:"end",children:[w.jsx(E.Button,{onClick:()=>F.length?m===0?n():y(m-1):n(),variant:"outline",children:F.length?m===0?"Abbrechen":"Zurück":"Abbrechen"}),w.jsx(E.Button,{type:"submit",loading:J,children:F.length?m===F.length-1?"Speichern":"Weiter":"Speichern"})]}),e[34]=m,e[35]=_,e[36]=J,e[37]=n,e[38]=F.length,e[39]=u):u=e[39];let c;e[40]!==u||e[41]!==C||e[42]!==v?(c=w.jsxs("form",{onSubmit:C,children:[v,u]}),e[40]=u,e[41]=C,e[42]=v,e[43]=c):c=e[43];let g;return e[44]!==c||e[45]!==D?(g=w.jsxs(w.Fragment,{children:[D,c]}),e[44]=c,e[45]=D,e[46]=g):g=e[46],g}function ou(t,e){return t[e.id]=(r,n)=>e.conditional&&!e.conditional(n)||r?null:"Pflichtfeld",t}function su(t){return t.required}function iu(t,e){return t[e.id]=e.type==="boolean"?!1:e.defaultValue??"",t}function au(t){return t.step}function lu(t){return typeof t.step=="number"}var[uu,ln]=E.createSafeContext("useDataTableColumnsContext must be used within DataTableColumnProvider"),is=t=>{let{children:e,columnsOrder:r,setColumnsOrder:n,columnsToggle:s,setColumnsToggle:d,resetColumnsOrder:f,resetColumnsToggle:i,setColumnWidth:m,setMultipleColumnWidths:y,resetColumnsWidth:_}=t,[M,x]=re.useState(""),[S,P]=re.useState("");return w.jsx(uu,{value:{sourceColumn:M,setSourceColumn:x,targetColumn:S,setTargetColumn:P,columnsToggle:s,setColumnsToggle:d,swapColumns:()=>{if(!r||!n||!M||!S)return;let A=r.indexOf(M),B=r.indexOf(S);if(A!==-1&&B!==-1){let Q=r.splice(A,1)[0];r.splice(B,0,Q),n([...r])}},resetColumnsOrder:f,resetColumnsToggle:i,setColumnWidth:m,setMultipleColumnWidths:y,resetColumnsWidth:_},children:e})};function cu(){return w.jsx("tr",{className:"mantine-datatable-empty-row",children:w.jsx("td",{})})}function du(){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 hu({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(du,{})}),w.jsx(E.Text,{component:"div",size:"sm",c:"dimmed",children:e})]})})}var fu=({key:t,columns:e=[],getInitialValueInEffect:r=!0})=>{function n(z,H){let F=[];return z.forEach($=>{H.find(te=>te.accessor===$)&&F.push($)}),H.forEach($=>{F.includes($.accessor)||F.push($.accessor)}),F}function s(z,H){let F=[];return z.forEach($=>{H.find(te=>te.accessor===$.accessor)&&F.push($)}),H.forEach($=>{F.find(te=>te.accessor===$.accessor)||F.push({accessor:$.accessor,defaultToggle:$.defaultToggle||!0,toggleable:$.toggleable,toggled:$.defaultToggle===void 0?!0:$.defaultToggle})}),F}function d(z,H){let F=[];return z.forEach($=>{let te=Object.keys($)[0];H.find(X=>X.accessor===te)&&F.push($)}),H.forEach($=>{let te=$.accessor;if(!F.find(X=>Object.keys(X)[0]===te)){let X={};X[te]="",F.push(X)}}),F}function f(){let[z,H]=Re.useLocalStorage({key:t?`${t}-columns-order`:"",defaultValue:t?y:void 0,getInitialValueInEffect:r});function F(X){t&&H(X)}if(!t)return[z,F];let $=n(z,e),te=JSON.stringify(z);return JSON.stringify($)!==te&&F($),[$,F]}function i(){let[z,H]=Re.useLocalStorage({key:t?`${t}-columns-toggle`:"",defaultValue:t?M:void 0,getInitialValueInEffect:r});function F(X){t&&H(X)}if(!t)return[z,F];let $=s(z,e),te=JSON.stringify(z);return JSON.stringify($)!==te&&F($),[s(z,e),F]}function m(){let[z,H]=Re.useLocalStorage({key:t?`${t}-columns-width`:"",defaultValue:t?_:void 0,getInitialValueInEffect:r});function F(X){t&&H(X)}if(!t)return[z,F];let $=d(z,e),te=JSON.stringify(z);return JSON.stringify($)!==te&&F($),[d(z,e),F]}let y=e&&e.map(z=>z.accessor)||[],_=e&&e.map(z=>({[z.accessor]:z.width??"initial"}))||[],M=e&&e.map(z=>({accessor:z.accessor,defaultToggle:z.defaultToggle||!0,toggleable:z.toggleable,toggled:z.defaultToggle===void 0?!0:z.defaultToggle})),[x,S]=f(),[P,A]=i(),[B,Q]=m(),W=()=>S(y),G=()=>{A(M)},J=()=>Q(_);return{effectiveColumns:re.useMemo(()=>x?x.map(z=>e.find(H=>H.accessor===z)).map(z=>({...z,hidden:z?.hidden||!P.find(H=>H.accessor===z?.accessor)?.toggled})).map(z=>({...z,width:B.find(H=>H[z?.accessor])?.[z?.accessor]})):e,[e,x,P,B]),setColumnsOrder:S,columnsOrder:x,resetColumnsOrder:W,columnsToggle:P,setColumnsToggle:A,resetColumnsToggle:G,columnsWidth:B,setColumnsWidth:Q,setColumnWidth:(z,H)=>{let F=B.map($=>$[z]?{[z]:H}:$);Q(F)},setMultipleColumnWidths:z=>{let H=B.map(F=>{let $=Object.keys(F)[0],te=z.find(X=>X.accessor===$);return te?{[$]:te.width}:F});Q(H)},resetColumnsWidth:J}},as=typeof window<"u"?re.useLayoutEffect:re.useEffect;function ls(t){let e=re.useRef(t);return e.current=t,e}var us="--mantine-datatable-header-height",cs="--mantine-datatable-footer-height",ds="--mantine-datatable-selection-column-width",hs="--mantine-datatable-last-row-border-bottom";function Ze(t,e,r){t?.style.setProperty(e,r)}function un(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 cn(t,e,r){if(t){let n=new ResizeObserver(s=>{let d=s[0];d&&e(un(d))});return n.observe(t),()=>{n.disconnect(),r()}}}function pu({scrollCallbacks:t,withRowBorders:e}){let r={root:re.useRef(null),table:re.useRef(null),scrollViewport:re.useRef(null),header:re.useRef(null),footer:re.useRef(null),selectionColumnHeader:re.useRef(null)},{root:n,table:s,scrollViewport:d,header:f,footer:i,selectionColumnHeader:m}=r,y=ls({withRowBorders:e}),_=ls(t),M=re.useRef(()=>{}),x=re.useRef(()=>{}),S=re.useCallback(P=>{_.current.onScroll?.(P),M.current()},[]);return re.useEffect(()=>cn(f.current,P=>{Ze(n.current,us,`${P.height}px`)},()=>Ze(n.current,us,"0")),[f.current]),re.useEffect(()=>cn(i.current,P=>{Ze(n.current,cs,`${P.height}px`)},()=>Ze(n.current,cs,"0")),[i.current]),re.useEffect(()=>cn(m.current,P=>{Ze(n.current,ds,`${P.width}px`)},()=>Ze(n.current,ds,"0")),[m.current]),as(()=>{if(typeof window===void 0)return;let P={top:!0,bottom:!0,left:!0,right:!0},A={width:0,height:0},B={width:0,height:0};function Q(H,F){let $=P[H];return P[H]=F,Ze(n.current,`--mantine-datatable-${H}-shadow-opacity`,F?"0":"1"),$}function W(){let H=A.height-B.height,F=H<0;Ze(n.current,"--mantine-datatable-footer-position",F?"relative":"sticky"),Ze(n.current,"--mantine-datatable-footer-bottom",F?`${H}px`:"0")}function G(){y.current.withRowBorders&&A.height<B.height?Ze(n.current,hs,`${E.rem("1px")} solid var(--mantine-datatable-border-color)`):Ze(n.current,hs,"unset")}x.current=G;function J(){let H=_.current,F=d.current?.scrollTop??0,$=d.current?.scrollLeft??0,te=F===0,X=A.height-F-B.height<1,q=Q("top",te),ue=Q("bottom",X);te&&te!==q&&H.onScrollToTop?.(),X&&X!==ue&&H.onScrollToBottom?.();let de=$===0,D=A.width-$-B.width<1,C=Q("left",de),v=Q("right",D);de&&de!==C&&H.onScrollToLeft?.(),D&&D!==v&&H.onScrollToRight?.()}M.current=J;let z=new ResizeObserver(H=>{for(let F of H)switch(F.target.tagName){case"TABLE":{A=un(F);break}case"DIV":{B=un(F);break}}J(),W(),G()});return z.observe(s.current),z.observe(d.current),()=>{z.disconnect()}},[]),as(()=>{x.current()},[e]),{refs:r,onScroll:S}}function gu(t){let[e,r]=re.useState(null),n=t?.join(":")||"";return re.useEffect(()=>{r(null)},[n]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:r}}function mu(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 yu(t,e){return e||(typeof window<"u"&&"matchMedia"in window?t.map(r=>window.matchMedia(r).matches):t.map(()=>!1))}function vu(t,e,{getInitialValueInEffect:r}={getInitialValueInEffect:!0}){let[n,s]=re.useState(r?e:yu(t,e)),d=re.useRef(null);return re.useEffect(()=>{if("matchMedia"in window)return d.current=t.map(f=>window.matchMedia(f)),s(d.current.map(f=>f.matches)),mu(d.current,f=>{s(f)})},[t]),n}function bu(t){let e=E.useMantineTheme(),r=re.useMemo(()=>t.map(s=>(typeof s=="function"?s(e):s)??""),[t,e]),n=re.useMemo(()=>t.map(()=>!0),[t]);return vu(r,n)}function vr(t){let e=E.useMantineTheme(),r=typeof t=="function"?t(e):t;return Re.useMediaQuery(r||"",!0)}function dn(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 wu(t,e,r){return t.filter(n=>!e.map(r).includes(r(n)))}function hn(t,e){return t.filter((r,n,s)=>n===s.findIndex(d=>e(r)===e(d)))}function fs(t,e){return e?e.match(/([^[.\]])+/g).reduce((r,n)=>r&&r[n],t):void 0}function Le(t,e){return typeof e=="string"?fs(t,e):e(t)}function _u({rowExpansion:t,records:e,idAccessor:r}){let n=[];if(t&&e){let{trigger:i,allowMultiple:m,initiallyExpanded:y}=t;e&&i==="always"?n=e.map(_=>Le(_,r)):y&&(n=e.filter((_,M)=>y({record:_,index:M})).map(_=>Le(_,r)),m||(n=[n[0]]))}let s,d,f=re.useState(n);if(t){let{expandable:i,trigger:m,allowMultiple:y,collapseProps:_,content:M}=t;t.expanded?{recordIds:s,onRecordIdsChange:d}=t.expanded:[s,d]=f;let x=S=>d?.(s.filter(P=>P!==Le(S,r)));return{expandOnClick:m!=="always"&&m!=="never",isRowExpanded:S=>m==="always"?!0:s.includes(Le(S,r)),isExpandable:({record:S,index:P})=>i?i({record:S,index:P}):!0,expandRow:S=>{let P=Le(S,r);d?.(y?[...s,P]:[P])},collapseRow:x,collapseProps:_,content:({record:S,index:P})=>()=>M({record:S,index:P,collapse:()=>x(S)})}}}function xu(t,e){let[r,n]=re.useState(t),[s,d]=re.useState(t),f=Re.useTimeout(()=>n(!0),0),i=Re.useTimeout(()=>d(!1),e||200);return re.useEffect(()=>{t?(i.clear(),d(!0),f.start()):(f.clear(),n(!1),i.start())},[f,i,t]),{expanded:r,visible:s}}var fn="mantine-datatable-nowrap",pn="mantine-datatable-ellipsis",_t="mantine-datatable-pointer-cursor",ps="mantine-datatable-context-menu-cursor",Cu="mantine-datatable-text-selection-disabled",br="mantine-datatable-text-align-left",wr="mantine-datatable-text-align-center",_r="mantine-datatable-text-align-right";function Su({className:t,style:e,visibleMediaQuery:r,title:n,noWrap:s,ellipsis:d,textAlign:f,width:i}){return vr(r)?w.jsx(E.TableTh,{className:De({[fn]:s||d,[pn]:d,[br]:f==="left",[wr]:f==="center",[_r]:f==="right"},t),style:[{width:i,minWidth:i,maxWidth:i},e],children:n}):null}function Du({shadowVisible:t}){return w.jsx(E.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":t||void 0})}function ku({className:t,style:e,columns:r,defaultColumnProps:n,selectionVisible:s,selectorCellShadowVisible:d,ref:f}){return w.jsx(E.TableTfoot,{ref:f,className:De("mantine-datatable-footer",t),style:e,children:w.jsxs(E.TableTr,{children:[s&&w.jsx(Du,{shadowVisible:d}),r.map(({hidden:i,...m})=>{if(i)return null;let{accessor:y,visibleMediaQuery:_,textAlign:M,width:x,footer:S,footerClassName:P,footerStyle:A,noWrap:B,ellipsis:Q}={...n,...m};return w.jsx(Su,{className:P,style:A,visibleMediaQuery:_,textAlign:M,width:x,title:S,noWrap:B,ellipsis:Q},y)})]})})}function Mu({group:{id:t,columns:e,title:r,textAlign:n,className:s,style:d}}){let f=re.useMemo(()=>e.map(({visibleMediaQuery:y})=>y),[e]),i=bu(f),m=re.useMemo(()=>e.filter(({hidden:y},_)=>!y&&i?.[_]).length,[e,i]);return m>0?w.jsx(E.TableTh,{colSpan:m,className:De("mantine-datatable-column-group-header-cell",{[br]:n==="left",[wr]:n==="center",[_r]:n==="right"},s),style:d,children:r??dn(t)}):null}function Pu(){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 Ou(){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 Au({children:t,isActive:e,filterPopoverProps:r,filterPopoverDisableClickOutside:n}){let[s,{close:d,toggle:f}]=Re.useDisclosure(!1),i=e?Ou:Pu,m=Re.useClickOutside(d);return n&&(m=void 0),w.jsxs(E.Popover,{withArrow:!0,shadow:"md",opened:s,onClose:d,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(),f()},onKeyDown:y=>y.stopPropagation(),children:w.jsx(i,{})})}),w.jsx(E.PopoverDropdown,{ref:m,onClick:y=>y.stopPropagation(),onKeyDown:y=>y.stopPropagation(),children:typeof t=="function"?t({close:d}):t})]})}var Eu=t=>{let{accessor:e,columnRef:r}=t,[n,s]=re.useState(!1),d=re.useRef(0),f=re.useRef({current:0,next:0}),{setMultipleColumnWidths:i}=ln(),m=re.useCallback(_=>{if(_.preventDefault(),_.stopPropagation(),!r.current)return;let M=r.current,x=M.nextElementSibling;for(;x;){let G=x.getAttribute("data-accessor");if(G&&G!=="__selection__")break;x=x.nextElementSibling}if(!x)return;let S=x.getAttribute("data-accessor");if(!S)return;let P=S==="__selection__";s(!0),d.current=_.clientX;let A=M.offsetWidth,B=x.offsetWidth;f.current={current:A,next:B};let Q=G=>{if(!r.current)return;let J=r.current,z=J.nextElementSibling;if(!z)return;let H=G.clientX-d.current,F=50,$=f.current.current-F,te=f.current.next-F,X=Math.max(-$,Math.min(H,te)),q=f.current.current+X,ue=f.current.next-X;J.style.width=`${q}px`,z.style.width=`${ue}px`,J.style.minWidth=`${q}px`,J.style.maxWidth=`${q}px`,z.style.minWidth=`${ue}px`,z.style.maxWidth=`${ue}px`},W=()=>{if(!r.current)return;let G=r.current,J=G.nextElementSibling;s(!1),document.body.style.cursor="initial",document.body.style.userSelect="initial";let z=parseInt(G.style.width)||G.offsetWidth,H=J?parseInt(J.style.width)||J.offsetWidth:0,F=[{accessor:e,width:`${z}px`}];if(J&&!P){let $=J.getAttribute("data-accessor");$&&F.push({accessor:$,width:`${H}px`})}setTimeout(()=>{i(F)},0),document.removeEventListener("mousemove",Q),document.removeEventListener("mouseup",W)};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",Q),document.addEventListener("mouseup",W)},[e,i]),y=re.useCallback(()=>{if(!r.current)return;let _=r.current,M=_.nextElementSibling;_.style.width="",_.style.minWidth="",_.style.maxWidth="";let x=[{accessor:e,width:"initial"}];if(M){M.style.width="",M.style.minWidth="",M.style.maxWidth="";let S=M.getAttribute("data-accessor");S&&S!=="__selection__"&&x.push({accessor:S,width:"initial"})}setTimeout(()=>{i(x)},0)},[e,i]);return w.jsx("div",{className:"mantine-datatable-header-resizable-handle",style:{cursor:n?"col-resize":void 0},onMouseDown:m,onDoubleClick:y,onClick:_=>_.stopPropagation(),title:"Drag to resize column, double-click to reset"})};function Tu(){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 ju(){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 Nu(){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 Ru(){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 $u({className:t,style:e,accessor:r,visibleMediaQuery:n,title:s,sortable:d,draggable:f,toggleable:i,resizable:m,sortIcons:y,textAlign:_,width:M,sortStatus:x,onSortStatusChange:S,filter:P,filterPopoverProps:A,filterPopoverDisableClickOutside:B,filtering:Q,sortKey:W}){let{setSourceColumn:G,setTargetColumn:J,swapColumns:z,setColumnsToggle:H}=ln(),[F,$]=re.useState(!1),te=re.useRef(null);if(!vr(n))return null;let X=s??dn(r),q=typeof X=="string"?X:void 0,ue=d&&S?g=>{g?.defaultPrevented||S({sortKey:W,columnAccessor:r,direction:x?.columnAccessor===r?x.direction==="asc"?"desc":"asc":x?.direction??"asc"})}:void 0,de=g=>{g.stopPropagation(),G(r),$(!1)},D=g=>{g.preventDefault(),J(r),$(!0)},C=()=>{J(r),$(!1),z()},v=()=>{$(!0)},u=()=>{$(!1)},c=g=>{g.stopPropagation(),H(l=>l.map(h=>h.accessor===r?{...h,toggled:!1}:h))};return w.jsxs(E.TableTh,{"data-accessor":r,className:De({"mantine-datatable-header-cell-sortable":d,"mantine-datatable-header-cell-toggleable":i,"mantine-datatable-header-cell-resizable":m},t),style:[{width:M,...m?{minWidth:"1px"}:{minWidth:M,maxWidth:M}},e],role:d?"button":void 0,tabIndex:d?0:void 0,onClick:ue,onKeyDown:g=>g.key==="Enter"&&ue?.(),ref:te,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:De({"mantine-datatable-header-cell-draggable":f,"mantine-datatable-header-cell-drag-over":F}),draggable:f,onDragStart:f?de:void 0,onDragEnter:f?v:void 0,onDragOver:f?D:void 0,onDrop:f?C:void 0,onDragLeave:f?u:void 0,children:[f?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:g=>{g.stopPropagation()},children:w.jsx(Nu,{})})}):null,w.jsx(E.Box,{className:De("mantine-datatable-header-cell-sortable-text",{[br]:_==="left",[wr]:_==="center",[_r]:_==="right"},fn,pn),title:q,children:X})]}),i?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:c,children:w.jsx(Ru,{})})}):null,d||x?.columnAccessor===r?w.jsx(w.Fragment,{children:x?.columnAccessor===r?w.jsx(E.Center,{className:De("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(Tu,{})}):w.jsx(E.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:y?.unsorted||w.jsx(ju,{})})}):null,P?w.jsx(Au,{filterPopoverProps:A,isActive:!!Q,filterPopoverDisableClickOutside:B,children:P}):null]}),m&&r!=="__selection__"?w.jsx(Eu,{accessor:r,columnRef:te}):null]})}function Lu({className:t,style:e,trigger:r,shadowVisible:n,checked:s,indeterminate:d,checkboxProps:f,onChange:i,rowSpan:m,ref:y}){let _=!f.disabled;return w.jsx(E.TableTh,{ref:y,className:De("mantine-datatable-header-selector-cell",{[_t]:r==="cell"&&_},t),style:e,rowSpan:m,"data-shadow-visible":n||void 0,"data-accessor":"__selection__",onClick:r==="cell"&&_?i:void 0,children:w.jsx(E.Checkbox,{classNames:_?{input:_t}:void 0,checked:s,indeterminate:d,onChange:i,...f,disabled:!(i||f.onChange)||f.disabled})})}function Bu({selectionColumnHeaderRef:t,className:e,style:r,sortStatus:n,sortIcons:s,onSortStatusChange:d,columns:f,defaultColumnProps:i,groups:m,selectionTrigger:y,selectionVisible:_,selectionChecked:M,selectionIndeterminate:x,onSelectionChange:S,selectionCheckboxProps:P,selectorCellShadowVisible:A,selectionColumnClassName:B,selectionColumnStyle:Q,ref:W}){let G=_?w.jsx(Lu,{ref:t,className:B,style:Q,trigger:y,shadowVisible:A,checked:M,indeterminate:x,checkboxProps:P,onChange:S,rowSpan:m?2:void 0}):null,{columnsToggle:J,setColumnsToggle:z}=ln(),[H,F]=re.useState(!1),$=f.some(q=>q.toggleable),te=$?Object.fromEntries(f.map(({accessor:q,title:ue})=>[q,ue??dn(String(q))])):void 0,X=w.jsxs(E.TableThead,{className:De("mantine-datatable-header",e),style:r,ref:W,onContextMenu:$?q=>{q.preventDefault(),F(ue=>!ue)}:void 0,children:[m&&w.jsxs(E.TableTr,{children:[G,m.map(q=>w.jsx(Mu,{group:q},q.id))]}),w.jsxs(E.TableTr,{children:[!m&&G,f.map(({hidden:q,...ue},de)=>{if(q)return null;let{accessor:D,visibleMediaQuery:C,textAlign:v,width:u,title:c,sortable:g,draggable:l,toggleable:h,resizable:b,titleClassName:T,titleStyle:R,filter:K,filterPopoverProps:Z,filterPopoverDisableClickOutside:ne,filtering:V,sortKey:oe}={...i,...ue};return w.jsx($u,{accessor:D,className:T,style:R,visibleMediaQuery:C,textAlign:v,width:u,title:c,sortable:g,draggable:l,toggleable:h,resizable:b&&de<f.length-1,sortStatus:n,sortIcons:s,sortKey:oe,onSortStatusChange:d,filter:K,filterPopoverProps:Z,filterPopoverDisableClickOutside:ne,filtering:V},D)})]})]});return $?w.jsxs(E.Popover,{position:"bottom",withArrow:!0,shadow:"md",opened:H,onChange:F,children:[w.jsx(E.PopoverTarget,{children:X}),w.jsx(E.PopoverDropdown,{children:w.jsx(E.Stack,{children:J.filter(q=>q.toggleable).map(q=>w.jsx(E.Group,{children:w.jsx(E.Checkbox,{classNames:{label:"mantine-datatable-header-column-toggle-checkbox-label"},size:"xs",label:te[q.accessor],checked:q.toggled,onChange:ue=>{z(J.map(de=>de.accessor===q.accessor?{...de,toggled:ue.currentTarget.checked}:de))}})},q.accessor))})})]}):X}function Iu({fetching:t,customContent:e,backgroundBlur:r,size:n,type:s,color:d}){return w.jsx(E.Center,{className:De("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:d}))})}function Pe(t,e,r){return t?E.parseThemeColor({color:typeof t=="object"?t[r]:t,theme:e}).value:void 0}function Yu({theme:t,c:e,backgroundColor:r,borderColor:n,rowBorderColor:s,stripedColor:d,highlightOnHoverColor:f}){return{"--mantine-datatable-color-light":Pe(e,t,"light"),"--mantine-datatable-color-dark":Pe(e,t,"dark"),"--mantine-datatable-background-color-light":Pe(r,t,"light"),"--mantine-datatable-background-color-dark":Pe(r,t,"dark"),"--mantine-datatable-border-color-light":Pe(n,t,"light"),"--mantine-datatable-border-color-dark":Pe(n,t,"dark"),"--mantine-datatable-row-border-color-light":Pe(s,t,"light"),"--mantine-datatable-row-border-color-dark":Pe(s,t,"dark"),"--mantine-datatable-striped-color-light":Pe(d,t,"light"),"--mantine-datatable-striped-color-dark":Pe(d,t,"dark"),"--mantine-datatable-highlight-on-hover-color-light":Pe(f,t,"light"),"--mantine-datatable-highlight-on-hover-color-dark":Pe(f,t,"dark")}}function gs({theme:t,paginationActiveTextColor:e,paginationActiveBackgroundColor:r}){return{"--mantine-datatable-pagination-active-text-color-light":Pe(e,t,"light"),"--mantine-datatable-pagination-active-text-color-dark":Pe(e,t,"dark"),"--mantine-datatable-pagination-active-background-color-light":Pe(r,t,"light"),"--mantine-datatable-pagination-active-background-color-dark":Pe(r,t,"dark")}}function zu({theme:t,color:e,backgroundColor:r}){return{"--mantine-datatable-row-color-light":Pe(e,t,"light"),"--mantine-datatable-row-color-dark":Pe(e,t,"dark"),"--mantine-datatable-row-background-color-light":Pe(r,t,"light"),"--mantine-datatable-row-background-color-dark":Pe(r,t,"dark")}}function Fu(){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 ms={xs:E.rem(22),sm:E.rem(26),md:E.rem(32),lg:E.rem(38),xl:E.rem(44)};function Uu({size:t,label:e,values:r,value:n,activeTextColor:s,activeBackgroundColor:d,onChange:f}){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(Fu,{}),style:[{fontWeight:"normal"},i=>({height:ms[t],paddingLeft:i.spacing[t],paddingRight:i.spacing[t]})],children:n})}),w.jsx(E.MenuDropdown,{children:r.map(i=>{let m=i===n;return w.jsx(E.MenuItem,{className:De({"mantine-datatable-page-size-selector-active":m}),style:[{height:ms[t]},m&&(s||d)?y=>gs({theme:y,paginationActiveTextColor:s,paginationActiveBackgroundColor:d}):void 0],disabled:m,onClick:()=>f(i),children:w.jsx(E.Text,{component:"div",size:t,children:i})},i)})})]})]})}function qu({className:t,style:e,fetching:r,page:n,onPageChange:s,paginationWithEdges:d,paginationWithControls:f,paginationActiveTextColor:i,paginationActiveBackgroundColor:m,paginationSize:y,loadingText:_,noRecordsText:M,paginationText:x,totalRecords:S,recordsPerPage:P,onRecordsPerPageChange:A,recordsPerPageLabel:B,recordsPerPageOptions:Q,recordsLength:W,horizontalSpacing:G,paginationWrapBreakpoint:J,getPaginationControlProps:z}){let H;if(S){let $=(n-1)*P+1,te=$+(W||0)-1;H=x({from:$,to:te,totalRecords:S})}else H=r?_:M;let F=vr(({breakpoints:$})=>`(min-width: ${typeof J=="number"?`${E.rem(J)}rem`:$[J]||J})`);return w.jsxs(E.Box,{px:G??"xs",py:"xs",className:De("mantine-datatable-pagination",t),style:[{flexDirection:F?"row":"column"},e],children:[w.jsx(E.Text,{component:"div",className:"mantine-datatable-pagination-text",size:y,children:H}),Q&&w.jsx(Uu,{activeTextColor:i,activeBackgroundColor:m,size:y,label:B,values:Q,value:P,onChange:A}),w.jsx(E.Pagination,{classNames:{root:De("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":r||!W}),control:"mantine-datatable-pagination-pages-control"},style:i||m?$=>gs({theme:$,paginationActiveTextColor:i,paginationActiveBackgroundColor:m}):void 0,withEdges:d,withControls:f,value:n,onChange:s,size:y,total:Math.ceil(S/P),getControlProps:z})]})}function Wu({className:t,style:e,visibleMediaQuery:r,record:n,index:s,onClick:d,onDoubleClick:f,onContextMenu:i,noWrap:m,ellipsis:y,textAlign:_,width:M,accessor:x,render:S,defaultRender:P,customCellAttributes:A}){return vr(r)?w.jsx(E.TableTd,{className:De({[fn]:m||y,[pn]:y,[_t]:d||f,[ps]:i,[br]:_==="left",[wr]:_==="center",[_r]:_==="right"},t),style:[{width:M,minWidth:M,maxWidth:M},e],onClick:d,onDoubleClick:f,onContextMenu:i,...A?.(n,s),children:S?S(n,s):P?P(n,s,x):fs(n,x)}):null}function Vu({open:t,colSpan:e,content:r,collapseProps:n}){let{expanded:s,visible:d}=xu(t,n?.transitionDuration);return d?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 Hu({className:t,style:e,record:r,index:n,trigger:s,onChange:d,withRightShadow:f,checkboxProps:i,getCheckboxProps:m,...y}){let _={...i,...m(r,n)},M=!y.disabled&&!_.disabled,x=S=>{S.stopPropagation(),s==="cell"&&M&&d?.(S)};return w.jsx(E.TableTd,{className:De("mantine-datatable-row-selector-cell",{[_t]:s==="cell"&&M},t),style:e,"data-shadow-visible":f||void 0,onClick:x,children:w.jsx(E.Checkbox,{classNames:M?{input:_t}:void 0,onChange:d,...y,..._})})}function Gu({record:t,index:e,columns:r,defaultColumnProps:n,defaultColumnRender:s,selectionTrigger:d,selectionVisible:f,selectionChecked:i,onSelectionChange:m,isRecordSelectable:y,selectionCheckboxProps:_,getSelectionCheckboxProps:M,onClick:x,onDoubleClick:S,onContextMenu:P,onCellClick:A,onCellDoubleClick:B,onCellContextMenu:Q,expansion:W,customAttributes:G,color:J,backgroundColor:z,className:H,style:F,selectorCellShadowVisible:$,selectionColumnClassName:te,selectionColumnStyle:X,rowFactory:q}){let ue=w.jsxs(w.Fragment,{children:[f&&w.jsx(Hu,{className:te,style:X,record:t,index:e,trigger:d,withRightShadow:$,checked:i,disabled:!m||(y?!y(t,e):!1),onChange:m,checkboxProps:_,getCheckboxProps:M}),r.map(({hidden:C,hiddenContent:v,...u},c)=>{if(C||v)return null;let{accessor:g,visibleMediaQuery:l,textAlign:h,noWrap:b,ellipsis:T,width:R,render:K,cellsClassName:Z,cellsStyle:ne,customCellAttributes:V}={...n,...u};return w.jsx(Wu,{className:typeof Z=="function"?Z(t,e):Z,style:ne?.(t,e),visibleMediaQuery:l,record:t,index:e,onClick:A?oe=>A({event:oe,record:t,index:e,column:u,columnIndex:c}):void 0,onDoubleClick:B?oe=>B({event:oe,record:t,index:e,column:u,columnIndex:c}):void 0,onContextMenu:Q?oe=>Q({event:oe,record:t,index:e,column:u,columnIndex:c}):void 0,accessor:g,textAlign:h,noWrap:b,ellipsis:T,width:R,render:K,defaultRender:s,customCellAttributes:V},g)})]}),de=W&&w.jsx(Vu,{colSpan:r.filter(({hidden:C})=>!C).length+(f?1:0),open:W.isRowExpanded(t),content:W.content({record:t,index:e}),collapseProps:W.collapseProps}),D=Qu({record:t,index:e,selectionChecked:i,onClick:x,onDoubleClick:S,onContextMenu:P,expansion:W,customAttributes:G,color:J,backgroundColor:z,className:H,style:F});return q?q({record:t,index:e,rowProps:D,children:ue,expandedElement:de}):w.jsxs(w.Fragment,{children:[w.jsx(E.TableTr,{...D,children:ue}),de]})}function Qu({record:t,index:e,selectionChecked:r,onClick:n,onDoubleClick:s,onContextMenu:d,expansion:f,customAttributes:i,color:m,backgroundColor:y,className:_,style:M}){return{className:De("mantine-datatable-row",{[_t]:n||s||f?.isExpandable({record:t,index:e})&&f?.expandOnClick},{[ps]:d},typeof _=="function"?_(t,e):_),"data-selected":r||void 0,onClick:x=>{if(f){let{isExpandable:S,isRowExpanded:P,expandOnClick:A,expandRow:B,collapseRow:Q}=f;S({record:t,index:e})&&A&&(P(t)?Q(t):B(t))}n?.({event:x,record:t,index:e})},onDoubleClick:s?x=>s({event:x,record:t,index:e}):void 0,onContextMenu:d?x=>d({event:x,record:t,index:e}):void 0,style:[m||y?x=>{let S=m?.(t,e),P=y?.(t,e);return zu({theme:x,color:S,backgroundColor:P})}:void 0,M?.(t,e)],...i?.(t,e)??{}}}function Ku({leftShadowBehind:t,rightShadowBehind:e,onScrollPositionChange:r,children:n,viewportRef:s,scrollAreaProps:d}){return w.jsxs(E.ScrollArea,{...d,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:De("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow")}),w.jsx("div",{className:De("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-behind":t})}),w.jsx("div",{className:De("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-behind":e})}),w.jsx(E.Box,{className:De("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow")})]})}function Zu({withTableBorder:t,borderRadius:e,textSelectionDisabled:r,height:n="100%",minHeight:s,maxHeight:d,shadow:f,verticalAlign:i="center",fetching:m,columns:y,storeColumnsKey:_,groups:M,pinFirstColumn:x,pinLastColumn:S,defaultColumnProps:P,defaultColumnRender:A,idAccessor:B="id",records:Q,selectionTrigger:W="checkbox",selectedRecords:G,onSelectedRecordsChange:J,selectionColumnClassName:z,selectionColumnStyle:H,isRecordSelectable:F,selectionCheckboxProps:$,allRecordsSelectionCheckboxProps:te={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:X=(Ye,zt)=>({"aria-label":`Select record ${zt+1}`}),sortStatus:q,sortIcons:ue,onSortStatusChange:de,horizontalSpacing:D,page:C,onPageChange:v,totalRecords:u,recordsPerPage:c,onRecordsPerPageChange:g,recordsPerPageOptions:l,recordsPerPageLabel:h="Records per page",paginationWithEdges:b,paginationWithControls:T,paginationActiveTextColor:R,paginationActiveBackgroundColor:K,paginationSize:Z="sm",paginationText:ne=({from:Ye,to:zt,totalRecords:xr})=>`${Ye} - ${zt} / ${xr}`,paginationWrapBreakpoint:V="sm",getPaginationControlProps:oe=Ye=>Ye==="previous"?{"aria-label":"Previous page"}:Ye==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:ee,customLoader:ie,loaderSize:O,loaderType:L,loaderColor:j,loadingText:Y="...",emptyState:I,noRecordsText:ce="No records",noRecordsIcon:o,highlightOnHover:a,striped:p,noHeader:k,onRowClick:N,onRowDoubleClick:U,onRowContextMenu:le,onCellClick:se,onCellDoubleClick:fe,onCellContextMenu:ae,onScroll:ge,onScrollToTop:ve,onScrollToBottom:pe,onScrollToLeft:xe,onScrollToRight:_e,c:Ce,backgroundColor:Be,borderColor:Oe,rowBorderColor:Se,stripedColor:Xe,highlightOnHoverColor:Te,rowColor:et,rowBackgroundColor:qe,rowExpansion:Je,rowClassName:tt,rowStyle:je,customRowAttributes:dt,scrollViewportRef:gt,scrollAreaProps:rt,tableRef:We,bodyRef:Ve,m:He,my:ot,mx:Ae,mt:me,mb:ke,ml:Ee,mr:Me,className:nt,classNames:Ie,style:xt,styles:Yt,rowFactory:vc,tableWrapper:gn,...Cs}){let Ye=re.useMemo(()=>M?.flatMap(be=>be.columns)??y,[y,M]),zt=re.useMemo(()=>Ye.some(be=>be.resizable),[Ye]),xr=fu({key:_,columns:Ye}),{refs:ht,onScroll:bc}=pu({scrollCallbacks:{onScroll:ge,onScrollToTop:ve,onScrollToBottom:pe,onScrollToLeft:xe,onScrollToRight:_e},withRowBorders:Cs.withRowBorders}),wc=Re.useMergedRef(ht.table,We),_c=Re.useMergedRef(ht.scrollViewport,gt),xc=_u({rowExpansion:Je,records:Q,idAccessor:B}),Cc=re.useCallback(be=>{ht.scrollViewport.current?.scrollTo({top:0,left:0}),v(be)},[v,ht.scrollViewport]),Cr=Q?.length,Ss=Q?.map(be=>Le(be,B)),Ct=!!G,Ft=G?.map(be=>Le(be,B)),Ds=Ss!==void 0&&Ft!==void 0&&Ft.length>0,mn=F?Q?.filter(F):Q,Sr=mn?.map(be=>Le(be,B)),Dr=Ds&&Sr.every(be=>Ft.includes(be)),Sc=Ds&&Sr.some(be=>Ft.includes(be)),Dc=re.useCallback(()=>{G&&J&&J(Dr?G.filter(be=>!Sr.includes(Le(be,B))):hn([...G,...mn],be=>Le(be,B)))},[Dr,B,J,Sr,mn,G]),{lastSelectionChangeIndex:kr,setLastSelectionChangeIndex:kc}=gu(Ss),yn=Ct&&!x,Mc={m:He,my:ot,mx:Ae,mt:me,mb:ke,ml:Ee,mr:Me},Pc=re.useCallback(({children:be})=>gn?gn({children:be}):be,[gn]);return w.jsx(is,{...xr,children:w.jsxs(E.Box,{ref:ht.root,...Mc,className:De("mantine-datatable",{"mantine-datatable-with-border":t},nt,Ie?.root),style:[be=>({...Yu({theme:be,c:Ce,backgroundColor:Be,borderColor:Oe,rowBorderColor:Se,stripedColor:Xe,highlightOnHoverColor:Te}),borderRadius:be.radius[e]||e,boxShadow:be.shadows[f]||f,height:n,minHeight:s,maxHeight:d}),xt,Yt?.root,{position:"relative"}],children:[w.jsx(Ku,{viewportRef:_c,leftShadowBehind:Ct||!!x,rightShadowBehind:S,onScrollPositionChange:bc,scrollAreaProps:rt,children:w.jsx(Pc,{children:w.jsxs(E.Table,{ref:wc,horizontalSpacing:D,className:De("mantine-datatable-table",{[Cu]:r,"mantine-datatable-vertical-align-top":i==="top","mantine-datatable-vertical-align-bottom":i==="bottom","mantine-datatable-pin-last-column":S,"mantine-datatable-selection-column-visible":Ct,"mantine-datatable-pin-first-column":x,"mantine-datatable-resizable-columns":zt},Ie?.table),style:{...Yt?.table},"data-striped":Cr&&p||void 0,"data-highlight-on-hover":a||void 0,...Cs,children:[k?null:w.jsx(is,{...xr,children:w.jsx(Bu,{ref:ht.header,selectionColumnHeaderRef:ht.selectionColumnHeader,className:Ie?.header,style:Yt?.header,columns:Ye,defaultColumnProps:P,groups:M,sortStatus:q,sortIcons:ue,onSortStatusChange:de,selectionTrigger:W,selectionVisible:Ct,selectionChecked:Dr,selectionIndeterminate:Sc&&!Dr,onSelectionChange:Dc,selectionCheckboxProps:{...$,...te},selectorCellShadowVisible:yn,selectionColumnClassName:z,selectionColumnStyle:H})}),w.jsx("tbody",{ref:Ve,children:Cr?Q.map((be,Ut)=>{let vn=Le(be,B),bn=Ft?.includes(vn)||!1,ks;return J&&G&&(ks=Oc=>{if(Oc.nativeEvent.shiftKey&&kr!==null){let St=Q.filter(Ut>kr?(mt,yt)=>yt>=kr&&yt<=Ut&&(F?F(mt,yt):!0):(mt,yt)=>yt>=Ut&&yt<=kr&&(F?F(mt,yt):!0));J(bn?wu(G,St,mt=>Le(mt,B)):hn([...G,...St],mt=>Le(mt,B)))}else J(bn?G.filter(St=>Le(St,B)!==vn):hn([...G,be],St=>Le(St,B)));kc(Ut)}),w.jsx(Gu,{record:be,index:Ut,columns:Ye,defaultColumnProps:P,defaultColumnRender:A,selectionTrigger:W,selectionVisible:Ct,selectionChecked:bn,onSelectionChange:ks,isRecordSelectable:F,selectionCheckboxProps:$,getSelectionCheckboxProps:X,onClick:N,onDoubleClick:U,onCellClick:se,onCellDoubleClick:fe,onContextMenu:le,onCellContextMenu:ae,expansion:xc,color:et,backgroundColor:qe,className:tt,style:je,customAttributes:dt,selectorCellShadowVisible:yn,selectionColumnClassName:z,selectionColumnStyle:H,idAccessor:B,rowFactory:vc},vn)}):w.jsx(cu,{})}),Ye.some(({footer:be})=>be)&&w.jsx(ku,{ref:ht.footer,className:Ie?.footer,style:Yt?.footer,columns:Ye,defaultColumnProps:P,selectionVisible:Ct,selectorCellShadowVisible:yn})]})})}),C&&w.jsx(qu,{className:Ie?.pagination,style:Yt?.pagination,horizontalSpacing:D,fetching:m,page:C,onPageChange:Cc,totalRecords:u,recordsPerPage:c,onRecordsPerPageChange:g,recordsPerPageOptions:l,recordsPerPageLabel:h,paginationWithEdges:b,paginationWithControls:T,paginationActiveTextColor:R,paginationActiveBackgroundColor:K,paginationSize:Z,paginationText:ne,paginationWrapBreakpoint:V,getPaginationControlProps:oe,noRecordsText:ce,loadingText:Y,recordsLength:Cr}),w.jsx(Iu,{fetching:m,backgroundBlur:ee,customContent:ie,size:O,type:L,color:j}),w.jsx(hu,{icon:o,text:ce,active:!m&&!Cr,children:I})]})})}function ys(t){const e=Ge.c(41),{fields:r,onClose:n,queryKey:s,apiPath:d,id:f,steps:i}=t,[m,y]=re.useState(0),[_,M]=re.useState(!1),{data:x,isLoading:S}=No(d,s,f),{mutateAsync:P,isError:A,error:B,isPending:Q}=en(d,s);let W;e[0]!==r?(W=new Set(r.filter(nc).map(rc)),e[0]=r,e[1]=W):W=e[1];let G;e[2]!==W?(G=[...W],e[2]=W,e[3]=G):G=e[3];const J=G;let z;e[4]!==r?(z=r.reduce(tc,{}),e[4]=r,e[5]=z):z=e[5];let H;e[6]!==r?(H=r.filter(ec).reduce(Xu,{}),e[6]=r,e[7]=H):H=e[7];let F;e[8]!==z||e[9]!==H?(F={mode:"uncontrolled",initialValues:z,validate:H},e[8]=z,e[9]=H,e[10]=F):F=e[10];const $=wn.useForm(F);let te;e[11]!==x||e[12]!==r||e[13]!==$?(te=()=>{if(x){const v={...x};r.forEach(u=>{const c=u.id;u.type==="boolean"&&v[c]===null?v[c]=!1:u.type==="date"&&v[c]?v[c]=new Date(v[c]):v[c]===null&&(v[c]="")}),$.initialize(v),$.setValues(v)}},e[11]=x,e[12]=r,e[13]=$,e[14]=te):te=e[14];let X;e[15]!==x?(X=[x],e[15]=x,e[16]=X):X=e[16],re.useEffect(te,X);let q;e[17]!==$||e[18]!==f?(q=function(u){const c=$.getValues();return u.conditional&&!u.conditional(c)?null:w.jsxs(re.Fragment,{children:[(u.type===void 0||u.type=="text")&&w.jsx(E.TextInput,{label:u.column.title,placeholder:u.placeholder??"",...$.getInputProps(u.id),type:u.id.includes("email")?"email":void 0,required:u.required},$.key(u.id)),u.type==="number"&&w.jsx(E.NumberInput,{decimalSeparator:",",label:u.column.title,placeholder:u.placeholder??"",...$.getInputProps(u.id),required:u.required},$.key(u.id)),u.type==="date"&&w.jsx(yr,{label:u.column.title,placeholder:u.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...$.getInputProps(u.id),required:u.required},$.key(u.id)),u.type==="boolean"&&w.jsx(E.Checkbox,{mt:"md",label:u.column.title,...$.getInputProps(u.id,{type:"checkbox"}),required:u.required},$.key(u.id)),u.type==="textarea"&&w.jsx(E.Textarea,{label:u.column.title,placeholder:u.placeholder??"",...$.getInputProps(u.id),minRows:3,autosize:!0,required:u.required},$.key(u.id)),u.type==="custom"&&u.render&&u.render({...$.getValues(),id:f},$.setValues,M,{error:$.getInputProps(u.id).error,required:u.required})]},u.id)},e[17]=$,e[18]=f,e[19]=q):q=e[19];const ue=q;let de;e[20]!==A||e[21]!==B?.message||e[22]!==B?.name?(de=A&&w.jsx(E.Alert,{variant:"outline",color:"red",title:B?.name??"Fehler aufgetreten",mb:"lg",children:B?.message??"Fehler aufgetreten"}),e[20]=A,e[21]=B?.message,e[22]=B?.name,e[23]=de):de=e[23];let D;e[24]!==m||e[25]!==r||e[26]!==$||e[27]!==_||e[28]!==f||e[29]!==S||e[30]!==Q||e[31]!==A||e[32]!==n||e[33]!==ue||e[34]!==i||e[35]!==J||e[36]!==P?(D=S?w.jsxs(E.Stack,{gap:"md",children:[w.jsx(E.Skeleton,{height:40}),Array(r.length).fill(0).map(Ju),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:$.onSubmit(async v=>{await P({...v,id:f}),J.length&&m<J.length-1?A||y(m+1):A||($.setInitialValues(v),$.reset(),n())}),children:[J.length?w.jsx(E.Stepper,{active:m,size:"sm",children:J.map(v=>w.jsx(E.Stepper.Step,{...i&&i[v-1]?{label:i[v-1].label}:{},children:r.filter(u=>u.step===v).map(u=>ue(u))},v))}):r.map(v=>ue(v)),!_&&w.jsxs(E.Group,{mt:"md",justify:"end",children:[w.jsx(E.Button,{onClick:()=>J.length?m===0?n():y(m-1):n(),variant:"outline",children:J.length?m===0?"Abbrechen":"Zurück":"Abbrechen"}),w.jsx(E.Button,{type:"submit",loading:Q,children:J.length?m===J.length-1?"Speichern":"Weiter":"Speichern"})]})]}),e[24]=m,e[25]=r,e[26]=$,e[27]=_,e[28]=f,e[29]=S,e[30]=Q,e[31]=A,e[32]=n,e[33]=ue,e[34]=i,e[35]=J,e[36]=P,e[37]=D):D=e[37];let C;return e[38]!==D||e[39]!==de?(C=w.jsxs(w.Fragment,{children:[de,D]}),e[38]=D,e[39]=de,e[40]=C):C=e[40],C}function Ju(t,e){return w.jsx(E.Skeleton,{height:35},`skeleton-field-${e}`)}function Xu(t,e){return t[e.id]=(r,n)=>e.conditional&&!e.conditional(n)||r?null:"Pflichtfeld",t}function ec(t){return t.required}function tc(t,e){return t[e.id]=e.type==="boolean"?e.defaultValue??!1:e.defaultValue??"",t}function rc(t){return t.step}function nc(t){return typeof t.step=="number"}function vs({queryKey:t,apiPath:e,onClose:r,selectedRecords:n}){const{mutateAsync:s,isError:d,error:f,isPending:i}=Lo(e,t),[m,y]=re.useState(n),[_,M]=re.useState(!1),x=_||i;return re.useEffect(()=>{m.length||r()},[r,m]),m.length?w.jsxs(w.Fragment,{children:[d&&f.message&&w.jsx(E.Alert,{variant:"outline",color:"red",title:f.name,children:f.message}),w.jsx(E.Text,{children:m.length===1?`Soll ${m.length} Eintrag wirklich gelöscht werden?`:`Sollen ${m.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(m.map(S=>s(S.id))),y([])}finally{M(!1)}},children:"Löschen"})]})]}):w.jsx(w.Fragment,{})}function bs(t,e){const r=Ge.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,d]=re.useState(n);let f;r[3]!==e?(f=y=>{d(y),localStorage.setItem(`use_persistent_storage_${e}`,JSON.stringify(y))},r[3]=e,r[4]=f):f=r[4];const i=f;let m;return r[5]!==i||r[6]!==s?(m=[s,i],r[5]=i,r[6]=s,r[7]=m):m=r[7],m}const oc=(t,e)=>{const r=t.map(m=>m[e]).filter(m=>m!=null&&m!=="");if(r.length===0)return"string";const n=Math.min(100,r.length),s=r.slice(0,n),d={string:0,number:0,date:0},f=[/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,/^\d{4}-\d{2}-\d{2}$/,/^\d{1,2}\/\d{1,2}\/\d{4}$/,/^\d{1,2}\.\d{1,2}\.\d{4}$/];s.forEach(m=>{if(typeof m=="number")d.number++;else if(typeof m=="string"){const y=m.trim();if(y!==""&&!isNaN(Number(y))&&!isNaN(parseFloat(y))){d.number++;return}if(f.some(_=>_.test(y))){const _=new Date(y);if(!isNaN(_.getTime())){d.date++;return}}d.string++}else m instanceof Date?d.date++:d.string++});const i=d.string+d.number+d.date;return d.date/i>=.6?"date":d.number/i>=.6?"number":d.string/i>=.6?"string":"mixed"},ws=new Map,_s=(t,e,r="asc")=>{if(!t||t.length===0)return[];const n=`${String(e)}_${t.length}`;let s=ws.get(n);return s||(s=oc(t,e),ws.set(n,s)),[...t].sort((f,i)=>{const m=f[e],y=i[e],_=m==null||m==="",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 m=="string"){const W=new Date(m.trim());x=isNaN(W.getTime())?null:W.getTime()}else m instanceof Date?x=m.getTime():x=null;if(typeof y=="string"){const W=new Date(y.trim());S=isNaN(W.getTime())?null:W.getTime()}else y instanceof Date?S=y.getTime():S=null;break;case"number":if(typeof m=="number")x=m;else{const W=String(m).trim(),G=parseFloat(W);x=isNaN(G)?null:G}if(typeof y=="number")S=y;else{const W=String(y).trim(),G=parseFloat(W);S=isNaN(G)?null:G}break;case"string":const P=typeof m=="string"?m:String(m),A=typeof y=="string"?y:String(y);x=P.toLowerCase().trim(),S=A.toLowerCase().trim();break;case"mixed":default:const B=String(m),Q=String(y);x=B.toLowerCase().trim(),S=Q.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})},xs=[10,15,20,50,100,500];function sc(t){const e=Ge.c(110),{title:r,queryKey:n,connectedQueryKeys:s,apiPath:d,buttons:f,fields:i,selection:m,pagination:y,filters:_,actions:M,steps:x,defaultSort:S,createButtonText:P,queryParams:A,tabs:B,defaultTab:Q,activeTab:W,onActiveTabChange:G}=t,[J,z]=re.useState(Q||(B&&B.length>0?B[0].value:null)),H=W!==void 0?W:J;let F;e[0]!==W||e[1]!==G?(F=Ae=>{W===void 0&&z(Ae),G&&G(Ae)},e[0]=W,e[1]=G,e[2]=F):F=e[2];const $=F,te=B?.find(Ae=>Ae.value===H)?.queryParams||{},X={...A,...te},q=X?"?"+Object.entries(X).filter(mc).map(gc).join("&"):"";let ue;e[3]!==H||e[4]!==n?(ue=H?[...n,H]:n,e[3]=H,e[4]=n,e[5]=ue):ue=e[5];const de=ue,{data:D,isLoading:C,isError:v,isRefetching:u,refetch:c}=Ro(d+q,de),{queryClient:g}=at();let l,h;e[6]!==D||e[7]!==s||e[8]!==g?(l=()=>{!D||!Array.isArray(D)||s?.forEach(Ae=>g.invalidateQueries({queryKey:Ae}))},h=[D,s,g],e[6]=D,e[7]=s,e[8]=g,e[9]=l,e[10]=h):(l=e[9],h=e[10]),re.useEffect(l,h);let b;e[11]!==D||e[12]!==_?(b=!D||!Array.isArray(D)?[]:!_||_.length===0?D:D.filter(Ae=>_.every(me=>{if(me.value===void 0)return!0;const ke=me.id;if(me.type==="query"){const Ee=Ae[ke];return Array.isArray(me.value)?Array.isArray(Ee)?Ee.some(Me=>{if(typeof Me=="string"||typeof Me=="number")return me.value.includes(String(Me));if(Me&&typeof Me=="object"){if("id"in Me&&me.value.includes(Me.id))return!0;for(const nt in Me){const Ie=Me[nt];if(typeof Ie=="string"&&me.value.includes(Ie)||Ie&&typeof Ie=="object"&&"id"in Ie&&me.value.includes(Ie.id))return!0}}return!1}):Ee&&typeof Ee=="object"&&"id"in Ee?me.value.includes(Ee.id):!1:typeof Ee=="string"&&Ee.includes(me.value)}else if(me.type==="date"){const Ee=me.value;if(!Ee)return!0;const[Me,nt]=Ee;if(!Me&&!nt)return!0;const Ie=Ae[ke];if(typeof Ie=="string"){const xt=Ie.split(" ")[0];if(Me&&nt)return xt>=Me&&xt<=nt;if(Me&&!nt)return xt>=Me;if(!Me&&nt)return xt<=nt}return!0}else if(me.type==="boolean")return Ae[ke]===me.value;return!0})),e[11]=D,e[12]=_,e[13]=b):b=e[13];const T=b,R=S?.field??i[0].id,K=S?.direction??"desc";let Z;e[14]!==R||e[15]!==K?(Z={columnAccessor:R,direction:K},e[14]=R,e[15]=K,e[16]=Z):Z=e[16];const[ne,V]=re.useState(Z),oe=_s(T,ne.columnAccessor,ne.direction),[ee,ie]=bs(xs[1],"mantine-table-page-size"),[O,L]=re.useState(1),j=y?oe.slice((O-1)*ee,O*ee):oe;let Y;e[17]===Symbol.for("react.memo_cache_sentinel")?(Y=[],e[17]=Y):Y=e[17];const[I,ce]=re.useState(Y);let o;e[18]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{ce([])},e[18]=o):o=e[18];let a;e[19]!==H?(a=[H],e[19]=H,e[20]=a):a=e[20],re.useEffect(o,a);const[p,k]=re.useState(!1),[N,U]=re.useState(!1),[le,se]=re.useState(!1),fe=r?"space-between":"end";let ae;e[21]!==r?(ae=r&&(typeof r=="string"?w.jsx(E.Title,{order:4,children:r}):r),e[21]=r,e[22]=ae):ae=e[22];let ge;e[23]!==c?(ge=()=>c(),e[23]=c,e[24]=ge):ge=e[24];let ve;e[25]===Symbol.for("react.memo_cache_sentinel")?(ve=w.jsx(Dt.IconRefresh,{}),e[25]=ve):ve=e[25];let pe;e[26]!==ge?(pe=w.jsx(E.ActionIcon,{variant:"subtle",onClick:ge,"aria-label":"Neuladen",children:ve}),e[26]=ge,e[27]=pe):pe=e[27];let xe;e[28]!==M||e[29]!==i||e[30]!==I||e[31]!==m?(xe=(i.some(pc)||m)&&w.jsxs(E.Menu,{shadow:"md",children:[w.jsx(E.Menu.Target,{children:w.jsx(E.Button,{variant:"outline",rightSection:w.jsx(Dt.IconCaretDownFilled,{size:14}),disabled:!I.length,children:"Aktionen"})}),w.jsxs(E.Menu.Dropdown,{children:[i.find(fc)&&w.jsx(E.Menu.Item,{leftSection:w.jsx(Dt.IconPencil,{size:14}),onClick:()=>U(!0),disabled:I.length!==1,children:"Bearbeiten"}),(M??[]).map((Ae,me)=>re.createElement(E.Menu.Item,{...Ae.icon&&{leftSection:Ae.icon},key:`custom_action_${me}`,onClick:()=>Ae.onClick(I)},Ae.label)),i.find(hc)&&w.jsx(E.Menu.Item,{leftSection:w.jsx(Dt.IconTrash,{size:14}),onClick:()=>se(!0),color:"red",children:"Löschen"})]})]}),e[28]=M,e[29]=i,e[30]=I,e[31]=m,e[32]=xe):xe=e[32];let _e;e[33]!==P||e[34]!==i||e[35]!==C?(_e=i.find(dc)&&w.jsx(E.Button,{onClick:()=>k(!0),disabled:C,children:P??"Erstellen"}),e[33]=P,e[34]=i,e[35]=C,e[36]=_e):_e=e[36];let Ce;e[37]!==f||e[38]!==pe||e[39]!==xe||e[40]!==_e?(Ce=w.jsxs(E.Group,{align:"center",gap:"xs",children:[pe,xe,_e,f]}),e[37]=f,e[38]=pe,e[39]=xe,e[40]=_e,e[41]=Ce):Ce=e[41];let Be;e[42]!==fe||e[43]!==ae||e[44]!==Ce?(Be=w.jsxs(E.Group,{gap:"xs",justify:fe,align:"center",children:[ae,Ce]}),e[42]=fe,e[43]=ae,e[44]=Ce,e[45]=Be):Be=e[45];let Oe;e[46]!==H||e[47]!==$||e[48]!==B?(Oe=B&&B.length>0&&w.jsx(E.Tabs,{value:H,onChange:$,mt:"md",children:w.jsx(E.Tabs.List,{children:B.map(cc)})}),e[46]=H,e[47]=$,e[48]=B,e[49]=Oe):Oe=e[49];let Se;e[50]!==v?(Se=v&&w.jsx(E.Alert,{mt:"md",variant:"light",color:"red",title:"Es ist ein Fehler aufgetreten.",icon:w.jsx(Dt.IconInfoCircle,{}),children:"Bitte versuche es später erneut oder sende eine Nachricht an unseren Support."}),e[50]=v,e[51]=Se):Se=e[51];let Xe;e[52]!==C||e[53]!==u?(Xe=(C||u)&&w.jsxs(E.Stack,{my:"md",children:[w.jsx(E.Skeleton,{height:40}),Array(5).fill(0).map(uc)]}),e[52]=C,e[53]=u,e[54]=Xe):Xe=e[54];let Te;e[55]!==i||e[56]!==v||e[57]!==C||e[58]!==u||e[59]!==O||e[60]!==ee||e[61]!==y||e[62]!==j||e[63]!==I||e[64]!==m||e[65]!==L||e[66]!==ie||e[67]!==ne||e[68]!==oe?(Te=!C&&!u&&w.jsx(Zu,{my:"md",striped:!0,minHeight:150,fetching:v,records:j,sortStatus:ne,onSortStatusChange:V,...m&&{selectedRecords:I,onSelectedRecordsChange:ce},...y&&j.length&&{totalRecords:oe.length,recordsPerPage:ee,onPageChange:L,page:O,recordsPerPageOptions:xs,onRecordsPerPageChange:ie,recordsPerPageLabel:"Einträge pro Seite"},columns:i.map(lc),noRecordsText:"Keine Einträge gefunden"}),e[55]=i,e[56]=v,e[57]=C,e[58]=u,e[59]=O,e[60]=ee,e[61]=y,e[62]=j,e[63]=I,e[64]=m,e[65]=L,e[66]=ie,e[67]=ne,e[68]=oe,e[69]=Te):Te=e[69];let et;e[70]===Symbol.for("react.memo_cache_sentinel")?(et=()=>{U(!1),ce([])},e[70]=et):et=e[70];const qe=r??"Bearbeiten";let Je;e[71]!==d||e[72]!==i||e[73]!==n||e[74]!==I[0]||e[75]!==I.length||e[76]!==x?(Je=I.length>0&&w.jsx(ys,{fields:i.filter(ac),queryKey:n,apiPath:d,id:I[0].id,onClose:()=>{U(!1),ce([])},steps:x}),e[71]=d,e[72]=i,e[73]=n,e[74]=I[0],e[75]=I.length,e[76]=x,e[77]=Je):Je=e[77];let tt;e[78]!==qe||e[79]!==Je||e[80]!==N?(tt=w.jsx(E.Modal,{opened:N,onClose:et,title:qe,children:Je}),e[78]=qe,e[79]=Je,e[80]=N,e[81]=tt):tt=e[81];let je;e[82]!==d||e[83]!==le||e[84]!==n||e[85]!==I||e[86]!==r?(je=I.length>0&&w.jsx(E.Modal,{opened:le,onClose:()=>{se(!1),ce([])},title:r??"Löschen",children:w.jsx(vs,{onClose:()=>{se(!1),ce([])},queryKey:n,apiPath:d,selectedRecords:I})}),e[82]=d,e[83]=le,e[84]=n,e[85]=I,e[86]=r,e[87]=je):je=e[87];let dt;e[88]===Symbol.for("react.memo_cache_sentinel")?(dt=()=>{k(!1)},e[88]=dt):dt=e[88];const gt=r??"Anlegen";let rt;e[89]===Symbol.for("react.memo_cache_sentinel")?(rt=()=>{k(!1)},e[89]=rt):rt=e[89];let We;e[90]!==i?(We=i.filter(ic),e[90]=i,e[91]=We):We=e[91];let Ve;e[92]!==d||e[93]!==n||e[94]!==x||e[95]!==We?(Ve=w.jsx(ss,{queryKey:n,apiPath:d,onClose:rt,fields:We,steps:x}),e[92]=d,e[93]=n,e[94]=x,e[95]=We,e[96]=Ve):Ve=e[96];let He;e[97]!==p||e[98]!==gt||e[99]!==Ve?(He=w.jsx(E.Modal,{opened:p,onClose:dt,title:gt,children:Ve}),e[97]=p,e[98]=gt,e[99]=Ve,e[100]=He):He=e[100];let ot;return e[101]!==Be||e[102]!==Oe||e[103]!==Se||e[104]!==Xe||e[105]!==Te||e[106]!==tt||e[107]!==je||e[108]!==He?(ot=w.jsxs(w.Fragment,{children:[Be,Oe,Se,Xe,Te,tt,je,He]}),e[101]=Be,e[102]=Oe,e[103]=Se,e[104]=Xe,e[105]=Te,e[106]=tt,e[107]=je,e[108]=He,e[109]=ot):ot=e[109],ot}function ic(t){return t.create}function ac(t){return t.update}function lc(t){return t.column}function uc(t,e){return w.jsx(E.Skeleton,{height:35},`skeleton-${e}`)}function cc(t){return w.jsx(E.Tabs.Tab,{value:t.value,leftSection:t.icon,children:t.label},t.value)}function dc(t){return t.create}function hc(t){return t.delete}function fc(t){return t.update}function pc(t){return t.update}function gc(t){const[e,r]=t;return`${e}=${encodeURIComponent(r??"")}`}function mc(t){const[,e]=t;return e!=null}function yc(t){const e=Ge.c(5),{queryClient:r}=at();let n;e[0]!==t?(n=w.jsx(sc,{...t}),e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==r||e[3]!==n?(s=w.jsx(In,{client:r,children:n}),e[2]=r,e[3]=n,e[4]=s):s=e[4],s}we.CreateModal=ss,we.DataTable=yc,we.DataTableProvider=nl,we.DeleteModal=vs,we.UpdateModal=ys,we.api=sl,we.createOne=To,we.deleteOne=Eo,we.getAll=Oo,we.getApiHeaders=pt,we.getOne=Ao,we.sortData=_s,we.updateOne=jo,we.useAddOne=$o,we.useDataTable=at,we.useDeleteOne=Lo,we.useGetAll=Ro,we.useGetOne=No,we.usePersistentState=bs,we.useUpdateOne=en,Object.defineProperty(we,Symbol.toStringTag,{value:"Module"})});
118
118
  //# sourceMappingURL=index.umd.js.map