var Cu=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var _=(e,t,r)=>(Cu(e,t,"read from private field"),r?r.call(e):t.get(e)),le=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},te=(e,t,r,n)=>(Cu(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);var uo=(e,t,r,n)=>({set _(i){te(e,t,i,r)},get _(){return _(e,t,n)}}),Oe=(e,t,r)=>(Cu(e,t,"access private method"),r);import{r as Z,j as L,bW as ar,l as J,bX as xc,a6 as jr,bY as Zh,bZ as Yh,b_ as Xh,bc as Kh,b9 as Ta,b$ as Jh,c0 as ed,c1 as td,_ as vi,c2 as rd,c3 as nd,bR as fs,bz as id,a9 as Tc,c4 as od,bv as ud,c5 as mr,c6 as ad,c7 as ao,W as Au,c8 as sd,c9 as ld,ca as cd,bG as hs,cb as ds,J as so,cc as Su,cd as $e,bE as fd,bu as lo,P as _c,ce as ps,bx as hd,cf as ms,cg as zr,ch as Fu,a2 as dd,ci as pd,cj as gs,ck as md,cl as gd,cm as vd,cn as Dd,co as yd,cp as vs,bC as wd,y as Ds,cq as Ed,B as Cd,cr as Ad,cs as Sd,ct as Fd,e as Si,C as bu}from"./main-1.0.13.js";import{A as ys,a as bd}from"./AdminTheme-1.0.13-a1e60de2.js";import{e as xd,u as Td,f as _d,g as Md,h as Nd,M as Bd}from"./index.esm-1.0.13-ae160362.js";import{a as _a,u as Pr,B as Dr,a3 as Od,H as Rd,a4 as Pd,a5 as kd,T as ws,_ as Es,a6 as Id,a7 as or,k as Ld,a8 as zd,a9 as $d,A as Ud,g as qd,h as jd,S as Vd,D as Hd,t as Wd}from"./main-1.0.13-4cbe632d.js";import{b as xu}from"./TextField-1.0.13-7258d491.js";import{l as Mc}from"./ActionsDml-1.0.13-147ce8d4.js";import{u as Gd}from"./useStoreTable-1.0.13-383948b4.js";import{u as Qd,B as wo,C as Cs,a as As}from"./useScreenSize-1.0.13-fa31f819.js";import{b as Zd,c as Yd,d as Xd,e as Kd,f as Jd}from"./index.esm-1.0.13-0afa0259.js";import{i as ep}from"./index-1.0.13-81ade722.js";import{O as Nc,T as tp,I as Tu}from"./iconBase-1.0.13-98e06aa9.js";import{R as rp,a as _u,B as np,b as ip,c as op,d as up,e as co,C as ap,j as sp}from"./settings-1.0.13-650559d5.js";import{S as lp}from"./ScopeEnum-1.0.13-d05c4b00.js";import{T as fo}from"./Tabs-1.0.13-f71c8d5c.js";const cp={actions:"Actions",and:"and",cancel:"Cancel",changeFilterMode:"Change filter mode",changeSearchMode:"Change search mode",clearFilter:"Clear filter",clearSearch:"Clear search",clearSelection:"Clear selection",clearSort:"Clear sort",clickToCopy:"Click to copy",copy:"Copy",collapse:"Collapse",collapseAll:"Collapse all",columnActions:"Column Actions",copiedToClipboard:"Copied to clipboard",dropToGroupBy:"Drop to group by {column}",edit:"Edit",expand:"Expand",expandAll:"Expand all",filterArrIncludes:"Includes",filterArrIncludesAll:"Includes all",filterArrIncludesSome:"Includes",filterBetween:"Between",filterBetweenInclusive:"Between Inclusive",filterByColumn:"Filter by {column}",filterContains:"Contains",filterEmpty:"Empty",filterEndsWith:"Ends With",filterEquals:"Equals",filterEqualsString:"Equals",filterFuzzy:"Fuzzy",filterGreaterThan:"Greater Than",filterGreaterThanOrEqualTo:"Greater Than Or Equal To",filterInNumberRange:"Between",filterIncludesString:"Contains",filterIncludesStringSensitive:"Contains",filterLessThan:"Less Than",filterLessThanOrEqualTo:"Less Than Or Equal To",filterMode:"Filter Mode: {filterType}",filterNotEmpty:"Not Empty",filterNotEquals:"Not Equals",filterStartsWith:"Starts With",filterWeakEquals:"Equals",filteringByColumn:"Filtering by {column} - {filterType} {filterValue}",goToFirstPage:"Go to first page",goToLastPage:"Go to last page",goToNextPage:"Go to next page",goToPreviousPage:"Go to previous page",grab:"Grab",groupByColumn:"Group by {column}",groupedBy:"Grouped by ",hideAll:"Hide all",hideColumn:"Hide {column} column",max:"Max",min:"Min",move:"Move",noRecordsToDisplay:"No records to display",noResultsFound:"No results found",of:"of",or:"or",pin:"Pin",pinToLeft:"Pin to left",pinToRight:"Pin to right",resetColumnSize:"Reset column size",resetOrder:"Reset order",rowActions:"Row Actions",rowNumber:"#",rowNumbers:"Row Numbers",rowsPerPage:"Rows per page",save:"Save",search:"Search",selectedCountOfRowCountRowsSelected:"{selectedCount} of {rowCount} row(s) selected",select:"Select",showAll:"Show all",showAllColumns:"Show all columns",showHideColumns:"Show/Hide columns",showHideFilters:"Show/Hide filters",showHideSearch:"Show/Hide search",sortByColumnAsc:"Sort by {column} ascending",sortByColumnDesc:"Sort by {column} descending",sortedByColumnAsc:"Sorted by {column} ascending",sortedByColumnDesc:"Sorted by {column} descending",thenBy:", then by ",toggleDensity:"Toggle density",toggleFullScreen:"Toggle full screen",toggleSelectAll:"Toggle select all",toggleSelectRow:"Toggle select row",toggleVisibility:"Toggle visibility",ungroupByColumn:"Ungroup by {column}",unpin:"Unpin",unpinAll:"Unpin all"};var no=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},fi=typeof window>"u"||"Deno"in globalThis;function cr(){}function fp(e,t){return typeof e=="function"?e(t):e}function Yu(e){return typeof e=="number"&&e>=0&&e!==1/0}function Bc(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ss(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:o,queryKey:u,stale:l}=e;if(u){if(n){if(t.queryHash!==Ma(u,t.options))return!1}else if(!Li(t.queryKey,u))return!1}if(r!=="all"){const f=t.isActive();if(r==="active"&&!f||r==="inactive"&&f)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||o&&!o(t))}function Fs(e,t){const{exact:r,status:n,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(Ii(t.options.mutationKey)!==Ii(o))return!1}else if(!Li(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function Ma(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ii)(e)}function Ii(e){return JSON.stringify(e,(t,r)=>Ku(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Li(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(r=>!Li(e[r],t[r])):!1}function Oc(e,t){if(e===t)return e;const r=bs(e)&&bs(t);if(r||Ku(e)&&Ku(t)){const n=r?e:Object.keys(e),i=n.length,o=r?t:Object.keys(t),u=o.length,l=r?[]:{};let f=0;for(let h=0;h<u;h++){const s=r?h:o[h];!r&&e[s]===void 0&&t[s]===void 0&&n.includes(s)?(l[s]=void 0,f++):(l[s]=Oc(e[s],t[s]),l[s]===e[s]&&e[s]!==void 0&&f++)}return i===u&&f===i?e:l}return t}function Xu(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function bs(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ku(e){if(!xs(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!xs(r)||!r.hasOwnProperty("isPrototypeOf"))}function xs(e){return Object.prototype.toString.call(e)==="[object Object]"}function hp(e){return new Promise(t=>{setTimeout(t,e)})}function Ju(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Oc(e,t):t}function dp(e){return e}function pp(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function mp(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Na=Symbol(),xn,en,Xn,Dc,gp=(Dc=class extends no{constructor(){super();le(this,xn,void 0);le(this,en,void 0);le(this,Xn,void 0);te(this,Xn,t=>{if(!fi&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){_(this,en)||this.setEventListener(_(this,Xn))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,en))==null||t.call(this),te(this,en,void 0))}setEventListener(t){var r;te(this,Xn,t),(r=_(this,en))==null||r.call(this),te(this,en,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){_(this,xn)!==t&&(te(this,xn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof _(this,xn)=="boolean"?_(this,xn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},xn=new WeakMap,en=new WeakMap,Xn=new WeakMap,Dc),Ba=new gp,Kn,tn,Jn,yc,vp=(yc=class extends no{constructor(){super();le(this,Kn,!0);le(this,tn,void 0);le(this,Jn,void 0);te(this,Jn,t=>{if(!fi&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){_(this,tn)||this.setEventListener(_(this,Jn))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,tn))==null||t.call(this),te(this,tn,void 0))}setEventListener(t){var r;te(this,Jn,t),(r=_(this,tn))==null||r.call(this),te(this,tn,t(this.setOnline.bind(this)))}setOnline(t){_(this,Kn)!==t&&(te(this,Kn,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return _(this,Kn)}},Kn=new WeakMap,tn=new WeakMap,Jn=new WeakMap,yc),Oo=new vp;function Dp(e){return Math.min(1e3*2**e,3e4)}function Oa(e){return(e??"online")==="online"?Oo.isOnline():!0}var Rc=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Mu(e){return e instanceof Rc}function Pc(e){let t=!1,r=0,n=!1,i,o,u;const l=new Promise((g,m)=>{o=g,u=m}),f=g=>{var m;n||(p(new Rc(g)),(m=e.abort)==null||m.call(e))},h=()=>{t=!0},s=()=>{t=!1},a=()=>!Ba.isFocused()||e.networkMode!=="always"&&!Oo.isOnline(),c=g=>{var m;n||(n=!0,(m=e.onSuccess)==null||m.call(e,g),i==null||i(),o(g))},p=g=>{var m;n||(n=!0,(m=e.onError)==null||m.call(e,g),i==null||i(),u(g))},D=()=>new Promise(g=>{var m;i=y=>{const v=n||!a();return v&&g(y),v},(m=e.onPause)==null||m.call(e)}).then(()=>{var g;i=void 0,n||(g=e.onContinue)==null||g.call(e)}),d=()=>{if(n)return;let g;try{g=e.fn()}catch(m){g=Promise.reject(m)}Promise.resolve(g).then(c).catch(m=>{var C;if(n)return;const y=e.retry??(fi?0:3),v=e.retryDelay??Dp,w=typeof v=="function"?v(r,m):v,E=y===!0||typeof y=="number"&&r<y||typeof y=="function"&&y(r,m);if(t||!E){p(m);return}r++,(C=e.onFail)==null||C.call(e,r,m),hp(w).then(()=>{if(a())return D()}).then(()=>{t?p(m):d()})})};return Oa(e.networkMode)?d():D().then(d),{promise:l,cancel:f,continue:()=>(i==null?void 0:i())?l:Promise.resolve(),cancelRetry:h,continueRetry:s}}function yp(){let e=[],t=0,r=c=>{c()},n=c=>{c()},i=c=>setTimeout(c,0);const o=c=>{i=c},u=c=>{let p;t++;try{p=c()}finally{t--,t||h()}return p},l=c=>{t?e.push(c):i(()=>{r(c)})},f=c=>(...p)=>{l(()=>{c(...p)})},h=()=>{const c=e;e=[],c.length&&i(()=>{n(()=>{c.forEach(p=>{r(p)})})})};return{batch:u,batchCalls:f,schedule:l,setNotifyFunction:c=>{r=c},setBatchNotifyFunction:c=>{n=c},setScheduler:o}}var _t=yp(),Tn,wc,kc=(wc=class{constructor(){le(this,Tn,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Yu(this.gcTime)&&te(this,Tn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(fi?1/0:5*60*1e3))}clearGcTimeout(){_(this,Tn)&&(clearTimeout(_(this,Tn)),te(this,Tn,void 0))}},Tn=new WeakMap,wc),ei,ti,sr,It,Ft,Hi,_n,vr,qr,Ec,wp=(Ec=class extends kc{constructor(t){super();le(this,vr);le(this,ei,void 0);le(this,ti,void 0);le(this,sr,void 0);le(this,It,void 0);le(this,Ft,void 0);le(this,Hi,void 0);le(this,_n,void 0);te(this,_n,!1),te(this,Hi,t.defaultOptions),this.setOptions(t.options),te(this,Ft,[]),te(this,sr,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,te(this,ei,t.state||Ep(this.options)),this.state=_(this,ei),this.scheduleGc()}get meta(){return this.options.meta}setOptions(t){this.options={..._(this,Hi),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!_(this,Ft).length&&this.state.fetchStatus==="idle"&&_(this,sr).remove(this)}setData(t,r){const n=Ju(this.state.data,t,this.options);return Oe(this,vr,qr).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){Oe(this,vr,qr).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,i;const r=(n=_(this,It))==null?void 0:n.promise;return(i=_(this,It))==null||i.cancel(t),r?r.then(cr).catch(cr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(_(this,ei))}isActive(){return _(this,Ft).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?_(this,Ft).some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!Bc(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=_(this,Ft).find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=_(this,It))==null||r.continue()}onOnline(){var r;const t=_(this,Ft).find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=_(this,It))==null||r.continue()}addObserver(t){_(this,Ft).includes(t)||(_(this,Ft).push(t),this.clearGcTimeout(),_(this,sr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){_(this,Ft).includes(t)&&(te(this,Ft,_(this,Ft).filter(r=>r!==t)),_(this,Ft).length||(_(this,It)&&(_(this,_n)?_(this,It).cancel({revert:!0}):_(this,It).cancelRetry()),this.scheduleGc()),_(this,sr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return _(this,Ft).length}invalidate(){this.state.isInvalidated||Oe(this,vr,qr).call(this,{type:"invalidate"})}fetch(t,r){var h,s,a;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(_(this,It))return _(this,It).continueRetry(),_(this,It).promise}if(t&&this.setOptions(t),!this.options.queryFn){const c=_(this,Ft).find(p=>p.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,i={queryKey:this.queryKey,meta:this.meta},o=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(te(this,_n,!0),n.signal)})};o(i);const u=()=>!this.options.queryFn||this.options.queryFn===Na?Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)):(te(this,_n,!1),this.options.persister?this.options.persister(this.options.queryFn,i,this):this.options.queryFn(i)),l={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:u};o(l),(h=this.options.behavior)==null||h.onFetch(l,this),te(this,ti,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((s=l.fetchOptions)==null?void 0:s.meta))&&Oe(this,vr,qr).call(this,{type:"fetch",meta:(a=l.fetchOptions)==null?void 0:a.meta});const f=c=>{var p,D,d,g;Mu(c)&&c.silent||Oe(this,vr,qr).call(this,{type:"error",error:c}),Mu(c)||((D=(p=_(this,sr).config).onError)==null||D.call(p,c,this),(g=(d=_(this,sr).config).onSettled)==null||g.call(d,this.state.data,c,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return te(this,It,Pc({fn:l.fetchFn,abort:n.abort.bind(n),onSuccess:c=>{var p,D,d,g;if(c===void 0){f(new Error(`${this.queryHash} data is undefined`));return}this.setData(c),(D=(p=_(this,sr).config).onSuccess)==null||D.call(p,c,this),(g=(d=_(this,sr).config).onSettled)==null||g.call(d,c,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:f,onFail:(c,p)=>{Oe(this,vr,qr).call(this,{type:"failed",failureCount:c,error:p})},onPause:()=>{Oe(this,vr,qr).call(this,{type:"pause"})},onContinue:()=>{Oe(this,vr,qr).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode})),_(this,It).promise}},ei=new WeakMap,ti=new WeakMap,sr=new WeakMap,It=new WeakMap,Ft=new WeakMap,Hi=new WeakMap,_n=new WeakMap,vr=new WeakSet,qr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Ic(n.data,this.options),fetchMeta:t.meta??null};case"success":return{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return Mu(i)&&i.revert&&_(this,ti)?{..._(this,ti),fetchStatus:"idle"}:{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),_t.batch(()=>{_(this,Ft).forEach(n=>{n.onQueryUpdate()}),_(this,sr).notify({query:this,type:"updated",action:t})})},Ec);function Ic(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Oa(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Ep(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Mr,Cc,Cp=(Cc=class extends no{constructor(t={}){super();le(this,Mr,void 0);this.config=t,te(this,Mr,new Map)}build(t,r,n){const i=r.queryKey,o=r.queryHash??Ma(i,r);let u=this.get(o);return u||(u=new wp({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(u)),u}add(t){_(this,Mr).has(t.queryHash)||(_(this,Mr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=_(this,Mr).get(t.queryHash);r&&(t.destroy(),r===t&&_(this,Mr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){_t.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return _(this,Mr).get(t)}getAll(){return[..._(this,Mr).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Ss(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Ss(t,n)):r}notify(t){_t.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){_t.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){_t.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Mr=new WeakMap,Cc),Nr,Wi,Jt,ri,Br,Yr,Ac,Ap=(Ac=class extends kc{constructor(t){super();le(this,Br);le(this,Nr,void 0);le(this,Wi,void 0);le(this,Jt,void 0);le(this,ri,void 0);this.mutationId=t.mutationId,te(this,Wi,t.defaultOptions),te(this,Jt,t.mutationCache),te(this,Nr,[]),this.state=t.state||Sp(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={..._(this,Wi),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){_(this,Nr).includes(t)||(_(this,Nr).push(t),this.clearGcTimeout(),_(this,Jt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){te(this,Nr,_(this,Nr).filter(r=>r!==t)),this.scheduleGc(),_(this,Jt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){_(this,Nr).length||(this.state.status==="pending"?this.scheduleGc():_(this,Jt).remove(this))}continue(){var t;return((t=_(this,ri))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,u,l,f,h,s,a,c,p,D,d,g,m,y,v,w,E,C,F;const r=()=>(te(this,ri,Pc({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(S,b)=>{Oe(this,Br,Yr).call(this,{type:"failed",failureCount:S,error:b})},onPause:()=>{Oe(this,Br,Yr).call(this,{type:"pause"})},onContinue:()=>{Oe(this,Br,Yr).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),_(this,ri).promise),n=this.state.status==="pending";try{if(!n){Oe(this,Br,Yr).call(this,{type:"pending",variables:t}),await((o=(i=_(this,Jt).config).onMutate)==null?void 0:o.call(i,t,this));const b=await((l=(u=this.options).onMutate)==null?void 0:l.call(u,t));b!==this.state.context&&Oe(this,Br,Yr).call(this,{type:"pending",context:b,variables:t})}const S=await r();return await((h=(f=_(this,Jt).config).onSuccess)==null?void 0:h.call(f,S,t,this.state.context,this)),await((a=(s=this.options).onSuccess)==null?void 0:a.call(s,S,t,this.state.context)),await((p=(c=_(this,Jt).config).onSettled)==null?void 0:p.call(c,S,null,this.state.variables,this.state.context,this)),await((d=(D=this.options).onSettled)==null?void 0:d.call(D,S,null,t,this.state.context)),Oe(this,Br,Yr).call(this,{type:"success",data:S}),S}catch(S){try{throw await((m=(g=_(this,Jt).config).onError)==null?void 0:m.call(g,S,t,this.state.context,this)),await((v=(y=this.options).onError)==null?void 0:v.call(y,S,t,this.state.context)),await((E=(w=_(this,Jt).config).onSettled)==null?void 0:E.call(w,void 0,S,this.state.variables,this.state.context,this)),await((F=(C=this.options).onSettled)==null?void 0:F.call(C,void 0,S,t,this.state.context)),S}finally{Oe(this,Br,Yr).call(this,{type:"error",error:S})}}}},Nr=new WeakMap,Wi=new WeakMap,Jt=new WeakMap,ri=new WeakMap,Br=new WeakSet,Yr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Oa(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),_t.batch(()=>{_(this,Nr).forEach(n=>{n.onMutationUpdate(t)}),_(this,Jt).notify({mutation:this,type:"updated",action:t})})},Ac);function Sp(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var lr,Gi,Mn,Sc,Fp=(Sc=class extends no{constructor(t={}){super();le(this,lr,void 0);le(this,Gi,void 0);le(this,Mn,void 0);this.config=t,te(this,lr,[]),te(this,Gi,0)}build(t,r,n){const i=new Ap({mutationCache:this,mutationId:++uo(this,Gi)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){_(this,lr).push(t),this.notify({type:"added",mutation:t})}remove(t){te(this,lr,_(this,lr).filter(r=>r!==t)),this.notify({type:"removed",mutation:t})}clear(){_t.batch(()=>{_(this,lr).forEach(t=>{this.remove(t)})})}getAll(){return _(this,lr)}find(t){const r={exact:!0,...t};return _(this,lr).find(n=>Fs(r,n))}findAll(t={}){return _(this,lr).filter(r=>Fs(t,r))}notify(t){_t.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){return te(this,Mn,(_(this,Mn)??Promise.resolve()).then(()=>{const t=_(this,lr).filter(r=>r.state.isPaused);return _t.batch(()=>t.reduce((r,n)=>r.then(()=>n.continue().catch(cr)),Promise.resolve()))}).then(()=>{te(this,Mn,void 0)})),_(this,Mn)}},lr=new WeakMap,Gi=new WeakMap,Mn=new WeakMap,Sc);function bp(e){return{onFetch:(t,r)=>{const n=async()=>{var D,d,g,m,y;const i=t.options,o=(g=(d=(D=t.fetchOptions)==null?void 0:D.meta)==null?void 0:d.fetchMore)==null?void 0:g.direction,u=((m=t.state.data)==null?void 0:m.pages)||[],l=((y=t.state.data)==null?void 0:y.pageParams)||[],f={pages:[],pageParams:[]};let h=!1;const s=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(t.signal.aborted?h=!0:t.signal.addEventListener("abort",()=>{h=!0}),t.signal)})},a=t.options.queryFn&&t.options.queryFn!==Na?t.options.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`)),c=async(v,w,E)=>{if(h)return Promise.reject();if(w==null&&v.pages.length)return Promise.resolve(v);const C={queryKey:t.queryKey,pageParam:w,direction:E?"backward":"forward",meta:t.options.meta};s(C);const F=await a(C),{maxPages:S}=t.options,b=E?mp:pp;return{pages:b(v.pages,F,S),pageParams:b(v.pageParams,w,S)}};let p;if(o&&u.length){const v=o==="backward",w=v?xp:Ts,E={pages:u,pageParams:l},C=w(i,E);p=await c(E,C,v)}else{p=await c(f,l[0]??i.initialPageParam);const v=e??u.length;for(let w=1;w<v;w++){const E=Ts(i,p);p=await c(p,E)}}return p};t.options.persister?t.fetchFn=()=>{var i,o;return(o=(i=t.options).persister)==null?void 0:o.call(i,n,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=n}}}function Ts(e,{pages:t,pageParams:r}){const n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function xp(e,{pages:t,pageParams:r}){var n;return(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r)}var pt,rn,nn,ni,ii,on,oi,ui,Fc,Tp=(Fc=class{constructor(e={}){le(this,pt,void 0);le(this,rn,void 0);le(this,nn,void 0);le(this,ni,void 0);le(this,ii,void 0);le(this,on,void 0);le(this,oi,void 0);le(this,ui,void 0);te(this,pt,e.queryCache||new Cp),te(this,rn,e.mutationCache||new Fp),te(this,nn,e.defaultOptions||{}),te(this,ni,new Map),te(this,ii,new Map),te(this,on,0)}mount(){uo(this,on)._++,_(this,on)===1&&(te(this,oi,Ba.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,pt).onFocus())})),te(this,ui,Oo.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,pt).onOnline())})))}unmount(){var e,t;uo(this,on)._--,_(this,on)===0&&((e=_(this,oi))==null||e.call(this),te(this,oi,void 0),(t=_(this,ui))==null||t.call(this),te(this,ui,void 0))}isFetching(e){return _(this,pt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return _(this,rn).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=_(this,pt).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const r=this.defaultQueryOptions(e),n=_(this,pt).build(this,r);return e.revalidateIfStale&&n.isStaleByTime(r.staleTime)&&this.prefetchQuery(r),Promise.resolve(t)}}getQueriesData(e){return _(this,pt).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),i=_(this,pt).get(n.queryHash),o=i==null?void 0:i.state.data,u=fp(t,o);if(u!==void 0)return _(this,pt).build(this,n).setData(u,{...r,manual:!0})}setQueriesData(e,t,r){return _t.batch(()=>_(this,pt).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=_(this,pt).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=_(this,pt);_t.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=_(this,pt),n={type:"active",...e};return _t.batch(()=>(r.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(n,t)))}cancelQueries(e={},t={}){const r={revert:!0,...t},n=_t.batch(()=>_(this,pt).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(cr).catch(cr)}invalidateQueries(e={},t={}){return _t.batch(()=>{if(_(this,pt).findAll(e).forEach(n=>{n.invalidate()}),e.refetchType==="none")return Promise.resolve();const r={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(r,t)})}refetchQueries(e={},t){const r={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},n=_t.batch(()=>_(this,pt).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,r);return r.throwOnError||(o=o.catch(cr)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(cr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=_(this,pt).build(this,t);return r.isStaleByTime(t.staleTime)?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(cr).catch(cr)}fetchInfiniteQuery(e){return e.behavior=bp(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(cr).catch(cr)}resumePausedMutations(){return Oo.isOnline()?_(this,rn).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,pt)}getMutationCache(){return _(this,rn)}getDefaultOptions(){return _(this,nn)}setDefaultOptions(e){te(this,nn,e)}setQueryDefaults(e,t){_(this,ni).set(Ii(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[..._(this,ni).values()];let r={};return t.forEach(n=>{Li(e,n.queryKey)&&(r={...r,...n.defaultOptions})}),r}setMutationDefaults(e,t){_(this,ii).set(Ii(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[..._(this,ii).values()];let r={};return t.forEach(n=>{Li(e,n.mutationKey)&&(r={...r,...n.defaultOptions})}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={..._(this,nn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ma(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===Na&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{..._(this,nn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){_(this,pt).clear(),_(this,rn).clear()}},pt=new WeakMap,rn=new WeakMap,nn=new WeakMap,ni=new WeakMap,ii=new WeakMap,on=new WeakMap,oi=new WeakMap,ui=new WeakMap,Fc),Ht,Xe,Qi,Lt,Nn,ai,Or,Zi,si,li,Bn,On,un,ci,Rn,Mi,Yi,ea,Xi,ta,Ki,ra,Ji,na,eo,ia,to,oa,ro,ua,tu,Lc,bc,_p=(bc=class extends no{constructor(t,r){super();le(this,Rn);le(this,Yi);le(this,Xi);le(this,Ki);le(this,Ji);le(this,eo);le(this,to);le(this,ro);le(this,tu);le(this,Ht,void 0);le(this,Xe,void 0);le(this,Qi,void 0);le(this,Lt,void 0);le(this,Nn,void 0);le(this,ai,void 0);le(this,Or,void 0);le(this,Zi,void 0);le(this,si,void 0);le(this,li,void 0);le(this,Bn,void 0);le(this,On,void 0);le(this,un,void 0);le(this,ci,new Set);this.options=r,te(this,Ht,t),te(this,Or,null),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,Xe).addObserver(this),_s(_(this,Xe),this.options)?Oe(this,Rn,Mi).call(this):this.updateResult(),Oe(this,Ji,na).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return aa(_(this,Xe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return aa(_(this,Xe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Oe(this,eo,ia).call(this),Oe(this,to,oa).call(this),_(this,Xe).removeObserver(this)}setOptions(t,r){const n=this.options,i=_(this,Xe);if(this.options=_(this,Ht).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");Oe(this,ro,ua).call(this),_(this,Xe).setOptions(this.options),n._defaulted&&!Xu(this.options,n)&&_(this,Ht).getQueryCache().notify({type:"observerOptionsUpdated",query:_(this,Xe),observer:this});const o=this.hasListeners();o&&Ms(_(this,Xe),i,this.options,n)&&Oe(this,Rn,Mi).call(this),this.updateResult(r),o&&(_(this,Xe)!==i||this.options.enabled!==n.enabled||this.options.staleTime!==n.staleTime)&&Oe(this,Yi,ea).call(this);const u=Oe(this,Xi,ta).call(this);o&&(_(this,Xe)!==i||this.options.enabled!==n.enabled||u!==_(this,un))&&Oe(this,Ki,ra).call(this,u)}getOptimisticResult(t){const r=_(this,Ht).getQueryCache().build(_(this,Ht),t),n=this.createResult(r,t);return Np(this,n)&&(te(this,Lt,n),te(this,ai,this.options),te(this,Nn,_(this,Xe).state)),n}getCurrentResult(){return _(this,Lt)}trackResult(t,r){const n={};return Object.keys(t).forEach(i=>{Object.defineProperty(n,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),r==null||r(i),t[i])})}),n}trackProp(t){_(this,ci).add(t)}getCurrentQuery(){return _(this,Xe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=_(this,Ht).defaultQueryOptions(t),n=_(this,Ht).getQueryCache().build(_(this,Ht),r);return n.isFetchingOptimistic=!0,n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Oe(this,Rn,Mi).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,Lt)))}createResult(t,r){var F;const n=_(this,Xe),i=this.options,o=_(this,Lt),u=_(this,Nn),l=_(this,ai),h=t!==n?t.state:_(this,Qi),{state:s}=t;let a={...s},c=!1,p;if(r._optimisticResults){const S=this.hasListeners(),b=!S&&_s(t,r),P=S&&Ms(t,n,r,i);(b||P)&&(a={...a,...Ic(s.data,t.options)}),r._optimisticResults==="isRestoring"&&(a.fetchStatus="idle")}let{error:D,errorUpdatedAt:d,status:g}=a;if(r.select&&a.data!==void 0)if(o&&a.data===(u==null?void 0:u.data)&&r.select===_(this,Zi))p=_(this,si);else try{te(this,Zi,r.select),p=r.select(a.data),p=Ju(o==null?void 0:o.data,p,r),te(this,si,p),te(this,Or,null)}catch(S){te(this,Or,S)}else p=a.data;if(r.placeholderData!==void 0&&p===void 0&&g==="pending"){let S;if(o!=null&&o.isPlaceholderData&&r.placeholderData===(l==null?void 0:l.placeholderData))S=o.data;else if(S=typeof r.placeholderData=="function"?r.placeholderData((F=_(this,li))==null?void 0:F.state.data,_(this,li)):r.placeholderData,r.select&&S!==void 0)try{S=r.select(S),te(this,Or,null)}catch(b){te(this,Or,b)}S!==void 0&&(g="success",p=Ju(o==null?void 0:o.data,S,r),c=!0)}_(this,Or)&&(D=_(this,Or),p=_(this,si),d=Date.now(),g="error");const m=a.fetchStatus==="fetching",y=g==="pending",v=g==="error",w=y&&m,E=p!==void 0;return{status:g,fetchStatus:a.fetchStatus,isPending:y,isSuccess:g==="success",isError:v,isInitialLoading:w,isLoading:w,data:p,dataUpdatedAt:a.dataUpdatedAt,error:D,errorUpdatedAt:d,failureCount:a.fetchFailureCount,failureReason:a.fetchFailureReason,errorUpdateCount:a.errorUpdateCount,isFetched:a.dataUpdateCount>0||a.errorUpdateCount>0,isFetchedAfterMount:a.dataUpdateCount>h.dataUpdateCount||a.errorUpdateCount>h.errorUpdateCount,isFetching:m,isRefetching:m&&!y,isLoadingError:v&&!E,isPaused:a.fetchStatus==="paused",isPlaceholderData:c,isRefetchError:v&&E,isStale:Ra(t,r),refetch:this.refetch}}updateResult(t){const r=_(this,Lt),n=this.createResult(_(this,Xe),this.options);if(te(this,Nn,_(this,Xe).state),te(this,ai,this.options),_(this,Nn).data!==void 0&&te(this,li,_(this,Xe)),Xu(n,r))return;te(this,Lt,n);const i={},o=()=>{if(!r)return!0;const{notifyOnChangeProps:u}=this.options,l=typeof u=="function"?u():u;if(l==="all"||!l&&!_(this,ci).size)return!0;const f=new Set(l??_(this,ci));return this.options.throwOnError&&f.add("error"),Object.keys(_(this,Lt)).some(h=>{const s=h;return _(this,Lt)[s]!==r[s]&&f.has(s)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),Oe(this,tu,Lc).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Oe(this,Ji,na).call(this)}},Ht=new WeakMap,Xe=new WeakMap,Qi=new WeakMap,Lt=new WeakMap,Nn=new WeakMap,ai=new WeakMap,Or=new WeakMap,Zi=new WeakMap,si=new WeakMap,li=new WeakMap,Bn=new WeakMap,On=new WeakMap,un=new WeakMap,ci=new WeakMap,Rn=new WeakSet,Mi=function(t){Oe(this,ro,ua).call(this);let r=_(this,Xe).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(cr)),r},Yi=new WeakSet,ea=function(){if(Oe(this,eo,ia).call(this),fi||_(this,Lt).isStale||!Yu(this.options.staleTime))return;const r=Bc(_(this,Lt).dataUpdatedAt,this.options.staleTime)+1;te(this,Bn,setTimeout(()=>{_(this,Lt).isStale||this.updateResult()},r))},Xi=new WeakSet,ta=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(_(this,Xe)):this.options.refetchInterval)??!1},Ki=new WeakSet,ra=function(t){Oe(this,to,oa).call(this),te(this,un,t),!(fi||this.options.enabled===!1||!Yu(_(this,un))||_(this,un)===0)&&te(this,On,setInterval(()=>{(this.options.refetchIntervalInBackground||Ba.isFocused())&&Oe(this,Rn,Mi).call(this)},_(this,un)))},Ji=new WeakSet,na=function(){Oe(this,Yi,ea).call(this),Oe(this,Ki,ra).call(this,Oe(this,Xi,ta).call(this))},eo=new WeakSet,ia=function(){_(this,Bn)&&(clearTimeout(_(this,Bn)),te(this,Bn,void 0))},to=new WeakSet,oa=function(){_(this,On)&&(clearInterval(_(this,On)),te(this,On,void 0))},ro=new WeakSet,ua=function(){const t=_(this,Ht).getQueryCache().build(_(this,Ht),this.options);if(t===_(this,Xe))return;const r=_(this,Xe);te(this,Xe,t),te(this,Qi,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},tu=new WeakSet,Lc=function(t){_t.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(_(this,Lt))}),_(this,Ht).getQueryCache().notify({query:_(this,Xe),type:"observerResultsUpdated"})})},bc);function Mp(e,t){return t.enabled!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function _s(e,t){return Mp(e,t)||e.state.data!==void 0&&aa(e,t,t.refetchOnMount)}function aa(e,t,r){if(t.enabled!==!1){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Ra(e,t)}return!1}function Ms(e,t,r,n){return(e!==t||n.enabled===!1)&&(!r.suspense||e.state.status!=="error")&&Ra(e,r)}function Ra(e,t){return t.enabled!==!1&&e.isStaleByTime(t.staleTime)}function Np(e,t){return!Xu(e.getCurrentResult(),t)}var zc=Z.createContext(void 0),Bp=e=>{const t=Z.useContext(zc);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Op=({client:e,children:t})=>(Z.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),L.jsx(zc.Provider,{value:e,children:t})),$c=Z.createContext(!1),Rp=()=>Z.useContext($c);$c.Provider;function Pp(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var kp=Z.createContext(Pp()),Ip=()=>Z.useContext(kp);function Lp(e,t){return typeof e=="function"?e(...t):!!e}var zp=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},$p=e=>{Z.useEffect(()=>{e.clearReset()},[e])},Up=({result:e,errorResetBoundary:t,throwOnError:r,query:n})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&Lp(r,[e.error,n]),qp=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},jp=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Vp=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function Hp(e,t,r){const n=Bp(r),i=Rp(),o=Ip(),u=n.defaultQueryOptions(e);u._optimisticResults=i?"isRestoring":"optimistic",qp(u),zp(u,o),$p(o);const[l]=Z.useState(()=>new t(n,u)),f=l.getOptimisticResult(u);if(Z.useSyncExternalStore(Z.useCallback(h=>{const s=i?()=>{}:l.subscribe(_t.batchCalls(h));return l.updateResult(),s},[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),Z.useEffect(()=>{l.setOptions(u,{listeners:!1})},[u,l]),jp(u,f))throw Vp(u,l,o);if(Up({result:f,errorResetBoundary:o,throwOnError:u.throwOnError,query:n.getQueryCache().get(u.queryHash)}))throw f.error;return u.notifyOnChangeProps?f:l.trackResult(f)}function Wp(e,t){return Hp(e,_p,t)}var Di={};/** * @license React * react-dom-server-legacy.browser.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Uc=Z;function Ce(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Wt=Object.prototype.hasOwnProperty,Gp=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Ns={},Bs={};function qc(e){return Wt.call(Bs,e)?!0:Wt.call(Ns,e)?!1:Gp.test(e)?Bs[e]=!0:(Ns[e]=!0,!1)}function qt(e,t,r,n,i,o,u){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=u}var Bt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Bt[e]=new qt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Bt[t]=new qt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Bt[e]=new qt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Bt[e]=new qt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Bt[e]=new qt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Bt[e]=new qt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Bt[e]=new qt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Bt[e]=new qt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Bt[e]=new qt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Pa=/[\-:]([a-z])/g;function ka(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Pa,ka);Bt[t]=new qt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Pa,ka);Bt[t]=new qt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Pa,ka);Bt[t]=new qt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Bt[e]=new qt(e,1,!1,e.toLowerCase(),null,!1,!1)});Bt.xlinkHref=new qt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Bt[e]=new qt(e,1,!1,e.toLowerCase(),null,!0,!0)});var Eo={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Qp=["Webkit","ms","Moz","O"];Object.keys(Eo).forEach(function(e){Qp.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Eo[t]=Eo[e]})});var Zp=/["'&<>]/;function zt(e){if(typeof e=="boolean"||typeof e=="number")return""+e;e=""+e;var t=Zp.exec(e);if(t){var r="",n,i=0;for(n=t.index;n<e.length;n++){switch(e.charCodeAt(n)){case 34:t="&quot;";break;case 38:t="&amp;";break;case 39:t="&#x27;";break;case 60:t="&lt;";break;case 62:t="&gt;";break;default:continue}i!==n&&(r+=e.substring(i,n)),i=n+1,r+=t}e=i!==n?r+e.substring(i,n):r}return e}var Yp=/([A-Z])/g,Xp=/^ms-/,sa=Array.isArray;function $r(e,t){return{insertionMode:e,selectedValue:t}}function Kp(e,t,r){switch(t){case"select":return $r(1,r.value!=null?r.value:r.defaultValue);case"svg":return $r(2,null);case"math":return $r(3,null);case"foreignObject":return $r(1,null);case"table":return $r(4,null);case"thead":case"tbody":case"tfoot":return $r(5,null);case"colgroup":return $r(7,null);case"tr":return $r(6,null)}return 4<=e.insertionMode||e.insertionMode===0?$r(1,null):e}var Os=new Map;function jc(e,t,r){if(typeof r!="object")throw Error(Ce(62));t=!0;for(var n in r)if(Wt.call(r,n)){var i=r[n];if(i!=null&&typeof i!="boolean"&&i!==""){if(n.indexOf("--")===0){var o=zt(n);i=zt((""+i).trim())}else{o=n;var u=Os.get(o);u!==void 0||(u=zt(o.replace(Yp,"-$1").toLowerCase().replace(Xp,"-ms-")),Os.set(o,u)),o=u,i=typeof i=="number"?i===0||Wt.call(Eo,n)?""+i:i+"px":zt((""+i).trim())}t?(t=!1,e.push(' style="',o,":",i)):e.push(";",o,":",i)}}t||e.push('"')}function Xt(e,t,r,n){switch(r){case"style":jc(e,t,n);return;case"defaultValue":case"defaultChecked":case"innerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":return}if(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N"){if(t=Bt.hasOwnProperty(r)?Bt[r]:null,t!==null){switch(typeof n){case"function":case"symbol":return;case"boolean":if(!t.acceptsBooleans)return}switch(r=t.attributeName,t.type){case 3:n&&e.push(" ",r,'=""');break;case 4:n===!0?e.push(" ",r,'=""'):n!==!1&&e.push(" ",r,'="',zt(n),'"');break;case 5:isNaN(n)||e.push(" ",r,'="',zt(n),'"');break;case 6:!isNaN(n)&&1<=n&&e.push(" ",r,'="',zt(n),'"');break;default:t.sanitizeURL&&(n=""+n),e.push(" ",r,'="',zt(n),'"')}}else if(qc(r)){switch(typeof n){case"function":case"symbol":return;case"boolean":if(t=r.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-")return}e.push(" ",r,'="',zt(n),'"')}}}function Co(e,t,r){if(t!=null){if(r!=null)throw Error(Ce(60));if(typeof t!="object"||!("__html"in t))throw Error(Ce(61));t=t.__html,t!=null&&e.push(""+t)}}function Jp(e){var t="";return Uc.Children.forEach(e,function(r){r!=null&&(t+=r)}),t}function Nu(e,t,r,n){e.push(Fr(r));var i=r=null,o;for(o in t)if(Wt.call(t,o)){var u=t[o];if(u!=null)switch(o){case"children":r=u;break;case"dangerouslySetInnerHTML":i=u;break;default:Xt(e,n,o,u)}}return e.push(">"),Co(e,i,r),typeof r=="string"?(e.push(zt(r)),null):r}var e0=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,Rs=new Map;function Fr(e){var t=Rs.get(e);if(t===void 0){if(!e0.test(e))throw Error(Ce(65,e));t="<"+e,Rs.set(e,t)}return t}function t0(e,t,r,n,i){switch(t){case"select":e.push(Fr("select"));var o=null,u=null;for(s in r)if(Wt.call(r,s)){var l=r[s];if(l!=null)switch(s){case"children":o=l;break;case"dangerouslySetInnerHTML":u=l;break;case"defaultValue":case"value":break;default:Xt(e,n,s,l)}}return e.push(">"),Co(e,u,o),o;case"option":u=i.selectedValue,e.push(Fr("option"));var f=l=null,h=null,s=null;for(o in r)if(Wt.call(r,o)){var a=r[o];if(a!=null)switch(o){case"children":l=a;break;case"selected":h=a;break;case"dangerouslySetInnerHTML":s=a;break;case"value":f=a;default:Xt(e,n,o,a)}}if(u!=null)if(r=f!==null?""+f:Jp(l),sa(u)){for(n=0;n<u.length;n++)if(""+u[n]===r){e.push(' selected=""');break}}else""+u===r&&e.push(' selected=""');else h&&e.push(' selected=""');return e.push(">"),Co(e,s,l),l;case"textarea":e.push(Fr("textarea")),s=u=o=null;for(l in r)if(Wt.call(r,l)&&(f=r[l],f!=null))switch(l){case"children":s=f;break;case"value":o=f;break;case"defaultValue":u=f;break;case"dangerouslySetInnerHTML":throw Error(Ce(91));default:Xt(e,n,l,f)}if(o===null&&u!==null&&(o=u),e.push(">"),s!=null){if(o!=null)throw Error(Ce(92));if(sa(s)&&1<s.length)throw Error(Ce(93));o=""+s}return typeof o=="string"&&o[0]===` `&&e.push(` `),o!==null&&e.push(zt(""+o)),null;case"input":e.push(Fr("input")),f=s=l=o=null;for(u in r)if(Wt.call(r,u)&&(h=r[u],h!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(Ce(399,"input"));case"defaultChecked":f=h;break;case"defaultValue":l=h;break;case"checked":s=h;break;case"value":o=h;break;default:Xt(e,n,u,h)}return s!==null?Xt(e,n,"checked",s):f!==null&&Xt(e,n,"checked",f),o!==null?Xt(e,n,"value",o):l!==null&&Xt(e,n,"value",l),e.push("/>"),null;case"menuitem":e.push(Fr("menuitem"));for(var c in r)if(Wt.call(r,c)&&(o=r[c],o!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(Ce(400));default:Xt(e,n,c,o)}return e.push(">"),null;case"title":e.push(Fr("title")),o=null;for(a in r)if(Wt.call(r,a)&&(u=r[a],u!=null))switch(a){case"children":o=u;break;case"dangerouslySetInnerHTML":throw Error(Ce(434));default:Xt(e,n,a,u)}return e.push(">"),o;case"listing":case"pre":e.push(Fr(t)),u=o=null;for(f in r)if(Wt.call(r,f)&&(l=r[f],l!=null))switch(f){case"children":o=l;break;case"dangerouslySetInnerHTML":u=l;break;default:Xt(e,n,f,l)}if(e.push(">"),u!=null){if(o!=null)throw Error(Ce(60));if(typeof u!="object"||!("__html"in u))throw Error(Ce(61));r=u.__html,r!=null&&(typeof r=="string"&&0<r.length&&r[0]===` `?e.push(` `,r):e.push(""+r))}return typeof o=="string"&&o[0]===` `&&e.push(` `),o;case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":e.push(Fr(t));for(var p in r)if(Wt.call(r,p)&&(o=r[p],o!=null))switch(p){case"children":case"dangerouslySetInnerHTML":throw Error(Ce(399,t));default:Xt(e,n,p,o)}return e.push("/>"),null;case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return Nu(e,r,t,n);case"html":return i.insertionMode===0&&e.push("<!DOCTYPE html>"),Nu(e,r,t,n);default:if(t.indexOf("-")===-1&&typeof r.is!="string")return Nu(e,r,t,n);e.push(Fr(t)),u=o=null;for(h in r)if(Wt.call(r,h)&&(l=r[h],l!=null))switch(h){case"children":o=l;break;case"dangerouslySetInnerHTML":u=l;break;case"style":jc(e,n,l);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":break;default:qc(h)&&typeof l!="function"&&typeof l!="symbol"&&e.push(" ",h,'="',zt(l),'"')}return e.push(">"),Co(e,u,o),o}}function Ps(e,t,r){if(e.push('<!--$?--><template id="'),r===null)throw Error(Ce(395));return e.push(r),e.push('"></template>')}function r0(e,t,r,n){switch(r.insertionMode){case 0:case 1:return e.push('<div hidden id="'),e.push(t.segmentPrefix),t=n.toString(16),e.push(t),e.push('">');case 2:return e.push('<svg aria-hidden="true" style="display:none" id="'),e.push(t.segmentPrefix),t=n.toString(16),e.push(t),e.push('">');case 3:return e.push('<math aria-hidden="true" style="display:none" id="'),e.push(t.segmentPrefix),t=n.toString(16),e.push(t),e.push('">');case 4:return e.push('<table hidden id="'),e.push(t.segmentPrefix),t=n.toString(16),e.push(t),e.push('">');case 5:return e.push('<table hidden><tbody id="'),e.push(t.segmentPrefix),t=n.toString(16),e.push(t),e.push('">');case 6:return e.push('<table hidden><tr id="'),e.push(t.segmentPrefix),t=n.toString(16),e.push(t),e.push('">');case 7:return e.push('<table hidden><colgroup id="'),e.push(t.segmentPrefix),t=n.toString(16),e.push(t),e.push('">');default:throw Error(Ce(397))}}function n0(e,t){switch(t.insertionMode){case 0:case 1:return e.push("</div>");case 2:return e.push("</svg>");case 3:return e.push("</math>");case 4:return e.push("</table>");case 5:return e.push("</tbody></table>");case 6:return e.push("</tr></table>");case 7:return e.push("</colgroup></table>");default:throw Error(Ce(397))}}var i0=/[<\u2028\u2029]/g;function Bu(e){return JSON.stringify(e).replace(i0,function(t){switch(t){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}})}function o0(e,t){return t=t===void 0?"":t,{bootstrapChunks:[],startInlineScript:"<script>",placeholderPrefix:t+"P:",segmentPrefix:t+"S:",boundaryPrefix:t+"B:",idPrefix:t,nextSuspenseID:0,sentCompleteSegmentFunction:!1,sentCompleteBoundaryFunction:!1,sentClientRenderFunction:!1,generateStaticMarkup:e}}function ks(e,t,r,n){return r.generateStaticMarkup?(e.push(zt(t)),!1):(t===""?e=n:(n&&e.push("<!-- -->"),e.push(zt(t)),e=!0),e)}var Pi=Object.assign,u0=Symbol.for("react.element"),Vc=Symbol.for("react.portal"),Hc=Symbol.for("react.fragment"),Wc=Symbol.for("react.strict_mode"),Gc=Symbol.for("react.profiler"),Qc=Symbol.for("react.provider"),Zc=Symbol.for("react.context"),Yc=Symbol.for("react.forward_ref"),Xc=Symbol.for("react.suspense"),Kc=Symbol.for("react.suspense_list"),Jc=Symbol.for("react.memo"),Ia=Symbol.for("react.lazy"),a0=Symbol.for("react.scope"),s0=Symbol.for("react.debug_trace_mode"),l0=Symbol.for("react.legacy_hidden"),c0=Symbol.for("react.default_value"),Is=Symbol.iterator;function la(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Hc:return"Fragment";case Vc:return"Portal";case Gc:return"Profiler";case Wc:return"StrictMode";case Xc:return"Suspense";case Kc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Zc:return(e.displayName||"Context")+".Consumer";case Qc:return(e._context.displayName||"Context")+".Provider";case Yc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Jc:return t=e.displayName||null,t!==null?t:la(e.type)||"Memo";case Ia:t=e._payload,e=e._init;try{return la(e(t))}catch{}}return null}var ef={};function Ls(e,t){if(e=e.contextTypes,!e)return ef;var r={},n;for(n in e)r[n]=t[n];return r}var Fn=null;function ru(e,t){if(e!==t){e.context._currentValue2=e.parentValue,e=e.parent;var r=t.parent;if(e===null){if(r!==null)throw Error(Ce(401))}else{if(r===null)throw Error(Ce(401));ru(e,r)}t.context._currentValue2=t.value}}function tf(e){e.context._currentValue2=e.parentValue,e=e.parent,e!==null&&tf(e)}function rf(e){var t=e.parent;t!==null&&rf(t),e.context._currentValue2=e.value}function nf(e,t){if(e.context._currentValue2=e.parentValue,e=e.parent,e===null)throw Error(Ce(402));e.depth===t.depth?ru(e,t):nf(e,t)}function of(e,t){var r=t.parent;if(r===null)throw Error(Ce(402));e.depth===r.depth?ru(e,r):of(e,r),t.context._currentValue2=t.value}function Ro(e){var t=Fn;t!==e&&(t===null?rf(e):e===null?tf(t):t.depth===e.depth?ru(t,e):t.depth>e.depth?nf(t,e):of(t,e),Fn=e)}var zs={isMounted:function(){return!1},enqueueSetState:function(e,t){e=e._reactInternals,e.queue!==null&&e.queue.push(t)},enqueueReplaceState:function(e,t){e=e._reactInternals,e.replace=!0,e.queue=[t]},enqueueForceUpdate:function(){}};function $s(e,t,r,n){var i=e.state!==void 0?e.state:null;e.updater=zs,e.props=r,e.state=i;var o={queue:[],replace:!1};e._reactInternals=o;var u=t.contextType;if(e.context=typeof u=="object"&&u!==null?u._currentValue2:n,u=t.getDerivedStateFromProps,typeof u=="function"&&(u=u(r,i),i=u==null?i:Pi({},i,u),e.state=i),typeof t.getDerivedStateFromProps!="function"&&typeof e.getSnapshotBeforeUpdate!="function"&&(typeof e.UNSAFE_componentWillMount=="function"||typeof e.componentWillMount=="function"))if(t=e.state,typeof e.componentWillMount=="function"&&e.componentWillMount(),typeof e.UNSAFE_componentWillMount=="function"&&e.UNSAFE_componentWillMount(),t!==e.state&&zs.enqueueReplaceState(e,e.state,null),o.queue!==null&&0<o.queue.length)if(t=o.queue,u=o.replace,o.queue=null,o.replace=!1,u&&t.length===1)e.state=t[0];else{for(o=u?t[0]:e.state,i=!0,u=u?1:0;u<t.length;u++){var l=t[u];l=typeof l=="function"?l.call(e,o,r,n):l,l!=null&&(i?(i=!1,o=Pi({},o,l)):Pi(o,l))}e.state=o}else o.queue=null}var f0={id:1,overflow:""};function ca(e,t,r){var n=e.id;e=e.overflow;var i=32-Ao(n)-1;n&=~(1<<i),r+=1;var o=32-Ao(t)+i;if(30<o){var u=i-i%5;return o=(n&(1<<u)-1).toString(32),n>>=u,i-=u,{id:1<<32-Ao(t)+i|r<<i|n,overflow:o+e}}return{id:1<<o|r<<i|n,overflow:e}}var Ao=Math.clz32?Math.clz32:p0,h0=Math.log,d0=Math.LN2;function p0(e){return e>>>=0,e===0?32:31-(h0(e)/d0|0)|0}function m0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var g0=typeof Object.is=="function"?Object.is:m0,Hr=null,La=null,So=null,Ke=null,Ni=!1,Po=!1,zi=0,an=null,nu=0;function Cn(){if(Hr===null)throw Error(Ce(321));return Hr}function Us(){if(0<nu)throw Error(Ce(312));return{memoizedState:null,queue:null,next:null}}function za(){return Ke===null?So===null?(Ni=!1,So=Ke=Us()):(Ni=!0,Ke=So):Ke.next===null?(Ni=!1,Ke=Ke.next=Us()):(Ni=!0,Ke=Ke.next),Ke}function $a(){La=Hr=null,Po=!1,So=null,nu=0,Ke=an=null}function uf(e,t){return typeof t=="function"?t(e):t}function qs(e,t,r){if(Hr=Cn(),Ke=za(),Ni){var n=Ke.queue;if(t=n.dispatch,an!==null&&(r=an.get(n),r!==void 0)){an.delete(n),n=Ke.memoizedState;do n=e(n,r.action),r=r.next;while(r!==null);return Ke.memoizedState=n,[n,t]}return[Ke.memoizedState,t]}return e=e===uf?typeof t=="function"?t():t:r!==void 0?r(t):t,Ke.memoizedState=e,e=Ke.queue={last:null,dispatch:null},e=e.dispatch=v0.bind(null,Hr,e),[Ke.memoizedState,e]}function js(e,t){if(Hr=Cn(),Ke=za(),t=t===void 0?null:t,Ke!==null){var r=Ke.memoizedState;if(r!==null&&t!==null){var n=r[1];e:if(n===null)n=!1;else{for(var i=0;i<n.length&&i<t.length;i++)if(!g0(t[i],n[i])){n=!1;break e}n=!0}if(n)return r[0]}}return e=e(),Ke.memoizedState=[e,t],e}function v0(e,t,r){if(25<=nu)throw Error(Ce(301));if(e===Hr)if(Po=!0,e={action:r,next:null},an===null&&(an=new Map),r=an.get(t),r===void 0)an.set(t,e);else{for(t=r;t.next!==null;)t=t.next;t.next=e}}function D0(){throw Error(Ce(394))}function ho(){}var Vs={readContext:function(e){return e._currentValue2},useContext:function(e){return Cn(),e._currentValue2},useMemo:js,useReducer:qs,useRef:function(e){Hr=Cn(),Ke=za();var t=Ke.memoizedState;return t===null?(e={current:e},Ke.memoizedState=e):t},useState:function(e){return qs(uf,e)},useInsertionEffect:ho,useLayoutEffect:function(){},useCallback:function(e,t){return js(function(){return e},t)},useImperativeHandle:ho,useEffect:ho,useDebugValue:ho,useDeferredValue:function(e){return Cn(),e},useTransition:function(){return Cn(),[!1,D0]},useId:function(){var e=La.treeContext,t=e.overflow;e=e.id,e=(e&~(1<<32-Ao(e)-1)).toString(32)+t;var r=Fo;if(r===null)throw Error(Ce(404));return t=zi++,e=":"+r.idPrefix+"R"+e,0<t&&(e+="H"+t.toString(32)),e+":"},useMutableSource:function(e,t){return Cn(),t(e._source)},useSyncExternalStore:function(e,t,r){if(r===void 0)throw Error(Ce(407));return r()}},Fo=null,Ou=Uc.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;function y0(e){return console.error(e),null}function Bi(){}function w0(e,t,r,n,i,o,u,l,f){var h=[],s=new Set;return t={destination:null,responseState:t,progressiveChunkSize:n===void 0?12800:n,status:0,fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,completedRootSegment:null,abortableTasks:s,pingedTasks:h,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],onError:i===void 0?y0:i,onAllReady:o===void 0?Bi:o,onShellReady:u===void 0?Bi:u,onShellError:l===void 0?Bi:l,onFatalError:f===void 0?Bi:f},r=ko(t,0,null,r,!1,!1),r.parentFlushed=!0,e=Ua(t,e,null,r,s,ef,null,f0),h.push(e),t}function Ua(e,t,r,n,i,o,u,l){e.allPendingTasks++,r===null?e.pendingRootTasks++:r.pendingTasks++;var f={node:t,ping:function(){var h=e.pingedTasks;h.push(f),h.length===1&&lf(e)},blockedBoundary:r,blockedSegment:n,abortSet:i,legacyContext:o,context:u,treeContext:l};return i.add(f),f}function ko(e,t,r,n,i,o){return{status:0,id:-1,index:t,parentFlushed:!1,chunks:[],children:[],formatContext:n,boundary:r,lastPushedText:i,textEmbedded:o}}function $i(e,t){if(e=e.onError(t),e!=null&&typeof e!="string")throw Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "'+typeof e+'" instead');return e}function Io(e,t){var r=e.onShellError;r(t),r=e.onFatalError,r(t),e.destination!==null?(e.status=2,e.destination.destroy(t)):(e.status=1,e.fatalError=t)}function Hs(e,t,r,n,i){for(Hr={},La=t,zi=0,e=r(n,i);Po;)Po=!1,zi=0,nu+=1,Ke=null,e=r(n,i);return $a(),e}function Ws(e,t,r,n){var i=r.render(),o=n.childContextTypes;if(o!=null){var u=t.legacyContext;if(typeof r.getChildContext!="function")n=u;else{r=r.getChildContext();for(var l in r)if(!(l in o))throw Error(Ce(108,la(n)||"Unknown",l));n=Pi({},u,r)}t.legacyContext=n,er(e,t,i),t.legacyContext=u}else er(e,t,i)}function Gs(e,t){if(e&&e.defaultProps){t=Pi({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function fa(e,t,r,n,i){if(typeof r=="function")if(r.prototype&&r.prototype.isReactComponent){i=Ls(r,t.legacyContext);var o=r.contextType;o=new r(n,typeof o=="object"&&o!==null?o._currentValue2:i),$s(o,r,n,i),Ws(e,t,o,r)}else{o=Ls(r,t.legacyContext),i=Hs(e,t,r,n,o);var u=zi!==0;if(typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0)$s(i,r,n,o),Ws(e,t,i,r);else if(u){n=t.treeContext,t.treeContext=ca(n,1,0);try{er(e,t,i)}finally{t.treeContext=n}}else er(e,t,i)}else if(typeof r=="string"){switch(i=t.blockedSegment,o=t0(i.chunks,r,n,e.responseState,i.formatContext),i.lastPushedText=!1,u=i.formatContext,i.formatContext=Kp(u,r,n),ha(e,t,o),i.formatContext=u,r){case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"input":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":break;default:i.chunks.push("</",r,">")}i.lastPushedText=!1}else{switch(r){case l0:case s0:case Wc:case Gc:case Hc:er(e,t,n.children);return;case Kc:er(e,t,n.children);return;case a0:throw Error(Ce(343));case Xc:e:{r=t.blockedBoundary,i=t.blockedSegment,o=n.fallback,n=n.children,u=new Set;var l={id:null,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:u,errorDigest:null},f=ko(e,i.chunks.length,l,i.formatContext,!1,!1);i.children.push(f),i.lastPushedText=!1;var h=ko(e,0,null,i.formatContext,!1,!1);h.parentFlushed=!0,t.blockedBoundary=l,t.blockedSegment=h;try{if(ha(e,t,n),e.responseState.generateStaticMarkup||h.lastPushedText&&h.textEmbedded&&h.chunks.push("<!-- -->"),h.status=1,Lo(l,h),l.pendingTasks===0)break e}catch(s){h.status=4,l.forceClientRender=!0,l.errorDigest=$i(e,s)}finally{t.blockedBoundary=r,t.blockedSegment=i}t=Ua(e,o,r,f,u,t.legacyContext,t.context,t.treeContext),e.pingedTasks.push(t)}return}if(typeof r=="object"&&r!==null)switch(r.$$typeof){case Yc:if(n=Hs(e,t,r.render,n,i),zi!==0){r=t.treeContext,t.treeContext=ca(r,1,0);try{er(e,t,n)}finally{t.treeContext=r}}else er(e,t,n);return;case Jc:r=r.type,n=Gs(r,n),fa(e,t,r,n,i);return;case Qc:if(i=n.children,r=r._context,n=n.value,o=r._currentValue2,r._currentValue2=n,u=Fn,Fn=n={parent:u,depth:u===null?0:u.depth+1,context:r,parentValue:o,value:n},t.context=n,er(e,t,i),e=Fn,e===null)throw Error(Ce(403));n=e.parentValue,e.context._currentValue2=n===c0?e.context._defaultValue:n,e=Fn=e.parent,t.context=e;return;case Zc:n=n.children,n=n(r._currentValue2),er(e,t,n);return;case Ia:i=r._init,r=i(r._payload),n=Gs(r,n),fa(e,t,r,n,void 0);return}throw Error(Ce(130,r==null?r:typeof r,""))}}function er(e,t,r){if(t.node=r,typeof r=="object"&&r!==null){switch(r.$$typeof){case u0:fa(e,t,r.type,r.props,r.ref);return;case Vc:throw Error(Ce(257));case Ia:var n=r._init;r=n(r._payload),er(e,t,r);return}if(sa(r)){Qs(e,t,r);return}if(r===null||typeof r!="object"?n=null:(n=Is&&r[Is]||r["@@iterator"],n=typeof n=="function"?n:null),n&&(n=n.call(r))){if(r=n.next(),!r.done){var i=[];do i.push(r.value),r=n.next();while(!r.done);Qs(e,t,i)}return}throw e=Object.prototype.toString.call(r),Error(Ce(31,e==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":e))}typeof r=="string"?(n=t.blockedSegment,n.lastPushedText=ks(t.blockedSegment.chunks,r,e.responseState,n.lastPushedText)):typeof r=="number"&&(n=t.blockedSegment,n.lastPushedText=ks(t.blockedSegment.chunks,""+r,e.responseState,n.lastPushedText))}function Qs(e,t,r){for(var n=r.length,i=0;i<n;i++){var o=t.treeContext;t.treeContext=ca(o,n,i);try{ha(e,t,r[i])}finally{t.treeContext=o}}}function ha(e,t,r){var n=t.blockedSegment.formatContext,i=t.legacyContext,o=t.context;try{return er(e,t,r)}catch(f){if($a(),typeof f=="object"&&f!==null&&typeof f.then=="function"){r=f;var u=t.blockedSegment,l=ko(e,u.chunks.length,null,u.formatContext,u.lastPushedText,!0);u.children.push(l),u.lastPushedText=!1,e=Ua(e,t.node,t.blockedBoundary,l,t.abortSet,t.legacyContext,t.context,t.treeContext).ping,r.then(e,e),t.blockedSegment.formatContext=n,t.legacyContext=i,t.context=o,Ro(o)}else throw t.blockedSegment.formatContext=n,t.legacyContext=i,t.context=o,Ro(o),f}}function E0(e){var t=e.blockedBoundary;e=e.blockedSegment,e.status=3,sf(this,t,e)}function af(e,t,r){var n=e.blockedBoundary;e.blockedSegment.status=3,n===null?(t.allPendingTasks--,t.status!==2&&(t.status=2,t.destination!==null&&t.destination.push(null))):(n.pendingTasks--,n.forceClientRender||(n.forceClientRender=!0,e=r===void 0?Error(Ce(432)):r,n.errorDigest=t.onError(e),n.parentFlushed&&t.clientRenderedBoundaries.push(n)),n.fallbackAbortableTasks.forEach(function(i){return af(i,t,r)}),n.fallbackAbortableTasks.clear(),t.allPendingTasks--,t.allPendingTasks===0&&(n=t.onAllReady,n()))}function Lo(e,t){if(t.chunks.length===0&&t.children.length===1&&t.children[0].boundary===null){var r=t.children[0];r.id=t.id,r.parentFlushed=!0,r.status===1&&Lo(e,r)}else e.completedSegments.push(t)}function sf(e,t,r){if(t===null){if(r.parentFlushed){if(e.completedRootSegment!==null)throw Error(Ce(389));e.completedRootSegment=r}e.pendingRootTasks--,e.pendingRootTasks===0&&(e.onShellError=Bi,t=e.onShellReady,t())}else t.pendingTasks--,t.forceClientRender||(t.pendingTasks===0?(r.parentFlushed&&r.status===1&&Lo(t,r),t.parentFlushed&&e.completedBoundaries.push(t),t.fallbackAbortableTasks.forEach(E0,e),t.fallbackAbortableTasks.clear()):r.parentFlushed&&r.status===1&&(Lo(t,r),t.completedSegments.length===1&&t.parentFlushed&&e.partialBoundaries.push(t)));e.allPendingTasks--,e.allPendingTasks===0&&(e=e.onAllReady,e())}function lf(e){if(e.status!==2){var t=Fn,r=Ou.current;Ou.current=Vs;var n=Fo;Fo=e.responseState;try{var i=e.pingedTasks,o;for(o=0;o<i.length;o++){var u=i[o],l=e,f=u.blockedSegment;if(f.status===0){Ro(u.context);try{er(l,u,u.node),l.responseState.generateStaticMarkup||f.lastPushedText&&f.textEmbedded&&f.chunks.push("<!-- -->"),u.abortSet.delete(u),f.status=1,sf(l,u.blockedBoundary,f)}catch(D){if($a(),typeof D=="object"&&D!==null&&typeof D.then=="function"){var h=u.ping;D.then(h,h)}else{u.abortSet.delete(u),f.status=4;var s=u.blockedBoundary,a=D,c=$i(l,a);if(s===null?Io(l,a):(s.pendingTasks--,s.forceClientRender||(s.forceClientRender=!0,s.errorDigest=c,s.parentFlushed&&l.clientRenderedBoundaries.push(s))),l.allPendingTasks--,l.allPendingTasks===0){var p=l.onAllReady;p()}}}finally{}}}i.splice(0,o),e.destination!==null&&qa(e,e.destination)}catch(D){$i(e,D),Io(e,D)}finally{Fo=n,Ou.current=r,r===Vs&&Ro(t)}}}function po(e,t,r){switch(r.parentFlushed=!0,r.status){case 0:var n=r.id=e.nextSegmentId++;return r.lastPushedText=!1,r.textEmbedded=!1,e=e.responseState,t.push('<template id="'),t.push(e.placeholderPrefix),e=n.toString(16),t.push(e),t.push('"></template>');case 1:r.status=2;var i=!0;n=r.chunks;var o=0;r=r.children;for(var u=0;u<r.length;u++){for(i=r[u];o<i.index;o++)t.push(n[o]);i=iu(e,t,i)}for(;o<n.length-1;o++)t.push(n[o]);return o<n.length&&(i=t.push(n[o])),i;default:throw Error(Ce(390))}}function iu(e,t,r){var n=r.boundary;if(n===null)return po(e,t,r);if(n.parentFlushed=!0,n.forceClientRender)return e.responseState.generateStaticMarkup||(n=n.errorDigest,t.push("<!--$!-->"),t.push("<template"),n&&(t.push(' data-dgst="'),n=zt(n),t.push(n),t.push('"')),t.push("></template>")),po(e,t,r),e=e.responseState.generateStaticMarkup?!0:t.push("<!--/$-->"),e;if(0<n.pendingTasks){n.rootSegmentID=e.nextSegmentId++,0<n.completedSegments.length&&e.partialBoundaries.push(n);var i=e.responseState,o=i.nextSuspenseID++;return i=i.boundaryPrefix+o.toString(16),n=n.id=i,Ps(t,e.responseState,n),po(e,t,r),t.push("<!--/$-->")}if(n.byteSize>e.progressiveChunkSize)return n.rootSegmentID=e.nextSegmentId++,e.completedBoundaries.push(n),Ps(t,e.responseState,n.id),po(e,t,r),t.push("<!--/$-->");if(e.responseState.generateStaticMarkup||t.push("<!--$-->"),r=n.completedSegments,r.length!==1)throw Error(Ce(391));return iu(e,t,r[0]),e=e.responseState.generateStaticMarkup?!0:t.push("<!--/$-->"),e}function Zs(e,t,r){return r0(t,e.responseState,r.formatContext,r.id),iu(e,t,r),n0(t,r.formatContext)}function Ys(e,t,r){for(var n=r.completedSegments,i=0;i<n.length;i++)cf(e,t,r,n[i]);if(n.length=0,e=e.responseState,n=r.id,r=r.rootSegmentID,t.push(e.startInlineScript),e.sentCompleteBoundaryFunction?t.push('$RC("'):(e.sentCompleteBoundaryFunction=!0,t.push('function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("')),n===null)throw Error(Ce(395));return r=r.toString(16),t.push(n),t.push('","'),t.push(e.segmentPrefix),t.push(r),t.push('")<\/script>')}function cf(e,t,r,n){if(n.status===2)return!0;var i=n.id;if(i===-1){if((n.id=r.rootSegmentID)===-1)throw Error(Ce(392));return Zs(e,t,n)}return Zs(e,t,n),e=e.responseState,t.push(e.startInlineScript),e.sentCompleteSegmentFunction?t.push('$RS("'):(e.sentCompleteSegmentFunction=!0,t.push('function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("')),t.push(e.segmentPrefix),i=i.toString(16),t.push(i),t.push('","'),t.push(e.placeholderPrefix),t.push(i),t.push('")<\/script>')}function qa(e,t){try{var r=e.completedRootSegment;if(r!==null&&e.pendingRootTasks===0){iu(e,t,r),e.completedRootSegment=null;var n=e.responseState.bootstrapChunks;for(r=0;r<n.length-1;r++)t.push(n[r]);r<n.length&&t.push(n[r])}var i=e.clientRenderedBoundaries,o;for(o=0;o<i.length;o++){var u=i[o];n=t;var l=e.responseState,f=u.id,h=u.errorDigest,s=u.errorMessage,a=u.errorComponentStack;if(n.push(l.startInlineScript),l.sentClientRenderFunction?n.push('$RX("'):(l.sentClientRenderFunction=!0,n.push('function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("')),f===null)throw Error(Ce(395));if(n.push(f),n.push('"'),h||s||a){n.push(",");var c=Bu(h||"");n.push(c)}if(s||a){n.push(",");var p=Bu(s||"");n.push(p)}if(a){n.push(",");var D=Bu(a);n.push(D)}if(!n.push(")<\/script>")){e.destination=null,o++,i.splice(0,o);return}}i.splice(0,o);var d=e.completedBoundaries;for(o=0;o<d.length;o++)if(!Ys(e,t,d[o])){e.destination=null,o++,d.splice(0,o);return}d.splice(0,o);var g=e.partialBoundaries;for(o=0;o<g.length;o++){var m=g[o];e:{i=e,u=t;var y=m.completedSegments;for(l=0;l<y.length;l++)if(!cf(i,u,m,y[l])){l++,y.splice(0,l);var v=!1;break e}y.splice(0,l),v=!0}if(!v){e.destination=null,o++,g.splice(0,o);return}}g.splice(0,o);var w=e.completedBoundaries;for(o=0;o<w.length;o++)if(!Ys(e,t,w[o])){e.destination=null,o++,w.splice(0,o);return}w.splice(0,o)}finally{e.allPendingTasks===0&&e.pingedTasks.length===0&&e.clientRenderedBoundaries.length===0&&e.completedBoundaries.length===0&&t.push(null)}}function C0(e,t){try{var r=e.abortableTasks;r.forEach(function(n){return af(n,e,t)}),r.clear(),e.destination!==null&&qa(e,e.destination)}catch(n){$i(e,n),Io(e,n)}}function A0(){}function ff(e,t,r,n){var i=!1,o=null,u="",l={push:function(h){return h!==null&&(u+=h),!0},destroy:function(h){i=!0,o=h}},f=!1;if(e=w0(e,o0(r,t?t.identifierPrefix:void 0),{insertionMode:1,selectedValue:null},1/0,A0,void 0,function(){f=!0},void 0,void 0),lf(e),C0(e,n),e.status===1)e.status=2,l.destroy(e.fatalError);else if(e.status!==2&&e.destination===null){e.destination=l;try{qa(e,l)}catch(h){$i(e,h),Io(e,h)}}if(i)throw o;if(!f)throw Error(Ce(426));return u}Di.renderToNodeStream=function(){throw Error(Ce(207))};Di.renderToStaticMarkup=function(e,t){return ff(e,t,!0,'The server used "renderToStaticMarkup" which does not support Suspense. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server')};Di.renderToStaticNodeStream=function(){throw Error(Ce(208))};Di.renderToString=function(e,t){return ff(e,t,!1,'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server')};Di.version="18.3.1";var ja={};/** * @license React * react-dom-server.browser.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var hf=Z;function be(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var tr=null,rr=0;function se(e,t){if(t.length!==0)if(512<t.length)0<rr&&(e.enqueue(new Uint8Array(tr.buffer,0,rr)),tr=new Uint8Array(512),rr=0),e.enqueue(t);else{var r=tr.length-rr;r<t.length&&(r===0?e.enqueue(tr):(tr.set(t.subarray(0,r),rr),e.enqueue(tr),t=t.subarray(r)),tr=new Uint8Array(512),rr=0),tr.set(t,rr),rr+=t.length}}function it(e,t){return se(e,t),!0}function Xs(e){tr&&0<rr&&(e.enqueue(new Uint8Array(tr.buffer,0,rr)),tr=null,rr=0)}var df=new TextEncoder;function Te(e){return df.encode(e)}function K(e){return df.encode(e)}function pf(e,t){typeof e.error=="function"?e.error(t):e.close()}var Gt=Object.prototype.hasOwnProperty,S0=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Ks={},Js={};function mf(e){return Gt.call(Js,e)?!0:Gt.call(Ks,e)?!1:S0.test(e)?Js[e]=!0:(Ks[e]=!0,!1)}function jt(e,t,r,n,i,o,u){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=u}var Ot={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ot[e]=new jt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ot[t]=new jt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ot[e]=new jt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ot[e]=new jt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ot[e]=new jt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ot[e]=new jt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ot[e]=new jt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ot[e]=new jt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ot[e]=new jt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Va=/[\-:]([a-z])/g;function Ha(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Va,Ha);Ot[t]=new jt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Va,Ha);Ot[t]=new jt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Va,Ha);Ot[t]=new jt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ot[e]=new jt(e,1,!1,e.toLowerCase(),null,!1,!1)});Ot.xlinkHref=new jt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ot[e]=new jt(e,1,!1,e.toLowerCase(),null,!0,!0)});var bo={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},F0=["Webkit","ms","Moz","O"];Object.keys(bo).forEach(function(e){F0.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),bo[t]=bo[e]})});var b0=/["'&<>]/;function Mt(e){if(typeof e=="boolean"||typeof e=="number")return""+e;e=""+e;var t=b0.exec(e);if(t){var r="",n,i=0;for(n=t.index;n<e.length;n++){switch(e.charCodeAt(n)){case 34:t="&quot;";break;case 38:t="&amp;";break;case 39:t="&#x27;";break;case 60:t="&lt;";break;case 62:t="&gt;";break;default:continue}i!==n&&(r+=e.substring(i,n)),i=n+1,r+=t}e=i!==n?r+e.substring(i,n):r}return e}var x0=/([A-Z])/g,T0=/^ms-/,da=Array.isArray,_0=K("<script>"),M0=K("<\/script>"),N0=K('<script src="'),B0=K('<script type="module" src="'),el=K('" async=""><\/script>'),O0=/(<\/|<)(s)(cript)/gi;function R0(e,t,r,n){return""+t+(r==="s"?"\\u0073":"\\u0053")+n}function P0(e,t,r,n,i){e=e===void 0?"":e,t=t===void 0?_0:K('<script nonce="'+Mt(t)+'">');var o=[];if(r!==void 0&&o.push(t,Te((""+r).replace(O0,R0)),M0),n!==void 0)for(r=0;r<n.length;r++)o.push(N0,Te(Mt(n[r])),el);if(i!==void 0)for(n=0;n<i.length;n++)o.push(B0,Te(Mt(i[n])),el);return{bootstrapChunks:o,startInlineScript:t,placeholderPrefix:K(e+"P:"),segmentPrefix:K(e+"S:"),boundaryPrefix:e+"B:",idPrefix:e,nextSuspenseID:0,sentCompleteSegmentFunction:!1,sentCompleteBoundaryFunction:!1,sentClientRenderFunction:!1}}function br(e,t){return{insertionMode:e,selectedValue:t}}function k0(e){return br(e==="http://www.w3.org/2000/svg"?2:e==="http://www.w3.org/1998/Math/MathML"?3:0,null)}function I0(e,t,r){switch(t){case"select":return br(1,r.value!=null?r.value:r.defaultValue);case"svg":return br(2,null);case"math":return br(3,null);case"foreignObject":return br(1,null);case"table":return br(4,null);case"thead":case"tbody":case"tfoot":return br(5,null);case"colgroup":return br(7,null);case"tr":return br(6,null)}return 4<=e.insertionMode||e.insertionMode===0?br(1,null):e}var Wa=K("<!-- -->");function tl(e,t,r,n){return t===""?n:(n&&e.push(Wa),e.push(Te(Mt(t))),!0)}var rl=new Map,L0=K(' style="'),nl=K(":"),z0=K(";");function gf(e,t,r){if(typeof r!="object")throw Error(be(62));t=!0;for(var n in r)if(Gt.call(r,n)){var i=r[n];if(i!=null&&typeof i!="boolean"&&i!==""){if(n.indexOf("--")===0){var o=Te(Mt(n));i=Te(Mt((""+i).trim()))}else{o=n;var u=rl.get(o);u!==void 0||(u=K(Mt(o.replace(x0,"-$1").toLowerCase().replace(T0,"-ms-"))),rl.set(o,u)),o=u,i=typeof i=="number"?i===0||Gt.call(bo,n)?Te(""+i):Te(i+"px"):Te(Mt((""+i).trim()))}t?(t=!1,e.push(L0,o,nl,i)):e.push(z0,o,nl,i)}}t||e.push(An)}var Xr=K(" "),Gn=K('="'),An=K('"'),il=K('=""');function Kt(e,t,r,n){switch(r){case"style":gf(e,t,n);return;case"defaultValue":case"defaultChecked":case"innerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":return}if(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N"){if(t=Ot.hasOwnProperty(r)?Ot[r]:null,t!==null){switch(typeof n){case"function":case"symbol":return;case"boolean":if(!t.acceptsBooleans)return}switch(r=Te(t.attributeName),t.type){case 3:n&&e.push(Xr,r,il);break;case 4:n===!0?e.push(Xr,r,il):n!==!1&&e.push(Xr,r,Gn,Te(Mt(n)),An);break;case 5:isNaN(n)||e.push(Xr,r,Gn,Te(Mt(n)),An);break;case 6:!isNaN(n)&&1<=n&&e.push(Xr,r,Gn,Te(Mt(n)),An);break;default:t.sanitizeURL&&(n=""+n),e.push(Xr,r,Gn,Te(Mt(n)),An)}}else if(mf(r)){switch(typeof n){case"function":case"symbol":return;case"boolean":if(t=r.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-")return}e.push(Xr,Te(r),Gn,Te(Mt(n)),An)}}}var Kr=K(">"),ol=K("/>");function xo(e,t,r){if(t!=null){if(r!=null)throw Error(be(60));if(typeof t!="object"||!("__html"in t))throw Error(be(61));t=t.__html,t!=null&&e.push(Te(""+t))}}function $0(e){var t="";return hf.Children.forEach(e,function(r){r!=null&&(t+=r)}),t}var Ru=K(' selected=""');function Pu(e,t,r,n){e.push(xr(r));var i=r=null,o;for(o in t)if(Gt.call(t,o)){var u=t[o];if(u!=null)switch(o){case"children":r=u;break;case"dangerouslySetInnerHTML":i=u;break;default:Kt(e,n,o,u)}}return e.push(Kr),xo(e,i,r),typeof r=="string"?(e.push(Te(Mt(r))),null):r}var ku=K(` `),U0=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,ul=new Map;function xr(e){var t=ul.get(e);if(t===void 0){if(!U0.test(e))throw Error(be(65,e));t=K("<"+e),ul.set(e,t)}return t}var q0=K("<!DOCTYPE html>");function j0(e,t,r,n,i){switch(t){case"select":e.push(xr("select"));var o=null,u=null;for(s in r)if(Gt.call(r,s)){var l=r[s];if(l!=null)switch(s){case"children":o=l;break;case"dangerouslySetInnerHTML":u=l;break;case"defaultValue":case"value":break;default:Kt(e,n,s,l)}}return e.push(Kr),xo(e,u,o),o;case"option":u=i.selectedValue,e.push(xr("option"));var f=l=null,h=null,s=null;for(o in r)if(Gt.call(r,o)){var a=r[o];if(a!=null)switch(o){case"children":l=a;break;case"selected":h=a;break;case"dangerouslySetInnerHTML":s=a;break;case"value":f=a;default:Kt(e,n,o,a)}}if(u!=null)if(r=f!==null?""+f:$0(l),da(u)){for(n=0;n<u.length;n++)if(""+u[n]===r){e.push(Ru);break}}else""+u===r&&e.push(Ru);else h&&e.push(Ru);return e.push(Kr),xo(e,s,l),l;case"textarea":e.push(xr("textarea")),s=u=o=null;for(l in r)if(Gt.call(r,l)&&(f=r[l],f!=null))switch(l){case"children":s=f;break;case"value":o=f;break;case"defaultValue":u=f;break;case"dangerouslySetInnerHTML":throw Error(be(91));default:Kt(e,n,l,f)}if(o===null&&u!==null&&(o=u),e.push(Kr),s!=null){if(o!=null)throw Error(be(92));if(da(s)&&1<s.length)throw Error(be(93));o=""+s}return typeof o=="string"&&o[0]===` `&&e.push(ku),o!==null&&e.push(Te(Mt(""+o))),null;case"input":e.push(xr("input")),f=s=l=o=null;for(u in r)if(Gt.call(r,u)&&(h=r[u],h!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(be(399,"input"));case"defaultChecked":f=h;break;case"defaultValue":l=h;break;case"checked":s=h;break;case"value":o=h;break;default:Kt(e,n,u,h)}return s!==null?Kt(e,n,"checked",s):f!==null&&Kt(e,n,"checked",f),o!==null?Kt(e,n,"value",o):l!==null&&Kt(e,n,"value",l),e.push(ol),null;case"menuitem":e.push(xr("menuitem"));for(var c in r)if(Gt.call(r,c)&&(o=r[c],o!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(be(400));default:Kt(e,n,c,o)}return e.push(Kr),null;case"title":e.push(xr("title")),o=null;for(a in r)if(Gt.call(r,a)&&(u=r[a],u!=null))switch(a){case"children":o=u;break;case"dangerouslySetInnerHTML":throw Error(be(434));default:Kt(e,n,a,u)}return e.push(Kr),o;case"listing":case"pre":e.push(xr(t)),u=o=null;for(f in r)if(Gt.call(r,f)&&(l=r[f],l!=null))switch(f){case"children":o=l;break;case"dangerouslySetInnerHTML":u=l;break;default:Kt(e,n,f,l)}if(e.push(Kr),u!=null){if(o!=null)throw Error(be(60));if(typeof u!="object"||!("__html"in u))throw Error(be(61));r=u.__html,r!=null&&(typeof r=="string"&&0<r.length&&r[0]===` `?e.push(ku,Te(r)):e.push(Te(""+r)))}return typeof o=="string"&&o[0]===` `&&e.push(ku),o;case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":e.push(xr(t));for(var p in r)if(Gt.call(r,p)&&(o=r[p],o!=null))switch(p){case"children":case"dangerouslySetInnerHTML":throw Error(be(399,t));default:Kt(e,n,p,o)}return e.push(ol),null;case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return Pu(e,r,t,n);case"html":return i.insertionMode===0&&e.push(q0),Pu(e,r,t,n);default:if(t.indexOf("-")===-1&&typeof r.is!="string")return Pu(e,r,t,n);e.push(xr(t)),u=o=null;for(h in r)if(Gt.call(r,h)&&(l=r[h],l!=null))switch(h){case"children":o=l;break;case"dangerouslySetInnerHTML":u=l;break;case"style":gf(e,n,l);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":break;default:mf(h)&&typeof l!="function"&&typeof l!="symbol"&&e.push(Xr,Te(h),Gn,Te(Mt(l)),An)}return e.push(Kr),xo(e,u,o),o}}var V0=K("</"),H0=K(">"),W0=K('<template id="'),G0=K('"></template>'),Q0=K("<!--$-->"),Z0=K('<!--$?--><template id="'),Y0=K('"></template>'),X0=K("<!--$!-->"),K0=K("<!--/$-->"),J0=K("<template"),em=K('"'),tm=K(' data-dgst="');K(' data-msg="');K(' data-stck="');var rm=K("></template>");function al(e,t,r){if(se(e,Z0),r===null)throw Error(be(395));return se(e,r),it(e,Y0)}var nm=K('<div hidden id="'),im=K('">'),om=K("</div>"),um=K('<svg aria-hidden="true" style="display:none" id="'),am=K('">'),sm=K("</svg>"),lm=K('<math aria-hidden="true" style="display:none" id="'),cm=K('">'),fm=K("</math>"),hm=K('<table hidden id="'),dm=K('">'),pm=K("</table>"),mm=K('<table hidden><tbody id="'),gm=K('">'),vm=K("</tbody></table>"),Dm=K('<table hidden><tr id="'),ym=K('">'),wm=K("</tr></table>"),Em=K('<table hidden><colgroup id="'),Cm=K('">'),Am=K("</colgroup></table>");function Sm(e,t,r,n){switch(r.insertionMode){case 0:case 1:return se(e,nm),se(e,t.segmentPrefix),se(e,Te(n.toString(16))),it(e,im);case 2:return se(e,um),se(e,t.segmentPrefix),se(e,Te(n.toString(16))),it(e,am);case 3:return se(e,lm),se(e,t.segmentPrefix),se(e,Te(n.toString(16))),it(e,cm);case 4:return se(e,hm),se(e,t.segmentPrefix),se(e,Te(n.toString(16))),it(e,dm);case 5:return se(e,mm),se(e,t.segmentPrefix),se(e,Te(n.toString(16))),it(e,gm);case 6:return se(e,Dm),se(e,t.segmentPrefix),se(e,Te(n.toString(16))),it(e,ym);case 7:return se(e,Em),se(e,t.segmentPrefix),se(e,Te(n.toString(16))),it(e,Cm);default:throw Error(be(397))}}function Fm(e,t){switch(t.insertionMode){case 0:case 1:return it(e,om);case 2:return it(e,sm);case 3:return it(e,fm);case 4:return it(e,pm);case 5:return it(e,vm);case 6:return it(e,wm);case 7:return it(e,Am);default:throw Error(be(397))}}var bm=K('function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("'),xm=K('$RS("'),Tm=K('","'),_m=K('")<\/script>'),Mm=K('function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("'),Nm=K('$RC("'),Bm=K('","'),Om=K('")<\/script>'),Rm=K('function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("'),Pm=K('$RX("'),km=K('"'),Im=K(")<\/script>"),Iu=K(","),Lm=/[<\u2028\u2029]/g;function Lu(e){return JSON.stringify(e).replace(Lm,function(t){switch(t){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}})}var ki=Object.assign,zm=Symbol.for("react.element"),vf=Symbol.for("react.portal"),Df=Symbol.for("react.fragment"),yf=Symbol.for("react.strict_mode"),wf=Symbol.for("react.profiler"),Ef=Symbol.for("react.provider"),Cf=Symbol.for("react.context"),Af=Symbol.for("react.forward_ref"),Sf=Symbol.for("react.suspense"),Ff=Symbol.for("react.suspense_list"),bf=Symbol.for("react.memo"),Ga=Symbol.for("react.lazy"),$m=Symbol.for("react.scope"),Um=Symbol.for("react.debug_trace_mode"),qm=Symbol.for("react.legacy_hidden"),jm=Symbol.for("react.default_value"),sl=Symbol.iterator;function pa(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Df:return"Fragment";case vf:return"Portal";case wf:return"Profiler";case yf:return"StrictMode";case Sf:return"Suspense";case Ff:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Cf:return(e.displayName||"Context")+".Consumer";case Ef:return(e._context.displayName||"Context")+".Provider";case Af:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case bf:return t=e.displayName||null,t!==null?t:pa(e.type)||"Memo";case Ga:t=e._payload,e=e._init;try{return pa(e(t))}catch{}}return null}var xf={};function ll(e,t){if(e=e.contextTypes,!e)return xf;var r={},n;for(n in e)r[n]=t[n];return r}var bn=null;function ou(e,t){if(e!==t){e.context._currentValue=e.parentValue,e=e.parent;var r=t.parent;if(e===null){if(r!==null)throw Error(be(401))}else{if(r===null)throw Error(be(401));ou(e,r)}t.context._currentValue=t.value}}function Tf(e){e.context._currentValue=e.parentValue,e=e.parent,e!==null&&Tf(e)}function _f(e){var t=e.parent;t!==null&&_f(t),e.context._currentValue=e.value}function Mf(e,t){if(e.context._currentValue=e.parentValue,e=e.parent,e===null)throw Error(be(402));e.depth===t.depth?ou(e,t):Mf(e,t)}function Nf(e,t){var r=t.parent;if(r===null)throw Error(be(402));e.depth===r.depth?ou(e,r):Nf(e,r),t.context._currentValue=t.value}function zo(e){var t=bn;t!==e&&(t===null?_f(e):e===null?Tf(t):t.depth===e.depth?ou(t,e):t.depth>e.depth?Mf(t,e):Nf(t,e),bn=e)}var cl={isMounted:function(){return!1},enqueueSetState:function(e,t){e=e._reactInternals,e.queue!==null&&e.queue.push(t)},enqueueReplaceState:function(e,t){e=e._reactInternals,e.replace=!0,e.queue=[t]},enqueueForceUpdate:function(){}};function fl(e,t,r,n){var i=e.state!==void 0?e.state:null;e.updater=cl,e.props=r,e.state=i;var o={queue:[],replace:!1};e._reactInternals=o;var u=t.contextType;if(e.context=typeof u=="object"&&u!==null?u._currentValue:n,u=t.getDerivedStateFromProps,typeof u=="function"&&(u=u(r,i),i=u==null?i:ki({},i,u),e.state=i),typeof t.getDerivedStateFromProps!="function"&&typeof e.getSnapshotBeforeUpdate!="function"&&(typeof e.UNSAFE_componentWillMount=="function"||typeof e.componentWillMount=="function"))if(t=e.state,typeof e.componentWillMount=="function"&&e.componentWillMount(),typeof e.UNSAFE_componentWillMount=="function"&&e.UNSAFE_componentWillMount(),t!==e.state&&cl.enqueueReplaceState(e,e.state,null),o.queue!==null&&0<o.queue.length)if(t=o.queue,u=o.replace,o.queue=null,o.replace=!1,u&&t.length===1)e.state=t[0];else{for(o=u?t[0]:e.state,i=!0,u=u?1:0;u<t.length;u++){var l=t[u];l=typeof l=="function"?l.call(e,o,r,n):l,l!=null&&(i?(i=!1,o=ki({},o,l)):ki(o,l))}e.state=o}else o.queue=null}var Vm={id:1,overflow:""};function ma(e,t,r){var n=e.id;e=e.overflow;var i=32-To(n)-1;n&=~(1<<i),r+=1;var o=32-To(t)+i;if(30<o){var u=i-i%5;return o=(n&(1<<u)-1).toString(32),n>>=u,i-=u,{id:1<<32-To(t)+i|r<<i|n,overflow:o+e}}return{id:1<<o|r<<i|n,overflow:e}}var To=Math.clz32?Math.clz32:Gm,Hm=Math.log,Wm=Math.LN2;function Gm(e){return e>>>=0,e===0?32:31-(Hm(e)/Wm|0)|0}function Qm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Zm=typeof Object.is=="function"?Object.is:Qm,Wr=null,Qa=null,_o=null,Je=null,Oi=!1,$o=!1,Ui=0,sn=null,uu=0;function Sn(){if(Wr===null)throw Error(be(321));return Wr}function hl(){if(0<uu)throw Error(be(312));return{memoizedState:null,queue:null,next:null}}function Za(){return Je===null?_o===null?(Oi=!1,_o=Je=hl()):(Oi=!0,Je=_o):Je.next===null?(Oi=!1,Je=Je.next=hl()):(Oi=!0,Je=Je.next),Je}function Ya(){Qa=Wr=null,$o=!1,_o=null,uu=0,Je=sn=null}function Bf(e,t){return typeof t=="function"?t(e):t}function dl(e,t,r){if(Wr=Sn(),Je=Za(),Oi){var n=Je.queue;if(t=n.dispatch,sn!==null&&(r=sn.get(n),r!==void 0)){sn.delete(n),n=Je.memoizedState;do n=e(n,r.action),r=r.next;while(r!==null);return Je.memoizedState=n,[n,t]}return[Je.memoizedState,t]}return e=e===Bf?typeof t=="function"?t():t:r!==void 0?r(t):t,Je.memoizedState=e,e=Je.queue={last:null,dispatch:null},e=e.dispatch=Ym.bind(null,Wr,e),[Je.memoizedState,e]}function pl(e,t){if(Wr=Sn(),Je=Za(),t=t===void 0?null:t,Je!==null){var r=Je.memoizedState;if(r!==null&&t!==null){var n=r[1];e:if(n===null)n=!1;else{for(var i=0;i<n.length&&i<t.length;i++)if(!Zm(t[i],n[i])){n=!1;break e}n=!0}if(n)return r[0]}}return e=e(),Je.memoizedState=[e,t],e}function Ym(e,t,r){if(25<=uu)throw Error(be(301));if(e===Wr)if($o=!0,e={action:r,next:null},sn===null&&(sn=new Map),r=sn.get(t),r===void 0)sn.set(t,e);else{for(t=r;t.next!==null;)t=t.next;t.next=e}}function Xm(){throw Error(be(394))}function mo(){}var ml={readContext:function(e){return e._currentValue},useContext:function(e){return Sn(),e._currentValue},useMemo:pl,useReducer:dl,useRef:function(e){Wr=Sn(),Je=Za();var t=Je.memoizedState;return t===null?(e={current:e},Je.memoizedState=e):t},useState:function(e){return dl(Bf,e)},useInsertionEffect:mo,useLayoutEffect:function(){},useCallback:function(e,t){return pl(function(){return e},t)},useImperativeHandle:mo,useEffect:mo,useDebugValue:mo,useDeferredValue:function(e){return Sn(),e},useTransition:function(){return Sn(),[!1,Xm]},useId:function(){var e=Qa.treeContext,t=e.overflow;e=e.id,e=(e&~(1<<32-To(e)-1)).toString(32)+t;var r=Mo;if(r===null)throw Error(be(404));return t=Ui++,e=":"+r.idPrefix+"R"+e,0<t&&(e+="H"+t.toString(32)),e+":"},useMutableSource:function(e,t){return Sn(),t(e._source)},useSyncExternalStore:function(e,t,r){if(r===void 0)throw Error(be(407));return r()}},Mo=null,zu=hf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;function Km(e){return console.error(e),null}function Ri(){}function Jm(e,t,r,n,i,o,u,l,f){var h=[],s=new Set;return t={destination:null,responseState:t,progressiveChunkSize:n===void 0?12800:n,status:0,fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,completedRootSegment:null,abortableTasks:s,pingedTasks:h,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],onError:i===void 0?Km:i,onAllReady:o===void 0?Ri:o,onShellReady:u===void 0?Ri:u,onShellError:l===void 0?Ri:l,onFatalError:f===void 0?Ri:f},r=Uo(t,0,null,r,!1,!1),r.parentFlushed=!0,e=Xa(t,e,null,r,s,xf,null,Vm),h.push(e),t}function Xa(e,t,r,n,i,o,u,l){e.allPendingTasks++,r===null?e.pendingRootTasks++:r.pendingTasks++;var f={node:t,ping:function(){var h=e.pingedTasks;h.push(f),h.length===1&&Pf(e)},blockedBoundary:r,blockedSegment:n,abortSet:i,legacyContext:o,context:u,treeContext:l};return i.add(f),f}function Uo(e,t,r,n,i,o){return{status:0,id:-1,index:t,parentFlushed:!1,chunks:[],children:[],formatContext:n,boundary:r,lastPushedText:i,textEmbedded:o}}function qi(e,t){if(e=e.onError(t),e!=null&&typeof e!="string")throw Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "'+typeof e+'" instead');return e}function qo(e,t){var r=e.onShellError;r(t),r=e.onFatalError,r(t),e.destination!==null?(e.status=2,pf(e.destination,t)):(e.status=1,e.fatalError=t)}function gl(e,t,r,n,i){for(Wr={},Qa=t,Ui=0,e=r(n,i);$o;)$o=!1,Ui=0,uu+=1,Je=null,e=r(n,i);return Ya(),e}function vl(e,t,r,n){var i=r.render(),o=n.childContextTypes;if(o!=null){var u=t.legacyContext;if(typeof r.getChildContext!="function")n=u;else{r=r.getChildContext();for(var l in r)if(!(l in o))throw Error(be(108,pa(n)||"Unknown",l));n=ki({},u,r)}t.legacyContext=n,nr(e,t,i),t.legacyContext=u}else nr(e,t,i)}function Dl(e,t){if(e&&e.defaultProps){t=ki({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function ga(e,t,r,n,i){if(typeof r=="function")if(r.prototype&&r.prototype.isReactComponent){i=ll(r,t.legacyContext);var o=r.contextType;o=new r(n,typeof o=="object"&&o!==null?o._currentValue:i),fl(o,r,n,i),vl(e,t,o,r)}else{o=ll(r,t.legacyContext),i=gl(e,t,r,n,o);var u=Ui!==0;if(typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0)fl(i,r,n,o),vl(e,t,i,r);else if(u){n=t.treeContext,t.treeContext=ma(n,1,0);try{nr(e,t,i)}finally{t.treeContext=n}}else nr(e,t,i)}else if(typeof r=="string"){switch(i=t.blockedSegment,o=j0(i.chunks,r,n,e.responseState,i.formatContext),i.lastPushedText=!1,u=i.formatContext,i.formatContext=I0(u,r,n),va(e,t,o),i.formatContext=u,r){case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"input":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":break;default:i.chunks.push(V0,Te(r),H0)}i.lastPushedText=!1}else{switch(r){case qm:case Um:case yf:case wf:case Df:nr(e,t,n.children);return;case Ff:nr(e,t,n.children);return;case $m:throw Error(be(343));case Sf:e:{r=t.blockedBoundary,i=t.blockedSegment,o=n.fallback,n=n.children,u=new Set;var l={id:null,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:u,errorDigest:null},f=Uo(e,i.chunks.length,l,i.formatContext,!1,!1);i.children.push(f),i.lastPushedText=!1;var h=Uo(e,0,null,i.formatContext,!1,!1);h.parentFlushed=!0,t.blockedBoundary=l,t.blockedSegment=h;try{if(va(e,t,n),h.lastPushedText&&h.textEmbedded&&h.chunks.push(Wa),h.status=1,jo(l,h),l.pendingTasks===0)break e}catch(s){h.status=4,l.forceClientRender=!0,l.errorDigest=qi(e,s)}finally{t.blockedBoundary=r,t.blockedSegment=i}t=Xa(e,o,r,f,u,t.legacyContext,t.context,t.treeContext),e.pingedTasks.push(t)}return}if(typeof r=="object"&&r!==null)switch(r.$$typeof){case Af:if(n=gl(e,t,r.render,n,i),Ui!==0){r=t.treeContext,t.treeContext=ma(r,1,0);try{nr(e,t,n)}finally{t.treeContext=r}}else nr(e,t,n);return;case bf:r=r.type,n=Dl(r,n),ga(e,t,r,n,i);return;case Ef:if(i=n.children,r=r._context,n=n.value,o=r._currentValue,r._currentValue=n,u=bn,bn=n={parent:u,depth:u===null?0:u.depth+1,context:r,parentValue:o,value:n},t.context=n,nr(e,t,i),e=bn,e===null)throw Error(be(403));n=e.parentValue,e.context._currentValue=n===jm?e.context._defaultValue:n,e=bn=e.parent,t.context=e;return;case Cf:n=n.children,n=n(r._currentValue),nr(e,t,n);return;case Ga:i=r._init,r=i(r._payload),n=Dl(r,n),ga(e,t,r,n,void 0);return}throw Error(be(130,r==null?r:typeof r,""))}}function nr(e,t,r){if(t.node=r,typeof r=="object"&&r!==null){switch(r.$$typeof){case zm:ga(e,t,r.type,r.props,r.ref);return;case vf:throw Error(be(257));case Ga:var n=r._init;r=n(r._payload),nr(e,t,r);return}if(da(r)){yl(e,t,r);return}if(r===null||typeof r!="object"?n=null:(n=sl&&r[sl]||r["@@iterator"],n=typeof n=="function"?n:null),n&&(n=n.call(r))){if(r=n.next(),!r.done){var i=[];do i.push(r.value),r=n.next();while(!r.done);yl(e,t,i)}return}throw e=Object.prototype.toString.call(r),Error(be(31,e==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":e))}typeof r=="string"?(n=t.blockedSegment,n.lastPushedText=tl(t.blockedSegment.chunks,r,e.responseState,n.lastPushedText)):typeof r=="number"&&(n=t.blockedSegment,n.lastPushedText=tl(t.blockedSegment.chunks,""+r,e.responseState,n.lastPushedText))}function yl(e,t,r){for(var n=r.length,i=0;i<n;i++){var o=t.treeContext;t.treeContext=ma(o,n,i);try{va(e,t,r[i])}finally{t.treeContext=o}}}function va(e,t,r){var n=t.blockedSegment.formatContext,i=t.legacyContext,o=t.context;try{return nr(e,t,r)}catch(f){if(Ya(),typeof f=="object"&&f!==null&&typeof f.then=="function"){r=f;var u=t.blockedSegment,l=Uo(e,u.chunks.length,null,u.formatContext,u.lastPushedText,!0);u.children.push(l),u.lastPushedText=!1,e=Xa(e,t.node,t.blockedBoundary,l,t.abortSet,t.legacyContext,t.context,t.treeContext).ping,r.then(e,e),t.blockedSegment.formatContext=n,t.legacyContext=i,t.context=o,zo(o)}else throw t.blockedSegment.formatContext=n,t.legacyContext=i,t.context=o,zo(o),f}}function eg(e){var t=e.blockedBoundary;e=e.blockedSegment,e.status=3,Rf(this,t,e)}function Of(e,t,r){var n=e.blockedBoundary;e.blockedSegment.status=3,n===null?(t.allPendingTasks--,t.status!==2&&(t.status=2,t.destination!==null&&t.destination.close())):(n.pendingTasks--,n.forceClientRender||(n.forceClientRender=!0,e=r===void 0?Error(be(432)):r,n.errorDigest=t.onError(e),n.parentFlushed&&t.clientRenderedBoundaries.push(n)),n.fallbackAbortableTasks.forEach(function(i){return Of(i,t,r)}),n.fallbackAbortableTasks.clear(),t.allPendingTasks--,t.allPendingTasks===0&&(n=t.onAllReady,n()))}function jo(e,t){if(t.chunks.length===0&&t.children.length===1&&t.children[0].boundary===null){var r=t.children[0];r.id=t.id,r.parentFlushed=!0,r.status===1&&jo(e,r)}else e.completedSegments.push(t)}function Rf(e,t,r){if(t===null){if(r.parentFlushed){if(e.completedRootSegment!==null)throw Error(be(389));e.completedRootSegment=r}e.pendingRootTasks--,e.pendingRootTasks===0&&(e.onShellError=Ri,t=e.onShellReady,t())}else t.pendingTasks--,t.forceClientRender||(t.pendingTasks===0?(r.parentFlushed&&r.status===1&&jo(t,r),t.parentFlushed&&e.completedBoundaries.push(t),t.fallbackAbortableTasks.forEach(eg,e),t.fallbackAbortableTasks.clear()):r.parentFlushed&&r.status===1&&(jo(t,r),t.completedSegments.length===1&&t.parentFlushed&&e.partialBoundaries.push(t)));e.allPendingTasks--,e.allPendingTasks===0&&(e=e.onAllReady,e())}function Pf(e){if(e.status!==2){var t=bn,r=zu.current;zu.current=ml;var n=Mo;Mo=e.responseState;try{var i=e.pingedTasks,o;for(o=0;o<i.length;o++){var u=i[o],l=e,f=u.blockedSegment;if(f.status===0){zo(u.context);try{nr(l,u,u.node),f.lastPushedText&&f.textEmbedded&&f.chunks.push(Wa),u.abortSet.delete(u),f.status=1,Rf(l,u.blockedBoundary,f)}catch(D){if(Ya(),typeof D=="object"&&D!==null&&typeof D.then=="function"){var h=u.ping;D.then(h,h)}else{u.abortSet.delete(u),f.status=4;var s=u.blockedBoundary,a=D,c=qi(l,a);if(s===null?qo(l,a):(s.pendingTasks--,s.forceClientRender||(s.forceClientRender=!0,s.errorDigest=c,s.parentFlushed&&l.clientRenderedBoundaries.push(s))),l.allPendingTasks--,l.allPendingTasks===0){var p=l.onAllReady;p()}}}finally{}}}i.splice(0,o),e.destination!==null&&Ka(e,e.destination)}catch(D){qi(e,D),qo(e,D)}finally{Mo=n,zu.current=r,r===ml&&zo(t)}}}function go(e,t,r){switch(r.parentFlushed=!0,r.status){case 0:var n=r.id=e.nextSegmentId++;return r.lastPushedText=!1,r.textEmbedded=!1,e=e.responseState,se(t,W0),se(t,e.placeholderPrefix),e=Te(n.toString(16)),se(t,e),it(t,G0);case 1:r.status=2;var i=!0;n=r.chunks;var o=0;r=r.children;for(var u=0;u<r.length;u++){for(i=r[u];o<i.index;o++)se(t,n[o]);i=au(e,t,i)}for(;o<n.length-1;o++)se(t,n[o]);return o<n.length&&(i=it(t,n[o])),i;default:throw Error(be(390))}}function au(e,t,r){var n=r.boundary;if(n===null)return go(e,t,r);if(n.parentFlushed=!0,n.forceClientRender)n=n.errorDigest,it(t,X0),se(t,J0),n&&(se(t,tm),se(t,Te(Mt(n))),se(t,em)),it(t,rm),go(e,t,r);else if(0<n.pendingTasks){n.rootSegmentID=e.nextSegmentId++,0<n.completedSegments.length&&e.partialBoundaries.push(n);var i=e.responseState,o=i.nextSuspenseID++;i=K(i.boundaryPrefix+o.toString(16)),n=n.id=i,al(t,e.responseState,n),go(e,t,r)}else if(n.byteSize>e.progressiveChunkSize)n.rootSegmentID=e.nextSegmentId++,e.completedBoundaries.push(n),al(t,e.responseState,n.id),go(e,t,r);else{if(it(t,Q0),r=n.completedSegments,r.length!==1)throw Error(be(391));au(e,t,r[0])}return it(t,K0)}function wl(e,t,r){return Sm(t,e.responseState,r.formatContext,r.id),au(e,t,r),Fm(t,r.formatContext)}function El(e,t,r){for(var n=r.completedSegments,i=0;i<n.length;i++)kf(e,t,r,n[i]);if(n.length=0,e=e.responseState,n=r.id,r=r.rootSegmentID,se(t,e.startInlineScript),e.sentCompleteBoundaryFunction?se(t,Nm):(e.sentCompleteBoundaryFunction=!0,se(t,Mm)),n===null)throw Error(be(395));return r=Te(r.toString(16)),se(t,n),se(t,Bm),se(t,e.segmentPrefix),se(t,r),it(t,Om)}function kf(e,t,r,n){if(n.status===2)return!0;var i=n.id;if(i===-1){if((n.id=r.rootSegmentID)===-1)throw Error(be(392));return wl(e,t,n)}return wl(e,t,n),e=e.responseState,se(t,e.startInlineScript),e.sentCompleteSegmentFunction?se(t,xm):(e.sentCompleteSegmentFunction=!0,se(t,bm)),se(t,e.segmentPrefix),i=Te(i.toString(16)),se(t,i),se(t,Tm),se(t,e.placeholderPrefix),se(t,i),it(t,_m)}function Ka(e,t){tr=new Uint8Array(512),rr=0;try{var r=e.completedRootSegment;if(r!==null&&e.pendingRootTasks===0){au(e,t,r),e.completedRootSegment=null;var n=e.responseState.bootstrapChunks;for(r=0;r<n.length-1;r++)se(t,n[r]);r<n.length&&it(t,n[r])}var i=e.clientRenderedBoundaries,o;for(o=0;o<i.length;o++){var u=i[o];n=t;var l=e.responseState,f=u.id,h=u.errorDigest,s=u.errorMessage,a=u.errorComponentStack;if(se(n,l.startInlineScript),l.sentClientRenderFunction?se(n,Pm):(l.sentClientRenderFunction=!0,se(n,Rm)),f===null)throw Error(be(395));se(n,f),se(n,km),(h||s||a)&&(se(n,Iu),se(n,Te(Lu(h||"")))),(s||a)&&(se(n,Iu),se(n,Te(Lu(s||"")))),a&&(se(n,Iu),se(n,Te(Lu(a)))),it(n,Im)}i.splice(0,o);var c=e.completedBoundaries;for(o=0;o<c.length;o++)El(e,t,c[o]);c.splice(0,o),Xs(t),tr=new Uint8Array(512),rr=0;var p=e.partialBoundaries;for(o=0;o<p.length;o++){var D=p[o];e:{i=e,u=t;var d=D.completedSegments;for(l=0;l<d.length;l++)if(!kf(i,u,D,d[l])){l++,d.splice(0,l);var g=!1;break e}d.splice(0,l),g=!0}if(!g){e.destination=null,o++,p.splice(0,o);return}}p.splice(0,o);var m=e.completedBoundaries;for(o=0;o<m.length;o++)El(e,t,m[o]);m.splice(0,o)}finally{Xs(t),e.allPendingTasks===0&&e.pingedTasks.length===0&&e.clientRenderedBoundaries.length===0&&e.completedBoundaries.length===0&&t.close()}}function Cl(e,t){try{var r=e.abortableTasks;r.forEach(function(n){return Of(n,e,t)}),r.clear(),e.destination!==null&&Ka(e,e.destination)}catch(n){qi(e,n),qo(e,n)}}ja.renderToReadableStream=function(e,t){return new Promise(function(r,n){var i,o,u=new Promise(function(s,a){o=s,i=a}),l=Jm(e,P0(t?t.identifierPrefix:void 0,t?t.nonce:void 0,t?t.bootstrapScriptContent:void 0,t?t.bootstrapScripts:void 0,t?t.bootstrapModules:void 0),k0(t?t.namespaceURI:void 0),t?t.progressiveChunkSize:void 0,t?t.onError:void 0,o,function(){var s=new ReadableStream({type:"bytes",pull:function(a){if(l.status===1)l.status=2,pf(a,l.fatalError);else if(l.status!==2&&l.destination===null){l.destination=a;try{Ka(l,a)}catch(c){qi(l,c),qo(l,c)}}},cancel:function(){Cl(l)}},{highWaterMark:0});s.allReady=u,r(s)},function(s){u.catch(function(){}),n(s)},i);if(t&&t.signal){var f=t.signal,h=function(){Cl(l,f.reason),f.removeEventListener("abort",h)};f.addEventListener("abort",h)}Pf(l)})};ja.version="18.3.1";var yi,If;yi=Di,If=ja;yi.version;var Lf=yi.renderToString;yi.renderToStaticMarkup;yi.renderToNodeStream;yi.renderToStaticNodeStream;If.renderToReadableStream;const Al=({tableSettings:e,globalFilter:t,columnFilters:r,pagination:n,locale:i,rowCount:o})=>{const u="pp-table-info";return e.largeTableSupport.actual===ar.ENABLED?e.largeTableSupport.skipCount===!0&&(Array.isArray(r)&&r.length>0||t!=null&&t!=="")?L.jsxs(xu,{className:u,children:[n.pageIndex*n.pageSize+1,"-",(n.pageIndex+1)*n.pageSize," ",i.of," ~filtered rows~ (total rows: ~",o==null?void 0:o.toLocaleString(),")"]}):L.jsxs(xu,{className:u,children:[n.pageIndex*n.pageSize+1,"-",(n.pageIndex+1)*n.pageSize," ",i.of," ~",o==null?void 0:o.toLocaleString()]}):L.jsxs(xu,{className:u,children:[n.pageIndex*n.pageSize+1,"-",Math.min((n.pageIndex+1)*n.pageSize,o??0)," ",i.of," ",o==null?void 0:o.toLocaleString()]})},tg=({appId:e,lookupColumn:t,cell:r,metaData:n,highlight:i})=>{J.debug(e,t,r,n);const o=_a(),[u,l]=Z.useState(r.getValue());return Z.useEffect(()=>{if(J.debug(e,t,r),t.lookup!==void 0){const f=xc(jr.getState(),e,t.columnName,r.getValue());if(J.debug(f),f!==void 0&&f.length>0)Array.isArray(f)?l(f.join(t.lookup.delimiter)):l(f);else{const h={};h[t.lookup.key]=r.getValue(),J.debug(h),Mc(e,"table",t.columnName,t.lookup.key,t.lookup.value,h,{},s=>{if(J.debug(s.data),t.lookup!==void 0&&Array.isArray(s.data)&&s.data.length>0){let a="";if(!t.lookup.value.includes(","))a=s.data[0].value,l(a.toString());else{const c=t.lookup.value.split(",");l(c.map(p=>s.data[0][p]).join(t.lookup.delimiter)),a=c.map(p=>s.data[0][p])}o(Zh({appId:e,columnName:t.columnName,lookupValue:{key:s.data[0].key,value:a}}))}},s=>{J.error(s)})}}else l("")},[e,r,o,t]),L.jsx(L.Fragment,{children:i(u,t,t.columnName+r.row.id)})},rg=e=>{const t=Pr(r=>Yh(r,e));return J.debug("lookups",t),t},zf=e=>{const t=Pr(r=>Xh(r,e));return J.debug("tableCode",t),t},ng=({appId:e,table:t,row:r,columns:n,appSettings:i,metaData:o,tableSettings:u})=>{J.debug(e,t,r,n,o,u);const l=Z.useRef(null);zf(e);const f=Z.useMemo(()=>{const a={};return n.map(c=>{const p=r.getAllCells().filter(g=>g.id===`${r.id}_${c.columnName}`)[0],D=L.jsx(xd,{cell:p,table:t});let d=r.original[c.columnName];if(c.lookup===void 0)try{d=Lf(D)}catch(g){J.error("Error rendering column "+c.columnName),J.error("Cell value",D),J.error(g),d=void 0}else{const g=xc(jr.getState(),e,c.columnName,p.getValue());g!==void 0?Array.isArray(g)?d=g.join(c.lookup.delimiter):d=g:d=""}d!==void 0&&c.computedField===void 0&&(a[c.columnName]={label:c.columnLabel,originalValue:r.original[c.columnName],renderedValue:d,cell:D})}),a},[]),h=()=>L.jsx(Dr,{onClick:a=>{a.stopPropagation()},className:"pp-table-detail-panel",sx:{margin:0,padding:"2rem",display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(500px, 1fr))",gap:"0.25rem"},children:Object.keys(f).map(a=>L.jsx(Kh.Fragment,{children:L.jsxs(Dr,{sx:{display:"grid",gridTemplateColumns:"2fr 4fr",alignItems:"start",gap:"0.5rem"},children:[L.jsx(Dr,{sx:{textAlign:"right",whiteSpace:"nowrap",overflow:"visible",direction:"rtl"},className:"label",children:f[a].label}),L.jsx(Dr,{sx:{fontWeight:"bold"},className:"content",children:f[a].cell})]})},a))}),s=()=>h();return L.jsxs(Dr,{sx:{position:"relative"},children:[L.jsx(Dr,{ref:l,sx:{border:"none",margin:0,padding:0},children:s()}),!1]})};var ig=function(e){return e instanceof RegExp},og=function(t){var r=/[\\^$.*+?()[\]{}|]/g,n=RegExp(r.source);return t&&n.test(t)?t.replace(r,"\\$&"):t},$f=function(e){return typeof e=="string"},ug=function(e){var t=[];return e.forEach(function(r){Array.isArray(r)?t=t.concat(r):t.push(r)}),t};function ag(e,t,r){var n=0,i=0;if(e==="")return e;if(!e||!$f(e))throw new TypeError("First argument to react-string-replace#replaceString must be a string");var o=t;ig(o)||(o=new RegExp("("+og(o)+")","gi"));for(var u=e.split(o),l=1,f=u.length;l<f;l+=2){if(u[l]===void 0||u[l-1]===void 0){console.warn("reactStringReplace: Encountered undefined value during string replacement. Your RegExp may not be working the way you expect.");continue}i=u[l].length,n+=u[l-1].length,u[l]=r(u[l],l,n),n+=i}return u}var sg=function(t,r,n){return Array.isArray(t)||(t=[t]),ug(t.map(function(i){return $f(i)?ag(i,r,n):i}))};const lg=Ta(sg);/*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */const{entries:Uf,setPrototypeOf:Sl,isFrozen:cg,getPrototypeOf:fg,getOwnPropertyDescriptor:hg}=Object;let{freeze:Ut,seal:fr,create:qf}=Object,{apply:Da,construct:ya}=typeof Reflect<"u"&&Reflect;Ut||(Ut=function(t){return t});fr||(fr=function(t){return t});Da||(Da=function(t,r,n){return t.apply(r,n)});ya||(ya=function(t,r){return new t(...r)});const vo=ir(Array.prototype.forEach),Fl=ir(Array.prototype.pop),Fi=ir(Array.prototype.push),No=ir(String.prototype.toLowerCase),$u=ir(String.prototype.toString),bl=ir(String.prototype.match),bi=ir(String.prototype.replace),dg=ir(String.prototype.indexOf),pg=ir(String.prototype.trim),gr=ir(Object.prototype.hasOwnProperty),kt=ir(RegExp.prototype.test),xi=mg(TypeError);function ir(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return Da(e,t,n)}}function mg(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return ya(e,r)}}function _e(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:No;Sl&&Sl(e,null);let n=t.length;for(;n--;){let i=t[n];if(typeof i=="string"){const o=r(i);o!==i&&(cg(t)||(t[n]=o),i=o)}e[i]=!0}return e}function gg(e){for(let t=0;t<e.length;t++)gr(e,t)||(e[t]=null);return e}function En(e){const t=qf(null);for(const[r,n]of Uf(e))gr(e,r)&&(Array.isArray(n)?t[r]=gg(n):n&&typeof n=="object"&&n.constructor===Object?t[r]=En(n):t[r]=n);return t}function Ti(e,t){for(;e!==null;){const n=hg(e,t);if(n){if(n.get)return ir(n.get);if(typeof n.value=="function")return ir(n.value)}e=fg(e)}function r(){return null}return r}const xl=Ut(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Uu=Ut(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),qu=Ut(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),vg=Ut(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ju=Ut(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Dg=Ut(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Tl=Ut(["#text"]),_l=Ut(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Vu=Ut(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Ml=Ut(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Do=Ut(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),yg=fr(/\{\{[\w\W]*|[\w\W]*\}\}/gm),wg=fr(/<%[\w\W]*|[\w\W]*%>/gm),Eg=fr(/\${[\w\W]*}/gm),Cg=fr(/^data-[\-\w.\u00B7-\uFFFF]/),Ag=fr(/^aria-[\-\w]+$/),jf=fr(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Sg=fr(/^(?:\w+script|data):/i),Fg=fr(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Vf=fr(/^html$/i),bg=fr(/^[a-z][.\w]*(-[.\w]+)+$/i);var Nl=Object.freeze({__proto__:null,MUSTACHE_EXPR:yg,ERB_EXPR:wg,TMPLIT_EXPR:Eg,DATA_ATTR:Cg,ARIA_ATTR:Ag,IS_ALLOWED_URI:jf,IS_SCRIPT_OR_DATA:Sg,ATTR_WHITESPACE:Fg,DOCTYPE_NAME:Vf,CUSTOM_ELEMENT:bg});const _i={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},xg=function(){return typeof window>"u"?null:window},Tg=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const o="dompurify"+(n?"#"+n:"");try{return t.createPolicy(o,{createHTML(u){return u},createScriptURL(u){return u}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function Hf(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:xg();const t=ae=>Hf(ae);if(t.version="3.1.6",t.removed=[],!e||!e.document||e.document.nodeType!==_i.document)return t.isSupported=!1,t;let{document:r}=e;const n=r,i=n.currentScript,{DocumentFragment:o,HTMLTemplateElement:u,Node:l,Element:f,NodeFilter:h,NamedNodeMap:s=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:a,DOMParser:c,trustedTypes:p}=e,D=f.prototype,d=Ti(D,"cloneNode"),g=Ti(D,"remove"),m=Ti(D,"nextSibling"),y=Ti(D,"childNodes"),v=Ti(D,"parentNode");if(typeof u=="function"){const ae=r.createElement("template");ae.content&&ae.content.ownerDocument&&(r=ae.content.ownerDocument)}let w,E="";const{implementation:C,createNodeIterator:F,createDocumentFragment:S,getElementsByTagName:b}=r,{importNode:P}=n;let B={};t.isSupported=typeof Uf=="function"&&typeof v=="function"&&C&&C.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:k,ERB_EXPR:H,TMPLIT_EXPR:M,DATA_ATTR:I,ARIA_ATTR:O,IS_SCRIPT_OR_DATA:oe,ATTR_WHITESPACE:ee,CUSTOM_ELEMENT:re}=Nl;let{IS_ALLOWED_URI:fe}=Nl,he=null;const Me=_e({},[...xl,...Uu,...qu,...ju,...Tl]);let ue=null;const Qe=_e({},[..._l,...Vu,...Ml,...Do]);let ve=Object.seal(qf(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),qe=null,Re=null,st=!0,Pe=!0,Ae=!1,et=!0,ke=!1,Ne=!0,Ie=!1,tt=!1,xt=!1,wt=!1,Dt=!1,Et=!1,Ar=!0,dn=!1;const pn="user-content-";let A=!0,T=!1,R={},z=null;const V=_e({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let U=null;const X=_e({},["audio","video","img","source","image","track"]);let W=null;const Y=_e({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),q="http://www.w3.org/1998/Math/MathML",Be="http://www.w3.org/2000/svg",xe="http://www.w3.org/1999/xhtml";let je=xe,ht=!1,gt=null;const Ct=_e({},[q,Be,xe],$u);let At=null;const pr=["application/xhtml+xml","text/html"],Zr="text/html";let dt=null,Sr=null;const mn=r.createElement("form"),gn=function(x){return x instanceof RegExp||x instanceof Function},Ze=function(){let x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Sr&&Sr===x)){if((!x||typeof x!="object")&&(x={}),x=En(x),At=pr.indexOf(x.PARSER_MEDIA_TYPE)===-1?Zr:x.PARSER_MEDIA_TYPE,dt=At==="application/xhtml+xml"?$u:No,he=gr(x,"ALLOWED_TAGS")?_e({},x.ALLOWED_TAGS,dt):Me,ue=gr(x,"ALLOWED_ATTR")?_e({},x.ALLOWED_ATTR,dt):Qe,gt=gr(x,"ALLOWED_NAMESPACES")?_e({},x.ALLOWED_NAMESPACES,$u):Ct,W=gr(x,"ADD_URI_SAFE_ATTR")?_e(En(Y),x.ADD_URI_SAFE_ATTR,dt):Y,U=gr(x,"ADD_DATA_URI_TAGS")?_e(En(X),x.ADD_DATA_URI_TAGS,dt):X,z=gr(x,"FORBID_CONTENTS")?_e({},x.FORBID_CONTENTS,dt):V,qe=gr(x,"FORBID_TAGS")?_e({},x.FORBID_TAGS,dt):{},Re=gr(x,"FORBID_ATTR")?_e({},x.FORBID_ATTR,dt):{},R=gr(x,"USE_PROFILES")?x.USE_PROFILES:!1,st=x.ALLOW_ARIA_ATTR!==!1,Pe=x.ALLOW_DATA_ATTR!==!1,Ae=x.ALLOW_UNKNOWN_PROTOCOLS||!1,et=x.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ke=x.SAFE_FOR_TEMPLATES||!1,Ne=x.SAFE_FOR_XML!==!1,Ie=x.WHOLE_DOCUMENT||!1,wt=x.RETURN_DOM||!1,Dt=x.RETURN_DOM_FRAGMENT||!1,Et=x.RETURN_TRUSTED_TYPE||!1,xt=x.FORCE_BODY||!1,Ar=x.SANITIZE_DOM!==!1,dn=x.SANITIZE_NAMED_PROPS||!1,A=x.KEEP_CONTENT!==!1,T=x.IN_PLACE||!1,fe=x.ALLOWED_URI_REGEXP||jf,je=x.NAMESPACE||xe,ve=x.CUSTOM_ELEMENT_HANDLING||{},x.CUSTOM_ELEMENT_HANDLING&&gn(x.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ve.tagNameCheck=x.CUSTOM_ELEMENT_HANDLING.tagNameCheck),x.CUSTOM_ELEMENT_HANDLING&&gn(x.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ve.attributeNameCheck=x.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),x.CUSTOM_ELEMENT_HANDLING&&typeof x.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ve.allowCustomizedBuiltInElements=x.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ke&&(Pe=!1),Dt&&(wt=!0),R&&(he=_e({},Tl),ue=[],R.html===!0&&(_e(he,xl),_e(ue,_l)),R.svg===!0&&(_e(he,Uu),_e(ue,Vu),_e(ue,Do)),R.svgFilters===!0&&(_e(he,qu),_e(ue,Vu),_e(ue,Do)),R.mathMl===!0&&(_e(he,ju),_e(ue,Ml),_e(ue,Do))),x.ADD_TAGS&&(he===Me&&(he=En(he)),_e(he,x.ADD_TAGS,dt)),x.ADD_ATTR&&(ue===Qe&&(ue=En(ue)),_e(ue,x.ADD_ATTR,dt)),x.ADD_URI_SAFE_ATTR&&_e(W,x.ADD_URI_SAFE_ATTR,dt),x.FORBID_CONTENTS&&(z===V&&(z=En(z)),_e(z,x.FORBID_CONTENTS,dt)),A&&(he["#text"]=!0),Ie&&_e(he,["html","head","body"]),he.table&&(_e(he,["tbody"]),delete qe.tbody),x.TRUSTED_TYPES_POLICY){if(typeof x.TRUSTED_TYPES_POLICY.createHTML!="function")throw xi('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof x.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw xi('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=x.TRUSTED_TYPES_POLICY,E=w.createHTML("")}else w===void 0&&(w=Tg(p,i)),w!==null&&typeof E=="string"&&(E=w.createHTML(""));Ut&&Ut(x),Sr=x}},Ir=_e({},["mi","mo","mn","ms","mtext"]),kn=_e({},["foreignobject","annotation-xml"]),In=_e({},["title","style","font","a","script"]),Ln=_e({},[...Uu,...qu,...vg]),vn=_e({},[...ju,...Dg]),rt=function(x){let G=v(x);(!G||!G.tagName)&&(G={namespaceURI:je,tagName:"template"});const ne=No(x.tagName),ze=No(G.tagName);return gt[x.namespaceURI]?x.namespaceURI===Be?G.namespaceURI===xe?ne==="svg":G.namespaceURI===q?ne==="svg"&&(ze==="annotation-xml"||Ir[ze]):!!Ln[ne]:x.namespaceURI===q?G.namespaceURI===xe?ne==="math":G.namespaceURI===Be?ne==="math"&&kn[ze]:!!vn[ne]:x.namespaceURI===xe?G.namespaceURI===Be&&!kn[ze]||G.namespaceURI===q&&!Ir[ze]?!1:!vn[ne]&&(In[ne]||!Ln[ne]):!!(At==="application/xhtml+xml"&&gt[x.namespaceURI]):!1},Vt=function(x){Fi(t.removed,{element:x});try{v(x).removeChild(x)}catch{g(x)}},Lr=function(x,G){try{Fi(t.removed,{attribute:G.getAttributeNode(x),from:G})}catch{Fi(t.removed,{attribute:null,from:G})}if(G.removeAttribute(x),x==="is"&&!ue[x])if(wt||Dt)try{Vt(G)}catch{}else try{G.setAttribute(x,"")}catch{}},zn=function(x){let G=null,ne=null;if(xt)x="<remove></remove>"+x;else{const pe=bl(x,/^[\r\n\t ]+/);ne=pe&&pe[0]}At==="application/xhtml+xml"&&je===xe&&(x='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+x+"</body></html>");const ze=w?w.createHTML(x):x;if(je===xe)try{G=new c().parseFromString(ze,At)}catch{}if(!G||!G.documentElement){G=C.createDocument(je,"template",null);try{G.documentElement.innerHTML=ht?E:ze}catch{}}const nt=G.body||G.documentElement;return x&&ne&&nt.insertBefore(r.createTextNode(ne),nt.childNodes[0]||null),je===xe?b.call(G,Ie?"html":"body")[0]:Ie?G.documentElement:nt},$n=function(x){return F.call(x.ownerDocument||x,x,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},Un=function(x){return x instanceof a&&(typeof x.nodeName!="string"||typeof x.textContent!="string"||typeof x.removeChild!="function"||!(x.attributes instanceof s)||typeof x.removeAttribute!="function"||typeof x.setAttribute!="function"||typeof x.namespaceURI!="string"||typeof x.insertBefore!="function"||typeof x.hasChildNodes!="function")},qn=function(x){return typeof l=="function"&&x instanceof l},Zt=function(x,G,ne){B[x]&&vo(B[x],ze=>{ze.call(t,G,ne,Sr)})},jn=function(x){let G=null;if(Zt("beforeSanitizeElements",x,null),Un(x))return Vt(x),!0;const ne=dt(x.nodeName);if(Zt("uponSanitizeElement",x,{tagName:ne,allowedTags:he}),x.hasChildNodes()&&!qn(x.firstElementChild)&&kt(/<[/\w]/g,x.innerHTML)&&kt(/<[/\w]/g,x.textContent)||x.nodeType===_i.progressingInstruction||Ne&&x.nodeType===_i.comment&&kt(/<[/\w]/g,x.data))return Vt(x),!0;if(!he[ne]||qe[ne]){if(!qe[ne]&&Dn(ne)&&(ve.tagNameCheck instanceof RegExp&&kt(ve.tagNameCheck,ne)||ve.tagNameCheck instanceof Function&&ve.tagNameCheck(ne)))return!1;if(A&&!z[ne]){const ze=v(x)||x.parentNode,nt=y(x)||x.childNodes;if(nt&&ze){const pe=nt.length;for(let Le=pe-1;Le>=0;--Le){const Pt=d(nt[Le],!0);Pt.__removalCount=(x.__removalCount||0)+1,ze.insertBefore(Pt,m(x))}}}return Vt(x),!0}return x instanceof f&&!rt(x)||(ne==="noscript"||ne==="noembed"||ne==="noframes")&&kt(/<\/no(script|embed|frames)/i,x.innerHTML)?(Vt(x),!0):(ke&&x.nodeType===_i.text&&(G=x.textContent,vo([k,H,M],ze=>{G=bi(G,ze," ")}),x.textContent!==G&&(Fi(t.removed,{element:x.cloneNode()}),x.textContent=G)),Zt("afterSanitizeElements",x,null),!1)},Vn=function(x,G,ne){if(Ar&&(G==="id"||G==="name")&&(ne in r||ne in mn))return!1;if(!(Pe&&!Re[G]&&kt(I,G))){if(!(st&&kt(O,G))){if(!ue[G]||Re[G]){if(!(Dn(x)&&(ve.tagNameCheck instanceof RegExp&&kt(ve.tagNameCheck,x)||ve.tagNameCheck instanceof Function&&ve.tagNameCheck(x))&&(ve.attributeNameCheck instanceof RegExp&&kt(ve.attributeNameCheck,G)||ve.attributeNameCheck instanceof Function&&ve.attributeNameCheck(G))||G==="is"&&ve.allowCustomizedBuiltInElements&&(ve.tagNameCheck instanceof RegExp&&kt(ve.tagNameCheck,ne)||ve.tagNameCheck instanceof Function&&ve.tagNameCheck(ne))))return!1}else if(!W[G]){if(!kt(fe,bi(ne,ee,""))){if(!((G==="src"||G==="xlink:href"||G==="href")&&x!=="script"&&dg(ne,"data:")===0&&U[x])){if(!(Ae&&!kt(oe,bi(ne,ee,"")))){if(ne)return!1}}}}}}return!0},Dn=function(x){return x!=="annotation-xml"&&bl(x,re)},yn=function(x){Zt("beforeSanitizeAttributes",x,null);const{attributes:G}=x;if(!G)return;const ne={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ue};let ze=G.length;for(;ze--;){const nt=G[ze],{name:pe,namespaceURI:Le,value:Pt}=nt,Yt=dt(pe);let ot=pe==="value"?Pt:pg(Pt);if(ne.attrName=Yt,ne.attrValue=ot,ne.keepAttr=!0,ne.forceKeepAttr=void 0,Zt("uponSanitizeAttribute",x,ne),ot=ne.attrValue,Ne&&kt(/((--!?|])>)|<\/(style|title)/i,ot)){Lr(pe,x);continue}if(ne.forceKeepAttr||(Lr(pe,x),!ne.keepAttr))continue;if(!et&&kt(/\/>/i,ot)){Lr(pe,x);continue}ke&&vo([k,H,M],Ei=>{ot=bi(ot,Ei," ")});const wn=dt(x.nodeName);if(Vn(wn,Yt,ot)){if(dn&&(Yt==="id"||Yt==="name")&&(Lr(pe,x),ot=pn+ot),w&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!Le)switch(p.getAttributeType(wn,Yt)){case"TrustedHTML":{ot=w.createHTML(ot);break}case"TrustedScriptURL":{ot=w.createScriptURL(ot);break}}try{Le?x.setAttributeNS(Le,pe,ot):x.setAttribute(pe,ot),Un(x)?Vt(x):Fl(t.removed)}catch{}}}Zt("afterSanitizeAttributes",x,null)},Hn=function ae(x){let G=null;const ne=$n(x);for(Zt("beforeSanitizeShadowDOM",x,null);G=ne.nextNode();)Zt("uponSanitizeShadowNode",G,null),!jn(G)&&(G.content instanceof o&&ae(G.content),yn(G));Zt("afterSanitizeShadowDOM",x,null)};return t.sanitize=function(ae){let x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},G=null,ne=null,ze=null,nt=null;if(ht=!ae,ht&&(ae="<!-->"),typeof ae!="string"&&!qn(ae))if(typeof ae.toString=="function"){if(ae=ae.toString(),typeof ae!="string")throw xi("dirty is not a string, aborting")}else throw xi("toString is not a function");if(!t.isSupported)return ae;if(tt||Ze(x),t.removed=[],typeof ae=="string"&&(T=!1),T){if(ae.nodeName){const Pt=dt(ae.nodeName);if(!he[Pt]||qe[Pt])throw xi("root node is forbidden and cannot be sanitized in-place")}}else if(ae instanceof l)G=zn("<!---->"),ne=G.ownerDocument.importNode(ae,!0),ne.nodeType===_i.element&&ne.nodeName==="BODY"||ne.nodeName==="HTML"?G=ne:G.appendChild(ne);else{if(!wt&&!ke&&!Ie&&ae.indexOf("<")===-1)return w&&Et?w.createHTML(ae):ae;if(G=zn(ae),!G)return wt?null:Et?E:""}G&&xt&&Vt(G.firstChild);const pe=$n(T?ae:G);for(;ze=pe.nextNode();)jn(ze)||(ze.content instanceof o&&Hn(ze.content),yn(ze));if(T)return ae;if(wt){if(Dt)for(nt=S.call(G.ownerDocument);G.firstChild;)nt.appendChild(G.firstChild);else nt=G;return(ue.shadowroot||ue.shadowrootmode)&&(nt=P.call(n,nt,!0)),nt}let Le=Ie?G.outerHTML:G.innerHTML;return Ie&&he["!doctype"]&&G.ownerDocument&&G.ownerDocument.doctype&&G.ownerDocument.doctype.name&&kt(Vf,G.ownerDocument.doctype.name)&&(Le="<!DOCTYPE "+G.ownerDocument.doctype.name+`> `+Le),ke&&vo([k,H,M],Pt=>{Le=bi(Le,Pt," ")}),w&&Et?w.createHTML(Le):Le},t.setConfig=function(){let ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ze(ae),tt=!0},t.clearConfig=function(){Sr=null,tt=!1},t.isValidAttribute=function(ae,x,G){Sr||Ze({});const ne=dt(ae),ze=dt(x);return Vn(ne,ze,G)},t.addHook=function(ae,x){typeof x=="function"&&(B[ae]=B[ae]||[],Fi(B[ae],x))},t.removeHook=function(ae){if(B[ae])return Fl(B[ae])},t.removeHooks=function(ae){B[ae]&&(B[ae]=[])},t.removeAllHooks=function(){B={}},t}var Bl=Hf();var Wf={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null};function ut(e){return typeof e=="number"}function bt(e){return!e||typeof e!="object"||typeof e.constructor!="function"?!1:e.isBigNumber===!0&&typeof e.constructor.prototype=="object"&&e.constructor.prototype.isBigNumber===!0||typeof e.constructor.isDecimal=="function"&&e.constructor.isDecimal(e)===!0}function Gf(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isComplex===!0||!1}function Qf(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isFraction===!0||!1}function Zf(e){return e&&e.constructor.prototype.isUnit===!0||!1}function Rr(e){return typeof e=="string"}var ct=Array.isArray;function at(e){return e&&e.constructor.prototype.isMatrix===!0||!1}function hi(e){return Array.isArray(e)||at(e)}function _g(e){return e&&e.isDenseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function Mg(e){return e&&e.isSparseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function Ng(e){return e&&e.constructor.prototype.isRange===!0||!1}function Ja(e){return e&&e.constructor.prototype.isIndex===!0||!1}function Bg(e){return typeof e=="boolean"}function Og(e){return e&&e.constructor.prototype.isResultSet===!0||!1}function Rg(e){return e&&e.constructor.prototype.isHelp===!0||!1}function Pg(e){return typeof e=="function"}function kg(e){return e instanceof Date}function Ig(e){return e instanceof RegExp}function Yf(e){return!!(e&&typeof e=="object"&&e.constructor===Object&&!Gf(e)&&!Qf(e))}function Lg(e){return e===null}function zg(e){return e===void 0}function $g(e){return e&&e.isAccessorNode===!0&&e.constructor.prototype.isNode===!0||!1}function Ug(e){return e&&e.isArrayNode===!0&&e.constructor.prototype.isNode===!0||!1}function qg(e){return e&&e.isAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function jg(e){return e&&e.isBlockNode===!0&&e.constructor.prototype.isNode===!0||!1}function Vg(e){return e&&e.isConditionalNode===!0&&e.constructor.prototype.isNode===!0||!1}function Hg(e){return e&&e.isConstantNode===!0&&e.constructor.prototype.isNode===!0||!1}function Wg(e){return e&&e.isFunctionAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function Gg(e){return e&&e.isFunctionNode===!0&&e.constructor.prototype.isNode===!0||!1}function Qg(e){return e&&e.isIndexNode===!0&&e.constructor.prototype.isNode===!0||!1}function Zg(e){return e&&e.isNode===!0&&e.constructor.prototype.isNode===!0||!1}function Yg(e){return e&&e.isObjectNode===!0&&e.constructor.prototype.isNode===!0||!1}function Xg(e){return e&&e.isOperatorNode===!0&&e.constructor.prototype.isNode===!0||!1}function Kg(e){return e&&e.isParenthesisNode===!0&&e.constructor.prototype.isNode===!0||!1}function Jg(e){return e&&e.isRangeNode===!0&&e.constructor.prototype.isNode===!0||!1}function ev(e){return e&&e.isRelationalNode===!0&&e.constructor.prototype.isNode===!0||!1}function tv(e){return e&&e.isSymbolNode===!0&&e.constructor.prototype.isNode===!0||!1}function rv(e){return e&&e.constructor.prototype.isChain===!0||!1}function wr(e){var t=typeof e;return t==="object"?e===null?"null":bt(e)?"BigNumber":e.constructor&&e.constructor.name?e.constructor.name:"Object":t}function mt(e){var t=typeof e;if(t==="number"||t==="string"||t==="boolean"||e===null||e===void 0)return e;if(typeof e.clone=="function")return e.clone();if(Array.isArray(e))return e.map(function(r){return mt(r)});if(e instanceof Date)return new Date(e.valueOf());if(bt(e))return e;if(Yf(e))return nv(e,mt);throw new TypeError("Cannot clone: unknown type of value (value: ".concat(e,")"))}function nv(e,t){var r={};for(var n in e)ji(e,n)&&(r[n]=t(e[n]));return r}function Xf(e,t){for(var r in t)ji(t,r)&&(e[r]=t[r]);return e}function di(e,t){var r,n,i;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;n++)if(!di(e[n],t[n]))return!1;return!0}else{if(typeof e=="function")return e===t;if(e instanceof Object){if(Array.isArray(t)||!(t instanceof Object))return!1;for(r in e)if(!(r in t)||!di(e[r],t[r]))return!1;for(r in t)if(!(r in e))return!1;return!0}else return e===t}}function ji(e,t){return e&&Object.hasOwnProperty.call(e,t)}function iv(e,t){for(var r={},n=0;n<t.length;n++){var i=t[n],o=e[i];o!==void 0&&(r[i]=o)}return r}var ov=["Matrix","Array"],uv=["number","BigNumber","Fraction"],hr=function(t){if(t)throw new Error(`The global config is readonly. Please create a mathjs instance if you want to change the default configuration. Example: import { create, all } from 'mathjs'; const mathjs = create(all); mathjs.config({ number: 'BigNumber' }); `);return Object.freeze(Wf)};Nc(hr,Wf,{MATRIX_OPTIONS:ov,NUMBER_OPTIONS:uv});function Ol(){return!0}function ur(){return!1}function Wn(){}const Rl="Argument is not a typed-function.";function Kf(){function e(A){return typeof A=="object"&&A!==null&&A.constructor===Object}const t=[{name:"number",test:function(A){return typeof A=="number"}},{name:"string",test:function(A){return typeof A=="string"}},{name:"boolean",test:function(A){return typeof A=="boolean"}},{name:"Function",test:function(A){return typeof A=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(A){return A instanceof Date}},{name:"RegExp",test:function(A){return A instanceof RegExp}},{name:"Object",test:e},{name:"null",test:function(A){return A===null}},{name:"undefined",test:function(A){return A===void 0}}],r={name:"any",test:Ol,isAny:!0};let n,i,o=0,u={createCount:0};function l(A){const T=n.get(A);if(T)return T;let R='Unknown type "'+A+'"';const z=A.toLowerCase();let V;for(V of i)if(V.toLowerCase()===z){R+='. Did you mean "'+V+'" ?';break}throw new TypeError(R)}function f(A){let T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any";const R=T?l(T).index:i.length,z=[];for(let U=0;U<A.length;++U){if(!A[U]||typeof A[U].name!="string"||typeof A[U].test!="function")throw new TypeError("Object with properties {name: string, test: function} expected");const X=A[U].name;if(n.has(X))throw new TypeError('Duplicate type name "'+X+'"');z.push(X),n.set(X,{name:X,test:A[U].test,isAny:A[U].isAny,index:R+U,conversionsTo:[]})}const V=i.slice(R);i=i.slice(0,R).concat(z).concat(V);for(let U=R+z.length;U<i.length;++U)n.get(i[U]).index=U}function h(){n=new Map,i=[],o=0,f([r],!1)}h(),f(t);function s(){let A;for(A of i)n.get(A).conversionsTo=[];o=0}function a(A){const T=i.filter(R=>{const z=n.get(R);return!z.isAny&&z.test(A)});return T.length?T:["any"]}function c(A){return A&&typeof A=="function"&&"_typedFunctionData"in A}function p(A,T,R){if(!c(A))throw new TypeError(Rl);const z=R&&R.exact,V=Array.isArray(T)?T.join(","):T,U=w(V),X=g(U);if(!z||X in A.signatures){const Be=A._typedFunctionData.signatureMap.get(X);if(Be)return Be}const W=U.length;let Y;if(z){Y=[];let Be;for(Be in A.signatures)Y.push(A._typedFunctionData.signatureMap.get(Be))}else Y=A._typedFunctionData.signatures;for(let Be=0;Be<W;++Be){const xe=U[Be],je=[];let ht;for(ht of Y){const gt=S(ht.params,Be);if(!(!gt||xe.restParam&&!gt.restParam)){if(!gt.hasAny){const Ct=v(gt);if(xe.types.some(At=>!Ct.has(At.name)))continue}je.push(ht)}}if(Y=je,Y.length===0)break}let q;for(q of Y)if(q.params.length<=W)return q;throw new TypeError("Signature not found (signature: "+(A.name||"unnamed")+"("+g(U,", ")+"))")}function D(A,T,R){return p(A,T,R).implementation}function d(A,T){const R=l(T);if(R.test(A))return A;const z=R.conversionsTo;if(z.length===0)throw new Error("There are no conversions to "+T+" defined.");for(let V=0;V<z.length;V++)if(l(z[V].from).test(A))return z[V].convert(A);throw new Error("Cannot convert "+A+" to "+T)}function g(A){let T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:",";return A.map(R=>R.name).join(T)}function m(A){const T=A.indexOf("...")===0,z=(T?A.length>3?A.slice(3):"any":A).split("|").map(W=>l(W.trim()));let V=!1,U=T?"...":"";return{types:z.map(function(W){return V=W.isAny||V,U+=W.name+"|",{name:W.name,typeIndex:W.index,test:W.test,isAny:W.isAny,conversion:null,conversionIndex:-1}}),name:U.slice(0,-1),hasAny:V,hasConversion:!1,restParam:T}}function y(A){const T=A.types.map(X=>X.name),R=oe(T);let z=A.hasAny,V=A.name;const U=R.map(function(X){const W=l(X.from);return z=W.isAny||z,V+="|"+X.from,{name:X.from,typeIndex:W.index,test:W.test,isAny:W.isAny,conversion:X,conversionIndex:X.index}});return{types:A.types.concat(U),name:V,hasAny:z,hasConversion:U.length>0,restParam:A.restParam}}function v(A){return A.typeSet||(A.typeSet=new Set,A.types.forEach(T=>A.typeSet.add(T.name))),A.typeSet}function w(A){const T=[];if(typeof A!="string")throw new TypeError("Signatures must be strings");const R=A.trim();if(R==="")return T;const z=R.split(",");for(let V=0;V<z.length;++V){const U=m(z[V].trim());if(U.restParam&&V!==z.length-1)throw new SyntaxError('Unexpected rest parameter "'+z[V]+'": only allowed for the last parameter');if(U.types.length===0)return null;T.push(U)}return T}function E(A){const T=Pe(A);return T?T.restParam:!1}function C(A){if(!A||A.types.length===0)return Ol;if(A.types.length===1)return l(A.types[0].name).test;if(A.types.length===2){const T=l(A.types[0].name).test,R=l(A.types[1].name).test;return function(V){return T(V)||R(V)}}else{const T=A.types.map(function(R){return l(R.name).test});return function(z){for(let V=0;V<T.length;V++)if(T[V](z))return!0;return!1}}}function F(A){let T,R,z;if(E(A)){T=st(A).map(C);const V=T.length,U=C(Pe(A)),X=function(W){for(let Y=V;Y<W.length;Y++)if(!U(W[Y]))return!1;return!0};return function(Y){for(let q=0;q<T.length;q++)if(!T[q](Y[q]))return!1;return X(Y)&&Y.length>=V+1}}else return A.length===0?function(U){return U.length===0}:A.length===1?(R=C(A[0]),function(U){return R(U[0])&&U.length===1}):A.length===2?(R=C(A[0]),z=C(A[1]),function(U){return R(U[0])&&z(U[1])&&U.length===2}):(T=A.map(C),function(U){for(let X=0;X<T.length;X++)if(!T[X](U[X]))return!1;return U.length===T.length})}function S(A,T){return T<A.length?A[T]:E(A)?Pe(A):null}function b(A,T){const R=S(A,T);return R?v(R):new Set}function P(A){return A.conversion===null||A.conversion===void 0}function B(A,T){const R=new Set;return A.forEach(z=>{const V=b(z.params,T);let U;for(U of V)R.add(U)}),R.has("any")?["any"]:Array.from(R)}function k(A,T,R){let z,V;const U=A||"unnamed";let X=R,W;for(W=0;W<T.length;W++){const xe=[];if(X.forEach(je=>{const ht=S(je.params,W),gt=C(ht);(W<je.params.length||E(je.params))&&gt(T[W])&&xe.push(je)}),xe.length===0){if(V=B(X,W),V.length>0){const je=a(T[W]);return z=new TypeError("Unexpected type of argument in function "+U+" (expected: "+V.join(" or ")+", actual: "+je.join(" | ")+", index: "+W+")"),z.data={category:"wrongType",fn:U,index:W,actual:je,expected:V},z}}else X=xe}const Y=X.map(function(xe){return E(xe.params)?1/0:xe.params.length});if(T.length<Math.min.apply(null,Y))return V=B(X,W),z=new TypeError("Too few arguments in function "+U+" (expected: "+V.join(" or ")+", index: "+T.length+")"),z.data={category:"tooFewArgs",fn:U,index:T.length,expected:V},z;const q=Math.max.apply(null,Y);if(T.length>q)return z=new TypeError("Too many arguments in function "+U+" (expected: "+q+", actual: "+T.length+")"),z.data={category:"tooManyArgs",fn:U,index:T.length,expectedLength:q},z;const Be=[];for(let xe=0;xe<T.length;++xe)Be.push(a(T[xe]).join("|"));return z=new TypeError('Arguments of type "'+Be.join(", ")+'" do not match any of the defined signatures of function '+U+"."),z.data={category:"mismatch",actual:Be},z}function H(A){let T=i.length+1;for(let R=0;R<A.types.length;R++)P(A.types[R])&&(T=Math.min(T,A.types[R].typeIndex));return T}function M(A){let T=o+1;for(let R=0;R<A.types.length;R++)P(A.types[R])||(T=Math.min(T,A.types[R].conversionIndex));return T}function I(A,T){if(A.hasAny){if(!T.hasAny)return 1}else if(T.hasAny)return-1;if(A.restParam){if(!T.restParam)return 1}else if(T.restParam)return-1;if(A.hasConversion){if(!T.hasConversion)return 1}else if(T.hasConversion)return-1;const R=H(A)-H(T);if(R<0)return-1;if(R>0)return 1;const z=M(A)-M(T);return z<0?-1:z>0?1:0}function O(A,T){const R=A.params,z=T.params,V=Pe(R),U=Pe(z),X=E(R),W=E(z);if(X&&V.hasAny){if(!W||!U.hasAny)return 1}else if(W&&U.hasAny)return-1;let Y=0,q=0,Be;for(Be of R)Be.hasAny&&++Y,Be.hasConversion&&++q;let xe=0,je=0;for(Be of z)Be.hasAny&&++xe,Be.hasConversion&&++je;if(Y!==xe)return Y-xe;if(X&&V.hasConversion){if(!W||!U.hasConversion)return 1}else if(W&&U.hasConversion)return-1;if(q!==je)return q-je;if(X){if(!W)return 1}else if(W)return-1;const ht=(R.length-z.length)*(X?-1:1);if(ht!==0)return ht;const gt=[];let Ct=0;for(let pr=0;pr<R.length;++pr){const Zr=I(R[pr],z[pr]);gt.push(Zr),Ct+=Zr}if(Ct!==0)return Ct;let At;for(At of gt)if(At!==0)return At;return 0}function oe(A){if(A.length===0)return[];const T=A.map(l);A.length>1&&T.sort((V,U)=>V.index-U.index);let R=T[0].conversionsTo;if(A.length===1)return R;R=R.concat([]);const z=new Set(A);for(let V=1;V<T.length;++V){let U;for(U of T[V].conversionsTo)z.has(U.from)||(R.push(U),z.add(U.from))}return R}function ee(A,T){let R=T;if(A.some(V=>V.hasConversion)){const V=E(A),U=A.map(re);R=function(){const W=[],Y=V?arguments.length-1:arguments.length;for(let q=0;q<Y;q++)W[q]=U[q](arguments[q]);return V&&(W[Y]=arguments[Y].map(U[Y])),T.apply(this,W)}}let z=R;if(E(A)){const V=A.length-1;z=function(){return R.apply(this,Ae(arguments,0,V).concat([Ae(arguments,V)]))}}return z}function re(A){let T,R,z,V;const U=[],X=[];switch(A.types.forEach(function(W){W.conversion&&(U.push(l(W.conversion.from).test),X.push(W.conversion.convert))}),X.length){case 0:return function(Y){return Y};case 1:return T=U[0],z=X[0],function(Y){return T(Y)?z(Y):Y};case 2:return T=U[0],R=U[1],z=X[0],V=X[1],function(Y){return T(Y)?z(Y):R(Y)?V(Y):Y};default:return function(Y){for(let q=0;q<X.length;q++)if(U[q](Y))return X[q](Y);return Y}}}function fe(A){function T(R,z,V){if(z<R.length){const U=R[z];let X=[];if(U.restParam){const W=U.types.filter(P);W.length<U.types.length&&X.push({types:W,name:"..."+W.map(Y=>Y.name).join("|"),hasAny:W.some(Y=>Y.isAny),hasConversion:!1,restParam:!0}),X.push(U)}else X=U.types.map(function(W){return{types:[W],name:W.name,hasAny:W.isAny,hasConversion:W.conversion,restParam:!1}});return ke(X,function(W){return T(R,z+1,V.concat([W]))})}else return[V]}return T(A,0,[])}function he(A,T){const R=Math.max(A.length,T.length);for(let W=0;W<R;W++){const Y=b(A,W),q=b(T,W);let Be=!1,xe;for(xe of q)if(Y.has(xe)){Be=!0;break}if(!Be)return!1}const z=A.length,V=T.length,U=E(A),X=E(T);return U?X?z===V:V>=z:X?z>=V:z===V}function Me(A){return A.map(T=>wt(T)?tt(T.referToSelf.callback):xt(T)?Ie(T.referTo.references,T.referTo.callback):T)}function ue(A,T,R){const z=[];let V;for(V of A){let U=R[V];if(typeof U!="number")throw new TypeError('No definition for referenced signature "'+V+'"');if(U=T[U],typeof U!="function")return!1;z.push(U)}return z}function Qe(A,T,R){const z=Me(A),V=new Array(z.length).fill(!1);let U=!0;for(;U;){U=!1;let X=!0;for(let W=0;W<z.length;++W){if(V[W])continue;const Y=z[W];if(wt(Y))z[W]=Y.referToSelf.callback(R),z[W].referToSelf=Y.referToSelf,V[W]=!0,X=!1;else if(xt(Y)){const q=ue(Y.referTo.references,z,T);q?(z[W]=Y.referTo.callback.apply(this,q),z[W].referTo=Y.referTo,V[W]=!0,X=!1):U=!0}}if(X&&U)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return z}function ve(A){const T=/\bthis(\(|\.signatures\b)/;Object.keys(A).forEach(R=>{const z=A[R];if(T.test(z.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function qe(A,T){if(u.createCount++,Object.keys(T).length===0)throw new SyntaxError("No signatures provided");u.warnAgainstDeprecatedThis&&ve(T);const R=[],z=[],V={},U=[];let X;for(X in T){if(!Object.prototype.hasOwnProperty.call(T,X))continue;const pe=w(X);if(!pe)continue;R.forEach(function(ot){if(he(ot,pe))throw new TypeError('Conflicting signatures "'+g(ot)+'" and "'+g(pe)+'".')}),R.push(pe);const Le=z.length;z.push(T[X]);const Pt=pe.map(y);let Yt;for(Yt of fe(Pt)){const ot=g(Yt);U.push({params:Yt,name:ot,fn:Le}),Yt.every(wn=>!wn.hasConversion)&&(V[ot]=Le)}}U.sort(O);const W=Qe(z,V,nt);let Y;for(Y in V)Object.prototype.hasOwnProperty.call(V,Y)&&(V[Y]=W[V[Y]]);const q=[],Be=new Map;for(Y of U)Be.has(Y.name)||(Y.fn=W[Y.fn],q.push(Y),Be.set(Y.name,Y));const xe=q[0]&&q[0].params.length<=2&&!E(q[0].params),je=q[1]&&q[1].params.length<=2&&!E(q[1].params),ht=q[2]&&q[2].params.length<=2&&!E(q[2].params),gt=q[3]&&q[3].params.length<=2&&!E(q[3].params),Ct=q[4]&&q[4].params.length<=2&&!E(q[4].params),At=q[5]&&q[5].params.length<=2&&!E(q[5].params),pr=xe&&je&&ht&&gt&&Ct&&At;for(let pe=0;pe<q.length;++pe)q[pe].test=F(q[pe].params);const Zr=xe?C(q[0].params[0]):ur,dt=je?C(q[1].params[0]):ur,Sr=ht?C(q[2].params[0]):ur,mn=gt?C(q[3].params[0]):ur,gn=Ct?C(q[4].params[0]):ur,Ze=At?C(q[5].params[0]):ur,Ir=xe?C(q[0].params[1]):ur,kn=je?C(q[1].params[1]):ur,In=ht?C(q[2].params[1]):ur,Ln=gt?C(q[3].params[1]):ur,vn=Ct?C(q[4].params[1]):ur,rt=At?C(q[5].params[1]):ur;for(let pe=0;pe<q.length;++pe)q[pe].implementation=ee(q[pe].params,q[pe].fn);const Vt=xe?q[0].implementation:Wn,Lr=je?q[1].implementation:Wn,zn=ht?q[2].implementation:Wn,$n=gt?q[3].implementation:Wn,Un=Ct?q[4].implementation:Wn,qn=At?q[5].implementation:Wn,Zt=xe?q[0].params.length:-1,jn=je?q[1].params.length:-1,Vn=ht?q[2].params.length:-1,Dn=gt?q[3].params.length:-1,yn=Ct?q[4].params.length:-1,Hn=At?q[5].params.length:-1,ae=pr?6:0,x=q.length,G=q.map(pe=>pe.test),ne=q.map(pe=>pe.implementation),ze=function(){for(let Le=ae;Le<x;Le++)if(G[Le](arguments))return ne[Le].apply(this,arguments);return u.onMismatch(A,arguments,q)};function nt(pe,Le){return arguments.length===Zt&&Zr(pe)&&Ir(Le)?Vt.apply(this,arguments):arguments.length===jn&&dt(pe)&&kn(Le)?Lr.apply(this,arguments):arguments.length===Vn&&Sr(pe)&&In(Le)?zn.apply(this,arguments):arguments.length===Dn&&mn(pe)&&Ln(Le)?$n.apply(this,arguments):arguments.length===yn&&gn(pe)&&vn(Le)?Un.apply(this,arguments):arguments.length===Hn&&Ze(pe)&&rt(Le)?qn.apply(this,arguments):ze.apply(this,arguments)}try{Object.defineProperty(nt,"name",{value:A})}catch{}return nt.signatures=V,nt._typedFunctionData={signatures:q,signatureMap:Be},nt}function Re(A,T,R){throw k(A,T,R)}function st(A){return Ae(A,0,A.length-1)}function Pe(A){return A[A.length-1]}function Ae(A,T,R){return Array.prototype.slice.call(A,T,R)}function et(A,T){for(let R=0;R<A.length;R++)if(T(A[R]))return A[R]}function ke(A,T){return Array.prototype.concat.apply([],A.map(T))}function Ne(){const A=st(arguments).map(R=>g(w(R))),T=Pe(arguments);if(typeof T!="function")throw new TypeError("Callback function expected as last argument");return Ie(A,T)}function Ie(A,T){return{referTo:{references:A,callback:T}}}function tt(A){if(typeof A!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:A}}}function xt(A){return A&&typeof A.referTo=="object"&&Array.isArray(A.referTo.references)&&typeof A.referTo.callback=="function"}function wt(A){return A&&typeof A.referToSelf=="object"&&typeof A.referToSelf.callback=="function"}function Dt(A,T){if(!A)return T;if(T&&T!==A){const R=new Error("Function names do not match (expected: "+A+", actual: "+T+")");throw R.data={actual:T,expected:A},R}return A}function Et(A){let T;for(const R in A)Object.prototype.hasOwnProperty.call(A,R)&&(c(A[R])||typeof A[R].signature=="string")&&(T=Dt(T,A[R].name));return T}function Ar(A,T){let R;for(R in T)if(Object.prototype.hasOwnProperty.call(T,R)){if(R in A&&T[R]!==A[R]){const z=new Error('Signature "'+R+'" is defined twice');throw z.data={signature:R,sourceFunction:T[R],destFunction:A[R]},z}A[R]=T[R]}}const dn=u;u=function(A){const T=typeof A=="string",R=T?1:0;let z=T?A:"";const V={};for(let U=R;U<arguments.length;++U){const X=arguments[U];let W={},Y;if(typeof X=="function"?(Y=X.name,typeof X.signature=="string"?W[X.signature]=X:c(X)&&(W=X.signatures)):e(X)&&(W=X,T||(Y=Et(X))),Object.keys(W).length===0){const q=new TypeError("Argument to 'typed' at index "+U+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw q.data={index:U,argument:X},q}T||(z=Dt(z,Y)),Ar(V,W)}return qe(z||"",V)},u.create=Kf,u.createCount=dn.createCount,u.onMismatch=Re,u.throwMismatchError=Re,u.createError=k,u.clear=h,u.clearConversions=s,u.addTypes=f,u._findType=l,u.referTo=Ne,u.referToSelf=tt,u.convert=d,u.findSignature=p,u.find=D,u.isTypedFunction=c,u.warnAgainstDeprecatedThis=!0,u.addType=function(A,T){let R="any";T!==!1&&n.has("Object")&&(R="Object"),u.addTypes([A],R)};function pn(A){if(!A||typeof A.from!="string"||typeof A.to!="string"||typeof A.convert!="function")throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(A.to===A.from)throw new SyntaxError('Illegal to define conversion from "'+A.from+'" to itself.')}return u.addConversion=function(A){pn(A);const T=l(A.to);if(T.conversionsTo.every(function(R){return R.from!==A.from}))T.conversionsTo.push({from:A.from,convert:A.convert,index:o++});else throw new Error('There is already a conversion from "'+A.from+'" to "'+T.name+'"')},u.addConversions=function(A){A.forEach(u.addConversion)},u.removeConversion=function(A){pn(A);const T=l(A.to),R=et(T.conversionsTo,V=>V.from===A.from);if(!R)throw new Error("Attempt to remove nonexistent conversion from "+A.from+" to "+A.to);if(R.convert!==A.convert)throw new Error("Conversion to remove does not match existing conversion");const z=T.conversionsTo.indexOf(R);T.conversionsTo.splice(z,1)},u.resolve=function(A,T){if(!c(A))throw new TypeError(Rl);const R=A._typedFunctionData.signatures;for(let z=0;z<R.length;++z)if(R[z].test(T))return R[z];return null},u}const Qn=Kf();function vt(e){return typeof e=="boolean"?!0:isFinite(e)?e===Math.round(e):!1}function Hu(e,t,r){var n={2:"0b",8:"0o",16:"0x"},i=n[t],o="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!vt(r))throw new Error("size must be an integer");if(e>2**(r-1)-1||e<-(2**(r-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!vt(e))throw new Error("Value must be an integer");e<0&&(e=e+2**r),o="i".concat(r)}var u="";return e<0&&(e=-e,u="-"),"".concat(u).concat(i).concat(e.toString(t)).concat(o)}function wa(e,t){if(typeof t=="function")return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var r="auto",n,i;if(t&&(t.notation&&(r=t.notation),ut(t)?n=t:ut(t.precision)&&(n=t.precision),t.wordSize&&(i=t.wordSize,typeof i!="number")))throw new Error('Option "wordSize" must be a number');switch(r){case"fixed":return sv(e,n);case"exponential":return Jf(e,n);case"engineering":return av(e,n);case"bin":return Hu(e,2,i);case"oct":return Hu(e,8,i);case"hex":return Hu(e,16,i);case"auto":return lv(e,n,t&&t).replace(/((\.\d*?)(0+))($|e)/,function(){var o=arguments[2],u=arguments[4];return o!=="."?o+u:u});default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function su(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var r=t[1],n=t[2],i=parseFloat(t[4]||"0"),o=n.indexOf(".");i+=o!==-1?o-1:n.length-1;var u=n.replace(".","").replace(/^0*/,function(l){return i-=l.length,""}).replace(/0*$/,"").split("").map(function(l){return parseInt(l)});return u.length===0&&(u.push(0),i++),{sign:r,coefficients:u,exponent:i}}function av(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=su(e),n=lu(r,t),i=n.exponent,o=n.coefficients,u=i%3===0?i:i<0?i-3-i%3:i-i%3;if(ut(t))for(;t>o.length||i-u+1>o.length;)o.push(0);else for(var l=Math.abs(i-u)-(o.length-1),f=0;f<l;f++)o.push(0);for(var h=Math.abs(i-u),s=1;h>0;)s++,h--;var a=o.slice(s).join(""),c=ut(t)&&a.length||a.match(/[1-9]/)?"."+a:"",p=o.slice(0,s).join("")+c+"e"+(i>=0?"+":"")+u.toString();return n.sign+p}function sv(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=su(e),n=typeof t=="number"?lu(r,r.exponent+1+t):r,i=n.coefficients,o=n.exponent+1,u=o+(t||0);return i.length<u&&(i=i.concat(Yn(u-i.length))),o<0&&(i=Yn(-o+1).concat(i),o=1),o<i.length&&i.splice(o,0,o===0?"0.":"."),n.sign+i.join("")}function Jf(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=su(e),n=t?lu(r,t):r,i=n.coefficients,o=n.exponent;i.length<t&&(i=i.concat(Yn(t-i.length)));var u=i.shift();return n.sign+u+(i.length>0?"."+i.join(""):"")+"e"+(o>=0?"+":"")+o}function lv(e,t,r){if(isNaN(e)||!isFinite(e))return String(e);var n=r&&r.lowerExp!==void 0?r.lowerExp:-3,i=r&&r.upperExp!==void 0?r.upperExp:5,o=su(e),u=t?lu(o,t):o;if(u.exponent<n||u.exponent>=i)return Jf(e,t);var l=u.coefficients,f=u.exponent;l.length<t&&(l=l.concat(Yn(t-l.length))),l=l.concat(Yn(f-l.length+1+(l.length<t?t-l.length:0))),l=Yn(-f).concat(l);var h=f>0?f:0;return h<l.length-1&&l.splice(h+1,0,"."),u.sign+l.join("")}function lu(e,t){for(var r={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},n=r.coefficients;t<=0;)n.unshift(0),r.exponent++,t++;if(n.length>t){var i=n.splice(t,n.length-t);if(i[0]>=5){var o=t-1;for(n[o]++;n[o]===10;)n.pop(),o===0&&(n.unshift(0),r.exponent++,o++),o--,n[o]++}}return r}function Yn(e){for(var t=[],r=0;r<e;r++)t.push(0);return t}function cv(e){return e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length}var fv=Number.EPSILON||2220446049250313e-31;function Pn(e,t,r){if(r==null)return e===t;if(e===t)return!0;if(isNaN(e)||isNaN(t))return!1;if(isFinite(e)&&isFinite(t)){var n=Math.abs(e-t);return n<fv?!0:n<=Math.max(Math.abs(e),Math.abs(t))*r}return!1}function Wu(e,t,r){var n=e.constructor,i=new n(2),o="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!vt(r))throw new Error("size must be an integer");if(e.greaterThan(i.pow(r-1).sub(1))||e.lessThan(i.pow(r-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(i.pow(r))),o="i".concat(r)}switch(t){case 2:return"".concat(e.toBinary()).concat(o);case 8:return"".concat(e.toOctal()).concat(o);case 16:return"".concat(e.toHexadecimal()).concat(o);default:throw new Error("Base ".concat(t," not supported "))}}function hv(e,t){if(typeof t=="function")return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var r="auto",n,i;if(t!==void 0&&(t.notation&&(r=t.notation),typeof t=="number"?n=t:t.precision!==void 0&&(n=t.precision),t.wordSize&&(i=t.wordSize,typeof i!="number")))throw new Error('Option "wordSize" must be a number');switch(r){case"fixed":return pv(e,n);case"exponential":return Pl(e,n);case"engineering":return dv(e,n);case"bin":return Wu(e,2,i);case"oct":return Wu(e,8,i);case"hex":return Wu(e,16,i);case"auto":{var o=t&&t.lowerExp!==void 0?t.lowerExp:-3,u=t&&t.upperExp!==void 0?t.upperExp:5;if(e.isZero())return"0";var l,f=e.toSignificantDigits(n),h=f.e;return h>=o&&h<u?l=f.toFixed():l=Pl(e,n),l.replace(/((\.\d*?)(0+))($|e)/,function(){var s=arguments[2],a=arguments[4];return s!=="."?s+a:a})}default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function dv(e,t){var r=e.e,n=r%3===0?r:r<0?r-3-r%3:r-r%3,i=e.mul(Math.pow(10,-n)),o=i.toPrecision(t);if(o.indexOf("e")!==-1){var u=e.constructor;o=new u(o).toFixed()}return o+"e"+(r>=0?"+":"")+n.toString()}function Pl(e,t){return t!==void 0?e.toExponential(t-1):e.toExponential()}function pv(e,t){return e.toFixed(t)}function yt(e,t){var r=mv(e,t);return t&&typeof t=="object"&&"truncate"in t&&r.length>t.truncate?r.substring(0,t.truncate-3)+"...":r}function mv(e,t){if(typeof e=="number")return wa(e,t);if(bt(e))return hv(e,t);if(gv(e))return!t||t.fraction!=="decimal"?e.s*e.n+"/"+e.d:e.toString();if(Array.isArray(e))return eh(e,t);if(Rr(e))return kl(e);if(typeof e=="function")return e.syntax?String(e.syntax):"function";if(e&&typeof e=="object"){if(typeof e.format=="function")return e.format(t);if(e&&e.toString(t)!=={}.toString())return e.toString(t);var r=Object.keys(e).map(n=>kl(n)+": "+yt(e[n],t));return"{"+r.join(", ")+"}"}return String(e)}function kl(e){for(var t=String(e),r="",n=0;n<t.length;){var i=t.charAt(n);r+=i in Il?Il[i]:i,n++}return'"'+r+'"'}var Il={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"};function eh(e,t){if(Array.isArray(e)){for(var r="[",n=e.length,i=0;i<n;i++)i!==0&&(r+=", "),r+=eh(e[i],t);return r+="]",r}else return yt(e,t)}function gv(e){return e&&typeof e=="object"&&typeof e.s=="number"&&typeof e.n=="number"&&typeof e.d=="number"||!1}function Ue(e,t,r){if(!(this instanceof Ue))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=r,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=new Error().stack}Ue.prototype=new RangeError;Ue.prototype.constructor=RangeError;Ue.prototype.name="DimensionError";Ue.prototype.isDimensionError=!0;function Qr(e,t,r){if(!(this instanceof Qr))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=r),this.min!==void 0&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":this.max!==void 0&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=new Error().stack}Qr.prototype=new RangeError;Qr.prototype.constructor=RangeError;Qr.prototype.name="IndexError";Qr.prototype.isIndexError=!0;function $t(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function th(e,t,r){var n,i=e.length;if(i!==t[r])throw new Ue(i,t[r]);if(r<t.length-1){var o=r+1;for(n=0;n<i;n++){var u=e[n];if(!Array.isArray(u))throw new Ue(t.length-1,t.length,"<");th(e[n],t,o)}}else for(n=0;n<i;n++)if(Array.isArray(e[n]))throw new Ue(t.length+1,t.length,">")}function Ll(e,t){var r=t.length===0;if(r){if(Array.isArray(e))throw new Ue(e.length,0)}else th(e,t,0)}function ft(e,t){if(e!==void 0){if(!ut(e)||!vt(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||typeof t=="number"&&e>=t)throw new Qr(e,t)}}function Ea(e,t,r){if(!Array.isArray(t))throw new TypeError("Array expected");if(t.length===0)throw new Error("Resizing to scalar is not supported");t.forEach(function(i){if(!ut(i)||!vt(i)||i<0)throw new TypeError("Invalid size, must contain positive integers (size: "+yt(t)+")")}),(ut(e)||bt(e))&&(e=[e]);var n=r!==void 0?r:0;return Ca(e,t,0,n),e}function Ca(e,t,r,n){var i,o,u=e.length,l=t[r],f=Math.min(u,l);if(e.length=l,r<t.length-1){var h=r+1;for(i=0;i<f;i++)o=e[i],Array.isArray(o)||(o=[o],e[i]=o),Ca(o,t,h,n);for(i=f;i<l;i++)o=[],e[i]=o,Ca(o,t,h,n)}else{for(i=0;i<f;i++)for(;Array.isArray(e[i]);)e[i]=e[i][0];for(i=f;i<l;i++)e[i]=n}}function rh(e,t){var r=uh(e),n=r.length;if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Array expected");if(t.length===0)throw new Ue(0,n,"!=");t=es(t,n);var i=nh(t);if(n!==i)throw new Ue(i,n,"!=");try{return vv(r,t)}catch(o){throw o instanceof Ue?new Ue(i,n,"!="):o}}function es(e,t){var r=nh(e),n=e.slice(),i=-1,o=e.indexOf(i),u=e.indexOf(i,o+1)>=0;if(u)throw new Error("More than one wildcard in sizes");var l=o>=0,f=t%r===0;if(l)if(f)n[o]=-t/r;else throw new Error("Could not replace wildcard, since "+t+" is no multiple of "+-r);return n}function nh(e){return e.reduce((t,r)=>t*r,1)}function vv(e,t){for(var r=e,n,i=t.length-1;i>0;i--){var o=t[i];n=[];for(var u=r.length/o,l=0;l<u;l++)n.push(r.slice(l*o,(l+1)*o));r=n}return r}function ih(e,t,r,n){var i=n||$t(e);if(r)for(var o=0;o<r;o++)e=[e],i.unshift(1);for(e=oh(e,t,0);i.length<t;)i.push(1);return e}function oh(e,t,r){var n,i;if(Array.isArray(e)){var o=r+1;for(n=0,i=e.length;n<i;n++)e[n]=oh(e[n],t,o)}else for(var u=r;u<t;u++)e=[e];return e}function uh(e){if(!Array.isArray(e))return e;var t=[];return e.forEach(function r(n){Array.isArray(n)?n.forEach(r):t.push(n)}),t}function Vo(e,t){for(var r,n=0,i=0;i<e.length;i++){var o=e[i],u=Array.isArray(o);if(i===0&&u&&(n=o.length),u&&o.length!==n)return;var l=u?Vo(o,t):t(o);if(r===void 0)r=l;else if(r!==l)return"mixed"}return r}function ah(e,t,r,n){if(n<r){if(e.length!==t.length)throw new Ue(e.length,t.length);for(var i=[],o=0;o<e.length;o++)i[o]=ah(e[o],t[o],r,n+1);return i}else return e.concat(t)}function sh(){var e=Array.prototype.slice.call(arguments,0,-1),t=Array.prototype.slice.call(arguments,-1);if(e.length===1)return e[0];if(e.length>1)return e.slice(1).reduce(function(r,n){return ah(r,n,t,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function Dv(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=t.map(c=>c.length),i=Math.max(...n),o=new Array(i).fill(null),u=0;u<t.length;u++)for(var l=t[u],f=n[u],h=0;h<f;h++){var s=i-f+h;l[h]>o[s]&&(o[s]=l[h])}for(var a=0;a<t.length;a++)Ho(t[a],o);return o}function Ho(e,t){for(var r=t.length,n=e.length,i=0;i<n;i++){var o=r-n+i;if(e[i]<t[o]&&e[i]>1||e[i]>t[o])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(n," with size ").concat(e[i]," to size ").concat(t[o]))}}function zl(e,t){var r=$t(e);if(di(r,t))return e;Ho(r,t);var n=Dv(r,t),i=n.length,o=[...Array(i-r.length).fill(1),...r],u=wv(e);r.length<i&&(u=rh(u,o),r=$t(u));for(var l=0;l<i;l++)r[l]<n[l]&&(u=yv(u,n[l],l),r=$t(u));return u}function yv(e,t,r){return sh(...Array(t).fill(e),r)}function wv(e){return Nc([],e)}function ie(e,t,r,n){function i(o){var u=iv(o,t.map(Av));return Ev(e,t,o),r(u)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),n&&(i.meta=n),i}function Ev(e,t,r){var n=t.filter(o=>!Cv(o)).every(o=>r[o]!==void 0);if(!n){var i=t.filter(o=>r[o]===void 0);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(i.map(o=>'"'.concat(o,'"')).join(", "),"."))}}function Cv(e){return e&&e[0]==="?"}function Av(e){return e&&e[0]==="?"?e.slice(1):e}function Sv(e,t){if(ch(e)&&lh(e,t))return e[t];throw typeof e[t]=="function"&&xv(e,t)?new Error('Cannot access method "'+t+'" as a property'):new Error('No access to property "'+t+'"')}function Fv(e,t,r){if(ch(e)&&lh(e,t))return e[t]=r,r;throw new Error('No access to property "'+t+'"')}function bv(e,t){return t in e}function lh(e,t){return!e||typeof e!="object"?!1:ji(Tv,t)?!0:!(t in Object.prototype||t in Function.prototype)}function xv(e,t){return e==null||typeof e[t]!="function"||ji(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)?!1:ji(_v,t)?!0:!(t in Object.prototype||t in Function.prototype)}function ch(e){return typeof e=="object"&&e&&e.constructor===Object}var Tv={length:!0,name:!0},_v={toString:!0,valueOf:!0,toLocaleString:!0};class Mv{constructor(t){this.wrappedObject=t}keys(){return Object.keys(this.wrappedObject)}get(t){return Sv(this.wrappedObject,t)}set(t,r){return Fv(this.wrappedObject,t,r),this}has(t){return bv(this.wrappedObject,t)}}function Nv(e){return e?e instanceof Map||e instanceof Mv||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}var fh=function(){return fh=Qn.create,Qn},Bv=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],Ov=ie("typed",Bv,function(t){var{BigNumber:r,Complex:n,DenseMatrix:i,Fraction:o}=t,u=fh();return u.clear(),u.addTypes([{name:"number",test:ut},{name:"Complex",test:Gf},{name:"BigNumber",test:bt},{name:"Fraction",test:Qf},{name:"Unit",test:Zf},{name:"identifier",test:l=>Rr&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(l)},{name:"string",test:Rr},{name:"Chain",test:rv},{name:"Array",test:ct},{name:"Matrix",test:at},{name:"DenseMatrix",test:_g},{name:"SparseMatrix",test:Mg},{name:"Range",test:Ng},{name:"Index",test:Ja},{name:"boolean",test:Bg},{name:"ResultSet",test:Og},{name:"Help",test:Rg},{name:"function",test:Pg},{name:"Date",test:kg},{name:"RegExp",test:Ig},{name:"null",test:Lg},{name:"undefined",test:zg},{name:"AccessorNode",test:$g},{name:"ArrayNode",test:Ug},{name:"AssignmentNode",test:qg},{name:"BlockNode",test:jg},{name:"ConditionalNode",test:Vg},{name:"ConstantNode",test:Hg},{name:"FunctionNode",test:Gg},{name:"FunctionAssignmentNode",test:Wg},{name:"IndexNode",test:Qg},{name:"Node",test:Zg},{name:"ObjectNode",test:Yg},{name:"OperatorNode",test:Xg},{name:"ParenthesisNode",test:Kg},{name:"RangeNode",test:Jg},{name:"RelationalNode",test:ev},{name:"SymbolNode",test:tv},{name:"Map",test:Nv},{name:"Object",test:Yf}]),u.addConversions([{from:"number",to:"BigNumber",convert:function(f){if(r||Gu(f),cv(f)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+f+"). Use function bignumber(x) to convert to BigNumber.");return new r(f)}},{from:"number",to:"Complex",convert:function(f){return n||yo(f),new n(f,0)}},{from:"BigNumber",to:"Complex",convert:function(f){return n||yo(f),new n(f.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(f){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(f){return n||yo(f),new n(f.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(f){o||Qu(f);var h=new o(f);if(h.valueOf()!==f)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+f+"). Use function fraction(x) to convert to Fraction.");return h}},{from:"string",to:"number",convert:function(f){var h=Number(f);if(isNaN(h))throw new Error('Cannot convert "'+f+'" to a number');return h}},{from:"string",to:"BigNumber",convert:function(f){r||Gu(f);try{return new r(f)}catch{throw new Error('Cannot convert "'+f+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(f){o||Qu(f);try{return new o(f)}catch{throw new Error('Cannot convert "'+f+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(f){n||yo(f);try{return new n(f)}catch{throw new Error('Cannot convert "'+f+'" to Complex')}}},{from:"boolean",to:"number",convert:function(f){return+f}},{from:"boolean",to:"BigNumber",convert:function(f){return r||Gu(f),new r(+f)}},{from:"boolean",to:"Fraction",convert:function(f){return o||Qu(f),new o(+f)}},{from:"boolean",to:"string",convert:function(f){return String(f)}},{from:"Array",to:"Matrix",convert:function(f){return i||Rv(),new i(f)}},{from:"Matrix",to:"Array",convert:function(f){return f.valueOf()}}]),u.onMismatch=(l,f,h)=>{var s=u.createError(l,f,h);if(["wrongType","mismatch"].includes(s.data.category)&&f.length===1&&hi(f[0])&&h.some(c=>!c.params.includes(","))){var a=new TypeError("Function '".concat(l,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(l,")'."));throw a.data=s.data,a}throw s},u.onMismatch=(l,f,h)=>{var s=u.createError(l,f,h);if(["wrongType","mismatch"].includes(s.data.category)&&f.length===1&&hi(f[0])&&h.some(c=>!c.params.includes(","))){var a=new TypeError("Function '".concat(l,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(l,")'."));throw a.data=s.data,a}throw s},u});function Gu(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function yo(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function Rv(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function Qu(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}/*! * decimal.js v10.4.3 * An arbitrary-precision Decimal type for JavaScript. * https://github.com/MikeMcl/decimal.js * Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com> * MIT Licence */var Zn=9e15,fn=1e9,Aa="0123456789abcdef",Wo="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Go="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Sa={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Zn,maxE:Zn,crypto:!1},hh,Vr,ye=!0,cu="[DecimalError] ",cn=cu+"Invalid argument: ",dh=cu+"Precision limit exceeded",ph=cu+"crypto unavailable",mh="[object Decimal]",Rt=Math.floor,St=Math.pow,Pv=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,kv=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Iv=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,gh=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Er=1e7,de=7,Lv=9007199254740991,zv=Wo.length-1,Fa=Go.length-1,j={toStringTag:mh};j.absoluteValue=j.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),ce(e)};j.ceil=function(){return ce(new this.constructor(this),this.e+1,2)};j.clampedTo=j.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(cn+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};j.comparedTo=j.cmp=function(e){var t,r,n,i,o=this,u=o.d,l=(e=new o.constructor(e)).d,f=o.s,h=e.s;if(!u||!l)return!f||!h?NaN:f!==h?f:u===l?0:!u^f<0?1:-1;if(!u[0]||!l[0])return u[0]?f:l[0]?-h:0;if(f!==h)return f;if(o.e!==e.e)return o.e>e.e^f<0?1:-1;for(n=u.length,i=l.length,t=0,r=n<i?n:i;t<r;++t)if(u[t]!==l[t])return u[t]>l[t]^f<0?1:-1;return n===i?0:n>i^f<0?1:-1};j.cosine=j.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+de,n.rounding=1,r=$v(n,Eh(n,r)),n.precision=e,n.rounding=t,ce(Vr==2||Vr==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};j.cubeRoot=j.cbrt=function(){var e,t,r,n,i,o,u,l,f,h,s=this,a=s.constructor;if(!s.isFinite()||s.isZero())return new a(s);for(ye=!1,o=s.s*St(s.s*s,1/3),!o||Math.abs(o)==1/0?(r=Nt(s.d),e=s.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=St(r,1/3),e=Rt((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new a(r),n.s=s.s):n=new a(o.toString()),u=(e=a.precision)+3;;)if(l=n,f=l.times(l).times(l),h=f.plus(s),n=Ge(h.plus(s).times(l),h.plus(f),u+2,1),Nt(l.d).slice(0,u)===(r=Nt(n.d)).slice(0,u))if(r=r.slice(u-3,u+1),r=="9999"||!i&&r=="4999"){if(!i&&(ce(l,e+1,0),l.times(l).times(l).eq(s))){n=l;break}u+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(ce(n,e+1,1),t=!n.times(n).times(n).eq(s));break}return ye=!0,ce(n,e,a.rounding,t)};j.decimalPlaces=j.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-Rt(this.e/de))*de,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};j.dividedBy=j.div=function(e){return Ge(this,new this.constructor(e))};j.dividedToIntegerBy=j.divToInt=function(e){var t=this,r=t.constructor;return ce(Ge(t,new r(e),0,1,1),r.precision,r.rounding)};j.equals=j.eq=function(e){return this.cmp(e)===0};j.floor=function(){return ce(new this.constructor(this),this.e+1,3)};j.greaterThan=j.gt=function(e){return this.cmp(e)>0};j.greaterThanOrEqualTo=j.gte=function(e){var t=this.cmp(e);return t==1||t===0};j.hyperbolicCosine=j.cosh=function(){var e,t,r,n,i,o=this,u=o.constructor,l=new u(1);if(!o.isFinite())return new u(o.s?1/0:NaN);if(o.isZero())return l;r=u.precision,n=u.rounding,u.precision=r+Math.max(o.e,o.sd())+4,u.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/hu(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=pi(u,1,o.times(t),new u(1),!0);for(var f,h=e,s=new u(8);h--;)f=o.times(o),o=l.minus(f.times(s.minus(f.times(s))));return ce(o,u.precision=r,u.rounding=n,!0)};j.hyperbolicSine=j.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=pi(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/hu(5,e)),i=pi(o,2,i,i,!0);for(var u,l=new o(5),f=new o(16),h=new o(20);e--;)u=i.times(i),i=i.times(l.plus(u.times(f.times(u).plus(h))))}return o.precision=t,o.rounding=r,ce(i,t,r,!0)};j.hyperbolicTangent=j.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,Ge(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};j.inverseCosine=j.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return n!==-1?n===0?t.isNeg()?yr(r,i,o):new r(0):new r(NaN):t.isZero()?yr(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=yr(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))};j.inverseHyperbolicCosine=j.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,ye=!1,r=r.times(r).minus(1).sqrt().plus(r),ye=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};j.inverseHyperbolicSine=j.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,ye=!1,r=r.times(r).plus(1).sqrt().plus(r),ye=!0,n.precision=e,n.rounding=t,r.ln())};j.inverseHyperbolicTangent=j.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?ce(new o(i),e,t,!0):(o.precision=r=n-i.e,i=Ge(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};j.inverseSine=j.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=yr(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};j.inverseTangent=j.atan=function(){var e,t,r,n,i,o,u,l,f,h=this,s=h.constructor,a=s.precision,c=s.rounding;if(h.isFinite()){if(h.isZero())return new s(h);if(h.abs().eq(1)&&a+4<=Fa)return u=yr(s,a+4,c).times(.25),u.s=h.s,u}else{if(!h.s)return new s(NaN);if(a+4<=Fa)return u=yr(s,a+4,c).times(.5),u.s=h.s,u}for(s.precision=l=a+10,s.rounding=1,r=Math.min(28,l/de+2|0),e=r;e;--e)h=h.div(h.times(h).plus(1).sqrt().plus(1));for(ye=!1,t=Math.ceil(l/de),n=1,f=h.times(h),u=new s(h),i=h;e!==-1;)if(i=i.times(f),o=u.minus(i.div(n+=2)),i=i.times(f),u=o.plus(i.div(n+=2)),u.d[t]!==void 0)for(e=t;u.d[e]===o.d[e]&&e--;);return r&&(u=u.times(2<<r-1)),ye=!0,ce(u,s.precision=a,s.rounding=c,!0)};j.isFinite=function(){return!!this.d};j.isInteger=j.isInt=function(){return!!this.d&&Rt(this.e/de)>this.d.length-2};j.isNaN=function(){return!this.s};j.isNegative=j.isNeg=function(){return this.s<0};j.isPositive=j.isPos=function(){return this.s>0};j.isZero=function(){return!!this.d&&this.d[0]===0};j.lessThan=j.lt=function(e){return this.cmp(e)<0};j.lessThanOrEqualTo=j.lte=function(e){return this.cmp(e)<1};j.logarithm=j.log=function(e){var t,r,n,i,o,u,l,f,h=this,s=h.constructor,a=s.precision,c=s.rounding,p=5;if(e==null)e=new s(10),t=!0;else{if(e=new s(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new s(NaN);t=e.eq(10)}if(r=h.d,h.s<0||!r||!r[0]||h.eq(1))return new s(r&&!r[0]?-1/0:h.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(ye=!1,l=a+p,u=ln(h,l),n=t?Qo(s,l+10):ln(e,l),f=Ge(u,n,l,1),Vi(f.d,i=a,c))do if(l+=10,u=ln(h,l),n=t?Qo(s,l+10):ln(e,l),f=Ge(u,n,l,1),!o){+Nt(f.d).slice(i+1,i+15)+1==1e14&&(f=ce(f,a+1,0));break}while(Vi(f.d,i+=10,c));return ye=!0,ce(f,a,c)};j.minus=j.sub=function(e){var t,r,n,i,o,u,l,f,h,s,a,c,p=this,D=p.constructor;if(e=new D(e),!p.d||!e.d)return!p.s||!e.s?e=new D(NaN):p.d?e.s=-e.s:e=new D(e.d||p.s!==e.s?p:NaN),e;if(p.s!=e.s)return e.s=-e.s,p.plus(e);if(h=p.d,c=e.d,l=D.precision,f=D.rounding,!h[0]||!c[0]){if(c[0])e.s=-e.s;else if(h[0])e=new D(p);else return new D(f===3?-0:0);return ye?ce(e,l,f):e}if(r=Rt(e.e/de),s=Rt(p.e/de),h=h.slice(),o=s-r,o){for(a=o<0,a?(t=h,o=-o,u=c.length):(t=c,r=s,u=h.length),n=Math.max(Math.ceil(l/de),u)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=h.length,u=c.length,a=n<u,a&&(u=n),n=0;n<u;n++)if(h[n]!=c[n]){a=h[n]<c[n];break}o=0}for(a&&(t=h,h=c,c=t,e.s=-e.s),u=h.length,n=c.length-u;n>0;--n)h[u++]=0;for(n=c.length;n>o;){if(h[--n]<c[n]){for(i=n;i&&h[--i]===0;)h[i]=Er-1;--h[i],h[n]+=Er}h[n]-=c[n]}for(;h[--u]===0;)h.pop();for(;h[0]===0;h.shift())--r;return h[0]?(e.d=h,e.e=fu(h,r),ye?ce(e,l,f):e):new D(f===3?-0:0)};j.modulo=j.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?ce(new n(r),n.precision,n.rounding):(ye=!1,n.modulo==9?(t=Ge(r,e.abs(),0,3,1),t.s*=e.s):t=Ge(r,e,0,n.modulo,1),t=t.times(e),ye=!0,r.minus(t))};j.naturalExponential=j.exp=function(){return ba(this)};j.naturalLogarithm=j.ln=function(){return ln(this)};j.negated=j.neg=function(){var e=new this.constructor(this);return e.s=-e.s,ce(e)};j.plus=j.add=function(e){var t,r,n,i,o,u,l,f,h,s,a=this,c=a.constructor;if(e=new c(e),!a.d||!e.d)return!a.s||!e.s?e=new c(NaN):a.d||(e=new c(e.d||a.s===e.s?a:NaN)),e;if(a.s!=e.s)return e.s=-e.s,a.minus(e);if(h=a.d,s=e.d,l=c.precision,f=c.rounding,!h[0]||!s[0])return s[0]||(e=new c(a)),ye?ce(e,l,f):e;if(o=Rt(a.e/de),n=Rt(e.e/de),h=h.slice(),i=o-n,i){for(i<0?(r=h,i=-i,u=s.length):(r=s,n=o,u=h.length),o=Math.ceil(l/de),u=o>u?o+1:u+1,i>u&&(i=u,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(u=h.length,i=s.length,u-i<0&&(i=u,r=s,s=h,h=r),t=0;i;)t=(h[--i]=h[i]+s[i]+t)/Er|0,h[i]%=Er;for(t&&(h.unshift(t),++n),u=h.length;h[--u]==0;)h.pop();return e.d=h,e.e=fu(h,n),ye?ce(e,l,f):e};j.precision=j.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(cn+e);return r.d?(t=vh(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};j.round=function(){var e=this,t=e.constructor;return ce(new t(e),e.e+1,t.rounding)};j.sine=j.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+de,n.rounding=1,r=qv(n,Eh(n,r)),n.precision=e,n.rounding=t,ce(Vr>2?r.neg():r,e,t,!0)):new n(NaN)};j.squareRoot=j.sqrt=function(){var e,t,r,n,i,o,u=this,l=u.d,f=u.e,h=u.s,s=u.constructor;if(h!==1||!l||!l[0])return new s(!h||h<0&&(!l||l[0])?NaN:l?u:1/0);for(ye=!1,h=Math.sqrt(+u),h==0||h==1/0?(t=Nt(l),(t.length+f)%2==0&&(t+="0"),h=Math.sqrt(t),f=Rt((f+1)/2)-(f<0||f%2),h==1/0?t="5e"+f:(t=h.toExponential(),t=t.slice(0,t.indexOf("e")+1)+f),n=new s(t)):n=new s(h.toString()),r=(f=s.precision)+3;;)if(o=n,n=o.plus(Ge(u,o,r+2,1)).times(.5),Nt(o.d).slice(0,r)===(t=Nt(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(ce(o,f+1,0),o.times(o).eq(u))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(ce(n,f+1,1),e=!n.times(n).eq(u));break}return ye=!0,ce(n,f,s.rounding,e)};j.tangent=j.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=Ge(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,ce(Vr==2||Vr==4?r.neg():r,e,t,!0)):new n(NaN)};j.times=j.mul=function(e){var t,r,n,i,o,u,l,f,h,s=this,a=s.constructor,c=s.d,p=(e=new a(e)).d;if(e.s*=s.s,!c||!c[0]||!p||!p[0])return new a(!e.s||c&&!c[0]&&!p||p&&!p[0]&&!c?NaN:!c||!p?e.s/0:e.s*0);for(r=Rt(s.e/de)+Rt(e.e/de),f=c.length,h=p.length,f<h&&(o=c,c=p,p=o,u=f,f=h,h=u),o=[],u=f+h,n=u;n--;)o.push(0);for(n=h;--n>=0;){for(t=0,i=f+n;i>n;)l=o[i]+p[n]*c[i-n-1]+t,o[i--]=l%Er|0,t=l/Er|0;o[i]=(o[i]+t)%Er|0}for(;!o[--u];)o.pop();return t?++r:o.shift(),e.d=o,e.e=fu(o,r),ye?ce(e,a.precision,a.rounding):e};j.toBinary=function(e,t){return ts(this,2,e,t)};j.toDecimalPlaces=j.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Qt(e,0,fn),t===void 0?t=n.rounding:Qt(t,0,8),ce(r,e+r.e+1,t))};j.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=kr(n,!0):(Qt(e,0,fn),t===void 0?t=i.rounding:Qt(t,0,8),n=ce(new i(n),e+1,t),r=kr(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};j.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=kr(i):(Qt(e,0,fn),t===void 0?t=o.rounding:Qt(t,0,8),n=ce(new o(i),e+i.e+1,t),r=kr(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};j.toFraction=function(e){var t,r,n,i,o,u,l,f,h,s,a,c,p=this,D=p.d,d=p.constructor;if(!D)return new d(p);if(h=r=new d(1),n=f=new d(0),t=new d(n),o=t.e=vh(D)-p.e-1,u=o%de,t.d[0]=St(10,u<0?de+u:u),e==null)e=o>0?t:h;else{if(l=new d(e),!l.isInt()||l.lt(h))throw Error(cn+l);e=l.gt(t)?o>0?t:h:l}for(ye=!1,l=new d(Nt(D)),s=d.precision,d.precision=o=D.length*de*2;a=Ge(l,t,0,1,1),i=r.plus(a.times(n)),i.cmp(e)!=1;)r=n,n=i,i=h,h=f.plus(a.times(i)),f=i,i=t,t=l.minus(a.times(i)),l=i;return i=Ge(e.minus(r),n,0,1,1),f=f.plus(i.times(h)),r=r.plus(i.times(n)),f.s=h.s=p.s,c=Ge(h,n,o,1).minus(p).abs().cmp(Ge(f,r,o,1).minus(p).abs())<1?[h,n]:[f,r],d.precision=s,ye=!0,c};j.toHexadecimal=j.toHex=function(e,t){return ts(this,16,e,t)};j.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:Qt(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(ye=!1,r=Ge(r,e,0,t,1).times(e),ye=!0,ce(r)):(e.s=r.s,r=e),r};j.toNumber=function(){return+this};j.toOctal=function(e,t){return ts(this,8,e,t)};j.toPower=j.pow=function(e){var t,r,n,i,o,u,l=this,f=l.constructor,h=+(e=new f(e));if(!l.d||!e.d||!l.d[0]||!e.d[0])return new f(St(+l,h));if(l=new f(l),l.eq(1))return l;if(n=f.precision,o=f.rounding,e.eq(1))return ce(l,n,o);if(t=Rt(e.e/de),t>=e.d.length-1&&(r=h<0?-h:h)<=Lv)return i=Dh(f,l,r,n),e.s<0?new f(1).div(i):ce(i,n,o);if(u=l.s,u<0){if(t<e.d.length-1)return new f(NaN);if(e.d[t]&1||(u=1),l.e==0&&l.d[0]==1&&l.d.length==1)return l.s=u,l}return r=St(+l,h),t=r==0||!isFinite(r)?Rt(h*(Math.log("0."+Nt(l.d))/Math.LN10+l.e+1)):new f(r+"").e,t>f.maxE+1||t<f.minE-1?new f(t>0?u/0:0):(ye=!1,f.rounding=l.s=1,r=Math.min(12,(t+"").length),i=ba(e.times(ln(l,n+r)),n),i.d&&(i=ce(i,n+5,1),Vi(i.d,n,o)&&(t=n+10,i=ce(ba(e.times(ln(l,t+r)),t),t+5,1),+Nt(i.d).slice(n+1,n+15)+1==1e14&&(i=ce(i,n+1,0)))),i.s=u,ye=!0,f.rounding=o,ce(i,n,o))};j.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=kr(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Qt(e,1,fn),t===void 0?t=i.rounding:Qt(t,0,8),n=ce(new i(n),e,t),r=kr(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};j.toSignificantDigits=j.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Qt(e,1,fn),t===void 0?t=n.rounding:Qt(t,0,8)),ce(new n(r),e,t)};j.toString=function(){var e=this,t=e.constructor,r=kr(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};j.truncated=j.trunc=function(){return ce(new this.constructor(this),this.e+1,1)};j.valueOf=j.toJSON=function(){var e=this,t=e.constructor,r=kr(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Nt(e){var t,r,n,i=e.length-1,o="",u=e[0];if(i>0){for(o+=u,t=1;t<i;t++)n=e[t]+"",r=de-n.length,r&&(o+=Jr(r)),o+=n;u=e[t],n=u+"",r=de-n.length,r&&(o+=Jr(r))}else if(u===0)return"0";for(;u%10===0;)u/=10;return o+u}function Qt(e,t,r){if(e!==~~e||e<t||e>r)throw Error(cn+e)}function Vi(e,t,r,n){var i,o,u,l;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=de,i=0):(i=Math.ceil((t+1)/de),t%=de),o=St(10,de-t),l=e[i]%o|0,n==null?t<3?(t==0?l=l/100|0:t==1&&(l=l/10|0),u=r<4&&l==99999||r>3&&l==49999||l==5e4||l==0):u=(r<4&&l+1==o||r>3&&l+1==o/2)&&(e[i+1]/o/100|0)==St(10,t-2)-1||(l==o/2||l==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?l=l/1e3|0:t==1?l=l/100|0:t==2&&(l=l/10|0),u=(n||r<4)&&l==9999||!n&&r>3&&l==4999):u=((n||r<4)&&l+1==o||!n&&r>3&&l+1==o/2)&&(e[i+1]/o/1e3|0)==St(10,t-3)-1,u}function Bo(e,t,r){for(var n,i=[0],o,u=0,l=e.length;u<l;){for(o=i.length;o--;)i[o]*=t;for(i[0]+=Aa.indexOf(e.charAt(u++)),n=0;n<i.length;n++)i[n]>r-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function $v(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/hu(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=pi(e,1,t.times(i),new e(1));for(var o=r;o--;){var u=t.times(t);t=u.times(u).minus(u).times(8).plus(1)}return e.precision-=r,t}var Ge=function(){function e(n,i,o){var u,l=0,f=n.length;for(n=n.slice();f--;)u=n[f]*i+l,n[f]=u%o|0,l=u/o|0;return l&&n.unshift(l),n}function t(n,i,o,u){var l,f;if(o!=u)f=o>u?1:-1;else for(l=f=0;l<o;l++)if(n[l]!=i[l]){f=n[l]>i[l]?1:-1;break}return f}function r(n,i,o,u){for(var l=0;o--;)n[o]-=l,l=n[o]<i[o]?1:0,n[o]=l*u+n[o]-i[o];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,o,u,l,f){var h,s,a,c,p,D,d,g,m,y,v,w,E,C,F,S,b,P,B,k,H=n.constructor,M=n.s==i.s?1:-1,I=n.d,O=i.d;if(!I||!I[0]||!O||!O[0])return new H(!n.s||!i.s||(I?O&&I[0]==O[0]:!O)?NaN:I&&I[0]==0||!O?M*0:M/0);for(f?(p=1,s=n.e-i.e):(f=Er,p=de,s=Rt(n.e/p)-Rt(i.e/p)),B=O.length,b=I.length,m=new H(M),y=m.d=[],a=0;O[a]==(I[a]||0);a++);if(O[a]>(I[a]||0)&&s--,o==null?(C=o=H.precision,u=H.rounding):l?C=o+(n.e-i.e)+1:C=o,C<0)y.push(1),D=!0;else{if(C=C/p+2|0,a=0,B==1){for(c=0,O=O[0],C++;(a<b||c)&&C--;a++)F=c*f+(I[a]||0),y[a]=F/O|0,c=F%O|0;D=c||a<b}else{for(c=f/(O[0]+1)|0,c>1&&(O=e(O,c,f),I=e(I,c,f),B=O.length,b=I.length),S=B,v=I.slice(0,B),w=v.length;w<B;)v[w++]=0;k=O.slice(),k.unshift(0),P=O[0],O[1]>=f/2&&++P;do c=0,h=t(O,v,B,w),h<0?(E=v[0],B!=w&&(E=E*f+(v[1]||0)),c=E/P|0,c>1?(c>=f&&(c=f-1),d=e(O,c,f),g=d.length,w=v.length,h=t(d,v,g,w),h==1&&(c--,r(d,B<g?k:O,g,f))):(c==0&&(h=c=1),d=O.slice()),g=d.length,g<w&&d.unshift(0),r(v,d,w,f),h==-1&&(w=v.length,h=t(O,v,B,w),h<1&&(c++,r(v,B<w?k:O,w,f))),w=v.length):h===0&&(c++,v=[0]),y[a++]=c,h&&v[0]?v[w++]=I[S]||0:(v=[I[S]],w=1);while((S++<b||v[0]!==void 0)&&C--);D=v[0]!==void 0}y[0]||y.shift()}if(p==1)m.e=s,hh=D;else{for(a=1,c=y[0];c>=10;c/=10)a++;m.e=a+s*p-1,ce(m,l?o+m.e+1:o,u,D)}return m}}();function ce(e,t,r,n){var i,o,u,l,f,h,s,a,c,p=e.constructor;e:if(t!=null){if(a=e.d,!a)return e;for(i=1,l=a[0];l>=10;l/=10)i++;if(o=t-i,o<0)o+=de,u=t,s=a[c=0],f=s/St(10,i-u-1)%10|0;else if(c=Math.ceil((o+1)/de),l=a.length,c>=l)if(n){for(;l++<=c;)a.push(0);s=f=0,i=1,o%=de,u=o-de+1}else break e;else{for(s=l=a[c],i=1;l>=10;l/=10)i++;o%=de,u=o-de+i,f=u<0?0:s/St(10,i-u-1)%10|0}if(n=n||t<0||a[c+1]!==void 0||(u<0?s:s%St(10,i-u-1)),h=r<4?(f||n)&&(r==0||r==(e.s<0?3:2)):f>5||f==5&&(r==4||n||r==6&&(o>0?u>0?s/St(10,i-u):0:a[c-1])%10&1||r==(e.s<0?8:7)),t<1||!a[0])return a.length=0,h?(t-=e.e+1,a[0]=St(10,(de-t%de)%de),e.e=-t||0):a[0]=e.e=0,e;if(o==0?(a.length=c,l=1,c--):(a.length=c+1,l=St(10,de-o),a[c]=u>0?(s/St(10,i-u)%St(10,u)|0)*l:0),h)for(;;)if(c==0){for(o=1,u=a[0];u>=10;u/=10)o++;for(u=a[0]+=l,l=1;u>=10;u/=10)l++;o!=l&&(e.e++,a[0]==Er&&(a[0]=1));break}else{if(a[c]+=l,a[c]!=Er)break;a[c--]=0,l=1}for(o=a.length;a[--o]===0;)a.pop()}return ye&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e<p.minE&&(e.e=0,e.d=[0])),e}function kr(e,t,r){if(!e.isFinite())return wh(e);var n,i=e.e,o=Nt(e.d),u=o.length;return t?(r&&(n=r-u)>0?o=o.charAt(0)+"."+o.slice(1)+Jr(n):u>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Jr(-i-1)+o,r&&(n=r-u)>0&&(o+=Jr(n))):i>=u?(o+=Jr(i+1-u),r&&(n=r-i-1)>0&&(o=o+"."+Jr(n))):((n=i+1)<u&&(o=o.slice(0,n)+"."+o.slice(n)),r&&(n=r-u)>0&&(i+1===u&&(o+="."),o+=Jr(n))),o}function fu(e,t){var r=e[0];for(t*=de;r>=10;r/=10)t++;return t}function Qo(e,t,r){if(t>zv)throw ye=!0,r&&(e.precision=r),Error(dh);return ce(new e(Wo),t,1,!0)}function yr(e,t,r){if(t>Fa)throw Error(dh);return ce(new e(Go),t,r,!0)}function vh(e){var t=e.length-1,r=t*de+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function Jr(e){for(var t="";e--;)t+="0";return t}function Dh(e,t,r,n){var i,o=new e(1),u=Math.ceil(n/de+4);for(ye=!1;;){if(r%2&&(o=o.times(t),Ul(o.d,u)&&(i=!0)),r=Rt(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),Ul(t.d,u)}return ye=!0,o}function $l(e){return e.d[e.d.length-1]&1}function yh(e,t,r){for(var n,i=new e(t[0]),o=0;++o<t.length;)if(n=new e(t[o]),n.s)i[r](n)&&(i=n);else{i=n;break}return i}function ba(e,t){var r,n,i,o,u,l,f,h=0,s=0,a=0,c=e.constructor,p=c.rounding,D=c.precision;if(!e.d||!e.d[0]||e.e>17)return new c(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(t==null?(ye=!1,f=D):f=t,l=new c(.03125);e.e>-2;)e=e.times(l),a+=5;for(n=Math.log(St(2,a))/Math.LN10*2+5|0,f+=n,r=o=u=new c(1),c.precision=f;;){if(o=ce(o.times(e),f,1),r=r.times(++s),l=u.plus(Ge(o,r,f,1)),Nt(l.d).slice(0,f)===Nt(u.d).slice(0,f)){for(i=a;i--;)u=ce(u.times(u),f,1);if(t==null)if(h<3&&Vi(u.d,f-n,p,h))c.precision=f+=10,r=o=l=new c(1),s=0,h++;else return ce(u,c.precision=D,p,ye=!0);else return c.precision=D,u}u=l}}function ln(e,t){var r,n,i,o,u,l,f,h,s,a,c,p=1,D=10,d=e,g=d.d,m=d.constructor,y=m.rounding,v=m.precision;if(d.s<0||!g||!g[0]||!d.e&&g[0]==1&&g.length==1)return new m(g&&!g[0]?-1/0:d.s!=1?NaN:g?0:d);if(t==null?(ye=!1,s=v):s=t,m.precision=s+=D,r=Nt(g),n=r.charAt(0),Math.abs(o=d.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)d=d.times(e),r=Nt(d.d),n=r.charAt(0),p++;o=d.e,n>1?(d=new m("0."+r),o++):d=new m(n+"."+r.slice(1))}else return h=Qo(m,s+2,v).times(o+""),d=ln(new m(n+"."+r.slice(1)),s-D).plus(h),m.precision=v,t==null?ce(d,v,y,ye=!0):d;for(a=d,f=u=d=Ge(d.minus(1),d.plus(1),s,1),c=ce(d.times(d),s,1),i=3;;){if(u=ce(u.times(c),s,1),h=f.plus(Ge(u,new m(i),s,1)),Nt(h.d).slice(0,s)===Nt(f.d).slice(0,s))if(f=f.times(2),o!==0&&(f=f.plus(Qo(m,s+2,v).times(o+""))),f=Ge(f,new m(p),s,1),t==null)if(Vi(f.d,s-D,y,l))m.precision=s+=D,h=u=d=Ge(a.minus(1),a.plus(1),s,1),c=ce(d.times(d),s,1),i=l=1;else return ce(f,m.precision=v,y,ye=!0);else return m.precision=v,f;f=h,i+=2}}function wh(e){return String(e.s*e.s/0)}function xa(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%de,r<0&&(n+=de),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=de;n<i;)e.d.push(+t.slice(n,n+=de));t=t.slice(n),n=de-t.length}else n-=i;for(;n--;)t+="0";e.d.push(+t),ye&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function Uv(e,t){var r,n,i,o,u,l,f,h,s;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),gh.test(t))return xa(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(kv.test(t))r=16,t=t.toLowerCase();else if(Pv.test(t))r=2;else if(Iv.test(t))r=8;else throw Error(cn+t);for(o=t.search(/p/i),o>0?(f=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),u=o>=0,n=e.constructor,u&&(t=t.replace(".",""),l=t.length,o=l-o,i=Dh(n,new n(r),o,o*2)),h=Bo(t,r,Er),s=h.length-1,o=s;h[o]===0;--o)h.pop();return o<0?new n(e.s*0):(e.e=fu(h,s),e.d=h,ye=!1,u&&(e=Ge(e,i,l*4)),f&&(e=e.times(Math.abs(f)<54?St(2,f):mi.pow(2,f))),ye=!0,e)}function qv(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:pi(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/hu(5,r)),t=pi(e,2,t,t);for(var i,o=new e(5),u=new e(16),l=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(u.times(i).minus(l))));return t}function pi(e,t,r,n,i){var o,u,l,f,h=e.precision,s=Math.ceil(h/de);for(ye=!1,f=r.times(r),l=new e(n);;){if(u=Ge(l.times(f),new e(t++*t++),h,1),l=i?n.plus(u):n.minus(u),n=Ge(u.times(f),new e(t++*t++),h,1),u=l.plus(n),u.d[s]!==void 0){for(o=s;u.d[o]===l.d[o]&&o--;);if(o==-1)break}o=l,l=n,n=u,u=o}return ye=!0,u.d.length=s+1,u}function hu(e,t){for(var r=e;--t;)r*=e;return r}function Eh(e,t){var r,n=t.s<0,i=yr(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return Vr=n?4:1,t;if(r=t.divToInt(i),r.isZero())Vr=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return Vr=$l(r)?n?2:3:n?4:1,t;Vr=$l(r)?n?1:4:n?3:2}return t.minus(i).abs()}function ts(e,t,r,n){var i,o,u,l,f,h,s,a,c,p=e.constructor,D=r!==void 0;if(D?(Qt(r,1,fn),n===void 0?n=p.rounding:Qt(n,0,8)):(r=p.precision,n=p.rounding),!e.isFinite())s=wh(e);else{for(s=kr(e),u=s.indexOf("."),D?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,u>=0&&(s=s.replace(".",""),c=new p(1),c.e=s.length-u,c.d=Bo(kr(c),10,i),c.e=c.d.length),a=Bo(s,10,i),o=f=a.length;a[--f]==0;)a.pop();if(!a[0])s=D?"0p+0":"0";else{if(u<0?o--:(e=new p(e),e.d=a,e.e=o,e=Ge(e,c,r,n,0,i),a=e.d,o=e.e,h=hh),u=a[r],l=i/2,h=h||a[r+1]!==void 0,h=n<4?(u!==void 0||h)&&(n===0||n===(e.s<0?3:2)):u>l||u===l&&(n===4||h||n===6&&a[r-1]&1||n===(e.s<0?8:7)),a.length=r,h)for(;++a[--r]>i-1;)a[r]=0,r||(++o,a.unshift(1));for(f=a.length;!a[f-1];--f);for(u=0,s="";u<f;u++)s+=Aa.charAt(a[u]);if(D){if(f>1)if(t==16||t==8){for(u=t==16?4:3,--f;f%u;f++)s+="0";for(a=Bo(s,i,t),f=a.length;!a[f-1];--f);for(u=1,s="1.";u<f;u++)s+=Aa.charAt(a[u])}else s=s.charAt(0)+"."+s.slice(1);s=s+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)s="0"+s;s="0."+s}else if(++o>f)for(o-=f;o--;)s+="0";else o<f&&(s=s.slice(0,o)+"."+s.slice(o))}s=(t==16?"0x":t==2?"0b":t==8?"0o":"")+s}return e.s<0?"-"+s:s}function Ul(e,t){if(e.length>t)return e.length=t,!0}function jv(e){return new this(e).abs()}function Vv(e){return new this(e).acos()}function Hv(e){return new this(e).acosh()}function Wv(e,t){return new this(e).plus(t)}function Gv(e){return new this(e).asin()}function Qv(e){return new this(e).asinh()}function Zv(e){return new this(e).atan()}function Yv(e){return new this(e).atanh()}function Xv(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=yr(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?yr(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=yr(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(Ge(e,t,o,1)),t=yr(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(Ge(e,t,o,1)),r}function Kv(e){return new this(e).cbrt()}function Jv(e){return ce(e=new this(e),e.e+1,2)}function e1(e,t,r){return new this(e).clamp(t,r)}function t1(e){if(!e||typeof e!="object")throw Error(cu+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,fn,"rounding",0,8,"toExpNeg",-Zn,0,"toExpPos",0,Zn,"maxE",0,Zn,"minE",-Zn,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(r=o[t],i&&(this[r]=Sa[r]),(n=e[r])!==void 0)if(Rt(n)===n&&n>=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(cn+r+": "+n);if(r="crypto",i&&(this[r]=Sa[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(ph);else this[r]=!1;else throw Error(cn+r+": "+n);return this}function r1(e){return new this(e).cos()}function n1(e){return new this(e).cosh()}function Ch(e){var t,r,n;function i(o){var u,l,f,h=this;if(!(h instanceof i))return new i(o);if(h.constructor=i,ql(o)){h.s=o.s,ye?!o.d||o.e>i.maxE?(h.e=NaN,h.d=null):o.e<i.minE?(h.e=0,h.d=[0]):(h.e=o.e,h.d=o.d.slice()):(h.e=o.e,h.d=o.d?o.d.slice():o.d);return}if(f=typeof o,f==="number"){if(o===0){h.s=1/o<0?-1:1,h.e=0,h.d=[0];return}if(o<0?(o=-o,h.s=-1):h.s=1,o===~~o&&o<1e7){for(u=0,l=o;l>=10;l/=10)u++;ye?u>i.maxE?(h.e=NaN,h.d=null):u<i.minE?(h.e=0,h.d=[0]):(h.e=u,h.d=[o]):(h.e=u,h.d=[o]);return}else if(o*0!==0){o||(h.s=NaN),h.e=NaN,h.d=null;return}return xa(h,o.toString())}else if(f!=="string")throw Error(cn+o);return(l=o.charCodeAt(0))===45?(o=o.slice(1),h.s=-1):(l===43&&(o=o.slice(1)),h.s=1),gh.test(o)?xa(h,o):Uv(h,o)}if(i.prototype=j,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=t1,i.clone=Ch,i.isDecimal=ql,i.abs=jv,i.acos=Vv,i.acosh=Hv,i.add=Wv,i.asin=Gv,i.asinh=Qv,i.atan=Zv,i.atanh=Yv,i.atan2=Xv,i.cbrt=Kv,i.ceil=Jv,i.clamp=e1,i.cos=r1,i.cosh=n1,i.div=i1,i.exp=o1,i.floor=u1,i.hypot=a1,i.ln=s1,i.log=l1,i.log10=f1,i.log2=c1,i.max=h1,i.min=d1,i.mod=p1,i.mul=m1,i.pow=g1,i.random=v1,i.round=D1,i.sign=y1,i.sin=w1,i.sinh=E1,i.sqrt=C1,i.sub=A1,i.sum=S1,i.tan=F1,i.tanh=b1,i.trunc=x1,e===void 0&&(e={}),e&&e.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function i1(e,t){return new this(e).div(t)}function o1(e){return new this(e).exp()}function u1(e){return ce(e=new this(e),e.e+1,3)}function a1(){var e,t,r=new this(0);for(ye=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return ye=!0,new this(1/0);r=t}return ye=!0,r.sqrt()}function ql(e){return e instanceof mi||e&&e.toStringTag===mh||!1}function s1(e){return new this(e).ln()}function l1(e,t){return new this(e).log(t)}function c1(e){return new this(e).log(2)}function f1(e){return new this(e).log(10)}function h1(){return yh(this,arguments,"lt")}function d1(){return yh(this,arguments,"gt")}function p1(e,t){return new this(e).mod(t)}function m1(e,t){return new this(e).mul(t)}function g1(e,t){return new this(e).pow(t)}function v1(e){var t,r,n,i,o=0,u=new this(1),l=[];if(e===void 0?e=this.precision:Qt(e,1,fn),n=Math.ceil(e/de),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));o<n;)i=t[o],i>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:l[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o<n;)i=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((t[o+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,o):(l.push(i%1e7),o+=4);o=n/4}else throw Error(ph);else for(;o<n;)l[o++]=Math.random()*1e7|0;for(n=l[--o],e%=de,n&&e&&(i=St(10,de-e),l[o]=(n/i|0)*i);l[o]===0;o--)l.pop();if(o<0)r=0,l=[0];else{for(r=-1;l[0]===0;r-=de)l.shift();for(n=1,i=l[0];i>=10;i/=10)n++;n<de&&(r-=de-n)}return u.e=r,u.d=l,u}function D1(e){return ce(e=new this(e),e.e+1,this.rounding)}function y1(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function w1(e){return new this(e).sin()}function E1(e){return new this(e).sinh()}function C1(e){return new this(e).sqrt()}function A1(e,t){return new this(e).sub(t)}function S1(){var e=0,t=arguments,r=new this(t[e]);for(ye=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return ye=!0,ce(r,this.precision,this.rounding)}function F1(e){return new this(e).tan()}function b1(e){return new this(e).tanh()}function x1(e){return ce(e=new this(e),e.e+1,1)}j[Symbol.for("nodejs.util.inspect.custom")]=j.toString;j[Symbol.toStringTag]="Decimal";var mi=j.constructor=Ch(Sa);Wo=new mi(Wo);Go=new mi(Go);var T1="BigNumber",_1=["?on","config"],M1=ie(T1,_1,e=>{var{on:t,config:r}=e,n=mi.clone({precision:r.precision,modulo:mi.EUCLID});return n.prototype=Object.create(n.prototype),n.prototype.type="BigNumber",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n.fromJSON=function(i){return new n(i.value)},t&&t("config",function(i,o){i.precision!==o.precision&&n.config({precision:i.precision})}),n},{isClass:!0}),Ah={exports:{}};/** * @license Complex.js v2.1.1 12/05/2020 * * Copyright (c) 2020, Robert Eisele (robert@xarg.org) * Dual licensed under the MIT or GPL Version 2 licenses. **/(function(e,t){(function(r){var n=Math.cosh||function(a){return Math.abs(a)<1e-9?1-a:(Math.exp(a)+Math.exp(-a))*.5},i=Math.sinh||function(a){return Math.abs(a)<1e-9?a:(Math.exp(a)-Math.exp(-a))*.5},o=function(a){var c=Math.PI/4;if(-c>a||a>c)return Math.cos(a)-1;var p=a*a;return p*(p*(p*(p*(p*(p*(p*(p/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},u=function(a,c){var p=Math.abs(a),D=Math.abs(c);return p<3e3&&D<3e3?Math.sqrt(p*p+D*D):(p<D?(p=D,D=a/c):D=c/a,p*Math.sqrt(1+D*D))},l=function(){throw SyntaxError("Invalid Param")};function f(a,c){var p=Math.abs(a),D=Math.abs(c);return a===0?Math.log(D):c===0?Math.log(p):p<3e3&&D<3e3?Math.log(a*a+c*c)*.5:(a=a/2,c=c/2,.5*Math.log(a*a+c*c)+Math.LN2)}var h=function(a,c){var p={re:0,im:0};if(a==null)p.re=p.im=0;else if(c!==void 0)p.re=a,p.im=c;else switch(typeof a){case"object":if("im"in a&&"re"in a)p.re=a.re,p.im=a.im;else if("abs"in a&&"arg"in a){if(!Number.isFinite(a.abs)&&Number.isFinite(a.arg))return s.INFINITY;p.re=a.abs*Math.cos(a.arg),p.im=a.abs*Math.sin(a.arg)}else if("r"in a&&"phi"in a){if(!Number.isFinite(a.r)&&Number.isFinite(a.phi))return s.INFINITY;p.re=a.r*Math.cos(a.phi),p.im=a.r*Math.sin(a.phi)}else a.length===2?(p.re=a[0],p.im=a[1]):l();break;case"string":p.im=p.re=0;var D=a.match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),d=1,g=0;D===null&&l();for(var m=0;m<D.length;m++){var y=D[m];y===" "||y===" "||y===` `||(y==="+"?d++:y==="-"?g++:y==="i"||y==="I"?(d+g===0&&l(),D[m+1]!==" "&&!isNaN(D[m+1])?(p.im+=parseFloat((g%2?"-":"")+D[m+1]),m++):p.im+=parseFloat((g%2?"-":"")+"1"),d=g=0):((d+g===0||isNaN(y))&&l(),D[m+1]==="i"||D[m+1]==="I"?(p.im+=parseFloat((g%2?"-":"")+y),m++):p.re+=parseFloat((g%2?"-":"")+y),d=g=0))}d+g>0&&l();break;case"number":p.im=0,p.re=a;break;default:l()}return isNaN(p.re)||isNaN(p.im),p};function s(a,c){if(!(this instanceof s))return new s(a,c);var p=h(a,c);this.re=p.re,this.im=p.im}s.prototype={re:0,im:0,sign:function(){var a=this.abs();return new s(this.re/a,this.im/a)},add:function(a,c){var p=new s(a,c);return this.isInfinite()&&p.isInfinite()?s.NAN:this.isInfinite()||p.isInfinite()?s.INFINITY:new s(this.re+p.re,this.im+p.im)},sub:function(a,c){var p=new s(a,c);return this.isInfinite()&&p.isInfinite()?s.NAN:this.isInfinite()||p.isInfinite()?s.INFINITY:new s(this.re-p.re,this.im-p.im)},mul:function(a,c){var p=new s(a,c);return this.isInfinite()&&p.isZero()||this.isZero()&&p.isInfinite()?s.NAN:this.isInfinite()||p.isInfinite()?s.INFINITY:p.im===0&&this.im===0?new s(this.re*p.re,0):new s(this.re*p.re-this.im*p.im,this.re*p.im+this.im*p.re)},div:function(a,c){var p=new s(a,c);if(this.isZero()&&p.isZero()||this.isInfinite()&&p.isInfinite())return s.NAN;if(this.isInfinite()||p.isZero())return s.INFINITY;if(this.isZero()||p.isInfinite())return s.ZERO;a=this.re,c=this.im;var D=p.re,d=p.im,g,m;return d===0?new s(a/D,c/D):Math.abs(D)<Math.abs(d)?(m=D/d,g=D*m+d,new s((a*m+c)/g,(c*m-a)/g)):(m=d/D,g=d*m+D,new s((a+c*m)/g,(c-a*m)/g))},pow:function(a,c){var p=new s(a,c);if(a=this.re,c=this.im,p.isZero())return s.ONE;if(p.im===0){if(c===0&&a>0)return new s(Math.pow(a,p.re),0);if(a===0)switch((p.re%4+4)%4){case 0:return new s(Math.pow(c,p.re),0);case 1:return new s(0,Math.pow(c,p.re));case 2:return new s(-Math.pow(c,p.re),0);case 3:return new s(0,-Math.pow(c,p.re))}}if(a===0&&c===0&&p.re>0&&p.im>=0)return s.ZERO;var D=Math.atan2(c,a),d=f(a,c);return a=Math.exp(p.re*d-p.im*D),c=p.im*d+p.re*D,new s(a*Math.cos(c),a*Math.sin(c))},sqrt:function(){var a=this.re,c=this.im,p=this.abs(),D,d;if(a>=0){if(c===0)return new s(Math.sqrt(a),0);D=.5*Math.sqrt(2*(p+a))}else D=Math.abs(c)/Math.sqrt(2*(p-a));return a<=0?d=.5*Math.sqrt(2*(p-a)):d=Math.abs(c)/Math.sqrt(2*(p+a)),new s(D,c<0?-d:d)},exp:function(){var a=Math.exp(this.re);return this.im,new s(a*Math.cos(this.im),a*Math.sin(this.im))},expm1:function(){var a=this.re,c=this.im;return new s(Math.expm1(a)*Math.cos(c)+o(c),Math.exp(a)*Math.sin(c))},log:function(){var a=this.re,c=this.im;return new s(f(a,c),Math.atan2(c,a))},abs:function(){return u(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var a=this.re,c=this.im;return new s(Math.sin(a)*n(c),Math.cos(a)*i(c))},cos:function(){var a=this.re,c=this.im;return new s(Math.cos(a)*n(c),-Math.sin(a)*i(c))},tan:function(){var a=2*this.re,c=2*this.im,p=Math.cos(a)+n(c);return new s(Math.sin(a)/p,i(c)/p)},cot:function(){var a=2*this.re,c=2*this.im,p=Math.cos(a)-n(c);return new s(-Math.sin(a)/p,i(c)/p)},sec:function(){var a=this.re,c=this.im,p=.5*n(2*c)+.5*Math.cos(2*a);return new s(Math.cos(a)*n(c)/p,Math.sin(a)*i(c)/p)},csc:function(){var a=this.re,c=this.im,p=.5*n(2*c)-.5*Math.cos(2*a);return new s(Math.sin(a)*n(c)/p,-Math.cos(a)*i(c)/p)},asin:function(){var a=this.re,c=this.im,p=new s(c*c-a*a+1,-2*a*c).sqrt(),D=new s(p.re-c,p.im+a).log();return new s(D.im,-D.re)},acos:function(){var a=this.re,c=this.im,p=new s(c*c-a*a+1,-2*a*c).sqrt(),D=new s(p.re-c,p.im+a).log();return new s(Math.PI/2-D.im,D.re)},atan:function(){var a=this.re,c=this.im;if(a===0){if(c===1)return new s(0,1/0);if(c===-1)return new s(0,-1/0)}var p=a*a+(1-c)*(1-c),D=new s((1-c*c-a*a)/p,-2*a/p).log();return new s(-.5*D.im,.5*D.re)},acot:function(){var a=this.re,c=this.im;if(c===0)return new s(Math.atan2(1,a),0);var p=a*a+c*c;return p!==0?new s(a/p,-c/p).atan():new s(a!==0?a/0:0,c!==0?-c/0:0).atan()},asec:function(){var a=this.re,c=this.im;if(a===0&&c===0)return new s(0,1/0);var p=a*a+c*c;return p!==0?new s(a/p,-c/p).acos():new s(a!==0?a/0:0,c!==0?-c/0:0).acos()},acsc:function(){var a=this.re,c=this.im;if(a===0&&c===0)return new s(Math.PI/2,1/0);var p=a*a+c*c;return p!==0?new s(a/p,-c/p).asin():new s(a!==0?a/0:0,c!==0?-c/0:0).asin()},sinh:function(){var a=this.re,c=this.im;return new s(i(a)*Math.cos(c),n(a)*Math.sin(c))},cosh:function(){var a=this.re,c=this.im;return new s(n(a)*Math.cos(c),i(a)*Math.sin(c))},tanh:function(){var a=2*this.re,c=2*this.im,p=n(a)+Math.cos(c);return new s(i(a)/p,Math.sin(c)/p)},coth:function(){var a=2*this.re,c=2*this.im,p=n(a)-Math.cos(c);return new s(i(a)/p,-Math.sin(c)/p)},csch:function(){var a=this.re,c=this.im,p=Math.cos(2*c)-n(2*a);return new s(-2*i(a)*Math.cos(c)/p,2*n(a)*Math.sin(c)/p)},sech:function(){var a=this.re,c=this.im,p=Math.cos(2*c)+n(2*a);return new s(2*n(a)*Math.cos(c)/p,-2*i(a)*Math.sin(c)/p)},asinh:function(){var a=this.im;this.im=-this.re,this.re=a;var c=this.asin();return this.re=-this.im,this.im=a,a=c.re,c.re=-c.im,c.im=a,c},acosh:function(){var a=this.acos();if(a.im<=0){var c=a.re;a.re=-a.im,a.im=c}else{var c=a.im;a.im=-a.re,a.re=c}return a},atanh:function(){var a=this.re,c=this.im,p=a>1&&c===0,D=1-a,d=1+a,g=D*D+c*c,m=g!==0?new s((d*D-c*c)/g,(c*D+d*c)/g):new s(a!==-1?a/0:0,c!==0?c/0:0),y=m.re;return m.re=f(m.re,m.im)/2,m.im=Math.atan2(m.im,y)/2,p&&(m.im=-m.im),m},acoth:function(){var a=this.re,c=this.im;if(a===0&&c===0)return new s(0,Math.PI/2);var p=a*a+c*c;return p!==0?new s(a/p,-c/p).atanh():new s(a!==0?a/0:0,c!==0?-c/0:0).atanh()},acsch:function(){var a=this.re,c=this.im;if(c===0)return new s(a!==0?Math.log(a+Math.sqrt(a*a+1)):1/0,0);var p=a*a+c*c;return p!==0?new s(a/p,-c/p).asinh():new s(a!==0?a/0:0,c!==0?-c/0:0).asinh()},asech:function(){var a=this.re,c=this.im;if(this.isZero())return s.INFINITY;var p=a*a+c*c;return p!==0?new s(a/p,-c/p).acosh():new s(a!==0?a/0:0,c!==0?-c/0:0).acosh()},inverse:function(){if(this.isZero())return s.INFINITY;if(this.isInfinite())return s.ZERO;var a=this.re,c=this.im,p=a*a+c*c;return new s(a/p,-c/p)},conjugate:function(){return new s(this.re,-this.im)},neg:function(){return new s(-this.re,-this.im)},ceil:function(a){return a=Math.pow(10,a||0),new s(Math.ceil(this.re*a)/a,Math.ceil(this.im*a)/a)},floor:function(a){return a=Math.pow(10,a||0),new s(Math.floor(this.re*a)/a,Math.floor(this.im*a)/a)},round:function(a){return a=Math.pow(10,a||0),new s(Math.round(this.re*a)/a,Math.round(this.im*a)/a)},equals:function(a,c){var p=new s(a,c);return Math.abs(p.re-this.re)<=s.EPSILON&&Math.abs(p.im-this.im)<=s.EPSILON},clone:function(){return new s(this.re,this.im)},toString:function(){var a=this.re,c=this.im,p="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(a)<s.EPSILON&&(a=0),Math.abs(c)<s.EPSILON&&(c=0),c===0?p+a:(a!==0?(p+=a,p+=" ",c<0?(c=-c,p+="-"):p+="+",p+=" "):c<0&&(c=-c,p+="-"),c!==1&&(p+=c),p+"i"))},toVector:function(){return[this.re,this.im]},valueOf:function(){return this.im===0?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return this.im===0&&this.re===0},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!(this.isNaN()||this.isFinite())}},s.ZERO=new s(0,0),s.ONE=new s(1,0),s.I=new s(0,1),s.PI=new s(Math.PI,0),s.E=new s(Math.E,0),s.INFINITY=new s(1/0,1/0),s.NAN=new s(NaN,NaN),s.EPSILON=1e-15,Object.defineProperty(s,"__esModule",{value:!0}),s.default=s,s.Complex=s,e.exports=s})()})(Ah);var N1=Ah.exports;const Tt=Ta(N1);var B1="Complex",O1=[],R1=ie(B1,O1,()=>(Object.defineProperty(Tt,"name",{value:"Complex"}),Tt.prototype.constructor=Tt,Tt.prototype.type="Complex",Tt.prototype.isComplex=!0,Tt.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},Tt.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},Tt.prototype.format=function(e){var t="",r=this.im,n=this.re,i=wa(this.re,e),o=wa(this.im,e),u=ut(e)?e:e?e.precision:null;if(u!==null){var l=Math.pow(10,-u);Math.abs(n/r)<l&&(n=0),Math.abs(r/n)<l&&(r=0)}return r===0?t=i:n===0?r===1?t="i":r===-1?t="-i":t=o+"i":r<0?r===-1?t=i+" - i":t=i+" - "+o.substring(1)+"i":r===1?t=i+" + i":t=i+" + "+o+"i",t},Tt.fromPolar=function(e){switch(arguments.length){case 1:{var t=arguments[0];if(typeof t=="object")return Tt(t);throw new TypeError("Input has to be an object with r and phi keys.")}case 2:{var r=arguments[0],n=arguments[1];if(ut(r)){if(Zf(n)&&n.hasBase("ANGLE")&&(n=n.toNumber("rad")),ut(n))return new Tt({r,phi:n});throw new TypeError("Phi is not a number nor an angle unit.")}else throw new TypeError("Radius r is not a number.")}default:throw new SyntaxError("Wrong number of arguments in function fromPolar")}},Tt.prototype.valueOf=Tt.prototype.toString,Tt.fromJSON=function(e){return new Tt(e)},Tt.compare=function(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0},Tt),{isClass:!0}),Sh={exports:{}};/** * @license Fraction.js v4.3.0 20/08/2023 * https://www.xarg.org/2014/03/rational-numbers-in-javascript/ * * Copyright (c) 2023, Robert Eisele (robert@raw.org) * Dual licensed under the MIT or GPL Version 2 licenses. **/(function(e,t){(function(r){var n=2e3,i={s:1,n:0,d:1};function o(m,y){if(isNaN(m=parseInt(m,10)))throw d();return m*y}function u(m,y){if(y===0)throw D();var v=Object.create(p.prototype);v.s=m<0?-1:1,m=m<0?-m:m;var w=c(m,y);return v.n=m/w,v.d=y/w,v}function l(m){for(var y={},v=m,w=2,E=4;E<=v;){for(;v%w===0;)v/=w,y[w]=(y[w]||0)+1;E+=1+2*w++}return v!==m?v>1&&(y[v]=(y[v]||0)+1):y[m]=(y[m]||0)+1,y}var f=function(m,y){var v=0,w=1,E=1,C=0,F=0,S=0,b=1,P=1,B=0,k=1,H=1,M=1,I=1e7,O;if(m!=null)if(y!==void 0){if(v=m,w=y,E=v*w,v%1!==0||w%1!==0)throw g()}else switch(typeof m){case"object":{if("d"in m&&"n"in m)v=m.n,w=m.d,"s"in m&&(v*=m.s);else if(0 in m)v=m[0],1 in m&&(w=m[1]);else throw d();E=v*w;break}case"number":{if(m<0&&(E=m,m=-m),m%1===0)v=m;else if(m>0){for(m>=1&&(P=Math.pow(10,Math.floor(1+Math.log(m)/Math.LN10)),m/=P);k<=I&&M<=I;)if(O=(B+H)/(k+M),m===O){k+M<=I?(v=B+H,w=k+M):M>k?(v=H,w=M):(v=B,w=k);break}else m>O?(B+=H,k+=M):(H+=B,M+=k),k>I?(v=H,w=M):(v=B,w=k);v*=P}else(isNaN(m)||isNaN(y))&&(w=v=NaN);break}case"string":{if(k=m.match(/\d+|./g),k===null)throw d();if(k[B]==="-"?(E=-1,B++):k[B]==="+"&&B++,k.length===B+1?F=o(k[B++],E):k[B+1]==="."||k[B]==="."?(k[B]!=="."&&(C=o(k[B++],E)),B++,(B+1===k.length||k[B+1]==="("&&k[B+3]===")"||k[B+1]==="'"&&k[B+3]==="'")&&(F=o(k[B],E),b=Math.pow(10,k[B].length),B++),(k[B]==="("&&k[B+2]===")"||k[B]==="'"&&k[B+2]==="'")&&(S=o(k[B+1],E),P=Math.pow(10,k[B+1].length)-1,B+=3)):k[B+1]==="/"||k[B+1]===":"?(F=o(k[B],E),b=o(k[B+2],1),B+=3):k[B+3]==="/"&&k[B+1]===" "&&(C=o(k[B],E),F=o(k[B+2],E),b=o(k[B+4],1),B+=5),k.length<=B){w=b*P,E=v=S+w*C+P*F;break}}default:throw d()}if(w===0)throw D();i.s=E<0?-1:1,i.n=Math.abs(v),i.d=Math.abs(w)};function h(m,y,v){for(var w=1;y>0;m=m*m%v,y>>=1)y&1&&(w=w*m%v);return w}function s(m,y){for(;y%2===0;y/=2);for(;y%5===0;y/=5);if(y===1)return 0;for(var v=10%y,w=1;v!==1;w++)if(v=v*10%y,w>n)return 0;return w}function a(m,y,v){for(var w=1,E=h(10,v,y),C=0;C<300;C++){if(w===E)return C;w=w*10%y,E=E*10%y}return 0}function c(m,y){if(!m)return y;if(!y)return m;for(;;){if(m%=y,!m)return y;if(y%=m,!y)return m}}function p(m,y){if(f(m,y),this instanceof p)m=c(i.d,i.n),this.s=i.s,this.n=i.n/m,this.d=i.d/m;else return u(i.s*i.n,i.d)}var D=function(){return new Error("Division by Zero")},d=function(){return new Error("Invalid argument")},g=function(){return new Error("Parameters must be integer")};p.prototype={s:1,n:0,d:1,abs:function(){return u(this.n,this.d)},neg:function(){return u(-this.s*this.n,this.d)},add:function(m,y){return f(m,y),u(this.s*this.n*i.d+i.s*this.d*i.n,this.d*i.d)},sub:function(m,y){return f(m,y),u(this.s*this.n*i.d-i.s*this.d*i.n,this.d*i.d)},mul:function(m,y){return f(m,y),u(this.s*i.s*this.n*i.n,this.d*i.d)},div:function(m,y){return f(m,y),u(this.s*i.s*this.n*i.d,this.d*i.n)},clone:function(){return u(this.s*this.n,this.d)},mod:function(m,y){if(isNaN(this.n)||isNaN(this.d))return new p(NaN);if(m===void 0)return u(this.s*this.n%this.d,1);if(f(m,y),i.n===0&&this.d===0)throw D();return u(this.s*(i.d*this.n)%(i.n*this.d),i.d*this.d)},gcd:function(m,y){return f(m,y),u(c(i.n,this.n)*c(i.d,this.d),i.d*this.d)},lcm:function(m,y){return f(m,y),i.n===0&&this.n===0?u(0,1):u(i.n*this.n,c(i.n,this.n)*c(i.d,this.d))},ceil:function(m){return m=Math.pow(10,m||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):u(Math.ceil(m*this.s*this.n/this.d),m)},floor:function(m){return m=Math.pow(10,m||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):u(Math.floor(m*this.s*this.n/this.d),m)},round:function(m){return m=Math.pow(10,m||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):u(Math.round(m*this.s*this.n/this.d),m)},inverse:function(){return u(this.s*this.d,this.n)},pow:function(m,y){if(f(m,y),i.d===1)return i.s<0?u(Math.pow(this.s*this.d,i.n),Math.pow(this.n,i.n)):u(Math.pow(this.s*this.n,i.n),Math.pow(this.d,i.n));if(this.s<0)return null;var v=l(this.n),w=l(this.d),E=1,C=1;for(var F in v)if(F!=="1"){if(F==="0"){E=0;break}if(v[F]*=i.n,v[F]%i.d===0)v[F]/=i.d;else return null;E*=Math.pow(F,v[F])}for(var F in w)if(F!=="1"){if(w[F]*=i.n,w[F]%i.d===0)w[F]/=i.d;else return null;C*=Math.pow(F,w[F])}return i.s<0?u(C,E):u(E,C)},equals:function(m,y){return f(m,y),this.s*this.n*i.d===i.s*i.n*this.d},compare:function(m,y){f(m,y);var v=this.s*this.n*i.d-i.s*i.n*this.d;return(0<v)-(v<0)},simplify:function(m){if(isNaN(this.n)||isNaN(this.d))return this;m=m||.001;for(var y=this.abs(),v=y.toContinued(),w=1;w<v.length;w++){for(var E=u(v[w-1],1),C=w-2;C>=0;C--)E=E.inverse().add(v[C]);if(Math.abs(E.sub(y).valueOf())<m)return E.mul(this.s)}return this},divisible:function(m,y){return f(m,y),!(!(i.n*this.d)||this.n*i.d%(i.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(m){var y,v="",w=this.n,E=this.d;return this.s<0&&(v+="-"),E===1?v+=w:(m&&(y=Math.floor(w/E))>0&&(v+=y,v+=" ",w%=E),v+=w,v+="/",v+=E),v},toLatex:function(m){var y,v="",w=this.n,E=this.d;return this.s<0&&(v+="-"),E===1?v+=w:(m&&(y=Math.floor(w/E))>0&&(v+=y,w%=E),v+="\\frac{",v+=w,v+="}{",v+=E,v+="}"),v},toContinued:function(){var m,y=this.n,v=this.d,w=[];if(isNaN(y)||isNaN(v))return w;do w.push(Math.floor(y/v)),m=y%v,y=v,v=m;while(y!==1);return w},toString:function(m){var y=this.n,v=this.d;if(isNaN(y)||isNaN(v))return"NaN";m=m||15;var w=s(y,v),E=a(y,v,w),C=this.s<0?"-":"";if(C+=y/v|0,y%=v,y*=10,y&&(C+="."),w){for(var F=E;F--;)C+=y/v|0,y%=v,y*=10;C+="(";for(var F=w;F--;)C+=y/v|0,y%=v,y*=10;C+=")"}else for(var F=m;y&&F--;)C+=y/v|0,y%=v,y*=10;return C}},Object.defineProperty(p,"__esModule",{value:!0}),p.default=p,p.Fraction=p,e.exports=p})()})(Sh);var P1=Sh.exports;const Ur=Ta(P1);var k1="Fraction",I1=[],L1=ie(k1,I1,()=>(Object.defineProperty(Ur,"name",{value:"Fraction"}),Ur.prototype.constructor=Ur,Ur.prototype.type="Fraction",Ur.prototype.isFraction=!0,Ur.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},Ur.fromJSON=function(e){return new Ur(e)},Ur),{isClass:!0}),z1="Matrix",$1=[],U1=ie(z1,$1,()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(t,r){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(t,r,n){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(t){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(t,r,n){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(t,r){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(t,r){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(t,r){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(t){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(t){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0});function Fh(e){return Object.keys(e.signatures||{}).reduce(function(t,r){var n=(r.match(/,/g)||[]).length+1;return Math.max(t,n)},-1)}var q1="DenseMatrix",j1=["Matrix"],V1=ie(q1,j1,e=>{var{Matrix:t}=e;function r(s,a){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(a&&!Rr(a))throw new Error("Invalid datatype: "+a);if(at(s))s.type==="DenseMatrix"?(this._data=mt(s._data),this._size=mt(s._size),this._datatype=a||s._datatype):(this._data=s.toArray(),this._size=s.size(),this._datatype=a||s._datatype);else if(s&&ct(s.data)&&ct(s.size))this._data=s.data,this._size=s.size,Ll(this._data,this._size),this._datatype=a||s.datatype;else if(ct(s))this._data=h(s),this._size=$t(this._data),Ll(this._data,this._size),this._datatype=a;else{if(s)throw new TypeError("Unsupported type of data ("+wr(s)+")");this._data=[],this._size=[0],this._datatype=a}}r.prototype=new t,r.prototype.createDenseMatrix=function(s,a){return new r(s,a)},Object.defineProperty(r,"name",{value:"DenseMatrix"}),r.prototype.constructor=r,r.prototype.type="DenseMatrix",r.prototype.isDenseMatrix=!0,r.prototype.getDataType=function(){return Vo(this._data,wr)},r.prototype.storage=function(){return"dense"},r.prototype.datatype=function(){return this._datatype},r.prototype.create=function(s,a){return new r(s,a)},r.prototype.subset=function(s,a,c){switch(arguments.length){case 1:return n(this,s);case 2:case 3:return o(this,s,a,c);default:throw new SyntaxError("Wrong number of arguments")}},r.prototype.get=function(s){if(!ct(s))throw new TypeError("Array expected");if(s.length!==this._size.length)throw new Ue(s.length,this._size.length);for(var a=0;a<s.length;a++)ft(s[a],this._size[a]);for(var c=this._data,p=0,D=s.length;p<D;p++){var d=s[p];ft(d,c.length),c=c[d]}return c},r.prototype.set=function(s,a,c){if(!ct(s))throw new TypeError("Array expected");if(s.length<this._size.length)throw new Ue(s.length,this._size.length,"<");var p,D,d,g=s.map(function(y){return y+1});f(this,g,c);var m=this._data;for(p=0,D=s.length-1;p<D;p++)d=s[p],ft(d,m.length),m=m[d];return d=s[s.length-1],ft(d,m.length),m[d]=a,this};function n(s,a){if(!Ja(a))throw new TypeError("Invalid index");var c=a.isScalar();if(c)return s.get(a.min());var p=a.size();if(p.length!==s._size.length)throw new Ue(p.length,s._size.length);for(var D=a.min(),d=a.max(),g=0,m=s._size.length;g<m;g++)ft(D[g],s._size[g]),ft(d[g],s._size[g]);return new r(i(s._data,a,p.length,0),s._datatype)}function i(s,a,c,p){var D=p===c-1,d=a.dimension(p);return D?d.map(function(g){return ft(g,s.length),s[g]}).valueOf():d.map(function(g){ft(g,s.length);var m=s[g];return i(m,a,c,p+1)}).valueOf()}function o(s,a,c,p){if(!a||a.isIndex!==!0)throw new TypeError("Invalid index");var D=a.size(),d=a.isScalar(),g;if(at(c)?(g=c.size(),c=c.valueOf()):g=$t(c),d){if(g.length!==0)throw new TypeError("Scalar expected");s.set(a.min(),c,p)}else{if(!di(g,D))try{g.length===0?c=zl([c],D):c=zl(c,D),g=$t(c)}catch{}if(D.length<s._size.length)throw new Ue(D.length,s._size.length,"<");if(g.length<D.length){for(var m=0,y=0;D[m]===1&&g[m]===1;)m++;for(;D[m]===1;)y++,m++;c=ih(c,D.length,y,g)}if(!di(D,g))throw new Ue(D,g,">");var v=a.max().map(function(C){return C+1});f(s,v,p);var w=D.length,E=0;u(s._data,a,c,w,E)}return s}function u(s,a,c,p,D){var d=D===p-1,g=a.dimension(D);d?g.forEach(function(m,y){ft(m),s[m]=c[y[0]]}):g.forEach(function(m,y){ft(m),u(s[m],a,c[y[0]],p,D+1)})}r.prototype.resize=function(s,a,c){if(!hi(s))throw new TypeError("Array or Matrix expected");var p=s.valueOf().map(d=>Array.isArray(d)&&d.length===1?d[0]:d),D=c?this.clone():this;return l(D,p,a)};function l(s,a,c){if(a.length===0){for(var p=s._data;ct(p);)p=p[0];return p}return s._size=a.slice(0),s._data=Ea(s._data,s._size,c),s}r.prototype.reshape=function(s,a){var c=a?this.clone():this;c._data=rh(c._data,s);var p=c._size.reduce((D,d)=>D*d);return c._size=es(s,p),c};function f(s,a,c){for(var p=s._size.slice(0),D=!1;p.length<a.length;)p.push(0),D=!0;for(var d=0,g=a.length;d<g;d++)a[d]>p[d]&&(p[d]=a[d],D=!0);D&&l(s,p,c)}r.prototype.clone=function(){var s=new r({data:mt(this._data),size:mt(this._size),datatype:this._datatype});return s},r.prototype.size=function(){return this._size.slice(0)},r.prototype.map=function(s){var a=this,c=Fh(s),p=function g(m,y){return ct(m)?m.map(function(v,w){return g(v,y.concat(w))}):c===1?s(m):c===2?s(m,y):s(m,y,a)},D=p(this._data,[]),d=this._datatype!==void 0?Vo(D,wr):void 0;return new r(D,d)},r.prototype.forEach=function(s){var a=this,c=function p(D,d){ct(D)?D.forEach(function(g,m){p(g,d.concat(m))}):s(D,d,a)};c(this._data,[])},r.prototype[Symbol.iterator]=function*(){var s=function*a(c,p){if(ct(c))for(var D=0;D<c.length;D++)yield*a(c[D],p.concat(D));else yield{value:c,index:p}};yield*s(this._data,[])},r.prototype.rows=function(){var s=[],a=this.size();if(a.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");var c=this._data;for(var p of c)s.push(new r([p],this._datatype));return s},r.prototype.columns=function(){var s=this,a=[],c=this.size();if(c.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var p=this._data,D=function(m){var y=p.map(v=>[v[m]]);a.push(new r(y,s._datatype))},d=0;d<c[1];d++)D(d);return a},r.prototype.toArray=function(){return mt(this._data)},r.prototype.valueOf=function(){return this._data},r.prototype.format=function(s){return yt(this._data,s)},r.prototype.toString=function(){return yt(this._data)},r.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},r.prototype.diagonal=function(s){if(s){if(bt(s)&&(s=s.toNumber()),!ut(s)||!vt(s))throw new TypeError("The parameter k must be an integer number")}else s=0;for(var a=s>0?s:0,c=s<0?-s:0,p=this._size[0],D=this._size[1],d=Math.min(p-c,D-a),g=[],m=0;m<d;m++)g[m]=this._data[m+c][m+a];return new r({data:g,size:[d],datatype:this._datatype})},r.diagonal=function(s,a,c,p){if(!ct(s))throw new TypeError("Array expected, size parameter");if(s.length!==2)throw new Error("Only two dimensions matrix are supported");if(s=s.map(function(F){if(bt(F)&&(F=F.toNumber()),!ut(F)||!vt(F)||F<1)throw new Error("Size values must be positive integers");return F}),c){if(bt(c)&&(c=c.toNumber()),!ut(c)||!vt(c))throw new TypeError("The parameter k must be an integer number")}else c=0;var D=c>0?c:0,d=c<0?-c:0,g=s[0],m=s[1],y=Math.min(g-d,m-D),v;if(ct(a)){if(a.length!==y)throw new Error("Invalid value array length");v=function(S){return a[S]}}else if(at(a)){var w=a.size();if(w.length!==1||w[0]!==y)throw new Error("Invalid matrix length");v=function(S){return a.get([S])}}else v=function(){return a};p||(p=bt(v(0))?v(0).mul(0):0);var E=[];if(s.length>0){E=Ea(E,s,p);for(var C=0;C<y;C++)E[C+d][C+D]=v(C)}return new r({data:E,size:[g,m]})},r.fromJSON=function(s){return new r(s)},r.prototype.swapRows=function(s,a){if(!ut(s)||!vt(s)||!ut(a)||!vt(a))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return ft(s,this._size[0]),ft(a,this._size[0]),r._swapRows(s,a,this._data),this},r._swapRows=function(s,a,c){var p=c[s];c[s]=c[a],c[a]=p};function h(s){return at(s)?h(s.valueOf()):ct(s)?s.map(h):s}return r},{isClass:!0});function H1(e){var t=e.length,r=e[0].length,n,i,o=[];for(i=0;i<r;i++){var u=[];for(n=0;n<t;n++)u.push(e[n][i]);o.push(u)}return o}function du(e){for(var t=0;t<e.length;t++)if(hi(e[t]))return!0;return!1}function gi(e,t){at(e)&&(e=e.valueOf());for(var r=0,n=e.length;r<n;r++){var i=e[r];Array.isArray(i)?gi(i,t):t(i)}}function Cr(e,t,r){return e&&typeof e.map=="function"?e.map(function(n){return Cr(n,t)}):t(e)}function rs(e,t,r){var n=Array.isArray(e)?$t(e):e.size();if(t<0||t>=n.length)throw new Qr(t,n.length);return at(e)?e.create(Zo(e.valueOf(),t,r)):Zo(e,t,r)}function Zo(e,t,r){var n,i,o,u;if(t<=0)if(Array.isArray(e[0])){for(u=H1(e),i=[],n=0;n<u.length;n++)i[n]=Zo(u[n],t-1,r);return i}else{for(o=e[0],n=1;n<e.length;n++)o=r(o,e[n]);return o}else{for(i=[],n=0;n<e.length;n++)i[n]=Zo(e[n],t-1,r);return i}}var jl="isInteger",W1=["typed"],G1=ie(jl,W1,e=>{var{typed:t}=e;return t(jl,{number:vt,BigNumber:function(n){return n.isInt()},Fraction:function(n){return n.d===1&&isFinite(n.n)},"Array | Matrix":t.referToSelf(r=>n=>Cr(n,r))})}),bh="number",ns="number, number";function xh(e){return Math.abs(e)}xh.signature=bh;function Th(e,t){return e+t}Th.signature=ns;function _h(e,t){return e-t}_h.signature=ns;function Mh(e,t){return e*t}Mh.signature=ns;function Nh(e){return-e}Nh.signature=bh;var Bh="number";function Oh(e){return e===0}Oh.signature=Bh;function Rh(e){return Number.isNaN(e)}Rh.signature=Bh;var Vl="isNumeric",Q1=["typed"],Z1=ie(Vl,Q1,e=>{var{typed:t}=e;return t(Vl,{"number | BigNumber | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":t.referToSelf(r=>n=>Cr(n,r))})}),Hl="isZero",Y1=["typed"],X1=ie(Hl,Y1,e=>{var{typed:t}=e;return t(Hl,{number:Oh,BigNumber:function(n){return n.isZero()},Complex:function(n){return n.re===0&&n.im===0},Fraction:function(n){return n.d===1&&n.n===0},Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Cr(n,r))})}),Wl="isNaN",K1=["typed"],J1=ie(Wl,K1,e=>{var{typed:t}=e;return t(Wl,{number:Rh,BigNumber:function(n){return n.isNaN()},Fraction:function(n){return!1},Complex:function(n){return n.isNaN()},Unit:function(n){return Number.isNaN(n.value)},"Array | Matrix":function(n){return Cr(n,Number.isNaN)}})});function pu(e,t,r){if(r==null)return e.eq(t);if(e.eq(t))return!0;if(e.isNaN()||t.isNaN())return!1;if(e.isFinite()&&t.isFinite()){var n=e.minus(t).abs();if(n.isZero())return!0;var i=e.constructor.max(e.abs(),t.abs());return n.lte(i.times(r))}return!1}function eD(e,t,r){return Pn(e.re,t.re,r)&&Pn(e.im,t.im,r)}var mu=ie("compareUnits",["typed"],e=>{var{typed:t}=e;return{"Unit, Unit":t.referToSelf(r=>(n,i)=>{if(!n.equalBase(i))throw new Error("Cannot compare units with different base");return t.find(r,[n.valueType(),i.valueType()])(n.value,i.value)})}}),Yo="equalScalar",tD=["typed","config"],rD=ie(Yo,tD,e=>{var{typed:t,config:r}=e,n=mu({typed:t});return t(Yo,{"boolean, boolean":function(o,u){return o===u},"number, number":function(o,u){return Pn(o,u,r.epsilon)},"BigNumber, BigNumber":function(o,u){return o.eq(u)||pu(o,u,r.epsilon)},"Fraction, Fraction":function(o,u){return o.equals(u)},"Complex, Complex":function(o,u){return eD(o,u,r.epsilon)}},n)});ie(Yo,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Yo,{"number, number":function(i,o){return Pn(i,o,r.epsilon)}})});var nD="SparseMatrix",iD=["typed","equalScalar","Matrix"],oD=ie(nD,iD,e=>{var{typed:t,equalScalar:r,Matrix:n}=e;function i(d,g){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(g&&!Rr(g))throw new Error("Invalid datatype: "+g);if(at(d))o(this,d,g);else if(d&&ct(d.index)&&ct(d.ptr)&&ct(d.size))this._values=d.values,this._index=d.index,this._ptr=d.ptr,this._size=d.size,this._datatype=g||d.datatype;else if(ct(d))u(this,d,g);else{if(d)throw new TypeError("Unsupported type of data ("+wr(d)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=g}}function o(d,g,m){g.type==="SparseMatrix"?(d._values=g._values?mt(g._values):void 0,d._index=mt(g._index),d._ptr=mt(g._ptr),d._size=mt(g._size),d._datatype=m||g._datatype):u(d,g.valueOf(),m||g._datatype)}function u(d,g,m){d._values=[],d._index=[],d._ptr=[],d._datatype=m;var y=g.length,v=0,w=r,E=0;if(Rr(m)&&(w=t.find(r,[m,m])||r,E=t.convert(0,m)),y>0){var C=0;do{d._ptr.push(d._index.length);for(var F=0;F<y;F++){var S=g[F];if(ct(S)){if(C===0&&v<S.length&&(v=S.length),C<S.length){var b=S[C];w(b,E)||(d._values.push(b),d._index.push(F))}}else C===0&&v<1&&(v=1),w(S,E)||(d._values.push(S),d._index.push(F))}C++}while(C<v)}d._ptr.push(d._index.length),d._size=[y,v]}i.prototype=new n,i.prototype.createSparseMatrix=function(d,g){return new i(d,g)},Object.defineProperty(i,"name",{value:"SparseMatrix"}),i.prototype.constructor=i,i.prototype.type="SparseMatrix",i.prototype.isSparseMatrix=!0,i.prototype.getDataType=function(){return Vo(this._values,wr)},i.prototype.storage=function(){return"sparse"},i.prototype.datatype=function(){return this._datatype},i.prototype.create=function(d,g){return new i(d,g)},i.prototype.density=function(){var d=this._size[0],g=this._size[1];return d!==0&&g!==0?this._index.length/(d*g):0},i.prototype.subset=function(d,g,m){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return l(this,d);case 2:case 3:return f(this,d,g,m);default:throw new SyntaxError("Wrong number of arguments")}};function l(d,g){if(!Ja(g))throw new TypeError("Invalid index");var m=g.isScalar();if(m)return d.get(g.min());var y=g.size();if(y.length!==d._size.length)throw new Ue(y.length,d._size.length);var v,w,E,C,F=g.min(),S=g.max();for(v=0,w=d._size.length;v<w;v++)ft(F[v],d._size[v]),ft(S[v],d._size[v]);var b=d._values,P=d._index,B=d._ptr,k=g.dimension(0),H=g.dimension(1),M=[],I=[];k.forEach(function(re,fe){I[re]=fe[0],M[re]=!0});var O=b?[]:void 0,oe=[],ee=[];return H.forEach(function(re){for(ee.push(oe.length),E=B[re],C=B[re+1];E<C;E++)v=P[E],M[v]===!0&&(oe.push(I[v]),O&&O.push(b[E]))}),ee.push(oe.length),new i({values:O,index:oe,ptr:ee,size:y,datatype:d._datatype})}function f(d,g,m,y){if(!g||g.isIndex!==!0)throw new TypeError("Invalid index");var v=g.size(),w=g.isScalar(),E;if(at(m)?(E=m.size(),m=m.toArray()):E=$t(m),w){if(E.length!==0)throw new TypeError("Scalar expected");d.set(g.min(),m,y)}else{if(v.length!==1&&v.length!==2)throw new Ue(v.length,d._size.length,"<");if(E.length<v.length){for(var C=0,F=0;v[C]===1&&E[C]===1;)C++;for(;v[C]===1;)F++,C++;m=ih(m,v.length,F,E)}if(!di(v,E))throw new Ue(v,E,">");if(v.length===1){var S=g.dimension(0);S.forEach(function(B,k){ft(B),d.set([B,0],m[k[0]],y)})}else{var b=g.dimension(0),P=g.dimension(1);b.forEach(function(B,k){ft(B),P.forEach(function(H,M){ft(H),d.set([B,H],m[k[0]][M[0]],y)})})}}return d}i.prototype.get=function(d){if(!ct(d))throw new TypeError("Array expected");if(d.length!==this._size.length)throw new Ue(d.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var g=d[0],m=d[1];ft(g,this._size[0]),ft(m,this._size[1]);var y=h(g,this._ptr[m],this._ptr[m+1],this._index);return y<this._ptr[m+1]&&this._index[y]===g?this._values[y]:0},i.prototype.set=function(d,g,m){if(!ct(d))throw new TypeError("Array expected");if(d.length!==this._size.length)throw new Ue(d.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var y=d[0],v=d[1],w=this._size[0],E=this._size[1],C=r,F=0;Rr(this._datatype)&&(C=t.find(r,[this._datatype,this._datatype])||r,F=t.convert(0,this._datatype)),(y>w-1||v>E-1)&&(c(this,Math.max(y+1,w),Math.max(v+1,E),m),w=this._size[0],E=this._size[1]),ft(y,w),ft(v,E);var S=h(y,this._ptr[v],this._ptr[v+1],this._index);return S<this._ptr[v+1]&&this._index[S]===y?C(g,F)?s(S,v,this._values,this._index,this._ptr):this._values[S]=g:C(g,F)||a(S,y,v,g,this._values,this._index,this._ptr),this};function h(d,g,m,y){if(m-g===0)return m;for(var v=g;v<m;v++)if(y[v]===d)return v;return g}function s(d,g,m,y,v){m.splice(d,1),y.splice(d,1);for(var w=g+1;w<v.length;w++)v[w]--}function a(d,g,m,y,v,w,E){v.splice(d,0,y),w.splice(d,0,g);for(var C=m+1;C<E.length;C++)E[C]++}i.prototype.resize=function(d,g,m){if(!hi(d))throw new TypeError("Array or Matrix expected");var y=d.valueOf().map(w=>Array.isArray(w)&&w.length===1?w[0]:w);if(y.length!==2)throw new Error("Only two dimensions matrix are supported");y.forEach(function(w){if(!ut(w)||!vt(w)||w<0)throw new TypeError("Invalid size, must contain positive integers (size: "+yt(y)+")")});var v=m?this.clone():this;return c(v,y[0],y[1],g)};function c(d,g,m,y){var v=y||0,w=r,E=0;Rr(d._datatype)&&(w=t.find(r,[d._datatype,d._datatype])||r,E=t.convert(0,d._datatype),v=t.convert(v,d._datatype));var C=!w(v,E),F=d._size[0],S=d._size[1],b,P,B;if(m>S){for(P=S;P<m;P++)if(d._ptr[P]=d._values.length,C)for(b=0;b<F;b++)d._values.push(v),d._index.push(b);d._ptr[m]=d._values.length}else m<S&&(d._ptr.splice(m+1,S-m),d._values.splice(d._ptr[m],d._values.length),d._index.splice(d._ptr[m],d._index.length));if(S=m,g>F){if(C){var k=0;for(P=0;P<S;P++){d._ptr[P]=d._ptr[P]+k,B=d._ptr[P+1]+k;var H=0;for(b=F;b<g;b++,H++)d._values.splice(B+H,0,v),d._index.splice(B+H,0,b),k++}d._ptr[S]=d._values.length}}else if(g<F){var M=0;for(P=0;P<S;P++){d._ptr[P]=d._ptr[P]-M;var I=d._ptr[P],O=d._ptr[P+1]-M;for(B=I;B<O;B++)b=d._index[B],b>g-1&&(d._values.splice(B,1),d._index.splice(B,1),M++)}d._ptr[P]=d._values.length}return d._size[0]=g,d._size[1]=m,d}i.prototype.reshape=function(d,g){if(!ct(d))throw new TypeError("Array expected");if(d.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");d.forEach(function(re){if(!ut(re)||!vt(re)||re<=-2||re===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+yt(d)+")")});var m=this._size[0]*this._size[1];d=es(d,m);var y=d[0]*d[1];if(m!==y)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var v=g?this.clone():this;if(this._size[0]===d[0]&&this._size[1]===d[1])return v;for(var w=[],E=0;E<v._ptr.length;E++)for(var C=0;C<v._ptr[E+1]-v._ptr[E];C++)w.push(E);for(var F=v._values.slice(),S=v._index.slice(),b=0;b<v._index.length;b++){var P=S[b],B=w[b],k=P*v._size[1]+B;w[b]=k%d[1],S[b]=Math.floor(k/d[1])}v._values.length=0,v._index.length=0,v._ptr.length=d[1]+1,v._size=d.slice();for(var H=0;H<v._ptr.length;H++)v._ptr[H]=0;for(var M=0;M<F.length;M++){var I=S[M],O=w[M],oe=F[M],ee=h(I,v._ptr[O],v._ptr[O+1],v._index);a(ee,I,O,oe,v._values,v._index,v._ptr)}return v},i.prototype.clone=function(){var d=new i({values:this._values?mt(this._values):void 0,index:mt(this._index),ptr:mt(this._ptr),size:mt(this._size),datatype:this._datatype});return d},i.prototype.size=function(){return this._size.slice(0)},i.prototype.map=function(d,g){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var m=this,y=this._size[0],v=this._size[1],w=Fh(d),E=function(F,S,b){return w===1?d(F):w===2?d(F,[S,b]):d(F,[S,b],m)};return p(this,0,y-1,0,v-1,E,g)};function p(d,g,m,y,v,w,E){var C=[],F=[],S=[],b=r,P=0;Rr(d._datatype)&&(b=t.find(r,[d._datatype,d._datatype])||r,P=t.convert(0,d._datatype));for(var B=function(ue,Qe,ve){ue=w(ue,Qe,ve),b(ue,P)||(C.push(ue),F.push(Qe))},k=y;k<=v;k++){S.push(C.length);var H=d._ptr[k],M=d._ptr[k+1];if(E)for(var I=H;I<M;I++){var O=d._index[I];O>=g&&O<=m&&B(d._values[I],O-g,k-y)}else{for(var oe={},ee=H;ee<M;ee++){var re=d._index[ee];oe[re]=d._values[ee]}for(var fe=g;fe<=m;fe++){var he=fe in oe?oe[fe]:0;B(he,fe-g,k-y)}}}return S.push(C.length),new i({values:C,index:F,ptr:S,size:[m-g+1,v-y+1]})}i.prototype.forEach=function(d,g){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var m=this,y=this._size[0],v=this._size[1],w=0;w<v;w++){var E=this._ptr[w],C=this._ptr[w+1];if(g)for(var F=E;F<C;F++){var S=this._index[F];d(this._values[F],[S,w],m)}else{for(var b={},P=E;P<C;P++){var B=this._index[P];b[B]=this._values[P]}for(var k=0;k<y;k++){var H=k in b?b[k]:0;d(H,[k,w],m)}}}},i.prototype[Symbol.iterator]=function*(){if(!this._values)throw new Error("Cannot iterate a Pattern only matrix");for(var d=this._size[1],g=0;g<d;g++)for(var m=this._ptr[g],y=this._ptr[g+1],v=m;v<y;v++){var w=this._index[v];yield{value:this._values[v],index:[w,g]}}},i.prototype.toArray=function(){return D(this._values,this._index,this._ptr,this._size,!0)},i.prototype.valueOf=function(){return D(this._values,this._index,this._ptr,this._size,!1)};function D(d,g,m,y,v){var w=y[0],E=y[1],C=[],F,S;for(F=0;F<w;F++)for(C[F]=[],S=0;S<E;S++)C[F][S]=0;for(S=0;S<E;S++)for(var b=m[S],P=m[S+1],B=b;B<P;B++)F=g[B],C[F][S]=d?v?mt(d[B]):d[B]:1;return C}return i.prototype.format=function(d){for(var g=this._size[0],m=this._size[1],y=this.density(),v="Sparse Matrix ["+yt(g,d)+" x "+yt(m,d)+"] density: "+yt(y,d)+` `,w=0;w<m;w++)for(var E=this._ptr[w],C=this._ptr[w+1],F=E;F<C;F++){var S=this._index[F];v+=` (`+yt(S,d)+", "+yt(w,d)+") ==> "+(this._values?yt(this._values[F],d):"X")}return v},i.prototype.toString=function(){return yt(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(d){if(d){if(bt(d)&&(d=d.toNumber()),!ut(d)||!vt(d))throw new TypeError("The parameter k must be an integer number")}else d=0;var g=d>0?d:0,m=d<0?-d:0,y=this._size[0],v=this._size[1],w=Math.min(y-m,v-g),E=[],C=[],F=[];F[0]=0;for(var S=g;S<v&&E.length<w;S++)for(var b=this._ptr[S],P=this._ptr[S+1],B=b;B<P;B++){var k=this._index[B];if(k===S-g+m){E.push(this._values[B]),C[E.length-1]=k-m;break}}return F.push(E.length),new i({values:E,index:C,ptr:F,size:[w,1]})},i.fromJSON=function(d){return new i(d)},i.diagonal=function(d,g,m,y,v){if(!ct(d))throw new TypeError("Array expected, size parameter");if(d.length!==2)throw new Error("Only two dimensions matrix are supported");if(d=d.map(function(re){if(bt(re)&&(re=re.toNumber()),!ut(re)||!vt(re)||re<1)throw new Error("Size values must be positive integers");return re}),m){if(bt(m)&&(m=m.toNumber()),!ut(m)||!vt(m))throw new TypeError("The parameter k must be an integer number")}else m=0;var w=r,E=0;Rr(v)&&(w=t.find(r,[v,v])||r,E=t.convert(0,v));var C=m>0?m:0,F=m<0?-m:0,S=d[0],b=d[1],P=Math.min(S-F,b-C),B;if(ct(g)){if(g.length!==P)throw new Error("Invalid value array length");B=function(fe){return g[fe]}}else if(at(g)){var k=g.size();if(k.length!==1||k[0]!==P)throw new Error("Invalid matrix length");B=function(fe){return g.get([fe])}}else B=function(){return g};for(var H=[],M=[],I=[],O=0;O<b;O++){I.push(H.length);var oe=O-C;if(oe>=0&&oe<P){var ee=B(oe);w(ee,E)||(M.push(oe+F),H.push(ee))}}return I.push(H.length),new i({values:H,index:M,ptr:I,size:[S,b]})},i.prototype.swapRows=function(d,g){if(!ut(d)||!vt(d)||!ut(g)||!vt(g))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return ft(d,this._size[0]),ft(g,this._size[0]),i._swapRows(d,g,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(d,g,m,y,v){for(var w=y[d],E=y[d+1],C=w;C<E;C++)v(m[C],g[C])},i._swapRows=function(d,g,m,y,v,w){for(var E=0;E<m;E++){var C=w[E],F=w[E+1],S=h(d,C,F,v),b=h(g,C,F,v);if(S<F&&b<F&&v[S]===d&&v[b]===g){if(y){var P=y[S];y[S]=y[b],y[b]=P}continue}if(S<F&&v[S]===d&&(b>=F||v[b]!==g)){var B=y?y[S]:void 0;v.splice(b,0,g),y&&y.splice(b,0,B),v.splice(b<=S?S+1:S,1),y&&y.splice(b<=S?S+1:S,1);continue}if(b<F&&v[b]===g&&(S>=F||v[S]!==d)){var k=y?y[b]:void 0;v.splice(S,0,d),y&&y.splice(S,0,k),v.splice(S<=b?b+1:b,1),y&&y.splice(S<=b?b+1:b,1)}}},i},{isClass:!0}),uD="number",aD=["typed"];function sD(e){var t=e.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(t){var r={"0b":2,"0o":8,"0x":16}[t[1]],n=t[2],i=t[3];return{input:e,radix:r,integerPart:n,fractionalPart:i}}else return null}function lD(e){for(var t=parseInt(e.integerPart,e.radix),r=0,n=0;n<e.fractionalPart.length;n++){var i=parseInt(e.fractionalPart[n],e.radix);r+=i/Math.pow(e.radix,n+1)}var o=t+r;if(isNaN(o))throw new SyntaxError('String "'+e.input+'" is no valid number');return o}var cD=ie(uD,aD,e=>{var{typed:t}=e,r=t("number",{"":function(){return 0},number:function(i){return i},string:function(i){if(i==="NaN")return NaN;var o=sD(i);if(o)return lD(o);var u=0,l=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);l&&(u=Number(l[2]),i=l[1]);var f=Number(i);if(isNaN(f))throw new SyntaxError('String "'+i+'" is no valid number');if(l){if(f>2**u-1)throw new SyntaxError('String "'.concat(i,'" is out of range'));f>=2**(u-1)&&(f=f-2**u)}return f},BigNumber:function(i){return i.toNumber()},Fraction:function(i){return i.valueOf()},Unit:t.referToSelf(n=>i=>{var o=i.clone();return o.value=n(i.value),o}),null:function(i){return 0},"Unit, string | Unit":function(i,o){return i.toNumber(o)},"Array | Matrix":t.referToSelf(n=>i=>Cr(i,n))});return r.fromJSON=function(n){return parseFloat(n.value)},r}),fD="bignumber",hD=["typed","BigNumber"],dD=ie(fD,hD,e=>{var{typed:t,BigNumber:r}=e;return t("bignumber",{"":function(){return new r(0)},number:function(i){return new r(i+"")},string:function(i){var o=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(o){var u=o[2],l=r(o[1]),f=new r(2).pow(Number(u));if(l.gt(f.sub(1)))throw new SyntaxError('String "'.concat(i,'" is out of range'));var h=new r(2).pow(Number(u)-1);return l.gte(h)?l.sub(f):l}return new r(i)},BigNumber:function(i){return i},Unit:t.referToSelf(n=>i=>{var o=i.clone();return o.value=n(i.value),o}),Fraction:function(i){return new r(i.n).div(i.d).times(i.s)},null:function(i){return new r(0)},"Array | Matrix":t.referToSelf(n=>i=>Cr(i,n))})}),pD="fraction",mD=["typed","Fraction"],gD=ie(pD,mD,e=>{var{typed:t,Fraction:r}=e;return t("fraction",{number:function(i){if(!isFinite(i)||isNaN(i))throw new Error(i+" cannot be represented as a fraction");return new r(i)},string:function(i){return new r(i)},"number, number":function(i,o){return new r(i,o)},null:function(i){return new r(0)},BigNumber:function(i){return new r(i.toString())},Fraction:function(i){return i},Unit:t.referToSelf(n=>i=>{var o=i.clone();return o.value=n(i.value),o}),Object:function(i){return new r(i)},"Array | Matrix":t.referToSelf(n=>i=>Cr(i,n))})}),Gl="matrix",vD=["typed","Matrix","DenseMatrix","SparseMatrix"],DD=ie(Gl,vD,e=>{var{typed:t,Matrix:r,DenseMatrix:n,SparseMatrix:i}=e;return t(Gl,{"":function(){return o([])},string:function(l){return o([],l)},"string, string":function(l,f){return o([],l,f)},Array:function(l){return o(l)},Matrix:function(l){return o(l,l.storage())},"Array | Matrix, string":o,"Array | Matrix, string, string":o});function o(u,l,f){if(l==="dense"||l==="default"||l===void 0)return new n(u,f);if(l==="sparse")return new i(u,f);throw new TypeError("Unknown matrix type "+JSON.stringify(l)+".")}}),Ql="unaryMinus",yD=["typed"],wD=ie(Ql,yD,e=>{var{typed:t}=e;return t(Ql,{number:Nh,"Complex | BigNumber | Fraction":r=>r.neg(),Unit:t.referToSelf(r=>n=>{var i=n.clone();return i.value=t.find(r,i.valueType())(n.value),i}),"Array | Matrix":t.referToSelf(r=>n=>Cr(n,r))})}),Zl="abs",ED=["typed"],CD=ie(Zl,ED,e=>{var{typed:t}=e;return t(Zl,{number:xh,"Complex | BigNumber | Fraction | Unit":r=>r.abs(),"Array | Matrix":t.referToSelf(r=>n=>Cr(n,r))})}),Yl="apply",AD=["typed","isInteger"],SD=ie(Yl,AD,e=>{var{typed:t,isInteger:r}=e;return t(Yl,{"Array | Matrix, number | BigNumber, function":function(i,o,u){if(!r(o))throw new TypeError("Integer number expected for dimension");var l=Array.isArray(i)?$t(i):i.size();if(o<0||o>=l.length)throw new Qr(o,l.length);return at(i)?i.create(Xo(i.valueOf(),o,u)):Xo(i,o,u)}})});function Xo(e,t,r){var n,i,o;if(t<=0)if(Array.isArray(e[0])){for(o=FD(e),i=[],n=0;n<o.length;n++)i[n]=Xo(o[n],t-1,r);return i}else return r(e);else{for(i=[],n=0;n<e.length;n++)i[n]=Xo(e[n],t-1,r);return i}}function FD(e){var t=e.length,r=e[0].length,n,i,o=[];for(i=0;i<r;i++){var u=[];for(n=0;n<t;n++)u.push(e[n][i]);o.push(u)}return o}var Xl="addScalar",bD=["typed"],xD=ie(Xl,bD,e=>{var{typed:t}=e;return t(Xl,{"number, number":Th,"Complex, Complex":function(n,i){return n.add(i)},"BigNumber, BigNumber":function(n,i){return n.plus(i)},"Fraction, Fraction":function(n,i){return n.add(i)},"Unit, Unit":t.referToSelf(r=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var o=n.clone();return o.value=t.find(r,[o.valueType(),i.valueType()])(o.value,i.value),o.fixPrefix=!1,o})})}),Kl="subtractScalar",TD=["typed"],_D=ie(Kl,TD,e=>{var{typed:t}=e;return t(Kl,{"number, number":_h,"Complex, Complex":function(n,i){return n.sub(i)},"BigNumber, BigNumber":function(n,i){return n.minus(i)},"Fraction, Fraction":function(n,i){return n.sub(i)},"Unit, Unit":t.referToSelf(r=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var o=n.clone();return o.value=t.find(r,[o.valueType(),i.valueType()])(o.value,i.value),o.fixPrefix=!1,o})})}),MD="matAlgo11xS0s",ND=["typed","equalScalar"],Ph=ie(MD,ND,e=>{var{typed:t,equalScalar:r}=e;return function(i,o,u,l){var f=i._values,h=i._index,s=i._ptr,a=i._size,c=i._datatype;if(!f)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=a[0],D=a[1],d,g=r,m=0,y=u;typeof c=="string"&&(d=c,g=t.find(r,[d,d]),m=t.convert(0,d),o=t.convert(o,d),y=t.find(u,[d,d]));for(var v=[],w=[],E=[],C=0;C<D;C++){E[C]=w.length;for(var F=s[C],S=s[C+1],b=F;b<S;b++){var P=h[b],B=l?y(o,f[b]):y(f[b],o);g(B,m)||(w.push(P),v.push(B))}}return E[D]=w.length,i.createSparseMatrix({values:v,index:w,ptr:E,size:[p,D],datatype:d})}}),BD="matAlgo12xSfs",OD=["typed","DenseMatrix"],gu=ie(BD,OD,e=>{var{typed:t,DenseMatrix:r}=e;return function(i,o,u,l){var f=i._values,h=i._index,s=i._ptr,a=i._size,c=i._datatype;if(!f)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=a[0],D=a[1],d,g=u;typeof c=="string"&&(d=c,o=t.convert(o,d),g=t.find(u,[d,d]));for(var m=[],y=[],v=[],w=0;w<D;w++){for(var E=w+1,C=s[w],F=s[w+1],S=C;S<F;S++){var b=h[S];y[b]=f[S],v[b]=E}for(var P=0;P<p;P++)w===0&&(m[P]=[]),v[P]===E?m[P][w]=l?g(o,y[P]):g(y[P],o):m[P][w]=l?g(o,0):g(0,o)}return new r({data:m,size:[p,D],datatype:d})}}),RD="matAlgo14xDs",PD=["typed"],is=ie(RD,PD,e=>{var{typed:t}=e;return function(i,o,u,l){var f=i._data,h=i._size,s=i._datatype,a,c=u;typeof s=="string"&&(a=s,o=t.convert(o,a),c=t.find(u,[a,a]));var p=h.length>0?r(c,0,h,h[0],f,o,l):[];return i.createDenseMatrix({data:p,size:mt(h),datatype:a})};function r(n,i,o,u,l,f,h){var s=[];if(i===o.length-1)for(var a=0;a<u;a++)s[a]=h?n(f,l[a]):n(l[a],f);else for(var c=0;c<u;c++)s[c]=r(n,i+1,o,o[i+1],l[c],f,h);return s}}),kD="matAlgo03xDSf",ID=["typed"],vu=ie(kD,ID,e=>{var{typed:t}=e;return function(n,i,o,u){var l=n._data,f=n._size,h=n._datatype,s=i._values,a=i._index,c=i._ptr,p=i._size,D=i._datatype;if(f.length!==p.length)throw new Ue(f.length,p.length);if(f[0]!==p[0]||f[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+p+")");if(!s)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var d=f[0],g=f[1],m,y=0,v=o;typeof h=="string"&&h===D&&(m=h,y=t.convert(0,m),v=t.find(o,[m,m]));for(var w=[],E=0;E<d;E++)w[E]=[];for(var C=[],F=[],S=0;S<g;S++){for(var b=S+1,P=c[S],B=c[S+1],k=P;k<B;k++){var H=a[k];C[H]=u?v(s[k],l[H][S]):v(l[H][S],s[k]),F[H]=b}for(var M=0;M<d;M++)F[M]===b?w[M][S]=C[M]:w[M][S]=u?v(y,l[M][S]):v(l[M][S],y)}return n.createDenseMatrix({data:w,size:[d,g],datatype:m})}}),LD="matAlgo05xSfSf",zD=["typed","equalScalar"],kh=ie(LD,zD,e=>{var{typed:t,equalScalar:r}=e;return function(i,o,u){var l=i._values,f=i._index,h=i._ptr,s=i._size,a=i._datatype,c=o._values,p=o._index,D=o._ptr,d=o._size,g=o._datatype;if(s.length!==d.length)throw new Ue(s.length,d.length);if(s[0]!==d[0]||s[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+d+")");var m=s[0],y=s[1],v,w=r,E=0,C=u;typeof a=="string"&&a===g&&(v=a,w=t.find(r,[v,v]),E=t.convert(0,v),C=t.find(u,[v,v]));var F=l&&c?[]:void 0,S=[],b=[],P=F?[]:void 0,B=F?[]:void 0,k=[],H=[],M,I,O,oe;for(I=0;I<y;I++){b[I]=S.length;var ee=I+1;for(O=h[I],oe=h[I+1];O<oe;O++)M=f[O],S.push(M),k[M]=ee,P&&(P[M]=l[O]);for(O=D[I],oe=D[I+1];O<oe;O++)M=p[O],k[M]!==ee&&S.push(M),H[M]=ee,B&&(B[M]=c[O]);if(F)for(O=b[I];O<S.length;){M=S[O];var re=k[M],fe=H[M];if(re===ee||fe===ee){var he=re===ee?P[M]:E,Me=fe===ee?B[M]:E,ue=C(he,Me);w(ue,E)?S.splice(O,1):(F.push(ue),O++)}}}return b[y]=S.length,i.createSparseMatrix({values:F,index:S,ptr:b,size:[m,y],datatype:v})}}),$D="matAlgo13xDD",UD=["typed"],qD=ie($D,UD,e=>{var{typed:t}=e;return function(i,o,u){var l=i._data,f=i._size,h=i._datatype,s=o._data,a=o._size,c=o._datatype,p=[];if(f.length!==a.length)throw new Ue(f.length,a.length);for(var D=0;D<f.length;D++){if(f[D]!==a[D])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+a+")");p[D]=f[D]}var d,g=u;typeof h=="string"&&h===c&&(d=h,g=t.find(u,[d,d]));var m=p.length>0?r(g,0,p,p[0],l,s):[];return i.createDenseMatrix({data:m,size:p,datatype:d})};function r(n,i,o,u,l,f){var h=[];if(i===o.length-1)for(var s=0;s<u;s++)h[s]=n(l[s],f[s]);else for(var a=0;a<u;a++)h[a]=r(n,i+1,o,o[i+1],l[a],f[a]);return h}}),jD="broadcast",VD=["concat"],HD=ie(jD,VD,e=>{var{concat:t}=e;return function(i,o){var u=Math.max(i._size.length,o._size.length);if(i._size.length===o._size.length&&i._size.every((D,d)=>D===o._size[d]))return[i,o];for(var l=r(i._size,u,0),f=r(o._size,u,0),h=[],s=0;s<u;s++)h[s]=Math.max(l[s],f[s]);Ho(l,h),Ho(f,h);var a=i.clone(),c=o.clone();a._size.length<u?a.reshape(r(a._size,u,1)):c._size.length<u&&c.reshape(r(c._size,u,1));for(var p=0;p<u;p++)a._size[p]<h[p]&&(a=n(a,h[p],p)),c._size[p]<h[p]&&(c=n(c,h[p],p));return[a,c]};function r(i,o,u){return[...Array(o-i.length).fill(u),...i]}function n(i,o,u){return t(...Array(o).fill(i),u)}}),WD="matrixAlgorithmSuite",GD=["typed","matrix","concat"],io=ie(WD,GD,e=>{var{typed:t,matrix:r,concat:n}=e,i=qD({typed:t}),o=is({typed:t}),u=HD({concat:n});return function(f){var h=f.elop,s=f.SD||f.DS,a;h?(a={"DenseMatrix, DenseMatrix":(d,g)=>i(...u(d,g),h),"Array, Array":(d,g)=>i(...u(r(d),r(g)),h).valueOf(),"Array, DenseMatrix":(d,g)=>i(...u(r(d),g),h),"DenseMatrix, Array":(d,g)=>i(...u(d,r(g)),h)},f.SS&&(a["SparseMatrix, SparseMatrix"]=(d,g)=>f.SS(...u(d,g),h,!1)),f.DS&&(a["DenseMatrix, SparseMatrix"]=(d,g)=>f.DS(...u(d,g),h,!1),a["Array, SparseMatrix"]=(d,g)=>f.DS(...u(r(d),g),h,!1)),s&&(a["SparseMatrix, DenseMatrix"]=(d,g)=>s(...u(g,d),h,!0),a["SparseMatrix, Array"]=(d,g)=>s(...u(r(g),d),h,!0))):(a={"DenseMatrix, DenseMatrix":t.referToSelf(d=>(g,m)=>i(...u(g,m),d)),"Array, Array":t.referToSelf(d=>(g,m)=>i(...u(r(g),r(m)),d).valueOf()),"Array, DenseMatrix":t.referToSelf(d=>(g,m)=>i(...u(r(g),m),d)),"DenseMatrix, Array":t.referToSelf(d=>(g,m)=>i(...u(g,r(m)),d))},f.SS&&(a["SparseMatrix, SparseMatrix"]=t.referToSelf(d=>(g,m)=>f.SS(...u(g,m),d,!1))),f.DS&&(a["DenseMatrix, SparseMatrix"]=t.referToSelf(d=>(g,m)=>f.DS(...u(g,m),d,!1)),a["Array, SparseMatrix"]=t.referToSelf(d=>(g,m)=>f.DS(...u(r(g),m),d,!1))),s&&(a["SparseMatrix, DenseMatrix"]=t.referToSelf(d=>(g,m)=>s(...u(m,g),d,!0)),a["SparseMatrix, Array"]=t.referToSelf(d=>(g,m)=>s(...u(r(m),g),d,!0))));var c=f.scalar||"any",p=f.Ds||f.Ss;p&&(h?(a["DenseMatrix,"+c]=(d,g)=>o(d,g,h,!1),a[c+", DenseMatrix"]=(d,g)=>o(g,d,h,!0),a["Array,"+c]=(d,g)=>o(r(d),g,h,!1).valueOf(),a[c+", Array"]=(d,g)=>o(r(g),d,h,!0).valueOf()):(a["DenseMatrix,"+c]=t.referToSelf(d=>(g,m)=>o(g,m,d,!1)),a[c+", DenseMatrix"]=t.referToSelf(d=>(g,m)=>o(m,g,d,!0)),a["Array,"+c]=t.referToSelf(d=>(g,m)=>o(r(g),m,d,!1).valueOf()),a[c+", Array"]=t.referToSelf(d=>(g,m)=>o(r(m),g,d,!0).valueOf())));var D=f.sS!==void 0?f.sS:f.Ss;return h?(f.Ss&&(a["SparseMatrix,"+c]=(d,g)=>f.Ss(d,g,h,!1)),D&&(a[c+", SparseMatrix"]=(d,g)=>D(g,d,h,!0))):(f.Ss&&(a["SparseMatrix,"+c]=t.referToSelf(d=>(g,m)=>f.Ss(g,m,d,!1))),D&&(a[c+", SparseMatrix"]=t.referToSelf(d=>(g,m)=>D(m,g,d,!0)))),h&&h.signatures&&Xf(a,h.signatures),a}}),QD="matAlgo01xDSid",ZD=["typed"],Ih=ie(QD,ZD,e=>{var{typed:t}=e;return function(n,i,o,u){var l=n._data,f=n._size,h=n._datatype,s=i._values,a=i._index,c=i._ptr,p=i._size,D=i._datatype;if(f.length!==p.length)throw new Ue(f.length,p.length);if(f[0]!==p[0]||f[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+p+")");if(!s)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var d=f[0],g=f[1],m=typeof h=="string"&&h===D?h:void 0,y=m?t.find(o,[m,m]):o,v,w,E=[];for(v=0;v<d;v++)E[v]=[];var C=[],F=[];for(w=0;w<g;w++){for(var S=w+1,b=c[w],P=c[w+1],B=b;B<P;B++)v=a[B],C[v]=u?y(s[B],l[v][w]):y(l[v][w],s[B]),F[v]=S;for(v=0;v<d;v++)F[v]===S?E[v][w]=C[v]:E[v][w]=l[v][w]}return n.createDenseMatrix({data:E,size:[d,g],datatype:m})}}),YD="matAlgo04xSidSid",XD=["typed","equalScalar"],KD=ie(YD,XD,e=>{var{typed:t,equalScalar:r}=e;return function(i,o,u){var l=i._values,f=i._index,h=i._ptr,s=i._size,a=i._datatype,c=o._values,p=o._index,D=o._ptr,d=o._size,g=o._datatype;if(s.length!==d.length)throw new Ue(s.length,d.length);if(s[0]!==d[0]||s[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+d+")");var m=s[0],y=s[1],v,w=r,E=0,C=u;typeof a=="string"&&a===g&&(v=a,w=t.find(r,[v,v]),E=t.convert(0,v),C=t.find(u,[v,v]));var F=l&&c?[]:void 0,S=[],b=[],P=l&&c?[]:void 0,B=l&&c?[]:void 0,k=[],H=[],M,I,O,oe,ee;for(I=0;I<y;I++){b[I]=S.length;var re=I+1;for(oe=h[I],ee=h[I+1],O=oe;O<ee;O++)M=f[O],S.push(M),k[M]=re,P&&(P[M]=l[O]);for(oe=D[I],ee=D[I+1],O=oe;O<ee;O++)if(M=p[O],k[M]===re){if(P){var fe=C(P[M],c[O]);w(fe,E)?k[M]=null:P[M]=fe}}else S.push(M),H[M]=re,B&&(B[M]=c[O]);if(P&&B)for(O=b[I];O<S.length;)M=S[O],k[M]===re?(F[O]=P[M],O++):H[M]===re?(F[O]=B[M],O++):S.splice(O,1)}return b[y]=S.length,i.createSparseMatrix({values:F,index:S,ptr:b,size:[m,y],datatype:v})}}),JD="matAlgo10xSids",ey=["typed","DenseMatrix"],Lh=ie(JD,ey,e=>{var{typed:t,DenseMatrix:r}=e;return function(i,o,u,l){var f=i._values,h=i._index,s=i._ptr,a=i._size,c=i._datatype;if(!f)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=a[0],D=a[1],d,g=u;typeof c=="string"&&(d=c,o=t.convert(o,d),g=t.find(u,[d,d]));for(var m=[],y=[],v=[],w=0;w<D;w++){for(var E=w+1,C=s[w],F=s[w+1],S=C;S<F;S++){var b=h[S];y[b]=f[S],v[b]=E}for(var P=0;P<p;P++)w===0&&(m[P]=[]),v[P]===E?m[P][w]=l?g(o,y[P]):g(y[P],o):m[P][w]=o}return new r({data:m,size:[p,D],datatype:d})}}),ty="multiplyScalar",ry=["typed"],ny=ie(ty,ry,e=>{var{typed:t}=e;return t("multiplyScalar",{"number, number":Mh,"Complex, Complex":function(n,i){return n.mul(i)},"BigNumber, BigNumber":function(n,i){return n.times(i)},"Fraction, Fraction":function(n,i){return n.mul(i)},"number | Fraction | BigNumber | Complex, Unit":(r,n)=>n.multiply(r),"Unit, number | Fraction | BigNumber | Complex | Unit":(r,n)=>r.multiply(n)})}),Jl="multiply",iy=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],oy=ie(Jl,iy,e=>{var{typed:t,matrix:r,addScalar:n,multiplyScalar:i,equalScalar:o,dot:u}=e,l=Ph({typed:t,equalScalar:o}),f=is({typed:t});function h(E,C){switch(E.length){case 1:switch(C.length){case 1:if(E[0]!==C[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(E[0]!==C[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+E[0]+") must match Matrix rows ("+C[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+C.length+" dimensions)")}break;case 2:switch(C.length){case 1:if(E[1]!==C[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+E[1]+") must match Vector length ("+C[0]+")");break;case 2:if(E[1]!==C[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+E[1]+") must match Matrix B rows ("+C[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+C.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+E.length+" dimensions)")}}function s(E,C,F){if(F===0)throw new Error("Cannot multiply two empty vectors");return u(E,C)}function a(E,C){if(C.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return c(E,C)}function c(E,C){var F=E._data,S=E._size,b=E._datatype,P=C._data,B=C._size,k=C._datatype,H=S[0],M=B[1],I,O=n,oe=i;b&&k&&b===k&&typeof b=="string"&&(I=b,O=t.find(n,[I,I]),oe=t.find(i,[I,I]));for(var ee=[],re=0;re<M;re++){for(var fe=oe(F[0],P[0][re]),he=1;he<H;he++)fe=O(fe,oe(F[he],P[he][re]));ee[re]=fe}return E.createDenseMatrix({data:ee,size:[M],datatype:I})}var p=t("_multiplyMatrixVector",{"DenseMatrix, any":d,"SparseMatrix, any":y}),D=t("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":g,"DenseMatrix, SparseMatrix":m,"SparseMatrix, DenseMatrix":v,"SparseMatrix, SparseMatrix":w});function d(E,C){var F=E._data,S=E._size,b=E._datatype,P=C._data,B=C._datatype,k=S[0],H=S[1],M,I=n,O=i;b&&B&&b===B&&typeof b=="string"&&(M=b,I=t.find(n,[M,M]),O=t.find(i,[M,M]));for(var oe=[],ee=0;ee<k;ee++){for(var re=F[ee],fe=O(re[0],P[0]),he=1;he<H;he++)fe=I(fe,O(re[he],P[he]));oe[ee]=fe}return E.createDenseMatrix({data:oe,size:[k],datatype:M})}function g(E,C){var F=E._data,S=E._size,b=E._datatype,P=C._data,B=C._size,k=C._datatype,H=S[0],M=S[1],I=B[1],O,oe=n,ee=i;b&&k&&b===k&&typeof b=="string"&&(O=b,oe=t.find(n,[O,O]),ee=t.find(i,[O,O]));for(var re=[],fe=0;fe<H;fe++){var he=F[fe];re[fe]=[];for(var Me=0;Me<I;Me++){for(var ue=ee(he[0],P[0][Me]),Qe=1;Qe<M;Qe++)ue=oe(ue,ee(he[Qe],P[Qe][Me]));re[fe][Me]=ue}}return E.createDenseMatrix({data:re,size:[H,I],datatype:O})}function m(E,C){var F=E._data,S=E._size,b=E._datatype,P=C._values,B=C._index,k=C._ptr,H=C._size,M=C._datatype;if(!P)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var I=S[0],O=H[1],oe,ee=n,re=i,fe=o,he=0;b&&M&&b===M&&typeof b=="string"&&(oe=b,ee=t.find(n,[oe,oe]),re=t.find(i,[oe,oe]),fe=t.find(o,[oe,oe]),he=t.convert(0,oe));for(var Me=[],ue=[],Qe=[],ve=C.createSparseMatrix({values:Me,index:ue,ptr:Qe,size:[I,O],datatype:oe}),qe=0;qe<O;qe++){Qe[qe]=ue.length;var Re=k[qe],st=k[qe+1];if(st>Re)for(var Pe=0,Ae=0;Ae<I;Ae++){for(var et=Ae+1,ke=void 0,Ne=Re;Ne<st;Ne++){var Ie=B[Ne];Pe!==et?(ke=re(F[Ae][Ie],P[Ne]),Pe=et):ke=ee(ke,re(F[Ae][Ie],P[Ne]))}Pe===et&&!fe(ke,he)&&(ue.push(Ae),Me.push(ke))}}return Qe[O]=ue.length,ve}function y(E,C){var F=E._values,S=E._index,b=E._ptr,P=E._datatype;if(!F)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var B=C._data,k=C._datatype,H=E._size[0],M=C._size[0],I=[],O=[],oe=[],ee,re=n,fe=i,he=o,Me=0;P&&k&&P===k&&typeof P=="string"&&(ee=P,re=t.find(n,[ee,ee]),fe=t.find(i,[ee,ee]),he=t.find(o,[ee,ee]),Me=t.convert(0,ee));var ue=[],Qe=[];oe[0]=0;for(var ve=0;ve<M;ve++){var qe=B[ve];if(!he(qe,Me))for(var Re=b[ve],st=b[ve+1],Pe=Re;Pe<st;Pe++){var Ae=S[Pe];Qe[Ae]?ue[Ae]=re(ue[Ae],fe(qe,F[Pe])):(Qe[Ae]=!0,O.push(Ae),ue[Ae]=fe(qe,F[Pe]))}}for(var et=O.length,ke=0;ke<et;ke++){var Ne=O[ke];I[ke]=ue[Ne]}return oe[1]=O.length,E.createSparseMatrix({values:I,index:O,ptr:oe,size:[H,1],datatype:ee})}function v(E,C){var F=E._values,S=E._index,b=E._ptr,P=E._datatype;if(!F)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var B=C._data,k=C._datatype,H=E._size[0],M=C._size[0],I=C._size[1],O,oe=n,ee=i,re=o,fe=0;P&&k&&P===k&&typeof P=="string"&&(O=P,oe=t.find(n,[O,O]),ee=t.find(i,[O,O]),re=t.find(o,[O,O]),fe=t.convert(0,O));for(var he=[],Me=[],ue=[],Qe=E.createSparseMatrix({values:he,index:Me,ptr:ue,size:[H,I],datatype:O}),ve=[],qe=[],Re=0;Re<I;Re++){ue[Re]=Me.length;for(var st=Re+1,Pe=0;Pe<M;Pe++){var Ae=B[Pe][Re];if(!re(Ae,fe))for(var et=b[Pe],ke=b[Pe+1],Ne=et;Ne<ke;Ne++){var Ie=S[Ne];qe[Ie]!==st?(qe[Ie]=st,Me.push(Ie),ve[Ie]=ee(Ae,F[Ne])):ve[Ie]=oe(ve[Ie],ee(Ae,F[Ne]))}}for(var tt=ue[Re],xt=Me.length,wt=tt;wt<xt;wt++){var Dt=Me[wt];he[wt]=ve[Dt]}}return ue[I]=Me.length,Qe}function w(E,C){var F=E._values,S=E._index,b=E._ptr,P=E._datatype,B=C._values,k=C._index,H=C._ptr,M=C._datatype,I=E._size[0],O=C._size[1],oe=F&&B,ee,re=n,fe=i;P&&M&&P===M&&typeof P=="string"&&(ee=P,re=t.find(n,[ee,ee]),fe=t.find(i,[ee,ee]));for(var he=oe?[]:void 0,Me=[],ue=[],Qe=E.createSparseMatrix({values:he,index:Me,ptr:ue,size:[I,O],datatype:ee}),ve=oe?[]:void 0,qe=[],Re,st,Pe,Ae,et,ke,Ne,Ie,tt=0;tt<O;tt++){ue[tt]=Me.length;var xt=tt+1;for(et=H[tt],ke=H[tt+1],Ae=et;Ae<ke;Ae++)if(Ie=k[Ae],oe)for(st=b[Ie],Pe=b[Ie+1],Re=st;Re<Pe;Re++)Ne=S[Re],qe[Ne]!==xt?(qe[Ne]=xt,Me.push(Ne),ve[Ne]=fe(B[Ae],F[Re])):ve[Ne]=re(ve[Ne],fe(B[Ae],F[Re]));else for(st=b[Ie],Pe=b[Ie+1],Re=st;Re<Pe;Re++)Ne=S[Re],qe[Ne]!==xt&&(qe[Ne]=xt,Me.push(Ne));if(oe)for(var wt=ue[tt],Dt=Me.length,Et=wt;Et<Dt;Et++){var Ar=Me[Et];he[Et]=ve[Ar]}}return ue[O]=Me.length,Qe}return t(Jl,i,{"Array, Array":t.referTo("Matrix, Matrix",E=>(C,F)=>{h($t(C),$t(F));var S=E(r(C),r(F));return at(S)?S.valueOf():S}),"Matrix, Matrix":function(C,F){var S=C.size(),b=F.size();return h(S,b),S.length===1?b.length===1?s(C,F,S[0]):a(C,F):b.length===1?p(C,F):D(C,F)},"Matrix, Array":t.referTo("Matrix,Matrix",E=>(C,F)=>E(C,r(F))),"Array, Matrix":t.referToSelf(E=>(C,F)=>E(r(C,F.storage()),F)),"SparseMatrix, any":function(C,F){return l(C,F,i,!1)},"DenseMatrix, any":function(C,F){return f(C,F,i,!1)},"any, SparseMatrix":function(C,F){return l(F,C,i,!0)},"any, DenseMatrix":function(C,F){return f(F,C,i,!0)},"Array, any":function(C,F){return f(r(C),F,i,!1).valueOf()},"any, Array":function(C,F){return f(r(F),C,i,!0).valueOf()},"any, any":i,"any, any, ...any":t.referToSelf(E=>(C,F,S)=>{for(var b=E(C,F),P=0;P<S.length;P++)b=E(b,S[P]);return b})})}),uy="sqrt",ay=["config","typed","Complex"],sy=ie(uy,ay,e=>{var{config:t,typed:r,Complex:n}=e;return r("sqrt",{number:i,Complex:function(u){return u.sqrt()},BigNumber:function(u){return!u.isNegative()||t.predictable?u.sqrt():i(u.toNumber())},Unit:function(u){return u.pow(.5)}});function i(o){return isNaN(o)?NaN:o>=0||t.predictable?Math.sqrt(o):new n(o,0).sqrt()}}),ec="subtract",ly=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],cy=ie(ec,ly,e=>{var{typed:t,matrix:r,equalScalar:n,subtractScalar:i,unaryMinus:o,DenseMatrix:u,concat:l}=e,f=Ih({typed:t}),h=vu({typed:t}),s=kh({typed:t,equalScalar:n}),a=Lh({typed:t,DenseMatrix:u}),c=gu({typed:t,DenseMatrix:u}),p=io({typed:t,matrix:r,concat:l});return t(ec,{"any, any":i},p({elop:i,SS:s,DS:f,SD:h,Ss:c,sS:a}))}),fy="matAlgo07xSSf",hy=["typed","DenseMatrix"],zh=ie(fy,hy,e=>{var{typed:t,DenseMatrix:r}=e;return function(o,u,l){var f=o._size,h=o._datatype,s=u._size,a=u._datatype;if(f.length!==s.length)throw new Ue(f.length,s.length);if(f[0]!==s[0]||f[1]!==s[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+s+")");var c=f[0],p=f[1],D,d=0,g=l;typeof h=="string"&&h===a&&(D=h,d=t.convert(0,D),g=t.find(l,[D,D]));var m,y,v=[];for(m=0;m<c;m++)v[m]=[];var w=[],E=[],C=[],F=[];for(y=0;y<p;y++){var S=y+1;for(n(o,y,C,w,S),n(u,y,F,E,S),m=0;m<c;m++){var b=C[m]===S?w[m]:d,P=F[m]===S?E[m]:d;v[m][y]=g(b,P)}}return new r({data:v,size:[c,p],datatype:D})};function n(i,o,u,l,f){for(var h=i._values,s=i._index,a=i._ptr,c=a[o],p=a[o+1];c<p;c++){var D=s[c];u[D]=f,l[D]=h[c]}}}),tc="conj",dy=["typed"],py=ie(tc,dy,e=>{var{typed:t}=e;return t(tc,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.conjugate(),"Array | Matrix":t.referToSelf(r=>n=>Cr(n,r))})}),rc="concat",my=["typed","matrix","isInteger"],gy=ie(rc,my,e=>{var{typed:t,matrix:r,isInteger:n}=e;return t(rc,{"...Array | Matrix | number | BigNumber":function(o){var u,l=o.length,f=-1,h,s=!1,a=[];for(u=0;u<l;u++){var c=o[u];if(at(c)&&(s=!0),ut(c)||bt(c)){if(u!==l-1)throw new Error("Dimension must be specified as last argument");if(h=f,f=c.valueOf(),!n(f))throw new TypeError("Integer number expected for dimension");if(f<0||u>0&&f>h)throw new Qr(f,h+1)}else{var p=mt(c).valueOf(),D=$t(p);if(a[u]=p,h=f,f=D.length-1,u>0&&f!==h)throw new Ue(h+1,f+1)}}if(a.length===0)throw new SyntaxError("At least one matrix expected");for(var d=a.shift();a.length;)d=sh(d,a.shift(),f);return s?r(d):d},"...string":function(o){return o.join("")}})});function vy(e,t,r,n,i){if(Qn.isTypedFunction(e)){var o=[t,r,n],u=Qn.resolve(e,o);if(u)return a(u.implementation,o);var l=[t,r],f=Qn.resolve(e,l);if(f)return a(f.implementation,l);var h=[t],s=Qn.resolve(e,h);return s?a(s.implementation,h):a(e,o)}else return e(t,r,n);function a(c,p){try{return c.apply(c,p)}catch(g){var D;if(g instanceof TypeError&&((D=g.data)===null||D===void 0?void 0:D.category)==="wrongType"){var d=[];throw d.push("value: ".concat(wr(t))),p.length>=2&&d.push("index: ".concat(wr(r))),p.length>=3&&d.push("array: ".concat(wr(n))),new TypeError("Function ".concat(i," cannot apply callback arguments ")+"".concat(e.name,"(").concat(d.join(", "),") at index ").concat(JSON.stringify(r)))}else throw new TypeError("Function ".concat(i," cannot apply callback arguments ")+"to function ".concat(e.name,": ").concat(g.message))}}}var nc="identity",Dy=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],yy=ie(nc,Dy,e=>{var{typed:t,config:r,matrix:n,BigNumber:i,DenseMatrix:o,SparseMatrix:u}=e;return t(nc,{"":function(){return r.matrix==="Matrix"?n([]):[]},string:function(s){return n(s)},"number | BigNumber":function(s){return f(s,s,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(s,a){return f(s,s,a)},"number | BigNumber, number | BigNumber":function(s,a){return f(s,a,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(s,a,c){return f(s,a,c)},Array:function(s){return l(s)},"Array, string":function(s,a){return l(s,a)},Matrix:function(s){return l(s.valueOf(),s.storage())},"Matrix, string":function(s,a){return l(s.valueOf(),a)}});function l(h,s){switch(h.length){case 0:return s?n(s):[];case 1:return f(h[0],h[0],s);case 2:return f(h[0],h[1],s);default:throw new Error("Vector containing two values expected")}}function f(h,s,a){var c=bt(h)||bt(s)?i:null;if(bt(h)&&(h=h.toNumber()),bt(s)&&(s=s.toNumber()),!vt(h)||h<1)throw new Error("Parameters in function identity must be positive integers");if(!vt(s)||s<1)throw new Error("Parameters in function identity must be positive integers");var p=c?new i(1):1,D=c?new c(0):0,d=[h,s];if(a){if(a==="sparse")return u.diagonal(d,p,0,D);if(a==="dense")return o.diagonal(d,p,0,D);throw new TypeError('Unknown matrix type "'.concat(a,'"'))}for(var g=Ea([],d,D),m=h<s?h:s,y=0;y<m;y++)g[y][y]=p;return g}}),ic="map",wy=["typed"],Ey=ie(ic,wy,e=>{var{typed:t}=e;return t(ic,{"Array, function":Cy,"Matrix, function":function(n,i){return n.map(i)}})});function Cy(e,t){var r=function n(i,o){return Array.isArray(i)?i.map(function(u,l){return n(u,o.concat(l))}):vy(t,i,o,e,"map")};return r(e,[])}function Ay(){throw new Error('No "bignumber" implementation available')}function Sy(){throw new Error('No "fraction" implementation available')}function Fy(){throw new Error('No "matrix" implementation available')}var oc="size",by=["typed","config","?matrix"],xy=ie(oc,by,e=>{var{typed:t,config:r,matrix:n}=e;return t(oc,{Matrix:function(o){return o.create(o.size())},Array:$t,string:function(o){return r.matrix==="Array"?[o.length]:n([o.length])},"number | Complex | BigNumber | Unit | boolean | null":function(o){return r.matrix==="Array"?[]:n?n([]):Fy()}})});function Gr(e,t,r){var n;return String(e).indexOf("Unexpected type")!==-1?(n=arguments.length>2?" (type: "+wr(r)+", value: "+JSON.stringify(r)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+n)):String(e).indexOf("complex numbers")!==-1?(n=arguments.length>2?" (type: "+wr(r)+", value: "+JSON.stringify(r)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+n)):e}var Ty="numeric",_y=["number","?bignumber","?fraction"],My=ie(Ty,_y,e=>{var{number:t,bignumber:r,fraction:n}=e,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},o={number:u=>t(u),BigNumber:r?u=>r(u):Ay,Fraction:n?u=>n(u):Sy};return function(l){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",h=arguments.length>2?arguments[2]:void 0;if(h!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var s=wr(l);if(!(s in i))throw new TypeError("Cannot convert "+l+' of type "'+s+'"; valid input types are '+Object.keys(i).join(", "));if(!(f in o))throw new TypeError("Cannot convert "+l+' to type "'+f+'"; valid output types are '+Object.keys(o).join(", "));return f===s?l:o[f](l)}}),uc="divideScalar",Ny=["typed","numeric"],By=ie(uc,Ny,e=>{var{typed:t,numeric:r}=e;return t(uc,{"number, number":function(i,o){return i/o},"Complex, Complex":function(i,o){return i.div(o)},"BigNumber, BigNumber":function(i,o){return i.div(o)},"Fraction, Fraction":function(i,o){return i.div(o)},"Unit, number | Complex | Fraction | BigNumber | Unit":(n,i)=>n.divide(i),"number | Fraction | Complex | BigNumber, Unit":(n,i)=>i.divideInto(n)})}),Ko="compare",Oy=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],Ry=ie(Ko,Oy,e=>{var{typed:t,config:r,equalScalar:n,matrix:i,BigNumber:o,Fraction:u,DenseMatrix:l,concat:f}=e,h=vu({typed:t}),s=kh({typed:t,equalScalar:n}),a=gu({typed:t,DenseMatrix:l}),c=io({typed:t,matrix:i,concat:f}),p=mu({typed:t});return t(Ko,Py({typed:t,config:r}),{"boolean, boolean":function(d,g){return d===g?0:d>g?1:-1},"BigNumber, BigNumber":function(d,g){return pu(d,g,r.epsilon)?new o(0):new o(d.cmp(g))},"Fraction, Fraction":function(d,g){return new u(d.compare(g))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},p,c({SS:s,DS:h,Ss:a}))}),Py=ie(Ko,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Ko,{"number, number":function(i,o){return Pn(i,o,r.epsilon)?0:i>o?1:-1}})}),Jo="smaller",ky=["typed","config","matrix","DenseMatrix","concat"],Iy=ie(Jo,ky,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e,u=vu({typed:t}),l=zh({typed:t,DenseMatrix:i}),f=gu({typed:t,DenseMatrix:i}),h=io({typed:t,matrix:n,concat:o}),s=mu({typed:t});return t(Jo,Ly({typed:t,config:r}),{"boolean, boolean":(a,c)=>a<c,"BigNumber, BigNumber":function(c,p){return c.lt(p)&&!pu(c,p,r.epsilon)},"Fraction, Fraction":(a,c)=>a.compare(c)===-1,"Complex, Complex":function(c,p){throw new TypeError("No ordering relation is defined for complex numbers")}},s,h({SS:l,DS:u,Ss:f}))}),Ly=ie(Jo,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Jo,{"number, number":function(i,o){return i<o&&!Pn(i,o,r.epsilon)}})}),eu="larger",zy=["typed","config","matrix","DenseMatrix","concat"],$y=ie(eu,zy,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e,u=vu({typed:t}),l=zh({typed:t,DenseMatrix:i}),f=gu({typed:t,DenseMatrix:i}),h=io({typed:t,matrix:n,concat:o}),s=mu({typed:t});return t(eu,Uy({typed:t,config:r}),{"boolean, boolean":(a,c)=>a>c,"BigNumber, BigNumber":function(c,p){return c.gt(p)&&!pu(c,p,r.epsilon)},"Fraction, Fraction":(a,c)=>a.compare(c)===1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},s,h({SS:l,DS:u,Ss:f}))}),Uy=ie(eu,["typed","config"],e=>{var{typed:t,config:r}=e;return t(eu,{"number, number":function(i,o){return i>o&&!Pn(i,o,r.epsilon)}})}),ac="partitionSelect",qy=["typed","isNumeric","isNaN","compare"],jy=ie(ac,qy,e=>{var{typed:t,isNumeric:r,isNaN:n,compare:i}=e,o=i,u=(h,s)=>-i(h,s);return t(ac,{"Array | Matrix, number":function(s,a){return l(s,a,o)},"Array | Matrix, number, string":function(s,a,c){if(c==="asc")return l(s,a,o);if(c==="desc")return l(s,a,u);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":l});function l(h,s,a){if(!vt(s)||s<0)throw new Error("k must be a non-negative integer");if(at(h)){var c=h.size();if(c.length>1)throw new Error("Only one dimensional matrices supported");return f(h.valueOf(),s,a)}if(Array.isArray(h))return f(h,s,a)}function f(h,s,a){if(s>=h.length)throw new Error("k out of bounds");for(var c=0;c<h.length;c++)if(r(h[c])&&n(h[c]))return h[c];for(var p=0,D=h.length-1;p<D;){for(var d=p,g=D,m=h[Math.floor(Math.random()*(D-p+1))+p];d<g;)if(a(h[d],m)>=0){var y=h[g];h[g]=h[d],h[d]=y,--g}else++d;a(h[d],m)>0&&--d,s<=d?D=d:p=d+1}return h[s]}}),sc="max",Vy=["typed","config","numeric","larger"],Hy=ie(sc,Vy,e=>{var{typed:t,config:r,numeric:n,larger:i}=e;return t(sc,{"Array | Matrix":u,"Array | Matrix, number | BigNumber":function(f,h){return rs(f,h.valueOf(),o)},"...":function(f){if(du(f))throw new TypeError("Scalar values expected in function max");return u(f)}});function o(l,f){try{return i(l,f)?l:f}catch(h){throw Gr(h,"max",f)}}function u(l){var f;if(gi(l,function(h){try{isNaN(h)&&typeof h=="number"?f=NaN:(f===void 0||i(h,f))&&(f=h)}catch(s){throw Gr(s,"max",h)}}),f===void 0)throw new Error("Cannot calculate max of an empty array");return typeof f=="string"&&(f=n(f,r.number)),f}}),lc="min",Wy=["typed","config","numeric","smaller"],Gy=ie(lc,Wy,e=>{var{typed:t,config:r,numeric:n,smaller:i}=e;return t(lc,{"Array | Matrix":u,"Array | Matrix, number | BigNumber":function(f,h){return rs(f,h.valueOf(),o)},"...":function(f){if(du(f))throw new TypeError("Scalar values expected in function min");return u(f)}});function o(l,f){try{return i(l,f)?l:f}catch(h){throw Gr(h,"min",f)}}function u(l){var f;if(gi(l,function(h){try{isNaN(h)&&typeof h=="number"?f=NaN:(f===void 0||i(h,f))&&(f=h)}catch(s){throw Gr(s,"min",h)}}),f===void 0)throw new Error("Cannot calculate min of an empty array");return typeof f=="string"&&(f=n(f,r.number)),f}}),cc="add",Qy=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],Zy=ie(cc,Qy,e=>{var{typed:t,matrix:r,addScalar:n,equalScalar:i,DenseMatrix:o,SparseMatrix:u,concat:l}=e,f=Ih({typed:t}),h=KD({typed:t,equalScalar:i}),s=Lh({typed:t,DenseMatrix:o}),a=io({typed:t,matrix:r,concat:l});return t(cc,{"any, any":n,"any, any, ...any":t.referToSelf(c=>(p,D,d)=>{for(var g=c(p,D),m=0;m<d.length;m++)g=c(g,d[m]);return g})},a({elop:n,DS:f,SS:h,Ss:s}))}),fc="dot",Yy=["typed","addScalar","multiplyScalar","conj","size"],Xy=ie(fc,Yy,e=>{var{typed:t,addScalar:r,multiplyScalar:n,conj:i,size:o}=e;return t(fc,{"Array | DenseMatrix, Array | DenseMatrix":l,"SparseMatrix, SparseMatrix":f});function u(s,a){var c=h(s),p=h(a),D,d;if(c.length===1)D=c[0];else if(c.length===2&&c[1]===1)D=c[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+c.join(", ")+")");if(p.length===1)d=p[0];else if(p.length===2&&p[1]===1)d=p[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+p.join(", ")+")");if(D!==d)throw new RangeError("Vectors must have equal length ("+D+" != "+d+")");if(D===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return D}function l(s,a){var c=u(s,a),p=at(s)?s._data:s,D=at(s)?s._datatype:void 0,d=at(a)?a._data:a,g=at(a)?a._datatype:void 0,m=h(s).length===2,y=h(a).length===2,v=r,w=n;if(D&&g&&D===g&&typeof D=="string"){var E=D;v=t.find(r,[E,E]),w=t.find(n,[E,E])}if(!m&&!y){for(var C=w(i(p[0]),d[0]),F=1;F<c;F++)C=v(C,w(i(p[F]),d[F]));return C}if(!m&&y){for(var S=w(i(p[0]),d[0][0]),b=1;b<c;b++)S=v(S,w(i(p[b]),d[b][0]));return S}if(m&&!y){for(var P=w(i(p[0][0]),d[0]),B=1;B<c;B++)P=v(P,w(i(p[B][0]),d[B]));return P}if(m&&y){for(var k=w(i(p[0][0]),d[0][0]),H=1;H<c;H++)k=v(k,w(i(p[H][0]),d[H][0]));return k}}function f(s,a){u(s,a);for(var c=s._index,p=s._values,D=a._index,d=a._values,g=0,m=r,y=n,v=0,w=0;v<c.length&&w<D.length;){var E=c[v],C=D[w];if(E<C){v++;continue}if(E>C){w++;continue}E===C&&(g=m(g,y(p[v],d[w])),v++,w++)}return g}function h(s){return at(s)?s.size():o(s)}}),hc="det",Ky=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],Jy=ie(hc,Ky,e=>{var{typed:t,matrix:r,subtractScalar:n,multiply:i,divideScalar:o,isZero:u,unaryMinus:l}=e;return t(hc,{any:function(s){return mt(s)},"Array | Matrix":function(s){var a;switch(at(s)?a=s.size():Array.isArray(s)?(s=r(s),a=s.size()):a=[],a.length){case 0:return mt(s);case 1:if(a[0]===1)return mt(s.valueOf()[0]);if(a[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+yt(a)+")");case 2:{var c=a[0],p=a[1];if(c===p)return f(s.clone().valueOf(),c);if(p===0)return 1;throw new RangeError("Matrix must be square (size: "+yt(a)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+yt(a)+")")}}});function f(h,s,a){if(s===1)return mt(h[0][0]);if(s===2)return n(i(h[0][0],h[1][1]),i(h[1][0],h[0][1]));for(var c=!1,p=new Array(s).fill(0).map((F,S)=>S),D=0;D<s;D++){var d=p[D];if(u(h[d][D])){var g=void 0;for(g=D+1;g<s;g++)if(!u(h[p[g]][D])){d=p[g],p[g]=p[D],p[D]=d,c=!c;break}if(g===s)return h[d][D]}for(var m=h[d][D],y=D===0?1:h[p[D-1]][D-1],v=D+1;v<s;v++)for(var w=p[v],E=D+1;E<s;E++)h[w][E]=o(n(i(h[w][E],m),i(h[w][D],h[d][E])),y)}var C=h[p[s-1]][s-1];return c?l(C):C}}),dc="inv",ew=["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],tw=ie(dc,ew,e=>{var{typed:t,matrix:r,divideScalar:n,addScalar:i,multiply:o,unaryMinus:u,det:l,identity:f,abs:h}=e;return t(dc,{"Array | Matrix":function(c){var p=at(c)?c.size():$t(c);switch(p.length){case 1:if(p[0]===1)return at(c)?r([n(1,c.valueOf()[0])]):[n(1,c[0])];throw new RangeError("Matrix must be square (size: "+yt(p)+")");case 2:{var D=p[0],d=p[1];if(D===d)return at(c)?r(s(c.valueOf(),D,d),c.storage()):s(c,D,d);throw new RangeError("Matrix must be square (size: "+yt(p)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+yt(p)+")")}},any:function(c){return n(1,c)}});function s(a,c,p){var D,d,g,m,y;if(c===1){if(m=a[0][0],m===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,m)]]}else if(c===2){var v=l(a);if(v===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(a[1][1],v),n(u(a[0][1]),v)],[n(u(a[1][0]),v),n(a[0][0],v)]]}else{var w=a.concat();for(D=0;D<c;D++)w[D]=w[D].concat();for(var E=f(c).valueOf(),C=0;C<p;C++){var F=h(w[C][C]),S=C;for(D=C+1;D<c;)h(w[D][C])>F&&(F=h(w[D][C]),S=D),D++;if(F===0)throw Error("Cannot calculate inverse, determinant is zero");D=S,D!==C&&(y=w[C],w[C]=w[D],w[D]=y,y=E[C],E[C]=E[D],E[D]=y);var b=w[C],P=E[C];for(D=0;D<c;D++){var B=w[D],k=E[D];if(D!==C){if(B[C]!==0){for(g=n(u(B[C]),b[C]),d=C;d<p;d++)B[d]=i(B[d],o(g,b[d]));for(d=0;d<p;d++)k[d]=i(k[d],o(g,P[d]))}}else{for(g=b[C],d=C;d<p;d++)B[d]=n(B[d],g);for(d=0;d<p;d++)k[d]=n(k[d],g)}}}return E}}}),rw="divide",nw=["typed","matrix","multiply","equalScalar","divideScalar","inv"],iw=ie(rw,nw,e=>{var{typed:t,matrix:r,multiply:n,equalScalar:i,divideScalar:o,inv:u}=e,l=Ph({typed:t,equalScalar:i}),f=is({typed:t});return t("divide",Xf({"Array | Matrix, Array | Matrix":function(s,a){return n(s,u(a))},"DenseMatrix, any":function(s,a){return f(s,a,o,!1)},"SparseMatrix, any":function(s,a){return l(s,a,o,!1)},"Array, any":function(s,a){return f(r(s),a,o,!1).valueOf()},"any, Array | Matrix":function(s,a){return n(s,u(a))}},o.signatures))}),pc="sum",ow=["typed","config","add","numeric"],uw=ie(pc,ow,e=>{var{typed:t,config:r,add:n,numeric:i}=e;return t(pc,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":u,"...":function(f){if(du(f))throw new TypeError("Scalar values expected in function sum");return o(f)}});function o(l){var f;return gi(l,function(h){try{f=f===void 0?h:n(f,h)}catch(s){throw Gr(s,"sum",h)}}),f===void 0&&(f=i(0,r.number)),typeof f=="string"&&(f=i(f,r.number)),f}function u(l,f){try{var h=rs(l,f,n);return h}catch(s){throw Gr(s,"sum")}}}),mc="median",aw=["typed","add","divide","compare","partitionSelect"],sw=ie(mc,aw,e=>{var{typed:t,add:r,divide:n,compare:i,partitionSelect:o}=e;function u(h){try{h=uh(h.valueOf());var s=h.length;if(s===0)throw new Error("Cannot calculate median of an empty array");if(s%2===0){for(var a=s/2-1,c=o(h,a+1),p=h[a],D=0;D<a;++D)i(h[D],p)>0&&(p=h[D]);return f(p,c)}else{var d=o(h,(s-1)/2);return l(d)}}catch(g){throw Gr(g,"median")}}var l=t({"number | BigNumber | Complex | Unit":function(s){return s}}),f=t({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(s,a){return n(r(s,a),2)}});return t(mc,{"Array | Matrix":u,"Array | Matrix, number | BigNumber":function(s,a){throw new Error("median(A, dim) is not yet supported")},"...":function(s){if(du(s))throw new TypeError("Scalar values expected in function median");return u(s)}})}),Zu="unbiased",gc="variance",lw=["typed","add","subtract","multiply","divide","apply","isNaN"],cw=ie(gc,lw,e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:o,apply:u,isNaN:l}=e;return t(gc,{"Array | Matrix":function(a){return f(a,Zu)},"Array | Matrix, string":f,"Array | Matrix, number | BigNumber":function(a,c){return h(a,c,Zu)},"Array | Matrix, number | BigNumber, string":h,"...":function(a){return f(a,Zu)}});function f(s,a){var c,p=0;if(s.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(gi(s,function(g){try{c=c===void 0?g:r(c,g),p++}catch(m){throw Gr(m,"variance",g)}}),p===0)throw new Error("Cannot calculate variance of an empty array");var D=o(c,p);if(c=void 0,gi(s,function(g){var m=n(g,D);c=c===void 0?i(m,m):r(c,i(m,m))}),l(c))return c;switch(a){case"uncorrected":return o(c,p);case"biased":return o(c,p+1);case"unbiased":{var d=bt(c)?c.mul(0):0;return p===1?d:o(c,p-1)}default:throw new Error('Unknown normalization "'+a+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function h(s,a,c){try{if(s.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return u(s,a,p=>f(p,c))}catch(p){throw Gr(p,"variance")}}}),vc="std",fw=["typed","map","sqrt","variance"],hw=ie(vc,fw,e=>{var{typed:t,map:r,sqrt:n,variance:i}=e;return t(vc,{"Array | Matrix":o,"Array | Matrix, string":o,"Array | Matrix, number | BigNumber":o,"Array | Matrix, number | BigNumber, string":o,"...":function(l){return o(l)}});function o(u,l){if(u.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var f=i.apply(null,arguments);return hi(f)?r(f,n):n(f)}catch(h){throw h instanceof TypeError&&h.message.indexOf(" variance")!==-1?new TypeError(h.message.replace(" variance"," std")):h}}}),Du=M1({config:hr}),$h=R1({}),os=L1({}),us=U1({}),hn=V1({Matrix:us}),Se=Ov({BigNumber:Du,Complex:$h,DenseMatrix:hn,Fraction:os}),dw=CD({typed:Se}),yu=xD({typed:Se}),pw=dD({BigNumber:Du,typed:Se}),mw=py({typed:Se}),wi=rD({config:hr,typed:Se}),Uh=G1({typed:Se}),gw=X1({typed:Se}),vw=Ey({typed:Se}),qh=ny({typed:Se}),Dw=cD({typed:Se}),as=oD({Matrix:us,equalScalar:wi,typed:Se}),jh=_D({typed:Se}),yw=SD({isInteger:Uh,typed:Se}),Vh=J1({typed:Se}),ww=sy({Complex:$h,config:hr,typed:Se}),ss=wD({typed:Se}),Ew=gD({Fraction:os,typed:Se}),Cw=Z1({typed:Se}),dr=DD({DenseMatrix:hn,Matrix:us,SparseMatrix:as,typed:Se}),wu=My({bignumber:pw,fraction:Ew,number:Dw}),Aw=xy({matrix:dr,config:hr,typed:Se}),oo=gy({isInteger:Uh,matrix:dr,typed:Se}),ls=By({numeric:wu,typed:Se}),Sw=yy({BigNumber:Du,DenseMatrix:hn,SparseMatrix:as,config:hr,matrix:dr,typed:Se}),Fw=Iy({DenseMatrix:hn,concat:oo,config:hr,matrix:dr,typed:Se}),bw=cy({DenseMatrix:hn,concat:oo,equalScalar:wi,matrix:dr,subtractScalar:jh,typed:Se,unaryMinus:ss}),cs=Zy({DenseMatrix:hn,SparseMatrix:as,addScalar:yu,concat:oo,equalScalar:wi,matrix:dr,typed:Se}),Hh=Ry({BigNumber:Du,DenseMatrix:hn,Fraction:os,concat:oo,config:hr,equalScalar:wi,matrix:dr,typed:Se}),xw=Xy({addScalar:yu,conj:mw,multiplyScalar:qh,size:Aw,typed:Se}),Tw=$y({DenseMatrix:hn,concat:oo,config:hr,matrix:dr,typed:Se}),_w=Gy({config:hr,numeric:wu,smaller:Fw,typed:Se}),Eu=oy({addScalar:yu,dot:xw,equalScalar:wi,matrix:dr,multiplyScalar:qh,typed:Se}),Mw=jy({compare:Hh,isNaN:Vh,isNumeric:Cw,typed:Se}),Nw=uw({add:cs,config:hr,numeric:wu,typed:Se}),Bw=Jy({divideScalar:ls,isZero:gw,matrix:dr,multiply:Eu,subtractScalar:jh,typed:Se,unaryMinus:ss}),Ow=Hy({config:hr,larger:Tw,numeric:wu,typed:Se}),Rw=tw({abs:dw,addScalar:yu,det:Bw,divideScalar:ls,identity:Sw,matrix:dr,multiply:Eu,typed:Se,unaryMinus:ss}),Wh=iw({divideScalar:ls,equalScalar:wi,inv:Rw,matrix:dr,multiply:Eu,typed:Se}),Gh=cw({add:cs,apply:yw,divide:Wh,isNaN:Vh,multiply:Eu,subtract:bw,typed:Se}),Pw=sw({add:cs,compare:Hh,divide:Wh,partitionSelect:Mw,typed:Se}),kw=hw({map:vw,sqrt:ww,typed:Se,variance:Gh}),Tr=(e=>(e[e.SUM=0]="SUM",e[e.MIN=1]="MIN",e[e.MAX=2]="MAX",e[e.AVG=3]="AVG",e[e.COUNT=4]="COUNT",e[e.UNIQUE=5]="UNIQUE",e[e.STD=6]="STD",e[e.VARIANCE=7]="VARIANCE",e[e.MEDIAN=8]="MEDIAN",e))(Tr||{}),_r=(e=>(e.SUM="Total",e.MIN="Minimum",e.MAX="Maximum",e.AVG="Average",e.COUNT="Count",e.UNIQUE="Unique",e.STD="Standard deviation",e.VARIANCE="Variance",e.MEDIAN="Median",e))(_r||{});const Iw=e=>{const t=Pr(r=>Jh(r,e));return J.debug("showColumnFilters",t),t},Lw=e=>{const t=Pr(r=>ed(r,e));return J.debug("lovs",t),t},zw=e=>{const t=Pr(r=>td(r,e));return J.debug("tableColumnCode",t),t},$w=Z.lazy(()=>vi(()=>import("./TableToolbar-1.0.13-f85116b0.js"),["./TableToolbar-1.0.13-f85116b0.js","./main-1.0.13.js","./main-1.0.13-4cbe632d.js","./iconBase-1.0.13-98e06aa9.js","./main-1.0.13-dd4484b4.css","./index-1.0.13-2afde5c8.js","./DialogContent-1.0.13-5873ffb9.js","./Menu-1.0.13-2a06ef00.js","./index.esm-1.0.13-8cdddba7.js","./FileSaver.min-1.0.13-c93578bb.js","./ActionsDml-1.0.13-147ce8d4.js","./settings-1.0.13-650559d5.js","./FormControlLabel-1.0.13-143a10df.js","./TextField-1.0.13-7258d491.js","./Close-1.0.13-b137ce2f.js","./useScreenSize-1.0.13-fa31f819.js","./AdminTheme-1.0.13-a1e60de2.js","./Tabs-1.0.13-f71c8d5c.js","./settings-1.0.13-e7dd0b92.css","./RadioGroup-1.0.13-1d87a31c.js","./Radio-1.0.13-befab7cd.js","./index.esm-1.0.13-ae160362.js","./MenuItem-1.0.13-e7719456.js","./Checkbox-1.0.13-3ec10fcc.js","./AlertTitle-1.0.13-80063b16.js","./useSlot-1.0.13-62ad37b6.js","./InputAdornment-1.0.13-83724c3f.js","./ListItemIcon-1.0.13-2bfd9865.js","./DateTimePicker-1.0.13-12d520d7.js","./useMobilePicker-1.0.13-30bb98f7.js","./date-time-utils-1.0.13-2393af5c.js","./dateViewRenderers-1.0.13-3b668027.js","./TimePicker-1.0.13-101f1fcd.js","./DatePicker-1.0.13-5c3486db.js","./ScopeEnum-1.0.13-d05c4b00.js","./useStoreTable-1.0.13-383948b4.js","./index.esm-1.0.13-0afa0259.js","./index-1.0.13-81ade722.js"],import.meta.url)),Uw=Z.lazy(()=>vi(()=>import("./RowActions-1.0.13-0065a69e.js"),["./RowActions-1.0.13-0065a69e.js","./main-1.0.13.js","./main-1.0.13-4cbe632d.js","./iconBase-1.0.13-98e06aa9.js","./main-1.0.13-dd4484b4.css","./settings-1.0.13-650559d5.js","./FormControlLabel-1.0.13-143a10df.js","./TextField-1.0.13-7258d491.js","./Close-1.0.13-b137ce2f.js","./Menu-1.0.13-2a06ef00.js","./useScreenSize-1.0.13-fa31f819.js","./DialogContent-1.0.13-5873ffb9.js","./AdminTheme-1.0.13-a1e60de2.js","./Tabs-1.0.13-f71c8d5c.js","./settings-1.0.13-e7dd0b92.css","./ActionsDml-1.0.13-147ce8d4.js"],import.meta.url)),qw=({appId:e,display:t,refresh:r,showForm:n,metaData:i})=>{var Dn,yn,Hn,ae,x,G,ne,ze,nt,pe,Le,Pt,Yt,ot,wn,Ei;const o=_a(),u=Z.useRef(null),l=Z.useRef(null),f=Z.useRef(!0),[h,s]=Z.useState([]),[a,c]=Z.useState(""),[p,D]=Z.useState([]),d=Iw(e),[g,m]=Z.useState(!1),[y,v]=Z.useState(!1);J.debug(p,g);const w=Pr(N=>rd(N,e));J.debug("deleteColumnFilter",w),Z.useEffect(()=>{if(w!==void 0){const N=[];p.map(Q=>{Q.id!==w&&N.push(Q)}),D(N),o(nd({appId:e}))}},[w]);const[E,C]=Z.useState(void 0),[F,S]=Z.useState({global:a,column:p,columnFns:{}}),[b,P]=Z.useState({});J.debug(e,t,r,i,h,a,E,F,b),J.debug(p,g);const[B,k]=Z.useState("");J.debug(B);const H=Gd(e),M=H.table,I=H.columns,[O,oe]=Z.useState(M.design.density.default),ee=Od(),re=Rd(e),fe=Pd(e);zf(e),zw(e);const he=I.filter(N=>N.lookup!==void 0),Me=rg(e),[ue,Qe]=Z.useState({pageIndex:0,pageSize:M.pagination.defaultPageSize});J.debug(ue);const ve=()=>{setTimeout(()=>{m(!g)},500)},qe=Z.useMemo(()=>cp,[]),Re=((yn=(Dn=i==null?void 0:i.settings)==null?void 0:Dn.wp)==null?void 0:yn.date_format)??"",st=((ae=(Hn=i==null?void 0:i.settings)==null?void 0:Hn.wp)==null?void 0:ae.time_format)??"",Pe=i.primary_key.length>0,Ae=M.viewLink,et=!fs(i)&&((x=i==null?void 0:i.privs)==null?void 0:x.update)&&M.transactions.update,ke=!fs(i)&&((G=i==null?void 0:i.privs)==null?void 0:G.delete)&&M.transactions.delete,Ne=Ae||et||ke,Ie=M.bulkActions,tt=Z.useMemo(()=>{var Q;let N=!1;for(const $ in Ie)$==="pdf"||$==="excel"||id(e)&&$==="sql"||(!((Q=i==null?void 0:i.privs)!=null&&Q.delete)||!Pe)&&$==="delete"||(N=N||Ie[$]===!0);return N},[Ie]);J.debug(H,Pe,Ae,et,ke,Ne,Ie,tt);const xt=Z.useMemo(()=>H.state.relTab!==!0&&H.state.masterDetailConditions!==void 0&&Tc(i),[H.state.relTab,H.state.masterDetailConditions]),wt=Z.useMemo(()=>[],[I]);J.debug("inlineEditingColumns",wt);const Dt=Z.useMemo(()=>({}),[I]);J.debug("inlineSearchColumns",Dt);const Et=Pr(N=>od(N,e));J.debug("storeRows",Et);const Ar=Pr(N=>ud(N,e));J.debug("fullScreen",Ar);const dn=()=>{for(let N=0;N<I.length;N++){const Q=I[N].lookup;if(Q!==void 0&&(Q.loadOnStartup||I[N].inlineEditing)&&B!==I[N].columnName){const $=H.table.searchSettings.cascade===!0,me=gs(jr.getState(),e,I[N].columnName);if(!me||$===!0&&I[N].inlineSearchEnum!==mr.SEARCHBOX){const ge={};$===!0&&(ge.cols=V,ge.search=a,ge.search_columns=Y(),ge.search_column_fns=rt.getState().columnFilterFns,ge.search_column_lov=Object.keys(Dt).filter(De=>Dt[De].lookup!==void 0&&Dt[De].inlineSearchEnum===mr.SEARCHBOX).map(De=>Dt[De].columnName),ge.search_data_types=pn(),ge.search_custom=A(),ge.search_params=H.state.staticFilter,ge.shortcode_params=H.state.shortcodeArgs,ge.md=H.state.masterDetailConditions,ge.cascade=$),Mc(e,"table",I[N].columnName,Q.key,Q.value,{},ge,De=>{J.debug(De.data);const we={};for(let Fe=0;Fe<De.data.length;Fe++)if(!Q.value.includes(","))we[De.data[Fe].key]=De.data[Fe].value;else{const lt=Q.value.split(",");we[De.data[Fe].key]=lt.map(Ee=>De.data[Fe][Ee])}($!==!0||!me)&&o(md({appId:e,columnName:I[N].columnName,lookup:we}))},De=>{J.error(De)})}}}},pn=()=>{const N={};return Object.keys(rt.getState().columnFilterFns).map(Q=>{const $=hs(i,Q);$!==void 0&&(N[Q]=i.columns[$].data_type)}),N},A=()=>{var Q,$;const N=gd(H.table.defaultWhere);if(N.length>0){const me=new URLSearchParams(window.location.search),ge=(($=(Q=Au)==null?void 0:Q.appSiteInfo)==null?void 0:$.appVars)??{},De={};if(N.map(we=>{if(we.paramType==="httpGet"||we.paramType==="httpRequest"){const Fe=me.get(we.paramName);Fe!==null&&(De.get||(De.get={}),De.get[we.paramName]=Fe)}(we.paramType==="httpPost"||we.paramType==="httpRequest")&&Object.keys(ge).map(Fe=>{De.post||(De.post={}),De.post[Fe]=ge[Fe]})}),Object.keys(De).length>0)return De}},T=Lw(e);Z.useEffect(()=>{J.debug("executing useeffect tableColumns..."),dn()},[I]),Z.useEffect(()=>{if(J.debug("executing effect columnFilters..."),M.largeTableSupport.actual===ar.ENABLED){for(let N=0;N<I.length;N++)if(I[N].inlineSearch&&I[N].inlineSearchEnum!==mr.SEARCHBOX){const Q=I[N].columnName;let $,me;for(let ge=0;ge<F.column.length;ge++)F.column[ge].id===Q&&($=F.column[ge].value);for(let ge=0;ge<p.length;ge++)p[ge].id===Q&&(me=p[ge].value);$!==me&&m(!g)}}},[p]);const R=()=>M.searchSettings.searchFormPosition===zr.HEADER||H.state.masterDetailConditions!==void 0,z=N=>L.jsx("div",{dangerouslySetInnerHTML:{__html:Bl.sanitize(N)}}),V=Z.useMemo(()=>{const N={};return I.filter(Q=>Q.computedField===void 0).map(Q=>{N[Q.columnName]=Q.queryable}),N},[I]),U=Z.useMemo(()=>{const N={};return I.map(Q=>{N[Q.columnName]=Q}),N},[I]),X=Z.useMemo(()=>I.map(N=>N.columnName),[I]),W=Z.useMemo(()=>[],[I]),Y=()=>p.map(N=>{var Q,$;if(Array.isArray(N.value)&&N.value.length===0)return null;if(Dt[N.id].inlineSearchEnum!==mr.SEARCHBOX&&((Q=Dt[N.id].lookup)==null?void 0:Q.loadOnStartup)===!0&&T!==void 0&&T[N.id]!==void 0&&gs(jr.getState(),e,N.id)){const me=vd(jr.getState(),e,N.id);if(me!==void 0)if(Array.isArray(N.value)){if(me.length>0)return{id:N.id,value:N.value.map(ge=>{var De;return(De=me.find(we=>we.value===ge))==null?void 0:De.key})}}else return{id:N.id,value:($=me.find(ge=>ge.value===N.value))==null?void 0:$.key}}return N}),{data:q,isError:Be,isRefetching:xe,isLoading:je,refetch:ht}=Wp({queryKey:["table-data",ue.pageIndex,ue.pageSize,h,g,M.largeTableSupport.actual===ar.ENABLED?g:a,M.largeTableSupport.actual===ar.ENABLED?g:p],queryFn:async()=>{var Q,$,me,ge;let N;if(M.searchSettings.forceSearch&&Array.isArray(p)&&p.length===0&&(a===void 0||a===""))N={data:{code:"ok",data:{},meta:{rowCount:0}}};else{const De=!ep(F,{global:a,column:p,columnFns:rt.getState().columnFilterFns});De&&Qe({pageIndex:0,pageSize:ue.pageSize});let we;M.largeTableSupport.actual===ar.ENABLED&&M.largeTableSupport.skipCount===!0?(we=ad(i),we===null&&(we=void 0)):we=De?void 0:E,J.debug("metaRowCount",we),J.debug("rowCount",E);const Fe={col:V,page_index:ue.pageIndex,page_size:ue.pageSize,sorting:h,search:a,search_columns:Y(),search_column_fns:rt.getState().columnFilterFns,search_column_lov:I.filter(Ee=>Ee.lookup!==void 0&&Ee.inlineSearchEnum===mr.SEARCHBOX).map(Ee=>Ee.columnName),search_data_types:pn(),row_count:we,row_count_estimate:M.largeTableSupport.actual===ar.ENABLED,media:i==null?void 0:i.media};Fe.search_custom=A(),Fe.search_params=H.state.staticFilter,Fe.shortcode_params=H.state.shortcodeArgs,H.state.masterDetailConditions!==void 0&&(Fe.md=H.state.masterDetailConditions),J.debug(Fe,i.src),H.state.relTab===!0&&(Fe.rel_tab=!0);const lt=window.document.getElementById("pp-app-"+e)??window.document.documentElement;for(let Ee=0;Ee<ue.pageSize;Ee++)lt.style.removeProperty(ao(e,Ee.toString(),"color")),lt.style.removeProperty(ao(e,Ee.toString(),"bgcolor"));await kd(i.src.app_id?Au.appUrlAppSelect:Au.appUrlSelect,{...Fe,...i.src}).then(Ee=>{N=Ee,v(!0)}).catch(Ee=>{J.error(Ee),N={}})}return J.debug(N),C(($=(Q=N==null?void 0:N.data)==null?void 0:Q.meta)==null?void 0:$.rowCount),S({global:a,column:p,columnFns:rt.getState().columnFilterFns}),P((ge=(me=N.data)==null?void 0:me.context)==null?void 0:ge.media),J.debug(N.data),N.data},placeholderData:dp}),gt=Z.useMemo(()=>{var N;if(q!==void 0&&Array.isArray(q.data)){const Q={};for(let $=0;$<I.length;$++){const me=I[$];if(me.aggregation!==void 0&&Array.isArray(I[$].aggregation)&&((N=me.aggregation)==null?void 0:N.length)>0){const ge=me.columnName;let De=[];if(me.computedField===void 0)De=q.data.map((lt,Ee)=>Et[Ee]!==void 0&&Et[Ee][ge]!==void 0?Et[Ee][ge]:lt[ge]);else if(me.computedField.type===sd.CODE&&me.computedField.expression!==void 0&&me.computedField.expression!==null&&me.computedField.expression!=="")for(let lt=0;lt<q.data.length;lt++){const Ee=Et[lt]??q.data[lt],He=ld(me.computedField,Ee,he,Me),Ve=fe.safeMode!==!0?cd(He??"",me.computedField.type,fe.safeMode):null;De.push(Ve)}const we=De.filter(lt=>lt!==null),Fe=De.length>0?Nw(we):void 0;Q[ge]={[Tr.SUM]:{value:Fe,label:_r.SUM},[Tr.MIN]:{value:we.length>0?_w(we):void 0,label:_r.MIN},[Tr.MAX]:{value:we.length>0?Ow(we):void 0,label:_r.MAX},[Tr.AVG]:{value:Fe!==void 0?Fe/q.data.length:void 0,label:_r.AVG},[Tr.COUNT]:{value:q.data.length,label:_r.COUNT},[Tr.UNIQUE]:{value:[...new Set(De.map(lt=>lt))].length,label:_r.UNIQUE},[Tr.STD]:{value:we.length>0?kw(we):void 0,label:_r.STD},[Tr.VARIANCE]:{value:we.length>0?Gh(we):void 0,label:_r.VARIANCE},[Tr.MEDIAN]:{value:we.length>0?Pw(we):void 0,label:_r.MEDIAN}}}}return Q}else return null},[q,Et,I]);J.debug("aggregates",gt);const Ct=()=>O===$e.COMPACT?28:40,At=N=>{if(T!==void 0&&T[N.columnName]!==void 0)return T[N.columnName].map(Q=>Q.value)},pr=or?or.palette.mode==="dark"?zd(or.palette.warning.dark,.25):$d(or.palette.warning.light,.5):"transparent";J.debug("matchHighlightColor",pr);const Zr=(N,Q,$)=>{const me=L.jsx("span",{style:{backgroundColor:pr,borderRadius:"2px",padding:"2px 1px"},children:N},$);return Q.allowMarkup===!0?Lf(me):me},dt=(N,Q,$)=>{if(!M.searchSettings.highlightMatches)return N;let me=N;return(a==null?void 0:a.trim())!==""&&(me=lg(me,a,ge=>Zr(ge,Q,$))),J.debug(Q.columnName,N,me),me},Sr=(N,Q,$,me)=>me,mn=Z.useMemo(()=>{J.debug("executing memo columnDef");const N=[];for(let Q=0;Q<I.length;Q++){const $=I[Q],me=$.columnName,ge=$.columnLabel,De=hs(i,$.columnName);let we=$.lookup!==void 0?"string":De!==void 0?ds(i.columns[De].data_type):void 0,Fe=De!==void 0?ds(i.columns[De].data_type,!0):void 0,lt=De!==void 0?i.columns[De].data_type:void 0;const Ee=i.media[me];J.debug(me,ge,De,Fe,lt,Ee);const He={accessorKey:me,header:ge,size:$.width,muiTableHeadCellProps:{className:$.classNames+" pp-table-column "+$.columnName+($.computedField===void 0&&$.orderable?" pp-column-orderable":"")+($.alignment===so.LEFT?" pp-align-left":$.alignment===so.RIGHT?" pp-align-right":""),align:$.alignment},muiTableBodyCellProps:{className:$.classNames+" pp-table-column "+$.columnName+($.computedField===void 0&&$.orderable?" pp-column-orderable":"")+($.alignment===so.LEFT?" pp-align-left":$.alignment===so.RIGHT?" pp-align-right":""),align:$.alignment},enableColumnFilter:$.inlineSearch&&!1,enableSorting:$.orderable,enableColumnActions:$.inlineSearch||$.orderable,columnFilterModeOptions:$.inlineSearch&&$.inlineSearchEnum===mr.SEARCHBOX?we==="string"?["contains","startsWith","endsWith","equals","notEquals","empty","notEmpty"]:["contains","equals","notEquals","greaterThan","greaterThanOrEqualTo","lessThan","lessThanOrEqualTo","between","betweenInclusive","empty","notEmpty"]:["equals"],filterVariant:$.inlineSearch&&$.inlineSearchEnum===mr.DROPDOWN?"select":$.inlineSearch&&($.inlineSearchEnum===mr.MULTISELECT||$.inlineSearchEnum===mr.SEARCHPANE)?"multi-select":"text",filterSelectOptions:$.inlineSearch&&$.inlineSearchEnum!==mr.SEARCHBOX&&T!==void 0&&T[$.columnName]!==void 0?At($):void 0,muiFilterTextFieldProps:({column:Ve})=>({label:qe.filterByColumn.replaceAll("{column}",Ve.columnDef.header),...(Fe==="date"||Fe==="datetime")&&{placeholder:"yyyy-mm-dd"},onFocus:()=>{k($.columnName)},onBlur:()=>{k("")}})};if($.lookup!==void 0){He.Cell=({cell:Ve,renderedCellValue:We})=>(J.debug(Fe,Ve,We),We===null||We===""?null:L.jsx(tg,{appId:e,lookupColumn:$,cell:Ve,metaData:i,highlight:dt})),N.push(He);continue}$.computedField===void 0&&(Ee==="ImageURL"?(He.muiTableBodyCellProps={className:"pp-image "+$.classNames,align:$.alignment,sx:{"& img":{maxWidth:"100%",height:"100%"}}},He.enableColumnFilter=!1,He.enableSorting=!1,He.enableColumnActions=!1,He.Cell=({cell:Ve})=>(J.debug(Fe,Ve),Ve.getValue()===null||Ve.getValue()===""?null:L.jsx(L.Fragment,{children:L.jsx("img",{src:Ve.getValue(),alt:$.columnLabel})}))):Ee==="HyperlinkURL"||Ee==="HyperlinkObject"?(He.muiTableBodyCellProps={className:"pp-hyperlink "+$.classNames,align:$.alignment},He.enableColumnFilter=!1,He.enableSorting=!1,He.enableColumnActions=!1,He.Cell=({cell:Ve})=>{if(J.debug(Fe,Ve),Ve.getValue()===null||Ve.getValue()==="")return null;if(Ee==="HyperlinkObject")try{const We=JSON.parse(Ve.getValue());return(We==null?void 0:We.url)!==""&&(We!=null&&We.target)&&(We==null?void 0:We.label)!==""?L.jsx("a",{href:We.url,target:We.target,onClick:Ci=>{Ci.stopPropagation()},children:We.label}):null}catch(We){return J.error("Invalid media properties",We),L.jsx(ws,{title:"Error reading media! Check console...",children:L.jsx("span",{children:L.jsx(Es,{})})})}else return L.jsxs("a",{href:Ve.getValue(),target:"_blank",style:{display:"flex",alignItems:"center",gap:"5px"},onClick:We=>{We.stopPropagation()},children:[L.jsx(Id,{}),L.jsx("span",{children:$.columnLabel})]})}):Ee==="WP-Image"||Ee==="WP-Attachment"||Ee==="WP-Audio"||Ee==="WP-Video"?(He.muiTableBodyCellProps={className:Ee.toLowerCase()+" "+$.classNames,align:$.alignment},Ee==="WP-Image"&&(He.muiTableBodyCellProps.sx={"& img":{maxWidth:"100%",height:"100%"}}),He.enableColumnFilter=!1,He.enableSorting=!1,He.enableColumnActions=!1,He.Cell=({cell:Ve,row:We})=>(J.debug(Fe,Ve,We),Ve.getValue()===null||Ve.getValue()===""||!b[We.id]||!b[We.id][$.columnName]?null:L.jsxs(L.Fragment,{children:[...b[We.id][$.columnName].map(Ci=>{try{const Ye=JSON.parse(Ci);if(!(Ye!=null&&Ye.url))return null;switch(Ee){case"WP-Image":return L.jsx("img",{src:Ye.url,title:Ye.title,alt:Ye.title},Ye.title);case"WP-Audio":return L.jsx("audio",{controls:!0,children:L.jsx("source",{src:Ye.url,type:Ye.mime_type})});case"WP-Video":return L.jsx("video",{controls:!0,children:L.jsx("source",{src:Ye.url,type:Ye.mime_type})});default:{const Ai=Ye.mime_type.split("/");return L.jsxs("a",{href:Ye.url,title:Ye.title,target:"_blank",onClick:Qh=>{Qh.stopPropagation()},children:[L.jsxs("div",{className:"pp-attachment-icon",children:[Ai[0]==="image"&&L.jsx(Zd,{}),Ai[0]==="audio"&&L.jsx(Yd,{}),Ai[0]==="video"&&L.jsx(Xd,{}),Ai[0]==="application"?Ai[1]==="pdf"?L.jsx(Kd,{}):L.jsx(Jd,{}):L.jsx(L.Fragment,{})]}),L.jsx("div",{className:"pp-attachment-link",children:Ye.title})]})}}}catch(Ye){return J.error("Invalid media properties",Ye),L.jsx(ws,{title:"Error reading media! Check console...",children:L.jsx("span",{children:L.jsx(Es,{})})})}})]}))):(lt!=null&&lt.includes("text")&&(He.muiTableBodyCellProps={className:$.classNames,align:$.alignment,sx:{whiteSpace:"pre-wrap"}}),He.Cell=({cell:Ve,renderedCellValue:We,row:Ci})=>{if(J.debug(Fe,Ve,We),Ve.getValue()===null||Ve.getValue()==="")return Sr($.columnName,Ci,null,null);if(I[Q].allowMarkup)return z(Ve.getValue());if(Fe==="date"){if(Re!==""){const Ye=new Date(Date.parse(Ve.getValue()));if(Ye.toString().toLowerCase()!=="invalid date")return Su(Re,Ye)}}else if(Fe==="datetime"){if(Re!==""&&st!==""){const Ye=new Date(Date.parse(Ve.getValue()));if(Ye.toString().toLowerCase()!=="invalid date")return Su(Re+" "+st,Ye)}}else if(Fe==="time"&&st!==""){const Ye=new Date(new Date().toDateString()+" "+Ve.getValue());if(Ye.toString().toLowerCase()!=="invalid date")return Su(st,Ye)}return We}),N.push(He))}return N},[e,M,I,q,b,Et,T,wt]);J.debug("columnDef",mn);const gn=Qd(),Ze=((ne=u==null?void 0:u.current)==null?void 0:ne.offsetWidth)??901;J.debug("componentWidth",Ze);const[Ir,kn]=Z.useState(Ze<900);Z.useEffect(()=>{var N;kn(Ze<900||(((N=l==null?void 0:l.current)==null?void 0:N.offsetWidth)??901)<=900)},[Ze,gn.width]);const In=()=>Object.fromEntries(mn.map(({accessorKey:N})=>[N,I.filter(Q=>Q.columnName===N&&Q.inlineSearchEnum!==mr.SEARCHBOX).length>0?"equals":"contains"])),[Ln,vn]=Z.useState(In());Z.useEffect(()=>{vn(In())},[I]);const rt=Td({columns:mn,data:(q==null?void 0:q.data)??[],rowCount:((ze=q==null?void 0:q.meta)==null?void 0:ze.rowCount)??0,initialState:{density:M.design.density.default,columnPinning:{left:["mrt-row-actions","mrt-row-select"],right:["mrt-row-expand"]}},state:{pagination:ue,sorting:h,globalFilter:a,columnFilters:p,isLoading:je,showAlertBanner:Be,showProgressBars:xe,columnOrder:["mrt-row-actions","mrt-row-select"].concat(X),showColumnFilters:d,columnFilterFns:Ln},onColumnFilterFnsChange:vn,localization:qe,enableStickyHeader:!1,enableColumnOrdering:!1,enableColumnResizing:!1,enableColumnPinning:!1,enableHiding:!0,layoutMode:"semantic",enableTopToolbar:!0,enableBottomToolbar:!0,enableFullScreenToggle:!1,positionToolbarDropZone:"none",renderTopToolbarCustomActions:()=>L.jsxs(L.Fragment,{children:[L.jsx(Z.Suspense,{children:L.jsx($w,{table:rt,metaData:i,appId:e,bulkActions:Ie,hasBulkActions:tt,tableStore:H,appLanguage:re,refetch:ht,showForm:n,appSettings:fe})}),M.pagination.position!=="bottom"&&L.jsx(Dr,{sx:{position:"absolute",top:"64px",left:"1.5rem"},children:L.jsx(Al,{tableSettings:M,globalFilter:a,columnFilters:p,pagination:ue,locale:qe,rowCount:E})})]}),renderToolbarInternalActions:({table:N})=>L.jsxs(L.Fragment,{children:[L.jsx(_d,{table:N}),W.length>0&&(M.searchSettings.searchFormAlwaysOpen!==!0||Ze<900)&&L.jsx(Md,{table:N}),M.design.density.userCanChange&&L.jsx(Nd,{table:N})]}),muiTopToolbarProps:()=>({className:"pp-top-toolbar",sx:{...Ze<390&&{"& > .MuiBox-root":{flexDirection:"column","& div:last-child":{alignSelf:"flex-end",marginLeft:"auto"}}}}}),muiToolbarAlertBannerProps:Be?{color:"error",children:re.errorLoadingData}:void 0,enableRowActions:Ne,positionActionsColumn:"first",renderRowActions:({row:N,table:Q})=>{J.debug(N,Q);const $={};return i.primary_key.map(me=>{N.original[me]&&($[me]=N.original[me])}),J.debug($),L.jsx(Z.Suspense,{children:L.jsx(Uw,{metaData:i,appId:e,showForm:n,rowId:$,rowData:N.original,storeTableSettings:M,refetch:ht,appLanguage:re,tableDensity:O})})},displayColumnDefOptions:{"mrt-row-actions":{minSize:(Number(Ae)+Number(et)+Number(ke))*Ct(),size:(Number(Ae)+Number(et)+Number(ke))*Ct(),maxSize:(Number(Ae)+Number(et)+Number(ke))*Ct(),enableHiding:!0,muiTableHeadCellProps:{sx:{"&.MuiTableCell-root.MuiTableCell-head":{backgroundColor:(nt=or)==null?void 0:nt.palette.background.default,paddingLeft:O===$e.COMPACT?"1rem":"1.5rem",boxShadow:"none"}}},muiTableBodyCellProps:{sx:{"&.MuiTableCell-root.MuiTableCell-body":{backgroundColor:(pe=or)==null?void 0:pe.palette.background.default,maxWidth:"0%",width:"0%",padding:O===$e.SPACIOUS?"0 1.5rem":"0 1rem"}}}},"mrt-row-select":{minSize:50,size:50,maxSize:50,enableHiding:!0,muiTableHeadCellProps:{sx:{"&.MuiTableCell-root.MuiTableCell-head":{backgroundColor:(Le=or)==null?void 0:Le.palette.background.default,boxShadow:"none",left:Ae||et||ke?(Number(Ae)+Number(et)+Number(ke))*Ct()+(O===$e.SPACIOUS?40:O===$e.COMFORTABLE?30:28):0,paddingLeft:O===$e.SPACIOUS?"1.5rem":"1rem",paddingRight:"8px"}}},muiTableBodyCellProps:{sx:{"&.MuiTableCell-root.MuiTableCell-body":{backgroundColor:(Pt=or)==null?void 0:Pt.palette.background.default,maxWidth:"0%",width:"0%",left:Ae||et||ke?(Number(Ae)+Number(et)+Number(ke))*Ct()+(O===$e.SPACIOUS?40:O===$e.COMFORTABLE?30:28):0,paddingTop:0,paddingBottom:0,paddingLeft:O===$e.SPACIOUS?"1.5rem":"1rem",paddingRight:"8px"}}}},"mrt-row-expand":{minSize:0,size:0,maxSize:0,enableHiding:!0,muiTableHeadCellProps:{sx:{"&.MuiTableCell-root.MuiTableCell-head":{backgroundColor:(Yt=or)==null?void 0:Yt.palette.background.default,paddingLeft:O===$e.SPACIOUS?"1.5rem":"1rem",boxShadow:"none"}}},muiTableBodyCellProps:{sx:{"&.MuiTableCell-root.MuiTableCell-body":{backgroundColor:(ot=or)==null?void 0:ot.palette.background.default,maxWidth:"0%",width:"0%",padding:O===$e.SPACIOUS?"0 1.5rem":"0 1rem"}}}}},renderColumnActionsMenuItems:({internalColumnMenuItems:N})=>{const Q=N.filter($=>$.key!=="3"&&$.key!=="5"&&$.key!=="11"&&$.key!=="12");return Q.length===0?Q:[...Q.slice(0,Q.length-1),fd({},...Q.slice(Q.length-1,Q.length),{props:{divider:!1}})]},positionExpandColumn:"last",renderDetailPanel:lo(M)?N=>L.jsx(ng,{appId:e,table:N.table,row:N.row,columns:I,appSettings:fe,metaData:i,tableSettings:M}):void 0,enableRowSelection:tt,enableSelectAll:tt,muiTableBodyRowProps:({isDetailPanel:N,row:Q})=>{var $,me,ge,De,we;return{...!N&&{hover:!0,onClick:Q.getToggleSelectedHandler(),sx:{cursor:"pointer",color:`var( ${ao(e,Q.id,"color")}, ${(ge=(me=($=or)==null?void 0:$.palette)==null?void 0:me.primary)==null?void 0:ge.main} ) !important`,backgroundColor:`var( ${ao(e,Q.id,"bgcolor")}, ${lo(M)&&Q.index%2?((we=(De=or)==null?void 0:De.palette)==null?void 0:we.mode)===_c.DARK?"#202020":"#f9f9f9":"inherit"}) !important`}}}},muiTableBodyCellProps:N=>({sx:{color:`var( ${ps(e,N.row.id,N.cell.column.id,"color")}, "inherit" )`,backgroundColor:`var( ${ps(e,N.row.id,N.cell.column.id,"bgcolor")}, "inherit" )`}}),enablePagination:!0,manualPagination:!0,onPaginationChange:N=>{rt.setRowSelection({}),o(hd({appId:e})),Qe(N)},paginationDisplayMode:M.largeTableSupport.actual===ar.ENABLED||M.pagination.showCompactButtons?"default":"pages",positionPagination:M.pagination.position,muiPaginationProps:{rowsPerPageOptions:M.pagination.rowsPerPage,color:"primary",shape:"rounded",variant:"outlined",showRowsPerPage:!0,showFirstButton:M.pagination.showFirstButton,showLastButton:M.pagination.showLastButton&&(M.largeTableSupport.actual===ar.DISABLED||M.largeTableSupport.skipCount===!1)},manualFiltering:!0,enableGlobalFilter:!0,enableFilterMatchHighlighting:M.searchSettings.highlightMatches,enableGlobalFilterModes:!1,onGlobalFilterChange:c,enableColumnFilterModes:!0,columnFilterDisplayMode:R()?"subheader":"custom",onColumnFiltersChange:D,enableColumnFilters:W.length>0,onShowColumnFiltersChange:()=>{M.searchSettings.searchFormAlwaysOpen||o(ms({appId:e,showColumnFilters:!d}))},muiSearchTextFieldProps:()=>({className:"pp-global-search-field",onKeyUp:N=>{M.largeTableSupport.actual===ar.ENABLED&&N.key.toLowerCase()==="enter"&&ve()},onClick:N=>{M.largeTableSupport.actual===ar.ENABLED&&N.target instanceof SVGElement&&N.target.dataset.testid==="CloseIcon"&&ve()},sx:{"& .MuiInputBase-input":{padding:"8px"}}}),muiFilterTextFieldProps:({column:N})=>({className:"pp-column-search-field",id:"pp-column-search-field-"+N.columnDef.id,onKeyUp:Q=>{M.largeTableSupport.actual===ar.ENABLED&&Q.key.toLowerCase()==="enter"&&ve()},onClickCapture:Q=>{M.largeTableSupport.actual===ar.ENABLED&&(Q.target.parentElement.dataset.testid==="CloseIcon"||Q.target.dataset.testid==="CloseIcon")&&ve()},sx:{"& .MuiChip-label:empty":{display:"none"}}}),manualSorting:!0,onSortingChange:s,sortDescFirst:!1,enableColumnActions:!0,enableSorting:!0,muiTablePaperProps:{elevation:ee,sx:{zIndex:1,visibility:t?"visible":"hidden",position:t?"auto":"fixed",height:t?"auto":0,order:((wn=M==null?void 0:M.searchSettings)==null?void 0:wn.searchFormPosition)===zr.RIGHT?-1:1,gridRowStart:((Ei=M==null?void 0:M.searchSettings)==null?void 0:Ei.searchFormPosition)===zr.BOTTOM?1:0,"& input":{border:"none"},border:"seperate","&.pp-table table":{margin:0,border:0,borderCollapse:"collapse"},"&.pp-table table tr th, &.pp-table table tr td":{boxShadow:"unset",padding:O===$e.COMPACT?"0.5rem":O===$e.COMFORTABLE?"1rem":"1.5rem",paddingRight:0,...Ze<500&&M.design.overflow===Fu.RESPONSIVE&&{minWidth:0,maxWidth:0,textOverflow:"ellipsis"}},"&.pp-table table tr th":{paddingTop:O===$e.COMPACT?"0.25rem":O===$e.COMFORTABLE?"0.75rem":"1.25rem",paddingBottom:O===$e.COMPACT?"0.4rem":"0.6rem"},...!lo(M)&&{"&.pp-table table tr th:last-of-type, &.pp-table table tr td:last-of-type":{paddingRight:O===$e.COMPACT||O===$e.COMFORTABLE?"1rem":"1.5rem"}},...lo(M)&&{"&.pp-table table tr td:nth-of-type(1), &.pp-table table tr td:nth-of-type(2), &.pp-table table tr td:nth-last-of-type(1)":{backgroundColor:"inherit"},"&.pp-table table tr th:nth-last-of-type(2), &.pp-table table tr td:nth-last-of-type(2)":{paddingRight:O===$e.COMPACT?"0.5rem":O===$e.COMFORTABLE?"1rem":"1.5rem"}},"&.pp-table table tr.Mui-TableBodyCell-DetailPanel td.Mui-TableBodyCell-DetailPanel":{padding:0},"& .pp-top-toolbar .MuiTablePagination-root":{marginTop:0,paddingTop:0,paddingBottom:0,...Ze<480&&{flexDirection:"column",gap:0}},"& .pp-top-toolbar label.MuiFormLabel-root, & .pp-bottom-toolbar label.MuiFormLabel-root":{transform:"none",...Ze<600&&H.state.masterDetailConditions!==void 0&&{display:"none"}},"& .pp-top-toolbar .MuiTablePagination-root .MuiTypography-root, & .pp-bottom-toolbar .MuiTablePagination-root .MuiTypography-root":{display:"none"}},className:"pp-table"+(Ar?" pp-table-sizer":"")},muiBottomToolbarProps:{className:"pp-bottom-toolbar",sx:{...!xt&&M.pagination.position==="top"&&{display:"none"},boxShadow:"none","& > div":{...Ze<500&&{display:"grid",width:"100%",justifyContent:"center","& .pp-bottom-toolbar-container":{marginLeft:0,display:"inline-block",textAlign:"center"},"& .MuiTablePagination-root":{justifyContent:"center",gap:0}}},"& .pp-bottom-toolbar-container":{font:"inherit",marginLeft:H.state.masterDetailConditions!==void 0?"8px":"1rem"},"& > .MuiBox-root > .MuiBox-root > .MuiBox-root":{alignItems:"center",paddingTop:0,paddingRight:Ze<500?0:"8px",paddingBottom:0,paddingLeft:0}}},renderBottomToolbarCustomActions:()=>!xt&&M.pagination.position==="top"?null:L.jsxs(Dr,{className:"pp-bottom-toolbar-container",sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"10px"},children:[!1,xt&&L.jsx(wo,{variant:"contained",className:"pp-builder-button",startIcon:L.jsx(Ld,{}),onClick:()=>{o(dd({appId:e,hideThemeSettings:!0}))},children:"Table Builder"}),M.pagination.position!=="top"&&L.jsx(Al,{tableSettings:M,globalFilter:a,columnFilters:p,pagination:ue,locale:qe,rowCount:E})]}),muiTableProps:{sx:{border:"unset","& th, td":{borderTop:"unset",borderRight:"unset",borderLeft:"unset"},margin:0}}});J.debug(rt),Z.useEffect(()=>{J.debug("executing effect viewLink + transactions...");const N=rt.getAllColumns();N[0].id==="mrt-row-actions"&&N[0].toggleVisibility(Ne)},[M.viewLink,M.transactions]),Z.useEffect(()=>{J.debug("executing effect bulkActions...");const N=rt.getAllColumns();N[1].id==="mrt-row-select"&&N[1].toggleVisibility(tt)},[M.bulkActions]),Z.useEffect(()=>{if(J.debug("executing effect overflow..."),M.design.overflow===Fu.SCROLL){const N=rt.getAllColumns();for(let Q=0;Q<N.length;Q++){const $=U[N[Q].id];$!==void 0&&(Ze>1200?N[Q].toggleVisibility($.visible??!1):Ze<600?N[Q].toggleVisibility($.visibleMobile??!1):N[Q].toggleVisibility($.visibleTablet??!1))}}},[M.design.overflow,I,Ze]);const Vt=(N=1)=>{var Fe,lt;const Q=((Fe=rt.refs.tableContainerRef.current)==null?void 0:Fe.offsetWidth)??0,$=rt.getState().density==="spacious"?40:rt.getState().density==="comfortable"?32:16,me=80;let ge=0,De=0;const we=rt.getAllColumns();for(let Ee=0;Ee<we.length;Ee++){const He=U[we[Ee].id];He!==void 0?(He==null?void 0:He.visible)===!0?(ge+=we[Ee].getSize()+$,De>0&&ge+me>Q?Ee>N&&we[Ee].toggleVisibility(!1):(we[Ee].toggleVisibility(!0),De++)):we[Ee].toggleVisibility(!1):(!Ir||((lt=we[Ee])==null?void 0:lt.id)!=="mrt-row-select")&&(ge+=we[Ee].getSize()+$)}},Lr=1+(Ne?1:0)+(tt?1:0);J.debug("staticColumnNumber",Lr),Z.useEffect(()=>{var N;if(J.debug("executing effect density...",tt,Ir),tt){const Q=rt.getAllColumns();for(let $=0;$<3;$++)((N=Q[$])==null?void 0:N.id)==="mrt-row-select"&&(Ir?Q[$].toggleVisibility(!1):Q[$].toggleVisibility(!0))}M.design.overflow===Fu.RESPONSIVE&&Vt(Lr)},[rt.getState().density,M.design.overflow,I,Ir,Ar,t,gn.width]),Z.useEffect(()=>{const N=rt.getState().density===$e.COMPACT?$e.COMPACT:rt.getState().density===$e.COMFORTABLE?$e.COMFORTABLE:$e.SPACIOUS;oe(N),o(pd({appId:e,density:N}))},[rt.getState().density]),Z.useEffect(()=>{J.debug("executing effect refresh..."),f.current?f.current=!1:ht()},[r]),Z.useEffect(()=>{},[M.searchSettings.searchForm,M.searchSettings.searchFormPosition,d]),Z.useEffect(()=>{M.searchSettings.searchFormAlwaysOpen&&o(ms({appId:e,showColumnFilters:!0}))},[M.searchSettings.searchFormAlwaysOpen]),Z.useEffect(()=>{y&&(J.debug("cascade search boxes"),H.table.searchSettings.cascade===!0&&dn())},[a,p,g]);const zn=()=>({minWidth:0,width:"100%",gap:"6px",display:"grid"}),$n=()=>{const N={zIndex:1};switch(O){case $e.SPACIOUS:N.padding="24px";break;case $e.COMFORTABLE:N.padding="18px";break;default:N.padding="12px"}return N},Un=()=>{var $;const N={display:"grid",justifyContent:"space-between",alignItems:"center",width:"100%"};let Q=($=M==null?void 0:M.searchSettings)==null?void 0:$.searchFormPosition;switch(Ze<900&&Q!==zr.BOTTOM&&(Q=zr.TOP),Q){case zr.TOP:case zr.BOTTOM:N.gridTemplateColumns=Ze<700?"repeat(1, 1fr)":Ze<900?"repeat(2, 1fr)":`repeat(auto-fit, minmax(${M==null?void 0:M.searchSettings.searchFormWidth}${M==null?void 0:M.searchSettings.searchFormWidthUnit}, 1fr))`;break;case zr.LEFT:case zr.RIGHT:N.gridTemplateColumns="repeat(1, 1fr)"}switch(O){case $e.SPACIOUS:N.marginTop="24px",N.gap="24px";break;case $e.COMFORTABLE:N.marginTop="18px",N.gap="18px";break;default:N.marginTop="12px",N.gap="12px"}return N},qn=()=>{const N={border:"1px solid #dedede",borderRadius:"4px",overflow:"auto"};switch(O){case $e.SPACIOUS:N.padding="24px";break;case $e.COMFORTABLE:N.padding="18px";break;default:N.padding="12px"}return N},Zt=Z.useMemo(()=>null,[R,Ze,M==null?void 0:M.searchSettings,t,d,$n,Un,qn]),jn=Z.useMemo(()=>{let N="";return Ze<600&&(N+=`#pp-app-${e} .pp-toolbar-buttons button {font-size:70%;padding:8px}`,N+=`#pp-app-${e} .pp-toolbar-buttons button.ppToolbarRefreshIcon {font-size:1.5rem;}`),L.jsx("style",{dangerouslySetInnerHTML:{__html:Bl.sanitize(N)}})},[Ze]),Vn=Z.useMemo(()=>null,[Dt]);return L.jsxs(Dr,{sx:zn(),className:"pp-table-container",ref:u,children:[Zt,L.jsx(Bd,{table:rt}),Vn,jn]})},jw=({appId:e,display:t,refresh:r,metaData:n,showForm:i})=>{J.debug(e,t,r);const o=new Tp;return L.jsx(Op,{client:o,children:L.jsx(qw,{appId:e,display:t,refresh:r,showForm:i,metaData:n})})},Vw=e=>{const t=Pr(r=>Dd(r,e));return J.debug("tableSettingsVisible",t),t},Hw=()=>{const e=Pr(t=>yd(t));return J.debug("hideThemeSetting",e),e},Ww=Z.lazy(()=>vi(()=>import("./SettingsTable-1.0.13-470c0145.js"),["./SettingsTable-1.0.13-470c0145.js","./main-1.0.13.js","./main-1.0.13-4cbe632d.js","./iconBase-1.0.13-98e06aa9.js","./main-1.0.13-dd4484b4.css","./useStoreTable-1.0.13-383948b4.js","./useTableUpdater-1.0.13-f903232c.js","./index-1.0.13-93f67fc3.js","./AccordionSummary-1.0.13-0885ed32.js","./Close-1.0.13-b137ce2f.js","./useSlot-1.0.13-62ad37b6.js","./settings-1.0.13-650559d5.js","./FormControlLabel-1.0.13-143a10df.js","./TextField-1.0.13-7258d491.js","./Menu-1.0.13-2a06ef00.js","./useScreenSize-1.0.13-fa31f819.js","./DialogContent-1.0.13-5873ffb9.js","./AdminTheme-1.0.13-a1e60de2.js","./Tabs-1.0.13-f71c8d5c.js","./settings-1.0.13-e7dd0b92.css","./Link-1.0.13-03de5435.js","./RadioGroup-1.0.13-1d87a31c.js","./Radio-1.0.13-befab7cd.js","./DefaultWhere-1.0.13-d139ab5a.js","./index.esm-1.0.13-0afa0259.js","./MenuItem-1.0.13-e7719456.js","./PremiumFeature-1.0.13-d257b3ff.js","./CssUnitTextField-1.0.13-9657903d.js","./useMobilePicker-1.0.13-30bb98f7.js","./InputAdornment-1.0.13-83724c3f.js"],import.meta.url)),Gw=Z.lazy(()=>vi(()=>import("./SettingsColumns-1.0.13-7d53bafa.js"),["./SettingsColumns-1.0.13-7d53bafa.js","./main-1.0.13.js","./useMetadataColumns-1.0.13-00fd71bb.js","./main-1.0.13-4cbe632d.js","./iconBase-1.0.13-98e06aa9.js","./main-1.0.13-dd4484b4.css","./useStoreTable-1.0.13-383948b4.js","./useScreenSize-1.0.13-fa31f819.js","./AdminTheme-1.0.13-a1e60de2.js","./index.esm-1.0.13-cc102a96.js","./ActionsDml-1.0.13-147ce8d4.js","./index.esm-1.0.13-0afa0259.js","./TextField-1.0.13-7258d491.js","./Close-1.0.13-b137ce2f.js","./Menu-1.0.13-2a06ef00.js","./MenuItem-1.0.13-e7719456.js","./index-1.0.13-93f67fc3.js","./useTableUpdater-1.0.13-f903232c.js","./Stepper-1.0.13-4e64ee4c.js","./settings-1.0.13-650559d5.js","./FormControlLabel-1.0.13-143a10df.js","./DialogContent-1.0.13-5873ffb9.js","./Tabs-1.0.13-f71c8d5c.js","./settings-1.0.13-e7dd0b92.css","./Checkbox-1.0.13-3ec10fcc.js","./Link-1.0.13-03de5435.js","./AccordionSummary-1.0.13-0885ed32.js","./useSlot-1.0.13-62ad37b6.js","./ScopeEnum-1.0.13-d05c4b00.js","./PremiumFeature-1.0.13-d257b3ff.js","./RadioGroup-1.0.13-1d87a31c.js","./Radio-1.0.13-befab7cd.js","./index.esm-1.0.13-ae160362.js","./AlertTitle-1.0.13-80063b16.js","./InputAdornment-1.0.13-83724c3f.js","./ListItemIcon-1.0.13-2bfd9865.js","./DateTimePicker-1.0.13-12d520d7.js","./useMobilePicker-1.0.13-30bb98f7.js","./date-time-utils-1.0.13-2393af5c.js","./dateViewRenderers-1.0.13-3b668027.js","./TimePicker-1.0.13-101f1fcd.js","./DatePicker-1.0.13-5c3486db.js","./index-1.0.13-81ade722.js"],import.meta.url)),Qw=Z.lazy(()=>vi(()=>import("./SettingsTableCode-1.0.13-de70c071.js"),["./SettingsTableCode-1.0.13-de70c071.js","./main-1.0.13.js","./index-1.0.13-2afde5c8.js","./DialogContent-1.0.13-5873ffb9.js","./iconBase-1.0.13-98e06aa9.js","./main-1.0.13-4cbe632d.js","./main-1.0.13-dd4484b4.css","./Menu-1.0.13-2a06ef00.js","./useTableUpdater-1.0.13-f903232c.js","./settings-1.0.13-650559d5.js","./FormControlLabel-1.0.13-143a10df.js","./TextField-1.0.13-7258d491.js","./Close-1.0.13-b137ce2f.js","./useScreenSize-1.0.13-fa31f819.js","./AdminTheme-1.0.13-a1e60de2.js","./Tabs-1.0.13-f71c8d5c.js","./settings-1.0.13-e7dd0b92.css","./PremiumFeature-1.0.13-d257b3ff.js","./index.esm-1.0.13-0afa0259.js","./index.esm-1.0.13-8cdddba7.js","./AccordionSummary-1.0.13-0885ed32.js","./useSlot-1.0.13-62ad37b6.js","./TreeItem2Provider-1.0.13-d4167759.js","./index.esm-1.0.13-ae160362.js","./MenuItem-1.0.13-e7719456.js","./Radio-1.0.13-befab7cd.js","./Checkbox-1.0.13-3ec10fcc.js","./AlertTitle-1.0.13-80063b16.js","./InputAdornment-1.0.13-83724c3f.js","./ListItemIcon-1.0.13-2bfd9865.js","./DateTimePicker-1.0.13-12d520d7.js","./useMobilePicker-1.0.13-30bb98f7.js","./date-time-utils-1.0.13-2393af5c.js","./dateViewRenderers-1.0.13-3b668027.js","./TimePicker-1.0.13-101f1fcd.js","./DatePicker-1.0.13-5c3486db.js","./ScopeEnum-1.0.13-d05c4b00.js","./ActionsDml-1.0.13-147ce8d4.js","./useStoreTable-1.0.13-383948b4.js","./index-1.0.13-81ade722.js"],import.meta.url)),Zw=Z.lazy(()=>vi(()=>import("./ThemeSettings-1.0.13-5f20f682.js"),["./ThemeSettings-1.0.13-5f20f682.js","./main-1.0.13.js","./main-1.0.13-4cbe632d.js","./iconBase-1.0.13-98e06aa9.js","./main-1.0.13-dd4484b4.css","./PremiumFeature-1.0.13-d257b3ff.js","./index.esm-1.0.13-0afa0259.js","./AdminTheme-1.0.13-a1e60de2.js","./TextField-1.0.13-7258d491.js","./Close-1.0.13-b137ce2f.js","./Menu-1.0.13-2a06ef00.js","./index-1.0.13-81ade722.js","./settings-1.0.13-650559d5.js","./FormControlLabel-1.0.13-143a10df.js","./useScreenSize-1.0.13-fa31f819.js","./DialogContent-1.0.13-5873ffb9.js","./Tabs-1.0.13-f71c8d5c.js","./settings-1.0.13-e7dd0b92.css","./ScopeEnum-1.0.13-d05c4b00.js","./Link-1.0.13-03de5435.js","./RadioGroup-1.0.13-1d87a31c.js","./Radio-1.0.13-befab7cd.js","./CssUnitTextField-1.0.13-9657903d.js","./AccordionSummary-1.0.13-0885ed32.js","./useSlot-1.0.13-62ad37b6.js"],import.meta.url)),Yw=({appId:e,metaData:t})=>{var F,S;J.debug(e,t);const r=_a(),n=Hw(),[i,o]=Z.useState(vs(jr.getState(),e));J.debug(i);const[u,l]=Z.useState(wd(jr.getState(),e));J.debug(u);const[f,h]=Z.useState(!1),s=()=>Fd(jr.getState(),e),a=b=>{r(Ed({appId:e,isUpdated:b}))},c=((F=ys)==null?void 0:F.palette.mode)===_c.LIGHT?(S=ys)==null?void 0:S.palette.primary.main:"",p=b=>{r(Cd({anchor:b}))},D=()=>{r(Ad({appId:e,tableState:i}))},d=()=>{r(Sd({})),a(!1)},g=()=>{s()?h(!0):(D(),d())},m=()=>{sp(e,lp.GLOBAL,b=>{if(J.debug(b),b!=null&&b.code&&(b==null?void 0:b.message)!==void 0)switch(b.code){case"ok":o(vs(jr.getState(),e)),Si(b.message,{variant:"success"});break;case"info":Si(b.message,{variant:"info"});break;default:J.error(b),Si(b.message??bu.contactSupport,{variant:"error"})}else J.error(b),Si(bu.contactSupport,{variant:"error"})},b=>{J.error("error",b),Si(b??bu.contactSupport,{variant:"error"})}),a(!1)},y=()=>{s()?(m(),setTimeout(()=>{d()},1e3)):d()},[v,w]=Z.useState("1"),E=(b,P)=>{w(P)},C=Vw(e);return L.jsx(L.Fragment,{children:C&&L.jsxs(L.Fragment,{children:[L.jsxs(rp,{closeDrawer:g,children:[L.jsx(Ud,{position:"static",elevation:4,sx:{borderRadius:0},children:L.jsxs(qd,{className:"pp-setting-toolbar",sx:{borderRadius:0},children:[L.jsx(tp,{variant:"h5",noWrap:!0,component:"div",className:"unselectable",sx:{flexGrow:1,display:{xs:"none",sm:"block"},paddingLeft:"6px"},children:"Table Builder"}),L.jsx(_u,{title:"Dock to left",position:"bottom",children:L.jsx(Tu,{onClick:()=>{p(Ds.LEFT)},size:"large",color:"inherit",sx:{fontSize:"1em"},children:L.jsx(np,{})})}),L.jsx(_u,{title:"Dock to right",position:"bottom",children:L.jsx(Tu,{onClick:()=>{p(Ds.RIGHT)},size:"large",color:"inherit",sx:{fontSize:"1em"},children:L.jsx(ip,{})})}),L.jsx(_u,{title:"Close",position:"bottom",children:L.jsx(Tu,{onClick:g,size:"large",color:"inherit",sx:{fontSize:"1.4em"},children:L.jsx(jd,{})})})]})}),L.jsx(Cs,{className:"pp-settings-container",children:L.jsx(As,{sx:{padding:0,margin:0},children:L.jsxs(op,{value:v,children:[L.jsxs(up,{variant:"fullWidth",textColor:"primary",onChange:E,sx:{width:"100%",height:"80px",padding:0,margin:0,backgroundColor:"rgb(242, 242, 242)"},children:[L.jsx(fo,{label:"Table",value:"1",sx:{fontWeight:"bold",fontSize:"110%",height:"80px"}}),L.jsx(fo,{label:"Columns",value:"2",sx:{fontWeight:"bold",fontSize:"110%",height:"80px"}}),L.jsx(fo,{label:"Hooks",value:"3",sx:{fontWeight:"bold",fontSize:"110%",height:"80px"}}),n!==!0&&L.jsx(fo,{label:"Theme",value:"4",sx:{fontWeight:"bold",fontSize:"110%",height:"80px"}})]}),L.jsxs(Dr,{sx:{margin:0,padding:0,overflowY:"auto",height:"calc(100vh - 250px)","& > div.MuiTabPanel-root":{padding:0}},children:[L.jsx(co,{value:"1",children:L.jsx(Z.Suspense,{fallback:L.jsx(Dr,{sx:{padding:"30px"},children:L.jsx(Vd,{title:"Loading Table Builder..."})}),children:L.jsx(Ww,{appId:e,metaData:t})})}),L.jsx(co,{value:"2",children:L.jsx(Z.Suspense,{children:L.jsx(Gw,{appId:e,metaData:t})})}),L.jsx(co,{value:"3",children:L.jsx(Z.Suspense,{children:L.jsx(Qw,{appId:e})})}),n!==!0&&L.jsx(co,{value:"4",children:L.jsx(Z.Suspense,{children:L.jsx(Zw,{appId:e,source:Hd.TABLE,setIsUpdated:a})})})]})]})})}),L.jsx(Cs,{className:"pp-setting-footer",sx:{borderRadius:0,backgroundColor:c},children:L.jsxs(As,{className:"pp-setting-footer-buttons",sx:{borderRadius:0},children:[L.jsx(wo,{variant:"outlined",className:"footer_action_button_apply",onClick:m,children:"Apply"}),L.jsx(wo,{variant:"outlined",className:"footer_action_button",onClick:y,children:"OK"}),L.jsx(wo,{variant:"outlined",className:"footer_action_button",onClick:g,children:"Cancel"})]})})]}),L.jsx(ap,{title:"Close Table Builder?",message:"All uncommitted changes will be lost!",open:f,setOpen:h,onConfirm:()=>{D(),d()},onKeep:()=>{d()}})]})})},Xw=({appId:e,display:t,refresh:r,showForm:n,metaData:i})=>{J.debug(e,e,t,r);const o=Z.useMemo(()=>Tc(i),[i]),u=Z.useMemo(()=>bd(),[]);return L.jsxs(L.Fragment,{children:[L.jsx(jw,{appId:e,display:t,refresh:r,showForm:n,metaData:i}),o&&L.jsx(Wd,{theme:u,children:L.jsx(Yw,{appId:e,metaData:i})})]})},dE=Object.freeze(Object.defineProperty({__proto__:null,default:Xw},Symbol.toStringTag,{value:"Module"}));export{Tr as A,dE as T,_r as a,rg as b,zf as u};