index-CeVjVVVA.js 1.8 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278
  1. function Ik(r,e){for(var t=0;t<e.length;t++){const n=e[t];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in r)){const a=Object.getOwnPropertyDescriptor(n,i);a&&Object.defineProperty(r,i,a.get?a:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function t(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=t(i);fetch(i.href,a)}})();var wp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function cl(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Nk(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var e=r.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var a1={exports:{}},nf={};/**
  2. * @license React
  3. * react-jsx-runtime.production.js
  4. *
  5. * Copyright (c) Meta Platforms, Inc. and affiliates.
  6. *
  7. * This source code is licensed under the MIT license found in the
  8. * LICENSE file in the root directory of this source tree.
  9. */var NT;function Lk(){if(NT)return nf;NT=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(n,i,a){var s=null;if(a!==void 0&&(s=""+a),i.key!==void 0&&(s=""+i.key),"key"in i){a={};for(var o in i)o!=="key"&&(a[o]=i[o])}else a=i;return i=a.ref,{$$typeof:r,type:n,key:s,ref:i!==void 0?i:null,props:a}}return nf.Fragment=e,nf.jsx=t,nf.jsxs=t,nf}var LT;function kk(){return LT||(LT=1,a1.exports=Lk()),a1.exports}var N=kk(),s1={exports:{}},Pt={};/**
  10. * @license React
  11. * react.production.js
  12. *
  13. * Copyright (c) Meta Platforms, Inc. and affiliates.
  14. *
  15. * This source code is licensed under the MIT license found in the
  16. * LICENSE file in the root directory of this source tree.
  17. */var kT;function Bk(){if(kT)return Pt;kT=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),s=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),v=Symbol.iterator;function g(L){return L===null||typeof L!="object"?null:(L=v&&L[v]||L["@@iterator"],typeof L=="function"?L:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,y={};function _(L,Y,G){this.props=L,this.context=Y,this.refs=y,this.updater=G||m}_.prototype.isReactComponent={},_.prototype.setState=function(L,Y){if(typeof L!="object"&&typeof L!="function"&&L!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,L,Y,"setState")},_.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function w(){}w.prototype=_.prototype;function S(L,Y,G){this.props=L,this.context=Y,this.refs=y,this.updater=G||m}var A=S.prototype=new w;A.constructor=S,x(A,_.prototype),A.isPureReactComponent=!0;var C=Array.isArray;function M(){}var E={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function D(L,Y,G){var re=G.ref;return{$$typeof:r,type:L,key:Y,ref:re!==void 0?re:null,props:G}}function I(L,Y){return D(L.type,Y,L.props)}function k(L){return typeof L=="object"&&L!==null&&L.$$typeof===r}function U(L){var Y={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(G){return Y[G]})}var V=/\/+/g;function X(L,Y){return typeof L=="object"&&L!==null&&L.key!=null?U(""+L.key):Y.toString(36)}function W(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(M,M):(L.status="pending",L.then(function(Y){L.status==="pending"&&(L.status="fulfilled",L.value=Y)},function(Y){L.status==="pending"&&(L.status="rejected",L.reason=Y)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function P(L,Y,G,re,ie){var le=typeof L;(le==="undefined"||le==="boolean")&&(L=null);var ce=!1;if(L===null)ce=!0;else switch(le){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(L.$$typeof){case r:case e:ce=!0;break;case h:return ce=L._init,P(ce(L._payload),Y,G,re,ie)}}if(ce)return ie=ie(L),ce=re===""?"."+X(L,0):re,C(ie)?(G="",ce!=null&&(G=ce.replace(V,"$&/")+"/"),P(ie,Y,G,"",function(ae){return ae})):ie!=null&&(k(ie)&&(ie=I(ie,G+(ie.key==null||L&&L.key===ie.key?"":(""+ie.key).replace(V,"$&/")+"/")+ce)),Y.push(ie)),1;ce=0;var _e=re===""?".":re+":";if(C(L))for(var pe=0;pe<L.length;pe++)re=L[pe],le=_e+X(re,pe),ce+=P(re,Y,G,le,ie);else if(pe=g(L),typeof pe=="function")for(L=pe.call(L),pe=0;!(re=L.next()).done;)re=re.value,le=_e+X(re,pe++),ce+=P(re,Y,G,le,ie);else if(le==="object"){if(typeof L.then=="function")return P(W(L),Y,G,re,ie);throw Y=String(L),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return ce}function H(L,Y,G){if(L==null)return L;var re=[],ie=0;return P(L,re,"","",function(le){return Y.call(G,le,ie++)}),re}function z(L){if(L._status===-1){var Y=L._result;Y=Y(),Y.then(function(G){(L._status===0||L._status===-1)&&(L._status=1,L._result=G)},function(G){(L._status===0||L._status===-1)&&(L._status=2,L._result=G)}),L._status===-1&&(L._status=0,L._result=Y)}if(L._status===1)return L._result.default;throw L._result}var $=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},B={map:H,forEach:function(L,Y,G){H(L,function(){Y.apply(this,arguments)},G)},count:function(L){var Y=0;return H(L,function(){Y++}),Y},toArray:function(L){return H(L,function(Y){return Y})||[]},only:function(L){if(!k(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return Pt.Activity=d,Pt.Children=B,Pt.Component=_,Pt.Fragment=t,Pt.Profiler=i,Pt.PureComponent=S,Pt.StrictMode=n,Pt.Suspense=l,Pt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=E,Pt.__COMPILER_RUNTIME={__proto__:null,c:function(L){return E.H.useMemoCache(L)}},Pt.cache=function(L){return function(){return L.apply(null,arguments)}},Pt.cacheSignal=function(){return null},Pt.cloneElement=function(L,Y,G){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var re=x({},L.props),ie=L.key;if(Y!=null)for(le in Y.key!==void 0&&(ie=""+Y.key),Y)!O.call(Y,le)||le==="key"||le==="__self"||le==="__source"||le==="ref"&&Y.ref===void 0||(re[le]=Y[le]);var le=arguments.length-2;if(le===1)re.children=G;else if(1<le){for(var ce=Array(le),_e=0;_e<le;_e++)ce[_e]=arguments[_e+2];re.children=ce}return D(L.type,ie,re)},Pt.createContext=function(L){return L={$$typeof:s,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:a,_context:L},L},Pt.createElement=function(L,Y,G){var re,ie={},le=null;if(Y!=null)for(re in Y.key!==void 0&&(le=""+Y.key),Y)O.call(Y,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(ie[re]=Y[re]);var ce=arguments.length-2;if(ce===1)ie.children=G;else if(1<ce){for(var _e=Array(ce),pe=0;pe<ce;pe++)_e[pe]=arguments[pe+2];ie.children=_e}if(L&&L.defaultProps)for(re in ce=L.defaultProps,ce)ie[re]===void 0&&(ie[re]=ce[re]);return D(L,le,ie)},Pt.createRef=function(){return{current:null}},Pt.forwardRef=function(L){return{$$typeof:o,render:L}},Pt.isValidElement=k,Pt.lazy=function(L){return{$$typeof:h,_payload:{_status:-1,_result:L},_init:z}},Pt.memo=function(L,Y){return{$$typeof:c,type:L,compare:Y===void 0?null:Y}},Pt.startTransition=function(L){var Y=E.T,G={};E.T=G;try{var re=L(),ie=E.S;ie!==null&&ie(G,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(M,$)}catch(le){$(le)}finally{Y!==null&&G.types!==null&&(Y.types=G.types),E.T=Y}},Pt.unstable_useCacheRefresh=function(){return E.H.useCacheRefresh()},Pt.use=function(L){return E.H.use(L)},Pt.useActionState=function(L,Y,G){return E.H.useActionState(L,Y,G)},Pt.useCallback=function(L,Y){return E.H.useCallback(L,Y)},Pt.useContext=function(L){return E.H.useContext(L)},Pt.useDebugValue=function(){},Pt.useDeferredValue=function(L,Y){return E.H.useDeferredValue(L,Y)},Pt.useEffect=function(L,Y){return E.H.useEffect(L,Y)},Pt.useEffectEvent=function(L){return E.H.useEffectEvent(L)},Pt.useId=function(){return E.H.useId()},Pt.useImperativeHandle=function(L,Y,G){return E.H.useImperativeHandle(L,Y,G)},Pt.useInsertionEffect=function(L,Y){return E.H.useInsertionEffect(L,Y)},Pt.useLayoutEffect=function(L,Y){return E.H.useLayoutEffect(L,Y)},Pt.useMemo=function(L,Y){return E.H.useMemo(L,Y)},Pt.useOptimistic=function(L,Y){return E.H.useOptimistic(L,Y)},Pt.useReducer=function(L,Y,G){return E.H.useReducer(L,Y,G)},Pt.useRef=function(L){return E.H.useRef(L)},Pt.useState=function(L){return E.H.useState(L)},Pt.useSyncExternalStore=function(L,Y,G){return E.H.useSyncExternalStore(L,Y,G)},Pt.useTransition=function(){return E.H.useTransition()},Pt.version="19.2.4",Pt}var BT;function B_(){return BT||(BT=1,s1.exports=Bk()),s1.exports}var he=B_();const p9=cl(he),Fk=Ik({__proto__:null,default:p9},[he]);var o1={exports:{}},af={},l1={exports:{}},u1={};/**
  18. * @license React
  19. * scheduler.production.js
  20. *
  21. * Copyright (c) Meta Platforms, Inc. and affiliates.
  22. *
  23. * This source code is licensed under the MIT license found in the
  24. * LICENSE file in the root directory of this source tree.
  25. */var FT;function zk(){return FT||(FT=1,(function(r){function e(P,H){var z=P.length;P.push(H);e:for(;0<z;){var $=z-1>>>1,B=P[$];if(0<i(B,H))P[$]=H,P[z]=B,z=$;else break e}}function t(P){return P.length===0?null:P[0]}function n(P){if(P.length===0)return null;var H=P[0],z=P.pop();if(z!==H){P[0]=z;e:for(var $=0,B=P.length,L=B>>>1;$<L;){var Y=2*($+1)-1,G=P[Y],re=Y+1,ie=P[re];if(0>i(G,z))re<B&&0>i(ie,G)?(P[$]=ie,P[re]=z,$=re):(P[$]=G,P[Y]=z,$=Y);else if(re<B&&0>i(ie,z))P[$]=ie,P[re]=z,$=re;else break e}}return H}function i(P,H){var z=P.sortIndex-H.sortIndex;return z!==0?z:P.id-H.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;r.unstable_now=function(){return a.now()}}else{var s=Date,o=s.now();r.unstable_now=function(){return s.now()-o}}var l=[],c=[],h=1,d=null,v=3,g=!1,m=!1,x=!1,y=!1,_=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function A(P){for(var H=t(c);H!==null;){if(H.callback===null)n(c);else if(H.startTime<=P)n(c),H.sortIndex=H.expirationTime,e(l,H);else break;H=t(c)}}function C(P){if(x=!1,A(P),!m)if(t(l)!==null)m=!0,M||(M=!0,U());else{var H=t(c);H!==null&&W(C,H.startTime-P)}}var M=!1,E=-1,O=5,D=-1;function I(){return y?!0:!(r.unstable_now()-D<O)}function k(){if(y=!1,M){var P=r.unstable_now();D=P;var H=!0;try{e:{m=!1,x&&(x=!1,w(E),E=-1),g=!0;var z=v;try{t:{for(A(P),d=t(l);d!==null&&!(d.expirationTime>P&&I());){var $=d.callback;if(typeof $=="function"){d.callback=null,v=d.priorityLevel;var B=$(d.expirationTime<=P);if(P=r.unstable_now(),typeof B=="function"){d.callback=B,A(P),H=!0;break t}d===t(l)&&n(l),A(P)}else n(l);d=t(l)}if(d!==null)H=!0;else{var L=t(c);L!==null&&W(C,L.startTime-P),H=!1}}break e}finally{d=null,v=z,g=!1}H=void 0}}finally{H?U():M=!1}}}var U;if(typeof S=="function")U=function(){S(k)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,X=V.port2;V.port1.onmessage=k,U=function(){X.postMessage(null)}}else U=function(){_(k,0)};function W(P,H){E=_(function(){P(r.unstable_now())},H)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(P){P.callback=null},r.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<P?Math.floor(1e3/P):5},r.unstable_getCurrentPriorityLevel=function(){return v},r.unstable_next=function(P){switch(v){case 1:case 2:case 3:var H=3;break;default:H=v}var z=v;v=H;try{return P()}finally{v=z}},r.unstable_requestPaint=function(){y=!0},r.unstable_runWithPriority=function(P,H){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var z=v;v=P;try{return H()}finally{v=z}},r.unstable_scheduleCallback=function(P,H,z){var $=r.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?$+z:$):z=$,P){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=z+B,P={id:h++,callback:H,priorityLevel:P,startTime:z,expirationTime:B,sortIndex:-1},z>$?(P.sortIndex=z,e(c,P),t(l)===null&&P===t(c)&&(x?(w(E),E=-1):x=!0,W(C,z-$))):(P.sortIndex=B,e(l,P),m||g||(m=!0,M||(M=!0,U()))),P},r.unstable_shouldYield=I,r.unstable_wrapCallback=function(P){var H=v;return function(){var z=v;v=H;try{return P.apply(this,arguments)}finally{v=z}}}})(u1)),u1}var zT;function Uk(){return zT||(zT=1,l1.exports=zk()),l1.exports}var c1={exports:{}},ei={};/**
  26. * @license React
  27. * react-dom.production.js
  28. *
  29. * Copyright (c) Meta Platforms, Inc. and affiliates.
  30. *
  31. * This source code is licensed under the MIT license found in the
  32. * LICENSE file in the root directory of this source tree.
  33. */var UT;function Gk(){if(UT)return ei;UT=1;var r=B_();function e(l){var c="https://react.dev/errors/"+l;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)c+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+l+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function t(){}var n={d:{f:t,r:function(){throw Error(e(522))},D:t,C:t,L:t,m:t,X:t,S:t,M:t},p:0,findDOMNode:null},i=Symbol.for("react.portal");function a(l,c,h){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:d==null?null:""+d,children:l,containerInfo:c,implementation:h}}var s=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(l,c){if(l==="font")return"";if(typeof c=="string")return c==="use-credentials"?c:""}return ei.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,ei.createPortal=function(l,c){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)throw Error(e(299));return a(l,c,null,h)},ei.flushSync=function(l){var c=s.T,h=n.p;try{if(s.T=null,n.p=2,l)return l()}finally{s.T=c,n.p=h,n.d.f()}},ei.preconnect=function(l,c){typeof l=="string"&&(c?(c=c.crossOrigin,c=typeof c=="string"?c==="use-credentials"?c:"":void 0):c=null,n.d.C(l,c))},ei.prefetchDNS=function(l){typeof l=="string"&&n.d.D(l)},ei.preinit=function(l,c){if(typeof l=="string"&&c&&typeof c.as=="string"){var h=c.as,d=o(h,c.crossOrigin),v=typeof c.integrity=="string"?c.integrity:void 0,g=typeof c.fetchPriority=="string"?c.fetchPriority:void 0;h==="style"?n.d.S(l,typeof c.precedence=="string"?c.precedence:void 0,{crossOrigin:d,integrity:v,fetchPriority:g}):h==="script"&&n.d.X(l,{crossOrigin:d,integrity:v,fetchPriority:g,nonce:typeof c.nonce=="string"?c.nonce:void 0})}},ei.preinitModule=function(l,c){if(typeof l=="string")if(typeof c=="object"&&c!==null){if(c.as==null||c.as==="script"){var h=o(c.as,c.crossOrigin);n.d.M(l,{crossOrigin:h,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0})}}else c==null&&n.d.M(l)},ei.preload=function(l,c){if(typeof l=="string"&&typeof c=="object"&&c!==null&&typeof c.as=="string"){var h=c.as,d=o(h,c.crossOrigin);n.d.L(l,h,{crossOrigin:d,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,type:typeof c.type=="string"?c.type:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0,referrerPolicy:typeof c.referrerPolicy=="string"?c.referrerPolicy:void 0,imageSrcSet:typeof c.imageSrcSet=="string"?c.imageSrcSet:void 0,imageSizes:typeof c.imageSizes=="string"?c.imageSizes:void 0,media:typeof c.media=="string"?c.media:void 0})}},ei.preloadModule=function(l,c){if(typeof l=="string")if(c){var h=o(c.as,c.crossOrigin);n.d.m(l,{as:typeof c.as=="string"&&c.as!=="script"?c.as:void 0,crossOrigin:h,integrity:typeof c.integrity=="string"?c.integrity:void 0})}else n.d.m(l)},ei.requestFormReset=function(l){n.d.r(l)},ei.unstable_batchedUpdates=function(l,c){return l(c)},ei.useFormState=function(l,c,h){return s.H.useFormState(l,c,h)},ei.useFormStatus=function(){return s.H.useHostTransitionStatus()},ei.version="19.2.4",ei}var GT;function g9(){if(GT)return c1.exports;GT=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}return r(),c1.exports=Gk(),c1.exports}/**
  34. * @license React
  35. * react-dom-client.production.js
  36. *
  37. * Copyright (c) Meta Platforms, Inc. and affiliates.
  38. *
  39. * This source code is licensed under the MIT license found in the
  40. * LICENSE file in the root directory of this source tree.
  41. */var HT;function Hk(){if(HT)return af;HT=1;var r=Uk(),e=B_(),t=g9();function n(u){var f="https://react.dev/errors/"+u;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+u+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(u){return!(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)}function a(u){var f=u,p=u;if(u.alternate)for(;f.return;)f=f.return;else{u=f;do f=u,(f.flags&4098)!==0&&(p=f.return),u=f.return;while(u)}return f.tag===3?p:null}function s(u){if(u.tag===13){var f=u.memoizedState;if(f===null&&(u=u.alternate,u!==null&&(f=u.memoizedState)),f!==null)return f.dehydrated}return null}function o(u){if(u.tag===31){var f=u.memoizedState;if(f===null&&(u=u.alternate,u!==null&&(f=u.memoizedState)),f!==null)return f.dehydrated}return null}function l(u){if(a(u)!==u)throw Error(n(188))}function c(u){var f=u.alternate;if(!f){if(f=a(u),f===null)throw Error(n(188));return f!==u?null:u}for(var p=u,b=f;;){var T=p.return;if(T===null)break;var R=T.alternate;if(R===null){if(b=T.return,b!==null){p=b;continue}break}if(T.child===R.child){for(R=T.child;R;){if(R===p)return l(T),u;if(R===b)return l(T),f;R=R.sibling}throw Error(n(188))}if(p.return!==b.return)p=T,b=R;else{for(var q=!1,Z=T.child;Z;){if(Z===p){q=!0,p=T,b=R;break}if(Z===b){q=!0,b=T,p=R;break}Z=Z.sibling}if(!q){for(Z=R.child;Z;){if(Z===p){q=!0,p=R,b=T;break}if(Z===b){q=!0,b=R,p=T;break}Z=Z.sibling}if(!q)throw Error(n(189))}}if(p.alternate!==b)throw Error(n(190))}if(p.tag!==3)throw Error(n(188));return p.stateNode.current===p?u:f}function h(u){var f=u.tag;if(f===5||f===26||f===27||f===6)return u;for(u=u.child;u!==null;){if(f=h(u),f!==null)return f;u=u.sibling}return null}var d=Object.assign,v=Symbol.for("react.element"),g=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),S=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),D=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),k=Symbol.iterator;function U(u){return u===null||typeof u!="object"?null:(u=k&&u[k]||u["@@iterator"],typeof u=="function"?u:null)}var V=Symbol.for("react.client.reference");function X(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===V?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case x:return"Fragment";case _:return"Profiler";case y:return"StrictMode";case C:return"Suspense";case M:return"SuspenseList";case D:return"Activity"}if(typeof u=="object")switch(u.$$typeof){case m:return"Portal";case S:return u.displayName||"Context";case w:return(u._context.displayName||"Context")+".Consumer";case A:var f=u.render;return u=u.displayName,u||(u=f.displayName||f.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case E:return f=u.displayName||null,f!==null?f:X(u.type)||"Memo";case O:f=u._payload,u=u._init;try{return X(u(f))}catch{}}return null}var W=Array.isArray,P=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},$=[],B=-1;function L(u){return{current:u}}function Y(u){0>B||(u.current=$[B],$[B]=null,B--)}function G(u,f){B++,$[B]=u.current,u.current=f}var re=L(null),ie=L(null),le=L(null),ce=L(null);function _e(u,f){switch(G(le,f),G(ie,u),G(re,null),f.nodeType){case 9:case 11:u=(u=f.documentElement)&&(u=u.namespaceURI)?nT(u):0;break;default:if(u=f.tagName,f=f.namespaceURI)f=nT(f),u=iT(f,u);else switch(u){case"svg":u=1;break;case"math":u=2;break;default:u=0}}Y(re),G(re,u)}function pe(){Y(re),Y(ie),Y(le)}function ae(u){u.memoizedState!==null&&G(ce,u);var f=re.current,p=iT(f,u.type);f!==p&&(G(ie,u),G(re,p))}function oe(u){ie.current===u&&(Y(re),Y(ie)),ce.current===u&&(Y(ce),Jh._currentValue=z)}var de,ye;function Ee(u){if(de===void 0)try{throw Error()}catch(p){var f=p.stack.trim().match(/\n( *(at )?)/);de=f&&f[1]||"",ye=-1<p.stack.indexOf(`
  42. at`)?" (<anonymous>)":-1<p.stack.indexOf("@")?"@unknown:0:0":""}return`
  43. `+de+u+ye}var Re=!1;function Ne(u,f){if(!u||Re)return"";Re=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var b={DetermineComponentFrameRoot:function(){try{if(f){var ze=function(){throw Error()};if(Object.defineProperty(ze.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ze,[])}catch(Ie){var Me=Ie}Reflect.construct(u,[],ze)}else{try{ze.call()}catch(Ie){Me=Ie}u.call(ze.prototype)}}else{try{throw Error()}catch(Ie){Me=Ie}(ze=u())&&typeof ze.catch=="function"&&ze.catch(function(){})}}catch(Ie){if(Ie&&Me&&typeof Ie.stack=="string")return[Ie.stack,Me.stack]}return[null,null]}};b.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var T=Object.getOwnPropertyDescriptor(b.DetermineComponentFrameRoot,"name");T&&T.configurable&&Object.defineProperty(b.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var R=b.DetermineComponentFrameRoot(),q=R[0],Z=R[1];if(q&&Z){var ve=q.split(`
  44. `),Ce=Z.split(`
  45. `);for(T=b=0;b<ve.length&&!ve[b].includes("DetermineComponentFrameRoot");)b++;for(;T<Ce.length&&!Ce[T].includes("DetermineComponentFrameRoot");)T++;if(b===ve.length||T===Ce.length)for(b=ve.length-1,T=Ce.length-1;1<=b&&0<=T&&ve[b]!==Ce[T];)T--;for(;1<=b&&0<=T;b--,T--)if(ve[b]!==Ce[T]){if(b!==1||T!==1)do if(b--,T--,0>T||ve[b]!==Ce[T]){var Le=`
  46. `+ve[b].replace(" at new "," at ");return u.displayName&&Le.includes("<anonymous>")&&(Le=Le.replace("<anonymous>",u.displayName)),Le}while(1<=b&&0<=T);break}}}finally{Re=!1,Error.prepareStackTrace=p}return(p=u?u.displayName||u.name:"")?Ee(p):""}function Be(u,f){switch(u.tag){case 26:case 27:case 5:return Ee(u.type);case 16:return Ee("Lazy");case 13:return u.child!==f&&f!==null?Ee("Suspense Fallback"):Ee("Suspense");case 19:return Ee("SuspenseList");case 0:case 15:return Ne(u.type,!1);case 11:return Ne(u.type.render,!1);case 1:return Ne(u.type,!0);case 31:return Ee("Activity");default:return""}}function $e(u){try{var f="",p=null;do f+=Be(u,p),p=u,u=u.return;while(u);return f}catch(b){return`
  47. Error generating stack: `+b.message+`
  48. `+b.stack}}var Ye=Object.prototype.hasOwnProperty,He=r.unstable_scheduleCallback,tt=r.unstable_cancelCallback,ot=r.unstable_shouldYield,ct=r.unstable_requestPaint,Ze=r.unstable_now,bt=r.unstable_getCurrentPriorityLevel,Se=r.unstable_ImmediatePriority,ke=r.unstable_UserBlockingPriority,We=r.unstable_NormalPriority,Ke=r.unstable_LowPriority,rt=r.unstable_IdlePriority,nt=r.log,De=r.unstable_setDisableYieldValue,Q=null,ne=null;function be(u){if(typeof nt=="function"&&De(u),ne&&typeof ne.setStrictMode=="function")try{ne.setStrictMode(Q,u)}catch{}}var ee=Math.clz32?Math.clz32:Ae,se=Math.log,Pe=Math.LN2;function Ae(u){return u>>>=0,u===0?32:31-(se(u)/Pe|0)|0}var Ge=256,J=262144,Oe=4194304;function Ve(u){var f=u&42;if(f!==0)return f;switch(u&-u){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return u&261888;case 262144:case 524288:case 1048576:case 2097152:return u&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return u&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return u}}function Ue(u,f,p){var b=u.pendingLanes;if(b===0)return 0;var T=0,R=u.suspendedLanes,q=u.pingedLanes;u=u.warmLanes;var Z=b&134217727;return Z!==0?(b=Z&~R,b!==0?T=Ve(b):(q&=Z,q!==0?T=Ve(q):p||(p=Z&~u,p!==0&&(T=Ve(p))))):(Z=b&~R,Z!==0?T=Ve(Z):q!==0?T=Ve(q):p||(p=b&~u,p!==0&&(T=Ve(p)))),T===0?0:f!==0&&f!==T&&(f&R)===0&&(R=T&-T,p=f&-f,R>=p||R===32&&(p&4194048)!==0)?f:T}function je(u,f){return(u.pendingLanes&~(u.suspendedLanes&~u.pingedLanes)&f)===0}function yt(u,f){switch(u){case 1:case 2:case 4:case 8:case 64:return f+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return f+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function vt(){var u=Oe;return Oe<<=1,(Oe&62914560)===0&&(Oe=4194304),u}function Ot(u){for(var f=[],p=0;31>p;p++)f.push(u);return f}function jt(u,f){u.pendingLanes|=f,f!==268435456&&(u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0)}function Nr(u,f,p,b,T,R){var q=u.pendingLanes;u.pendingLanes=p,u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0,u.expiredLanes&=p,u.entangledLanes&=p,u.errorRecoveryDisabledLanes&=p,u.shellSuspendCounter=0;var Z=u.entanglements,ve=u.expirationTimes,Ce=u.hiddenUpdates;for(p=q&~p;0<p;){var Le=31-ee(p),ze=1<<Le;Z[Le]=0,ve[Le]=-1;var Me=Ce[Le];if(Me!==null)for(Ce[Le]=null,Le=0;Le<Me.length;Le++){var Ie=Me[Le];Ie!==null&&(Ie.lane&=-536870913)}p&=~ze}b!==0&&Vt(u,b,0),R!==0&&T===0&&u.tag!==0&&(u.suspendedLanes|=R&~(q&~f))}function Vt(u,f,p){u.pendingLanes|=f,u.suspendedLanes&=~f;var b=31-ee(f);u.entangledLanes|=f,u.entanglements[b]=u.entanglements[b]|1073741824|p&261930}function Qt(u,f){var p=u.entangledLanes|=f;for(u=u.entanglements;p;){var b=31-ee(p),T=1<<b;T&f|u[b]&f&&(u[b]|=f),p&=~T}}function rr(u,f){var p=f&-f;return p=(p&42)!==0?1:ur(p),(p&(u.suspendedLanes|f))!==0?0:p}function ur(u){switch(u){case 2:u=1;break;case 8:u=4;break;case 32:u=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:u=128;break;case 268435456:u=134217728;break;default:u=0}return u}function In(u){return u&=-u,2<u?8<u?(u&134217727)!==0?32:268435456:8:2}function vr(){var u=H.p;return u!==0?u:(u=window.event,u===void 0?32:AT(u.type))}function Gn(u,f){var p=H.p;try{return H.p=u,f()}finally{H.p=p}}var Yr=Math.random().toString(36).slice(2),nr="__reactFiber$"+Yr,Lr="__reactProps$"+Yr,cn="__reactContainer$"+Yr,Ur="__reactEvents$"+Yr,Wr="__reactListeners$"+Yr,xe="__reactHandles$"+Yr,st="__reactResources$"+Yr,lt="__reactMarker$"+Yr;function Ut(u){delete u[nr],delete u[Lr],delete u[Ur],delete u[Wr],delete u[xe]}function br(u){var f=u[nr];if(f)return f;for(var p=u.parentNode;p;){if(f=p[cn]||p[nr]){if(p=f.alternate,f.child!==null||p!==null&&p.child!==null)for(u=hT(u);u!==null;){if(p=u[nr])return p;u=hT(u)}return f}u=p,p=u.parentNode}return null}function hn(u){if(u=u[nr]||u[cn]){var f=u.tag;if(f===5||f===6||f===13||f===31||f===26||f===27||f===3)return u}return null}function Ii(u){var f=u.tag;if(f===5||f===26||f===27||f===6)return u.stateNode;throw Error(n(33))}function Zn(u){var f=u[st];return f||(f=u[st]={hoistableStyles:new Map,hoistableScripts:new Map}),f}function cr(u){u[lt]=!0}var ds=new Set,to={};function nn(u,f){Qn(u,f),Qn(u+"Capture",f)}function Qn(u,f){for(to[u]=f,u=0;u<f.length;u++)ds.add(f[u])}var Ba=RegExp("^[: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]*$"),bl={},ph={};function Zg(u){return Ye.call(ph,u)?!0:Ye.call(bl,u)?!1:Ba.test(u)?ph[u]=!0:(bl[u]=!0,!1)}function Jn(u,f,p){if(Zg(f))if(p===null)u.removeAttribute(f);else{switch(typeof p){case"undefined":case"function":case"symbol":u.removeAttribute(f);return;case"boolean":var b=f.toLowerCase().slice(0,5);if(b!=="data-"&&b!=="aria-"){u.removeAttribute(f);return}}u.setAttribute(f,""+p)}}function ro(u,f,p){if(p===null)u.removeAttribute(f);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":u.removeAttribute(f);return}u.setAttribute(f,""+p)}}function Ki(u,f,p,b){if(b===null)u.removeAttribute(p);else{switch(typeof b){case"undefined":case"function":case"symbol":case"boolean":u.removeAttribute(p);return}u.setAttributeNS(f,p,""+b)}}function Nn(u){switch(typeof u){case"bigint":case"boolean":case"number":case"string":case"undefined":return u;case"object":return u;default:return""}}function gi(u){var f=u.type;return(u=u.nodeName)&&u.toLowerCase()==="input"&&(f==="checkbox"||f==="radio")}function Qg(u,f,p){var b=Object.getOwnPropertyDescriptor(u.constructor.prototype,f);if(!u.hasOwnProperty(f)&&typeof b<"u"&&typeof b.get=="function"&&typeof b.set=="function"){var T=b.get,R=b.set;return Object.defineProperty(u,f,{configurable:!0,get:function(){return T.call(this)},set:function(q){p=""+q,R.call(this,q)}}),Object.defineProperty(u,f,{enumerable:b.enumerable}),{getValue:function(){return p},setValue:function(q){p=""+q},stopTracking:function(){u._valueTracker=null,delete u[f]}}}}function jd(u){if(!u._valueTracker){var f=gi(u)?"checked":"value";u._valueTracker=Qg(u,f,""+u[f])}}function Vd(u){if(!u)return!1;var f=u._valueTracker;if(!f)return!0;var p=f.getValue(),b="";return u&&(b=gi(u)?u.checked?"true":"false":u.value),u=b,u!==p?(f.setValue(u),!0):!1}function qd(u){if(u=u||(typeof document<"u"?document:void 0),typeof u>"u")return null;try{return u.activeElement||u.body}catch{return u.body}}var AN=/[\n"\\]/g;function Zi(u){return u.replace(AN,function(f){return"\\"+f.charCodeAt(0).toString(16)+" "})}function Jg(u,f,p,b,T,R,q,Z){u.name="",q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?u.type=q:u.removeAttribute("type"),f!=null?q==="number"?(f===0&&u.value===""||u.value!=f)&&(u.value=""+Nn(f)):u.value!==""+Nn(f)&&(u.value=""+Nn(f)):q!=="submit"&&q!=="reset"||u.removeAttribute("value"),f!=null?em(u,q,Nn(f)):p!=null?em(u,q,Nn(p)):b!=null&&u.removeAttribute("value"),T==null&&R!=null&&(u.defaultChecked=!!R),T!=null&&(u.checked=T&&typeof T!="function"&&typeof T!="symbol"),Z!=null&&typeof Z!="function"&&typeof Z!="symbol"&&typeof Z!="boolean"?u.name=""+Nn(Z):u.removeAttribute("name")}function Z3(u,f,p,b,T,R,q,Z){if(R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(u.type=R),f!=null||p!=null){if(!(R!=="submit"&&R!=="reset"||f!=null)){jd(u);return}p=p!=null?""+Nn(p):"",f=f!=null?""+Nn(f):p,Z||f===u.value||(u.value=f),u.defaultValue=f}b=b??T,b=typeof b!="function"&&typeof b!="symbol"&&!!b,u.checked=Z?u.checked:!!b,u.defaultChecked=!!b,q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"&&(u.name=q),jd(u)}function em(u,f,p){f==="number"&&qd(u.ownerDocument)===u||u.defaultValue===""+p||(u.defaultValue=""+p)}function Au(u,f,p,b){if(u=u.options,f){f={};for(var T=0;T<p.length;T++)f["$"+p[T]]=!0;for(p=0;p<u.length;p++)T=f.hasOwnProperty("$"+u[p].value),u[p].selected!==T&&(u[p].selected=T),T&&b&&(u[p].defaultSelected=!0)}else{for(p=""+Nn(p),f=null,T=0;T<u.length;T++){if(u[T].value===p){u[T].selected=!0,b&&(u[T].defaultSelected=!0);return}f!==null||u[T].disabled||(f=u[T])}f!==null&&(f.selected=!0)}}function Q3(u,f,p){if(f!=null&&(f=""+Nn(f),f!==u.value&&(u.value=f),p==null)){u.defaultValue!==f&&(u.defaultValue=f);return}u.defaultValue=p!=null?""+Nn(p):""}function J3(u,f,p,b){if(f==null){if(b!=null){if(p!=null)throw Error(n(92));if(W(b)){if(1<b.length)throw Error(n(93));b=b[0]}p=b}p==null&&(p=""),f=p}p=Nn(f),u.defaultValue=p,b=u.textContent,b===p&&b!==""&&b!==null&&(u.value=b),jd(u)}function Mu(u,f){if(f){var p=u.firstChild;if(p&&p===u.lastChild&&p.nodeType===3){p.nodeValue=f;return}}u.textContent=f}var MN=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function e5(u,f,p){var b=f.indexOf("--")===0;p==null||typeof p=="boolean"||p===""?b?u.setProperty(f,""):f==="float"?u.cssFloat="":u[f]="":b?u.setProperty(f,p):typeof p!="number"||p===0||MN.has(f)?f==="float"?u.cssFloat=p:u[f]=(""+p).trim():u[f]=p+"px"}function t5(u,f,p){if(f!=null&&typeof f!="object")throw Error(n(62));if(u=u.style,p!=null){for(var b in p)!p.hasOwnProperty(b)||f!=null&&f.hasOwnProperty(b)||(b.indexOf("--")===0?u.setProperty(b,""):b==="float"?u.cssFloat="":u[b]="");for(var T in f)b=f[T],f.hasOwnProperty(T)&&p[T]!==b&&e5(u,T,b)}else for(var R in f)f.hasOwnProperty(R)&&e5(u,R,f[R])}function tm(u){if(u.indexOf("-")===-1)return!1;switch(u){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!1;default:return!0}}var RN=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),ON=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Xd(u){return ON.test(""+u)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":u}function vs(){}var rm=null;function nm(u){return u=u.target||u.srcElement||window,u.correspondingUseElement&&(u=u.correspondingUseElement),u.nodeType===3?u.parentNode:u}var Ru=null,Ou=null;function r5(u){var f=hn(u);if(f&&(u=f.stateNode)){var p=u[Lr]||null;e:switch(u=f.stateNode,f.type){case"input":if(Jg(u,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name),f=p.name,p.type==="radio"&&f!=null){for(p=u;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll('input[name="'+Zi(""+f)+'"][type="radio"]'),f=0;f<p.length;f++){var b=p[f];if(b!==u&&b.form===u.form){var T=b[Lr]||null;if(!T)throw Error(n(90));Jg(b,T.value,T.defaultValue,T.defaultValue,T.checked,T.defaultChecked,T.type,T.name)}}for(f=0;f<p.length;f++)b=p[f],b.form===u.form&&Vd(b)}break e;case"textarea":Q3(u,p.value,p.defaultValue);break e;case"select":f=p.value,f!=null&&Au(u,!!p.multiple,f,!1)}}}var im=!1;function n5(u,f,p){if(im)return u(f,p);im=!0;try{var b=u(f);return b}finally{if(im=!1,(Ru!==null||Ou!==null)&&(I0(),Ru&&(f=Ru,u=Ou,Ou=Ru=null,r5(f),u)))for(f=0;f<u.length;f++)r5(u[f])}}function gh(u,f){var p=u.stateNode;if(p===null)return null;var b=p[Lr]||null;if(b===null)return null;p=b[f];e:switch(f){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(b=!b.disabled)||(u=u.type,b=!(u==="button"||u==="input"||u==="select"||u==="textarea")),u=!b;break e;default:u=!1}if(u)return null;if(p&&typeof p!="function")throw Error(n(231,f,typeof p));return p}var ps=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),am=!1;if(ps)try{var mh={};Object.defineProperty(mh,"passive",{get:function(){am=!0}}),window.addEventListener("test",mh,mh),window.removeEventListener("test",mh,mh)}catch{am=!1}var no=null,sm=null,Yd=null;function i5(){if(Yd)return Yd;var u,f=sm,p=f.length,b,T="value"in no?no.value:no.textContent,R=T.length;for(u=0;u<p&&f[u]===T[u];u++);var q=p-u;for(b=1;b<=q&&f[p-b]===T[R-b];b++);return Yd=T.slice(u,1<b?1-b:void 0)}function Wd(u){var f=u.keyCode;return"charCode"in u?(u=u.charCode,u===0&&f===13&&(u=13)):u=f,u===10&&(u=13),32<=u||u===13?u:0}function $d(){return!0}function a5(){return!1}function mi(u){function f(p,b,T,R,q){this._reactName=p,this._targetInst=T,this.type=b,this.nativeEvent=R,this.target=q,this.currentTarget=null;for(var Z in u)u.hasOwnProperty(Z)&&(p=u[Z],this[Z]=p?p(R):R[Z]);return this.isDefaultPrevented=(R.defaultPrevented!=null?R.defaultPrevented:R.returnValue===!1)?$d:a5,this.isPropagationStopped=a5,this}return d(f.prototype,{preventDefault:function(){this.defaultPrevented=!0;var p=this.nativeEvent;p&&(p.preventDefault?p.preventDefault():typeof p.returnValue!="unknown"&&(p.returnValue=!1),this.isDefaultPrevented=$d)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=$d)},persist:function(){},isPersistent:$d}),f}var xl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(u){return u.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Kd=mi(xl),yh=d({},xl,{view:0,detail:0}),DN=mi(yh),om,lm,bh,Zd=d({},yh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cm,button:0,buttons:0,relatedTarget:function(u){return u.relatedTarget===void 0?u.fromElement===u.srcElement?u.toElement:u.fromElement:u.relatedTarget},movementX:function(u){return"movementX"in u?u.movementX:(u!==bh&&(bh&&u.type==="mousemove"?(om=u.screenX-bh.screenX,lm=u.screenY-bh.screenY):lm=om=0,bh=u),om)},movementY:function(u){return"movementY"in u?u.movementY:lm}}),s5=mi(Zd),PN=d({},Zd,{dataTransfer:0}),IN=mi(PN),NN=d({},yh,{relatedTarget:0}),um=mi(NN),LN=d({},xl,{animationName:0,elapsedTime:0,pseudoElement:0}),kN=mi(LN),BN=d({},xl,{clipboardData:function(u){return"clipboardData"in u?u.clipboardData:window.clipboardData}}),FN=mi(BN),zN=d({},xl,{data:0}),o5=mi(zN),UN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},GN={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},HN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jN(u){var f=this.nativeEvent;return f.getModifierState?f.getModifierState(u):(u=HN[u])?!!f[u]:!1}function cm(){return jN}var VN=d({},yh,{key:function(u){if(u.key){var f=UN[u.key]||u.key;if(f!=="Unidentified")return f}return u.type==="keypress"?(u=Wd(u),u===13?"Enter":String.fromCharCode(u)):u.type==="keydown"||u.type==="keyup"?GN[u.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cm,charCode:function(u){return u.type==="keypress"?Wd(u):0},keyCode:function(u){return u.type==="keydown"||u.type==="keyup"?u.keyCode:0},which:function(u){return u.type==="keypress"?Wd(u):u.type==="keydown"||u.type==="keyup"?u.keyCode:0}}),qN=mi(VN),XN=d({},Zd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),l5=mi(XN),YN=d({},yh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cm}),WN=mi(YN),$N=d({},xl,{propertyName:0,elapsedTime:0,pseudoElement:0}),KN=mi($N),ZN=d({},Zd,{deltaX:function(u){return"deltaX"in u?u.deltaX:"wheelDeltaX"in u?-u.wheelDeltaX:0},deltaY:function(u){return"deltaY"in u?u.deltaY:"wheelDeltaY"in u?-u.wheelDeltaY:"wheelDelta"in u?-u.wheelDelta:0},deltaZ:0,deltaMode:0}),QN=mi(ZN),JN=d({},xl,{newState:0,oldState:0}),eL=mi(JN),tL=[9,13,27,32],hm=ps&&"CompositionEvent"in window,xh=null;ps&&"documentMode"in document&&(xh=document.documentMode);var rL=ps&&"TextEvent"in window&&!xh,u5=ps&&(!hm||xh&&8<xh&&11>=xh),c5=" ",h5=!1;function f5(u,f){switch(u){case"keyup":return tL.indexOf(f.keyCode)!==-1;case"keydown":return f.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function d5(u){return u=u.detail,typeof u=="object"&&"data"in u?u.data:null}var Du=!1;function nL(u,f){switch(u){case"compositionend":return d5(f);case"keypress":return f.which!==32?null:(h5=!0,c5);case"textInput":return u=f.data,u===c5&&h5?null:u;default:return null}}function iL(u,f){if(Du)return u==="compositionend"||!hm&&f5(u,f)?(u=i5(),Yd=sm=no=null,Du=!1,u):null;switch(u){case"paste":return null;case"keypress":if(!(f.ctrlKey||f.altKey||f.metaKey)||f.ctrlKey&&f.altKey){if(f.char&&1<f.char.length)return f.char;if(f.which)return String.fromCharCode(f.which)}return null;case"compositionend":return u5&&f.locale!=="ko"?null:f.data;default:return null}}var aL={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function v5(u){var f=u&&u.nodeName&&u.nodeName.toLowerCase();return f==="input"?!!aL[u.type]:f==="textarea"}function p5(u,f,p,b){Ru?Ou?Ou.push(b):Ou=[b]:Ru=b,f=U0(f,"onChange"),0<f.length&&(p=new Kd("onChange","change",null,p,b),u.push({event:p,listeners:f}))}var _h=null,wh=null;function sL(u){ZE(u,0)}function Qd(u){var f=Ii(u);if(Vd(f))return u}function g5(u,f){if(u==="change")return f}var m5=!1;if(ps){var fm;if(ps){var dm="oninput"in document;if(!dm){var y5=document.createElement("div");y5.setAttribute("oninput","return;"),dm=typeof y5.oninput=="function"}fm=dm}else fm=!1;m5=fm&&(!document.documentMode||9<document.documentMode)}function b5(){_h&&(_h.detachEvent("onpropertychange",x5),wh=_h=null)}function x5(u){if(u.propertyName==="value"&&Qd(wh)){var f=[];p5(f,wh,u,nm(u)),n5(sL,f)}}function oL(u,f,p){u==="focusin"?(b5(),_h=f,wh=p,_h.attachEvent("onpropertychange",x5)):u==="focusout"&&b5()}function lL(u){if(u==="selectionchange"||u==="keyup"||u==="keydown")return Qd(wh)}function uL(u,f){if(u==="click")return Qd(f)}function cL(u,f){if(u==="input"||u==="change")return Qd(f)}function hL(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var Ni=typeof Object.is=="function"?Object.is:hL;function Sh(u,f){if(Ni(u,f))return!0;if(typeof u!="object"||u===null||typeof f!="object"||f===null)return!1;var p=Object.keys(u),b=Object.keys(f);if(p.length!==b.length)return!1;for(b=0;b<p.length;b++){var T=p[b];if(!Ye.call(f,T)||!Ni(u[T],f[T]))return!1}return!0}function _5(u){for(;u&&u.firstChild;)u=u.firstChild;return u}function w5(u,f){var p=_5(u);u=0;for(var b;p;){if(p.nodeType===3){if(b=u+p.textContent.length,u<=f&&b>=f)return{node:p,offset:f-u};u=b}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=_5(p)}}function S5(u,f){return u&&f?u===f?!0:u&&u.nodeType===3?!1:f&&f.nodeType===3?S5(u,f.parentNode):"contains"in u?u.contains(f):u.compareDocumentPosition?!!(u.compareDocumentPosition(f)&16):!1:!1}function E5(u){u=u!=null&&u.ownerDocument!=null&&u.ownerDocument.defaultView!=null?u.ownerDocument.defaultView:window;for(var f=qd(u.document);f instanceof u.HTMLIFrameElement;){try{var p=typeof f.contentWindow.location.href=="string"}catch{p=!1}if(p)u=f.contentWindow;else break;f=qd(u.document)}return f}function vm(u){var f=u&&u.nodeName&&u.nodeName.toLowerCase();return f&&(f==="input"&&(u.type==="text"||u.type==="search"||u.type==="tel"||u.type==="url"||u.type==="password")||f==="textarea"||u.contentEditable==="true")}var fL=ps&&"documentMode"in document&&11>=document.documentMode,Pu=null,pm=null,Eh=null,gm=!1;function T5(u,f,p){var b=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;gm||Pu==null||Pu!==qd(b)||(b=Pu,"selectionStart"in b&&vm(b)?b={start:b.selectionStart,end:b.selectionEnd}:(b=(b.ownerDocument&&b.ownerDocument.defaultView||window).getSelection(),b={anchorNode:b.anchorNode,anchorOffset:b.anchorOffset,focusNode:b.focusNode,focusOffset:b.focusOffset}),Eh&&Sh(Eh,b)||(Eh=b,b=U0(pm,"onSelect"),0<b.length&&(f=new Kd("onSelect","select",null,f,p),u.push({event:f,listeners:b}),f.target=Pu)))}function _l(u,f){var p={};return p[u.toLowerCase()]=f.toLowerCase(),p["Webkit"+u]="webkit"+f,p["Moz"+u]="moz"+f,p}var Iu={animationend:_l("Animation","AnimationEnd"),animationiteration:_l("Animation","AnimationIteration"),animationstart:_l("Animation","AnimationStart"),transitionrun:_l("Transition","TransitionRun"),transitionstart:_l("Transition","TransitionStart"),transitioncancel:_l("Transition","TransitionCancel"),transitionend:_l("Transition","TransitionEnd")},mm={},C5={};ps&&(C5=document.createElement("div").style,"AnimationEvent"in window||(delete Iu.animationend.animation,delete Iu.animationiteration.animation,delete Iu.animationstart.animation),"TransitionEvent"in window||delete Iu.transitionend.transition);function wl(u){if(mm[u])return mm[u];if(!Iu[u])return u;var f=Iu[u],p;for(p in f)if(f.hasOwnProperty(p)&&p in C5)return mm[u]=f[p];return u}var A5=wl("animationend"),M5=wl("animationiteration"),R5=wl("animationstart"),dL=wl("transitionrun"),vL=wl("transitionstart"),pL=wl("transitioncancel"),O5=wl("transitionend"),D5=new Map,ym="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");ym.push("scrollEnd");function Sa(u,f){D5.set(u,f),nn(f,[u])}var Jd=typeof reportError=="function"?reportError:function(u){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var f=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof u=="object"&&u!==null&&typeof u.message=="string"?String(u.message):String(u),error:u});if(!window.dispatchEvent(f))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",u);return}console.error(u)},Qi=[],Nu=0,bm=0;function e0(){for(var u=Nu,f=bm=Nu=0;f<u;){var p=Qi[f];Qi[f++]=null;var b=Qi[f];Qi[f++]=null;var T=Qi[f];Qi[f++]=null;var R=Qi[f];if(Qi[f++]=null,b!==null&&T!==null){var q=b.pending;q===null?T.next=T:(T.next=q.next,q.next=T),b.pending=T}R!==0&&P5(p,T,R)}}function t0(u,f,p,b){Qi[Nu++]=u,Qi[Nu++]=f,Qi[Nu++]=p,Qi[Nu++]=b,bm|=b,u.lanes|=b,u=u.alternate,u!==null&&(u.lanes|=b)}function xm(u,f,p,b){return t0(u,f,p,b),r0(u)}function Sl(u,f){return t0(u,null,null,f),r0(u)}function P5(u,f,p){u.lanes|=p;var b=u.alternate;b!==null&&(b.lanes|=p);for(var T=!1,R=u.return;R!==null;)R.childLanes|=p,b=R.alternate,b!==null&&(b.childLanes|=p),R.tag===22&&(u=R.stateNode,u===null||u._visibility&1||(T=!0)),u=R,R=R.return;return u.tag===3?(R=u.stateNode,T&&f!==null&&(T=31-ee(p),u=R.hiddenUpdates,b=u[T],b===null?u[T]=[f]:b.push(f),f.lane=p|536870912),R):null}function r0(u){if(50<Xh)throw Xh=0,Ry=null,Error(n(185));for(var f=u.return;f!==null;)u=f,f=u.return;return u.tag===3?u.stateNode:null}var Lu={};function gL(u,f,p,b){this.tag=u,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=b,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Li(u,f,p,b){return new gL(u,f,p,b)}function _m(u){return u=u.prototype,!(!u||!u.isReactComponent)}function gs(u,f){var p=u.alternate;return p===null?(p=Li(u.tag,f,u.key,u.mode),p.elementType=u.elementType,p.type=u.type,p.stateNode=u.stateNode,p.alternate=u,u.alternate=p):(p.pendingProps=f,p.type=u.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=u.flags&65011712,p.childLanes=u.childLanes,p.lanes=u.lanes,p.child=u.child,p.memoizedProps=u.memoizedProps,p.memoizedState=u.memoizedState,p.updateQueue=u.updateQueue,f=u.dependencies,p.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},p.sibling=u.sibling,p.index=u.index,p.ref=u.ref,p.refCleanup=u.refCleanup,p}function I5(u,f){u.flags&=65011714;var p=u.alternate;return p===null?(u.childLanes=0,u.lanes=f,u.child=null,u.subtreeFlags=0,u.memoizedProps=null,u.memoizedState=null,u.updateQueue=null,u.dependencies=null,u.stateNode=null):(u.childLanes=p.childLanes,u.lanes=p.lanes,u.child=p.child,u.subtreeFlags=0,u.deletions=null,u.memoizedProps=p.memoizedProps,u.memoizedState=p.memoizedState,u.updateQueue=p.updateQueue,u.type=p.type,f=p.dependencies,u.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext}),u}function n0(u,f,p,b,T,R){var q=0;if(b=u,typeof u=="function")_m(u)&&(q=1);else if(typeof u=="string")q=_k(u,p,re.current)?26:u==="html"||u==="head"||u==="body"?27:5;else e:switch(u){case D:return u=Li(31,p,f,T),u.elementType=D,u.lanes=R,u;case x:return El(p.children,T,R,f);case y:q=8,T|=24;break;case _:return u=Li(12,p,f,T|2),u.elementType=_,u.lanes=R,u;case C:return u=Li(13,p,f,T),u.elementType=C,u.lanes=R,u;case M:return u=Li(19,p,f,T),u.elementType=M,u.lanes=R,u;default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case S:q=10;break e;case w:q=9;break e;case A:q=11;break e;case E:q=14;break e;case O:q=16,b=null;break e}q=29,p=Error(n(130,u===null?"null":typeof u,"")),b=null}return f=Li(q,p,f,T),f.elementType=u,f.type=b,f.lanes=R,f}function El(u,f,p,b){return u=Li(7,u,b,f),u.lanes=p,u}function wm(u,f,p){return u=Li(6,u,null,f),u.lanes=p,u}function N5(u){var f=Li(18,null,null,0);return f.stateNode=u,f}function Sm(u,f,p){return f=Li(4,u.children!==null?u.children:[],u.key,f),f.lanes=p,f.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},f}var L5=new WeakMap;function Ji(u,f){if(typeof u=="object"&&u!==null){var p=L5.get(u);return p!==void 0?p:(f={value:u,source:f,stack:$e(f)},L5.set(u,f),f)}return{value:u,source:f,stack:$e(f)}}var ku=[],Bu=0,i0=null,Th=0,ea=[],ta=0,io=null,Fa=1,za="";function ms(u,f){ku[Bu++]=Th,ku[Bu++]=i0,i0=u,Th=f}function k5(u,f,p){ea[ta++]=Fa,ea[ta++]=za,ea[ta++]=io,io=u;var b=Fa;u=za;var T=32-ee(b)-1;b&=~(1<<T),p+=1;var R=32-ee(f)+T;if(30<R){var q=T-T%5;R=(b&(1<<q)-1).toString(32),b>>=q,T-=q,Fa=1<<32-ee(f)+T|p<<T|b,za=R+u}else Fa=1<<R|p<<T|b,za=u}function Em(u){u.return!==null&&(ms(u,1),k5(u,1,0))}function Tm(u){for(;u===i0;)i0=ku[--Bu],ku[Bu]=null,Th=ku[--Bu],ku[Bu]=null;for(;u===io;)io=ea[--ta],ea[ta]=null,za=ea[--ta],ea[ta]=null,Fa=ea[--ta],ea[ta]=null}function B5(u,f){ea[ta++]=Fa,ea[ta++]=za,ea[ta++]=io,Fa=f.id,za=f.overflow,io=u}var Hn=null,kr=null,Yt=!1,ao=null,ra=!1,Cm=Error(n(519));function so(u){var f=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ch(Ji(f,u)),Cm}function F5(u){var f=u.stateNode,p=u.type,b=u.memoizedProps;switch(f[nr]=u,f[Lr]=b,p){case"dialog":Ht("cancel",f),Ht("close",f);break;case"iframe":case"object":case"embed":Ht("load",f);break;case"video":case"audio":for(p=0;p<Wh.length;p++)Ht(Wh[p],f);break;case"source":Ht("error",f);break;case"img":case"image":case"link":Ht("error",f),Ht("load",f);break;case"details":Ht("toggle",f);break;case"input":Ht("invalid",f),Z3(f,b.value,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name,!0);break;case"select":Ht("invalid",f);break;case"textarea":Ht("invalid",f),J3(f,b.value,b.defaultValue,b.children)}p=b.children,typeof p!="string"&&typeof p!="number"&&typeof p!="bigint"||f.textContent===""+p||b.suppressHydrationWarning===!0||tT(f.textContent,p)?(b.popover!=null&&(Ht("beforetoggle",f),Ht("toggle",f)),b.onScroll!=null&&Ht("scroll",f),b.onScrollEnd!=null&&Ht("scrollend",f),b.onClick!=null&&(f.onclick=vs),f=!0):f=!1,f||so(u,!0)}function z5(u){for(Hn=u.return;Hn;)switch(Hn.tag){case 5:case 31:case 13:ra=!1;return;case 27:case 3:ra=!0;return;default:Hn=Hn.return}}function Fu(u){if(u!==Hn)return!1;if(!Yt)return z5(u),Yt=!0,!1;var f=u.tag,p;if((p=f!==3&&f!==27)&&((p=f===5)&&(p=u.type,p=!(p!=="form"&&p!=="button")||Vy(u.type,u.memoizedProps)),p=!p),p&&kr&&so(u),z5(u),f===13){if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(n(317));kr=cT(u)}else if(f===31){if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(n(317));kr=cT(u)}else f===27?(f=kr,_o(u.type)?(u=$y,$y=null,kr=u):kr=f):kr=Hn?ia(u.stateNode.nextSibling):null;return!0}function Tl(){kr=Hn=null,Yt=!1}function Am(){var u=ao;return u!==null&&(_i===null?_i=u:_i.push.apply(_i,u),ao=null),u}function Ch(u){ao===null?ao=[u]:ao.push(u)}var Mm=L(null),Cl=null,ys=null;function oo(u,f,p){G(Mm,f._currentValue),f._currentValue=p}function bs(u){u._currentValue=Mm.current,Y(Mm)}function Rm(u,f,p){for(;u!==null;){var b=u.alternate;if((u.childLanes&f)!==f?(u.childLanes|=f,b!==null&&(b.childLanes|=f)):b!==null&&(b.childLanes&f)!==f&&(b.childLanes|=f),u===p)break;u=u.return}}function Om(u,f,p,b){var T=u.child;for(T!==null&&(T.return=u);T!==null;){var R=T.dependencies;if(R!==null){var q=T.child;R=R.firstContext;e:for(;R!==null;){var Z=R;R=T;for(var ve=0;ve<f.length;ve++)if(Z.context===f[ve]){R.lanes|=p,Z=R.alternate,Z!==null&&(Z.lanes|=p),Rm(R.return,p,u),b||(q=null);break e}R=Z.next}}else if(T.tag===18){if(q=T.return,q===null)throw Error(n(341));q.lanes|=p,R=q.alternate,R!==null&&(R.lanes|=p),Rm(q,p,u),q=null}else q=T.child;if(q!==null)q.return=T;else for(q=T;q!==null;){if(q===u){q=null;break}if(T=q.sibling,T!==null){T.return=q.return,q=T;break}q=q.return}T=q}}function zu(u,f,p,b){u=null;for(var T=f,R=!1;T!==null;){if(!R){if((T.flags&524288)!==0)R=!0;else if((T.flags&262144)!==0)break}if(T.tag===10){var q=T.alternate;if(q===null)throw Error(n(387));if(q=q.memoizedProps,q!==null){var Z=T.type;Ni(T.pendingProps.value,q.value)||(u!==null?u.push(Z):u=[Z])}}else if(T===ce.current){if(q=T.alternate,q===null)throw Error(n(387));q.memoizedState.memoizedState!==T.memoizedState.memoizedState&&(u!==null?u.push(Jh):u=[Jh])}T=T.return}u!==null&&Om(f,u,p,b),f.flags|=262144}function a0(u){for(u=u.firstContext;u!==null;){if(!Ni(u.context._currentValue,u.memoizedValue))return!0;u=u.next}return!1}function Al(u){Cl=u,ys=null,u=u.dependencies,u!==null&&(u.firstContext=null)}function jn(u){return U5(Cl,u)}function s0(u,f){return Cl===null&&Al(u),U5(u,f)}function U5(u,f){var p=f._currentValue;if(f={context:f,memoizedValue:p,next:null},ys===null){if(u===null)throw Error(n(308));ys=f,u.dependencies={lanes:0,firstContext:f},u.flags|=524288}else ys=ys.next=f;return p}var mL=typeof AbortController<"u"?AbortController:function(){var u=[],f=this.signal={aborted:!1,addEventListener:function(p,b){u.push(b)}};this.abort=function(){f.aborted=!0,u.forEach(function(p){return p()})}},yL=r.unstable_scheduleCallback,bL=r.unstable_NormalPriority,pn={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Dm(){return{controller:new mL,data:new Map,refCount:0}}function Ah(u){u.refCount--,u.refCount===0&&yL(bL,function(){u.controller.abort()})}var Mh=null,Pm=0,Uu=0,Gu=null;function xL(u,f){if(Mh===null){var p=Mh=[];Pm=0,Uu=Ly(),Gu={status:"pending",value:void 0,then:function(b){p.push(b)}}}return Pm++,f.then(G5,G5),f}function G5(){if(--Pm===0&&Mh!==null){Gu!==null&&(Gu.status="fulfilled");var u=Mh;Mh=null,Uu=0,Gu=null;for(var f=0;f<u.length;f++)(0,u[f])()}}function _L(u,f){var p=[],b={status:"pending",value:null,reason:null,then:function(T){p.push(T)}};return u.then(function(){b.status="fulfilled",b.value=f;for(var T=0;T<p.length;T++)(0,p[T])(f)},function(T){for(b.status="rejected",b.reason=T,T=0;T<p.length;T++)(0,p[T])(void 0)}),b}var H5=P.S;P.S=function(u,f){TE=Ze(),typeof f=="object"&&f!==null&&typeof f.then=="function"&&xL(u,f),H5!==null&&H5(u,f)};var Ml=L(null);function Im(){var u=Ml.current;return u!==null?u:Er.pooledCache}function o0(u,f){f===null?G(Ml,Ml.current):G(Ml,f.pool)}function j5(){var u=Im();return u===null?null:{parent:pn._currentValue,pool:u}}var Hu=Error(n(460)),Nm=Error(n(474)),l0=Error(n(542)),u0={then:function(){}};function V5(u){return u=u.status,u==="fulfilled"||u==="rejected"}function q5(u,f,p){switch(p=u[p],p===void 0?u.push(f):p!==f&&(f.then(vs,vs),f=p),f.status){case"fulfilled":return f.value;case"rejected":throw u=f.reason,Y5(u),u;default:if(typeof f.status=="string")f.then(vs,vs);else{if(u=Er,u!==null&&100<u.shellSuspendCounter)throw Error(n(482));u=f,u.status="pending",u.then(function(b){if(f.status==="pending"){var T=f;T.status="fulfilled",T.value=b}},function(b){if(f.status==="pending"){var T=f;T.status="rejected",T.reason=b}})}switch(f.status){case"fulfilled":return f.value;case"rejected":throw u=f.reason,Y5(u),u}throw Ol=f,Hu}}function Rl(u){try{var f=u._init;return f(u._payload)}catch(p){throw p!==null&&typeof p=="object"&&typeof p.then=="function"?(Ol=p,Hu):p}}var Ol=null;function X5(){if(Ol===null)throw Error(n(459));var u=Ol;return Ol=null,u}function Y5(u){if(u===Hu||u===l0)throw Error(n(483))}var ju=null,Rh=0;function c0(u){var f=Rh;return Rh+=1,ju===null&&(ju=[]),q5(ju,u,f)}function Oh(u,f){f=f.props.ref,u.ref=f!==void 0?f:null}function h0(u,f){throw f.$$typeof===v?Error(n(525)):(u=Object.prototype.toString.call(f),Error(n(31,u==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":u)))}function W5(u){function f(we,ge){if(u){var Te=we.deletions;Te===null?(we.deletions=[ge],we.flags|=16):Te.push(ge)}}function p(we,ge){if(!u)return null;for(;ge!==null;)f(we,ge),ge=ge.sibling;return null}function b(we){for(var ge=new Map;we!==null;)we.key!==null?ge.set(we.key,we):ge.set(we.index,we),we=we.sibling;return ge}function T(we,ge){return we=gs(we,ge),we.index=0,we.sibling=null,we}function R(we,ge,Te){return we.index=Te,u?(Te=we.alternate,Te!==null?(Te=Te.index,Te<ge?(we.flags|=67108866,ge):Te):(we.flags|=67108866,ge)):(we.flags|=1048576,ge)}function q(we){return u&&we.alternate===null&&(we.flags|=67108866),we}function Z(we,ge,Te,Fe){return ge===null||ge.tag!==6?(ge=wm(Te,we.mode,Fe),ge.return=we,ge):(ge=T(ge,Te),ge.return=we,ge)}function ve(we,ge,Te,Fe){var _t=Te.type;return _t===x?Le(we,ge,Te.props.children,Fe,Te.key):ge!==null&&(ge.elementType===_t||typeof _t=="object"&&_t!==null&&_t.$$typeof===O&&Rl(_t)===ge.type)?(ge=T(ge,Te.props),Oh(ge,Te),ge.return=we,ge):(ge=n0(Te.type,Te.key,Te.props,null,we.mode,Fe),Oh(ge,Te),ge.return=we,ge)}function Ce(we,ge,Te,Fe){return ge===null||ge.tag!==4||ge.stateNode.containerInfo!==Te.containerInfo||ge.stateNode.implementation!==Te.implementation?(ge=Sm(Te,we.mode,Fe),ge.return=we,ge):(ge=T(ge,Te.children||[]),ge.return=we,ge)}function Le(we,ge,Te,Fe,_t){return ge===null||ge.tag!==7?(ge=El(Te,we.mode,Fe,_t),ge.return=we,ge):(ge=T(ge,Te),ge.return=we,ge)}function ze(we,ge,Te){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return ge=wm(""+ge,we.mode,Te),ge.return=we,ge;if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case g:return Te=n0(ge.type,ge.key,ge.props,null,we.mode,Te),Oh(Te,ge),Te.return=we,Te;case m:return ge=Sm(ge,we.mode,Te),ge.return=we,ge;case O:return ge=Rl(ge),ze(we,ge,Te)}if(W(ge)||U(ge))return ge=El(ge,we.mode,Te,null),ge.return=we,ge;if(typeof ge.then=="function")return ze(we,c0(ge),Te);if(ge.$$typeof===S)return ze(we,s0(we,ge),Te);h0(we,ge)}return null}function Me(we,ge,Te,Fe){var _t=ge!==null?ge.key:null;if(typeof Te=="string"&&Te!==""||typeof Te=="number"||typeof Te=="bigint")return _t!==null?null:Z(we,ge,""+Te,Fe);if(typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case g:return Te.key===_t?ve(we,ge,Te,Fe):null;case m:return Te.key===_t?Ce(we,ge,Te,Fe):null;case O:return Te=Rl(Te),Me(we,ge,Te,Fe)}if(W(Te)||U(Te))return _t!==null?null:Le(we,ge,Te,Fe,null);if(typeof Te.then=="function")return Me(we,ge,c0(Te),Fe);if(Te.$$typeof===S)return Me(we,ge,s0(we,Te),Fe);h0(we,Te)}return null}function Ie(we,ge,Te,Fe,_t){if(typeof Fe=="string"&&Fe!==""||typeof Fe=="number"||typeof Fe=="bigint")return we=we.get(Te)||null,Z(ge,we,""+Fe,_t);if(typeof Fe=="object"&&Fe!==null){switch(Fe.$$typeof){case g:return we=we.get(Fe.key===null?Te:Fe.key)||null,ve(ge,we,Fe,_t);case m:return we=we.get(Fe.key===null?Te:Fe.key)||null,Ce(ge,we,Fe,_t);case O:return Fe=Rl(Fe),Ie(we,ge,Te,Fe,_t)}if(W(Fe)||U(Fe))return we=we.get(Te)||null,Le(ge,we,Fe,_t,null);if(typeof Fe.then=="function")return Ie(we,ge,Te,c0(Fe),_t);if(Fe.$$typeof===S)return Ie(we,ge,Te,s0(ge,Fe),_t);h0(ge,Fe)}return null}function gt(we,ge,Te,Fe){for(var _t=null,Jt=null,mt=ge,kt=ge=0,Xt=null;mt!==null&&kt<Te.length;kt++){mt.index>kt?(Xt=mt,mt=null):Xt=mt.sibling;var er=Me(we,mt,Te[kt],Fe);if(er===null){mt===null&&(mt=Xt);break}u&&mt&&er.alternate===null&&f(we,mt),ge=R(er,ge,kt),Jt===null?_t=er:Jt.sibling=er,Jt=er,mt=Xt}if(kt===Te.length)return p(we,mt),Yt&&ms(we,kt),_t;if(mt===null){for(;kt<Te.length;kt++)mt=ze(we,Te[kt],Fe),mt!==null&&(ge=R(mt,ge,kt),Jt===null?_t=mt:Jt.sibling=mt,Jt=mt);return Yt&&ms(we,kt),_t}for(mt=b(mt);kt<Te.length;kt++)Xt=Ie(mt,we,kt,Te[kt],Fe),Xt!==null&&(u&&Xt.alternate!==null&&mt.delete(Xt.key===null?kt:Xt.key),ge=R(Xt,ge,kt),Jt===null?_t=Xt:Jt.sibling=Xt,Jt=Xt);return u&&mt.forEach(function(Co){return f(we,Co)}),Yt&&ms(we,kt),_t}function At(we,ge,Te,Fe){if(Te==null)throw Error(n(151));for(var _t=null,Jt=null,mt=ge,kt=ge=0,Xt=null,er=Te.next();mt!==null&&!er.done;kt++,er=Te.next()){mt.index>kt?(Xt=mt,mt=null):Xt=mt.sibling;var Co=Me(we,mt,er.value,Fe);if(Co===null){mt===null&&(mt=Xt);break}u&&mt&&Co.alternate===null&&f(we,mt),ge=R(Co,ge,kt),Jt===null?_t=Co:Jt.sibling=Co,Jt=Co,mt=Xt}if(er.done)return p(we,mt),Yt&&ms(we,kt),_t;if(mt===null){for(;!er.done;kt++,er=Te.next())er=ze(we,er.value,Fe),er!==null&&(ge=R(er,ge,kt),Jt===null?_t=er:Jt.sibling=er,Jt=er);return Yt&&ms(we,kt),_t}for(mt=b(mt);!er.done;kt++,er=Te.next())er=Ie(mt,we,kt,er.value,Fe),er!==null&&(u&&er.alternate!==null&&mt.delete(er.key===null?kt:er.key),ge=R(er,ge,kt),Jt===null?_t=er:Jt.sibling=er,Jt=er);return u&&mt.forEach(function(Pk){return f(we,Pk)}),Yt&&ms(we,kt),_t}function wr(we,ge,Te,Fe){if(typeof Te=="object"&&Te!==null&&Te.type===x&&Te.key===null&&(Te=Te.props.children),typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case g:e:{for(var _t=Te.key;ge!==null;){if(ge.key===_t){if(_t=Te.type,_t===x){if(ge.tag===7){p(we,ge.sibling),Fe=T(ge,Te.props.children),Fe.return=we,we=Fe;break e}}else if(ge.elementType===_t||typeof _t=="object"&&_t!==null&&_t.$$typeof===O&&Rl(_t)===ge.type){p(we,ge.sibling),Fe=T(ge,Te.props),Oh(Fe,Te),Fe.return=we,we=Fe;break e}p(we,ge);break}else f(we,ge);ge=ge.sibling}Te.type===x?(Fe=El(Te.props.children,we.mode,Fe,Te.key),Fe.return=we,we=Fe):(Fe=n0(Te.type,Te.key,Te.props,null,we.mode,Fe),Oh(Fe,Te),Fe.return=we,we=Fe)}return q(we);case m:e:{for(_t=Te.key;ge!==null;){if(ge.key===_t)if(ge.tag===4&&ge.stateNode.containerInfo===Te.containerInfo&&ge.stateNode.implementation===Te.implementation){p(we,ge.sibling),Fe=T(ge,Te.children||[]),Fe.return=we,we=Fe;break e}else{p(we,ge);break}else f(we,ge);ge=ge.sibling}Fe=Sm(Te,we.mode,Fe),Fe.return=we,we=Fe}return q(we);case O:return Te=Rl(Te),wr(we,ge,Te,Fe)}if(W(Te))return gt(we,ge,Te,Fe);if(U(Te)){if(_t=U(Te),typeof _t!="function")throw Error(n(150));return Te=_t.call(Te),At(we,ge,Te,Fe)}if(typeof Te.then=="function")return wr(we,ge,c0(Te),Fe);if(Te.$$typeof===S)return wr(we,ge,s0(we,Te),Fe);h0(we,Te)}return typeof Te=="string"&&Te!==""||typeof Te=="number"||typeof Te=="bigint"?(Te=""+Te,ge!==null&&ge.tag===6?(p(we,ge.sibling),Fe=T(ge,Te),Fe.return=we,we=Fe):(p(we,ge),Fe=wm(Te,we.mode,Fe),Fe.return=we,we=Fe),q(we)):p(we,ge)}return function(we,ge,Te,Fe){try{Rh=0;var _t=wr(we,ge,Te,Fe);return ju=null,_t}catch(mt){if(mt===Hu||mt===l0)throw mt;var Jt=Li(29,mt,null,we.mode);return Jt.lanes=Fe,Jt.return=we,Jt}finally{}}}var Dl=W5(!0),$5=W5(!1),lo=!1;function Lm(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function km(u,f){u=u.updateQueue,f.updateQueue===u&&(f.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,callbacks:null})}function uo(u){return{lane:u,tag:0,payload:null,callback:null,next:null}}function co(u,f,p){var b=u.updateQueue;if(b===null)return null;if(b=b.shared,(ir&2)!==0){var T=b.pending;return T===null?f.next=f:(f.next=T.next,T.next=f),b.pending=f,f=r0(u),P5(u,null,p),f}return t0(u,b,f,p),r0(u)}function Dh(u,f,p){if(f=f.updateQueue,f!==null&&(f=f.shared,(p&4194048)!==0)){var b=f.lanes;b&=u.pendingLanes,p|=b,f.lanes=p,Qt(u,p)}}function Bm(u,f){var p=u.updateQueue,b=u.alternate;if(b!==null&&(b=b.updateQueue,p===b)){var T=null,R=null;if(p=p.firstBaseUpdate,p!==null){do{var q={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};R===null?T=R=q:R=R.next=q,p=p.next}while(p!==null);R===null?T=R=f:R=R.next=f}else T=R=f;p={baseState:b.baseState,firstBaseUpdate:T,lastBaseUpdate:R,shared:b.shared,callbacks:b.callbacks},u.updateQueue=p;return}u=p.lastBaseUpdate,u===null?p.firstBaseUpdate=f:u.next=f,p.lastBaseUpdate=f}var Fm=!1;function Ph(){if(Fm){var u=Gu;if(u!==null)throw u}}function Ih(u,f,p,b){Fm=!1;var T=u.updateQueue;lo=!1;var R=T.firstBaseUpdate,q=T.lastBaseUpdate,Z=T.shared.pending;if(Z!==null){T.shared.pending=null;var ve=Z,Ce=ve.next;ve.next=null,q===null?R=Ce:q.next=Ce,q=ve;var Le=u.alternate;Le!==null&&(Le=Le.updateQueue,Z=Le.lastBaseUpdate,Z!==q&&(Z===null?Le.firstBaseUpdate=Ce:Z.next=Ce,Le.lastBaseUpdate=ve))}if(R!==null){var ze=T.baseState;q=0,Le=Ce=ve=null,Z=R;do{var Me=Z.lane&-536870913,Ie=Me!==Z.lane;if(Ie?(qt&Me)===Me:(b&Me)===Me){Me!==0&&Me===Uu&&(Fm=!0),Le!==null&&(Le=Le.next={lane:0,tag:Z.tag,payload:Z.payload,callback:null,next:null});e:{var gt=u,At=Z;Me=f;var wr=p;switch(At.tag){case 1:if(gt=At.payload,typeof gt=="function"){ze=gt.call(wr,ze,Me);break e}ze=gt;break e;case 3:gt.flags=gt.flags&-65537|128;case 0:if(gt=At.payload,Me=typeof gt=="function"?gt.call(wr,ze,Me):gt,Me==null)break e;ze=d({},ze,Me);break e;case 2:lo=!0}}Me=Z.callback,Me!==null&&(u.flags|=64,Ie&&(u.flags|=8192),Ie=T.callbacks,Ie===null?T.callbacks=[Me]:Ie.push(Me))}else Ie={lane:Me,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},Le===null?(Ce=Le=Ie,ve=ze):Le=Le.next=Ie,q|=Me;if(Z=Z.next,Z===null){if(Z=T.shared.pending,Z===null)break;Ie=Z,Z=Ie.next,Ie.next=null,T.lastBaseUpdate=Ie,T.shared.pending=null}}while(!0);Le===null&&(ve=ze),T.baseState=ve,T.firstBaseUpdate=Ce,T.lastBaseUpdate=Le,R===null&&(T.shared.lanes=0),go|=q,u.lanes=q,u.memoizedState=ze}}function K5(u,f){if(typeof u!="function")throw Error(n(191,u));u.call(f)}function Z5(u,f){var p=u.callbacks;if(p!==null)for(u.callbacks=null,u=0;u<p.length;u++)K5(p[u],f)}var Vu=L(null),f0=L(0);function Q5(u,f){u=Ms,G(f0,u),G(Vu,f),Ms=u|f.baseLanes}function zm(){G(f0,Ms),G(Vu,Vu.current)}function Um(){Ms=f0.current,Y(Vu),Y(f0)}var ki=L(null),na=null;function ho(u){var f=u.alternate;G(fn,fn.current&1),G(ki,u),na===null&&(f===null||Vu.current!==null||f.memoizedState!==null)&&(na=u)}function Gm(u){G(fn,fn.current),G(ki,u),na===null&&(na=u)}function J5(u){u.tag===22?(G(fn,fn.current),G(ki,u),na===null&&(na=u)):fo()}function fo(){G(fn,fn.current),G(ki,ki.current)}function Bi(u){Y(ki),na===u&&(na=null),Y(fn)}var fn=L(0);function d0(u){for(var f=u;f!==null;){if(f.tag===13){var p=f.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||Yy(p)||Wy(p)))return f}else if(f.tag===19&&(f.memoizedProps.revealOrder==="forwards"||f.memoizedProps.revealOrder==="backwards"||f.memoizedProps.revealOrder==="unstable_legacy-backwards"||f.memoizedProps.revealOrder==="together")){if((f.flags&128)!==0)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===u)break;for(;f.sibling===null;){if(f.return===null||f.return===u)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}var xs=0,Nt=null,xr=null,gn=null,v0=!1,qu=!1,Pl=!1,p0=0,Nh=0,Xu=null,wL=0;function an(){throw Error(n(321))}function Hm(u,f){if(f===null)return!1;for(var p=0;p<f.length&&p<u.length;p++)if(!Ni(u[p],f[p]))return!1;return!0}function jm(u,f,p,b,T,R){return xs=R,Nt=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,P.H=u===null||u.memoizedState===null?kS:iy,Pl=!1,R=p(b,T),Pl=!1,qu&&(R=tS(f,p,b,T)),eS(u),R}function eS(u){P.H=Bh;var f=xr!==null&&xr.next!==null;if(xs=0,gn=xr=Nt=null,v0=!1,Nh=0,Xu=null,f)throw Error(n(300));u===null||mn||(u=u.dependencies,u!==null&&a0(u)&&(mn=!0))}function tS(u,f,p,b){Nt=u;var T=0;do{if(qu&&(Xu=null),Nh=0,qu=!1,25<=T)throw Error(n(301));if(T+=1,gn=xr=null,u.updateQueue!=null){var R=u.updateQueue;R.lastEffect=null,R.events=null,R.stores=null,R.memoCache!=null&&(R.memoCache.index=0)}P.H=BS,R=f(p,b)}while(qu);return R}function SL(){var u=P.H,f=u.useState()[0];return f=typeof f.then=="function"?Lh(f):f,u=u.useState()[0],(xr!==null?xr.memoizedState:null)!==u&&(Nt.flags|=1024),f}function Vm(){var u=p0!==0;return p0=0,u}function qm(u,f,p){f.updateQueue=u.updateQueue,f.flags&=-2053,u.lanes&=~p}function Xm(u){if(v0){for(u=u.memoizedState;u!==null;){var f=u.queue;f!==null&&(f.pending=null),u=u.next}v0=!1}xs=0,gn=xr=Nt=null,qu=!1,Nh=p0=0,Xu=null}function si(){var u={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return gn===null?Nt.memoizedState=gn=u:gn=gn.next=u,gn}function dn(){if(xr===null){var u=Nt.alternate;u=u!==null?u.memoizedState:null}else u=xr.next;var f=gn===null?Nt.memoizedState:gn.next;if(f!==null)gn=f,xr=u;else{if(u===null)throw Nt.alternate===null?Error(n(467)):Error(n(310));xr=u,u={memoizedState:xr.memoizedState,baseState:xr.baseState,baseQueue:xr.baseQueue,queue:xr.queue,next:null},gn===null?Nt.memoizedState=gn=u:gn=gn.next=u}return gn}function g0(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Lh(u){var f=Nh;return Nh+=1,Xu===null&&(Xu=[]),u=q5(Xu,u,f),f=Nt,(gn===null?f.memoizedState:gn.next)===null&&(f=f.alternate,P.H=f===null||f.memoizedState===null?kS:iy),u}function m0(u){if(u!==null&&typeof u=="object"){if(typeof u.then=="function")return Lh(u);if(u.$$typeof===S)return jn(u)}throw Error(n(438,String(u)))}function Ym(u){var f=null,p=Nt.updateQueue;if(p!==null&&(f=p.memoCache),f==null){var b=Nt.alternate;b!==null&&(b=b.updateQueue,b!==null&&(b=b.memoCache,b!=null&&(f={data:b.data.map(function(T){return T.slice()}),index:0})))}if(f==null&&(f={data:[],index:0}),p===null&&(p=g0(),Nt.updateQueue=p),p.memoCache=f,p=f.data[f.index],p===void 0)for(p=f.data[f.index]=Array(u),b=0;b<u;b++)p[b]=I;return f.index++,p}function _s(u,f){return typeof f=="function"?f(u):f}function y0(u){var f=dn();return Wm(f,xr,u)}function Wm(u,f,p){var b=u.queue;if(b===null)throw Error(n(311));b.lastRenderedReducer=p;var T=u.baseQueue,R=b.pending;if(R!==null){if(T!==null){var q=T.next;T.next=R.next,R.next=q}f.baseQueue=T=R,b.pending=null}if(R=u.baseState,T===null)u.memoizedState=R;else{f=T.next;var Z=q=null,ve=null,Ce=f,Le=!1;do{var ze=Ce.lane&-536870913;if(ze!==Ce.lane?(qt&ze)===ze:(xs&ze)===ze){var Me=Ce.revertLane;if(Me===0)ve!==null&&(ve=ve.next={lane:0,revertLane:0,gesture:null,action:Ce.action,hasEagerState:Ce.hasEagerState,eagerState:Ce.eagerState,next:null}),ze===Uu&&(Le=!0);else if((xs&Me)===Me){Ce=Ce.next,Me===Uu&&(Le=!0);continue}else ze={lane:0,revertLane:Ce.revertLane,gesture:null,action:Ce.action,hasEagerState:Ce.hasEagerState,eagerState:Ce.eagerState,next:null},ve===null?(Z=ve=ze,q=R):ve=ve.next=ze,Nt.lanes|=Me,go|=Me;ze=Ce.action,Pl&&p(R,ze),R=Ce.hasEagerState?Ce.eagerState:p(R,ze)}else Me={lane:ze,revertLane:Ce.revertLane,gesture:Ce.gesture,action:Ce.action,hasEagerState:Ce.hasEagerState,eagerState:Ce.eagerState,next:null},ve===null?(Z=ve=Me,q=R):ve=ve.next=Me,Nt.lanes|=ze,go|=ze;Ce=Ce.next}while(Ce!==null&&Ce!==f);if(ve===null?q=R:ve.next=Z,!Ni(R,u.memoizedState)&&(mn=!0,Le&&(p=Gu,p!==null)))throw p;u.memoizedState=R,u.baseState=q,u.baseQueue=ve,b.lastRenderedState=R}return T===null&&(b.lanes=0),[u.memoizedState,b.dispatch]}function $m(u){var f=dn(),p=f.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=u;var b=p.dispatch,T=p.pending,R=f.memoizedState;if(T!==null){p.pending=null;var q=T=T.next;do R=u(R,q.action),q=q.next;while(q!==T);Ni(R,f.memoizedState)||(mn=!0),f.memoizedState=R,f.baseQueue===null&&(f.baseState=R),p.lastRenderedState=R}return[R,b]}function rS(u,f,p){var b=Nt,T=dn(),R=Yt;if(R){if(p===void 0)throw Error(n(407));p=p()}else p=f();var q=!Ni((xr||T).memoizedState,p);if(q&&(T.memoizedState=p,mn=!0),T=T.queue,Qm(aS.bind(null,b,T,u),[u]),T.getSnapshot!==f||q||gn!==null&&gn.memoizedState.tag&1){if(b.flags|=2048,Yu(9,{destroy:void 0},iS.bind(null,b,T,p,f),null),Er===null)throw Error(n(349));R||(xs&127)!==0||nS(b,f,p)}return p}function nS(u,f,p){u.flags|=16384,u={getSnapshot:f,value:p},f=Nt.updateQueue,f===null?(f=g0(),Nt.updateQueue=f,f.stores=[u]):(p=f.stores,p===null?f.stores=[u]:p.push(u))}function iS(u,f,p,b){f.value=p,f.getSnapshot=b,sS(f)&&oS(u)}function aS(u,f,p){return p(function(){sS(f)&&oS(u)})}function sS(u){var f=u.getSnapshot;u=u.value;try{var p=f();return!Ni(u,p)}catch{return!0}}function oS(u){var f=Sl(u,2);f!==null&&wi(f,u,2)}function Km(u){var f=si();if(typeof u=="function"){var p=u;if(u=p(),Pl){be(!0);try{p()}finally{be(!1)}}}return f.memoizedState=f.baseState=u,f.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:u},f}function lS(u,f,p,b){return u.baseState=p,Wm(u,xr,typeof b=="function"?b:_s)}function EL(u,f,p,b,T){if(_0(u))throw Error(n(485));if(u=f.action,u!==null){var R={payload:T,action:u,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(q){R.listeners.push(q)}};P.T!==null?p(!0):R.isTransition=!1,b(R),p=f.pending,p===null?(R.next=f.pending=R,uS(f,R)):(R.next=p.next,f.pending=p.next=R)}}function uS(u,f){var p=f.action,b=f.payload,T=u.state;if(f.isTransition){var R=P.T,q={};P.T=q;try{var Z=p(T,b),ve=P.S;ve!==null&&ve(q,Z),cS(u,f,Z)}catch(Ce){Zm(u,f,Ce)}finally{R!==null&&q.types!==null&&(R.types=q.types),P.T=R}}else try{R=p(T,b),cS(u,f,R)}catch(Ce){Zm(u,f,Ce)}}function cS(u,f,p){p!==null&&typeof p=="object"&&typeof p.then=="function"?p.then(function(b){hS(u,f,b)},function(b){return Zm(u,f,b)}):hS(u,f,p)}function hS(u,f,p){f.status="fulfilled",f.value=p,fS(f),u.state=p,f=u.pending,f!==null&&(p=f.next,p===f?u.pending=null:(p=p.next,f.next=p,uS(u,p)))}function Zm(u,f,p){var b=u.pending;if(u.pending=null,b!==null){b=b.next;do f.status="rejected",f.reason=p,fS(f),f=f.next;while(f!==b)}u.action=null}function fS(u){u=u.listeners;for(var f=0;f<u.length;f++)(0,u[f])()}function dS(u,f){return f}function vS(u,f){if(Yt){var p=Er.formState;if(p!==null){e:{var b=Nt;if(Yt){if(kr){t:{for(var T=kr,R=ra;T.nodeType!==8;){if(!R){T=null;break t}if(T=ia(T.nextSibling),T===null){T=null;break t}}R=T.data,T=R==="F!"||R==="F"?T:null}if(T){kr=ia(T.nextSibling),b=T.data==="F!";break e}}so(b)}b=!1}b&&(f=p[0])}}return p=si(),p.memoizedState=p.baseState=f,b={pending:null,lanes:0,dispatch:null,lastRenderedReducer:dS,lastRenderedState:f},p.queue=b,p=IS.bind(null,Nt,b),b.dispatch=p,b=Km(!1),R=ny.bind(null,Nt,!1,b.queue),b=si(),T={state:f,dispatch:null,action:u,pending:null},b.queue=T,p=EL.bind(null,Nt,T,R,p),T.dispatch=p,b.memoizedState=u,[f,p,!1]}function pS(u){var f=dn();return gS(f,xr,u)}function gS(u,f,p){if(f=Wm(u,f,dS)[0],u=y0(_s)[0],typeof f=="object"&&f!==null&&typeof f.then=="function")try{var b=Lh(f)}catch(q){throw q===Hu?l0:q}else b=f;f=dn();var T=f.queue,R=T.dispatch;return p!==f.memoizedState&&(Nt.flags|=2048,Yu(9,{destroy:void 0},TL.bind(null,T,p),null)),[b,R,u]}function TL(u,f){u.action=f}function mS(u){var f=dn(),p=xr;if(p!==null)return gS(f,p,u);dn(),f=f.memoizedState,p=dn();var b=p.queue.dispatch;return p.memoizedState=u,[f,b,!1]}function Yu(u,f,p,b){return u={tag:u,create:p,deps:b,inst:f,next:null},f=Nt.updateQueue,f===null&&(f=g0(),Nt.updateQueue=f),p=f.lastEffect,p===null?f.lastEffect=u.next=u:(b=p.next,p.next=u,u.next=b,f.lastEffect=u),u}function yS(){return dn().memoizedState}function b0(u,f,p,b){var T=si();Nt.flags|=u,T.memoizedState=Yu(1|f,{destroy:void 0},p,b===void 0?null:b)}function x0(u,f,p,b){var T=dn();b=b===void 0?null:b;var R=T.memoizedState.inst;xr!==null&&b!==null&&Hm(b,xr.memoizedState.deps)?T.memoizedState=Yu(f,R,p,b):(Nt.flags|=u,T.memoizedState=Yu(1|f,R,p,b))}function bS(u,f){b0(8390656,8,u,f)}function Qm(u,f){x0(2048,8,u,f)}function CL(u){Nt.flags|=4;var f=Nt.updateQueue;if(f===null)f=g0(),Nt.updateQueue=f,f.events=[u];else{var p=f.events;p===null?f.events=[u]:p.push(u)}}function xS(u){var f=dn().memoizedState;return CL({ref:f,nextImpl:u}),function(){if((ir&2)!==0)throw Error(n(440));return f.impl.apply(void 0,arguments)}}function _S(u,f){return x0(4,2,u,f)}function wS(u,f){return x0(4,4,u,f)}function SS(u,f){if(typeof f=="function"){u=u();var p=f(u);return function(){typeof p=="function"?p():f(null)}}if(f!=null)return u=u(),f.current=u,function(){f.current=null}}function ES(u,f,p){p=p!=null?p.concat([u]):null,x0(4,4,SS.bind(null,f,u),p)}function Jm(){}function TS(u,f){var p=dn();f=f===void 0?null:f;var b=p.memoizedState;return f!==null&&Hm(f,b[1])?b[0]:(p.memoizedState=[u,f],u)}function CS(u,f){var p=dn();f=f===void 0?null:f;var b=p.memoizedState;if(f!==null&&Hm(f,b[1]))return b[0];if(b=u(),Pl){be(!0);try{u()}finally{be(!1)}}return p.memoizedState=[b,f],b}function ey(u,f,p){return p===void 0||(xs&1073741824)!==0&&(qt&261930)===0?u.memoizedState=f:(u.memoizedState=p,u=AE(),Nt.lanes|=u,go|=u,p)}function AS(u,f,p,b){return Ni(p,f)?p:Vu.current!==null?(u=ey(u,p,b),Ni(u,f)||(mn=!0),u):(xs&42)===0||(xs&1073741824)!==0&&(qt&261930)===0?(mn=!0,u.memoizedState=p):(u=AE(),Nt.lanes|=u,go|=u,f)}function MS(u,f,p,b,T){var R=H.p;H.p=R!==0&&8>R?R:8;var q=P.T,Z={};P.T=Z,ny(u,!1,f,p);try{var ve=T(),Ce=P.S;if(Ce!==null&&Ce(Z,ve),ve!==null&&typeof ve=="object"&&typeof ve.then=="function"){var Le=_L(ve,b);kh(u,f,Le,Ui(u))}else kh(u,f,b,Ui(u))}catch(ze){kh(u,f,{then:function(){},status:"rejected",reason:ze},Ui())}finally{H.p=R,q!==null&&Z.types!==null&&(q.types=Z.types),P.T=q}}function AL(){}function ty(u,f,p,b){if(u.tag!==5)throw Error(n(476));var T=RS(u).queue;MS(u,T,f,z,p===null?AL:function(){return OS(u),p(b)})}function RS(u){var f=u.memoizedState;if(f!==null)return f;f={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:z},next:null};var p={};return f.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:p},next:null},u.memoizedState=f,u=u.alternate,u!==null&&(u.memoizedState=f),f}function OS(u){var f=RS(u);f.next===null&&(f=u.alternate.memoizedState),kh(u,f.next.queue,{},Ui())}function ry(){return jn(Jh)}function DS(){return dn().memoizedState}function PS(){return dn().memoizedState}function ML(u){for(var f=u.return;f!==null;){switch(f.tag){case 24:case 3:var p=Ui();u=uo(p);var b=co(f,u,p);b!==null&&(wi(b,f,p),Dh(b,f,p)),f={cache:Dm()},u.payload=f;return}f=f.return}}function RL(u,f,p){var b=Ui();p={lane:b,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},_0(u)?NS(f,p):(p=xm(u,f,p,b),p!==null&&(wi(p,u,b),LS(p,f,b)))}function IS(u,f,p){var b=Ui();kh(u,f,p,b)}function kh(u,f,p,b){var T={lane:b,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(_0(u))NS(f,T);else{var R=u.alternate;if(u.lanes===0&&(R===null||R.lanes===0)&&(R=f.lastRenderedReducer,R!==null))try{var q=f.lastRenderedState,Z=R(q,p);if(T.hasEagerState=!0,T.eagerState=Z,Ni(Z,q))return t0(u,f,T,0),Er===null&&e0(),!1}catch{}finally{}if(p=xm(u,f,T,b),p!==null)return wi(p,u,b),LS(p,f,b),!0}return!1}function ny(u,f,p,b){if(b={lane:2,revertLane:Ly(),gesture:null,action:b,hasEagerState:!1,eagerState:null,next:null},_0(u)){if(f)throw Error(n(479))}else f=xm(u,p,b,2),f!==null&&wi(f,u,2)}function _0(u){var f=u.alternate;return u===Nt||f!==null&&f===Nt}function NS(u,f){qu=v0=!0;var p=u.pending;p===null?f.next=f:(f.next=p.next,p.next=f),u.pending=f}function LS(u,f,p){if((p&4194048)!==0){var b=f.lanes;b&=u.pendingLanes,p|=b,f.lanes=p,Qt(u,p)}}var Bh={readContext:jn,use:m0,useCallback:an,useContext:an,useEffect:an,useImperativeHandle:an,useLayoutEffect:an,useInsertionEffect:an,useMemo:an,useReducer:an,useRef:an,useState:an,useDebugValue:an,useDeferredValue:an,useTransition:an,useSyncExternalStore:an,useId:an,useHostTransitionStatus:an,useFormState:an,useActionState:an,useOptimistic:an,useMemoCache:an,useCacheRefresh:an};Bh.useEffectEvent=an;var kS={readContext:jn,use:m0,useCallback:function(u,f){return si().memoizedState=[u,f===void 0?null:f],u},useContext:jn,useEffect:bS,useImperativeHandle:function(u,f,p){p=p!=null?p.concat([u]):null,b0(4194308,4,SS.bind(null,f,u),p)},useLayoutEffect:function(u,f){return b0(4194308,4,u,f)},useInsertionEffect:function(u,f){b0(4,2,u,f)},useMemo:function(u,f){var p=si();f=f===void 0?null:f;var b=u();if(Pl){be(!0);try{u()}finally{be(!1)}}return p.memoizedState=[b,f],b},useReducer:function(u,f,p){var b=si();if(p!==void 0){var T=p(f);if(Pl){be(!0);try{p(f)}finally{be(!1)}}}else T=f;return b.memoizedState=b.baseState=T,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:T},b.queue=u,u=u.dispatch=RL.bind(null,Nt,u),[b.memoizedState,u]},useRef:function(u){var f=si();return u={current:u},f.memoizedState=u},useState:function(u){u=Km(u);var f=u.queue,p=IS.bind(null,Nt,f);return f.dispatch=p,[u.memoizedState,p]},useDebugValue:Jm,useDeferredValue:function(u,f){var p=si();return ey(p,u,f)},useTransition:function(){var u=Km(!1);return u=MS.bind(null,Nt,u.queue,!0,!1),si().memoizedState=u,[!1,u]},useSyncExternalStore:function(u,f,p){var b=Nt,T=si();if(Yt){if(p===void 0)throw Error(n(407));p=p()}else{if(p=f(),Er===null)throw Error(n(349));(qt&127)!==0||nS(b,f,p)}T.memoizedState=p;var R={value:p,getSnapshot:f};return T.queue=R,bS(aS.bind(null,b,R,u),[u]),b.flags|=2048,Yu(9,{destroy:void 0},iS.bind(null,b,R,p,f),null),p},useId:function(){var u=si(),f=Er.identifierPrefix;if(Yt){var p=za,b=Fa;p=(b&~(1<<32-ee(b)-1)).toString(32)+p,f="_"+f+"R_"+p,p=p0++,0<p&&(f+="H"+p.toString(32)),f+="_"}else p=wL++,f="_"+f+"r_"+p.toString(32)+"_";return u.memoizedState=f},useHostTransitionStatus:ry,useFormState:vS,useActionState:vS,useOptimistic:function(u){var f=si();f.memoizedState=f.baseState=u;var p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return f.queue=p,f=ny.bind(null,Nt,!0,p),p.dispatch=f,[u,f]},useMemoCache:Ym,useCacheRefresh:function(){return si().memoizedState=ML.bind(null,Nt)},useEffectEvent:function(u){var f=si(),p={impl:u};return f.memoizedState=p,function(){if((ir&2)!==0)throw Error(n(440));return p.impl.apply(void 0,arguments)}}},iy={readContext:jn,use:m0,useCallback:TS,useContext:jn,useEffect:Qm,useImperativeHandle:ES,useInsertionEffect:_S,useLayoutEffect:wS,useMemo:CS,useReducer:y0,useRef:yS,useState:function(){return y0(_s)},useDebugValue:Jm,useDeferredValue:function(u,f){var p=dn();return AS(p,xr.memoizedState,u,f)},useTransition:function(){var u=y0(_s)[0],f=dn().memoizedState;return[typeof u=="boolean"?u:Lh(u),f]},useSyncExternalStore:rS,useId:DS,useHostTransitionStatus:ry,useFormState:pS,useActionState:pS,useOptimistic:function(u,f){var p=dn();return lS(p,xr,u,f)},useMemoCache:Ym,useCacheRefresh:PS};iy.useEffectEvent=xS;var BS={readContext:jn,use:m0,useCallback:TS,useContext:jn,useEffect:Qm,useImperativeHandle:ES,useInsertionEffect:_S,useLayoutEffect:wS,useMemo:CS,useReducer:$m,useRef:yS,useState:function(){return $m(_s)},useDebugValue:Jm,useDeferredValue:function(u,f){var p=dn();return xr===null?ey(p,u,f):AS(p,xr.memoizedState,u,f)},useTransition:function(){var u=$m(_s)[0],f=dn().memoizedState;return[typeof u=="boolean"?u:Lh(u),f]},useSyncExternalStore:rS,useId:DS,useHostTransitionStatus:ry,useFormState:mS,useActionState:mS,useOptimistic:function(u,f){var p=dn();return xr!==null?lS(p,xr,u,f):(p.baseState=u,[u,p.queue.dispatch])},useMemoCache:Ym,useCacheRefresh:PS};BS.useEffectEvent=xS;function ay(u,f,p,b){f=u.memoizedState,p=p(b,f),p=p==null?f:d({},f,p),u.memoizedState=p,u.lanes===0&&(u.updateQueue.baseState=p)}var sy={enqueueSetState:function(u,f,p){u=u._reactInternals;var b=Ui(),T=uo(b);T.payload=f,p!=null&&(T.callback=p),f=co(u,T,b),f!==null&&(wi(f,u,b),Dh(f,u,b))},enqueueReplaceState:function(u,f,p){u=u._reactInternals;var b=Ui(),T=uo(b);T.tag=1,T.payload=f,p!=null&&(T.callback=p),f=co(u,T,b),f!==null&&(wi(f,u,b),Dh(f,u,b))},enqueueForceUpdate:function(u,f){u=u._reactInternals;var p=Ui(),b=uo(p);b.tag=2,f!=null&&(b.callback=f),f=co(u,b,p),f!==null&&(wi(f,u,p),Dh(f,u,p))}};function FS(u,f,p,b,T,R,q){return u=u.stateNode,typeof u.shouldComponentUpdate=="function"?u.shouldComponentUpdate(b,R,q):f.prototype&&f.prototype.isPureReactComponent?!Sh(p,b)||!Sh(T,R):!0}function zS(u,f,p,b){u=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(p,b),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(p,b),f.state!==u&&sy.enqueueReplaceState(f,f.state,null)}function Il(u,f){var p=f;if("ref"in f){p={};for(var b in f)b!=="ref"&&(p[b]=f[b])}if(u=u.defaultProps){p===f&&(p=d({},p));for(var T in u)p[T]===void 0&&(p[T]=u[T])}return p}function US(u){Jd(u)}function GS(u){console.error(u)}function HS(u){Jd(u)}function w0(u,f){try{var p=u.onUncaughtError;p(f.value,{componentStack:f.stack})}catch(b){setTimeout(function(){throw b})}}function jS(u,f,p){try{var b=u.onCaughtError;b(p.value,{componentStack:p.stack,errorBoundary:f.tag===1?f.stateNode:null})}catch(T){setTimeout(function(){throw T})}}function oy(u,f,p){return p=uo(p),p.tag=3,p.payload={element:null},p.callback=function(){w0(u,f)},p}function VS(u){return u=uo(u),u.tag=3,u}function qS(u,f,p,b){var T=p.type.getDerivedStateFromError;if(typeof T=="function"){var R=b.value;u.payload=function(){return T(R)},u.callback=function(){jS(f,p,b)}}var q=p.stateNode;q!==null&&typeof q.componentDidCatch=="function"&&(u.callback=function(){jS(f,p,b),typeof T!="function"&&(mo===null?mo=new Set([this]):mo.add(this));var Z=b.stack;this.componentDidCatch(b.value,{componentStack:Z!==null?Z:""})})}function OL(u,f,p,b,T){if(p.flags|=32768,b!==null&&typeof b=="object"&&typeof b.then=="function"){if(f=p.alternate,f!==null&&zu(f,p,T,!0),p=ki.current,p!==null){switch(p.tag){case 31:case 13:return na===null?N0():p.alternate===null&&sn===0&&(sn=3),p.flags&=-257,p.flags|=65536,p.lanes=T,b===u0?p.flags|=16384:(f=p.updateQueue,f===null?p.updateQueue=new Set([b]):f.add(b),Py(u,b,T)),!1;case 22:return p.flags|=65536,b===u0?p.flags|=16384:(f=p.updateQueue,f===null?(f={transitions:null,markerInstances:null,retryQueue:new Set([b])},p.updateQueue=f):(p=f.retryQueue,p===null?f.retryQueue=new Set([b]):p.add(b)),Py(u,b,T)),!1}throw Error(n(435,p.tag))}return Py(u,b,T),N0(),!1}if(Yt)return f=ki.current,f!==null?((f.flags&65536)===0&&(f.flags|=256),f.flags|=65536,f.lanes=T,b!==Cm&&(u=Error(n(422),{cause:b}),Ch(Ji(u,p)))):(b!==Cm&&(f=Error(n(423),{cause:b}),Ch(Ji(f,p))),u=u.current.alternate,u.flags|=65536,T&=-T,u.lanes|=T,b=Ji(b,p),T=oy(u.stateNode,b,T),Bm(u,T),sn!==4&&(sn=2)),!1;var R=Error(n(520),{cause:b});if(R=Ji(R,p),qh===null?qh=[R]:qh.push(R),sn!==4&&(sn=2),f===null)return!0;b=Ji(b,p),p=f;do{switch(p.tag){case 3:return p.flags|=65536,u=T&-T,p.lanes|=u,u=oy(p.stateNode,b,u),Bm(p,u),!1;case 1:if(f=p.type,R=p.stateNode,(p.flags&128)===0&&(typeof f.getDerivedStateFromError=="function"||R!==null&&typeof R.componentDidCatch=="function"&&(mo===null||!mo.has(R))))return p.flags|=65536,T&=-T,p.lanes|=T,T=VS(T),qS(T,u,p,b),Bm(p,T),!1}p=p.return}while(p!==null);return!1}var ly=Error(n(461)),mn=!1;function Vn(u,f,p,b){f.child=u===null?$5(f,null,p,b):Dl(f,u.child,p,b)}function XS(u,f,p,b,T){p=p.render;var R=f.ref;if("ref"in b){var q={};for(var Z in b)Z!=="ref"&&(q[Z]=b[Z])}else q=b;return Al(f),b=jm(u,f,p,q,R,T),Z=Vm(),u!==null&&!mn?(qm(u,f,T),ws(u,f,T)):(Yt&&Z&&Em(f),f.flags|=1,Vn(u,f,b,T),f.child)}function YS(u,f,p,b,T){if(u===null){var R=p.type;return typeof R=="function"&&!_m(R)&&R.defaultProps===void 0&&p.compare===null?(f.tag=15,f.type=R,WS(u,f,R,b,T)):(u=n0(p.type,null,b,f,f.mode,T),u.ref=f.ref,u.return=f,f.child=u)}if(R=u.child,!gy(u,T)){var q=R.memoizedProps;if(p=p.compare,p=p!==null?p:Sh,p(q,b)&&u.ref===f.ref)return ws(u,f,T)}return f.flags|=1,u=gs(R,b),u.ref=f.ref,u.return=f,f.child=u}function WS(u,f,p,b,T){if(u!==null){var R=u.memoizedProps;if(Sh(R,b)&&u.ref===f.ref)if(mn=!1,f.pendingProps=b=R,gy(u,T))(u.flags&131072)!==0&&(mn=!0);else return f.lanes=u.lanes,ws(u,f,T)}return uy(u,f,p,b,T)}function $S(u,f,p,b){var T=b.children,R=u!==null?u.memoizedState:null;if(u===null&&f.stateNode===null&&(f.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),b.mode==="hidden"){if((f.flags&128)!==0){if(R=R!==null?R.baseLanes|p:p,u!==null){for(b=f.child=u.child,T=0;b!==null;)T=T|b.lanes|b.childLanes,b=b.sibling;b=T&~R}else b=0,f.child=null;return KS(u,f,R,p,b)}if((p&536870912)!==0)f.memoizedState={baseLanes:0,cachePool:null},u!==null&&o0(f,R!==null?R.cachePool:null),R!==null?Q5(f,R):zm(),J5(f);else return b=f.lanes=536870912,KS(u,f,R!==null?R.baseLanes|p:p,p,b)}else R!==null?(o0(f,R.cachePool),Q5(f,R),fo(),f.memoizedState=null):(u!==null&&o0(f,null),zm(),fo());return Vn(u,f,T,p),f.child}function Fh(u,f){return u!==null&&u.tag===22||f.stateNode!==null||(f.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.sibling}function KS(u,f,p,b,T){var R=Im();return R=R===null?null:{parent:pn._currentValue,pool:R},f.memoizedState={baseLanes:p,cachePool:R},u!==null&&o0(f,null),zm(),J5(f),u!==null&&zu(u,f,b,!0),f.childLanes=T,null}function S0(u,f){return f=T0({mode:f.mode,children:f.children},u.mode),f.ref=u.ref,u.child=f,f.return=u,f}function ZS(u,f,p){return Dl(f,u.child,null,p),u=S0(f,f.pendingProps),u.flags|=2,Bi(f),f.memoizedState=null,u}function DL(u,f,p){var b=f.pendingProps,T=(f.flags&128)!==0;if(f.flags&=-129,u===null){if(Yt){if(b.mode==="hidden")return u=S0(f,b),f.lanes=536870912,Fh(null,u);if(Gm(f),(u=kr)?(u=uT(u,ra),u=u!==null&&u.data==="&"?u:null,u!==null&&(f.memoizedState={dehydrated:u,treeContext:io!==null?{id:Fa,overflow:za}:null,retryLane:536870912,hydrationErrors:null},p=N5(u),p.return=f,f.child=p,Hn=f,kr=null)):u=null,u===null)throw so(f);return f.lanes=536870912,null}return S0(f,b)}var R=u.memoizedState;if(R!==null){var q=R.dehydrated;if(Gm(f),T)if(f.flags&256)f.flags&=-257,f=ZS(u,f,p);else if(f.memoizedState!==null)f.child=u.child,f.flags|=128,f=null;else throw Error(n(558));else if(mn||zu(u,f,p,!1),T=(p&u.childLanes)!==0,mn||T){if(b=Er,b!==null&&(q=rr(b,p),q!==0&&q!==R.retryLane))throw R.retryLane=q,Sl(u,q),wi(b,u,q),ly;N0(),f=ZS(u,f,p)}else u=R.treeContext,kr=ia(q.nextSibling),Hn=f,Yt=!0,ao=null,ra=!1,u!==null&&B5(f,u),f=S0(f,b),f.flags|=4096;return f}return u=gs(u.child,{mode:b.mode,children:b.children}),u.ref=f.ref,f.child=u,u.return=f,u}function E0(u,f){var p=f.ref;if(p===null)u!==null&&u.ref!==null&&(f.flags|=4194816);else{if(typeof p!="function"&&typeof p!="object")throw Error(n(284));(u===null||u.ref!==p)&&(f.flags|=4194816)}}function uy(u,f,p,b,T){return Al(f),p=jm(u,f,p,b,void 0,T),b=Vm(),u!==null&&!mn?(qm(u,f,T),ws(u,f,T)):(Yt&&b&&Em(f),f.flags|=1,Vn(u,f,p,T),f.child)}function QS(u,f,p,b,T,R){return Al(f),f.updateQueue=null,p=tS(f,b,p,T),eS(u),b=Vm(),u!==null&&!mn?(qm(u,f,R),ws(u,f,R)):(Yt&&b&&Em(f),f.flags|=1,Vn(u,f,p,R),f.child)}function JS(u,f,p,b,T){if(Al(f),f.stateNode===null){var R=Lu,q=p.contextType;typeof q=="object"&&q!==null&&(R=jn(q)),R=new p(b,R),f.memoizedState=R.state!==null&&R.state!==void 0?R.state:null,R.updater=sy,f.stateNode=R,R._reactInternals=f,R=f.stateNode,R.props=b,R.state=f.memoizedState,R.refs={},Lm(f),q=p.contextType,R.context=typeof q=="object"&&q!==null?jn(q):Lu,R.state=f.memoizedState,q=p.getDerivedStateFromProps,typeof q=="function"&&(ay(f,p,q,b),R.state=f.memoizedState),typeof p.getDerivedStateFromProps=="function"||typeof R.getSnapshotBeforeUpdate=="function"||typeof R.UNSAFE_componentWillMount!="function"&&typeof R.componentWillMount!="function"||(q=R.state,typeof R.componentWillMount=="function"&&R.componentWillMount(),typeof R.UNSAFE_componentWillMount=="function"&&R.UNSAFE_componentWillMount(),q!==R.state&&sy.enqueueReplaceState(R,R.state,null),Ih(f,b,R,T),Ph(),R.state=f.memoizedState),typeof R.componentDidMount=="function"&&(f.flags|=4194308),b=!0}else if(u===null){R=f.stateNode;var Z=f.memoizedProps,ve=Il(p,Z);R.props=ve;var Ce=R.context,Le=p.contextType;q=Lu,typeof Le=="object"&&Le!==null&&(q=jn(Le));var ze=p.getDerivedStateFromProps;Le=typeof ze=="function"||typeof R.getSnapshotBeforeUpdate=="function",Z=f.pendingProps!==Z,Le||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(Z||Ce!==q)&&zS(f,R,b,q),lo=!1;var Me=f.memoizedState;R.state=Me,Ih(f,b,R,T),Ph(),Ce=f.memoizedState,Z||Me!==Ce||lo?(typeof ze=="function"&&(ay(f,p,ze,b),Ce=f.memoizedState),(ve=lo||FS(f,p,ve,b,Me,Ce,q))?(Le||typeof R.UNSAFE_componentWillMount!="function"&&typeof R.componentWillMount!="function"||(typeof R.componentWillMount=="function"&&R.componentWillMount(),typeof R.UNSAFE_componentWillMount=="function"&&R.UNSAFE_componentWillMount()),typeof R.componentDidMount=="function"&&(f.flags|=4194308)):(typeof R.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=b,f.memoizedState=Ce),R.props=b,R.state=Ce,R.context=q,b=ve):(typeof R.componentDidMount=="function"&&(f.flags|=4194308),b=!1)}else{R=f.stateNode,km(u,f),q=f.memoizedProps,Le=Il(p,q),R.props=Le,ze=f.pendingProps,Me=R.context,Ce=p.contextType,ve=Lu,typeof Ce=="object"&&Ce!==null&&(ve=jn(Ce)),Z=p.getDerivedStateFromProps,(Ce=typeof Z=="function"||typeof R.getSnapshotBeforeUpdate=="function")||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(q!==ze||Me!==ve)&&zS(f,R,b,ve),lo=!1,Me=f.memoizedState,R.state=Me,Ih(f,b,R,T),Ph();var Ie=f.memoizedState;q!==ze||Me!==Ie||lo||u!==null&&u.dependencies!==null&&a0(u.dependencies)?(typeof Z=="function"&&(ay(f,p,Z,b),Ie=f.memoizedState),(Le=lo||FS(f,p,Le,b,Me,Ie,ve)||u!==null&&u.dependencies!==null&&a0(u.dependencies))?(Ce||typeof R.UNSAFE_componentWillUpdate!="function"&&typeof R.componentWillUpdate!="function"||(typeof R.componentWillUpdate=="function"&&R.componentWillUpdate(b,Ie,ve),typeof R.UNSAFE_componentWillUpdate=="function"&&R.UNSAFE_componentWillUpdate(b,Ie,ve)),typeof R.componentDidUpdate=="function"&&(f.flags|=4),typeof R.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof R.componentDidUpdate!="function"||q===u.memoizedProps&&Me===u.memoizedState||(f.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||q===u.memoizedProps&&Me===u.memoizedState||(f.flags|=1024),f.memoizedProps=b,f.memoizedState=Ie),R.props=b,R.state=Ie,R.context=ve,b=Le):(typeof R.componentDidUpdate!="function"||q===u.memoizedProps&&Me===u.memoizedState||(f.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||q===u.memoizedProps&&Me===u.memoizedState||(f.flags|=1024),b=!1)}return R=b,E0(u,f),b=(f.flags&128)!==0,R||b?(R=f.stateNode,p=b&&typeof p.getDerivedStateFromError!="function"?null:R.render(),f.flags|=1,u!==null&&b?(f.child=Dl(f,u.child,null,T),f.child=Dl(f,null,p,T)):Vn(u,f,p,T),f.memoizedState=R.state,u=f.child):u=ws(u,f,T),u}function eE(u,f,p,b){return Tl(),f.flags|=256,Vn(u,f,p,b),f.child}var cy={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hy(u){return{baseLanes:u,cachePool:j5()}}function fy(u,f,p){return u=u!==null?u.childLanes&~p:0,f&&(u|=zi),u}function tE(u,f,p){var b=f.pendingProps,T=!1,R=(f.flags&128)!==0,q;if((q=R)||(q=u!==null&&u.memoizedState===null?!1:(fn.current&2)!==0),q&&(T=!0,f.flags&=-129),q=(f.flags&32)!==0,f.flags&=-33,u===null){if(Yt){if(T?ho(f):fo(),(u=kr)?(u=uT(u,ra),u=u!==null&&u.data!=="&"?u:null,u!==null&&(f.memoizedState={dehydrated:u,treeContext:io!==null?{id:Fa,overflow:za}:null,retryLane:536870912,hydrationErrors:null},p=N5(u),p.return=f,f.child=p,Hn=f,kr=null)):u=null,u===null)throw so(f);return Wy(u)?f.lanes=32:f.lanes=536870912,null}var Z=b.children;return b=b.fallback,T?(fo(),T=f.mode,Z=T0({mode:"hidden",children:Z},T),b=El(b,T,p,null),Z.return=f,b.return=f,Z.sibling=b,f.child=Z,b=f.child,b.memoizedState=hy(p),b.childLanes=fy(u,q,p),f.memoizedState=cy,Fh(null,b)):(ho(f),dy(f,Z))}var ve=u.memoizedState;if(ve!==null&&(Z=ve.dehydrated,Z!==null)){if(R)f.flags&256?(ho(f),f.flags&=-257,f=vy(u,f,p)):f.memoizedState!==null?(fo(),f.child=u.child,f.flags|=128,f=null):(fo(),Z=b.fallback,T=f.mode,b=T0({mode:"visible",children:b.children},T),Z=El(Z,T,p,null),Z.flags|=2,b.return=f,Z.return=f,b.sibling=Z,f.child=b,Dl(f,u.child,null,p),b=f.child,b.memoizedState=hy(p),b.childLanes=fy(u,q,p),f.memoizedState=cy,f=Fh(null,b));else if(ho(f),Wy(Z)){if(q=Z.nextSibling&&Z.nextSibling.dataset,q)var Ce=q.dgst;q=Ce,b=Error(n(419)),b.stack="",b.digest=q,Ch({value:b,source:null,stack:null}),f=vy(u,f,p)}else if(mn||zu(u,f,p,!1),q=(p&u.childLanes)!==0,mn||q){if(q=Er,q!==null&&(b=rr(q,p),b!==0&&b!==ve.retryLane))throw ve.retryLane=b,Sl(u,b),wi(q,u,b),ly;Yy(Z)||N0(),f=vy(u,f,p)}else Yy(Z)?(f.flags|=192,f.child=u.child,f=null):(u=ve.treeContext,kr=ia(Z.nextSibling),Hn=f,Yt=!0,ao=null,ra=!1,u!==null&&B5(f,u),f=dy(f,b.children),f.flags|=4096);return f}return T?(fo(),Z=b.fallback,T=f.mode,ve=u.child,Ce=ve.sibling,b=gs(ve,{mode:"hidden",children:b.children}),b.subtreeFlags=ve.subtreeFlags&65011712,Ce!==null?Z=gs(Ce,Z):(Z=El(Z,T,p,null),Z.flags|=2),Z.return=f,b.return=f,b.sibling=Z,f.child=b,Fh(null,b),b=f.child,Z=u.child.memoizedState,Z===null?Z=hy(p):(T=Z.cachePool,T!==null?(ve=pn._currentValue,T=T.parent!==ve?{parent:ve,pool:ve}:T):T=j5(),Z={baseLanes:Z.baseLanes|p,cachePool:T}),b.memoizedState=Z,b.childLanes=fy(u,q,p),f.memoizedState=cy,Fh(u.child,b)):(ho(f),p=u.child,u=p.sibling,p=gs(p,{mode:"visible",children:b.children}),p.return=f,p.sibling=null,u!==null&&(q=f.deletions,q===null?(f.deletions=[u],f.flags|=16):q.push(u)),f.child=p,f.memoizedState=null,p)}function dy(u,f){return f=T0({mode:"visible",children:f},u.mode),f.return=u,u.child=f}function T0(u,f){return u=Li(22,u,null,f),u.lanes=0,u}function vy(u,f,p){return Dl(f,u.child,null,p),u=dy(f,f.pendingProps.children),u.flags|=2,f.memoizedState=null,u}function rE(u,f,p){u.lanes|=f;var b=u.alternate;b!==null&&(b.lanes|=f),Rm(u.return,f,p)}function py(u,f,p,b,T,R){var q=u.memoizedState;q===null?u.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:b,tail:p,tailMode:T,treeForkCount:R}:(q.isBackwards=f,q.rendering=null,q.renderingStartTime=0,q.last=b,q.tail=p,q.tailMode=T,q.treeForkCount=R)}function nE(u,f,p){var b=f.pendingProps,T=b.revealOrder,R=b.tail;b=b.children;var q=fn.current,Z=(q&2)!==0;if(Z?(q=q&1|2,f.flags|=128):q&=1,G(fn,q),Vn(u,f,b,p),b=Yt?Th:0,!Z&&u!==null&&(u.flags&128)!==0)e:for(u=f.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&rE(u,p,f);else if(u.tag===19)rE(u,p,f);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===f)break e;for(;u.sibling===null;){if(u.return===null||u.return===f)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}switch(T){case"forwards":for(p=f.child,T=null;p!==null;)u=p.alternate,u!==null&&d0(u)===null&&(T=p),p=p.sibling;p=T,p===null?(T=f.child,f.child=null):(T=p.sibling,p.sibling=null),py(f,!1,T,p,R,b);break;case"backwards":case"unstable_legacy-backwards":for(p=null,T=f.child,f.child=null;T!==null;){if(u=T.alternate,u!==null&&d0(u)===null){f.child=T;break}u=T.sibling,T.sibling=p,p=T,T=u}py(f,!0,p,null,R,b);break;case"together":py(f,!1,null,null,void 0,b);break;default:f.memoizedState=null}return f.child}function ws(u,f,p){if(u!==null&&(f.dependencies=u.dependencies),go|=f.lanes,(p&f.childLanes)===0)if(u!==null){if(zu(u,f,p,!1),(p&f.childLanes)===0)return null}else return null;if(u!==null&&f.child!==u.child)throw Error(n(153));if(f.child!==null){for(u=f.child,p=gs(u,u.pendingProps),f.child=p,p.return=f;u.sibling!==null;)u=u.sibling,p=p.sibling=gs(u,u.pendingProps),p.return=f;p.sibling=null}return f.child}function gy(u,f){return(u.lanes&f)!==0?!0:(u=u.dependencies,!!(u!==null&&a0(u)))}function PL(u,f,p){switch(f.tag){case 3:_e(f,f.stateNode.containerInfo),oo(f,pn,u.memoizedState.cache),Tl();break;case 27:case 5:ae(f);break;case 4:_e(f,f.stateNode.containerInfo);break;case 10:oo(f,f.type,f.memoizedProps.value);break;case 31:if(f.memoizedState!==null)return f.flags|=128,Gm(f),null;break;case 13:var b=f.memoizedState;if(b!==null)return b.dehydrated!==null?(ho(f),f.flags|=128,null):(p&f.child.childLanes)!==0?tE(u,f,p):(ho(f),u=ws(u,f,p),u!==null?u.sibling:null);ho(f);break;case 19:var T=(u.flags&128)!==0;if(b=(p&f.childLanes)!==0,b||(zu(u,f,p,!1),b=(p&f.childLanes)!==0),T){if(b)return nE(u,f,p);f.flags|=128}if(T=f.memoizedState,T!==null&&(T.rendering=null,T.tail=null,T.lastEffect=null),G(fn,fn.current),b)break;return null;case 22:return f.lanes=0,$S(u,f,p,f.pendingProps);case 24:oo(f,pn,u.memoizedState.cache)}return ws(u,f,p)}function iE(u,f,p){if(u!==null)if(u.memoizedProps!==f.pendingProps)mn=!0;else{if(!gy(u,p)&&(f.flags&128)===0)return mn=!1,PL(u,f,p);mn=(u.flags&131072)!==0}else mn=!1,Yt&&(f.flags&1048576)!==0&&k5(f,Th,f.index);switch(f.lanes=0,f.tag){case 16:e:{var b=f.pendingProps;if(u=Rl(f.elementType),f.type=u,typeof u=="function")_m(u)?(b=Il(u,b),f.tag=1,f=JS(null,f,u,b,p)):(f.tag=0,f=uy(null,f,u,b,p));else{if(u!=null){var T=u.$$typeof;if(T===A){f.tag=11,f=XS(null,f,u,b,p);break e}else if(T===E){f.tag=14,f=YS(null,f,u,b,p);break e}}throw f=X(u)||u,Error(n(306,f,""))}}return f;case 0:return uy(u,f,f.type,f.pendingProps,p);case 1:return b=f.type,T=Il(b,f.pendingProps),JS(u,f,b,T,p);case 3:e:{if(_e(f,f.stateNode.containerInfo),u===null)throw Error(n(387));b=f.pendingProps;var R=f.memoizedState;T=R.element,km(u,f),Ih(f,b,null,p);var q=f.memoizedState;if(b=q.cache,oo(f,pn,b),b!==R.cache&&Om(f,[pn],p,!0),Ph(),b=q.element,R.isDehydrated)if(R={element:b,isDehydrated:!1,cache:q.cache},f.updateQueue.baseState=R,f.memoizedState=R,f.flags&256){f=eE(u,f,b,p);break e}else if(b!==T){T=Ji(Error(n(424)),f),Ch(T),f=eE(u,f,b,p);break e}else{switch(u=f.stateNode.containerInfo,u.nodeType){case 9:u=u.body;break;default:u=u.nodeName==="HTML"?u.ownerDocument.body:u}for(kr=ia(u.firstChild),Hn=f,Yt=!0,ao=null,ra=!0,p=$5(f,null,b,p),f.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling}else{if(Tl(),b===T){f=ws(u,f,p);break e}Vn(u,f,b,p)}f=f.child}return f;case 26:return E0(u,f),u===null?(p=pT(f.type,null,f.pendingProps,null))?f.memoizedState=p:Yt||(p=f.type,u=f.pendingProps,b=G0(le.current).createElement(p),b[nr]=f,b[Lr]=u,qn(b,p,u),cr(b),f.stateNode=b):f.memoizedState=pT(f.type,u.memoizedProps,f.pendingProps,u.memoizedState),null;case 27:return ae(f),u===null&&Yt&&(b=f.stateNode=fT(f.type,f.pendingProps,le.current),Hn=f,ra=!0,T=kr,_o(f.type)?($y=T,kr=ia(b.firstChild)):kr=T),Vn(u,f,f.pendingProps.children,p),E0(u,f),u===null&&(f.flags|=4194304),f.child;case 5:return u===null&&Yt&&((T=b=kr)&&(b=lk(b,f.type,f.pendingProps,ra),b!==null?(f.stateNode=b,Hn=f,kr=ia(b.firstChild),ra=!1,T=!0):T=!1),T||so(f)),ae(f),T=f.type,R=f.pendingProps,q=u!==null?u.memoizedProps:null,b=R.children,Vy(T,R)?b=null:q!==null&&Vy(T,q)&&(f.flags|=32),f.memoizedState!==null&&(T=jm(u,f,SL,null,null,p),Jh._currentValue=T),E0(u,f),Vn(u,f,b,p),f.child;case 6:return u===null&&Yt&&((u=p=kr)&&(p=uk(p,f.pendingProps,ra),p!==null?(f.stateNode=p,Hn=f,kr=null,u=!0):u=!1),u||so(f)),null;case 13:return tE(u,f,p);case 4:return _e(f,f.stateNode.containerInfo),b=f.pendingProps,u===null?f.child=Dl(f,null,b,p):Vn(u,f,b,p),f.child;case 11:return XS(u,f,f.type,f.pendingProps,p);case 7:return Vn(u,f,f.pendingProps,p),f.child;case 8:return Vn(u,f,f.pendingProps.children,p),f.child;case 12:return Vn(u,f,f.pendingProps.children,p),f.child;case 10:return b=f.pendingProps,oo(f,f.type,b.value),Vn(u,f,b.children,p),f.child;case 9:return T=f.type._context,b=f.pendingProps.children,Al(f),T=jn(T),b=b(T),f.flags|=1,Vn(u,f,b,p),f.child;case 14:return YS(u,f,f.type,f.pendingProps,p);case 15:return WS(u,f,f.type,f.pendingProps,p);case 19:return nE(u,f,p);case 31:return DL(u,f,p);case 22:return $S(u,f,p,f.pendingProps);case 24:return Al(f),b=jn(pn),u===null?(T=Im(),T===null&&(T=Er,R=Dm(),T.pooledCache=R,R.refCount++,R!==null&&(T.pooledCacheLanes|=p),T=R),f.memoizedState={parent:b,cache:T},Lm(f),oo(f,pn,T)):((u.lanes&p)!==0&&(km(u,f),Ih(f,null,null,p),Ph()),T=u.memoizedState,R=f.memoizedState,T.parent!==b?(T={parent:b,cache:b},f.memoizedState=T,f.lanes===0&&(f.memoizedState=f.updateQueue.baseState=T),oo(f,pn,b)):(b=R.cache,oo(f,pn,b),b!==T.cache&&Om(f,[pn],p,!0))),Vn(u,f,f.pendingProps.children,p),f.child;case 29:throw f.pendingProps}throw Error(n(156,f.tag))}function Ss(u){u.flags|=4}function my(u,f,p,b,T){if((f=(u.mode&32)!==0)&&(f=!1),f){if(u.flags|=16777216,(T&335544128)===T)if(u.stateNode.complete)u.flags|=8192;else if(DE())u.flags|=8192;else throw Ol=u0,Nm}else u.flags&=-16777217}function aE(u,f){if(f.type!=="stylesheet"||(f.state.loading&4)!==0)u.flags&=-16777217;else if(u.flags|=16777216,!xT(f))if(DE())u.flags|=8192;else throw Ol=u0,Nm}function C0(u,f){f!==null&&(u.flags|=4),u.flags&16384&&(f=u.tag!==22?vt():536870912,u.lanes|=f,Zu|=f)}function zh(u,f){if(!Yt)switch(u.tailMode){case"hidden":f=u.tail;for(var p=null;f!==null;)f.alternate!==null&&(p=f),f=f.sibling;p===null?u.tail=null:p.sibling=null;break;case"collapsed":p=u.tail;for(var b=null;p!==null;)p.alternate!==null&&(b=p),p=p.sibling;b===null?f||u.tail===null?u.tail=null:u.tail.sibling=null:b.sibling=null}}function Br(u){var f=u.alternate!==null&&u.alternate.child===u.child,p=0,b=0;if(f)for(var T=u.child;T!==null;)p|=T.lanes|T.childLanes,b|=T.subtreeFlags&65011712,b|=T.flags&65011712,T.return=u,T=T.sibling;else for(T=u.child;T!==null;)p|=T.lanes|T.childLanes,b|=T.subtreeFlags,b|=T.flags,T.return=u,T=T.sibling;return u.subtreeFlags|=b,u.childLanes=p,f}function IL(u,f,p){var b=f.pendingProps;switch(Tm(f),f.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Br(f),null;case 1:return Br(f),null;case 3:return p=f.stateNode,b=null,u!==null&&(b=u.memoizedState.cache),f.memoizedState.cache!==b&&(f.flags|=2048),bs(pn),pe(),p.pendingContext&&(p.context=p.pendingContext,p.pendingContext=null),(u===null||u.child===null)&&(Fu(f)?Ss(f):u===null||u.memoizedState.isDehydrated&&(f.flags&256)===0||(f.flags|=1024,Am())),Br(f),null;case 26:var T=f.type,R=f.memoizedState;return u===null?(Ss(f),R!==null?(Br(f),aE(f,R)):(Br(f),my(f,T,null,b,p))):R?R!==u.memoizedState?(Ss(f),Br(f),aE(f,R)):(Br(f),f.flags&=-16777217):(u=u.memoizedProps,u!==b&&Ss(f),Br(f),my(f,T,u,b,p)),null;case 27:if(oe(f),p=le.current,T=f.type,u!==null&&f.stateNode!=null)u.memoizedProps!==b&&Ss(f);else{if(!b){if(f.stateNode===null)throw Error(n(166));return Br(f),null}u=re.current,Fu(f)?F5(f):(u=fT(T,b,p),f.stateNode=u,Ss(f))}return Br(f),null;case 5:if(oe(f),T=f.type,u!==null&&f.stateNode!=null)u.memoizedProps!==b&&Ss(f);else{if(!b){if(f.stateNode===null)throw Error(n(166));return Br(f),null}if(R=re.current,Fu(f))F5(f);else{var q=G0(le.current);switch(R){case 1:R=q.createElementNS("http://www.w3.org/2000/svg",T);break;case 2:R=q.createElementNS("http://www.w3.org/1998/Math/MathML",T);break;default:switch(T){case"svg":R=q.createElementNS("http://www.w3.org/2000/svg",T);break;case"math":R=q.createElementNS("http://www.w3.org/1998/Math/MathML",T);break;case"script":R=q.createElement("div"),R.innerHTML="<script><\/script>",R=R.removeChild(R.firstChild);break;case"select":R=typeof b.is=="string"?q.createElement("select",{is:b.is}):q.createElement("select"),b.multiple?R.multiple=!0:b.size&&(R.size=b.size);break;default:R=typeof b.is=="string"?q.createElement(T,{is:b.is}):q.createElement(T)}}R[nr]=f,R[Lr]=b;e:for(q=f.child;q!==null;){if(q.tag===5||q.tag===6)R.appendChild(q.stateNode);else if(q.tag!==4&&q.tag!==27&&q.child!==null){q.child.return=q,q=q.child;continue}if(q===f)break e;for(;q.sibling===null;){if(q.return===null||q.return===f)break e;q=q.return}q.sibling.return=q.return,q=q.sibling}f.stateNode=R;e:switch(qn(R,T,b),T){case"button":case"input":case"select":case"textarea":b=!!b.autoFocus;break e;case"img":b=!0;break e;default:b=!1}b&&Ss(f)}}return Br(f),my(f,f.type,u===null?null:u.memoizedProps,f.pendingProps,p),null;case 6:if(u&&f.stateNode!=null)u.memoizedProps!==b&&Ss(f);else{if(typeof b!="string"&&f.stateNode===null)throw Error(n(166));if(u=le.current,Fu(f)){if(u=f.stateNode,p=f.memoizedProps,b=null,T=Hn,T!==null)switch(T.tag){case 27:case 5:b=T.memoizedProps}u[nr]=f,u=!!(u.nodeValue===p||b!==null&&b.suppressHydrationWarning===!0||tT(u.nodeValue,p)),u||so(f,!0)}else u=G0(u).createTextNode(b),u[nr]=f,f.stateNode=u}return Br(f),null;case 31:if(p=f.memoizedState,u===null||u.memoizedState!==null){if(b=Fu(f),p!==null){if(u===null){if(!b)throw Error(n(318));if(u=f.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(n(557));u[nr]=f}else Tl(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;Br(f),u=!1}else p=Am(),u!==null&&u.memoizedState!==null&&(u.memoizedState.hydrationErrors=p),u=!0;if(!u)return f.flags&256?(Bi(f),f):(Bi(f),null);if((f.flags&128)!==0)throw Error(n(558))}return Br(f),null;case 13:if(b=f.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if(T=Fu(f),b!==null&&b.dehydrated!==null){if(u===null){if(!T)throw Error(n(318));if(T=f.memoizedState,T=T!==null?T.dehydrated:null,!T)throw Error(n(317));T[nr]=f}else Tl(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;Br(f),T=!1}else T=Am(),u!==null&&u.memoizedState!==null&&(u.memoizedState.hydrationErrors=T),T=!0;if(!T)return f.flags&256?(Bi(f),f):(Bi(f),null)}return Bi(f),(f.flags&128)!==0?(f.lanes=p,f):(p=b!==null,u=u!==null&&u.memoizedState!==null,p&&(b=f.child,T=null,b.alternate!==null&&b.alternate.memoizedState!==null&&b.alternate.memoizedState.cachePool!==null&&(T=b.alternate.memoizedState.cachePool.pool),R=null,b.memoizedState!==null&&b.memoizedState.cachePool!==null&&(R=b.memoizedState.cachePool.pool),R!==T&&(b.flags|=2048)),p!==u&&p&&(f.child.flags|=8192),C0(f,f.updateQueue),Br(f),null);case 4:return pe(),u===null&&zy(f.stateNode.containerInfo),Br(f),null;case 10:return bs(f.type),Br(f),null;case 19:if(Y(fn),b=f.memoizedState,b===null)return Br(f),null;if(T=(f.flags&128)!==0,R=b.rendering,R===null)if(T)zh(b,!1);else{if(sn!==0||u!==null&&(u.flags&128)!==0)for(u=f.child;u!==null;){if(R=d0(u),R!==null){for(f.flags|=128,zh(b,!1),u=R.updateQueue,f.updateQueue=u,C0(f,u),f.subtreeFlags=0,u=p,p=f.child;p!==null;)I5(p,u),p=p.sibling;return G(fn,fn.current&1|2),Yt&&ms(f,b.treeForkCount),f.child}u=u.sibling}b.tail!==null&&Ze()>D0&&(f.flags|=128,T=!0,zh(b,!1),f.lanes=4194304)}else{if(!T)if(u=d0(R),u!==null){if(f.flags|=128,T=!0,u=u.updateQueue,f.updateQueue=u,C0(f,u),zh(b,!0),b.tail===null&&b.tailMode==="hidden"&&!R.alternate&&!Yt)return Br(f),null}else 2*Ze()-b.renderingStartTime>D0&&p!==536870912&&(f.flags|=128,T=!0,zh(b,!1),f.lanes=4194304);b.isBackwards?(R.sibling=f.child,f.child=R):(u=b.last,u!==null?u.sibling=R:f.child=R,b.last=R)}return b.tail!==null?(u=b.tail,b.rendering=u,b.tail=u.sibling,b.renderingStartTime=Ze(),u.sibling=null,p=fn.current,G(fn,T?p&1|2:p&1),Yt&&ms(f,b.treeForkCount),u):(Br(f),null);case 22:case 23:return Bi(f),Um(),b=f.memoizedState!==null,u!==null?u.memoizedState!==null!==b&&(f.flags|=8192):b&&(f.flags|=8192),b?(p&536870912)!==0&&(f.flags&128)===0&&(Br(f),f.subtreeFlags&6&&(f.flags|=8192)):Br(f),p=f.updateQueue,p!==null&&C0(f,p.retryQueue),p=null,u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(p=u.memoizedState.cachePool.pool),b=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(b=f.memoizedState.cachePool.pool),b!==p&&(f.flags|=2048),u!==null&&Y(Ml),null;case 24:return p=null,u!==null&&(p=u.memoizedState.cache),f.memoizedState.cache!==p&&(f.flags|=2048),bs(pn),Br(f),null;case 25:return null;case 30:return null}throw Error(n(156,f.tag))}function NL(u,f){switch(Tm(f),f.tag){case 1:return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 3:return bs(pn),pe(),u=f.flags,(u&65536)!==0&&(u&128)===0?(f.flags=u&-65537|128,f):null;case 26:case 27:case 5:return oe(f),null;case 31:if(f.memoizedState!==null){if(Bi(f),f.alternate===null)throw Error(n(340));Tl()}return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 13:if(Bi(f),u=f.memoizedState,u!==null&&u.dehydrated!==null){if(f.alternate===null)throw Error(n(340));Tl()}return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 19:return Y(fn),null;case 4:return pe(),null;case 10:return bs(f.type),null;case 22:case 23:return Bi(f),Um(),u!==null&&Y(Ml),u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 24:return bs(pn),null;case 25:return null;default:return null}}function sE(u,f){switch(Tm(f),f.tag){case 3:bs(pn),pe();break;case 26:case 27:case 5:oe(f);break;case 4:pe();break;case 31:f.memoizedState!==null&&Bi(f);break;case 13:Bi(f);break;case 19:Y(fn);break;case 10:bs(f.type);break;case 22:case 23:Bi(f),Um(),u!==null&&Y(Ml);break;case 24:bs(pn)}}function Uh(u,f){try{var p=f.updateQueue,b=p!==null?p.lastEffect:null;if(b!==null){var T=b.next;p=T;do{if((p.tag&u)===u){b=void 0;var R=p.create,q=p.inst;b=R(),q.destroy=b}p=p.next}while(p!==T)}}catch(Z){gr(f,f.return,Z)}}function vo(u,f,p){try{var b=f.updateQueue,T=b!==null?b.lastEffect:null;if(T!==null){var R=T.next;b=R;do{if((b.tag&u)===u){var q=b.inst,Z=q.destroy;if(Z!==void 0){q.destroy=void 0,T=f;var ve=p,Ce=Z;try{Ce()}catch(Le){gr(T,ve,Le)}}}b=b.next}while(b!==R)}}catch(Le){gr(f,f.return,Le)}}function oE(u){var f=u.updateQueue;if(f!==null){var p=u.stateNode;try{Z5(f,p)}catch(b){gr(u,u.return,b)}}}function lE(u,f,p){p.props=Il(u.type,u.memoizedProps),p.state=u.memoizedState;try{p.componentWillUnmount()}catch(b){gr(u,f,b)}}function Gh(u,f){try{var p=u.ref;if(p!==null){switch(u.tag){case 26:case 27:case 5:var b=u.stateNode;break;case 30:b=u.stateNode;break;default:b=u.stateNode}typeof p=="function"?u.refCleanup=p(b):p.current=b}}catch(T){gr(u,f,T)}}function Ua(u,f){var p=u.ref,b=u.refCleanup;if(p!==null)if(typeof b=="function")try{b()}catch(T){gr(u,f,T)}finally{u.refCleanup=null,u=u.alternate,u!=null&&(u.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(T){gr(u,f,T)}else p.current=null}function uE(u){var f=u.type,p=u.memoizedProps,b=u.stateNode;try{e:switch(f){case"button":case"input":case"select":case"textarea":p.autoFocus&&b.focus();break e;case"img":p.src?b.src=p.src:p.srcSet&&(b.srcset=p.srcSet)}}catch(T){gr(u,u.return,T)}}function yy(u,f,p){try{var b=u.stateNode;rk(b,u.type,p,f),b[Lr]=f}catch(T){gr(u,u.return,T)}}function cE(u){return u.tag===5||u.tag===3||u.tag===26||u.tag===27&&_o(u.type)||u.tag===4}function by(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||cE(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&u.tag!==18;){if(u.tag===27&&_o(u.type)||u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function xy(u,f,p){var b=u.tag;if(b===5||b===6)u=u.stateNode,f?(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p).insertBefore(u,f):(f=p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,f.appendChild(u),p=p._reactRootContainer,p!=null||f.onclick!==null||(f.onclick=vs));else if(b!==4&&(b===27&&_o(u.type)&&(p=u.stateNode,f=null),u=u.child,u!==null))for(xy(u,f,p),u=u.sibling;u!==null;)xy(u,f,p),u=u.sibling}function A0(u,f,p){var b=u.tag;if(b===5||b===6)u=u.stateNode,f?p.insertBefore(u,f):p.appendChild(u);else if(b!==4&&(b===27&&_o(u.type)&&(p=u.stateNode),u=u.child,u!==null))for(A0(u,f,p),u=u.sibling;u!==null;)A0(u,f,p),u=u.sibling}function hE(u){var f=u.stateNode,p=u.memoizedProps;try{for(var b=u.type,T=f.attributes;T.length;)f.removeAttributeNode(T[0]);qn(f,b,p),f[nr]=u,f[Lr]=p}catch(R){gr(u,u.return,R)}}var Es=!1,yn=!1,_y=!1,fE=typeof WeakSet=="function"?WeakSet:Set,Ln=null;function LL(u,f){if(u=u.containerInfo,Hy=W0,u=E5(u),vm(u)){if("selectionStart"in u)var p={start:u.selectionStart,end:u.selectionEnd};else e:{p=(p=u.ownerDocument)&&p.defaultView||window;var b=p.getSelection&&p.getSelection();if(b&&b.rangeCount!==0){p=b.anchorNode;var T=b.anchorOffset,R=b.focusNode;b=b.focusOffset;try{p.nodeType,R.nodeType}catch{p=null;break e}var q=0,Z=-1,ve=-1,Ce=0,Le=0,ze=u,Me=null;t:for(;;){for(var Ie;ze!==p||T!==0&&ze.nodeType!==3||(Z=q+T),ze!==R||b!==0&&ze.nodeType!==3||(ve=q+b),ze.nodeType===3&&(q+=ze.nodeValue.length),(Ie=ze.firstChild)!==null;)Me=ze,ze=Ie;for(;;){if(ze===u)break t;if(Me===p&&++Ce===T&&(Z=q),Me===R&&++Le===b&&(ve=q),(Ie=ze.nextSibling)!==null)break;ze=Me,Me=ze.parentNode}ze=Ie}p=Z===-1||ve===-1?null:{start:Z,end:ve}}else p=null}p=p||{start:0,end:0}}else p=null;for(jy={focusedElem:u,selectionRange:p},W0=!1,Ln=f;Ln!==null;)if(f=Ln,u=f.child,(f.subtreeFlags&1028)!==0&&u!==null)u.return=f,Ln=u;else for(;Ln!==null;){switch(f=Ln,R=f.alternate,u=f.flags,f.tag){case 0:if((u&4)!==0&&(u=f.updateQueue,u=u!==null?u.events:null,u!==null))for(p=0;p<u.length;p++)T=u[p],T.ref.impl=T.nextImpl;break;case 11:case 15:break;case 1:if((u&1024)!==0&&R!==null){u=void 0,p=f,T=R.memoizedProps,R=R.memoizedState,b=p.stateNode;try{var gt=Il(p.type,T);u=b.getSnapshotBeforeUpdate(gt,R),b.__reactInternalSnapshotBeforeUpdate=u}catch(At){gr(p,p.return,At)}}break;case 3:if((u&1024)!==0){if(u=f.stateNode.containerInfo,p=u.nodeType,p===9)Xy(u);else if(p===1)switch(u.nodeName){case"HEAD":case"HTML":case"BODY":Xy(u);break;default:u.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((u&1024)!==0)throw Error(n(163))}if(u=f.sibling,u!==null){u.return=f.return,Ln=u;break}Ln=f.return}}function dE(u,f,p){var b=p.flags;switch(p.tag){case 0:case 11:case 15:Cs(u,p),b&4&&Uh(5,p);break;case 1:if(Cs(u,p),b&4)if(u=p.stateNode,f===null)try{u.componentDidMount()}catch(q){gr(p,p.return,q)}else{var T=Il(p.type,f.memoizedProps);f=f.memoizedState;try{u.componentDidUpdate(T,f,u.__reactInternalSnapshotBeforeUpdate)}catch(q){gr(p,p.return,q)}}b&64&&oE(p),b&512&&Gh(p,p.return);break;case 3:if(Cs(u,p),b&64&&(u=p.updateQueue,u!==null)){if(f=null,p.child!==null)switch(p.child.tag){case 27:case 5:f=p.child.stateNode;break;case 1:f=p.child.stateNode}try{Z5(u,f)}catch(q){gr(p,p.return,q)}}break;case 27:f===null&&b&4&&hE(p);case 26:case 5:Cs(u,p),f===null&&b&4&&uE(p),b&512&&Gh(p,p.return);break;case 12:Cs(u,p);break;case 31:Cs(u,p),b&4&&gE(u,p);break;case 13:Cs(u,p),b&4&&mE(u,p),b&64&&(u=p.memoizedState,u!==null&&(u=u.dehydrated,u!==null&&(p=VL.bind(null,p),ck(u,p))));break;case 22:if(b=p.memoizedState!==null||Es,!b){f=f!==null&&f.memoizedState!==null||yn,T=Es;var R=yn;Es=b,(yn=f)&&!R?As(u,p,(p.subtreeFlags&8772)!==0):Cs(u,p),Es=T,yn=R}break;case 30:break;default:Cs(u,p)}}function vE(u){var f=u.alternate;f!==null&&(u.alternate=null,vE(f)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(f=u.stateNode,f!==null&&Ut(f)),u.stateNode=null,u.return=null,u.dependencies=null,u.memoizedProps=null,u.memoizedState=null,u.pendingProps=null,u.stateNode=null,u.updateQueue=null}var Gr=null,yi=!1;function Ts(u,f,p){for(p=p.child;p!==null;)pE(u,f,p),p=p.sibling}function pE(u,f,p){if(ne&&typeof ne.onCommitFiberUnmount=="function")try{ne.onCommitFiberUnmount(Q,p)}catch{}switch(p.tag){case 26:yn||Ua(p,f),Ts(u,f,p),p.memoizedState?p.memoizedState.count--:p.stateNode&&(p=p.stateNode,p.parentNode.removeChild(p));break;case 27:yn||Ua(p,f);var b=Gr,T=yi;_o(p.type)&&(Gr=p.stateNode,yi=!1),Ts(u,f,p),Kh(p.stateNode),Gr=b,yi=T;break;case 5:yn||Ua(p,f);case 6:if(b=Gr,T=yi,Gr=null,Ts(u,f,p),Gr=b,yi=T,Gr!==null)if(yi)try{(Gr.nodeType===9?Gr.body:Gr.nodeName==="HTML"?Gr.ownerDocument.body:Gr).removeChild(p.stateNode)}catch(R){gr(p,f,R)}else try{Gr.removeChild(p.stateNode)}catch(R){gr(p,f,R)}break;case 18:Gr!==null&&(yi?(u=Gr,oT(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,p.stateNode),ac(u)):oT(Gr,p.stateNode));break;case 4:b=Gr,T=yi,Gr=p.stateNode.containerInfo,yi=!0,Ts(u,f,p),Gr=b,yi=T;break;case 0:case 11:case 14:case 15:vo(2,p,f),yn||vo(4,p,f),Ts(u,f,p);break;case 1:yn||(Ua(p,f),b=p.stateNode,typeof b.componentWillUnmount=="function"&&lE(p,f,b)),Ts(u,f,p);break;case 21:Ts(u,f,p);break;case 22:yn=(b=yn)||p.memoizedState!==null,Ts(u,f,p),yn=b;break;default:Ts(u,f,p)}}function gE(u,f){if(f.memoizedState===null&&(u=f.alternate,u!==null&&(u=u.memoizedState,u!==null))){u=u.dehydrated;try{ac(u)}catch(p){gr(f,f.return,p)}}}function mE(u,f){if(f.memoizedState===null&&(u=f.alternate,u!==null&&(u=u.memoizedState,u!==null&&(u=u.dehydrated,u!==null))))try{ac(u)}catch(p){gr(f,f.return,p)}}function kL(u){switch(u.tag){case 31:case 13:case 19:var f=u.stateNode;return f===null&&(f=u.stateNode=new fE),f;case 22:return u=u.stateNode,f=u._retryCache,f===null&&(f=u._retryCache=new fE),f;default:throw Error(n(435,u.tag))}}function M0(u,f){var p=kL(u);f.forEach(function(b){if(!p.has(b)){p.add(b);var T=qL.bind(null,u,b);b.then(T,T)}})}function bi(u,f){var p=f.deletions;if(p!==null)for(var b=0;b<p.length;b++){var T=p[b],R=u,q=f,Z=q;e:for(;Z!==null;){switch(Z.tag){case 27:if(_o(Z.type)){Gr=Z.stateNode,yi=!1;break e}break;case 5:Gr=Z.stateNode,yi=!1;break e;case 3:case 4:Gr=Z.stateNode.containerInfo,yi=!0;break e}Z=Z.return}if(Gr===null)throw Error(n(160));pE(R,q,T),Gr=null,yi=!1,R=T.alternate,R!==null&&(R.return=null),T.return=null}if(f.subtreeFlags&13886)for(f=f.child;f!==null;)yE(f,u),f=f.sibling}var Ea=null;function yE(u,f){var p=u.alternate,b=u.flags;switch(u.tag){case 0:case 11:case 14:case 15:bi(f,u),xi(u),b&4&&(vo(3,u,u.return),Uh(3,u),vo(5,u,u.return));break;case 1:bi(f,u),xi(u),b&512&&(yn||p===null||Ua(p,p.return)),b&64&&Es&&(u=u.updateQueue,u!==null&&(b=u.callbacks,b!==null&&(p=u.shared.hiddenCallbacks,u.shared.hiddenCallbacks=p===null?b:p.concat(b))));break;case 26:var T=Ea;if(bi(f,u),xi(u),b&512&&(yn||p===null||Ua(p,p.return)),b&4){var R=p!==null?p.memoizedState:null;if(b=u.memoizedState,p===null)if(b===null)if(u.stateNode===null){e:{b=u.type,p=u.memoizedProps,T=T.ownerDocument||T;t:switch(b){case"title":R=T.getElementsByTagName("title")[0],(!R||R[lt]||R[nr]||R.namespaceURI==="http://www.w3.org/2000/svg"||R.hasAttribute("itemprop"))&&(R=T.createElement(b),T.head.insertBefore(R,T.querySelector("head > title"))),qn(R,b,p),R[nr]=u,cr(R),b=R;break e;case"link":var q=yT("link","href",T).get(b+(p.href||""));if(q){for(var Z=0;Z<q.length;Z++)if(R=q[Z],R.getAttribute("href")===(p.href==null||p.href===""?null:p.href)&&R.getAttribute("rel")===(p.rel==null?null:p.rel)&&R.getAttribute("title")===(p.title==null?null:p.title)&&R.getAttribute("crossorigin")===(p.crossOrigin==null?null:p.crossOrigin)){q.splice(Z,1);break t}}R=T.createElement(b),qn(R,b,p),T.head.appendChild(R);break;case"meta":if(q=yT("meta","content",T).get(b+(p.content||""))){for(Z=0;Z<q.length;Z++)if(R=q[Z],R.getAttribute("content")===(p.content==null?null:""+p.content)&&R.getAttribute("name")===(p.name==null?null:p.name)&&R.getAttribute("property")===(p.property==null?null:p.property)&&R.getAttribute("http-equiv")===(p.httpEquiv==null?null:p.httpEquiv)&&R.getAttribute("charset")===(p.charSet==null?null:p.charSet)){q.splice(Z,1);break t}}R=T.createElement(b),qn(R,b,p),T.head.appendChild(R);break;default:throw Error(n(468,b))}R[nr]=u,cr(R),b=R}u.stateNode=b}else bT(T,u.type,u.stateNode);else u.stateNode=mT(T,b,u.memoizedProps);else R!==b?(R===null?p.stateNode!==null&&(p=p.stateNode,p.parentNode.removeChild(p)):R.count--,b===null?bT(T,u.type,u.stateNode):mT(T,b,u.memoizedProps)):b===null&&u.stateNode!==null&&yy(u,u.memoizedProps,p.memoizedProps)}break;case 27:bi(f,u),xi(u),b&512&&(yn||p===null||Ua(p,p.return)),p!==null&&b&4&&yy(u,u.memoizedProps,p.memoizedProps);break;case 5:if(bi(f,u),xi(u),b&512&&(yn||p===null||Ua(p,p.return)),u.flags&32){T=u.stateNode;try{Mu(T,"")}catch(gt){gr(u,u.return,gt)}}b&4&&u.stateNode!=null&&(T=u.memoizedProps,yy(u,T,p!==null?p.memoizedProps:T)),b&1024&&(_y=!0);break;case 6:if(bi(f,u),xi(u),b&4){if(u.stateNode===null)throw Error(n(162));b=u.memoizedProps,p=u.stateNode;try{p.nodeValue=b}catch(gt){gr(u,u.return,gt)}}break;case 3:if(V0=null,T=Ea,Ea=H0(f.containerInfo),bi(f,u),Ea=T,xi(u),b&4&&p!==null&&p.memoizedState.isDehydrated)try{ac(f.containerInfo)}catch(gt){gr(u,u.return,gt)}_y&&(_y=!1,bE(u));break;case 4:b=Ea,Ea=H0(u.stateNode.containerInfo),bi(f,u),xi(u),Ea=b;break;case 12:bi(f,u),xi(u);break;case 31:bi(f,u),xi(u),b&4&&(b=u.updateQueue,b!==null&&(u.updateQueue=null,M0(u,b)));break;case 13:bi(f,u),xi(u),u.child.flags&8192&&u.memoizedState!==null!=(p!==null&&p.memoizedState!==null)&&(O0=Ze()),b&4&&(b=u.updateQueue,b!==null&&(u.updateQueue=null,M0(u,b)));break;case 22:T=u.memoizedState!==null;var ve=p!==null&&p.memoizedState!==null,Ce=Es,Le=yn;if(Es=Ce||T,yn=Le||ve,bi(f,u),yn=Le,Es=Ce,xi(u),b&8192)e:for(f=u.stateNode,f._visibility=T?f._visibility&-2:f._visibility|1,T&&(p===null||ve||Es||yn||Nl(u)),p=null,f=u;;){if(f.tag===5||f.tag===26){if(p===null){ve=p=f;try{if(R=ve.stateNode,T)q=R.style,typeof q.setProperty=="function"?q.setProperty("display","none","important"):q.display="none";else{Z=ve.stateNode;var ze=ve.memoizedProps.style,Me=ze!=null&&ze.hasOwnProperty("display")?ze.display:null;Z.style.display=Me==null||typeof Me=="boolean"?"":(""+Me).trim()}}catch(gt){gr(ve,ve.return,gt)}}}else if(f.tag===6){if(p===null){ve=f;try{ve.stateNode.nodeValue=T?"":ve.memoizedProps}catch(gt){gr(ve,ve.return,gt)}}}else if(f.tag===18){if(p===null){ve=f;try{var Ie=ve.stateNode;T?lT(Ie,!0):lT(ve.stateNode,!1)}catch(gt){gr(ve,ve.return,gt)}}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===u)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===u)break e;for(;f.sibling===null;){if(f.return===null||f.return===u)break e;p===f&&(p=null),f=f.return}p===f&&(p=null),f.sibling.return=f.return,f=f.sibling}b&4&&(b=u.updateQueue,b!==null&&(p=b.retryQueue,p!==null&&(b.retryQueue=null,M0(u,p))));break;case 19:bi(f,u),xi(u),b&4&&(b=u.updateQueue,b!==null&&(u.updateQueue=null,M0(u,b)));break;case 30:break;case 21:break;default:bi(f,u),xi(u)}}function xi(u){var f=u.flags;if(f&2){try{for(var p,b=u.return;b!==null;){if(cE(b)){p=b;break}b=b.return}if(p==null)throw Error(n(160));switch(p.tag){case 27:var T=p.stateNode,R=by(u);A0(u,R,T);break;case 5:var q=p.stateNode;p.flags&32&&(Mu(q,""),p.flags&=-33);var Z=by(u);A0(u,Z,q);break;case 3:case 4:var ve=p.stateNode.containerInfo,Ce=by(u);xy(u,Ce,ve);break;default:throw Error(n(161))}}catch(Le){gr(u,u.return,Le)}u.flags&=-3}f&4096&&(u.flags&=-4097)}function bE(u){if(u.subtreeFlags&1024)for(u=u.child;u!==null;){var f=u;bE(f),f.tag===5&&f.flags&1024&&f.stateNode.reset(),u=u.sibling}}function Cs(u,f){if(f.subtreeFlags&8772)for(f=f.child;f!==null;)dE(u,f.alternate,f),f=f.sibling}function Nl(u){for(u=u.child;u!==null;){var f=u;switch(f.tag){case 0:case 11:case 14:case 15:vo(4,f,f.return),Nl(f);break;case 1:Ua(f,f.return);var p=f.stateNode;typeof p.componentWillUnmount=="function"&&lE(f,f.return,p),Nl(f);break;case 27:Kh(f.stateNode);case 26:case 5:Ua(f,f.return),Nl(f);break;case 22:f.memoizedState===null&&Nl(f);break;case 30:Nl(f);break;default:Nl(f)}u=u.sibling}}function As(u,f,p){for(p=p&&(f.subtreeFlags&8772)!==0,f=f.child;f!==null;){var b=f.alternate,T=u,R=f,q=R.flags;switch(R.tag){case 0:case 11:case 15:As(T,R,p),Uh(4,R);break;case 1:if(As(T,R,p),b=R,T=b.stateNode,typeof T.componentDidMount=="function")try{T.componentDidMount()}catch(Ce){gr(b,b.return,Ce)}if(b=R,T=b.updateQueue,T!==null){var Z=b.stateNode;try{var ve=T.shared.hiddenCallbacks;if(ve!==null)for(T.shared.hiddenCallbacks=null,T=0;T<ve.length;T++)K5(ve[T],Z)}catch(Ce){gr(b,b.return,Ce)}}p&&q&64&&oE(R),Gh(R,R.return);break;case 27:hE(R);case 26:case 5:As(T,R,p),p&&b===null&&q&4&&uE(R),Gh(R,R.return);break;case 12:As(T,R,p);break;case 31:As(T,R,p),p&&q&4&&gE(T,R);break;case 13:As(T,R,p),p&&q&4&&mE(T,R);break;case 22:R.memoizedState===null&&As(T,R,p),Gh(R,R.return);break;case 30:break;default:As(T,R,p)}f=f.sibling}}function wy(u,f){var p=null;u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(p=u.memoizedState.cachePool.pool),u=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(u=f.memoizedState.cachePool.pool),u!==p&&(u!=null&&u.refCount++,p!=null&&Ah(p))}function Sy(u,f){u=null,f.alternate!==null&&(u=f.alternate.memoizedState.cache),f=f.memoizedState.cache,f!==u&&(f.refCount++,u!=null&&Ah(u))}function Ta(u,f,p,b){if(f.subtreeFlags&10256)for(f=f.child;f!==null;)xE(u,f,p,b),f=f.sibling}function xE(u,f,p,b){var T=f.flags;switch(f.tag){case 0:case 11:case 15:Ta(u,f,p,b),T&2048&&Uh(9,f);break;case 1:Ta(u,f,p,b);break;case 3:Ta(u,f,p,b),T&2048&&(u=null,f.alternate!==null&&(u=f.alternate.memoizedState.cache),f=f.memoizedState.cache,f!==u&&(f.refCount++,u!=null&&Ah(u)));break;case 12:if(T&2048){Ta(u,f,p,b),u=f.stateNode;try{var R=f.memoizedProps,q=R.id,Z=R.onPostCommit;typeof Z=="function"&&Z(q,f.alternate===null?"mount":"update",u.passiveEffectDuration,-0)}catch(ve){gr(f,f.return,ve)}}else Ta(u,f,p,b);break;case 31:Ta(u,f,p,b);break;case 13:Ta(u,f,p,b);break;case 23:break;case 22:R=f.stateNode,q=f.alternate,f.memoizedState!==null?R._visibility&2?Ta(u,f,p,b):Hh(u,f):R._visibility&2?Ta(u,f,p,b):(R._visibility|=2,Wu(u,f,p,b,(f.subtreeFlags&10256)!==0||!1)),T&2048&&wy(q,f);break;case 24:Ta(u,f,p,b),T&2048&&Sy(f.alternate,f);break;default:Ta(u,f,p,b)}}function Wu(u,f,p,b,T){for(T=T&&((f.subtreeFlags&10256)!==0||!1),f=f.child;f!==null;){var R=u,q=f,Z=p,ve=b,Ce=q.flags;switch(q.tag){case 0:case 11:case 15:Wu(R,q,Z,ve,T),Uh(8,q);break;case 23:break;case 22:var Le=q.stateNode;q.memoizedState!==null?Le._visibility&2?Wu(R,q,Z,ve,T):Hh(R,q):(Le._visibility|=2,Wu(R,q,Z,ve,T)),T&&Ce&2048&&wy(q.alternate,q);break;case 24:Wu(R,q,Z,ve,T),T&&Ce&2048&&Sy(q.alternate,q);break;default:Wu(R,q,Z,ve,T)}f=f.sibling}}function Hh(u,f){if(f.subtreeFlags&10256)for(f=f.child;f!==null;){var p=u,b=f,T=b.flags;switch(b.tag){case 22:Hh(p,b),T&2048&&wy(b.alternate,b);break;case 24:Hh(p,b),T&2048&&Sy(b.alternate,b);break;default:Hh(p,b)}f=f.sibling}}var jh=8192;function $u(u,f,p){if(u.subtreeFlags&jh)for(u=u.child;u!==null;)_E(u,f,p),u=u.sibling}function _E(u,f,p){switch(u.tag){case 26:$u(u,f,p),u.flags&jh&&u.memoizedState!==null&&wk(p,Ea,u.memoizedState,u.memoizedProps);break;case 5:$u(u,f,p);break;case 3:case 4:var b=Ea;Ea=H0(u.stateNode.containerInfo),$u(u,f,p),Ea=b;break;case 22:u.memoizedState===null&&(b=u.alternate,b!==null&&b.memoizedState!==null?(b=jh,jh=16777216,$u(u,f,p),jh=b):$u(u,f,p));break;default:$u(u,f,p)}}function wE(u){var f=u.alternate;if(f!==null&&(u=f.child,u!==null)){f.child=null;do f=u.sibling,u.sibling=null,u=f;while(u!==null)}}function Vh(u){var f=u.deletions;if((u.flags&16)!==0){if(f!==null)for(var p=0;p<f.length;p++){var b=f[p];Ln=b,EE(b,u)}wE(u)}if(u.subtreeFlags&10256)for(u=u.child;u!==null;)SE(u),u=u.sibling}function SE(u){switch(u.tag){case 0:case 11:case 15:Vh(u),u.flags&2048&&vo(9,u,u.return);break;case 3:Vh(u);break;case 12:Vh(u);break;case 22:var f=u.stateNode;u.memoizedState!==null&&f._visibility&2&&(u.return===null||u.return.tag!==13)?(f._visibility&=-3,R0(u)):Vh(u);break;default:Vh(u)}}function R0(u){var f=u.deletions;if((u.flags&16)!==0){if(f!==null)for(var p=0;p<f.length;p++){var b=f[p];Ln=b,EE(b,u)}wE(u)}for(u=u.child;u!==null;){switch(f=u,f.tag){case 0:case 11:case 15:vo(8,f,f.return),R0(f);break;case 22:p=f.stateNode,p._visibility&2&&(p._visibility&=-3,R0(f));break;default:R0(f)}u=u.sibling}}function EE(u,f){for(;Ln!==null;){var p=Ln;switch(p.tag){case 0:case 11:case 15:vo(8,p,f);break;case 23:case 22:if(p.memoizedState!==null&&p.memoizedState.cachePool!==null){var b=p.memoizedState.cachePool.pool;b!=null&&b.refCount++}break;case 24:Ah(p.memoizedState.cache)}if(b=p.child,b!==null)b.return=p,Ln=b;else e:for(p=u;Ln!==null;){b=Ln;var T=b.sibling,R=b.return;if(vE(b),b===p){Ln=null;break e}if(T!==null){T.return=R,Ln=T;break e}Ln=R}}}var BL={getCacheForType:function(u){var f=jn(pn),p=f.data.get(u);return p===void 0&&(p=u(),f.data.set(u,p)),p},cacheSignal:function(){return jn(pn).controller.signal}},FL=typeof WeakMap=="function"?WeakMap:Map,ir=0,Er=null,Gt=null,qt=0,pr=0,Fi=null,po=!1,Ku=!1,Ey=!1,Ms=0,sn=0,go=0,Ll=0,Ty=0,zi=0,Zu=0,qh=null,_i=null,Cy=!1,O0=0,TE=0,D0=1/0,P0=null,mo=null,Cn=0,yo=null,Qu=null,Rs=0,Ay=0,My=null,CE=null,Xh=0,Ry=null;function Ui(){return(ir&2)!==0&&qt!==0?qt&-qt:P.T!==null?Ly():vr()}function AE(){if(zi===0)if((qt&536870912)===0||Yt){var u=J;J<<=1,(J&3932160)===0&&(J=262144),zi=u}else zi=536870912;return u=ki.current,u!==null&&(u.flags|=32),zi}function wi(u,f,p){(u===Er&&(pr===2||pr===9)||u.cancelPendingCommit!==null)&&(Ju(u,0),bo(u,qt,zi,!1)),jt(u,p),((ir&2)===0||u!==Er)&&(u===Er&&((ir&2)===0&&(Ll|=p),sn===4&&bo(u,qt,zi,!1)),Ga(u))}function ME(u,f,p){if((ir&6)!==0)throw Error(n(327));var b=!p&&(f&127)===0&&(f&u.expiredLanes)===0||je(u,f),T=b?GL(u,f):Dy(u,f,!0),R=b;do{if(T===0){Ku&&!b&&bo(u,f,0,!1);break}else{if(p=u.current.alternate,R&&!zL(p)){T=Dy(u,f,!1),R=!1;continue}if(T===2){if(R=f,u.errorRecoveryDisabledLanes&R)var q=0;else q=u.pendingLanes&-536870913,q=q!==0?q:q&536870912?536870912:0;if(q!==0){f=q;e:{var Z=u;T=qh;var ve=Z.current.memoizedState.isDehydrated;if(ve&&(Ju(Z,q).flags|=256),q=Dy(Z,q,!1),q!==2){if(Ey&&!ve){Z.errorRecoveryDisabledLanes|=R,Ll|=R,T=4;break e}R=_i,_i=T,R!==null&&(_i===null?_i=R:_i.push.apply(_i,R))}T=q}if(R=!1,T!==2)continue}}if(T===1){Ju(u,0),bo(u,f,0,!0);break}e:{switch(b=u,R=T,R){case 0:case 1:throw Error(n(345));case 4:if((f&4194048)!==f)break;case 6:bo(b,f,zi,!po);break e;case 2:_i=null;break;case 3:case 5:break;default:throw Error(n(329))}if((f&62914560)===f&&(T=O0+300-Ze(),10<T)){if(bo(b,f,zi,!po),Ue(b,0,!0)!==0)break e;Rs=f,b.timeoutHandle=aT(RE.bind(null,b,p,_i,P0,Cy,f,zi,Ll,Zu,po,R,"Throttled",-0,0),T);break e}RE(b,p,_i,P0,Cy,f,zi,Ll,Zu,po,R,null,-0,0)}}break}while(!0);Ga(u)}function RE(u,f,p,b,T,R,q,Z,ve,Ce,Le,ze,Me,Ie){if(u.timeoutHandle=-1,ze=f.subtreeFlags,ze&8192||(ze&16785408)===16785408){ze={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:vs},_E(f,R,ze);var gt=(R&62914560)===R?O0-Ze():(R&4194048)===R?TE-Ze():0;if(gt=Sk(ze,gt),gt!==null){Rs=R,u.cancelPendingCommit=gt(BE.bind(null,u,f,R,p,b,T,q,Z,ve,Le,ze,null,Me,Ie)),bo(u,R,q,!Ce);return}}BE(u,f,R,p,b,T,q,Z,ve)}function zL(u){for(var f=u;;){var p=f.tag;if((p===0||p===11||p===15)&&f.flags&16384&&(p=f.updateQueue,p!==null&&(p=p.stores,p!==null)))for(var b=0;b<p.length;b++){var T=p[b],R=T.getSnapshot;T=T.value;try{if(!Ni(R(),T))return!1}catch{return!1}}if(p=f.child,f.subtreeFlags&16384&&p!==null)p.return=f,f=p;else{if(f===u)break;for(;f.sibling===null;){if(f.return===null||f.return===u)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function bo(u,f,p,b){f&=~Ty,f&=~Ll,u.suspendedLanes|=f,u.pingedLanes&=~f,b&&(u.warmLanes|=f),b=u.expirationTimes;for(var T=f;0<T;){var R=31-ee(T),q=1<<R;b[R]=-1,T&=~q}p!==0&&Vt(u,p,f)}function I0(){return(ir&6)===0?(Yh(0),!1):!0}function Oy(){if(Gt!==null){if(pr===0)var u=Gt.return;else u=Gt,ys=Cl=null,Xm(u),ju=null,Rh=0,u=Gt;for(;u!==null;)sE(u.alternate,u),u=u.return;Gt=null}}function Ju(u,f){var p=u.timeoutHandle;p!==-1&&(u.timeoutHandle=-1,ak(p)),p=u.cancelPendingCommit,p!==null&&(u.cancelPendingCommit=null,p()),Rs=0,Oy(),Er=u,Gt=p=gs(u.current,null),qt=f,pr=0,Fi=null,po=!1,Ku=je(u,f),Ey=!1,Zu=zi=Ty=Ll=go=sn=0,_i=qh=null,Cy=!1,(f&8)!==0&&(f|=f&32);var b=u.entangledLanes;if(b!==0)for(u=u.entanglements,b&=f;0<b;){var T=31-ee(b),R=1<<T;f|=u[T],b&=~R}return Ms=f,e0(),p}function OE(u,f){Nt=null,P.H=Bh,f===Hu||f===l0?(f=X5(),pr=3):f===Nm?(f=X5(),pr=4):pr=f===ly?8:f!==null&&typeof f=="object"&&typeof f.then=="function"?6:1,Fi=f,Gt===null&&(sn=1,w0(u,Ji(f,u.current)))}function DE(){var u=ki.current;return u===null?!0:(qt&4194048)===qt?na===null:(qt&62914560)===qt||(qt&536870912)!==0?u===na:!1}function PE(){var u=P.H;return P.H=Bh,u===null?Bh:u}function IE(){var u=P.A;return P.A=BL,u}function N0(){sn=4,po||(qt&4194048)!==qt&&ki.current!==null||(Ku=!0),(go&134217727)===0&&(Ll&134217727)===0||Er===null||bo(Er,qt,zi,!1)}function Dy(u,f,p){var b=ir;ir|=2;var T=PE(),R=IE();(Er!==u||qt!==f)&&(P0=null,Ju(u,f)),f=!1;var q=sn;e:do try{if(pr!==0&&Gt!==null){var Z=Gt,ve=Fi;switch(pr){case 8:Oy(),q=6;break e;case 3:case 2:case 9:case 6:ki.current===null&&(f=!0);var Ce=pr;if(pr=0,Fi=null,ec(u,Z,ve,Ce),p&&Ku){q=0;break e}break;default:Ce=pr,pr=0,Fi=null,ec(u,Z,ve,Ce)}}UL(),q=sn;break}catch(Le){OE(u,Le)}while(!0);return f&&u.shellSuspendCounter++,ys=Cl=null,ir=b,P.H=T,P.A=R,Gt===null&&(Er=null,qt=0,e0()),q}function UL(){for(;Gt!==null;)NE(Gt)}function GL(u,f){var p=ir;ir|=2;var b=PE(),T=IE();Er!==u||qt!==f?(P0=null,D0=Ze()+500,Ju(u,f)):Ku=je(u,f);e:do try{if(pr!==0&&Gt!==null){f=Gt;var R=Fi;t:switch(pr){case 1:pr=0,Fi=null,ec(u,f,R,1);break;case 2:case 9:if(V5(R)){pr=0,Fi=null,LE(f);break}f=function(){pr!==2&&pr!==9||Er!==u||(pr=7),Ga(u)},R.then(f,f);break e;case 3:pr=7;break e;case 4:pr=5;break e;case 7:V5(R)?(pr=0,Fi=null,LE(f)):(pr=0,Fi=null,ec(u,f,R,7));break;case 5:var q=null;switch(Gt.tag){case 26:q=Gt.memoizedState;case 5:case 27:var Z=Gt;if(q?xT(q):Z.stateNode.complete){pr=0,Fi=null;var ve=Z.sibling;if(ve!==null)Gt=ve;else{var Ce=Z.return;Ce!==null?(Gt=Ce,L0(Ce)):Gt=null}break t}}pr=0,Fi=null,ec(u,f,R,5);break;case 6:pr=0,Fi=null,ec(u,f,R,6);break;case 8:Oy(),sn=6;break e;default:throw Error(n(462))}}HL();break}catch(Le){OE(u,Le)}while(!0);return ys=Cl=null,P.H=b,P.A=T,ir=p,Gt!==null?0:(Er=null,qt=0,e0(),sn)}function HL(){for(;Gt!==null&&!ot();)NE(Gt)}function NE(u){var f=iE(u.alternate,u,Ms);u.memoizedProps=u.pendingProps,f===null?L0(u):Gt=f}function LE(u){var f=u,p=f.alternate;switch(f.tag){case 15:case 0:f=QS(p,f,f.pendingProps,f.type,void 0,qt);break;case 11:f=QS(p,f,f.pendingProps,f.type.render,f.ref,qt);break;case 5:Xm(f);default:sE(p,f),f=Gt=I5(f,Ms),f=iE(p,f,Ms)}u.memoizedProps=u.pendingProps,f===null?L0(u):Gt=f}function ec(u,f,p,b){ys=Cl=null,Xm(f),ju=null,Rh=0;var T=f.return;try{if(OL(u,T,f,p,qt)){sn=1,w0(u,Ji(p,u.current)),Gt=null;return}}catch(R){if(T!==null)throw Gt=T,R;sn=1,w0(u,Ji(p,u.current)),Gt=null;return}f.flags&32768?(Yt||b===1?u=!0:Ku||(qt&536870912)!==0?u=!1:(po=u=!0,(b===2||b===9||b===3||b===6)&&(b=ki.current,b!==null&&b.tag===13&&(b.flags|=16384))),kE(f,u)):L0(f)}function L0(u){var f=u;do{if((f.flags&32768)!==0){kE(f,po);return}u=f.return;var p=IL(f.alternate,f,Ms);if(p!==null){Gt=p;return}if(f=f.sibling,f!==null){Gt=f;return}Gt=f=u}while(f!==null);sn===0&&(sn=5)}function kE(u,f){do{var p=NL(u.alternate,u);if(p!==null){p.flags&=32767,Gt=p;return}if(p=u.return,p!==null&&(p.flags|=32768,p.subtreeFlags=0,p.deletions=null),!f&&(u=u.sibling,u!==null)){Gt=u;return}Gt=u=p}while(u!==null);sn=6,Gt=null}function BE(u,f,p,b,T,R,q,Z,ve){u.cancelPendingCommit=null;do k0();while(Cn!==0);if((ir&6)!==0)throw Error(n(327));if(f!==null){if(f===u.current)throw Error(n(177));if(R=f.lanes|f.childLanes,R|=bm,Nr(u,p,R,q,Z,ve),u===Er&&(Gt=Er=null,qt=0),Qu=f,yo=u,Rs=p,Ay=R,My=T,CE=b,(f.subtreeFlags&10256)!==0||(f.flags&10256)!==0?(u.callbackNode=null,u.callbackPriority=0,XL(We,function(){return HE(),null})):(u.callbackNode=null,u.callbackPriority=0),b=(f.flags&13878)!==0,(f.subtreeFlags&13878)!==0||b){b=P.T,P.T=null,T=H.p,H.p=2,q=ir,ir|=4;try{LL(u,f,p)}finally{ir=q,H.p=T,P.T=b}}Cn=1,FE(),zE(),UE()}}function FE(){if(Cn===1){Cn=0;var u=yo,f=Qu,p=(f.flags&13878)!==0;if((f.subtreeFlags&13878)!==0||p){p=P.T,P.T=null;var b=H.p;H.p=2;var T=ir;ir|=4;try{yE(f,u);var R=jy,q=E5(u.containerInfo),Z=R.focusedElem,ve=R.selectionRange;if(q!==Z&&Z&&Z.ownerDocument&&S5(Z.ownerDocument.documentElement,Z)){if(ve!==null&&vm(Z)){var Ce=ve.start,Le=ve.end;if(Le===void 0&&(Le=Ce),"selectionStart"in Z)Z.selectionStart=Ce,Z.selectionEnd=Math.min(Le,Z.value.length);else{var ze=Z.ownerDocument||document,Me=ze&&ze.defaultView||window;if(Me.getSelection){var Ie=Me.getSelection(),gt=Z.textContent.length,At=Math.min(ve.start,gt),wr=ve.end===void 0?At:Math.min(ve.end,gt);!Ie.extend&&At>wr&&(q=wr,wr=At,At=q);var we=w5(Z,At),ge=w5(Z,wr);if(we&&ge&&(Ie.rangeCount!==1||Ie.anchorNode!==we.node||Ie.anchorOffset!==we.offset||Ie.focusNode!==ge.node||Ie.focusOffset!==ge.offset)){var Te=ze.createRange();Te.setStart(we.node,we.offset),Ie.removeAllRanges(),At>wr?(Ie.addRange(Te),Ie.extend(ge.node,ge.offset)):(Te.setEnd(ge.node,ge.offset),Ie.addRange(Te))}}}}for(ze=[],Ie=Z;Ie=Ie.parentNode;)Ie.nodeType===1&&ze.push({element:Ie,left:Ie.scrollLeft,top:Ie.scrollTop});for(typeof Z.focus=="function"&&Z.focus(),Z=0;Z<ze.length;Z++){var Fe=ze[Z];Fe.element.scrollLeft=Fe.left,Fe.element.scrollTop=Fe.top}}W0=!!Hy,jy=Hy=null}finally{ir=T,H.p=b,P.T=p}}u.current=f,Cn=2}}function zE(){if(Cn===2){Cn=0;var u=yo,f=Qu,p=(f.flags&8772)!==0;if((f.subtreeFlags&8772)!==0||p){p=P.T,P.T=null;var b=H.p;H.p=2;var T=ir;ir|=4;try{dE(u,f.alternate,f)}finally{ir=T,H.p=b,P.T=p}}Cn=3}}function UE(){if(Cn===4||Cn===3){Cn=0,ct();var u=yo,f=Qu,p=Rs,b=CE;(f.subtreeFlags&10256)!==0||(f.flags&10256)!==0?Cn=5:(Cn=0,Qu=yo=null,GE(u,u.pendingLanes));var T=u.pendingLanes;if(T===0&&(mo=null),In(p),f=f.stateNode,ne&&typeof ne.onCommitFiberRoot=="function")try{ne.onCommitFiberRoot(Q,f,void 0,(f.current.flags&128)===128)}catch{}if(b!==null){f=P.T,T=H.p,H.p=2,P.T=null;try{for(var R=u.onRecoverableError,q=0;q<b.length;q++){var Z=b[q];R(Z.value,{componentStack:Z.stack})}}finally{P.T=f,H.p=T}}(Rs&3)!==0&&k0(),Ga(u),T=u.pendingLanes,(p&261930)!==0&&(T&42)!==0?u===Ry?Xh++:(Xh=0,Ry=u):Xh=0,Yh(0)}}function GE(u,f){(u.pooledCacheLanes&=f)===0&&(f=u.pooledCache,f!=null&&(u.pooledCache=null,Ah(f)))}function k0(){return FE(),zE(),UE(),HE()}function HE(){if(Cn!==5)return!1;var u=yo,f=Ay;Ay=0;var p=In(Rs),b=P.T,T=H.p;try{H.p=32>p?32:p,P.T=null,p=My,My=null;var R=yo,q=Rs;if(Cn=0,Qu=yo=null,Rs=0,(ir&6)!==0)throw Error(n(331));var Z=ir;if(ir|=4,SE(R.current),xE(R,R.current,q,p),ir=Z,Yh(0,!1),ne&&typeof ne.onPostCommitFiberRoot=="function")try{ne.onPostCommitFiberRoot(Q,R)}catch{}return!0}finally{H.p=T,P.T=b,GE(u,f)}}function jE(u,f,p){f=Ji(p,f),f=oy(u.stateNode,f,2),u=co(u,f,2),u!==null&&(jt(u,2),Ga(u))}function gr(u,f,p){if(u.tag===3)jE(u,u,p);else for(;f!==null;){if(f.tag===3){jE(f,u,p);break}else if(f.tag===1){var b=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof b.componentDidCatch=="function"&&(mo===null||!mo.has(b))){u=Ji(p,u),p=VS(2),b=co(f,p,2),b!==null&&(qS(p,b,f,u),jt(b,2),Ga(b));break}}f=f.return}}function Py(u,f,p){var b=u.pingCache;if(b===null){b=u.pingCache=new FL;var T=new Set;b.set(f,T)}else T=b.get(f),T===void 0&&(T=new Set,b.set(f,T));T.has(p)||(Ey=!0,T.add(p),u=jL.bind(null,u,f,p),f.then(u,u))}function jL(u,f,p){var b=u.pingCache;b!==null&&b.delete(f),u.pingedLanes|=u.suspendedLanes&p,u.warmLanes&=~p,Er===u&&(qt&p)===p&&(sn===4||sn===3&&(qt&62914560)===qt&&300>Ze()-O0?(ir&2)===0&&Ju(u,0):Ty|=p,Zu===qt&&(Zu=0)),Ga(u)}function VE(u,f){f===0&&(f=vt()),u=Sl(u,f),u!==null&&(jt(u,f),Ga(u))}function VL(u){var f=u.memoizedState,p=0;f!==null&&(p=f.retryLane),VE(u,p)}function qL(u,f){var p=0;switch(u.tag){case 31:case 13:var b=u.stateNode,T=u.memoizedState;T!==null&&(p=T.retryLane);break;case 19:b=u.stateNode;break;case 22:b=u.stateNode._retryCache;break;default:throw Error(n(314))}b!==null&&b.delete(f),VE(u,p)}function XL(u,f){return He(u,f)}var B0=null,tc=null,Iy=!1,F0=!1,Ny=!1,xo=0;function Ga(u){u!==tc&&u.next===null&&(tc===null?B0=tc=u:tc=tc.next=u),F0=!0,Iy||(Iy=!0,WL())}function Yh(u,f){if(!Ny&&F0){Ny=!0;do for(var p=!1,b=B0;b!==null;){if(u!==0){var T=b.pendingLanes;if(T===0)var R=0;else{var q=b.suspendedLanes,Z=b.pingedLanes;R=(1<<31-ee(42|u)+1)-1,R&=T&~(q&~Z),R=R&201326741?R&201326741|1:R?R|2:0}R!==0&&(p=!0,WE(b,R))}else R=qt,R=Ue(b,b===Er?R:0,b.cancelPendingCommit!==null||b.timeoutHandle!==-1),(R&3)===0||je(b,R)||(p=!0,WE(b,R));b=b.next}while(p);Ny=!1}}function YL(){qE()}function qE(){F0=Iy=!1;var u=0;xo!==0&&ik()&&(u=xo);for(var f=Ze(),p=null,b=B0;b!==null;){var T=b.next,R=XE(b,f);R===0?(b.next=null,p===null?B0=T:p.next=T,T===null&&(tc=p)):(p=b,(u!==0||(R&3)!==0)&&(F0=!0)),b=T}Cn!==0&&Cn!==5||Yh(u),xo!==0&&(xo=0)}function XE(u,f){for(var p=u.suspendedLanes,b=u.pingedLanes,T=u.expirationTimes,R=u.pendingLanes&-62914561;0<R;){var q=31-ee(R),Z=1<<q,ve=T[q];ve===-1?((Z&p)===0||(Z&b)!==0)&&(T[q]=yt(Z,f)):ve<=f&&(u.expiredLanes|=Z),R&=~Z}if(f=Er,p=qt,p=Ue(u,u===f?p:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),b=u.callbackNode,p===0||u===f&&(pr===2||pr===9)||u.cancelPendingCommit!==null)return b!==null&&b!==null&&tt(b),u.callbackNode=null,u.callbackPriority=0;if((p&3)===0||je(u,p)){if(f=p&-p,f===u.callbackPriority)return f;switch(b!==null&&tt(b),In(p)){case 2:case 8:p=ke;break;case 32:p=We;break;case 268435456:p=rt;break;default:p=We}return b=YE.bind(null,u),p=He(p,b),u.callbackPriority=f,u.callbackNode=p,f}return b!==null&&b!==null&&tt(b),u.callbackPriority=2,u.callbackNode=null,2}function YE(u,f){if(Cn!==0&&Cn!==5)return u.callbackNode=null,u.callbackPriority=0,null;var p=u.callbackNode;if(k0()&&u.callbackNode!==p)return null;var b=qt;return b=Ue(u,u===Er?b:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),b===0?null:(ME(u,b,f),XE(u,Ze()),u.callbackNode!=null&&u.callbackNode===p?YE.bind(null,u):null)}function WE(u,f){if(k0())return null;ME(u,f,!0)}function WL(){sk(function(){(ir&6)!==0?He(Se,YL):qE()})}function Ly(){if(xo===0){var u=Uu;u===0&&(u=Ge,Ge<<=1,(Ge&261888)===0&&(Ge=256)),xo=u}return xo}function $E(u){return u==null||typeof u=="symbol"||typeof u=="boolean"?null:typeof u=="function"?u:Xd(""+u)}function KE(u,f){var p=f.ownerDocument.createElement("input");return p.name=f.name,p.value=f.value,u.id&&p.setAttribute("form",u.id),f.parentNode.insertBefore(p,f),u=new FormData(u),p.parentNode.removeChild(p),u}function $L(u,f,p,b,T){if(f==="submit"&&p&&p.stateNode===T){var R=$E((T[Lr]||null).action),q=b.submitter;q&&(f=(f=q[Lr]||null)?$E(f.formAction):q.getAttribute("formAction"),f!==null&&(R=f,q=null));var Z=new Kd("action","action",null,b,T);u.push({event:Z,listeners:[{instance:null,listener:function(){if(b.defaultPrevented){if(xo!==0){var ve=q?KE(T,q):new FormData(T);ty(p,{pending:!0,data:ve,method:T.method,action:R},null,ve)}}else typeof R=="function"&&(Z.preventDefault(),ve=q?KE(T,q):new FormData(T),ty(p,{pending:!0,data:ve,method:T.method,action:R},R,ve))},currentTarget:T}]})}}for(var ky=0;ky<ym.length;ky++){var By=ym[ky],KL=By.toLowerCase(),ZL=By[0].toUpperCase()+By.slice(1);Sa(KL,"on"+ZL)}Sa(A5,"onAnimationEnd"),Sa(M5,"onAnimationIteration"),Sa(R5,"onAnimationStart"),Sa("dblclick","onDoubleClick"),Sa("focusin","onFocus"),Sa("focusout","onBlur"),Sa(dL,"onTransitionRun"),Sa(vL,"onTransitionStart"),Sa(pL,"onTransitionCancel"),Sa(O5,"onTransitionEnd"),Qn("onMouseEnter",["mouseout","mouseover"]),Qn("onMouseLeave",["mouseout","mouseover"]),Qn("onPointerEnter",["pointerout","pointerover"]),Qn("onPointerLeave",["pointerout","pointerover"]),nn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),nn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),nn("onBeforeInput",["compositionend","keypress","textInput","paste"]),nn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),nn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),nn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wh="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),QL=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Wh));function ZE(u,f){f=(f&4)!==0;for(var p=0;p<u.length;p++){var b=u[p],T=b.event;b=b.listeners;e:{var R=void 0;if(f)for(var q=b.length-1;0<=q;q--){var Z=b[q],ve=Z.instance,Ce=Z.currentTarget;if(Z=Z.listener,ve!==R&&T.isPropagationStopped())break e;R=Z,T.currentTarget=Ce;try{R(T)}catch(Le){Jd(Le)}T.currentTarget=null,R=ve}else for(q=0;q<b.length;q++){if(Z=b[q],ve=Z.instance,Ce=Z.currentTarget,Z=Z.listener,ve!==R&&T.isPropagationStopped())break e;R=Z,T.currentTarget=Ce;try{R(T)}catch(Le){Jd(Le)}T.currentTarget=null,R=ve}}}}function Ht(u,f){var p=f[Ur];p===void 0&&(p=f[Ur]=new Set);var b=u+"__bubble";p.has(b)||(QE(f,u,2,!1),p.add(b))}function Fy(u,f,p){var b=0;f&&(b|=4),QE(p,u,b,f)}var z0="_reactListening"+Math.random().toString(36).slice(2);function zy(u){if(!u[z0]){u[z0]=!0,ds.forEach(function(p){p!=="selectionchange"&&(QL.has(p)||Fy(p,!1,u),Fy(p,!0,u))});var f=u.nodeType===9?u:u.ownerDocument;f===null||f[z0]||(f[z0]=!0,Fy("selectionchange",!1,f))}}function QE(u,f,p,b){switch(AT(f)){case 2:var T=Ck;break;case 8:T=Ak;break;default:T=e1}p=T.bind(null,f,p,u),T=void 0,!am||f!=="touchstart"&&f!=="touchmove"&&f!=="wheel"||(T=!0),b?T!==void 0?u.addEventListener(f,p,{capture:!0,passive:T}):u.addEventListener(f,p,!0):T!==void 0?u.addEventListener(f,p,{passive:T}):u.addEventListener(f,p,!1)}function Uy(u,f,p,b,T){var R=b;if((f&1)===0&&(f&2)===0&&b!==null)e:for(;;){if(b===null)return;var q=b.tag;if(q===3||q===4){var Z=b.stateNode.containerInfo;if(Z===T)break;if(q===4)for(q=b.return;q!==null;){var ve=q.tag;if((ve===3||ve===4)&&q.stateNode.containerInfo===T)return;q=q.return}for(;Z!==null;){if(q=br(Z),q===null)return;if(ve=q.tag,ve===5||ve===6||ve===26||ve===27){b=R=q;continue e}Z=Z.parentNode}}b=b.return}n5(function(){var Ce=R,Le=nm(p),ze=[];e:{var Me=D5.get(u);if(Me!==void 0){var Ie=Kd,gt=u;switch(u){case"keypress":if(Wd(p)===0)break e;case"keydown":case"keyup":Ie=qN;break;case"focusin":gt="focus",Ie=um;break;case"focusout":gt="blur",Ie=um;break;case"beforeblur":case"afterblur":Ie=um;break;case"click":if(p.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ie=s5;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ie=IN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ie=WN;break;case A5:case M5:case R5:Ie=kN;break;case O5:Ie=KN;break;case"scroll":case"scrollend":Ie=DN;break;case"wheel":Ie=QN;break;case"copy":case"cut":case"paste":Ie=FN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ie=l5;break;case"toggle":case"beforetoggle":Ie=eL}var At=(f&4)!==0,wr=!At&&(u==="scroll"||u==="scrollend"),we=At?Me!==null?Me+"Capture":null:Me;At=[];for(var ge=Ce,Te;ge!==null;){var Fe=ge;if(Te=Fe.stateNode,Fe=Fe.tag,Fe!==5&&Fe!==26&&Fe!==27||Te===null||we===null||(Fe=gh(ge,we),Fe!=null&&At.push($h(ge,Fe,Te))),wr)break;ge=ge.return}0<At.length&&(Me=new Ie(Me,gt,null,p,Le),ze.push({event:Me,listeners:At}))}}if((f&7)===0){e:{if(Me=u==="mouseover"||u==="pointerover",Ie=u==="mouseout"||u==="pointerout",Me&&p!==rm&&(gt=p.relatedTarget||p.fromElement)&&(br(gt)||gt[cn]))break e;if((Ie||Me)&&(Me=Le.window===Le?Le:(Me=Le.ownerDocument)?Me.defaultView||Me.parentWindow:window,Ie?(gt=p.relatedTarget||p.toElement,Ie=Ce,gt=gt?br(gt):null,gt!==null&&(wr=a(gt),At=gt.tag,gt!==wr||At!==5&&At!==27&&At!==6)&&(gt=null)):(Ie=null,gt=Ce),Ie!==gt)){if(At=s5,Fe="onMouseLeave",we="onMouseEnter",ge="mouse",(u==="pointerout"||u==="pointerover")&&(At=l5,Fe="onPointerLeave",we="onPointerEnter",ge="pointer"),wr=Ie==null?Me:Ii(Ie),Te=gt==null?Me:Ii(gt),Me=new At(Fe,ge+"leave",Ie,p,Le),Me.target=wr,Me.relatedTarget=Te,Fe=null,br(Le)===Ce&&(At=new At(we,ge+"enter",gt,p,Le),At.target=Te,At.relatedTarget=wr,Fe=At),wr=Fe,Ie&&gt)t:{for(At=JL,we=Ie,ge=gt,Te=0,Fe=we;Fe;Fe=At(Fe))Te++;Fe=0;for(var _t=ge;_t;_t=At(_t))Fe++;for(;0<Te-Fe;)we=At(we),Te--;for(;0<Fe-Te;)ge=At(ge),Fe--;for(;Te--;){if(we===ge||ge!==null&&we===ge.alternate){At=we;break t}we=At(we),ge=At(ge)}At=null}else At=null;Ie!==null&&JE(ze,Me,Ie,At,!1),gt!==null&&wr!==null&&JE(ze,wr,gt,At,!0)}}e:{if(Me=Ce?Ii(Ce):window,Ie=Me.nodeName&&Me.nodeName.toLowerCase(),Ie==="select"||Ie==="input"&&Me.type==="file")var Jt=g5;else if(v5(Me))if(m5)Jt=cL;else{Jt=lL;var mt=oL}else Ie=Me.nodeName,!Ie||Ie.toLowerCase()!=="input"||Me.type!=="checkbox"&&Me.type!=="radio"?Ce&&tm(Ce.elementType)&&(Jt=g5):Jt=uL;if(Jt&&(Jt=Jt(u,Ce))){p5(ze,Jt,p,Le);break e}mt&&mt(u,Me,Ce),u==="focusout"&&Ce&&Me.type==="number"&&Ce.memoizedProps.value!=null&&em(Me,"number",Me.value)}switch(mt=Ce?Ii(Ce):window,u){case"focusin":(v5(mt)||mt.contentEditable==="true")&&(Pu=mt,pm=Ce,Eh=null);break;case"focusout":Eh=pm=Pu=null;break;case"mousedown":gm=!0;break;case"contextmenu":case"mouseup":case"dragend":gm=!1,T5(ze,p,Le);break;case"selectionchange":if(fL)break;case"keydown":case"keyup":T5(ze,p,Le)}var kt;if(hm)e:{switch(u){case"compositionstart":var Xt="onCompositionStart";break e;case"compositionend":Xt="onCompositionEnd";break e;case"compositionupdate":Xt="onCompositionUpdate";break e}Xt=void 0}else Du?f5(u,p)&&(Xt="onCompositionEnd"):u==="keydown"&&p.keyCode===229&&(Xt="onCompositionStart");Xt&&(u5&&p.locale!=="ko"&&(Du||Xt!=="onCompositionStart"?Xt==="onCompositionEnd"&&Du&&(kt=i5()):(no=Le,sm="value"in no?no.value:no.textContent,Du=!0)),mt=U0(Ce,Xt),0<mt.length&&(Xt=new o5(Xt,u,null,p,Le),ze.push({event:Xt,listeners:mt}),kt?Xt.data=kt:(kt=d5(p),kt!==null&&(Xt.data=kt)))),(kt=rL?nL(u,p):iL(u,p))&&(Xt=U0(Ce,"onBeforeInput"),0<Xt.length&&(mt=new o5("onBeforeInput","beforeinput",null,p,Le),ze.push({event:mt,listeners:Xt}),mt.data=kt)),$L(ze,u,Ce,p,Le)}ZE(ze,f)})}function $h(u,f,p){return{instance:u,listener:f,currentTarget:p}}function U0(u,f){for(var p=f+"Capture",b=[];u!==null;){var T=u,R=T.stateNode;if(T=T.tag,T!==5&&T!==26&&T!==27||R===null||(T=gh(u,p),T!=null&&b.unshift($h(u,T,R)),T=gh(u,f),T!=null&&b.push($h(u,T,R))),u.tag===3)return b;u=u.return}return[]}function JL(u){if(u===null)return null;do u=u.return;while(u&&u.tag!==5&&u.tag!==27);return u||null}function JE(u,f,p,b,T){for(var R=f._reactName,q=[];p!==null&&p!==b;){var Z=p,ve=Z.alternate,Ce=Z.stateNode;if(Z=Z.tag,ve!==null&&ve===b)break;Z!==5&&Z!==26&&Z!==27||Ce===null||(ve=Ce,T?(Ce=gh(p,R),Ce!=null&&q.unshift($h(p,Ce,ve))):T||(Ce=gh(p,R),Ce!=null&&q.push($h(p,Ce,ve)))),p=p.return}q.length!==0&&u.push({event:f,listeners:q})}var ek=/\r\n?/g,tk=/\u0000|\uFFFD/g;function eT(u){return(typeof u=="string"?u:""+u).replace(ek,`
  49. `).replace(tk,"")}function tT(u,f){return f=eT(f),eT(u)===f}function _r(u,f,p,b,T,R){switch(p){case"children":typeof b=="string"?f==="body"||f==="textarea"&&b===""||Mu(u,b):(typeof b=="number"||typeof b=="bigint")&&f!=="body"&&Mu(u,""+b);break;case"className":ro(u,"class",b);break;case"tabIndex":ro(u,"tabindex",b);break;case"dir":case"role":case"viewBox":case"width":case"height":ro(u,p,b);break;case"style":t5(u,b,R);break;case"data":if(f!=="object"){ro(u,"data",b);break}case"src":case"href":if(b===""&&(f!=="a"||p!=="href")){u.removeAttribute(p);break}if(b==null||typeof b=="function"||typeof b=="symbol"||typeof b=="boolean"){u.removeAttribute(p);break}b=Xd(""+b),u.setAttribute(p,b);break;case"action":case"formAction":if(typeof b=="function"){u.setAttribute(p,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof R=="function"&&(p==="formAction"?(f!=="input"&&_r(u,f,"name",T.name,T,null),_r(u,f,"formEncType",T.formEncType,T,null),_r(u,f,"formMethod",T.formMethod,T,null),_r(u,f,"formTarget",T.formTarget,T,null)):(_r(u,f,"encType",T.encType,T,null),_r(u,f,"method",T.method,T,null),_r(u,f,"target",T.target,T,null)));if(b==null||typeof b=="symbol"||typeof b=="boolean"){u.removeAttribute(p);break}b=Xd(""+b),u.setAttribute(p,b);break;case"onClick":b!=null&&(u.onclick=vs);break;case"onScroll":b!=null&&Ht("scroll",u);break;case"onScrollEnd":b!=null&&Ht("scrollend",u);break;case"dangerouslySetInnerHTML":if(b!=null){if(typeof b!="object"||!("__html"in b))throw Error(n(61));if(p=b.__html,p!=null){if(T.children!=null)throw Error(n(60));u.innerHTML=p}}break;case"multiple":u.multiple=b&&typeof b!="function"&&typeof b!="symbol";break;case"muted":u.muted=b&&typeof b!="function"&&typeof b!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(b==null||typeof b=="function"||typeof b=="boolean"||typeof b=="symbol"){u.removeAttribute("xlink:href");break}p=Xd(""+b),u.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",p);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":b!=null&&typeof b!="function"&&typeof b!="symbol"?u.setAttribute(p,""+b):u.removeAttribute(p);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":b&&typeof b!="function"&&typeof b!="symbol"?u.setAttribute(p,""):u.removeAttribute(p);break;case"capture":case"download":b===!0?u.setAttribute(p,""):b!==!1&&b!=null&&typeof b!="function"&&typeof b!="symbol"?u.setAttribute(p,b):u.removeAttribute(p);break;case"cols":case"rows":case"size":case"span":b!=null&&typeof b!="function"&&typeof b!="symbol"&&!isNaN(b)&&1<=b?u.setAttribute(p,b):u.removeAttribute(p);break;case"rowSpan":case"start":b==null||typeof b=="function"||typeof b=="symbol"||isNaN(b)?u.removeAttribute(p):u.setAttribute(p,b);break;case"popover":Ht("beforetoggle",u),Ht("toggle",u),Jn(u,"popover",b);break;case"xlinkActuate":Ki(u,"http://www.w3.org/1999/xlink","xlink:actuate",b);break;case"xlinkArcrole":Ki(u,"http://www.w3.org/1999/xlink","xlink:arcrole",b);break;case"xlinkRole":Ki(u,"http://www.w3.org/1999/xlink","xlink:role",b);break;case"xlinkShow":Ki(u,"http://www.w3.org/1999/xlink","xlink:show",b);break;case"xlinkTitle":Ki(u,"http://www.w3.org/1999/xlink","xlink:title",b);break;case"xlinkType":Ki(u,"http://www.w3.org/1999/xlink","xlink:type",b);break;case"xmlBase":Ki(u,"http://www.w3.org/XML/1998/namespace","xml:base",b);break;case"xmlLang":Ki(u,"http://www.w3.org/XML/1998/namespace","xml:lang",b);break;case"xmlSpace":Ki(u,"http://www.w3.org/XML/1998/namespace","xml:space",b);break;case"is":Jn(u,"is",b);break;case"innerText":case"textContent":break;default:(!(2<p.length)||p[0]!=="o"&&p[0]!=="O"||p[1]!=="n"&&p[1]!=="N")&&(p=RN.get(p)||p,Jn(u,p,b))}}function Gy(u,f,p,b,T,R){switch(p){case"style":t5(u,b,R);break;case"dangerouslySetInnerHTML":if(b!=null){if(typeof b!="object"||!("__html"in b))throw Error(n(61));if(p=b.__html,p!=null){if(T.children!=null)throw Error(n(60));u.innerHTML=p}}break;case"children":typeof b=="string"?Mu(u,b):(typeof b=="number"||typeof b=="bigint")&&Mu(u,""+b);break;case"onScroll":b!=null&&Ht("scroll",u);break;case"onScrollEnd":b!=null&&Ht("scrollend",u);break;case"onClick":b!=null&&(u.onclick=vs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!to.hasOwnProperty(p))e:{if(p[0]==="o"&&p[1]==="n"&&(T=p.endsWith("Capture"),f=p.slice(2,T?p.length-7:void 0),R=u[Lr]||null,R=R!=null?R[p]:null,typeof R=="function"&&u.removeEventListener(f,R,T),typeof b=="function")){typeof R!="function"&&R!==null&&(p in u?u[p]=null:u.hasAttribute(p)&&u.removeAttribute(p)),u.addEventListener(f,b,T);break e}p in u?u[p]=b:b===!0?u.setAttribute(p,""):Jn(u,p,b)}}}function qn(u,f,p){switch(f){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ht("error",u),Ht("load",u);var b=!1,T=!1,R;for(R in p)if(p.hasOwnProperty(R)){var q=p[R];if(q!=null)switch(R){case"src":b=!0;break;case"srcSet":T=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,f));default:_r(u,f,R,q,p,null)}}T&&_r(u,f,"srcSet",p.srcSet,p,null),b&&_r(u,f,"src",p.src,p,null);return;case"input":Ht("invalid",u);var Z=R=q=T=null,ve=null,Ce=null;for(b in p)if(p.hasOwnProperty(b)){var Le=p[b];if(Le!=null)switch(b){case"name":T=Le;break;case"type":q=Le;break;case"checked":ve=Le;break;case"defaultChecked":Ce=Le;break;case"value":R=Le;break;case"defaultValue":Z=Le;break;case"children":case"dangerouslySetInnerHTML":if(Le!=null)throw Error(n(137,f));break;default:_r(u,f,b,Le,p,null)}}Z3(u,R,Z,ve,Ce,q,T,!1);return;case"select":Ht("invalid",u),b=q=R=null;for(T in p)if(p.hasOwnProperty(T)&&(Z=p[T],Z!=null))switch(T){case"value":R=Z;break;case"defaultValue":q=Z;break;case"multiple":b=Z;default:_r(u,f,T,Z,p,null)}f=R,p=q,u.multiple=!!b,f!=null?Au(u,!!b,f,!1):p!=null&&Au(u,!!b,p,!0);return;case"textarea":Ht("invalid",u),R=T=b=null;for(q in p)if(p.hasOwnProperty(q)&&(Z=p[q],Z!=null))switch(q){case"value":b=Z;break;case"defaultValue":T=Z;break;case"children":R=Z;break;case"dangerouslySetInnerHTML":if(Z!=null)throw Error(n(91));break;default:_r(u,f,q,Z,p,null)}J3(u,b,T,R);return;case"option":for(ve in p)if(p.hasOwnProperty(ve)&&(b=p[ve],b!=null))switch(ve){case"selected":u.selected=b&&typeof b!="function"&&typeof b!="symbol";break;default:_r(u,f,ve,b,p,null)}return;case"dialog":Ht("beforetoggle",u),Ht("toggle",u),Ht("cancel",u),Ht("close",u);break;case"iframe":case"object":Ht("load",u);break;case"video":case"audio":for(b=0;b<Wh.length;b++)Ht(Wh[b],u);break;case"image":Ht("error",u),Ht("load",u);break;case"details":Ht("toggle",u);break;case"embed":case"source":case"link":Ht("error",u),Ht("load",u);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Ce in p)if(p.hasOwnProperty(Ce)&&(b=p[Ce],b!=null))switch(Ce){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,f));default:_r(u,f,Ce,b,p,null)}return;default:if(tm(f)){for(Le in p)p.hasOwnProperty(Le)&&(b=p[Le],b!==void 0&&Gy(u,f,Le,b,p,void 0));return}}for(Z in p)p.hasOwnProperty(Z)&&(b=p[Z],b!=null&&_r(u,f,Z,b,p,null))}function rk(u,f,p,b){switch(f){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var T=null,R=null,q=null,Z=null,ve=null,Ce=null,Le=null;for(Ie in p){var ze=p[Ie];if(p.hasOwnProperty(Ie)&&ze!=null)switch(Ie){case"checked":break;case"value":break;case"defaultValue":ve=ze;default:b.hasOwnProperty(Ie)||_r(u,f,Ie,null,b,ze)}}for(var Me in b){var Ie=b[Me];if(ze=p[Me],b.hasOwnProperty(Me)&&(Ie!=null||ze!=null))switch(Me){case"type":R=Ie;break;case"name":T=Ie;break;case"checked":Ce=Ie;break;case"defaultChecked":Le=Ie;break;case"value":q=Ie;break;case"defaultValue":Z=Ie;break;case"children":case"dangerouslySetInnerHTML":if(Ie!=null)throw Error(n(137,f));break;default:Ie!==ze&&_r(u,f,Me,Ie,b,ze)}}Jg(u,q,Z,ve,Ce,Le,R,T);return;case"select":Ie=q=Z=Me=null;for(R in p)if(ve=p[R],p.hasOwnProperty(R)&&ve!=null)switch(R){case"value":break;case"multiple":Ie=ve;default:b.hasOwnProperty(R)||_r(u,f,R,null,b,ve)}for(T in b)if(R=b[T],ve=p[T],b.hasOwnProperty(T)&&(R!=null||ve!=null))switch(T){case"value":Me=R;break;case"defaultValue":Z=R;break;case"multiple":q=R;default:R!==ve&&_r(u,f,T,R,b,ve)}f=Z,p=q,b=Ie,Me!=null?Au(u,!!p,Me,!1):!!b!=!!p&&(f!=null?Au(u,!!p,f,!0):Au(u,!!p,p?[]:"",!1));return;case"textarea":Ie=Me=null;for(Z in p)if(T=p[Z],p.hasOwnProperty(Z)&&T!=null&&!b.hasOwnProperty(Z))switch(Z){case"value":break;case"children":break;default:_r(u,f,Z,null,b,T)}for(q in b)if(T=b[q],R=p[q],b.hasOwnProperty(q)&&(T!=null||R!=null))switch(q){case"value":Me=T;break;case"defaultValue":Ie=T;break;case"children":break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(n(91));break;default:T!==R&&_r(u,f,q,T,b,R)}Q3(u,Me,Ie);return;case"option":for(var gt in p)if(Me=p[gt],p.hasOwnProperty(gt)&&Me!=null&&!b.hasOwnProperty(gt))switch(gt){case"selected":u.selected=!1;break;default:_r(u,f,gt,null,b,Me)}for(ve in b)if(Me=b[ve],Ie=p[ve],b.hasOwnProperty(ve)&&Me!==Ie&&(Me!=null||Ie!=null))switch(ve){case"selected":u.selected=Me&&typeof Me!="function"&&typeof Me!="symbol";break;default:_r(u,f,ve,Me,b,Ie)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var At in p)Me=p[At],p.hasOwnProperty(At)&&Me!=null&&!b.hasOwnProperty(At)&&_r(u,f,At,null,b,Me);for(Ce in b)if(Me=b[Ce],Ie=p[Ce],b.hasOwnProperty(Ce)&&Me!==Ie&&(Me!=null||Ie!=null))switch(Ce){case"children":case"dangerouslySetInnerHTML":if(Me!=null)throw Error(n(137,f));break;default:_r(u,f,Ce,Me,b,Ie)}return;default:if(tm(f)){for(var wr in p)Me=p[wr],p.hasOwnProperty(wr)&&Me!==void 0&&!b.hasOwnProperty(wr)&&Gy(u,f,wr,void 0,b,Me);for(Le in b)Me=b[Le],Ie=p[Le],!b.hasOwnProperty(Le)||Me===Ie||Me===void 0&&Ie===void 0||Gy(u,f,Le,Me,b,Ie);return}}for(var we in p)Me=p[we],p.hasOwnProperty(we)&&Me!=null&&!b.hasOwnProperty(we)&&_r(u,f,we,null,b,Me);for(ze in b)Me=b[ze],Ie=p[ze],!b.hasOwnProperty(ze)||Me===Ie||Me==null&&Ie==null||_r(u,f,ze,Me,b,Ie)}function rT(u){switch(u){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function nk(){if(typeof performance.getEntriesByType=="function"){for(var u=0,f=0,p=performance.getEntriesByType("resource"),b=0;b<p.length;b++){var T=p[b],R=T.transferSize,q=T.initiatorType,Z=T.duration;if(R&&Z&&rT(q)){for(q=0,Z=T.responseEnd,b+=1;b<p.length;b++){var ve=p[b],Ce=ve.startTime;if(Ce>Z)break;var Le=ve.transferSize,ze=ve.initiatorType;Le&&rT(ze)&&(ve=ve.responseEnd,q+=Le*(ve<Z?1:(Z-Ce)/(ve-Ce)))}if(--b,f+=8*(R+q)/(T.duration/1e3),u++,10<u)break}}if(0<u)return f/u/1e6}return navigator.connection&&(u=navigator.connection.downlink,typeof u=="number")?u:5}var Hy=null,jy=null;function G0(u){return u.nodeType===9?u:u.ownerDocument}function nT(u){switch(u){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function iT(u,f){if(u===0)switch(f){case"svg":return 1;case"math":return 2;default:return 0}return u===1&&f==="foreignObject"?0:u}function Vy(u,f){return u==="textarea"||u==="noscript"||typeof f.children=="string"||typeof f.children=="number"||typeof f.children=="bigint"||typeof f.dangerouslySetInnerHTML=="object"&&f.dangerouslySetInnerHTML!==null&&f.dangerouslySetInnerHTML.__html!=null}var qy=null;function ik(){var u=window.event;return u&&u.type==="popstate"?u===qy?!1:(qy=u,!0):(qy=null,!1)}var aT=typeof setTimeout=="function"?setTimeout:void 0,ak=typeof clearTimeout=="function"?clearTimeout:void 0,sT=typeof Promise=="function"?Promise:void 0,sk=typeof queueMicrotask=="function"?queueMicrotask:typeof sT<"u"?function(u){return sT.resolve(null).then(u).catch(ok)}:aT;function ok(u){setTimeout(function(){throw u})}function _o(u){return u==="head"}function oT(u,f){var p=f,b=0;do{var T=p.nextSibling;if(u.removeChild(p),T&&T.nodeType===8)if(p=T.data,p==="/$"||p==="/&"){if(b===0){u.removeChild(T),ac(f);return}b--}else if(p==="$"||p==="$?"||p==="$~"||p==="$!"||p==="&")b++;else if(p==="html")Kh(u.ownerDocument.documentElement);else if(p==="head"){p=u.ownerDocument.head,Kh(p);for(var R=p.firstChild;R;){var q=R.nextSibling,Z=R.nodeName;R[lt]||Z==="SCRIPT"||Z==="STYLE"||Z==="LINK"&&R.rel.toLowerCase()==="stylesheet"||p.removeChild(R),R=q}}else p==="body"&&Kh(u.ownerDocument.body);p=T}while(p);ac(f)}function lT(u,f){var p=u;u=0;do{var b=p.nextSibling;if(p.nodeType===1?f?(p._stashedDisplay=p.style.display,p.style.display="none"):(p.style.display=p._stashedDisplay||"",p.getAttribute("style")===""&&p.removeAttribute("style")):p.nodeType===3&&(f?(p._stashedText=p.nodeValue,p.nodeValue=""):p.nodeValue=p._stashedText||""),b&&b.nodeType===8)if(p=b.data,p==="/$"){if(u===0)break;u--}else p!=="$"&&p!=="$?"&&p!=="$~"&&p!=="$!"||u++;p=b}while(p)}function Xy(u){var f=u.firstChild;for(f&&f.nodeType===10&&(f=f.nextSibling);f;){var p=f;switch(f=f.nextSibling,p.nodeName){case"HTML":case"HEAD":case"BODY":Xy(p),Ut(p);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(p.rel.toLowerCase()==="stylesheet")continue}u.removeChild(p)}}function lk(u,f,p,b){for(;u.nodeType===1;){var T=p;if(u.nodeName.toLowerCase()!==f.toLowerCase()){if(!b&&(u.nodeName!=="INPUT"||u.type!=="hidden"))break}else if(b){if(!u[lt])switch(f){case"meta":if(!u.hasAttribute("itemprop"))break;return u;case"link":if(R=u.getAttribute("rel"),R==="stylesheet"&&u.hasAttribute("data-precedence"))break;if(R!==T.rel||u.getAttribute("href")!==(T.href==null||T.href===""?null:T.href)||u.getAttribute("crossorigin")!==(T.crossOrigin==null?null:T.crossOrigin)||u.getAttribute("title")!==(T.title==null?null:T.title))break;return u;case"style":if(u.hasAttribute("data-precedence"))break;return u;case"script":if(R=u.getAttribute("src"),(R!==(T.src==null?null:T.src)||u.getAttribute("type")!==(T.type==null?null:T.type)||u.getAttribute("crossorigin")!==(T.crossOrigin==null?null:T.crossOrigin))&&R&&u.hasAttribute("async")&&!u.hasAttribute("itemprop"))break;return u;default:return u}}else if(f==="input"&&u.type==="hidden"){var R=T.name==null?null:""+T.name;if(T.type==="hidden"&&u.getAttribute("name")===R)return u}else return u;if(u=ia(u.nextSibling),u===null)break}return null}function uk(u,f,p){if(f==="")return null;for(;u.nodeType!==3;)if((u.nodeType!==1||u.nodeName!=="INPUT"||u.type!=="hidden")&&!p||(u=ia(u.nextSibling),u===null))return null;return u}function uT(u,f){for(;u.nodeType!==8;)if((u.nodeType!==1||u.nodeName!=="INPUT"||u.type!=="hidden")&&!f||(u=ia(u.nextSibling),u===null))return null;return u}function Yy(u){return u.data==="$?"||u.data==="$~"}function Wy(u){return u.data==="$!"||u.data==="$?"&&u.ownerDocument.readyState!=="loading"}function ck(u,f){var p=u.ownerDocument;if(u.data==="$~")u._reactRetry=f;else if(u.data!=="$?"||p.readyState!=="loading")f();else{var b=function(){f(),p.removeEventListener("DOMContentLoaded",b)};p.addEventListener("DOMContentLoaded",b),u._reactRetry=b}}function ia(u){for(;u!=null;u=u.nextSibling){var f=u.nodeType;if(f===1||f===3)break;if(f===8){if(f=u.data,f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"||f==="F!"||f==="F")break;if(f==="/$"||f==="/&")return null}}return u}var $y=null;function cT(u){u=u.nextSibling;for(var f=0;u;){if(u.nodeType===8){var p=u.data;if(p==="/$"||p==="/&"){if(f===0)return ia(u.nextSibling);f--}else p!=="$"&&p!=="$!"&&p!=="$?"&&p!=="$~"&&p!=="&"||f++}u=u.nextSibling}return null}function hT(u){u=u.previousSibling;for(var f=0;u;){if(u.nodeType===8){var p=u.data;if(p==="$"||p==="$!"||p==="$?"||p==="$~"||p==="&"){if(f===0)return u;f--}else p!=="/$"&&p!=="/&"||f++}u=u.previousSibling}return null}function fT(u,f,p){switch(f=G0(p),u){case"html":if(u=f.documentElement,!u)throw Error(n(452));return u;case"head":if(u=f.head,!u)throw Error(n(453));return u;case"body":if(u=f.body,!u)throw Error(n(454));return u;default:throw Error(n(451))}}function Kh(u){for(var f=u.attributes;f.length;)u.removeAttributeNode(f[0]);Ut(u)}var aa=new Map,dT=new Set;function H0(u){return typeof u.getRootNode=="function"?u.getRootNode():u.nodeType===9?u:u.ownerDocument}var Os=H.d;H.d={f:hk,r:fk,D:dk,C:vk,L:pk,m:gk,X:yk,S:mk,M:bk};function hk(){var u=Os.f(),f=I0();return u||f}function fk(u){var f=hn(u);f!==null&&f.tag===5&&f.type==="form"?OS(f):Os.r(u)}var rc=typeof document>"u"?null:document;function vT(u,f,p){var b=rc;if(b&&typeof f=="string"&&f){var T=Zi(f);T='link[rel="'+u+'"][href="'+T+'"]',typeof p=="string"&&(T+='[crossorigin="'+p+'"]'),dT.has(T)||(dT.add(T),u={rel:u,crossOrigin:p,href:f},b.querySelector(T)===null&&(f=b.createElement("link"),qn(f,"link",u),cr(f),b.head.appendChild(f)))}}function dk(u){Os.D(u),vT("dns-prefetch",u,null)}function vk(u,f){Os.C(u,f),vT("preconnect",u,f)}function pk(u,f,p){Os.L(u,f,p);var b=rc;if(b&&u&&f){var T='link[rel="preload"][as="'+Zi(f)+'"]';f==="image"&&p&&p.imageSrcSet?(T+='[imagesrcset="'+Zi(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(T+='[imagesizes="'+Zi(p.imageSizes)+'"]')):T+='[href="'+Zi(u)+'"]';var R=T;switch(f){case"style":R=nc(u);break;case"script":R=ic(u)}aa.has(R)||(u=d({rel:"preload",href:f==="image"&&p&&p.imageSrcSet?void 0:u,as:f},p),aa.set(R,u),b.querySelector(T)!==null||f==="style"&&b.querySelector(Zh(R))||f==="script"&&b.querySelector(Qh(R))||(f=b.createElement("link"),qn(f,"link",u),cr(f),b.head.appendChild(f)))}}function gk(u,f){Os.m(u,f);var p=rc;if(p&&u){var b=f&&typeof f.as=="string"?f.as:"script",T='link[rel="modulepreload"][as="'+Zi(b)+'"][href="'+Zi(u)+'"]',R=T;switch(b){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":R=ic(u)}if(!aa.has(R)&&(u=d({rel:"modulepreload",href:u},f),aa.set(R,u),p.querySelector(T)===null)){switch(b){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(Qh(R)))return}b=p.createElement("link"),qn(b,"link",u),cr(b),p.head.appendChild(b)}}}function mk(u,f,p){Os.S(u,f,p);var b=rc;if(b&&u){var T=Zn(b).hoistableStyles,R=nc(u);f=f||"default";var q=T.get(R);if(!q){var Z={loading:0,preload:null};if(q=b.querySelector(Zh(R)))Z.loading=5;else{u=d({rel:"stylesheet",href:u,"data-precedence":f},p),(p=aa.get(R))&&Ky(u,p);var ve=q=b.createElement("link");cr(ve),qn(ve,"link",u),ve._p=new Promise(function(Ce,Le){ve.onload=Ce,ve.onerror=Le}),ve.addEventListener("load",function(){Z.loading|=1}),ve.addEventListener("error",function(){Z.loading|=2}),Z.loading|=4,j0(q,f,b)}q={type:"stylesheet",instance:q,count:1,state:Z},T.set(R,q)}}}function yk(u,f){Os.X(u,f);var p=rc;if(p&&u){var b=Zn(p).hoistableScripts,T=ic(u),R=b.get(T);R||(R=p.querySelector(Qh(T)),R||(u=d({src:u,async:!0},f),(f=aa.get(T))&&Zy(u,f),R=p.createElement("script"),cr(R),qn(R,"link",u),p.head.appendChild(R)),R={type:"script",instance:R,count:1,state:null},b.set(T,R))}}function bk(u,f){Os.M(u,f);var p=rc;if(p&&u){var b=Zn(p).hoistableScripts,T=ic(u),R=b.get(T);R||(R=p.querySelector(Qh(T)),R||(u=d({src:u,async:!0,type:"module"},f),(f=aa.get(T))&&Zy(u,f),R=p.createElement("script"),cr(R),qn(R,"link",u),p.head.appendChild(R)),R={type:"script",instance:R,count:1,state:null},b.set(T,R))}}function pT(u,f,p,b){var T=(T=le.current)?H0(T):null;if(!T)throw Error(n(446));switch(u){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(f=nc(p.href),p=Zn(T).hoistableStyles,b=p.get(f),b||(b={type:"style",instance:null,count:0,state:null},p.set(f,b)),b):{type:"void",instance:null,count:0,state:null};case"link":if(p.rel==="stylesheet"&&typeof p.href=="string"&&typeof p.precedence=="string"){u=nc(p.href);var R=Zn(T).hoistableStyles,q=R.get(u);if(q||(T=T.ownerDocument||T,q={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},R.set(u,q),(R=T.querySelector(Zh(u)))&&!R._p&&(q.instance=R,q.state.loading=5),aa.has(u)||(p={rel:"preload",as:"style",href:p.href,crossOrigin:p.crossOrigin,integrity:p.integrity,media:p.media,hrefLang:p.hrefLang,referrerPolicy:p.referrerPolicy},aa.set(u,p),R||xk(T,u,p,q.state))),f&&b===null)throw Error(n(528,""));return q}if(f&&b!==null)throw Error(n(529,""));return null;case"script":return f=p.async,p=p.src,typeof p=="string"&&f&&typeof f!="function"&&typeof f!="symbol"?(f=ic(p),p=Zn(T).hoistableScripts,b=p.get(f),b||(b={type:"script",instance:null,count:0,state:null},p.set(f,b)),b):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,u))}}function nc(u){return'href="'+Zi(u)+'"'}function Zh(u){return'link[rel="stylesheet"]['+u+"]"}function gT(u){return d({},u,{"data-precedence":u.precedence,precedence:null})}function xk(u,f,p,b){u.querySelector('link[rel="preload"][as="style"]['+f+"]")?b.loading=1:(f=u.createElement("link"),b.preload=f,f.addEventListener("load",function(){return b.loading|=1}),f.addEventListener("error",function(){return b.loading|=2}),qn(f,"link",p),cr(f),u.head.appendChild(f))}function ic(u){return'[src="'+Zi(u)+'"]'}function Qh(u){return"script[async]"+u}function mT(u,f,p){if(f.count++,f.instance===null)switch(f.type){case"style":var b=u.querySelector('style[data-href~="'+Zi(p.href)+'"]');if(b)return f.instance=b,cr(b),b;var T=d({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return b=(u.ownerDocument||u).createElement("style"),cr(b),qn(b,"style",T),j0(b,p.precedence,u),f.instance=b;case"stylesheet":T=nc(p.href);var R=u.querySelector(Zh(T));if(R)return f.state.loading|=4,f.instance=R,cr(R),R;b=gT(p),(T=aa.get(T))&&Ky(b,T),R=(u.ownerDocument||u).createElement("link"),cr(R);var q=R;return q._p=new Promise(function(Z,ve){q.onload=Z,q.onerror=ve}),qn(R,"link",b),f.state.loading|=4,j0(R,p.precedence,u),f.instance=R;case"script":return R=ic(p.src),(T=u.querySelector(Qh(R)))?(f.instance=T,cr(T),T):(b=p,(T=aa.get(R))&&(b=d({},p),Zy(b,T)),u=u.ownerDocument||u,T=u.createElement("script"),cr(T),qn(T,"link",b),u.head.appendChild(T),f.instance=T);case"void":return null;default:throw Error(n(443,f.type))}else f.type==="stylesheet"&&(f.state.loading&4)===0&&(b=f.instance,f.state.loading|=4,j0(b,p.precedence,u));return f.instance}function j0(u,f,p){for(var b=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),T=b.length?b[b.length-1]:null,R=T,q=0;q<b.length;q++){var Z=b[q];if(Z.dataset.precedence===f)R=Z;else if(R!==T)break}R?R.parentNode.insertBefore(u,R.nextSibling):(f=p.nodeType===9?p.head:p,f.insertBefore(u,f.firstChild))}function Ky(u,f){u.crossOrigin==null&&(u.crossOrigin=f.crossOrigin),u.referrerPolicy==null&&(u.referrerPolicy=f.referrerPolicy),u.title==null&&(u.title=f.title)}function Zy(u,f){u.crossOrigin==null&&(u.crossOrigin=f.crossOrigin),u.referrerPolicy==null&&(u.referrerPolicy=f.referrerPolicy),u.integrity==null&&(u.integrity=f.integrity)}var V0=null;function yT(u,f,p){if(V0===null){var b=new Map,T=V0=new Map;T.set(p,b)}else T=V0,b=T.get(p),b||(b=new Map,T.set(p,b));if(b.has(u))return b;for(b.set(u,null),p=p.getElementsByTagName(u),T=0;T<p.length;T++){var R=p[T];if(!(R[lt]||R[nr]||u==="link"&&R.getAttribute("rel")==="stylesheet")&&R.namespaceURI!=="http://www.w3.org/2000/svg"){var q=R.getAttribute(f)||"";q=u+q;var Z=b.get(q);Z?Z.push(R):b.set(q,[R])}}return b}function bT(u,f,p){u=u.ownerDocument||u,u.head.insertBefore(p,f==="title"?u.querySelector("head > title"):null)}function _k(u,f,p){if(p===1||f.itemProp!=null)return!1;switch(u){case"meta":case"title":return!0;case"style":if(typeof f.precedence!="string"||typeof f.href!="string"||f.href==="")break;return!0;case"link":if(typeof f.rel!="string"||typeof f.href!="string"||f.href===""||f.onLoad||f.onError)break;switch(f.rel){case"stylesheet":return u=f.disabled,typeof f.precedence=="string"&&u==null;default:return!0}case"script":if(f.async&&typeof f.async!="function"&&typeof f.async!="symbol"&&!f.onLoad&&!f.onError&&f.src&&typeof f.src=="string")return!0}return!1}function xT(u){return!(u.type==="stylesheet"&&(u.state.loading&3)===0)}function wk(u,f,p,b){if(p.type==="stylesheet"&&(typeof b.media!="string"||matchMedia(b.media).matches!==!1)&&(p.state.loading&4)===0){if(p.instance===null){var T=nc(b.href),R=f.querySelector(Zh(T));if(R){f=R._p,f!==null&&typeof f=="object"&&typeof f.then=="function"&&(u.count++,u=q0.bind(u),f.then(u,u)),p.state.loading|=4,p.instance=R,cr(R);return}R=f.ownerDocument||f,b=gT(b),(T=aa.get(T))&&Ky(b,T),R=R.createElement("link"),cr(R);var q=R;q._p=new Promise(function(Z,ve){q.onload=Z,q.onerror=ve}),qn(R,"link",b),p.instance=R}u.stylesheets===null&&(u.stylesheets=new Map),u.stylesheets.set(p,f),(f=p.state.preload)&&(p.state.loading&3)===0&&(u.count++,p=q0.bind(u),f.addEventListener("load",p),f.addEventListener("error",p))}}var Qy=0;function Sk(u,f){return u.stylesheets&&u.count===0&&Y0(u,u.stylesheets),0<u.count||0<u.imgCount?function(p){var b=setTimeout(function(){if(u.stylesheets&&Y0(u,u.stylesheets),u.unsuspend){var R=u.unsuspend;u.unsuspend=null,R()}},6e4+f);0<u.imgBytes&&Qy===0&&(Qy=62500*nk());var T=setTimeout(function(){if(u.waitingForImages=!1,u.count===0&&(u.stylesheets&&Y0(u,u.stylesheets),u.unsuspend)){var R=u.unsuspend;u.unsuspend=null,R()}},(u.imgBytes>Qy?50:800)+f);return u.unsuspend=p,function(){u.unsuspend=null,clearTimeout(b),clearTimeout(T)}}:null}function q0(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Y0(this,this.stylesheets);else if(this.unsuspend){var u=this.unsuspend;this.unsuspend=null,u()}}}var X0=null;function Y0(u,f){u.stylesheets=null,u.unsuspend!==null&&(u.count++,X0=new Map,f.forEach(Ek,u),X0=null,q0.call(u))}function Ek(u,f){if(!(f.state.loading&4)){var p=X0.get(u);if(p)var b=p.get(null);else{p=new Map,X0.set(u,p);for(var T=u.querySelectorAll("link[data-precedence],style[data-precedence]"),R=0;R<T.length;R++){var q=T[R];(q.nodeName==="LINK"||q.getAttribute("media")!=="not all")&&(p.set(q.dataset.precedence,q),b=q)}b&&p.set(null,b)}T=f.instance,q=T.getAttribute("data-precedence"),R=p.get(q)||b,R===b&&p.set(null,T),p.set(q,T),this.count++,b=q0.bind(this),T.addEventListener("load",b),T.addEventListener("error",b),R?R.parentNode.insertBefore(T,R.nextSibling):(u=u.nodeType===9?u.head:u,u.insertBefore(T,u.firstChild)),f.state.loading|=4}}var Jh={$$typeof:S,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function Tk(u,f,p,b,T,R,q,Z,ve){this.tag=1,this.containerInfo=u,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ot(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ot(0),this.hiddenUpdates=Ot(null),this.identifierPrefix=b,this.onUncaughtError=T,this.onCaughtError=R,this.onRecoverableError=q,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ve,this.incompleteTransitions=new Map}function _T(u,f,p,b,T,R,q,Z,ve,Ce,Le,ze){return u=new Tk(u,f,p,q,ve,Ce,Le,ze,Z),f=1,R===!0&&(f|=24),R=Li(3,null,null,f),u.current=R,R.stateNode=u,f=Dm(),f.refCount++,u.pooledCache=f,f.refCount++,R.memoizedState={element:b,isDehydrated:p,cache:f},Lm(R),u}function wT(u){return u?(u=Lu,u):Lu}function ST(u,f,p,b,T,R){T=wT(T),b.context===null?b.context=T:b.pendingContext=T,b=uo(f),b.payload={element:p},R=R===void 0?null:R,R!==null&&(b.callback=R),p=co(u,b,f),p!==null&&(wi(p,u,f),Dh(p,u,f))}function ET(u,f){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var p=u.retryLane;u.retryLane=p!==0&&p<f?p:f}}function Jy(u,f){ET(u,f),(u=u.alternate)&&ET(u,f)}function TT(u){if(u.tag===13||u.tag===31){var f=Sl(u,67108864);f!==null&&wi(f,u,67108864),Jy(u,67108864)}}function CT(u){if(u.tag===13||u.tag===31){var f=Ui();f=ur(f);var p=Sl(u,f);p!==null&&wi(p,u,f),Jy(u,f)}}var W0=!0;function Ck(u,f,p,b){var T=P.T;P.T=null;var R=H.p;try{H.p=2,e1(u,f,p,b)}finally{H.p=R,P.T=T}}function Ak(u,f,p,b){var T=P.T;P.T=null;var R=H.p;try{H.p=8,e1(u,f,p,b)}finally{H.p=R,P.T=T}}function e1(u,f,p,b){if(W0){var T=t1(b);if(T===null)Uy(u,f,b,$0,p),MT(u,b);else if(Rk(T,u,f,p,b))b.stopPropagation();else if(MT(u,b),f&4&&-1<Mk.indexOf(u)){for(;T!==null;){var R=hn(T);if(R!==null)switch(R.tag){case 3:if(R=R.stateNode,R.current.memoizedState.isDehydrated){var q=Ve(R.pendingLanes);if(q!==0){var Z=R;for(Z.pendingLanes|=2,Z.entangledLanes|=2;q;){var ve=1<<31-ee(q);Z.entanglements[1]|=ve,q&=~ve}Ga(R),(ir&6)===0&&(D0=Ze()+500,Yh(0))}}break;case 31:case 13:Z=Sl(R,2),Z!==null&&wi(Z,R,2),I0(),Jy(R,2)}if(R=t1(b),R===null&&Uy(u,f,b,$0,p),R===T)break;T=R}T!==null&&b.stopPropagation()}else Uy(u,f,b,null,p)}}function t1(u){return u=nm(u),r1(u)}var $0=null;function r1(u){if($0=null,u=br(u),u!==null){var f=a(u);if(f===null)u=null;else{var p=f.tag;if(p===13){if(u=s(f),u!==null)return u;u=null}else if(p===31){if(u=o(f),u!==null)return u;u=null}else if(p===3){if(f.stateNode.current.memoizedState.isDehydrated)return f.tag===3?f.stateNode.containerInfo:null;u=null}else f!==u&&(u=null)}}return $0=u,null}function AT(u){switch(u){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(bt()){case Se:return 2;case ke:return 8;case We:case Ke:return 32;case rt:return 268435456;default:return 32}default:return 32}}var n1=!1,wo=null,So=null,Eo=null,ef=new Map,tf=new Map,To=[],Mk="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function MT(u,f){switch(u){case"focusin":case"focusout":wo=null;break;case"dragenter":case"dragleave":So=null;break;case"mouseover":case"mouseout":Eo=null;break;case"pointerover":case"pointerout":ef.delete(f.pointerId);break;case"gotpointercapture":case"lostpointercapture":tf.delete(f.pointerId)}}function rf(u,f,p,b,T,R){return u===null||u.nativeEvent!==R?(u={blockedOn:f,domEventName:p,eventSystemFlags:b,nativeEvent:R,targetContainers:[T]},f!==null&&(f=hn(f),f!==null&&TT(f)),u):(u.eventSystemFlags|=b,f=u.targetContainers,T!==null&&f.indexOf(T)===-1&&f.push(T),u)}function Rk(u,f,p,b,T){switch(f){case"focusin":return wo=rf(wo,u,f,p,b,T),!0;case"dragenter":return So=rf(So,u,f,p,b,T),!0;case"mouseover":return Eo=rf(Eo,u,f,p,b,T),!0;case"pointerover":var R=T.pointerId;return ef.set(R,rf(ef.get(R)||null,u,f,p,b,T)),!0;case"gotpointercapture":return R=T.pointerId,tf.set(R,rf(tf.get(R)||null,u,f,p,b,T)),!0}return!1}function RT(u){var f=br(u.target);if(f!==null){var p=a(f);if(p!==null){if(f=p.tag,f===13){if(f=s(p),f!==null){u.blockedOn=f,Gn(u.priority,function(){CT(p)});return}}else if(f===31){if(f=o(p),f!==null){u.blockedOn=f,Gn(u.priority,function(){CT(p)});return}}else if(f===3&&p.stateNode.current.memoizedState.isDehydrated){u.blockedOn=p.tag===3?p.stateNode.containerInfo:null;return}}}u.blockedOn=null}function K0(u){if(u.blockedOn!==null)return!1;for(var f=u.targetContainers;0<f.length;){var p=t1(u.nativeEvent);if(p===null){p=u.nativeEvent;var b=new p.constructor(p.type,p);rm=b,p.target.dispatchEvent(b),rm=null}else return f=hn(p),f!==null&&TT(f),u.blockedOn=p,!1;f.shift()}return!0}function OT(u,f,p){K0(u)&&p.delete(f)}function Ok(){n1=!1,wo!==null&&K0(wo)&&(wo=null),So!==null&&K0(So)&&(So=null),Eo!==null&&K0(Eo)&&(Eo=null),ef.forEach(OT),tf.forEach(OT)}function Z0(u,f){u.blockedOn===f&&(u.blockedOn=null,n1||(n1=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Ok)))}var Q0=null;function DT(u){Q0!==u&&(Q0=u,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){Q0===u&&(Q0=null);for(var f=0;f<u.length;f+=3){var p=u[f],b=u[f+1],T=u[f+2];if(typeof b!="function"){if(r1(b||p)===null)continue;break}var R=hn(p);R!==null&&(u.splice(f,3),f-=3,ty(R,{pending:!0,data:T,method:p.method,action:b},b,T))}}))}function ac(u){function f(ve){return Z0(ve,u)}wo!==null&&Z0(wo,u),So!==null&&Z0(So,u),Eo!==null&&Z0(Eo,u),ef.forEach(f),tf.forEach(f);for(var p=0;p<To.length;p++){var b=To[p];b.blockedOn===u&&(b.blockedOn=null)}for(;0<To.length&&(p=To[0],p.blockedOn===null);)RT(p),p.blockedOn===null&&To.shift();if(p=(u.ownerDocument||u).$$reactFormReplay,p!=null)for(b=0;b<p.length;b+=3){var T=p[b],R=p[b+1],q=T[Lr]||null;if(typeof R=="function")q||DT(p);else if(q){var Z=null;if(R&&R.hasAttribute("formAction")){if(T=R,q=R[Lr]||null)Z=q.formAction;else if(r1(T)!==null)continue}else Z=q.action;typeof Z=="function"?p[b+1]=Z:(p.splice(b,3),b-=3),DT(p)}}}function PT(){function u(R){R.canIntercept&&R.info==="react-transition"&&R.intercept({handler:function(){return new Promise(function(q){return T=q})},focusReset:"manual",scroll:"manual"})}function f(){T!==null&&(T(),T=null),b||setTimeout(p,20)}function p(){if(!b&&!navigation.transition){var R=navigation.currentEntry;R&&R.url!=null&&navigation.navigate(R.url,{state:R.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var b=!1,T=null;return navigation.addEventListener("navigate",u),navigation.addEventListener("navigatesuccess",f),navigation.addEventListener("navigateerror",f),setTimeout(p,100),function(){b=!0,navigation.removeEventListener("navigate",u),navigation.removeEventListener("navigatesuccess",f),navigation.removeEventListener("navigateerror",f),T!==null&&(T(),T=null)}}}function i1(u){this._internalRoot=u}J0.prototype.render=i1.prototype.render=function(u){var f=this._internalRoot;if(f===null)throw Error(n(409));var p=f.current,b=Ui();ST(p,b,u,f,null,null)},J0.prototype.unmount=i1.prototype.unmount=function(){var u=this._internalRoot;if(u!==null){this._internalRoot=null;var f=u.containerInfo;ST(u.current,2,null,u,null,null),I0(),f[cn]=null}};function J0(u){this._internalRoot=u}J0.prototype.unstable_scheduleHydration=function(u){if(u){var f=vr();u={blockedOn:null,target:u,priority:f};for(var p=0;p<To.length&&f!==0&&f<To[p].priority;p++);To.splice(p,0,u),p===0&&RT(u)}};var IT=e.version;if(IT!=="19.2.4")throw Error(n(527,IT,"19.2.4"));H.findDOMNode=function(u){var f=u._reactInternals;if(f===void 0)throw typeof u.render=="function"?Error(n(188)):(u=Object.keys(u).join(","),Error(n(268,u)));return u=c(f),u=u!==null?h(u):null,u=u===null?null:u.stateNode,u};var Dk={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ev=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ev.isDisabled&&ev.supportsFiber)try{Q=ev.inject(Dk),ne=ev}catch{}}return af.createRoot=function(u,f){if(!i(u))throw Error(n(299));var p=!1,b="",T=US,R=GS,q=HS;return f!=null&&(f.unstable_strictMode===!0&&(p=!0),f.identifierPrefix!==void 0&&(b=f.identifierPrefix),f.onUncaughtError!==void 0&&(T=f.onUncaughtError),f.onCaughtError!==void 0&&(R=f.onCaughtError),f.onRecoverableError!==void 0&&(q=f.onRecoverableError)),f=_T(u,1,!1,null,null,p,b,null,T,R,q,PT),u[cn]=f.current,zy(u),new i1(f)},af.hydrateRoot=function(u,f,p){if(!i(u))throw Error(n(299));var b=!1,T="",R=US,q=GS,Z=HS,ve=null;return p!=null&&(p.unstable_strictMode===!0&&(b=!0),p.identifierPrefix!==void 0&&(T=p.identifierPrefix),p.onUncaughtError!==void 0&&(R=p.onUncaughtError),p.onCaughtError!==void 0&&(q=p.onCaughtError),p.onRecoverableError!==void 0&&(Z=p.onRecoverableError),p.formState!==void 0&&(ve=p.formState)),f=_T(u,1,!0,f,p??null,b,T,ve,R,q,Z,PT),f.context=wT(null),p=f.current,b=Ui(),b=ur(b),T=uo(b),T.callback=null,co(p,T,b),p=b,f.current.lanes=p,jt(f,p),Ga(f),u[cn]=f.current,zy(u),new J0(f)},af.version="19.2.4",af}var jT;function jk(){if(jT)return o1.exports;jT=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}return r(),o1.exports=Hk(),o1.exports}var Vk=jk();const qk=cl(Vk);g9();/**
  50. * @remix-run/router v1.23.2
  51. *
  52. * Copyright (c) Remix Software Inc.
  53. *
  54. * This source code is licensed under the MIT license found in the
  55. * LICENSE.md file in the root directory of this source tree.
  56. *
  57. * @license MIT
  58. */function Xf(){return Xf=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},Xf.apply(this,arguments)}var ko;(function(r){r.Pop="POP",r.Push="PUSH",r.Replace="REPLACE"})(ko||(ko={}));const VT="popstate";function Xk(r){r===void 0&&(r={});function e(n,i){let{pathname:a,search:s,hash:o}=n.location;return $x("",{pathname:a,search:s,hash:o},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function t(n,i){return typeof i=="string"?i:Sp(i)}return Wk(e,t,null,r)}function Jr(r,e){if(r===!1||r===null||typeof r>"u")throw new Error(e)}function F_(r,e){if(!r){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Yk(){return Math.random().toString(36).substr(2,8)}function qT(r,e){return{usr:r.state,key:r.key,idx:e}}function $x(r,e,t,n){return t===void 0&&(t=null),Xf({pathname:typeof r=="string"?r:r.pathname,search:"",hash:""},typeof e=="string"?$c(e):e,{state:t,key:e&&e.key||n||Yk()})}function Sp(r){let{pathname:e="/",search:t="",hash:n=""}=r;return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function $c(r){let e={};if(r){let t=r.indexOf("#");t>=0&&(e.hash=r.substr(t),r=r.substr(0,t));let n=r.indexOf("?");n>=0&&(e.search=r.substr(n),r=r.substr(0,n)),r&&(e.pathname=r)}return e}function Wk(r,e,t,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,s=i.history,o=ko.Pop,l=null,c=h();c==null&&(c=0,s.replaceState(Xf({},s.state,{idx:c}),""));function h(){return(s.state||{idx:null}).idx}function d(){o=ko.Pop;let y=h(),_=y==null?null:y-c;c=y,l&&l({action:o,location:x.location,delta:_})}function v(y,_){o=ko.Push;let w=$x(x.location,y,_);c=h()+1;let S=qT(w,c),A=x.createHref(w);try{s.pushState(S,"",A)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;i.location.assign(A)}a&&l&&l({action:o,location:x.location,delta:1})}function g(y,_){o=ko.Replace;let w=$x(x.location,y,_);c=h();let S=qT(w,c),A=x.createHref(w);s.replaceState(S,"",A),a&&l&&l({action:o,location:x.location,delta:0})}function m(y){let _=i.location.origin!=="null"?i.location.origin:i.location.href,w=typeof y=="string"?y:Sp(y);return w=w.replace(/ $/,"%20"),Jr(_,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,_)}let x={get action(){return o},get location(){return r(i,s)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(VT,d),l=y,()=>{i.removeEventListener(VT,d),l=null}},createHref(y){return e(i,y)},createURL:m,encodeLocation(y){let _=m(y);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:v,replace:g,go(y){return s.go(y)}};return x}var XT;(function(r){r.data="data",r.deferred="deferred",r.redirect="redirect",r.error="error"})(XT||(XT={}));function $k(r,e,t){return t===void 0&&(t="/"),Kk(r,e,t)}function Kk(r,e,t,n){let i=typeof e=="string"?$c(e):e,a=Bc(i.pathname||"/",t);if(a==null)return null;let s=m9(r);Zk(s);let o=null;for(let l=0;o==null&&l<s.length;++l){let c=lB(a);o=sB(s[l],c)}return o}function m9(r,e,t,n){e===void 0&&(e=[]),t===void 0&&(t=[]),n===void 0&&(n="");let i=(a,s,o)=>{let l={relativePath:o===void 0?a.path||"":o,caseSensitive:a.caseSensitive===!0,childrenIndex:s,route:a};l.relativePath.startsWith("/")&&(Jr(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let c=jo([n,l.relativePath]),h=t.concat(l);a.children&&a.children.length>0&&(Jr(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),m9(a.children,e,h,c)),!(a.path==null&&!a.index)&&e.push({path:c,score:iB(c,a.index),routesMeta:h})};return r.forEach((a,s)=>{var o;if(a.path===""||!((o=a.path)!=null&&o.includes("?")))i(a,s);else for(let l of y9(a.path))i(a,s,l)}),e}function y9(r){let e=r.split("/");if(e.length===0)return[];let[t,...n]=e,i=t.endsWith("?"),a=t.replace(/\?$/,"");if(n.length===0)return i?[a,""]:[a];let s=y9(n.join("/")),o=[];return o.push(...s.map(l=>l===""?a:[a,l].join("/"))),i&&o.push(...s),o.map(l=>r.startsWith("/")&&l===""?"/":l)}function Zk(r){r.sort((e,t)=>e.score!==t.score?t.score-e.score:aB(e.routesMeta.map(n=>n.childrenIndex),t.routesMeta.map(n=>n.childrenIndex)))}const Qk=/^:[\w-]+$/,Jk=3,eB=2,tB=1,rB=10,nB=-2,YT=r=>r==="*";function iB(r,e){let t=r.split("/"),n=t.length;return t.some(YT)&&(n+=nB),e&&(n+=eB),t.filter(i=>!YT(i)).reduce((i,a)=>i+(Qk.test(a)?Jk:a===""?tB:rB),n)}function aB(r,e){return r.length===e.length&&r.slice(0,-1).every((n,i)=>n===e[i])?r[r.length-1]-e[e.length-1]:0}function sB(r,e,t){let{routesMeta:n}=r,i={},a="/",s=[];for(let o=0;o<n.length;++o){let l=n[o],c=o===n.length-1,h=a==="/"?e:e.slice(a.length)||"/",d=Kx({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},h),v=l.route;if(!d)return null;Object.assign(i,d.params),s.push({params:i,pathname:jo([a,d.pathname]),pathnameBase:dB(jo([a,d.pathnameBase])),route:v}),d.pathnameBase!=="/"&&(a=jo([a,d.pathnameBase]))}return s}function Kx(r,e){typeof r=="string"&&(r={path:r,caseSensitive:!1,end:!0});let[t,n]=oB(r.path,r.caseSensitive,r.end),i=e.match(t);if(!i)return null;let a=i[0],s=a.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:n.reduce((c,h,d)=>{let{paramName:v,isOptional:g}=h;if(v==="*"){let x=o[d]||"";s=a.slice(0,a.length-x.length).replace(/(.)\/+$/,"$1")}const m=o[d];return g&&!m?c[v]=void 0:c[v]=(m||"").replace(/%2F/g,"/"),c},{}),pathname:a,pathnameBase:s,pattern:r}}function oB(r,e,t){e===void 0&&(e=!1),t===void 0&&(t=!0),F_(r==="*"||!r.endsWith("*")||r.endsWith("/*"),'Route path "'+r+'" will be treated as if it were '+('"'+r.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+r.replace(/\*$/,"/*")+'".'));let n=[],i="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,o,l)=>(n.push({paramName:o,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return r.endsWith("*")?(n.push({paramName:"*"}),i+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?i+="\\/*$":r!==""&&r!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}function lB(r){try{return r.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return F_(!1,'The URL path "'+r+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),r}}function Bc(r,e){if(e==="/")return r;if(!r.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,n=r.charAt(t);return n&&n!=="/"?null:r.slice(t)||"/"}const uB=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,cB=r=>uB.test(r);function hB(r,e){e===void 0&&(e="/");let{pathname:t,search:n="",hash:i=""}=typeof r=="string"?$c(r):r,a;if(t)if(cB(t))a=t;else{if(t.includes("//")){let s=t;t=t.replace(/\/\/+/g,"/"),F_(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+t))}t.startsWith("/")?a=WT(t.substring(1),"/"):a=WT(t,e)}else a=e;return{pathname:a,search:vB(n),hash:pB(i)}}function WT(r,e){let t=e.replace(/\/+$/,"").split("/");return r.split("/").forEach(i=>{i===".."?t.length>1&&t.pop():i!=="."&&t.push(i)}),t.length>1?t.join("/"):"/"}function h1(r,e,t,n){return"Cannot include a '"+r+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+t+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function fB(r){return r.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function z_(r,e){let t=fB(r);return e?t.map((n,i)=>i===t.length-1?n.pathname:n.pathnameBase):t.map(n=>n.pathnameBase)}function U_(r,e,t,n){n===void 0&&(n=!1);let i;typeof r=="string"?i=$c(r):(i=Xf({},r),Jr(!i.pathname||!i.pathname.includes("?"),h1("?","pathname","search",i)),Jr(!i.pathname||!i.pathname.includes("#"),h1("#","pathname","hash",i)),Jr(!i.search||!i.search.includes("#"),h1("#","search","hash",i)));let a=r===""||i.pathname==="",s=a?"/":i.pathname,o;if(s==null)o=t;else{let d=e.length-1;if(!n&&s.startsWith("..")){let v=s.split("/");for(;v[0]==="..";)v.shift(),d-=1;i.pathname=v.join("/")}o=d>=0?e[d]:"/"}let l=hB(i,o),c=s&&s!=="/"&&s.endsWith("/"),h=(a||s===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(c||h)&&(l.pathname+="/"),l}const jo=r=>r.join("/").replace(/\/\/+/g,"/"),dB=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),vB=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,pB=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r;function gB(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}const b9=["post","put","patch","delete"];new Set(b9);const mB=["get",...b9];new Set(mB);/**
  59. * React Router v6.30.3
  60. *
  61. * Copyright (c) Remix Software Inc.
  62. *
  63. * This source code is licensed under the MIT license found in the
  64. * LICENSE.md file in the root directory of this source tree.
  65. *
  66. * @license MIT
  67. */function Yf(){return Yf=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},Yf.apply(this,arguments)}const eg=he.createContext(null),x9=he.createContext(null),Xs=he.createContext(null),tg=he.createContext(null),Ys=he.createContext({outlet:null,matches:[],isDataRoute:!1}),_9=he.createContext(null);function yB(r,e){let{relative:t}=e===void 0?{}:e;Kc()||Jr(!1);let{basename:n,navigator:i}=he.useContext(Xs),{hash:a,pathname:s,search:o}=rg(r,{relative:t}),l=s;return n!=="/"&&(l=s==="/"?n:jo([n,s])),i.createHref({pathname:l,search:o,hash:a})}function Kc(){return he.useContext(tg)!=null}function Zc(){return Kc()||Jr(!1),he.useContext(tg).location}function w9(r){he.useContext(Xs).static||he.useLayoutEffect(r)}function yu(){let{isDataRoute:r}=he.useContext(Ys);return r?IB():bB()}function bB(){Kc()||Jr(!1);let r=he.useContext(eg),{basename:e,future:t,navigator:n}=he.useContext(Xs),{matches:i}=he.useContext(Ys),{pathname:a}=Zc(),s=JSON.stringify(z_(i,t.v7_relativeSplatPath)),o=he.useRef(!1);return w9(()=>{o.current=!0}),he.useCallback(function(c,h){if(h===void 0&&(h={}),!o.current)return;if(typeof c=="number"){n.go(c);return}let d=U_(c,JSON.parse(s),a,h.relative==="path");r==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:jo([e,d.pathname])),(h.replace?n.replace:n.push)(d,h.state,h)},[e,n,s,a,r])}const xB=he.createContext(null);function _B(r){let e=he.useContext(Ys).outlet;return e&&he.createElement(xB.Provider,{value:r},e)}function rg(r,e){let{relative:t}=e===void 0?{}:e,{future:n}=he.useContext(Xs),{matches:i}=he.useContext(Ys),{pathname:a}=Zc(),s=JSON.stringify(z_(i,n.v7_relativeSplatPath));return he.useMemo(()=>U_(r,JSON.parse(s),a,t==="path"),[r,s,a,t])}function wB(r,e){return SB(r,e)}function SB(r,e,t,n){Kc()||Jr(!1);let{navigator:i}=he.useContext(Xs),{matches:a}=he.useContext(Ys),s=a[a.length-1],o=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let c=Zc(),h;if(e){var d;let y=typeof e=="string"?$c(e):e;l==="/"||(d=y.pathname)!=null&&d.startsWith(l)||Jr(!1),h=y}else h=c;let v=h.pathname||"/",g=v;if(l!=="/"){let y=l.replace(/^\//,"").split("/");g="/"+v.replace(/^\//,"").split("/").slice(y.length).join("/")}let m=$k(r,{pathname:g}),x=MB(m&&m.map(y=>Object.assign({},y,{params:Object.assign({},o,y.params),pathname:jo([l,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:jo([l,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,t,n);return e&&x?he.createElement(tg.Provider,{value:{location:Yf({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:ko.Pop}},x):x}function EB(){let r=PB(),e=gB(r)?r.status+" "+r.statusText:r instanceof Error?r.message:JSON.stringify(r),t=r instanceof Error?r.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return he.createElement(he.Fragment,null,he.createElement("h2",null,"Unexpected Application Error!"),he.createElement("h3",{style:{fontStyle:"italic"}},e),t?he.createElement("pre",{style:i},t):null,null)}const TB=he.createElement(EB,null);class CB extends he.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?he.createElement(Ys.Provider,{value:this.props.routeContext},he.createElement(_9.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function AB(r){let{routeContext:e,match:t,children:n}=r,i=he.useContext(eg);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),he.createElement(Ys.Provider,{value:e},n)}function MB(r,e,t,n){var i;if(e===void 0&&(e=[]),t===void 0&&(t=null),n===void 0&&(n=null),r==null){var a;if(!t)return null;if(t.errors)r=t.matches;else if((a=n)!=null&&a.v7_partialHydration&&e.length===0&&!t.initialized&&t.matches.length>0)r=t.matches;else return null}let s=r,o=(i=t)==null?void 0:i.errors;if(o!=null){let h=s.findIndex(d=>d.route.id&&(o==null?void 0:o[d.route.id])!==void 0);h>=0||Jr(!1),s=s.slice(0,Math.min(s.length,h+1))}let l=!1,c=-1;if(t&&n&&n.v7_partialHydration)for(let h=0;h<s.length;h++){let d=s[h];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=h),d.route.id){let{loaderData:v,errors:g}=t,m=d.route.loader&&v[d.route.id]===void 0&&(!g||g[d.route.id]===void 0);if(d.route.lazy||m){l=!0,c>=0?s=s.slice(0,c+1):s=[s[0]];break}}}return s.reduceRight((h,d,v)=>{let g,m=!1,x=null,y=null;t&&(g=o&&d.route.id?o[d.route.id]:void 0,x=d.route.errorElement||TB,l&&(c<0&&v===0?(NB("route-fallback"),m=!0,y=null):c===v&&(m=!0,y=d.route.hydrateFallbackElement||null)));let _=e.concat(s.slice(0,v+1)),w=()=>{let S;return g?S=x:m?S=y:d.route.Component?S=he.createElement(d.route.Component,null):d.route.element?S=d.route.element:S=h,he.createElement(AB,{match:d,routeContext:{outlet:h,matches:_,isDataRoute:t!=null},children:S})};return t&&(d.route.ErrorBoundary||d.route.errorElement||v===0)?he.createElement(CB,{location:t.location,revalidation:t.revalidation,component:x,error:g,children:w(),routeContext:{outlet:null,matches:_,isDataRoute:!0}}):w()},null)}var S9=(function(r){return r.UseBlocker="useBlocker",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r})(S9||{}),E9=(function(r){return r.UseBlocker="useBlocker",r.UseLoaderData="useLoaderData",r.UseActionData="useActionData",r.UseRouteError="useRouteError",r.UseNavigation="useNavigation",r.UseRouteLoaderData="useRouteLoaderData",r.UseMatches="useMatches",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r.UseRouteId="useRouteId",r})(E9||{});function RB(r){let e=he.useContext(eg);return e||Jr(!1),e}function OB(r){let e=he.useContext(x9);return e||Jr(!1),e}function DB(r){let e=he.useContext(Ys);return e||Jr(!1),e}function T9(r){let e=DB(),t=e.matches[e.matches.length-1];return t.route.id||Jr(!1),t.route.id}function PB(){var r;let e=he.useContext(_9),t=OB(),n=T9();return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function IB(){let{router:r}=RB(S9.UseNavigateStable),e=T9(E9.UseNavigateStable),t=he.useRef(!1);return w9(()=>{t.current=!0}),he.useCallback(function(i,a){a===void 0&&(a={}),t.current&&(typeof i=="number"?r.navigate(i):r.navigate(i,Yf({fromRouteId:e},a)))},[r,e])}const $T={};function NB(r,e,t){$T[r]||($T[r]=!0)}function LB(r,e){r==null||r.v7_startTransition,r==null||r.v7_relativeSplatPath}function Zx(r){let{to:e,replace:t,state:n,relative:i}=r;Kc()||Jr(!1);let{future:a,static:s}=he.useContext(Xs),{matches:o}=he.useContext(Ys),{pathname:l}=Zc(),c=yu(),h=U_(e,z_(o,a.v7_relativeSplatPath),l,i==="path"),d=JSON.stringify(h);return he.useEffect(()=>c(JSON.parse(d),{replace:t,state:n,relative:i}),[c,d,i,t,n]),null}function kB(r){return _B(r.context)}function Gi(r){Jr(!1)}function BB(r){let{basename:e="/",children:t=null,location:n,navigationType:i=ko.Pop,navigator:a,static:s=!1,future:o}=r;Kc()&&Jr(!1);let l=e.replace(/^\/*/,"/"),c=he.useMemo(()=>({basename:l,navigator:a,static:s,future:Yf({v7_relativeSplatPath:!1},o)}),[l,o,a,s]);typeof n=="string"&&(n=$c(n));let{pathname:h="/",search:d="",hash:v="",state:g=null,key:m="default"}=n,x=he.useMemo(()=>{let y=Bc(h,l);return y==null?null:{location:{pathname:y,search:d,hash:v,state:g,key:m},navigationType:i}},[l,h,d,v,g,m,i]);return x==null?null:he.createElement(Xs.Provider,{value:c},he.createElement(tg.Provider,{children:t,value:x}))}function FB(r){let{children:e,location:t}=r;return wB(Qx(e),t)}new Promise(()=>{});function Qx(r,e){e===void 0&&(e=[]);let t=[];return he.Children.forEach(r,(n,i)=>{if(!he.isValidElement(n))return;let a=[...e,i];if(n.type===he.Fragment){t.push.apply(t,Qx(n.props.children,a));return}n.type!==Gi&&Jr(!1),!n.props.index||!n.props.children||Jr(!1);let s={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(s.children=Qx(n.props.children,a)),t.push(s)}),t}/**
  68. * React Router DOM v6.30.3
  69. *
  70. * Copyright (c) Remix Software Inc.
  71. *
  72. * This source code is licensed under the MIT license found in the
  73. * LICENSE.md file in the root directory of this source tree.
  74. *
  75. * @license MIT
  76. */function Ep(){return Ep=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},Ep.apply(this,arguments)}function C9(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,a;for(a=0;a<n.length;a++)i=n[a],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}function zB(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function UB(r,e){return r.button===0&&(!e||e==="_self")&&!zB(r)}const GB=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],HB=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],jB="6";try{window.__reactRouterVersion=jB}catch{}const VB=he.createContext({isTransitioning:!1}),qB="startTransition",KT=Fk[qB];function XB(r){let{basename:e,children:t,future:n,window:i}=r,a=he.useRef();a.current==null&&(a.current=Xk({window:i,v5Compat:!0}));let s=a.current,[o,l]=he.useState({action:s.action,location:s.location}),{v7_startTransition:c}=n||{},h=he.useCallback(d=>{c&&KT?KT(()=>l(d)):l(d)},[l,c]);return he.useLayoutEffect(()=>s.listen(h),[s,h]),he.useEffect(()=>LB(n),[n]),he.createElement(BB,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:s,future:n})}const YB=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",WB=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,A9=he.forwardRef(function(e,t){let{onClick:n,relative:i,reloadDocument:a,replace:s,state:o,target:l,to:c,preventScrollReset:h,viewTransition:d}=e,v=C9(e,GB),{basename:g}=he.useContext(Xs),m,x=!1;if(typeof c=="string"&&WB.test(c)&&(m=c,YB))try{let S=new URL(window.location.href),A=c.startsWith("//")?new URL(S.protocol+c):new URL(c),C=Bc(A.pathname,g);A.origin===S.origin&&C!=null?c=C+A.search+A.hash:x=!0}catch{}let y=yB(c,{relative:i}),_=KB(c,{replace:s,state:o,target:l,preventScrollReset:h,relative:i,viewTransition:d});function w(S){n&&n(S),S.defaultPrevented||_(S)}return he.createElement("a",Ep({},v,{href:m||y,onClick:x||a?n:w,ref:t,target:l}))}),tv=he.forwardRef(function(e,t){let{"aria-current":n="page",caseSensitive:i=!1,className:a="",end:s=!1,style:o,to:l,viewTransition:c,children:h}=e,d=C9(e,HB),v=rg(l,{relative:d.relative}),g=Zc(),m=he.useContext(x9),{navigator:x,basename:y}=he.useContext(Xs),_=m!=null&&ZB(v)&&c===!0,w=x.encodeLocation?x.encodeLocation(v).pathname:v.pathname,S=g.pathname,A=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;i||(S=S.toLowerCase(),A=A?A.toLowerCase():null,w=w.toLowerCase()),A&&y&&(A=Bc(A,y)||A);const C=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let M=S===w||!s&&S.startsWith(w)&&S.charAt(C)==="/",E=A!=null&&(A===w||!s&&A.startsWith(w)&&A.charAt(w.length)==="/"),O={isActive:M,isPending:E,isTransitioning:_},D=M?n:void 0,I;typeof a=="function"?I=a(O):I=[a,M?"active":null,E?"pending":null,_?"transitioning":null].filter(Boolean).join(" ");let k=typeof o=="function"?o(O):o;return he.createElement(A9,Ep({},d,{"aria-current":D,className:I,ref:t,style:k,to:l,viewTransition:c}),typeof h=="function"?h(O):h)});var Jx;(function(r){r.UseScrollRestoration="useScrollRestoration",r.UseSubmit="useSubmit",r.UseSubmitFetcher="useSubmitFetcher",r.UseFetcher="useFetcher",r.useViewTransitionState="useViewTransitionState"})(Jx||(Jx={}));var ZT;(function(r){r.UseFetcher="useFetcher",r.UseFetchers="useFetchers",r.UseScrollRestoration="useScrollRestoration"})(ZT||(ZT={}));function $B(r){let e=he.useContext(eg);return e||Jr(!1),e}function KB(r,e){let{target:t,replace:n,state:i,preventScrollReset:a,relative:s,viewTransition:o}=e===void 0?{}:e,l=yu(),c=Zc(),h=rg(r,{relative:s});return he.useCallback(d=>{if(UB(d,t)){d.preventDefault();let v=n!==void 0?n:Sp(c)===Sp(h);l(r,{replace:v,state:i,preventScrollReset:a,relative:s,viewTransition:o})}},[c,l,h,n,i,t,r,a,s,o])}function ZB(r,e){e===void 0&&(e={});let t=he.useContext(VB);t==null&&Jr(!1);let{basename:n}=$B(Jx.useViewTransitionState),i=rg(r,{relative:e.relative});if(!t.isTransitioning)return!1;let a=Bc(t.currentLocation.pathname,n)||t.currentLocation.pathname,s=Bc(t.nextLocation.pathname,n)||t.nextLocation.pathname;return Kx(i.pathname,s)!=null||Kx(i.pathname,a)!=null}const G_="kmb_access_token",QB="kmb_user_cache";function M9(){return localStorage.getItem(G_)}function JB(r){localStorage.setItem(G_,r)}function R9(){localStorage.removeItem(G_),sessionStorage.removeItem(QB)}const eF="/api/v1";async function lr(r,e){const t=M9(),n=new Headers(e==null?void 0:e.headers),i=(e==null?void 0:e.body)instanceof FormData;!n.has("Content-Type")&&(e!=null&&e.body)&&!i&&n.set("Content-Type","application/json"),t&&n.set("Authorization",`Bearer ${t}`);const a=await fetch(`${eF}${r}`,{...e,headers:n});if(a.status===401&&R9(),!a.ok){let s=`HTTP ${a.status}`;try{const o=await a.json();s=(o==null?void 0:o.detail)??JSON.stringify(o)}catch{}throw new Error(s)}return await a.json()}async function tF(r,e,t){return lr("/auth/register",{method:"POST",body:JSON.stringify({username:r,password:e,role:t})})}async function rF(r,e){const t=new URLSearchParams;return t.set("username",r),t.set("password",e),lr("/auth/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t.toString()})}async function nF(){return lr("/users/me")}async function f1(r){return lr(`/knowledge-graph/knowledge/${encodeURIComponent(r)}`)}async function H_(){return lr("/knowledge-graph/catalog")}async function iF(){return lr("/knowledge-graph/maintenance/seed-catalog",{method:"POST"})}async function aF(r,e){return lr("/knowledge-graph/prerequisite",{method:"POST",body:JSON.stringify({prerequisite_code:r,dependent_code:e})})}async function sF(r,e){const t=new URLSearchParams({prerequisite_code:r,dependent_code:e});return lr(`/knowledge-graph/prerequisite?${t.toString()}`,{method:"DELETE"})}async function QT(r,e,t,n){const i=new URLSearchParams({name:e});return t!=null&&t.trim()&&i.set("grade",t.trim()),n!=null&&n.trim()&&i.set("category",n.trim()),lr(`/knowledge-graph/knowledge/${encodeURIComponent(r)}?${i.toString()}`,{method:"POST"})}async function oF(r,e,t){const n=new URLSearchParams({grade:r,old_name:e,new_name:t});return lr(`/knowledge-graph/categories/rename?${n.toString()}`,{method:"PATCH"})}async function lF(r,e){const t=new URLSearchParams({grade:r,name:e});return lr(`/knowledge-graph/categories?${t.toString()}`,{method:"DELETE"})}async function uF(r,e){const t=new URLSearchParams({new_name:e});return lr(`/knowledge-graph/knowledge/${encodeURIComponent(r)}/rename?${t.toString()}`,{method:"PATCH"})}async function cF(r){return lr(`/knowledge-graph/knowledge/${encodeURIComponent(r)}`,{method:"DELETE"})}async function O9(r,e,t){const n=new FormData;n.append("file",e);const i=new URLSearchParams;t!=null&&t.trim()&&i.set("knowledge_code",t.trim());const a=i.toString()?`?${i.toString()}`:"";return lr(`${r}${a}`,{method:"POST",body:n})}async function hF(r,e){return O9("/knowledge-graph/exercises/import",r,e)}async function fF(r,e){return O9("/knowledge-graph/exercises/import/preview",r,e)}async function dF(r,e,t,n,i,a,s){return lr("/digital-human/ask",{method:"POST",body:JSON.stringify({question:r,knowledge_code:e,session_id:t,model_name:n,model_provider:i,model_id:a}),signal:s})}async function vF(){return lr("/digital-human/voice-assets")}async function pF(r){const e=new FormData;return e.append("file",r),lr("/digital-human/voice-assets",{method:"POST",body:e})}async function gF(r){return lr(`/digital-human/voice-assets/${encodeURIComponent(r)}`,{method:"DELETE"})}async function mF(r,e=6,t,n){return lr("/recommendation/recommend",{method:"POST",body:JSON.stringify({knowledge_code:r,limit:e,mode:t,...(n==null?void 0:n.knowledge_grade)!=null&&n.knowledge_grade!==""?{knowledge_grade:n.knowledge_grade}:{},...(n==null?void 0:n.knowledge_category)!=null&&n.knowledge_category!==""?{knowledge_category:n.knowledge_category}:{}})})}async function yF(r){return lr("/assessment/exercises",{method:"POST",body:JSON.stringify(r)})}async function bF(r){const e=r?`?knowledge_code=${encodeURIComponent(r)}`:"";return lr(`/assessment/exercises${e}`)}async function xF(r){return r.length?lr("/assessment/exercises/batch",{method:"POST",body:JSON.stringify({ids:r})}):[]}async function _F(r,e){return lr(`/assessment/exercises/${encodeURIComponent(r)}/attempts`,{method:"POST",body:JSON.stringify({answer:e})})}async function JT(){return lr("/assessment/attempts/me")}async function wF(){return lr("/learning-analytics/me")}async function SF(){return lr("/learning-analytics/me/knowledge-breakdown")}async function EF(){return lr("/learning-analytics/students")}async function TF(){return lr("/learning-analytics/wrong-book/me")}async function CF(){return lr("/learning-analytics/wrong-book/summary")}async function AF(){return lr("/modules")}async function MF(r,e,t){return lr("/modules/register",{method:"POST",body:JSON.stringify({name:r,base_url:e,is_enabled:t})})}const j_="kmb_user_cache";function e6(){try{const r=sessionStorage.getItem(j_);return r?JSON.parse(r):null}catch{return null}}function RF(r){sessionStorage.setItem(j_,JSON.stringify(r))}function OF(){sessionStorage.removeItem(j_)}const D9=he.createContext(null);function DF({children:r}){const e=e6(),[t,n]=he.useState(e),[i,a]=he.useState(!e),s=he.useCallback(async()=>{e6()||a(!0);try{const l=await nF();n(l),RF(l)}catch{n(null),OF()}finally{a(!1)}},[]);he.useEffect(()=>{s()},[s]);const o={user:t,role:(t==null?void 0:t.role)??null,username:(t==null?void 0:t.username)??"",loading:i,refresh:s};return N.jsx(D9.Provider,{value:o,children:r})}function bu(){const r=he.useContext(D9);if(!r)throw new Error("useCurrentUser must be used within UserProvider");return r}function PF(){const r=yu(),{role:e,username:t}=bu(),n=e==="teacher"?"教师":e==="student"?"学生":"";return N.jsxs(N.Fragment,{children:[N.jsx("div",{className:"nav",children:N.jsxs("div",{className:"nav-inner",children:[N.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[N.jsxs("div",{className:"row",style:{alignItems:"center"},children:[N.jsx(A9,{to:"/",className:"brand",children:"KnowMathBot"}),N.jsx("span",{className:"pill",children:"初中数学 · AI 数字人辅助教学"})]}),t||n?N.jsxs("div",{className:"row",style:{gap:10,alignItems:"center",flexWrap:"wrap"},children:[t?N.jsxs("div",{className:"row",style:{gap:8,alignItems:"center"},children:[N.jsx("span",{className:"pill",children:"当前用户"}),N.jsx("span",{className:"mono",children:t})]}):null,n?N.jsxs("div",{className:"row",style:{gap:8,alignItems:"center"},children:[N.jsx("span",{className:"pill",children:"角色"}),N.jsx("span",{className:"mono",children:n})]}):null]}):null]}),N.jsxs("div",{className:"row",style:{gap:10,alignItems:"center",flexWrap:"wrap"},children:[N.jsx(tv,{to:"/knowledge",className:({isActive:i})=>`btn ${i?"primary":""}`.trim(),children:"知识图谱"}),N.jsx(tv,{to:"/digital-human",className:({isActive:i})=>`btn ${i?"primary":""}`.trim(),children:"数字人答疑"}),N.jsx(tv,{to:"/assessment",className:({isActive:i})=>`btn ${i?"primary":""}`.trim(),children:"习题测评"}),N.jsx(tv,{to:"/analytics",className:({isActive:i})=>`btn ${i?"primary":""}`.trim(),children:"学情统计"}),N.jsx("button",{className:"btn danger",onClick:()=>{R9(),r("/login")},children:"退出"})]})]})}),N.jsx("div",{className:"container",children:N.jsx(kB,{})})]})}function IF(){return N.jsx(DF,{children:N.jsx(PF,{})})}function NF(){const r=yu(),[e,t]=he.useState("login"),[n,i]=he.useState("student1"),[a,s]=he.useState("123456"),[o,l]=he.useState("student"),[c,h]=he.useState(null),[d,v]=he.useState(null),[g,m]=he.useState(!1);async function x(y){y.preventDefault(),v(null),h(null),m(!0);try{if(e==="register")await tF(n,a,o),h("注册成功,请登录。"),t("login");else{const _=await rF(n,a);JB(_.access_token),r("/")}}catch(_){v(_ instanceof Error?_.message:"操作失败")}finally{m(!1)}}return N.jsx("div",{className:"container",style:{maxWidth:520,minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",paddingTop:24,paddingBottom:24},children:N.jsxs("div",{className:"card",style:{padding:18,width:"100%"},children:[N.jsxs("div",{className:"row",style:{justifyContent:"space-between"},children:[N.jsxs("div",{children:[N.jsx("div",{style:{fontSize:20,fontWeight:800},children:"KnowMathBot"}),N.jsx("div",{className:"muted",style:{marginTop:6},children:"更懂你的AI数学辅助机器人"})]}),N.jsxs("div",{className:"row",children:[N.jsx("button",{className:`btn ${e==="login"?"primary":""}`,onClick:()=>t("login"),children:"登录"}),N.jsx("button",{className:`btn ${e==="register"?"primary":""}`,onClick:()=>t("register"),children:"注册"})]})]}),N.jsxs("form",{onSubmit:x,style:{marginTop:14},children:[N.jsxs("div",{style:{marginBottom:10},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"用户名"}),N.jsx("input",{className:"input",value:n,onChange:y=>i(y.target.value)})]}),N.jsxs("div",{style:{marginBottom:10},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"密码"}),N.jsx("input",{className:"input",type:"password",value:a,onChange:y=>s(y.target.value)})]}),e==="register"?N.jsxs("div",{style:{marginBottom:10},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"角色"}),N.jsxs("select",{className:"select",value:o,onChange:y=>l(y.target.value),children:[N.jsx("option",{value:"student",children:"学生"}),N.jsx("option",{value:"teacher",children:"教师"})]})]}):null,d?N.jsx("div",{className:"error",style:{marginBottom:10},children:d}):null,c?N.jsx("div",{className:"success",style:{marginBottom:10},children:c}):null,N.jsx("button",{className:"btn primary",disabled:g,style:{width:"100%"},children:g?"处理中...":e==="login"?"登录":"注册"})]})]})})}function e4(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function LF(r){if(Array.isArray(r))return r}function kF(r){if(Array.isArray(r))return e4(r)}function hl(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function BF(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,I9(n.key),n)}}function fl(r,e,t){return e&&BF(r.prototype,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function Ri(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=V_(r))||e){t&&(r=t);var n=0,i=function(){};return{s:i,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
  77. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,o=!1;return{s:function(){t=t.call(r)},n:function(){var l=t.next();return s=l.done,l},e:function(l){o=!0,a=l},f:function(){try{s||t.return==null||t.return()}finally{if(o)throw a}}}}function P9(r,e,t){return(e=I9(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function FF(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function zF(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,a,s,o=[],l=!0,c=!1;try{if(a=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=a.call(t)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(h){c=!0,i=h}finally{try{if(!l&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(c)throw i}}return o}}function UF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
  78. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GF(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
  79. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _n(r,e){return LF(r)||zF(r,e)||V_(r,e)||UF()}function Tp(r){return kF(r)||FF(r)||V_(r)||GF()}function HF(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function I9(r){var e=HF(r,"string");return typeof e=="symbol"?e:e+""}function On(r){"@babel/helpers - typeof";return On=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},On(r)}function V_(r,e){if(r){if(typeof r=="string")return e4(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?e4(r,e):void 0}}var An=typeof window>"u"?null:window,t6=An?An.navigator:null;An&&An.document;var jF=On(""),N9=On({}),VF=On(function(){}),qF=typeof HTMLElement>"u"?"undefined":On(HTMLElement),Ed=function(e){return e&&e.instanceString&&en(e.instanceString)?e.instanceString():null},xt=function(e){return e!=null&&On(e)==jF},en=function(e){return e!=null&&On(e)===VF},Cr=function(e){return!qi(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Zt=function(e){return e!=null&&On(e)===N9&&!Cr(e)&&e.constructor===Object},XF=function(e){return e!=null&&On(e)===N9},ut=function(e){return e!=null&&On(e)===On(1)&&!isNaN(e)},YF=function(e){return ut(e)&&Math.floor(e)===e},Cp=function(e){if(qF!=="undefined")return e!=null&&e instanceof HTMLElement},qi=function(e){return Td(e)||L9(e)},Td=function(e){return Ed(e)==="collection"&&e._private.single},L9=function(e){return Ed(e)==="collection"&&!e._private.single},q_=function(e){return Ed(e)==="core"},k9=function(e){return Ed(e)==="stylesheet"},WF=function(e){return Ed(e)==="event"},$o=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},$F=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},KF=function(e){return Zt(e)&&ut(e.x1)&&ut(e.x2)&&ut(e.y1)&&ut(e.y2)},ZF=function(e){return XF(e)&&en(e.then)},QF=function(){return t6&&t6.userAgent.match(/msie|trident|edge/i)},Fc=function(e,t){t||(t=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var a=[],s=0;s<arguments.length;s++)a.push(arguments[s]);return a.join("$")});var n=function(){var a=this,s=arguments,o,l=t.apply(a,s),c=n.cache;return(o=c[l])||(o=c[l]=e.apply(a,s)),o};return n.cache={},n},X_=Fc(function(r){return r.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),ng=Fc(function(r){return r.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),B9=Fc(function(r,e){return r+e[0].toUpperCase()+e.substring(1)},function(r,e){return r+"$"+e}),r6=function(e){return $o(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},Bo=function(e,t){return e.slice(-1*t.length)===t},Rn="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",JF="rgb[a]?\\(("+Rn+"[%]?)\\s*,\\s*("+Rn+"[%]?)\\s*,\\s*("+Rn+"[%]?)(?:\\s*,\\s*("+Rn+"))?\\)",ez="rgb[a]?\\((?:"+Rn+"[%]?)\\s*,\\s*(?:"+Rn+"[%]?)\\s*,\\s*(?:"+Rn+"[%]?)(?:\\s*,\\s*(?:"+Rn+"))?\\)",tz="hsl[a]?\\(("+Rn+")\\s*,\\s*("+Rn+"[%])\\s*,\\s*("+Rn+"[%])(?:\\s*,\\s*("+Rn+"))?\\)",rz="hsl[a]?\\((?:"+Rn+")\\s*,\\s*(?:"+Rn+"[%])\\s*,\\s*(?:"+Rn+"[%])(?:\\s*,\\s*(?:"+Rn+"))?\\)",nz="\\#[0-9a-fA-F]{3}",iz="\\#[0-9a-fA-F]{6}",F9=function(e,t){return e<t?-1:e>t?1:0},az=function(e,t){return-1*F9(e,t)},Ct=Object.assign!=null?Object.assign.bind(Object):function(r){for(var e=arguments,t=1;t<e.length;t++){var n=e[t];if(n!=null)for(var i=Object.keys(n),a=0;a<i.length;a++){var s=i[a];r[s]=n[s]}}return r},sz=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var t=e.length===4,n,i,a,s=16;return t?(n=parseInt(e[1]+e[1],s),i=parseInt(e[2]+e[2],s),a=parseInt(e[3]+e[3],s)):(n=parseInt(e[1]+e[2],s),i=parseInt(e[3]+e[4],s),a=parseInt(e[5]+e[6],s)),[n,i,a]}},oz=function(e){var t,n,i,a,s,o,l,c;function h(m,x,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?m+(x-m)*6*y:y<1/2?x:y<2/3?m+(x-m)*(2/3-y)*6:m}var d=new RegExp("^"+tz+"$").exec(e);if(d){if(n=parseInt(d[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,i=parseFloat(d[2]),i<0||i>100||(i=i/100,a=parseFloat(d[3]),a<0||a>100)||(a=a/100,s=d[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(i===0)o=l=c=Math.round(a*255);else{var v=a<.5?a*(1+i):a+i-a*i,g=2*a-v;o=Math.round(255*h(g,v,n+1/3)),l=Math.round(255*h(g,v,n)),c=Math.round(255*h(g,v,n-1/3))}t=[o,l,c,s]}return t},lz=function(e){var t,n=new RegExp("^"+JF+"$").exec(e);if(n){t=[];for(var i=[],a=1;a<=3;a++){var s=n[a];if(s[s.length-1]==="%"&&(i[a]=!0),s=parseFloat(s),i[a]&&(s=s/100*255),s<0||s>255)return;t.push(Math.floor(s))}var o=i[1]||i[2]||i[3],l=i[1]&&i[2]&&i[3];if(o&&!l)return;var c=n[4];if(c!==void 0){if(c=parseFloat(c),c<0||c>1)return;t.push(c)}}return t},uz=function(e){return cz[e.toLowerCase()]},z9=function(e){return(Cr(e)?e:null)||uz(e)||sz(e)||lz(e)||oz(e)},cz={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},U9=function(e){for(var t=e.map,n=e.keys,i=n.length,a=0;a<i;a++){var s=n[a];if(Zt(s))throw Error("Tried to set map with object key");a<n.length-1?(t[s]==null&&(t[s]={}),t=t[s]):t[s]=e.value}},G9=function(e){for(var t=e.map,n=e.keys,i=n.length,a=0;a<i;a++){var s=n[a];if(Zt(s))throw Error("Tried to get map with object key");if(t=t[s],t==null)return t}return t},rv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cd(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var d1,n6;function Ad(){if(n6)return d1;n6=1;function r(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return d1=r,d1}var v1,i6;function hz(){if(i6)return v1;i6=1;var r=typeof rv=="object"&&rv&&rv.Object===Object&&rv;return v1=r,v1}var p1,a6;function ig(){if(a6)return p1;a6=1;var r=hz(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return p1=t,p1}var g1,s6;function fz(){if(s6)return g1;s6=1;var r=ig(),e=function(){return r.Date.now()};return g1=e,g1}var m1,o6;function dz(){if(o6)return m1;o6=1;var r=/\s/;function e(t){for(var n=t.length;n--&&r.test(t.charAt(n)););return n}return m1=e,m1}var y1,l6;function vz(){if(l6)return y1;l6=1;var r=dz(),e=/^\s+/;function t(n){return n&&n.slice(0,r(n)+1).replace(e,"")}return y1=t,y1}var b1,u6;function Y_(){if(u6)return b1;u6=1;var r=ig(),e=r.Symbol;return b1=e,b1}var x1,c6;function pz(){if(c6)return x1;c6=1;var r=Y_(),e=Object.prototype,t=e.hasOwnProperty,n=e.toString,i=r?r.toStringTag:void 0;function a(s){var o=t.call(s,i),l=s[i];try{s[i]=void 0;var c=!0}catch{}var h=n.call(s);return c&&(o?s[i]=l:delete s[i]),h}return x1=a,x1}var _1,h6;function gz(){if(h6)return _1;h6=1;var r=Object.prototype,e=r.toString;function t(n){return e.call(n)}return _1=t,_1}var w1,f6;function H9(){if(f6)return w1;f6=1;var r=Y_(),e=pz(),t=gz(),n="[object Null]",i="[object Undefined]",a=r?r.toStringTag:void 0;function s(o){return o==null?o===void 0?i:n:a&&a in Object(o)?e(o):t(o)}return w1=s,w1}var S1,d6;function mz(){if(d6)return S1;d6=1;function r(e){return e!=null&&typeof e=="object"}return S1=r,S1}var E1,v6;function Md(){if(v6)return E1;v6=1;var r=H9(),e=mz(),t="[object Symbol]";function n(i){return typeof i=="symbol"||e(i)&&r(i)==t}return E1=n,E1}var T1,p6;function yz(){if(p6)return T1;p6=1;var r=vz(),e=Ad(),t=Md(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt;function l(c){if(typeof c=="number")return c;if(t(c))return n;if(e(c)){var h=typeof c.valueOf=="function"?c.valueOf():c;c=e(h)?h+"":h}if(typeof c!="string")return c===0?c:+c;c=r(c);var d=a.test(c);return d||s.test(c)?o(c.slice(2),d?2:8):i.test(c)?n:+c}return T1=l,T1}var C1,g6;function bz(){if(g6)return C1;g6=1;var r=Ad(),e=fz(),t=yz(),n="Expected a function",i=Math.max,a=Math.min;function s(o,l,c){var h,d,v,g,m,x,y=0,_=!1,w=!1,S=!0;if(typeof o!="function")throw new TypeError(n);l=t(l)||0,r(c)&&(_=!!c.leading,w="maxWait"in c,v=w?i(t(c.maxWait)||0,l):v,S="trailing"in c?!!c.trailing:S);function A(V){var X=h,W=d;return h=d=void 0,y=V,g=o.apply(W,X),g}function C(V){return y=V,m=setTimeout(O,l),_?A(V):g}function M(V){var X=V-x,W=V-y,P=l-X;return w?a(P,v-W):P}function E(V){var X=V-x,W=V-y;return x===void 0||X>=l||X<0||w&&W>=v}function O(){var V=e();if(E(V))return D(V);m=setTimeout(O,M(V))}function D(V){return m=void 0,S&&h?A(V):(h=d=void 0,g)}function I(){m!==void 0&&clearTimeout(m),y=0,h=x=d=m=void 0}function k(){return m===void 0?g:D(e())}function U(){var V=e(),X=E(V);if(h=arguments,d=this,x=V,X){if(m===void 0)return C(x);if(w)return clearTimeout(m),m=setTimeout(O,l),A(x)}return m===void 0&&(m=setTimeout(O,l)),g}return U.cancel=I,U.flush=k,U}return C1=s,C1}var xz=bz(),Rd=Cd(xz),A1=An?An.performance:null,j9=A1&&A1.now?function(){return A1.now()}:function(){return Date.now()},_z=(function(){if(An){if(An.requestAnimationFrame)return function(r){An.requestAnimationFrame(r)};if(An.mozRequestAnimationFrame)return function(r){An.mozRequestAnimationFrame(r)};if(An.webkitRequestAnimationFrame)return function(r){An.webkitRequestAnimationFrame(r)};if(An.msRequestAnimationFrame)return function(r){An.msRequestAnimationFrame(r)}}return function(r){r&&setTimeout(function(){r(j9())},1e3/60)}})(),Ap=function(e){return _z(e)},js=j9,nu=9261,V9=65599,wc=5381,q9=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nu,n=t,i;i=e.next(),!i.done;)n=n*V9+i.value|0;return n},Wf=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nu;return t*V9+e|0},$f=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:wc;return(t<<5)+t+e|0},wz=function(e,t){return e*2097152+t},Ao=function(e){return e[0]*2097152+e[1]},nv=function(e,t){return[Wf(e[0],t[0]),$f(e[1],t[1])]},m6=function(e,t){var n={value:0,done:!1},i=0,a=e.length,s={next:function(){return i<a?n.value=e[i++]:n.done=!0,n}};return q9(s,t)},cu=function(e,t){var n={value:0,done:!1},i=0,a=e.length,s={next:function(){return i<a?n.value=e.charCodeAt(i++):n.done=!0,n}};return q9(s,t)},X9=function(){return Sz(arguments)},Sz=function(e){for(var t,n=0;n<e.length;n++){var i=e[n];n===0?t=cu(i):t=cu(i,t)}return t};function Ez(r,e,t,n,i){var a=i*Math.PI/180,s=Math.cos(a)*(r-t)-Math.sin(a)*(e-n)+t,o=Math.sin(a)*(r-t)+Math.cos(a)*(e-n)+n;return{x:s,y:o}}var Tz=function(e,t,n,i,a,s){return{x:(e-n)*a+n,y:(t-i)*s+i}};function Cz(r,e,t){if(t===0)return r;var n=(e.x1+e.x2)/2,i=(e.y1+e.y2)/2,a=e.w/e.h,s=1/a,o=Ez(r.x,r.y,n,i,t),l=Tz(o.x,o.y,n,i,a,s);return{x:l.x,y:l.y}}var y6=!0,Az=console.warn!=null,Mz=console.trace!=null,W_=Number.MAX_SAFE_INTEGER||9007199254740991,Y9=function(){return!0},Mp=function(){return!1},b6=function(){return 0},$_=function(){},jr=function(e){throw new Error(e)},W9=function(e){if(e!==void 0)y6=!!e;else return y6},fr=function(e){W9()&&(Az?console.warn(e):(console.log(e),Mz&&console.trace()))},Rz=function(e){return Ct({},e)},Ja=function(e){return e==null?e:Cr(e)?e.slice():Zt(e)?Rz(e):e},Oz=function(e){return e.slice()},$9=function(e,t){for(t=e="";e++<36;t+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return t},Dz={},K9=function(){return Dz},$n=function(e){var t=Object.keys(e);return function(n){for(var i={},a=0;a<t.length;a++){var s=t[a],o=n==null?void 0:n[s];i[s]=o===void 0?e[s]:o}return i}},Ko=function(e,t,n){for(var i=e.length-1;i>=0;i--)e[i]===t&&e.splice(i,1)},K_=function(e){e.splice(0,e.length)},Pz=function(e,t){for(var n=0;n<t.length;n++){var i=t[n];e.push(i)}},Ai=function(e,t,n){return n&&(t=B9(n,t)),e[t]},ks=function(e,t,n,i){n&&(t=B9(n,t)),e[t]=i},Iz=(function(){function r(){hl(this,r),this._obj={}}return fl(r,[{key:"set",value:function(t,n){return this._obj[t]=n,this}},{key:"delete",value:function(t){return this._obj[t]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(t){return this._obj[t]!==void 0}},{key:"get",value:function(t){return this._obj[t]}}])})(),zs=typeof Map<"u"?Map:Iz,Nz="undefined",Lz=(function(){function r(e){if(hl(this,r),this._obj=Object.create(null),this.size=0,e!=null){var t;e.instanceString!=null&&e.instanceString()===this.instanceString()?t=e.toArray():t=e;for(var n=0;n<t.length;n++)this.add(t[n])}}return fl(r,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(t){var n=this._obj;n[t]!==1&&(n[t]=1,this.size++)}},{key:"delete",value:function(t){var n=this._obj;n[t]===1&&(n[t]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(t){return this._obj[t]===1}},{key:"toArray",value:function(){var t=this;return Object.keys(this._obj).filter(function(n){return t.has(n)})}},{key:"forEach",value:function(t,n){return this.toArray().forEach(t,n)}}])})(),Qc=(typeof Set>"u"?"undefined":On(Set))!==Nz?Set:Lz,ag=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||t===void 0||!q_(e)){jr("An element must have a core reference and parameters set");return}var i=t.group;if(i==null&&(t.data&&t.data.source!=null&&t.data.target!=null?i="edges":i="nodes"),i!=="nodes"&&i!=="edges"){jr("An element must be of type `nodes` or `edges`; you specified `"+i+"`");return}this.length=1,this[0]=this;var a=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:i,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:t.selectable===void 0?!0:!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:t.grabbable===void 0?!0:!!t.grabbable,pannable:t.pannable===void 0?i==="edges":!!t.pannable,active:!1,classes:new Qc,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(a.position.x==null&&(a.position.x=0),a.position.y==null&&(a.position.y=0),t.renderedPosition){var s=t.renderedPosition,o=e.pan(),l=e.zoom();a.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var c=[];Cr(t.classes)?c=t.classes:xt(t.classes)&&(c=t.classes.split(/\s+/));for(var h=0,d=c.length;h<d;h++){var v=c[h];!v||v===""||a.classes.add(v)}this.createEmitter(),(n===void 0||n)&&this.restore();var g=t.style||t.css;g&&(fr("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(g))},x6=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(n,i,a){var s;Zt(n)&&!qi(n)&&(s=n,n=s.roots||s.root,i=s.visit,a=s.directed),a=arguments.length===2&&!en(i)?i:a,i=en(i)?i:function(){};for(var o=this._private.cy,l=n=xt(n)?this.filter(n):n,c=[],h=[],d={},v={},g={},m=0,x,y=this.byGroup(),_=y.nodes,w=y.edges,S=0;S<l.length;S++){var A=l[S],C=A.id();A.isNode()&&(c.unshift(A),e.bfs&&(g[C]=!0,h.push(A)),v[C]=0)}for(var M=function(){var V=e.bfs?c.shift():c.pop(),X=V.id();if(e.dfs){if(g[X])return 0;g[X]=!0,h.push(V)}var W=v[X],P=d[X],H=P!=null?P.source():null,z=P!=null?P.target():null,$=P==null?void 0:V.same(H)?z[0]:H[0],B;if(B=i(V,P,$,m++,W),B===!0)return x=V,1;if(B===!1)return 1;for(var L=V.connectedEdges().filter(function(le){return(!a||le.source().same(V))&&w.has(le)}),Y=0;Y<L.length;Y++){var G=L[Y],re=G.connectedNodes().filter(function(le){return!le.same(V)&&_.has(le)}),ie=re.id();re.length!==0&&!g[ie]&&(re=re[0],c.push(re),e.bfs&&(g[ie]=!0,h.push(re)),d[ie]=G,v[ie]=v[X]+1)}},E;c.length!==0&&(E=M(),!(E!==0&&E===1)););for(var O=o.collection(),D=0;D<h.length;D++){var I=h[D],k=d[I.id()];k!=null&&O.push(k),O.push(I)}return{path:o.collection(O),found:o.collection(x)}}},Kf={breadthFirstSearch:x6({bfs:!0}),depthFirstSearch:x6({dfs:!0})};Kf.bfs=Kf.breadthFirstSearch;Kf.dfs=Kf.depthFirstSearch;var ep={exports:{}},kz=ep.exports,_6;function Bz(){return _6||(_6=1,(function(r,e){(function(){var t,n,i,a,s,o,l,c,h,d,v,g,m,x,y;i=Math.floor,d=Math.min,n=function(_,w){return _<w?-1:_>w?1:0},h=function(_,w,S,A,C){var M;if(S==null&&(S=0),C==null&&(C=n),S<0)throw new Error("lo must be non-negative");for(A==null&&(A=_.length);S<A;)M=i((S+A)/2),C(w,_[M])<0?A=M:S=M+1;return[].splice.apply(_,[S,S-S].concat(w)),w},o=function(_,w,S){return S==null&&(S=n),_.push(w),x(_,0,_.length-1,S)},s=function(_,w){var S,A;return w==null&&(w=n),S=_.pop(),_.length?(A=_[0],_[0]=S,y(_,0,w)):A=S,A},c=function(_,w,S){var A;return S==null&&(S=n),A=_[0],_[0]=w,y(_,0,S),A},l=function(_,w,S){var A;return S==null&&(S=n),_.length&&S(_[0],w)<0&&(A=[_[0],w],w=A[0],_[0]=A[1],y(_,0,S)),w},a=function(_,w){var S,A,C,M,E,O;for(w==null&&(w=n),M=(function(){O=[];for(var D=0,I=i(_.length/2);0<=I?D<I:D>I;0<=I?D++:D--)O.push(D);return O}).apply(this).reverse(),E=[],A=0,C=M.length;A<C;A++)S=M[A],E.push(y(_,S,w));return E},m=function(_,w,S){var A;if(S==null&&(S=n),A=_.indexOf(w),A!==-1)return x(_,0,A,S),y(_,A,S)},v=function(_,w,S){var A,C,M,E,O;if(S==null&&(S=n),C=_.slice(0,w),!C.length)return C;for(a(C,S),O=_.slice(w),M=0,E=O.length;M<E;M++)A=O[M],l(C,A,S);return C.sort(S).reverse()},g=function(_,w,S){var A,C,M,E,O,D,I,k,U;if(S==null&&(S=n),w*10<=_.length){if(M=_.slice(0,w).sort(S),!M.length)return M;for(C=M[M.length-1],I=_.slice(w),E=0,D=I.length;E<D;E++)A=I[E],S(A,C)<0&&(h(M,A,0,null,S),M.pop(),C=M[M.length-1]);return M}for(a(_,S),U=[],O=0,k=d(w,_.length);0<=k?O<k:O>k;0<=k?++O:--O)U.push(s(_,S));return U},x=function(_,w,S,A){var C,M,E;for(A==null&&(A=n),C=_[S];S>w;){if(E=S-1>>1,M=_[E],A(C,M)<0){_[S]=M,S=E;continue}break}return _[S]=C},y=function(_,w,S){var A,C,M,E,O;for(S==null&&(S=n),C=_.length,O=w,M=_[w],A=2*w+1;A<C;)E=A+1,E<C&&!(S(_[A],_[E])<0)&&(A=E),_[w]=_[A],w=A,A=2*w+1;return _[w]=M,x(_,O,w,S)},t=(function(){_.push=o,_.pop=s,_.replace=c,_.pushpop=l,_.heapify=a,_.updateItem=m,_.nlargest=v,_.nsmallest=g;function _(w){this.cmp=w??n,this.nodes=[]}return _.prototype.push=function(w){return o(this.nodes,w,this.cmp)},_.prototype.pop=function(){return s(this.nodes,this.cmp)},_.prototype.peek=function(){return this.nodes[0]},_.prototype.contains=function(w){return this.nodes.indexOf(w)!==-1},_.prototype.replace=function(w){return c(this.nodes,w,this.cmp)},_.prototype.pushpop=function(w){return l(this.nodes,w,this.cmp)},_.prototype.heapify=function(){return a(this.nodes,this.cmp)},_.prototype.updateItem=function(w){return m(this.nodes,w,this.cmp)},_.prototype.clear=function(){return this.nodes=[]},_.prototype.empty=function(){return this.nodes.length===0},_.prototype.size=function(){return this.nodes.length},_.prototype.clone=function(){var w;return w=new _,w.nodes=this.nodes.slice(0),w},_.prototype.toArray=function(){return this.nodes.slice(0)},_.prototype.insert=_.prototype.push,_.prototype.top=_.prototype.peek,_.prototype.front=_.prototype.peek,_.prototype.has=_.prototype.contains,_.prototype.copy=_.prototype.clone,_})(),(function(_,w){return r.exports=w()})(this,function(){return t})}).call(kz)})(ep)),ep.exports}var M1,w6;function Fz(){return w6||(w6=1,M1=Bz()),M1}var zz=Fz(),Od=Cd(zz),Uz=$n({root:null,weight:function(e){return 1},directed:!1}),Gz={dijkstra:function(e){if(!Zt(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=Uz(e),i=n.root,a=n.weight,s=n.directed,o=this,l=a,c=xt(i)?this.filter(i)[0]:i[0],h={},d={},v={},g=this.byGroup(),m=g.nodes,x=g.edges;x.unmergeBy(function(W){return W.isLoop()});for(var y=function(P){return h[P.id()]},_=function(P,H){h[P.id()]=H,w.updateItem(P)},w=new Od(function(W,P){return y(W)-y(P)}),S=0;S<m.length;S++){var A=m[S];h[A.id()]=A.same(c)?0:1/0,w.push(A)}for(var C=function(P,H){for(var z=(s?P.edgesTo(H):P.edgesWith(H)).intersect(x),$=1/0,B,L=0;L<z.length;L++){var Y=z[L],G=l(Y);(G<$||!B)&&($=G,B=Y)}return{edge:B,dist:$}};w.size()>0;){var M=w.pop(),E=y(M),O=M.id();if(v[O]=E,E!==1/0)for(var D=M.neighborhood().intersect(m),I=0;I<D.length;I++){var k=D[I],U=k.id(),V=C(M,k),X=E+V.dist;X<y(k)&&(_(k,X),d[U]={node:M,edge:V.edge})}}return{distanceTo:function(P){var H=xt(P)?m.filter(P)[0]:P[0];return v[H.id()]},pathTo:function(P){var H=xt(P)?m.filter(P)[0]:P[0],z=[],$=H,B=$.id();if(H.length>0)for(z.unshift(H);d[B];){var L=d[B];z.unshift(L.edge),z.unshift(L.node),$=L.node,B=$.id()}return o.spawn(z)}}}},Hz={kruskal:function(e){e=e||function(S){return 1};for(var t=this.byGroup(),n=t.nodes,i=t.edges,a=n.length,s=new Array(a),o=n,l=function(A){for(var C=0;C<s.length;C++){var M=s[C];if(M.has(A))return C}},c=0;c<a;c++)s[c]=this.spawn(n[c]);for(var h=i.sort(function(S,A){return e(S)-e(A)}),d=0;d<h.length;d++){var v=h[d],g=v.source()[0],m=v.target()[0],x=l(g),y=l(m),_=s[x],w=s[y];x!==y&&(o.merge(v),_.merge(w),s.splice(y,1))}return o}},jz=$n({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),Vz={aStar:function(e){var t=this.cy(),n=jz(e),i=n.root,a=n.goal,s=n.heuristic,o=n.directed,l=n.weight;i=t.collection(i)[0],a=t.collection(a)[0];var c=i.id(),h=a.id(),d={},v={},g={},m=new Od(function(B,L){return v[B.id()]-v[L.id()]}),x=new Qc,y={},_={},w=function(L,Y){m.push(L),x.add(Y)},S,A,C=function(){S=m.pop(),A=S.id(),x.delete(A)},M=function(L){return x.has(L)};w(i,c),d[c]=0,v[c]=s(i);for(var E=0;m.size()>0;){if(C(),E++,A===h){for(var O=[],D=a,I=h,k=_[I];O.unshift(D),k!=null&&O.unshift(k),D=y[I],D!=null;)I=D.id(),k=_[I];return{found:!0,distance:d[A],path:this.spawn(O),steps:E}}g[A]=!0;for(var U=S._private.edges,V=0;V<U.length;V++){var X=U[V];if(this.hasElementWithId(X.id())&&!(o&&X.data("source")!==A)){var W=X.source(),P=X.target(),H=W.id()!==A?W:P,z=H.id();if(this.hasElementWithId(z)&&!g[z]){var $=d[A]+l(X);if(!M(z)){d[z]=$,v[z]=$+s(H),w(H,z),y[z]=S,_[z]=X;continue}$<d[z]&&(d[z]=$,v[z]=$+s(H),y[z]=S,_[z]=X)}}}}return{found:!1,distance:void 0,path:void 0,steps:E}}},qz=$n({weight:function(e){return 1},directed:!1}),Xz={floydWarshall:function(e){for(var t=this.cy(),n=qz(e),i=n.weight,a=n.directed,s=i,o=this.byGroup(),l=o.nodes,c=o.edges,h=l.length,d=h*h,v=function(G){return l.indexOf(G)},g=function(G){return l[G]},m=new Array(d),x=0;x<d;x++){var y=x%h,_=(x-y)/h;_===y?m[x]=0:m[x]=1/0}for(var w=new Array(d),S=new Array(d),A=0;A<c.length;A++){var C=c[A],M=C.source()[0],E=C.target()[0];if(M!==E){var O=v(M),D=v(E),I=O*h+D,k=s(C);if(m[I]>k&&(m[I]=k,w[I]=D,S[I]=C),!a){var U=D*h+O;!a&&m[U]>k&&(m[U]=k,w[U]=O,S[U]=C)}}}for(var V=0;V<h;V++)for(var X=0;X<h;X++)for(var W=X*h+V,P=0;P<h;P++){var H=X*h+P,z=V*h+P;m[W]+m[z]<m[H]&&(m[H]=m[W]+m[z],w[H]=w[W])}var $=function(G){return(xt(G)?t.filter(G):G)[0]},B=function(G){return v($(G))},L={distance:function(G,re){var ie=B(G),le=B(re);return m[ie*h+le]},path:function(G,re){var ie=B(G),le=B(re),ce=g(ie);if(ie===le)return ce.collection();if(w[ie*h+le]==null)return t.collection();var _e=t.collection(),pe=ie,ae;for(_e.merge(ce);ie!==le;)pe=ie,ie=w[ie*h+le],ae=S[pe*h+ie],_e.merge(ae),_e.merge(g(ie));return _e}};return L}},Yz=$n({weight:function(e){return 1},directed:!1,root:null}),Wz={bellmanFord:function(e){var t=this,n=Yz(e),i=n.weight,a=n.directed,s=n.root,o=i,l=this,c=this.cy(),h=this.byGroup(),d=h.edges,v=h.nodes,g=v.length,m=new zs,x=!1,y=[];s=c.collection(s)[0],d.unmergeBy(function(Be){return Be.isLoop()});for(var _=d.length,w=function($e){var Ye=m.get($e.id());return Ye||(Ye={},m.set($e.id(),Ye)),Ye},S=function($e){return(xt($e)?c.$($e):$e)[0]},A=function($e){return w(S($e)).dist},C=function($e){for(var Ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s,He=S($e),tt=[],ot=He;;){if(ot==null)return t.spawn();var ct=w(ot),Ze=ct.edge,bt=ct.pred;if(tt.unshift(ot[0]),ot.same(Ye)&&tt.length>0)break;Ze!=null&&tt.unshift(Ze),ot=bt}return l.spawn(tt)},M=0;M<g;M++){var E=v[M],O=w(E);E.same(s)?O.dist=0:O.dist=1/0,O.pred=null,O.edge=null}for(var D=!1,I=function($e,Ye,He,tt,ot,ct){var Ze=tt.dist+ct;Ze<ot.dist&&!He.same(tt.edge)&&(ot.dist=Ze,ot.pred=$e,ot.edge=He,D=!0)},k=1;k<g;k++){D=!1;for(var U=0;U<_;U++){var V=d[U],X=V.source(),W=V.target(),P=o(V),H=w(X),z=w(W);I(X,W,V,H,z,P),a||I(W,X,V,z,H,P)}if(!D)break}if(D)for(var $=[],B=0;B<_;B++){var L=d[B],Y=L.source(),G=L.target(),re=o(L),ie=w(Y).dist,le=w(G).dist;if(ie+re<le||!a&&le+re<ie)if(x||(fr("Graph contains a negative weight cycle for Bellman-Ford"),x=!0),e.findNegativeWeightCycles!==!1){var ce=[];ie+re<le&&ce.push(Y),!a&&le+re<ie&&ce.push(G);for(var _e=ce.length,pe=0;pe<_e;pe++){var ae=ce[pe],oe=[ae];oe.push(w(ae).edge);for(var de=w(ae).pred;oe.indexOf(de)===-1;)oe.push(de),oe.push(w(de).edge),de=w(de).pred;oe=oe.slice(oe.indexOf(de));for(var ye=oe[0].id(),Ee=0,Re=2;Re<oe.length;Re+=2)oe[Re].id()<ye&&(ye=oe[Re].id(),Ee=Re);oe=oe.slice(Ee).concat(oe.slice(0,Ee)),oe.push(oe[0]);var Ne=oe.map(function(Be){return Be.id()}).join(",");$.indexOf(Ne)===-1&&(y.push(l.spawn(oe)),$.push(Ne))}}else break}return{distanceTo:A,pathTo:C,hasNegativeWeightCycle:x,negativeWeightCycles:y}}},$z=Math.sqrt(2),Kz=function(e,t,n){n.length===0&&jr("Karger-Stein must be run on a connected (sub)graph");for(var i=n[e],a=i[1],s=i[2],o=t[a],l=t[s],c=n,h=c.length-1;h>=0;h--){var d=c[h],v=d[1],g=d[2];(t[v]===o&&t[g]===l||t[v]===l&&t[g]===o)&&c.splice(h,1)}for(var m=0;m<c.length;m++){var x=c[m];x[1]===l?(c[m]=x.slice(),c[m][1]=o):x[2]===l&&(c[m]=x.slice(),c[m][2]=o)}for(var y=0;y<t.length;y++)t[y]===l&&(t[y]=o);return c},R1=function(e,t,n,i){for(;n>i;){var a=Math.floor(Math.random()*t.length);t=Kz(a,e,t),n--}return t},Zz={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,i=t.edges;i.unmergeBy(function(z){return z.isLoop()});var a=n.length,s=i.length,o=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),l=Math.floor(a/$z);if(a<2){jr("At least 2 nodes are required for Karger-Stein algorithm");return}for(var c=[],h=0;h<s;h++){var d=i[h];c.push([h,n.indexOf(d.source()),n.indexOf(d.target())])}for(var v=1/0,g=[],m=new Array(a),x=new Array(a),y=new Array(a),_=function($,B){for(var L=0;L<a;L++)B[L]=$[L]},w=0;w<=o;w++){for(var S=0;S<a;S++)x[S]=S;var A=R1(x,c.slice(),a,l),C=A.slice();_(x,y);var M=R1(x,A,l,2),E=R1(y,C,l,2);M.length<=E.length&&M.length<v?(v=M.length,g=M,_(x,m)):E.length<=M.length&&E.length<v&&(v=E.length,g=E,_(y,m))}for(var O=this.spawn(g.map(function(z){return i[z[0]]})),D=this.spawn(),I=this.spawn(),k=m[0],U=0;U<m.length;U++){var V=m[U],X=n[U];V===k?D.merge(X):I.merge(X)}var W=function($){var B=e.spawn();return $.forEach(function(L){B.merge(L),L.connectedEdges().forEach(function(Y){e.contains(Y)&&!O.contains(Y)&&B.merge(Y)})}),B},P=[W(D),W(I)],H={cut:O,components:P,partition1:D,partition2:I};return H}},O1,Qz=function(e){return{x:e.x,y:e.y}},sg=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},Z9=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},Tc=function(e){return{x:e[0],y:e[1]}},Jz=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=1/0,a=t;a<n;a++){var s=e[a];isFinite(s)&&(i=Math.min(s,i))}return i},eU=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=-1/0,a=t;a<n;a++){var s=e[a];isFinite(s)&&(i=Math.max(s,i))}return i},tU=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=0,a=0,s=t;s<n;s++){var o=e[s];isFinite(o)&&(i+=o,a++)}return i/a},rU=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;i?e=e.slice(t,n):(n<e.length&&e.splice(n,e.length-n),t>0&&e.splice(0,t));for(var o=0,l=e.length-1;l>=0;l--){var c=e[l];s?isFinite(c)||(e[l]=-1/0,o++):e.splice(l,1)}a&&e.sort(function(v,g){return v-g});var h=e.length,d=Math.floor(h/2);return h%2!==0?e[d+1+o]:(e[d-1+o]+e[d+o])/2},nU=function(e){return Math.PI*e/180},iv=function(e,t){return Math.atan2(t,e)-Math.PI/2},Z_=Math.log2||function(r){return Math.log(r)/Math.log(2)},Q_=function(e){return e>0?1:e<0?-1:0},hu=function(e,t){return Math.sqrt(Wl(e,t))},Wl=function(e,t){var n=t.x-e.x,i=t.y-e.y;return n*n+i*i},iU=function(e){for(var t=e.length,n=0,i=0;i<t;i++)n+=e[i];for(var a=0;a<t;a++)e[a]=e[a]/n;return e},kn=function(e,t,n,i){return(1-i)*(1-i)*e+2*(1-i)*i*t+i*i*n},Mc=function(e,t,n,i){return{x:kn(e.x,t.x,n.x,i),y:kn(e.y,t.y,n.y,i)}},aU=function(e,t,n,i){var a={x:t.x-e.x,y:t.y-e.y},s=hu(e,t),o={x:a.x/s,y:a.y/s};return n=n??0,i=i??n*s,{x:e.x+o.x*i,y:e.y+o.y*i}},Zf=function(e,t,n){return Math.max(e,Math.min(n,t))},di=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},sU=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},oU=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},lU=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},Q9=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},tp=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},rp=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,i,a,s;if(t.length===1)n=i=a=s=t[0];else if(t.length===2)n=a=t[0],s=i=t[1];else if(t.length===4){var o=_n(t,4);n=o[0],i=o[1],a=o[2],s=o[3]}return e.x1-=s,e.x2+=i,e.y1-=n,e.y2+=a,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},S6=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},J_=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2<t.x1||t.x2<e.x1||e.y2<t.y1||t.y2<e.y1||e.y1>t.y2||t.y1>e.y2)},Fo=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},E6=function(e,t){return Fo(e,t.x,t.y)},J9=function(e,t){return Fo(e,t.x1,t.y1)&&Fo(e,t.x2,t.y2)},uU=(O1=Math.hypot)!==null&&O1!==void 0?O1:function(r,e){return Math.sqrt(r*r+e*e)};function cU(r,e){if(r.length<3)throw new Error("Need at least 3 vertices");var t=function(O,D){return{x:O.x+D.x,y:O.y+D.y}},n=function(O,D){return{x:O.x-D.x,y:O.y-D.y}},i=function(O,D){return{x:O.x*D,y:O.y*D}},a=function(O,D){return O.x*D.y-O.y*D.x},s=function(O){var D=uU(O.x,O.y);return D===0?{x:0,y:0}:{x:O.x/D,y:O.y/D}},o=function(O){for(var D=0,I=0;I<O.length;I++){var k=O[I],U=O[(I+1)%O.length];D+=k.x*U.y-U.x*k.y}return D/2},l=function(O,D,I,k){var U=n(D,O),V=n(k,I),X=a(U,V);if(Math.abs(X)<1e-9)return t(O,i(U,.5));var W=a(n(I,O),V)/X;return t(O,i(U,W))},c=r.map(function(E){return{x:E.x,y:E.y}});o(c)<0&&c.reverse();for(var h=c.length,d=[],v=0;v<h;v++){var g=c[v],m=c[(v+1)%h],x=n(m,g),y=s({x:x.y,y:-x.x});d.push(y)}for(var _=d.map(function(E,O){var D=t(c[O],i(E,e)),I=t(c[(O+1)%h],i(E,e));return{p1:D,p2:I}}),w=[],S=0;S<h;S++){var A=_[(S-1+h)%h],C=_[S],M=l(A.p1,A.p2,C.p1,C.p2);w.push(M)}return w}function hU(r,e,t,n,i,a){var s=xU(r,e,t,n,i),o=cU(s,a),l=di();return o.forEach(function(c){return Q9(l,c.x,c.y)}),l}var eR=function(e,t,n,i,a,s,o){var l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",c=l==="auto"?Zo(a,s):l,h=a/2,d=s/2;c=Math.min(c,h,d);var v=c!==h,g=c!==d,m;if(v){var x=n-h+c-o,y=i-d-o,_=n+h-c+o,w=y;if(m=zo(e,t,n,i,x,y,_,w,!1),m.length>0)return m}if(g){var S=n+h+o,A=i-d+c-o,C=S,M=i+d-c+o;if(m=zo(e,t,n,i,S,A,C,M,!1),m.length>0)return m}if(v){var E=n-h+c-o,O=i+d+o,D=n+h-c+o,I=O;if(m=zo(e,t,n,i,E,O,D,I,!1),m.length>0)return m}if(g){var k=n-h-o,U=i-d+c-o,V=k,X=i+d-c+o;if(m=zo(e,t,n,i,k,U,V,X,!1),m.length>0)return m}var W;{var P=n-h+c,H=i-d+c;if(W=Af(e,t,n,i,P,H,c+o),W.length>0&&W[0]<=P&&W[1]<=H)return[W[0],W[1]]}{var z=n+h-c,$=i-d+c;if(W=Af(e,t,n,i,z,$,c+o),W.length>0&&W[0]>=z&&W[1]<=$)return[W[0],W[1]]}{var B=n+h-c,L=i+d-c;if(W=Af(e,t,n,i,B,L,c+o),W.length>0&&W[0]>=B&&W[1]>=L)return[W[0],W[1]]}{var Y=n-h+c,G=i+d-c;if(W=Af(e,t,n,i,Y,G,c+o),W.length>0&&W[0]<=Y&&W[1]>=G)return[W[0],W[1]]}return[]},fU=function(e,t,n,i,a,s,o){var l=o,c=Math.min(n,a),h=Math.max(n,a),d=Math.min(i,s),v=Math.max(i,s);return c-l<=e&&e<=h+l&&d-l<=t&&t<=v+l},dU=function(e,t,n,i,a,s,o,l,c){var h={x1:Math.min(n,o,a)-c,x2:Math.max(n,o,a)+c,y1:Math.min(i,l,s)-c,y2:Math.max(i,l,s)+c};return!(e<h.x1||e>h.x2||t<h.y1||t>h.y2)},vU=function(e,t,n,i){n-=i;var a=t*t-4*e*n;if(a<0)return[];var s=Math.sqrt(a),o=2*e,l=(-t+s)/o,c=(-t-s)/o;return[l,c]},pU=function(e,t,n,i,a){var s=1e-5;e===0&&(e=s),t/=e,n/=e,i/=e;var o,l,c,h,d,v,g,m;if(l=(3*n-t*t)/9,c=-(27*i)+t*(9*n-2*(t*t)),c/=54,o=l*l*l+c*c,a[1]=0,g=t/3,o>0){d=c+Math.sqrt(o),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),v=c-Math.sqrt(o),v=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),a[0]=-g+d+v,g+=(d+v)/2,a[4]=a[2]=-g,g=Math.sqrt(3)*(-v+d)/2,a[3]=g,a[5]=-g;return}if(a[5]=a[3]=0,o===0){m=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),a[0]=-g+2*m,a[4]=a[2]=-(m+g);return}l=-l,h=l*l*l,h=Math.acos(c/Math.sqrt(h)),m=2*Math.sqrt(l),a[0]=-g+m*Math.cos(h/3),a[2]=-g+m*Math.cos((h+2*Math.PI)/3),a[4]=-g+m*Math.cos((h+4*Math.PI)/3)},gU=function(e,t,n,i,a,s,o,l){var c=1*n*n-4*n*a+2*n*o+4*a*a-4*a*o+o*o+i*i-4*i*s+2*i*l+4*s*s-4*s*l+l*l,h=9*n*a-3*n*n-3*n*o-6*a*a+3*a*o+9*i*s-3*i*i-3*i*l-6*s*s+3*s*l,d=3*n*n-6*n*a+n*o-n*e+2*a*a+2*a*e-o*e+3*i*i-6*i*s+i*l-i*t+2*s*s+2*s*t-l*t,v=1*n*a-n*n+n*e-a*e+i*s-i*i+i*t-s*t,g=[];pU(c,h,d,v,g);for(var m=1e-7,x=[],y=0;y<6;y+=2)Math.abs(g[y+1])<m&&g[y]>=0&&g[y]<=1&&x.push(g[y]);x.push(1),x.push(0);for(var _=-1,w,S,A,C=0;C<x.length;C++)w=Math.pow(1-x[C],2)*n+2*(1-x[C])*x[C]*a+x[C]*x[C]*o,S=Math.pow(1-x[C],2)*i+2*(1-x[C])*x[C]*s+x[C]*x[C]*l,A=Math.pow(w-e,2)+Math.pow(S-t,2),_>=0?A<_&&(_=A):_=A;return _},mU=function(e,t,n,i,a,s){var o=[e-n,t-i],l=[a-n,s-i],c=l[0]*l[0]+l[1]*l[1],h=o[0]*o[0]+o[1]*o[1],d=o[0]*l[0]+o[1]*l[1],v=d*d/c;return d<0?h:v>c?(e-a)*(e-a)+(t-s)*(t-s):h-v},Mi=function(e,t,n){for(var i,a,s,o,l,c=0,h=0;h<n.length/2;h++)if(i=n[h*2],a=n[h*2+1],h+1<n.length/2?(s=n[(h+1)*2],o=n[(h+1)*2+1]):(s=n[(h+1-n.length/2)*2],o=n[(h+1-n.length/2)*2+1]),!(i==e&&s==e))if(i>=e&&e>=s||i<=e&&e<=s)l=(e-i)/(s-i)*(o-a)+a,l>t&&c++;else continue;return c%2!==0},Vs=function(e,t,n,i,a,s,o,l,c){var h=new Array(n.length),d;l[0]!=null?(d=Math.atan(l[1]/l[0]),l[0]<0?d=d+Math.PI/2:d=-d-Math.PI/2):d=l;for(var v=Math.cos(-d),g=Math.sin(-d),m=0;m<h.length/2;m++)h[m*2]=s/2*(n[m*2]*v-n[m*2+1]*g),h[m*2+1]=o/2*(n[m*2+1]*v+n[m*2]*g),h[m*2]+=i,h[m*2+1]+=a;var x;if(c>0){var y=Op(h,-c);x=Rp(y)}else x=h;return Mi(e,t,x)},yU=function(e,t,n,i,a,s,o,l){for(var c=new Array(n.length*2),h=0;h<l.length;h++){var d=l[h];c[h*4+0]=d.startX,c[h*4+1]=d.startY,c[h*4+2]=d.stopX,c[h*4+3]=d.stopY;var v=Math.pow(d.cx-e,2)+Math.pow(d.cy-t,2);if(v<=Math.pow(d.radius,2))return!0}return Mi(e,t,c)},Rp=function(e){for(var t=new Array(e.length/2),n,i,a,s,o,l,c,h,d=0;d<e.length/4;d++){n=e[d*4],i=e[d*4+1],a=e[d*4+2],s=e[d*4+3],d<e.length/4-1?(o=e[(d+1)*4],l=e[(d+1)*4+1],c=e[(d+1)*4+2],h=e[(d+1)*4+3]):(o=e[0],l=e[1],c=e[2],h=e[3]);var v=zo(n,i,a,s,o,l,c,h,!0);t[d*2]=v[0],t[d*2+1]=v[1]}return t},Op=function(e,t){for(var n=new Array(e.length*2),i,a,s,o,l=0;l<e.length/2;l++){i=e[l*2],a=e[l*2+1],l<e.length/2-1?(s=e[(l+1)*2],o=e[(l+1)*2+1]):(s=e[0],o=e[1]);var c=o-a,h=-(s-i),d=Math.sqrt(c*c+h*h),v=c/d,g=h/d;n[l*4]=i+v*t,n[l*4+1]=a+g*t,n[l*4+2]=s+v*t,n[l*4+3]=o+g*t}return n},bU=function(e,t,n,i,a,s){var o=n-e,l=i-t;o/=a,l/=s;var c=Math.sqrt(o*o+l*l),h=c-1;if(h<0)return[];var d=h/c;return[(n-e)*d+e,(i-t)*d+t]},su=function(e,t,n,i,a,s,o){return e-=a,t-=s,e/=n/2+o,t/=i/2+o,e*e+t*t<=1},Af=function(e,t,n,i,a,s,o){var l=[n-e,i-t],c=[e-a,t-s],h=l[0]*l[0]+l[1]*l[1],d=2*(c[0]*l[0]+c[1]*l[1]),v=c[0]*c[0]+c[1]*c[1]-o*o,g=d*d-4*h*v;if(g<0)return[];var m=(-d+Math.sqrt(g))/(2*h),x=(-d-Math.sqrt(g))/(2*h),y=Math.min(m,x),_=Math.max(m,x),w=[];if(y>=0&&y<=1&&w.push(y),_>=0&&_<=1&&w.push(_),w.length===0)return[];var S=w[0]*l[0]+e,A=w[0]*l[1]+t;if(w.length>1){if(w[0]==w[1])return[S,A];var C=w[1]*l[0]+e,M=w[1]*l[1]+t;return[S,A,C,M]}else return[S,A]},D1=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},zo=function(e,t,n,i,a,s,o,l,c){var h=e-a,d=n-e,v=o-a,g=t-s,m=i-t,x=l-s,y=v*g-x*h,_=d*g-m*h,w=x*d-v*m;if(w!==0){var S=y/w,A=_/w,C=.001,M=0-C,E=1+C;return M<=S&&S<=E&&M<=A&&A<=E?[e+S*d,t+S*m]:c?[e+S*d,t+S*m]:[]}else return y===0||_===0?D1(e,n,o)===o?[o,l]:D1(e,n,a)===a?[a,s]:D1(a,o,n)===n?[n,i]:[]:[]},xU=function(e,t,n,i,a){var s=[],o=i/2,l=a/2,c=t,h=n;s.push({x:c+o*e[0],y:h+l*e[1]});for(var d=1;d<e.length/2;d++)s.push({x:c+o*e[d*2],y:h+l*e[d*2+1]});return s},Qf=function(e,t,n,i,a,s,o,l){var c=[],h,d=new Array(n.length),v=!0;s==null&&(v=!1);var g;if(v){for(var m=0;m<d.length/2;m++)d[m*2]=n[m*2]*s+i,d[m*2+1]=n[m*2+1]*o+a;if(l>0){var x=Op(d,-l);g=Rp(x)}else g=d}else g=n;for(var y,_,w,S,A=0;A<g.length/2;A++)y=g[A*2],_=g[A*2+1],A<g.length/2-1?(w=g[(A+1)*2],S=g[(A+1)*2+1]):(w=g[0],S=g[1]),h=zo(e,t,i,a,y,_,w,S),h.length!==0&&c.push(h[0],h[1]);return c},_U=function(e,t,n,i,a,s,o,l,c){var h=[],d,v=new Array(n.length*2);c.forEach(function(w,S){S===0?(v[v.length-2]=w.startX,v[v.length-1]=w.startY):(v[S*4-2]=w.startX,v[S*4-1]=w.startY),v[S*4]=w.stopX,v[S*4+1]=w.stopY,d=Af(e,t,i,a,w.cx,w.cy,w.radius),d.length!==0&&h.push(d[0],d[1])});for(var g=0;g<v.length/4;g++)d=zo(e,t,i,a,v[g*4],v[g*4+1],v[g*4+2],v[g*4+3],!1),d.length!==0&&h.push(d[0],d[1]);if(h.length>2){for(var m=[h[0],h[1]],x=Math.pow(m[0]-e,2)+Math.pow(m[1]-t,2),y=1;y<h.length/2;y++){var _=Math.pow(h[y*2]-e,2)+Math.pow(h[y*2+1]-t,2);_<=x&&(m[0]=h[y*2],m[1]=h[y*2+1],x=_)}return m}return h},av=function(e,t,n){var i=[e[0]-t[0],e[1]-t[1]],a=Math.sqrt(i[0]*i[0]+i[1]*i[1]),s=(a-n)/a;return s<0&&(s=1e-5),[t[0]+s*i[0],t[1]+s*i[1]]},ui=function(e,t){var n=t4(e,t);return n=tR(n),n},tR=function(e){for(var t,n,i=e.length/2,a=1/0,s=1/0,o=-1/0,l=-1/0,c=0;c<i;c++)t=e[2*c],n=e[2*c+1],a=Math.min(a,t),o=Math.max(o,t),s=Math.min(s,n),l=Math.max(l,n);for(var h=2/(o-a),d=2/(l-s),v=0;v<i;v++)t=e[2*v]=e[2*v]*h,n=e[2*v+1]=e[2*v+1]*d,a=Math.min(a,t),o=Math.max(o,t),s=Math.min(s,n),l=Math.max(l,n);if(s<-1)for(var g=0;g<i;g++)n=e[2*g+1]=e[2*g+1]+(-1-s);return e},t4=function(e,t){var n=1/e*2*Math.PI,i=e%2===0?Math.PI/2+n/2:Math.PI/2;i+=t;for(var a=new Array(e*2),s,o=0;o<e;o++)s=o*n+i,a[2*o]=Math.cos(s),a[2*o+1]=Math.sin(-s);return a},Zo=function(e,t){return Math.min(e/4,t/4,8)},rR=function(e,t){return Math.min(e/10,t/10,8)},ew=function(){return 8},wU=function(e,t,n){return[e-2*t+n,2*(t-e),e]},r4=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function P1(r,e){function t(d){for(var v=[],g=0;g<d.length;g++){var m=d[g],x=d[(g+1)%d.length],y={x:x.x-m.x,y:x.y-m.y},_={x:-y.y,y:y.x},w=Math.sqrt(_.x*_.x+_.y*_.y);v.push({x:_.x/w,y:_.y/w})}return v}function n(d,v){var g=1/0,m=-1/0,x=Ri(d),y;try{for(x.s();!(y=x.n()).done;){var _=y.value,w=_.x*v.x+_.y*v.y;g=Math.min(g,w),m=Math.max(m,w)}}catch(S){x.e(S)}finally{x.f()}return{min:g,max:m}}function i(d,v){return!(d.max<v.min||v.max<d.min)}var a=[].concat(Tp(t(r)),Tp(t(e))),s=Ri(a),o;try{for(s.s();!(o=s.n()).done;){var l=o.value,c=n(r,l),h=n(e,l);if(!i(c,h))return!1}}catch(d){s.e(d)}finally{s.f()}return!0}var SU=$n({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),EU={pageRank:function(e){for(var t=SU(e),n=t.dampingFactor,i=t.precision,a=t.iterations,s=t.weight,o=this._private.cy,l=this.byGroup(),c=l.nodes,h=l.edges,d=c.length,v=d*d,g=h.length,m=new Array(v),x=new Array(d),y=(1-n)/d,_=0;_<d;_++){for(var w=0;w<d;w++){var S=_*d+w;m[S]=0}x[_]=0}for(var A=0;A<g;A++){var C=h[A],M=C.data("source"),E=C.data("target");if(M!==E){var O=c.indexOfId(M),D=c.indexOfId(E),I=s(C),k=D*d+O;m[k]+=I,x[O]+=I}}for(var U=1/d+y,V=0;V<d;V++)if(x[V]===0)for(var X=0;X<d;X++){var W=X*d+V;m[W]=U}else for(var P=0;P<d;P++){var H=P*d+V;m[H]=m[H]/x[V]+y}for(var z=new Array(d),$=new Array(d),B,L=0;L<d;L++)z[L]=1;for(var Y=0;Y<a;Y++){for(var G=0;G<d;G++)$[G]=0;for(var re=0;re<d;re++)for(var ie=0;ie<d;ie++){var le=re*d+ie;$[re]+=m[le]*z[ie]}iU($),B=z,z=$,$=B;for(var ce=0,_e=0;_e<d;_e++){var pe=B[_e]-z[_e];ce+=pe*pe}if(ce<i)break}var ae={rank:function(de){return de=o.collection(de)[0],z[c.indexOf(de)]}};return ae}},T6=$n({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Rc={degreeCentralityNormalized:function(e){e=T6(e);var t=this.cy(),n=this.nodes(),i=n.length;if(e.directed){for(var h={},d={},v=0,g=0,m=0;m<i;m++){var x=n[m],y=x.id();e.root=x;var _=this.degreeCentrality(e);v<_.indegree&&(v=_.indegree),g<_.outdegree&&(g=_.outdegree),h[y]=_.indegree,d[y]=_.outdegree}return{indegree:function(S){return v==0?0:(xt(S)&&(S=t.filter(S)),h[S.id()]/v)},outdegree:function(S){return g===0?0:(xt(S)&&(S=t.filter(S)),d[S.id()]/g)}}}else{for(var a={},s=0,o=0;o<i;o++){var l=n[o];e.root=l;var c=this.degreeCentrality(e);s<c.degree&&(s=c.degree),a[l.id()]=c.degree}return{degree:function(S){return s===0?0:(xt(S)&&(S=t.filter(S)),a[S.id()]/s)}}}},degreeCentrality:function(e){e=T6(e);var t=this.cy(),n=this,i=e,a=i.root,s=i.weight,o=i.directed,l=i.alpha;if(a=t.collection(a)[0],o){for(var g=a.connectedEdges(),m=g.filter(function(M){return M.target().same(a)&&n.has(M)}),x=g.filter(function(M){return M.source().same(a)&&n.has(M)}),y=m.length,_=x.length,w=0,S=0,A=0;A<m.length;A++)w+=s(m[A]);for(var C=0;C<x.length;C++)S+=s(x[C]);return{indegree:Math.pow(y,1-l)*Math.pow(w,l),outdegree:Math.pow(_,1-l)*Math.pow(S,l)}}else{for(var c=a.connectedEdges().intersection(n),h=c.length,d=0,v=0;v<c.length;v++)d+=s(c[v]);return{degree:Math.pow(h,1-l)*Math.pow(d,l)}}}};Rc.dc=Rc.degreeCentrality;Rc.dcn=Rc.degreeCentralityNormalised=Rc.degreeCentralityNormalized;var C6=$n({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Oc={closenessCentralityNormalized:function(e){for(var t=C6(e),n=t.harmonic,i=t.weight,a=t.directed,s=this.cy(),o={},l=0,c=this.nodes(),h=this.floydWarshall({weight:i,directed:a}),d=0;d<c.length;d++){for(var v=0,g=c[d],m=0;m<c.length;m++)if(d!==m){var x=h.distance(g,c[m]);n?v+=1/x:v+=x}n||(v=1/v),l<v&&(l=v),o[g.id()]=v}return{closeness:function(_){return l==0?0:(xt(_)?_=s.filter(_)[0].id():_=_.id(),o[_]/l)}}},closenessCentrality:function(e){var t=C6(e),n=t.root,i=t.weight,a=t.directed,s=t.harmonic;n=this.filter(n)[0];for(var o=this.dijkstra({root:n,weight:i,directed:a}),l=0,c=this.nodes(),h=0;h<c.length;h++){var d=c[h];if(!d.same(n)){var v=o.distanceTo(d);s?l+=1/v:l+=v}}return s?l:1/l}};Oc.cc=Oc.closenessCentrality;Oc.ccn=Oc.closenessCentralityNormalised=Oc.closenessCentralityNormalized;var TU=$n({weight:null,directed:!1}),n4={betweennessCentrality:function(e){for(var t=TU(e),n=t.directed,i=t.weight,a=i!=null,s=this.cy(),o=this.nodes(),l={},c={},h=0,d={set:function(S,A){c[S]=A,A>h&&(h=A)},get:function(S){return c[S]}},v=0;v<o.length;v++){var g=o[v],m=g.id();n?l[m]=g.outgoers().nodes():l[m]=g.openNeighborhood().nodes(),d.set(m,0)}for(var x=function(){for(var S=o[y].id(),A=[],C={},M={},E={},O=new Od(function(re,ie){return E[re]-E[ie]}),D=0;D<o.length;D++){var I=o[D].id();C[I]=[],M[I]=0,E[I]=1/0}for(M[S]=1,E[S]=0,O.push(S);!O.empty();){var k=O.pop();if(A.push(k),a)for(var U=0;U<l[k].length;U++){var V=l[k][U],X=s.getElementById(k),W=void 0;X.edgesTo(V).length>0?W=X.edgesTo(V)[0]:W=V.edgesTo(X)[0];var P=i(W);V=V.id(),E[V]>E[k]+P&&(E[V]=E[k]+P,O.nodes.indexOf(V)<0?O.push(V):O.updateItem(V),M[V]=0,C[V]=[]),E[V]==E[k]+P&&(M[V]=M[V]+M[k],C[V].push(k))}else for(var H=0;H<l[k].length;H++){var z=l[k][H].id();E[z]==1/0&&(O.push(z),E[z]=E[k]+1),E[z]==E[k]+1&&(M[z]=M[z]+M[k],C[z].push(k))}}for(var $={},B=0;B<o.length;B++)$[o[B].id()]=0;for(;A.length>0;){for(var L=A.pop(),Y=0;Y<C[L].length;Y++){var G=C[L][Y];$[G]=$[G]+M[G]/M[L]*(1+$[L])}L!=o[y].id()&&d.set(L,d.get(L)+$[L])}},y=0;y<o.length;y++)x();var _={betweenness:function(S){var A=s.collection(S).id();return d.get(A)},betweennessNormalized:function(S){if(h==0)return 0;var A=s.collection(S).id();return d.get(A)/h}};return _.betweennessNormalised=_.betweennessNormalized,_}};n4.bc=n4.betweennessCentrality;var CU=$n({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(r){return 1}]}),AU=function(e){return CU(e)},MU=function(e,t){for(var n=0,i=0;i<t.length;i++)n+=t[i](e);return n},RU=function(e,t,n){for(var i=0;i<t;i++)e[i*t+i]=n},nR=function(e,t){for(var n,i=0;i<t;i++){n=0;for(var a=0;a<t;a++)n+=e[a*t+i];for(var s=0;s<t;s++)e[s*t+i]=e[s*t+i]/n}},OU=function(e,t,n){for(var i=new Array(n*n),a=0;a<n;a++){for(var s=0;s<n;s++)i[a*n+s]=0;for(var o=0;o<n;o++)for(var l=0;l<n;l++)i[a*n+l]+=e[a*n+o]*t[o*n+l]}return i},DU=function(e,t,n){for(var i=e.slice(0),a=1;a<n;a++)e=OU(e,i,t);return e},PU=function(e,t,n){for(var i=new Array(t*t),a=0;a<t*t;a++)i[a]=Math.pow(e[a],n);return nR(i,t),i},IU=function(e,t,n,i){for(var a=0;a<n;a++){var s=Math.round(e[a]*Math.pow(10,i))/Math.pow(10,i),o=Math.round(t[a]*Math.pow(10,i))/Math.pow(10,i);if(s!==o)return!1}return!0},NU=function(e,t,n,i){for(var a=[],s=0;s<t;s++){for(var o=[],l=0;l<t;l++)Math.round(e[s*t+l]*1e3)/1e3>0&&o.push(n[l]);o.length!==0&&a.push(i.collection(o))}return a},LU=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},kU=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&LU(e[t],e[n])&&e.splice(n,1);return e},A6=function(e){for(var t=this.nodes(),n=this.edges(),i=this.cy(),a=AU(e),s={},o=0;o<t.length;o++)s[t[o].id()]=o;for(var l=t.length,c=l*l,h=new Array(c),d,v=0;v<c;v++)h[v]=0;for(var g=0;g<n.length;g++){var m=n[g],x=s[m.source().id()],y=s[m.target().id()],_=MU(m,a.attributes);h[x*l+y]+=_,h[y*l+x]+=_}RU(h,l,a.multFactor),nR(h,l);for(var w=!0,S=0;w&&S<a.maxIterations;)w=!1,d=DU(h,l,a.expandFactor),h=PU(d,l,a.inflateFactor),IU(h,d,c,4)||(w=!0),S++;var A=NU(h,l,t,i);return A=kU(A),A},BU={markovClustering:A6,mcl:A6},FU=function(e){return e},iR=function(e,t){return Math.abs(t-e)},M6=function(e,t,n){return e+iR(t,n)},R6=function(e,t,n){return e+Math.pow(n-t,2)},zU=function(e){return Math.sqrt(e)},UU=function(e,t,n){return Math.max(e,iR(t,n))},sf=function(e,t,n,i,a){for(var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:FU,o=i,l,c,h=0;h<e;h++)l=t(h),c=n(h),o=a(o,l,c);return s(o)},zc={euclidean:function(e,t,n){return e>=2?sf(e,t,n,0,R6,zU):sf(e,t,n,0,M6)},squaredEuclidean:function(e,t,n){return sf(e,t,n,0,R6)},manhattan:function(e,t,n){return sf(e,t,n,0,M6)},max:function(e,t,n){return sf(e,t,n,-1/0,UU)}};zc["squared-euclidean"]=zc.squaredEuclidean;zc.squaredeuclidean=zc.squaredEuclidean;function og(r,e,t,n,i,a){var s;return en(r)?s=r:s=zc[r]||zc.euclidean,e===0&&en(r)?s(i,a):s(e,t,n,i,a)}var GU=$n({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),tw=function(e){return GU(e)},Dp=function(e,t,n,i,a){var s=a!=="kMedoids",o=s?function(d){return n[d]}:function(d){return i[d](n)},l=function(v){return i[v](t)},c=n,h=t;return og(e,i.length,o,l,c,h)},I1=function(e,t,n){for(var i=n.length,a=new Array(i),s=new Array(i),o=new Array(t),l=null,c=0;c<i;c++)a[c]=e.min(n[c]).value,s[c]=e.max(n[c]).value;for(var h=0;h<t;h++){l=[];for(var d=0;d<i;d++)l[d]=Math.random()*(s[d]-a[d])+a[d];o[h]=l}return o},aR=function(e,t,n,i,a){for(var s=1/0,o=0,l=0;l<t.length;l++){var c=Dp(n,e,t[l],i,a);c<s&&(s=c,o=l)}return o},sR=function(e,t,n){for(var i=[],a=null,s=0;s<t.length;s++)a=t[s],n[a.id()]===e&&i.push(a);return i},HU=function(e,t,n){return Math.abs(t-e)<=n},jU=function(e,t,n){for(var i=0;i<e.length;i++)for(var a=0;a<e[i].length;a++){var s=Math.abs(e[i][a]-t[i][a]);if(s>n)return!1}return!0},VU=function(e,t,n){for(var i=0;i<n;i++)if(e===t[i])return!0;return!1},O6=function(e,t){var n=new Array(t);if(e.length<50)for(var i=0;i<t;i++){for(var a=e[Math.floor(Math.random()*e.length)];VU(a,n,i);)a=e[Math.floor(Math.random()*e.length)];n[i]=a}else for(var s=0;s<t;s++)n[s]=e[Math.floor(Math.random()*e.length)];return n},D6=function(e,t,n){for(var i=0,a=0;a<t.length;a++)i+=Dp("manhattan",t[a],e,n,"kMedoids");return i},qU=function(e){var t=this.cy(),n=this.nodes(),i=null,a=tw(e),s=new Array(a.k),o={},l;a.testMode?typeof a.testCentroids=="number"?(a.testCentroids,l=I1(n,a.k,a.attributes)):On(a.testCentroids)==="object"?l=a.testCentroids:l=I1(n,a.k,a.attributes):l=I1(n,a.k,a.attributes);for(var c=!0,h=0;c&&h<a.maxIterations;){for(var d=0;d<n.length;d++)i=n[d],o[i.id()]=aR(i,l,a.distance,a.attributes,"kMeans");c=!1;for(var v=0;v<a.k;v++){var g=sR(v,n,o);if(g.length!==0){for(var m=a.attributes.length,x=l[v],y=new Array(m),_=new Array(m),w=0;w<m;w++){_[w]=0;for(var S=0;S<g.length;S++)i=g[S],_[w]+=a.attributes[w](i);y[w]=_[w]/g.length,HU(y[w],x[w],a.sensitivityThreshold)||(c=!0)}l[v]=y,s[v]=t.collection(g)}}h++}return s},XU=function(e){var t=this.cy(),n=this.nodes(),i=null,a=tw(e),s=new Array(a.k),o,l={},c,h=new Array(a.k);a.testMode?typeof a.testCentroids=="number"||(On(a.testCentroids)==="object"?o=a.testCentroids:o=O6(n,a.k)):o=O6(n,a.k);for(var d=!0,v=0;d&&v<a.maxIterations;){for(var g=0;g<n.length;g++)i=n[g],l[i.id()]=aR(i,o,a.distance,a.attributes,"kMedoids");d=!1;for(var m=0;m<o.length;m++){var x=sR(m,n,l);if(x.length!==0){h[m]=D6(o[m],x,a.attributes);for(var y=0;y<x.length;y++)c=D6(x[y],x,a.attributes),c<h[m]&&(h[m]=c,o[m]=x[y],d=!0);s[m]=t.collection(x)}}v++}return s},YU=function(e,t,n,i,a){for(var s,o,l=0;l<t.length;l++)for(var c=0;c<e.length;c++)i[l][c]=Math.pow(n[l][c],a.m);for(var h=0;h<e.length;h++)for(var d=0;d<a.attributes.length;d++){s=0,o=0;for(var v=0;v<t.length;v++)s+=i[v][h]*a.attributes[d](t[v]),o+=i[v][h];e[h][d]=s/o}},WU=function(e,t,n,i,a){for(var s=0;s<e.length;s++)t[s]=e[s].slice();for(var o,l,c,h=2/(a.m-1),d=0;d<n.length;d++)for(var v=0;v<i.length;v++){o=0;for(var g=0;g<n.length;g++)l=Dp(a.distance,i[v],n[d],a.attributes,"cmeans"),c=Dp(a.distance,i[v],n[g],a.attributes,"cmeans"),o+=Math.pow(l/c,h);e[v][d]=1/o}},$U=function(e,t,n,i){for(var a=new Array(n.k),s=0;s<a.length;s++)a[s]=[];for(var o,l,c=0;c<t.length;c++){o=-1/0,l=-1;for(var h=0;h<t[0].length;h++)t[c][h]>o&&(o=t[c][h],l=h);a[l].push(e[c])}for(var d=0;d<a.length;d++)a[d]=i.collection(a[d]);return a},P6=function(e){var t=this.cy(),n=this.nodes(),i=tw(e),a,s,o,l,c;l=new Array(n.length);for(var h=0;h<n.length;h++)l[h]=new Array(i.k);o=new Array(n.length);for(var d=0;d<n.length;d++)o[d]=new Array(i.k);for(var v=0;v<n.length;v++){for(var g=0,m=0;m<i.k;m++)o[v][m]=Math.random(),g+=o[v][m];for(var x=0;x<i.k;x++)o[v][x]=o[v][x]/g}s=new Array(i.k);for(var y=0;y<i.k;y++)s[y]=new Array(i.attributes.length);c=new Array(n.length);for(var _=0;_<n.length;_++)c[_]=new Array(i.k);for(var w=!0,S=0;w&&S<i.maxIterations;)w=!1,YU(s,n,o,c,i),WU(o,l,s,n,i),jU(o,l,i.sensitivityThreshold)||(w=!0),S++;return a=$U(n,o,i,t),{clusters:a,degreeOfMembership:o}},KU={kMeans:qU,kMedoids:XU,fuzzyCMeans:P6,fcm:P6},ZU=$n({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),QU={single:"min",complete:"max"},JU=function(e){var t=ZU(e),n=QU[t.linkage];return n!=null&&(t.linkage=n),t},I6=function(e,t,n,i,a){for(var s=0,o=1/0,l,c=a.attributes,h=function(D,I){return og(a.distance,c.length,function(k){return c[k](D)},function(k){return c[k](I)},D,I)},d=0;d<e.length;d++){var v=e[d].key,g=n[v][i[v]];g<o&&(s=v,o=g)}if(a.mode==="threshold"&&o>=a.threshold||a.mode==="dendrogram"&&e.length===1)return!1;var m=t[s],x=t[i[s]],y;a.mode==="dendrogram"?y={left:m,right:x,key:m.key}:y={value:m.value.concat(x.value),key:m.key},e[m.index]=y,e.splice(x.index,1),t[m.key]=y;for(var _=0;_<e.length;_++){var w=e[_];m.key===w.key?l=1/0:a.linkage==="min"?(l=n[m.key][w.key],n[m.key][w.key]>n[x.key][w.key]&&(l=n[x.key][w.key])):a.linkage==="max"?(l=n[m.key][w.key],n[m.key][w.key]<n[x.key][w.key]&&(l=n[x.key][w.key])):a.linkage==="mean"?l=(n[m.key][w.key]*m.size+n[x.key][w.key]*x.size)/(m.size+x.size):a.mode==="dendrogram"?l=h(w.value,m.value):l=h(w.value[0],m.value[0]),n[m.key][w.key]=n[w.key][m.key]=l}for(var S=0;S<e.length;S++){var A=e[S].key;if(i[A]===m.key||i[A]===x.key){for(var C=A,M=0;M<e.length;M++){var E=e[M].key;n[A][E]<n[A][C]&&(C=E)}i[A]=C}e[S].index=S}return m.key=x.key=m.index=x.index=null,!0},Cc=function(e,t,n){e&&(e.value?t.push(e.value):(e.left&&Cc(e.left,t),e.right&&Cc(e.right,t)))},i4=function(e,t){if(!e)return"";if(e.left&&e.right){var n=i4(e.left,t),i=i4(e.right,t),a=t.add({group:"nodes",data:{id:n+","+i}});return t.add({group:"edges",data:{source:n,target:a.id()}}),t.add({group:"edges",data:{source:i,target:a.id()}}),a.id()}else if(e.value)return e.value.id()},a4=function(e,t,n){if(!e)return[];var i=[],a=[],s=[];return t===0?(e.left&&Cc(e.left,i),e.right&&Cc(e.right,a),s=i.concat(a),[n.collection(s)]):t===1?e.value?[n.collection(e.value)]:(e.left&&Cc(e.left,i),e.right&&Cc(e.right,a),[n.collection(i),n.collection(a)]):e.value?[n.collection(e.value)]:(e.left&&(i=a4(e.left,t-1,n)),e.right&&(a=a4(e.right,t-1,n)),i.concat(a))},N6=function(e){for(var t=this.cy(),n=this.nodes(),i=JU(e),a=i.attributes,s=function(S,A){return og(i.distance,a.length,function(C){return a[C](S)},function(C){return a[C](A)},S,A)},o=[],l=[],c=[],h=[],d=0;d<n.length;d++){var v={value:i.mode==="dendrogram"?n[d]:[n[d]],key:d,index:d};o[d]=v,h[d]=v,l[d]=[],c[d]=0}for(var g=0;g<o.length;g++)for(var m=0;m<=g;m++){var x=void 0;i.mode==="dendrogram"?x=g===m?1/0:s(o[g].value,o[m].value):x=g===m?1/0:s(o[g].value[0],o[m].value[0]),l[g][m]=x,l[m][g]=x,x<l[g][c[g]]&&(c[g]=m)}for(var y=I6(o,h,l,c,i);y;)y=I6(o,h,l,c,i);var _;return i.mode==="dendrogram"?(_=a4(o[0],i.dendrogramDepth,t),i.addDendrogram&&i4(o[0],t)):(_=new Array(o.length),o.forEach(function(w,S){w.key=w.index=null,_[S]=t.collection(w.value)})),_},eG={hierarchicalClustering:N6,hca:N6},tG=$n({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),rG=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||jr("Damping must range on [0.5, 1). Got: ".concat(t));var i=["median","mean","min","max"];return i.some(function(a){return a===n})||ut(n)||jr("Preference must be one of [".concat(i.map(function(a){return"'".concat(a,"'")}).join(", "),"] or a number. Got: ").concat(n)),tG(e)},nG=function(e,t,n,i){var a=function(o,l){return i[l](o)};return-og(e,i.length,function(s){return a(t,s)},function(s){return a(n,s)},t,n)},iG=function(e,t){var n=null;return t==="median"?n=rU(e):t==="mean"?n=tU(e):t==="min"?n=Jz(e):t==="max"?n=eU(e):n=t,n},aG=function(e,t,n){for(var i=[],a=0;a<e;a++)t[a*e+a]+n[a*e+a]>0&&i.push(a);return i},L6=function(e,t,n){for(var i=[],a=0;a<e;a++){for(var s=-1,o=-1/0,l=0;l<n.length;l++){var c=n[l];t[a*e+c]>o&&(s=c,o=t[a*e+c])}s>0&&i.push(s)}for(var h=0;h<n.length;h++)i[n[h]]=n[h];return i},sG=function(e,t,n){for(var i=L6(e,t,n),a=0;a<n.length;a++){for(var s=[],o=0;o<i.length;o++)i[o]===n[a]&&s.push(o);for(var l=-1,c=-1/0,h=0;h<s.length;h++){for(var d=0,v=0;v<s.length;v++)d+=t[s[v]*e+s[h]];d>c&&(l=h,c=d)}n[a]=s[l]}return i=L6(e,t,n),i},k6=function(e){for(var t=this.cy(),n=this.nodes(),i=rG(e),a={},s=0;s<n.length;s++)a[n[s].id()]=s;var o,l,c,h,d,v;o=n.length,l=o*o,c=new Array(l);for(var g=0;g<l;g++)c[g]=-1/0;for(var m=0;m<o;m++)for(var x=0;x<o;x++)m!==x&&(c[m*o+x]=nG(i.distance,n[m],n[x],i.attributes));h=iG(c,i.preference);for(var y=0;y<o;y++)c[y*o+y]=h;d=new Array(l);for(var _=0;_<l;_++)d[_]=0;v=new Array(l);for(var w=0;w<l;w++)v[w]=0;for(var S=new Array(o),A=new Array(o),C=new Array(o),M=0;M<o;M++)S[M]=0,A[M]=0,C[M]=0;for(var E=new Array(o*i.minIterations),O=0;O<E.length;O++)E[O]=0;var D;for(D=0;D<i.maxIterations;D++){for(var I=0;I<o;I++){for(var k=-1/0,U=-1/0,V=-1,X=0,W=0;W<o;W++)S[W]=d[I*o+W],X=v[I*o+W]+c[I*o+W],X>=k?(U=k,k=X,V=W):X>U&&(U=X);for(var P=0;P<o;P++)d[I*o+P]=(1-i.damping)*(c[I*o+P]-k)+i.damping*S[P];d[I*o+V]=(1-i.damping)*(c[I*o+V]-U)+i.damping*S[V]}for(var H=0;H<o;H++){for(var z=0,$=0;$<o;$++)S[$]=v[$*o+H],A[$]=Math.max(0,d[$*o+H]),z+=A[$];z-=A[H],A[H]=d[H*o+H],z+=A[H];for(var B=0;B<o;B++)v[B*o+H]=(1-i.damping)*Math.min(0,z-A[B])+i.damping*S[B];v[H*o+H]=(1-i.damping)*(z-A[H])+i.damping*S[H]}for(var L=0,Y=0;Y<o;Y++){var G=v[Y*o+Y]+d[Y*o+Y]>0?1:0;E[D%i.minIterations*o+Y]=G,L+=G}if(L>0&&(D>=i.minIterations-1||D==i.maxIterations-1)){for(var re=0,ie=0;ie<o;ie++){C[ie]=0;for(var le=0;le<i.minIterations;le++)C[ie]+=E[le*o+ie];(C[ie]===0||C[ie]===i.minIterations)&&re++}if(re===o)break}}for(var ce=aG(o,d,v),_e=sG(o,c,ce),pe={},ae=0;ae<ce.length;ae++)pe[ce[ae]]=[];for(var oe=0;oe<n.length;oe++){var de=a[n[oe].id()],ye=_e[de];ye!=null&&pe[ye].push(n[oe])}for(var Ee=new Array(ce.length),Re=0;Re<ce.length;Re++)Ee[Re]=t.collection(pe[ce[Re]]);return Ee},oG={affinityPropagation:k6,ap:k6},lG=$n({root:void 0,directed:!1}),uG={hierholzer:function(e){if(!Zt(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n=lG(e),i=n.root,a=n.directed,s=this,o=!1,l,c,h;i&&(h=xt(i)?this.filter(i)[0].id():i[0].id());var d={},v={};a?s.forEach(function(w){var S=w.id();if(w.isNode()){var A=w.indegree(!0),C=w.outdegree(!0),M=A-C,E=C-A;M==1?l?o=!0:l=S:E==1?c?o=!0:c=S:(E>1||M>1)&&(o=!0),d[S]=[],w.outgoers().forEach(function(O){O.isEdge()&&d[S].push(O.id())})}else v[S]=[void 0,w.target().id()]}):s.forEach(function(w){var S=w.id();if(w.isNode()){var A=w.degree(!0);A%2&&(l?c?o=!0:c=S:l=S),d[S]=[],w.connectedEdges().forEach(function(C){return d[S].push(C.id())})}else v[S]=[w.source().id(),w.target().id()]});var g={found:!1,trail:void 0};if(o)return g;if(c&&l)if(a){if(h&&c!=h)return g;h=c}else{if(h&&c!=h&&l!=h)return g;h||(h=c)}else h||(h=s[0].id());var m=function(S){for(var A=S,C=[S],M,E,O;d[A].length;)M=d[A].shift(),E=v[M][0],O=v[M][1],A!=O?(d[O]=d[O].filter(function(D){return D!=M}),A=O):!a&&A!=E&&(d[E]=d[E].filter(function(D){return D!=M}),A=E),C.unshift(M),C.unshift(A);return C},x=[],y=[];for(y=m(h);y.length!=1;)d[y[0]].length==0?(x.unshift(s.getElementById(y.shift())),x.unshift(s.getElementById(y.shift()))):y=m(y.shift()).concat(y);x.unshift(s.getElementById(y.shift()));for(var _ in d)if(d[_].length)return g;return g.found=!0,g.trail=this.spawn(x,!0),g}},sv=function(){var e=this,t={},n=0,i=0,a=[],s=[],o={},l=function(v,g){for(var m=s.length-1,x=[],y=e.spawn();s[m].x!=v||s[m].y!=g;)x.push(s.pop().edge),m--;x.push(s.pop().edge),x.forEach(function(_){var w=_.connectedNodes().intersection(e);y.merge(_),w.forEach(function(S){var A=S.id(),C=S.connectedEdges().intersection(e);y.merge(S),t[A].cutVertex?y.merge(C.filter(function(M){return M.isLoop()})):y.merge(C)})}),a.push(y)},c=function(v,g,m){v===m&&(i+=1),t[g]={id:n,low:n++,cutVertex:!1};var x=e.getElementById(g).connectedEdges().intersection(e);if(x.size()===0)a.push(e.spawn(e.getElementById(g)));else{var y,_,w,S;x.forEach(function(A){y=A.source().id(),_=A.target().id(),w=y===g?_:y,w!==m&&(S=A.id(),o[S]||(o[S]=!0,s.push({x:g,y:w,edge:A})),w in t?t[g].low=Math.min(t[g].low,t[w].id):(c(v,w,g),t[g].low=Math.min(t[g].low,t[w].low),t[g].id<=t[w].low&&(t[g].cutVertex=!0,l(g,w))))})}};e.forEach(function(d){if(d.isNode()){var v=d.id();v in t||(i=0,c(v,v),t[v].cutVertex=i>1)}});var h=Object.keys(t).filter(function(d){return t[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(h),components:a}},cG={hopcroftTarjanBiconnected:sv,htbc:sv,htb:sv,hopcroftTarjanBiconnectedComponents:sv},ov=function(){var e=this,t={},n=0,i=[],a=[],s=e.spawn(e),o=function(c){a.push(c),t[c]={index:n,low:n++,explored:!1};var h=e.getElementById(c).connectedEdges().intersection(e);if(h.forEach(function(x){var y=x.target().id();y!==c&&(y in t||o(y),t[y].explored||(t[c].low=Math.min(t[c].low,t[y].low)))}),t[c].index===t[c].low){for(var d=e.spawn();;){var v=a.pop();if(d.merge(e.getElementById(v)),t[v].low=t[c].index,t[v].explored=!0,v===c)break}var g=d.edgesWith(d),m=d.merge(g);i.push(m),s=s.difference(m)}};return e.forEach(function(l){if(l.isNode()){var c=l.id();c in t||o(c)}}),{cut:s,components:i}},hG={tarjanStronglyConnected:ov,tsc:ov,tscc:ov,tarjanStronglyConnectedComponents:ov},oR={};[Kf,Gz,Hz,Vz,Xz,Wz,Zz,EU,Rc,Oc,n4,BU,KU,eG,oG,uG,cG,hG].forEach(function(r){Ct(oR,r)});/*!
  80. Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
  81. Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
  82. Licensed under The MIT License (http://opensource.org/licenses/MIT)
  83. */var lR=0,uR=1,cR=2,La=function(e){if(!(this instanceof La))return new La(e);this.id="Thenable/1.0.7",this.state=lR,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};La.prototype={fulfill:function(e){return B6(this,uR,"fulfillValue",e)},reject:function(e){return B6(this,cR,"rejectReason",e)},then:function(e,t){var n=this,i=new La;return n.onFulfilled.push(z6(e,i,"fulfill")),n.onRejected.push(z6(t,i,"reject")),hR(n),i.proxy}};var B6=function(e,t,n,i){return e.state===lR&&(e.state=t,e[n]=i,hR(e)),e},hR=function(e){e.state===uR?F6(e,"onFulfilled",e.fulfillValue):e.state===cR&&F6(e,"onRejected",e.rejectReason)},F6=function(e,t,n){if(e[t].length!==0){var i=e[t];e[t]=[];var a=function(){for(var o=0;o<i.length;o++)i[o](n)};typeof setImmediate=="function"?setImmediate(a):setTimeout(a,0)}},z6=function(e,t,n){return function(i){if(typeof e!="function")t[n].call(t,i);else{var a;try{a=e(i)}catch(s){t.reject(s);return}fR(t,a)}}},fR=function(e,t){if(e===t||e.proxy===t){e.reject(new TypeError("cannot resolve promise with itself"));return}var n;if(On(t)==="object"&&t!==null||typeof t=="function")try{n=t.then}catch(a){e.reject(a);return}if(typeof n=="function"){var i=!1;try{n.call(t,function(a){i||(i=!0,a===t?e.reject(new TypeError("circular thenable chain")):fR(e,a))},function(a){i||(i=!0,e.reject(a))})}catch(a){i||e.reject(a)}return}e.fulfill(t)};La.all=function(r){return new La(function(e,t){for(var n=new Array(r.length),i=0,a=function(l,c){n[l]=c,i++,i===r.length&&e(n)},s=0;s<r.length;s++)(function(o){var l=r[o],c=l!=null&&l.then!=null;if(c)l.then(function(d){a(o,d)},function(d){t(d)});else{var h=l;a(o,h)}})(s)})};La.resolve=function(r){return new La(function(e,t){e(r)})};La.reject=function(r){return new La(function(e,t){t(r)})};var Jc=typeof Promise<"u"?Promise:La,s4=function(e,t,n){var i=q_(e),a=!i,s=this._private=Ct({duration:1e3},t,n);if(s.target=e,s.style=s.style||s.css,s.started=!1,s.playing=!1,s.hooked=!1,s.applying=!1,s.progress=0,s.completes=[],s.frames=[],s.complete&&en(s.complete)&&s.completes.push(s.complete),a){var o=e.position();s.startPosition=s.startPosition||{x:o.x,y:o.y},s.startStyle=s.startStyle||e.cy().style().getAnimationStartStyle(e,s.style)}if(i){var l=e.pan();s.startPan={x:l.x,y:l.y},s.startZoom=e.zoom()}this.length=1,this[0]=this},fu=s4.prototype;Ct(fu,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var t,n=e.target._private.animation;e.queue?t=n.queue:t=n.current,t.push(this),qi(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var t=this._private;return e===void 0?t.progress*t.duration:this.progress(e/t.duration)},progress:function(e){var t=this._private,n=t.playing;return e===void 0?t.progress:(n&&this.pause(),t.progress=e,t.started=!1,n&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,t=e.playing;t&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(c,h){var d=e[c];d!=null&&(e[c]=e[h],e[h]=d)};if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),e.style)for(var i=0;i<e.style.length;i++){var a=e.style[i],s=a.name,o=e.startStyle[s];e.startStyle[s]=a,e.style[i]=o}return t&&this.play(),this},promise:function(e){var t=this._private,n;switch(e){case"frame":n=t.frames;break;default:case"complete":case"completed":n=t.completes}return new Jc(function(i,a){n.push(function(){i()})})}});fu.complete=fu.completed;fu.run=fu.play;fu.running=fu.playing;var fG={animated:function(){return function(){var t=this,n=t.length!==void 0,i=n?t:[t],a=this._private.cy||this;if(!a.styleEnabled())return!1;var s=i[0];if(s)return s._private.animation.current.length>0}},clearQueue:function(){return function(){var t=this,n=t.length!==void 0,i=n?t:[t],a=this._private.cy||this;if(!a.styleEnabled())return this;for(var s=0;s<i.length;s++){var o=i[s];o._private.animation.queue=[]}return this}},delay:function(){return function(t,n){var i=this._private.cy||this;return i.styleEnabled()?this.animate({delay:t,duration:t,complete:n}):this}},delayAnimation:function(){return function(t,n){var i=this._private.cy||this;return i.styleEnabled()?this.animation({delay:t,duration:t,complete:n}):this}},animation:function(){return function(t,n){var i=this,a=i.length!==void 0,s=a?i:[i],o=this._private.cy||this,l=!a,c=!l;if(!o.styleEnabled())return this;var h=o.style();t=Ct({},t,n);var d=Object.keys(t).length===0;if(d)return new s4(s[0],t);switch(t.duration===void 0&&(t.duration=400),t.duration){case"slow":t.duration=600;break;case"fast":t.duration=200;break}if(c&&(t.style=h.getPropsList(t.style||t.css),t.css=void 0),c&&t.renderedPosition!=null){var v=t.renderedPosition,g=o.pan(),m=o.zoom();t.position=Z9(v,m,g)}if(l&&t.panBy!=null){var x=t.panBy,y=o.pan();t.pan={x:y.x+x.x,y:y.y+x.y}}var _=t.center||t.centre;if(l&&_!=null){var w=o.getCenterPan(_.eles,t.zoom);w!=null&&(t.pan=w)}if(l&&t.fit!=null){var S=t.fit,A=o.getFitViewport(S.eles||S.boundingBox,S.padding);A!=null&&(t.pan=A.pan,t.zoom=A.zoom)}if(l&&Zt(t.zoom)){var C=o.getZoomedViewport(t.zoom);C!=null?(C.zoomed&&(t.zoom=C.zoom),C.panned&&(t.pan=C.pan)):t.zoom=null}return new s4(s[0],t)}},animate:function(){return function(t,n){var i=this,a=i.length!==void 0,s=a?i:[i],o=this._private.cy||this;if(!o.styleEnabled())return this;n&&(t=Ct({},t,n));for(var l=0;l<s.length;l++){var c=s[l],h=c.animated()&&(t.queue===void 0||t.queue),d=c.animation(t,h?{queue:!0}:void 0);d.play()}return this}},stop:function(){return function(t,n){var i=this,a=i.length!==void 0,s=a?i:[i],o=this._private.cy||this;if(!o.styleEnabled())return this;for(var l=0;l<s.length;l++){for(var c=s[l],h=c._private,d=h.animation.current,v=0;v<d.length;v++){var g=d[v],m=g._private;n&&(m.duration=0)}t&&(h.animation.queue=[]),n||(h.animation.current=[])}return o.notify("draw"),this}}},N1,U6;function lg(){if(U6)return N1;U6=1;var r=Array.isArray;return N1=r,N1}var L1,G6;function dG(){if(G6)return L1;G6=1;var r=lg(),e=Md(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,s){if(r(a))return!1;var o=typeof a;return o=="number"||o=="symbol"||o=="boolean"||a==null||e(a)?!0:n.test(a)||!t.test(a)||s!=null&&a in Object(s)}return L1=i,L1}var k1,H6;function vG(){if(H6)return k1;H6=1;var r=H9(),e=Ad(),t="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function s(o){if(!e(o))return!1;var l=r(o);return l==n||l==i||l==t||l==a}return k1=s,k1}var B1,j6;function pG(){if(j6)return B1;j6=1;var r=ig(),e=r["__core-js_shared__"];return B1=e,B1}var F1,V6;function gG(){if(V6)return F1;V6=1;var r=pG(),e=(function(){var n=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function t(n){return!!e&&e in n}return F1=t,F1}var z1,q6;function mG(){if(q6)return z1;q6=1;var r=Function.prototype,e=r.toString;function t(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return z1=t,z1}var U1,X6;function yG(){if(X6)return U1;X6=1;var r=vG(),e=gG(),t=Ad(),n=mG(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,s=Function.prototype,o=Object.prototype,l=s.toString,c=o.hasOwnProperty,h=RegExp("^"+l.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(v){if(!t(v)||e(v))return!1;var g=r(v)?h:a;return g.test(n(v))}return U1=d,U1}var G1,Y6;function bG(){if(Y6)return G1;Y6=1;function r(e,t){return e==null?void 0:e[t]}return G1=r,G1}var H1,W6;function rw(){if(W6)return H1;W6=1;var r=yG(),e=bG();function t(n,i){var a=e(n,i);return r(a)?a:void 0}return H1=t,H1}var j1,$6;function ug(){if($6)return j1;$6=1;var r=rw(),e=r(Object,"create");return j1=e,j1}var V1,K6;function xG(){if(K6)return V1;K6=1;var r=ug();function e(){this.__data__=r?r(null):{},this.size=0}return V1=e,V1}var q1,Z6;function _G(){if(Z6)return q1;Z6=1;function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return q1=r,q1}var X1,Q6;function wG(){if(Q6)return X1;Q6=1;var r=ug(),e="__lodash_hash_undefined__",t=Object.prototype,n=t.hasOwnProperty;function i(a){var s=this.__data__;if(r){var o=s[a];return o===e?void 0:o}return n.call(s,a)?s[a]:void 0}return X1=i,X1}var Y1,J6;function SG(){if(J6)return Y1;J6=1;var r=ug(),e=Object.prototype,t=e.hasOwnProperty;function n(i){var a=this.__data__;return r?a[i]!==void 0:t.call(a,i)}return Y1=n,Y1}var W1,e8;function EG(){if(e8)return W1;e8=1;var r=ug(),e="__lodash_hash_undefined__";function t(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=r&&i===void 0?e:i,this}return W1=t,W1}var $1,t8;function TG(){if(t8)return $1;t8=1;var r=xG(),e=_G(),t=wG(),n=SG(),i=EG();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var c=s[o];this.set(c[0],c[1])}}return a.prototype.clear=r,a.prototype.delete=e,a.prototype.get=t,a.prototype.has=n,a.prototype.set=i,$1=a,$1}var K1,r8;function CG(){if(r8)return K1;r8=1;function r(){this.__data__=[],this.size=0}return K1=r,K1}var Z1,n8;function dR(){if(n8)return Z1;n8=1;function r(e,t){return e===t||e!==e&&t!==t}return Z1=r,Z1}var Q1,i8;function cg(){if(i8)return Q1;i8=1;var r=dR();function e(t,n){for(var i=t.length;i--;)if(r(t[i][0],n))return i;return-1}return Q1=e,Q1}var J1,a8;function AG(){if(a8)return J1;a8=1;var r=cg(),e=Array.prototype,t=e.splice;function n(i){var a=this.__data__,s=r(a,i);if(s<0)return!1;var o=a.length-1;return s==o?a.pop():t.call(a,s,1),--this.size,!0}return J1=n,J1}var e2,s8;function MG(){if(s8)return e2;s8=1;var r=cg();function e(t){var n=this.__data__,i=r(n,t);return i<0?void 0:n[i][1]}return e2=e,e2}var t2,o8;function RG(){if(o8)return t2;o8=1;var r=cg();function e(t){return r(this.__data__,t)>-1}return t2=e,t2}var r2,l8;function OG(){if(l8)return r2;l8=1;var r=cg();function e(t,n){var i=this.__data__,a=r(i,t);return a<0?(++this.size,i.push([t,n])):i[a][1]=n,this}return r2=e,r2}var n2,u8;function DG(){if(u8)return n2;u8=1;var r=CG(),e=AG(),t=MG(),n=RG(),i=OG();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var c=s[o];this.set(c[0],c[1])}}return a.prototype.clear=r,a.prototype.delete=e,a.prototype.get=t,a.prototype.has=n,a.prototype.set=i,n2=a,n2}var i2,c8;function PG(){if(c8)return i2;c8=1;var r=rw(),e=ig(),t=r(e,"Map");return i2=t,i2}var a2,h8;function IG(){if(h8)return a2;h8=1;var r=TG(),e=DG(),t=PG();function n(){this.size=0,this.__data__={hash:new r,map:new(t||e),string:new r}}return a2=n,a2}var s2,f8;function NG(){if(f8)return s2;f8=1;function r(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return s2=r,s2}var o2,d8;function hg(){if(d8)return o2;d8=1;var r=NG();function e(t,n){var i=t.__data__;return r(n)?i[typeof n=="string"?"string":"hash"]:i.map}return o2=e,o2}var l2,v8;function LG(){if(v8)return l2;v8=1;var r=hg();function e(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n}return l2=e,l2}var u2,p8;function kG(){if(p8)return u2;p8=1;var r=hg();function e(t){return r(this,t).get(t)}return u2=e,u2}var c2,g8;function BG(){if(g8)return c2;g8=1;var r=hg();function e(t){return r(this,t).has(t)}return c2=e,c2}var h2,m8;function FG(){if(m8)return h2;m8=1;var r=hg();function e(t,n){var i=r(this,t),a=i.size;return i.set(t,n),this.size+=i.size==a?0:1,this}return h2=e,h2}var f2,y8;function zG(){if(y8)return f2;y8=1;var r=IG(),e=LG(),t=kG(),n=BG(),i=FG();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var c=s[o];this.set(c[0],c[1])}}return a.prototype.clear=r,a.prototype.delete=e,a.prototype.get=t,a.prototype.has=n,a.prototype.set=i,f2=a,f2}var d2,b8;function UG(){if(b8)return d2;b8=1;var r=zG(),e="Expected a function";function t(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var a=function(){var s=arguments,o=i?i.apply(this,s):s[0],l=a.cache;if(l.has(o))return l.get(o);var c=n.apply(this,s);return a.cache=l.set(o,c)||l,c};return a.cache=new(t.Cache||r),a}return t.Cache=r,d2=t,d2}var v2,x8;function GG(){if(x8)return v2;x8=1;var r=UG(),e=500;function t(n){var i=r(n,function(s){return a.size===e&&a.clear(),s}),a=i.cache;return i}return v2=t,v2}var p2,_8;function vR(){if(_8)return p2;_8=1;var r=GG(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,n=r(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(e,function(s,o,l,c){a.push(l?c.replace(t,"$1"):o||s)}),a});return p2=n,p2}var g2,w8;function pR(){if(w8)return g2;w8=1;function r(e,t){for(var n=-1,i=e==null?0:e.length,a=Array(i);++n<i;)a[n]=t(e[n],n,e);return a}return g2=r,g2}var m2,S8;function HG(){if(S8)return m2;S8=1;var r=Y_(),e=pR(),t=lg(),n=Md(),i=r?r.prototype:void 0,a=i?i.toString:void 0;function s(o){if(typeof o=="string")return o;if(t(o))return e(o,s)+"";if(n(o))return a?a.call(o):"";var l=o+"";return l=="0"&&1/o==-1/0?"-0":l}return m2=s,m2}var y2,E8;function gR(){if(E8)return y2;E8=1;var r=HG();function e(t){return t==null?"":r(t)}return y2=e,y2}var b2,T8;function mR(){if(T8)return b2;T8=1;var r=lg(),e=dG(),t=vR(),n=gR();function i(a,s){return r(a)?a:e(a,s)?[a]:t(n(a))}return b2=i,b2}var x2,C8;function nw(){if(C8)return x2;C8=1;var r=Md();function e(t){if(typeof t=="string"||r(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}return x2=e,x2}var _2,A8;function jG(){if(A8)return _2;A8=1;var r=mR(),e=nw();function t(n,i){i=r(i,n);for(var a=0,s=i.length;n!=null&&a<s;)n=n[e(i[a++])];return a&&a==s?n:void 0}return _2=t,_2}var w2,M8;function VG(){if(M8)return w2;M8=1;var r=jG();function e(t,n,i){var a=t==null?void 0:r(t,n);return a===void 0?i:a}return w2=e,w2}var qG=VG(),XG=Cd(qG),S2,R8;function YG(){if(R8)return S2;R8=1;var r=rw(),e=(function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch{}})();return S2=e,S2}var E2,O8;function WG(){if(O8)return E2;O8=1;var r=YG();function e(t,n,i){n=="__proto__"&&r?r(t,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[n]=i}return E2=e,E2}var T2,D8;function $G(){if(D8)return T2;D8=1;var r=WG(),e=dR(),t=Object.prototype,n=t.hasOwnProperty;function i(a,s,o){var l=a[s];(!(n.call(a,s)&&e(l,o))||o===void 0&&!(s in a))&&r(a,s,o)}return T2=i,T2}var C2,P8;function KG(){if(P8)return C2;P8=1;var r=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(n,i){var a=typeof n;return i=i??r,!!i&&(a=="number"||a!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<i}return C2=t,C2}var A2,I8;function ZG(){if(I8)return A2;I8=1;var r=$G(),e=mR(),t=KG(),n=Ad(),i=nw();function a(s,o,l,c){if(!n(s))return s;o=e(o,s);for(var h=-1,d=o.length,v=d-1,g=s;g!=null&&++h<d;){var m=i(o[h]),x=l;if(m==="__proto__"||m==="constructor"||m==="prototype")return s;if(h!=v){var y=g[m];x=c?c(y,m,g):void 0,x===void 0&&(x=n(y)?y:t(o[h+1])?[]:{})}r(g,m,x),g=g[m]}return s}return A2=a,A2}var M2,N8;function QG(){if(N8)return M2;N8=1;var r=ZG();function e(t,n,i){return t==null?t:r(t,n,i)}return M2=e,M2}var JG=QG(),eH=Cd(JG),R2,L8;function tH(){if(L8)return R2;L8=1;function r(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t}return R2=r,R2}var O2,k8;function rH(){if(k8)return O2;k8=1;var r=pR(),e=tH(),t=lg(),n=Md(),i=vR(),a=nw(),s=gR();function o(l){return t(l)?r(l,a):n(l)?[l]:e(i(s(l)))}return O2=o,O2}var nH=rH(),iH=Cd(nH),aH={data:function(e){var t={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(i){},beforeSet:function(i,a){},onSet:function(i){},canSet:function(i){return!0}};return e=Ct({},t,e),function(i,a){var s=e,o=this,l=o.length!==void 0,c=l?o:[o],h=l?o[0]:o;if(xt(i)){var d=i.indexOf(".")!==-1,v=d&&iH(i);if(s.allowGetting&&a===void 0){var g;return h&&(s.beforeGet(h),v&&h._private[s.field][i]===void 0?g=XG(h._private[s.field],v):g=h._private[s.field][i]),g}else if(s.allowSetting&&a!==void 0){var m=!s.immutableKeys[i];if(m){var x=P9({},i,a);s.beforeSet(o,x);for(var y=0,_=c.length;y<_;y++){var w=c[y];s.canSet(w)&&(v&&h._private[s.field][i]===void 0?eH(w._private[s.field],v,a):w._private[s.field][i]=a)}s.updateStyle&&o.updateStyle(),s.onSet(o),s.settingTriggersEvent&&o[s.triggerFnName](s.settingEvent)}}}else if(s.allowSetting&&Zt(i)){var S=i,A,C,M=Object.keys(S);s.beforeSet(o,S);for(var E=0;E<M.length;E++){A=M[E],C=S[A];var O=!s.immutableKeys[A];if(O)for(var D=0;D<c.length;D++){var I=c[D];s.canSet(I)&&(I._private[s.field][A]=C)}}s.updateStyle&&o.updateStyle(),s.onSet(o),s.settingTriggersEvent&&o[s.triggerFnName](s.settingEvent)}else if(s.allowBinding&&en(i)){var k=i;o.on(s.bindingEvent,k)}else if(s.allowGetting&&i===void 0){var U;return h&&(s.beforeGet(h),U=h._private[s.field]),U}return o}},removeData:function(e){var t={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=Ct({},t,e),function(i){var a=e,s=this,o=s.length!==void 0,l=o?s:[s];if(xt(i)){for(var c=i.split(/\s+/),h=c.length,d=0;d<h;d++){var v=c[d];if(!$o(v)){var g=!a.immutableKeys[v];if(g)for(var m=0,x=l.length;m<x;m++)l[m]._private[a.field][v]=void 0}}a.triggerEvent&&s[a.triggerFnName](a.event)}else if(i===void 0){for(var y=0,_=l.length;y<_;y++)for(var w=l[y]._private[a.field],S=Object.keys(w),A=0;A<S.length;A++){var C=S[A],M=!a.immutableKeys[C];M&&(w[C]=void 0)}a.triggerEvent&&s[a.triggerFnName](a.event)}return s}}},sH={eventAliasesOn:function(e){var t=e;t.addListener=t.listen=t.bind=t.on,t.unlisten=t.unbind=t.off=t.removeListener,t.trigger=t.emit,t.pon=t.promiseOn=function(n,i){var a=this,s=Array.prototype.slice.call(arguments,0);return new Jc(function(o,l){var c=function(g){a.off.apply(a,d),o(g)},h=s.concat([c]),d=h.concat([]);a.on.apply(a,h)})}}},hr={};[fG,aH,sH].forEach(function(r){Ct(hr,r)});var oH={animate:hr.animate(),animation:hr.animation(),animated:hr.animated(),clearQueue:hr.clearQueue(),delay:hr.delay(),delayAnimation:hr.delayAnimation(),stop:hr.stop()},np={classes:function(e){var t=this;if(e===void 0){var n=[];return t[0]._private.classes.forEach(function(m){return n.push(m)}),n}else Cr(e)||(e=(e||"").match(/\S+/g)||[]);for(var i=[],a=new Qc(e),s=0;s<t.length;s++){for(var o=t[s],l=o._private,c=l.classes,h=!1,d=0;d<e.length;d++){var v=e[d],g=c.has(v);if(!g){h=!0;break}}h||(h=c.size!==e.length),h&&(l.classes=a,i.push(o))}return i.length>0&&this.spawn(i).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return t!=null&&t._private.classes.has(e)},toggleClass:function(e,t){Cr(e)||(e=e.match(/\S+/g)||[]);for(var n=this,i=t===void 0,a=[],s=0,o=n.length;s<o;s++)for(var l=n[s],c=l._private.classes,h=!1,d=0;d<e.length;d++){var v=e[d],g=c.has(v),m=!1;t||i&&!g?(c.add(v),m=!0):(!t||i&&g)&&(c.delete(v),m=!0),!h&&m&&(a.push(l),h=!0)}return a.length>0&&this.spawn(a).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(t==null)t=250;else if(t===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},t),n}};np.className=np.classNames=np.classes;var Kt={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Rn,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Kt.variable="(?:[\\w-.]|(?:\\\\"+Kt.metaChar+"))+";Kt.className="(?:[\\w-]|(?:\\\\"+Kt.metaChar+"))+";Kt.value=Kt.string+"|"+Kt.number;Kt.id=Kt.variable;(function(){var r,e,t;for(r=Kt.comparatorOp.split("|"),t=0;t<r.length;t++)e=r[t],Kt.comparatorOp+="|@"+e;for(r=Kt.comparatorOp.split("|"),t=0;t<r.length;t++)e=r[t],!(e.indexOf("!")>=0)&&e!=="="&&(Kt.comparatorOp+="|\\!"+e)})();var Sr=function(){return{checks:[]}},pt={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},o4=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(r,e){return az(r.selector,e.selector)}),lH=(function(){for(var r={},e,t=0;t<o4.length;t++)e=o4[t],r[e.selector]=e.matches;return r})(),uH=function(e,t){return lH[e](t)},cH="("+o4.map(function(r){return r.selector}).join("|")+")",sc=function(e){return e.replace(new RegExp("\\\\("+Kt.metaChar+")","g"),function(t,n){return n})},Mo=function(e,t,n){e[e.length-1]=n},l4=[{name:"group",query:!0,regex:"("+Kt.group+")",populate:function(e,t,n){var i=_n(n,1),a=i[0];t.checks.push({type:pt.GROUP,value:a==="*"?a:a+"s"})}},{name:"state",query:!0,regex:cH,populate:function(e,t,n){var i=_n(n,1),a=i[0];t.checks.push({type:pt.STATE,value:a})}},{name:"id",query:!0,regex:"\\#("+Kt.id+")",populate:function(e,t,n){var i=_n(n,1),a=i[0];t.checks.push({type:pt.ID,value:sc(a)})}},{name:"className",query:!0,regex:"\\.("+Kt.className+")",populate:function(e,t,n){var i=_n(n,1),a=i[0];t.checks.push({type:pt.CLASS,value:sc(a)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Kt.variable+")\\s*\\]",populate:function(e,t,n){var i=_n(n,1),a=i[0];t.checks.push({type:pt.DATA_EXIST,field:sc(a)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Kt.variable+")\\s*("+Kt.comparatorOp+")\\s*("+Kt.value+")\\s*\\]",populate:function(e,t,n){var i=_n(n,3),a=i[0],s=i[1],o=i[2],l=new RegExp("^"+Kt.string+"$").exec(o)!=null;l?o=o.substring(1,o.length-1):o=parseFloat(o),t.checks.push({type:pt.DATA_COMPARE,field:sc(a),operator:s,value:o})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Kt.boolOp+")\\s*("+Kt.variable+")\\s*\\]",populate:function(e,t,n){var i=_n(n,2),a=i[0],s=i[1];t.checks.push({type:pt.DATA_BOOL,field:sc(s),operator:a})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Kt.meta+")\\s*("+Kt.comparatorOp+")\\s*("+Kt.number+")\\s*\\]\\]",populate:function(e,t,n){var i=_n(n,3),a=i[0],s=i[1],o=i[2];t.checks.push({type:pt.META_COMPARE,field:sc(a),operator:s,value:parseFloat(o)})}},{name:"nextQuery",separator:!0,regex:Kt.separator,populate:function(e,t){var n=e.currentSubject,i=e.edgeCount,a=e.compoundCount,s=e[e.length-1];n!=null&&(s.subject=n,e.currentSubject=null),s.edgeCount=i,s.compoundCount=a,e.edgeCount=0,e.compoundCount=0;var o=e[e.length++]=Sr();return o}},{name:"directedEdge",separator:!0,regex:Kt.directedEdge,populate:function(e,t){if(e.currentSubject==null){var n=Sr(),i=t,a=Sr();return n.checks.push({type:pt.DIRECTED_EDGE,source:i,target:a}),Mo(e,t,n),e.edgeCount++,a}else{var s=Sr(),o=t,l=Sr();return s.checks.push({type:pt.NODE_SOURCE,source:o,target:l}),Mo(e,t,s),e.edgeCount++,l}}},{name:"undirectedEdge",separator:!0,regex:Kt.undirectedEdge,populate:function(e,t){if(e.currentSubject==null){var n=Sr(),i=t,a=Sr();return n.checks.push({type:pt.UNDIRECTED_EDGE,nodes:[i,a]}),Mo(e,t,n),e.edgeCount++,a}else{var s=Sr(),o=t,l=Sr();return s.checks.push({type:pt.NODE_NEIGHBOR,node:o,neighbor:l}),Mo(e,t,s),l}}},{name:"child",separator:!0,regex:Kt.child,populate:function(e,t){if(e.currentSubject==null){var n=Sr(),i=Sr(),a=e[e.length-1];return n.checks.push({type:pt.CHILD,parent:a,child:i}),Mo(e,t,n),e.compoundCount++,i}else if(e.currentSubject===t){var s=Sr(),o=e[e.length-1],l=Sr(),c=Sr(),h=Sr(),d=Sr();return s.checks.push({type:pt.COMPOUND_SPLIT,left:o,right:l,subject:c}),c.checks=t.checks,t.checks=[{type:pt.TRUE}],d.checks.push({type:pt.TRUE}),l.checks.push({type:pt.PARENT,parent:d,child:h}),Mo(e,o,s),e.currentSubject=c,e.compoundCount++,h}else{var v=Sr(),g=Sr(),m=[{type:pt.PARENT,parent:v,child:g}];return v.checks=t.checks,t.checks=m,e.compoundCount++,g}}},{name:"descendant",separator:!0,regex:Kt.descendant,populate:function(e,t){if(e.currentSubject==null){var n=Sr(),i=Sr(),a=e[e.length-1];return n.checks.push({type:pt.DESCENDANT,ancestor:a,descendant:i}),Mo(e,t,n),e.compoundCount++,i}else if(e.currentSubject===t){var s=Sr(),o=e[e.length-1],l=Sr(),c=Sr(),h=Sr(),d=Sr();return s.checks.push({type:pt.COMPOUND_SPLIT,left:o,right:l,subject:c}),c.checks=t.checks,t.checks=[{type:pt.TRUE}],d.checks.push({type:pt.TRUE}),l.checks.push({type:pt.ANCESTOR,ancestor:d,descendant:h}),Mo(e,o,s),e.currentSubject=c,e.compoundCount++,h}else{var v=Sr(),g=Sr(),m=[{type:pt.ANCESTOR,ancestor:v,descendant:g}];return v.checks=t.checks,t.checks=m,e.compoundCount++,g}}},{name:"subject",modifier:!0,regex:Kt.subject,populate:function(e,t){if(e.currentSubject!=null&&e.currentSubject!==t)return fr("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=t;var n=e[e.length-1],i=n.checks[0],a=i==null?null:i.type;a===pt.DIRECTED_EDGE?i.type=pt.NODE_TARGET:a===pt.UNDIRECTED_EDGE&&(i.type=pt.NODE_NEIGHBOR,i.node=i.nodes[1],i.neighbor=i.nodes[0],i.nodes=null)}}];l4.forEach(function(r){return r.regexObj=new RegExp("^"+r.regex)});var hH=function(e){for(var t,n,i,a=0;a<l4.length;a++){var s=l4[a],o=s.name,l=e.match(s.regexObj);if(l!=null){n=l,t=s,i=o;var c=l[0];e=e.substring(c.length);break}}return{expr:t,match:n,name:i,remaining:e}},fH=function(e){var t=e.match(/^\s+/);if(t){var n=t[0];e=e.substring(n.length)}return e},dH=function(e){var t=this,n=t.inputText=e,i=t[0]=Sr();for(t.length=1,n=fH(n);;){var a=hH(n);if(a.expr==null)return fr("The selector `"+e+"`is invalid"),!1;var s=a.match.slice(1),o=a.expr.populate(t,i,s);if(o===!1)return!1;if(o!=null&&(i=o),n=a.remaining,n.match(/^\s*$/))break}var l=t[t.length-1];t.currentSubject!=null&&(l.subject=t.currentSubject),l.edgeCount=t.edgeCount,l.compoundCount=t.compoundCount;for(var c=0;c<t.length;c++){var h=t[c];if(h.compoundCount>0&&h.edgeCount>0)return fr("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return fr("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&fr("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},vH=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(h){return h??""},t=function(h){return xt(h)?'"'+h+'"':e(h)},n=function(h){return" "+h+" "},i=function(h,d){var v=h.type,g=h.value;switch(v){case pt.GROUP:{var m=e(g);return m.substring(0,m.length-1)}case pt.DATA_COMPARE:{var x=h.field,y=h.operator;return"["+x+n(e(y))+t(g)+"]"}case pt.DATA_BOOL:{var _=h.operator,w=h.field;return"["+e(_)+w+"]"}case pt.DATA_EXIST:{var S=h.field;return"["+S+"]"}case pt.META_COMPARE:{var A=h.operator,C=h.field;return"[["+C+n(e(A))+t(g)+"]]"}case pt.STATE:return g;case pt.ID:return"#"+g;case pt.CLASS:return"."+g;case pt.PARENT:case pt.CHILD:return a(h.parent,d)+n(">")+a(h.child,d);case pt.ANCESTOR:case pt.DESCENDANT:return a(h.ancestor,d)+" "+a(h.descendant,d);case pt.COMPOUND_SPLIT:{var M=a(h.left,d),E=a(h.subject,d),O=a(h.right,d);return M+(M.length>0?" ":"")+E+O}case pt.TRUE:return""}},a=function(h,d){return h.checks.reduce(function(v,g,m){return v+(d===h&&m===0?"$":"")+i(g,d)},"")},s="",o=0;o<this.length;o++){var l=this[o];s+=a(l,l.subject),this.length>1&&o<this.length-1&&(s+=", ")}return this.toStringCache=s,s},pH={parse:dH,toString:vH},yR=function(e,t,n){var i,a=xt(e),s=ut(e),o=xt(n),l,c,h=!1,d=!1,v=!1;switch(t.indexOf("!")>=0&&(t=t.replace("!",""),d=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),h=!0),(a||o||h)&&(l=!a&&!s?"":""+e,c=""+n),h&&(e=l=l.toLowerCase(),n=c=c.toLowerCase()),t){case"*=":i=l.indexOf(c)>=0;break;case"$=":i=l.indexOf(c,l.length-c.length)>=0;break;case"^=":i=l.indexOf(c)===0;break;case"=":i=e===n;break;case">":v=!0,i=e>n;break;case">=":v=!0,i=e>=n;break;case"<":v=!0,i=e<n;break;case"<=":v=!0,i=e<=n;break;default:i=!1;break}return d&&(e!=null||!v)&&(i=!i),i},gH=function(e,t){switch(t){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},mH=function(e){return e!==void 0},iw=function(e,t){return e.data(t)},yH=function(e,t){return e[t]()},un=[],zr=function(e,t){return e.checks.every(function(n){return un[n.type](n,t)})};un[pt.GROUP]=function(r,e){var t=r.value;return t==="*"||t===e.group()};un[pt.STATE]=function(r,e){var t=r.value;return uH(t,e)};un[pt.ID]=function(r,e){var t=r.value;return e.id()===t};un[pt.CLASS]=function(r,e){var t=r.value;return e.hasClass(t)};un[pt.META_COMPARE]=function(r,e){var t=r.field,n=r.operator,i=r.value;return yR(yH(e,t),n,i)};un[pt.DATA_COMPARE]=function(r,e){var t=r.field,n=r.operator,i=r.value;return yR(iw(e,t),n,i)};un[pt.DATA_BOOL]=function(r,e){var t=r.field,n=r.operator;return gH(iw(e,t),n)};un[pt.DATA_EXIST]=function(r,e){var t=r.field;return r.operator,mH(iw(e,t))};un[pt.UNDIRECTED_EDGE]=function(r,e){var t=r.nodes[0],n=r.nodes[1],i=e.source(),a=e.target();return zr(t,i)&&zr(n,a)||zr(n,i)&&zr(t,a)};un[pt.NODE_NEIGHBOR]=function(r,e){return zr(r.node,e)&&e.neighborhood().some(function(t){return t.isNode()&&zr(r.neighbor,t)})};un[pt.DIRECTED_EDGE]=function(r,e){return zr(r.source,e.source())&&zr(r.target,e.target())};un[pt.NODE_SOURCE]=function(r,e){return zr(r.source,e)&&e.outgoers().some(function(t){return t.isNode()&&zr(r.target,t)})};un[pt.NODE_TARGET]=function(r,e){return zr(r.target,e)&&e.incomers().some(function(t){return t.isNode()&&zr(r.source,t)})};un[pt.CHILD]=function(r,e){return zr(r.child,e)&&zr(r.parent,e.parent())};un[pt.PARENT]=function(r,e){return zr(r.parent,e)&&e.children().some(function(t){return zr(r.child,t)})};un[pt.DESCENDANT]=function(r,e){return zr(r.descendant,e)&&e.ancestors().some(function(t){return zr(r.ancestor,t)})};un[pt.ANCESTOR]=function(r,e){return zr(r.ancestor,e)&&e.descendants().some(function(t){return zr(r.descendant,t)})};un[pt.COMPOUND_SPLIT]=function(r,e){return zr(r.subject,e)&&zr(r.left,e)&&zr(r.right,e)};un[pt.TRUE]=function(){return!0};un[pt.COLLECTION]=function(r,e){var t=r.value;return t.has(e)};un[pt.FILTER]=function(r,e){var t=r.value;return t(e)};var bH=function(e){var t=this;if(t.length===1&&t[0].checks.length===1&&t[0].checks[0].type===pt.ID)return e.getElementById(t[0].checks[0].value).collection();var n=function(a){for(var s=0;s<t.length;s++){var o=t[s];if(zr(o,a))return!0}return!1};return t.text()==null&&(n=function(){return!0}),e.filter(n)},xH=function(e){for(var t=this,n=0;n<t.length;n++){var i=t[n];if(zr(i,e))return!0}return!1},_H={matches:xH,filter:bH},Qo=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||xt(e)&&e.match(/^\s*$/)||(qi(e)?this.addQuery({checks:[{type:pt.COLLECTION,value:e.collection()}]}):en(e)?this.addQuery({checks:[{type:pt.FILTER,value:e}]}):xt(e)?this.parse(e)||(this.invalid=!0):jr("A selector must be created from a string; found "))},Jo=Qo.prototype;[pH,_H].forEach(function(r){return Ct(Jo,r)});Jo.text=function(){return this.inputText};Jo.size=function(){return this.length};Jo.eq=function(r){return this[r]};Jo.sameText=function(r){return!this.invalid&&!r.invalid&&this.text()===r.text()};Jo.addQuery=function(r){this[this.length++]=r};Jo.selector=Jo.toString;var Vo={allAre:function(e){var t=new Qo(e);return this.every(function(n){return t.matches(n)})},is:function(e){var t=new Qo(e);return this.some(function(n){return t.matches(n)})},some:function(e,t){for(var n=0;n<this.length;n++){var i=t?e.apply(t,[this[n],n,this]):e(this[n],n,this);if(i)return!0}return!1},every:function(e,t){for(var n=0;n<this.length;n++){var i=t?e.apply(t,[this[n],n,this]):e(this[n],n,this);if(!i)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var t=this.length,n=e.length;return t!==n?!1:t===1?this[0]===e[0]:this.every(function(i){return e.hasElementWithId(i.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(t){return e.hasElementWithId(t.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var t=this.neighborhood();return e.every(function(n){return t.hasElementWithId(n.id())})},contains:function(e){e=this.cy().collection(e);var t=this;return e.every(function(n){return t.hasElementWithId(n.id())})}};Vo.allAreNeighbours=Vo.allAreNeighbors;Vo.has=Vo.contains;Vo.equal=Vo.equals=Vo.same;var va=function(e,t){return function(i,a,s,o){var l=i,c=this,h;if(l==null?h="":qi(l)&&l.length===1&&(h=l.id()),c.length===1&&h){var d=c[0]._private,v=d.traversalCache=d.traversalCache||{},g=v[t]=v[t]||[],m=cu(h),x=g[m];return x||(g[m]=e.call(c,i,a,s,o))}else return e.call(c,i,a,s,o)}},Uc={parent:function(e){var t=[];if(this.length===1){var n=this[0]._private.parent;if(n)return n}for(var i=0;i<this.length;i++){var a=this[i],s=a._private.parent;s&&t.push(s)}return this.spawn(t,!0).filter(e)},parents:function(e){for(var t=[],n=this.parent();n.nonempty();){for(var i=0;i<n.length;i++){var a=n[i];t.push(a)}n=n.parent()}return this.spawn(t,!0).filter(e)},commonAncestors:function(e){for(var t,n=0;n<this.length;n++){var i=this[n],a=i.parents();t=t||a,t=t.intersect(a)}return t.filter(e)},orphans:function(e){return this.stdFilter(function(t){return t.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(t){return t.isChild()}).filter(e)},children:va(function(r){for(var e=[],t=0;t<this.length;t++)for(var n=this[t],i=n._private.children,a=0;a<i.length;a++)e.push(i[a]);return this.spawn(e,!0).filter(r)},"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var t=[];function n(i){for(var a=0;a<i.length;a++){var s=i[a];t.push(s),s.children().nonempty()&&n(s.children())}}return n(this.children()),this.spawn(t,!0).filter(e)}};function aw(r,e,t,n){for(var i=[],a=new Qc,s=r.cy(),o=s.hasCompoundNodes(),l=0;l<r.length;l++){var c=r[l];t?i.push(c):o&&n(i,a,c)}for(;i.length>0;){var h=i.shift();e(h),a.add(h.id()),o&&n(i,a,h)}return r}function bR(r,e,t){if(t.isParent())for(var n=t._private.children,i=0;i<n.length;i++){var a=n[i];e.has(a.id())||r.push(a)}}Uc.forEachDown=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return aw(this,r,e,bR)};function xR(r,e,t){if(t.isChild()){var n=t._private.parent;e.has(n.id())||r.push(n)}}Uc.forEachUp=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return aw(this,r,e,xR)};function wH(r,e,t){xR(r,e,t),bR(r,e,t)}Uc.forEachUpAndDown=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return aw(this,r,e,wH)};Uc.ancestors=Uc.parents;var Jf,_R;Jf=_R={data:hr.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:hr.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:hr.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:hr.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:hr.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:hr.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};Jf.attr=Jf.data;Jf.removeAttr=Jf.removeData;var SH=_R,fg={};function D2(r){return function(e){var t=this;if(e===void 0&&(e=!0),t.length!==0)if(t.isNode()&&!t.removed()){for(var n=0,i=t[0],a=i._private.edges,s=0;s<a.length;s++){var o=a[s];!e&&o.isLoop()||(n+=r(i,o))}return n}else return}}Ct(fg,{degree:D2(function(r,e){return e.source().same(e.target())?2:1}),indegree:D2(function(r,e){return e.target().same(r)?1:0}),outdegree:D2(function(r,e){return e.source().same(r)?1:0})});function oc(r,e){return function(t){for(var n,i=this.nodes(),a=0;a<i.length;a++){var s=i[a],o=s[r](t);o!==void 0&&(n===void 0||e(o,n))&&(n=o)}return n}}Ct(fg,{minDegree:oc("degree",function(r,e){return r<e}),maxDegree:oc("degree",function(r,e){return r>e}),minIndegree:oc("indegree",function(r,e){return r<e}),maxIndegree:oc("indegree",function(r,e){return r>e}),minOutdegree:oc("outdegree",function(r,e){return r<e}),maxOutdegree:oc("outdegree",function(r,e){return r>e})});Ct(fg,{totalDegree:function(e){for(var t=0,n=this.nodes(),i=0;i<n.length;i++)t+=n[i].degree(e);return t}});var Pa,wR,SR=function(e,t,n){for(var i=0;i<e.length;i++){var a=e[i];if(!a.locked()){var s=a._private.position,o={x:t.x!=null?t.x-s.x:0,y:t.y!=null?t.y-s.y:0};a.isParent()&&!(o.x===0&&o.y===0)&&a.children().shift(o,n),a.dirtyBoundingBoxCache()}}},B8={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,t){SR(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};Pa=wR={position:hr.data(B8),silentPosition:hr.data(Ct({},B8,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){SR(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(Zt(e))t?this.silentPosition(e):this.position(e);else if(en(e)){var n=e,i=this.cy();i.startBatch();for(var a=0;a<this.length;a++){var s=this[a],o=void 0;(o=n(s,a))&&(t?s.silentPosition(o):s.position(o))}i.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,t,n){var i;if(Zt(e)?(i={x:ut(e.x)?e.x:0,y:ut(e.y)?e.y:0},n=t):xt(e)&&ut(t)&&(i={x:0,y:0},i[e]=t),i!=null){var a=this.cy();a.startBatch();for(var s=0;s<this.length;s++){var o=this[s];if(!(a.hasCompoundNodes()&&o.isChild()&&o.ancestors().anySame(this))){var l=o.position(),c={x:l.x+i.x,y:l.y+i.y};n?o.silentPosition(c):o.position(c)}}a.endBatch()}return this},silentShift:function(e,t){return Zt(e)?this.shift(e,!0):xt(e)&&ut(t)&&this.shift(e,t,!0),this},renderedPosition:function(e,t){var n=this[0],i=this.cy(),a=i.zoom(),s=i.pan(),o=Zt(e)?e:void 0,l=o!==void 0||t!==void 0&&xt(e);if(n&&n.isNode())if(l)for(var c=0;c<this.length;c++){var h=this[c];t!==void 0?h.position(e,(t-s[e])/a):o!==void 0&&h.position(Z9(o,a,s))}else{var d=n.position();return o=sg(d,a,s),e===void 0?o:o[e]}else if(!l)return;return this},relativePosition:function(e,t){var n=this[0],i=this.cy(),a=Zt(e)?e:void 0,s=a!==void 0||t!==void 0&&xt(e),o=i.hasCompoundNodes();if(n&&n.isNode())if(s)for(var l=0;l<this.length;l++){var c=this[l],h=o?c.parent():null,d=h&&h.length>0,v=d;d&&(h=h[0]);var g=v?h.position():{x:0,y:0};t!==void 0?c.position(e,t+g[e]):a!==void 0&&c.position({x:a.x+g.x,y:a.y+g.y})}else{var m=n.position(),x=o?n.parent():null,y=x&&x.length>0,_=y;y&&(x=x[0]);var w=_?x.position():{x:0,y:0};return a={x:m.x-w.x,y:m.y-w.y},e===void 0?a:a[e]}else if(!s)return;return this}};Pa.modelPosition=Pa.point=Pa.position;Pa.modelPositions=Pa.points=Pa.positions;Pa.renderedPoint=Pa.renderedPosition;Pa.relativePoint=Pa.relativePosition;var EH=wR,Dc,dl;Dc=dl={};dl.renderedBoundingBox=function(r){var e=this.boundingBox(r),t=this.cy(),n=t.zoom(),i=t.pan(),a=e.x1*n+i.x,s=e.x2*n+i.x,o=e.y1*n+i.y,l=e.y2*n+i.y;return{x1:a,x2:s,y1:o,y2:l,w:s-a,h:l-o}};dl.dirtyCompoundBoundsCache=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,r||t.emitAndNotify("bounds")}}),this)};dl.updateCompoundBounds=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!r&&e.batching())return this;function t(s){if(!s.isParent())return;var o=s._private,l=s.children(),c=s.pstyle("compound-sizing-wrt-labels").value==="include",h={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},d=l.boundingBox({includeLabels:c,includeOverlays:!1,useCache:!1}),v=o.position;(d.w===0||d.h===0)&&(d={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},d.x1=v.x-d.w/2,d.x2=v.x+d.w/2,d.y1=v.y-d.h/2,d.y2=v.y+d.h/2);function g(D,I,k){var U=0,V=0,X=I+k;return D>0&&X>0&&(U=I/X*D,V=k/X*D),{biasDiff:U,biasComplementDiff:V}}function m(D,I,k,U){if(k.units==="%")switch(U){case"width":return D>0?k.pfValue*D:0;case"height":return I>0?k.pfValue*I:0;case"average":return D>0&&I>0?k.pfValue*(D+I)/2:0;case"min":return D>0&&I>0?D>I?k.pfValue*I:k.pfValue*D:0;case"max":return D>0&&I>0?D>I?k.pfValue*D:k.pfValue*I:0;default:return 0}else return k.units==="px"?k.pfValue:0}var x=h.width.left.value;h.width.left.units==="px"&&h.width.val>0&&(x=x*100/h.width.val);var y=h.width.right.value;h.width.right.units==="px"&&h.width.val>0&&(y=y*100/h.width.val);var _=h.height.top.value;h.height.top.units==="px"&&h.height.val>0&&(_=_*100/h.height.val);var w=h.height.bottom.value;h.height.bottom.units==="px"&&h.height.val>0&&(w=w*100/h.height.val);var S=g(h.width.val-d.w,x,y),A=S.biasDiff,C=S.biasComplementDiff,M=g(h.height.val-d.h,_,w),E=M.biasDiff,O=M.biasComplementDiff;o.autoPadding=m(d.w,d.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(d.w,h.width.val),v.x=(-A+d.x1+d.x2+C)/2,o.autoHeight=Math.max(d.h,h.height.val),v.y=(-E+d.y1+d.y2+O)/2}for(var n=0;n<this.length;n++){var i=this[n],a=i._private;(!a.compoundBoundsClean||r)&&(t(i),e.batching()||(a.compoundBoundsClean=!0))}return this};var ca=function(e){return e===1/0||e===-1/0?0:e},Oa=function(e,t,n,i,a){i-t===0||a-n===0||t==null||n==null||i==null||a==null||(e.x1=t<e.x1?t:e.x1,e.x2=i>e.x2?i:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=a>e.y2?a:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},Lo=function(e,t){return t==null?e:Oa(e,t.x1,t.y1,t.x2,t.y2)},of=function(e,t,n){return Ai(e,t,n)},lv=function(e,t,n){if(!t.cy().headless()){var i=t._private,a=i.rstyle,s=a.arrowWidth/2,o=t.pstyle(n+"-arrow-shape").value,l,c;if(o!=="none"){n==="source"?(l=a.srcX,c=a.srcY):n==="target"?(l=a.tgtX,c=a.tgtY):(l=a.midX,c=a.midY);var h=i.arrowBounds=i.arrowBounds||{},d=h[n]=h[n]||{};d.x1=l-s,d.y1=c-s,d.x2=l+s,d.y2=c+s,d.w=d.x2-d.x1,d.h=d.y2-d.y1,tp(d,1),Oa(e,d.x1,d.y1,d.x2,d.y2)}}},P2=function(e,t,n){if(!t.cy().headless()){var i;n?i=n+"-":i="";var a=t._private,s=a.rstyle,o=t.pstyle(i+"label").strValue;if(o){var l=t.pstyle("text-halign"),c=t.pstyle("text-valign"),h=of(s,"labelWidth",n),d=of(s,"labelHeight",n),v=of(s,"labelX",n),g=of(s,"labelY",n),m=t.pstyle(i+"text-margin-x").pfValue,x=t.pstyle(i+"text-margin-y").pfValue,y=t.isEdge(),_=t.pstyle(i+"text-rotation"),w=t.pstyle("text-outline-width").pfValue,S=t.pstyle("text-border-width").pfValue,A=S/2,C=t.pstyle("text-background-padding").pfValue,M=2,E=d,O=h,D=O/2,I=E/2,k,U,V,X;if(y)k=v-D,U=v+D,V=g-I,X=g+I;else{switch(l.value){case"left":k=v-O,U=v;break;case"center":k=v-D,U=v+D;break;case"right":k=v,U=v+O;break}switch(c.value){case"top":V=g-E,X=g;break;case"center":V=g-I,X=g+I;break;case"bottom":V=g,X=g+E;break}}var W=m-Math.max(w,A)-C-M,P=m+Math.max(w,A)+C+M,H=x-Math.max(w,A)-C-M,z=x+Math.max(w,A)+C+M;k+=W,U+=P,V+=H,X+=z;var $=n||"main",B=a.labelBounds,L=B[$]=B[$]||{};L.x1=k,L.y1=V,L.x2=U,L.y2=X,L.w=U-k,L.h=X-V,L.leftPad=W,L.rightPad=P,L.topPad=H,L.botPad=z;var Y=y&&_.strValue==="autorotate",G=_.pfValue!=null&&_.pfValue!==0;if(Y||G){var re=Y?of(a.rstyle,"labelAngle",n):_.pfValue,ie=Math.cos(re),le=Math.sin(re),ce=(k+U)/2,_e=(V+X)/2;if(!y){switch(l.value){case"left":ce=U;break;case"right":ce=k;break}switch(c.value){case"top":_e=X;break;case"bottom":_e=V;break}}var pe=function(Be,$e){return Be=Be-ce,$e=$e-_e,{x:Be*ie-$e*le+ce,y:Be*le+$e*ie+_e}},ae=pe(k,V),oe=pe(k,X),de=pe(U,V),ye=pe(U,X);k=Math.min(ae.x,oe.x,de.x,ye.x),U=Math.max(ae.x,oe.x,de.x,ye.x),V=Math.min(ae.y,oe.y,de.y,ye.y),X=Math.max(ae.y,oe.y,de.y,ye.y)}var Ee=$+"Rot",Re=B[Ee]=B[Ee]||{};Re.x1=k,Re.y1=V,Re.x2=U,Re.y2=X,Re.w=U-k,Re.h=X-V,Oa(e,k,V,U,X),Oa(a.labelBounds.all,k,V,U,X)}return e}},F8=function(e,t){if(!t.cy().headless()){var n=t.pstyle("outline-opacity").value,i=t.pstyle("outline-width").value,a=t.pstyle("outline-offset").value,s=i+a;ER(e,t,n,s,"outside",s/2)}},ER=function(e,t,n,i,a,s){if(!(n===0||i<=0||a==="inside")){var o=t.cy(),l=o.renderer(),c=l.nodeShapes[l.getNodeShape(t)];if(c){var h=t.position(),d=h.x,v=h.y,g=t.width(),m=t.height();if(c.hasMiterBounds){a==="center"&&(i/=2);var x=c.miterBounds(d,v,g,m,i);Lo(e,x)}else s!=null&&s>0&&rp(e,[s,s,s,s])}}},TH=function(e,t){if(!t.cy().headless()){var n=t.pstyle("border-opacity").value,i=t.pstyle("border-width").pfValue,a=t.pstyle("border-position").value;ER(e,t,n,i,a)}},CH=function(e,t){var n=e._private.cy,i=n.styleEnabled(),a=n.headless(),s=di(),o=e._private,l=e.isNode(),c=e.isEdge(),h,d,v,g,m,x,y=o.rstyle,_=l&&i?e.pstyle("bounds-expansion").pfValue:[0],w=function(Ne){return Ne.pstyle("display").value!=="none"},S=!i||w(e)&&(!c||w(e.source())&&w(e.target()));if(S){var A=0,C=0;i&&t.includeOverlays&&(A=e.pstyle("overlay-opacity").value,A!==0&&(C=e.pstyle("overlay-padding").value));var M=0,E=0;i&&t.includeUnderlays&&(M=e.pstyle("underlay-opacity").value,M!==0&&(E=e.pstyle("underlay-padding").value));var O=Math.max(C,E),D=0,I=0;if(i&&(D=e.pstyle("width").pfValue,I=D/2),l&&t.includeNodes){var k=e.position();m=k.x,x=k.y;var U=e.outerWidth(),V=U/2,X=e.outerHeight(),W=X/2;h=m-V,d=m+V,v=x-W,g=x+W,Oa(s,h,v,d,g),i&&F8(s,e),i&&t.includeOutlines&&!a&&F8(s,e),i&&TH(s,e)}else if(c&&t.includeEdges)if(i&&!a){var P=e.pstyle("curve-style").strValue;if(h=Math.min(y.srcX,y.midX,y.tgtX),d=Math.max(y.srcX,y.midX,y.tgtX),v=Math.min(y.srcY,y.midY,y.tgtY),g=Math.max(y.srcY,y.midY,y.tgtY),h-=I,d+=I,v-=I,g+=I,Oa(s,h,v,d,g),P==="haystack"){var H=y.haystackPts;if(H&&H.length===2){if(h=H[0].x,v=H[0].y,d=H[1].x,g=H[1].y,h>d){var z=h;h=d,d=z}if(v>g){var $=v;v=g,g=$}Oa(s,h-I,v-I,d+I,g+I)}}else if(P==="bezier"||P==="unbundled-bezier"||Bo(P,"segments")||Bo(P,"taxi")){var B;switch(P){case"bezier":case"unbundled-bezier":B=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":B=y.linePts;break}if(B!=null)for(var L=0;L<B.length;L++){var Y=B[L];h=Y.x-I,d=Y.x+I,v=Y.y-I,g=Y.y+I,Oa(s,h,v,d,g)}}}else{var G=e.source(),re=G.position(),ie=e.target(),le=ie.position();if(h=re.x,d=le.x,v=re.y,g=le.y,h>d){var ce=h;h=d,d=ce}if(v>g){var _e=v;v=g,g=_e}h-=I,d+=I,v-=I,g+=I,Oa(s,h,v,d,g)}if(i&&t.includeEdges&&c&&(lv(s,e,"mid-source"),lv(s,e,"mid-target"),lv(s,e,"source"),lv(s,e,"target")),i){var pe=e.pstyle("ghost").value==="yes";if(pe){var ae=e.pstyle("ghost-offset-x").pfValue,oe=e.pstyle("ghost-offset-y").pfValue;Oa(s,s.x1+ae,s.y1+oe,s.x2+ae,s.y2+oe)}}var de=o.bodyBounds=o.bodyBounds||{};S6(de,s),rp(de,_),tp(de,1),i&&(h=s.x1,d=s.x2,v=s.y1,g=s.y2,Oa(s,h-O,v-O,d+O,g+O));var ye=o.overlayBounds=o.overlayBounds||{};S6(ye,s),rp(ye,_),tp(ye,1);var Ee=o.labelBounds=o.labelBounds||{};Ee.all!=null?oU(Ee.all):Ee.all=di(),i&&t.includeLabels&&(t.includeMainLabels&&P2(s,e,null),c&&(t.includeSourceLabels&&P2(s,e,"source"),t.includeTargetLabels&&P2(s,e,"target")))}return s.x1=ca(s.x1),s.y1=ca(s.y1),s.x2=ca(s.x2),s.y2=ca(s.y2),s.w=ca(s.x2-s.x1),s.h=ca(s.y2-s.y1),s.w>0&&s.h>0&&S&&(rp(s,_),tp(s,1)),s},TR=function(e){var t=0,n=function(s){return(s?1:0)<<t++},i=0;return i+=n(e.incudeNodes),i+=n(e.includeEdges),i+=n(e.includeLabels),i+=n(e.includeMainLabels),i+=n(e.includeSourceLabels),i+=n(e.includeTargetLabels),i+=n(e.includeOverlays),i+=n(e.includeOutlines),i},CR=function(e){var t=function(o){return Math.round(o)};if(e.isEdge()){var n=e.source().position(),i=e.target().position();return m6([t(n.x),t(n.y),t(i.x),t(i.y)])}else{var a=e.position();return m6([t(a.x),t(a.y)])}},z8=function(e,t){var n=e._private,i,a=e.isEdge(),s=t==null?U8:TR(t),o=s===U8;if(n.bbCache==null?(i=CH(e,ed),n.bbCache=i,n.bbCachePosKey=CR(e)):i=n.bbCache,!o){var l=e.isNode();i=di(),(t.includeNodes&&l||t.includeEdges&&!l)&&(t.includeOverlays?Lo(i,n.overlayBounds):Lo(i,n.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!a||t.includeSourceLabels&&t.includeTargetLabels)?Lo(i,n.labelBounds.all):(t.includeMainLabels&&Lo(i,n.labelBounds.mainRot),t.includeSourceLabels&&Lo(i,n.labelBounds.sourceRot),t.includeTargetLabels&&Lo(i,n.labelBounds.targetRot))),i.w=i.x2-i.x1,i.h=i.y2-i.y1}return i},ed={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},U8=TR(ed),G8=$n(ed);dl.boundingBox=function(r){var e,t=r===void 0||r.useCache===void 0||r.useCache===!0,n=Fc(function(h){var d=h._private;return d.bbCache==null||d.styleDirty||d.bbCachePosKey!==CR(h)},function(h){return h.id()});if(t&&this.length===1&&!n(this[0]))r===void 0?r=ed:r=G8(r),e=z8(this[0],r);else{e=di(),r=r||ed;var i=G8(r),a=this,s=a.cy(),o=s.styleEnabled();this.edges().forEach(n),this.nodes().forEach(n),o&&this.recalculateRenderedStyle(t),this.updateCompoundBounds(!t);for(var l=0;l<a.length;l++){var c=a[l];n(c)&&c.dirtyBoundingBoxCache(),Lo(e,z8(c,i))}}return e.x1=ca(e.x1),e.y1=ca(e.y1),e.x2=ca(e.x2),e.y2=ca(e.y2),e.w=ca(e.x2-e.x1),e.h=ca(e.y2-e.y1),e};dl.dirtyBoundingBoxCache=function(){for(var r=0;r<this.length;r++){var e=this[r]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this};dl.boundingBoxAt=function(r){var e=this.nodes(),t=this.cy(),n=t.hasCompoundNodes(),i=t.collection();if(n&&(i=e.filter(function(c){return c.isParent()}),e=e.not(i)),Zt(r)){var a=r;r=function(){return a}}var s=function(h,d){return h._private.bbAtOldPos=r(h,d)},o=function(h){return h._private.bbAtOldPos};t.startBatch(),e.forEach(s).silentPositions(r),n&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0));var l=sU(this.boundingBox({useCache:!1}));return e.silentPositions(o),n&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0)),t.endBatch(),l};Dc.boundingbox=Dc.bb=Dc.boundingBox;Dc.renderedBoundingbox=Dc.renderedBoundingBox;var AH=dl,Mf,Dd;Mf=Dd={};var AR=function(e){e.uppercaseName=r6(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=r6(e.outerName),Mf[e.name]=function(){var n=this[0],i=n._private,a=i.cy,s=a._private.styleEnabled;if(n)if(s){if(n.isParent())return n.updateCompoundBounds(),i[e.autoName]||0;var o=n.pstyle(e.name);switch(o.strValue){case"label":return n.recalculateRenderedStyle(),i.rstyle[e.labelName]||0;default:return o.pfValue}}else return 1},Mf["outer"+e.uppercaseName]=function(){var n=this[0],i=n._private,a=i.cy,s=a._private.styleEnabled;if(n)if(s){var o=n[e.name](),l=n.pstyle("border-position").value,c;l==="center"?c=n.pstyle("border-width").pfValue:l==="outside"?c=2*n.pstyle("border-width").pfValue:c=0;var h=2*n.padding();return o+c+h}else return 1},Mf["rendered"+e.uppercaseName]=function(){var n=this[0];if(n){var i=n[e.name]();return i*this.cy().zoom()}},Mf["rendered"+e.uppercaseOuterName]=function(){var n=this[0];if(n){var i=n[e.outerName]();return i*this.cy().zoom()}}};AR({name:"width"});AR({name:"height"});Dd.padding=function(){var r=this[0],e=r._private;return r.isParent()?(r.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:r.pstyle("padding").pfValue):r.pstyle("padding").pfValue};Dd.paddedHeight=function(){var r=this[0];return r.height()+2*r.padding()};Dd.paddedWidth=function(){var r=this[0];return r.width()+2*r.padding()};var MH=Dd,RH=function(e,t){if(e.isEdge()&&e.takesUpSpace())return t(e)},OH=function(e,t){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy();return sg(t(e),n.zoom(),n.pan())}},DH=function(e,t){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy(),i=n.pan(),a=n.zoom();return t(e).map(function(s){return sg(s,a,i)})}},PH=function(e){return e.renderer().getControlPoints(e)},IH=function(e){return e.renderer().getSegmentPoints(e)},NH=function(e){return e.renderer().getSourceEndpoint(e)},LH=function(e){return e.renderer().getTargetEndpoint(e)},kH=function(e){return e.renderer().getEdgeMidpoint(e)},H8={controlPoints:{get:PH,mult:!0},segmentPoints:{get:IH,mult:!0},sourceEndpoint:{get:NH},targetEndpoint:{get:LH},midpoint:{get:kH}},BH=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},FH=Object.keys(H8).reduce(function(r,e){var t=H8[e],n=BH(e);return r[e]=function(){return RH(this,t.get)},t.mult?r[n]=function(){return DH(this,t.get)}:r[n]=function(){return OH(this,t.get)},r},{}),zH=Ct({},EH,AH,MH,FH);/*!
  84. Event object based on jQuery events, MIT license
  85. https://jquery.org/license/
  86. https://tldrlegal.com/license/mit-license
  87. https://github.com/jquery/jquery/blob/master/src/event.js
  88. */var MR=function(e,t){this.recycle(e,t)};function lf(){return!1}function uv(){return!0}MR.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=lf,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?uv:lf):e!=null&&e.type?t=e:this.type=e,t!=null&&(this.originalEvent=t.originalEvent,this.type=t.type!=null?t.type:this.type,this.cy=t.cy,this.target=t.target,this.position=t.position,this.renderedPosition=t.renderedPosition,this.namespace=t.namespace,this.layout=t.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,i=this.cy.zoom(),a=this.cy.pan();this.renderedPosition={x:n.x*i+a.x,y:n.y*i+a.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=uv;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=uv;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=uv,this.stopPropagation()},isDefaultPrevented:lf,isPropagationStopped:lf,isImmediatePropagationStopped:lf};var RR=/^([^.]+)(\.(?:[^.]+))?$/,UH=".*",OR={qualifierCompare:function(e,t){return e===t},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},j8=Object.keys(OR),GH={};function dg(){for(var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:GH,e=arguments.length>1?arguments[1]:void 0,t=0;t<j8.length;t++){var n=j8[t];this[n]=r[n]||OR[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var el=dg.prototype,DR=function(e,t,n,i,a,s,o){en(i)&&(a=i,i=null),o&&(s==null?s=o:s=Ct({},s,o));for(var l=Cr(n)?n:n.split(/\s+/),c=0;c<l.length;c++){var h=l[c];if(!$o(h)){var d=h.match(RR);if(d){var v=d[1],g=d[2]?d[2]:null,m=t(e,h,v,g,i,a,s);if(m===!1)break}}}},V8=function(e,t){return e.addEventFields(e.context,t),new MR(t.type,t)},HH=function(e,t,n){if(WF(n)){t(e,n);return}else if(Zt(n)){t(e,V8(e,n));return}for(var i=Cr(n)?n:n.split(/\s+/),a=0;a<i.length;a++){var s=i[a];if(!$o(s)){var o=s.match(RR);if(o){var l=o[1],c=o[2]?o[2]:null,h=V8(e,{type:l,namespace:c,target:e.context});t(e,h)}}}};el.on=el.addListener=function(r,e,t,n,i){return DR(this,function(a,s,o,l,c,h,d){en(h)&&a.listeners.push({event:s,callback:h,type:o,namespace:l,qualifier:c,conf:d})},r,e,t,n,i),this};el.one=function(r,e,t,n){return this.on(r,e,t,n,{one:!0})};el.removeListener=el.off=function(r,e,t,n){var i=this;this.emitting!==0&&(this.listeners=Oz(this.listeners));for(var a=this.listeners,s=function(c){var h=a[c];DR(i,function(d,v,g,m,x,y){if((h.type===g||r==="*")&&(!m&&h.namespace!==".*"||h.namespace===m)&&(!x||d.qualifierCompare(h.qualifier,x))&&(!y||h.callback===y))return a.splice(c,1),!1},r,e,t,n)},o=a.length-1;o>=0;o--)s(o);return this};el.removeAllListeners=function(){return this.removeListener("*")};el.emit=el.trigger=function(r,e,t){var n=this.listeners,i=n.length;return this.emitting++,Cr(e)||(e=[e]),HH(this,function(a,s){t!=null&&(n=[{event:s.event,type:s.type,namespace:s.namespace,callback:t}],i=n.length);for(var o=function(){var h=n[l];if(h.type===s.type&&(!h.namespace||h.namespace===s.namespace||h.namespace===UH)&&a.eventMatches(a.context,h,s)){var d=[s];e!=null&&Pz(d,e),a.beforeEmit(a.context,h,s),h.conf&&h.conf.one&&(a.listeners=a.listeners.filter(function(m){return m!==h}));var v=a.callbackContext(a.context,h,s),g=h.callback.apply(v,d);a.afterEmit(a.context,h,s),g===!1&&(s.stopPropagation(),s.preventDefault())}},l=0;l<i;l++)o();a.bubble(a.context)&&!s.isPropagationStopped()&&a.parent(a.context).emit(s,e)},r),this.emitting--,this};var jH={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,n){var i=t.qualifier;return i!=null?e!==n.target&&Td(n.target)&&i.matches(n.target):!0},addEventFields:function(e,t){t.cy=e.cy(),t.target=e},callbackContext:function(e,t,n){return t.qualifier!=null?n.target:e},beforeEmit:function(e,t){t.conf&&t.conf.once&&t.conf.onceCollection.removeListener(t.event,t.qualifier,t.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},cv=function(e){return xt(e)?new Qo(e):e},PR={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||(n.emitter=new dg(jH,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var i=cv(t),a=0;a<this.length;a++){var s=this[a];s.emitter().on(e,i,n)}return this},removeListener:function(e,t,n){for(var i=cv(t),a=0;a<this.length;a++){var s=this[a];s.emitter().removeListener(e,i,n)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var t=this[e];t.emitter().removeAllListeners()}return this},one:function(e,t,n){for(var i=cv(t),a=0;a<this.length;a++){var s=this[a];s.emitter().one(e,i,n)}return this},once:function(e,t,n){for(var i=cv(t),a=0;a<this.length;a++){var s=this[a];s.emitter().on(e,i,n,{once:!0,onceCollection:this})}},emit:function(e,t){for(var n=0;n<this.length;n++){var i=this[n];i.emitter().emit(e,t)}return this},emitAndNotify:function(e,t){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,t),this}};hr.eventAliasesOn(PR);var IR={nodes:function(e){return this.filter(function(t){return t.isNode()}).filter(e)},edges:function(e){return this.filter(function(t){return t.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),t=this.spawn(),n=0;n<this.length;n++){var i=this[n];i.isNode()?e.push(i):t.push(i)}return{nodes:e,edges:t}},filter:function(e,t){if(e===void 0)return this;if(xt(e)||qi(e))return new Qo(e).filter(this);if(en(e)){for(var n=this.spawn(),i=this,a=0;a<i.length;a++){var s=i[a],o=t?e.apply(t,[s,a,i]):e(s,a,i);o&&n.push(s)}return n}return this.spawn()},not:function(e){if(e){xt(e)&&(e=this.filter(e));for(var t=this.spawn(),n=0;n<this.length;n++){var i=this[n],a=e.has(i);a||t.push(i)}return t}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(xt(e)){var t=e;return this.filter(t)}for(var n=this.spawn(),i=this,a=e,s=this.length<e.length,o=s?i:a,l=s?a:i,c=0;c<o.length;c++){var h=o[c];l.has(h)&&n.push(h)}return n},xor:function(e){var t=this._private.cy;xt(e)&&(e=t.$(e));var n=this.spawn(),i=this,a=e,s=function(l,c){for(var h=0;h<l.length;h++){var d=l[h],v=d._private.data.id,g=c.hasElementWithId(v);g||n.push(d)}};return s(i,a),s(a,i),n},diff:function(e){var t=this._private.cy;xt(e)&&(e=t.$(e));var n=this.spawn(),i=this.spawn(),a=this.spawn(),s=this,o=e,l=function(h,d,v){for(var g=0;g<h.length;g++){var m=h[g],x=m._private.data.id,y=d.hasElementWithId(x);y?a.merge(m):v.push(m)}};return l(s,o,n),l(o,s,i),{left:n,right:i,both:a}},add:function(e){var t=this._private.cy;if(!e)return this;if(xt(e)){var n=e;e=t.mutableElements().filter(n)}for(var i=this.spawnSelf(),a=0;a<e.length;a++){var s=e[a],o=!this.has(s);o&&i.push(s)}return i},merge:function(e){var t=this._private,n=t.cy;if(!e)return this;if(e&&xt(e)){var i=e;e=n.mutableElements().filter(i)}for(var a=t.map,s=0;s<e.length;s++){var o=e[s],l=o._private.data.id,c=!a.has(l);if(c){var h=this.length++;this[h]=o,a.set(l,{ele:o,index:h})}}return this},unmergeAt:function(e){var t=this[e],n=t.id(),i=this._private,a=i.map;this[e]=void 0,a.delete(n);var s=e===this.length-1;if(this.length>1&&!s){var o=this.length-1,l=this[o],c=l._private.data.id;this[o]=void 0,this[e]=l,a.set(c,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,i=t.map,a=i.get(n);if(!a)return this;var s=a.index;return this.unmergeAt(s),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&xt(e)){var n=e;e=t.mutableElements().filter(n)}for(var i=0;i<e.length;i++)this.unmergeOne(e[i]);return this},unmergeBy:function(e){for(var t=this.length-1;t>=0;t--){var n=this[t];e(n)&&this.unmergeAt(t)}return this},map:function(e,t){for(var n=[],i=this,a=0;a<i.length;a++){var s=i[a],o=t?e.apply(t,[s,a,i]):e(s,a,i);n.push(o)}return n},reduce:function(e,t){for(var n=t,i=this,a=0;a<i.length;a++)n=e(n,i[a],a,i);return n},max:function(e,t){for(var n=-1/0,i,a=this,s=0;s<a.length;s++){var o=a[s],l=t?e.apply(t,[o,s,a]):e(o,s,a);l>n&&(n=l,i=o)}return{value:n,ele:i}},min:function(e,t){for(var n=1/0,i,a=this,s=0;s<a.length;s++){var o=a[s],l=t?e.apply(t,[o,s,a]):e(o,s,a);l<n&&(n=l,i=o)}return{value:n,ele:i}}},tr=IR;tr.u=tr["|"]=tr["+"]=tr.union=tr.or=tr.add;tr["\\"]=tr["!"]=tr["-"]=tr.difference=tr.relativeComplement=tr.subtract=tr.not;tr.n=tr["&"]=tr["."]=tr.and=tr.intersection=tr.intersect;tr["^"]=tr["(+)"]=tr["(-)"]=tr.symmetricDifference=tr.symdiff=tr.xor;tr.fnFilter=tr.filterFn=tr.stdFilter=tr.filter;tr.complement=tr.abscomp=tr.absoluteComplement;var VH={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},NR=function(e,t){var n=e.cy(),i=n.hasCompoundNodes();function a(h){var d=h.pstyle("z-compound-depth");return d.value==="auto"?i?h.zDepth():0:d.value==="bottom"?-1:d.value==="top"?W_:0}var s=a(e)-a(t);if(s!==0)return s;function o(h){var d=h.pstyle("z-index-compare");return d.value==="auto"&&h.isNode()?1:0}var l=o(e)-o(t);if(l!==0)return l;var c=e.pstyle("z-index").value-t.pstyle("z-index").value;return c!==0?c:e.poolIndex()-t.poolIndex()},Pp={forEach:function(e,t){if(en(e))for(var n=this.length,i=0;i<n;i++){var a=this[i],s=t?e.apply(t,[a,i,this]):e(a,i,this);if(s===!1)break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(e,t){var n=[],i=this.length;t==null&&(t=i),e==null&&(e=0),e<0&&(e=i+e),t<0&&(t=i+t);for(var a=e;a>=0&&a<t&&a<i;a++)n.push(this[a]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!en(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(NR)},zDepth:function(){var e=this[0];if(e){var t=e._private,n=t.group;if(n==="nodes"){var i=t.data.parent?e.parents().size():0;return e.isParent()?i:W_-1}else{var a=t.source,s=t.target,o=a.zDepth(),l=s.zDepth();return Math.max(o,l,0)}}}};Pp.each=Pp.forEach;var qH=function(){var e="undefined",t=(typeof Symbol>"u"?"undefined":On(Symbol))!=e&&On(Symbol.iterator)!=e;t&&(Pp[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},a=0,s=this.length;return P9({next:function(){return a<s?i.value=n[a++]:(i.value=void 0,i.done=!0),i}},Symbol.iterator,function(){return this})})};qH();var XH=$n({nodeDimensionsIncludeLabels:!1}),ip={layoutDimensions:function(e){e=XH(e);var t;if(!this.takesUpSpace())t={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();t={w:n.w,h:n.h}}else t={w:this.outerWidth(),h:this.outerHeight()};return(t.w===0||t.h===0)&&(t.w=t.h=1),t},layoutPositions:function(e,t,n){var i=this.nodes().filter(function(C){return!C.isParent()}),a=this.cy(),s=t.eles,o=function(M){return M.id()},l=Fc(n,o);e.emit({type:"layoutstart",layout:e}),e.animations=[];var c=function(M,E,O){var D={x:E.x1+E.w/2,y:E.y1+E.h/2},I={x:(O.x-D.x)*M,y:(O.y-D.y)*M};return{x:D.x+I.x,y:D.y+I.y}},h=t.spacingFactor&&t.spacingFactor!==1,d=function(){if(!h)return null;for(var M=di(),E=0;E<i.length;E++){var O=i[E],D=l(O,E);Q9(M,D.x,D.y)}return M},v=d(),g=Fc(function(C,M){var E=l(C,M);if(h){var O=Math.abs(t.spacingFactor);E=c(O,v,E)}return t.transform!=null&&(E=t.transform(C,E)),E},o);if(t.animate){for(var m=0;m<i.length;m++){var x=i[m],y=g(x,m),_=t.animateFilter==null||t.animateFilter(x,m);if(_){var w=x.animation({position:y,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(w)}else x.position(y)}if(t.fit){var S=a.animation({fit:{boundingBox:s.boundingBoxAt(g),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(S)}else if(t.zoom!==void 0&&t.pan!==void 0){var A=a.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(A)}e.animations.forEach(function(C){return C.play()}),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),Jc.all(e.animations.map(function(C){return C.promise()})).then(function(){e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e})})}else i.positions(g),t.fit&&a.fit(t.eles,t.padding),t.zoom!=null&&a.zoom(t.zoom),t.pan&&a.pan(t.pan),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var t=this.cy();return t.makeLayout(Ct({},e,{eles:this}))}};ip.createLayout=ip.makeLayout=ip.layout;function LR(r,e,t){var n=t._private,i=n.styleCache=n.styleCache||[],a;return(a=i[r])!=null||(a=i[r]=e(t)),a}function vg(r,e){return r=cu(r),function(n){return LR(r,e,n)}}function pg(r,e){r=cu(r);var t=function(i){return e.call(i)};return function(){var i=this[0];if(i)return LR(r,t,i)}}var Yn={recalculateRenderedStyle:function(e){var t=this.cy(),n=t.renderer(),i=t.styleEnabled();return n&&i&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),t=function(a){return a._private.styleCache=null};if(e.hasCompoundNodes()){var n;n=this.spawnSelf().merge(this.descendants()).merge(this.parents()),n.merge(n.connectedEdges()),n.forEach(t)}else this.forEach(function(i){t(i),i.connectedEdges().forEach(t)});return this},updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t.batching()){var n=t._private.batchStyleEles;return n.merge(this),this}var i=t.hasCompoundNodes(),a=this;e=!!(e||e===void 0),i&&(a=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var s=a;return e?s.emitAndNotify("style"):s.emit("style"),a.forEach(function(o){return o._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var t=0;t<this.length;t++){var n=this[t];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],i=n.cy();if(i.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,i.style().apply(n));var a=n._private.style[e];return a??(t?i.style().getDefaultProperty(e):null)}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled()&&t)return t.pstyle(e).units},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];if(n)return t.style().getRenderedStyle(n,e)},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var i=!1,a=n.style();if(Zt(e)){var s=e;a.applyBypass(this,s,i),this.emitAndNotify("style")}else if(xt(e))if(t===void 0){var o=this[0];return o?a.getStylePropertyValue(o,e):void 0}else a.applyBypass(this,e,t,i),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?a.getRawStyle(l):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=!1,i=t.style(),a=this;if(e===void 0)for(var s=0;s<a.length;s++){var o=a[s];i.removeAllBypasses(o,n)}else{e=e.split(/\s+/);for(var l=0;l<a.length;l++){var c=a[l];i.removeBypasses(c,e,n)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var t=e.hasCompoundNodes(),n=this[0];if(n){var i=n._private,a=n.pstyle("opacity").value;if(!t)return a;var s=i.data.parent?n.parents():null;if(s)for(var o=0;o<s.length;o++){var l=s[o],c=l.pstyle("opacity").value;a=c*a}return a}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var t=this[0],n=t.cy().hasCompoundNodes();if(t)return n?t.effectiveOpacity()===0:t.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var t=this[0];return!!t._private.backgrounding}};function I2(r,e){var t=r._private,n=t.data.parent?r.parents():null;if(n)for(var i=0;i<n.length;i++){var a=n[i];if(!e(a))return!1}return!0}function sw(r){var e=r.ok,t=r.edgeOkViaNode||r.ok,n=r.parentOk||r.ok;return function(){var i=this.cy();if(!i.styleEnabled())return!0;var a=this[0],s=i.hasCompoundNodes();if(a){var o=a._private;if(!e(a))return!1;if(a.isNode())return!s||I2(a,n);var l=o.source,c=o.target;return t(l)&&(!s||I2(l,t))&&(l===c||t(c)&&(!s||I2(c,t)))}}}var eh=vg("eleTakesUpSpace",function(r){return r.pstyle("display").value==="element"&&r.width()!==0&&(r.isNode()?r.height()!==0:!0)});Yn.takesUpSpace=pg("takesUpSpace",sw({ok:eh}));var YH=vg("eleInteractive",function(r){return r.pstyle("events").value==="yes"&&r.pstyle("visibility").value==="visible"&&eh(r)}),WH=vg("parentInteractive",function(r){return r.pstyle("visibility").value==="visible"&&eh(r)});Yn.interactive=pg("interactive",sw({ok:YH,parentOk:WH,edgeOkViaNode:eh}));Yn.noninteractive=function(){var r=this[0];if(r)return!r.interactive()};var $H=vg("eleVisible",function(r){return r.pstyle("visibility").value==="visible"&&r.pstyle("opacity").pfValue!==0&&eh(r)}),KH=eh;Yn.visible=pg("visible",sw({ok:$H,edgeOkViaNode:KH}));Yn.hidden=function(){var r=this[0];if(r)return!r.visible()};Yn.isBundledBezier=pg("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});Yn.bypass=Yn.css=Yn.style;Yn.renderedCss=Yn.renderedStyle;Yn.removeBypass=Yn.removeCss=Yn.removeStyle;Yn.pstyle=Yn.parsedStyle;var qo={};function q8(r){return function(){var e=arguments,t=[];if(e.length===2){var n=e[0],i=e[1];this.on(r.event,n,i)}else if(e.length===1&&en(e[0])){var a=e[0];this.on(r.event,a)}else if(e.length===0||e.length===1&&Cr(e[0])){for(var s=e.length===1?e[0]:null,o=0;o<this.length;o++){var l=this[o],c=!r.ableField||l._private[r.ableField],h=l._private[r.field]!=r.value;if(r.overrideAble){var d=r.overrideAble(l);if(d!==void 0&&(c=d,!d))return this}c&&(l._private[r.field]=r.value,h&&t.push(l))}var v=this.spawn(t);v.updateStyle(),v.emit(r.event),s&&v.emit(s)}return this}}function th(r){qo[r.field]=function(){var e=this[0];if(e){if(r.overrideField){var t=r.overrideField(e);if(t!==void 0)return t}return e._private[r.field]}},qo[r.on]=q8({event:r.on,field:r.field,ableField:r.ableField,overrideAble:r.overrideAble,value:!0}),qo[r.off]=q8({event:r.off,field:r.field,ableField:r.ableField,overrideAble:r.overrideAble,value:!1})}th({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});th({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});th({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});th({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});qo.deselect=qo.unselect;qo.grabbed=function(){var r=this[0];if(r)return r._private.grabbed};th({field:"active",on:"activate",off:"unactivate"});th({field:"pannable",on:"panify",off:"unpanify"});qo.inactive=function(){var r=this[0];if(r)return!r._private.active};var ri={},X8=function(e){return function(n){for(var i=this,a=[],s=0;s<i.length;s++){var o=i[s];if(o.isNode()){for(var l=!1,c=o.connectedEdges(),h=0;h<c.length;h++){var d=c[h],v=d.source(),g=d.target();if(e.noIncomingEdges&&g===o&&v!==o||e.noOutgoingEdges&&v===o&&g!==o){l=!0;break}}l||a.push(o)}}return this.spawn(a,!0).filter(n)}},Y8=function(e){return function(t){for(var n=this,i=[],a=0;a<n.length;a++){var s=n[a];if(s.isNode())for(var o=s.connectedEdges(),l=0;l<o.length;l++){var c=o[l],h=c.source(),d=c.target();e.outgoing&&h===s?(i.push(c),i.push(d)):e.incoming&&d===s&&(i.push(c),i.push(h))}}return this.spawn(i,!0).filter(t)}},W8=function(e){return function(t){for(var n=this,i=[],a={};;){var s=e.outgoing?n.outgoers():n.incomers();if(s.length===0)break;for(var o=!1,l=0;l<s.length;l++){var c=s[l],h=c.id();a[h]||(a[h]=!0,i.push(c),o=!0)}if(!o)break;n=s}return this.spawn(i,!0).filter(t)}};ri.clearTraversalCache=function(){for(var r=0;r<this.length;r++)this[r]._private.traversalCache=null};Ct(ri,{roots:X8({noIncomingEdges:!0}),leaves:X8({noOutgoingEdges:!0}),outgoers:va(Y8({outgoing:!0}),"outgoers"),successors:W8({outgoing:!0}),incomers:va(Y8({incoming:!0}),"incomers"),predecessors:W8({})});Ct(ri,{neighborhood:va(function(r){for(var e=[],t=this.nodes(),n=0;n<t.length;n++)for(var i=t[n],a=i.connectedEdges(),s=0;s<a.length;s++){var o=a[s],l=o.source(),c=o.target(),h=i===l?c:l;h.length>0&&e.push(h[0]),e.push(o[0])}return this.spawn(e,!0).filter(r)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});ri.neighbourhood=ri.neighborhood;ri.closedNeighbourhood=ri.closedNeighborhood;ri.openNeighbourhood=ri.openNeighborhood;Ct(ri,{source:va(function(e){var t=this[0],n;return t&&(n=t._private.source||t.cy().collection()),n&&e?n.filter(e):n},"source"),target:va(function(e){var t=this[0],n;return t&&(n=t._private.target||t.cy().collection()),n&&e?n.filter(e):n},"target"),sources:$8({attr:"source"}),targets:$8({attr:"target"})});function $8(r){return function(t){for(var n=[],i=0;i<this.length;i++){var a=this[i],s=a._private[r.attr];s&&n.push(s)}return this.spawn(n,!0).filter(t)}}Ct(ri,{edgesWith:va(K8(),"edgesWith"),edgesTo:va(K8({thisIsSrc:!0}),"edgesTo")});function K8(r){return function(t){var n=[],i=this._private.cy,a=r||{};xt(t)&&(t=i.$(t));for(var s=0;s<t.length;s++)for(var o=t[s]._private.edges,l=0;l<o.length;l++){var c=o[l],h=c._private.data,d=this.hasElementWithId(h.source)&&t.hasElementWithId(h.target),v=t.hasElementWithId(h.source)&&this.hasElementWithId(h.target),g=d||v;g&&((a.thisIsSrc||a.thisIsTgt)&&(a.thisIsSrc&&!d||a.thisIsTgt&&!v)||n.push(c))}return this.spawn(n,!0)}}Ct(ri,{connectedEdges:va(function(r){for(var e=[],t=this,n=0;n<t.length;n++){var i=t[n];if(i.isNode())for(var a=i._private.edges,s=0;s<a.length;s++){var o=a[s];e.push(o)}}return this.spawn(e,!0).filter(r)},"connectedEdges"),connectedNodes:va(function(r){for(var e=[],t=this,n=0;n<t.length;n++){var i=t[n];i.isEdge()&&(e.push(i.source()[0]),e.push(i.target()[0]))}return this.spawn(e,!0).filter(r)},"connectedNodes"),parallelEdges:va(Z8(),"parallelEdges"),codirectedEdges:va(Z8({codirected:!0}),"codirectedEdges")});function Z8(r){var e={codirected:!1};return r=Ct({},e,r),function(n){for(var i=[],a=this.edges(),s=r,o=0;o<a.length;o++)for(var l=a[o],c=l._private,h=c.source,d=h._private.data.id,v=c.data.target,g=h._private.edges,m=0;m<g.length;m++){var x=g[m],y=x._private.data,_=y.target,w=y.source,S=_===v&&w===d,A=d===_&&v===w;(s.codirected&&S||!s.codirected&&(S||A))&&i.push(x)}return this.spawn(i,!0).filter(n)}}Ct(ri,{components:function(e){var t=this,n=t.cy(),i=n.collection(),a=e==null?t.nodes():e.nodes(),s=[];e!=null&&a.empty()&&(a=e.sources());var o=function(h,d){i.merge(h),a.unmerge(h),d.merge(h)};if(a.empty())return t.spawn();var l=function(){var h=n.collection();s.push(h);var d=a[0];o(d,h),t.bfs({directed:!1,roots:d,visit:function(g){return o(g,h)}}),h.forEach(function(v){v.connectedEdges().forEach(function(g){t.has(g)&&h.has(g.source())&&h.has(g.target())&&h.merge(g)})})};do l();while(a.length>0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});ri.componentsOf=ri.components;var Wn=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){jr("A collection must have a reference to the core");return}var a=new zs,s=!1;if(!t)t=[];else if(t.length>0&&Zt(t[0])&&!Td(t[0])){s=!0;for(var o=[],l=new Qc,c=0,h=t.length;c<h;c++){var d=t[c];d.data==null&&(d.data={});var v=d.data;if(v.id==null)v.id=$9();else if(e.hasElementWithId(v.id)||l.has(v.id))continue;var g=new ag(e,d,!1);o.push(g),l.add(v.id)}t=o}this.length=0;for(var m=0,x=t.length;m<x;m++){var y=t[m][0];if(y!=null){var _=y._private.data.id;(!n||!a.has(_))&&(n&&a.set(_,{index:this.length,ele:y}),this[this.length]=y,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(w){this.lazyMap=w},rebuildMap:function(){for(var S=this.lazyMap=new zs,A=this.eles,C=0;C<A.length;C++){var M=A[C];S.set(M.id(),{index:C,ele:M})}}},n&&(this._private.map=a),s&&!i&&this.restore()},Pr=ag.prototype=Wn.prototype=Object.create(Array.prototype);Pr.instanceString=function(){return"collection"};Pr.spawn=function(r,e){return new Wn(this.cy(),r,e)};Pr.spawnSelf=function(){return this.spawn(this)};Pr.cy=function(){return this._private.cy};Pr.renderer=function(){return this._private.cy.renderer()};Pr.element=function(){return this[0]};Pr.collection=function(){return L9(this)?this:new Wn(this._private.cy,[this])};Pr.unique=function(){return new Wn(this._private.cy,this,!0)};Pr.hasElementWithId=function(r){return r=""+r,this._private.map.has(r)};Pr.getElementById=function(r){r=""+r;var e=this._private.cy,t=this._private.map.get(r);return t?t.ele:new Wn(e)};Pr.$id=Pr.getElementById;Pr.poolIndex=function(){var r=this._private.cy,e=r._private.elements,t=this[0]._private.data.id;return e._private.map.get(t).index};Pr.indexOf=function(r){var e=r[0]._private.data.id;return this._private.map.get(e).index};Pr.indexOfId=function(r){return r=""+r,this._private.map.get(r).index};Pr.json=function(r){var e=this.element(),t=this.cy();if(e==null&&r)return this;if(e!=null){var n=e._private;if(Zt(r)){if(t.startBatch(),r.data){e.data(r.data);var i=n.data;if(e.isEdge()){var a=!1,s={},o=r.data.source,l=r.data.target;o!=null&&o!=i.source&&(s.source=""+o,a=!0),l!=null&&l!=i.target&&(s.target=""+l,a=!0),a&&(e=e.move(s))}else{var c="parent"in r.data,h=r.data.parent;c&&(h!=null||i.parent!=null)&&h!=i.parent&&(h===void 0&&(h=null),h!=null&&(h=""+h),e=e.move({parent:h}))}}r.position&&e.position(r.position);var d=function(x,y,_){var w=r[x];w!=null&&w!==n[x]&&(w?e[y]():e[_]())};return d("removed","remove","restore"),d("selected","select","unselect"),d("selectable","selectify","unselectify"),d("locked","lock","unlock"),d("grabbable","grabify","ungrabify"),d("pannable","panify","unpanify"),r.classes!=null&&e.classes(r.classes),t.endBatch(),this}else if(r===void 0){var v={data:Ja(n.data),position:Ja(n.position),group:n.group,removed:n.removed,selected:n.selected,selectable:n.selectable,locked:n.locked,grabbable:n.grabbable,pannable:n.pannable,classes:null};v.classes="";var g=0;return n.classes.forEach(function(m){return v.classes+=g++===0?m:" "+m}),v}}};Pr.jsons=function(){for(var r=[],e=0;e<this.length;e++){var t=this[e],n=t.json();r.push(n)}return r};Pr.clone=function(){for(var r=this.cy(),e=[],t=0;t<this.length;t++){var n=this[t],i=n.json(),a=new ag(r,i,!1);e.push(a)}return new Wn(r,e)};Pr.copy=Pr.clone;Pr.restore=function(){for(var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,n=t.cy(),i=n._private,a=[],s=[],o,l=0,c=t.length;l<c;l++){var h=t[l];e&&!h.removed()||(h.isNode()?a.push(h):s.push(h))}o=a.concat(s);var d,v=function(){o.splice(d,1),d--};for(d=0;d<o.length;d++){var g=o[d],m=g._private,x=m.data;if(g.clearTraversalCache(),!(!e&&!m.removed)){if(x.id===void 0)x.id=$9();else if(ut(x.id))x.id=""+x.id;else if($o(x.id)||!xt(x.id)){jr("Can not create element with invalid string ID `"+x.id+"`"),v();continue}else if(n.hasElementWithId(x.id)){jr("Can not create second element with ID `"+x.id+"`"),v();continue}}var y=x.id;if(g.isNode()){var _=m.position;_.x==null&&(_.x=0),_.y==null&&(_.y=0)}if(g.isEdge()){for(var w=g,S=["source","target"],A=S.length,C=!1,M=0;M<A;M++){var E=S[M],O=x[E];ut(O)&&(O=x[E]=""+x[E]),O==null||O===""?(jr("Can not create edge `"+y+"` with unspecified "+E),C=!0):n.hasElementWithId(O)||(jr("Can not create edge `"+y+"` with nonexistent "+E+" `"+O+"`"),C=!0)}if(C){v();continue}var D=n.getElementById(x.source),I=n.getElementById(x.target);D.same(I)?D._private.edges.push(w):(D._private.edges.push(w),I._private.edges.push(w)),w._private.source=D,w._private.target=I}m.map=new zs,m.map.set(y,{ele:g,index:0}),m.removed=!1,e&&n.addToPool(g)}for(var k=0;k<a.length;k++){var U=a[k],V=U._private.data;ut(V.parent)&&(V.parent=""+V.parent);var X=V.parent,W=X!=null;if(W||U._private.parent){var P=U._private.parent?n.collection().merge(U._private.parent):n.getElementById(X);if(P.empty())V.parent=void 0;else if(P[0].removed())fr("Node added with missing parent, reference to parent removed"),V.parent=void 0,U._private.parent=null;else{for(var H=!1,z=P;!z.empty();){if(U.same(z)){H=!0,V.parent=void 0;break}z=z.parent()}H||(P[0]._private.children.push(U),U._private.parent=P[0],i.hasCompoundNodes=!0)}}}if(o.length>0){for(var $=o.length===t.length?t:new Wn(n,o),B=0;B<$.length;B++){var L=$[B];L.isNode()||(L.parallelEdges().clearTraversalCache(),L.source().clearTraversalCache(),L.target().clearTraversalCache())}var Y;i.hasCompoundNodes?Y=n.collection().merge($).merge($.connectedNodes()).merge($.parent()):Y=$,Y.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(r),r?$.emitAndNotify("add"):e&&$.emit("add")}return t};Pr.removed=function(){var r=this[0];return r&&r._private.removed};Pr.inside=function(){var r=this[0];return r&&!r._private.removed};Pr.remove=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,n=[],i={},a=t._private.cy;function s(X){for(var W=X._private.edges,P=0;P<W.length;P++)l(W[P])}function o(X){for(var W=X._private.children,P=0;P<W.length;P++)l(W[P])}function l(X){var W=i[X.id()];e&&X.removed()||W||(i[X.id()]=!0,X.isNode()?(n.push(X),s(X),o(X)):n.unshift(X))}for(var c=0,h=t.length;c<h;c++){var d=t[c];l(d)}function v(X,W){var P=X._private.edges;Ko(P,W),X.clearTraversalCache()}function g(X){X.clearTraversalCache()}var m=[];m.ids={};function x(X,W){W=W[0],X=X[0];var P=X._private.children,H=X.id();Ko(P,W),W._private.parent=null,m.ids[H]||(m.ids[H]=!0,m.push(X))}t.dirtyCompoundBoundsCache(),e&&a.removeFromPool(n);for(var y=0;y<n.length;y++){var _=n[y];if(_.isEdge()){var w=_.source()[0],S=_.target()[0];v(w,_),v(S,_);for(var A=_.parallelEdges(),C=0;C<A.length;C++){var M=A[C];g(M),M.isBundledBezier()&&M.dirtyBoundingBoxCache()}}else{var E=_.parent();E.length!==0&&x(E,_)}e&&(_._private.removed=!0)}var O=a._private.elements;a._private.hasCompoundNodes=!1;for(var D=0;D<O.length;D++){var I=O[D];if(I.isParent()){a._private.hasCompoundNodes=!0;break}}var k=new Wn(this.cy(),n);k.size()>0&&(r?k.emitAndNotify("remove"):e&&k.emit("remove"));for(var U=0;U<m.length;U++){var V=m[U];(!e||!V.removed())&&V.updateStyle()}return k};Pr.move=function(r){var e=this._private.cy,t=this,n=!1,i=!1,a=function(m){return m==null?m:""+m};if(r.source!==void 0||r.target!==void 0){var s=a(r.source),o=a(r.target),l=s!=null&&e.hasElementWithId(s),c=o!=null&&e.hasElementWithId(o);(l||c)&&(e.batch(function(){t.remove(n,i),t.emitAndNotify("moveout");for(var g=0;g<t.length;g++){var m=t[g],x=m._private.data;m.isEdge()&&(l&&(x.source=s),c&&(x.target=o))}t.restore(n,i)}),t.emitAndNotify("move"))}else if(r.parent!==void 0){var h=a(r.parent),d=h===null||e.hasElementWithId(h);if(d){var v=h===null?void 0:h;e.batch(function(){var g=t.remove(n,i);g.emitAndNotify("moveout");for(var m=0;m<t.length;m++){var x=t[m],y=x._private.data;x.isNode()&&(y.parent=v)}g.restore(n,i)}),t.emitAndNotify("move")}}return this};[oR,oH,np,Vo,Uc,SH,fg,zH,PR,IR,VH,Pp,ip,Yn,qo,ri].forEach(function(r){Ct(Pr,r)});var ZH={add:function(e){var t,n=this;if(qi(e)){var i=e;if(i._private.cy===n)t=i.restore();else{for(var a=[],s=0;s<i.length;s++){var o=i[s];a.push(o.json())}t=new Wn(n,a)}}else if(Cr(e)){var l=e;t=new Wn(n,l)}else if(Zt(e)&&(Cr(e.nodes)||Cr(e.edges))){for(var c=e,h=[],d=["nodes","edges"],v=0,g=d.length;v<g;v++){var m=d[v],x=c[m];if(Cr(x))for(var y=0,_=x.length;y<_;y++){var w=Ct({group:m},x[y]);h.push(w)}}t=new Wn(n,h)}else{var S=e;t=new ag(n,S).collection()}return t},remove:function(e){if(!qi(e)){if(xt(e)){var t=e;e=this.$(t)}}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function QH(r,e,t,n){var i=4,a=.001,s=1e-7,o=10,l=11,c=1/(l-1),h=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var d=0;d<4;++d)if(typeof arguments[d]!="number"||isNaN(arguments[d])||!isFinite(arguments[d]))return!1;r=Math.min(r,1),t=Math.min(t,1),r=Math.max(r,0),t=Math.max(t,0);var v=h?new Float32Array(l):new Array(l);function g(I,k){return 1-3*k+3*I}function m(I,k){return 3*k-6*I}function x(I){return 3*I}function y(I,k,U){return((g(k,U)*I+m(k,U))*I+x(k))*I}function _(I,k,U){return 3*g(k,U)*I*I+2*m(k,U)*I+x(k)}function w(I,k){for(var U=0;U<i;++U){var V=_(k,r,t);if(V===0)return k;var X=y(k,r,t)-I;k-=X/V}return k}function S(){for(var I=0;I<l;++I)v[I]=y(I*c,r,t)}function A(I,k,U){var V,X,W=0;do X=k+(U-k)/2,V=y(X,r,t)-I,V>0?U=X:k=X;while(Math.abs(V)>s&&++W<o);return X}function C(I){for(var k=0,U=1,V=l-1;U!==V&&v[U]<=I;++U)k+=c;--U;var X=(I-v[U])/(v[U+1]-v[U]),W=k+X*c,P=_(W,r,t);return P>=a?w(I,W):P===0?W:A(I,k,k+c)}var M=!1;function E(){M=!0,(r!==e||t!==n)&&S()}var O=function(k){return M||E(),r===e&&t===n?k:k===0?0:k===1?1:y(C(k),e,n)};O.getControlPoints=function(){return[{x:r,y:e},{x:t,y:n}]};var D="generateBezier("+[r,e,t,n]+")";return O.toString=function(){return D},O}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var JH=(function(){function r(n){return-n.tension*n.x-n.friction*n.v}function e(n,i,a){var s={x:n.x+a.dx*i,v:n.v+a.dv*i,tension:n.tension,friction:n.friction};return{dx:s.v,dv:r(s)}}function t(n,i){var a={dx:n.v,dv:r(n)},s=e(n,i*.5,a),o=e(n,i*.5,s),l=e(n,i,o),c=1/6*(a.dx+2*(s.dx+o.dx)+l.dx),h=1/6*(a.dv+2*(s.dv+o.dv)+l.dv);return n.x=n.x+c*i,n.v=n.v+h*i,n}return function n(i,a,s){var o={x:-1,v:0,tension:null,friction:null},l=[0],c=0,h=1/1e4,d=16/1e3,v,g,m;for(i=parseFloat(i)||500,a=parseFloat(a)||20,s=s||null,o.tension=i,o.friction=a,v=s!==null,v?(c=n(i,a),g=c/s*d):g=d;m=t(m||o,g),l.push(1+m.x),c+=16,Math.abs(m.x)>h&&Math.abs(m.v)>h;);return v?function(x){return l[x*(l.length-1)|0]}:c}})(),Rr=function(e,t,n,i){var a=QH(e,t,n,i);return function(s,o,l){return s+(o-s)*a(l)}},ap={linear:function(e,t,n){return e+(t-e)*n},ease:Rr(.25,.1,.25,1),"ease-in":Rr(.42,0,1,1),"ease-out":Rr(0,0,.58,1),"ease-in-out":Rr(.42,0,.58,1),"ease-in-sine":Rr(.47,0,.745,.715),"ease-out-sine":Rr(.39,.575,.565,1),"ease-in-out-sine":Rr(.445,.05,.55,.95),"ease-in-quad":Rr(.55,.085,.68,.53),"ease-out-quad":Rr(.25,.46,.45,.94),"ease-in-out-quad":Rr(.455,.03,.515,.955),"ease-in-cubic":Rr(.55,.055,.675,.19),"ease-out-cubic":Rr(.215,.61,.355,1),"ease-in-out-cubic":Rr(.645,.045,.355,1),"ease-in-quart":Rr(.895,.03,.685,.22),"ease-out-quart":Rr(.165,.84,.44,1),"ease-in-out-quart":Rr(.77,0,.175,1),"ease-in-quint":Rr(.755,.05,.855,.06),"ease-out-quint":Rr(.23,1,.32,1),"ease-in-out-quint":Rr(.86,0,.07,1),"ease-in-expo":Rr(.95,.05,.795,.035),"ease-out-expo":Rr(.19,1,.22,1),"ease-in-out-expo":Rr(1,0,0,1),"ease-in-circ":Rr(.6,.04,.98,.335),"ease-out-circ":Rr(.075,.82,.165,1),"ease-in-out-circ":Rr(.785,.135,.15,.86),spring:function(e,t,n){if(n===0)return ap.linear;var i=JH(e,t,n);return function(a,s,o){return a+(s-a)*i(o)}},"cubic-bezier":Rr};function Q8(r,e,t,n,i){if(n===1||e===t)return t;var a=i(e,t,n);return r==null||((r.roundValue||r.color)&&(a=Math.round(a)),r.min!==void 0&&(a=Math.max(a,r.min)),r.max!==void 0&&(a=Math.min(a,r.max))),a}function J8(r,e){return r.pfValue!=null||r.value!=null?r.pfValue!=null&&(e==null||e.type.units!=="%")?r.pfValue:r.value:r}function lc(r,e,t,n,i){var a=i!=null?i.type:null;t<0?t=0:t>1&&(t=1);var s=J8(r,i),o=J8(e,i);if(ut(s)&&ut(o))return Q8(a,s,o,t,n);if(Cr(s)&&Cr(o)){for(var l=[],c=0;c<o.length;c++){var h=s[c],d=o[c];if(h!=null&&d!=null){var v=Q8(a,h,d,t,n);l.push(v)}else l.push(d)}return l}}function ej(r,e,t,n){var i=!n,a=r._private,s=e._private,o=s.easing,l=s.startTime,c=n?r:r.cy(),h=c.style();if(!s.easingImpl)if(o==null)s.easingImpl=ap.linear;else{var d;if(xt(o)){var v=h.parse("transition-timing-function",o);d=v.value}else d=o;var g,m;xt(d)?(g=d,m=[]):(g=d[1],m=d.slice(2).map(function($){return+$})),m.length>0?(g==="spring"&&m.push(s.duration),s.easingImpl=ap[g].apply(null,m)):s.easingImpl=ap[g]}var x=s.easingImpl,y;if(s.duration===0?y=1:y=(t-l)/s.duration,s.applying&&(y=s.progress),y<0?y=0:y>1&&(y=1),s.delay==null){var _=s.startPosition,w=s.position;if(w&&i&&!r.locked()){var S={};uf(_.x,w.x)&&(S.x=lc(_.x,w.x,y,x)),uf(_.y,w.y)&&(S.y=lc(_.y,w.y,y,x)),r.position(S)}var A=s.startPan,C=s.pan,M=a.pan,E=C!=null&&n;E&&(uf(A.x,C.x)&&(M.x=lc(A.x,C.x,y,x)),uf(A.y,C.y)&&(M.y=lc(A.y,C.y,y,x)),r.emit("pan"));var O=s.startZoom,D=s.zoom,I=D!=null&&n;I&&(uf(O,D)&&(a.zoom=Zf(a.minZoom,lc(O,D,y,x),a.maxZoom)),r.emit("zoom")),(E||I)&&r.emit("viewport");var k=s.style;if(k&&k.length>0&&i){for(var U=0;U<k.length;U++){var V=k[U],X=V.name,W=V,P=s.startStyle[X],H=h.properties[P.name],z=lc(P,W,y,x,H);h.overrideBypass(r,X,z)}r.emit("style")}}return s.progress=y,y}function uf(r,e){return r==null||e==null?!1:ut(r)&&ut(e)?!0:!!(r&&e)}function tj(r,e,t,n){var i=e._private;i.started=!0,i.startTime=t-i.progress*i.duration}function e7(r,e){var t=e._private.aniEles,n=[];function i(h,d){var v=h._private,g=v.animation.current,m=v.animation.queue,x=!1;if(g.length===0){var y=m.shift();y&&g.push(y)}for(var _=function(M){for(var E=M.length-1;E>=0;E--){var O=M[E];O()}M.splice(0,M.length)},w=g.length-1;w>=0;w--){var S=g[w],A=S._private;if(A.stopped){g.splice(w,1),A.hooked=!1,A.playing=!1,A.started=!1,_(A.frames);continue}!A.playing&&!A.applying||(A.playing&&A.applying&&(A.applying=!1),A.started||tj(h,S,r),ej(h,S,r,d),A.applying&&(A.applying=!1),_(A.frames),A.step!=null&&A.step(r),S.completed()&&(g.splice(w,1),A.hooked=!1,A.playing=!1,A.started=!1,_(A.completes)),x=!0)}return!d&&g.length===0&&m.length===0&&n.push(h),x}for(var a=!1,s=0;s<t.length;s++){var o=t[s],l=i(o);a=a||l}var c=i(e,!0);(a||c)&&(t.length>0?e.notify("draw",t):e.notify("draw")),t.unmerge(n),e.emit("step")}var rj={animate:hr.animate(),animation:hr.animation(),animated:hr.animated(),clearQueue:hr.clearQueue(),delay:hr.delay(),delayAnimation:hr.delayAnimation(),stop:hr.stop(),addToAnimationPool:function(e){var t=this;t.styleEnabled()&&t._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function t(){e._private.animationsRunning&&Ap(function(a){e7(a,e),t()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(a,s){e7(s,e)},n.beforeRenderPriorities.animations):t()}},nj={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,n){var i=t.qualifier;return i!=null?e!==n.target&&Td(n.target)&&i.matches(n.target):!0},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return t.qualifier!=null?n.target:e}},hv=function(e){return xt(e)?new Qo(e):e},kR={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new dg(nj,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,hv(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,hv(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,hv(t),n),this},once:function(e,t,n){return this.emitter().one(e,hv(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};hr.eventAliasesOn(kR);var u4={png:function(e){var t=this._private.renderer;return e=e||{},t.png(e)},jpg:function(e){var t=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",t.jpg(e)}};u4.jpeg=u4.jpg;var sp={layout:function(e){var t=this;if(e==null){jr("Layout options must be specified to make a layout");return}if(e.name==null){jr("A `name` must be specified to make a layout");return}var n=e.name,i=t.extension("layout",n);if(i==null){jr("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var a;xt(e.eles)?a=t.$(e.eles):a=e.eles!=null?e.eles:t.$();var s=new i(Ct({},e,{cy:t,eles:a}));return s}};sp.createLayout=sp.makeLayout=sp.layout;var ij={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var i=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();t!=null&&i.merge(t);return}if(n.notificationsEnabled){var a=this.renderer();this.destroyed()||!a||a.notify(e,t)}},notifications:function(e){var t=this._private;return e===void 0?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var i=e.batchNotifications[n];i.empty()?t.notify(n):t.notify(n,i)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var n=Object.keys(e),i=0;i<n.length;i++){var a=n[i],s=e[a],o=t.getElementById(a);o.data(s)}})}},aj=$n({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),c4={renderTo:function(e,t,n,i){var a=this._private.renderer;return a.renderTo(e,t,n,i),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var t=this,n=t.extension("renderer",e.name);if(n==null){jr("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&fr("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var i=aj(e);i.cy=t,t._private.renderer=new n(i),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var t=e.container();if(t)for(t._cyreg=null;t.childNodes.length>0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var i=n._private;i.rscratch={},i.rstyle={},i.animation.current=[],i.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};c4.invalidateDimensions=c4.resize;var op={collection:function(e,t){return xt(e)?this.$(e):qi(e)?e.collection():Cr(e)?(t||(t={}),new Wn(this,e,t.unique,t.removed)):new Wn(this)},nodes:function(e){var t=this.$(function(n){return n.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(n){return n.isEdge()});return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};op.elements=op.filter=op.$;var Un={},Bf="t",sj="f";Un.apply=function(r){for(var e=this,t=e._private,n=t.cy,i=n.collection(),a=0;a<r.length;a++){var s=r[a],o=e.getContextMeta(s);if(!o.empty){var l=e.getContextStyle(o),c=e.applyContextStyle(o,l,s);s._private.appliedInitStyle?e.updateTransitions(s,c.diffProps):s._private.appliedInitStyle=!0;var h=e.updateStyleHints(s);h&&i.push(s)}}return i};Un.getPropertiesDiff=function(r,e){var t=this,n=t._private.propDiffs=t._private.propDiffs||{},i=r+"-"+e,a=n[i];if(a)return a;for(var s=[],o={},l=0;l<t.length;l++){var c=t[l],h=r[l]===Bf,d=e[l]===Bf,v=h!==d,g=c.mappedProperties.length>0;if(v||d&&g){var m=void 0;v&&g||v?m=c.properties:g&&(m=c.mappedProperties);for(var x=0;x<m.length;x++){for(var y=m[x],_=y.name,w=!1,S=l+1;S<t.length;S++){var A=t[S],C=e[S]===Bf;if(C&&(w=A.properties[y.name]!=null,w))break}!o[_]&&!w&&(o[_]=!0,s.push(_))}}}return n[i]=s,s};Un.getContextMeta=function(r){for(var e=this,t="",n,i=r._private.styleCxtKey||"",a=0;a<e.length;a++){var s=e[a],o=s.selector&&s.selector.matches(r);o?t+=Bf:t+=sj}return n=e.getPropertiesDiff(i,t),r._private.styleCxtKey=t,{key:t,diffPropNames:n,empty:n.length===0}};Un.getContextStyle=function(r){var e=r.key,t=this,n=this._private.contextStyles=this._private.contextStyles||{};if(n[e])return n[e];for(var i={_private:{key:e}},a=0;a<t.length;a++){var s=t[a],o=e[a]===Bf;if(o)for(var l=0;l<s.properties.length;l++){var c=s.properties[l];i[c.name]=c}}return n[e]=i,i};Un.applyContextStyle=function(r,e,t){for(var n=this,i=r.diffPropNames,a={},s=n.types,o=0;o<i.length;o++){var l=i[o],c=e[l],h=t.pstyle(l);if(!c)if(h)h.bypass?c={name:l,deleteBypassed:!0}:c={name:l,delete:!0};else continue;if(h!==c){if(c.mapped===s.fn&&h!=null&&h.mapping!=null&&h.mapping.value===c.value){var d=h.mapping,v=d.fnValue=c.value(t);if(v===d.prevFnValue)continue}var g=a[l]={prev:h};n.applyParsedProperty(t,c),g.next=t.pstyle(l),g.next&&g.next.bypass&&(g.next=g.next.bypassed)}}return{diffProps:a}};Un.updateStyleHints=function(r){var e=r._private,t=this,n=t.propertyGroupNames,i=t.propertyGroupKeys,a=function(de,ye,Ee){return t.getPropertiesHash(de,ye,Ee)},s=e.styleKey;if(r.removed())return!1;var o=e.group==="nodes",l=r._private.style;n=Object.keys(l);for(var c=0;c<i.length;c++){var h=i[c];e.styleKeys[h]=[nu,wc]}for(var d=function(de,ye){return e.styleKeys[ye][0]=Wf(de,e.styleKeys[ye][0])},v=function(de,ye){return e.styleKeys[ye][1]=$f(de,e.styleKeys[ye][1])},g=function(de,ye){d(de,ye),v(de,ye)},m=function(de,ye){for(var Ee=0;Ee<de.length;Ee++){var Re=de.charCodeAt(Ee);d(Re,ye),v(Re,ye)}},x=2e9,y=function(de){return-128<de&&de<128&&Math.floor(de)!==de?x-(de*1024|0):de},_=0;_<n.length;_++){var w=n[_],S=l[w];if(S!=null){var A=this.properties[w],C=A.type,M=A.groupKey,E=void 0;A.hashOverride!=null?E=A.hashOverride(r,S):S.pfValue!=null&&(E=S.pfValue);var O=A.enums==null?S.value:null,D=E!=null,I=O!=null,k=D||I,U=S.units;if(C.number&&k&&!C.multiple){var V=D?E:O;g(y(V),M),!D&&U!=null&&m(U,M)}else m(S.strValue,M)}}for(var X=[nu,wc],W=0;W<i.length;W++){var P=i[W],H=e.styleKeys[P];X[0]=Wf(H[0],X[0]),X[1]=$f(H[1],X[1])}e.styleKey=wz(X[0],X[1]);var z=e.styleKeys;e.labelDimsKey=Ao(z.labelDimensions);var $=a(r,["label"],z.labelDimensions);if(e.labelKey=Ao($),e.labelStyleKey=Ao(nv(z.commonLabel,$)),!o){var B=a(r,["source-label"],z.labelDimensions);e.sourceLabelKey=Ao(B),e.sourceLabelStyleKey=Ao(nv(z.commonLabel,B));var L=a(r,["target-label"],z.labelDimensions);e.targetLabelKey=Ao(L),e.targetLabelStyleKey=Ao(nv(z.commonLabel,L))}if(o){var Y=e.styleKeys,G=Y.nodeBody,re=Y.nodeBorder,ie=Y.nodeOutline,le=Y.backgroundImage,ce=Y.compound,_e=Y.pie,pe=Y.stripe,ae=[G,re,ie,le,ce,_e,pe].filter(function(oe){return oe!=null}).reduce(nv,[nu,wc]);e.nodeKey=Ao(ae),e.hasPie=_e!=null&&_e[0]!==nu&&_e[1]!==wc,e.hasStripe=pe!=null&&pe[0]!==nu&&pe[1]!==wc}return s!==e.styleKey};Un.clearStyleHints=function(r){var e=r._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null,e.hasStripe=null};Un.applyParsedProperty=function(r,e){var t=this,n=e,i=r._private.style,a,s=t.types,o=t.properties[n.name].type,l=n.bypass,c=i[n.name],h=c&&c.bypass,d=r._private,v="mapping",g=function(G){return G==null?null:G.pfValue!=null?G.pfValue:G.value},m=function(){var G=g(c),re=g(n);t.checkTriggers(r,n.name,G,re)};if(e.name==="curve-style"&&r.isEdge()&&(e.value!=="bezier"&&r.isLoop()||e.value==="haystack"&&(r.source().isParent()||r.target().isParent()))&&(n=e=this.parse(e.name,"bezier",l)),n.delete)return i[n.name]=void 0,m(),!0;if(n.deleteBypassed)return c?c.bypass?(c.bypassed=void 0,m(),!0):!1:(m(),!0);if(n.deleteBypass)return c?c.bypass?(i[n.name]=c.bypassed,m(),!0):!1:(m(),!0);var x=function(){fr("Do not assign mappings to elements without corresponding data (i.e. ele `"+r.id()+"` has no mapping for property `"+n.name+"` with data field `"+n.field+"`); try a `["+n.field+"]` selector to limit scope to elements with `"+n.field+"` defined")};switch(n.mapped){case s.mapData:{for(var y=n.field.split("."),_=d.data,w=0;w<y.length&&_;w++){var S=y[w];_=_[S]}if(_==null)return x(),!1;var A;if(ut(_)){var C=n.fieldMax-n.fieldMin;C===0?A=0:A=(_-n.fieldMin)/C}else return fr("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+_+"` for `"+r.id()+"` is non-numeric)"),!1;if(A<0?A=0:A>1&&(A=1),o.color){var M=n.valueMin[0],E=n.valueMax[0],O=n.valueMin[1],D=n.valueMax[1],I=n.valueMin[2],k=n.valueMax[2],U=n.valueMin[3]==null?1:n.valueMin[3],V=n.valueMax[3]==null?1:n.valueMax[3],X=[Math.round(M+(E-M)*A),Math.round(O+(D-O)*A),Math.round(I+(k-I)*A),Math.round(U+(V-U)*A)];a={bypass:n.bypass,name:n.name,value:X,strValue:"rgb("+X[0]+", "+X[1]+", "+X[2]+")"}}else if(o.number){var W=n.valueMin+(n.valueMax-n.valueMin)*A;a=this.parse(n.name,W,n.bypass,v)}else return!1;if(!a)return x(),!1;a.mapping=n,n=a;break}case s.data:{for(var P=n.field.split("."),H=d.data,z=0;z<P.length&&H;z++){var $=P[z];H=H[$]}if(H!=null&&(a=this.parse(n.name,H,n.bypass,v)),!a)return x(),!1;a.mapping=n,n=a;break}case s.fn:{var B=n.value,L=n.fnValue!=null?n.fnValue:B(r);if(n.prevFnValue=L,L==null)return fr("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+r.id()+"` is null)"),!1;if(a=this.parse(n.name,L,n.bypass,v),!a)return fr("Custom function mappers may not return invalid values for the property type (i.e. `"+n.name+"` for ele `"+r.id()+"` is invalid)"),!1;a.mapping=Ja(n),n=a;break}case void 0:break;default:return!1}return l?(h?n.bypassed=c.bypassed:n.bypassed=c,i[n.name]=n):h?c.bypassed=n:i[n.name]=n,m(),!0};Un.cleanElements=function(r,e){for(var t=0;t<r.length;t++){var n=r[t];if(this.clearStyleHints(n),n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),!e)n._private.style={};else for(var i=n._private.style,a=Object.keys(i),s=0;s<a.length;s++){var o=a[s],l=i[o];l!=null&&(l.bypass?l.bypassed=null:i[o]=null)}}};Un.update=function(){var r=this._private.cy,e=r.mutableElements();e.updateStyle()};Un.updateTransitions=function(r,e){var t=this,n=r._private,i=r.pstyle("transition-property").value,a=r.pstyle("transition-duration").pfValue,s=r.pstyle("transition-delay").pfValue;if(i.length>0&&a>0){for(var o={},l=!1,c=0;c<i.length;c++){var h=i[c],d=r.pstyle(h),v=e[h];if(v){var g=v.prev,m=g,x=v.next!=null?v.next:d,y=!1,_=void 0,w=1e-6;m&&(ut(m.pfValue)&&ut(x.pfValue)?(y=x.pfValue-m.pfValue,_=m.pfValue+w*y):ut(m.value)&&ut(x.value)?(y=x.value-m.value,_=m.value+w*y):Cr(m.value)&&Cr(x.value)&&(y=m.value[0]!==x.value[0]||m.value[1]!==x.value[1]||m.value[2]!==x.value[2],_=m.strValue),y&&(o[h]=x.strValue,this.applyBypass(r,h,_),l=!0))}}if(!l)return;n.transitioning=!0,new Jc(function(S){s>0?r.delayAnimation(s).play().promise().then(S):S()}).then(function(){return r.animation({style:o,duration:a,easing:r.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){t.removeBypasses(r,i),r.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(r,i),r.emitAndNotify("style"),n.transitioning=!1)};Un.checkTrigger=function(r,e,t,n,i,a){var s=this.properties[e],o=i(s);r.removed()||o!=null&&o(t,n,r)&&a(s)};Un.checkZOrderTrigger=function(r,e,t,n){var i=this;this.checkTrigger(r,e,t,n,function(a){return a.triggersZOrder},function(){i._private.cy.notify("zorder",r)})};Un.checkBoundsTrigger=function(r,e,t,n){this.checkTrigger(r,e,t,n,function(i){return i.triggersBounds},function(i){r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache()})};Un.checkConnectedEdgesBoundsTrigger=function(r,e,t,n){this.checkTrigger(r,e,t,n,function(i){return i.triggersBoundsOfConnectedEdges},function(i){r.connectedEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})};Un.checkParallelEdgesBoundsTrigger=function(r,e,t,n){this.checkTrigger(r,e,t,n,function(i){return i.triggersBoundsOfParallelEdges},function(i){r.parallelEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})};Un.checkTriggers=function(r,e,t,n){r.dirtyStyleCache(),this.checkZOrderTrigger(r,e,t,n),this.checkBoundsTrigger(r,e,t,n),this.checkConnectedEdgesBoundsTrigger(r,e,t,n),this.checkParallelEdgesBoundsTrigger(r,e,t,n)};var Pd={};Pd.applyBypass=function(r,e,t,n){var i=this,a=[],s=!0;if(e==="*"||e==="**"){if(t!==void 0)for(var o=0;o<i.properties.length;o++){var l=i.properties[o],c=l.name,h=this.parse(c,t,!0);h&&a.push(h)}}else if(xt(e)){var d=this.parse(e,t,!0);d&&a.push(d)}else if(Zt(e)){var v=e;n=t;for(var g=Object.keys(v),m=0;m<g.length;m++){var x=g[m],y=v[x];if(y===void 0&&(y=v[ng(x)]),y!==void 0){var _=this.parse(x,y,!0);_&&a.push(_)}}}else return!1;if(a.length===0)return!1;for(var w=!1,S=0;S<r.length;S++){for(var A=r[S],C={},M=void 0,E=0;E<a.length;E++){var O=a[E];if(n){var D=A.pstyle(O.name);M=C[O.name]={prev:D}}w=this.applyParsedProperty(A,Ja(O))||w,n&&(M.next=A.pstyle(O.name))}w&&this.updateStyleHints(A),n&&this.updateTransitions(A,C,s)}return w};Pd.overrideBypass=function(r,e,t){e=X_(e);for(var n=0;n<r.length;n++){var i=r[n],a=i._private.style[e],s=this.properties[e].type,o=s.color,l=s.mutiple,c=a?a.pfValue!=null?a.pfValue:a.value:null;!a||!a.bypass?this.applyBypass(i,e,t):(a.value=t,a.pfValue!=null&&(a.pfValue=t),o?a.strValue="rgb("+t.join(",")+")":l?a.strValue=t.join(" "):a.strValue=""+t,this.updateStyleHints(i)),this.checkTriggers(i,e,c,t)}};Pd.removeAllBypasses=function(r,e){return this.removeBypasses(r,this.propertyNames,e)};Pd.removeBypasses=function(r,e,t){for(var n=!0,i=0;i<r.length;i++){for(var a=r[i],s={},o=0;o<e.length;o++){var l=e[o],c=this.properties[l],h=a.pstyle(c.name);if(!(!h||!h.bypass)){var d="",v=this.parse(l,d,!0),g=s[c.name]={prev:h};this.applyParsedProperty(a,v),g.next=a.pstyle(c.name)}}this.updateStyleHints(a),t&&this.updateTransitions(a,s,n)}};var ow={};ow.getEmSizeInPixels=function(){var r=this.containerCss("font-size");return r!=null?parseFloat(r):1};ow.containerCss=function(r){var e=this._private.cy,t=e.container(),n=e.window();if(n&&t&&n.getComputedStyle)return n.getComputedStyle(t).getPropertyValue(r)};var rs={};rs.getRenderedStyle=function(r,e){return e?this.getStylePropertyValue(r,e,!0):this.getRawStyle(r,!0)};rs.getRawStyle=function(r,e){var t=this;if(r=r[0],r){for(var n={},i=0;i<t.properties.length;i++){var a=t.properties[i],s=t.getStylePropertyValue(r,a.name,e);s!=null&&(n[a.name]=s,n[ng(a.name)]=s)}return n}};rs.getIndexedStyle=function(r,e,t,n){var i=r.pstyle(e)[t][n];return i??r.cy().style().getDefaultProperty(e)[t][0]};rs.getStylePropertyValue=function(r,e,t){var n=this;if(r=r[0],r){var i=n.properties[e];i.alias&&(i=i.pointsTo);var a=i.type,s=r.pstyle(i.name);if(s){var o=s.value,l=s.units,c=s.strValue;if(t&&a.number&&o!=null&&ut(o)){var h=r.cy().zoom(),d=function(y){return y*h},v=function(y,_){return d(y)+_},g=Cr(o),m=g?l.every(function(x){return x!=null}):l!=null;return m?g?o.map(function(x,y){return v(x,l[y])}).join(" "):v(o,l):g?o.map(function(x){return xt(x)?x:""+d(x)}).join(" "):""+d(o)}else if(c!=null)return c}return null}};rs.getAnimationStartStyle=function(r,e){for(var t={},n=0;n<e.length;n++){var i=e[n],a=i.name,s=r.pstyle(a);s!==void 0&&(Zt(s)?s=this.parse(a,s.strValue):s=this.parse(a,s)),s&&(t[a]=s)}return t};rs.getPropsList=function(r){var e=this,t=[],n=r,i=e.properties;if(n)for(var a=Object.keys(n),s=0;s<a.length;s++){var o=a[s],l=n[o],c=i[o]||i[X_(o)],h=this.parse(c.name,l);h&&t.push(h)}return t};rs.getNonDefaultPropertiesHash=function(r,e,t){var n=t.slice(),i,a,s,o,l,c;for(l=0;l<e.length;l++)if(i=e[l],a=r.pstyle(i,!1),a!=null)if(a.pfValue!=null)n[0]=Wf(o,n[0]),n[1]=$f(o,n[1]);else for(s=a.strValue,c=0;c<s.length;c++)o=s.charCodeAt(c),n[0]=Wf(o,n[0]),n[1]=$f(o,n[1]);return n};rs.getPropertiesHash=rs.getNonDefaultPropertiesHash;var gg={};gg.appendFromJson=function(r){for(var e=this,t=0;t<r.length;t++){var n=r[t],i=n.selector,a=n.style||n.css,s=Object.keys(a);e.selector(i);for(var o=0;o<s.length;o++){var l=s[o],c=a[l];e.css(l,c)}}return e};gg.fromJson=function(r){var e=this;return e.resetToDefault(),e.appendFromJson(r),e};gg.json=function(){for(var r=[],e=this.defaultLength;e<this.length;e++){for(var t=this[e],n=t.selector,i=t.properties,a={},s=0;s<i.length;s++){var o=i[s];a[o.name]=o.strValue}r.push({selector:n?n.toString():"core",style:a})}return r};var lw={};lw.appendFromString=function(r){var e=this,t=this,n=""+r,i,a,s;n=n.replace(/[/][*](\s|.)+?[*][/]/g,"");function o(){n.length>i.length?n=n.substr(i.length):n=""}function l(){a.length>s.length?a=a.substr(s.length):a=""}for(;;){var c=n.match(/^\s*$/);if(c)break;var h=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){fr("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}i=h[0];var d=h[1];if(d!=="core"){var v=new Qo(d);if(v.invalid){fr("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),o();continue}}var g=h[2],m=!1;a=g;for(var x=[];;){var y=a.match(/^\s*$/);if(y)break;var _=a.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!_){fr("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+g),m=!0;break}s=_[0];var w=_[1],S=_[2],A=e.properties[w];if(!A){fr("Skipping property: Invalid property name in: "+s),l();continue}var C=t.parse(w,S);if(!C){fr("Skipping property: Invalid property definition in: "+s),l();continue}x.push({name:w,val:S}),l()}if(m){o();break}t.selector(d);for(var M=0;M<x.length;M++){var E=x[M];t.css(E.name,E.val)}o()}return t};lw.fromString=function(r){var e=this;return e.resetToDefault(),e.appendFromString(r),e};var xn={};(function(){var r=Rn,e=ez,t=rz,n=nz,i=iz,a=function(oe){return"^"+oe+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},s=function(oe){var de=r+"|\\w+|"+e+"|"+t+"|"+n+"|"+i;return"^"+oe+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+r+")\\s*\\,\\s*("+r+")\\s*,\\s*("+de+")\\s*\\,\\s*("+de+")\\)$"},o=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];xn.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},axisDirectionExplicit:{enums:["leftward","rightward","upward","downward"]},axisDirectionPrimary:{enums:["horizontal","vertical"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},boxSelection:{enums:["contain","overlap","none"]},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle","circle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:a("data")},layoutData:{mapping:!0,regex:a("layoutData")},scratch:{mapping:!0,regex:a("scratch")},mapData:{mapping:!0,regex:s("mapData")},mapLayoutData:{mapping:!0,regex:s("mapLayoutData")},mapScratch:{mapping:!0,regex:s("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:o,singleRegexMatchValue:!0},urls:{regexes:o,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(oe,de){switch(oe.length){case 2:return de[0]!=="deg"&&de[0]!=="rad"&&de[1]!=="deg"&&de[1]!=="rad";case 1:return xt(oe[0])||de[0]==="deg"||de[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+r+")\\s*,\\s*("+r+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+r+")\\s*,\\s*("+r+")\\s*,\\s*("+r+")\\s*,\\s*("+r+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(oe){var de=oe.length;return de===1||de===2||de===4}}};var l={zeroNonZero:function(oe,de){return(oe==null||de==null)&&oe!==de||oe==0&&de!=0?!0:oe!=0&&de==0},any:function(oe,de){return oe!=de},emptyNonEmpty:function(oe,de){var ye=$o(oe),Ee=$o(de);return ye&&!Ee||!ye&&Ee}},c=xn.types,h=[{name:"label",type:c.text,triggersBounds:l.any,triggersZOrder:l.emptyNonEmpty},{name:"text-rotation",type:c.textRotation,triggersBounds:l.any},{name:"text-margin-x",type:c.bidirectionalSize,triggersBounds:l.any},{name:"text-margin-y",type:c.bidirectionalSize,triggersBounds:l.any}],d=[{name:"source-label",type:c.text,triggersBounds:l.any},{name:"source-text-rotation",type:c.textRotation,triggersBounds:l.any},{name:"source-text-margin-x",type:c.bidirectionalSize,triggersBounds:l.any},{name:"source-text-margin-y",type:c.bidirectionalSize,triggersBounds:l.any},{name:"source-text-offset",type:c.size,triggersBounds:l.any}],v=[{name:"target-label",type:c.text,triggersBounds:l.any},{name:"target-text-rotation",type:c.textRotation,triggersBounds:l.any},{name:"target-text-margin-x",type:c.bidirectionalSize,triggersBounds:l.any},{name:"target-text-margin-y",type:c.bidirectionalSize,triggersBounds:l.any},{name:"target-text-offset",type:c.size,triggersBounds:l.any}],g=[{name:"font-family",type:c.fontFamily,triggersBounds:l.any},{name:"font-style",type:c.fontStyle,triggersBounds:l.any},{name:"font-weight",type:c.fontWeight,triggersBounds:l.any},{name:"font-size",type:c.size,triggersBounds:l.any},{name:"text-transform",type:c.textTransform,triggersBounds:l.any},{name:"text-wrap",type:c.textWrap,triggersBounds:l.any},{name:"text-overflow-wrap",type:c.textOverflowWrap,triggersBounds:l.any},{name:"text-max-width",type:c.size,triggersBounds:l.any},{name:"text-outline-width",type:c.size,triggersBounds:l.any},{name:"line-height",type:c.positiveNumber,triggersBounds:l.any}],m=[{name:"text-valign",type:c.valign,triggersBounds:l.any},{name:"text-halign",type:c.halign,triggersBounds:l.any},{name:"color",type:c.color},{name:"text-outline-color",type:c.color},{name:"text-outline-opacity",type:c.zeroOneNumber},{name:"text-background-color",type:c.color},{name:"text-background-opacity",type:c.zeroOneNumber},{name:"text-background-padding",type:c.size,triggersBounds:l.any},{name:"text-border-opacity",type:c.zeroOneNumber},{name:"text-border-color",type:c.color},{name:"text-border-width",type:c.size,triggersBounds:l.any},{name:"text-border-style",type:c.borderStyle,triggersBounds:l.any},{name:"text-background-shape",type:c.textBackgroundShape,triggersBounds:l.any},{name:"text-justification",type:c.justification},{name:"box-select-labels",type:c.bool,triggersBounds:l.any}],x=[{name:"events",type:c.bool,triggersZOrder:l.any},{name:"text-events",type:c.bool,triggersZOrder:l.any},{name:"box-selection",type:c.boxSelection,triggersZOrder:l.any}],y=[{name:"display",type:c.display,triggersZOrder:l.any,triggersBounds:l.any,triggersBoundsOfConnectedEdges:l.any,triggersBoundsOfParallelEdges:function(oe,de,ye){return oe===de?!1:ye.pstyle("curve-style").value==="bezier"}},{name:"visibility",type:c.visibility,triggersZOrder:l.any},{name:"opacity",type:c.zeroOneNumber,triggersZOrder:l.zeroNonZero},{name:"text-opacity",type:c.zeroOneNumber},{name:"min-zoomed-font-size",type:c.size},{name:"z-compound-depth",type:c.zCompoundDepth,triggersZOrder:l.any},{name:"z-index-compare",type:c.zIndexCompare,triggersZOrder:l.any},{name:"z-index",type:c.number,triggersZOrder:l.any}],_=[{name:"overlay-padding",type:c.size,triggersBounds:l.any},{name:"overlay-color",type:c.color},{name:"overlay-opacity",type:c.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"overlay-shape",type:c.overlayShape,triggersBounds:l.any},{name:"overlay-corner-radius",type:c.cornerRadius}],w=[{name:"underlay-padding",type:c.size,triggersBounds:l.any},{name:"underlay-color",type:c.color},{name:"underlay-opacity",type:c.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"underlay-shape",type:c.overlayShape,triggersBounds:l.any},{name:"underlay-corner-radius",type:c.cornerRadius}],S=[{name:"transition-property",type:c.propList},{name:"transition-duration",type:c.time},{name:"transition-delay",type:c.time},{name:"transition-timing-function",type:c.easing}],A=function(oe,de){return de.value==="label"?-oe.poolIndex():de.pfValue},C=[{name:"height",type:c.nodeSize,triggersBounds:l.any,hashOverride:A},{name:"width",type:c.nodeSize,triggersBounds:l.any,hashOverride:A},{name:"shape",type:c.nodeShape,triggersBounds:l.any},{name:"shape-polygon-points",type:c.polygonPointList,triggersBounds:l.any},{name:"corner-radius",type:c.cornerRadius},{name:"background-color",type:c.color},{name:"background-fill",type:c.fill},{name:"background-opacity",type:c.zeroOneNumber},{name:"background-blacken",type:c.nOneOneNumber},{name:"background-gradient-stop-colors",type:c.colors},{name:"background-gradient-stop-positions",type:c.percentages},{name:"background-gradient-direction",type:c.gradientDirection},{name:"padding",type:c.sizeMaybePercent,triggersBounds:l.any},{name:"padding-relative-to",type:c.paddingRelativeTo,triggersBounds:l.any},{name:"bounds-expansion",type:c.boundsExpansion,triggersBounds:l.any}],M=[{name:"border-color",type:c.color},{name:"border-opacity",type:c.zeroOneNumber},{name:"border-width",type:c.size,triggersBounds:l.any},{name:"border-style",type:c.borderStyle},{name:"border-cap",type:c.lineCap},{name:"border-join",type:c.lineJoin},{name:"border-dash-pattern",type:c.numbers},{name:"border-dash-offset",type:c.number},{name:"border-position",type:c.linePosition}],E=[{name:"outline-color",type:c.color},{name:"outline-opacity",type:c.zeroOneNumber},{name:"outline-width",type:c.size,triggersBounds:l.any},{name:"outline-style",type:c.borderStyle},{name:"outline-offset",type:c.size,triggersBounds:l.any}],O=[{name:"background-image",type:c.urls},{name:"background-image-crossorigin",type:c.bgCrossOrigin},{name:"background-image-opacity",type:c.zeroOneNumbers},{name:"background-image-containment",type:c.bgContainment},{name:"background-image-smoothing",type:c.bools},{name:"background-position-x",type:c.bgPos},{name:"background-position-y",type:c.bgPos},{name:"background-width-relative-to",type:c.bgRelativeTo},{name:"background-height-relative-to",type:c.bgRelativeTo},{name:"background-repeat",type:c.bgRepeat},{name:"background-fit",type:c.bgFit},{name:"background-clip",type:c.bgClip},{name:"background-width",type:c.bgWH},{name:"background-height",type:c.bgWH},{name:"background-offset-x",type:c.bgPos},{name:"background-offset-y",type:c.bgPos}],D=[{name:"position",type:c.position,triggersBounds:l.any},{name:"compound-sizing-wrt-labels",type:c.compoundIncludeLabels,triggersBounds:l.any},{name:"min-width",type:c.size,triggersBounds:l.any},{name:"min-width-bias-left",type:c.sizeMaybePercent,triggersBounds:l.any},{name:"min-width-bias-right",type:c.sizeMaybePercent,triggersBounds:l.any},{name:"min-height",type:c.size,triggersBounds:l.any},{name:"min-height-bias-top",type:c.sizeMaybePercent,triggersBounds:l.any},{name:"min-height-bias-bottom",type:c.sizeMaybePercent,triggersBounds:l.any}],I=[{name:"line-style",type:c.lineStyle},{name:"line-color",type:c.color},{name:"line-fill",type:c.fill},{name:"line-cap",type:c.lineCap},{name:"line-opacity",type:c.zeroOneNumber},{name:"line-dash-pattern",type:c.numbers},{name:"line-dash-offset",type:c.number},{name:"line-outline-width",type:c.size},{name:"line-outline-color",type:c.color},{name:"line-gradient-stop-colors",type:c.colors},{name:"line-gradient-stop-positions",type:c.percentages},{name:"curve-style",type:c.curveStyle,triggersBounds:l.any,triggersBoundsOfParallelEdges:function(oe,de){return oe===de?!1:oe==="bezier"||de==="bezier"}},{name:"haystack-radius",type:c.zeroOneNumber,triggersBounds:l.any},{name:"source-endpoint",type:c.edgeEndpoint,triggersBounds:l.any},{name:"target-endpoint",type:c.edgeEndpoint,triggersBounds:l.any},{name:"control-point-step-size",type:c.size,triggersBounds:l.any},{name:"control-point-distances",type:c.bidirectionalSizes,triggersBounds:l.any},{name:"control-point-weights",type:c.numbers,triggersBounds:l.any},{name:"segment-distances",type:c.bidirectionalSizes,triggersBounds:l.any},{name:"segment-weights",type:c.numbers,triggersBounds:l.any},{name:"segment-radii",type:c.numbers,triggersBounds:l.any},{name:"radius-type",type:c.radiusType,triggersBounds:l.any},{name:"taxi-turn",type:c.bidirectionalSizeMaybePercent,triggersBounds:l.any},{name:"taxi-turn-min-distance",type:c.size,triggersBounds:l.any},{name:"taxi-direction",type:c.axisDirection,triggersBounds:l.any},{name:"taxi-radius",type:c.number,triggersBounds:l.any},{name:"edge-distances",type:c.edgeDistances,triggersBounds:l.any},{name:"arrow-scale",type:c.positiveNumber,triggersBounds:l.any},{name:"loop-direction",type:c.angle,triggersBounds:l.any},{name:"loop-sweep",type:c.angle,triggersBounds:l.any},{name:"source-distance-from-node",type:c.size,triggersBounds:l.any},{name:"target-distance-from-node",type:c.size,triggersBounds:l.any}],k=[{name:"ghost",type:c.bool,triggersBounds:l.any},{name:"ghost-offset-x",type:c.bidirectionalSize,triggersBounds:l.any},{name:"ghost-offset-y",type:c.bidirectionalSize,triggersBounds:l.any},{name:"ghost-opacity",type:c.zeroOneNumber}],U=[{name:"selection-box-color",type:c.color},{name:"selection-box-opacity",type:c.zeroOneNumber},{name:"selection-box-border-color",type:c.color},{name:"selection-box-border-width",type:c.size},{name:"active-bg-color",type:c.color},{name:"active-bg-opacity",type:c.zeroOneNumber},{name:"active-bg-size",type:c.size},{name:"outside-texture-bg-color",type:c.color},{name:"outside-texture-bg-opacity",type:c.zeroOneNumber}],V=[];xn.pieBackgroundN=16,V.push({name:"pie-size",type:c.sizeMaybePercent}),V.push({name:"pie-hole",type:c.sizeMaybePercent}),V.push({name:"pie-start-angle",type:c.angle});for(var X=1;X<=xn.pieBackgroundN;X++)V.push({name:"pie-"+X+"-background-color",type:c.color}),V.push({name:"pie-"+X+"-background-size",type:c.percent}),V.push({name:"pie-"+X+"-background-opacity",type:c.zeroOneNumber});var W=[];xn.stripeBackgroundN=16,W.push({name:"stripe-size",type:c.sizeMaybePercent}),W.push({name:"stripe-direction",type:c.axisDirectionPrimary});for(var P=1;P<=xn.stripeBackgroundN;P++)W.push({name:"stripe-"+P+"-background-color",type:c.color}),W.push({name:"stripe-"+P+"-background-size",type:c.percent}),W.push({name:"stripe-"+P+"-background-opacity",type:c.zeroOneNumber});var H=[],z=xn.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:c.arrowShape,triggersBounds:l.any},{name:"arrow-color",type:c.color},{name:"arrow-fill",type:c.arrowFill},{name:"arrow-width",type:c.arrowWidth}].forEach(function(ae){z.forEach(function(oe){var de=oe+"-"+ae.name,ye=ae.type,Ee=ae.triggersBounds;H.push({name:de,type:ye,triggersBounds:Ee})})},{});var $=xn.properties=[].concat(x,S,y,_,w,k,m,g,h,d,v,C,M,E,O,V,W,D,I,H,U),B=xn.propertyGroups={behavior:x,transition:S,visibility:y,overlay:_,underlay:w,ghost:k,commonLabel:m,labelDimensions:g,mainLabel:h,sourceLabel:d,targetLabel:v,nodeBody:C,nodeBorder:M,nodeOutline:E,backgroundImage:O,pie:V,stripe:W,compound:D,edgeLine:I,edgeArrow:H,core:U},L=xn.propertyGroupNames={},Y=xn.propertyGroupKeys=Object.keys(B);Y.forEach(function(ae){L[ae]=B[ae].map(function(oe){return oe.name}),B[ae].forEach(function(oe){return oe.groupKey=ae})});var G=xn.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];xn.propertyNames=$.map(function(ae){return ae.name});for(var re=0;re<$.length;re++){var ie=$[re];$[ie.name]=ie}for(var le=0;le<G.length;le++){var ce=G[le],_e=$[ce.pointsTo],pe={name:ce.name,alias:!0,pointsTo:_e};$.push(pe),$[ce.name]=pe}})();xn.getDefaultProperty=function(r){return this.getDefaultProperties()[r]};xn.getDefaultProperties=function(){var r=this._private;if(r.defaultProperties!=null)return r.defaultProperties;for(var e=Ct({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","box-selection":"contain","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","box-select-labels":"no","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%","pie-hole":0,"pie-start-angle":"0deg"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(l,c){for(var h=1;h<=xn.pieBackgroundN;h++){var d=c.name.replace("{{i}}",h),v=c.value;l[d]=v}return l},{}),{"stripe-size":"100%","stripe-direction":"horizontal"},[{name:"stripe-{{i}}-background-color",value:"black"},{name:"stripe-{{i}}-background-size",value:"0%"},{name:"stripe-{{i}}-background-opacity",value:1}].reduce(function(l,c){for(var h=1;h<=xn.stripeBackgroundN;h++){var d=c.name.replace("{{i}}",h),v=c.value;l[d]=v}return l},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(l,c){return xn.arrowPrefixes.forEach(function(h){var d=h+"-"+c.name,v=c.value;l[d]=v}),l},{})),t={},n=0;n<this.properties.length;n++){var i=this.properties[n];if(!i.pointsTo){var a=i.name,s=e[a],o=this.parse(a,s);t[a]=o}}return r.defaultProperties=t,r.defaultProperties};xn.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var mg={};mg.parse=function(r,e,t,n){var i=this;if(en(e))return i.parseImplWarn(r,e,t,n);var a=n==="mapping"||n===!0||n===!1||n==null?"dontcare":n,s=t?"t":"f",o=""+e,l=X9(r,o,s,a),c=i.propCache=i.propCache||[],h;return(h=c[l])||(h=c[l]=i.parseImplWarn(r,e,t,n)),(t||n==="mapping")&&(h=Ja(h),h&&(h.value=Ja(h.value))),h};mg.parseImplWarn=function(r,e,t,n){var i=this.parseImpl(r,e,t,n);return!i&&e!=null&&fr("The style property `".concat(r,": ").concat(e,"` is invalid")),i&&(i.name==="width"||i.name==="height")&&e==="label"&&fr("The style value of `label` is deprecated for `"+i.name+"`"),i};mg.parseImpl=function(r,e,t,n){var i=this;r=X_(r);var a=i.properties[r],s=e,o=i.types;if(!a||e===void 0)return null;a.alias&&(a=a.pointsTo,r=a.name);var l=xt(e);l&&(e=e.trim());var c=a.type;if(!c)return null;if(t&&(e===""||e===null))return{name:r,value:e,bypass:!0,deleteBypass:!0};if(en(e))return{name:r,value:e,strValue:"fn",mapped:o.fn,bypass:t};var h,d;if(!(!l||n||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(h=new RegExp(o.data.regex).exec(e))){if(t)return!1;var v=o.data;return{name:r,value:h,strValue:""+e,mapped:v,field:h[1],bypass:t}}else if(e.length>=10&&e[0]==="m"&&(d=new RegExp(o.mapData.regex).exec(e))){if(t||c.multiple)return!1;var g=o.mapData;if(!(c.color||c.number))return!1;var m=this.parse(r,d[4]);if(!m||m.mapped)return!1;var x=this.parse(r,d[5]);if(!x||x.mapped)return!1;if(m.pfValue===x.pfValue||m.strValue===x.strValue)return fr("`"+r+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+r+": "+m.strValue+"`"),this.parse(r,m.strValue);if(c.color){var y=m.value,_=x.value,w=y[0]===_[0]&&y[1]===_[1]&&y[2]===_[2]&&(y[3]===_[3]||(y[3]==null||y[3]===1)&&(_[3]==null||_[3]===1));if(w)return!1}return{name:r,value:d,strValue:""+e,mapped:g,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:m.value,valueMax:x.value,bypass:t}}}if(c.multiple&&n!=="multiple"){var S;if(l?S=e.split(/\s+/):Cr(e)?S=e:S=[e],c.evenMultiple&&S.length%2!==0)return null;for(var A=[],C=[],M=[],E="",O=!1,D=0;D<S.length;D++){var I=i.parse(r,S[D],t,"multiple");O=O||xt(I.value),A.push(I.value),M.push(I.pfValue!=null?I.pfValue:I.value),C.push(I.units),E+=(D>0?" ":"")+I.strValue}return c.validate&&!c.validate(A,C)?null:c.singleEnum&&O?A.length===1&&xt(A[0])?{name:r,value:A[0],strValue:A[0],bypass:t}:null:{name:r,value:A,pfValue:M,strValue:E,bypass:t,units:C}}var k=function(){for(var pe=0;pe<c.enums.length;pe++){var ae=c.enums[pe];if(ae===e)return{name:r,value:e,strValue:""+e,bypass:t}}return null};if(c.number){var U,V="px";if(c.units&&(U=c.units),c.implicitUnits&&(V=c.implicitUnits),!c.unitless)if(l){var X="px|em"+(c.allowPercent?"|\\%":"");U&&(X=U);var W=e.match("^("+Rn+")("+X+")?$");W&&(e=W[1],U=W[2]||V)}else(!U||c.implicitUnits)&&(U=V);if(e=parseFloat(e),isNaN(e)&&c.enums===void 0)return null;if(isNaN(e)&&c.enums!==void 0)return e=s,k();if(c.integer&&!YF(e)||c.min!==void 0&&(e<c.min||c.strictMin&&e===c.min)||c.max!==void 0&&(e>c.max||c.strictMax&&e===c.max))return null;var P={name:r,value:e,strValue:""+e+(U||""),units:U,bypass:t};return c.unitless||U!=="px"&&U!=="em"?P.pfValue=e:P.pfValue=U==="px"||!U?e:this.getEmSizeInPixels()*e,(U==="ms"||U==="s")&&(P.pfValue=U==="ms"?e:1e3*e),(U==="deg"||U==="rad")&&(P.pfValue=U==="rad"?e:nU(e)),U==="%"&&(P.pfValue=e/100),P}else if(c.propList){var H=[],z=""+e;if(z!=="none"){for(var $=z.split(/\s*,\s*|\s+/),B=0;B<$.length;B++){var L=$[B].trim();i.properties[L]?H.push(L):fr("`"+L+"` is not a valid property name")}if(H.length===0)return null}return{name:r,value:H,strValue:H.length===0?"none":H.join(" "),bypass:t}}else if(c.color){var Y=z9(e);return Y?{name:r,value:Y,pfValue:Y,strValue:"rgb("+Y[0]+","+Y[1]+","+Y[2]+")",bypass:t}:null}else if(c.regex||c.regexes){if(c.enums){var G=k();if(G)return G}for(var re=c.regexes?c.regexes:[c.regex],ie=0;ie<re.length;ie++){var le=new RegExp(re[ie]),ce=le.exec(e);if(ce)return{name:r,value:c.singleRegexMatchValue?ce[1]:ce,strValue:""+e,bypass:t}}return null}else return c.string?{name:r,value:""+e,strValue:""+e,bypass:t}:c.enums?k():null};var zn=function(e){if(!(this instanceof zn))return new zn(e);if(!q_(e)){jr("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},ni=zn.prototype;ni.instanceString=function(){return"style"};ni.clear=function(){for(var r=this._private,e=r.cy,t=e.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,r.contextStyles={},r.propDiffs={},this.cleanElements(t,!0),t.forEach(function(i){var a=i[0]._private;a.styleDirty=!0,a.appliedInitStyle=!1}),this};ni.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};ni.core=function(r){return this._private.coreStyle[r]||this.getDefaultProperty(r)};ni.selector=function(r){var e=r==="core"?null:new Qo(r),t=this.length++;return this[t]={selector:e,properties:[],mappedProperties:[],index:t},this};ni.css=function(){var r=this,e=arguments;if(e.length===1)for(var t=e[0],n=0;n<r.properties.length;n++){var i=r.properties[n],a=t[i.name];a===void 0&&(a=t[ng(i.name)]),a!==void 0&&this.cssRule(i.name,a)}else e.length===2&&this.cssRule(e[0],e[1]);return this};ni.style=ni.css;ni.cssRule=function(r,e){var t=this.parse(r,e);if(t){var n=this.length-1;this[n].properties.push(t),this[n].properties[t.name]=t,t.name.match(/pie-(\d+)-background-size/)&&t.value&&(this._private.hasPie=!0),t.name.match(/stripe-(\d+)-background-size/)&&t.value&&(this._private.hasStripe=!0),t.mapped&&this[n].mappedProperties.push(t);var i=!this[n].selector;i&&(this._private.coreStyle[t.name]=t)}return this};ni.append=function(r){return k9(r)?r.appendToStyle(this):Cr(r)?this.appendFromJson(r):xt(r)&&this.appendFromString(r),this};zn.fromJson=function(r,e){var t=new zn(r);return t.fromJson(e),t};zn.fromString=function(r,e){return new zn(r).fromString(e)};[Un,Pd,ow,rs,gg,lw,xn,mg].forEach(function(r){Ct(ni,r)});zn.types=ni.types;zn.properties=ni.properties;zn.propertyGroups=ni.propertyGroups;zn.propertyGroupNames=ni.propertyGroupNames;zn.propertyGroupKeys=ni.propertyGroupKeys;var oj={style:function(e){if(e){var t=this.setStyle(e);t.update()}return this._private.style},setStyle:function(e){var t=this._private;return k9(e)?t.style=e.generateStyle(this):Cr(e)?t.style=zn.fromJson(this,e):xt(e)?t.style=zn.fromString(this,e):t.style=zn(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},lj="single",du={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var t=this._private;if(t.selectionType==null&&(t.selectionType=lj),e!==void 0)(e==="additive"||e==="single")&&(t.selectionType=e);else return t.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,t=this._private.pan,n,i,a,s,o;switch(e.length){case 0:return t;case 1:if(xt(e[0]))return n=e[0],t[n];if(Zt(e[0])){if(!this._private.panningEnabled)return this;a=e[0],s=a.x,o=a.y,ut(s)&&(t.x=s),ut(o)&&(t.y=o),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;n=e[0],i=e[1],(n==="x"||n==="y")&&ut(i)&&(t[n]=i),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,t){var n=arguments,i=this._private.pan,a,s,o,l,c;if(!this._private.panningEnabled)return this;switch(n.length){case 1:Zt(e)&&(o=n[0],l=o.x,c=o.y,ut(l)&&(i.x+=l),ut(c)&&(i.y+=c),this.emit("pan viewport"));break;case 2:a=e,s=t,(a==="x"||a==="y")&&ut(s)&&(i[a]+=s),this.emit("pan viewport");break}return this.notify("viewport"),this},gc:function(){this.notify("gc")},fit:function(e,t){var n=this.getFitViewport(e,t);if(n){var i=this._private;i.zoom=n.zoom,i.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,t){if(ut(e)&&t===void 0&&(t=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var n;if(xt(e)){var i=e;e=this.$(i)}else if(KF(e)){var a=e;n={x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2},n.w=n.x2-n.x1,n.h=n.y2-n.y1}else qi(e)||(e=this.mutableElements());if(!(qi(e)&&e.empty())){n=n||e.boundingBox();var s=this.width(),o=this.height(),l;if(t=ut(t)?t:0,!isNaN(s)&&!isNaN(o)&&s>0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((s-2*t)/n.w,(o-2*t)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l<this._private.minZoom?this._private.minZoom:l;var c={x:(s-l*(n.x1+n.x2))/2,y:(o-l*(n.y1+n.y2))/2};return{zoom:l,pan:c}}}}},zoomRange:function(e,t){var n=this._private;if(t==null){var i=e;e=i.min,t=i.max}return ut(e)&&ut(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):ut(e)&&t===void 0&&e<=n.maxZoom?n.minZoom=e:ut(t)&&e===void 0&&t>=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t=this._private,n=t.pan,i=t.zoom,a,s,o=!1;if(t.zoomingEnabled||(o=!0),ut(e)?s=e:Zt(e)&&(s=e.level,e.position!=null?a=sg(e.position,i,n):e.renderedPosition!=null&&(a=e.renderedPosition),a!=null&&!t.panningEnabled&&(o=!0)),s=s>t.maxZoom?t.maxZoom:s,s=s<t.minZoom?t.minZoom:s,o||!ut(s)||s===i||a!=null&&(!ut(a.x)||!ut(a.y)))return null;if(a!=null){var l=n,c=i,h=s,d={x:-h/c*(a.x-l.x)+a.x,y:-h/c*(a.y-l.y)+a.y};return{zoomed:!0,panned:!0,zoom:h,pan:d}}else return{zoomed:!0,panned:!1,zoom:s,pan:n}},zoom:function(e){if(e===void 0)return this._private.zoom;var t=this.getZoomedViewport(e),n=this._private;return t==null||!t.zoomed?this:(n.zoom=t.zoom,t.panned&&(n.pan.x=t.pan.x,n.pan.y=t.pan.y),this.emit("zoom"+(t.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var t=this._private,n=!0,i=!0,a=[],s=!1,o=!1;if(!e)return this;if(ut(e.zoom)||(n=!1),Zt(e.pan)||(i=!1),!n&&!i)return this;if(n){var l=e.zoom;l<t.minZoom||l>t.maxZoom||!t.zoomingEnabled?s=!0:(t.zoom=l,a.push("zoom"))}if(i&&(!s||!e.cancelOnFailedZoom)&&t.panningEnabled){var c=e.pan;ut(c.x)&&(t.pan.x=c.x,o=!1),ut(c.y)&&(t.pan.y=c.y,o=!1),o||a.push("pan")}return a.length>0&&(a.push("viewport"),this.emit(a.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(xt(e)){var n=e;e=this.mutableElements().filter(n)}else qi(e)||(e=this.mutableElements());if(e.length!==0){var i=e.boundingBox(),a=this.width(),s=this.height();t=t===void 0?this._private.zoom:t;var o={x:(a-t*(i.x1+i.x2))/2,y:(s-t*(i.y1+i.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,t=e.container,n=this;return e.sizeCache=e.sizeCache||(t?(function(){var i=n.window().getComputedStyle(t),a=function(o){return parseFloat(i.getPropertyValue(o))};return{width:t.clientWidth-a("padding-left")-a("padding-right"),height:t.clientHeight-a("padding-top")-a("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),i={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return i.w=i.x2-i.x1,i.h=i.y2-i.y1,i},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};du.centre=du.center;du.autolockNodes=du.autolock;du.autoungrabifyNodes=du.autoungrabify;var td={data:hr.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:hr.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:hr.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:hr.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};td.attr=td.data;td.removeAttr=td.removeData;var rd=function(e){var t=this;e=Ct({},e);var n=e.container;n&&!Cp(n)&&Cp(n[0])&&(n=n[0]);var i=n?n._cyreg:null;i=i||{},i&&i.cy&&(i.cy.destroy(),i={});var a=i.readies=i.readies||[];n&&(n._cyreg=i),i.cy=t;var s=An!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=Ct({name:s?"grid":"null"},o.layout),o.renderer=Ct({name:s?"canvas":"null"},o.renderer);var l=function(m,x,y){return x!==void 0?x:y!==void 0?y:m},c=this._private={container:n,ready:!1,options:o,elements:new Wn(this),listeners:[],aniEles:new Wn(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:ut(o.zoom)?o.zoom:1,pan:{x:Zt(o.pan)&&ut(o.pan.x)?o.pan.x:0,y:Zt(o.pan)&&ut(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var h=function(m,x){var y=m.some(ZF);if(y)return Jc.all(m).then(x);x(m)};c.styleEnabled&&t.setStyle([]);var d=Ct({},o,o.renderer);t.initRenderer(d);var v=function(m,x,y){t.notifications(!1);var _=t.mutableElements();_.length>0&&_.remove(),m!=null&&(Zt(m)||Cr(m))&&t.add(m),t.one("layoutready",function(S){t.notifications(!0),t.emit(S),t.one("load",x),t.emitAndNotify("load")}).one("layoutstop",function(){t.one("done",y),t.emit("done")});var w=Ct({},t._private.options.layout);w.eles=t.elements(),t.layout(w).run()};h([o.style,o.elements],function(g){var m=g[0],x=g[1];c.styleEnabled&&t.style().append(m),v(x,function(){t.startAnimationLoop(),c.ready=!0,en(o.ready)&&t.on("ready",o.ready);for(var y=0;y<a.length;y++){var _=a[y];t.on("ready",_)}i&&(i.readies=[]),t.emit("ready")},o.done)})},Ip=rd.prototype;Ct(Ip,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){var e=this._private.container;if(e==null)return An;var t=this._private.container.ownerDocument;return t===void 0||t==null?An:t.defaultView||An},mount:function(e){if(e!=null){var t=this,n=t._private,i=n.options;return!Cp(e)&&Cp(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),n.container=e,n.styleEnabled=!0,t.invalidateSize(),t.initRenderer(Ct({},i,i.renderer,{name:i.renderer.name==="null"?"canvas":i.renderer.name})),t.startAnimationLoop(),t.style(i.style),t.emit("mount"),t}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Ja(this._private.options)},json:function(e){var t=this,n=t._private,i=t.mutableElements(),a=function(A){return t.getElementById(A.id())};if(Zt(e)){if(t.startBatch(),e.elements){var s={},o=function(A,C){for(var M=[],E=[],O=0;O<A.length;O++){var D=A[O];if(!D.data.id){fr("cy.json() cannot handle elements without an ID attribute");continue}var I=""+D.data.id,k=t.getElementById(I);s[I]=!0,k.length!==0?E.push({ele:k,json:D}):(C&&(D.group=C),M.push(D))}t.add(M);for(var U=0;U<E.length;U++){var V=E[U],X=V.ele,W=V.json;X.json(W)}};if(Cr(e.elements))o(e.elements);else for(var l=["nodes","edges"],c=0;c<l.length;c++){var h=l[c],d=e.elements[h];Cr(d)&&o(d,h)}var v=t.collection();i.filter(function(S){return!s[S.id()]}).forEach(function(S){S.isParent()?v.merge(S):S.remove()}),v.forEach(function(S){return S.children().move({parent:null})}),v.forEach(function(S){return a(S).remove()})}e.style&&t.style(e.style),e.zoom!=null&&e.zoom!==n.zoom&&t.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&t.pan(e.pan),e.data&&t.data(e.data);for(var g=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],m=0;m<g.length;m++){var x=g[m];e[x]!=null&&t[x](e[x])}return t.endBatch(),this}else{var y=!!e,_={};y?_.elements=this.elements().map(function(S){return S.json()}):(_.elements={},i.forEach(function(S){var A=S.group();_.elements[A]||(_.elements[A]=[]),_.elements[A].push(S.json())})),this._private.styleEnabled&&(_.style=t.style().json()),_.data=Ja(t.data());var w=n.options;return _.zoomingEnabled=n.zoomingEnabled,_.userZoomingEnabled=n.userZoomingEnabled,_.zoom=n.zoom,_.minZoom=n.minZoom,_.maxZoom=n.maxZoom,_.panningEnabled=n.panningEnabled,_.userPanningEnabled=n.userPanningEnabled,_.pan=Ja(n.pan),_.boxSelectionEnabled=n.boxSelectionEnabled,_.renderer=Ja(w.renderer),_.hideEdgesOnViewport=w.hideEdgesOnViewport,_.textureOnViewport=w.textureOnViewport,_.wheelSensitivity=w.wheelSensitivity,_.motionBlur=w.motionBlur,_.multiClickDebounceTime=w.multiClickDebounceTime,_}}});Ip.$id=Ip.getElementById;[ZH,rj,kR,u4,sp,ij,c4,op,oj,du,td].forEach(function(r){Ct(Ip,r)});var uj={fit:!0,directed:!1,direction:"downward",padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},cj={maximal:!1,acyclic:!1},uc=function(e){return e.scratch("breadthfirst")},t7=function(e,t){return e.scratch("breadthfirst",t)};function BR(r){this.options=Ct({},uj,cj,r)}BR.prototype.run=function(){var r=this.options,e=r.cy,t=r.eles,n=t.nodes().filter(function(Ye){return Ye.isChildless()}),i=t,a=r.directed,s=r.acyclic||r.maximal||r.maximalAdjustments>0,o=!!r.boundingBox,l=di(o?r.boundingBox:structuredClone(e.extent())),c;if(qi(r.roots))c=r.roots;else if(Cr(r.roots)){for(var h=[],d=0;d<r.roots.length;d++){var v=r.roots[d],g=e.getElementById(v);h.push(g)}c=e.collection(h)}else if(xt(r.roots))c=e.$(r.roots);else if(a)c=n.roots();else{var m=t.components();c=e.collection();for(var x=function(){var He=m[y],tt=He.maxDegree(!1),ot=He.filter(function(ct){return ct.degree(!1)===tt});c=c.add(ot)},y=0;y<m.length;y++)x()}var _=[],w={},S=function(He,tt){_[tt]==null&&(_[tt]=[]);var ot=_[tt].length;_[tt].push(He),t7(He,{index:ot,depth:tt})},A=function(He,tt){var ot=uc(He),ct=ot.depth,Ze=ot.index;_[ct][Ze]=null,He.isChildless()&&S(He,tt)};i.bfs({roots:c,directed:r.directed,visit:function(He,tt,ot,ct,Ze){var bt=He[0],Se=bt.id();bt.isChildless()&&S(bt,Ze),w[Se]=!0}});for(var C=[],M=0;M<n.length;M++){var E=n[M];w[E.id()]||C.push(E)}var O=function(He){for(var tt=_[He],ot=0;ot<tt.length;ot++){var ct=tt[ot];if(ct==null){tt.splice(ot,1),ot--;continue}t7(ct,{depth:He,index:ot})}},D=function(He,tt){for(var ot=uc(He),ct=He.incomers().filter(function(rt){return rt.isNode()&&t.has(rt)}),Ze=-1,bt=He.id(),Se=0;Se<ct.length;Se++){var ke=ct[Se],We=uc(ke);Ze=Math.max(Ze,We.depth)}if(ot.depth<=Ze){if(!r.acyclic&&tt[bt])return null;var Ke=Ze+1;return A(He,Ke),tt[bt]=Ke,!0}return!1};if(a&&s){var I=[],k={},U=function(He){return I.push(He)},V=function(){return I.shift()};for(n.forEach(function(Ye){return I.push(Ye)});I.length>0;){var X=V(),W=D(X,k);if(W)X.outgoers().filter(function(Ye){return Ye.isNode()&&t.has(Ye)}).forEach(U);else if(W===null){fr("Detected double maximal shift for node `"+X.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var P=0;if(r.avoidOverlap)for(var H=0;H<n.length;H++){var z=n[H],$=z.layoutDimensions(r),B=$.w,L=$.h;P=Math.max(P,B,L)}var Y={},G=function(He){if(Y[He.id()])return Y[He.id()];for(var tt=uc(He).depth,ot=He.neighborhood(),ct=0,Ze=0,bt=0;bt<ot.length;bt++){var Se=ot[bt];if(!(Se.isEdge()||Se.isParent()||!n.has(Se))){var ke=uc(Se);if(ke!=null){var We=ke.index,Ke=ke.depth;if(!(We==null||Ke==null)){var rt=_[Ke].length;Ke<tt&&(ct+=We/rt,Ze++)}}}}return Ze=Math.max(1,Ze),ct=ct/Ze,Ze===0&&(ct=0),Y[He.id()]=ct,ct},re=function(He,tt){var ot=G(He),ct=G(tt),Ze=ot-ct;return Ze===0?F9(He.id(),tt.id()):Ze};r.depthSort!==void 0&&(re=r.depthSort);for(var ie=_.length,le=0;le<ie;le++)_[le].sort(re),O(le);for(var ce=[],_e=0;_e<C.length;_e++)ce.push(C[_e]);var pe=function(){for(var He=0;He<ie;He++)O(He)};ce.length&&(_.unshift(ce),ie=_.length,pe());for(var ae=0,oe=0;oe<ie;oe++)ae=Math.max(_[oe].length,ae);var de={x:l.x1+l.w/2,y:l.y1+l.h/2},ye=n.reduce(function(Ye,He){return(function(tt){return{w:Ye.w===-1?tt.w:(Ye.w+tt.w)/2,h:Ye.h===-1?tt.h:(Ye.h+tt.h)/2}})(He.boundingBox({includeLabels:r.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),Ee=Math.max(ie===1?0:o?(l.h-r.padding*2-ye.h)/(ie-1):(l.h-r.padding*2-ye.h)/(ie+1),P),Re=_.reduce(function(Ye,He){return Math.max(Ye,He.length)},0),Ne=function(He){var tt=uc(He),ot=tt.depth,ct=tt.index;if(r.circle){var Ze=Math.min(l.w/2/ie,l.h/2/ie);Ze=Math.max(Ze,P);var bt=Ze*ot+Ze-(ie>0&&_[0].length<=3?Ze/2:0),Se=2*Math.PI/_[ot].length*ct;return ot===0&&_[0].length===1&&(bt=1),{x:de.x+bt*Math.cos(Se),y:de.y+bt*Math.sin(Se)}}else{var ke=_[ot].length,We=Math.max(ke===1?0:o?(l.w-r.padding*2-ye.w)/((r.grid?Re:ke)-1):(l.w-r.padding*2-ye.w)/((r.grid?Re:ke)+1),P),Ke={x:de.x+(ct+1-(ke+1)/2)*We,y:de.y+(ot+1-(ie+1)/2)*Ee};return Ke}},Be={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Be).indexOf(r.direction)===-1&&jr("Invalid direction '".concat(r.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Be).join(", ")));var $e=function(He){return Cz(Ne(He),l,Be[r.direction])};return t.nodes().layoutPositions(this,r,$e),this};var hj={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function FR(r){this.options=Ct({},hj,r)}FR.prototype.run=function(){var r=this.options,e=r,t=r.cy,n=e.eles,i=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));for(var s=di(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/a.length:e.sweep,c=l/Math.max(1,a.length-1),h,d=0,v=0;v<a.length;v++){var g=a[v],m=g.layoutDimensions(e),x=m.w,y=m.h;d=Math.max(d,x,y)}if(ut(e.radius)?h=e.radius:a.length<=1?h=0:h=Math.min(s.h,s.w)/2-d,a.length>1&&e.avoidOverlap){d*=1.75;var _=Math.cos(c)-Math.cos(0),w=Math.sin(c)-Math.sin(0),S=Math.sqrt(d*d/(_*_+w*w));h=Math.max(S,h)}var A=function(M,E){var O=e.startAngle+E*c*(i?1:-1),D=h*Math.cos(O),I=h*Math.sin(O),k={x:o.x+D,y:o.y+I};return k};return n.nodes().layoutPositions(this,e,A),this};var fj={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function zR(r){this.options=Ct({},fj,r)}zR.prototype.run=function(){for(var r=this.options,e=r,t=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=r.cy,i=e.eles,a=i.nodes().not(":parent"),s=di(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=[],c=0,h=0;h<a.length;h++){var d=a[h],v=void 0;v=e.concentric(d),l.push({value:v,node:d}),d._private.scratch.concentric=v}a.updateStyle();for(var g=0;g<a.length;g++){var m=a[g],x=m.layoutDimensions(e);c=Math.max(c,x.w,x.h)}l.sort(function(Ee,Re){return Re.value-Ee.value});for(var y=e.levelWidth(a),_=[[]],w=_[0],S=0;S<l.length;S++){var A=l[S];if(w.length>0){var C=Math.abs(w[0].value-A.value);C>=y&&(w=[],_.push(w))}w.push(A)}var M=c+e.minNodeSpacing;if(!e.avoidOverlap){var E=_.length>0&&_[0].length>1,O=Math.min(s.w,s.h)/2-M,D=O/(_.length+E?1:0);M=Math.min(M,D)}for(var I=0,k=0;k<_.length;k++){var U=_[k],V=e.sweep===void 0?2*Math.PI-2*Math.PI/U.length:e.sweep,X=U.dTheta=V/Math.max(1,U.length-1);if(U.length>1&&e.avoidOverlap){var W=Math.cos(X)-Math.cos(0),P=Math.sin(X)-Math.sin(0),H=Math.sqrt(M*M/(W*W+P*P));I=Math.max(H,I)}U.r=I,I+=M}if(e.equidistant){for(var z=0,$=0,B=0;B<_.length;B++){var L=_[B],Y=L.r-$;z=Math.max(z,Y)}$=0;for(var G=0;G<_.length;G++){var re=_[G];G===0&&($=re.r),re.r=$,$+=z}}for(var ie={},le=0;le<_.length;le++)for(var ce=_[le],_e=ce.dTheta,pe=ce.r,ae=0;ae<ce.length;ae++){var oe=ce[ae],de=e.startAngle+(t?1:-1)*_e*ae,ye={x:o.x+pe*Math.cos(de),y:o.y+pe*Math.sin(de)};ie[oe.node.id()]=ye}return i.nodes().layoutPositions(this,e,function(Ee){var Re=Ee.id();return ie[Re]}),this};var N2,dj={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,t){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function yg(r){this.options=Ct({},dj,r),this.options.layout=this;var e=this.options.eles.nodes(),t=this.options.eles.edges(),n=t.filter(function(i){var a=i.source().data("id"),s=i.target().data("id"),o=e.some(function(c){return c.data("id")===a}),l=e.some(function(c){return c.data("id")===s});return!o||!l});this.options.eles=this.options.eles.not(n)}yg.prototype.run=function(){var r=this.options,e=r.cy,t=this;t.stopped=!1,(r.animate===!0||r.animate===!1)&&t.emit({type:"layoutstart",layout:t}),r.debug===!0?N2=!0:N2=!1;var n=vj(e,t,r);N2&&gj(n),r.randomize&&mj(n);var i=js(),a=function(){yj(n,e,r),r.fit===!0&&e.fit(r.padding)},s=function(v){return!(t.stopped||v>=r.numIter||(bj(n,r),n.temperature=n.temperature*r.coolingFactor,n.temperature<r.minTemp))},o=function(){if(r.animate===!0||r.animate===!1)a(),t.one("layoutstop",r.stop),t.emit({type:"layoutstop",layout:t});else{var v=r.eles.nodes(),g=GR(n,r,v);v.layoutPositions(t,r,g)}},l=0,c=!0;if(r.animate===!0){var h=function(){for(var v=0;c&&v<r.refresh;)c=s(l),l++,v++;if(!c)n7(n,r),o();else{var g=js();g-i>=r.animationThreshold&&a(),Ap(h)}};h()}else{for(;c;)c=s(l),l++;n7(n,r),o()}return this};yg.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};yg.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var vj=function(e,t,n){for(var i=n.eles.edges(),a=n.eles.nodes(),s=di(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:a.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:i.size(),temperature:n.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},l=n.eles.components(),c={},h=0;h<l.length;h++)for(var d=l[h],v=0;v<d.length;v++){var g=d[v];c[g.id()]=h}for(var h=0;h<o.nodeSize;h++){var m=a[h],x=m.layoutDimensions(n),y={};y.isLocked=m.locked(),y.id=m.data("id"),y.parentId=m.data("parent"),y.cmptId=c[m.id()],y.children=[],y.positionX=m.position("x"),y.positionY=m.position("y"),y.offsetX=0,y.offsetY=0,y.height=x.w,y.width=x.h,y.maxX=y.positionX+y.width/2,y.minX=y.positionX-y.width/2,y.maxY=y.positionY+y.height/2,y.minY=y.positionY-y.height/2,y.padLeft=parseFloat(m.style("padding")),y.padRight=parseFloat(m.style("padding")),y.padTop=parseFloat(m.style("padding")),y.padBottom=parseFloat(m.style("padding")),y.nodeRepulsion=en(n.nodeRepulsion)?n.nodeRepulsion(m):n.nodeRepulsion,o.layoutNodes.push(y),o.idToIndex[y.id]=h}for(var _=[],w=0,S=-1,A=[],h=0;h<o.nodeSize;h++){var m=o.layoutNodes[h],C=m.parentId;C!=null?o.layoutNodes[o.idToIndex[C]].children.push(m.id):(_[++S]=m.id,A.push(m.id))}for(o.graphSet.push(A);w<=S;){var M=_[w++],E=o.idToIndex[M],g=o.layoutNodes[E],O=g.children;if(O.length>0){o.graphSet.push(O);for(var h=0;h<O.length;h++)_[++S]=O[h]}}for(var h=0;h<o.graphSet.length;h++)for(var D=o.graphSet[h],v=0;v<D.length;v++){var I=o.idToIndex[D[v]];o.indexToGraph[I]=h}for(var h=0;h<o.edgeSize;h++){var k=i[h],U={};U.id=k.data("id"),U.sourceId=k.data("source"),U.targetId=k.data("target");var V=en(n.idealEdgeLength)?n.idealEdgeLength(k):n.idealEdgeLength,X=en(n.edgeElasticity)?n.edgeElasticity(k):n.edgeElasticity,W=o.idToIndex[U.sourceId],P=o.idToIndex[U.targetId],H=o.indexToGraph[W],z=o.indexToGraph[P];if(H!=z){for(var $=pj(U.sourceId,U.targetId,o),B=o.graphSet[$],L=0,y=o.layoutNodes[W];B.indexOf(y.id)===-1;)y=o.layoutNodes[o.idToIndex[y.parentId]],L++;for(y=o.layoutNodes[P];B.indexOf(y.id)===-1;)y=o.layoutNodes[o.idToIndex[y.parentId]],L++;V*=L*n.nestingFactor}U.idealLength=V,U.elasticity=X,o.layoutEdges.push(U)}return o},pj=function(e,t,n){var i=UR(e,t,0,n);return 2>i.count?0:i.graph},UR=function(e,t,n,i){var a=i.graphSet[n];if(-1<a.indexOf(e)&&-1<a.indexOf(t))return{count:2,graph:n};for(var s=0,o=0;o<a.length;o++){var l=a[o],c=i.idToIndex[l],h=i.layoutNodes[c].children;if(h.length!==0){var d=i.indexToGraph[i.idToIndex[h[0]]],v=UR(e,t,d,i);if(v.count!==0)if(v.count===1){if(s++,s===2)break}else return v}}return{count:s,graph:n}},gj,mj=function(e,t){for(var n=e.clientWidth,i=e.clientHeight,a=0;a<e.nodeSize;a++){var s=e.layoutNodes[a];s.children.length===0&&!s.isLocked&&(s.positionX=Math.random()*n,s.positionY=Math.random()*i)}},GR=function(e,t,n){var i=e.boundingBox,a={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return t.boundingBox&&(n.forEach(function(s){var o=e.layoutNodes[e.idToIndex[s.data("id")]];a.x1=Math.min(a.x1,o.positionX),a.x2=Math.max(a.x2,o.positionX),a.y1=Math.min(a.y1,o.positionY),a.y2=Math.max(a.y2,o.positionY)}),a.w=a.x2-a.x1,a.h=a.y2-a.y1),function(s,o){var l=e.layoutNodes[e.idToIndex[s.data("id")]];if(t.boundingBox){var c=a.w===0?.5:(l.positionX-a.x1)/a.w,h=a.h===0?.5:(l.positionY-a.y1)/a.h;return{x:i.x1+c*i.w,y:i.y1+h*i.h}}else return{x:l.positionX,y:l.positionY}}},yj=function(e,t,n){var i=n.layout,a=n.eles.nodes(),s=GR(e,n,a);a.positions(s),e.ready!==!0&&(e.ready=!0,i.one("layoutready",n.ready),i.emit({type:"layoutready",layout:this}))},bj=function(e,t,n){xj(e,t),Sj(e),Ej(e,t),Tj(e),Cj(e)},xj=function(e,t){for(var n=0;n<e.graphSet.length;n++)for(var i=e.graphSet[n],a=i.length,s=0;s<a;s++)for(var o=e.layoutNodes[e.idToIndex[i[s]]],l=s+1;l<a;l++){var c=e.layoutNodes[e.idToIndex[i[l]]];_j(o,c,e,t)}},r7=function(e){return-1+2*e*Math.random()},_j=function(e,t,n,i){var a=e.cmptId,s=t.cmptId;if(!(a!==s&&!n.isCompound)){var o=t.positionX-e.positionX,l=t.positionY-e.positionY,c=1;o===0&&l===0&&(o=r7(c),l=r7(c));var h=wj(e,t,o,l);if(h>0)var d=i.nodeOverlap*h,v=Math.sqrt(o*o+l*l),g=d*o/v,m=d*l/v;else var x=Np(e,o,l),y=Np(t,-1*o,-1*l),_=y.x-x.x,w=y.y-x.y,S=_*_+w*w,v=Math.sqrt(S),d=(e.nodeRepulsion+t.nodeRepulsion)/S,g=d*_/v,m=d*w/v;e.isLocked||(e.offsetX-=g,e.offsetY-=m),t.isLocked||(t.offsetX+=g,t.offsetY+=m)}},wj=function(e,t,n,i){if(n>0)var a=e.maxX-t.minX;else var a=t.maxX-e.minX;if(i>0)var s=e.maxY-t.minY;else var s=t.maxY-e.minY;return a>=0&&s>=0?Math.sqrt(a*a+s*s):0},Np=function(e,t,n){var i=e.positionX,a=e.positionY,s=e.height||1,o=e.width||1,l=n/t,c=s/o,h={};return t===0&&0<n||t===0&&0>n?(h.x=i,h.y=a+s/2,h):0<t&&-1*c<=l&&l<=c?(h.x=i+o/2,h.y=a+o*n/2/t,h):0>t&&-1*c<=l&&l<=c?(h.x=i-o/2,h.y=a-o*n/2/t,h):0<n&&(l<=-1*c||l>=c)?(h.x=i+s*t/2/n,h.y=a+s/2,h):(0>n&&(l<=-1*c||l>=c)&&(h.x=i-s*t/2/n,h.y=a-s/2),h)},Sj=function(e,t){for(var n=0;n<e.edgeSize;n++){var i=e.layoutEdges[n],a=e.idToIndex[i.sourceId],s=e.layoutNodes[a],o=e.idToIndex[i.targetId],l=e.layoutNodes[o],c=l.positionX-s.positionX,h=l.positionY-s.positionY;if(!(c===0&&h===0)){var d=Np(s,c,h),v=Np(l,-1*c,-1*h),g=v.x-d.x,m=v.y-d.y,x=Math.sqrt(g*g+m*m),y=Math.pow(i.idealLength-x,2)/i.elasticity;if(x!==0)var _=y*g/x,w=y*m/x;else var _=0,w=0;s.isLocked||(s.offsetX+=_,s.offsetY+=w),l.isLocked||(l.offsetX-=_,l.offsetY-=w)}}},Ej=function(e,t){if(t.gravity!==0)for(var n=1,i=0;i<e.graphSet.length;i++){var a=e.graphSet[i],s=a.length;if(i===0)var o=e.clientHeight/2,l=e.clientWidth/2;else var c=e.layoutNodes[e.idToIndex[a[0]]],h=e.layoutNodes[e.idToIndex[c.parentId]],o=h.positionX,l=h.positionY;for(var d=0;d<s;d++){var v=e.layoutNodes[e.idToIndex[a[d]]];if(!v.isLocked){var g=o-v.positionX,m=l-v.positionY,x=Math.sqrt(g*g+m*m);if(x>n){var y=t.gravity*g/x,_=t.gravity*m/x;v.offsetX+=y,v.offsetY+=_}}}}},Tj=function(e,t){var n=[],i=0,a=-1;for(n.push.apply(n,e.graphSet[0]),a+=e.graphSet[0].length;i<=a;){var s=n[i++],o=e.idToIndex[s],l=e.layoutNodes[o],c=l.children;if(0<c.length&&!l.isLocked){for(var h=l.offsetX,d=l.offsetY,v=0;v<c.length;v++){var g=e.layoutNodes[e.idToIndex[c[v]]];g.offsetX+=h,g.offsetY+=d,n[++a]=c[v]}l.offsetX=0,l.offsetY=0}}},Cj=function(e,t){for(var n=0;n<e.nodeSize;n++){var i=e.layoutNodes[n];0<i.children.length&&(i.maxX=void 0,i.minX=void 0,i.maxY=void 0,i.minY=void 0)}for(var n=0;n<e.nodeSize;n++){var i=e.layoutNodes[n];if(!(0<i.children.length||i.isLocked)){var a=Aj(i.offsetX,i.offsetY,e.temperature);i.positionX+=a.x,i.positionY+=a.y,i.offsetX=0,i.offsetY=0,i.minX=i.positionX-i.width,i.maxX=i.positionX+i.width,i.minY=i.positionY-i.height,i.maxY=i.positionY+i.height,HR(i,e)}}for(var n=0;n<e.nodeSize;n++){var i=e.layoutNodes[n];0<i.children.length&&!i.isLocked&&(i.positionX=(i.maxX+i.minX)/2,i.positionY=(i.maxY+i.minY)/2,i.width=i.maxX-i.minX,i.height=i.maxY-i.minY)}},Aj=function(e,t,n){var i=Math.sqrt(e*e+t*t);if(i>n)var a={x:n*e/i,y:n*t/i};else var a={x:e,y:t};return a},HR=function(e,t){var n=e.parentId;if(n!=null){var i=t.layoutNodes[t.idToIndex[n]],a=!1;if((i.maxX==null||e.maxX+i.padRight>i.maxX)&&(i.maxX=e.maxX+i.padRight,a=!0),(i.minX==null||e.minX-i.padLeft<i.minX)&&(i.minX=e.minX-i.padLeft,a=!0),(i.maxY==null||e.maxY+i.padBottom>i.maxY)&&(i.maxY=e.maxY+i.padBottom,a=!0),(i.minY==null||e.minY-i.padTop<i.minY)&&(i.minY=e.minY-i.padTop,a=!0),a)return HR(i,t)}},n7=function(e,t){for(var n=e.layoutNodes,i=[],a=0;a<n.length;a++){var s=n[a],o=s.cmptId,l=i[o]=i[o]||[];l.push(s)}for(var c=0,a=0;a<i.length;a++){var h=i[a];if(h){h.x1=1/0,h.x2=-1/0,h.y1=1/0,h.y2=-1/0;for(var d=0;d<h.length;d++){var v=h[d];h.x1=Math.min(h.x1,v.positionX-v.width/2),h.x2=Math.max(h.x2,v.positionX+v.width/2),h.y1=Math.min(h.y1,v.positionY-v.height/2),h.y2=Math.max(h.y2,v.positionY+v.height/2)}h.w=h.x2-h.x1,h.h=h.y2-h.y1,c+=h.w*h.h}}i.sort(function(w,S){return S.w*S.h-w.w*w.h});for(var g=0,m=0,x=0,y=0,_=Math.sqrt(c)*e.clientWidth/e.clientHeight,a=0;a<i.length;a++){var h=i[a];if(h){for(var d=0;d<h.length;d++){var v=h[d];v.isLocked||(v.positionX+=g-h.x1,v.positionY+=m-h.y1)}g+=h.w+t.componentSpacing,x+=h.w+t.componentSpacing,y=Math.max(y,h.h),x>_&&(m+=y+t.componentSpacing,g=0,x=0,y=0)}}},Mj={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function jR(r){this.options=Ct({},Mj,r)}jR.prototype.run=function(){var r=this.options,e=r,t=r.cy,n=e.eles,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));var a=di(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});if(a.h===0||a.w===0)n.nodes().layoutPositions(this,e,function(G){return{x:a.x1,y:a.y1}});else{var s=i.size(),o=Math.sqrt(s*a.h/a.w),l=Math.round(o),c=Math.round(a.w/a.h*o),h=function(re){if(re==null)return Math.min(l,c);var ie=Math.min(l,c);ie==l?l=re:c=re},d=function(re){if(re==null)return Math.max(l,c);var ie=Math.max(l,c);ie==l?l=re:c=re},v=e.rows,g=e.cols!=null?e.cols:e.columns;if(v!=null&&g!=null)l=v,c=g;else if(v!=null&&g==null)l=v,c=Math.ceil(s/l);else if(v==null&&g!=null)c=g,l=Math.ceil(s/c);else if(c*l>s){var m=h(),x=d();(m-1)*x>=s?h(m-1):(x-1)*m>=s&&d(x-1)}else for(;c*l<s;){var y=h(),_=d();(_+1)*y>=s?d(_+1):h(y+1)}var w=a.w/c,S=a.h/l;if(e.condense&&(w=0,S=0),e.avoidOverlap)for(var A=0;A<i.length;A++){var C=i[A],M=C._private.position;(M.x==null||M.y==null)&&(M.x=0,M.y=0);var E=C.layoutDimensions(e),O=e.avoidOverlapPadding,D=E.w+O,I=E.h+O;w=Math.max(w,D),S=Math.max(S,I)}for(var k={},U=function(re,ie){return!!k["c-"+re+"-"+ie]},V=function(re,ie){k["c-"+re+"-"+ie]=!0},X=0,W=0,P=function(){W++,W>=c&&(W=0,X++)},H={},z=0;z<i.length;z++){var $=i[z],B=e.position($);if(B&&(B.row!==void 0||B.col!==void 0)){var L={row:B.row,col:B.col};if(L.col===void 0)for(L.col=0;U(L.row,L.col);)L.col++;else if(L.row===void 0)for(L.row=0;U(L.row,L.col);)L.row++;H[$.id()]=L,V(L.row,L.col)}}var Y=function(re,ie){var le,ce;if(re.locked()||re.isParent())return!1;var _e=H[re.id()];if(_e)le=_e.col*w+w/2+a.x1,ce=_e.row*S+S/2+a.y1;else{for(;U(X,W);)P();le=W*w+w/2+a.x1,ce=X*S+S/2+a.y1,V(X,W),P()}return{x:le,y:ce}};i.layoutPositions(this,e,Y)}return this};var Rj={ready:function(){},stop:function(){}};function uw(r){this.options=Ct({},Rj,r)}uw.prototype.run=function(){var r=this.options,e=r.eles,t=this;return r.cy,t.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),t.one("layoutready",r.ready),t.emit("layoutready"),t.one("layoutstop",r.stop),t.emit("layoutstop"),this};uw.prototype.stop=function(){return this};var Oj={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function VR(r){this.options=Ct({},Oj,r)}VR.prototype.run=function(){var r=this.options,e=r.eles,t=e.nodes(),n=en(r.positions);function i(a){if(r.positions==null)return Qz(a.position());if(n)return r.positions(a);var s=r.positions[a._private.data.id];return s??null}return t.layoutPositions(this,r,function(a,s){var o=i(a);return a.locked()||o==null?!1:o}),this};var Dj={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function qR(r){this.options=Ct({},Dj,r)}qR.prototype.run=function(){var r=this.options,e=r.cy,t=r.eles,n=di(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),i=function(s,o){return{x:n.x1+Math.round(Math.random()*n.w),y:n.y1+Math.round(Math.random()*n.h)}};return t.nodes().layoutPositions(this,r,i),this};var Pj=[{name:"breadthfirst",impl:BR},{name:"circle",impl:FR},{name:"concentric",impl:zR},{name:"cose",impl:yg},{name:"grid",impl:jR},{name:"null",impl:uw},{name:"preset",impl:VR},{name:"random",impl:qR}];function XR(r){this.options=r,this.notifications=0}var i7=function(){},a7=function(){throw new Error("A headless instance can not render images")};XR.prototype={recalculateRenderedStyle:i7,notify:function(){this.notifications++},init:i7,isHeadless:function(){return!0},png:a7,jpg:a7};var cw={};cw.arrowShapeWidth=.3;cw.registerArrowShapes=function(){var r=this.arrowShapes={},e=this,t=function(c,h,d,v,g,m,x){var y=g.x-d/2-x,_=g.x+d/2+x,w=g.y-d/2-x,S=g.y+d/2+x,A=y<=c&&c<=_&&w<=h&&h<=S;return A},n=function(c,h,d,v,g){var m=c*Math.cos(v)-h*Math.sin(v),x=c*Math.sin(v)+h*Math.cos(v),y=m*d,_=x*d,w=y+g.x,S=_+g.y;return{x:w,y:S}},i=function(c,h,d,v){for(var g=[],m=0;m<c.length;m+=2){var x=c[m],y=c[m+1];g.push(n(x,y,h,d,v))}return g},a=function(c){for(var h=[],d=0;d<c.length;d++){var v=c[d];h.push(v.x,v.y)}return h},s=function(c){return c.pstyle("width").pfValue*c.pstyle("arrow-scale").pfValue*2},o=function(c,h){xt(h)&&(h=r[h]),r[c]=Ct({name:c,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(v,g,m,x,y,_){var w=a(i(this.points,m+2*_,x,y)),S=Mi(v,g,w);return S},roughCollide:t,draw:function(v,g,m,x){var y=i(this.points,g,m,x);e.arrowShapeImpl("polygon")(v,y)},spacing:function(v){return 0},gap:s},h)};o("none",{collide:Mp,roughCollide:Mp,draw:$_,spacing:b6,gap:b6}),o("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),o("arrow","triangle"),o("triangle-backcurve",{points:r.triangle.points,controlPoint:[0,-.15],roughCollide:t,draw:function(c,h,d,v,g){var m=i(this.points,h,d,v),x=this.controlPoint,y=n(x[0],x[1],h,d,v);e.arrowShapeImpl(this.name)(c,m,y)},gap:function(c){return s(c)*.8}}),o("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(c,h,d,v,g,m,x){var y=a(i(this.points,d+2*x,v,g)),_=a(i(this.pointsTee,d+2*x,v,g)),w=Mi(c,h,y)||Mi(c,h,_);return w},draw:function(c,h,d,v,g){var m=i(this.points,h,d,v),x=i(this.pointsTee,h,d,v);e.arrowShapeImpl(this.name)(c,m,x)}}),o("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(c,h,d,v,g,m,x){var y=g,_=Math.pow(y.x-c,2)+Math.pow(y.y-h,2)<=Math.pow((d+2*x)*this.radius,2),w=a(i(this.points,d+2*x,v,g));return Mi(c,h,w)||_},draw:function(c,h,d,v,g){var m=i(this.pointsTr,h,d,v);e.arrowShapeImpl(this.name)(c,m,v.x,v.y,this.radius*h)},spacing:function(c){return e.getArrowWidth(c.pstyle("width").pfValue,c.pstyle("arrow-scale").value)*this.radius}}),o("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(c,h){var d=this.baseCrossLinePts.slice(),v=h/c,g=3,m=5;return d[g]=d[g]-v,d[m]=d[m]-v,d},collide:function(c,h,d,v,g,m,x){var y=a(i(this.points,d+2*x,v,g)),_=a(i(this.crossLinePts(d,m),d+2*x,v,g)),w=Mi(c,h,y)||Mi(c,h,_);return w},draw:function(c,h,d,v,g){var m=i(this.points,h,d,v),x=i(this.crossLinePts(h,g),h,d,v);e.arrowShapeImpl(this.name)(c,m,x)}}),o("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(c){return s(c)*.525}}),o("circle",{radius:.15,collide:function(c,h,d,v,g,m,x){var y=g,_=Math.pow(y.x-c,2)+Math.pow(y.y-h,2)<=Math.pow((d+2*x)*this.radius,2);return _},draw:function(c,h,d,v,g){e.arrowShapeImpl(this.name)(c,v.x,v.y,this.radius*h)},spacing:function(c){return e.getArrowWidth(c.pstyle("width").pfValue,c.pstyle("arrow-scale").value)*this.radius}}),o("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(c){return 1},gap:function(c){return 1}}),o("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),o("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(c){return c.pstyle("width").pfValue*c.pstyle("arrow-scale").value}}),o("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(c){return .95*c.pstyle("width").pfValue*c.pstyle("arrow-scale").value}})};var xu={};xu.projectIntoViewport=function(r,e){var t=this.cy,n=this.findContainerClientCoords(),i=n[0],a=n[1],s=n[4],o=t.pan(),l=t.zoom(),c=((r-i)/s-o.x)/l,h=((e-a)/s-o.y)/l;return[c,h]};xu.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var r=this.container,e=r.getBoundingClientRect(),t=this.cy.window().getComputedStyle(r),n=function(_){return parseFloat(t.getPropertyValue(_))},i={left:n("padding-left"),right:n("padding-right"),top:n("padding-top"),bottom:n("padding-bottom")},a={left:n("border-left-width"),right:n("border-right-width"),top:n("border-top-width"),bottom:n("border-bottom-width")},s=r.clientWidth,o=r.clientHeight,l=i.left+i.right,c=i.top+i.bottom,h=a.left+a.right,d=e.width/(s+h),v=s-l,g=o-c,m=e.left+i.left+a.left,x=e.top+i.top+a.top;return this.containerBB=[m,x,v,g,d]};xu.invalidateContainerClientCoordsCache=function(){this.containerBB=null};xu.findNearestElement=function(r,e,t,n){return this.findNearestElements(r,e,t,n)[0]};xu.findNearestElements=function(r,e,t,n){var i=this,a=this,s=a.getCachedZSortedEles(),o=[],l=a.cy.zoom(),c=a.cy.hasCompoundNodes(),h=(n?24:8)/l,d=(n?8:2)/l,v=(n?8:2)/l,g=1/0,m,x;t&&(s=s.interactive);function y(E,O){if(E.isNode()){if(x)return;x=E,o.push(E)}if(E.isEdge()&&(O==null||O<g))if(m){if(m.pstyle("z-compound-depth").value===E.pstyle("z-compound-depth").value&&m.pstyle("z-compound-depth").value===E.pstyle("z-compound-depth").value){for(var D=0;D<o.length;D++)if(o[D].isEdge()){o[D]=E,m=E,g=O??g;break}}}else o.push(E),m=E,g=O??g}function _(E){var O=E.outerWidth()+2*d,D=E.outerHeight()+2*d,I=O/2,k=D/2,U=E.position(),V=E.pstyle("corner-radius").value==="auto"?"auto":E.pstyle("corner-radius").pfValue,X=E._private.rscratch;if(U.x-I<=r&&r<=U.x+I&&U.y-k<=e&&e<=U.y+k){var W=a.nodeShapes[i.getNodeShape(E)];if(W.checkPoint(r,e,0,O,D,U.x,U.y,V,X))return y(E,0),!0}}function w(E){var O=E._private,D=O.rscratch,I=E.pstyle("width").pfValue,k=E.pstyle("arrow-scale").value,U=I/2+h,V=U*U,X=U*2,z=O.source,$=O.target,W;if(D.edgeType==="segments"||D.edgeType==="straight"||D.edgeType==="haystack"){for(var P=D.allpts,H=0;H+3<P.length;H+=2)if(fU(r,e,P[H],P[H+1],P[H+2],P[H+3],X)&&V>(W=mU(r,e,P[H],P[H+1],P[H+2],P[H+3])))return y(E,W),!0}else if(D.edgeType==="bezier"||D.edgeType==="multibezier"||D.edgeType==="self"||D.edgeType==="compound"){for(var P=D.allpts,H=0;H+5<D.allpts.length;H+=4)if(dU(r,e,P[H],P[H+1],P[H+2],P[H+3],P[H+4],P[H+5],X)&&V>(W=gU(r,e,P[H],P[H+1],P[H+2],P[H+3],P[H+4],P[H+5])))return y(E,W),!0}for(var z=z||O.source,$=$||O.target,B=i.getArrowWidth(I,k),L=[{name:"source",x:D.arrowStartX,y:D.arrowStartY,angle:D.srcArrowAngle},{name:"target",x:D.arrowEndX,y:D.arrowEndY,angle:D.tgtArrowAngle},{name:"mid-source",x:D.midX,y:D.midY,angle:D.midsrcArrowAngle},{name:"mid-target",x:D.midX,y:D.midY,angle:D.midtgtArrowAngle}],H=0;H<L.length;H++){var Y=L[H],G=a.arrowShapes[E.pstyle(Y.name+"-arrow-shape").value],re=E.pstyle("width").pfValue;if(G.roughCollide(r,e,B,Y.angle,{x:Y.x,y:Y.y},re,h)&&G.collide(r,e,B,Y.angle,{x:Y.x,y:Y.y},re,h))return y(E),!0}c&&o.length>0&&(_(z),_($))}function S(E,O,D){return Ai(E,O,D)}function A(E,O){var D=E._private,I=v,k;O?k=O+"-":k="",E.boundingBox();var U=D.labelBounds[O||"main"],V=E.pstyle(k+"label").value,X=E.pstyle("text-events").strValue==="yes";if(!(!X||!V)){var W=S(D.rscratch,"labelX",O),P=S(D.rscratch,"labelY",O),H=S(D.rscratch,"labelAngle",O),z=E.pstyle(k+"text-margin-x").pfValue,$=E.pstyle(k+"text-margin-y").pfValue,B=U.x1-I-z,L=U.x2+I-z,Y=U.y1-I-$,G=U.y2+I-$;if(H){var re=Math.cos(H),ie=Math.sin(H),le=function(ye,Ee){return ye=ye-W,Ee=Ee-P,{x:ye*re-Ee*ie+W,y:ye*ie+Ee*re+P}},ce=le(B,Y),_e=le(B,G),pe=le(L,Y),ae=le(L,G),oe=[ce.x+z,ce.y+$,pe.x+z,pe.y+$,ae.x+z,ae.y+$,_e.x+z,_e.y+$];if(Mi(r,e,oe))return y(E),!0}else if(Fo(U,r,e))return y(E),!0}}for(var C=s.length-1;C>=0;C--){var M=s[C];M.isNode()?_(M)||A(M):w(M)||A(M)||A(M,"source")||A(M,"target")}return o};xu.getAllInBox=function(r,e,t,n){var i=this.getCachedZSortedEles().interactive,a=this.cy.zoom(),s=2/a,o=[],l=Math.min(r,t),c=Math.max(r,t),h=Math.min(e,n),d=Math.max(e,n);r=l,t=c,e=h,n=d;var v=di({x1:r,y1:e,x2:t,y2:n}),g=[{x:v.x1,y:v.y1},{x:v.x2,y:v.y1},{x:v.x2,y:v.y2},{x:v.x1,y:v.y2}],m=[[g[0],g[1]],[g[1],g[2]],[g[2],g[3]],[g[3],g[0]]];function x(ye,Ee,Re){return Ai(ye,Ee,Re)}function y(ye,Ee){var Re=ye._private,Ne=s,Be="";ye.boundingBox();var $e=Re.labelBounds.main;if(!$e)return null;var Ye=x(Re.rscratch,"labelX",Ee),He=x(Re.rscratch,"labelY",Ee),tt=x(Re.rscratch,"labelAngle",Ee),ot=ye.pstyle(Be+"text-margin-x").pfValue,ct=ye.pstyle(Be+"text-margin-y").pfValue,Ze=$e.x1-Ne-ot,bt=$e.x2+Ne-ot,Se=$e.y1-Ne-ct,ke=$e.y2+Ne-ct;if(tt){var We=Math.cos(tt),Ke=Math.sin(tt),rt=function(De,Q){return De=De-Ye,Q=Q-He,{x:De*We-Q*Ke+Ye,y:De*Ke+Q*We+He}};return[rt(Ze,Se),rt(bt,Se),rt(bt,ke),rt(Ze,ke)]}else return[{x:Ze,y:Se},{x:bt,y:Se},{x:bt,y:ke},{x:Ze,y:ke}]}function _(ye,Ee,Re,Ne){function Be($e,Ye,He){return(He.y-$e.y)*(Ye.x-$e.x)>(Ye.y-$e.y)*(He.x-$e.x)}return Be(ye,Re,Ne)!==Be(Ee,Re,Ne)&&Be(ye,Ee,Re)!==Be(ye,Ee,Ne)}for(var w=0;w<i.length;w++){var S=i[w];if(S.isNode()){var A=S,C=A.pstyle("text-events").strValue==="yes",M=A.pstyle("box-selection").strValue,E=A.pstyle("box-select-labels").strValue==="yes";if(M==="none")continue;var O=(M==="overlap"||E)&&C,D=A.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:O});if(M==="contain"){var I=!1;if(E&&C){var k=y(A);k&&P1(k,g)&&(o.push(A),I=!0)}!I&&J9(v,D)&&o.push(A)}else if(M==="overlap"&&J_(v,D)){var U=A.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1}),V=[{x:U.x1,y:U.y1},{x:U.x2,y:U.y1},{x:U.x2,y:U.y2},{x:U.x1,y:U.y2}];if(P1(V,g))o.push(A);else{var X=y(A);X&&P1(X,g)&&o.push(A)}}}else{var W=S,P=W._private,H=P.rscratch,z=W.pstyle("box-selection").strValue;if(z==="none")continue;if(z==="contain"){if(H.startX!=null&&H.startY!=null&&!Fo(v,H.startX,H.startY)||H.endX!=null&&H.endY!=null&&!Fo(v,H.endX,H.endY))continue;if(H.edgeType==="bezier"||H.edgeType==="multibezier"||H.edgeType==="self"||H.edgeType==="compound"||H.edgeType==="segments"||H.edgeType==="haystack"){for(var $=P.rstyle.bezierPts||P.rstyle.linePts||P.rstyle.haystackPts,B=!0,L=0;L<$.length;L++)if(!E6(v,$[L])){B=!1;break}B&&o.push(W)}else H.edgeType==="straight"&&o.push(W)}else if(z==="overlap"){var Y=!1;if(H.startX!=null&&H.startY!=null&&H.endX!=null&&H.endY!=null&&(Fo(v,H.startX,H.startY)||Fo(v,H.endX,H.endY)))o.push(W),Y=!0;else if(!Y&&H.edgeType==="haystack"){for(var G=P.rstyle.haystackPts,re=0;re<G.length;re++)if(E6(v,G[re])){o.push(W),Y=!0;break}}if(!Y){var ie=P.rstyle.bezierPts||P.rstyle.linePts||P.rstyle.haystackPts;if((!ie||ie.length<2)&&H.edgeType==="straight"&&H.startX!=null&&H.startY!=null&&H.endX!=null&&H.endY!=null&&(ie=[{x:H.startX,y:H.startY},{x:H.endX,y:H.endY}]),!ie||ie.length<2)continue;for(var le=0;le<ie.length-1;le++){for(var ce=ie[le],_e=ie[le+1],pe=0;pe<m.length;pe++){var ae=_n(m[pe],2),oe=ae[0],de=ae[1];if(_(ce,_e,oe,de)){o.push(W),Y=!0;break}}if(Y)break}}}}}return o};var Lp={};Lp.calculateArrowAngles=function(r){var e=r._private.rscratch,t=e.edgeType==="haystack",n=e.edgeType==="bezier",i=e.edgeType==="multibezier",a=e.edgeType==="segments",s=e.edgeType==="compound",o=e.edgeType==="self",l,c,h,d,v,g,_,w;if(t?(h=e.haystackPts[0],d=e.haystackPts[1],v=e.haystackPts[2],g=e.haystackPts[3]):(h=e.arrowStartX,d=e.arrowStartY,v=e.arrowEndX,g=e.arrowEndY),_=e.midX,w=e.midY,a)l=h-e.segpts[0],c=d-e.segpts[1];else if(i||s||o||n){var m=e.allpts,x=kn(m[0],m[2],m[4],.1),y=kn(m[1],m[3],m[5],.1);l=h-x,c=d-y}else l=h-_,c=d-w;e.srcArrowAngle=iv(l,c);var _=e.midX,w=e.midY;if(t&&(_=(h+v)/2,w=(d+g)/2),l=v-h,c=g-d,a){var m=e.allpts;if(m.length/2%2===0){var S=m.length/2,A=S-2;l=m[S]-m[A],c=m[S+1]-m[A+1]}else if(e.isRound)l=e.midVector[1],c=-e.midVector[0];else{var S=m.length/2-1,A=S-2;l=m[S]-m[A],c=m[S+1]-m[A+1]}}else if(i||s||o){var m=e.allpts,C=e.ctrlpts,M,E,O,D;if(C.length/2%2===0){var I=m.length/2-1,k=I+2,U=k+2;M=kn(m[I],m[k],m[U],0),E=kn(m[I+1],m[k+1],m[U+1],0),O=kn(m[I],m[k],m[U],1e-4),D=kn(m[I+1],m[k+1],m[U+1],1e-4)}else{var k=m.length/2-1,I=k-2,U=k+2;M=kn(m[I],m[k],m[U],.4999),E=kn(m[I+1],m[k+1],m[U+1],.4999),O=kn(m[I],m[k],m[U],.5),D=kn(m[I+1],m[k+1],m[U+1],.5)}l=O-M,c=D-E}if(e.midtgtArrowAngle=iv(l,c),e.midDispX=l,e.midDispY=c,l*=-1,c*=-1,a){var m=e.allpts;if(m.length/2%2!==0){if(!e.isRound){var S=m.length/2-1,V=S+2;l=-(m[V]-m[S]),c=-(m[V+1]-m[S+1])}}}if(e.midsrcArrowAngle=iv(l,c),a)l=v-e.segpts[e.segpts.length-2],c=g-e.segpts[e.segpts.length-1];else if(i||s||o||n){var m=e.allpts,X=m.length,x=kn(m[X-6],m[X-4],m[X-2],.9),y=kn(m[X-5],m[X-3],m[X-1],.9);l=v-x,c=g-y}else l=v-_,c=g-w;e.tgtArrowAngle=iv(l,c)};Lp.getArrowWidth=Lp.getArrowHeight=function(r,e){var t=this.arrowWidthCache=this.arrowWidthCache||{},n=t[r+", "+e];return n||(n=Math.max(Math.pow(r*13.37,.9),29)*e,t[r+", "+e]=n,n)};var h4,f4,Xa={},oa={},s7,o7,iu,lp,Ds,kl,$l,Ha,cc,fv,YR,WR,d4,v4,l7,u7=function(e,t,n){n.x=t.x-e.x,n.y=t.y-e.y,n.len=Math.sqrt(n.x*n.x+n.y*n.y),n.nx=n.x/n.len,n.ny=n.y/n.len,n.ang=Math.atan2(n.ny,n.nx)},Ij=function(e,t){t.x=e.x*-1,t.y=e.y*-1,t.nx=e.nx*-1,t.ny=e.ny*-1,t.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},Nj=function(e,t,n,i,a){if(e!==l7?u7(t,e,Xa):Ij(oa,Xa),u7(t,n,oa),s7=Xa.nx*oa.ny-Xa.ny*oa.nx,o7=Xa.nx*oa.nx-Xa.ny*-oa.ny,Ds=Math.asin(Math.max(-1,Math.min(1,s7))),Math.abs(Ds)<1e-6){h4=t.x,f4=t.y,$l=cc=0;return}iu=1,lp=!1,o7<0?Ds<0?Ds=Math.PI+Ds:(Ds=Math.PI-Ds,iu=-1,lp=!0):Ds>0&&(iu=-1,lp=!0),t.radius!==void 0?cc=t.radius:cc=i,kl=Ds/2,fv=Math.min(Xa.len/2,oa.len/2),a?(Ha=Math.abs(Math.cos(kl)*cc/Math.sin(kl)),Ha>fv?(Ha=fv,$l=Math.abs(Ha*Math.sin(kl)/Math.cos(kl))):$l=cc):(Ha=Math.min(fv,cc),$l=Math.abs(Ha*Math.sin(kl)/Math.cos(kl))),d4=t.x+oa.nx*Ha,v4=t.y+oa.ny*Ha,h4=d4-oa.ny*$l*iu,f4=v4+oa.nx*$l*iu,YR=t.x+Xa.nx*Ha,WR=t.y+Xa.ny*Ha,l7=t};function $R(r,e){e.radius===0?r.lineTo(e.cx,e.cy):r.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function hw(r,e,t,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(Nj(r,e,t,n,i),{cx:h4,cy:f4,radius:$l,startX:YR,startY:WR,stopX:d4,stopY:v4,startAngle:Xa.ang+Math.PI/2*iu,endAngle:oa.ang-Math.PI/2*iu,counterClockwise:lp})}var nd=.01,Lj=Math.sqrt(2*nd),ii={};ii.findMidptPtsEtc=function(r,e){var t=e.posPts,n=e.intersectionPts,i=e.vectorNormInverse,a,s=r.pstyle("source-endpoint"),o=r.pstyle("target-endpoint"),l=s.units!=null&&o.units!=null,c=function(C,M,E,O){var D=O-M,I=E-C,k=Math.sqrt(I*I+D*D);return{x:-D/k,y:I/k}},h=r.pstyle("edge-distances").value;switch(h){case"node-position":a=t;break;case"intersection":a=n;break;case"endpoints":{if(l){var d=this.manualEndptToPx(r.source()[0],s),v=_n(d,2),g=v[0],m=v[1],x=this.manualEndptToPx(r.target()[0],o),y=_n(x,2),_=y[0],w=y[1],S={x1:g,y1:m,x2:_,y2:w};i=c(g,m,_,w),a=S}else fr("Edge ".concat(r.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),a=n;break}}return{midptPts:a,vectorNormInverse:i}};ii.findHaystackPoints=function(r){for(var e=0;e<r.length;e++){var t=r[e],n=t._private,i=n.rscratch;if(!i.haystack){var a=Math.random()*2*Math.PI;i.source={x:Math.cos(a),y:Math.sin(a)},a=Math.random()*2*Math.PI,i.target={x:Math.cos(a),y:Math.sin(a)}}var s=n.source,o=n.target,l=s.position(),c=o.position(),h=s.width(),d=o.width(),v=s.height(),g=o.height(),m=t.pstyle("haystack-radius").value,x=m/2;i.haystackPts=i.allpts=[i.source.x*h*x+l.x,i.source.y*v*x+l.y,i.target.x*d*x+c.x,i.target.y*g*x+c.y],i.midX=(i.allpts[0]+i.allpts[2])/2,i.midY=(i.allpts[1]+i.allpts[3])/2,i.edgeType="haystack",i.haystack=!0,this.storeEdgeProjections(t),this.calculateArrowAngles(t),this.recalculateEdgeLabelProjections(t),this.calculateLabelAngles(t)}};ii.findSegmentsPoints=function(r,e){var t=r._private.rscratch,n=r.pstyle("segment-weights"),i=r.pstyle("segment-distances"),a=r.pstyle("segment-radii"),s=r.pstyle("radius-type"),o=Math.min(n.pfValue.length,i.pfValue.length),l=a.pfValue[a.pfValue.length-1],c=s.pfValue[s.pfValue.length-1];t.edgeType="segments",t.segpts=[],t.radii=[],t.isArcRadius=[];for(var h=0;h<o;h++){var d=n.pfValue[h],v=i.pfValue[h],g=1-d,m=d,x=this.findMidptPtsEtc(r,e),y=x.midptPts,_=x.vectorNormInverse,w={x:y.x1*g+y.x2*m,y:y.y1*g+y.y2*m};t.segpts.push(w.x+_.x*v,w.y+_.y*v),t.radii.push(a.pfValue[h]!==void 0?a.pfValue[h]:l),t.isArcRadius.push((s.pfValue[h]!==void 0?s.pfValue[h]:c)==="arc-radius")}};ii.findLoopPoints=function(r,e,t,n){var i=r._private.rscratch,a=e.dirCounts,s=e.srcPos,o=r.pstyle("control-point-distances"),l=o?o.pfValue[0]:void 0,c=r.pstyle("loop-direction").pfValue,h=r.pstyle("loop-sweep").pfValue,d=r.pstyle("control-point-step-size").pfValue;i.edgeType="self";var v=t,g=d;n&&(v=0,g=l);var m=c-Math.PI/2,x=m-h/2,y=m+h/2,_=c+"_"+h;v=a[_]===void 0?a[_]=0:++a[_],i.ctrlpts=[s.x+Math.cos(x)*1.4*g*(v/3+1),s.y+Math.sin(x)*1.4*g*(v/3+1),s.x+Math.cos(y)*1.4*g*(v/3+1),s.y+Math.sin(y)*1.4*g*(v/3+1)]};ii.findCompoundLoopPoints=function(r,e,t,n){var i=r._private.rscratch;i.edgeType="compound";var a=e.srcPos,s=e.tgtPos,o=e.srcW,l=e.srcH,c=e.tgtW,h=e.tgtH,d=r.pstyle("control-point-step-size").pfValue,v=r.pstyle("control-point-distances"),g=v?v.pfValue[0]:void 0,m=t,x=d;n&&(m=0,x=g);var y=50,_={x:a.x-o/2,y:a.y-l/2},w={x:s.x-c/2,y:s.y-h/2},S={x:Math.min(_.x,w.x),y:Math.min(_.y,w.y)},A=.5,C=Math.max(A,Math.log(o*nd)),M=Math.max(A,Math.log(c*nd));i.ctrlpts=[S.x,S.y-(1+Math.pow(y,1.12)/100)*x*(m/3+1)*C,S.x-(1+Math.pow(y,1.12)/100)*x*(m/3+1)*M,S.y]};ii.findStraightEdgePoints=function(r){r._private.rscratch.edgeType="straight"};ii.findBezierPoints=function(r,e,t,n,i){var a=r._private.rscratch,s=r.pstyle("control-point-step-size").pfValue,o=r.pstyle("control-point-distances"),l=r.pstyle("control-point-weights"),c=o&&l?Math.min(o.value.length,l.value.length):1,h=o?o.pfValue[0]:void 0,d=l.value[0],v=n;a.edgeType=v?"multibezier":"bezier",a.ctrlpts=[];for(var g=0;g<c;g++){var m=(.5-e.eles.length/2+t)*s*(i?-1:1),x=void 0,y=Q_(m);v&&(h=o?o.pfValue[g]:s,d=l.value[g]),n?x=h:x=h!==void 0?y*h:void 0;var _=x!==void 0?x:m,w=1-d,S=d,A=this.findMidptPtsEtc(r,e),C=A.midptPts,M=A.vectorNormInverse,E={x:C.x1*w+C.x2*S,y:C.y1*w+C.y2*S};a.ctrlpts.push(E.x+M.x*_,E.y+M.y*_)}};ii.findTaxiPoints=function(r,e){var t=r._private.rscratch;t.edgeType="segments";var n="vertical",i="horizontal",a="leftward",s="rightward",o="downward",l="upward",c="auto",h=e.posPts,d=e.srcW,v=e.srcH,g=e.tgtW,m=e.tgtH,x=r.pstyle("edge-distances").value,y=x!=="node-position",_=r.pstyle("taxi-direction").value,w=_,S=r.pstyle("taxi-turn"),A=S.units==="%",C=S.pfValue,M=C<0,E=r.pstyle("taxi-turn-min-distance").pfValue,O=y?(d+g)/2:0,D=y?(v+m)/2:0,I=h.x2-h.x1,k=h.y2-h.y1,U=function(Q,ne){return Q>0?Math.max(Q-ne,0):Math.min(Q+ne,0)},V=U(I,O),X=U(k,D),W=!1;w===c?_=Math.abs(V)>Math.abs(X)?i:n:w===l||w===o?(_=n,W=!0):(w===a||w===s)&&(_=i,W=!0);var P=_===n,H=P?X:V,z=P?k:I,$=Q_(z),B=!1;!(W&&(A||M))&&(w===o&&z<0||w===l&&z>0||w===a&&z>0||w===s&&z<0)&&($*=-1,H=$*Math.abs(H),B=!0);var L;if(A){var Y=C<0?1+C:C;L=Y*H}else{var G=C<0?H:0;L=G+C*$}var re=function(Q){return Math.abs(Q)<E||Math.abs(Q)>=Math.abs(H)},ie=re(L),le=re(Math.abs(H)-Math.abs(L)),ce=ie||le;if(ce&&!B)if(P){var _e=Math.abs(z)<=v/2,pe=Math.abs(I)<=g/2;if(_e){var ae=(h.x1+h.x2)/2,oe=h.y1,de=h.y2;t.segpts=[ae,oe,ae,de]}else if(pe){var ye=(h.y1+h.y2)/2,Ee=h.x1,Re=h.x2;t.segpts=[Ee,ye,Re,ye]}else t.segpts=[h.x1,h.y2]}else{var Ne=Math.abs(z)<=d/2,Be=Math.abs(k)<=m/2;if(Ne){var $e=(h.y1+h.y2)/2,Ye=h.x1,He=h.x2;t.segpts=[Ye,$e,He,$e]}else if(Be){var tt=(h.x1+h.x2)/2,ot=h.y1,ct=h.y2;t.segpts=[tt,ot,tt,ct]}else t.segpts=[h.x2,h.y1]}else if(P){var Ze=h.y1+L+(y?v/2*$:0),bt=h.x1,Se=h.x2;t.segpts=[bt,Ze,Se,Ze]}else{var ke=h.x1+L+(y?d/2*$:0),We=h.y1,Ke=h.y2;t.segpts=[ke,We,ke,Ke]}if(t.isRound){var rt=r.pstyle("taxi-radius").value,nt=r.pstyle("radius-type").value[0]==="arc-radius";t.radii=new Array(t.segpts.length/2).fill(rt),t.isArcRadius=new Array(t.segpts.length/2).fill(nt)}};ii.tryToCorrectInvalidPoints=function(r,e){var t=r._private.rscratch;if(t.edgeType==="bezier"){var n=e.srcPos,i=e.tgtPos,a=e.srcW,s=e.srcH,o=e.tgtW,l=e.tgtH,c=e.srcShape,h=e.tgtShape,d=e.srcCornerRadius,v=e.tgtCornerRadius,g=e.srcRs,m=e.tgtRs,x=!ut(t.startX)||!ut(t.startY),y=!ut(t.arrowStartX)||!ut(t.arrowStartY),_=!ut(t.endX)||!ut(t.endY),w=!ut(t.arrowEndX)||!ut(t.arrowEndY),S=3,A=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth,C=S*A,M=hu({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.startX,y:t.startY}),E=M<C,O=hu({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.endX,y:t.endY}),D=O<C,I=!1;if(x||y||E){I=!0;var k={x:t.ctrlpts[0]-n.x,y:t.ctrlpts[1]-n.y},U=Math.sqrt(k.x*k.x+k.y*k.y),V={x:k.x/U,y:k.y/U},X=Math.max(a,s),W={x:t.ctrlpts[0]+V.x*2*X,y:t.ctrlpts[1]+V.y*2*X},P=c.intersectLine(n.x,n.y,a,s,W.x,W.y,0,d,g);E?(t.ctrlpts[0]=t.ctrlpts[0]+V.x*(C-M),t.ctrlpts[1]=t.ctrlpts[1]+V.y*(C-M)):(t.ctrlpts[0]=P[0]+V.x*C,t.ctrlpts[1]=P[1]+V.y*C)}if(_||w||D){I=!0;var H={x:t.ctrlpts[0]-i.x,y:t.ctrlpts[1]-i.y},z=Math.sqrt(H.x*H.x+H.y*H.y),$={x:H.x/z,y:H.y/z},B=Math.max(a,s),L={x:t.ctrlpts[0]+$.x*2*B,y:t.ctrlpts[1]+$.y*2*B},Y=h.intersectLine(i.x,i.y,o,l,L.x,L.y,0,v,m);D?(t.ctrlpts[0]=t.ctrlpts[0]+$.x*(C-O),t.ctrlpts[1]=t.ctrlpts[1]+$.y*(C-O)):(t.ctrlpts[0]=Y[0]+$.x*C,t.ctrlpts[1]=Y[1]+$.y*C)}I&&this.findEndpoints(r)}};ii.storeAllpts=function(r){var e=r._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var t=0;t+1<e.ctrlpts.length;t+=2)e.allpts.push(e.ctrlpts[t],e.ctrlpts[t+1]),t+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[t]+e.ctrlpts[t+2])/2,(e.ctrlpts[t+1]+e.ctrlpts[t+3])/2);e.allpts.push(e.endX,e.endY);var n,i;e.ctrlpts.length/2%2===0?(n=e.allpts.length/2-1,e.midX=e.allpts[n],e.midY=e.allpts[n+1]):(n=e.allpts.length/2-3,i=.5,e.midX=kn(e.allpts[n],e.allpts[n+2],e.allpts[n+4],i),e.midY=kn(e.allpts[n+1],e.allpts[n+3],e.allpts[n+5],i))}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments"){if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.isRound){e.roundCorners=[];for(var a=2;a+3<e.allpts.length;a+=2){var s=e.radii[a/2-1],o=e.isArcRadius[a/2-1];e.roundCorners.push(hw({x:e.allpts[a-2],y:e.allpts[a-1]},{x:e.allpts[a],y:e.allpts[a+1],radius:s},{x:e.allpts[a+2],y:e.allpts[a+3]},s,o))}}if(e.segpts.length%4===0){var l=e.segpts.length/2,c=l-2;e.midX=(e.segpts[c]+e.segpts[l])/2,e.midY=(e.segpts[c+1]+e.segpts[l+1])/2}else{var h=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[h],e.midY=e.segpts[h+1];else{var d={x:e.segpts[h],y:e.segpts[h+1]},v=e.roundCorners[h/2];if(v.radius===0){var g={x:e.segpts[h+2],y:e.segpts[h+3]};e.midX=d.x,e.midY=d.y,e.midVector=[d.y-g.y,g.x-d.x]}else{var m=[d.x-v.cx,d.y-v.cy],x=v.radius/Math.sqrt(Math.pow(m[0],2)+Math.pow(m[1],2));m=m.map(function(y){return y*x}),e.midX=v.cx+m[0],e.midY=v.cy+m[1],e.midVector=m}}}}};ii.checkForInvalidEdgeWarning=function(r){var e=r[0]._private.rscratch;e.nodesOverlap||ut(e.startX)&&ut(e.startY)&&ut(e.endX)&&ut(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,fr("Edge `"+r.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))};ii.findEdgeControlPoints=function(r){var e=this;if(!(!r||r.length===0)){for(var t=this,n=t.cy,i=n.hasCompoundNodes(),a=new zs,s=function(D,I){return[].concat(Tp(D),[I?1:0]).join("-")},o=[],l=[],c=0;c<r.length;c++){var h=r[c],d=h._private,v=h.pstyle("curve-style").value;if(!(h.removed()||!h.takesUpSpace())){if(v==="haystack"){l.push(h);continue}var g=v==="unbundled-bezier"||Bo(v,"segments")||v==="straight"||v==="straight-triangle"||Bo(v,"taxi"),m=v==="unbundled-bezier"||v==="bezier",x=d.source,y=d.target,_=x.poolIndex(),w=y.poolIndex(),S=[_,w].sort(),A=s(S,g),C=a.get(A);C==null&&(C={eles:[]},o.push({pairId:S,edgeIsUnbundled:g}),a.set(A,C)),C.eles.push(h),g&&(C.hasUnbundled=!0),m&&(C.hasBezier=!0)}}for(var M=function(){var D=o[E],I=D.pairId,k=D.edgeIsUnbundled,U=s(I,k),V=a.get(U),X;if(!V.hasUnbundled){var W=V.eles[0].parallelEdges().filter(function(nt){return nt.isBundledBezier()});K_(V.eles),W.forEach(function(nt){return V.eles.push(nt)}),V.eles.sort(function(nt,De){return nt.poolIndex()-De.poolIndex()})}var P=V.eles[0],H=P.source(),z=P.target();if(H.poolIndex()>z.poolIndex()){var $=H;H=z,z=$}var B=V.srcPos=H.position(),L=V.tgtPos=z.position(),Y=V.srcW=H.outerWidth(),G=V.srcH=H.outerHeight(),re=V.tgtW=z.outerWidth(),ie=V.tgtH=z.outerHeight(),le=V.srcShape=t.nodeShapes[e.getNodeShape(H)],ce=V.tgtShape=t.nodeShapes[e.getNodeShape(z)],_e=V.srcCornerRadius=H.pstyle("corner-radius").value==="auto"?"auto":H.pstyle("corner-radius").pfValue,pe=V.tgtCornerRadius=z.pstyle("corner-radius").value==="auto"?"auto":z.pstyle("corner-radius").pfValue,ae=V.tgtRs=z._private.rscratch,oe=V.srcRs=H._private.rscratch;V.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var de=0;de<V.eles.length;de++){var ye=V.eles[de],Ee=ye[0]._private.rscratch,Re=ye.pstyle("curve-style").value,Ne=Re==="unbundled-bezier"||Bo(Re,"segments")||Bo(Re,"taxi"),Be=!H.same(ye.source());if(!V.calculatedIntersection&&H!==z&&(V.hasBezier||V.hasUnbundled)){V.calculatedIntersection=!0;var $e=le.intersectLine(B.x,B.y,Y,G,L.x,L.y,0,_e,oe),Ye=V.srcIntn=$e,He=ce.intersectLine(L.x,L.y,re,ie,B.x,B.y,0,pe,ae),tt=V.tgtIntn=He,ot=V.intersectionPts={x1:$e[0],x2:He[0],y1:$e[1],y2:He[1]},ct=V.posPts={x1:B.x,x2:L.x,y1:B.y,y2:L.y},Ze=He[1]-$e[1],bt=He[0]-$e[0],Se=Math.sqrt(bt*bt+Ze*Ze);ut(Se)&&Se>=Lj||(Se=Math.sqrt(Math.max(bt*bt,nd)+Math.max(Ze*Ze,nd)));var ke=V.vector={x:bt,y:Ze},We=V.vectorNorm={x:ke.x/Se,y:ke.y/Se},Ke={x:-We.y,y:We.x};V.nodesOverlap=!ut(Se)||ce.checkPoint($e[0],$e[1],0,re,ie,L.x,L.y,pe,ae)||le.checkPoint(He[0],He[1],0,Y,G,B.x,B.y,_e,oe),V.vectorNormInverse=Ke,X={nodesOverlap:V.nodesOverlap,dirCounts:V.dirCounts,calculatedIntersection:!0,hasBezier:V.hasBezier,hasUnbundled:V.hasUnbundled,eles:V.eles,srcPos:L,srcRs:ae,tgtPos:B,tgtRs:oe,srcW:re,srcH:ie,tgtW:Y,tgtH:G,srcIntn:tt,tgtIntn:Ye,srcShape:ce,tgtShape:le,posPts:{x1:ct.x2,y1:ct.y2,x2:ct.x1,y2:ct.y1},intersectionPts:{x1:ot.x2,y1:ot.y2,x2:ot.x1,y2:ot.y1},vector:{x:-ke.x,y:-ke.y},vectorNorm:{x:-We.x,y:-We.y},vectorNormInverse:{x:-Ke.x,y:-Ke.y}}}var rt=Be?X:V;Ee.nodesOverlap=rt.nodesOverlap,Ee.srcIntn=rt.srcIntn,Ee.tgtIntn=rt.tgtIntn,Ee.isRound=Re.startsWith("round"),i&&(H.isParent()||H.isChild()||z.isParent()||z.isChild())&&(H.parents().anySame(z)||z.parents().anySame(H)||H.same(z)&&H.isParent())?e.findCompoundLoopPoints(ye,rt,de,Ne):H===z?e.findLoopPoints(ye,rt,de,Ne):Re.endsWith("segments")?e.findSegmentsPoints(ye,rt):Re.endsWith("taxi")?e.findTaxiPoints(ye,rt):Re==="straight"||!Ne&&V.eles.length%2===1&&de===Math.floor(V.eles.length/2)?e.findStraightEdgePoints(ye):e.findBezierPoints(ye,rt,de,Ne,Be),e.findEndpoints(ye),e.tryToCorrectInvalidPoints(ye,rt),e.checkForInvalidEdgeWarning(ye),e.storeAllpts(ye),e.storeEdgeProjections(ye),e.calculateArrowAngles(ye),e.recalculateEdgeLabelProjections(ye),e.calculateLabelAngles(ye)}},E=0;E<o.length;E++)M();this.findHaystackPoints(l)}};function KR(r){var e=[];if(r!=null){for(var t=0;t<r.length;t+=2){var n=r[t],i=r[t+1];e.push({x:n,y:i})}return e}}ii.getSegmentPoints=function(r){var e=r[0]._private.rscratch;this.recalculateRenderedStyle(r);var t=e.edgeType;if(t==="segments")return KR(e.segpts)};ii.getControlPoints=function(r){var e=r[0]._private.rscratch;this.recalculateRenderedStyle(r);var t=e.edgeType;if(t==="bezier"||t==="multibezier"||t==="self"||t==="compound")return KR(e.ctrlpts)};ii.getEdgeMidpoint=function(r){var e=r[0]._private.rscratch;return this.recalculateRenderedStyle(r),{x:e.midX,y:e.midY}};var Id={};Id.manualEndptToPx=function(r,e){var t=this,n=r.position(),i=r.outerWidth(),a=r.outerHeight(),s=r._private.rscratch;if(e.value.length===2){var o=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(o[0]=o[0]*i),e.units[1]==="%"&&(o[1]=o[1]*a),o[0]+=n.x,o[1]+=n.y,o}else{var l=e.pfValue[0];l=-Math.PI/2+l;var c=2*Math.max(i,a),h=[n.x+Math.cos(l)*c,n.y+Math.sin(l)*c];return t.nodeShapes[this.getNodeShape(r)].intersectLine(n.x,n.y,i,a,h[0],h[1],0,r.pstyle("corner-radius").value==="auto"?"auto":r.pstyle("corner-radius").pfValue,s)}};Id.findEndpoints=function(r){var e,t,n,i,a=this,s,o=r.source()[0],l=r.target()[0],c=o.position(),h=l.position(),d=r.pstyle("target-arrow-shape").value,v=r.pstyle("source-arrow-shape").value,g=r.pstyle("target-distance-from-node").pfValue,m=r.pstyle("source-distance-from-node").pfValue,x=o._private.rscratch,y=l._private.rscratch,_=r.pstyle("curve-style").value,w=r._private.rscratch,S=w.edgeType,A=Bo(_,"taxi"),C=S==="self"||S==="compound",M=S==="bezier"||S==="multibezier"||C,E=S!=="bezier",O=S==="straight"||S==="segments",D=S==="segments",I=M||E||O,k=C||A,U=r.pstyle("source-endpoint"),V=k?"outside-to-node":U.value,X=o.pstyle("corner-radius").value==="auto"?"auto":o.pstyle("corner-radius").pfValue,W=r.pstyle("target-endpoint"),P=k?"outside-to-node":W.value,H=l.pstyle("corner-radius").value==="auto"?"auto":l.pstyle("corner-radius").pfValue;w.srcManEndpt=U,w.tgtManEndpt=W;var z,$,B,L,Y=(e=(W==null||(t=W.pfValue)===null||t===void 0?void 0:t.length)===2?W.pfValue:null)!==null&&e!==void 0?e:[0,0],G=(n=(U==null||(i=U.pfValue)===null||i===void 0?void 0:i.length)===2?U.pfValue:null)!==null&&n!==void 0?n:[0,0];if(M){var re=[w.ctrlpts[0],w.ctrlpts[1]],ie=E?[w.ctrlpts[w.ctrlpts.length-2],w.ctrlpts[w.ctrlpts.length-1]]:re;z=ie,$=re}else if(O){var le=D?w.segpts.slice(0,2):[h.x+Y[0],h.y+Y[1]],ce=D?w.segpts.slice(w.segpts.length-2):[c.x+G[0],c.y+G[1]];z=ce,$=le}if(P==="inside-to-node")s=[h.x,h.y];else if(W.units)s=this.manualEndptToPx(l,W);else if(P==="outside-to-line")s=w.tgtIntn;else if(P==="outside-to-node"||P==="outside-to-node-or-label"?B=z:(P==="outside-to-line"||P==="outside-to-line-or-label")&&(B=[c.x,c.y]),s=a.nodeShapes[this.getNodeShape(l)].intersectLine(h.x,h.y,l.outerWidth(),l.outerHeight(),B[0],B[1],0,H,y),P==="outside-to-node-or-label"||P==="outside-to-line-or-label"){var _e=l._private.rscratch,pe=_e.labelWidth,ae=_e.labelHeight,oe=_e.labelX,de=_e.labelY,ye=pe/2,Ee=ae/2,Re=l.pstyle("text-valign").value;Re==="top"?de-=Ee:Re==="bottom"&&(de+=Ee);var Ne=l.pstyle("text-halign").value;Ne==="left"?oe-=ye:Ne==="right"&&(oe+=ye);var Be=Qf(B[0],B[1],[oe-ye,de-Ee,oe+ye,de-Ee,oe+ye,de+Ee,oe-ye,de+Ee],h.x,h.y);if(Be.length>0){var $e=c,Ye=Wl($e,Tc(s)),He=Wl($e,Tc(Be)),tt=Ye;if(He<Ye&&(s=Be,tt=He),Be.length>2){var ot=Wl($e,{x:Be[2],y:Be[3]});ot<tt&&(s=[Be[2],Be[3]])}}}var ct=av(s,z,a.arrowShapes[d].spacing(r)+g),Ze=av(s,z,a.arrowShapes[d].gap(r)+g);if(w.endX=Ze[0],w.endY=Ze[1],w.arrowEndX=ct[0],w.arrowEndY=ct[1],V==="inside-to-node")s=[c.x,c.y];else if(U.units)s=this.manualEndptToPx(o,U);else if(V==="outside-to-line")s=w.srcIntn;else if(V==="outside-to-node"||V==="outside-to-node-or-label"?L=$:(V==="outside-to-line"||V==="outside-to-line-or-label")&&(L=[h.x,h.y]),s=a.nodeShapes[this.getNodeShape(o)].intersectLine(c.x,c.y,o.outerWidth(),o.outerHeight(),L[0],L[1],0,X,x),V==="outside-to-node-or-label"||V==="outside-to-line-or-label"){var bt=o._private.rscratch,Se=bt.labelWidth,ke=bt.labelHeight,We=bt.labelX,Ke=bt.labelY,rt=Se/2,nt=ke/2,De=o.pstyle("text-valign").value;De==="top"?Ke-=nt:De==="bottom"&&(Ke+=nt);var Q=o.pstyle("text-halign").value;Q==="left"?We-=rt:Q==="right"&&(We+=rt);var ne=Qf(L[0],L[1],[We-rt,Ke-nt,We+rt,Ke-nt,We+rt,Ke+nt,We-rt,Ke+nt],c.x,c.y);if(ne.length>0){var be=h,ee=Wl(be,Tc(s)),se=Wl(be,Tc(ne)),Pe=ee;if(se<ee&&(s=[ne[0],ne[1]],Pe=se),ne.length>2){var Ae=Wl(be,{x:ne[2],y:ne[3]});Ae<Pe&&(s=[ne[2],ne[3]])}}}var Ge=av(s,$,a.arrowShapes[v].spacing(r)+m),J=av(s,$,a.arrowShapes[v].gap(r)+m);w.startX=J[0],w.startY=J[1],w.arrowStartX=Ge[0],w.arrowStartY=Ge[1],I&&(!ut(w.startX)||!ut(w.startY)||!ut(w.endX)||!ut(w.endY)?w.badLine=!0:w.badLine=!1)};Id.getSourceEndpoint=function(r){var e=r[0]._private.rscratch;switch(this.recalculateRenderedStyle(r),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}};Id.getTargetEndpoint=function(r){var e=r[0]._private.rscratch;switch(this.recalculateRenderedStyle(r),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var fw={};function kj(r,e,t){for(var n=function(c,h,d,v){return kn(c,h,d,v)},i=e._private,a=i.rstyle.bezierPts,s=0;s<r.bezierProjPcts.length;s++){var o=r.bezierProjPcts[s];a.push({x:n(t[0],t[2],t[4],o),y:n(t[1],t[3],t[5],o)})}}fw.storeEdgeProjections=function(r){var e=r._private,t=e.rscratch,n=t.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,n==="multibezier"||n==="bezier"||n==="self"||n==="compound"){e.rstyle.bezierPts=[];for(var i=0;i+5<t.allpts.length;i+=4)kj(this,r,t.allpts.slice(i,i+6))}else if(n==="segments")for(var a=e.rstyle.linePts=[],i=0;i+1<t.allpts.length;i+=2)a.push({x:t.allpts[i],y:t.allpts[i+1]});else if(n==="haystack"){var s=t.haystackPts;e.rstyle.haystackPts=[{x:s[0],y:s[1]},{x:s[2],y:s[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth};fw.recalculateEdgeProjections=function(r){this.findEdgeControlPoints(r)};var os={};os.recalculateNodeLabelProjection=function(r){var e=r.pstyle("label").strValue;if(!$o(e)){var t,n,i=r._private,a=r.width(),s=r.height(),o=r.padding(),l=r.position(),c=r.pstyle("text-halign").strValue,h=r.pstyle("text-valign").strValue,d=i.rscratch,v=i.rstyle;switch(c){case"left":t=l.x-a/2-o;break;case"right":t=l.x+a/2+o;break;default:t=l.x}switch(h){case"top":n=l.y-s/2-o;break;case"bottom":n=l.y+s/2+o;break;default:n=l.y}d.labelX=t,d.labelY=n,v.labelX=t,v.labelY=n,this.calculateLabelAngles(r),this.applyLabelDimensions(r)}};var ZR=function(e,t){var n=Math.atan(t/e);return e===0&&n<0&&(n=n*-1),n},QR=function(e,t){var n=t.x-e.x,i=t.y-e.y;return ZR(n,i)},Bj=function(e,t,n,i){var a=Zf(0,i-.001,1),s=Zf(0,i+.001,1),o=Mc(e,t,n,a),l=Mc(e,t,n,s);return QR(o,l)};os.recalculateEdgeLabelProjections=function(r){var e,t=r._private,n=t.rscratch,i=this,a={mid:r.pstyle("label").strValue,source:r.pstyle("source-label").strValue,target:r.pstyle("target-label").strValue};if(a.mid||a.source||a.target){e={x:n.midX,y:n.midY};var s=function(d,v,g){ks(t.rscratch,d,v,g),ks(t.rstyle,d,v,g)};s("labelX",null,e.x),s("labelY",null,e.y);var o=ZR(n.midDispX,n.midDispY);s("labelAutoAngle",null,o);var l=function(){if(l.cache)return l.cache;for(var d=[],v=0;v+5<n.allpts.length;v+=4){var g={x:n.allpts[v],y:n.allpts[v+1]},m={x:n.allpts[v+2],y:n.allpts[v+3]},x={x:n.allpts[v+4],y:n.allpts[v+5]};d.push({p0:g,p1:m,p2:x,startDist:0,length:0,segments:[]})}var y=t.rstyle.bezierPts,_=i.bezierProjPcts.length;function w(E,O,D,I,k){var U=hu(O,D),V=E.segments[E.segments.length-1],X={p0:O,p1:D,t0:I,t1:k,startDist:V?V.startDist+V.length:0,length:U};E.segments.push(X),E.length+=U}for(var S=0;S<d.length;S++){var A=d[S],C=d[S-1];C&&(A.startDist=C.startDist+C.length),w(A,A.p0,y[S*_],0,i.bezierProjPcts[0]);for(var M=0;M<_-1;M++)w(A,y[S*_+M],y[S*_+M+1],i.bezierProjPcts[M],i.bezierProjPcts[M+1]);w(A,y[S*_+_-1],A.p2,i.bezierProjPcts[_-1],1)}return l.cache=d},c=function(d){var v,g=d==="source";if(a[d]){var m=r.pstyle(d+"-text-offset").pfValue;switch(n.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var x=l(),y,_=0,w=0,S=0;S<x.length;S++){for(var A=x[g?S:x.length-1-S],C=0;C<A.segments.length;C++){var M=A.segments[g?C:A.segments.length-1-C],E=S===x.length-1&&C===A.segments.length-1;if(_=w,w+=M.length,w>=m||E){y={cp:A,segment:M};break}}if(y)break}var O=y.cp,D=y.segment,I=(m-_)/D.length,k=D.t1-D.t0,U=g?D.t0+k*I:D.t1-k*I;U=Zf(0,U,1),e=Mc(O.p0,O.p1,O.p2,U),v=Bj(O.p0,O.p1,O.p2,U);break}case"straight":case"segments":case"haystack":{for(var V=0,X,W,P,H,z=n.allpts.length,$=0;$+3<z&&(g?(P={x:n.allpts[$],y:n.allpts[$+1]},H={x:n.allpts[$+2],y:n.allpts[$+3]}):(P={x:n.allpts[z-2-$],y:n.allpts[z-1-$]},H={x:n.allpts[z-4-$],y:n.allpts[z-3-$]}),X=hu(P,H),W=V,V+=X,!(V>=m));$+=2);var B=m-W,L=B/X;L=Zf(0,L,1),e=aU(P,H,L),v=QR(P,H);break}}s("labelX",d,e.x),s("labelY",d,e.y),s("labelAutoAngle",d,v)}};c("source"),c("target"),this.applyLabelDimensions(r)}};os.applyLabelDimensions=function(r){this.applyPrefixedLabelDimensions(r),r.isEdge()&&(this.applyPrefixedLabelDimensions(r,"source"),this.applyPrefixedLabelDimensions(r,"target"))};os.applyPrefixedLabelDimensions=function(r,e){var t=r._private,n=this.getLabelText(r,e),i=cu(n,r._private.labelDimsKey);if(Ai(t.rscratch,"prefixedLabelDimsKey",e)!==i){ks(t.rscratch,"prefixedLabelDimsKey",e,i);var a=this.calculateLabelDimensions(r,n),s=r.pstyle("line-height").pfValue,o=r.pstyle("text-wrap").strValue,l=Ai(t.rscratch,"labelWrapCachedLines",e)||[],c=o!=="wrap"?1:Math.max(l.length,1),h=a.height/c,d=h*s,v=a.width,g=a.height+(c-1)*(s-1)*h;ks(t.rstyle,"labelWidth",e,v),ks(t.rscratch,"labelWidth",e,v),ks(t.rstyle,"labelHeight",e,g),ks(t.rscratch,"labelHeight",e,g),ks(t.rscratch,"labelLineHeight",e,d)}};os.getLabelText=function(r,e){var t=r._private,n=e?e+"-":"",i=r.pstyle(n+"label").strValue,a=r.pstyle("text-transform").value,s=function(G,re){return re?(ks(t.rscratch,G,e,re),re):Ai(t.rscratch,G,e)};if(!i)return"";a=="none"||(a=="uppercase"?i=i.toUpperCase():a=="lowercase"&&(i=i.toLowerCase()));var o=r.pstyle("text-wrap").value;if(o==="wrap"){var l=s("labelKey");if(l!=null&&s("labelWrapKey")===l)return s("labelWrapCachedText");for(var c="​",h=i.split(`
  89. `),d=r.pstyle("text-max-width").pfValue,v=r.pstyle("text-overflow-wrap").value,g=v==="anywhere",m=[],x=/[\s\u200b]+|$/g,y=0;y<h.length;y++){var _=h[y],w=this.calculateLabelDimensions(r,_),S=w.width;if(g){var A=_.split("").join(c);_=A}if(S>d){var C=_.matchAll(x),M="",E=0,O=Ri(C),D;try{for(O.s();!(D=O.n()).done;){var I=D.value,k=I[0],U=_.substring(E,I.index);E=I.index+k.length;var V=M.length===0?U:M+U+k,X=this.calculateLabelDimensions(r,V),W=X.width;W<=d?M+=U+k:(M&&m.push(M),M=U+k)}}catch(Y){O.e(Y)}finally{O.f()}M.match(/^[\s\u200b]+$/)||m.push(M)}else m.push(_)}s("labelWrapCachedLines",m),i=s("labelWrapCachedText",m.join(`
  90. `)),s("labelWrapKey",l)}else if(o==="ellipsis"){var P=r.pstyle("text-max-width").pfValue,H="",z="…",$=!1;if(this.calculateLabelDimensions(r,i).width<P)return i;for(var B=0;B<i.length;B++){var L=this.calculateLabelDimensions(r,H+i[B]+z).width;if(L>P)break;H+=i[B],B===i.length-1&&($=!0)}return $||(H+=z),H}return i};os.getLabelJustification=function(r){var e=r.pstyle("text-justification").strValue,t=r.pstyle("text-halign").strValue;if(e==="auto")if(r.isNode())switch(t){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e};os.calculateLabelDimensions=function(r,e){var t=this,n=t.cy.window(),i=n.document,a=0,s=r.pstyle("font-style").strValue,o=r.pstyle("font-size").pfValue,l=r.pstyle("font-family").strValue,c=r.pstyle("font-weight").strValue,h=this.labelCalcCanvas,d=this.labelCalcCanvasContext;if(!h){h=this.labelCalcCanvas=i.createElement("canvas"),d=this.labelCalcCanvasContext=h.getContext("2d");var v=h.style;v.position="absolute",v.left="-9999px",v.top="-9999px",v.zIndex="-1",v.visibility="hidden",v.pointerEvents="none"}d.font="".concat(s," ").concat(c," ").concat(o,"px ").concat(l);for(var g=0,m=0,x=e.split(`
  91. `),y=0;y<x.length;y++){var _=x[y],w=d.measureText(_),S=Math.ceil(w.width),A=o;g=Math.max(S,g),m+=A}return g+=a,m+=a,{width:g,height:m}};os.calculateLabelAngle=function(r,e){var t=r._private,n=t.rscratch,i=r.isEdge(),a=e?e+"-":"",s=r.pstyle(a+"text-rotation"),o=s.strValue;return o==="none"?0:i&&o==="autorotate"?n.labelAutoAngle:o==="autorotate"?0:s.pfValue};os.calculateLabelAngles=function(r){var e=this,t=r.isEdge(),n=r._private,i=n.rscratch;i.labelAngle=e.calculateLabelAngle(r),t&&(i.sourceLabelAngle=e.calculateLabelAngle(r,"source"),i.targetLabelAngle=e.calculateLabelAngle(r,"target"))};var JR={},c7=28,h7=!1;JR.getNodeShape=function(r){var e=this,t=r.pstyle("shape").value;if(t==="cutrectangle"&&(r.width()<c7||r.height()<c7))return h7||(fr("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),h7=!0),"rectangle";if(r.isParent())return t==="rectangle"||t==="roundrectangle"||t==="round-rectangle"||t==="cutrectangle"||t==="cut-rectangle"||t==="barrel"?t:"rectangle";if(t==="polygon"){var n=r.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(n).name}return t};var bg={};bg.registerCalculationListeners=function(){var r=this.cy,e=r.collection(),t=this,n=function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l<s.length;l++){var c=s[l],h=c._private,d=h.rstyle;d.clean=!1,d.cleanConnected=!1}};t.binder(r).on("bounds.* dirty.*",function(s){var o=s.target;n(o)}).on("style.* background.*",function(s){var o=s.target;n(o,!1)});var i=function(s){if(s){var o=t.onUpdateEleCalcsFns;e.cleanStyle();for(var l=0;l<e.length;l++){var c=e[l],h=c._private.rstyle;c.isNode()&&!h.cleanConnected&&(n(c.connectedEdges()),h.cleanConnected=!0)}if(o)for(var d=0;d<o.length;d++){var v=o[d];v(s,e)}t.recalculateRenderedStyle(e),e=r.collection()}};t.flushRenderedStyleQueue=function(){i(!0)},t.beforeRender(i,t.beforeRenderPriorities.eleCalcs)};bg.onUpdateEleCalcs=function(r){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(r)};bg.recalculateRenderedStyle=function(r,e){var t=function(A){return A._private.rstyle.cleanConnected};if(r.length!==0){var n=[],i=[];if(!this.destroyed){e===void 0&&(e=!0);for(var a=0;a<r.length;a++){var s=r[a],o=s._private,l=o.rstyle;s.isEdge()&&(!t(s.source())||!t(s.target()))&&(l.clean=!1),s.isEdge()&&s.isBundledBezier()&&s.parallelEdges().some(function(S){return!S._private.rstyle.clean&&S.isBundledBezier()})&&(l.clean=!1),!(e&&l.clean||s.removed())&&s.pstyle("display").value!=="none"&&(o.group==="nodes"?i.push(s):n.push(s),l.clean=!0)}for(var c=0;c<i.length;c++){var h=i[c],d=h._private,v=d.rstyle,g=h.position();this.recalculateNodeLabelProjection(h),v.nodeX=g.x,v.nodeY=g.y,v.nodeW=h.pstyle("width").pfValue,v.nodeH=h.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var m=0;m<n.length;m++){var x=n[m],y=x._private,_=y.rstyle,w=y.rscratch;_.srcX=w.arrowStartX,_.srcY=w.arrowStartY,_.tgtX=w.arrowEndX,_.tgtY=w.arrowEndY,_.midX=w.midX,_.midY=w.midY,_.labelAngle=w.labelAngle,_.sourceLabelAngle=w.sourceLabelAngle,_.targetLabelAngle=w.targetLabelAngle}}}};var xg={};xg.updateCachedGrabbedEles=function(){var r=this.cachedZSortedEles;if(r){r.drag=[],r.nondrag=[];for(var e=[],t=0;t<r.length;t++){var n=r[t],i=n._private.rscratch;n.grabbed()&&!n.isParent()?e.push(n):i.inDragLayer?r.drag.push(n):r.nondrag.push(n)}for(var t=0;t<e.length;t++){var n=e[t];r.drag.push(n)}}};xg.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};xg.getCachedZSortedEles=function(r){if(r||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(NR),e.interactive=e.filter(function(t){return t.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var eO={};[xu,Lp,ii,Id,fw,os,JR,bg,xg].forEach(function(r){Ct(eO,r)});var tO={};tO.getCachedImage=function(r,e,t){var n=this,i=n.imageCache=n.imageCache||{},a=i[r];if(a)return a.image.complete||a.image.addEventListener("load",t),a.image;a=i[r]=i[r]||{};var s=a.image=new Image;s.addEventListener("load",t),s.addEventListener("error",function(){s.error=!0});var o="data:",l=r.substring(0,o.length).toLowerCase()===o;return l||(e=e==="null"?null:e,s.crossOrigin=e),s.src=r,s};var rh={};rh.registerBinding=function(r,e,t,n){var i=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(r)){for(var a=[],s=0;s<r.length;s++){var o=r[s];if(o!==void 0){var l=this.binder(o);a.push(l.on.apply(l,i))}}return a}var l=this.binder(r);return l.on.apply(l,i)};rh.binder=function(r){var e=this,t=e.cy.window(),n=r===t||r===t.document||r===t.document.body||$F(r);if(e.supportsPassiveEvents==null){var i=!1;try{var a=Object.defineProperty({},"passive",{get:function(){return i=!0,!0}});t.addEventListener("test",null,a)}catch{}e.supportsPassiveEvents=i}var s=function(l,c,h){var d=Array.prototype.slice.call(arguments);return n&&e.supportsPassiveEvents&&(d[2]={capture:h??!1,passive:!1,once:!1}),e.bindings.push({target:r,args:d}),(r.addEventListener||r.on).apply(r,d),this};return{on:s,addEventListener:s,addListener:s,bind:s}};rh.nodeIsDraggable=function(r){return r&&r.isNode()&&!r.locked()&&r.grabbable()};rh.nodeIsGrabbable=function(r){return this.nodeIsDraggable(r)&&r.interactive()};rh.load=function(){var r=this,e=r.cy.window(),t=function(Q){return Q.selected()},n=function(Q){var ne=Q.getRootNode();if(ne&&ne.nodeType===11&&ne.host!==void 0)return ne},i=function(Q,ne,be,ee){Q==null&&(Q=r.cy);for(var se=0;se<ne.length;se++){var Pe=ne[se];Q.emit({originalEvent:be,type:Pe,position:ee})}},a=function(Q){return Q.shiftKey||Q.metaKey||Q.ctrlKey},s=function(Q,ne){var be=!0;if(r.cy.hasCompoundNodes()&&Q&&Q.pannable())for(var ee=0;ne&&ee<ne.length;ee++){var Q=ne[ee];if(Q.isNode()&&Q.isParent()&&!Q.pannable()){be=!1;break}}else be=!0;return be},o=function(Q){Q[0]._private.grabbed=!0},l=function(Q){Q[0]._private.grabbed=!1},c=function(Q){Q[0]._private.rscratch.inDragLayer=!0},h=function(Q){Q[0]._private.rscratch.inDragLayer=!1},d=function(Q){Q[0]._private.rscratch.isGrabTarget=!0},v=function(Q){Q[0]._private.rscratch.isGrabTarget=!1},g=function(Q,ne){var be=ne.addToList,ee=be.has(Q);!ee&&Q.grabbable()&&!Q.locked()&&(be.merge(Q),o(Q))},m=function(Q,ne){if(Q.cy().hasCompoundNodes()&&!(ne.inDragLayer==null&&ne.addToList==null)){var be=Q.descendants();ne.inDragLayer&&(be.forEach(c),be.connectedEdges().forEach(c)),ne.addToList&&g(be,ne)}},x=function(Q,ne){ne=ne||{};var be=Q.cy().hasCompoundNodes();ne.inDragLayer&&(Q.forEach(c),Q.neighborhood().stdFilter(function(ee){return!be||ee.isEdge()}).forEach(c)),ne.addToList&&Q.forEach(function(ee){g(ee,ne)}),m(Q,ne),w(Q,{inDragLayer:ne.inDragLayer}),r.updateCachedGrabbedEles()},y=x,_=function(Q){Q&&(r.getCachedZSortedEles().forEach(function(ne){l(ne),h(ne),v(ne)}),r.updateCachedGrabbedEles())},w=function(Q,ne){if(!(ne.inDragLayer==null&&ne.addToList==null)&&Q.cy().hasCompoundNodes()){var be=Q.ancestors().orphans();if(!be.same(Q)){var ee=be.descendants().spawnSelf().merge(be).unmerge(Q).unmerge(Q.descendants()),se=ee.connectedEdges();ne.inDragLayer&&(se.forEach(c),ee.forEach(c)),ne.addToList&&ee.forEach(function(Pe){g(Pe,ne)})}}},S=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},A=typeof MutationObserver<"u",C=typeof ResizeObserver<"u";A?(r.removeObserver=new MutationObserver(function(De){for(var Q=0;Q<De.length;Q++){var ne=De[Q],be=ne.removedNodes;if(be)for(var ee=0;ee<be.length;ee++){var se=be[ee];if(se===r.container){r.destroy();break}}}}),r.container.parentNode&&r.removeObserver.observe(r.container.parentNode,{childList:!0})):r.registerBinding(r.container,"DOMNodeRemoved",function(De){r.destroy()});var M=Rd(function(){r.cy.resize()},100);A&&(r.styleObserver=new MutationObserver(M),r.styleObserver.observe(r.container,{attributes:!0})),r.registerBinding(e,"resize",M),C&&(r.resizeObserver=new ResizeObserver(M),r.resizeObserver.observe(r.container));var E=function(Q,ne){for(;Q!=null;)ne(Q),Q=Q.parentNode},O=function(){r.invalidateContainerClientCoordsCache()};E(r.container,function(De){r.registerBinding(De,"transitionend",O),r.registerBinding(De,"animationend",O),r.registerBinding(De,"scroll",O)}),r.registerBinding(r.container,"contextmenu",function(De){De.preventDefault()});var D=function(){return r.selection[4]!==0},I=function(Q){for(var ne=r.findContainerClientCoords(),be=ne[0],ee=ne[1],se=ne[2],Pe=ne[3],Ae=Q.touches?Q.touches:[Q],Ge=!1,J=0;J<Ae.length;J++){var Oe=Ae[J];if(be<=Oe.clientX&&Oe.clientX<=be+se&&ee<=Oe.clientY&&Oe.clientY<=ee+Pe){Ge=!0;break}}if(!Ge)return!1;for(var Ve=r.container,Ue=Q.target,je=Ue.parentNode,yt=!1;je;){if(je===Ve){yt=!0;break}je=je.parentNode}return!!yt};r.registerBinding(r.container,"mousedown",function(Q){if(I(Q)&&!(r.hoverData.which===1&&Q.which!==1)){Q.preventDefault(),S(),r.hoverData.capture=!0,r.hoverData.which=Q.which;var ne=r.cy,be=[Q.clientX,Q.clientY],ee=r.projectIntoViewport(be[0],be[1]),se=r.selection,Pe=r.findNearestElements(ee[0],ee[1],!0,!1),Ae=Pe[0],Ge=r.dragData.possibleDragElements;r.hoverData.mdownPos=ee,r.hoverData.mdownGPos=be;var J=function(vt){return{originalEvent:Q,type:vt,position:{x:ee[0],y:ee[1]}}},Oe=function(){r.hoverData.tapholdCancelled=!1,clearTimeout(r.hoverData.tapholdTimeout),r.hoverData.tapholdTimeout=setTimeout(function(){if(!r.hoverData.tapholdCancelled){var vt=r.hoverData.down;vt?vt.emit(J("taphold")):ne.emit(J("taphold"))}},r.tapholdDuration)};if(Q.which==3){r.hoverData.cxtStarted=!0;var Ve={originalEvent:Q,type:"cxttapstart",position:{x:ee[0],y:ee[1]}};Ae?(Ae.activate(),Ae.emit(Ve),r.hoverData.down=Ae):ne.emit(Ve),r.hoverData.downTime=new Date().getTime(),r.hoverData.cxtDragged=!1}else if(Q.which==1){Ae&&Ae.activate();{if(Ae!=null&&r.nodeIsGrabbable(Ae)){var Ue=function(vt){vt.emit(J("grab"))};if(d(Ae),!Ae.selected())Ge=r.dragData.possibleDragElements=ne.collection(),y(Ae,{addToList:Ge}),Ae.emit(J("grabon")).emit(J("grab"));else{Ge=r.dragData.possibleDragElements=ne.collection();var je=ne.$(function(yt){return yt.isNode()&&yt.selected()&&r.nodeIsGrabbable(yt)});x(je,{addToList:Ge}),Ae.emit(J("grabon")),je.forEach(Ue)}r.redrawHint("eles",!0),r.redrawHint("drag",!0)}r.hoverData.down=Ae,r.hoverData.downs=Pe,r.hoverData.downTime=new Date().getTime()}i(Ae,["mousedown","tapstart","vmousedown"],Q,{x:ee[0],y:ee[1]}),Ae==null?(se[4]=1,r.data.bgActivePosistion={x:ee[0],y:ee[1]},r.redrawHint("select",!0),r.redraw()):Ae.pannable()&&(se[4]=1),Oe()}se[0]=se[2]=ee[0],se[1]=se[3]=ee[1]}},!1);var k=n(r.container);r.registerBinding([e,k],"mousemove",function(Q){var ne=r.hoverData.capture;if(!(!ne&&!I(Q))){var be=!1,ee=r.cy,se=ee.zoom(),Pe=[Q.clientX,Q.clientY],Ae=r.projectIntoViewport(Pe[0],Pe[1]),Ge=r.hoverData.mdownPos,J=r.hoverData.mdownGPos,Oe=r.selection,Ve=null;!r.hoverData.draggingEles&&!r.hoverData.dragging&&!r.hoverData.selecting&&(Ve=r.findNearestElement(Ae[0],Ae[1],!0,!1));var Ue=r.hoverData.last,je=r.hoverData.down,yt=[Ae[0]-Oe[2],Ae[1]-Oe[3]],vt=r.dragData.possibleDragElements,Ot;if(J){var jt=Pe[0]-J[0],Nr=jt*jt,Vt=Pe[1]-J[1],Qt=Vt*Vt,rr=Nr+Qt;r.hoverData.isOverThresholdDrag=Ot=rr>=r.desktopTapThreshold2}var ur=a(Q);Ot&&(r.hoverData.tapholdCancelled=!0);var In=function(){var lt=r.hoverData.dragDelta=r.hoverData.dragDelta||[];lt.length===0?(lt.push(yt[0]),lt.push(yt[1])):(lt[0]+=yt[0],lt[1]+=yt[1])};be=!0,i(Ve,["mousemove","vmousemove","tapdrag"],Q,{x:Ae[0],y:Ae[1]});var vr=function(lt){return{originalEvent:Q,type:lt,position:{x:Ae[0],y:Ae[1]}}},Gn=function(){r.data.bgActivePosistion=void 0,r.hoverData.selecting||ee.emit(vr("boxstart")),Oe[4]=1,r.hoverData.selecting=!0,r.redrawHint("select",!0),r.redraw()};if(r.hoverData.which===3){if(Ot){var Yr=vr("cxtdrag");je?je.emit(Yr):ee.emit(Yr),r.hoverData.cxtDragged=!0,(!r.hoverData.cxtOver||Ve!==r.hoverData.cxtOver)&&(r.hoverData.cxtOver&&r.hoverData.cxtOver.emit(vr("cxtdragout")),r.hoverData.cxtOver=Ve,Ve&&Ve.emit(vr("cxtdragover")))}}else if(r.hoverData.dragging){if(be=!0,ee.panningEnabled()&&ee.userPanningEnabled()){var nr;if(r.hoverData.justStartedPan){var Lr=r.hoverData.mdownPos;nr={x:(Ae[0]-Lr[0])*se,y:(Ae[1]-Lr[1])*se},r.hoverData.justStartedPan=!1}else nr={x:yt[0]*se,y:yt[1]*se};ee.panBy(nr),ee.emit(vr("dragpan")),r.hoverData.dragged=!0}Ae=r.projectIntoViewport(Q.clientX,Q.clientY)}else if(Oe[4]==1&&(je==null||je.pannable())){if(Ot){if(!r.hoverData.dragging&&ee.boxSelectionEnabled()&&(ur||!ee.panningEnabled()||!ee.userPanningEnabled()))Gn();else if(!r.hoverData.selecting&&ee.panningEnabled()&&ee.userPanningEnabled()){var cn=s(je,r.hoverData.downs);cn&&(r.hoverData.dragging=!0,r.hoverData.justStartedPan=!0,Oe[4]=0,r.data.bgActivePosistion=Tc(Ge),r.redrawHint("select",!0),r.redraw())}je&&je.pannable()&&je.active()&&je.unactivate()}}else{if(je&&je.pannable()&&je.active()&&je.unactivate(),(!je||!je.grabbed())&&Ve!=Ue&&(Ue&&i(Ue,["mouseout","tapdragout"],Q,{x:Ae[0],y:Ae[1]}),Ve&&i(Ve,["mouseover","tapdragover"],Q,{x:Ae[0],y:Ae[1]}),r.hoverData.last=Ve),je)if(Ot){if(ee.boxSelectionEnabled()&&ur)je&&je.grabbed()&&(_(vt),je.emit(vr("freeon")),vt.emit(vr("free")),r.dragData.didDrag&&(je.emit(vr("dragfreeon")),vt.emit(vr("dragfree")))),Gn();else if(je&&je.grabbed()&&r.nodeIsDraggable(je)){var Ur=!r.dragData.didDrag;Ur&&r.redrawHint("eles",!0),r.dragData.didDrag=!0,r.hoverData.draggingEles||x(vt,{inDragLayer:!0});var Wr={x:0,y:0};if(ut(yt[0])&&ut(yt[1])&&(Wr.x+=yt[0],Wr.y+=yt[1],Ur)){var xe=r.hoverData.dragDelta;xe&&ut(xe[0])&&ut(xe[1])&&(Wr.x+=xe[0],Wr.y+=xe[1])}r.hoverData.draggingEles=!0,vt.silentShift(Wr).emit(vr("position")).emit(vr("drag")),r.redrawHint("drag",!0),r.redraw()}}else In();be=!0}if(Oe[2]=Ae[0],Oe[3]=Ae[1],be)return Q.stopPropagation&&Q.stopPropagation(),Q.preventDefault&&Q.preventDefault(),!1}},!1);var U,V,X;r.registerBinding(e,"mouseup",function(Q){if(!(r.hoverData.which===1&&Q.which!==1&&r.hoverData.capture)){var ne=r.hoverData.capture;if(ne){r.hoverData.capture=!1;var be=r.cy,ee=r.projectIntoViewport(Q.clientX,Q.clientY),se=r.selection,Pe=r.findNearestElement(ee[0],ee[1],!0,!1),Ae=r.dragData.possibleDragElements,Ge=r.hoverData.down,J=a(Q);r.data.bgActivePosistion&&(r.redrawHint("select",!0),r.redraw()),r.hoverData.tapholdCancelled=!0,r.data.bgActivePosistion=void 0,Ge&&Ge.unactivate();var Oe=function(jt){return{originalEvent:Q,type:jt,position:{x:ee[0],y:ee[1]}}};if(r.hoverData.which===3){var Ve=Oe("cxttapend");if(Ge?Ge.emit(Ve):be.emit(Ve),!r.hoverData.cxtDragged){var Ue=Oe("cxttap");Ge?Ge.emit(Ue):be.emit(Ue)}r.hoverData.cxtDragged=!1,r.hoverData.which=null}else if(r.hoverData.which===1){if(i(Pe,["mouseup","tapend","vmouseup"],Q,{x:ee[0],y:ee[1]}),!r.dragData.didDrag&&!r.hoverData.dragged&&!r.hoverData.selecting&&!r.hoverData.isOverThresholdDrag&&(i(Ge,["click","tap","vclick"],Q,{x:ee[0],y:ee[1]}),V=!1,Q.timeStamp-X<=be.multiClickDebounceTime()?(U&&clearTimeout(U),V=!0,X=null,i(Ge,["dblclick","dbltap","vdblclick"],Q,{x:ee[0],y:ee[1]})):(U=setTimeout(function(){V||i(Ge,["oneclick","onetap","voneclick"],Q,{x:ee[0],y:ee[1]})},be.multiClickDebounceTime()),X=Q.timeStamp)),Ge==null&&!r.dragData.didDrag&&!r.hoverData.selecting&&!r.hoverData.dragged&&!a(Q)&&(be.$(t).unselect(["tapunselect"]),Ae.length>0&&r.redrawHint("eles",!0),r.dragData.possibleDragElements=Ae=be.collection()),Pe==Ge&&!r.dragData.didDrag&&!r.hoverData.selecting&&Pe!=null&&Pe._private.selectable&&(r.hoverData.dragging||(be.selectionType()==="additive"||J?Pe.selected()?Pe.unselect(["tapunselect"]):Pe.select(["tapselect"]):J||(be.$(t).unmerge(Pe).unselect(["tapunselect"]),Pe.select(["tapselect"]))),r.redrawHint("eles",!0)),r.hoverData.selecting){var je=be.collection(r.getAllInBox(se[0],se[1],se[2],se[3]));r.redrawHint("select",!0),je.length>0&&r.redrawHint("eles",!0),be.emit(Oe("boxend"));var yt=function(jt){return jt.selectable()&&!jt.selected()};be.selectionType()==="additive"||J||be.$(t).unmerge(je).unselect(),je.emit(Oe("box")).stdFilter(yt).select().emit(Oe("boxselect")),r.redraw()}if(r.hoverData.dragging&&(r.hoverData.dragging=!1,r.redrawHint("select",!0),r.redrawHint("eles",!0),r.redraw()),!se[4]){r.redrawHint("drag",!0),r.redrawHint("eles",!0);var vt=Ge&&Ge.grabbed();_(Ae),vt&&(Ge.emit(Oe("freeon")),Ae.emit(Oe("free")),r.dragData.didDrag&&(Ge.emit(Oe("dragfreeon")),Ae.emit(Oe("dragfree"))))}}se[4]=0,r.hoverData.down=null,r.hoverData.cxtStarted=!1,r.hoverData.draggingEles=!1,r.hoverData.selecting=!1,r.hoverData.isOverThresholdDrag=!1,r.dragData.didDrag=!1,r.hoverData.dragged=!1,r.hoverData.dragDelta=[],r.hoverData.mdownPos=null,r.hoverData.mdownGPos=null,r.hoverData.which=null}}},!1);var W=[],P=4,H,z=1e5,$=function(Q,ne){for(var be=0;be<Q.length;be++)if(Q[be]%ne!==0)return!1;return!0},B=function(Q){for(var ne=Math.abs(Q[0]),be=1;be<Q.length;be++)if(Math.abs(Q[be])!==ne)return!1;return!0},L=function(Q){var ne=!1,be=Q.deltaY;if(be==null&&(Q.wheelDeltaY!=null?be=Q.wheelDeltaY/4:Q.wheelDelta!=null&&(be=Q.wheelDelta/4)),be!==0){if(H==null)if(W.length>=P){var ee=W;if(H=$(ee,5),!H){var se=Math.abs(ee[0]);H=B(ee)&&se>5}if(H)for(var Pe=0;Pe<ee.length;Pe++)z=Math.min(Math.abs(ee[Pe]),z)}else W.push(be),ne=!0;else H&&(z=Math.min(Math.abs(be),z));if(!r.scrollingPage){var Ae=r.cy,Ge=Ae.zoom(),J=Ae.pan(),Oe=r.projectIntoViewport(Q.clientX,Q.clientY),Ve=[Oe[0]*Ge+J.x,Oe[1]*Ge+J.y];if(r.hoverData.draggingEles||r.hoverData.dragging||r.hoverData.cxtStarted||D()){Q.preventDefault();return}if(Ae.panningEnabled()&&Ae.userPanningEnabled()&&Ae.zoomingEnabled()&&Ae.userZoomingEnabled()){Q.preventDefault(),r.data.wheelZooming=!0,clearTimeout(r.data.wheelTimeout),r.data.wheelTimeout=setTimeout(function(){r.data.wheelZooming=!1,r.redrawHint("eles",!0),r.redraw()},150);var Ue;ne&&Math.abs(be)>5&&(be=Q_(be)*5),Ue=be/-250,H&&(Ue/=z,Ue*=3),Ue=Ue*r.wheelSensitivity;var je=Q.deltaMode===1;je&&(Ue*=33);var yt=Ae.zoom()*Math.pow(10,Ue);Q.type==="gesturechange"&&(yt=r.gestureStartZoom*Q.scale),Ae.zoom({level:yt,renderedPosition:{x:Ve[0],y:Ve[1]}}),Ae.emit({type:Q.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:Q,position:{x:Oe[0],y:Oe[1]}})}}}};r.registerBinding(r.container,"wheel",L,!0),r.registerBinding(e,"scroll",function(Q){r.scrollingPage=!0,clearTimeout(r.scrollingPageTimeout),r.scrollingPageTimeout=setTimeout(function(){r.scrollingPage=!1},250)},!0),r.registerBinding(r.container,"gesturestart",function(Q){r.gestureStartZoom=r.cy.zoom(),r.hasTouchStarted||Q.preventDefault()},!0),r.registerBinding(r.container,"gesturechange",function(De){r.hasTouchStarted||L(De)},!0),r.registerBinding(r.container,"mouseout",function(Q){var ne=r.projectIntoViewport(Q.clientX,Q.clientY);r.cy.emit({originalEvent:Q,type:"mouseout",position:{x:ne[0],y:ne[1]}})},!1),r.registerBinding(r.container,"mouseover",function(Q){var ne=r.projectIntoViewport(Q.clientX,Q.clientY);r.cy.emit({originalEvent:Q,type:"mouseover",position:{x:ne[0],y:ne[1]}})},!1);var Y,G,re,ie,le,ce,_e,pe,ae,oe,de,ye,Ee,Re=function(Q,ne,be,ee){return Math.sqrt((be-Q)*(be-Q)+(ee-ne)*(ee-ne))},Ne=function(Q,ne,be,ee){return(be-Q)*(be-Q)+(ee-ne)*(ee-ne)},Be;r.registerBinding(r.container,"touchstart",Be=function(Q){if(r.hasTouchStarted=!0,!!I(Q)){S(),r.touchData.capture=!0,r.data.bgActivePosistion=void 0;var ne=r.cy,be=r.touchData.now,ee=r.touchData.earlier;if(Q.touches[0]){var se=r.projectIntoViewport(Q.touches[0].clientX,Q.touches[0].clientY);be[0]=se[0],be[1]=se[1]}if(Q.touches[1]){var se=r.projectIntoViewport(Q.touches[1].clientX,Q.touches[1].clientY);be[2]=se[0],be[3]=se[1]}if(Q.touches[2]){var se=r.projectIntoViewport(Q.touches[2].clientX,Q.touches[2].clientY);be[4]=se[0],be[5]=se[1]}var Pe=function(ur){return{originalEvent:Q,type:ur,position:{x:be[0],y:be[1]}}};if(Q.touches[1]){r.touchData.singleTouchMoved=!0,_(r.dragData.touchDragEles);var Ae=r.findContainerClientCoords();ae=Ae[0],oe=Ae[1],de=Ae[2],ye=Ae[3],Y=Q.touches[0].clientX-ae,G=Q.touches[0].clientY-oe,re=Q.touches[1].clientX-ae,ie=Q.touches[1].clientY-oe,Ee=0<=Y&&Y<=de&&0<=re&&re<=de&&0<=G&&G<=ye&&0<=ie&&ie<=ye;var Ge=ne.pan(),J=ne.zoom();le=Re(Y,G,re,ie),ce=Ne(Y,G,re,ie),_e=[(Y+re)/2,(G+ie)/2],pe=[(_e[0]-Ge.x)/J,(_e[1]-Ge.y)/J];var Oe=200,Ve=Oe*Oe;if(ce<Ve&&!Q.touches[2]){var Ue=r.findNearestElement(be[0],be[1],!0,!0),je=r.findNearestElement(be[2],be[3],!0,!0);Ue&&Ue.isNode()?(Ue.activate().emit(Pe("cxttapstart")),r.touchData.start=Ue):je&&je.isNode()?(je.activate().emit(Pe("cxttapstart")),r.touchData.start=je):ne.emit(Pe("cxttapstart")),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!0,r.touchData.cxtDragged=!1,r.data.bgActivePosistion=void 0,r.redraw();return}}if(Q.touches[2])ne.boxSelectionEnabled()&&Q.preventDefault();else if(!Q.touches[1]){if(Q.touches[0]){var yt=r.findNearestElements(be[0],be[1],!0,!0),vt=yt[0];if(vt!=null&&(vt.activate(),r.touchData.start=vt,r.touchData.starts=yt,r.nodeIsGrabbable(vt))){var Ot=r.dragData.touchDragEles=ne.collection(),jt=null;r.redrawHint("eles",!0),r.redrawHint("drag",!0),vt.selected()?(jt=ne.$(function(rr){return rr.selected()&&r.nodeIsGrabbable(rr)}),x(jt,{addToList:Ot})):y(vt,{addToList:Ot}),d(vt),vt.emit(Pe("grabon")),jt?jt.forEach(function(rr){rr.emit(Pe("grab"))}):vt.emit(Pe("grab"))}i(vt,["touchstart","tapstart","vmousedown"],Q,{x:be[0],y:be[1]}),vt==null&&(r.data.bgActivePosistion={x:se[0],y:se[1]},r.redrawHint("select",!0),r.redraw()),r.touchData.singleTouchMoved=!1,r.touchData.singleTouchStartTime=+new Date,clearTimeout(r.touchData.tapholdTimeout),r.touchData.tapholdTimeout=setTimeout(function(){r.touchData.singleTouchMoved===!1&&!r.pinching&&!r.touchData.selecting&&i(r.touchData.start,["taphold"],Q,{x:be[0],y:be[1]})},r.tapholdDuration)}}if(Q.touches.length>=1){for(var Nr=r.touchData.startPosition=[null,null,null,null,null,null],Vt=0;Vt<be.length;Vt++)Nr[Vt]=ee[Vt]=be[Vt];var Qt=Q.touches[0];r.touchData.startGPosition=[Qt.clientX,Qt.clientY]}}},!1);var $e;r.registerBinding(e,"touchmove",$e=function(Q){var ne=r.touchData.capture;if(!(!ne&&!I(Q))){var be=r.selection,ee=r.cy,se=r.touchData.now,Pe=r.touchData.earlier,Ae=ee.zoom();if(Q.touches[0]){var Ge=r.projectIntoViewport(Q.touches[0].clientX,Q.touches[0].clientY);se[0]=Ge[0],se[1]=Ge[1]}if(Q.touches[1]){var Ge=r.projectIntoViewport(Q.touches[1].clientX,Q.touches[1].clientY);se[2]=Ge[0],se[3]=Ge[1]}if(Q.touches[2]){var Ge=r.projectIntoViewport(Q.touches[2].clientX,Q.touches[2].clientY);se[4]=Ge[0],se[5]=Ge[1]}var J=function(Vd){return{originalEvent:Q,type:Vd,position:{x:se[0],y:se[1]}}},Oe=r.touchData.startGPosition,Ve;if(ne&&Q.touches[0]&&Oe){for(var Ue=[],je=0;je<se.length;je++)Ue[je]=se[je]-Pe[je];var yt=Q.touches[0].clientX-Oe[0],vt=yt*yt,Ot=Q.touches[0].clientY-Oe[1],jt=Ot*Ot,Nr=vt+jt;Ve=Nr>=r.touchTapThreshold2}if(ne&&r.touchData.cxt){Q.preventDefault();var Vt=Q.touches[0].clientX-ae,Qt=Q.touches[0].clientY-oe,rr=Q.touches[1].clientX-ae,ur=Q.touches[1].clientY-oe,In=Ne(Vt,Qt,rr,ur),vr=In/ce,Gn=150,Yr=Gn*Gn,nr=1.5,Lr=nr*nr;if(vr>=Lr||In>=Yr){r.touchData.cxt=!1,r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var cn=J("cxttapend");r.touchData.start?(r.touchData.start.unactivate().emit(cn),r.touchData.start=null):ee.emit(cn)}}if(ne&&r.touchData.cxt){var cn=J("cxtdrag");r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.touchData.start?r.touchData.start.emit(cn):ee.emit(cn),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxtDragged=!0;var Ur=r.findNearestElement(se[0],se[1],!0,!0);(!r.touchData.cxtOver||Ur!==r.touchData.cxtOver)&&(r.touchData.cxtOver&&r.touchData.cxtOver.emit(J("cxtdragout")),r.touchData.cxtOver=Ur,Ur&&Ur.emit(J("cxtdragover")))}else if(ne&&Q.touches[2]&&ee.boxSelectionEnabled())Q.preventDefault(),r.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,r.touchData.selecting||ee.emit(J("boxstart")),r.touchData.selecting=!0,r.touchData.didSelect=!0,be[4]=1,!be||be.length===0||be[0]===void 0?(be[0]=(se[0]+se[2]+se[4])/3,be[1]=(se[1]+se[3]+se[5])/3,be[2]=(se[0]+se[2]+se[4])/3+1,be[3]=(se[1]+se[3]+se[5])/3+1):(be[2]=(se[0]+se[2]+se[4])/3,be[3]=(se[1]+se[3]+se[5])/3),r.redrawHint("select",!0),r.redraw();else if(ne&&Q.touches[1]&&!r.touchData.didSelect&&ee.zoomingEnabled()&&ee.panningEnabled()&&ee.userZoomingEnabled()&&ee.userPanningEnabled()){Q.preventDefault(),r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var Wr=r.dragData.touchDragEles;if(Wr){r.redrawHint("drag",!0);for(var xe=0;xe<Wr.length;xe++){var st=Wr[xe]._private;st.grabbed=!1,st.rscratch.inDragLayer=!1}}var lt=r.touchData.start,Vt=Q.touches[0].clientX-ae,Qt=Q.touches[0].clientY-oe,rr=Q.touches[1].clientX-ae,ur=Q.touches[1].clientY-oe,Ut=Re(Vt,Qt,rr,ur),br=Ut/le;if(Ee){var hn=Vt-Y,Ii=Qt-G,Zn=rr-re,cr=ur-ie,ds=(hn+Zn)/2,to=(Ii+cr)/2,nn=ee.zoom(),Qn=nn*br,Ba=ee.pan(),bl=pe[0]*nn+Ba.x,ph=pe[1]*nn+Ba.y,Zg={x:-Qn/nn*(bl-Ba.x-ds)+bl,y:-Qn/nn*(ph-Ba.y-to)+ph};if(lt&&lt.active()){var Wr=r.dragData.touchDragEles;_(Wr),r.redrawHint("drag",!0),r.redrawHint("eles",!0),lt.unactivate().emit(J("freeon")),Wr.emit(J("free")),r.dragData.didDrag&&(lt.emit(J("dragfreeon")),Wr.emit(J("dragfree")))}ee.viewport({zoom:Qn,pan:Zg,cancelOnFailedZoom:!0}),ee.emit(J("pinchzoom")),le=Ut,Y=Vt,G=Qt,re=rr,ie=ur,r.pinching=!0}if(Q.touches[0]){var Ge=r.projectIntoViewport(Q.touches[0].clientX,Q.touches[0].clientY);se[0]=Ge[0],se[1]=Ge[1]}if(Q.touches[1]){var Ge=r.projectIntoViewport(Q.touches[1].clientX,Q.touches[1].clientY);se[2]=Ge[0],se[3]=Ge[1]}if(Q.touches[2]){var Ge=r.projectIntoViewport(Q.touches[2].clientX,Q.touches[2].clientY);se[4]=Ge[0],se[5]=Ge[1]}}else if(Q.touches[0]&&!r.touchData.didSelect){var Jn=r.touchData.start,ro=r.touchData.last,Ur;if(!r.hoverData.draggingEles&&!r.swipePanning&&(Ur=r.findNearestElement(se[0],se[1],!0,!0)),ne&&Jn!=null&&Q.preventDefault(),ne&&Jn!=null&&r.nodeIsDraggable(Jn))if(Ve){var Wr=r.dragData.touchDragEles,Ki=!r.dragData.didDrag;Ki&&x(Wr,{inDragLayer:!0}),r.dragData.didDrag=!0;var Nn={x:0,y:0};if(ut(Ue[0])&&ut(Ue[1])&&(Nn.x+=Ue[0],Nn.y+=Ue[1],Ki)){r.redrawHint("eles",!0);var gi=r.touchData.dragDelta;gi&&ut(gi[0])&&ut(gi[1])&&(Nn.x+=gi[0],Nn.y+=gi[1])}r.hoverData.draggingEles=!0,Wr.silentShift(Nn).emit(J("position")).emit(J("drag")),r.redrawHint("drag",!0),r.touchData.startPosition[0]==Pe[0]&&r.touchData.startPosition[1]==Pe[1]&&r.redrawHint("eles",!0),r.redraw()}else{var gi=r.touchData.dragDelta=r.touchData.dragDelta||[];gi.length===0?(gi.push(Ue[0]),gi.push(Ue[1])):(gi[0]+=Ue[0],gi[1]+=Ue[1])}if(i(Jn||Ur,["touchmove","tapdrag","vmousemove"],Q,{x:se[0],y:se[1]}),(!Jn||!Jn.grabbed())&&Ur!=ro&&(ro&&ro.emit(J("tapdragout")),Ur&&Ur.emit(J("tapdragover"))),r.touchData.last=Ur,ne)for(var xe=0;xe<se.length;xe++)se[xe]&&r.touchData.startPosition[xe]&&Ve&&(r.touchData.singleTouchMoved=!0);if(ne&&(Jn==null||Jn.pannable())&&ee.panningEnabled()&&ee.userPanningEnabled()){var Qg=s(Jn,r.touchData.starts);Qg&&(Q.preventDefault(),r.data.bgActivePosistion||(r.data.bgActivePosistion=Tc(r.touchData.startPosition)),r.swipePanning?(ee.panBy({x:Ue[0]*Ae,y:Ue[1]*Ae}),ee.emit(J("dragpan"))):Ve&&(r.swipePanning=!0,ee.panBy({x:yt*Ae,y:Ot*Ae}),ee.emit(J("dragpan")),Jn&&(Jn.unactivate(),r.redrawHint("select",!0),r.touchData.start=null)));var Ge=r.projectIntoViewport(Q.touches[0].clientX,Q.touches[0].clientY);se[0]=Ge[0],se[1]=Ge[1]}}for(var je=0;je<se.length;je++)Pe[je]=se[je];ne&&Q.touches.length>0&&!r.hoverData.draggingEles&&!r.swipePanning&&r.data.bgActivePosistion!=null&&(r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.redraw())}},!1);var Ye;r.registerBinding(e,"touchcancel",Ye=function(Q){var ne=r.touchData.start;r.touchData.capture=!1,ne&&ne.unactivate()});var He,tt,ot,ct;if(r.registerBinding(e,"touchend",He=function(Q){var ne=r.touchData.start,be=r.touchData.capture;if(be)Q.touches.length===0&&(r.touchData.capture=!1),Q.preventDefault();else return;var ee=r.selection;r.swipePanning=!1,r.hoverData.draggingEles=!1;var se=r.cy,Pe=se.zoom(),Ae=r.touchData.now,Ge=r.touchData.earlier;if(Q.touches[0]){var J=r.projectIntoViewport(Q.touches[0].clientX,Q.touches[0].clientY);Ae[0]=J[0],Ae[1]=J[1]}if(Q.touches[1]){var J=r.projectIntoViewport(Q.touches[1].clientX,Q.touches[1].clientY);Ae[2]=J[0],Ae[3]=J[1]}if(Q.touches[2]){var J=r.projectIntoViewport(Q.touches[2].clientX,Q.touches[2].clientY);Ae[4]=J[0],Ae[5]=J[1]}var Oe=function(Yr){return{originalEvent:Q,type:Yr,position:{x:Ae[0],y:Ae[1]}}};ne&&ne.unactivate();var Ve;if(r.touchData.cxt){if(Ve=Oe("cxttapend"),ne?ne.emit(Ve):se.emit(Ve),!r.touchData.cxtDragged){var Ue=Oe("cxttap");ne?ne.emit(Ue):se.emit(Ue)}r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!1,r.touchData.start=null,r.redraw();return}if(!Q.touches[2]&&se.boxSelectionEnabled()&&r.touchData.selecting){r.touchData.selecting=!1;var je=se.collection(r.getAllInBox(ee[0],ee[1],ee[2],ee[3]));ee[0]=void 0,ee[1]=void 0,ee[2]=void 0,ee[3]=void 0,ee[4]=0,r.redrawHint("select",!0),se.emit(Oe("boxend"));var yt=function(Yr){return Yr.selectable()&&!Yr.selected()};je.emit(Oe("box")).stdFilter(yt).select().emit(Oe("boxselect")),je.nonempty()&&r.redrawHint("eles",!0),r.redraw()}if(ne!=null&&ne.unactivate(),Q.touches[2])r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);else if(!Q.touches[1]){if(!Q.touches[0]){if(!Q.touches[0]){r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var vt=r.dragData.touchDragEles;if(ne!=null){var Ot=ne._private.grabbed;_(vt),r.redrawHint("drag",!0),r.redrawHint("eles",!0),Ot&&(ne.emit(Oe("freeon")),vt.emit(Oe("free")),r.dragData.didDrag&&(ne.emit(Oe("dragfreeon")),vt.emit(Oe("dragfree")))),i(ne,["touchend","tapend","vmouseup","tapdragout"],Q,{x:Ae[0],y:Ae[1]}),ne.unactivate(),r.touchData.start=null}else{var jt=r.findNearestElement(Ae[0],Ae[1],!0,!0);i(jt,["touchend","tapend","vmouseup","tapdragout"],Q,{x:Ae[0],y:Ae[1]})}var Nr=r.touchData.startPosition[0]-Ae[0],Vt=Nr*Nr,Qt=r.touchData.startPosition[1]-Ae[1],rr=Qt*Qt,ur=Vt+rr,In=ur*Pe*Pe;r.touchData.singleTouchMoved||(ne||se.$(":selected").unselect(["tapunselect"]),i(ne,["tap","vclick"],Q,{x:Ae[0],y:Ae[1]}),tt=!1,Q.timeStamp-ct<=se.multiClickDebounceTime()?(ot&&clearTimeout(ot),tt=!0,ct=null,i(ne,["dbltap","vdblclick"],Q,{x:Ae[0],y:Ae[1]})):(ot=setTimeout(function(){tt||i(ne,["onetap","voneclick"],Q,{x:Ae[0],y:Ae[1]})},se.multiClickDebounceTime()),ct=Q.timeStamp)),ne!=null&&!r.dragData.didDrag&&ne._private.selectable&&In<r.touchTapThreshold2&&!r.pinching&&(se.selectionType()==="single"?(se.$(t).unmerge(ne).unselect(["tapunselect"]),ne.select(["tapselect"])):ne.selected()?ne.unselect(["tapunselect"]):ne.select(["tapselect"]),r.redrawHint("eles",!0)),r.touchData.singleTouchMoved=!0}}}for(var vr=0;vr<Ae.length;vr++)Ge[vr]=Ae[vr];r.dragData.didDrag=!1,Q.touches.length===0&&(r.touchData.dragDelta=[],r.touchData.startPosition=[null,null,null,null,null,null],r.touchData.startGPosition=null,r.touchData.didSelect=!1),Q.touches.length<2&&(Q.touches.length===1&&(r.touchData.startGPosition=[Q.touches[0].clientX,Q.touches[0].clientY]),r.pinching=!1,r.redrawHint("eles",!0),r.redraw())},!1),typeof TouchEvent>"u"){var Ze=[],bt=function(Q){return{clientX:Q.clientX,clientY:Q.clientY,force:1,identifier:Q.pointerId,pageX:Q.pageX,pageY:Q.pageY,radiusX:Q.width/2,radiusY:Q.height/2,screenX:Q.screenX,screenY:Q.screenY,target:Q.target}},Se=function(Q){return{event:Q,touch:bt(Q)}},ke=function(Q){Ze.push(Se(Q))},We=function(Q){for(var ne=0;ne<Ze.length;ne++){var be=Ze[ne];if(be.event.pointerId===Q.pointerId){Ze.splice(ne,1);return}}},Ke=function(Q){var ne=Ze.filter(function(be){return be.event.pointerId===Q.pointerId})[0];ne.event=Q,ne.touch=bt(Q)},rt=function(Q){Q.touches=Ze.map(function(ne){return ne.touch})},nt=function(Q){return Q.pointerType==="mouse"||Q.pointerType===4};r.registerBinding(r.container,"pointerdown",function(De){nt(De)||(De.preventDefault(),ke(De),rt(De),Be(De))}),r.registerBinding(r.container,"pointerup",function(De){nt(De)||(We(De),rt(De),He(De))}),r.registerBinding(r.container,"pointercancel",function(De){nt(De)||(We(De),rt(De),Ye(De))}),r.registerBinding(r.container,"pointermove",function(De){nt(De)||(De.preventDefault(),Ke(De),rt(De),$e(De))})}};var Ws={};Ws.generatePolygon=function(r,e){return this.nodeShapes[r]={renderer:this,name:r,points:e,draw:function(n,i,a,s,o,l){this.renderer.nodeShapeImpl("polygon",n,i,a,s,o,this.points)},intersectLine:function(n,i,a,s,o,l,c,h){return Qf(o,l,this.points,n,i,a/2,s/2,c)},checkPoint:function(n,i,a,s,o,l,c,h){return Vs(n,i,this.points,l,c,s,o,[0,-1],a)},hasMiterBounds:r!=="rectangle",miterBounds:function(n,i,a,s,o,l){return hU(this.points,n,i,a,s,o)}}};Ws.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,n,i,a,s){this.renderer.nodeShapeImpl(this.name,e,t,n,i,a)},intersectLine:function(e,t,n,i,a,s,o,l){return bU(a,s,e,t,n/2+o,i/2+o)},checkPoint:function(e,t,n,i,a,s,o,l){return su(e,t,i,a,s,o,n)}}};Ws.generateRoundPolygon=function(r,e){return this.nodeShapes[r]={renderer:this,name:r,points:e,getOrCreateCorners:function(n,i,a,s,o,l,c){if(l[c]!==void 0&&l[c+"-cx"]===n&&l[c+"-cy"]===i)return l[c];l[c]=new Array(e.length/2),l[c+"-cx"]=n,l[c+"-cy"]=i;var h=a/2,d=s/2;o=o==="auto"?rR(a,s):o;for(var v=new Array(e.length/2),g=0;g<e.length/2;g++)v[g]={x:n+h*e[g*2],y:i+d*e[g*2+1]};var m,x,y,_,w=v.length;for(x=v[w-1],m=0;m<w;m++)y=v[m%w],_=v[(m+1)%w],l[c][m]=hw(x,y,_,o),x=y,y=_;return l[c]},draw:function(n,i,a,s,o,l,c){this.renderer.nodeShapeImpl("round-polygon",n,i,a,s,o,this.points,this.getOrCreateCorners(i,a,s,o,l,c,"drawCorners"))},intersectLine:function(n,i,a,s,o,l,c,h,d){return _U(o,l,this.points,n,i,a,s,c,this.getOrCreateCorners(n,i,a,s,h,d,"corners"))},checkPoint:function(n,i,a,s,o,l,c,h,d){return yU(n,i,this.points,l,c,s,o,this.getOrCreateCorners(l,c,s,o,h,d,"corners"))}}};Ws.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:ui(4,0),draw:function(e,t,n,i,a,s){this.renderer.nodeShapeImpl(this.name,e,t,n,i,a,this.points,s)},intersectLine:function(e,t,n,i,a,s,o,l){return eR(a,s,e,t,n,i,o,l)},checkPoint:function(e,t,n,i,a,s,o,l){var c=i/2,h=a/2;l=l==="auto"?Zo(i,a):l,l=Math.min(c,h,l);var d=l*2;return!!(Vs(e,t,this.points,s,o,i,a-d,[0,-1],n)||Vs(e,t,this.points,s,o,i-d,a,[0,-1],n)||su(e,t,d,d,s-c+l,o-h+l,n)||su(e,t,d,d,s+c-l,o-h+l,n)||su(e,t,d,d,s+c-l,o+h-l,n)||su(e,t,d,d,s-c+l,o+h-l,n))}}};Ws.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:ew(),points:ui(4,0),draw:function(e,t,n,i,a,s){this.renderer.nodeShapeImpl(this.name,e,t,n,i,a,null,s)},generateCutTrianglePts:function(e,t,n,i,a){var s=a==="auto"?this.cornerLength:a,o=t/2,l=e/2,c=n-l,h=n+l,d=i-o,v=i+o;return{topLeft:[c,d+s,c+s,d,c+s,d+s],topRight:[h-s,d,h,d+s,h-s,d+s],bottomRight:[h,v-s,h-s,v,h-s,v-s],bottomLeft:[c+s,v,c,v-s,c+s,v-s]}},intersectLine:function(e,t,n,i,a,s,o,l){var c=this.generateCutTrianglePts(n+2*o,i+2*o,e,t,l),h=[].concat.apply([],[c.topLeft.splice(0,4),c.topRight.splice(0,4),c.bottomRight.splice(0,4),c.bottomLeft.splice(0,4)]);return Qf(a,s,h,e,t)},checkPoint:function(e,t,n,i,a,s,o,l){var c=l==="auto"?this.cornerLength:l;if(Vs(e,t,this.points,s,o,i,a-2*c,[0,-1],n)||Vs(e,t,this.points,s,o,i-2*c,a,[0,-1],n))return!0;var h=this.generateCutTrianglePts(i,a,s,o);return Mi(e,t,h.topLeft)||Mi(e,t,h.topRight)||Mi(e,t,h.bottomRight)||Mi(e,t,h.bottomLeft)}}};Ws.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:ui(4,0),draw:function(e,t,n,i,a,s){this.renderer.nodeShapeImpl(this.name,e,t,n,i,a)},intersectLine:function(e,t,n,i,a,s,o,l){var c=.15,h=.5,d=.85,v=this.generateBarrelBezierPts(n+2*o,i+2*o,e,t),g=function(y){var _=Mc({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},c),w=Mc({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},h),S=Mc({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},d);return[y[0],y[1],_.x,_.y,w.x,w.y,S.x,S.y,y[4],y[5]]},m=[].concat(g(v.topLeft),g(v.topRight),g(v.bottomRight),g(v.bottomLeft));return Qf(a,s,m,e,t)},generateBarrelBezierPts:function(e,t,n,i){var a=t/2,s=e/2,o=n-s,l=n+s,c=i-a,h=i+a,d=r4(e,t),v=d.heightOffset,g=d.widthOffset,m=d.ctrlPtOffsetPct*e,x={topLeft:[o,c+v,o+m,c,o+g,c],topRight:[l-g,c,l-m,c,l,c+v],bottomRight:[l,h-v,l-m,h,l-g,h],bottomLeft:[o+g,h,o+m,h,o,h-v]};return x.topLeft.isTop=!0,x.topRight.isTop=!0,x.bottomLeft.isBottom=!0,x.bottomRight.isBottom=!0,x},checkPoint:function(e,t,n,i,a,s,o,l){var c=r4(i,a),h=c.heightOffset,d=c.widthOffset;if(Vs(e,t,this.points,s,o,i,a-2*h,[0,-1],n)||Vs(e,t,this.points,s,o,i-2*d,a,[0,-1],n))return!0;for(var v=this.generateBarrelBezierPts(i,a,s,o),g=function(O,D,I){var k=I[4],U=I[2],V=I[0],X=I[5],W=I[1],P=Math.min(k,V),H=Math.max(k,V),z=Math.min(X,W),$=Math.max(X,W);if(P<=O&&O<=H&&z<=D&&D<=$){var B=wU(k,U,V),L=vU(B[0],B[1],B[2],O),Y=L.filter(function(G){return 0<=G&&G<=1});if(Y.length>0)return Y[0]}return null},m=Object.keys(v),x=0;x<m.length;x++){var y=m[x],_=v[y],w=g(e,t,_);if(w!=null){var S=_[5],A=_[3],C=_[1],M=kn(S,A,C,w);if(_.isTop&&M<=t||_.isBottom&&t<=M)return!0}}return!1}}};Ws.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:ui(4,0),draw:function(e,t,n,i,a,s){this.renderer.nodeShapeImpl(this.name,e,t,n,i,a,this.points,s)},intersectLine:function(e,t,n,i,a,s,o,l){var c=e-(n/2+o),h=t-(i/2+o),d=h,v=e+(n/2+o),g=zo(a,s,e,t,c,h,v,d,!1);return g.length>0?g:eR(a,s,e,t,n,i,o,l)},checkPoint:function(e,t,n,i,a,s,o,l){l=l==="auto"?Zo(i,a):l;var c=2*l;if(Vs(e,t,this.points,s,o,i,a-c,[0,-1],n)||Vs(e,t,this.points,s,o,i-c,a,[0,-1],n))return!0;var h=i/2+2*n,d=a/2+2*n,v=[s-h,o-d,s-h,o,s+h,o,s+h,o-d];return!!(Mi(e,t,v)||su(e,t,c,c,s+i/2-l,o+a/2-l,n)||su(e,t,c,c,s-i/2+l,o+a/2-l,n))}}};Ws.registerNodeShapes=function(){var r=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",ui(3,0)),this.generateRoundPolygon("round-triangle",ui(3,0)),this.generatePolygon("rectangle",ui(4,0)),r.square=r.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var t=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",t),this.generateRoundPolygon("round-diamond",t)}this.generatePolygon("pentagon",ui(5,0)),this.generateRoundPolygon("round-pentagon",ui(5,0)),this.generatePolygon("hexagon",ui(6,0)),this.generateRoundPolygon("round-hexagon",ui(6,0)),this.generatePolygon("heptagon",ui(7,0)),this.generateRoundPolygon("round-heptagon",ui(7,0)),this.generatePolygon("octagon",ui(8,0)),this.generateRoundPolygon("round-octagon",ui(8,0));var n=new Array(20);{var i=t4(5,0),a=t4(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o<a.length/2;o++)a[o*2]*=s,a[o*2+1]*=s;for(var o=0;o<20/4;o++)n[o*4]=i[o*2],n[o*4+1]=i[o*2+1],n[o*4+2]=a[o*2],n[o*4+3]=a[o*2+1]}n=tR(n),this.generatePolygon("star",n),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var l=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",l),this.generateRoundPolygon("round-tag",l)}r.makePolygon=function(c){var h=c.join("$"),d="polygon-"+h,v;return(v=this[d])?v:e.generatePolygon(d,c)}};var Nd={};Nd.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};Nd.redraw=function(r){r=r||K9();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=r};Nd.beforeRender=function(r,e){if(!this.destroyed){e==null&&jr("Priority is not optional for beforeRender");var t=this.beforeRenderCallbacks;t.push({fn:r,priority:e}),t.sort(function(n,i){return i.priority-n.priority})}};var f7=function(e,t,n){for(var i=e.beforeRenderCallbacks,a=0;a<i.length;a++)i[a].fn(t,n)};Nd.startRenderLoop=function(){var r=this,e=r.cy;if(!r.renderLoopStarted){r.renderLoopStarted=!0;var t=function(i){if(!r.destroyed){if(!e.batching())if(r.requestedFrame&&!r.skipFrame){f7(r,!0,i);var a=js();r.render(r.renderOptions);var s=r.lastDrawTime=js();r.averageRedrawTime===void 0&&(r.averageRedrawTime=s-a),r.redrawCount===void 0&&(r.redrawCount=0),r.redrawCount++,r.redrawTotalTime===void 0&&(r.redrawTotalTime=0);var o=s-a;r.redrawTotalTime+=o,r.lastRedrawTime=o,r.averageRedrawTime=r.averageRedrawTime/2+o/2,r.requestedFrame=!1}else f7(r,!1,i);r.skipFrame=!1,Ap(t)}};Ap(t)}};var Fj=function(e){this.init(e)},rO=Fj,nh=rO.prototype;nh.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];nh.init=function(r){var e=this;e.options=r,e.cy=r.cy;var t=e.container=r.cy.container(),n=e.cy.window();if(n){var i=n.document,a=i.head,s="__________cytoscape_stylesheet",o="__________cytoscape_container",l=i.getElementById(s)!=null;if(t.className.indexOf(o)<0&&(t.className=(t.className||"")+" "+o),!l){var c=i.createElement("style");c.id=s,c.textContent="."+o+" { position: relative; }",a.insertBefore(c,a.children[0])}var h=n.getComputedStyle(t),d=h.getPropertyValue("position");d==="static"&&fr("A Cytoscape container has style position:static and so can not use UI extensions properly")}e.selection=[void 0,void 0,void 0,void 0,0],e.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],e.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},e.dragData={possibleDragElements:[]},e.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},e.redraws=0,e.showFps=r.showFps,e.debug=r.debug,e.webgl=r.webgl,e.hideEdgesOnViewport=r.hideEdgesOnViewport,e.textureOnViewport=r.textureOnViewport,e.wheelSensitivity=r.wheelSensitivity,e.motionBlurEnabled=r.motionBlur,e.forcedPixelRatio=ut(r.pixelRatio)?r.pixelRatio:null,e.motionBlur=r.motionBlur,e.motionBlurOpacity=r.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=r.desktopTapThreshold,e.desktopTapThreshold2=r.desktopTapThreshold*r.desktopTapThreshold,e.touchTapThreshold=r.touchTapThreshold,e.touchTapThreshold2=r.touchTapThreshold*r.touchTapThreshold,e.tapholdDuration=500,e.bindings=[],e.beforeRenderCallbacks=[],e.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},e.registerNodeShapes(),e.registerArrowShapes(),e.registerCalculationListeners()};nh.notify=function(r,e){var t=this,n=t.cy;if(!this.destroyed){if(r==="init"){t.load();return}if(r==="destroy"){t.destroy();return}(r==="add"||r==="remove"||r==="move"&&n.hasCompoundNodes()||r==="load"||r==="zorder"||r==="mount")&&t.invalidateCachedZSortedEles(),r==="viewport"&&t.redrawHint("select",!0),r==="gc"&&t.redrawHint("gc",!0),(r==="load"||r==="resize"||r==="mount")&&(t.invalidateContainerClientCoordsCache(),t.matchCanvasSize(t.container)),t.redrawHint("eles",!0),t.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};nh.destroy=function(){var r=this;r.destroyed=!0,r.cy.stopAnimationLoop();for(var e=0;e<r.bindings.length;e++){var t=r.bindings[e],n=t,i=n.target;(i.off||i.removeEventListener).apply(i,n.args)}if(r.bindings=[],r.beforeRenderCallbacks=[],r.onUpdateEleCalcsFns=[],r.removeObserver&&r.removeObserver.disconnect(),r.styleObserver&&r.styleObserver.disconnect(),r.resizeObserver&&r.resizeObserver.disconnect(),r.labelCalcDiv)try{document.body.removeChild(r.labelCalcDiv)}catch{}};nh.isHeadless=function(){return!1};[cw,eO,tO,rh,Ws,Nd].forEach(function(r){Ct(nh,r)});var L2=1e3/60,nO={setupDequeueing:function(e){return function(){var n=this,i=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var a=Rd(function(){i.redrawHint("eles",!0),i.redrawHint("drag",!0),i.redraw()},e.deqRedrawThreshold),s=function(c,h){var d=js(),v=i.averageRedrawTime,g=i.lastRedrawTime,m=[],x=i.cy.extent(),y=i.getPixelRatio();for(c||i.flushRenderedStyleQueue();;){var _=js(),w=_-d,S=_-h;if(g<L2){var A=L2-(c?v:0);if(S>=e.deqFastCost*A)break}else if(c){if(w>=e.deqCost*g||w>=e.deqAvgCost*v)break}else if(S>=e.deqNoDrawCost*L2)break;var C=e.deq(n,y,x);if(C.length>0)for(var M=0;M<C.length;M++)m.push(C[M]);else break}m.length>0&&(e.onDeqd(n,m),!c&&e.shouldRedraw(n,m,y,x)&&a())},o=e.priority||$_;i.beforeRender(s,o(n))}}}},zj=(function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Mp;hl(this,r),this.idsByKey=new zs,this.keyForId=new zs,this.cachesByLvl=new zs,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=t}return fl(r,[{key:"getIdsFor",value:function(t){t==null&&jr("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(t);return i||(i=new Qc,n.set(t,i)),i}},{key:"addIdForKey",value:function(t,n){t!=null&&this.getIdsFor(t).add(n)}},{key:"deleteIdForKey",value:function(t,n){t!=null&&this.getIdsFor(t).delete(n)}},{key:"getNumberOfIdsForKey",value:function(t){return t==null?0:this.getIdsFor(t).size}},{key:"updateKeyMappingFor",value:function(t){var n=t.id(),i=this.keyForId.get(n),a=this.getKey(t);this.deleteIdForKey(i,n),this.addIdForKey(a,n),this.keyForId.set(n,a)}},{key:"deleteKeyMappingFor",value:function(t){var n=t.id(),i=this.keyForId.get(n);this.deleteIdForKey(i,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(t){var n=t.id(),i=this.keyForId.get(n),a=this.getKey(t);return i!==a}},{key:"isInvalid",value:function(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}},{key:"getCachesAt",value:function(t){var n=this.cachesByLvl,i=this.lvls,a=n.get(t);return a||(a=new zs,n.set(t,a),i.push(t)),a}},{key:"getCache",value:function(t,n){return this.getCachesAt(n).get(t)}},{key:"get",value:function(t,n){var i=this.getKey(t),a=this.getCache(i,n);return a!=null&&this.updateKeyMappingFor(t),a}},{key:"getForCachedKey",value:function(t,n){var i=this.keyForId.get(t.id()),a=this.getCache(i,n);return a}},{key:"hasCache",value:function(t,n){return this.getCachesAt(n).has(t)}},{key:"has",value:function(t,n){var i=this.getKey(t);return this.hasCache(i,n)}},{key:"setCache",value:function(t,n,i){i.key=t,this.getCachesAt(n).set(t,i)}},{key:"set",value:function(t,n,i){var a=this.getKey(t);this.setCache(a,n,i),this.updateKeyMappingFor(t)}},{key:"deleteCache",value:function(t,n){this.getCachesAt(n).delete(t)}},{key:"delete",value:function(t,n){var i=this.getKey(t);this.deleteCache(i,n)}},{key:"invalidateKey",value:function(t){var n=this;this.lvls.forEach(function(i){return n.deleteCache(t,i)})}},{key:"invalidate",value:function(t){var n=t.id(),i=this.keyForId.get(n);this.deleteKeyMappingFor(t);var a=this.doesEleInvalidateKey(t);return a&&this.invalidateKey(i),a||this.getNumberOfIdsForKey(i)===0}}])})(),d7=25,dv=50,up=-4,p4=3,iO=7.99,Uj=8,Gj=1024,Hj=1024,jj=1024,Vj=.2,qj=.8,Xj=10,Yj=.15,Wj=.1,$j=.9,Kj=.9,Zj=100,Qj=1,Ac={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Jj=$n({getKey:null,doesEleInvalidateKey:Mp,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Y9,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Rf=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var i=Jj(t);Ct(n,i),n.lookup=new zj(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},Pn=Rf.prototype;Pn.reasons=Ac;Pn.getTextureQueue=function(r){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[r]=e.eleImgCaches[r]||[]};Pn.getRetiredTextureQueue=function(r){var e=this,t=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=t[r]=t[r]||[];return n};Pn.getElementQueue=function(){var r=this,e=r.eleCacheQueue=r.eleCacheQueue||new Od(function(t,n){return n.reqs-t.reqs});return e};Pn.getElementKeyToQueue=function(){var r=this,e=r.eleKeyToCacheQueue=r.eleKeyToCacheQueue||{};return e};Pn.getElement=function(r,e,t,n,i){var a=this,s=this.renderer,o=s.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!r.visible()||r.removed()||!a.allowEdgeTxrCaching&&r.isEdge()||!a.allowParentTxrCaching&&r.isParent())return null;if(n==null&&(n=Math.ceil(Z_(o*t))),n<up)n=up;else if(o>=iO||n>p4)return null;var c=Math.pow(2,n),h=e.h*c,d=e.w*c,v=s.eleTextBiggerThanMin(r,c);if(!this.isVisible(r,v))return null;var g=l.get(r,n);if(g&&g.invalidated&&(g.invalidated=!1,g.texture.invalidatedWidth-=g.width),g)return g;var m;if(h<=d7?m=d7:h<=dv?m=dv:m=Math.ceil(h/dv)*dv,h>jj||d>Hj)return null;var x=a.getTextureQueue(m),y=x[x.length-2],_=function(){return a.recycleTexture(m,d)||a.addTexture(m,d)};y||(y=x[x.length-1]),y||(y=_()),y.width-y.usedWidth<d&&(y=_());for(var w=function(P){return P&&P.scaledLabelShown===v},S=i&&i===Ac.dequeue,A=i&&i===Ac.highQuality,C=i&&i===Ac.downscale,M,E=n+1;E<=p4;E++){var O=l.get(r,E);if(O){M=O;break}}var D=M&&M.level===n+1?M:null,I=function(){y.context.drawImage(D.texture.canvas,D.x,0,D.width,D.height,y.usedWidth,0,d,h)};if(y.context.setTransform(1,0,0,1,0,0),y.context.clearRect(y.usedWidth,0,d,m),w(D))I();else if(w(M))if(A){for(var k=M.level;k>n;k--)D=a.getElement(r,e,t,k,Ac.downscale);I()}else return a.queueElement(r,M.level-1),M;else{var U;if(!S&&!A&&!C)for(var V=n-1;V>=up;V--){var X=l.get(r,V);if(X){U=X;break}}if(w(U))return a.queueElement(r,n),U;y.context.translate(y.usedWidth,0),y.context.scale(c,c),this.drawElement(y.context,r,e,v,!1),y.context.scale(1/c,1/c),y.context.translate(-y.usedWidth,0)}return g={x:y.usedWidth,texture:y,level:n,scale:c,width:d,height:h,scaledLabelShown:v},y.usedWidth+=Math.ceil(d+Uj),y.eleCaches.push(g),l.set(r,n,g),a.checkTextureFullness(y),g};Pn.invalidateElements=function(r){for(var e=0;e<r.length;e++)this.invalidateElement(r[e])};Pn.invalidateElement=function(r){var e=this,t=e.lookup,n=[],i=t.isInvalid(r);if(i){for(var a=up;a<=p4;a++){var s=t.getForCachedKey(r,a);s&&n.push(s)}var o=t.invalidate(r);if(o)for(var l=0;l<n.length;l++){var c=n[l],h=c.texture;h.invalidatedWidth+=c.width,c.invalidated=!0,e.checkTextureUtility(h)}e.removeFromQueue(r)}};Pn.checkTextureUtility=function(r){r.invalidatedWidth>=Vj*r.width&&this.retireTexture(r)};Pn.checkTextureFullness=function(r){var e=this,t=e.getTextureQueue(r.height);r.usedWidth/r.width>qj&&r.fullnessChecks>=Xj?Ko(t,r):r.fullnessChecks++};Pn.retireTexture=function(r){var e=this,t=r.height,n=e.getTextureQueue(t),i=this.lookup;Ko(n,r),r.retired=!0;for(var a=r.eleCaches,s=0;s<a.length;s++){var o=a[s];i.deleteCache(o.key,o.level)}K_(a);var l=e.getRetiredTextureQueue(t);l.push(r)};Pn.addTexture=function(r,e){var t=this,n=t.getTextureQueue(r),i={};return n.push(i),i.eleCaches=[],i.height=r,i.width=Math.max(Gj,e),i.usedWidth=0,i.invalidatedWidth=0,i.fullnessChecks=0,i.canvas=t.renderer.makeOffscreenCanvas(i.width,i.height),i.context=i.canvas.getContext("2d"),i};Pn.recycleTexture=function(r,e){for(var t=this,n=t.getTextureQueue(r),i=t.getRetiredTextureQueue(r),a=0;a<i.length;a++){var s=i[a];if(s.width>=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,K_(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),Ko(i,s),n.push(s),s}};Pn.queueElement=function(r,e){var t=this,n=t.getElementQueue(),i=t.getElementKeyToQueue(),a=this.getKey(r),s=i[a];if(s)s.level=Math.max(s.level,e),s.eles.merge(r),s.reqs++,n.updateItem(s);else{var o={eles:r.spawn().merge(r),level:e,reqs:1,key:a};n.push(o),i[a]=o}};Pn.dequeue=function(r){for(var e=this,t=e.getElementQueue(),n=e.getElementKeyToQueue(),i=[],a=e.lookup,s=0;s<Qj&&t.size()>0;s++){var o=t.pop(),l=o.key,c=o.eles[0],h=a.hasCache(c,o.level);if(n[l]=null,h)continue;i.push(o);var d=e.getBoundingBox(c);e.getElement(c,d,r,o.level,Ac.dequeue)}return i};Pn.removeFromQueue=function(r){var e=this,t=e.getElementQueue(),n=e.getElementKeyToQueue(),i=this.getKey(r),a=n[i];a!=null&&(a.eles.length===1?(a.reqs=W_,t.updateItem(a),t.pop(),n[i]=null):a.eles.unmerge(r))};Pn.onDequeue=function(r){this.onDequeues.push(r)};Pn.offDequeue=function(r){Ko(this.onDequeues,r)};Pn.setupDequeueing=nO.setupDequeueing({deqRedrawThreshold:Zj,deqCost:Yj,deqAvgCost:Wj,deqNoDrawCost:$j,deqFastCost:Kj,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n<e.onDequeues.length;n++){var i=e.onDequeues[n];i(t)}},shouldRedraw:function(e,t,n,i){for(var a=0;a<t.length;a++)for(var s=t[a].eles,o=0;o<s.length;o++){var l=s[o].boundingBox();if(J_(l,i))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var eV=1,Ff=-4,kp=2,tV=3.99,rV=50,nV=50,iV=.15,aV=.1,sV=.9,oV=.9,lV=1,v7=250,uV=4e3*4e3,p7=32767,cV=!0,aO=function(e){var t=this,n=t.renderer=e,i=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=js()-2*v7,t.skipping=!1,t.eleTxrDeqs=i.collection(),t.scheduleElementRefinement=Rd(function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)},nV),n.beforeRender(function(s,o){o-t.lastInvalidationTime<=v7?t.skipping=!0:t.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var a=function(o,l){return l.reqs-o.reqs};t.layersQueue=new Od(a),t.setupDequeueing()},Kn=aO.prototype,g7=0,hV=Math.pow(2,53)-1;Kn.makeLayer=function(r,e){var t=Math.pow(2,e),n=Math.ceil(r.w*t),i=Math.ceil(r.h*t),a=this.renderer.makeOffscreenCanvas(n,i),s={id:g7=++g7%hV,bb:r,level:e,width:n,height:i,canvas:a,context:a.getContext("2d"),eles:[],elesQueue:[],reqs:0},o=s.context,l=-s.bb.x1,c=-s.bb.y1;return o.scale(t,t),o.translate(l,c),s};Kn.getLayers=function(r,e,t){var n=this,i=n.renderer,a=i.cy,s=a.zoom(),o=n.firstGet;if(n.firstGet=!1,t==null){if(t=Math.ceil(Z_(s*e)),t<Ff)t=Ff;else if(s>=tV||t>kp)return null}n.validateLayersElesOrdering(t,r);var l=n.layersByLevel,c=Math.pow(2,t),h=l[t]=l[t]||[],d,v=n.levelIsComplete(t,r),g,m=function(){var I=function(W){if(n.validateLayersElesOrdering(W,r),n.levelIsComplete(W,r))return g=l[W],!0},k=function(W){if(!g)for(var P=t+W;Ff<=P&&P<=kp&&!I(P);P+=W);};k(1),k(-1);for(var U=h.length-1;U>=0;U--){var V=h[U];V.invalid&&Ko(h,V)}};if(!v)m();else return h;var x=function(){if(!d){d=di();for(var I=0;I<r.length;I++)lU(d,r[I].boundingBox())}return d},y=function(I){I=I||{};var k=I.after;x();var U=Math.ceil(d.w*c),V=Math.ceil(d.h*c);if(U>p7||V>p7)return null;var X=U*V;if(X>uV)return null;var W=n.makeLayer(d,t);if(k!=null){var P=h.indexOf(k)+1;h.splice(P,0,W)}else(I.insert===void 0||I.insert)&&h.unshift(W);return W};if(n.skipping&&!o)return null;for(var _=null,w=r.length/eV,S=!o,A=0;A<r.length;A++){var C=r[A],M=C._private.rscratch,E=M.imgLayerCaches=M.imgLayerCaches||{},O=E[t];if(O){_=O;continue}if((!_||_.eles.length>=w||!J9(_.bb,C.boundingBox()))&&(_=y({insert:!0,after:_}),!_))return null;g||S?n.queueLayer(_,C):n.drawEleInLayer(_,C,t,e),_.eles.push(C),E[t]=_}return g||(S?null:h)};Kn.getEleLevelForLayerLevel=function(r,e){return r};Kn.drawEleInLayer=function(r,e,t,n){var i=this,a=this.renderer,s=r.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(t=i.getEleLevelForLayerLevel(t,n),a.setImgSmoothing(s,!1),a.drawCachedElement(s,e,null,null,t,cV),a.setImgSmoothing(s,!0))};Kn.levelIsComplete=function(r,e){var t=this,n=t.layersByLevel[r];if(!n||n.length===0)return!1;for(var i=0,a=0;a<n.length;a++){var s=n[a];if(s.reqs>0||s.invalid)return!1;i+=s.eles.length}return i===e.length};Kn.validateLayersElesOrdering=function(r,e){var t=this.layersByLevel[r];if(t)for(var n=0;n<t.length;n++){for(var i=t[n],a=-1,s=0;s<e.length;s++)if(i.eles[0]===e[s]){a=s;break}if(a<0){this.invalidateLayer(i);continue}for(var o=a,s=0;s<i.eles.length;s++)if(i.eles[s]!==e[o+s]){this.invalidateLayer(i);break}}};Kn.updateElementsInLayers=function(r,e){for(var t=this,n=Td(r[0]),i=0;i<r.length;i++)for(var a=n?null:r[i],s=n?r[i]:r[i].ele,o=s._private.rscratch,l=o.imgLayerCaches=o.imgLayerCaches||{},c=Ff;c<=kp;c++){var h=l[c];h&&(a&&t.getEleLevelForLayerLevel(h.level)!==a.level||e(h,s,a))}};Kn.haveLayers=function(){for(var r=this,e=!1,t=Ff;t<=kp;t++){var n=r.layersByLevel[t];if(n&&n.length>0){e=!0;break}}return e};Kn.invalidateElements=function(r){var e=this;r.length!==0&&(e.lastInvalidationTime=js(),!(r.length===0||!e.haveLayers())&&e.updateElementsInLayers(r,function(n,i,a){e.invalidateLayer(n)}))};Kn.invalidateLayer=function(r){if(this.lastInvalidationTime=js(),!r.invalid){var e=r.level,t=r.eles,n=this.layersByLevel[e];Ko(n,r),r.elesQueue=[],r.invalid=!0,r.replacement&&(r.replacement.invalid=!0);for(var i=0;i<t.length;i++){var a=t[i]._private.rscratch.imgLayerCaches;a&&(a[e]=null)}}};Kn.refineElementTextures=function(r){var e=this;e.updateElementsInLayers(r,function(n,i,a){var s=n.replacement;if(s||(s=n.replacement=e.makeLayer(n.bb,n.level),s.replaces=n,s.eles=n.eles),!s.reqs)for(var o=0;o<s.eles.length;o++)e.queueLayer(s,s.eles[o])})};Kn.enqueueElementRefinement=function(r){this.eleTxrDeqs.merge(r),this.scheduleElementRefinement()};Kn.queueLayer=function(r,e){var t=this,n=t.layersQueue,i=r.elesQueue,a=i.hasId=i.hasId||{};if(!r.replacement){if(e){if(a[e.id()])return;i.push(e),a[e.id()]=!0}r.reqs?(r.reqs++,n.updateItem(r)):(r.reqs=1,n.push(r))}};Kn.dequeue=function(r){for(var e=this,t=e.layersQueue,n=[],i=0;i<lV&&t.size()!==0;){var a=t.peek();if(a.replacement){t.pop();continue}if(a.replaces&&a!==a.replaces.replacement){t.pop();continue}if(a.invalid){t.pop();continue}var s=a.elesQueue.shift();s&&(e.drawEleInLayer(a,s,a.level,r),i++),n.length===0&&n.push(!0),a.elesQueue.length===0&&(t.pop(),a.reqs=0,a.replaces&&e.applyLayerReplacement(a),e.requestRedraw())}return n};Kn.applyLayerReplacement=function(r){var e=this,t=e.layersByLevel[r.level],n=r.replaces,i=t.indexOf(n);if(!(i<0||n.invalid)){t[i]=r;for(var a=0;a<r.eles.length;a++){var s=r.eles[a]._private,o=s.imgLayerCaches=s.imgLayerCaches||{};o&&(o[r.level]=r)}e.requestRedraw()}};Kn.requestRedraw=Rd(function(){var r=this.renderer;r.redrawHint("eles",!0),r.redrawHint("drag",!0),r.redraw()},100);Kn.setupDequeueing=nO.setupDequeueing({deqRedrawThreshold:rV,deqCost:iV,deqAvgCost:aV,deqNoDrawCost:sV,deqFastCost:oV,deq:function(e,t){return e.dequeue(t)},onDeqd:$_,shouldRedraw:Y9,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var sO={},m7;function fV(r,e){for(var t=0;t<e.length;t++){var n=e[t];r.lineTo(n.x,n.y)}}function dV(r,e,t){for(var n,i=0;i<e.length;i++){var a=e[i];i===0&&(n=a),r.lineTo(a.x,a.y)}r.quadraticCurveTo(t.x,t.y,n.x,n.y)}function y7(r,e,t){r.beginPath&&r.beginPath();for(var n=e,i=0;i<n.length;i++){var a=n[i];r.lineTo(a.x,a.y)}var s=t,o=t[0];r.moveTo(o.x,o.y);for(var i=1;i<s.length;i++){var a=s[i];r.lineTo(a.x,a.y)}r.closePath&&r.closePath()}function vV(r,e,t,n,i){r.beginPath&&r.beginPath(),r.arc(t,n,i,0,Math.PI*2,!1);var a=e,s=a[0];r.moveTo(s.x,s.y);for(var o=0;o<a.length;o++){var l=a[o];r.lineTo(l.x,l.y)}r.closePath&&r.closePath()}function pV(r,e,t,n){r.arc(e,t,n,0,Math.PI*2,!1)}sO.arrowShapeImpl=function(r){return(m7||(m7={polygon:fV,"triangle-backcurve":dV,"triangle-tee":y7,"circle-triangle":vV,"triangle-cross":y7,circle:pV}))[r]};var ls={};ls.drawElement=function(r,e,t,n,i,a){var s=this;e.isNode()?s.drawNode(r,e,t,n,i,a):s.drawEdge(r,e,t,n,i,a)};ls.drawElementOverlay=function(r,e){var t=this;e.isNode()?t.drawNodeOverlay(r,e):t.drawEdgeOverlay(r,e)};ls.drawElementUnderlay=function(r,e){var t=this;e.isNode()?t.drawNodeUnderlay(r,e):t.drawEdgeUnderlay(r,e)};ls.drawCachedElementPortion=function(r,e,t,n,i,a,s,o){var l=this,c=t.getBoundingBox(e);if(!(c.w===0||c.h===0)){var h=t.getElement(e,c,n,i,a);if(h!=null){var d=o(l,e);if(d===0)return;var v=s(l,e),g=c.x1,m=c.y1,x=c.w,y=c.h,_,w,S,A,C;if(v!==0){var M=t.getRotationPoint(e);S=M.x,A=M.y,r.translate(S,A),r.rotate(v),C=l.getImgSmoothing(r),C||l.setImgSmoothing(r,!0);var E=t.getRotationOffset(e);_=E.x,w=E.y}else _=g,w=m;var O;d!==1&&(O=r.globalAlpha,r.globalAlpha=O*d),r.drawImage(h.texture.canvas,h.x,0,h.width,h.height,_,w,x,y),d!==1&&(r.globalAlpha=O),v!==0&&(r.rotate(-v),r.translate(-S,-A),C||l.setImgSmoothing(r,!1))}else t.drawElement(r,e)}};var gV=function(){return 0},mV=function(e,t){return e.getTextAngle(t,null)},yV=function(e,t){return e.getTextAngle(t,"source")},bV=function(e,t){return e.getTextAngle(t,"target")},xV=function(e,t){return t.effectiveOpacity()},k2=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};ls.drawCachedElement=function(r,e,t,n,i,a){var s=this,o=s.data,l=o.eleTxrCache,c=o.lblTxrCache,h=o.slbTxrCache,d=o.tlbTxrCache,v=e.boundingBox(),g=a===!0?l.reasons.highQuality:null;if(!(v.w===0||v.h===0||!e.visible())&&(!n||J_(v,n))){var m=e.isEdge(),x=e.element()._private.rscratch.badLine;s.drawElementUnderlay(r,e),s.drawCachedElementPortion(r,e,l,t,i,g,gV,xV),(!m||!x)&&s.drawCachedElementPortion(r,e,c,t,i,g,mV,k2),m&&!x&&(s.drawCachedElementPortion(r,e,h,t,i,g,yV,k2),s.drawCachedElementPortion(r,e,d,t,i,g,bV,k2)),s.drawElementOverlay(r,e)}};ls.drawElements=function(r,e){for(var t=this,n=0;n<e.length;n++){var i=e[n];t.drawElement(r,i)}};ls.drawCachedElements=function(r,e,t,n){for(var i=this,a=0;a<e.length;a++){var s=e[a];i.drawCachedElement(r,s,t,n)}};ls.drawCachedNodes=function(r,e,t,n){for(var i=this,a=0;a<e.length;a++){var s=e[a];s.isNode()&&i.drawCachedElement(r,s,t,n)}};ls.drawLayeredElements=function(r,e,t,n){var i=this,a=i.data.lyrTxrCache.getLayers(e,t);if(a)for(var s=0;s<a.length;s++){var o=a[s],l=o.bb;l.w===0||l.h===0||r.drawImage(o.canvas,l.x1,l.y1,l.w,l.h)}else i.drawCachedElements(r,e,t,n)};var $s={};$s.drawEdge=function(r,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(a&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var l;t&&(l=t,r.translate(-l.x1,-l.y1));var c=a?e.pstyle("opacity").value:1,h=a?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,v=e.pstyle("line-style").value,g=e.pstyle("width").pfValue,m=e.pstyle("line-cap").value,x=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,_=c*h,w=c*h,S=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_;d==="straight-triangle"?(s.eleStrokeStyle(r,e,W),s.drawEdgeTrianglePath(e,r,o.allpts)):(r.lineWidth=g,r.lineCap=m,s.eleStrokeStyle(r,e,W),s.drawEdgePath(e,r,o.allpts,v),r.lineCap="butt")},A=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_;if(r.lineWidth=g+x,r.lineCap=m,x>0)s.colorStrokeStyle(r,y[0],y[1],y[2],W);else{r.lineCap="butt";return}d==="straight-triangle"?s.drawEdgeTrianglePath(e,r,o.allpts):(s.drawEdgePath(e,r,o.allpts,v),r.lineCap="butt")},C=function(){i&&s.drawEdgeOverlay(r,e)},M=function(){i&&s.drawEdgeUnderlay(r,e)},E=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w;s.drawArrowheads(r,e,W)},O=function(){s.drawElementText(r,e,null,n)};r.lineJoin="round";var D=e.pstyle("ghost").value==="yes";if(D){var I=e.pstyle("ghost-offset-x").pfValue,k=e.pstyle("ghost-offset-y").pfValue,U=e.pstyle("ghost-opacity").value,V=_*U;r.translate(I,k),S(V),E(V),r.translate(-I,-k)}else A();M(),S(),E(),C(),O(),t&&r.translate(l.x1,l.y1)}};var oO=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var i=n.pstyle("".concat(e,"-opacity")).value;if(i!==0){var a=this,s=a.usePaths(),o=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,c=2*l,h=n.pstyle("".concat(e,"-color")).value;t.lineWidth=c,o.edgeType==="self"&&!s?t.lineCap="butt":t.lineCap="round",a.colorStrokeStyle(t,h[0],h[1],h[2],i),a.drawEdgePath(n,t,o.allpts,"solid")}}}};$s.drawEdgeOverlay=oO("overlay");$s.drawEdgeUnderlay=oO("underlay");$s.drawEdgePath=function(r,e,t,n){var i=r._private.rscratch,a=e,s,o=!1,l=this.usePaths(),c=r.pstyle("line-dash-pattern").pfValue,h=r.pstyle("line-dash-offset").pfValue;if(l){var d=t.join("$"),v=i.pathCacheKey&&i.pathCacheKey===d;v?(s=e=i.pathCache,o=!0):(s=e=new Path2D,i.pathCacheKey=d,i.pathCache=s)}if(a.setLineDash)switch(n){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(c),a.lineDashOffset=h;break;case"solid":a.setLineDash([]);break}if(!o&&!i.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(t[0],t[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var g=2;g+3<t.length;g+=4)e.quadraticCurveTo(t[g],t[g+1],t[g+2],t[g+3]);break;case"straight":case"haystack":for(var m=2;m+1<t.length;m+=2)e.lineTo(t[m],t[m+1]);break;case"segments":if(i.isRound){var x=Ri(i.roundCorners),y;try{for(x.s();!(y=x.n()).done;){var _=y.value;$R(e,_)}}catch(S){x.e(S)}finally{x.f()}e.lineTo(t[t.length-2],t[t.length-1])}else for(var w=2;w+1<t.length;w+=2)e.lineTo(t[w],t[w+1]);break}e=a,l?e.stroke(s):e.stroke(),e.setLineDash&&e.setLineDash([])};$s.drawEdgeTrianglePath=function(r,e,t){e.fillStyle=e.strokeStyle;for(var n=r.pstyle("width").pfValue,i=0;i+1<t.length;i+=2){var a=[t[i+2]-t[i],t[i+3]-t[i+1]],s=Math.sqrt(a[0]*a[0]+a[1]*a[1]),o=[a[1]/s,-a[0]/s],l=[o[0]*n/2,o[1]*n/2];e.beginPath(),e.moveTo(t[i]-l[0],t[i+1]-l[1]),e.lineTo(t[i]+l[0],t[i+1]+l[1]),e.lineTo(t[i+2],t[i+3]),e.closePath(),e.fill()}};$s.drawArrowheads=function(r,e,t){var n=e._private.rscratch,i=n.edgeType==="haystack";i||this.drawArrowhead(r,e,"source",n.arrowStartX,n.arrowStartY,n.srcArrowAngle,t),this.drawArrowhead(r,e,"mid-target",n.midX,n.midY,n.midtgtArrowAngle,t),this.drawArrowhead(r,e,"mid-source",n.midX,n.midY,n.midsrcArrowAngle,t),i||this.drawArrowhead(r,e,"target",n.arrowEndX,n.arrowEndY,n.tgtArrowAngle,t)};$s.drawArrowhead=function(r,e,t,n,i,a,s){if(!(isNaN(n)||n==null||isNaN(i)||i==null||isNaN(a)||a==null)){var o=this,l=e.pstyle(t+"-arrow-shape").value;if(l!=="none"){var c=e.pstyle(t+"-arrow-fill").value==="hollow"?"both":"filled",h=e.pstyle(t+"-arrow-fill").value,d=e.pstyle("width").pfValue,v=e.pstyle(t+"-arrow-width"),g=v.value==="match-line"?d:v.pfValue;v.units==="%"&&(g*=d);var m=e.pstyle("opacity").value;s===void 0&&(s=m);var x=r.globalCompositeOperation;(s!==1||h==="hollow")&&(r.globalCompositeOperation="destination-out",o.colorFillStyle(r,255,255,255,1),o.colorStrokeStyle(r,255,255,255,1),o.drawArrowShape(e,r,c,d,l,g,n,i,a),r.globalCompositeOperation=x);var y=e.pstyle(t+"-arrow-color").value;o.colorFillStyle(r,y[0],y[1],y[2],s),o.colorStrokeStyle(r,y[0],y[1],y[2],s),o.drawArrowShape(e,r,h,d,l,g,n,i,a)}}};$s.drawArrowShape=function(r,e,t,n,i,a,s,o,l){var c=this,h=this.usePaths()&&i!=="triangle-cross",d=!1,v,g=e,m={x:s,y:o},x=r.pstyle("arrow-scale").value,y=this.getArrowWidth(n,x),_=c.arrowShapes[i];if(h){var w=c.arrowPathCache=c.arrowPathCache||[],S=cu(i),A=w[S];A!=null?(v=e=A,d=!0):(v=e=new Path2D,w[S]=v)}d||(e.beginPath&&e.beginPath(),h?_.draw(e,1,0,{x:0,y:0},1):_.draw(e,y,l,m,n),e.closePath&&e.closePath()),e=g,h&&(e.translate(s,o),e.rotate(l),e.scale(y,y)),(t==="filled"||t==="both")&&(h?e.fill(v):e.fill()),(t==="hollow"||t==="both")&&(e.lineWidth=a/(h?y:1),e.lineJoin="miter",h?e.stroke(v):e.stroke()),h&&(e.scale(1/y,1/y),e.rotate(-l),e.translate(-s,-o))};var dw={};dw.safeDrawImage=function(r,e,t,n,i,a,s,o,l,c){if(!(i<=0||a<=0||l<=0||c<=0))try{r.drawImage(e,t,n,i,a,s,o,l,c)}catch(h){fr(h)}};dw.drawInscribedImage=function(r,e,t,n,i){var a=this,s=t.position(),o=s.x,l=s.y,c=t.cy().style(),h=c.getIndexedStyle.bind(c),d=h(t,"background-fit","value",n),v=h(t,"background-repeat","value",n),g=t.width(),m=t.height(),x=t.padding()*2,y=g+(h(t,"background-width-relative-to","value",n)==="inner"?0:x),_=m+(h(t,"background-height-relative-to","value",n)==="inner"?0:x),w=t._private.rscratch,S=h(t,"background-clip","value",n),A=S==="node",C=h(t,"background-image-opacity","value",n)*i,M=h(t,"background-image-smoothing","value",n),E=t.pstyle("corner-radius").value;E!=="auto"&&(E=t.pstyle("corner-radius").pfValue);var O=e.width||e.cachedW,D=e.height||e.cachedH;(O==null||D==null)&&(document.body.appendChild(e),O=e.cachedW=e.width||e.offsetWidth,D=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var I=O,k=D;if(h(t,"background-width","value",n)!=="auto"&&(h(t,"background-width","units",n)==="%"?I=h(t,"background-width","pfValue",n)*y:I=h(t,"background-width","pfValue",n)),h(t,"background-height","value",n)!=="auto"&&(h(t,"background-height","units",n)==="%"?k=h(t,"background-height","pfValue",n)*_:k=h(t,"background-height","pfValue",n)),!(I===0||k===0)){if(d==="contain"){var U=Math.min(y/I,_/k);I*=U,k*=U}else if(d==="cover"){var U=Math.max(y/I,_/k);I*=U,k*=U}var V=o-y/2,X=h(t,"background-position-x","units",n),W=h(t,"background-position-x","pfValue",n);X==="%"?V+=(y-I)*W:V+=W;var P=h(t,"background-offset-x","units",n),H=h(t,"background-offset-x","pfValue",n);P==="%"?V+=(y-I)*H:V+=H;var z=l-_/2,$=h(t,"background-position-y","units",n),B=h(t,"background-position-y","pfValue",n);$==="%"?z+=(_-k)*B:z+=B;var L=h(t,"background-offset-y","units",n),Y=h(t,"background-offset-y","pfValue",n);L==="%"?z+=(_-k)*Y:z+=Y,w.pathCache&&(V-=o,z-=l,o=0,l=0);var G=r.globalAlpha;r.globalAlpha=C;var re=a.getImgSmoothing(r),ie=!1;if(M==="no"&&re?(a.setImgSmoothing(r,!1),ie=!0):M==="yes"&&!re&&(a.setImgSmoothing(r,!0),ie=!0),v==="no-repeat")A&&(r.save(),w.pathCache?r.clip(w.pathCache):(a.nodeShapes[a.getNodeShape(t)].draw(r,o,l,y,_,E,w),r.clip())),a.safeDrawImage(r,e,0,0,O,D,V,z,I,k),A&&r.restore();else{var le=r.createPattern(e,v);r.fillStyle=le,a.nodeShapes[a.getNodeShape(t)].draw(r,o,l,y,_,E,w),r.translate(V,z),r.fill(),r.translate(-V,-z)}r.globalAlpha=G,ie&&a.setImgSmoothing(r,re)}};var _u={};_u.eleTextBiggerThanMin=function(r,e){if(!e){var t=r.cy().zoom(),n=this.getPixelRatio(),i=Math.ceil(Z_(t*n));e=Math.pow(2,i)}var a=r.pstyle("font-size").pfValue*e,s=r.pstyle("min-zoomed-font-size").pfValue;return!(a<s)};_u.drawElementText=function(r,e,t,n,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(n==null){if(a&&!s.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e);r.textAlign=l,r.textBaseline="bottom"}else{var c=e.element()._private.rscratch.badLine,h=e.pstyle("label"),d=e.pstyle("source-label"),v=e.pstyle("target-label");if(c||(!h||!h.value)&&(!d||!d.value)&&(!v||!v.value))return;r.textAlign="center",r.textBaseline="bottom"}var g=!t,m;t&&(m=t,r.translate(-m.x1,-m.y1)),i==null?(s.drawText(r,e,null,g,a),e.isEdge()&&(s.drawText(r,e,"source",g,a),s.drawText(r,e,"target",g,a))):s.drawText(r,e,i,g,a),t&&r.translate(m.x1,m.y1)};_u.getFontCache=function(r){var e;this.fontCaches=this.fontCaches||[];for(var t=0;t<this.fontCaches.length;t++)if(e=this.fontCaches[t],e.context===r)return e;return e={context:r},this.fontCaches.push(e),e};_u.setupTextStyle=function(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue+"px",a=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=t?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,c=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;r.font=n+" "+s+" "+i+" "+a,r.lineJoin="round",this.colorFillStyle(r,c[0],c[1],c[2],o),this.colorStrokeStyle(r,h[0],h[1],h[2],l)};function _V(r,e,t,n,i){var a=Math.min(n,i),s=a/2,o=e+n/2,l=t+i/2;r.beginPath(),r.arc(o,l,s,0,Math.PI*2),r.closePath()}function b7(r,e,t,n,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(a,n/2,i/2);r.beginPath(),r.moveTo(e+s,t),r.lineTo(e+n-s,t),r.quadraticCurveTo(e+n,t,e+n,t+s),r.lineTo(e+n,t+i-s),r.quadraticCurveTo(e+n,t+i,e+n-s,t+i),r.lineTo(e+s,t+i),r.quadraticCurveTo(e,t+i,e,t+i-s),r.lineTo(e,t+s),r.quadraticCurveTo(e,t,e+s,t),r.closePath()}_u.getTextAngle=function(r,e){var t,n=r._private,i=n.rscratch,a=e?e+"-":"",s=r.pstyle(a+"text-rotation");if(s.strValue==="autorotate"){var o=Ai(i,"labelAngle",e);t=r.isEdge()?o:0}else s.strValue==="none"?t=0:t=s.pfValue;return t};_u.drawText=function(r,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=e._private,s=a.rscratch,o=i?e.effectiveOpacity():1;if(!(i&&(o===0||e.pstyle("text-opacity").value===0))){t==="main"&&(t=null);var l=Ai(s,"labelX",t),c=Ai(s,"labelY",t),h,d,v=this.getLabelText(e,t);if(v!=null&&v!==""&&!isNaN(l)&&!isNaN(c)){this.setupTextStyle(r,e,i);var g=t?t+"-":"",m=Ai(s,"labelWidth",t),x=Ai(s,"labelHeight",t),y=e.pstyle(g+"text-margin-x").pfValue,_=e.pstyle(g+"text-margin-y").pfValue,w=e.isEdge(),S=e.pstyle("text-halign").value,A=e.pstyle("text-valign").value;w&&(S="center",A="center"),l+=y,c+=_;var C;switch(n?C=this.getTextAngle(e,t):C=0,C!==0&&(h=l,d=c,r.translate(h,d),r.rotate(C),l=0,c=0),A){case"top":break;case"center":c+=x/2;break;case"bottom":c+=x;break}var M=e.pstyle("text-background-opacity").value,E=e.pstyle("text-border-opacity").value,O=e.pstyle("text-border-width").pfValue,D=e.pstyle("text-background-padding").pfValue,I=e.pstyle("text-background-shape").strValue,k=I==="round-rectangle"||I==="roundrectangle",U=I==="circle",V=2;if(M>0||O>0&&E>0){var X=r.fillStyle,W=r.strokeStyle,P=r.lineWidth,H=e.pstyle("text-background-color").value,z=e.pstyle("text-border-color").value,$=e.pstyle("text-border-style").value,B=M>0,L=O>0&&E>0,Y=l-D;switch(S){case"left":Y-=m;break;case"center":Y-=m/2;break}var G=c-x-D,re=m+2*D,ie=x+2*D;if(B&&(r.fillStyle="rgba(".concat(H[0],",").concat(H[1],",").concat(H[2],",").concat(M*o,")")),L&&(r.strokeStyle="rgba(".concat(z[0],",").concat(z[1],",").concat(z[2],",").concat(E*o,")"),r.lineWidth=O,r.setLineDash))switch($){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"double":r.lineWidth=O/4,r.setLineDash([]);break;case"solid":default:r.setLineDash([]);break}if(k?(r.beginPath(),b7(r,Y,G,re,ie,V)):U?(r.beginPath(),_V(r,Y,G,re,ie)):(r.beginPath(),r.rect(Y,G,re,ie)),B&&r.fill(),L&&r.stroke(),L&&$==="double"){var le=O/2;r.beginPath(),k?b7(r,Y+le,G+le,re-2*le,ie-2*le,V):r.rect(Y+le,G+le,re-2*le,ie-2*le),r.stroke()}r.fillStyle=X,r.strokeStyle=W,r.lineWidth=P,r.setLineDash&&r.setLineDash([])}var ce=2*e.pstyle("text-outline-width").pfValue;if(ce>0&&(r.lineWidth=ce),e.pstyle("text-wrap").value==="wrap"){var _e=Ai(s,"labelWrapCachedLines",t),pe=Ai(s,"labelLineHeight",t),ae=m/2,oe=this.getLabelJustification(e);switch(oe==="auto"||(S==="left"?oe==="left"?l+=-m:oe==="center"&&(l+=-ae):S==="center"?oe==="left"?l+=-ae:oe==="right"&&(l+=ae):S==="right"&&(oe==="center"?l+=ae:oe==="right"&&(l+=m))),A){case"top":c-=(_e.length-1)*pe;break;case"center":case"bottom":c-=(_e.length-1)*pe;break}for(var de=0;de<_e.length;de++)ce>0&&r.strokeText(_e[de],l,c),r.fillText(_e[de],l,c),c+=pe}else ce>0&&r.strokeText(v,l,c),r.fillText(v,l,c);C!==0&&(r.rotate(-C),r.translate(-h,-d))}}};var vl={};vl.drawNode=function(r,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,l,c=e._private,h=c.rscratch,d=e.position();if(!(!ut(d.x)||!ut(d.y))&&!(a&&!e.visible())){var v=a?e.effectiveOpacity():1,g=s.usePaths(),m,x=!1,y=e.padding();o=e.width()+2*y,l=e.height()+2*y;var _;t&&(_=t,r.translate(-_.x1,-_.y1));for(var w=e.pstyle("background-image"),S=w.value,A=new Array(S.length),C=new Array(S.length),M=0,E=0;E<S.length;E++){var O=S[E],D=A[E]=O!=null&&O!=="none";if(D){var I=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",E);M++,C[E]=s.getCachedImage(O,I,function(){c.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var k=e.pstyle("background-blacken").value,U=e.pstyle("border-width").pfValue,V=e.pstyle("background-opacity").value*v,X=e.pstyle("border-color").value,W=e.pstyle("border-style").value,P=e.pstyle("border-join").value,H=e.pstyle("border-cap").value,z=e.pstyle("border-position").value,$=e.pstyle("border-dash-pattern").pfValue,B=e.pstyle("border-dash-offset").pfValue,L=e.pstyle("border-opacity").value*v,Y=e.pstyle("outline-width").pfValue,G=e.pstyle("outline-color").value,re=e.pstyle("outline-style").value,ie=e.pstyle("outline-opacity").value*v,le=e.pstyle("outline-offset").value,ce=e.pstyle("corner-radius").value;ce!=="auto"&&(ce=e.pstyle("corner-radius").pfValue);var _e=function(){var nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:V;s.eleFillStyle(r,e,nt)},pe=function(){var nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:L;s.colorStrokeStyle(r,X[0],X[1],X[2],nt)},ae=function(){var nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ie;s.colorStrokeStyle(r,G[0],G[1],G[2],nt)},oe=function(nt,De,Q,ne){var be=s.nodePathCache=s.nodePathCache||[],ee=X9(Q==="polygon"?Q+","+ne.join(","):Q,""+De,""+nt,""+ce),se=be[ee],Pe,Ae=!1;return se!=null?(Pe=se,Ae=!0,h.pathCache=Pe):(Pe=new Path2D,be[ee]=h.pathCache=Pe),{path:Pe,cacheHit:Ae}},de=e.pstyle("shape").strValue,ye=e.pstyle("shape-polygon-points").pfValue;if(g){r.translate(d.x,d.y);var Ee=oe(o,l,de,ye);m=Ee.path,x=Ee.cacheHit}var Re=function(){if(!x){var nt=d;g&&(nt={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(m||r,nt.x,nt.y,o,l,ce,h)}g?r.fill(m):r.fill()},Ne=function(){for(var nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v,De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,Q=c.backgrounding,ne=0,be=0;be<C.length;be++){var ee=e.cy().style().getIndexedStyle(e,"background-image-containment","value",be);if(De&&ee==="over"||!De&&ee==="inside"){ne++;continue}A[be]&&C[be].complete&&!C[be].error&&(ne++,s.drawInscribedImage(r,C[be],e,be,nt))}c.backgrounding=ne!==M,Q!==c.backgrounding&&e.updateStyle(!1)},Be=function(){var nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:v;s.hasPie(e)&&(s.drawPie(r,e,De),nt&&(g||s.nodeShapes[s.getNodeShape(e)].draw(r,d.x,d.y,o,l,ce,h)))},$e=function(){var nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:v;s.hasStripe(e)&&(r.save(),g?r.clip(h.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(r,d.x,d.y,o,l,ce,h),r.clip()),s.drawStripe(r,e,De),r.restore(),nt&&(g||s.nodeShapes[s.getNodeShape(e)].draw(r,d.x,d.y,o,l,ce,h)))},Ye=function(){var nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v,De=(k>0?k:-k)*nt,Q=k>0?0:255;k!==0&&(s.colorFillStyle(r,Q,Q,Q,De),g?r.fill(m):r.fill())},He=function(){if(U>0){if(r.lineWidth=U,r.lineCap=H,r.lineJoin=P,r.setLineDash)switch(W){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash($),r.lineDashOffset=B;break;case"solid":case"double":r.setLineDash([]);break}if(z!=="center"){if(r.save(),r.lineWidth*=2,z==="inside")g?r.clip(m):r.clip();else{var nt=new Path2D;nt.rect(-o/2-U,-l/2-U,o+2*U,l+2*U),nt.addPath(m),r.clip(nt,"evenodd")}g?r.stroke(m):r.stroke(),r.restore()}else g?r.stroke(m):r.stroke();if(W==="double"){r.lineWidth=U/3;var De=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",g?r.stroke(m):r.stroke(),r.globalCompositeOperation=De}r.setLineDash&&r.setLineDash([])}},tt=function(){if(Y>0){if(r.lineWidth=Y,r.lineCap="butt",r.setLineDash)switch(re){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"solid":case"double":r.setLineDash([]);break}var nt=d;g&&(nt={x:0,y:0});var De=s.getNodeShape(e),Q=U;z==="inside"&&(Q=0),z==="outside"&&(Q*=2);var ne=(o+Q+(Y+le))/o,be=(l+Q+(Y+le))/l,ee=o*ne,se=l*be,Pe=s.nodeShapes[De].points,Ae;if(g){var Ge=oe(ee,se,De,Pe);Ae=Ge.path}if(De==="ellipse")s.drawEllipsePath(Ae||r,nt.x,nt.y,ee,se);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(De)){var J=0,Oe=0,Ve=0;De==="round-diamond"?J=(Q+le+Y)*1.4:De==="round-heptagon"?(J=(Q+le+Y)*1.075,Ve=-(Q/2+le+Y)/35):De==="round-hexagon"?J=(Q+le+Y)*1.12:De==="round-pentagon"?(J=(Q+le+Y)*1.13,Ve=-(Q/2+le+Y)/15):De==="round-tag"?(J=(Q+le+Y)*1.12,Oe=(Q/2+Y+le)*.07):De==="round-triangle"&&(J=(Q+le+Y)*(Math.PI/2),Ve=-(Q+le/2+Y)/Math.PI),J!==0&&(ne=(o+J)/o,ee=o*ne,["round-hexagon","round-tag"].includes(De)||(be=(l+J)/l,se=l*be)),ce=ce==="auto"?rR(ee,se):ce;for(var Ue=ee/2,je=se/2,yt=ce+(Q+Y+le)/2,vt=new Array(Pe.length/2),Ot=new Array(Pe.length/2),jt=0;jt<Pe.length/2;jt++)vt[jt]={x:nt.x+Oe+Ue*Pe[jt*2],y:nt.y+Ve+je*Pe[jt*2+1]};var Nr,Vt,Qt,rr,ur=vt.length;for(Vt=vt[ur-1],Nr=0;Nr<ur;Nr++)Qt=vt[Nr%ur],rr=vt[(Nr+1)%ur],Ot[Nr]=hw(Vt,Qt,rr,yt),Vt=Qt,Qt=rr;s.drawRoundPolygonPath(Ae||r,nt.x+Oe,nt.y+Ve,o*ne,l*be,Pe,Ot)}else if(["roundrectangle","round-rectangle"].includes(De))ce=ce==="auto"?Zo(ee,se):ce,s.drawRoundRectanglePath(Ae||r,nt.x,nt.y,ee,se,ce+(Q+Y+le)/2);else if(["cutrectangle","cut-rectangle"].includes(De))ce=ce==="auto"?ew():ce,s.drawCutRectanglePath(Ae||r,nt.x,nt.y,ee,se,null,ce+(Q+Y+le)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(De))ce=ce==="auto"?Zo(ee,se):ce,s.drawBottomRoundRectanglePath(Ae||r,nt.x,nt.y,ee,se,ce+(Q+Y+le)/2);else if(De==="barrel")s.drawBarrelPath(Ae||r,nt.x,nt.y,ee,se);else if(De.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(De)){var In=(Q+Y+le)/o;Pe=Rp(Op(Pe,In)),s.drawPolygonPath(Ae||r,nt.x,nt.y,o,l,Pe)}else{var vr=(Q+Y+le)/o;Pe=Rp(Op(Pe,-vr)),s.drawPolygonPath(Ae||r,nt.x,nt.y,o,l,Pe)}if(g?r.stroke(Ae):r.stroke(),re==="double"){r.lineWidth=Q/3;var Gn=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",g?r.stroke(Ae):r.stroke(),r.globalCompositeOperation=Gn}r.setLineDash&&r.setLineDash([])}},ot=function(){i&&s.drawNodeOverlay(r,e,d,o,l)},ct=function(){i&&s.drawNodeUnderlay(r,e,d,o,l)},Ze=function(){s.drawElementText(r,e,null,n)},bt=e.pstyle("ghost").value==="yes";if(bt){var Se=e.pstyle("ghost-offset-x").pfValue,ke=e.pstyle("ghost-offset-y").pfValue,We=e.pstyle("ghost-opacity").value,Ke=We*v;r.translate(Se,ke),ae(),tt(),_e(We*V),Re(),Ne(Ke,!0),pe(We*L),He(),Be(k!==0||U!==0),$e(k!==0||U!==0),Ne(Ke,!1),Ye(Ke),r.translate(-Se,-ke)}g&&r.translate(-d.x,-d.y),ct(),g&&r.translate(d.x,d.y),ae(),tt(),_e(),Re(),Ne(v,!0),pe(),He(),Be(k!==0||U!==0),$e(k!==0||U!==0),Ne(v,!1),Ye(),g&&r.translate(-d.x,-d.y),Ze(),ot(),t&&r.translate(_.x1,_.y1)}};var lO=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n,i,a,s){var o=this;if(n.visible()){var l=n.pstyle("".concat(e,"-padding")).pfValue,c=n.pstyle("".concat(e,"-opacity")).value,h=n.pstyle("".concat(e,"-color")).value,d=n.pstyle("".concat(e,"-shape")).value,v=n.pstyle("".concat(e,"-corner-radius")).value;if(c>0){if(i=i||n.position(),a==null||s==null){var g=n.padding();a=n.width()+2*g,s=n.height()+2*g}o.colorFillStyle(t,h[0],h[1],h[2],c),o.nodeShapes[d].draw(t,i.x,i.y,a+l*2,s+l*2,v),t.fill()}}}};vl.drawNodeOverlay=lO("overlay");vl.drawNodeUnderlay=lO("underlay");vl.hasPie=function(r){return r=r[0],r._private.hasPie};vl.hasStripe=function(r){return r=r[0],r._private.hasStripe};vl.drawPie=function(r,e,t,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,l=n.x,c=n.y,h=e.width(),d=e.height(),v=Math.min(h,d)/2,g,m=0,x=this.usePaths();if(x&&(l=0,c=0),a.units==="%"?v=v*a.pfValue:a.pfValue!==void 0&&(v=a.pfValue/2),s.units==="%"?g=v*s.pfValue:s.pfValue!==void 0&&(g=s.pfValue/2),!(g>=v))for(var y=1;y<=i.pieBackgroundN;y++){var _=e.pstyle("pie-"+y+"-background-size").value,w=e.pstyle("pie-"+y+"-background-color").value,S=e.pstyle("pie-"+y+"-background-opacity").value*t,A=_/100;A+m>1&&(A=1-m);var C=1.5*Math.PI+2*Math.PI*m;C+=o;var M=2*Math.PI*A,E=C+M;_===0||m>=1||m+A>1||(g===0?(r.beginPath(),r.moveTo(l,c),r.arc(l,c,v,C,E),r.closePath()):(r.beginPath(),r.arc(l,c,v,C,E),r.arc(l,c,g,E,C,!0),r.closePath()),this.colorFillStyle(r,w[0],w[1],w[2],S),r.fill(),m+=A)}};vl.drawStripe=function(r,e,t,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=n.x,s=n.y,o=e.width(),l=e.height(),c=0,h=this.usePaths();r.save();var d=e.pstyle("stripe-direction").value,v=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":r.rotate(-Math.PI/2);break}var g=o,m=l;v.units==="%"?(g=g*v.pfValue,m=m*v.pfValue):v.pfValue!==void 0&&(g=v.pfValue,m=v.pfValue),h&&(a=0,s=0),s-=g/2,a-=m/2;for(var x=1;x<=i.stripeBackgroundN;x++){var y=e.pstyle("stripe-"+x+"-background-size").value,_=e.pstyle("stripe-"+x+"-background-color").value,w=e.pstyle("stripe-"+x+"-background-opacity").value*t,S=y/100;S+c>1&&(S=1-c),!(y===0||c>=1||c+S>1)&&(r.beginPath(),r.rect(a,s+m*c,g,m*S),r.closePath(),this.colorFillStyle(r,_[0],_[1],_[2],w),r.fill(),c+=S)}r.restore()};var vi={},wV=100;vi.getPixelRatio=function(){var r=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),t=r.backingStorePixelRatio||r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/t};vi.paintCache=function(r){for(var e=this.paintCaches=this.paintCaches||[],t=!0,n,i=0;i<e.length;i++)if(n=e[i],n.context===r){t=!1;break}return t&&(n={context:r},e.push(n)),n};vi.createGradientStyleFor=function(r,e,t,n,i){var a,s=this.usePaths(),o=t.pstyle(e+"-gradient-stop-colors").value,l=t.pstyle(e+"-gradient-stop-positions").pfValue;if(n==="radial-gradient")if(t.isEdge()){var c=t.sourceEndpoint(),h=t.targetEndpoint(),d=t.midpoint(),v=hu(c,d),g=hu(h,d);a=r.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(v,g))}else{var m=s?{x:0,y:0}:t.position(),x=t.paddedWidth(),y=t.paddedHeight();a=r.createRadialGradient(m.x,m.y,0,m.x,m.y,Math.max(x,y))}else if(t.isEdge()){var _=t.sourceEndpoint(),w=t.targetEndpoint();a=r.createLinearGradient(_.x,_.y,w.x,w.y)}else{var S=s?{x:0,y:0}:t.position(),A=t.paddedWidth(),C=t.paddedHeight(),M=A/2,E=C/2,O=t.pstyle("background-gradient-direction").value;switch(O){case"to-bottom":a=r.createLinearGradient(S.x,S.y-E,S.x,S.y+E);break;case"to-top":a=r.createLinearGradient(S.x,S.y+E,S.x,S.y-E);break;case"to-left":a=r.createLinearGradient(S.x+M,S.y,S.x-M,S.y);break;case"to-right":a=r.createLinearGradient(S.x-M,S.y,S.x+M,S.y);break;case"to-bottom-right":case"to-right-bottom":a=r.createLinearGradient(S.x-M,S.y-E,S.x+M,S.y+E);break;case"to-top-right":case"to-right-top":a=r.createLinearGradient(S.x-M,S.y+E,S.x+M,S.y-E);break;case"to-bottom-left":case"to-left-bottom":a=r.createLinearGradient(S.x+M,S.y-E,S.x-M,S.y+E);break;case"to-top-left":case"to-left-top":a=r.createLinearGradient(S.x+M,S.y+E,S.x-M,S.y-E);break}}if(!a)return null;for(var D=l.length===o.length,I=o.length,k=0;k<I;k++)a.addColorStop(D?l[k]:k/(I-1),"rgba("+o[k][0]+","+o[k][1]+","+o[k][2]+","+i+")");return a};vi.gradientFillStyle=function(r,e,t,n){var i=this.createGradientStyleFor(r,"background",e,t,n);if(!i)return null;r.fillStyle=i};vi.colorFillStyle=function(r,e,t,n,i){r.fillStyle="rgba("+e+","+t+","+n+","+i+")"};vi.eleFillStyle=function(r,e,t){var n=e.pstyle("background-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientFillStyle(r,e,n,t);else{var i=e.pstyle("background-color").value;this.colorFillStyle(r,i[0],i[1],i[2],t)}};vi.gradientStrokeStyle=function(r,e,t,n){var i=this.createGradientStyleFor(r,"line",e,t,n);if(!i)return null;r.strokeStyle=i};vi.colorStrokeStyle=function(r,e,t,n,i){r.strokeStyle="rgba("+e+","+t+","+n+","+i+")"};vi.eleStrokeStyle=function(r,e,t){var n=e.pstyle("line-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientStrokeStyle(r,e,n,t);else{var i=e.pstyle("line-color").value;this.colorStrokeStyle(r,i[0],i[1],i[2],t)}};vi.matchCanvasSize=function(r){var e=this,t=e.data,n=e.findContainerClientCoords(),i=n[2],a=n[3],s=e.getPixelRatio(),o=e.motionBlurPxRatio;(r===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||r===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(s=o);var l=i*s,c=a*s,h;if(!(l===e.canvasWidth&&c===e.canvasHeight)){e.fontCaches=null;var d=t.canvasContainer;d.style.width=i+"px",d.style.height=a+"px";for(var v=0;v<e.CANVAS_LAYERS;v++)h=t.canvases[v],h.width=l,h.height=c,h.style.width=i+"px",h.style.height=a+"px";for(var v=0;v<e.BUFFER_COUNT;v++)h=t.bufferCanvases[v],h.width=l,h.height=c,h.style.width=i+"px",h.style.height=a+"px";e.textureMult=1,s<=1&&(h=t.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,h.width=l*e.textureMult,h.height=c*e.textureMult),e.canvasWidth=l,e.canvasHeight=c,e.pixelRatio=s}};vi.renderTo=function(r,e,t,n){this.render({forcedContext:r,forcedZoom:e,forcedPan:t,drawAllLayers:!0,forcedPxRatio:n})};vi.clearCanvas=function(){var r=this,e=r.data;function t(n){n.clearRect(0,0,r.canvasWidth,r.canvasHeight)}t(e.contexts[r.NODE]),t(e.contexts[r.DRAG])};vi.render=function(r){var e=this;r=r||K9();var t=e.cy,n=r.forcedContext,i=r.drawAllLayers,a=r.drawOnlyNodeLayer,s=r.forcedZoom,o=r.forcedPan,l=r.forcedPxRatio===void 0?this.getPixelRatio():r.forcedPxRatio,c=e.data,h=c.canvasNeedsRedraw,d=e.textureOnViewport&&!n&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),v=r.motionBlur!==void 0?r.motionBlur:e.motionBlur,g=e.motionBlurPxRatio,m=t.hasCompoundNodes(),x=e.hoverData.draggingEles,y=!!(e.hoverData.selecting||e.touchData.selecting);v=v&&!n&&e.motionBlurEnabled&&!y;var _=v;n||(e.prevPxRatio!==l&&(e.invalidateContainerClientCoordsCache(),e.matchCanvasSize(e.container),e.redrawHint("eles",!0),e.redrawHint("drag",!0)),e.prevPxRatio=l),!n&&e.motionBlurTimeout&&clearTimeout(e.motionBlurTimeout),v&&(e.mbFrames==null&&(e.mbFrames=0),e.mbFrames++,e.mbFrames<3&&(_=!1),e.mbFrames>e.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(h[e.NODE]=!0,h[e.SELECT_BOX]=!0);var w=t.style(),S=t.zoom(),A=s!==void 0?s:S,C=t.pan(),M={x:C.x,y:C.y},E={zoom:S,pan:{x:C.x,y:C.y}},O=e.prevViewport,D=O===void 0||E.zoom!==O.zoom||E.pan.x!==O.pan.x||E.pan.y!==O.pan.y;!D&&!(x&&!m)&&(e.motionBlurPxRatio=1),o&&(M=o),A*=l,M.x*=l,M.y*=l;var I=e.getCachedZSortedEles();function k(pe,ae,oe,de,ye){var Ee=pe.globalCompositeOperation;pe.globalCompositeOperation="destination-out",e.colorFillStyle(pe,255,255,255,e.motionBlurTransparency),pe.fillRect(ae,oe,de,ye),pe.globalCompositeOperation=Ee}function U(pe,ae){var oe,de,ye,Ee;!e.clearingMotionBlur&&(pe===c.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||pe===c.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(oe={x:C.x*g,y:C.y*g},de=S*g,ye=e.canvasWidth*g,Ee=e.canvasHeight*g):(oe=M,de=A,ye=e.canvasWidth,Ee=e.canvasHeight),pe.setTransform(1,0,0,1,0,0),ae==="motionBlur"?k(pe,0,0,ye,Ee):!n&&(ae===void 0||ae)&&pe.clearRect(0,0,ye,Ee),i||(pe.translate(oe.x,oe.y),pe.scale(de,de)),o&&pe.translate(o.x,o.y),s&&pe.scale(s,s)}if(d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=t.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var V=e.data.bufferContexts[e.TEXTURE_BUFFER];V.setTransform(1,0,0,1,0,0),V.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:V,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var E=e.textureCache.viewport={zoom:t.zoom(),pan:t.pan(),width:e.canvasWidth,height:e.canvasHeight};E.mpan={x:(0-E.pan.x)/E.zoom,y:(0-E.pan.y)/E.zoom}}h[e.DRAG]=!1,h[e.NODE]=!1;var X=c.contexts[e.NODE],W=e.textureCache.texture,E=e.textureCache.viewport;X.setTransform(1,0,0,1,0,0),v?k(X,0,0,E.width,E.height):X.clearRect(0,0,E.width,E.height);var P=w.core("outside-texture-bg-color").value,H=w.core("outside-texture-bg-opacity").value;e.colorFillStyle(X,P[0],P[1],P[2],H),X.fillRect(0,0,E.width,E.height);var S=t.zoom();U(X,!1),X.clearRect(E.mpan.x,E.mpan.y,E.width/E.zoom/l,E.height/E.zoom/l),X.drawImage(W,E.mpan.x,E.mpan.y,E.width/E.zoom/l,E.height/E.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var z=t.extent(),$=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),B=e.hideEdgesOnViewport&&$,L=[];if(L[e.NODE]=!h[e.NODE]&&v&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,L[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),L[e.DRAG]=!h[e.DRAG]&&v&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,L[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||i||a||L[e.NODE]){var Y=v&&!L[e.NODE]&&g!==1,X=n||(Y?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:c.contexts[e.NODE]),G=v&&!Y?"motionBlur":void 0;U(X,G),B?e.drawCachedNodes(X,I.nondrag,l,z):e.drawLayeredElements(X,I.nondrag,l,z),e.debug&&e.drawDebugPoints(X,I.nondrag),!i&&!v&&(h[e.NODE]=!1)}if(!a&&(h[e.DRAG]||i||L[e.DRAG])){var Y=v&&!L[e.DRAG]&&g!==1,X=n||(Y?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:c.contexts[e.DRAG]);U(X,v&&!Y?"motionBlur":void 0),B?e.drawCachedNodes(X,I.drag,l,z):e.drawCachedElements(X,I.drag,l,z),e.debug&&e.drawDebugPoints(X,I.drag),!i&&!v&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(r,U),v&&g!==1){var re=c.contexts[e.NODE],ie=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],le=c.contexts[e.DRAG],ce=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],_e=function(ae,oe,de){ae.setTransform(1,0,0,1,0,0),de||!_?ae.clearRect(0,0,e.canvasWidth,e.canvasHeight):k(ae,0,0,e.canvasWidth,e.canvasHeight);var ye=g;ae.drawImage(oe,0,0,e.canvasWidth*ye,e.canvasHeight*ye,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||L[e.NODE])&&(_e(re,ie,L[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||L[e.DRAG])&&(_e(le,ce,L[e.DRAG]),h[e.DRAG]=!1)}e.prevViewport=E,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),v&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,h[e.NODE]=!0,h[e.DRAG]=!0,e.redraw()},wV)),n||t.emit("render")};var cf;vi.drawSelectionRectangle=function(r,e){var t=this,n=t.cy,i=t.data,a=n.style(),s=r.drawOnlyNodeLayer,o=r.drawAllLayers,l=i.canvasNeedsRedraw,c=r.forcedContext;if(t.showFps||!s&&l[t.SELECT_BOX]&&!o){var h=c||i.contexts[t.SELECT_BOX];if(e(h),t.selection[4]==1&&(t.hoverData.selecting||t.touchData.selecting)){var d=t.cy.zoom(),v=a.core("selection-box-border-width").value/d;h.lineWidth=v,h.fillStyle="rgba("+a.core("selection-box-color").value[0]+","+a.core("selection-box-color").value[1]+","+a.core("selection-box-color").value[2]+","+a.core("selection-box-opacity").value+")",h.fillRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]),v>0&&(h.strokeStyle="rgba("+a.core("selection-box-border-color").value[0]+","+a.core("selection-box-border-color").value[1]+","+a.core("selection-box-border-color").value[2]+","+a.core("selection-box-opacity").value+")",h.strokeRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]))}if(i.bgActivePosistion&&!t.hoverData.selecting){var d=t.cy.zoom(),g=i.bgActivePosistion;h.fillStyle="rgba("+a.core("active-bg-color").value[0]+","+a.core("active-bg-color").value[1]+","+a.core("active-bg-color").value[2]+","+a.core("active-bg-opacity").value+")",h.beginPath(),h.arc(g.x,g.y,a.core("active-bg-size").pfValue/d,0,2*Math.PI),h.fill()}var m=t.lastRedrawTime;if(t.showFps&&m){m=Math.round(m);var x=Math.round(1e3/m),y="1 frame = "+m+" ms = "+x+" fps";if(h.setTransform(1,0,0,1,0,0),h.fillStyle="rgba(255, 0, 0, 0.75)",h.strokeStyle="rgba(255, 0, 0, 0.75)",h.font="30px Arial",!cf){var _=h.measureText(y);cf=_.actualBoundingBoxAscent}h.fillText(y,0,cf);var w=60;h.strokeRect(0,cf+10,250,20),h.fillRect(0,cf+10,250*Math.min(x/w,1),20)}o||(l[t.SELECT_BOX]=!1)}};function x7(r,e,t){var n=r.createShader(e);if(r.shaderSource(n,t),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw new Error(r.getShaderInfoLog(n));return n}function SV(r,e,t){var n=x7(r,r.VERTEX_SHADER,e),i=x7(r,r.FRAGMENT_SHADER,t),a=r.createProgram();if(r.attachShader(a,n),r.attachShader(a,i),r.linkProgram(a),!r.getProgramParameter(a,r.LINK_STATUS))throw new Error("Could not initialize shaders");return a}function EV(r,e,t){t===void 0&&(t=e);var n=r.makeOffscreenCanvas(e,t),i=n.context=n.getContext("2d");return n.clear=function(){return i.clearRect(0,0,n.width,n.height)},n.clear(),n}function vw(r){var e=r.pixelRatio,t=r.cy.zoom(),n=r.cy.pan();return{zoom:t*e,pan:{x:n.x*e,y:n.y*e}}}function TV(r){var e=r.pixelRatio,t=r.cy.zoom();return t*e}function CV(r,e,t,n,i){var a=n*t+e.x,s=i*t+e.y;return s=Math.round(r.canvasHeight-s),[a,s]}function AV(r,e){return e.picking?!0:r.pstyle("background-fill").value!=="solid"||r.pstyle("background-image").strValue!=="none"?!1:r.pstyle("border-width").value===0||r.pstyle("border-opacity").value===0?!0:r.pstyle("border-style").value==="solid"}function MV(r,e){if(r.length!==e.length)return!1;for(var t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}function Bl(r,e,t){var n=r[0]/255,i=r[1]/255,a=r[2]/255,s=e,o=t||new Array(4);return o[0]=n*s,o[1]=i*s,o[2]=a*s,o[3]=s,o}function hc(r,e){var t=e||new Array(4);return t[0]=(r>>0&255)/255,t[1]=(r>>8&255)/255,t[2]=(r>>16&255)/255,t[3]=(r>>24&255)/255,t}function RV(r){return r[0]+(r[1]<<8)+(r[2]<<16)+(r[3]<<24)}function OV(r,e){var t=r.createTexture();return t.buffer=function(n){r.bindTexture(r.TEXTURE_2D,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR_MIPMAP_NEAREST),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,n),r.generateMipmap(r.TEXTURE_2D),r.bindTexture(r.TEXTURE_2D,null)},t.deleteTexture=function(){r.deleteTexture(t)},t}function uO(r,e){switch(e){case"float":return[1,r.FLOAT,4];case"vec2":return[2,r.FLOAT,4];case"vec3":return[3,r.FLOAT,4];case"vec4":return[4,r.FLOAT,4];case"int":return[1,r.INT,4];case"ivec2":return[2,r.INT,4]}}function cO(r,e,t){switch(e){case r.FLOAT:return new Float32Array(t);case r.INT:return new Int32Array(t)}}function DV(r,e,t,n,i,a){switch(e){case r.FLOAT:return new Float32Array(t.buffer,a*n,i);case r.INT:return new Int32Array(t.buffer,a*n,i)}}function PV(r,e,t,n){var i=uO(r,e),a=_n(i,2),s=a[0],o=a[1],l=cO(r,o,n),c=r.createBuffer();return r.bindBuffer(r.ARRAY_BUFFER,c),r.bufferData(r.ARRAY_BUFFER,l,r.STATIC_DRAW),o===r.FLOAT?r.vertexAttribPointer(t,s,o,!1,0,0):o===r.INT&&r.vertexAttribIPointer(t,s,o,0,0),r.enableVertexAttribArray(t),r.bindBuffer(r.ARRAY_BUFFER,null),c}function ja(r,e,t,n){var i=uO(r,t),a=_n(i,3),s=a[0],o=a[1],l=a[2],c=cO(r,o,e*s),h=s*l,d=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,d),r.bufferData(r.ARRAY_BUFFER,e*h,r.DYNAMIC_DRAW),r.enableVertexAttribArray(n),o===r.FLOAT?r.vertexAttribPointer(n,s,o,!1,h,0):o===r.INT&&r.vertexAttribIPointer(n,s,o,h,0),r.vertexAttribDivisor(n,1),r.bindBuffer(r.ARRAY_BUFFER,null);for(var v=new Array(e),g=0;g<e;g++)v[g]=DV(r,o,c,h,s,g);return d.dataArray=c,d.stride=h,d.size=s,d.getView=function(m){return v[m]},d.setPoint=function(m,x,y){var _=v[m];_[0]=x,_[1]=y},d.bufferSubData=function(m){r.bindBuffer(r.ARRAY_BUFFER,d),m?r.bufferSubData(r.ARRAY_BUFFER,0,c,0,m*s):r.bufferSubData(r.ARRAY_BUFFER,0,c)},d}function IV(r,e,t){for(var n=9,i=new Float32Array(e*n),a=new Array(e),s=0;s<e;s++){var o=s*n*4;a[s]=new Float32Array(i.buffer,o,n)}var l=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,l),r.bufferData(r.ARRAY_BUFFER,i.byteLength,r.DYNAMIC_DRAW);for(var c=0;c<3;c++){var h=t+c;r.enableVertexAttribArray(h),r.vertexAttribPointer(h,3,r.FLOAT,!1,36,c*12),r.vertexAttribDivisor(h,1)}return r.bindBuffer(r.ARRAY_BUFFER,null),l.getMatrixView=function(d){return a[d]},l.setData=function(d,v){a[v].set(d,0)},l.bufferSubData=function(){r.bindBuffer(r.ARRAY_BUFFER,l),r.bufferSubData(r.ARRAY_BUFFER,0,i)},l}function NV(r){var e=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,e);var t=r.createTexture();return r.bindTexture(r.TEXTURE_2D,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,t,0),r.bindFramebuffer(r.FRAMEBUFFER,null),e.setFramebufferAttachmentSizes=function(n,i){r.bindTexture(r.TEXTURE_2D,t),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,n,i,0,r.RGBA,r.UNSIGNED_BYTE,null)},e}var _7=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var r=0,e=arguments.length;e--;)r+=arguments[e]*arguments[e];return Math.sqrt(r)});function B2(){var r=new _7(9);return _7!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function w7(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function LV(r,e,t){var n=e[0],i=e[1],a=e[2],s=e[3],o=e[4],l=e[5],c=e[6],h=e[7],d=e[8],v=t[0],g=t[1],m=t[2],x=t[3],y=t[4],_=t[5],w=t[6],S=t[7],A=t[8];return r[0]=v*n+g*s+m*c,r[1]=v*i+g*o+m*h,r[2]=v*a+g*l+m*d,r[3]=x*n+y*s+_*c,r[4]=x*i+y*o+_*h,r[5]=x*a+y*l+_*d,r[6]=w*n+S*s+A*c,r[7]=w*i+S*o+A*h,r[8]=w*a+S*l+A*d,r}function cp(r,e,t){var n=e[0],i=e[1],a=e[2],s=e[3],o=e[4],l=e[5],c=e[6],h=e[7],d=e[8],v=t[0],g=t[1];return r[0]=n,r[1]=i,r[2]=a,r[3]=s,r[4]=o,r[5]=l,r[6]=v*n+g*s+c,r[7]=v*i+g*o+h,r[8]=v*a+g*l+d,r}function S7(r,e,t){var n=e[0],i=e[1],a=e[2],s=e[3],o=e[4],l=e[5],c=e[6],h=e[7],d=e[8],v=Math.sin(t),g=Math.cos(t);return r[0]=g*n+v*s,r[1]=g*i+v*o,r[2]=g*a+v*l,r[3]=g*s-v*n,r[4]=g*o-v*i,r[5]=g*l-v*a,r[6]=c,r[7]=h,r[8]=d,r}function g4(r,e,t){var n=t[0],i=t[1];return r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=i*e[3],r[4]=i*e[4],r[5]=i*e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r}function kV(r,e,t){return r[0]=2/e,r[1]=0,r[2]=0,r[3]=0,r[4]=-2/t,r[5]=0,r[6]=-1,r[7]=1,r[8]=1,r}var BV=(function(){function r(e,t,n,i){hl(this,r),this.debugID=Math.floor(Math.random()*1e4),this.r=e,this.texSize=t,this.texRows=n,this.texHeight=Math.floor(t/n),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=i(e,t,t),this.scratch=i(e,t,this.texHeight,"scratch")}return fl(r,[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(t){var n=t.w,i=t.h,a=this.texHeight,s=this.texSize,o=a/i,l=n*o,c=i*o;return l>s&&(o=s/n,l=n*o,c=i*o),{scale:o,texW:l,texH:c}}},{key:"draw",value:function(t,n,i){var a=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,l=this.texHeight,c=this.getScale(n),h=c.scale,d=c.texW,v=c.texH,g=function(S,A){if(i&&A){var C=A.context,M=S.x,E=S.row,O=M,D=l*E;C.save(),C.translate(O,D),C.scale(h,h),i(C,n),C.restore()}},m=[null,null],x=function(){g(a.freePointer,a.canvas),m[0]={x:a.freePointer.x,y:a.freePointer.row*l,w:d,h:v},m[1]={x:a.freePointer.x+d,y:a.freePointer.row*l,w:0,h:v},a.freePointer.x+=d,a.freePointer.x==s&&(a.freePointer.x=0,a.freePointer.row++)},y=function(){var S=a.scratch,A=a.canvas;S.clear(),g({x:0,row:0},S);var C=s-a.freePointer.x,M=d-C,E=l;{var O=a.freePointer.x,D=a.freePointer.row*l,I=C;A.context.drawImage(S,0,0,I,E,O,D,I,E),m[0]={x:O,y:D,w:I,h:v}}{var k=C,U=(a.freePointer.row+1)*l,V=M;A&&A.context.drawImage(S,k,0,V,E,0,U,V,E),m[1]={x:0,y:U,w:V,h:v}}a.freePointer.x=M,a.freePointer.row++},_=function(){a.freePointer.x=0,a.freePointer.row++};if(this.freePointer.x+d<=s)x();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===s?(_(),x()):this.enableWrapping?y():(_(),x())}return this.keyToLocation.set(t,m),this.needsBuffer=!0,m}},{key:"getOffsets",value:function(t){return this.keyToLocation.get(t)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(t){if(this.locked)return!1;var n=this.texSize,i=this.texRows,a=this.getScale(t),s=a.texW;return this.freePointer.x+s>n?this.freePointer.row<i-1:!0}},{key:"bufferIfNeeded",value:function(t){this.texture||(this.texture=OV(t,this.debugID)),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked&&(this.canvas=null,this.scratch=null))}},{key:"dispose",value:function(){this.texture&&(this.texture.deleteTexture(),this.texture=null),this.canvas=null,this.scratch=null,this.locked=!0}}])})(),FV=(function(){function r(e,t,n,i){hl(this,r),this.r=e,this.texSize=t,this.texRows=n,this.createTextureCanvas=i,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return fl(r,[{key:"getKeys",value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function(){var t=this.r,n=this.texSize,i=this.texRows,a=this.createTextureCanvas;return new BV(t,n,i,a)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var t=this.r,n=this.texSize,i=this.texRows,a=this.createTextureCanvas,s=Math.floor(n/i);this.scratch=a(t,n,s,"scratch")}return this.scratch}},{key:"draw",value:function(t,n,i){var a=this.styleKeyToAtlas.get(t);return a||(a=this.atlases[this.atlases.length-1],(!a||!a.canFit(n))&&(a&&a.lock(),a=this._createAtlas(),this.atlases.push(a)),a.draw(t,n,i),this.styleKeyToAtlas.set(t,a)),a}},{key:"getAtlas",value:function(t){return this.styleKeyToAtlas.get(t)}},{key:"hasAtlas",value:function(t){return this.styleKeyToAtlas.has(t)}},{key:"markKeyForGC",value:function(t){this.markedKeys.add(t)}},{key:"gc",value:function(){var t=this,n=this.markedKeys;if(n.size===0){console.log("nothing to garbage collect");return}var i=[],a=new Map,s=null,o=Ri(this.atlases),l;try{var c=function(){var d=l.value,v=d.getKeys(),g=zV(n,v);if(g.size===0)return i.push(d),v.forEach(function(C){return a.set(C,d)}),1;s||(s=t._createAtlas(),i.push(s));var m=Ri(v),x;try{for(m.s();!(x=m.n()).done;){var y=x.value;if(!g.has(y)){var _=d.getOffsets(y),w=_n(_,2),S=w[0],A=w[1];s.canFit({w:S.w+A.w,h:S.h})||(s.lock(),s=t._createAtlas(),i.push(s)),d.canvas&&(t._copyTextureToNewAtlas(y,d,s),a.set(y,s))}}}catch(C){m.e(C)}finally{m.f()}d.dispose()};for(o.s();!(l=o.n()).done;)c()}catch(h){o.e(h)}finally{o.f()}this.atlases=i,this.styleKeyToAtlas=a,this.markedKeys=new Set}},{key:"_copyTextureToNewAtlas",value:function(t,n,i){var a=n.getOffsets(t),s=_n(a,2),o=s[0],l=s[1];if(l.w===0)i.draw(t,o,function(v){v.drawImage(n.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h)});else{var c=this._getScratchCanvas();c.clear(),c.context.drawImage(n.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h),c.context.drawImage(n.canvas,l.x,l.y,l.w,l.h,o.w,0,l.w,l.h);var h=o.w+l.w,d=o.h;i.draw(t,{w:h,h:d},function(v){v.drawImage(c,0,0,h,d,0,0,h,d)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])})();function zV(r,e){return r.intersection?r.intersection(e):new Set(Tp(r).filter(function(t){return e.has(t)}))}var UV=(function(){function r(e,t){hl(this,r),this.r=e,this.globalOptions=t,this.atlasSize=t.webglTexSize,this.maxAtlasesPerBatch=t.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map}return fl(r,[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(t,n){var i=this.globalOptions,a=i.webglTexSize,s=i.createTextureCanvas,o=n.texRows,l=this._cacheScratchCanvas(s),c=new FV(this.r,a,o,l);this.collections.set(t,c)}},{key:"addRenderType",value:function(t,n){var i=n.collection;if(!this.collections.has(i))throw new Error("invalid atlas collection name '".concat(i,"'"));var a=this.collections.get(i),s=Ct({type:t,atlasCollection:a},n);this.renderTypes.set(t,s)}},{key:"getRenderTypeOpts",value:function(t){return this.renderTypes.get(t)}},{key:"getAtlasCollection",value:function(t){return this.collections.get(t)}},{key:"_cacheScratchCanvas",value:function(t){var n=-1,i=-1,a=null;return function(s,o,l,c){return c?((!a||o!=n||l!=i)&&(n=o,i=l,a=t(s,o,l)),a):t(s,o,l)}}},{key:"_key",value:function(t,n){return"".concat(t,"-").concat(n)}},{key:"invalidate",value:function(t){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=i.forceRedraw,s=a===void 0?!1:a,o=i.filterEle,l=o===void 0?function(){return!0}:o,c=i.filterType,h=c===void 0?function(){return!0}:c,d=!1,v=!1,g=Ri(t),m;try{for(g.s();!(m=g.n()).done;){var x=m.value;if(l(x)){var y=Ri(this.renderTypes.values()),_;try{var w=function(){var A=_.value,C=A.type;if(h(C)){var M=n.collections.get(A.collection),E=A.getKey(x),O=Array.isArray(E)?E:[E];if(s)O.forEach(function(U){return M.markKeyForGC(U)}),v=!0;else{var D=A.getID?A.getID(x):x.id(),I=n._key(C,D),k=n.typeAndIdToKey.get(I);k!==void 0&&!MV(O,k)&&(d=!0,n.typeAndIdToKey.delete(I),k.forEach(function(U){return M.markKeyForGC(U)}))}}};for(y.s();!(_=y.n()).done;)w()}catch(S){y.e(S)}finally{y.f()}}}}catch(S){g.e(S)}finally{g.f()}return v&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var t=Ri(this.collections.values()),n;try{for(t.s();!(n=t.n()).done;){var i=n.value;i.gc()}}catch(a){t.e(a)}finally{t.f()}}},{key:"getOrCreateAtlas",value:function(t,n,i,a){var s=this.renderTypes.get(n),o=this.collections.get(s.collection),l=!1,c=o.draw(a,i,function(v){s.drawClipped?(v.save(),v.beginPath(),v.rect(0,0,i.w,i.h),v.clip(),s.drawElement(v,t,i,!0,!0),v.restore()):s.drawElement(v,t,i,!0,!0),l=!0});if(l){var h=s.getID?s.getID(t):t.id(),d=this._key(n,h);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(a):this.typeAndIdToKey.set(d,[a])}return c}},{key:"getAtlasInfo",value:function(t,n){var i=this,a=this.renderTypes.get(n),s=a.getKey(t),o=Array.isArray(s)?s:[s];return o.map(function(l){var c=a.getBoundingBox(t,l),h=i.getOrCreateAtlas(t,n,c,l),d=h.getOffsets(l),v=_n(d,2),g=v[0],m=v[1];return{atlas:h,tex:g,tex1:g,tex2:m,bb:c}})}},{key:"getDebugInfo",value:function(){var t=[],n=Ri(this.collections),i;try{for(n.s();!(i=n.n()).done;){var a=_n(i.value,2),s=a[0],o=a[1],l=o.getCounts(),c=l.keyCount,h=l.atlasCount;t.push({type:s,keyCount:c,atlasCount:h})}}catch(d){n.e(d)}finally{n.f()}return t}}])})(),GV=(function(){function r(e){hl(this,r),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return fl(r,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(t,n){return n})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(t){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(t):!0}},{key:"getAtlasIndexForBatch",value:function(t){var n=this.batchAtlases.indexOf(t);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(t),n=this.batchAtlases.length-1}return n}}])})(),HV=`
  92. float circleSD(vec2 p, float r) {
  93. return distance(vec2(0), p) - r; // signed distance
  94. }
  95. `,jV=`
  96. float rectangleSD(vec2 p, vec2 b) {
  97. vec2 d = abs(p)-b;
  98. return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);
  99. }
  100. `,VV=`
  101. float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {
  102. cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;
  103. cr.x = (p.y > 0.0) ? cr.x : cr.y;
  104. vec2 q = abs(p) - b + cr.x;
  105. return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;
  106. }
  107. `,qV=`
  108. float ellipseSD(vec2 p, vec2 ab) {
  109. p = abs( p ); // symmetry
  110. // find root with Newton solver
  111. vec2 q = ab*(p-ab);
  112. float w = (q.x<q.y)? 1.570796327 : 0.0;
  113. for( int i=0; i<5; i++ ) {
  114. vec2 cs = vec2(cos(w),sin(w));
  115. vec2 u = ab*vec2( cs.x,cs.y);
  116. vec2 v = ab*vec2(-cs.y,cs.x);
  117. w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v));
  118. }
  119. // compute final point and distance
  120. float d = length(p-ab*vec2(cos(w),sin(w)));
  121. // return signed distance
  122. return (dot(p/ab,p/ab)>1.0) ? d : -d;
  123. }
  124. `,zf={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},Bp={IGNORE:1,USE_BB:2},F2=0,E7=1,T7=2,z2=3,fc=4,vv=5,hf=6,ff=7,XV=(function(){function r(e,t,n){hl(this,r),this.r=e,this.gl=t,this.maxInstances=n.webglBatchSize,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,this.debug=n.webglDebug,this.batchDebugInfo=[],n.enableWrapping=!0,n.createTextureCanvas=EV,this.atlasManager=new UV(e,n),this.batchManager=new GV(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(zf.SCREEN),this.pickingProgram=this._createShaderProgram(zf.PICKING),this.vao=this._createVAO()}return fl(r,[{key:"addAtlasCollection",value:function(t,n){this.atlasManager.addAtlasCollection(t,n)}},{key:"addTextureAtlasRenderType",value:function(t,n){this.atlasManager.addRenderType(t,n)}},{key:"addSimpleShapeRenderType",value:function(t,n){this.simpleShapeOptions.set(t,n)}},{key:"invalidate",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.type,a=this.atlasManager;return i?a.invalidate(t,{filterType:function(o){return o===i},forceRedraw:!0}):a.invalidate(t)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(t){var n=this.gl,i=`#version 300 es
  125. precision highp float;
  126. uniform mat3 uPanZoomMatrix;
  127. uniform int uAtlasSize;
  128. // instanced
  129. in vec2 aPosition; // a vertex from the unit square
  130. in mat3 aTransform; // used to transform verticies, eg into a bounding box
  131. in int aVertType; // the type of thing we are rendering
  132. // the z-index that is output when using picking mode
  133. in vec4 aIndex;
  134. // For textures
  135. in int aAtlasId; // which shader unit/atlas to use
  136. in vec4 aTex; // x/y/w/h of texture in atlas
  137. // for edges
  138. in vec4 aPointAPointB;
  139. in vec4 aPointCPointD;
  140. in vec2 aLineWidth; // also used for node border width
  141. // simple shapes
  142. in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]
  143. in vec4 aColor; // also used for edges
  144. in vec4 aBorderColor; // aLineWidth is used for border width
  145. // output values passed to the fragment shader
  146. out vec2 vTexCoord;
  147. out vec4 vColor;
  148. out vec2 vPosition;
  149. // flat values are not interpolated
  150. flat out int vAtlasId;
  151. flat out int vVertType;
  152. flat out vec2 vTopRight;
  153. flat out vec2 vBotLeft;
  154. flat out vec4 vCornerRadius;
  155. flat out vec4 vBorderColor;
  156. flat out vec2 vBorderWidth;
  157. flat out vec4 vIndex;
  158. void main(void) {
  159. int vid = gl_VertexID;
  160. vec2 position = aPosition; // TODO make this a vec3, simplifies some code below
  161. if(aVertType == `.concat(F2,`) {
  162. float texX = aTex.x; // texture coordinates
  163. float texY = aTex.y;
  164. float texW = aTex.z;
  165. float texH = aTex.w;
  166. if(vid == 1 || vid == 2 || vid == 4) {
  167. texX += texW;
  168. }
  169. if(vid == 2 || vid == 4 || vid == 5) {
  170. texY += texH;
  171. }
  172. float d = float(uAtlasSize);
  173. vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1
  174. gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
  175. }
  176. else if(aVertType == `).concat(fc," || aVertType == ").concat(ff,`
  177. || aVertType == `).concat(vv," || aVertType == ").concat(hf,`) { // simple shapes
  178. // the bounding box is needed by the fragment shader
  179. vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat
  180. vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat
  181. vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated
  182. // calculations are done in the fragment shader, just pass these along
  183. vColor = aColor;
  184. vCornerRadius = aCornerRadius;
  185. vBorderColor = aBorderColor;
  186. vBorderWidth = aLineWidth;
  187. gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
  188. }
  189. else if(aVertType == `).concat(E7,`) {
  190. vec2 source = aPointAPointB.xy;
  191. vec2 target = aPointAPointB.zw;
  192. // adjust the geometry so that the line is centered on the edge
  193. position.y = position.y - 0.5;
  194. // stretch the unit square into a long skinny rectangle
  195. vec2 xBasis = target - source;
  196. vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));
  197. vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;
  198. gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);
  199. vColor = aColor;
  200. }
  201. else if(aVertType == `).concat(T7,`) {
  202. vec2 pointA = aPointAPointB.xy;
  203. vec2 pointB = aPointAPointB.zw;
  204. vec2 pointC = aPointCPointD.xy;
  205. vec2 pointD = aPointCPointD.zw;
  206. // adjust the geometry so that the line is centered on the edge
  207. position.y = position.y - 0.5;
  208. vec2 p0, p1, p2, pos;
  209. if(position.x == 0.0) { // The left side of the unit square
  210. p0 = pointA;
  211. p1 = pointB;
  212. p2 = pointC;
  213. pos = position;
  214. } else { // The right side of the unit square, use same approach but flip the geometry upside down
  215. p0 = pointD;
  216. p1 = pointC;
  217. p2 = pointB;
  218. pos = vec2(0.0, -position.y);
  219. }
  220. vec2 p01 = p1 - p0;
  221. vec2 p12 = p2 - p1;
  222. vec2 p21 = p1 - p2;
  223. // Find the normal vector.
  224. vec2 tangent = normalize(normalize(p12) + normalize(p01));
  225. vec2 normal = vec2(-tangent.y, tangent.x);
  226. // Find the vector perpendicular to p0 -> p1.
  227. vec2 p01Norm = normalize(vec2(-p01.y, p01.x));
  228. // Determine the bend direction.
  229. float sigma = sign(dot(p01 + p21, normal));
  230. float width = aLineWidth[0];
  231. if(sign(pos.y) == -sigma) {
  232. // This is an intersecting vertex. Adjust the position so that there's no overlap.
  233. vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);
  234. gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
  235. } else {
  236. // This is a non-intersecting vertex. Treat it like a mitre join.
  237. vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);
  238. gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
  239. }
  240. vColor = aColor;
  241. }
  242. else if(aVertType == `).concat(z2,` && vid < 3) {
  243. // massage the first triangle into an edge arrow
  244. if(vid == 0)
  245. position = vec2(-0.15, -0.3);
  246. if(vid == 1)
  247. position = vec2( 0.0, 0.0);
  248. if(vid == 2)
  249. position = vec2( 0.15, -0.3);
  250. gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
  251. vColor = aColor;
  252. }
  253. else {
  254. gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space
  255. }
  256. vAtlasId = aAtlasId;
  257. vVertType = aVertType;
  258. vIndex = aIndex;
  259. }
  260. `),a=this.batchManager.getIndexArray(),s=`#version 300 es
  261. precision highp float;
  262. // declare texture unit for each texture atlas in the batch
  263. `.concat(a.map(function(c){return"uniform sampler2D uTexture".concat(c,";")}).join(`
  264. `),`
  265. uniform vec4 uBGColor;
  266. uniform float uZoom;
  267. in vec2 vTexCoord;
  268. in vec4 vColor;
  269. in vec2 vPosition; // model coordinates
  270. flat in int vAtlasId;
  271. flat in vec4 vIndex;
  272. flat in int vVertType;
  273. flat in vec2 vTopRight;
  274. flat in vec2 vBotLeft;
  275. flat in vec4 vCornerRadius;
  276. flat in vec4 vBorderColor;
  277. flat in vec2 vBorderWidth;
  278. out vec4 outColor;
  279. `).concat(HV,`
  280. `).concat(jV,`
  281. `).concat(VV,`
  282. `).concat(qV,`
  283. vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha
  284. return vec4(
  285. top.rgb + (bot.rgb * (1.0 - top.a)),
  286. top.a + (bot.a * (1.0 - top.a))
  287. );
  288. }
  289. vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance
  290. // scale to the zoom level so that borders don't look blurry when zoomed in
  291. // note 1.5 is an aribitrary value chosen because it looks good
  292. return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d)));
  293. }
  294. void main(void) {
  295. if(vVertType == `).concat(F2,`) {
  296. // look up the texel from the texture unit
  297. `).concat(a.map(function(c){return"if(vAtlasId == ".concat(c,") outColor = texture(uTexture").concat(c,", vTexCoord);")}).join(`
  298. else `),`
  299. }
  300. else if(vVertType == `).concat(z2,`) {
  301. // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';
  302. outColor = blend(vColor, uBGColor);
  303. outColor.a = 1.0; // make opaque, masks out line under arrow
  304. }
  305. else if(vVertType == `).concat(fc,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border
  306. outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done
  307. }
  308. else if(vVertType == `).concat(fc," || vVertType == ").concat(ff,`
  309. || vVertType == `).concat(vv," || vVertType == ").concat(hf,`) { // use SDF
  310. float outerBorder = vBorderWidth[0];
  311. float innerBorder = vBorderWidth[1];
  312. float borderPadding = outerBorder * 2.0;
  313. float w = vTopRight.x - vBotLeft.x - borderPadding;
  314. float h = vTopRight.y - vBotLeft.y - borderPadding;
  315. vec2 b = vec2(w/2.0, h/2.0); // half width, half height
  316. vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center
  317. float d; // signed distance
  318. if(vVertType == `).concat(fc,`) {
  319. d = rectangleSD(p, b);
  320. } else if(vVertType == `).concat(ff,` && w == h) {
  321. d = circleSD(p, b.x); // faster than ellipse
  322. } else if(vVertType == `).concat(ff,`) {
  323. d = ellipseSD(p, b);
  324. } else {
  325. d = roundRectangleSD(p, b, vCornerRadius.wzyx);
  326. }
  327. // use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling
  328. // we must smooth colors inwards, because we can't change pixels outside the shape's bounding box
  329. if(d > 0.0) {
  330. if(d > outerBorder) {
  331. discard;
  332. } else {
  333. outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);
  334. }
  335. } else {
  336. if(d > innerBorder) {
  337. vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;
  338. vec4 innerBorderColor = blend(vBorderColor, vColor);
  339. outColor = distInterp(innerBorderColor, outerColor, d);
  340. }
  341. else {
  342. vec4 outerColor;
  343. if(innerBorder == 0.0 && outerBorder == 0.0) {
  344. outerColor = vec4(0);
  345. } else if(innerBorder == 0.0) {
  346. outerColor = vBorderColor;
  347. } else {
  348. outerColor = blend(vBorderColor, vColor);
  349. }
  350. outColor = distInterp(vColor, outerColor, d - innerBorder);
  351. }
  352. }
  353. }
  354. else {
  355. outColor = vColor;
  356. }
  357. `).concat(t.picking?`if(outColor.a == 0.0) discard;
  358. else outColor = vIndex;`:"",`
  359. }
  360. `),o=SV(n,i,s);o.aPosition=n.getAttribLocation(o,"aPosition"),o.aIndex=n.getAttribLocation(o,"aIndex"),o.aVertType=n.getAttribLocation(o,"aVertType"),o.aTransform=n.getAttribLocation(o,"aTransform"),o.aAtlasId=n.getAttribLocation(o,"aAtlasId"),o.aTex=n.getAttribLocation(o,"aTex"),o.aPointAPointB=n.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=n.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=n.getAttribLocation(o,"aLineWidth"),o.aColor=n.getAttribLocation(o,"aColor"),o.aCornerRadius=n.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=n.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=n.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=n.getUniformLocation(o,"uAtlasSize"),o.uBGColor=n.getUniformLocation(o,"uBGColor"),o.uZoom=n.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var l=0;l<this.batchManager.getMaxAtlasesPerBatch();l++)o.uTextures.push(n.getUniformLocation(o,"uTexture".concat(l)));return o}},{key:"_createVAO",value:function(){var t=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=t.length/2;var n=this.maxInstances,i=this.gl,a=this.program,s=i.createVertexArray();return i.bindVertexArray(s),PV(i,"vec2",a.aPosition,t),this.transformBuffer=IV(i,n,a.aTransform),this.indexBuffer=ja(i,n,"vec4",a.aIndex),this.vertTypeBuffer=ja(i,n,"int",a.aVertType),this.atlasIdBuffer=ja(i,n,"int",a.aAtlasId),this.texBuffer=ja(i,n,"vec4",a.aTex),this.pointAPointBBuffer=ja(i,n,"vec4",a.aPointAPointB),this.pointCPointDBuffer=ja(i,n,"vec4",a.aPointCPointD),this.lineWidthBuffer=ja(i,n,"vec2",a.aLineWidth),this.colorBuffer=ja(i,n,"vec4",a.aColor),this.cornerRadiusBuffer=ja(i,n,"vec4",a.aCornerRadius),this.borderColorBuffer=ja(i,n,"vec4",a.aBorderColor),i.bindVertexArray(null),s}},{key:"buffers",get:function(){var t=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(n){return Bo(n,"Buffer")}).map(function(n){return t[n]})),this._buffers}},{key:"startFrame",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:zf.SCREEN;this.panZoomMatrix=t,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(t,n){return t.visible()?n&&n.isVisible?n.isVisible(t):!0:!1}},{key:"drawTexture",value:function(t,n,i){var a=this.atlasManager,s=this.batchManager,o=a.getRenderTypeOpts(i);if(this._isVisible(t,o)&&!(t.isEdge()&&!this._isValidEdge(t))){if(this.renderTarget.picking&&o.getTexPickingMode){var l=o.getTexPickingMode(t);if(l===Bp.IGNORE)return;if(l==Bp.USE_BB){this.drawPickingRectangle(t,n,i);return}}var c=a.getAtlasInfo(t,i),h=Ri(c),d;try{for(h.s();!(d=h.n()).done;){var v=d.value,g=v.atlas,m=v.tex1,x=v.tex2;s.canAddToCurrentBatch(g)||this.endBatch();for(var y=s.getAtlasIndexForBatch(g),_=0,w=[[m,!0],[x,!1]];_<w.length;_++){var S=_n(w[_],2),A=S[0],C=S[1];if(A.w!=0){var M=this.instanceCount;this.vertTypeBuffer.getView(M)[0]=F2;var E=this.indexBuffer.getView(M);hc(n,E);var O=this.atlasIdBuffer.getView(M);O[0]=y;var D=this.texBuffer.getView(M);D[0]=A.x,D[1]=A.y,D[2]=A.w,D[3]=A.h;var I=this.transformBuffer.getMatrixView(M);this.setTransformMatrix(t,I,o,v,C),this.instanceCount++,C||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(k){h.e(k)}finally{h.f()}}}},{key:"setTransformMatrix",value:function(t,n,i,a){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(i.shapeProps&&i.shapeProps.padding&&(o=t.pstyle(i.shapeProps.padding).pfValue),a){var l=a.bb,c=a.tex1,h=a.tex2,d=c.w/(c.w+h.w);s||(d=1-d);var v=this._getAdjustedBB(l,o,s,d);this._applyTransformMatrix(n,v,i,t)}else{var g=i.getBoundingBox(t),m=this._getAdjustedBB(g,o,!0,1);this._applyTransformMatrix(n,m,i,t)}}},{key:"_applyTransformMatrix",value:function(t,n,i,a){var s,o;w7(t);var l=i.getRotation?i.getRotation(a):0;if(l!==0){var c=i.getRotationPoint(a),h=c.x,d=c.y;cp(t,t,[h,d]),S7(t,t,l);var v=i.getRotationOffset(a);s=v.x+(n.xOffset||0),o=v.y+(n.yOffset||0)}else s=n.x1,o=n.y1;cp(t,t,[s,o]),g4(t,t,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(t,n,i,a){var s=t.x1,o=t.y1,l=t.w,c=t.h,h=t.yOffset;n&&(s-=n,o-=n,l+=2*n,c+=2*n);var d=0,v=l*a;return i&&a<1?l=v:!i&&a<1&&(d=l-v,s+=d,l=v),{x1:s,y1:o,w:l,h:c,xOffset:d,yOffset:h}}},{key:"drawPickingRectangle",value:function(t,n,i){var a=this.atlasManager.getRenderTypeOpts(i),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=fc;var o=this.indexBuffer.getView(s);hc(n,o);var l=this.colorBuffer.getView(s);Bl([0,0,0],1,l);var c=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(t,c,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(t,n,i){var a=this.simpleShapeOptions.get(i);if(this._isVisible(t,a)){var s=a.shapeProps,o=this._getVertTypeForShape(t,s.shape);if(o===void 0||a.isSimple&&!a.isSimple(t,this.renderTarget)){this.drawTexture(t,n,i);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=o,o===vv||o===hf){var c=a.getBoundingBox(t),h=this._getCornerRadius(t,s.radius,c),d=this.cornerRadiusBuffer.getView(l);d[0]=h,d[1]=h,d[2]=h,d[3]=h,o===hf&&(d[0]=0,d[2]=0)}var v=this.indexBuffer.getView(l);hc(n,v);var g=this.renderTarget.picking?1:t.pstyle(s.opacity).value,m=t.pstyle(s.color).value,x=this.colorBuffer.getView(l);Bl(m,g,x);var y=this.lineWidthBuffer.getView(l);if(y[0]=0,y[1]=0,s.border){var _=t.pstyle("border-width").value;if(_>0){var w=t.pstyle("border-color").value,S=t.pstyle("border-opacity").value,A=this.borderColorBuffer.getView(l);Bl(w,S,A);var C=t.pstyle("border-position").value;if(C==="inside")y[0]=0,y[1]=-_;else if(C==="outside")y[0]=_,y[1]=0;else{var M=_/2;y[0]=M,y[1]=-M}}}var E=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(t,E,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(t,n){var i=t.pstyle(n).value;switch(i){case"rectangle":return fc;case"ellipse":return ff;case"roundrectangle":case"round-rectangle":return vv;case"bottom-round-rectangle":return hf;default:return}}},{key:"_getCornerRadius",value:function(t,n,i){var a=i.w,s=i.h;if(t.pstyle(n).value==="auto")return Zo(a,s);var o=t.pstyle(n).pfValue,l=a/2,c=s/2;return Math.min(o,c,l)}},{key:"drawEdgeArrow",value:function(t,n,i){if(t.visible()){var a=t._private.rscratch,s,o,l;if(i==="source"?(s=a.arrowStartX,o=a.arrowStartY,l=a.srcArrowAngle):(s=a.arrowEndX,o=a.arrowEndY,l=a.tgtArrowAngle),!(isNaN(s)||s==null||isNaN(o)||o==null||isNaN(l)||l==null)){var c=t.pstyle(i+"-arrow-shape").value;if(c!=="none"){var h=t.pstyle(i+"-arrow-color").value,d=t.pstyle("opacity").value,v=t.pstyle("line-opacity").value,g=d*v,m=t.pstyle("width").pfValue,x=t.pstyle("arrow-scale").value,y=this.r.getArrowWidth(m,x),_=this.instanceCount,w=this.transformBuffer.getMatrixView(_);w7(w),cp(w,w,[s,o]),g4(w,w,[y,y]),S7(w,w,l),this.vertTypeBuffer.getView(_)[0]=z2;var S=this.indexBuffer.getView(_);hc(n,S);var A=this.colorBuffer.getView(_);Bl(h,g,A),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(t,n){if(t.visible()){var i=this._getEdgePoints(t);if(i){var a=t.pstyle("opacity").value,s=t.pstyle("line-opacity").value,o=t.pstyle("width").pfValue,l=t.pstyle("line-color").value,c=a*s;if(i.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),i.length==4){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=E7;var d=this.indexBuffer.getView(h);hc(n,d);var v=this.colorBuffer.getView(h);Bl(l,c,v);var g=this.lineWidthBuffer.getView(h);g[0]=o;var m=this.pointAPointBBuffer.getView(h);m[0]=i[0],m[1]=i[1],m[2]=i[2],m[3]=i[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var x=0;x<i.length-2;x+=2){var y=this.instanceCount;this.vertTypeBuffer.getView(y)[0]=T7;var _=this.indexBuffer.getView(y);hc(n,_);var w=this.colorBuffer.getView(y);Bl(l,c,w);var S=this.lineWidthBuffer.getView(y);S[0]=o;var A=i[x-2],C=i[x-1],M=i[x],E=i[x+1],O=i[x+2],D=i[x+3],I=i[x+4],k=i[x+5];x==0&&(A=2*M-O+.001,C=2*E-D+.001),x==i.length-4&&(I=2*O-M+.001,k=2*D-E+.001);var U=this.pointAPointBBuffer.getView(y);U[0]=A,U[1]=C,U[2]=M,U[3]=E;var V=this.pointCPointDBuffer.getView(y);V[0]=O,V[1]=D,V[2]=I,V[3]=k,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(t){var n=t._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(t){var n=t._private.rscratch;if(this._isValidEdge(t)){var i=n.allpts;if(i.length==4)return i;var a=this._getNumSegments(t);return this._getCurveSegmentPoints(i,a)}}},{key:"_getNumSegments",value:function(t){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(t,n){if(t.length==4)return t;for(var i=Array((n+1)*2),a=0;a<=n;a++)if(a==0)i[0]=t[0],i[1]=t[1];else if(a==n)i[a*2]=t[t.length-2],i[a*2+1]=t[t.length-1];else{var s=a/n;this._setCurvePoint(t,s,i,a*2)}return i}},{key:"_setCurvePoint",value:function(t,n,i,a){if(t.length<=2)i[a]=t[0],i[a+1]=t[1];else{for(var s=Array(t.length-2),o=0;o<s.length;o+=2){var l=(1-n)*t[o]+n*t[o+2],c=(1-n)*t[o+1]+n*t[o+3];s[o]=l,s[o+1]=c}return this._setCurvePoint(s,n,i,a)}}},{key:"endBatch",value:function(){var t=this.gl,n=this.vao,i=this.vertexCount,a=this.instanceCount;if(a!==0){var s=this.renderTarget.picking?this.pickingProgram:this.program;t.useProgram(s),t.bindVertexArray(n);var o=Ri(this.buffers),l;try{for(o.s();!(l=o.n()).done;){var c=l.value;c.bufferSubData(a)}}catch(m){o.e(m)}finally{o.f()}for(var h=this.batchManager.getAtlases(),d=0;d<h.length;d++)h[d].bufferIfNeeded(t);for(var v=0;v<h.length;v++)t.activeTexture(t.TEXTURE0+v),t.bindTexture(t.TEXTURE_2D,h[v].texture),t.uniform1i(s.uTextures[v],v);t.uniform1f(s.uZoom,TV(this.r)),t.uniformMatrix3fv(s.uPanZoomMatrix,!1,this.panZoomMatrix),t.uniform1i(s.uAtlasSize,this.batchManager.getAtlasSize());var g=Bl(this.bgColor,1);t.uniform4fv(s.uBGColor,g),t.drawArraysInstanced(t.TRIANGLES,0,i,a),t.bindVertexArray(null),t.bindTexture(t.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:a,atlasCount:h.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){var t=this.atlasManager.getDebugInfo(),n=t.reduce(function(s,o){return s+o.atlasCount},0),i=this.batchDebugInfo,a=i.reduce(function(s,o){return s+o.count},0);return{atlasInfo:t,totalAtlases:n,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:i.length,batchInfo:i,totalInstances:a}}}])})(),hO={};hO.initWebgl=function(r,e){var t=this,n=t.data.contexts[t.WEBGL];r.bgColor=YV(t),r.webglTexSize=Math.min(r.webglTexSize,n.getParameter(n.MAX_TEXTURE_SIZE)),r.webglTexRows=Math.min(r.webglTexRows,54),r.webglTexRowsNodes=Math.min(r.webglTexRowsNodes,54),r.webglBatchSize=Math.min(r.webglBatchSize,16384),r.webglTexPerBatch=Math.min(r.webglTexPerBatch,n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS)),t.webglDebug=r.webglDebug,t.webglDebugShowAtlases=r.webglDebugShowAtlases,t.pickingFrameBuffer=NV(n),t.pickingFrameBuffer.needsDraw=!0,t.drawing=new XV(t,n,r);var i=function(d){return function(v){return t.getTextAngle(v,d)}},a=function(d){return function(v){var g=v.pstyle(d);return g&&g.value}},s=function(d){return function(v){return v.pstyle("".concat(d,"-opacity")).value>0}},o=function(d){var v=d.pstyle("text-events").strValue==="yes";return v?Bp.USE_BB:Bp.IGNORE},l=function(d){var v=d.position(),g=v.x,m=v.y,x=d.outerWidth(),y=d.outerHeight();return{w:x,h:y,x1:g-x/2,y1:m-y/2}};t.drawing.addAtlasCollection("node",{texRows:r.webglTexRowsNodes}),t.drawing.addAtlasCollection("label",{texRows:r.webglTexRows}),t.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),t.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:AV,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),t.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),t.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),t.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:U2(e.getLabelKey,null),getBoundingBox:G2(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:i(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:a("label")}),t.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:U2(e.getSourceLabelKey,"source"),getBoundingBox:G2(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:i("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:a("source-label")}),t.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:U2(e.getTargetLabelKey,"target"),getBoundingBox:G2(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:a("target-label")});var c=Rd(function(){console.log("garbage collect flag set"),t.data.gc=!0},1e4);t.onUpdateEleCalcs(function(h,d){var v=!1;d&&d.length>0&&(v|=t.drawing.invalidate(d)),v&&c()}),WV(t)};function YV(r){var e=r.cy.container(),t=e&&e.style&&e.style.backgroundColor||"white";return z9(t)}function fO(r,e){var t=r._private.rscratch;return Ai(t,"labelWrapCachedLines",e)||[]}var U2=function(e,t){return function(n){var i=e(n),a=fO(n,t);return a.length>1?a.map(function(s,o){return"".concat(i,"_").concat(o)}):i}},G2=function(e,t){return function(n,i){var a=e(n);if(typeof i=="string"){var s=i.indexOf("_");if(s>0){var o=Number(i.substring(s+1)),l=fO(n,t),c=a.h/l.length,h=c*o,d=a.y1+h;return{x1:a.x1,w:a.w,y1:d,h:c,yOffset:h}}}return a}};function WV(r){{var e=r.render;r.render=function(a){a=a||{};var s=r.cy;r.webgl&&(s.zoom()>iO?($V(r),e.call(r,a)):(KV(r),vO(r,a,zf.SCREEN)))}}{var t=r.matchCanvasSize;r.matchCanvasSize=function(a){t.call(r,a),r.pickingFrameBuffer.setFramebufferAttachmentSizes(r.canvasWidth,r.canvasHeight),r.pickingFrameBuffer.needsDraw=!0}}r.findNearestElements=function(a,s,o,l){return rq(r,a,s)};{var n=r.invalidateCachedZSortedEles;r.invalidateCachedZSortedEles=function(){n.call(r),r.pickingFrameBuffer.needsDraw=!0}}{var i=r.notify;r.notify=function(a,s){i.call(r,a,s),a==="viewport"||a==="bounds"?r.pickingFrameBuffer.needsDraw=!0:a==="background"&&r.drawing.invalidate(s,{type:"node-body"})}}}function $V(r){var e=r.data.contexts[r.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function KV(r){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,r.canvasWidth,r.canvasHeight),n.restore()};e(r.data.contexts[r.NODE]),e(r.data.contexts[r.DRAG])}function ZV(r){var e=r.canvasWidth,t=r.canvasHeight,n=vw(r),i=n.pan,a=n.zoom,s=B2();cp(s,s,[i.x,i.y]),g4(s,s,[a,a]);var o=B2();kV(o,e,t);var l=B2();return LV(l,o,s),l}function dO(r,e){var t=r.canvasWidth,n=r.canvasHeight,i=vw(r),a=i.pan,s=i.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t,n),e.translate(a.x,a.y),e.scale(s,s)}function QV(r,e){r.drawSelectionRectangle(e,function(t){return dO(r,t)})}function JV(r){var e=r.data.contexts[r.NODE];e.save(),dO(r,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function eq(r){var e=function(i,a,s){for(var o=i.atlasManager.getAtlasCollection(a),l=r.data.contexts[r.NODE],c=o.atlases,h=0;h<c.length;h++){var d=c[h],v=d.canvas;if(v){var g=v.width,m=v.height,x=g*h,y=v.height*s,_=.4;l.save(),l.scale(_,_),l.drawImage(v,x,y),l.strokeStyle="black",l.rect(x,y,g,m),l.stroke(),l.restore()}}},t=0;e(r.drawing,"node",t++),e(r.drawing,"label",t++)}function tq(r,e,t,n,i){var a,s,o,l,c=vw(r),h=c.pan,d=c.zoom;{var v=CV(r,h,d,e,t),g=_n(v,2),m=g[0],x=g[1],y=6;a=m-y/2,s=x-y/2,o=y,l=y}if(o===0||l===0)return[];var _=r.data.contexts[r.WEBGL];_.bindFramebuffer(_.FRAMEBUFFER,r.pickingFrameBuffer),r.pickingFrameBuffer.needsDraw&&(_.viewport(0,0,_.canvas.width,_.canvas.height),vO(r,null,zf.PICKING),r.pickingFrameBuffer.needsDraw=!1);var w=o*l,S=new Uint8Array(w*4);_.readPixels(a,s,o,l,_.RGBA,_.UNSIGNED_BYTE,S),_.bindFramebuffer(_.FRAMEBUFFER,null);for(var A=new Set,C=0;C<w;C++){var M=S.slice(C*4,C*4+4),E=RV(M)-1;E>=0&&A.add(E)}return A}function rq(r,e,t){var n=tq(r,e,t),i=r.getCachedZSortedEles(),a,s,o=Ri(n),l;try{for(o.s();!(l=o.n()).done;){var c=l.value,h=i[c];if(!a&&h.isNode()&&(a=h),!s&&h.isEdge()&&(s=h),a&&s)break}}catch(d){o.e(d)}finally{o.f()}return[a,s].filter(Boolean)}function H2(r,e,t){var n=r.drawing;e+=1,t.isNode()?(n.drawNode(t,e,"node-underlay"),n.drawNode(t,e,"node-body"),n.drawTexture(t,e,"label"),n.drawNode(t,e,"node-overlay")):(n.drawEdgeLine(t,e),n.drawEdgeArrow(t,e,"source"),n.drawEdgeArrow(t,e,"target"),n.drawTexture(t,e,"label"),n.drawTexture(t,e,"edge-source-label"),n.drawTexture(t,e,"edge-target-label"))}function vO(r,e,t){var n;r.webglDebug&&(n=performance.now());var i=r.drawing,a=0;if(t.screen&&r.data.canvasNeedsRedraw[r.SELECT_BOX]&&QV(r,e),r.data.canvasNeedsRedraw[r.NODE]||t.picking){var s=r.data.contexts[r.WEBGL];t.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var o=ZV(r),l=r.getCachedZSortedEles();if(a=l.length,i.startFrame(o,t),t.screen){for(var c=0;c<l.nondrag.length;c++)H2(r,c,l.nondrag[c]);for(var h=0;h<l.drag.length;h++)H2(r,h,l.drag[h])}else if(t.picking)for(var d=0;d<l.length;d++)H2(r,d,l[d]);i.endFrame(),t.screen&&r.webglDebugShowAtlases&&(JV(r),eq(r)),r.data.canvasNeedsRedraw[r.NODE]=!1,r.data.canvasNeedsRedraw[r.DRAG]=!1}if(r.webglDebug){var v=performance.now(),g=!1,m=Math.ceil(v-n),x=i.getDebugInfo(),y=["".concat(a," elements"),"".concat(x.totalInstances," instances"),"".concat(x.batchCount," batches"),"".concat(x.totalAtlases," atlases"),"".concat(x.wrappedCount," wrapped textures"),"".concat(x.simpleCount," simple shapes")].join(", ");if(g)console.log("WebGL (".concat(t.name,") - time ").concat(m,"ms, ").concat(y));else{console.log("WebGL (".concat(t.name,") - frame time ").concat(m,"ms")),console.log("Totals:"),console.log(" ".concat(y)),console.log("Texture Atlases Used:");var _=x.atlasInfo,w=Ri(_),S;try{for(w.s();!(S=w.n()).done;){var A=S.value;console.log(" ".concat(A.type,": ").concat(A.keyCount," keys, ").concat(A.atlasCount," atlases"))}}catch(C){w.e(C)}finally{w.f()}console.log("")}}r.data.gc&&(console.log("Garbage Collect!"),r.data.gc=!1,i.gc())}var pl={};pl.drawPolygonPath=function(r,e,t,n,i,a){var s=n/2,o=i/2;r.beginPath&&r.beginPath(),r.moveTo(e+s*a[0],t+o*a[1]);for(var l=1;l<a.length/2;l++)r.lineTo(e+s*a[l*2],t+o*a[l*2+1]);r.closePath()};pl.drawRoundPolygonPath=function(r,e,t,n,i,a,s){s.forEach(function(o){return $R(r,o)}),r.closePath()};pl.drawRoundRectanglePath=function(r,e,t,n,i,a){var s=n/2,o=i/2,l=a==="auto"?Zo(n,i):Math.min(a,o,s);r.beginPath&&r.beginPath(),r.moveTo(e,t-o),r.arcTo(e+s,t-o,e+s,t,l),r.arcTo(e+s,t+o,e,t+o,l),r.arcTo(e-s,t+o,e-s,t,l),r.arcTo(e-s,t-o,e,t-o,l),r.lineTo(e,t-o),r.closePath()};pl.drawBottomRoundRectanglePath=function(r,e,t,n,i,a){var s=n/2,o=i/2,l=a==="auto"?Zo(n,i):a;r.beginPath&&r.beginPath(),r.moveTo(e,t-o),r.lineTo(e+s,t-o),r.lineTo(e+s,t),r.arcTo(e+s,t+o,e,t+o,l),r.arcTo(e-s,t+o,e-s,t,l),r.lineTo(e-s,t-o),r.lineTo(e,t-o),r.closePath()};pl.drawCutRectanglePath=function(r,e,t,n,i,a,s){var o=n/2,l=i/2,c=s==="auto"?ew():s;r.beginPath&&r.beginPath(),r.moveTo(e-o+c,t-l),r.lineTo(e+o-c,t-l),r.lineTo(e+o,t-l+c),r.lineTo(e+o,t+l-c),r.lineTo(e+o-c,t+l),r.lineTo(e-o+c,t+l),r.lineTo(e-o,t+l-c),r.lineTo(e-o,t-l+c),r.closePath()};pl.drawBarrelPath=function(r,e,t,n,i){var a=n/2,s=i/2,o=e-a,l=e+a,c=t-s,h=t+s,d=r4(n,i),v=d.widthOffset,g=d.heightOffset,m=d.ctrlPtOffsetPct*v;r.beginPath&&r.beginPath(),r.moveTo(o,c+g),r.lineTo(o,h-g),r.quadraticCurveTo(o+m,h,o+v,h),r.lineTo(l-v,h),r.quadraticCurveTo(l-m,h,l,h-g),r.lineTo(l,c+g),r.quadraticCurveTo(l-m,c,l-v,c),r.lineTo(o+v,c),r.quadraticCurveTo(o+m,c,o,c+g),r.closePath()};var C7=Math.sin(0),A7=Math.cos(0),m4={},y4={},pO=Math.PI/40;for(var dc=0*Math.PI;dc<2*Math.PI;dc+=pO)m4[dc]=Math.sin(dc),y4[dc]=Math.cos(dc);pl.drawEllipsePath=function(r,e,t,n,i){if(r.beginPath&&r.beginPath(),r.ellipse)r.ellipse(e,t,n/2,i/2,0,0,2*Math.PI);else for(var a,s,o=n/2,l=i/2,c=0*Math.PI;c<2*Math.PI;c+=pO)a=e-o*m4[c]*C7+o*y4[c]*A7,s=t+l*y4[c]*C7+l*m4[c]*A7,c===0?r.moveTo(a,s):r.lineTo(a,s);r.closePath()};var Ld={};Ld.createBuffer=function(r,e){var t=document.createElement("canvas");return t.width=r,t.height=e,[t,t.getContext("2d")]};Ld.bufferCanvasImage=function(r){var e=this.cy,t=e.mutableElements(),n=t.boundingBox(),i=this.findContainerClientCoords(),a=r.full?Math.ceil(n.w):i[2],s=r.full?Math.ceil(n.h):i[3],o=ut(r.maxWidth)||ut(r.maxHeight),l=this.getPixelRatio(),c=1;if(r.scale!==void 0)a*=r.scale,s*=r.scale,c=r.scale;else if(o){var h=1/0,d=1/0;ut(r.maxWidth)&&(h=c*r.maxWidth/a),ut(r.maxHeight)&&(d=c*r.maxHeight/s),c=Math.min(h,d),a*=c,s*=c}o||(a*=l,s*=l,c*=l);var v=document.createElement("canvas");v.width=a,v.height=s,v.style.width=a+"px",v.style.height=s+"px";var g=v.getContext("2d");if(a>0&&s>0){g.clearRect(0,0,a,s),g.globalCompositeOperation="source-over";var m=this.getCachedZSortedEles();if(r.full)g.translate(-n.x1*c,-n.y1*c),g.scale(c,c),this.drawElements(g,m),g.scale(1/c,1/c),g.translate(n.x1*c,n.y1*c);else{var x=e.pan(),y={x:x.x*c,y:x.y*c};c*=e.zoom(),g.translate(y.x,y.y),g.scale(c,c),this.drawElements(g,m),g.scale(1/c,1/c),g.translate(-y.x,-y.y)}r.bg&&(g.globalCompositeOperation="destination-over",g.fillStyle=r.bg,g.rect(0,0,a,s),g.fill())}return v};function nq(r,e){for(var t=atob(r),n=new ArrayBuffer(t.length),i=new Uint8Array(n),a=0;a<t.length;a++)i[a]=t.charCodeAt(a);return new Blob([n],{type:e})}function M7(r){var e=r.indexOf(",");return r.substr(e+1)}function gO(r,e,t){var n=function(){return e.toDataURL(t,r.quality)};switch(r.output){case"blob-promise":return new Jc(function(i,a){try{e.toBlob(function(s){s!=null?i(s):a(new Error("`canvas.toBlob()` sent a null value in its callback"))},t,r.quality)}catch(s){a(s)}});case"blob":return nq(M7(n()),t);case"base64":return M7(n());case"base64uri":default:return n()}}Ld.png=function(r){return gO(r,this.bufferCanvasImage(r),"image/png")};Ld.jpg=function(r){return gO(r,this.bufferCanvasImage(r),"image/jpeg")};var mO={};mO.nodeShapeImpl=function(r,e,t,n,i,a,s,o){switch(r){case"ellipse":return this.drawEllipsePath(e,t,n,i,a);case"polygon":return this.drawPolygonPath(e,t,n,i,a,s);case"round-polygon":return this.drawRoundPolygonPath(e,t,n,i,a,s,o);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,t,n,i,a,o);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,t,n,i,a,s,o);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,t,n,i,a,o);case"barrel":return this.drawBarrelPath(e,t,n,i,a)}};var iq=yO,zt=yO.prototype;zt.CANVAS_LAYERS=3;zt.SELECT_BOX=0;zt.DRAG=1;zt.NODE=2;zt.WEBGL=3;zt.CANVAS_TYPES=["2d","2d","2d","webgl2"];zt.BUFFER_COUNT=3;zt.TEXTURE_BUFFER=0;zt.MOTIONBLUR_BUFFER_NODE=1;zt.MOTIONBLUR_BUFFER_DRAG=2;function yO(r){var e=this,t=e.cy.window(),n=t.document;r.webgl&&(zt.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),e.data={canvases:new Array(zt.CANVAS_LAYERS),contexts:new Array(zt.CANVAS_LAYERS),canvasNeedsRedraw:new Array(zt.CANVAS_LAYERS),bufferCanvases:new Array(zt.BUFFER_COUNT),bufferContexts:new Array(zt.CANVAS_LAYERS)};var i="-webkit-tap-highlight-color",a="rgba(0,0,0,0)";e.data.canvasContainer=n.createElement("div");var s=e.data.canvasContainer.style;e.data.canvasContainer.style[i]=a,s.position="relative",s.zIndex="0",s.overflow="hidden";var o=r.cy.container();o.appendChild(e.data.canvasContainer),o.style[i]=a;var l={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};QF()&&(l["-ms-touch-action"]="none",l["touch-action"]="none");for(var c=0;c<zt.CANVAS_LAYERS;c++){var h=e.data.canvases[c]=n.createElement("canvas"),d=zt.CANVAS_TYPES[c];e.data.contexts[c]=h.getContext(d),e.data.contexts[c]||jr("Could not create canvas of type "+d),Object.keys(l).forEach(function(pe){h.style[pe]=l[pe]}),h.style.position="absolute",h.setAttribute("data-id","layer"+c),h.style.zIndex=String(zt.CANVAS_LAYERS-c),e.data.canvasContainer.appendChild(h),e.data.canvasNeedsRedraw[c]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[zt.NODE].setAttribute("data-id","layer"+zt.NODE+"-node"),e.data.canvases[zt.SELECT_BOX].setAttribute("data-id","layer"+zt.SELECT_BOX+"-selectbox"),e.data.canvases[zt.DRAG].setAttribute("data-id","layer"+zt.DRAG+"-drag"),e.data.canvases[zt.WEBGL]&&e.data.canvases[zt.WEBGL].setAttribute("data-id","layer"+zt.WEBGL+"-webgl");for(var c=0;c<zt.BUFFER_COUNT;c++)e.data.bufferCanvases[c]=n.createElement("canvas"),e.data.bufferContexts[c]=e.data.bufferCanvases[c].getContext("2d"),e.data.bufferCanvases[c].style.position="absolute",e.data.bufferCanvases[c].setAttribute("data-id","buffer"+c),e.data.bufferCanvases[c].style.zIndex=String(-c-1),e.data.bufferCanvases[c].style.visibility="hidden";e.pathsEnabled=!0;var v=di(),g=function(ae){return{x:(ae.x1+ae.x2)/2,y:(ae.y1+ae.y2)/2}},m=function(ae){return{x:-ae.w/2,y:-ae.h/2}},x=function(ae){var oe=ae[0]._private,de=oe.oldBackgroundTimestamp===oe.backgroundTimestamp;return!de},y=function(ae){return ae[0]._private.nodeKey},_=function(ae){return ae[0]._private.labelStyleKey},w=function(ae){return ae[0]._private.sourceLabelStyleKey},S=function(ae){return ae[0]._private.targetLabelStyleKey},A=function(ae,oe,de,ye,Ee){return e.drawElement(ae,oe,de,!1,!1,Ee)},C=function(ae,oe,de,ye,Ee){return e.drawElementText(ae,oe,de,ye,"main",Ee)},M=function(ae,oe,de,ye,Ee){return e.drawElementText(ae,oe,de,ye,"source",Ee)},E=function(ae,oe,de,ye,Ee){return e.drawElementText(ae,oe,de,ye,"target",Ee)},O=function(ae){return ae.boundingBox(),ae[0]._private.bodyBounds},D=function(ae){return ae.boundingBox(),ae[0]._private.labelBounds.main||v},I=function(ae){return ae.boundingBox(),ae[0]._private.labelBounds.source||v},k=function(ae){return ae.boundingBox(),ae[0]._private.labelBounds.target||v},U=function(ae,oe){return oe},V=function(ae){return g(O(ae))},X=function(ae,oe,de){var ye=ae?ae+"-":"";return{x:oe.x+de.pstyle(ye+"text-margin-x").pfValue,y:oe.y+de.pstyle(ye+"text-margin-y").pfValue}},W=function(ae,oe,de){var ye=ae[0]._private.rscratch;return{x:ye[oe],y:ye[de]}},P=function(ae){return X("",W(ae,"labelX","labelY"),ae)},H=function(ae){return X("source",W(ae,"sourceLabelX","sourceLabelY"),ae)},z=function(ae){return X("target",W(ae,"targetLabelX","targetLabelY"),ae)},$=function(ae){return m(O(ae))},B=function(ae){return m(I(ae))},L=function(ae){return m(k(ae))},Y=function(ae){var oe=D(ae),de=m(D(ae));if(ae.isNode()){switch(ae.pstyle("text-halign").value){case"left":de.x=-oe.w-(oe.leftPad||0);break;case"right":de.x=-(oe.rightPad||0);break}switch(ae.pstyle("text-valign").value){case"top":de.y=-oe.h-(oe.topPad||0);break;case"bottom":de.y=-(oe.botPad||0);break}}return de},G=e.data.eleTxrCache=new Rf(e,{getKey:y,doesEleInvalidateKey:x,drawElement:A,getBoundingBox:O,getRotationPoint:V,getRotationOffset:$,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),re=e.data.lblTxrCache=new Rf(e,{getKey:_,drawElement:C,getBoundingBox:D,getRotationPoint:P,getRotationOffset:Y,isVisible:U}),ie=e.data.slbTxrCache=new Rf(e,{getKey:w,drawElement:M,getBoundingBox:I,getRotationPoint:H,getRotationOffset:B,isVisible:U}),le=e.data.tlbTxrCache=new Rf(e,{getKey:S,drawElement:E,getBoundingBox:k,getRotationPoint:z,getRotationOffset:L,isVisible:U}),ce=e.data.lyrTxrCache=new aO(e);e.onUpdateEleCalcs(function(ae,oe){G.invalidateElements(oe),re.invalidateElements(oe),ie.invalidateElements(oe),le.invalidateElements(oe),ce.invalidateElements(oe);for(var de=0;de<oe.length;de++){var ye=oe[de]._private;ye.oldBackgroundTimestamp=ye.backgroundTimestamp}});var _e=function(ae){for(var oe=0;oe<ae.length;oe++)ce.enqueueElementRefinement(ae[oe].ele)};G.onDequeue(_e),re.onDequeue(_e),ie.onDequeue(_e),le.onDequeue(_e),r.webgl&&e.initWebgl(r,{getStyleKey:y,getLabelKey:_,getSourceLabelKey:w,getTargetLabelKey:S,drawElement:A,drawLabel:C,drawSourceLabel:M,drawTargetLabel:E,getElementBox:O,getLabelBox:D,getSourceLabelBox:I,getTargetLabelBox:k,getElementRotationPoint:V,getElementRotationOffset:$,getLabelRotationPoint:P,getSourceLabelRotationPoint:H,getTargetLabelRotationPoint:z,getLabelRotationOffset:Y,getSourceLabelRotationOffset:B,getTargetLabelRotationOffset:L})}zt.redrawHint=function(r,e){var t=this;switch(r){case"eles":t.data.canvasNeedsRedraw[zt.NODE]=e;break;case"drag":t.data.canvasNeedsRedraw[zt.DRAG]=e;break;case"select":t.data.canvasNeedsRedraw[zt.SELECT_BOX]=e;break;case"gc":t.data.gc=!0;break}};var aq=typeof Path2D<"u";zt.path2dEnabled=function(r){if(r===void 0)return this.pathsEnabled;this.pathsEnabled=!!r};zt.usePaths=function(){return aq&&this.pathsEnabled};zt.setImgSmoothing=function(r,e){r.imageSmoothingEnabled!=null?r.imageSmoothingEnabled=e:(r.webkitImageSmoothingEnabled=e,r.mozImageSmoothingEnabled=e,r.msImageSmoothingEnabled=e)};zt.getImgSmoothing=function(r){return r.imageSmoothingEnabled!=null?r.imageSmoothingEnabled:r.webkitImageSmoothingEnabled||r.mozImageSmoothingEnabled||r.msImageSmoothingEnabled};zt.makeOffscreenCanvas=function(r,e){var t;if((typeof OffscreenCanvas>"u"?"undefined":On(OffscreenCanvas))!=="undefined")t=new OffscreenCanvas(r,e);else{var n=this.cy.window(),i=n.document;t=i.createElement("canvas"),t.width=r,t.height=e}return t};[sO,ls,$s,dw,_u,vl,vi,hO,pl,Ld,mO].forEach(function(r){Ct(zt,r)});var sq=[{name:"null",impl:XR},{name:"base",impl:rO},{name:"canvas",impl:iq}],oq=[{type:"layout",extensions:Pj},{type:"renderer",extensions:sq}],bO={},xO={};function _O(r,e,t){var n=t,i=function(O){fr("Can not register `"+e+"` for `"+r+"` since `"+O+"` already exists in the prototype and can not be overridden")};if(r==="core"){if(rd.prototype[e])return i(e);rd.prototype[e]=t}else if(r==="collection"){if(Wn.prototype[e])return i(e);Wn.prototype[e]=t}else if(r==="layout"){for(var a=function(O){this.options=O,t.call(this,O),Zt(this._private)||(this._private={}),this._private.cy=O.cy,this._private.listeners=[],this.createEmitter()},s=a.prototype=Object.create(t.prototype),o=[],l=0;l<o.length;l++){var c=o[l];s[c]=s[c]||function(){return this}}s.start&&!s.run?s.run=function(){return this.start(),this}:!s.start&&s.run&&(s.start=function(){return this.run(),this});var h=t.prototype.stop;s.stop=function(){var E=this.options;if(E&&E.animate){var O=this.animations;if(O)for(var D=0;D<O.length;D++)O[D].stop()}return h?h.call(this):this.emit("layoutstop"),this},s.destroy||(s.destroy=function(){return this}),s.cy=function(){return this._private.cy};var d=function(O){return O._private.cy},v={addEventFields:function(O,D){D.layout=O,D.cy=d(O),D.target=O},bubble:function(){return!0},parent:function(O){return d(O)}};Ct(s,{createEmitter:function(){return this._private.emitter=new dg(v,this),this},emitter:function(){return this._private.emitter},on:function(O,D){return this.emitter().on(O,D),this},one:function(O,D){return this.emitter().one(O,D),this},once:function(O,D){return this.emitter().one(O,D),this},removeListener:function(O,D){return this.emitter().removeListener(O,D),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(O,D){return this.emitter().emit(O,D),this}}),hr.eventAliasesOn(s),n=a}else if(r==="renderer"&&e!=="null"&&e!=="base"){var g=wO("renderer","base"),m=g.prototype,x=t,y=t.prototype,_=function(){g.apply(this,arguments),x.apply(this,arguments)},w=_.prototype;for(var S in m){var A=m[S],C=y[S]!=null;if(C)return i(S);w[S]=A}for(var M in y)w[M]=y[M];m.clientFunctions.forEach(function(E){w[E]=w[E]||function(){jr("Renderer does not implement `renderer."+E+"()` on its prototype")}}),n=_}else if(r==="__proto__"||r==="constructor"||r==="prototype")return jr(r+" is an illegal type to be registered, possibly lead to prototype pollutions");return U9({map:bO,keys:[r,e],value:n})}function wO(r,e){return G9({map:bO,keys:[r,e]})}function lq(r,e,t,n,i){return U9({map:xO,keys:[r,e,t,n],value:i})}function uq(r,e,t,n){return G9({map:xO,keys:[r,e,t,n]})}var b4=function(){if(arguments.length===2)return wO.apply(null,arguments);if(arguments.length===3)return _O.apply(null,arguments);if(arguments.length===4)return uq.apply(null,arguments);if(arguments.length===5)return lq.apply(null,arguments);jr("Invalid extension access syntax")};rd.prototype.extension=b4;oq.forEach(function(r){r.extensions.forEach(function(e){_O(r.type,e.name,e.impl)})});var Fp=function(){if(!(this instanceof Fp))return new Fp;this.length=0},vu=Fp.prototype;vu.instanceString=function(){return"stylesheet"};vu.selector=function(r){var e=this.length++;return this[e]={selector:r,properties:[]},this};vu.css=function(r,e){var t=this.length-1;if(xt(r))this[t].properties.push({name:r,value:e});else if(Zt(r))for(var n=r,i=Object.keys(n),a=0;a<i.length;a++){var s=i[a],o=n[s];if(o!=null){var l=zn.properties[s]||zn.properties[ng(s)];if(l!=null){var c=l.name,h=o;this[t].properties.push({name:c,value:h})}}}return this};vu.style=vu.css;vu.generateStyle=function(r){var e=new zn(r);return this.appendToStyle(e)};vu.appendToStyle=function(r){for(var e=0;e<this.length;e++){var t=this[e],n=t.selector,i=t.properties;r.selector(n);for(var a=0;a<i.length;a++){var s=i[a];r.css(s.name,s.value)}}return r};var cq="3.33.2",tl=function(e){if(e===void 0&&(e={}),Zt(e))return new rd(e);if(xt(e))return b4.apply(b4,arguments)};tl.use=function(r){var e=Array.prototype.slice.call(arguments,1);return e.unshift(tl),r.apply(null,e),this};tl.warnings=function(r){return W9(r)};tl.version=cq;tl.stylesheet=tl.Stylesheet=Fp;var hp={exports:{}},fp={exports:{}},dp={exports:{}},hq=dp.exports,R7;function fq(){return R7||(R7=1,(function(r,e){(function(n,i){r.exports=i()})(hq,function(){return(function(t){var n={};function i(a){if(n[a])return n[a].exports;var s=n[a]={i:a,l:!1,exports:{}};return t[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=n,i.i=function(a){return a},i.d=function(a,s,o){i.o(a,s)||Object.defineProperty(a,s,{configurable:!1,enumerable:!0,get:o})},i.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(s,"a",s),s},i.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},i.p="",i(i.s=26)})([(function(t,n,i){function a(){}a.QUALITY=1,a.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,a.DEFAULT_INCREMENTAL=!1,a.DEFAULT_ANIMATION_ON_LAYOUT=!0,a.DEFAULT_ANIMATION_DURING_LAYOUT=!1,a.DEFAULT_ANIMATION_PERIOD=50,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,a.DEFAULT_GRAPH_MARGIN=15,a.NODE_DIMENSIONS_INCLUDE_LABELS=!1,a.SIMPLE_NODE_SIZE=40,a.SIMPLE_NODE_HALF_SIZE=a.SIMPLE_NODE_SIZE/2,a.EMPTY_COMPOUND_NODE_SIZE=40,a.MIN_EDGE_LENGTH=1,a.WORLD_BOUNDARY=1e6,a.INITIAL_WORLD_BOUNDARY=a.WORLD_BOUNDARY/1e3,a.WORLD_CENTER_X=1200,a.WORLD_CENTER_Y=900,t.exports=a}),(function(t,n,i){var a=i(2),s=i(8),o=i(9);function l(h,d,v){a.call(this,v),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=v,this.bendpoints=[],this.source=h,this.target=d}l.prototype=Object.create(a.prototype);for(var c in a)l[c]=a[c];l.prototype.getSource=function(){return this.source},l.prototype.getTarget=function(){return this.target},l.prototype.isInterGraph=function(){return this.isInterGraph},l.prototype.getLength=function(){return this.length},l.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},l.prototype.getBendpoints=function(){return this.bendpoints},l.prototype.getLca=function(){return this.lca},l.prototype.getSourceInLca=function(){return this.sourceInLca},l.prototype.getTargetInLca=function(){return this.targetInLca},l.prototype.getOtherEnd=function(h){if(this.source===h)return this.target;if(this.target===h)return this.source;throw"Node is not incident with this edge"},l.prototype.getOtherEndInGraph=function(h,d){for(var v=this.getOtherEnd(h),g=d.getGraphManager().getRoot();;){if(v.getOwner()==d)return v;if(v.getOwner()==g)break;v=v.getOwner().getParent()}return null},l.prototype.updateLength=function(){var h=new Array(4);this.isOverlapingSourceAndTarget=s.getIntersection(this.target.getRect(),this.source.getRect(),h),this.isOverlapingSourceAndTarget||(this.lengthX=h[0]-h[2],this.lengthY=h[1]-h[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},l.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=l}),(function(t,n,i){function a(s){this.vGraphObject=s}t.exports=a}),(function(t,n,i){var a=i(2),s=i(10),o=i(13),l=i(0),c=i(16),h=i(4);function d(g,m,x,y){x==null&&y==null&&(y=m),a.call(this,y),g.graphManager!=null&&(g=g.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=y,this.edges=[],this.graphManager=g,x!=null&&m!=null?this.rect=new o(m.x,m.y,x.width,x.height):this.rect=new o}d.prototype=Object.create(a.prototype);for(var v in a)d[v]=a[v];d.prototype.getEdges=function(){return this.edges},d.prototype.getChild=function(){return this.child},d.prototype.getOwner=function(){return this.owner},d.prototype.getWidth=function(){return this.rect.width},d.prototype.setWidth=function(g){this.rect.width=g},d.prototype.getHeight=function(){return this.rect.height},d.prototype.setHeight=function(g){this.rect.height=g},d.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},d.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},d.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},d.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)},d.prototype.getRect=function(){return this.rect},d.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},d.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},d.prototype.setRect=function(g,m){this.rect.x=g.x,this.rect.y=g.y,this.rect.width=m.width,this.rect.height=m.height},d.prototype.setCenter=function(g,m){this.rect.x=g-this.rect.width/2,this.rect.y=m-this.rect.height/2},d.prototype.setLocation=function(g,m){this.rect.x=g,this.rect.y=m},d.prototype.moveBy=function(g,m){this.rect.x+=g,this.rect.y+=m},d.prototype.getEdgeListToNode=function(g){var m=[],x=this;return x.edges.forEach(function(y){if(y.target==g){if(y.source!=x)throw"Incorrect edge source!";m.push(y)}}),m},d.prototype.getEdgesBetween=function(g){var m=[],x=this;return x.edges.forEach(function(y){if(!(y.source==x||y.target==x))throw"Incorrect edge source and/or target";(y.target==g||y.source==g)&&m.push(y)}),m},d.prototype.getNeighborsList=function(){var g=new Set,m=this;return m.edges.forEach(function(x){if(x.source==m)g.add(x.target);else{if(x.target!=m)throw"Incorrect incidency!";g.add(x.source)}}),g},d.prototype.withChildren=function(){var g=new Set,m,x;if(g.add(this),this.child!=null)for(var y=this.child.getNodes(),_=0;_<y.length;_++)m=y[_],x=m.withChildren(),x.forEach(function(w){g.add(w)});return g},d.prototype.getNoOfChildren=function(){var g=0,m;if(this.child==null)g=1;else for(var x=this.child.getNodes(),y=0;y<x.length;y++)m=x[y],g+=m.getNoOfChildren();return g==0&&(g=1),g},d.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},d.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},d.prototype.scatter=function(){var g,m,x=-l.INITIAL_WORLD_BOUNDARY,y=l.INITIAL_WORLD_BOUNDARY;g=l.WORLD_CENTER_X+c.nextDouble()*(y-x)+x;var _=-l.INITIAL_WORLD_BOUNDARY,w=l.INITIAL_WORLD_BOUNDARY;m=l.WORLD_CENTER_Y+c.nextDouble()*(w-_)+_,this.rect.x=g,this.rect.y=m},d.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var g=this.getChild();if(g.updateBounds(!0),this.rect.x=g.getLeft(),this.rect.y=g.getTop(),this.setWidth(g.getRight()-g.getLeft()),this.setHeight(g.getBottom()-g.getTop()),l.NODE_DIMENSIONS_INCLUDE_LABELS){var m=g.getRight()-g.getLeft(),x=g.getBottom()-g.getTop();this.labelWidth>m&&(this.rect.x-=(this.labelWidth-m)/2,this.setWidth(this.labelWidth)),this.labelHeight>x&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-x)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-x),this.setHeight(this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(g){var m=this.rect.x;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var x=this.rect.y;x>l.WORLD_BOUNDARY?x=l.WORLD_BOUNDARY:x<-l.WORLD_BOUNDARY&&(x=-l.WORLD_BOUNDARY);var y=new h(m,x),_=g.inverseTransformPoint(y);this.setLocation(_.x,_.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},t.exports=d}),(function(t,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},t.exports=a}),(function(t,n,i){var a=i(2),s=i(10),o=i(0),l=i(6),c=i(3),h=i(1),d=i(13),v=i(12),g=i(11);function m(y,_,w){a.call(this,w),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,_!=null&&_ instanceof l?this.graphManager=_:_!=null&&_ instanceof Layout&&(this.graphManager=_.graphManager)}m.prototype=Object.create(a.prototype);for(var x in a)m[x]=a[x];m.prototype.getNodes=function(){return this.nodes},m.prototype.getEdges=function(){return this.edges},m.prototype.getGraphManager=function(){return this.graphManager},m.prototype.getParent=function(){return this.parent},m.prototype.getLeft=function(){return this.left},m.prototype.getRight=function(){return this.right},m.prototype.getTop=function(){return this.top},m.prototype.getBottom=function(){return this.bottom},m.prototype.isConnected=function(){return this.isConnected},m.prototype.add=function(y,_,w){if(_==null&&w==null){var S=y;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(S)>-1)throw"Node already in graph!";return S.owner=this,this.getNodes().push(S),S}else{var A=y;if(!(this.getNodes().indexOf(_)>-1&&this.getNodes().indexOf(w)>-1))throw"Source or target not in graph!";if(!(_.owner==w.owner&&_.owner==this))throw"Both owners must be this graph!";return _.owner!=w.owner?null:(A.source=_,A.target=w,A.isInterGraph=!1,this.getEdges().push(A),_.edges.push(A),w!=_&&w.edges.push(A),A)}},m.prototype.remove=function(y){var _=y;if(y instanceof c){if(_==null)throw"Node is null!";if(!(_.owner!=null&&_.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var w=_.edges.slice(),S,A=w.length,C=0;C<A;C++)S=w[C],S.isInterGraph?this.graphManager.remove(S):S.source.owner.remove(S);var M=this.nodes.indexOf(_);if(M==-1)throw"Node not in owner node list!";this.nodes.splice(M,1)}else if(y instanceof h){var S=y;if(S==null)throw"Edge is null!";if(!(S.source!=null&&S.target!=null))throw"Source and/or target is null!";if(!(S.source.owner!=null&&S.target.owner!=null&&S.source.owner==this&&S.target.owner==this))throw"Source and/or target owner is invalid!";var E=S.source.edges.indexOf(S),O=S.target.edges.indexOf(S);if(!(E>-1&&O>-1))throw"Source and/or target doesn't know this edge!";S.source.edges.splice(E,1),S.target!=S.source&&S.target.edges.splice(O,1);var M=S.source.owner.getEdges().indexOf(S);if(M==-1)throw"Not in owner's edge list!";S.source.owner.getEdges().splice(M,1)}},m.prototype.updateLeftTop=function(){for(var y=s.MAX_VALUE,_=s.MAX_VALUE,w,S,A,C=this.getNodes(),M=C.length,E=0;E<M;E++){var O=C[E];w=O.getTop(),S=O.getLeft(),y>w&&(y=w),_>S&&(_=S)}return y==s.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?A=C[0].getParent().paddingLeft:A=this.margin,this.left=_-A,this.top=y-A,new v(this.left,this.top))},m.prototype.updateBounds=function(y){for(var _=s.MAX_VALUE,w=-s.MAX_VALUE,S=s.MAX_VALUE,A=-s.MAX_VALUE,C,M,E,O,D,I=this.nodes,k=I.length,U=0;U<k;U++){var V=I[U];y&&V.child!=null&&V.updateBounds(),C=V.getLeft(),M=V.getRight(),E=V.getTop(),O=V.getBottom(),_>C&&(_=C),w<M&&(w=M),S>E&&(S=E),A<O&&(A=O)}var X=new d(_,S,w-_,A-S);_==s.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),I[0].getParent().paddingLeft!=null?D=I[0].getParent().paddingLeft:D=this.margin,this.left=X.x-D,this.right=X.x+X.width+D,this.top=X.y-D,this.bottom=X.y+X.height+D},m.calculateBounds=function(y){for(var _=s.MAX_VALUE,w=-s.MAX_VALUE,S=s.MAX_VALUE,A=-s.MAX_VALUE,C,M,E,O,D=y.length,I=0;I<D;I++){var k=y[I];C=k.getLeft(),M=k.getRight(),E=k.getTop(),O=k.getBottom(),_>C&&(_=C),w<M&&(w=M),S>E&&(S=E),A<O&&(A=O)}var U=new d(_,S,w-_,A-S);return U},m.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},m.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},m.prototype.calcEstimatedSize=function(){for(var y=0,_=this.nodes,w=_.length,S=0;S<w;S++){var A=_[S];y+=A.calcEstimatedSize()}return y==0?this.estimatedSize=o.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=y/Math.sqrt(this.nodes.length),this.estimatedSize},m.prototype.updateConnected=function(){var y=this;if(this.nodes.length==0){this.isConnected=!0;return}var _=new g,w=new Set,S=this.nodes[0],A,C,M=S.withChildren();for(M.forEach(function(U){_.push(U),w.add(U)});_.length!==0;){S=_.shift(),A=S.getEdges();for(var E=A.length,O=0;O<E;O++){var D=A[O];if(C=D.getOtherEndInGraph(S,this),C!=null&&!w.has(C)){var I=C.withChildren();I.forEach(function(U){_.push(U),w.add(U)})}}}if(this.isConnected=!1,w.size>=this.nodes.length){var k=0;w.forEach(function(U){U.owner==y&&k++}),k==this.nodes.length&&(this.isConnected=!0)}},t.exports=m}),(function(t,n,i){var a,s=i(1);function o(l){a=i(5),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),c=this.layout.newNode(null),h=this.add(l,c);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,c,h,d,v){if(h==null&&d==null&&v==null){if(l==null)throw"Graph is null!";if(c==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(c.child!=null)throw"Already has a child!";return l.parent=c,c.child=l,l}else{v=h,d=c,h=l;var g=d.getOwner(),m=v.getOwner();if(!(g!=null&&g.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(m!=null&&m.getGraphManager()==this))throw"Target not in this graph mgr!";if(g==m)return h.isInterGraph=!1,g.add(h,d,v);if(h.isInterGraph=!0,h.source=d,h.target=v,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var c=l;if(c.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(c==this.rootGraph||c.parent!=null&&c.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(c.getEdges());for(var d,v=h.length,g=0;g<v;g++)d=h[g],c.remove(d);var m=[];m=m.concat(c.getNodes());var x;v=m.length;for(var g=0;g<v;g++)x=m[g],c.remove(x);c==this.rootGraph&&this.setRootGraph(null);var y=this.graphs.indexOf(c);this.graphs.splice(y,1),c.parent=null}else if(l instanceof s){if(d=l,d==null)throw"Edge is null!";if(!d.isInterGraph)throw"Not an inter-graph edge!";if(!(d.source!=null&&d.target!=null))throw"Source and/or target is null!";if(!(d.source.edges.indexOf(d)!=-1&&d.target.edges.indexOf(d)!=-1))throw"Source and/or target doesn't know this edge!";var y=d.source.edges.indexOf(d);if(d.source.edges.splice(y,1),y=d.target.edges.indexOf(d),d.target.edges.splice(y,1),!(d.source.owner!=null&&d.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(d.source.owner.getGraphManager().edges.indexOf(d)==-1)throw"Not in owner graph manager's edge list!";var y=d.source.owner.getGraphManager().edges.indexOf(d);d.source.owner.getGraphManager().edges.splice(y,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(this.allNodes==null){for(var l=[],c=this.getGraphs(),h=c.length,d=0;d<h;d++)l=l.concat(c[d].getNodes());this.allNodes=l}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(this.allEdges==null){var l=[],c=this.getGraphs();c.length;for(var h=0;h<c.length;h++)l=l.concat(c[h].getEdges());l=l.concat(this.edges),this.allEdges=l}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(l){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=l},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(l){if(l.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=l,l.parent==null&&(l.parent=this.layout.newNode("Root node"))},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(l,c){if(!(l!=null&&c!=null))throw"assert failed";if(l==c)return!0;var h=l.getOwner(),d;do{if(d=h.getParent(),d==null)break;if(d==c)return!0;if(h=d.getOwner(),h==null)break}while(!0);h=c.getOwner();do{if(d=h.getParent(),d==null)break;if(d==l)return!0;if(h=d.getOwner(),h==null)break}while(!0);return!1},o.prototype.calcLowestCommonAncestors=function(){for(var l,c,h,d,v,g=this.getAllEdges(),m=g.length,x=0;x<m;x++){if(l=g[x],c=l.source,h=l.target,l.lca=null,l.sourceInLca=c,l.targetInLca=h,c==h){l.lca=c.getOwner();continue}for(d=c.getOwner();l.lca==null;){for(l.targetInLca=h,v=h.getOwner();l.lca==null;){if(v==d){l.lca=v;break}if(v==this.rootGraph)break;if(l.lca!=null)throw"assert failed";l.targetInLca=v.getParent(),v=l.targetInLca.getOwner()}if(d==this.rootGraph)break;l.lca==null&&(l.sourceInLca=d.getParent(),d=l.sourceInLca.getOwner())}if(l.lca==null)throw"assert failed"}},o.prototype.calcLowestCommonAncestor=function(l,c){if(l==c)return l.getOwner();var h=l.getOwner();do{if(h==null)break;var d=c.getOwner();do{if(d==null)break;if(d==h)return d;d=d.getParent().getOwner()}while(!0);h=h.getParent().getOwner()}while(!0);return h},o.prototype.calcInclusionTreeDepths=function(l,c){l==null&&c==null&&(l=this.rootGraph,c=1);for(var h,d=l.getNodes(),v=d.length,g=0;g<v;g++)h=d[g],h.inclusionTreeDepth=c,h.child!=null&&this.calcInclusionTreeDepths(h.child,c+1)},o.prototype.includesInvalidEdge=function(){for(var l,c=this.edges.length,h=0;h<c;h++)if(l=this.edges[h],this.isOneAncestorOfOther(l.source,l.target))return!0;return!1},t.exports=o}),(function(t,n,i){var a=i(0);function s(){}for(var o in a)s[o]=a[o];s.MAX_ITERATIONS=2500,s.DEFAULT_EDGE_LENGTH=50,s.DEFAULT_SPRING_STRENGTH=.45,s.DEFAULT_REPULSION_STRENGTH=4500,s.DEFAULT_GRAVITY_STRENGTH=.4,s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,s.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,s.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,s.COOLING_ADAPTATION_FACTOR=.33,s.ADAPTATION_LOWER_NODE_LIMIT=1e3,s.ADAPTATION_UPPER_NODE_LIMIT=5e3,s.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,s.MAX_NODE_DISPLACEMENT=s.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,s.MIN_REPULSION_DIST=s.DEFAULT_EDGE_LENGTH/10,s.CONVERGENCE_CHECK_PERIOD=100,s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,s.MIN_EDGE_LENGTH=1,s.GRID_CALCULATION_CHECK_PERIOD=10,t.exports=s}),(function(t,n,i){var a=i(12);function s(){}s.calcSeparationAmount=function(o,l,c,h){if(!o.intersects(l))throw"assert failed";var d=new Array(2);this.decideDirectionsForOverlappingNodes(o,l,d),c[0]=Math.min(o.getRight(),l.getRight())-Math.max(o.x,l.x),c[1]=Math.min(o.getBottom(),l.getBottom())-Math.max(o.y,l.y),o.getX()<=l.getX()&&o.getRight()>=l.getRight()?c[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(c[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?c[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(c[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var v=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(v=1);var g=v*c[0],m=c[1]/v;c[0]<m?m=c[0]:g=c[1],c[0]=-1*d[0]*(m/2+h),c[1]=-1*d[1]*(g/2+h)},s.decideDirectionsForOverlappingNodes=function(o,l,c){o.getCenterX()<l.getCenterX()?c[0]=-1:c[0]=1,o.getCenterY()<l.getCenterY()?c[1]=-1:c[1]=1},s.getIntersection2=function(o,l,c){var h=o.getCenterX(),d=o.getCenterY(),v=l.getCenterX(),g=l.getCenterY();if(o.intersects(l))return c[0]=h,c[1]=d,c[2]=v,c[3]=g,!0;var m=o.getX(),x=o.getY(),y=o.getRight(),_=o.getX(),w=o.getBottom(),S=o.getRight(),A=o.getWidthHalf(),C=o.getHeightHalf(),M=l.getX(),E=l.getY(),O=l.getRight(),D=l.getX(),I=l.getBottom(),k=l.getRight(),U=l.getWidthHalf(),V=l.getHeightHalf(),X=!1,W=!1;if(h===v){if(d>g)return c[0]=h,c[1]=x,c[2]=v,c[3]=I,!1;if(d<g)return c[0]=h,c[1]=w,c[2]=v,c[3]=E,!1}else if(d===g){if(h>v)return c[0]=m,c[1]=d,c[2]=O,c[3]=g,!1;if(h<v)return c[0]=y,c[1]=d,c[2]=M,c[3]=g,!1}else{var P=o.height/o.width,H=l.height/l.width,z=(g-d)/(v-h),$=void 0,B=void 0,L=void 0,Y=void 0,G=void 0,re=void 0;if(-P===z?h>v?(c[0]=_,c[1]=w,X=!0):(c[0]=y,c[1]=x,X=!0):P===z&&(h>v?(c[0]=m,c[1]=x,X=!0):(c[0]=S,c[1]=w,X=!0)),-H===z?v>h?(c[2]=D,c[3]=I,W=!0):(c[2]=O,c[3]=E,W=!0):H===z&&(v>h?(c[2]=M,c[3]=E,W=!0):(c[2]=k,c[3]=I,W=!0)),X&&W)return!1;if(h>v?d>g?($=this.getCardinalDirection(P,z,4),B=this.getCardinalDirection(H,z,2)):($=this.getCardinalDirection(-P,z,3),B=this.getCardinalDirection(-H,z,1)):d>g?($=this.getCardinalDirection(-P,z,1),B=this.getCardinalDirection(-H,z,3)):($=this.getCardinalDirection(P,z,2),B=this.getCardinalDirection(H,z,4)),!X)switch($){case 1:Y=x,L=h+-C/z,c[0]=L,c[1]=Y;break;case 2:L=S,Y=d+A*z,c[0]=L,c[1]=Y;break;case 3:Y=w,L=h+C/z,c[0]=L,c[1]=Y;break;case 4:L=_,Y=d+-A*z,c[0]=L,c[1]=Y;break}if(!W)switch(B){case 1:re=E,G=v+-V/z,c[2]=G,c[3]=re;break;case 2:G=k,re=g+U*z,c[2]=G,c[3]=re;break;case 3:re=I,G=v+V/z,c[2]=G,c[3]=re;break;case 4:G=D,re=g+-U*z,c[2]=G,c[3]=re;break}}return!1},s.getCardinalDirection=function(o,l,c){return o>l?c:1+c%4},s.getIntersection=function(o,l,c,h){if(h==null)return this.getIntersection2(o,l,c);var d=o.x,v=o.y,g=l.x,m=l.y,x=c.x,y=c.y,_=h.x,w=h.y,S=void 0,A=void 0,C=void 0,M=void 0,E=void 0,O=void 0,D=void 0,I=void 0,k=void 0;return C=m-v,E=d-g,D=g*v-d*m,M=w-y,O=x-_,I=_*y-x*w,k=C*O-M*E,k===0?null:(S=(E*I-O*D)/k,A=(M*D-C*I)/k,new a(S,A))},s.angleOfVector=function(o,l,c,h){var d=void 0;return o!==c?(d=Math.atan((h-l)/(c-o)),c<o?d+=Math.PI:h<l&&(d+=this.TWO_PI)):h<l?d=this.ONE_AND_HALF_PI:d=this.HALF_PI,d},s.doIntersect=function(o,l,c,h){var d=o.x,v=o.y,g=l.x,m=l.y,x=c.x,y=c.y,_=h.x,w=h.y,S=(g-d)*(w-y)-(_-x)*(m-v);if(S===0)return!1;var A=((w-y)*(_-d)+(x-_)*(w-v))/S,C=((v-m)*(_-d)+(g-d)*(w-v))/S;return 0<A&&A<1&&0<C&&C<1},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,t.exports=s}),(function(t,n,i){function a(){}a.sign=function(s){return s>0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},t.exports=a}),(function(t,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,t.exports=a}),(function(t,n,i){var a=(function(){function d(v,g){for(var m=0;m<g.length;m++){var x=g[m];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(v,x.key,x)}}return function(v,g,m){return g&&d(v.prototype,g),m&&d(v,m),v}})();function s(d,v){if(!(d instanceof v))throw new TypeError("Cannot call a class as a function")}var o=function(v){return{value:v,next:null,prev:null}},l=function(v,g,m,x){return v!==null?v.next=g:x.head=g,m!==null?m.prev=g:x.tail=g,g.prev=v,g.next=m,x.length++,g},c=function(v,g){var m=v.prev,x=v.next;return m!==null?m.next=x:g.head=x,x!==null?x.prev=m:g.tail=m,v.prev=v.next=null,g.length--,v},h=(function(){function d(v){var g=this;s(this,d),this.length=0,this.head=null,this.tail=null,v!=null&&v.forEach(function(m){return g.push(m)})}return a(d,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(g,m){return l(m.prev,o(g),m,this)}},{key:"insertAfter",value:function(g,m){return l(m,o(g),m.next,this)}},{key:"insertNodeBefore",value:function(g,m){return l(m.prev,g,m,this)}},{key:"insertNodeAfter",value:function(g,m){return l(m,g,m.next,this)}},{key:"push",value:function(g){return l(this.tail,o(g),null,this)}},{key:"unshift",value:function(g){return l(null,o(g),this.head,this)}},{key:"remove",value:function(g){return c(g,this)}},{key:"pop",value:function(){return c(this.tail,this).value}},{key:"popNode",value:function(){return c(this.tail,this)}},{key:"shift",value:function(){return c(this.head,this).value}},{key:"shiftNode",value:function(){return c(this.head,this)}},{key:"get_object_at",value:function(g){if(g<=this.length()){for(var m=1,x=this.head;m<g;)x=x.next,m++;return x.value}}},{key:"set_object_at",value:function(g,m){if(g<=this.length()){for(var x=1,y=this.head;x<g;)y=y.next,x++;y.value=m}}}]),d})();t.exports=h}),(function(t,n,i){function a(s,o,l){this.x=null,this.y=null,s==null&&o==null&&l==null?(this.x=0,this.y=0):typeof s=="number"&&typeof o=="number"&&l==null?(this.x=s,this.y=o):s.constructor.name=="Point"&&o==null&&l==null&&(l=s,this.x=l.x,this.y=l.y)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.getLocation=function(){return new a(this.x,this.y)},a.prototype.setLocation=function(s,o,l){s.constructor.name=="Point"&&o==null&&l==null?(l=s,this.setLocation(l.x,l.y)):typeof s=="number"&&typeof o=="number"&&l==null&&(parseInt(s)==s&&parseInt(o)==o?this.move(s,o):(this.x=Math.floor(s+.5),this.y=Math.floor(o+.5)))},a.prototype.move=function(s,o){this.x=s,this.y=o},a.prototype.translate=function(s,o){this.x+=s,this.y+=o},a.prototype.equals=function(s){if(s.constructor.name=="Point"){var o=s;return this.x==o.x&&this.y==o.y}return this==s},a.prototype.toString=function(){return new a().constructor.name+"[x="+this.x+",y="+this.y+"]"},t.exports=a}),(function(t,n,i){function a(s,o,l,c){this.x=0,this.y=0,this.width=0,this.height=0,s!=null&&o!=null&&l!=null&&c!=null&&(this.x=s,this.y=o,this.width=l,this.height=c)}a.prototype.getX=function(){return this.x},a.prototype.setX=function(s){this.x=s},a.prototype.getY=function(){return this.y},a.prototype.setY=function(s){this.y=s},a.prototype.getWidth=function(){return this.width},a.prototype.setWidth=function(s){this.width=s},a.prototype.getHeight=function(){return this.height},a.prototype.setHeight=function(s){this.height=s},a.prototype.getRight=function(){return this.x+this.width},a.prototype.getBottom=function(){return this.y+this.height},a.prototype.intersects=function(s){return!(this.getRight()<s.x||this.getBottom()<s.y||s.getRight()<this.x||s.getBottom()<this.y)},a.prototype.getCenterX=function(){return this.x+this.width/2},a.prototype.getMinX=function(){return this.getX()},a.prototype.getMaxX=function(){return this.getX()+this.width},a.prototype.getCenterY=function(){return this.y+this.height/2},a.prototype.getMinY=function(){return this.getY()},a.prototype.getMaxY=function(){return this.getY()+this.height},a.prototype.getWidthHalf=function(){return this.width/2},a.prototype.getHeightHalf=function(){return this.height/2},t.exports=a}),(function(t,n,i){var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function s(){}s.lastID=0,s.createID=function(o){return s.isPrimitive(o)?o:(o.uniqueID!=null||(o.uniqueID=s.getString(),s.lastID++),o.uniqueID)},s.getString=function(o){return o==null&&(o=s.lastID),"Object#"+o},s.isPrimitive=function(o){var l=typeof o>"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},t.exports=s}),(function(t,n,i){function a(x){if(Array.isArray(x)){for(var y=0,_=Array(x.length);y<x.length;y++)_[y]=x[y];return _}else return Array.from(x)}var s=i(0),o=i(6),l=i(3),c=i(1),h=i(5),d=i(4),v=i(17),g=i(27);function m(x){g.call(this),this.layoutQuality=s.QUALITY,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=s.DEFAULT_INCREMENTAL,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,x!=null&&(this.isRemoteUse=x)}m.RANDOM_SEED=1,m.prototype=Object.create(g.prototype),m.prototype.getGraphManager=function(){return this.graphManager},m.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},m.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},m.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},m.prototype.newGraphManager=function(){var x=new o(this);return this.graphManager=x,x},m.prototype.newGraph=function(x){return new h(null,this.graphManager,x)},m.prototype.newNode=function(x){return new l(this.graphManager,x)},m.prototype.newEdge=function(x){return new c(null,null,x)},m.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},m.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var x;return this.checkLayoutSuccess()?x=!1:x=this.layout(),s.ANIMATE==="during"?!1:(x&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,x)},m.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},m.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var x=this.graphManager.getAllEdges(),y=0;y<x.length;y++)x[y];for(var _=this.graphManager.getRoot().getNodes(),y=0;y<_.length;y++)_[y];this.update(this.graphManager.getRoot())}},m.prototype.update=function(x){if(x==null)this.update2();else if(x instanceof l){var y=x;if(y.getChild()!=null)for(var _=y.getChild().getNodes(),w=0;w<_.length;w++)update(_[w]);if(y.vGraphObject!=null){var S=y.vGraphObject;S.update(y)}}else if(x instanceof c){var A=x;if(A.vGraphObject!=null){var C=A.vGraphObject;C.update(A)}}else if(x instanceof h){var M=x;if(M.vGraphObject!=null){var E=M.vGraphObject;E.update(M)}}},m.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=s.QUALITY,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=s.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},m.prototype.transform=function(x){if(x==null)this.transform(new d(0,0));else{var y=new v,_=this.graphManager.getRoot().updateLeftTop();if(_!=null){y.setWorldOrgX(x.x),y.setWorldOrgY(x.y),y.setDeviceOrgX(_.x),y.setDeviceOrgY(_.y);for(var w=this.getAllNodes(),S,A=0;A<w.length;A++)S=w[A],S.transform(y)}}},m.prototype.positionNodesRandomly=function(x){if(x==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var y,_,w=x.getNodes(),S=0;S<w.length;S++)y=w[S],_=y.getChild(),_==null||_.getNodes().length==0?y.scatter():(this.positionNodesRandomly(_),y.updateBounds())},m.prototype.getFlatForest=function(){for(var x=[],y=!0,_=this.graphManager.getRoot().getNodes(),w=!0,S=0;S<_.length;S++)_[S].getChild()!=null&&(w=!1);if(!w)return x;var A=new Set,C=[],M=new Map,E=[];for(E=E.concat(_);E.length>0&&y;){for(C.push(E[0]);C.length>0&&y;){var O=C[0];C.splice(0,1),A.add(O);for(var D=O.getEdges(),S=0;S<D.length;S++){var I=D[S].getOtherEnd(O);if(M.get(O)!=I)if(!A.has(I))C.push(I),M.set(I,O);else{y=!1;break}}}if(!y)x=[];else{var k=[].concat(a(A));x.push(k);for(var S=0;S<k.length;S++){var U=k[S],V=E.indexOf(U);V>-1&&E.splice(V,1)}A=new Set,M=new Map}}return x},m.prototype.createDummyNodesForBendpoints=function(x){for(var y=[],_=x.source,w=this.graphManager.calcLowestCommonAncestor(x.source,x.target),S=0;S<x.bendpoints.length;S++){var A=this.newNode(null);A.setRect(new Point(0,0),new Dimension(1,1)),w.add(A);var C=this.newEdge(null);this.graphManager.add(C,_,A),y.add(A),_=A}var C=this.newEdge(null);return this.graphManager.add(C,_,x.target),this.edgeToDummyNodes.set(x,y),x.isInterGraph()?this.graphManager.remove(x):w.remove(x),y},m.prototype.createBendpointsFromDummyNodes=function(){var x=[];x=x.concat(this.graphManager.getAllEdges()),x=[].concat(a(this.edgeToDummyNodes.keys())).concat(x);for(var y=0;y<x.length;y++){var _=x[y];if(_.bendpoints.length>0){for(var w=this.edgeToDummyNodes.get(_),S=0;S<w.length;S++){var A=w[S],C=new d(A.getCenterX(),A.getCenterY()),M=_.bendpoints.get(S);M.x=C.x,M.y=C.y,A.getOwner().remove(A)}this.graphManager.add(_,_.source,_.target)}}},m.transform=function(x,y,_,w){if(_!=null&&w!=null){var S=y;if(x<=50){var A=y/_;S-=(y-A)/50*(50-x)}else{var C=y*w;S+=(C-y)/50*(x-50)}return S}else{var M,E;return x<=50?(M=9*y/500,E=y/10):(M=9*y/50,E=-8*y),M*x+E}},m.findCenterOfTree=function(x){var y=[];y=y.concat(x);var _=[],w=new Map,S=!1,A=null;(y.length==1||y.length==2)&&(S=!0,A=y[0]);for(var C=0;C<y.length;C++){var M=y[C],E=M.getNeighborsList().size;w.set(M,M.getNeighborsList().size),E==1&&_.push(M)}var O=[];for(O=O.concat(_);!S;){var D=[];D=D.concat(O),O=[];for(var C=0;C<y.length;C++){var M=y[C],I=y.indexOf(M);I>=0&&y.splice(I,1);var k=M.getNeighborsList();k.forEach(function(X){if(_.indexOf(X)<0){var W=w.get(X),P=W-1;P==1&&O.push(X),w.set(X,P)}})}_=_.concat(O),(y.length==1||y.length==2)&&(S=!0,A=y[0])}return A},m.prototype.setGraphManager=function(x){this.graphManager=x},t.exports=m}),(function(t,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},t.exports=a}),(function(t,n,i){var a=i(4);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,c=this.lworldExtX;return c!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/c),l},s.prototype.transformY=function(o){var l=0,c=this.lworldExtY;return c!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/c),l},s.prototype.inverseTransformX=function(o){var l=0,c=this.ldeviceExtX;return c!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/c),l},s.prototype.inverseTransformY=function(o){var l=0,c=this.ldeviceExtY;return c!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/c),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},t.exports=s}),(function(t,n,i){function a(g){if(Array.isArray(g)){for(var m=0,x=Array(g.length);m<g.length;m++)x[m]=g[m];return x}else return Array.from(g)}var s=i(15),o=i(7),l=i(0),c=i(8),h=i(9);function d(){s.call(this),this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.springConstant=o.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=o.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=o.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=o.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=o.MAX_ITERATIONS}d.prototype=Object.create(s.prototype);for(var v in s)d[v]=s[v];d.prototype.initParameters=function(){s.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},d.prototype.calcIdealEdgeLengths=function(){for(var g,m,x,y,_,w,S=this.getGraphManager().getAllEdges(),A=0;A<S.length;A++)g=S[A],g.idealLength=this.idealEdgeLength,g.isInterGraph&&(x=g.getSource(),y=g.getTarget(),_=g.getSourceInLca().getEstimatedSize(),w=g.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(g.idealLength+=_+w-2*l.SIMPLE_NODE_SIZE),m=g.getLca().getInclusionTreeDepth(),g.idealLength+=o.DEFAULT_EDGE_LENGTH*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(x.getInclusionTreeDepth()+y.getInclusionTreeDepth()-2*m))},d.prototype.initSpringEmbedder=function(){var g=this.getAllNodes().length;this.incremental?(g>o.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(g-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(g>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(g-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var g=this.getAllEdges(),m,x=0;x<g.length;x++)m=g[x],this.calcSpringForce(m,m.idealLength)},d.prototype.calcRepulsionForces=function(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,x,y,_,w,S=this.getAllNodes(),A;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&g&&this.updateGrid(),A=new Set,x=0;x<S.length;x++)_=S[x],this.calculateRepulsionForceOfANode(_,A,g,m),A.add(_);else for(x=0;x<S.length;x++)for(_=S[x],y=x+1;y<S.length;y++)w=S[y],_.getOwner()==w.getOwner()&&this.calcRepulsionForce(_,w)},d.prototype.calcGravitationalForces=function(){for(var g,m=this.getAllNodesToApplyGravitation(),x=0;x<m.length;x++)g=m[x],this.calcGravitationalForce(g)},d.prototype.moveNodes=function(){for(var g=this.getAllNodes(),m,x=0;x<g.length;x++)m=g[x],m.move()},d.prototype.calcSpringForce=function(g,m){var x=g.getSource(),y=g.getTarget(),_,w,S,A;if(this.uniformLeafNodeSizes&&x.getChild()==null&&y.getChild()==null)g.updateLengthSimple();else if(g.updateLength(),g.isOverlapingSourceAndTarget)return;_=g.getLength(),_!=0&&(w=this.springConstant*(_-m),S=w*(g.lengthX/_),A=w*(g.lengthY/_),x.springForceX+=S,x.springForceY+=A,y.springForceX-=S,y.springForceY-=A)},d.prototype.calcRepulsionForce=function(g,m){var x=g.getRect(),y=m.getRect(),_=new Array(2),w=new Array(4),S,A,C,M,E,O,D;if(x.intersects(y)){c.calcSeparationAmount(x,y,_,o.DEFAULT_EDGE_LENGTH/2),O=2*_[0],D=2*_[1];var I=g.noOfChildren*m.noOfChildren/(g.noOfChildren+m.noOfChildren);g.repulsionForceX-=I*O,g.repulsionForceY-=I*D,m.repulsionForceX+=I*O,m.repulsionForceY+=I*D}else this.uniformLeafNodeSizes&&g.getChild()==null&&m.getChild()==null?(S=y.getCenterX()-x.getCenterX(),A=y.getCenterY()-x.getCenterY()):(c.getIntersection(x,y,w),S=w[2]-w[0],A=w[3]-w[1]),Math.abs(S)<o.MIN_REPULSION_DIST&&(S=h.sign(S)*o.MIN_REPULSION_DIST),Math.abs(A)<o.MIN_REPULSION_DIST&&(A=h.sign(A)*o.MIN_REPULSION_DIST),C=S*S+A*A,M=Math.sqrt(C),E=this.repulsionConstant*g.noOfChildren*m.noOfChildren/C,O=E*S/M,D=E*A/M,g.repulsionForceX-=O,g.repulsionForceY-=D,m.repulsionForceX+=O,m.repulsionForceY+=D},d.prototype.calcGravitationalForce=function(g){var m,x,y,_,w,S,A,C;m=g.getOwner(),x=(m.getRight()+m.getLeft())/2,y=(m.getTop()+m.getBottom())/2,_=g.getCenterX()-x,w=g.getCenterY()-y,S=Math.abs(_)+g.getWidth()/2,A=Math.abs(w)+g.getHeight()/2,g.getOwner()==this.graphManager.getRoot()?(C=m.getEstimatedSize()*this.gravityRangeFactor,(S>C||A>C)&&(g.gravitationForceX=-this.gravityConstant*_,g.gravitationForceY=-this.gravityConstant*w)):(C=m.getEstimatedSize()*this.compoundGravityRangeFactor,(S>C||A>C)&&(g.gravitationForceX=-this.gravityConstant*_*this.compoundGravityConstant,g.gravitationForceY=-this.gravityConstant*w*this.compoundGravityConstant))},d.prototype.isConverged=function(){var g,m=!1;return this.totalIterations>this.maxIterations/3&&(m=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),g=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,g||m},d.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},d.prototype.calcNoOfChildrenForAllNodes=function(){for(var g,m=this.graphManager.getAllNodes(),x=0;x<m.length;x++)g=m[x],g.noOfChildren=g.getNoOfChildren()},d.prototype.calcGrid=function(g){var m=0,x=0;m=parseInt(Math.ceil((g.getRight()-g.getLeft())/this.repulsionRange)),x=parseInt(Math.ceil((g.getBottom()-g.getTop())/this.repulsionRange));for(var y=new Array(m),_=0;_<m;_++)y[_]=new Array(x);for(var _=0;_<m;_++)for(var w=0;w<x;w++)y[_][w]=new Array;return y},d.prototype.addNodeToGrid=function(g,m,x){var y=0,_=0,w=0,S=0;y=parseInt(Math.floor((g.getRect().x-m)/this.repulsionRange)),_=parseInt(Math.floor((g.getRect().width+g.getRect().x-m)/this.repulsionRange)),w=parseInt(Math.floor((g.getRect().y-x)/this.repulsionRange)),S=parseInt(Math.floor((g.getRect().height+g.getRect().y-x)/this.repulsionRange));for(var A=y;A<=_;A++)for(var C=w;C<=S;C++)this.grid[A][C].push(g),g.setGridCoordinates(y,_,w,S)},d.prototype.updateGrid=function(){var g,m,x=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),g=0;g<x.length;g++)m=x[g],this.addNodeToGrid(m,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},d.prototype.calculateRepulsionForceOfANode=function(g,m,x,y){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&x||y){var _=new Set;g.surrounding=new Array;for(var w,S=this.grid,A=g.startX-1;A<g.finishX+2;A++)for(var C=g.startY-1;C<g.finishY+2;C++)if(!(A<0||C<0||A>=S.length||C>=S[0].length)){for(var M=0;M<S[A][C].length;M++)if(w=S[A][C][M],!(g.getOwner()!=w.getOwner()||g==w)&&!m.has(w)&&!_.has(w)){var E=Math.abs(g.getCenterX()-w.getCenterX())-(g.getWidth()/2+w.getWidth()/2),O=Math.abs(g.getCenterY()-w.getCenterY())-(g.getHeight()/2+w.getHeight()/2);E<=this.repulsionRange&&O<=this.repulsionRange&&_.add(w)}}g.surrounding=[].concat(a(_))}for(A=0;A<g.surrounding.length;A++)this.calcRepulsionForce(g,g.surrounding[A])},d.prototype.calcRepulsionRange=function(){return 0},t.exports=d}),(function(t,n,i){var a=i(1),s=i(7);function o(c,h,d){a.call(this,c,h,d),this.idealLength=s.DEFAULT_EDGE_LENGTH}o.prototype=Object.create(a.prototype);for(var l in a)o[l]=a[l];t.exports=o}),(function(t,n,i){var a=i(3);function s(l,c,h,d){a.call(this,l,c,h,d),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}s.prototype=Object.create(a.prototype);for(var o in a)s[o]=a[o];s.prototype.setGridCoordinates=function(l,c,h,d){this.startX=l,this.finishX=c,this.startY=h,this.finishY=d},t.exports=s}),(function(t,n,i){function a(s,o){this.width=0,this.height=0,s!==null&&o!==null&&(this.height=o,this.width=s)}a.prototype.getWidth=function(){return this.width},a.prototype.setWidth=function(s){this.width=s},a.prototype.getHeight=function(){return this.height},a.prototype.setHeight=function(s){this.height=s},t.exports=a}),(function(t,n,i){var a=i(14);function s(){this.map={},this.keys=[]}s.prototype.put=function(o,l){var c=a.createID(o);this.contains(c)||(this.map[c]=l,this.keys.push(o))},s.prototype.contains=function(o){return a.createID(o),this.map[o]!=null},s.prototype.get=function(o){var l=a.createID(o);return this.map[l]},s.prototype.keySet=function(){return this.keys},t.exports=s}),(function(t,n,i){var a=i(14);function s(){this.set={}}s.prototype.add=function(o){var l=a.createID(o);this.contains(l)||(this.set[l]=o)},s.prototype.remove=function(o){delete this.set[a.createID(o)]},s.prototype.clear=function(){this.set={}},s.prototype.contains=function(o){return this.set[a.createID(o)]==o},s.prototype.isEmpty=function(){return this.size()===0},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAllTo=function(o){for(var l=Object.keys(this.set),c=l.length,h=0;h<c;h++)o.push(this.set[l[h]])},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAll=function(o){for(var l=o.length,c=0;c<l;c++){var h=o[c];this.add(h)}},t.exports=s}),(function(t,n,i){var a=(function(){function c(h,d){for(var v=0;v<d.length;v++){var g=d[v];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(h,g.key,g)}}return function(h,d,v){return d&&c(h.prototype,d),v&&c(h,v),h}})();function s(c,h){if(!(c instanceof h))throw new TypeError("Cannot call a class as a function")}var o=i(11),l=(function(){function c(h,d){s(this,c),(d!==null||d!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var v=void 0;h instanceof o?v=h.size():v=h.length,this._quicksort(h,0,v-1)}return a(c,[{key:"_quicksort",value:function(d,v,g){if(v<g){var m=this._partition(d,v,g);this._quicksort(d,v,m),this._quicksort(d,m+1,g)}}},{key:"_partition",value:function(d,v,g){for(var m=this._get(d,v),x=v,y=g;;){for(;this.compareFunction(m,this._get(d,y));)y--;for(;this.compareFunction(this._get(d,x),m);)x++;if(x<y)this._swap(d,x,y),x++,y--;else return y}}},{key:"_get",value:function(d,v){return d instanceof o?d.get_object_at(v):d[v]}},{key:"_set",value:function(d,v,g){d instanceof o?d.set_object_at(v,g):d[v]=g}},{key:"_swap",value:function(d,v,g){var m=this._get(d,v);this._set(d,v,this._get(d,g)),this._set(d,g,m)}},{key:"_defaultCompareFunction",value:function(d,v){return v>d}}]),c})();t.exports=l}),(function(t,n,i){var a=(function(){function l(c,h){for(var d=0;d<h.length;d++){var v=h[d];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(c,v.key,v)}}return function(c,h,d){return h&&l(c.prototype,h),d&&l(c,d),c}})();function s(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}var o=(function(){function l(c,h){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,v=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,g=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=c,this.sequence2=h,this.match_score=d,this.mismatch_penalty=v,this.gap_penalty=g,this.iMax=c.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var m=0;m<this.iMax;m++){this.grid[m]=new Array(this.jMax);for(var x=0;x<this.jMax;x++)this.grid[m][x]=0}this.tracebackGrid=new Array(this.iMax);for(var y=0;y<this.iMax;y++){this.tracebackGrid[y]=new Array(this.jMax);for(var _=0;_<this.jMax;_++)this.tracebackGrid[y][_]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return a(l,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var h=1;h<this.jMax;h++)this.grid[0][h]=this.grid[0][h-1]+this.gap_penalty,this.tracebackGrid[0][h]=[!1,!1,!0];for(var d=1;d<this.iMax;d++)this.grid[d][0]=this.grid[d-1][0]+this.gap_penalty,this.tracebackGrid[d][0]=[!1,!0,!1];for(var v=1;v<this.iMax;v++)for(var g=1;g<this.jMax;g++){var m=void 0;this.sequence1[v-1]===this.sequence2[g-1]?m=this.grid[v-1][g-1]+this.match_score:m=this.grid[v-1][g-1]+this.mismatch_penalty;var x=this.grid[v-1][g]+this.gap_penalty,y=this.grid[v][g-1]+this.gap_penalty,_=[m,x,y],w=this.arrayAllMaxIndexes(_);this.grid[v][g]=_[w[0]],this.tracebackGrid[v][g]=[w.includes(0),w.includes(1),w.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var h=[];for(h.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});h[0];){var d=h[0],v=this.tracebackGrid[d.pos[0]][d.pos[1]];v[0]&&h.push({pos:[d.pos[0]-1,d.pos[1]-1],seq1:this.sequence1[d.pos[0]-1]+d.seq1,seq2:this.sequence2[d.pos[1]-1]+d.seq2}),v[1]&&h.push({pos:[d.pos[0]-1,d.pos[1]],seq1:this.sequence1[d.pos[0]-1]+d.seq1,seq2:"-"+d.seq2}),v[2]&&h.push({pos:[d.pos[0],d.pos[1]-1],seq1:"-"+d.seq1,seq2:this.sequence2[d.pos[1]-1]+d.seq2}),d.pos[0]===0&&d.pos[1]===0&&this.alignments.push({sequence1:d.seq1,sequence2:d.seq2}),h.shift()}return this.alignments}},{key:"getAllIndexes",value:function(h,d){for(var v=[],g=-1;(g=h.indexOf(d,g+1))!==-1;)v.push(g);return v}},{key:"arrayAllMaxIndexes",value:function(h){return this.getAllIndexes(h,Math.max.apply(null,h))}}]),l})();t.exports=o}),(function(t,n,i){var a=function(){};a.FDLayout=i(18),a.FDLayoutConstants=i(7),a.FDLayoutEdge=i(19),a.FDLayoutNode=i(20),a.DimensionD=i(21),a.HashMap=i(22),a.HashSet=i(23),a.IGeometry=i(8),a.IMath=i(9),a.Integer=i(10),a.Point=i(12),a.PointD=i(4),a.RandomSeed=i(16),a.RectangleD=i(13),a.Transform=i(17),a.UniqueIDGeneretor=i(14),a.Quicksort=i(24),a.LinkedList=i(11),a.LGraphObject=i(2),a.LGraph=i(5),a.LEdge=i(1),a.LGraphManager=i(6),a.LNode=i(3),a.Layout=i(15),a.LayoutConstants=i(0),a.NeedlemanWunsch=i(25),t.exports=a}),(function(t,n,i){function a(){this.listeners=[]}var s=a.prototype;s.addListener=function(o,l){this.listeners.push({event:o,callback:l})},s.removeListener=function(o,l){for(var c=this.listeners.length;c>=0;c--){var h=this.listeners[c];h.event===o&&h.callback===l&&this.listeners.splice(c,1)}},s.emit=function(o,l){for(var c=0;c<this.listeners.length;c++){var h=this.listeners[c];o===h.event&&h.callback(l)}},t.exports=a})])})})(dp)),dp.exports}var dq=fp.exports,O7;function vq(){return O7||(O7=1,(function(r,e){(function(n,i){r.exports=i(fq())})(dq,function(t){return(function(n){var i={};function a(s){if(i[s])return i[s].exports;var o=i[s]={i:s,l:!1,exports:{}};return n[s].call(o.exports,o,o.exports,a),o.l=!0,o.exports}return a.m=n,a.c=i,a.i=function(s){return s},a.d=function(s,o,l){a.o(s,o)||Object.defineProperty(s,o,{configurable:!1,enumerable:!0,get:l})},a.n=function(s){var o=s&&s.__esModule?function(){return s.default}:function(){return s};return a.d(o,"a",o),o},a.o=function(s,o){return Object.prototype.hasOwnProperty.call(s,o)},a.p="",a(a.s=7)})([(function(n,i){n.exports=t}),(function(n,i,a){var s=a(0).FDLayoutConstants;function o(){}for(var l in s)o[l]=s[l];o.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,o.DEFAULT_RADIAL_SEPARATION=s.DEFAULT_EDGE_LENGTH,o.DEFAULT_COMPONENT_SEPERATION=60,o.TILE=!0,o.TILING_PADDING_VERTICAL=10,o.TILING_PADDING_HORIZONTAL=10,o.TREE_REDUCTION_ON_INCREMENTAL=!1,n.exports=o}),(function(n,i,a){var s=a(0).FDLayoutEdge;function o(c,h,d){s.call(this,c,h,d)}o.prototype=Object.create(s.prototype);for(var l in s)o[l]=s[l];n.exports=o}),(function(n,i,a){var s=a(0).LGraph;function o(c,h,d){s.call(this,c,h,d)}o.prototype=Object.create(s.prototype);for(var l in s)o[l]=s[l];n.exports=o}),(function(n,i,a){var s=a(0).LGraphManager;function o(c){s.call(this,c)}o.prototype=Object.create(s.prototype);for(var l in s)o[l]=s[l];n.exports=o}),(function(n,i,a){var s=a(0).FDLayoutNode,o=a(0).IMath;function l(h,d,v,g){s.call(this,h,d,v,g)}l.prototype=Object.create(s.prototype);for(var c in s)l[c]=s[c];l.prototype.move=function(){var h=this.graphManager.getLayout();this.displacementX=h.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=h.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementX=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementX)),Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementY=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),h.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},l.prototype.propogateDisplacementToChildren=function(h,d){for(var v=this.getChild().getNodes(),g,m=0;m<v.length;m++)g=v[m],g.getChild()==null?(g.moveBy(h,d),g.displacementX+=h,g.displacementY+=d):g.propogateDisplacementToChildren(h,d)},l.prototype.setPred1=function(h){this.pred1=h},l.prototype.getPred1=function(){return pred1},l.prototype.getPred2=function(){return pred2},l.prototype.setNext=function(h){this.next=h},l.prototype.getNext=function(){return next},l.prototype.setProcessed=function(h){this.processed=h},l.prototype.isProcessed=function(){return processed},n.exports=l}),(function(n,i,a){var s=a(0).FDLayout,o=a(4),l=a(3),c=a(5),h=a(2),d=a(1),v=a(0).FDLayoutConstants,g=a(0).LayoutConstants,m=a(0).Point,x=a(0).PointD,y=a(0).Layout,_=a(0).Integer,w=a(0).IGeometry,S=a(0).LGraph,A=a(0).Transform;function C(){s.call(this),this.toBeTiled={}}C.prototype=Object.create(s.prototype);for(var M in s)C[M]=s[M];C.prototype.newGraphManager=function(){var E=new o(this);return this.graphManager=E,E},C.prototype.newGraph=function(E){return new l(null,this.graphManager,E)},C.prototype.newNode=function(E){return new c(this.graphManager,E)},C.prototype.newEdge=function(E){return new h(null,null,E)},C.prototype.initParameters=function(){s.prototype.initParameters.call(this,arguments),this.isSubLayout||(d.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=d.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=d.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=v.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=v.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=v.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=v.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=v.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/v.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=v.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},C.prototype.layout=function(){var E=g.DEFAULT_CREATE_BENDS_AS_NEEDED;return E&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},C.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(d.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var O=new Set(this.getAllNodes()),D=this.nodesWithGravity.filter(function(U){return O.has(U)});this.graphManager.setAllNodesToApplyGravitation(D)}}else{var E=this.getFlatForest();if(E.length>0)this.positionNodesRadially(E);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var O=new Set(this.getAllNodes()),D=this.nodesWithGravity.filter(function(I){return O.has(I)});this.graphManager.setAllNodesToApplyGravitation(D),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},C.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%v.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),O=this.nodesWithGravity.filter(function(k){return E.has(k)});this.graphManager.setAllNodesToApplyGravitation(O),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var D=!this.isTreeGrowing&&!this.isGrowthFinished,I=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(D,I),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},C.prototype.getPositionsData=function(){for(var E=this.graphManager.getAllNodes(),O={},D=0;D<E.length;D++){var I=E[D].rect,k=E[D].id;O[k]={id:k,x:I.getCenterX(),y:I.getCenterY(),w:I.width,h:I.height}}return O},C.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var E=!1;if(v.ANIMATE==="during")this.emit("layoutstarted");else{for(;!E;)E=this.tick();this.graphManager.updateBounds()}},C.prototype.calculateNodesToApplyGravitationTo=function(){var E=[],O,D=this.graphManager.getGraphs(),I=D.length,k;for(k=0;k<I;k++)O=D[k],O.updateConnected(),O.isConnected||(E=E.concat(O.getNodes()));return E},C.prototype.createBendpoints=function(){var E=[];E=E.concat(this.graphManager.getAllEdges());var O=new Set,D;for(D=0;D<E.length;D++){var I=E[D];if(!O.has(I)){var k=I.getSource(),U=I.getTarget();if(k==U)I.getBendpoints().push(new x),I.getBendpoints().push(new x),this.createDummyNodesForBendpoints(I),O.add(I);else{var V=[];if(V=V.concat(k.getEdgeListToNode(U)),V=V.concat(U.getEdgeListToNode(k)),!O.has(V[0])){if(V.length>1){var X;for(X=0;X<V.length;X++){var W=V[X];W.getBendpoints().push(new x),this.createDummyNodesForBendpoints(W)}}V.forEach(function(P){O.add(P)})}}}if(O.size==E.length)break}},C.prototype.positionNodesRadially=function(E){for(var O=new m(0,0),D=Math.ceil(Math.sqrt(E.length)),I=0,k=0,U=0,V=new x(0,0),X=0;X<E.length;X++){X%D==0&&(U=0,k=I,X!=0&&(k+=d.DEFAULT_COMPONENT_SEPERATION),I=0);var W=E[X],P=y.findCenterOfTree(W);O.x=U,O.y=k,V=C.radialLayout(W,P,O),V.y>I&&(I=Math.floor(V.y)),U=Math.floor(V.x+d.DEFAULT_COMPONENT_SEPERATION)}this.transform(new x(g.WORLD_CENTER_X-V.x/2,g.WORLD_CENTER_Y-V.y/2))},C.radialLayout=function(E,O,D){var I=Math.max(this.maxDiagonalInTree(E),d.DEFAULT_RADIAL_SEPARATION);C.branchRadialLayout(O,null,0,359,0,I);var k=S.calculateBounds(E),U=new A;U.setDeviceOrgX(k.getMinX()),U.setDeviceOrgY(k.getMinY()),U.setWorldOrgX(D.x),U.setWorldOrgY(D.y);for(var V=0;V<E.length;V++){var X=E[V];X.transform(U)}var W=new x(k.getMaxX(),k.getMaxY());return U.inverseTransformPoint(W)},C.branchRadialLayout=function(E,O,D,I,k,U){var V=(I-D+1)/2;V<0&&(V+=180);var X=(V+D)%360,W=X*w.TWO_PI/360,P=k*Math.cos(W),H=k*Math.sin(W);E.setCenter(P,H);var z=[];z=z.concat(E.getEdges());var $=z.length;O!=null&&$--;for(var B=0,L=z.length,Y,G=E.getEdgesBetween(O);G.length>1;){var re=G[0];G.splice(0,1);var ie=z.indexOf(re);ie>=0&&z.splice(ie,1),L--,$--}O!=null?Y=(z.indexOf(G[0])+1)%L:Y=0;for(var le=Math.abs(I-D)/$,ce=Y;B!=$;ce=++ce%L){var _e=z[ce].getOtherEnd(E);if(_e!=O){var pe=(D+B*le)%360,ae=(pe+le)%360;C.branchRadialLayout(_e,E,pe,ae,k+U,U),B++}}},C.maxDiagonalInTree=function(E){for(var O=_.MIN_VALUE,D=0;D<E.length;D++){var I=E[D],k=I.getDiagonal();k>O&&(O=k)}return O},C.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},C.prototype.groupZeroDegreeMembers=function(){var E=this,O={};this.memberGroups={},this.idToDummyNode={};for(var D=[],I=this.graphManager.getAllNodes(),k=0;k<I.length;k++){var U=I[k],V=U.getParent();this.getNodeDegreeWithChildren(U)===0&&(V.id==null||!this.getToBeTiled(V))&&D.push(U)}for(var k=0;k<D.length;k++){var U=D[k],X=U.getParent().id;typeof O[X]>"u"&&(O[X]=[]),O[X]=O[X].concat(U)}Object.keys(O).forEach(function(W){if(O[W].length>1){var P="DummyCompound_"+W;E.memberGroups[P]=O[W];var H=O[W][0].getParent(),z=new c(E.graphManager);z.id=P,z.paddingLeft=H.paddingLeft||0,z.paddingRight=H.paddingRight||0,z.paddingBottom=H.paddingBottom||0,z.paddingTop=H.paddingTop||0,E.idToDummyNode[P]=z;var $=E.getGraphManager().add(E.newGraph(),z),B=H.getChild();B.add(z);for(var L=0;L<O[W].length;L++){var Y=O[W][L];B.remove(Y),$.add(Y)}}})},C.prototype.clearCompounds=function(){var E={},O={};this.performDFSOnCompounds();for(var D=0;D<this.compoundOrder.length;D++)O[this.compoundOrder[D].id]=this.compoundOrder[D],E[this.compoundOrder[D].id]=[].concat(this.compoundOrder[D].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[D].getChild()),this.compoundOrder[D].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(E,O)},C.prototype.clearZeroDegreeMembers=function(){var E=this,O=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(D){var I=E.idToDummyNode[D];O[D]=E.tileNodes(E.memberGroups[D],I.paddingLeft+I.paddingRight),I.rect.width=O[D].width,I.rect.height=O[D].height})},C.prototype.repopulateCompounds=function(){for(var E=this.compoundOrder.length-1;E>=0;E--){var O=this.compoundOrder[E],D=O.id,I=O.paddingLeft,k=O.paddingTop;this.adjustLocations(this.tiledMemberPack[D],O.rect.x,O.rect.y,I,k)}},C.prototype.repopulateZeroDegreeMembers=function(){var E=this,O=this.tiledZeroDegreePack;Object.keys(O).forEach(function(D){var I=E.idToDummyNode[D],k=I.paddingLeft,U=I.paddingTop;E.adjustLocations(O[D],I.rect.x,I.rect.y,k,U)})},C.prototype.getToBeTiled=function(E){var O=E.id;if(this.toBeTiled[O]!=null)return this.toBeTiled[O];var D=E.getChild();if(D==null)return this.toBeTiled[O]=!1,!1;for(var I=D.getNodes(),k=0;k<I.length;k++){var U=I[k];if(this.getNodeDegree(U)>0)return this.toBeTiled[O]=!1,!1;if(U.getChild()==null){this.toBeTiled[U.id]=!1;continue}if(!this.getToBeTiled(U))return this.toBeTiled[O]=!1,!1}return this.toBeTiled[O]=!0,!0},C.prototype.getNodeDegree=function(E){E.id;for(var O=E.getEdges(),D=0,I=0;I<O.length;I++){var k=O[I];k.getSource().id!==k.getTarget().id&&(D=D+1)}return D},C.prototype.getNodeDegreeWithChildren=function(E){var O=this.getNodeDegree(E);if(E.getChild()==null)return O;for(var D=E.getChild().getNodes(),I=0;I<D.length;I++){var k=D[I];O+=this.getNodeDegreeWithChildren(k)}return O},C.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},C.prototype.fillCompexOrderByDFS=function(E){for(var O=0;O<E.length;O++){var D=E[O];D.getChild()!=null&&this.fillCompexOrderByDFS(D.getChild().getNodes()),this.getToBeTiled(D)&&this.compoundOrder.push(D)}},C.prototype.adjustLocations=function(E,O,D,I,k){O+=I,D+=k;for(var U=O,V=0;V<E.rows.length;V++){var X=E.rows[V];O=U;for(var W=0,P=0;P<X.length;P++){var H=X[P];H.rect.x=O,H.rect.y=D,O+=H.rect.width+E.horizontalPadding,H.rect.height>W&&(W=H.rect.height)}D+=W+E.verticalPadding}},C.prototype.tileCompoundMembers=function(E,O){var D=this;this.tiledMemberPack=[],Object.keys(E).forEach(function(I){var k=O[I];D.tiledMemberPack[I]=D.tileNodes(E[I],k.paddingLeft+k.paddingRight),k.rect.width=D.tiledMemberPack[I].width,k.rect.height=D.tiledMemberPack[I].height})},C.prototype.tileNodes=function(E,O){var D=d.TILING_PADDING_VERTICAL,I=d.TILING_PADDING_HORIZONTAL,k={rows:[],rowWidth:[],rowHeight:[],width:0,height:O,verticalPadding:D,horizontalPadding:I};E.sort(function(X,W){return X.rect.width*X.rect.height>W.rect.width*W.rect.height?-1:X.rect.width*X.rect.height<W.rect.width*W.rect.height?1:0});for(var U=0;U<E.length;U++){var V=E[U];k.rows.length==0?this.insertNodeToRow(k,V,0,O):this.canAddHorizontal(k,V.rect.width,V.rect.height)?this.insertNodeToRow(k,V,this.getShortestRowIndex(k),O):this.insertNodeToRow(k,V,k.rows.length,O),this.shiftToLastRow(k)}return k},C.prototype.insertNodeToRow=function(E,O,D,I){var k=I;if(D==E.rows.length){var U=[];E.rows.push(U),E.rowWidth.push(k),E.rowHeight.push(0)}var V=E.rowWidth[D]+O.rect.width;E.rows[D].length>0&&(V+=E.horizontalPadding),E.rowWidth[D]=V,E.width<V&&(E.width=V);var X=O.rect.height;D>0&&(X+=E.verticalPadding);var W=0;X>E.rowHeight[D]&&(W=E.rowHeight[D],E.rowHeight[D]=X,W=E.rowHeight[D]-W),E.height+=W,E.rows[D].push(O)},C.prototype.getShortestRowIndex=function(E){for(var O=-1,D=Number.MAX_VALUE,I=0;I<E.rows.length;I++)E.rowWidth[I]<D&&(O=I,D=E.rowWidth[I]);return O},C.prototype.getLongestRowIndex=function(E){for(var O=-1,D=Number.MIN_VALUE,I=0;I<E.rows.length;I++)E.rowWidth[I]>D&&(O=I,D=E.rowWidth[I]);return O},C.prototype.canAddHorizontal=function(E,O,D){var I=this.getShortestRowIndex(E);if(I<0)return!0;var k=E.rowWidth[I];if(k+E.horizontalPadding+O<=E.width)return!0;var U=0;E.rowHeight[I]<D&&I>0&&(U=D+E.verticalPadding-E.rowHeight[I]);var V;E.width-k>=O+E.horizontalPadding?V=(E.height+U)/(k+O+E.horizontalPadding):V=(E.height+U)/E.width,U=D+E.verticalPadding;var X;return E.width<O?X=(E.height+U)/O:X=(E.height+U)/E.width,X<1&&(X=1/X),V<1&&(V=1/V),V<X},C.prototype.shiftToLastRow=function(E){var O=this.getLongestRowIndex(E),D=E.rowWidth.length-1,I=E.rows[O],k=I[I.length-1],U=k.width+E.horizontalPadding;if(E.width-E.rowWidth[D]>U&&O!=D){I.splice(-1,1),E.rows[D].push(k),E.rowWidth[O]=E.rowWidth[O]-U,E.rowWidth[D]=E.rowWidth[D]+U,E.width=E.rowWidth[instance.getLongestRowIndex(E)];for(var V=Number.MIN_VALUE,X=0;X<I.length;X++)I[X].height>V&&(V=I[X].height);O>0&&(V+=E.verticalPadding);var W=E.rowHeight[O]+E.rowHeight[D];E.rowHeight[O]=V,E.rowHeight[D]<k.height+E.verticalPadding&&(E.rowHeight[D]=k.height+E.verticalPadding);var P=E.rowHeight[O]+E.rowHeight[D];E.height+=P-W,this.shiftToLastRow(E)}},C.prototype.tilingPreLayout=function(){d.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},C.prototype.tilingPostLayout=function(){d.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},C.prototype.reduceTrees=function(){for(var E=[],O=!0,D;O;){var I=this.graphManager.getAllNodes(),k=[];O=!1;for(var U=0;U<I.length;U++)D=I[U],D.getEdges().length==1&&!D.getEdges()[0].isInterGraph&&D.getChild()==null&&(k.push([D,D.getEdges()[0],D.getOwner()]),O=!0);if(O==!0){for(var V=[],X=0;X<k.length;X++)k[X][0].getEdges().length==1&&(V.push(k[X]),k[X][0].getOwner().remove(k[X][0]));E.push(V),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=E},C.prototype.growTree=function(E){for(var O=E.length,D=E[O-1],I,k=0;k<D.length;k++)I=D[k],this.findPlaceforPrunedNode(I),I[2].add(I[0]),I[2].add(I[1],I[1].source,I[1].target);E.splice(E.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},C.prototype.findPlaceforPrunedNode=function(E){var O,D,I=E[0];I==E[1].source?D=E[1].target:D=E[1].source;var k=D.startX,U=D.finishX,V=D.startY,X=D.finishY,W=0,P=0,H=0,z=0,$=[W,H,P,z];if(V>0)for(var B=k;B<=U;B++)$[0]+=this.grid[B][V-1].length+this.grid[B][V].length-1;if(U<this.grid.length-1)for(var B=V;B<=X;B++)$[1]+=this.grid[U+1][B].length+this.grid[U][B].length-1;if(X<this.grid[0].length-1)for(var B=k;B<=U;B++)$[2]+=this.grid[B][X+1].length+this.grid[B][X].length-1;if(k>0)for(var B=V;B<=X;B++)$[3]+=this.grid[k-1][B].length+this.grid[k][B].length-1;for(var L=_.MAX_VALUE,Y,G,re=0;re<$.length;re++)$[re]<L?(L=$[re],Y=1,G=re):$[re]==L&&Y++;if(Y==3&&L==0)$[0]==0&&$[1]==0&&$[2]==0?O=1:$[0]==0&&$[1]==0&&$[3]==0?O=0:$[0]==0&&$[2]==0&&$[3]==0?O=3:$[1]==0&&$[2]==0&&$[3]==0&&(O=2);else if(Y==2&&L==0){var ie=Math.floor(Math.random()*2);$[0]==0&&$[1]==0?ie==0?O=0:O=1:$[0]==0&&$[2]==0?ie==0?O=0:O=2:$[0]==0&&$[3]==0?ie==0?O=0:O=3:$[1]==0&&$[2]==0?ie==0?O=1:O=2:$[1]==0&&$[3]==0?ie==0?O=1:O=3:ie==0?O=2:O=3}else if(Y==4&&L==0){var ie=Math.floor(Math.random()*4);O=ie}else O=G;O==0?I.setCenter(D.getCenterX(),D.getCenterY()-D.getHeight()/2-v.DEFAULT_EDGE_LENGTH-I.getHeight()/2):O==1?I.setCenter(D.getCenterX()+D.getWidth()/2+v.DEFAULT_EDGE_LENGTH+I.getWidth()/2,D.getCenterY()):O==2?I.setCenter(D.getCenterX(),D.getCenterY()+D.getHeight()/2+v.DEFAULT_EDGE_LENGTH+I.getHeight()/2):I.setCenter(D.getCenterX()-D.getWidth()/2-v.DEFAULT_EDGE_LENGTH-I.getWidth()/2,D.getCenterY())},n.exports=C}),(function(n,i,a){var s={};s.layoutBase=a(0),s.CoSEConstants=a(1),s.CoSEEdge=a(2),s.CoSEGraph=a(3),s.CoSEGraphManager=a(4),s.CoSELayout=a(6),s.CoSENode=a(5),n.exports=s})])})})(fp)),fp.exports}var pq=hp.exports,D7;function gq(){return D7||(D7=1,(function(r,e){(function(n,i){r.exports=i(vq())})(pq,function(t){return(function(n){var i={};function a(s){if(i[s])return i[s].exports;var o=i[s]={i:s,l:!1,exports:{}};return n[s].call(o.exports,o,o.exports,a),o.l=!0,o.exports}return a.m=n,a.c=i,a.i=function(s){return s},a.d=function(s,o,l){a.o(s,o)||Object.defineProperty(s,o,{configurable:!1,enumerable:!0,get:l})},a.n=function(s){var o=s&&s.__esModule?function(){return s.default}:function(){return s};return a.d(o,"a",o),o},a.o=function(s,o){return Object.prototype.hasOwnProperty.call(s,o)},a.p="",a(a.s=1)})([(function(n,i){n.exports=t}),(function(n,i,a){var s=a(0).layoutBase.LayoutConstants,o=a(0).layoutBase.FDLayoutConstants,l=a(0).CoSEConstants,c=a(0).CoSELayout,h=a(0).CoSENode,d=a(0).layoutBase.PointD,v=a(0).layoutBase.DimensionD,g={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function m(w,S){var A={};for(var C in w)A[C]=w[C];for(var C in S)A[C]=S[C];return A}function x(w){this.options=m(g,w),y(this.options)}var y=function(S){S.nodeRepulsion!=null&&(l.DEFAULT_REPULSION_STRENGTH=o.DEFAULT_REPULSION_STRENGTH=S.nodeRepulsion),S.idealEdgeLength!=null&&(l.DEFAULT_EDGE_LENGTH=o.DEFAULT_EDGE_LENGTH=S.idealEdgeLength),S.edgeElasticity!=null&&(l.DEFAULT_SPRING_STRENGTH=o.DEFAULT_SPRING_STRENGTH=S.edgeElasticity),S.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=S.nestingFactor),S.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=o.DEFAULT_GRAVITY_STRENGTH=S.gravity),S.numIter!=null&&(l.MAX_ITERATIONS=o.MAX_ITERATIONS=S.numIter),S.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=o.DEFAULT_GRAVITY_RANGE_FACTOR=S.gravityRange),S.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH=S.gravityCompound),S.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=S.gravityRangeCompound),S.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=o.DEFAULT_COOLING_FACTOR_INCREMENTAL=S.initialEnergyOnIncremental),S.quality=="draft"?s.QUALITY=0:S.quality=="proof"?s.QUALITY=2:s.QUALITY=1,l.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=s.NODE_DIMENSIONS_INCLUDE_LABELS=S.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=s.DEFAULT_INCREMENTAL=!S.randomize,l.ANIMATE=o.ANIMATE=s.ANIMATE=S.animate,l.TILE=S.tile,l.TILING_PADDING_VERTICAL=typeof S.tilingPaddingVertical=="function"?S.tilingPaddingVertical.call():S.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof S.tilingPaddingHorizontal=="function"?S.tilingPaddingHorizontal.call():S.tilingPaddingHorizontal};x.prototype.run=function(){var w,S,A=this.options;this.idToLNode={};var C=this.layout=new c,M=this;M.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var E=C.newGraphManager();this.gm=E;var O=this.options.eles.nodes(),D=this.options.eles.edges();this.root=E.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(O),C);for(var I=0;I<D.length;I++){var k=D[I],U=this.idToLNode[k.data("source")],V=this.idToLNode[k.data("target")];if(U!==V&&U.getEdgesBetween(V).length==0){var X=E.add(C.newEdge(),U,V);X.id=k.id()}}var W=function(z,$){typeof z=="number"&&(z=$);var B=z.data("id"),L=M.idToLNode[B];return{x:L.getRect().getCenterX(),y:L.getRect().getCenterY()}},P=function H(){for(var z=function(){A.fit&&A.cy.fit(A.eles,A.padding),w||(w=!0,M.cy.one("layoutready",A.ready),M.cy.trigger({type:"layoutready",layout:M}))},$=M.options.refresh,B,L=0;L<$&&!B;L++)B=M.stopped||M.layout.tick();if(B){C.checkLayoutSuccess()&&!C.isSubLayout&&C.doPostLayout(),C.tilingPostLayout&&C.tilingPostLayout(),C.isLayoutFinished=!0,M.options.eles.nodes().positions(W),z(),M.cy.one("layoutstop",M.options.stop),M.cy.trigger({type:"layoutstop",layout:M}),S&&cancelAnimationFrame(S),w=!1;return}var Y=M.layout.getPositionsData();A.eles.nodes().positions(function(G,re){if(typeof G=="number"&&(G=re),!G.isParent()){for(var ie=G.id(),le=Y[ie],ce=G;le==null&&(le=Y[ce.data("parent")]||Y["DummyCompound_"+ce.data("parent")],Y[ie]=le,ce=ce.parent()[0],ce!=null););return le!=null?{x:le.x,y:le.y}:{x:G.position("x"),y:G.position("y")}}}),z(),S=requestAnimationFrame(H)};return C.addListener("layoutstarted",function(){M.options.animate==="during"&&(S=requestAnimationFrame(P))}),C.runLayout(),this.options.animate!=="during"&&(M.options.eles.nodes().not(":parent").layoutPositions(M,M.options,W),w=!1),this},x.prototype.getTopMostNodes=function(w){for(var S={},A=0;A<w.length;A++)S[w[A].id()]=!0;var C=w.filter(function(M,E){typeof M=="number"&&(M=E);for(var O=M.parent()[0];O!=null;){if(S[O.id()])return!1;O=O.parent()[0]}return!0});return C},x.prototype.processChildrenList=function(w,S,A){for(var C=S.length,M=0;M<C;M++){var E=S[M],O=E.children(),D,I=E.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(E.outerWidth()!=null&&E.outerHeight()!=null?D=w.add(new h(A.graphManager,new d(E.position("x")-I.w/2,E.position("y")-I.h/2),new v(parseFloat(I.w),parseFloat(I.h)))):D=w.add(new h(this.graphManager)),D.id=E.data("id"),D.paddingLeft=parseInt(E.css("padding")),D.paddingTop=parseInt(E.css("padding")),D.paddingRight=parseInt(E.css("padding")),D.paddingBottom=parseInt(E.css("padding")),this.options.nodeDimensionsIncludeLabels&&E.isParent()){var k=E.boundingBox({includeLabels:!0,includeNodes:!1}).w,U=E.boundingBox({includeLabels:!0,includeNodes:!1}).h,V=E.css("text-halign");D.labelWidth=k,D.labelHeight=U,D.labelPos=V}if(this.idToLNode[E.data("id")]=D,isNaN(D.rect.x)&&(D.rect.x=0),isNaN(D.rect.y)&&(D.rect.y=0),O!=null&&O.length>0){var X;X=A.getGraphManager().add(A.newGraph(),D),this.processChildrenList(X,O,A)}}},x.prototype.stop=function(){return this.stopped=!0,this};var _=function(S){S("layout","cose-bilkent",x)};typeof cytoscape<"u"&&_(cytoscape),n.exports=_})])})})(hp)),hp.exports}var mq=gq();const yq=cl(mq),Uo={七年级:{代数与方程:[{code:"J7-EQ-001",name:"一元一次方程"},{code:"J7-EQ-002",name:"二元一次方程组"}],几何基础:[{code:"J7-GEO-001",name:"线段与角"},{code:"J7-GEO-002",name:"相交线与平行线"}]},八年级:{代数与函数:[{code:"J8-FUNC-001",name:"一次函数"},{code:"J8-ROOT-001",name:"二次根式"}],几何证明:[{code:"J8-GEO-001",name:"全等三角形"},{code:"J8-GEO-002",name:"轴对称"}]},九年级:{代数进阶:[{code:"J9-EQ-001",name:"一元二次方程"},{code:"J9-FUNC-001",name:"二次函数"}],圆与统计:[{code:"J9-CIRCLE-001",name:"圆的基本性质"},{code:"J9-STAT-001",name:"概率初步"}]}},bq={display:"flex",flexDirection:"column",gap:10},xq={marginTop:8,display:"flex",justifyContent:"flex-end"},_q={display:"flex",gap:8,alignItems:"center",flexWrap:"nowrap"},pv={height:40},df={height:40,minWidth:92};function j2(r){var n;const e=(r||"").trim();if(!e)return{label:""};const t=e.match(/^(?<name>.*?)[((]\s*(?<code>[^))]+)\s*[))]\s*$/);if((n=t==null?void 0:t.groups)!=null&&n.code){const i=String(t.groups.code).trim();return{label:String(t.groups.name||"").trim()||e,code:i}}return{label:e}}function wq(r){const e=[],t=[],n="category",i="center";e.push({id:n,kind:"category",label:`类别:${r.category}`}),e.push({id:i,kind:"center",label:r.centerName||r.centerCode,code:r.centerCode}),t.push({id:"e_cat_center",from:n,to:i,label:"CONTAINS"});const a=(r.prerequisites||[]).slice(0,10),s=(r.next_steps||[]).slice(0,10),o=(r.related||[]).slice(0,12);return a.forEach((l,c)=>{const h=j2(l),d=`prereq_${c}`;e.push({id:d,kind:"prereq",label:h.label||l,code:h.code}),t.push({id:`e_${d}_center`,from:d,to:i,label:"PREREQUISITE"})}),s.forEach((l,c)=>{const h=j2(l),d=`next_${c}`;e.push({id:d,kind:"next",label:h.label||l,code:h.code}),t.push({id:`e_center_${d}`,from:i,to:d,label:"PREREQUISITE"})}),o.forEach((l,c)=>{const h=j2(l),d=`related_${c}`;e.push({id:d,kind:"related",label:h.label||l,code:h.code}),t.push({id:`e_cat_${d}`,from:n,to:d,label:"CONTAINS"})}),{nodes:e,edges:t}}tl.use(yq);function Sq(r){const{nodes:e,edges:t}=wq(r),n=[];for(const i of e)n.push({data:{id:i.id,label:i.code?`${i.label}
  361. (${i.code})`:i.label,kind:i.kind,code:i.code||""}});for(const i of t)n.push({data:{id:i.id,source:i.from,target:i.to,label:i.label}});return n}function Eq({preview:r,onSelectCode:e}){const t=he.useRef(null),n=he.useRef(null),i=he.useRef(null),[a,s]=he.useState(!1),o=he.useMemo(()=>Sq(r),[r]),l=he.useCallback(()=>{const d=i.current;d&&(d.resize(),d.fit(void 0,40))},[]);he.useEffect(()=>{const d=()=>{const v=document.fullscreenElement===t.current;s(v),requestAnimationFrame(()=>l())};return document.addEventListener("fullscreenchange",d),()=>document.removeEventListener("fullscreenchange",d)},[l]),he.useEffect(()=>{if(!n.current||i.current)return;const d=tl({container:n.current,elements:[],style:[{selector:"node",style:{label:"data(label)","text-wrap":"wrap","text-max-width":"110px","text-valign":"center","text-halign":"center","font-size":"11px",color:"#111827","background-color":"#ffffff","border-color":"#e5e7eb","border-width":1,shape:"ellipse",width:"44px",height:"44px"}},{selector:'node[kind = "category"]',style:{"background-color":"#eff6ff","border-color":"#bfdbfe"}},{selector:'node[kind = "center"]',style:{"background-color":"#eef2ff","border-color":"#c7d2fe",width:"56px",height:"56px","font-size":"12px"}},{selector:'node[kind = "prereq"]',style:{"background-color":"#fffbeb","border-color":"#fde68a"}},{selector:'node[kind = "next"]',style:{"background-color":"#f0fdf4","border-color":"#bbf7d0"}},{selector:"edge",style:{width:1.5,"line-color":"#94a3b8","target-arrow-color":"#94a3b8","target-arrow-shape":"triangle","curve-style":"bezier",label:"data(label)","font-size":"9px","text-rotation":"autorotate",color:"#64748b","text-background-color":"#ffffff","text-background-opacity":.8,"text-background-padding":"2px"}}],layout:{name:"preset"},wheelSensitivity:.15});return d.on("tap","node",v=>{const g=String(v.target.data("code")||"").trim();g&&e(g)}),i.current=d,()=>{d.destroy(),i.current=null}},[e]),he.useEffect(()=>{const d=i.current;d&&(d.elements().remove(),d.add(o),d.layout({name:"cose-bilkent",animate:!0,fit:!0,padding:30,nodeRepulsion:9e3,idealEdgeLength:120,edgeElasticity:.25,gravity:.25,numIter:800}).run())},[o]);async function c(){const d=t.current;if(d)try{await d.requestFullscreen()}catch{}}async function h(){if(document.fullscreenElement)try{await document.exitFullscreen()}catch{}}return N.jsxs("div",{ref:t,style:{display:"flex",flexDirection:"column",gap:8,width:"100%",background:a?"#ffffff":void 0},children:[N.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,flexWrap:"wrap"},children:[N.jsxs("span",{className:"muted",style:{fontSize:12},children:["图关系预览",a?"(全屏 · 点击节点可切换中心 · Esc 退出)":""]}),N.jsx("button",{type:"button",className:"btn",style:{padding:"6px 12px",fontSize:13},onClick:()=>a?void h():void c(),children:a?"退出全屏":"全屏"})]}),N.jsx("div",{ref:n,style:{flex:a?1:void 0,height:a?void 0:420,minHeight:a?0:420,width:"100%",border:"1px solid #e5e7eb",borderRadius:12,background:"#ffffff"}})]})}function Tq(){var ee,se,Pe,Ae,Ge;const[r,e]=he.useState(Uo),t=Object.keys(r),[n,i]=he.useState(t[0]),[a,s]=he.useState(Object.keys(r[t[0]])[0]),[o,l]=he.useState(r[t[0]][Object.keys(r[t[0]])[0]][0].code),[c,h]=he.useState(o),[d,v]=he.useState(""),[g,m]=he.useState(""),[x,y]=he.useState(""),[_,w]=he.useState(null),[S,A]=he.useState(null),[C,M]=he.useState(!1),{role:E}=bu(),[O,D]=he.useState(!1),[I,k]=he.useState(""),[U,V]=he.useState(""),[X,W]=he.useState(""),[P,H]=he.useState(""),z=E==="teacher",[$,B]=he.useState(null),[L,Y]=he.useState(""),[G,re]=he.useState(""),[ie,le]=he.useState(t[0]||""),[ce,_e]=he.useState(Object.keys(r[t[0]]||{})[0]||""),[pe,ae]=he.useState(t[0]||""),[oe,de]=he.useState(Object.keys(r[t[0]]||{})[0]||"");async function ye(J,Oe){const Ve=(J||"").trim();if(Ve){w(null),A(null),M(!0);try{const Ue=await f1(Ve);y(JSON.stringify(Ue,null,2)),h(Ve),B({grade:Ue.grade||n,category:Ue.category||a,centerName:Ue.name||Oe||Ve,centerCode:Ue.knowledge_code||Ve,related:Ue.related||[],prerequisites:Ue.prerequisites||[],next_steps:Ue.next_steps||[]})}catch(Ue){w(Ue instanceof Error?Ue.message:"查询失败")}finally{M(!1)}}}function Ee(J){return J.includes("七")?"J7":J.includes("八")?"J8":J.includes("九")?"J9":"JX"}function Re(J){return J.includes("方程")||J.includes("代数")?"EQ":J.includes("函数")?"FUNC":J.includes("几何")?"GEO":J.includes("圆")?"CIRCLE":J.includes("统计")||J.includes("概率")?"STAT":"GEN"}function Ne(J){return J.replace(/\s+/g,"")||"知识点"}function Be(J,Oe,Ve,Ue){const je=String(Ue).padStart(3,"0");return`${Ee(J)}-${Re(Oe)}-${je}-${Ne(Ve)}`}const $e=((ee=r[n])==null?void 0:ee[a])||[],Ye=$e.find(J=>J.code===o),He=Be(n,a,g||(Ye==null?void 0:Ye.name)||"知识点",($e.length||0)+1),tt=((se=r[ie])==null?void 0:se[ce])||[],ot=((Pe=r[pe])==null?void 0:Pe[oe])||[],ct=Object.keys(r[n]||{}),Ze=((Ae=r[n])==null?void 0:Ae[I])||[];async function bt(){try{const J=await H_();J&&Object.keys(J).length&&e(J)}catch{}}he.useEffect(()=>{bt()},[]),he.useEffect(()=>{const J=Object.keys(r[ie]||{});J.length&&!J.includes(ce)&&_e(J[0]||"");const Oe=Object.keys(r[pe]||{});Oe.length&&!Oe.includes(oe)&&de(Oe[0]||"")},[r,ie,ce,pe,oe]),he.useEffect(()=>{var Ve,Ue,je,yt,vt;const J=((Ve=r[ie])==null?void 0:Ve[ce])||[];J.some(Ot=>Ot.code===L)||Y(((Ue=J[0])==null?void 0:Ue.code)||"");const Oe=((je=r[pe])==null?void 0:je[oe])||[];Oe.some(Ot=>Ot.code===G)||re(((yt=Oe[1])==null?void 0:yt.code)||((vt=Oe[0])==null?void 0:vt.code)||"")},[r,ie,ce,pe,oe,L,G]),he.useEffect(()=>{const J=Object.keys(r);!J.includes(n)&&J[0]&&i(J[0])},[r,n]),he.useEffect(()=>{const J=Object.keys(r[n]||{});J.includes(a)||s(J[0]||"")},[r,n,a]),he.useEffect(()=>{var Oe,Ve;const J=((Oe=r[n])==null?void 0:Oe[a])||[];J.some(Ue=>Ue.code===o)||l(((Ve=J[0])==null?void 0:Ve.code)||"")},[r,n,a,o]),he.useEffect(()=>{var Ue,je;if(!O)return;const J=Object.keys(r[n]||{})[0]||"",Oe=I&&((Ue=r[n])!=null&&Ue[I]?I:J);k(Oe),V(Oe);const Ve=(((je=r[n])==null?void 0:je[Oe])||[])[0];W((Ve==null?void 0:Ve.code)||""),H((Ve==null?void 0:Ve.name)||"")},[O,r,n]),he.useEffect(()=>{var Oe;if(!O)return;const J=(((Oe=r[n])==null?void 0:Oe[I])||[]).find(Ve=>Ve.code===X);H((J==null?void 0:J.name)||"")},[O,r,n,I,X]),he.useEffect(()=>{O&&I&&V(I)},[O,I]),he.useEffect(()=>{var Oe;const J=(((Oe=r[n])==null?void 0:Oe[a])||[]).find(Ve=>Ve.code===o);J&&h(J.code)},[r,n,a,o]);async function Se(){var jt,Nr;w(null),A(null);const J=d.trim(),Oe=g.trim(),Ve=!!J,Ue=!!Oe;if(!Ve&&!Ue){w("请至少输入类别或具体知识点");return}if(!Ve&&Ue&&!a){w("请先选择类别");return}const je=Ve?J:a;if(!je){w("请先选择或输入类别");return}if(Ve&&((jt=r[n])!=null&&jt[je])){w("该类别已存在");return}const yt=Ve?[]:((Nr=r[n])==null?void 0:Nr[je])||[],vt=Ue?{code:Be(n,je,Oe,yt.length+1),name:Oe}:null;if(e(Vt=>{const Qt=Vt[n]||{},rr=Ve?[]:Qt[je]||[],ur=vt?[...rr,vt]:rr;return{...Vt,[n]:{...Qt,[je]:ur}}}),Ve&&(s(je),v("")),vt){l(vt.code),h(vt.code),m("");try{const Vt=await QT(vt.code,vt.name,n,je);y(JSON.stringify(Vt,null,2))}catch(Vt){w(Vt instanceof Error?Vt.message:"新增后写入图谱失败")}}const Ot=[];Ve&&Ot.push("已添加类别"),Ue&&Ot.push("已添加具体知识点"),A(Ot.join(","))}async function ke(){var Ue,je;const J=U.trim();if(!J){w("类别名称不能为空");return}if(J===I){A("类别名称未变化");return}if((Ue=r[n])!=null&&Ue[J]){w("目标类别已存在");return}const Oe=I;M(!0);try{await oF(n,Oe,J)}catch(yt){w(yt instanceof Error?yt.message:"修改类别失败"),M(!1);return}const Ve=((je=r[n])==null?void 0:je[Oe])||[];e(yt=>{const vt={...yt[n]||{}};return delete vt[Oe],vt[J]=Ve,{...yt,[n]:vt}}),s(J),k(J),V(J),A(`已将类别“${Oe}”修改为“${J}”`),w(null),M(!1)}async function We(){const J=I.trim();if(!J)return;const Oe=Object.keys(r[n]||{});if(Oe.length<=1){w("至少保留一个类别,无法删除");return}M(!0);try{await lF(n,J)}catch(Ue){w(Ue instanceof Error?Ue.message:"删除类别失败"),M(!1);return}e(Ue=>{const je={...Ue[n]||{}};return delete je[J],{...Ue,[n]:je}});const Ve=Oe.find(Ue=>Ue!==J)||"";s(Ve),k(Ve),A(`已删除类别:${J}`),w(null),M(!1)}async function Ke(){const J=P.trim();if(!J||!X){w("请先选择知识点并填写名称");return}M(!0);try{await uF(X,J)}catch(Oe){w(Oe instanceof Error?Oe.message:"修改知识点失败"),M(!1);return}e(Oe=>{const Ve={...Oe[n]||{}},Ue=[...Ve[I]||[]],je=Ue.findIndex(yt=>yt.code===X);return je>=0&&(Ue[je]={...Ue[je],name:J}),Ve[I]=Ue,{...Oe,[n]:Ve}}),A("已修改具体知识点名称"),w(null),M(!1)}async function rt(){if(!X){w("请先选择具体知识点");return}M(!0);try{await cF(X)}catch(J){w(J instanceof Error?J.message:"删除知识点失败"),M(!1);return}e(J=>{const Oe={...J[n]||{}},Ve=[...Oe[I]||[]];return Oe[I]=Ve.filter(Ue=>Ue.code!==X),{...J,[n]:Oe}}),W(""),H(""),A("已删除具体知识点"),w(null),M(!1)}async function nt(){await ye(c,Ye==null?void 0:Ye.name)}async function De(){w(null),A(null),M(!0);try{const J=await QT(c,(Ye==null?void 0:Ye.name)||"未命名知识点",n,a);y(JSON.stringify(J,null,2)),B({grade:J.grade||n,category:J.category||a,centerName:J.name||(Ye==null?void 0:Ye.name)||c,centerCode:J.knowledge_code||c,related:J.related||[],prerequisites:J.prerequisites||[],next_steps:J.next_steps||[]}),await bt()}catch(J){w(J instanceof Error?J.message:"写入失败(需要teacher权限)")}finally{M(!1)}}async function Q(){w(null),A(null),M(!0);try{const J=await iF();y(JSON.stringify(J,null,2)),A(`已同步默认知识点目录到 Neo4j:共 ${J.upserted} 条(可重复执行)`),await bt()}catch(J){w(J instanceof Error?J.message:"同步失败(需要 teacher 权限且 Neo4j 可用)")}finally{M(!1)}}async function ne(){w(null),A(null),M(!0);try{await aF(L,G),A(`已建立递进关系:必须先掌握「${L}」再学「${G}」`);const J=await f1(G);y(JSON.stringify(J,null,2)),B({grade:J.grade||n,category:J.category||a,centerName:J.name||c,centerCode:J.knowledge_code||G,related:J.related||[],prerequisites:J.prerequisites||[],next_steps:J.next_steps||[]}),await bt()}catch(J){w(J instanceof Error?J.message:"建立递进关系失败")}finally{M(!1)}}async function be(){w(null),A(null),M(!0);try{const J=await sF(L,G);A(J.deleted?"已解除该递进关系":"图中不存在该递进关系(可能已删除)");const Oe=await f1(G);y(JSON.stringify(Oe,null,2)),B({grade:Oe.grade||n,category:Oe.category||a,centerName:Oe.name||c,centerCode:Oe.knowledge_code||G,related:Oe.related||[],prerequisites:Oe.prerequisites||[],next_steps:Oe.next_steps||[]}),await bt()}catch(J){w(J instanceof Error?J.message:"解除失败")}finally{M(!1)}}return N.jsxs("div",{className:"grid",children:[N.jsx("div",{className:"col-12",children:N.jsxs("div",{className:"card",style:{height:"100%"},children:[N.jsx("div",{className:"card-header",children:N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"知识图谱查询与维护"})}),N.jsxs("div",{className:"card-body",style:{...bq,minHeight:z?260:0},children:[N.jsxs("div",{className:"row",style:{alignItems:"flex-end",gap:8,flexWrap:"nowrap"},children:[N.jsxs("div",{style:{flex:.9,minWidth:96},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"年级"}),N.jsx("select",{className:"select",value:n,onChange:J=>i(J.target.value),children:t.map(J=>N.jsx("option",{value:J,children:J},J))})]}),N.jsxs("div",{style:{flex:1.05,minWidth:118},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"类别"}),N.jsx("select",{className:"select",value:a,onChange:J=>s(J.target.value),children:Object.keys(r[n]||{}).map(J=>N.jsx("option",{value:J,children:J},J))})]}),N.jsxs("div",{style:{flex:1.55,minWidth:176},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"具体知识点"}),N.jsx("select",{className:"select",value:o,onChange:J=>l(J.target.value),children:(((Ge=r[n])==null?void 0:Ge[a])||[]).map(J=>N.jsx("option",{value:J.code,children:J.name},J.code))})]})]}),z?N.jsxs(N.Fragment,{children:[N.jsxs("div",{className:"row",style:{alignItems:"flex-end",gap:8,flexWrap:"nowrap",marginTop:2},children:[N.jsxs("div",{style:{flex:1.05,minWidth:176},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"添加类别"}),N.jsx("div",{className:"row",style:{gap:8},children:N.jsx("input",{className:"input",style:{flex:1,height:42,paddingTop:0,paddingBottom:0},value:d,onChange:J=>v(J.target.value),placeholder:"输入新类别名称"})})]}),N.jsxs("div",{style:{flex:1.2,minWidth:196},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"添加具体知识点"}),N.jsx("div",{className:"row",style:{gap:8},children:N.jsx("input",{className:"input",style:{flex:1,height:42,paddingTop:0,paddingBottom:0},value:g,onChange:J=>m(J.target.value),placeholder:"如:一元一次不等式"})})]}),N.jsx("div",{style:{width:72,minWidth:72},children:N.jsx("button",{className:"btn",style:{width:"100%",height:42,padding:0,lineHeight:"42px",boxSizing:"border-box"},onClick:Se,disabled:C,children:"添加"})})]}),N.jsxs("div",{style:{marginTop:4},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"知识点编码(自动生成:年级码-类别码-序号-知识点名称)"}),N.jsx("input",{className:"input",value:He,readOnly:!0})]})]}):N.jsxs("div",{style:{marginBottom:10},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"知识点编码"}),N.jsx("input",{className:"input",value:c,readOnly:!0})]}),z?null:N.jsxs("div",{className:"row",style:{marginTop:4,justifyContent:"space-between",alignItems:"center",gap:8,flexWrap:"nowrap"},children:[N.jsx("div",{className:"muted",style:{fontSize:12},children:"当前为学生账号:仅可查询知识点。"}),N.jsx("button",{className:"btn",onClick:nt,disabled:C,children:"查询"})]}),_?N.jsx("div",{className:"error",style:{marginTop:12},children:_}):null,S?N.jsx("div",{className:"success",style:{marginTop:12},children:S}):null,N.jsxs("div",{style:{...xq,justifyContent:"space-between"},children:[N.jsx("div",{children:z?N.jsx("button",{className:"btn",onClick:()=>D(!0),disabled:C,children:"修改"}):null}),N.jsxs("div",{style:_q,children:[z?N.jsx("button",{className:"btn",onClick:nt,disabled:C,children:"查询"}):null,z?N.jsx("button",{className:"btn",type:"button",onClick:Q,disabled:C,children:"同步默认目录到 Neo4j"}):null,z?N.jsx("button",{className:"btn primary",onClick:De,disabled:C,children:"写入/更新"}):null]})]})]})]})}),z?N.jsx("div",{className:"col-12",children:N.jsxs("div",{className:"card",children:[N.jsx("div",{className:"card-header",children:N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"递进关系(手动连边)"})}),N.jsxs("div",{className:"card-body",style:{display:"flex",flexDirection:"column",gap:12},children:[!tt.length||!ot.length?N.jsx("div",{className:"muted",style:{fontSize:12},children:"当前所选年级/类别下知识点为空。先「同步默认目录到 Neo4j」或在知识图谱里先「写入/更新」对应知识点。"}):null,N.jsxs("div",{className:"row",style:{alignItems:"flex-end",gap:10,flexWrap:"wrap"},children:[N.jsxs("div",{style:{flex:1,minWidth:200},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"前置"}),N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"年级"}),N.jsx("select",{className:"select",value:ie,onChange:J=>le(J.target.value),children:Object.keys(r).map(J=>N.jsx("option",{value:J,children:J},J))}),N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6,marginTop:8},children:"类别"}),N.jsx("select",{className:"select",value:ce,onChange:J=>_e(J.target.value),children:Object.keys(r[ie]||{}).map(J=>N.jsx("option",{value:J,children:J},J))}),N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6,marginTop:8},children:"具体知识点"}),N.jsx("select",{className:"select",value:L,onChange:J=>Y(J.target.value),disabled:!tt.length,children:tt.map(J=>N.jsxs("option",{value:J.code,children:[(J.name||J.code).trim(),"(",J.code,")"]},J.code))})]}),N.jsxs("div",{style:{flex:1,minWidth:200},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"后置"}),N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"年级"}),N.jsx("select",{className:"select",value:pe,onChange:J=>ae(J.target.value),children:Object.keys(r).map(J=>N.jsx("option",{value:J,children:J},J))}),N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6,marginTop:8},children:"类别"}),N.jsx("select",{className:"select",value:oe,onChange:J=>de(J.target.value),children:Object.keys(r[pe]||{}).map(J=>N.jsx("option",{value:J,children:J},J))}),N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6,marginTop:8},children:"具体知识点"}),N.jsx("select",{className:"select",value:G,onChange:J=>re(J.target.value),disabled:!ot.length,children:ot.map(J=>N.jsxs("option",{value:J.code,children:[(J.name||J.code).trim(),"(",J.code,")"]},J.code))})]})]}),N.jsxs("div",{className:"row",style:{gap:8,justifyContent:"flex-end"},children:[N.jsx("button",{className:"btn primary",type:"button",onClick:ne,disabled:C||!L||!G||L===G,children:"建立递进关系"}),N.jsx("button",{className:"btn",type:"button",onClick:be,disabled:C||!L||!G,children:"解除递进关系"})]})]})]})}):null,N.jsx("div",{className:"col-12",children:N.jsxs("div",{className:"card",children:[N.jsxs("div",{className:"card-header",children:[N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"效果预览"}),N.jsx("div",{className:"muted",style:{marginTop:6},children:"展示查询与写入的返回数据"})]}),N.jsx("div",{className:"card-body",children:N.jsx("div",{style:{marginBottom:12,border:"1px solid #e5e7eb",borderRadius:10,padding:10,background:"#fafafa"},children:$?N.jsx(Eq,{preview:$,onSelectCode:J=>void ye(J)}):N.jsx("div",{className:"muted",style:{fontSize:12},children:"暂无预览数据"})})})]})}),O?N.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(17,24,39,0.35)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onClick:()=>D(!1),children:N.jsxs("div",{className:"card",style:{width:640,maxWidth:"92vw"},onClick:J=>J.stopPropagation(),children:[N.jsx("div",{className:"card-header",children:N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"修改类别与具体知识点"})}),N.jsxs("div",{className:"card-body",style:{display:"flex",flexDirection:"column",gap:12},children:[N.jsxs("div",{className:"row",style:{alignItems:"flex-end",gap:10},children:[N.jsxs("div",{style:{flex:1},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"选择类别"}),N.jsx("select",{className:"select",style:pv,value:I,onChange:J=>k(J.target.value),children:ct.map(J=>N.jsx("option",{value:J,children:J},J))})]}),N.jsxs("div",{style:{flex:1},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"类别新名称"}),N.jsx("input",{className:"input",style:pv,value:U,onChange:J=>V(J.target.value)})]}),N.jsx("button",{className:"btn",style:df,onClick:ke,children:"修改类别"}),N.jsx("button",{className:"btn danger",style:df,onClick:We,children:"删除类别"})]}),N.jsxs("div",{className:"row",style:{alignItems:"flex-end",gap:10},children:[N.jsxs("div",{style:{flex:1},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"选择具体知识点"}),N.jsxs("select",{className:"select",style:pv,value:X,onChange:J=>W(J.target.value),children:[N.jsx("option",{value:"",children:"请选择"}),Ze.map(J=>N.jsx("option",{value:J.code,children:J.name},J.code))]})]}),N.jsxs("div",{style:{flex:1},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"具体知识点新名称"}),N.jsx("input",{className:"input",style:pv,value:P,onChange:J=>H(J.target.value)})]}),N.jsx("button",{className:"btn",style:df,onClick:Ke,children:"修改知识点"}),N.jsx("button",{className:"btn danger",style:df,onClick:rt,children:"删除知识点"})]}),N.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:N.jsx("button",{className:"btn",style:df,onClick:()=>D(!1),children:"关闭"})})]})]})}):null]})}function Cq(r){var e=this.constructor;return this.then(function(t){return e.resolve(r()).then(function(){return t})},function(t){return e.resolve(r()).then(function(){return e.reject(t)})})}function Aq(r){var e=this;return new e(function(t,n){if(!(r&&typeof r.length<"u"))return n(new TypeError(typeof r+" "+r+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var i=Array.prototype.slice.call(r);if(i.length===0)return t([]);var a=i.length;function s(l,c){if(c&&(typeof c=="object"||typeof c=="function")){var h=c.then;if(typeof h=="function"){h.call(c,function(d){s(l,d)},function(d){i[l]={status:"rejected",reason:d},--a===0&&t(i)});return}}i[l]={status:"fulfilled",value:c},--a===0&&t(i)}for(var o=0;o<i.length;o++)s(o,i[o])})}function SO(r,e){this.name="AggregateError",this.errors=r,this.message=e||""}SO.prototype=Error.prototype;function Mq(r){var e=this;return new e(function(t,n){if(!(r&&typeof r.length<"u"))return n(new TypeError("Promise.any accepts an array"));var i=Array.prototype.slice.call(r);if(i.length===0)return n();for(var a=[],s=0;s<i.length;s++)try{e.resolve(i[s]).then(t).catch(function(o){a.push(o),a.length===i.length&&n(new SO(a,"All promises were rejected"))})}catch(o){n(o)}})}var Rq=setTimeout;function EO(r){return!!(r&&typeof r.length<"u")}function Oq(){}function Dq(r,e){return function(){r.apply(e,arguments)}}function tn(r){if(!(this instanceof tn))throw new TypeError("Promises must be constructed via new");if(typeof r!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],CO(r,this)}function TO(r,e){for(;r._state===3;)r=r._value;if(r._state===0){r._deferreds.push(e);return}r._handled=!0,tn._immediateFn(function(){var t=r._state===1?e.onFulfilled:e.onRejected;if(t===null){(r._state===1?x4:id)(e.promise,r._value);return}var n;try{n=t(r._value)}catch(i){id(e.promise,i);return}x4(e.promise,n)})}function x4(r,e){try{if(e===r)throw new TypeError("A promise cannot be resolved with itself.");if(e&&(typeof e=="object"||typeof e=="function")){var t=e.then;if(e instanceof tn){r._state=3,r._value=e,_4(r);return}else if(typeof t=="function"){CO(Dq(t,e),r);return}}r._state=1,r._value=e,_4(r)}catch(n){id(r,n)}}function id(r,e){r._state=2,r._value=e,_4(r)}function _4(r){r._state===2&&r._deferreds.length===0&&tn._immediateFn(function(){r._handled||tn._unhandledRejectionFn(r._value)});for(var e=0,t=r._deferreds.length;e<t;e++)TO(r,r._deferreds[e]);r._deferreds=null}function Pq(r,e,t){this.onFulfilled=typeof r=="function"?r:null,this.onRejected=typeof e=="function"?e:null,this.promise=t}function CO(r,e){var t=!1;try{r(function(n){t||(t=!0,x4(e,n))},function(n){t||(t=!0,id(e,n))})}catch(n){if(t)return;t=!0,id(e,n)}}tn.prototype.catch=function(r){return this.then(null,r)};tn.prototype.then=function(r,e){var t=new this.constructor(Oq);return TO(this,new Pq(r,e,t)),t};tn.prototype.finally=Cq;tn.all=function(r){return new tn(function(e,t){if(!EO(r))return t(new TypeError("Promise.all accepts an array"));var n=Array.prototype.slice.call(r);if(n.length===0)return e([]);var i=n.length;function a(o,l){try{if(l&&(typeof l=="object"||typeof l=="function")){var c=l.then;if(typeof c=="function"){c.call(l,function(h){a(o,h)},t);return}}n[o]=l,--i===0&&e(n)}catch(h){t(h)}}for(var s=0;s<n.length;s++)a(s,n[s])})};tn.any=Mq;tn.allSettled=Aq;tn.resolve=function(r){return r&&typeof r=="object"&&r.constructor===tn?r:new tn(function(e){e(r)})};tn.reject=function(r){return new tn(function(e,t){t(r)})};tn.race=function(r){return new tn(function(e,t){if(!EO(r))return t(new TypeError("Promise.race accepts an array"));for(var n=0,i=r.length;n<i;n++)tn.resolve(r[n]).then(e,t)})};tn._immediateFn=typeof setImmediate=="function"&&function(r){setImmediate(r)}||function(r){Rq(r,0)};tn._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};/*
  362. object-assign
  363. (c) Sindre Sorhus
  364. @license MIT
  365. */var V2,P7;function Iq(){if(P7)return V2;P7=1;var r=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function n(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function i(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var s={},o=0;o<10;o++)s["_"+String.fromCharCode(o)]=o;var l=Object.getOwnPropertyNames(s).map(function(h){return s[h]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(h){c[h]=h}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return V2=i()?Object.assign:function(a,s){for(var o,l=n(a),c,h=1;h<arguments.length;h++){o=Object(arguments[h]);for(var d in o)e.call(o,d)&&(l[d]=o[d]);if(r){c=r(o);for(var v=0;v<c.length;v++)t.call(o,c[v])&&(l[c[v]]=o[c[v]])}}return l},V2}var Nq=Iq();const Lq=cl(Nq);/*!
  366. * @pixi/polyfill - v6.5.10
  367. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  368. *
  369. * @pixi/polyfill is licensed under the MIT License.
  370. * http://www.opensource.org/licenses/mit-license
  371. */typeof globalThis>"u"&&(typeof self<"u"?self.globalThis=self:typeof global<"u"&&(global.globalThis=global));globalThis.Promise||(globalThis.Promise=tn);Object.assign||(Object.assign=Lq);var kq=16;Date.now&&Date.prototype.getTime||(Date.now=function(){return new Date().getTime()});if(!(globalThis.performance&&globalThis.performance.now)){var Bq=Date.now();globalThis.performance||(globalThis.performance={}),globalThis.performance.now=function(){return Date.now()-Bq}}var q2=Date.now(),I7=["ms","moz","webkit","o"];for(var X2=0;X2<I7.length&&!globalThis.requestAnimationFrame;++X2){var Y2=I7[X2];globalThis.requestAnimationFrame=globalThis[Y2+"RequestAnimationFrame"],globalThis.cancelAnimationFrame=globalThis[Y2+"CancelAnimationFrame"]||globalThis[Y2+"CancelRequestAnimationFrame"]}globalThis.requestAnimationFrame||(globalThis.requestAnimationFrame=function(r){if(typeof r!="function")throw new TypeError(r+"is not a function");var e=Date.now(),t=kq+q2-e;return t<0&&(t=0),q2=e,globalThis.self.setTimeout(function(){q2=Date.now(),r(performance.now())},t)});globalThis.cancelAnimationFrame||(globalThis.cancelAnimationFrame=function(r){return clearTimeout(r)});Math.sign||(Math.sign=function(e){return e=Number(e),e===0||isNaN(e)?e:e>0?1:-1});Number.isInteger||(Number.isInteger=function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e});globalThis.ArrayBuffer||(globalThis.ArrayBuffer=Array);globalThis.Float32Array||(globalThis.Float32Array=Array);globalThis.Uint32Array||(globalThis.Uint32Array=Array);globalThis.Uint16Array||(globalThis.Uint16Array=Array);globalThis.Uint8Array||(globalThis.Uint8Array=Array);globalThis.Int32Array||(globalThis.Int32Array=Array);/*!
  372. * @pixi/constants - v6.5.10
  373. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  374. *
  375. * @pixi/constants is licensed under the MIT License.
  376. * http://www.opensource.org/licenses/mit-license
  377. */var ns;(function(r){r[r.WEBGL_LEGACY=0]="WEBGL_LEGACY",r[r.WEBGL=1]="WEBGL",r[r.WEBGL2=2]="WEBGL2"})(ns||(ns={}));var Gc;(function(r){r[r.UNKNOWN=0]="UNKNOWN",r[r.WEBGL=1]="WEBGL",r[r.CANVAS=2]="CANVAS"})(Gc||(Gc={}));var ad;(function(r){r[r.COLOR=16384]="COLOR",r[r.DEPTH=256]="DEPTH",r[r.STENCIL=1024]="STENCIL"})(ad||(ad={}));var Et;(function(r){r[r.NORMAL=0]="NORMAL",r[r.ADD=1]="ADD",r[r.MULTIPLY=2]="MULTIPLY",r[r.SCREEN=3]="SCREEN",r[r.OVERLAY=4]="OVERLAY",r[r.DARKEN=5]="DARKEN",r[r.LIGHTEN=6]="LIGHTEN",r[r.COLOR_DODGE=7]="COLOR_DODGE",r[r.COLOR_BURN=8]="COLOR_BURN",r[r.HARD_LIGHT=9]="HARD_LIGHT",r[r.SOFT_LIGHT=10]="SOFT_LIGHT",r[r.DIFFERENCE=11]="DIFFERENCE",r[r.EXCLUSION=12]="EXCLUSION",r[r.HUE=13]="HUE",r[r.SATURATION=14]="SATURATION",r[r.COLOR=15]="COLOR",r[r.LUMINOSITY=16]="LUMINOSITY",r[r.NORMAL_NPM=17]="NORMAL_NPM",r[r.ADD_NPM=18]="ADD_NPM",r[r.SCREEN_NPM=19]="SCREEN_NPM",r[r.NONE=20]="NONE",r[r.SRC_OVER=0]="SRC_OVER",r[r.SRC_IN=21]="SRC_IN",r[r.SRC_OUT=22]="SRC_OUT",r[r.SRC_ATOP=23]="SRC_ATOP",r[r.DST_OVER=24]="DST_OVER",r[r.DST_IN=25]="DST_IN",r[r.DST_OUT=26]="DST_OUT",r[r.DST_ATOP=27]="DST_ATOP",r[r.ERASE=26]="ERASE",r[r.SUBTRACT=28]="SUBTRACT",r[r.XOR=29]="XOR"})(Et||(Et={}));var pa;(function(r){r[r.POINTS=0]="POINTS",r[r.LINES=1]="LINES",r[r.LINE_LOOP=2]="LINE_LOOP",r[r.LINE_STRIP=3]="LINE_STRIP",r[r.TRIANGLES=4]="TRIANGLES",r[r.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",r[r.TRIANGLE_FAN=6]="TRIANGLE_FAN"})(pa||(pa={}));var at;(function(r){r[r.RGBA=6408]="RGBA",r[r.RGB=6407]="RGB",r[r.RG=33319]="RG",r[r.RED=6403]="RED",r[r.RGBA_INTEGER=36249]="RGBA_INTEGER",r[r.RGB_INTEGER=36248]="RGB_INTEGER",r[r.RG_INTEGER=33320]="RG_INTEGER",r[r.RED_INTEGER=36244]="RED_INTEGER",r[r.ALPHA=6406]="ALPHA",r[r.LUMINANCE=6409]="LUMINANCE",r[r.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",r[r.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",r[r.DEPTH_STENCIL=34041]="DEPTH_STENCIL"})(at||(at={}));var Xo;(function(r){r[r.TEXTURE_2D=3553]="TEXTURE_2D",r[r.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",r[r.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",r[r.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",r[r.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",r[r.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",r[r.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"})(Xo||(Xo={}));var wt;(function(r){r[r.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",r[r.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",r[r.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",r[r.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",r[r.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",r[r.UNSIGNED_INT=5125]="UNSIGNED_INT",r[r.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",r[r.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",r[r.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",r[r.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",r[r.BYTE=5120]="BYTE",r[r.SHORT=5122]="SHORT",r[r.INT=5124]="INT",r[r.FLOAT=5126]="FLOAT",r[r.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",r[r.HALF_FLOAT=36193]="HALF_FLOAT"})(wt||(wt={}));var sd;(function(r){r[r.FLOAT=0]="FLOAT",r[r.INT=1]="INT",r[r.UINT=2]="UINT"})(sd||(sd={}));var Da;(function(r){r[r.NEAREST=0]="NEAREST",r[r.LINEAR=1]="LINEAR"})(Da||(Da={}));var Ia;(function(r){r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"})(Ia||(Ia={}));var ba;(function(r){r[r.OFF=0]="OFF",r[r.POW2=1]="POW2",r[r.ON=2]="ON",r[r.ON_MANUAL=3]="ON_MANUAL"})(ba||(ba={}));var xa;(function(r){r[r.NPM=0]="NPM",r[r.UNPACK=1]="UNPACK",r[r.PMA=2]="PMA",r[r.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",r[r.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",r[r.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",r[r.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"})(xa||(xa={}));var ha;(function(r){r[r.NO=0]="NO",r[r.YES=1]="YES",r[r.AUTO=2]="AUTO",r[r.BLEND=0]="BLEND",r[r.CLEAR=1]="CLEAR",r[r.BLIT=2]="BLIT"})(ha||(ha={}));var od;(function(r){r[r.AUTO=0]="AUTO",r[r.MANUAL=1]="MANUAL"})(od||(od={}));var Oi;(function(r){r.LOW="lowp",r.MEDIUM="mediump",r.HIGH="highp"})(Oi||(Oi={}));var vn;(function(r){r[r.NONE=0]="NONE",r[r.SCISSOR=1]="SCISSOR",r[r.STENCIL=2]="STENCIL",r[r.SPRITE=3]="SPRITE",r[r.COLOR=4]="COLOR"})(vn||(vn={}));var w4;(function(r){r[r.RED=1]="RED",r[r.GREEN=2]="GREEN",r[r.BLUE=4]="BLUE",r[r.ALPHA=8]="ALPHA"})(w4||(w4={}));var Fr;(function(r){r[r.NONE=0]="NONE",r[r.LOW=2]="LOW",r[r.MEDIUM=4]="MEDIUM",r[r.HIGH=8]="HIGH"})(Fr||(Fr={}));var Na;(function(r){r[r.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",r[r.ARRAY_BUFFER=34962]="ARRAY_BUFFER",r[r.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"})(Na||(Na={}));/*!
  378. * @pixi/settings - v6.5.10
  379. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  380. *
  381. * @pixi/settings is licensed under the MIT License.
  382. * http://www.opensource.org/licenses/mit-license
  383. */var AO={createCanvas:function(r,e){var t=document.createElement("canvas");return t.width=r,t.height=e,t},getWebGLRenderingContext:function(){return WebGLRenderingContext},getNavigator:function(){return navigator},getBaseUrl:function(){var r;return(r=document.baseURI)!==null&&r!==void 0?r:window.location.href},fetch:function(r,e){return fetch(r,e)}},W2=/iPhone/i,N7=/iPod/i,L7=/iPad/i,k7=/\biOS-universal(?:.+)Mac\b/i,$2=/\bAndroid(?:.+)Mobile\b/i,B7=/Android/i,vc=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,gv=/Silk/i,Ps=/Windows Phone/i,F7=/\bWindows(?:.+)ARM\b/i,z7=/BlackBerry/i,U7=/BB10/i,G7=/Opera Mini/i,H7=/\b(CriOS|Chrome)(?:.+)Mobile/i,j7=/Mobile(?:.+)Firefox\b/i,V7=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};function Fq(r){return function(e){return e.test(r)}}function zq(r){var e={userAgent:"",platform:"",maxTouchPoints:0};!r&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof r=="string"?e.userAgent=r:r&&r.userAgent&&(e={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0});var t=e.userAgent,n=t.split("[FBAN");typeof n[1]<"u"&&(t=n[0]),n=t.split("Twitter"),typeof n[1]<"u"&&(t=n[0]);var i=Fq(t),a={apple:{phone:i(W2)&&!i(Ps),ipod:i(N7),tablet:!i(W2)&&(i(L7)||V7(e))&&!i(Ps),universal:i(k7),device:(i(W2)||i(N7)||i(L7)||i(k7)||V7(e))&&!i(Ps)},amazon:{phone:i(vc),tablet:!i(vc)&&i(gv),device:i(vc)||i(gv)},android:{phone:!i(Ps)&&i(vc)||!i(Ps)&&i($2),tablet:!i(Ps)&&!i(vc)&&!i($2)&&(i(gv)||i(B7)),device:!i(Ps)&&(i(vc)||i(gv)||i($2)||i(B7))||i(/\bokhttp\b/i)},windows:{phone:i(Ps),tablet:i(F7),device:i(Ps)||i(F7)},other:{blackberry:i(z7),blackberry10:i(U7),opera:i(G7),firefox:i(j7),chrome:i(H7),device:i(z7)||i(U7)||i(G7)||i(j7)||i(H7)},any:!1,phone:!1,tablet:!1};return a.any=a.apple.device||a.android.device||a.windows.device||a.other.device,a.phone=a.apple.phone||a.android.phone||a.windows.phone,a.tablet=a.apple.tablet||a.android.tablet||a.windows.tablet,a}var ga=zq(globalThis.navigator);function Uq(){return!ga.apple.device}function Gq(r){var e=!0;if(ga.tablet||ga.phone){if(ga.apple.device){var t=navigator.userAgent.match(/OS (\d+)_(\d+)?/);if(t){var n=parseInt(t[1],10);n<11&&(e=!1)}}if(ga.android.device){var t=navigator.userAgent.match(/Android\s([0-9.]*)/);if(t){var n=parseInt(t[1],10);n<7&&(e=!1)}}}return e?r:4}var ht={ADAPTER:AO,MIPMAP_TEXTURES:ba.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:Fr.NONE,SPRITE_MAX_TEXTURES:Gq(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,width:800,height:600,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,antialias:!1,preserveDrawingBuffer:!1},GC_MODE:od.AUTO,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:Ia.CLAMP,SCALE_MODE:Da.LINEAR,PRECISION_VERTEX:Oi.HIGH,PRECISION_FRAGMENT:ga.apple.device?Oi.HIGH:Oi.MEDIUM,CAN_UPLOAD_SAME_BUFFER:Uq(),CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},K2={exports:{}},q7;function Hq(){return q7||(q7=1,(function(r){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function i(l,c,h){this.fn=l,this.context=c,this.once=h||!1}function a(l,c,h,d,v){if(typeof h!="function")throw new TypeError("The listener must be a function");var g=new i(h,d||l,v),m=t?t+c:c;return l._events[m]?l._events[m].fn?l._events[m]=[l._events[m],g]:l._events[m].push(g):(l._events[m]=g,l._eventsCount++),l}function s(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var c=[],h,d;if(this._eventsCount===0)return c;for(d in h=this._events)e.call(h,d)&&c.push(t?d.slice(1):d);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(h)):c},o.prototype.listeners=function(c){var h=t?t+c:c,d=this._events[h];if(!d)return[];if(d.fn)return[d.fn];for(var v=0,g=d.length,m=new Array(g);v<g;v++)m[v]=d[v].fn;return m},o.prototype.listenerCount=function(c){var h=t?t+c:c,d=this._events[h];return d?d.fn?1:d.length:0},o.prototype.emit=function(c,h,d,v,g,m){var x=t?t+c:c;if(!this._events[x])return!1;var y=this._events[x],_=arguments.length,w,S;if(y.fn){switch(y.once&&this.removeListener(c,y.fn,void 0,!0),_){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,h),!0;case 3:return y.fn.call(y.context,h,d),!0;case 4:return y.fn.call(y.context,h,d,v),!0;case 5:return y.fn.call(y.context,h,d,v,g),!0;case 6:return y.fn.call(y.context,h,d,v,g,m),!0}for(S=1,w=new Array(_-1);S<_;S++)w[S-1]=arguments[S];y.fn.apply(y.context,w)}else{var A=y.length,C;for(S=0;S<A;S++)switch(y[S].once&&this.removeListener(c,y[S].fn,void 0,!0),_){case 1:y[S].fn.call(y[S].context);break;case 2:y[S].fn.call(y[S].context,h);break;case 3:y[S].fn.call(y[S].context,h,d);break;case 4:y[S].fn.call(y[S].context,h,d,v);break;default:if(!w)for(C=1,w=new Array(_-1);C<_;C++)w[C-1]=arguments[C];y[S].fn.apply(y[S].context,w)}}return!0},o.prototype.on=function(c,h,d){return a(this,c,h,d,!1)},o.prototype.once=function(c,h,d){return a(this,c,h,d,!0)},o.prototype.removeListener=function(c,h,d,v){var g=t?t+c:c;if(!this._events[g])return this;if(!h)return s(this,g),this;var m=this._events[g];if(m.fn)m.fn===h&&(!v||m.once)&&(!d||m.context===d)&&s(this,g);else{for(var x=0,y=[],_=m.length;x<_;x++)(m[x].fn!==h||v&&!m[x].once||d&&m[x].context!==d)&&y.push(m[x]);y.length?this._events[g]=y.length===1?y[0]:y:s(this,g)}return this},o.prototype.removeAllListeners=function(c){var h;return c?(h=t?t+c:c,this._events[h]&&s(this,h)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=t,o.EventEmitter=o,r.exports=o})(K2)),K2.exports}var jq=Hq();const Ks=cl(jq);var mv={exports:{}},X7;function Vq(){if(X7)return mv.exports;X7=1,mv.exports=r,mv.exports.default=r;function r(P,H,z){z=z||2;var $=H&&H.length,B=$?H[0]*z:P.length,L=e(P,0,B,z,!0),Y=[];if(!L||L.next===L.prev)return Y;var G,re,ie,le,ce,_e,pe;if($&&(L=l(P,H,L,z)),P.length>80*z){G=ie=P[0],re=le=P[1];for(var ae=z;ae<B;ae+=z)ce=P[ae],_e=P[ae+1],ce<G&&(G=ce),_e<re&&(re=_e),ce>ie&&(ie=ce),_e>le&&(le=_e);pe=Math.max(ie-G,le-re),pe=pe!==0?32767/pe:0}return n(L,Y,z,G,re,pe,0),Y}function e(P,H,z,$,B){var L,Y;if(B===W(P,H,z,$)>0)for(L=H;L<z;L+=$)Y=U(L,P[L],P[L+1],Y);else for(L=z-$;L>=H;L-=$)Y=U(L,P[L],P[L+1],Y);return Y&&A(Y,Y.next)&&(V(Y),Y=Y.next),Y}function t(P,H){if(!P)return P;H||(H=P);var z=P,$;do if($=!1,!z.steiner&&(A(z,z.next)||S(z.prev,z,z.next)===0)){if(V(z),z=H=z.prev,z===z.next)break;$=!0}else z=z.next;while($||z!==H);return H}function n(P,H,z,$,B,L,Y){if(P){!Y&&L&&g(P,$,B,L);for(var G=P,re,ie;P.prev!==P.next;){if(re=P.prev,ie=P.next,L?a(P,$,B,L):i(P)){H.push(re.i/z|0),H.push(P.i/z|0),H.push(ie.i/z|0),V(P),P=ie.next,G=ie.next;continue}if(P=ie,P===G){Y?Y===1?(P=s(t(P),H,z),n(P,H,z,$,B,L,2)):Y===2&&o(P,H,z,$,B,L):n(t(P),H,z,$,B,L,1);break}}}}function i(P){var H=P.prev,z=P,$=P.next;if(S(H,z,$)>=0)return!1;for(var B=H.x,L=z.x,Y=$.x,G=H.y,re=z.y,ie=$.y,le=B<L?B<Y?B:Y:L<Y?L:Y,ce=G<re?G<ie?G:ie:re<ie?re:ie,_e=B>L?B>Y?B:Y:L>Y?L:Y,pe=G>re?G>ie?G:ie:re>ie?re:ie,ae=$.next;ae!==H;){if(ae.x>=le&&ae.x<=_e&&ae.y>=ce&&ae.y<=pe&&_(B,G,L,re,Y,ie,ae.x,ae.y)&&S(ae.prev,ae,ae.next)>=0)return!1;ae=ae.next}return!0}function a(P,H,z,$){var B=P.prev,L=P,Y=P.next;if(S(B,L,Y)>=0)return!1;for(var G=B.x,re=L.x,ie=Y.x,le=B.y,ce=L.y,_e=Y.y,pe=G<re?G<ie?G:ie:re<ie?re:ie,ae=le<ce?le<_e?le:_e:ce<_e?ce:_e,oe=G>re?G>ie?G:ie:re>ie?re:ie,de=le>ce?le>_e?le:_e:ce>_e?ce:_e,ye=x(pe,ae,H,z,$),Ee=x(oe,de,H,z,$),Re=P.prevZ,Ne=P.nextZ;Re&&Re.z>=ye&&Ne&&Ne.z<=Ee;){if(Re.x>=pe&&Re.x<=oe&&Re.y>=ae&&Re.y<=de&&Re!==B&&Re!==Y&&_(G,le,re,ce,ie,_e,Re.x,Re.y)&&S(Re.prev,Re,Re.next)>=0||(Re=Re.prevZ,Ne.x>=pe&&Ne.x<=oe&&Ne.y>=ae&&Ne.y<=de&&Ne!==B&&Ne!==Y&&_(G,le,re,ce,ie,_e,Ne.x,Ne.y)&&S(Ne.prev,Ne,Ne.next)>=0))return!1;Ne=Ne.nextZ}for(;Re&&Re.z>=ye;){if(Re.x>=pe&&Re.x<=oe&&Re.y>=ae&&Re.y<=de&&Re!==B&&Re!==Y&&_(G,le,re,ce,ie,_e,Re.x,Re.y)&&S(Re.prev,Re,Re.next)>=0)return!1;Re=Re.prevZ}for(;Ne&&Ne.z<=Ee;){if(Ne.x>=pe&&Ne.x<=oe&&Ne.y>=ae&&Ne.y<=de&&Ne!==B&&Ne!==Y&&_(G,le,re,ce,ie,_e,Ne.x,Ne.y)&&S(Ne.prev,Ne,Ne.next)>=0)return!1;Ne=Ne.nextZ}return!0}function s(P,H,z){var $=P;do{var B=$.prev,L=$.next.next;!A(B,L)&&C(B,$,$.next,L)&&D(B,L)&&D(L,B)&&(H.push(B.i/z|0),H.push($.i/z|0),H.push(L.i/z|0),V($),V($.next),$=P=L),$=$.next}while($!==P);return t($)}function o(P,H,z,$,B,L){var Y=P;do{for(var G=Y.next.next;G!==Y.prev;){if(Y.i!==G.i&&w(Y,G)){var re=k(Y,G);Y=t(Y,Y.next),re=t(re,re.next),n(Y,H,z,$,B,L,0),n(re,H,z,$,B,L,0);return}G=G.next}Y=Y.next}while(Y!==P)}function l(P,H,z,$){var B=[],L,Y,G,re,ie;for(L=0,Y=H.length;L<Y;L++)G=H[L]*$,re=L<Y-1?H[L+1]*$:P.length,ie=e(P,G,re,$,!1),ie===ie.next&&(ie.steiner=!0),B.push(y(ie));for(B.sort(c),L=0;L<B.length;L++)z=h(B[L],z);return z}function c(P,H){return P.x-H.x}function h(P,H){var z=d(P,H);if(!z)return H;var $=k(z,P);return t($,$.next),t(z,z.next)}function d(P,H){var z=H,$=P.x,B=P.y,L=-1/0,Y;do{if(B<=z.y&&B>=z.next.y&&z.next.y!==z.y){var G=z.x+(B-z.y)*(z.next.x-z.x)/(z.next.y-z.y);if(G<=$&&G>L&&(L=G,Y=z.x<z.next.x?z:z.next,G===$))return Y}z=z.next}while(z!==H);if(!Y)return null;var re=Y,ie=Y.x,le=Y.y,ce=1/0,_e;z=Y;do $>=z.x&&z.x>=ie&&$!==z.x&&_(B<le?$:L,B,ie,le,B<le?L:$,B,z.x,z.y)&&(_e=Math.abs(B-z.y)/($-z.x),D(z,P)&&(_e<ce||_e===ce&&(z.x>Y.x||z.x===Y.x&&v(Y,z)))&&(Y=z,ce=_e)),z=z.next;while(z!==re);return Y}function v(P,H){return S(P.prev,P,H.prev)<0&&S(H.next,P,P.next)<0}function g(P,H,z,$){var B=P;do B.z===0&&(B.z=x(B.x,B.y,H,z,$)),B.prevZ=B.prev,B.nextZ=B.next,B=B.next;while(B!==P);B.prevZ.nextZ=null,B.prevZ=null,m(B)}function m(P){var H,z,$,B,L,Y,G,re,ie=1;do{for(z=P,P=null,L=null,Y=0;z;){for(Y++,$=z,G=0,H=0;H<ie&&(G++,$=$.nextZ,!!$);H++);for(re=ie;G>0||re>0&&$;)G!==0&&(re===0||!$||z.z<=$.z)?(B=z,z=z.nextZ,G--):(B=$,$=$.nextZ,re--),L?L.nextZ=B:P=B,B.prevZ=L,L=B;z=$}L.nextZ=null,ie*=2}while(Y>1);return P}function x(P,H,z,$,B){return P=(P-z)*B|0,H=(H-$)*B|0,P=(P|P<<8)&16711935,P=(P|P<<4)&252645135,P=(P|P<<2)&858993459,P=(P|P<<1)&1431655765,H=(H|H<<8)&16711935,H=(H|H<<4)&252645135,H=(H|H<<2)&858993459,H=(H|H<<1)&1431655765,P|H<<1}function y(P){var H=P,z=P;do(H.x<z.x||H.x===z.x&&H.y<z.y)&&(z=H),H=H.next;while(H!==P);return z}function _(P,H,z,$,B,L,Y,G){return(B-Y)*(H-G)>=(P-Y)*(L-G)&&(P-Y)*($-G)>=(z-Y)*(H-G)&&(z-Y)*(L-G)>=(B-Y)*($-G)}function w(P,H){return P.next.i!==H.i&&P.prev.i!==H.i&&!O(P,H)&&(D(P,H)&&D(H,P)&&I(P,H)&&(S(P.prev,P,H.prev)||S(P,H.prev,H))||A(P,H)&&S(P.prev,P,P.next)>0&&S(H.prev,H,H.next)>0)}function S(P,H,z){return(H.y-P.y)*(z.x-H.x)-(H.x-P.x)*(z.y-H.y)}function A(P,H){return P.x===H.x&&P.y===H.y}function C(P,H,z,$){var B=E(S(P,H,z)),L=E(S(P,H,$)),Y=E(S(z,$,P)),G=E(S(z,$,H));return!!(B!==L&&Y!==G||B===0&&M(P,z,H)||L===0&&M(P,$,H)||Y===0&&M(z,P,$)||G===0&&M(z,H,$))}function M(P,H,z){return H.x<=Math.max(P.x,z.x)&&H.x>=Math.min(P.x,z.x)&&H.y<=Math.max(P.y,z.y)&&H.y>=Math.min(P.y,z.y)}function E(P){return P>0?1:P<0?-1:0}function O(P,H){var z=P;do{if(z.i!==P.i&&z.next.i!==P.i&&z.i!==H.i&&z.next.i!==H.i&&C(z,z.next,P,H))return!0;z=z.next}while(z!==P);return!1}function D(P,H){return S(P.prev,P,P.next)<0?S(P,H,P.next)>=0&&S(P,P.prev,H)>=0:S(P,H,P.prev)<0||S(P,P.next,H)<0}function I(P,H){var z=P,$=!1,B=(P.x+H.x)/2,L=(P.y+H.y)/2;do z.y>L!=z.next.y>L&&z.next.y!==z.y&&B<(z.next.x-z.x)*(L-z.y)/(z.next.y-z.y)+z.x&&($=!$),z=z.next;while(z!==P);return $}function k(P,H){var z=new X(P.i,P.x,P.y),$=new X(H.i,H.x,H.y),B=P.next,L=H.prev;return P.next=H,H.prev=P,z.next=B,B.prev=z,$.next=z,z.prev=$,L.next=$,$.prev=L,$}function U(P,H,z,$){var B=new X(P,H,z);return $?(B.next=$.next,B.prev=$,$.next.prev=B,$.next=B):(B.prev=B,B.next=B),B}function V(P){P.next.prev=P.prev,P.prev.next=P.next,P.prevZ&&(P.prevZ.nextZ=P.nextZ),P.nextZ&&(P.nextZ.prevZ=P.prevZ)}function X(P,H,z){this.i=P,this.x=H,this.y=z,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}r.deviation=function(P,H,z,$){var B=H&&H.length,L=B?H[0]*z:P.length,Y=Math.abs(W(P,0,L,z));if(B)for(var G=0,re=H.length;G<re;G++){var ie=H[G]*z,le=G<re-1?H[G+1]*z:P.length;Y-=Math.abs(W(P,ie,le,z))}var ce=0;for(G=0;G<$.length;G+=3){var _e=$[G]*z,pe=$[G+1]*z,ae=$[G+2]*z;ce+=Math.abs((P[_e]-P[ae])*(P[pe+1]-P[_e+1])-(P[_e]-P[pe])*(P[ae+1]-P[_e+1]))}return Y===0&&ce===0?0:Math.abs((ce-Y)/Y)};function W(P,H,z,$){for(var B=0,L=H,Y=z-$;L<z;L+=$)B+=(P[Y]-P[L])*(P[L+1]+P[Y+1]),Y=L;return B}return r.flatten=function(P){for(var H=P[0][0].length,z={vertices:[],holes:[],dimensions:H},$=0,B=0;B<P.length;B++){for(var L=0;L<P[B].length;L++)for(var Y=0;Y<H;Y++)z.vertices.push(P[B][L][Y]);B>0&&($+=P[B-1].length,z.holes.push($))}return z},mv.exports}var qq=Vq();const pw=cl(qq);var Fl={},Of={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var Xq=Of.exports,Y7;function Yq(){return Y7||(Y7=1,(function(r,e){(function(t){var n=e&&!e.nodeType&&e,i=r&&!r.nodeType&&r,a=typeof wp=="object"&&wp;(a.global===a||a.window===a||a.self===a)&&(t=a);var s,o=2147483647,l=36,c=1,h=26,d=38,v=700,g=72,m=128,x="-",y=/^xn--/,_=/[^\x20-\x7E]/,w=/[\x2E\u3002\uFF0E\uFF61]/g,S={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=l-c,C=Math.floor,M=String.fromCharCode,E;function O(B){throw new RangeError(S[B])}function D(B,L){for(var Y=B.length,G=[];Y--;)G[Y]=L(B[Y]);return G}function I(B,L){var Y=B.split("@"),G="";Y.length>1&&(G=Y[0]+"@",B=Y[1]),B=B.replace(w,".");var re=B.split("."),ie=D(re,L).join(".");return G+ie}function k(B){for(var L=[],Y=0,G=B.length,re,ie;Y<G;)re=B.charCodeAt(Y++),re>=55296&&re<=56319&&Y<G?(ie=B.charCodeAt(Y++),(ie&64512)==56320?L.push(((re&1023)<<10)+(ie&1023)+65536):(L.push(re),Y--)):L.push(re);return L}function U(B){return D(B,function(L){var Y="";return L>65535&&(L-=65536,Y+=M(L>>>10&1023|55296),L=56320|L&1023),Y+=M(L),Y}).join("")}function V(B){return B-48<10?B-22:B-65<26?B-65:B-97<26?B-97:l}function X(B,L){return B+22+75*(B<26)-((L!=0)<<5)}function W(B,L,Y){var G=0;for(B=Y?C(B/v):B>>1,B+=C(B/L);B>A*h>>1;G+=l)B=C(B/A);return C(G+(A+1)*B/(B+d))}function P(B){var L=[],Y=B.length,G,re=0,ie=m,le=g,ce,_e,pe,ae,oe,de,ye,Ee,Re;for(ce=B.lastIndexOf(x),ce<0&&(ce=0),_e=0;_e<ce;++_e)B.charCodeAt(_e)>=128&&O("not-basic"),L.push(B.charCodeAt(_e));for(pe=ce>0?ce+1:0;pe<Y;){for(ae=re,oe=1,de=l;pe>=Y&&O("invalid-input"),ye=V(B.charCodeAt(pe++)),(ye>=l||ye>C((o-re)/oe))&&O("overflow"),re+=ye*oe,Ee=de<=le?c:de>=le+h?h:de-le,!(ye<Ee);de+=l)Re=l-Ee,oe>C(o/Re)&&O("overflow"),oe*=Re;G=L.length+1,le=W(re-ae,G,ae==0),C(re/G)>o-ie&&O("overflow"),ie+=C(re/G),re%=G,L.splice(re++,0,ie)}return U(L)}function H(B){var L,Y,G,re,ie,le,ce,_e,pe,ae,oe,de=[],ye,Ee,Re,Ne;for(B=k(B),ye=B.length,L=m,Y=0,ie=g,le=0;le<ye;++le)oe=B[le],oe<128&&de.push(M(oe));for(G=re=de.length,re&&de.push(x);G<ye;){for(ce=o,le=0;le<ye;++le)oe=B[le],oe>=L&&oe<ce&&(ce=oe);for(Ee=G+1,ce-L>C((o-Y)/Ee)&&O("overflow"),Y+=(ce-L)*Ee,L=ce,le=0;le<ye;++le)if(oe=B[le],oe<L&&++Y>o&&O("overflow"),oe==L){for(_e=Y,pe=l;ae=pe<=ie?c:pe>=ie+h?h:pe-ie,!(_e<ae);pe+=l)Ne=_e-ae,Re=l-ae,de.push(M(X(ae+Ne%Re,0))),_e=C(Ne/Re);de.push(M(X(_e,0))),ie=W(Y,Ee,G==re),Y=0,++G}++Y,++L}return de.join("")}function z(B){return I(B,function(L){return y.test(L)?P(L.slice(4).toLowerCase()):L})}function $(B){return I(B,function(L){return _.test(L)?"xn--"+H(L):L})}if(s={version:"1.4.1",ucs2:{decode:k,encode:U},decode:P,encode:H,toASCII:$,toUnicode:z},n&&i)if(r.exports==n)i.exports=s;else for(E in s)s.hasOwnProperty(E)&&(n[E]=s[E]);else t.punycode=s})(Xq)})(Of,Of.exports)),Of.exports}var Z2,W7;function ih(){return W7||(W7=1,Z2=TypeError),Z2}const Wq={},$q=Object.freeze(Object.defineProperty({__proto__:null,default:Wq},Symbol.toStringTag,{value:"Module"})),Kq=Nk($q);var Q2,$7;function _g(){if($7)return Q2;$7=1;var r=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,t=r&&e&&typeof e.get=="function"?e.get:null,n=r&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,a=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=i&&a&&typeof a.get=="function"?a.get:null,o=i&&Set.prototype.forEach,l=typeof WeakMap=="function"&&WeakMap.prototype,c=l?WeakMap.prototype.has:null,h=typeof WeakSet=="function"&&WeakSet.prototype,d=h?WeakSet.prototype.has:null,v=typeof WeakRef=="function"&&WeakRef.prototype,g=v?WeakRef.prototype.deref:null,m=Boolean.prototype.valueOf,x=Object.prototype.toString,y=Function.prototype.toString,_=String.prototype.match,w=String.prototype.slice,S=String.prototype.replace,A=String.prototype.toUpperCase,C=String.prototype.toLowerCase,M=RegExp.prototype.test,E=Array.prototype.concat,O=Array.prototype.join,D=Array.prototype.slice,I=Math.floor,k=typeof BigInt=="function"?BigInt.prototype.valueOf:null,U=Object.getOwnPropertySymbols,V=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,X=typeof Symbol=="function"&&typeof Symbol.iterator=="object",W=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===X||!0)?Symbol.toStringTag:null,P=Object.prototype.propertyIsEnumerable,H=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(ee){return ee.__proto__}:null);function z(ee,se){if(ee===1/0||ee===-1/0||ee!==ee||ee&&ee>-1e3&&ee<1e3||M.call(/e/,se))return se;var Pe=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof ee=="number"){var Ae=ee<0?-I(-ee):I(ee);if(Ae!==ee){var Ge=String(Ae),J=w.call(se,Ge.length+1);return S.call(Ge,Pe,"$&_")+"."+S.call(S.call(J,/([0-9]{3})/g,"$&_"),/_$/,"")}}return S.call(se,Pe,"$&_")}var $=Kq,B=$.custom,L=Ee(B)?B:null,Y={__proto__:null,double:'"',single:"'"},G={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Q2=function ee(se,Pe,Ae,Ge){var J=Pe||{};if(Be(J,"quoteStyle")&&!Be(Y,J.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Be(J,"maxStringLength")&&(typeof J.maxStringLength=="number"?J.maxStringLength<0&&J.maxStringLength!==1/0:J.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Oe=Be(J,"customInspect")?J.customInspect:!0;if(typeof Oe!="boolean"&&Oe!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Be(J,"indent")&&J.indent!==null&&J.indent!==" "&&!(parseInt(J.indent,10)===J.indent&&J.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Be(J,"numericSeparator")&&typeof J.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Ve=J.numericSeparator;if(typeof se>"u")return"undefined";if(se===null)return"null";if(typeof se=="boolean")return se?"true":"false";if(typeof se=="string")return ke(se,J);if(typeof se=="number"){if(se===0)return 1/0/se>0?"0":"-0";var Ue=String(se);return Ve?z(se,Ue):Ue}if(typeof se=="bigint"){var je=String(se)+"n";return Ve?z(se,je):je}var yt=typeof J.depth>"u"?5:J.depth;if(typeof Ae>"u"&&(Ae=0),Ae>=yt&&yt>0&&typeof se=="object")return ce(se)?"[Array]":"[Object]";var vt=Q(J,Ae);if(typeof Ge>"u")Ge=[];else if(He(Ge,se)>=0)return"[Circular]";function Ot(st,lt,Ut){if(lt&&(Ge=D.call(Ge),Ge.push(lt)),Ut){var br={depth:J.depth};return Be(J,"quoteStyle")&&(br.quoteStyle=J.quoteStyle),ee(st,br,Ae+1,Ge)}return ee(st,J,Ae+1,Ge)}if(typeof se=="function"&&!pe(se)){var jt=Ye(se),Nr=be(se,Ot);return"[Function"+(jt?": "+jt:" (anonymous)")+"]"+(Nr.length>0?" { "+O.call(Nr,", ")+" }":"")}if(Ee(se)){var Vt=X?S.call(String(se),/^(Symbol\(.*\))_[^)]*$/,"$1"):V.call(se);return typeof se=="object"&&!X?Ke(Vt):Vt}if(Se(se)){for(var Qt="<"+C.call(String(se.nodeName)),rr=se.attributes||[],ur=0;ur<rr.length;ur++)Qt+=" "+rr[ur].name+"="+re(ie(rr[ur].value),"double",J);return Qt+=">",se.childNodes&&se.childNodes.length&&(Qt+="..."),Qt+="</"+C.call(String(se.nodeName))+">",Qt}if(ce(se)){if(se.length===0)return"[]";var In=be(se,Ot);return vt&&!De(In)?"["+ne(In,vt)+"]":"[ "+O.call(In,", ")+" ]"}if(ae(se)){var vr=be(se,Ot);return!("cause"in Error.prototype)&&"cause"in se&&!P.call(se,"cause")?"{ ["+String(se)+"] "+O.call(E.call("[cause]: "+Ot(se.cause),vr),", ")+" }":vr.length===0?"["+String(se)+"]":"{ ["+String(se)+"] "+O.call(vr,", ")+" }"}if(typeof se=="object"&&Oe){if(L&&typeof se[L]=="function"&&$)return $(se,{depth:yt-Ae});if(Oe!=="symbol"&&typeof se.inspect=="function")return se.inspect()}if(tt(se)){var Gn=[];return n&&n.call(se,function(st,lt){Gn.push(Ot(lt,se,!0)+" => "+Ot(st,se))}),nt("Map",t.call(se),Gn,vt)}if(Ze(se)){var Yr=[];return o&&o.call(se,function(st){Yr.push(Ot(st,se))}),nt("Set",s.call(se),Yr,vt)}if(ot(se))return rt("WeakMap");if(bt(se))return rt("WeakSet");if(ct(se))return rt("WeakRef");if(de(se))return Ke(Ot(Number(se)));if(Re(se))return Ke(Ot(k.call(se)));if(ye(se))return Ke(m.call(se));if(oe(se))return Ke(Ot(String(se)));if(typeof window<"u"&&se===window)return"{ [object Window] }";if(typeof globalThis<"u"&&se===globalThis||typeof wp<"u"&&se===wp)return"{ [object globalThis] }";if(!_e(se)&&!pe(se)){var nr=be(se,Ot),Lr=H?H(se)===Object.prototype:se instanceof Object||se.constructor===Object,cn=se instanceof Object?"":"null prototype",Ur=!Lr&&W&&Object(se)===se&&W in se?w.call($e(se),8,-1):cn?"Object":"",Wr=Lr||typeof se.constructor!="function"?"":se.constructor.name?se.constructor.name+" ":"",xe=Wr+(Ur||cn?"["+O.call(E.call([],Ur||[],cn||[]),": ")+"] ":"");return nr.length===0?xe+"{}":vt?xe+"{"+ne(nr,vt)+"}":xe+"{ "+O.call(nr,", ")+" }"}return String(se)};function re(ee,se,Pe){var Ae=Pe.quoteStyle||se,Ge=Y[Ae];return Ge+ee+Ge}function ie(ee){return S.call(String(ee),/"/g,"&quot;")}function le(ee){return!W||!(typeof ee=="object"&&(W in ee||typeof ee[W]<"u"))}function ce(ee){return $e(ee)==="[object Array]"&&le(ee)}function _e(ee){return $e(ee)==="[object Date]"&&le(ee)}function pe(ee){return $e(ee)==="[object RegExp]"&&le(ee)}function ae(ee){return $e(ee)==="[object Error]"&&le(ee)}function oe(ee){return $e(ee)==="[object String]"&&le(ee)}function de(ee){return $e(ee)==="[object Number]"&&le(ee)}function ye(ee){return $e(ee)==="[object Boolean]"&&le(ee)}function Ee(ee){if(X)return ee&&typeof ee=="object"&&ee instanceof Symbol;if(typeof ee=="symbol")return!0;if(!ee||typeof ee!="object"||!V)return!1;try{return V.call(ee),!0}catch{}return!1}function Re(ee){if(!ee||typeof ee!="object"||!k)return!1;try{return k.call(ee),!0}catch{}return!1}var Ne=Object.prototype.hasOwnProperty||function(ee){return ee in this};function Be(ee,se){return Ne.call(ee,se)}function $e(ee){return x.call(ee)}function Ye(ee){if(ee.name)return ee.name;var se=_.call(y.call(ee),/^function\s*([\w$]+)/);return se?se[1]:null}function He(ee,se){if(ee.indexOf)return ee.indexOf(se);for(var Pe=0,Ae=ee.length;Pe<Ae;Pe++)if(ee[Pe]===se)return Pe;return-1}function tt(ee){if(!t||!ee||typeof ee!="object")return!1;try{t.call(ee);try{s.call(ee)}catch{return!0}return ee instanceof Map}catch{}return!1}function ot(ee){if(!c||!ee||typeof ee!="object")return!1;try{c.call(ee,c);try{d.call(ee,d)}catch{return!0}return ee instanceof WeakMap}catch{}return!1}function ct(ee){if(!g||!ee||typeof ee!="object")return!1;try{return g.call(ee),!0}catch{}return!1}function Ze(ee){if(!s||!ee||typeof ee!="object")return!1;try{s.call(ee);try{t.call(ee)}catch{return!0}return ee instanceof Set}catch{}return!1}function bt(ee){if(!d||!ee||typeof ee!="object")return!1;try{d.call(ee,d);try{c.call(ee,c)}catch{return!0}return ee instanceof WeakSet}catch{}return!1}function Se(ee){return!ee||typeof ee!="object"?!1:typeof HTMLElement<"u"&&ee instanceof HTMLElement?!0:typeof ee.nodeName=="string"&&typeof ee.getAttribute=="function"}function ke(ee,se){if(ee.length>se.maxStringLength){var Pe=ee.length-se.maxStringLength,Ae="... "+Pe+" more character"+(Pe>1?"s":"");return ke(w.call(ee,0,se.maxStringLength),se)+Ae}var Ge=G[se.quoteStyle||"single"];Ge.lastIndex=0;var J=S.call(S.call(ee,Ge,"\\$1"),/[\x00-\x1f]/g,We);return re(J,"single",se)}function We(ee){var se=ee.charCodeAt(0),Pe={8:"b",9:"t",10:"n",12:"f",13:"r"}[se];return Pe?"\\"+Pe:"\\x"+(se<16?"0":"")+A.call(se.toString(16))}function Ke(ee){return"Object("+ee+")"}function rt(ee){return ee+" { ? }"}function nt(ee,se,Pe,Ae){var Ge=Ae?ne(Pe,Ae):O.call(Pe,", ");return ee+" ("+se+") {"+Ge+"}"}function De(ee){for(var se=0;se<ee.length;se++)if(He(ee[se],`
  384. `)>=0)return!1;return!0}function Q(ee,se){var Pe;if(ee.indent===" ")Pe=" ";else if(typeof ee.indent=="number"&&ee.indent>0)Pe=O.call(Array(ee.indent+1)," ");else return null;return{base:Pe,prev:O.call(Array(se+1),Pe)}}function ne(ee,se){if(ee.length===0)return"";var Pe=`
  385. `+se.prev+se.base;return Pe+O.call(ee,","+Pe)+`
  386. `+se.prev}function be(ee,se){var Pe=ce(ee),Ae=[];if(Pe){Ae.length=ee.length;for(var Ge=0;Ge<ee.length;Ge++)Ae[Ge]=Be(ee,Ge)?se(ee[Ge],ee):""}var J=typeof U=="function"?U(ee):[],Oe;if(X){Oe={};for(var Ve=0;Ve<J.length;Ve++)Oe["$"+J[Ve]]=J[Ve]}for(var Ue in ee)Be(ee,Ue)&&(Pe&&String(Number(Ue))===Ue&&Ue<ee.length||X&&Oe["$"+Ue]instanceof Symbol||(M.call(/[^\w$]/,Ue)?Ae.push(se(Ue,ee)+": "+se(ee[Ue],ee)):Ae.push(Ue+": "+se(ee[Ue],ee))));if(typeof U=="function")for(var je=0;je<J.length;je++)P.call(ee,J[je])&&Ae.push("["+se(J[je])+"]: "+se(ee[J[je]],ee));return Ae}return Q2}var J2,K7;function Zq(){if(K7)return J2;K7=1;var r=_g(),e=ih(),t=function(o,l,c){for(var h=o,d;(d=h.next)!=null;h=d)if(d.key===l)return h.next=d.next,c||(d.next=o.next,o.next=d),d},n=function(o,l){if(o){var c=t(o,l);return c&&c.value}},i=function(o,l,c){var h=t(o,l);h?h.value=c:o.next={key:l,next:o.next,value:c}},a=function(o,l){return o?!!t(o,l):!1},s=function(o,l){if(o)return t(o,l,!0)};return J2=function(){var l,c={assert:function(h){if(!c.has(h))throw new e("Side channel does not contain "+r(h))},delete:function(h){var d=l&&l.next,v=s(l,h);return v&&d&&d===v&&(l=void 0),!!v},get:function(h){return n(l,h)},has:function(h){return a(l,h)},set:function(h,d){l||(l={next:void 0}),i(l,h,d)}};return c},J2}var eb,Z7;function MO(){return Z7||(Z7=1,eb=Object),eb}var tb,Q7;function Qq(){return Q7||(Q7=1,tb=Error),tb}var rb,J7;function Jq(){return J7||(J7=1,rb=EvalError),rb}var nb,eC;function eX(){return eC||(eC=1,nb=RangeError),nb}var ib,tC;function tX(){return tC||(tC=1,ib=ReferenceError),ib}var ab,rC;function rX(){return rC||(rC=1,ab=SyntaxError),ab}var sb,nC;function nX(){return nC||(nC=1,sb=URIError),sb}var ob,iC;function iX(){return iC||(iC=1,ob=Math.abs),ob}var lb,aC;function aX(){return aC||(aC=1,lb=Math.floor),lb}var ub,sC;function sX(){return sC||(sC=1,ub=Math.max),ub}var cb,oC;function oX(){return oC||(oC=1,cb=Math.min),cb}var hb,lC;function lX(){return lC||(lC=1,hb=Math.pow),hb}var fb,uC;function uX(){return uC||(uC=1,fb=Math.round),fb}var db,cC;function cX(){return cC||(cC=1,db=Number.isNaN||function(e){return e!==e}),db}var vb,hC;function hX(){if(hC)return vb;hC=1;var r=cX();return vb=function(t){return r(t)||t===0?t:t<0?-1:1},vb}var pb,fC;function fX(){return fC||(fC=1,pb=Object.getOwnPropertyDescriptor),pb}var gb,dC;function RO(){if(dC)return gb;dC=1;var r=fX();if(r)try{r([],"length")}catch{r=null}return gb=r,gb}var mb,vC;function dX(){if(vC)return mb;vC=1;var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}return mb=r,mb}var yb,pC;function vX(){return pC||(pC=1,yb=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(var a in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==i||o.enumerable!==!0)return!1}return!0}),yb}var bb,gC;function pX(){if(gC)return bb;gC=1;var r=typeof Symbol<"u"&&Symbol,e=vX();return bb=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},bb}var xb,mC;function OO(){return mC||(mC=1,xb=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),xb}var _b,yC;function DO(){if(yC)return _b;yC=1;var r=MO();return _b=r.getPrototypeOf||null,_b}var wb,bC;function gX(){if(bC)return wb;bC=1;var r="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,t=Math.max,n="[object Function]",i=function(l,c){for(var h=[],d=0;d<l.length;d+=1)h[d]=l[d];for(var v=0;v<c.length;v+=1)h[v+l.length]=c[v];return h},a=function(l,c){for(var h=[],d=c,v=0;d<l.length;d+=1,v+=1)h[v]=l[d];return h},s=function(o,l){for(var c="",h=0;h<o.length;h+=1)c+=o[h],h+1<o.length&&(c+=l);return c};return wb=function(l){var c=this;if(typeof c!="function"||e.apply(c)!==n)throw new TypeError(r+c);for(var h=a(arguments,1),d,v=function(){if(this instanceof d){var _=c.apply(this,i(h,arguments));return Object(_)===_?_:this}return c.apply(l,i(h,arguments))},g=t(0,c.length-h.length),m=[],x=0;x<g;x++)m[x]="$"+x;if(d=Function("binder","return function ("+s(m,",")+"){ return binder.apply(this,arguments); }")(v),c.prototype){var y=function(){};y.prototype=c.prototype,d.prototype=new y,y.prototype=null}return d},wb}var Sb,xC;function wg(){if(xC)return Sb;xC=1;var r=gX();return Sb=Function.prototype.bind||r,Sb}var Eb,_C;function gw(){return _C||(_C=1,Eb=Function.prototype.call),Eb}var Tb,wC;function PO(){return wC||(wC=1,Tb=Function.prototype.apply),Tb}var Cb,SC;function mX(){return SC||(SC=1,Cb=typeof Reflect<"u"&&Reflect&&Reflect.apply),Cb}var Ab,EC;function yX(){if(EC)return Ab;EC=1;var r=wg(),e=PO(),t=gw(),n=mX();return Ab=n||r.call(t,e),Ab}var Mb,TC;function IO(){if(TC)return Mb;TC=1;var r=wg(),e=ih(),t=gw(),n=yX();return Mb=function(a){if(a.length<1||typeof a[0]!="function")throw new e("a function is required");return n(r,t,a)},Mb}var Rb,CC;function bX(){if(CC)return Rb;CC=1;var r=IO(),e=RO(),t;try{t=[].__proto__===Array.prototype}catch(s){if(!s||typeof s!="object"||!("code"in s)||s.code!=="ERR_PROTO_ACCESS")throw s}var n=!!t&&e&&e(Object.prototype,"__proto__"),i=Object,a=i.getPrototypeOf;return Rb=n&&typeof n.get=="function"?r([n.get]):typeof a=="function"?function(o){return a(o==null?o:i(o))}:!1,Rb}var Ob,AC;function xX(){if(AC)return Ob;AC=1;var r=OO(),e=DO(),t=bX();return Ob=r?function(i){return r(i)}:e?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return e(i)}:t?function(i){return t(i)}:null,Ob}var Db,MC;function _X(){if(MC)return Db;MC=1;var r=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=wg();return Db=t.call(r,e),Db}var Pb,RC;function mw(){if(RC)return Pb;RC=1;var r,e=MO(),t=Qq(),n=Jq(),i=eX(),a=tX(),s=rX(),o=ih(),l=nX(),c=iX(),h=aX(),d=sX(),v=oX(),g=lX(),m=uX(),x=hX(),y=Function,_=function(pe){try{return y('"use strict"; return ('+pe+").constructor;")()}catch{}},w=RO(),S=dX(),A=function(){throw new o},C=w?(function(){try{return arguments.callee,A}catch{try{return w(arguments,"callee").get}catch{return A}}})():A,M=pX()(),E=xX(),O=DO(),D=OO(),I=PO(),k=gw(),U={},V=typeof Uint8Array>"u"||!E?r:E(Uint8Array),X={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":M&&E?E([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":U,"%AsyncGenerator%":U,"%AsyncGeneratorFunction%":U,"%AsyncIteratorPrototype%":U,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?r:Float16Array,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":y,"%GeneratorFunction%":U,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":M&&E?E(E([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!M||!E?r:E(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":w,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":i,"%ReferenceError%":a,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!M||!E?r:E(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":M&&E?E(""[Symbol.iterator]()):r,"%Symbol%":M?Symbol:r,"%SyntaxError%":s,"%ThrowTypeError%":C,"%TypedArray%":V,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":k,"%Function.prototype.apply%":I,"%Object.defineProperty%":S,"%Object.getPrototypeOf%":O,"%Math.abs%":c,"%Math.floor%":h,"%Math.max%":d,"%Math.min%":v,"%Math.pow%":g,"%Math.round%":m,"%Math.sign%":x,"%Reflect.getPrototypeOf%":D};if(E)try{null.error}catch(pe){var W=E(E(pe));X["%Error.prototype%"]=W}var P=function pe(ae){var oe;if(ae==="%AsyncFunction%")oe=_("async function () {}");else if(ae==="%GeneratorFunction%")oe=_("function* () {}");else if(ae==="%AsyncGeneratorFunction%")oe=_("async function* () {}");else if(ae==="%AsyncGenerator%"){var de=pe("%AsyncGeneratorFunction%");de&&(oe=de.prototype)}else if(ae==="%AsyncIteratorPrototype%"){var ye=pe("%AsyncGenerator%");ye&&E&&(oe=E(ye.prototype))}return X[ae]=oe,oe},H={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},z=wg(),$=_X(),B=z.call(k,Array.prototype.concat),L=z.call(I,Array.prototype.splice),Y=z.call(k,String.prototype.replace),G=z.call(k,String.prototype.slice),re=z.call(k,RegExp.prototype.exec),ie=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,le=/\\(\\)?/g,ce=function(ae){var oe=G(ae,0,1),de=G(ae,-1);if(oe==="%"&&de!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(de==="%"&&oe!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var ye=[];return Y(ae,ie,function(Ee,Re,Ne,Be){ye[ye.length]=Ne?Y(Be,le,"$1"):Re||Ee}),ye},_e=function(ae,oe){var de=ae,ye;if($(H,de)&&(ye=H[de],de="%"+ye[0]+"%"),$(X,de)){var Ee=X[de];if(Ee===U&&(Ee=P(de)),typeof Ee>"u"&&!oe)throw new o("intrinsic "+ae+" exists, but is not available. Please file an issue!");return{alias:ye,name:de,value:Ee}}throw new s("intrinsic "+ae+" does not exist!")};return Pb=function(ae,oe){if(typeof ae!="string"||ae.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof oe!="boolean")throw new o('"allowMissing" argument must be a boolean');if(re(/^%?[^%]*%?$/,ae)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var de=ce(ae),ye=de.length>0?de[0]:"",Ee=_e("%"+ye+"%",oe),Re=Ee.name,Ne=Ee.value,Be=!1,$e=Ee.alias;$e&&(ye=$e[0],L(de,B([0,1],$e)));for(var Ye=1,He=!0;Ye<de.length;Ye+=1){var tt=de[Ye],ot=G(tt,0,1),ct=G(tt,-1);if((ot==='"'||ot==="'"||ot==="`"||ct==='"'||ct==="'"||ct==="`")&&ot!==ct)throw new s("property names with quotes must have matching quotes");if((tt==="constructor"||!He)&&(Be=!0),ye+="."+tt,Re="%"+ye+"%",$(X,Re))Ne=X[Re];else if(Ne!=null){if(!(tt in Ne)){if(!oe)throw new o("base intrinsic for "+ae+" exists, but the property is not available.");return}if(w&&Ye+1>=de.length){var Ze=w(Ne,tt);He=!!Ze,He&&"get"in Ze&&!("originalValue"in Ze.get)?Ne=Ze.get:Ne=Ne[tt]}else He=$(Ne,tt),Ne=Ne[tt];He&&!Be&&(X[Re]=Ne)}}return Ne},Pb}var Ib,OC;function NO(){if(OC)return Ib;OC=1;var r=mw(),e=IO(),t=e([r("%String.prototype.indexOf%")]);return Ib=function(i,a){var s=r(i,!!a);return typeof s=="function"&&t(i,".prototype.")>-1?e([s]):s},Ib}var Nb,DC;function LO(){if(DC)return Nb;DC=1;var r=mw(),e=NO(),t=_g(),n=ih(),i=r("%Map%",!0),a=e("Map.prototype.get",!0),s=e("Map.prototype.set",!0),o=e("Map.prototype.has",!0),l=e("Map.prototype.delete",!0),c=e("Map.prototype.size",!0);return Nb=!!i&&function(){var d,v={assert:function(g){if(!v.has(g))throw new n("Side channel does not contain "+t(g))},delete:function(g){if(d){var m=l(d,g);return c(d)===0&&(d=void 0),m}return!1},get:function(g){if(d)return a(d,g)},has:function(g){return d?o(d,g):!1},set:function(g,m){d||(d=new i),s(d,g,m)}};return v},Nb}var Lb,PC;function wX(){if(PC)return Lb;PC=1;var r=mw(),e=NO(),t=_g(),n=LO(),i=ih(),a=r("%WeakMap%",!0),s=e("WeakMap.prototype.get",!0),o=e("WeakMap.prototype.set",!0),l=e("WeakMap.prototype.has",!0),c=e("WeakMap.prototype.delete",!0);return Lb=a?function(){var d,v,g={assert:function(m){if(!g.has(m))throw new i("Side channel does not contain "+t(m))},delete:function(m){if(a&&m&&(typeof m=="object"||typeof m=="function")){if(d)return c(d,m)}else if(n&&v)return v.delete(m);return!1},get:function(m){return a&&m&&(typeof m=="object"||typeof m=="function")&&d?s(d,m):v&&v.get(m)},has:function(m){return a&&m&&(typeof m=="object"||typeof m=="function")&&d?l(d,m):!!v&&v.has(m)},set:function(m,x){a&&m&&(typeof m=="object"||typeof m=="function")?(d||(d=new a),o(d,m,x)):n&&(v||(v=n()),v.set(m,x))}};return g}:n,Lb}var kb,IC;function kO(){if(IC)return kb;IC=1;var r=ih(),e=_g(),t=Zq(),n=LO(),i=wX(),a=i||n||t;return kb=function(){var o,l={assert:function(c){if(!l.has(c))throw new r("Side channel does not contain "+e(c))},delete:function(c){return!!o&&o.delete(c)},get:function(c){return o&&o.get(c)},has:function(c){return!!o&&o.has(c)},set:function(c,h){o||(o=a()),o.set(c,h)}};return l},kb}var Bb,NC;function yw(){if(NC)return Bb;NC=1;var r=String.prototype.replace,e=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return Bb={default:t.RFC3986,formatters:{RFC1738:function(n){return r.call(n,e,"+")},RFC3986:function(n){return String(n)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},Bb}var Fb,LC;function BO(){if(LC)return Fb;LC=1;var r=yw(),e=kO(),t=Object.prototype.hasOwnProperty,n=Array.isArray,i=e(),a=function(E,O){return i.set(E,O),E},s=function(E){return i.has(E)},o=function(E){return i.get(E)},l=function(E,O){i.set(E,O)},c=(function(){for(var M=[],E=0;E<256;++E)M[M.length]="%"+((E<16?"0":"")+E.toString(16)).toUpperCase();return M})(),h=function(E){for(;E.length>1;){var O=E.pop(),D=O.obj[O.prop];if(n(D)){for(var I=[],k=0;k<D.length;++k)typeof D[k]<"u"&&(I[I.length]=D[k]);O.obj[O.prop]=I}}},d=function(E,O){for(var D=O&&O.plainObjects?{__proto__:null}:{},I=0;I<E.length;++I)typeof E[I]<"u"&&(D[I]=E[I]);return D},v=function M(E,O,D){if(!O)return E;if(typeof O!="object"&&typeof O!="function"){if(n(E)){var I=E.length;if(D&&typeof D.arrayLimit=="number"&&I>D.arrayLimit)return a(d(E.concat(O),D),I);E[I]=O}else if(E&&typeof E=="object")if(s(E)){var k=o(E)+1;E[k]=O,l(E,k)}else{if(D&&D.strictMerge)return[E,O];(D&&(D.plainObjects||D.allowPrototypes)||!t.call(Object.prototype,O))&&(E[O]=!0)}else return[E,O];return E}if(!E||typeof E!="object"){if(s(O)){for(var U=Object.keys(O),V=D&&D.plainObjects?{__proto__:null,0:E}:{0:E},X=0;X<U.length;X++){var W=parseInt(U[X],10);V[W+1]=O[U[X]]}return a(V,o(O)+1)}var P=[E].concat(O);return D&&typeof D.arrayLimit=="number"&&P.length>D.arrayLimit?a(d(P,D),P.length-1):P}var H=E;return n(E)&&!n(O)&&(H=d(E,D)),n(E)&&n(O)?(O.forEach(function(z,$){if(t.call(E,$)){var B=E[$];B&&typeof B=="object"&&z&&typeof z=="object"?E[$]=M(B,z,D):E[E.length]=z}else E[$]=z}),E):Object.keys(O).reduce(function(z,$){var B=O[$];if(t.call(z,$)?z[$]=M(z[$],B,D):z[$]=B,s(O)&&!s(z)&&a(z,o(O)),s(z)){var L=parseInt($,10);String(L)===$&&L>=0&&L>o(z)&&l(z,L)}return z},H)},g=function(E,O){return Object.keys(O).reduce(function(D,I){return D[I]=O[I],D},E)},m=function(M,E,O){var D=M.replace(/\+/g," ");if(O==="iso-8859-1")return D.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(D)}catch{return D}},x=1024,y=function(E,O,D,I,k){if(E.length===0)return E;var U=E;if(typeof E=="symbol"?U=Symbol.prototype.toString.call(E):typeof E!="string"&&(U=String(E)),D==="iso-8859-1")return escape(U).replace(/%u[0-9a-f]{4}/gi,function($){return"%26%23"+parseInt($.slice(2),16)+"%3B"});for(var V="",X=0;X<U.length;X+=x){for(var W=U.length>=x?U.slice(X,X+x):U,P=[],H=0;H<W.length;++H){var z=W.charCodeAt(H);if(z===45||z===46||z===95||z===126||z>=48&&z<=57||z>=65&&z<=90||z>=97&&z<=122||k===r.RFC1738&&(z===40||z===41)){P[P.length]=W.charAt(H);continue}if(z<128){P[P.length]=c[z];continue}if(z<2048){P[P.length]=c[192|z>>6]+c[128|z&63];continue}if(z<55296||z>=57344){P[P.length]=c[224|z>>12]+c[128|z>>6&63]+c[128|z&63];continue}H+=1,z=65536+((z&1023)<<10|W.charCodeAt(H)&1023),P[P.length]=c[240|z>>18]+c[128|z>>12&63]+c[128|z>>6&63]+c[128|z&63]}V+=P.join("")}return V},_=function(E){for(var O=[{obj:{o:E},prop:"o"}],D=[],I=0;I<O.length;++I)for(var k=O[I],U=k.obj[k.prop],V=Object.keys(U),X=0;X<V.length;++X){var W=V[X],P=U[W];typeof P=="object"&&P!==null&&D.indexOf(P)===-1&&(O[O.length]={obj:U,prop:W},D[D.length]=P)}return h(O),E},w=function(E){return Object.prototype.toString.call(E)==="[object RegExp]"},S=function(E){return!E||typeof E!="object"?!1:!!(E.constructor&&E.constructor.isBuffer&&E.constructor.isBuffer(E))},A=function(E,O,D,I){if(s(E)){var k=o(E)+1;return E[k]=O,l(E,k),E}var U=[].concat(E,O);return U.length>D?a(d(U,{plainObjects:I}),U.length-1):U},C=function(E,O){if(n(E)){for(var D=[],I=0;I<E.length;I+=1)D[D.length]=O(E[I]);return D}return O(E)};return Fb={arrayToObject:d,assign:g,combine:A,compact:_,decode:m,encode:y,isBuffer:S,isOverflow:s,isRegExp:w,markOverflow:a,maybeMap:C,merge:v},Fb}var zb,kC;function SX(){if(kC)return zb;kC=1;var r=kO(),e=BO(),t=yw(),n=Object.prototype.hasOwnProperty,i={brackets:function(y){return y+"[]"},comma:"comma",indices:function(y,_){return y+"["+_+"]"},repeat:function(y){return y}},a=Array.isArray,s=Array.prototype.push,o=function(x,y){s.apply(x,a(y)?y:[y])},l=Date.prototype.toISOString,c=t.default,h={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:e.encode,encodeValuesOnly:!1,filter:void 0,format:c,formatter:t.formatters[c],indices:!1,serializeDate:function(y){return l.call(y)},skipNulls:!1,strictNullHandling:!1},d=function(y){return typeof y=="string"||typeof y=="number"||typeof y=="boolean"||typeof y=="symbol"||typeof y=="bigint"},v={},g=function x(y,_,w,S,A,C,M,E,O,D,I,k,U,V,X,W,P,H){for(var z=y,$=H,B=0,L=!1;($=$.get(v))!==void 0&&!L;){var Y=$.get(y);if(B+=1,typeof Y<"u"){if(Y===B)throw new RangeError("Cyclic object value");L=!0}typeof $.get(v)>"u"&&(B=0)}if(typeof D=="function"?z=D(_,z):z instanceof Date?z=U(z):w==="comma"&&a(z)&&(z=e.maybeMap(z,function(Re){return Re instanceof Date?U(Re):Re})),z===null){if(C)return O&&!W?O(_,h.encoder,P,"key",V):_;z=""}if(d(z)||e.isBuffer(z)){if(O){var G=W?_:O(_,h.encoder,P,"key",V);return[X(G)+"="+X(O(z,h.encoder,P,"value",V))]}return[X(_)+"="+X(String(z))]}var re=[];if(typeof z>"u")return re;var ie;if(w==="comma"&&a(z))W&&O&&(z=e.maybeMap(z,O)),ie=[{value:z.length>0?z.join(",")||null:void 0}];else if(a(D))ie=D;else{var le=Object.keys(z);ie=I?le.sort(I):le}var ce=E?String(_).replace(/\./g,"%2E"):String(_),_e=S&&a(z)&&z.length===1?ce+"[]":ce;if(A&&a(z)&&z.length===0)return _e+"[]";for(var pe=0;pe<ie.length;++pe){var ae=ie[pe],oe=typeof ae=="object"&&ae&&typeof ae.value<"u"?ae.value:z[ae];if(!(M&&oe===null)){var de=k&&E?String(ae).replace(/\./g,"%2E"):String(ae),ye=a(z)?typeof w=="function"?w(_e,de):_e:_e+(k?"."+de:"["+de+"]");H.set(y,B);var Ee=r();Ee.set(v,H),o(re,x(oe,ye,w,S,A,C,M,E,w==="comma"&&W&&a(z)?null:O,D,I,k,U,V,X,W,P,Ee))}}return re},m=function(y){if(!y)return h;if(typeof y.allowEmptyArrays<"u"&&typeof y.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof y.encodeDotInKeys<"u"&&typeof y.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(y.encoder!==null&&typeof y.encoder<"u"&&typeof y.encoder!="function")throw new TypeError("Encoder has to be a function.");var _=y.charset||h.charset;if(typeof y.charset<"u"&&y.charset!=="utf-8"&&y.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var w=t.default;if(typeof y.format<"u"){if(!n.call(t.formatters,y.format))throw new TypeError("Unknown format option provided.");w=y.format}var S=t.formatters[w],A=h.filter;(typeof y.filter=="function"||a(y.filter))&&(A=y.filter);var C;if(y.arrayFormat in i?C=y.arrayFormat:"indices"in y?C=y.indices?"indices":"repeat":C=h.arrayFormat,"commaRoundTrip"in y&&typeof y.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var M=typeof y.allowDots>"u"?y.encodeDotInKeys===!0?!0:h.allowDots:!!y.allowDots;return{addQueryPrefix:typeof y.addQueryPrefix=="boolean"?y.addQueryPrefix:h.addQueryPrefix,allowDots:M,allowEmptyArrays:typeof y.allowEmptyArrays=="boolean"?!!y.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:C,charset:_,charsetSentinel:typeof y.charsetSentinel=="boolean"?y.charsetSentinel:h.charsetSentinel,commaRoundTrip:!!y.commaRoundTrip,delimiter:typeof y.delimiter>"u"?h.delimiter:y.delimiter,encode:typeof y.encode=="boolean"?y.encode:h.encode,encodeDotInKeys:typeof y.encodeDotInKeys=="boolean"?y.encodeDotInKeys:h.encodeDotInKeys,encoder:typeof y.encoder=="function"?y.encoder:h.encoder,encodeValuesOnly:typeof y.encodeValuesOnly=="boolean"?y.encodeValuesOnly:h.encodeValuesOnly,filter:A,format:w,formatter:S,serializeDate:typeof y.serializeDate=="function"?y.serializeDate:h.serializeDate,skipNulls:typeof y.skipNulls=="boolean"?y.skipNulls:h.skipNulls,sort:typeof y.sort=="function"?y.sort:null,strictNullHandling:typeof y.strictNullHandling=="boolean"?y.strictNullHandling:h.strictNullHandling}};return zb=function(x,y){var _=x,w=m(y),S,A;typeof w.filter=="function"?(A=w.filter,_=A("",_)):a(w.filter)&&(A=w.filter,S=A);var C=[];if(typeof _!="object"||_===null)return"";var M=i[w.arrayFormat],E=M==="comma"&&w.commaRoundTrip;S||(S=Object.keys(_)),w.sort&&S.sort(w.sort);for(var O=r(),D=0;D<S.length;++D){var I=S[D],k=_[I];w.skipNulls&&k===null||o(C,g(k,I,M,E,w.allowEmptyArrays,w.strictNullHandling,w.skipNulls,w.encodeDotInKeys,w.encode?w.encoder:null,w.filter,w.sort,w.allowDots,w.serializeDate,w.format,w.formatter,w.encodeValuesOnly,w.charset,O))}var U=C.join(w.delimiter),V=w.addQueryPrefix===!0?"?":"";return w.charsetSentinel&&(w.charset==="iso-8859-1"?V+="utf8=%26%2310003%3B&":V+="utf8=%E2%9C%93&"),U.length>0?V+U:""},zb}var Ub,BC;function EX(){if(BC)return Ub;BC=1;var r=BO(),e=Object.prototype.hasOwnProperty,t=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:r.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},i=function(g){return g.replace(/&#(\d+);/g,function(m,x){return String.fromCharCode(parseInt(x,10))})},a=function(g,m,x){if(g&&typeof g=="string"&&m.comma&&g.indexOf(",")>-1)return g.split(",");if(m.throwOnLimitExceeded&&x>=m.arrayLimit)throw new RangeError("Array limit exceeded. Only "+m.arrayLimit+" element"+(m.arrayLimit===1?"":"s")+" allowed in an array.");return g},s="utf8=%26%2310003%3B",o="utf8=%E2%9C%93",l=function(m,x){var y={__proto__:null},_=x.ignoreQueryPrefix?m.replace(/^\?/,""):m;_=_.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var w=x.parameterLimit===1/0?void 0:x.parameterLimit,S=_.split(x.delimiter,x.throwOnLimitExceeded?w+1:w);if(x.throwOnLimitExceeded&&S.length>w)throw new RangeError("Parameter limit exceeded. Only "+w+" parameter"+(w===1?"":"s")+" allowed.");var A=-1,C,M=x.charset;if(x.charsetSentinel)for(C=0;C<S.length;++C)S[C].indexOf("utf8=")===0&&(S[C]===o?M="utf-8":S[C]===s&&(M="iso-8859-1"),A=C,C=S.length);for(C=0;C<S.length;++C)if(C!==A){var E=S[C],O=E.indexOf("]="),D=O===-1?E.indexOf("="):O+1,I,k;if(D===-1?(I=x.decoder(E,n.decoder,M,"key"),k=x.strictNullHandling?null:""):(I=x.decoder(E.slice(0,D),n.decoder,M,"key"),I!==null&&(k=r.maybeMap(a(E.slice(D+1),x,t(y[I])?y[I].length:0),function(V){return x.decoder(V,n.decoder,M,"value")}))),k&&x.interpretNumericEntities&&M==="iso-8859-1"&&(k=i(String(k))),E.indexOf("[]=")>-1&&(k=t(k)?[k]:k),x.comma&&t(k)&&k.length>x.arrayLimit){if(x.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+x.arrayLimit+" element"+(x.arrayLimit===1?"":"s")+" allowed in an array.");k=r.combine([],k,x.arrayLimit,x.plainObjects)}if(I!==null){var U=e.call(y,I);U&&(x.duplicates==="combine"||E.indexOf("[]=")>-1)?y[I]=r.combine(y[I],k,x.arrayLimit,x.plainObjects):(!U||x.duplicates==="last")&&(y[I]=k)}}return y},c=function(g,m,x,y){var _=0;if(g.length>0&&g[g.length-1]==="[]"){var w=g.slice(0,-1).join("");_=Array.isArray(m)&&m[w]?m[w].length:0}for(var S=y?m:a(m,x,_),A=g.length-1;A>=0;--A){var C,M=g[A];if(M==="[]"&&x.parseArrays)r.isOverflow(S)?C=S:C=x.allowEmptyArrays&&(S===""||x.strictNullHandling&&S===null)?[]:r.combine([],S,x.arrayLimit,x.plainObjects);else{C=x.plainObjects?{__proto__:null}:{};var E=M.charAt(0)==="["&&M.charAt(M.length-1)==="]"?M.slice(1,-1):M,O=x.decodeDotInKeys?E.replace(/%2E/g,"."):E,D=parseInt(O,10),I=!isNaN(D)&&M!==O&&String(D)===O&&D>=0&&x.parseArrays;if(!x.parseArrays&&O==="")C={0:S};else if(I&&D<x.arrayLimit)C=[],C[D]=S;else{if(I&&x.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+x.arrayLimit+" element"+(x.arrayLimit===1?"":"s")+" allowed in an array.");I?(C[D]=S,r.markOverflow(C,D)):O!=="__proto__"&&(C[O]=S)}}S=C}return S},h=function(m,x){var y=x.allowDots?m.replace(/\.([^.[]+)/g,"[$1]"):m;if(x.depth<=0)return!x.plainObjects&&e.call(Object.prototype,y)&&!x.allowPrototypes?void 0:[y];var _=/(\[[^[\]]*])/,w=/(\[[^[\]]*])/g,S=_.exec(y),A=S?y.slice(0,S.index):y,C=[];if(A){if(!x.plainObjects&&e.call(Object.prototype,A)&&!x.allowPrototypes)return;C[C.length]=A}for(var M=0;(S=w.exec(y))!==null&&M<x.depth;){M+=1;var E=S[1].slice(1,-1);if(!x.plainObjects&&e.call(Object.prototype,E)&&!x.allowPrototypes)return;C[C.length]=S[1]}if(S){if(x.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+x.depth+" and strictDepth is true");C[C.length]="["+y.slice(S.index)+"]"}return C},d=function(m,x,y,_){if(m){var w=h(m,y);if(w)return c(w,x,y,_)}},v=function(m){if(!m)return n;if(typeof m.allowEmptyArrays<"u"&&typeof m.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof m.decodeDotInKeys<"u"&&typeof m.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(m.decoder!==null&&typeof m.decoder<"u"&&typeof m.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof m.charset<"u"&&m.charset!=="utf-8"&&m.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof m.throwOnLimitExceeded<"u"&&typeof m.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var x=typeof m.charset>"u"?n.charset:m.charset,y=typeof m.duplicates>"u"?n.duplicates:m.duplicates;if(y!=="combine"&&y!=="first"&&y!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var _=typeof m.allowDots>"u"?m.decodeDotInKeys===!0?!0:n.allowDots:!!m.allowDots;return{allowDots:_,allowEmptyArrays:typeof m.allowEmptyArrays=="boolean"?!!m.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof m.allowPrototypes=="boolean"?m.allowPrototypes:n.allowPrototypes,allowSparse:typeof m.allowSparse=="boolean"?m.allowSparse:n.allowSparse,arrayLimit:typeof m.arrayLimit=="number"?m.arrayLimit:n.arrayLimit,charset:x,charsetSentinel:typeof m.charsetSentinel=="boolean"?m.charsetSentinel:n.charsetSentinel,comma:typeof m.comma=="boolean"?m.comma:n.comma,decodeDotInKeys:typeof m.decodeDotInKeys=="boolean"?m.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof m.decoder=="function"?m.decoder:n.decoder,delimiter:typeof m.delimiter=="string"||r.isRegExp(m.delimiter)?m.delimiter:n.delimiter,depth:typeof m.depth=="number"||m.depth===!1?+m.depth:n.depth,duplicates:y,ignoreQueryPrefix:m.ignoreQueryPrefix===!0,interpretNumericEntities:typeof m.interpretNumericEntities=="boolean"?m.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof m.parameterLimit=="number"?m.parameterLimit:n.parameterLimit,parseArrays:m.parseArrays!==!1,plainObjects:typeof m.plainObjects=="boolean"?m.plainObjects:n.plainObjects,strictDepth:typeof m.strictDepth=="boolean"?!!m.strictDepth:n.strictDepth,strictMerge:typeof m.strictMerge=="boolean"?!!m.strictMerge:n.strictMerge,strictNullHandling:typeof m.strictNullHandling=="boolean"?m.strictNullHandling:n.strictNullHandling,throwOnLimitExceeded:typeof m.throwOnLimitExceeded=="boolean"?m.throwOnLimitExceeded:!1}};return Ub=function(g,m){var x=v(m);if(g===""||g===null||typeof g>"u")return x.plainObjects?{__proto__:null}:{};for(var y=typeof g=="string"?l(g,x):g,_=x.plainObjects?{__proto__:null}:{},w=Object.keys(y),S=0;S<w.length;++S){var A=w[S],C=d(A,y[A],x,typeof g=="string");_=r.merge(_,C,x)}return x.allowSparse===!0?_:r.compact(_)},Ub}var Gb,FC;function TX(){if(FC)return Gb;FC=1;var r=SX(),e=EX(),t=yw();return Gb={formats:t,parse:e,stringify:r},Gb}var zC;function CX(){if(zC)return Fl;zC=1;var r=Yq();function e(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var t=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,a=["<",">",'"',"`"," ","\r",`
  387. `," "],s=["{","}","|","\\","^","`"].concat(a),o=["'"].concat(s),l=["%","/","?",";","#"].concat(o),c=["/","?","#"],h=255,d=/^[+a-z0-9A-Z_-]{0,63}$/,v=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},x={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=TX();function _(C,M,E){if(C&&typeof C=="object"&&C instanceof e)return C;var O=new e;return O.parse(C,M,E),O}e.prototype.parse=function(C,M,E){if(typeof C!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof C);var O=C.indexOf("?"),D=O!==-1&&O<C.indexOf("#")?"?":"#",I=C.split(D),k=/\\/g;I[0]=I[0].replace(k,"/"),C=I.join(D);var U=C;if(U=U.trim(),!E&&C.split("#").length===1){var V=i.exec(U);if(V)return this.path=U,this.href=U,this.pathname=V[1],V[2]?(this.search=V[2],M?this.query=y.parse(this.search.substr(1)):this.query=this.search.substr(1)):M&&(this.search="",this.query={}),this}var X=t.exec(U);if(X){X=X[0];var W=X.toLowerCase();this.protocol=W,U=U.substr(X.length)}if(E||X||U.match(/^\/\/[^@/]+@[^@/]+/)){var P=U.substr(0,2)==="//";P&&!(X&&m[X])&&(U=U.substr(2),this.slashes=!0)}if(!m[X]&&(P||X&&!x[X])){for(var H=-1,z=0;z<c.length;z++){var $=U.indexOf(c[z]);$!==-1&&(H===-1||$<H)&&(H=$)}var B,L;H===-1?L=U.lastIndexOf("@"):L=U.lastIndexOf("@",H),L!==-1&&(B=U.slice(0,L),U=U.slice(L+1),this.auth=decodeURIComponent(B)),H=-1;for(var z=0;z<l.length;z++){var $=U.indexOf(l[z]);$!==-1&&(H===-1||$<H)&&(H=$)}H===-1&&(H=U.length),this.host=U.slice(0,H),U=U.slice(H),this.parseHost(),this.hostname=this.hostname||"";var Y=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!Y)for(var G=this.hostname.split(/\./),z=0,re=G.length;z<re;z++){var ie=G[z];if(ie&&!ie.match(d)){for(var le="",ce=0,_e=ie.length;ce<_e;ce++)ie.charCodeAt(ce)>127?le+="x":le+=ie[ce];if(!le.match(d)){var pe=G.slice(0,z),ae=G.slice(z+1),oe=ie.match(v);oe&&(pe.push(oe[1]),ae.unshift(oe[2])),ae.length&&(U="/"+ae.join(".")+U),this.hostname=pe.join(".");break}}}this.hostname.length>h?this.hostname="":this.hostname=this.hostname.toLowerCase(),Y||(this.hostname=r.toASCII(this.hostname));var de=this.port?":"+this.port:"",ye=this.hostname||"";this.host=ye+de,this.href+=this.host,Y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),U[0]!=="/"&&(U="/"+U))}if(!g[W])for(var z=0,re=o.length;z<re;z++){var Ee=o[z];if(U.indexOf(Ee)!==-1){var Re=encodeURIComponent(Ee);Re===Ee&&(Re=escape(Ee)),U=U.split(Ee).join(Re)}}var Ne=U.indexOf("#");Ne!==-1&&(this.hash=U.substr(Ne),U=U.slice(0,Ne));var Be=U.indexOf("?");if(Be!==-1?(this.search=U.substr(Be),this.query=U.substr(Be+1),M&&(this.query=y.parse(this.query)),U=U.slice(0,Be)):M&&(this.search="",this.query={}),U&&(this.pathname=U),x[W]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var de=this.pathname||"",$e=this.search||"";this.path=de+$e}return this.href=this.format(),this};function w(C){return typeof C=="string"&&(C=_(C)),C instanceof e?C.format():e.prototype.format.call(C)}e.prototype.format=function(){var C=this.auth||"";C&&(C=encodeURIComponent(C),C=C.replace(/%3A/i,":"),C+="@");var M=this.protocol||"",E=this.pathname||"",O=this.hash||"",D=!1,I="";this.host?D=C+this.host:this.hostname&&(D=C+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(D+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(I=y.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var k=this.search||I&&"?"+I||"";return M&&M.substr(-1)!==":"&&(M+=":"),this.slashes||(!M||x[M])&&D!==!1?(D="//"+(D||""),E&&E.charAt(0)!=="/"&&(E="/"+E)):D||(D=""),O&&O.charAt(0)!=="#"&&(O="#"+O),k&&k.charAt(0)!=="?"&&(k="?"+k),E=E.replace(/[?#]/g,function(U){return encodeURIComponent(U)}),k=k.replace("#","%23"),M+D+E+k+O};function S(C,M){return _(C,!1,!0).resolve(M)}e.prototype.resolve=function(C){return this.resolveObject(_(C,!1,!0)).format()};function A(C,M){return C?_(C,!1,!0).resolveObject(M):M}return e.prototype.resolveObject=function(C){if(typeof C=="string"){var M=new e;M.parse(C,!1,!0),C=M}for(var E=new e,O=Object.keys(this),D=0;D<O.length;D++){var I=O[D];E[I]=this[I]}if(E.hash=C.hash,C.href==="")return E.href=E.format(),E;if(C.slashes&&!C.protocol){for(var k=Object.keys(C),U=0;U<k.length;U++){var V=k[U];V!=="protocol"&&(E[V]=C[V])}return x[E.protocol]&&E.hostname&&!E.pathname&&(E.pathname="/",E.path=E.pathname),E.href=E.format(),E}if(C.protocol&&C.protocol!==E.protocol){if(!x[C.protocol]){for(var X=Object.keys(C),W=0;W<X.length;W++){var P=X[W];E[P]=C[P]}return E.href=E.format(),E}if(E.protocol=C.protocol,!C.host&&!m[C.protocol]){for(var re=(C.pathname||"").split("/");re.length&&!(C.host=re.shift()););C.host||(C.host=""),C.hostname||(C.hostname=""),re[0]!==""&&re.unshift(""),re.length<2&&re.unshift(""),E.pathname=re.join("/")}else E.pathname=C.pathname;if(E.search=C.search,E.query=C.query,E.host=C.host||"",E.auth=C.auth,E.hostname=C.hostname||C.host,E.port=C.port,E.pathname||E.search){var H=E.pathname||"",z=E.search||"";E.path=H+z}return E.slashes=E.slashes||C.slashes,E.href=E.format(),E}var $=E.pathname&&E.pathname.charAt(0)==="/",B=C.host||C.pathname&&C.pathname.charAt(0)==="/",L=B||$||E.host&&C.pathname,Y=L,G=E.pathname&&E.pathname.split("/")||[],re=C.pathname&&C.pathname.split("/")||[],ie=E.protocol&&!x[E.protocol];if(ie&&(E.hostname="",E.port=null,E.host&&(G[0]===""?G[0]=E.host:G.unshift(E.host)),E.host="",C.protocol&&(C.hostname=null,C.port=null,C.host&&(re[0]===""?re[0]=C.host:re.unshift(C.host)),C.host=null),L=L&&(re[0]===""||G[0]==="")),B)E.host=C.host||C.host===""?C.host:E.host,E.hostname=C.hostname||C.hostname===""?C.hostname:E.hostname,E.search=C.search,E.query=C.query,G=re;else if(re.length)G||(G=[]),G.pop(),G=G.concat(re),E.search=C.search,E.query=C.query;else if(C.search!=null){if(ie){E.host=G.shift(),E.hostname=E.host;var le=E.host&&E.host.indexOf("@")>0?E.host.split("@"):!1;le&&(E.auth=le.shift(),E.hostname=le.shift(),E.host=E.hostname)}return E.search=C.search,E.query=C.query,(E.pathname!==null||E.search!==null)&&(E.path=(E.pathname?E.pathname:"")+(E.search?E.search:"")),E.href=E.format(),E}if(!G.length)return E.pathname=null,E.search?E.path="/"+E.search:E.path=null,E.href=E.format(),E;for(var ce=G.slice(-1)[0],_e=(E.host||C.host||G.length>1)&&(ce==="."||ce==="..")||ce==="",pe=0,ae=G.length;ae>=0;ae--)ce=G[ae],ce==="."?G.splice(ae,1):ce===".."?(G.splice(ae,1),pe++):pe&&(G.splice(ae,1),pe--);if(!L&&!Y)for(;pe--;pe)G.unshift("..");L&&G[0]!==""&&(!G[0]||G[0].charAt(0)!=="/")&&G.unshift(""),_e&&G.join("/").substr(-1)!=="/"&&G.push("");var oe=G[0]===""||G[0]&&G[0].charAt(0)==="/";if(ie){E.hostname=oe?"":G.length?G.shift():"",E.host=E.hostname;var le=E.host&&E.host.indexOf("@")>0?E.host.split("@"):!1;le&&(E.auth=le.shift(),E.hostname=le.shift(),E.host=E.hostname)}return L=L||E.host&&G.length,L&&!oe&&G.unshift(""),G.length>0?E.pathname=G.join("/"):(E.pathname=null,E.path=null),(E.pathname!==null||E.search!==null)&&(E.path=(E.pathname?E.pathname:"")+(E.search?E.search:"")),E.auth=C.auth||E.auth,E.slashes=E.slashes||C.slashes,E.href=E.format(),E},e.prototype.parseHost=function(){var C=this.host,M=n.exec(C);M&&(M=M[0],M!==":"&&(this.port=M.substr(1)),C=C.substr(0,C.length-M.length)),C&&(this.hostname=C)},Fl.parse=_,Fl.resolve=S,Fl.resolveObject=A,Fl.format=w,Fl.Url=e,Fl}var Hb=CX();/*!
  388. * @pixi/utils - v6.5.10
  389. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  390. *
  391. * @pixi/utils is licensed under the MIT License.
  392. * http://www.opensource.org/licenses/mit-license
  393. */var es={parse:Hb.parse,format:Hb.format,resolve:Hb.resolve};function Ca(r){if(typeof r!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(r))}function UC(r){var e=r.split("?")[0];return e.split("#")[0]}function AX(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function MX(r,e,t){return r.replace(new RegExp(AX(e),"g"),t)}function RX(r,e){for(var t="",n=0,i=-1,a=0,s,o=0;o<=r.length;++o){if(o<r.length)s=r.charCodeAt(o);else{if(s===47)break;s=47}if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(t.length<2||n!==2||t.charCodeAt(t.length-1)!==46||t.charCodeAt(t.length-2)!==46){if(t.length>2){var l=t.lastIndexOf("/");if(l!==t.length-1){l===-1?(t="",n=0):(t=t.slice(0,l),n=t.length-1-t.lastIndexOf("/")),i=o,a=0;continue}}else if(t.length===2||t.length===1){t="",n=0,i=o,a=0;continue}}}else t.length>0?t+="/"+r.slice(i+1,o):t=r.slice(i+1,o),n=o-i-1;i=o,a=0}else s===46&&a!==-1?++a:a=-1}return t}var FO={toPosix:function(r){return MX(r,"\\","/")},isUrl:function(r){return/^https?:/.test(this.toPosix(r))},isDataUrl:function(r){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(r)},hasProtocol:function(r){return/^[^/:]+:\//.test(this.toPosix(r))},getProtocol:function(r){Ca(r),r=this.toPosix(r);var e="",t=/^file:\/\/\//.exec(r),n=/^[^/:]+:\/\//.exec(r),i=/^[^/:]+:\//.exec(r);if(t||n||i){var a=(t==null?void 0:t[0])||(n==null?void 0:n[0])||(i==null?void 0:i[0]);e=a,r=r.slice(a.length)}return e},toAbsolute:function(r,e,t){if(this.isDataUrl(r))return r;var n=UC(this.toPosix(e??ht.ADAPTER.getBaseUrl())),i=UC(this.toPosix(t??this.rootname(n)));if(Ca(r),r=this.toPosix(r),r.startsWith("/"))return FO.join(i,r.slice(1));var a=this.isAbsolute(r)?r:this.join(n,r);return a},normalize:function(r){if(r=this.toPosix(r),Ca(r),r.length===0)return".";var e="",t=r.startsWith("/");this.hasProtocol(r)&&(e=this.rootname(r),r=r.slice(e.length));var n=r.endsWith("/");return r=RX(r),r.length>0&&n&&(r+="/"),t?"/"+r:e+r},isAbsolute:function(r){return Ca(r),r=this.toPosix(r),this.hasProtocol(r)?!0:r.startsWith("/")},join:function(){for(var r=arguments,e,t=[],n=0;n<arguments.length;n++)t[n]=r[n];if(t.length===0)return".";for(var i,a=0;a<t.length;++a){var s=t[a];if(Ca(s),s.length>0)if(i===void 0)i=s;else{var o=(e=t[a-1])!==null&&e!==void 0?e:"";this.extname(o)?i+="/../"+s:i+="/"+s}}return i===void 0?".":this.normalize(i)},dirname:function(r){if(Ca(r),r.length===0)return".";r=this.toPosix(r);var e=r.charCodeAt(0),t=e===47,n=-1,i=!0,a=this.getProtocol(r),s=r;r=r.slice(a.length);for(var o=r.length-1;o>=1;--o)if(e=r.charCodeAt(o),e===47){if(!i){n=o;break}}else i=!1;return n===-1?t?"/":this.isUrl(s)?a+r:a:t&&n===1?"//":a+r.slice(0,n)},rootname:function(r){Ca(r),r=this.toPosix(r);var e="";if(r.startsWith("/")?e="/":e=this.getProtocol(r),this.isUrl(r)){var t=r.indexOf("/",e.length);t!==-1?e=r.slice(0,t):e=r,e.endsWith("/")||(e+="/")}return e},basename:function(r,e){Ca(r),e&&Ca(e),r=this.toPosix(r);var t=0,n=-1,i=!0,a;if(e!==void 0&&e.length>0&&e.length<=r.length){if(e.length===r.length&&e===r)return"";var s=e.length-1,o=-1;for(a=r.length-1;a>=0;--a){var l=r.charCodeAt(a);if(l===47){if(!i){t=a+1;break}}else o===-1&&(i=!1,o=a+1),s>=0&&(l===e.charCodeAt(s)?--s===-1&&(n=a):(s=-1,n=o))}return t===n?n=o:n===-1&&(n=r.length),r.slice(t,n)}for(a=r.length-1;a>=0;--a)if(r.charCodeAt(a)===47){if(!i){t=a+1;break}}else n===-1&&(i=!1,n=a+1);return n===-1?"":r.slice(t,n)},extname:function(r){Ca(r),r=this.toPosix(r);for(var e=-1,t=0,n=-1,i=!0,a=0,s=r.length-1;s>=0;--s){var o=r.charCodeAt(s);if(o===47){if(!i){t=s+1;break}continue}n===-1&&(i=!1,n=s+1),o===46?e===-1?e=s:a!==1&&(a=1):e!==-1&&(a=-1)}return e===-1||n===-1||a===0||a===1&&e===n-1&&e===t+1?"":r.slice(e,n)},parse:function(r){Ca(r);var e={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return e;r=this.toPosix(r);var t=r.charCodeAt(0),n=this.isAbsolute(r),i;e.root=this.rootname(r),n||this.hasProtocol(r)?i=1:i=0;for(var a=-1,s=0,o=-1,l=!0,c=r.length-1,h=0;c>=i;--c){if(t=r.charCodeAt(c),t===47){if(!l){s=c+1;break}continue}o===-1&&(l=!1,o=c+1),t===46?a===-1?a=c:h!==1&&(h=1):a!==-1&&(h=-1)}return a===-1||o===-1||h===0||h===1&&a===o-1&&a===s+1?o!==-1&&(s===0&&n?e.base=e.name=r.slice(1,o):e.base=e.name=r.slice(s,o)):(s===0&&n?(e.name=r.slice(1,a),e.base=r.slice(1,o)):(e.name=r.slice(s,a),e.base=r.slice(s,o)),e.ext=r.slice(a,o)),e.dir=this.dirname(r),e},sep:"/",delimiter:":"};ht.RETINA_PREFIX=/@([0-9\.]+)x/;ht.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var S4=!1,GC="6.5.10";function OX(){S4=!0}function zO(r){var e;if(!S4){if(ht.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){var t=[`
  394. %c %c %c PixiJS `+GC+" - ✰ "+r+` ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥
  395. `,"background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(e=globalThis.console).log.apply(e,t)}else globalThis.console&&globalThis.console.log("PixiJS "+GC+" - "+r+" - http://www.pixijs.com/");S4=!0}}var jb;function UO(){return typeof jb>"u"&&(jb=(function(){var e={stencil:!0,failIfMajorPerformanceCaveat:ht.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!ht.ADAPTER.getWebGLRenderingContext())return!1;var t=ht.ADAPTER.createCanvas(),n=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),i=!!(n&&n.getContextAttributes().stencil);if(n){var a=n.getExtension("WEBGL_lose_context");a&&a.loseContext()}return n=null,i}catch{return!1}})()),jb}var DX="#f0f8ff",PX="#faebd7",IX="#00ffff",NX="#7fffd4",LX="#f0ffff",kX="#f5f5dc",BX="#ffe4c4",FX="#000000",zX="#ffebcd",UX="#0000ff",GX="#8a2be2",HX="#a52a2a",jX="#deb887",VX="#5f9ea0",qX="#7fff00",XX="#d2691e",YX="#ff7f50",WX="#6495ed",$X="#fff8dc",KX="#dc143c",ZX="#00ffff",QX="#00008b",JX="#008b8b",eY="#b8860b",tY="#a9a9a9",rY="#006400",nY="#a9a9a9",iY="#bdb76b",aY="#8b008b",sY="#556b2f",oY="#ff8c00",lY="#9932cc",uY="#8b0000",cY="#e9967a",hY="#8fbc8f",fY="#483d8b",dY="#2f4f4f",vY="#2f4f4f",pY="#00ced1",gY="#9400d3",mY="#ff1493",yY="#00bfff",bY="#696969",xY="#696969",_Y="#1e90ff",wY="#b22222",SY="#fffaf0",EY="#228b22",TY="#ff00ff",CY="#dcdcdc",AY="#f8f8ff",MY="#daa520",RY="#ffd700",OY="#808080",DY="#008000",PY="#adff2f",IY="#808080",NY="#f0fff0",LY="#ff69b4",kY="#cd5c5c",BY="#4b0082",FY="#fffff0",zY="#f0e68c",UY="#fff0f5",GY="#e6e6fa",HY="#7cfc00",jY="#fffacd",VY="#add8e6",qY="#f08080",XY="#e0ffff",YY="#fafad2",WY="#d3d3d3",$Y="#90ee90",KY="#d3d3d3",ZY="#ffb6c1",QY="#ffa07a",JY="#20b2aa",eW="#87cefa",tW="#778899",rW="#778899",nW="#b0c4de",iW="#ffffe0",aW="#00ff00",sW="#32cd32",oW="#faf0e6",lW="#ff00ff",uW="#800000",cW="#66cdaa",hW="#0000cd",fW="#ba55d3",dW="#9370db",vW="#3cb371",pW="#7b68ee",gW="#00fa9a",mW="#48d1cc",yW="#c71585",bW="#191970",xW="#f5fffa",_W="#ffe4e1",wW="#ffe4b5",SW="#ffdead",EW="#000080",TW="#fdf5e6",CW="#808000",AW="#6b8e23",MW="#ffa500",RW="#ff4500",OW="#da70d6",DW="#eee8aa",PW="#98fb98",IW="#afeeee",NW="#db7093",LW="#ffefd5",kW="#ffdab9",BW="#cd853f",FW="#ffc0cb",zW="#dda0dd",UW="#b0e0e6",GW="#800080",HW="#663399",jW="#ff0000",VW="#bc8f8f",qW="#4169e1",XW="#8b4513",YW="#fa8072",WW="#f4a460",$W="#2e8b57",KW="#fff5ee",ZW="#a0522d",QW="#c0c0c0",JW="#87ceeb",e$="#6a5acd",t$="#708090",r$="#708090",n$="#fffafa",i$="#00ff7f",a$="#4682b4",s$="#d2b48c",o$="#008080",l$="#d8bfd8",u$="#ff6347",c$="#40e0d0",h$="#ee82ee",f$="#f5deb3",d$="#ffffff",v$="#f5f5f5",p$="#ffff00",g$="#9acd32",m$={aliceblue:DX,antiquewhite:PX,aqua:IX,aquamarine:NX,azure:LX,beige:kX,bisque:BX,black:FX,blanchedalmond:zX,blue:UX,blueviolet:GX,brown:HX,burlywood:jX,cadetblue:VX,chartreuse:qX,chocolate:XX,coral:YX,cornflowerblue:WX,cornsilk:$X,crimson:KX,cyan:ZX,darkblue:QX,darkcyan:JX,darkgoldenrod:eY,darkgray:tY,darkgreen:rY,darkgrey:nY,darkkhaki:iY,darkmagenta:aY,darkolivegreen:sY,darkorange:oY,darkorchid:lY,darkred:uY,darksalmon:cY,darkseagreen:hY,darkslateblue:fY,darkslategray:dY,darkslategrey:vY,darkturquoise:pY,darkviolet:gY,deeppink:mY,deepskyblue:yY,dimgray:bY,dimgrey:xY,dodgerblue:_Y,firebrick:wY,floralwhite:SY,forestgreen:EY,fuchsia:TY,gainsboro:CY,ghostwhite:AY,goldenrod:MY,gold:RY,gray:OY,green:DY,greenyellow:PY,grey:IY,honeydew:NY,hotpink:LY,indianred:kY,indigo:BY,ivory:FY,khaki:zY,lavenderblush:UY,lavender:GY,lawngreen:HY,lemonchiffon:jY,lightblue:VY,lightcoral:qY,lightcyan:XY,lightgoldenrodyellow:YY,lightgray:WY,lightgreen:$Y,lightgrey:KY,lightpink:ZY,lightsalmon:QY,lightseagreen:JY,lightskyblue:eW,lightslategray:tW,lightslategrey:rW,lightsteelblue:nW,lightyellow:iW,lime:aW,limegreen:sW,linen:oW,magenta:lW,maroon:uW,mediumaquamarine:cW,mediumblue:hW,mediumorchid:fW,mediumpurple:dW,mediumseagreen:vW,mediumslateblue:pW,mediumspringgreen:gW,mediumturquoise:mW,mediumvioletred:yW,midnightblue:bW,mintcream:xW,mistyrose:_W,moccasin:wW,navajowhite:SW,navy:EW,oldlace:TW,olive:CW,olivedrab:AW,orange:MW,orangered:RW,orchid:OW,palegoldenrod:DW,palegreen:PW,paleturquoise:IW,palevioletred:NW,papayawhip:LW,peachpuff:kW,peru:BW,pink:FW,plum:zW,powderblue:UW,purple:GW,rebeccapurple:HW,red:jW,rosybrown:VW,royalblue:qW,saddlebrown:XW,salmon:YW,sandybrown:WW,seagreen:$W,seashell:KW,sienna:ZW,silver:QW,skyblue:JW,slateblue:e$,slategray:t$,slategrey:r$,snow:n$,springgreen:i$,steelblue:a$,tan:s$,teal:o$,thistle:l$,tomato:u$,turquoise:c$,violet:h$,wheat:f$,white:d$,whitesmoke:v$,yellow:p$,yellowgreen:g$};function pu(r,e){return e===void 0&&(e=[]),e[0]=(r>>16&255)/255,e[1]=(r>>8&255)/255,e[2]=(r&255)/255,e}function bw(r){var e=r.toString(16);return e="000000".substring(0,6-e.length)+e,"#"+e}function xw(r){return typeof r=="string"&&(r=m$[r.toLowerCase()]||r,r[0]==="#"&&(r=r.slice(1))),parseInt(r,16)}function y$(r){return(r[0]*255<<16)+(r[1]*255<<8)+(r[2]*255|0)}function b$(){for(var r=[],e=[],t=0;t<32;t++)r[t]=t,e[t]=t;r[Et.NORMAL_NPM]=Et.NORMAL,r[Et.ADD_NPM]=Et.ADD,r[Et.SCREEN_NPM]=Et.SCREEN,e[Et.NORMAL]=Et.NORMAL_NPM,e[Et.ADD]=Et.ADD_NPM,e[Et.SCREEN]=Et.SCREEN_NPM;var n=[];return n.push(e),n.push(r),n}var _w=b$();function ww(r,e){return _w[e?1:0][r]}function GO(r,e,t,n){return t=t||new Float32Array(4),n||n===void 0?(t[0]=r[0]*e,t[1]=r[1]*e,t[2]=r[2]*e):(t[0]=r[0],t[1]=r[1],t[2]=r[2]),t[3]=e,t}function Sg(r,e){if(e===1)return(e*255<<24)+r;if(e===0)return 0;var t=r>>16&255,n=r>>8&255,i=r&255;return t=t*e+.5|0,n=n*e+.5|0,i=i*e+.5|0,(e*255<<24)+(t<<16)+(n<<8)+i}function Sw(r,e,t,n){return t=t||new Float32Array(4),t[0]=(r>>16&255)/255,t[1]=(r>>8&255)/255,t[2]=(r&255)/255,(n||n===void 0)&&(t[0]*=e,t[1]*=e,t[2]*=e),t[3]=e,t}function HO(r,e){e===void 0&&(e=null);var t=r*6;if(e=e||new Uint16Array(t),e.length!==t)throw new Error("Out buffer length is incorrect, got "+e.length+" and expected "+t);for(var n=0,i=0;n<t;n+=6,i+=4)e[n+0]=i+0,e[n+1]=i+1,e[n+2]=i+2,e[n+3]=i+0,e[n+4]=i+2,e[n+5]=i+3;return e}function Eg(r){if(r.BYTES_PER_ELEMENT===4)return r instanceof Float32Array?"Float32Array":r instanceof Uint32Array?"Uint32Array":"Int32Array";if(r.BYTES_PER_ELEMENT===2){if(r instanceof Uint16Array)return"Uint16Array"}else if(r.BYTES_PER_ELEMENT===1&&r instanceof Uint8Array)return"Uint8Array";return null}var x$={Float32Array,Uint32Array,Int32Array,Uint8Array};function _$(r,e){for(var t=0,n=0,i={},a=0;a<r.length;a++)n+=e[a],t+=r[a].length;for(var s=new ArrayBuffer(t*4),o=null,l=0,a=0;a<r.length;a++){var c=e[a],h=r[a],d=Eg(h);i[d]||(i[d]=new x$[d](s)),o=i[d];for(var v=0;v<h.length;v++){var g=(v/c|0)*n+l,m=v%c;o[g+m]=h[v]}l+=c}return new Float32Array(s)}function ld(r){return r+=r===0?1:0,--r,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r+1}function E4(r){return!(r&r-1)&&!!r}function T4(r){var e=(r>65535?1:0)<<4;r>>>=e;var t=(r>255?1:0)<<3;return r>>>=t,e|=t,t=(r>15?1:0)<<2,r>>>=t,e|=t,t=(r>3?1:0)<<1,r>>>=t,e|=t,e|r>>1}function lu(r,e,t){var n=r.length,i;if(!(e>=n||t===0)){t=e+t>n?n-e:t;var a=n-t;for(i=e;i<a;++i)r[i]=r[i+t];r.length=a}}function ou(r){return r===0?0:r<0?-1:1}var w$=0;function rl(){return++w$}var HC={};function fi(r,e,t){if(t===void 0&&(t=3),!HC[e]){var n=new Error().stack;typeof n>"u"?console.warn("PixiJS Deprecation Warning: ",e+`
  396. Deprecated since v`+r):(n=n.split(`
  397. `).splice(t).join(`
  398. `),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",e+`
  399. Deprecated since v`+r),console.warn(n),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",e+`
  400. Deprecated since v`+r),console.warn(n))),HC[e]=!0}}var C4={},Ti=Object.create(null),ua=Object.create(null);function S$(){var r;for(r in Ti)Ti[r].destroy();for(r in ua)ua[r].destroy()}function E$(){var r;for(r in Ti)delete Ti[r];for(r in ua)delete ua[r]}var A4=(function(){function r(e,t,n){this.canvas=ht.ADAPTER.createCanvas(),this.context=this.canvas.getContext("2d"),this.resolution=n||ht.RESOLUTION,this.resize(e,t)}return r.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},r.prototype.resize=function(e,t){this.canvas.width=Math.round(e*this.resolution),this.canvas.height=Math.round(t*this.resolution)},r.prototype.destroy=function(){this.context=null,this.canvas=null},Object.defineProperty(r.prototype,"width",{get:function(){return this.canvas.width},set:function(e){this.canvas.width=Math.round(e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this.canvas.height},set:function(e){this.canvas.height=Math.round(e)},enumerable:!1,configurable:!0}),r})();function jO(r){var e=r.width,t=r.height,n=r.getContext("2d",{willReadFrequently:!0}),i=n.getImageData(0,0,e,t),a=i.data,s=a.length,o={top:null,left:null,right:null,bottom:null},l=null,c,h,d;for(c=0;c<s;c+=4)a[c+3]!==0&&(h=c/4%e,d=~~(c/4/e),o.top===null&&(o.top=d),(o.left===null||h<o.left)&&(o.left=h),(o.right===null||o.right<h)&&(o.right=h+1),(o.bottom===null||o.bottom<d)&&(o.bottom=d));return o.top!==null&&(e=o.right-o.left,t=o.bottom-o.top+1,l=n.getImageData(o.left,o.top,e,t)),{height:t,width:e,data:l}}var VO=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i;function T$(r){var e=VO.exec(r);if(e)return{mediaType:e[1]?e[1].toLowerCase():void 0,subType:e[2]?e[2].toLowerCase():void 0,charset:e[3]?e[3].toLowerCase():void 0,encoding:e[4]?e[4].toLowerCase():void 0,data:e[5]}}var yv;function qO(r,e){if(e===void 0&&(e=globalThis.location),r.indexOf("data:")===0)return"";e=e||globalThis.location,yv||(yv=document.createElement("a")),yv.href=r;var t=es.parse(yv.href),n=!t.port&&e.port===""||t.port===e.port;return t.hostname!==e.hostname||!n||t.protocol!==e.protocol?"anonymous":""}function ud(r,e){var t=ht.RETINA_PREFIX.exec(r);return t?parseFloat(t[1]):e!==void 0?e:1}const C$=Object.freeze(Object.defineProperty({__proto__:null,BaseTextureCache:ua,CanvasRenderTarget:A4,DATA_URI:VO,EventEmitter:Ks,ProgramCache:C4,TextureCache:Ti,clearTextureCache:E$,correctBlendMode:ww,createIndicesForQuads:HO,decomposeDataUri:T$,deprecation:fi,destroyTextureCache:S$,determineCrossOrigin:qO,earcut:pw,getBufferType:Eg,getResolutionOfUrl:ud,hex2rgb:pu,hex2string:bw,interleaveTypedArrays:_$,isMobile:ga,isPow2:E4,isWebGLSupported:UO,log2:T4,nextPow2:ld,path:FO,premultiplyBlendMode:_w,premultiplyRgba:GO,premultiplyTint:Sg,premultiplyTintToRgba:Sw,removeItems:lu,rgb2hex:y$,sayHello:zO,sign:ou,skipHello:OX,string2hex:xw,trimCanvas:jO,uid:rl,url:es},Symbol.toStringTag,{value:"Module"}));/*!
  401. * @pixi/math - v6.5.10
  402. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  403. *
  404. * @pixi/math is licensed under the MIT License.
  405. * http://www.opensource.org/licenses/mit-license
  406. */var cd=Math.PI*2,XO=180/Math.PI,YO=Math.PI/180,Mn;(function(r){r[r.POLY=0]="POLY",r[r.RECT=1]="RECT",r[r.CIRC=2]="CIRC",r[r.ELIP=3]="ELIP",r[r.RREC=4]="RREC"})(Mn||(Mn={}));var Ar=(function(){function r(e,t){e===void 0&&(e=0),t===void 0&&(t=0),this.x=0,this.y=0,this.x=e,this.y=t}return r.prototype.clone=function(){return new r(this.x,this.y)},r.prototype.copyFrom=function(e){return this.set(e.x,e.y),this},r.prototype.copyTo=function(e){return e.set(this.x,this.y),e},r.prototype.equals=function(e){return e.x===this.x&&e.y===this.y},r.prototype.set=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=e),this.x=e,this.y=t,this},r.prototype.toString=function(){return"[@pixi/math:Point x="+this.x+" y="+this.y+"]"},r})(),bv=[new Ar,new Ar,new Ar,new Ar],$t=(function(){function r(e,t,n,i){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0),i===void 0&&(i=0),this.x=Number(e),this.y=Number(t),this.width=Number(n),this.height=Number(i),this.type=Mn.RECT}return Object.defineProperty(r.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(r,"EMPTY",{get:function(){return new r(0,0,0,0)},enumerable:!1,configurable:!0}),r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.copyFrom=function(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this},r.prototype.copyTo=function(e){return e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e},r.prototype.contains=function(e,t){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&t>=this.y&&t<this.y+this.height},r.prototype.intersects=function(e,t){if(!t){var n=this.x<e.x?e.x:this.x,i=this.right>e.right?e.right:this.right;if(i<=n)return!1;var a=this.y<e.y?e.y:this.y,s=this.bottom>e.bottom?e.bottom:this.bottom;return s>a}var o=this.left,l=this.right,c=this.top,h=this.bottom;if(l<=o||h<=c)return!1;var d=bv[0].set(e.left,e.top),v=bv[1].set(e.left,e.bottom),g=bv[2].set(e.right,e.top),m=bv[3].set(e.right,e.bottom);if(g.x<=d.x||v.y<=d.y)return!1;var x=Math.sign(t.a*t.d-t.b*t.c);if(x===0||(t.apply(d,d),t.apply(v,v),t.apply(g,g),t.apply(m,m),Math.max(d.x,v.x,g.x,m.x)<=o||Math.min(d.x,v.x,g.x,m.x)>=l||Math.max(d.y,v.y,g.y,m.y)<=c||Math.min(d.y,v.y,g.y,m.y)>=h))return!1;var y=x*(v.y-d.y),_=x*(d.x-v.x),w=y*o+_*c,S=y*l+_*c,A=y*o+_*h,C=y*l+_*h;if(Math.max(w,S,A,C)<=y*d.x+_*d.y||Math.min(w,S,A,C)>=y*m.x+_*m.y)return!1;var M=x*(d.y-g.y),E=x*(g.x-d.x),O=M*o+E*c,D=M*l+E*c,I=M*o+E*h,k=M*l+E*h;return!(Math.max(O,D,I,k)<=M*d.x+E*d.y||Math.min(O,D,I,k)>=M*m.x+E*m.y)},r.prototype.pad=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=e),this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this},r.prototype.fit=function(e){var t=Math.max(this.x,e.x),n=Math.min(this.x+this.width,e.x+e.width),i=Math.max(this.y,e.y),a=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(n-t,0),this.y=i,this.height=Math.max(a-i,0),this},r.prototype.ceil=function(e,t){e===void 0&&(e=1),t===void 0&&(t=.001);var n=Math.ceil((this.x+this.width-t)*e)/e,i=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=n-this.x,this.height=i-this.y,this},r.prototype.enlarge=function(e){var t=Math.min(this.x,e.x),n=Math.max(this.x+this.width,e.x+e.width),i=Math.min(this.y,e.y),a=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=n-t,this.y=i,this.height=a-i,this},r.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},r})(),WO=(function(){function r(e,t,n){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0),this.x=e,this.y=t,this.radius=n,this.type=Mn.CIRC}return r.prototype.clone=function(){return new r(this.x,this.y,this.radius)},r.prototype.contains=function(e,t){if(this.radius<=0)return!1;var n=this.radius*this.radius,i=this.x-e,a=this.y-t;return i*=i,a*=a,i+a<=n},r.prototype.getBounds=function(){return new $t(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)},r.prototype.toString=function(){return"[@pixi/math:Circle x="+this.x+" y="+this.y+" radius="+this.radius+"]"},r})(),$O=(function(){function r(e,t,n,i){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0),i===void 0&&(i=0),this.x=e,this.y=t,this.width=n,this.height=i,this.type=Mn.ELIP}return r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.contains=function(e,t){if(this.width<=0||this.height<=0)return!1;var n=(e-this.x)/this.width,i=(t-this.y)/this.height;return n*=n,i*=i,n+i<=1},r.prototype.getBounds=function(){return new $t(this.x-this.width,this.y-this.height,this.width,this.height)},r.prototype.toString=function(){return"[@pixi/math:Ellipse x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},r})(),Uf=(function(){function r(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];var i=Array.isArray(t[0])?t[0]:t;if(typeof i[0]!="number"){for(var a=[],s=0,o=i.length;s<o;s++)a.push(i[s].x,i[s].y);i=a}this.points=i,this.type=Mn.POLY,this.closeStroke=!0}return r.prototype.clone=function(){var e=this.points.slice(),t=new r(e);return t.closeStroke=this.closeStroke,t},r.prototype.contains=function(e,t){for(var n=!1,i=this.points.length/2,a=0,s=i-1;a<i;s=a++){var o=this.points[a*2],l=this.points[a*2+1],c=this.points[s*2],h=this.points[s*2+1],d=l>t!=h>t&&e<(c-o)*((t-l)/(h-l))+o;d&&(n=!n)}return n},r.prototype.toString=function(){return"[@pixi/math:Polygon"+("closeStroke="+this.closeStroke)+("points="+this.points.reduce(function(e,t){return e+", "+t},"")+"]")},r})(),KO=(function(){function r(e,t,n,i,a){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0),i===void 0&&(i=0),a===void 0&&(a=20),this.x=e,this.y=t,this.width=n,this.height=i,this.radius=a,this.type=Mn.RREC}return r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height,this.radius)},r.prototype.contains=function(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){var n=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+n&&t<=this.y+this.height-n||e>=this.x+n&&e<=this.x+this.width-n)return!0;var i=e-(this.x+n),a=t-(this.y+n),s=n*n;if(i*i+a*a<=s||(i=e-(this.x+this.width-n),i*i+a*a<=s)||(a=t-(this.y+this.height-n),i*i+a*a<=s)||(i=e-(this.x+n),i*i+a*a<=s))return!0}return!1},r.prototype.toString=function(){return"[@pixi/math:RoundedRectangle x="+this.x+" y="+this.y+("width="+this.width+" height="+this.height+" radius="+this.radius+"]")},r})(),Go=(function(){function r(e,t,n,i){n===void 0&&(n=0),i===void 0&&(i=0),this._x=n,this._y=i,this.cb=e,this.scope=t}return r.prototype.clone=function(e,t){return e===void 0&&(e=this.cb),t===void 0&&(t=this.scope),new r(e,t,this._x,this._y)},r.prototype.set=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=e),(this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this.cb.call(this.scope)),this},r.prototype.copyFrom=function(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this},r.prototype.copyTo=function(e){return e.set(this._x,this._y),e},r.prototype.equals=function(e){return e.x===this._x&&e.y===this._y},r.prototype.toString=function(){return"[@pixi/math:ObservablePoint x=0 y=0 scope="+this.scope+"]"},Object.defineProperty(r.prototype,"x",{get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"y",{get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),r})(),qr=(function(){function r(e,t,n,i,a,s){e===void 0&&(e=1),t===void 0&&(t=0),n===void 0&&(n=0),i===void 0&&(i=1),a===void 0&&(a=0),s===void 0&&(s=0),this.array=null,this.a=e,this.b=t,this.c=n,this.d=i,this.tx=a,this.ty=s}return r.prototype.fromArray=function(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]},r.prototype.set=function(e,t,n,i,a,s){return this.a=e,this.b=t,this.c=n,this.d=i,this.tx=a,this.ty=s,this},r.prototype.toArray=function(e,t){this.array||(this.array=new Float32Array(9));var n=t||this.array;return e?(n[0]=this.a,n[1]=this.b,n[2]=0,n[3]=this.c,n[4]=this.d,n[5]=0,n[6]=this.tx,n[7]=this.ty,n[8]=1):(n[0]=this.a,n[1]=this.c,n[2]=this.tx,n[3]=this.b,n[4]=this.d,n[5]=this.ty,n[6]=0,n[7]=0,n[8]=1),n},r.prototype.apply=function(e,t){t=t||new Ar;var n=e.x,i=e.y;return t.x=this.a*n+this.c*i+this.tx,t.y=this.b*n+this.d*i+this.ty,t},r.prototype.applyInverse=function(e,t){t=t||new Ar;var n=1/(this.a*this.d+this.c*-this.b),i=e.x,a=e.y;return t.x=this.d*n*i+-this.c*n*a+(this.ty*this.c-this.tx*this.d)*n,t.y=this.a*n*a+-this.b*n*i+(-this.ty*this.a+this.tx*this.b)*n,t},r.prototype.translate=function(e,t){return this.tx+=e,this.ty+=t,this},r.prototype.scale=function(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this},r.prototype.rotate=function(e){var t=Math.cos(e),n=Math.sin(e),i=this.a,a=this.c,s=this.tx;return this.a=i*t-this.b*n,this.b=i*n+this.b*t,this.c=a*t-this.d*n,this.d=a*n+this.d*t,this.tx=s*t-this.ty*n,this.ty=s*n+this.ty*t,this},r.prototype.append=function(e){var t=this.a,n=this.b,i=this.c,a=this.d;return this.a=e.a*t+e.b*i,this.b=e.a*n+e.b*a,this.c=e.c*t+e.d*i,this.d=e.c*n+e.d*a,this.tx=e.tx*t+e.ty*i+this.tx,this.ty=e.tx*n+e.ty*a+this.ty,this},r.prototype.setTransform=function(e,t,n,i,a,s,o,l,c){return this.a=Math.cos(o+c)*a,this.b=Math.sin(o+c)*a,this.c=-Math.sin(o-l)*s,this.d=Math.cos(o-l)*s,this.tx=e-(n*this.a+i*this.c),this.ty=t-(n*this.b+i*this.d),this},r.prototype.prepend=function(e){var t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){var n=this.a,i=this.c;this.a=n*e.a+this.b*e.c,this.b=n*e.b+this.b*e.d,this.c=i*e.a+this.d*e.c,this.d=i*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this},r.prototype.decompose=function(e){var t=this.a,n=this.b,i=this.c,a=this.d,s=e.pivot,o=-Math.atan2(-i,a),l=Math.atan2(n,t),c=Math.abs(o+l);return c<1e-5||Math.abs(cd-c)<1e-5?(e.rotation=l,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=o,e.skew.y=l),e.scale.x=Math.sqrt(t*t+n*n),e.scale.y=Math.sqrt(i*i+a*a),e.position.x=this.tx+(s.x*t+s.y*i),e.position.y=this.ty+(s.x*n+s.y*a),e},r.prototype.invert=function(){var e=this.a,t=this.b,n=this.c,i=this.d,a=this.tx,s=e*i-t*n;return this.a=i/s,this.b=-t/s,this.c=-n/s,this.d=e/s,this.tx=(n*this.ty-i*a)/s,this.ty=-(e*this.ty-t*a)/s,this},r.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},r.prototype.clone=function(){var e=new r;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},r.prototype.copyTo=function(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},r.prototype.copyFrom=function(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this},r.prototype.toString=function(){return"[@pixi/math:Matrix a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+"]"},Object.defineProperty(r,"IDENTITY",{get:function(){return new r},enumerable:!1,configurable:!0}),Object.defineProperty(r,"TEMP_MATRIX",{get:function(){return new r},enumerable:!1,configurable:!0}),r})(),Kl=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Zl=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Ql=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Jl=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],M4=[],ZO=[],xv=Math.sign;function A$(){for(var r=0;r<16;r++){var e=[];M4.push(e);for(var t=0;t<16;t++)for(var n=xv(Kl[r]*Kl[t]+Ql[r]*Zl[t]),i=xv(Zl[r]*Kl[t]+Jl[r]*Zl[t]),a=xv(Kl[r]*Ql[t]+Ql[r]*Jl[t]),s=xv(Zl[r]*Ql[t]+Jl[r]*Jl[t]),o=0;o<16;o++)if(Kl[o]===n&&Zl[o]===i&&Ql[o]===a&&Jl[o]===s){e.push(o);break}}for(var r=0;r<16;r++){var l=new qr;l.set(Kl[r],Zl[r],Ql[r],Jl[r],0,0),ZO.push(l)}}A$();var Hr={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(r){return Kl[r]},uY:function(r){return Zl[r]},vX:function(r){return Ql[r]},vY:function(r){return Jl[r]},inv:function(r){return r&8?r&15:-r&7},add:function(r,e){return M4[r][e]},sub:function(r,e){return M4[r][Hr.inv(e)]},rotate180:function(r){return r^4},isVertical:function(r){return(r&3)===2},byDirection:function(r,e){return Math.abs(r)*2<=Math.abs(e)?e>=0?Hr.S:Hr.N:Math.abs(e)*2<=Math.abs(r)?r>0?Hr.E:Hr.W:e>0?r>0?Hr.SE:Hr.SW:r>0?Hr.NE:Hr.NW},matrixAppendRotationInv:function(r,e,t,n){t===void 0&&(t=0),n===void 0&&(n=0);var i=ZO[Hr.inv(e)];i.tx=t,i.ty=n,r.append(i)}},Tg=(function(){function r(){this.worldTransform=new qr,this.localTransform=new qr,this.position=new Go(this.onChange,this,0,0),this.scale=new Go(this.onChange,this,1,1),this.pivot=new Go(this.onChange,this,0,0),this.skew=new Go(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return r.prototype.onChange=function(){this._localID++},r.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},r.prototype.toString=function(){return"[@pixi/math:Transform "+("position=("+this.position.x+", "+this.position.y+") ")+("rotation="+this.rotation+" ")+("scale=("+this.scale.x+", "+this.scale.y+") ")+("skew=("+this.skew.x+", "+this.skew.y+") ")+"]"},r.prototype.updateLocalTransform=function(){var e=this.localTransform;this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1)},r.prototype.updateTransform=function(e){var t=this.localTransform;if(this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==e._worldID){var n=e.worldTransform,i=this.worldTransform;i.a=t.a*n.a+t.b*n.c,i.b=t.a*n.b+t.b*n.d,i.c=t.c*n.a+t.d*n.c,i.d=t.c*n.b+t.d*n.d,i.tx=t.tx*n.a+t.ty*n.c+n.tx,i.ty=t.tx*n.b+t.ty*n.d+n.ty,this._parentID=e._worldID,this._worldID++}},r.prototype.setFromMatrix=function(e){e.decompose(this),this._localID++},Object.defineProperty(r.prototype,"rotation",{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,this.updateSkew())},enumerable:!1,configurable:!0}),r.IDENTITY=new r,r})();/*!
  407. * @pixi/display - v6.5.10
  408. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  409. *
  410. * @pixi/display is licensed under the MIT License.
  411. * http://www.opensource.org/licenses/mit-license
  412. */ht.SORTABLE_CHILDREN=!1;var hd=(function(){function r(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return r.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},r.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},r.prototype.getRectangle=function(e){return this.minX>this.maxX||this.minY>this.maxY?$t.EMPTY:(e=e||new $t(0,0,1,1),e.x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)},r.prototype.addPoint=function(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)},r.prototype.addPointMatrix=function(e,t){var n=e.a,i=e.b,a=e.c,s=e.d,o=e.tx,l=e.ty,c=n*t.x+a*t.y+o,h=i*t.x+s*t.y+l;this.minX=Math.min(this.minX,c),this.maxX=Math.max(this.maxX,c),this.minY=Math.min(this.minY,h),this.maxY=Math.max(this.maxY,h)},r.prototype.addQuad=function(e){var t=this.minX,n=this.minY,i=this.maxX,a=this.maxY,s=e[0],o=e[1];t=s<t?s:t,n=o<n?o:n,i=s>i?s:i,a=o>a?o:a,s=e[2],o=e[3],t=s<t?s:t,n=o<n?o:n,i=s>i?s:i,a=o>a?o:a,s=e[4],o=e[5],t=s<t?s:t,n=o<n?o:n,i=s>i?s:i,a=o>a?o:a,s=e[6],o=e[7],t=s<t?s:t,n=o<n?o:n,i=s>i?s:i,a=o>a?o:a,this.minX=t,this.minY=n,this.maxX=i,this.maxY=a},r.prototype.addFrame=function(e,t,n,i,a){this.addFrameMatrix(e.worldTransform,t,n,i,a)},r.prototype.addFrameMatrix=function(e,t,n,i,a){var s=e.a,o=e.b,l=e.c,c=e.d,h=e.tx,d=e.ty,v=this.minX,g=this.minY,m=this.maxX,x=this.maxY,y=s*t+l*n+h,_=o*t+c*n+d;v=y<v?y:v,g=_<g?_:g,m=y>m?y:m,x=_>x?_:x,y=s*i+l*n+h,_=o*i+c*n+d,v=y<v?y:v,g=_<g?_:g,m=y>m?y:m,x=_>x?_:x,y=s*t+l*a+h,_=o*t+c*a+d,v=y<v?y:v,g=_<g?_:g,m=y>m?y:m,x=_>x?_:x,y=s*i+l*a+h,_=o*i+c*a+d,v=y<v?y:v,g=_<g?_:g,m=y>m?y:m,x=_>x?_:x,this.minX=v,this.minY=g,this.maxX=m,this.maxY=x},r.prototype.addVertexData=function(e,t,n){for(var i=this.minX,a=this.minY,s=this.maxX,o=this.maxY,l=t;l<n;l+=2){var c=e[l],h=e[l+1];i=c<i?c:i,a=h<a?h:a,s=c>s?c:s,o=h>o?h:o}this.minX=i,this.minY=a,this.maxX=s,this.maxY=o},r.prototype.addVertices=function(e,t,n,i){this.addVerticesMatrix(e.worldTransform,t,n,i)},r.prototype.addVerticesMatrix=function(e,t,n,i,a,s){a===void 0&&(a=0),s===void 0&&(s=a);for(var o=e.a,l=e.b,c=e.c,h=e.d,d=e.tx,v=e.ty,g=this.minX,m=this.minY,x=this.maxX,y=this.maxY,_=n;_<i;_+=2){var w=t[_],S=t[_+1],A=o*w+c*S+d,C=h*S+l*w+v;g=Math.min(g,A-a),x=Math.max(x,A+a),m=Math.min(m,C-s),y=Math.max(y,C+s)}this.minX=g,this.minY=m,this.maxX=x,this.maxY=y},r.prototype.addBounds=function(e){var t=this.minX,n=this.minY,i=this.maxX,a=this.maxY;this.minX=e.minX<t?e.minX:t,this.minY=e.minY<n?e.minY:n,this.maxX=e.maxX>i?e.maxX:i,this.maxY=e.maxY>a?e.maxY:a},r.prototype.addBoundsMask=function(e,t){var n=e.minX>t.minX?e.minX:t.minX,i=e.minY>t.minY?e.minY:t.minY,a=e.maxX<t.maxX?e.maxX:t.maxX,s=e.maxY<t.maxY?e.maxY:t.maxY;if(n<=a&&i<=s){var o=this.minX,l=this.minY,c=this.maxX,h=this.maxY;this.minX=n<o?n:o,this.minY=i<l?i:l,this.maxX=a>c?a:c,this.maxY=s>h?s:h}},r.prototype.addBoundsMatrix=function(e,t){this.addFrameMatrix(t,e.minX,e.minY,e.maxX,e.maxY)},r.prototype.addBoundsArea=function(e,t){var n=e.minX>t.x?e.minX:t.x,i=e.minY>t.y?e.minY:t.y,a=e.maxX<t.x+t.width?e.maxX:t.x+t.width,s=e.maxY<t.y+t.height?e.maxY:t.y+t.height;if(n<=a&&i<=s){var o=this.minX,l=this.minY,c=this.maxX,h=this.maxY;this.minX=n<o?n:o,this.minY=i<l?i:l,this.maxX=a>c?a:c,this.maxY=s>h?s:h}},r.prototype.pad=function(e,t){e===void 0&&(e=0),t===void 0&&(t=e),this.isEmpty()||(this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t)},r.prototype.addFramePad=function(e,t,n,i,a,s){e-=a,t-=s,n+=a,i+=s,this.minX=this.minX<e?this.minX:e,this.maxX=this.maxX>n?this.maxX:n,this.minY=this.minY<t?this.minY:t,this.maxY=this.maxY>i?this.maxY:i},r})();/*! *****************************************************************************
  413. Copyright (c) Microsoft Corporation.
  414. Permission to use, copy, modify, and/or distribute this software for any
  415. purpose with or without fee is hereby granted.
  416. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  417. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  418. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  419. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  420. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  421. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  422. PERFORMANCE OF THIS SOFTWARE.
  423. ***************************************************************************** */var R4=function(r,e){return R4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},R4(r,e)};function Ew(r,e){R4(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var ln=(function(r){Ew(e,r);function e(){var t=r.call(this)||this;return t.tempDisplayObjectParent=null,t.transform=new Tg,t.alpha=1,t.visible=!0,t.renderable=!0,t.cullable=!1,t.cullArea=null,t.parent=null,t.worldAlpha=1,t._lastSortedIndex=0,t._zIndex=0,t.filterArea=null,t.filters=null,t._enabledFilters=null,t._bounds=new hd,t._localBounds=null,t._boundsID=0,t._boundsRect=null,t._localBoundsRect=null,t._mask=null,t._maskRefCount=0,t._destroyed=!1,t.isSprite=!1,t.isMask=!1,t}return e.mixin=function(t){for(var n=Object.keys(t),i=0;i<n.length;++i){var a=n[i];Object.defineProperty(e.prototype,a,Object.getOwnPropertyDescriptor(t,a))}},Object.defineProperty(e.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!1,configurable:!0}),e.prototype._recursivePostUpdateTransform=function(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)},e.prototype.updateTransform=function(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha},e.prototype.getBounds=function(t,n){return t||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),n||(this._boundsRect||(this._boundsRect=new $t),n=this._boundsRect),this._bounds.getRectangle(n)},e.prototype.getLocalBounds=function(t){t||(this._localBoundsRect||(this._localBoundsRect=new $t),t=this._localBoundsRect),this._localBounds||(this._localBounds=new hd);var n=this.transform,i=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;var a=this._bounds,s=this._boundsID;this._bounds=this._localBounds;var o=this.getBounds(!1,t);return this.parent=i,this.transform=n,this._bounds=a,this._bounds.updateID+=this._boundsID-s,o},e.prototype.toGlobal=function(t,n,i){return i===void 0&&(i=!1),i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,n)},e.prototype.toLocal=function(t,n,i,a){return n&&(t=n.toGlobal(t,i,a)),a||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,i)},e.prototype.setParent=function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t},e.prototype.setTransform=function(t,n,i,a,s,o,l,c,h){return t===void 0&&(t=0),n===void 0&&(n=0),i===void 0&&(i=1),a===void 0&&(a=1),s===void 0&&(s=0),o===void 0&&(o=0),l===void 0&&(l=0),c===void 0&&(c=0),h===void 0&&(h=0),this.position.x=t,this.position.y=n,this.scale.x=i||1,this.scale.y=a||1,this.rotation=s,this.skew.x=o,this.skew.y=l,this.pivot.x=c,this.pivot.y=h,this},e.prototype.destroy=function(t){this.parent&&this.parent.removeChild(this),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.interactive=!1,this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()},Object.defineProperty(e.prototype,"_tempDisplayObjectParent",{get:function(){return this.tempDisplayObjectParent===null&&(this.tempDisplayObjectParent=new Tw),this.tempDisplayObjectParent},enumerable:!1,configurable:!0}),e.prototype.enableTempParent=function(){var t=this.parent;return this.parent=this._tempDisplayObjectParent,t},e.prototype.disableTempParent=function(t){this.parent=t},Object.defineProperty(e.prototype,"x",{get:function(){return this.position.x},set:function(t){this.transform.position.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.position.y},set:function(t){this.transform.position.y=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.transform.worldTransform},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localTransform",{get:function(){return this.transform.localTransform},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.transform.position},set:function(t){this.transform.position.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scale",{get:function(){return this.transform.scale},set:function(t){this.transform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pivot",{get:function(){return this.transform.pivot},set:function(t){this.transform.pivot.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"skew",{get:function(){return this.transform.skew},set:function(t){this.transform.skew.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotation",{get:function(){return this.transform.rotation},set:function(t){this.transform.rotation=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"angle",{get:function(){return this.transform.rotation*XO},set:function(t){this.transform.rotation=t*YO},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zIndex",{get:function(){return this._zIndex},set:function(t){this._zIndex=t,this.parent&&(this.parent.sortDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"worldVisible",{get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mask",{get:function(){return this._mask},set:function(t){if(this._mask!==t){if(this._mask){var n=this._mask.isMaskData?this._mask.maskObject:this._mask;n&&(n._maskRefCount--,n._maskRefCount===0&&(n.renderable=!0,n.isMask=!1))}if(this._mask=t,this._mask){var n=this._mask.isMaskData?this._mask.maskObject:this._mask;n&&(n._maskRefCount===0&&(n.renderable=!1,n.isMask=!0),n._maskRefCount++)}}},enumerable:!1,configurable:!0}),e})(Ks),Tw=(function(r){Ew(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.sortDirty=null,t}return e})(ln);ln.prototype.displayObjectUpdateTransform=ln.prototype.updateTransform;function M$(r,e){return r.zIndex===e.zIndex?r._lastSortedIndex-e._lastSortedIndex:r.zIndex-e.zIndex}var _a=(function(r){Ew(e,r);function e(){var t=r.call(this)||this;return t.children=[],t.sortableChildren=ht.SORTABLE_CHILDREN,t.sortDirty=!1,t}return e.prototype.onChildrenChange=function(t){},e.prototype.addChild=function(){for(var t=arguments,n=[],i=0;i<arguments.length;i++)n[i]=t[i];if(n.length>1)for(var a=0;a<n.length;a++)this.addChild(n[a]);else{var s=n[0];s.parent&&s.parent.removeChild(s),s.parent=this,this.sortDirty=!0,s.transform._parentID=-1,this.children.push(s),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",s,this,this.children.length-1),s.emit("added",this)}return n[0]},e.prototype.addChildAt=function(t,n){if(n<0||n>this.children.length)throw new Error(t+"addChildAt: The index "+n+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(n,0,t),this._boundsID++,this.onChildrenChange(n),t.emit("added",this),this.emit("childAdded",t,this,n),t},e.prototype.swapChildren=function(t,n){if(t!==n){var i=this.getChildIndex(t),a=this.getChildIndex(n);this.children[i]=n,this.children[a]=t,this.onChildrenChange(i<a?i:a)}},e.prototype.getChildIndex=function(t){var n=this.children.indexOf(t);if(n===-1)throw new Error("The supplied DisplayObject must be a child of the caller");return n},e.prototype.setChildIndex=function(t,n){if(n<0||n>=this.children.length)throw new Error("The index "+n+" supplied is out of bounds "+this.children.length);var i=this.getChildIndex(t);lu(this.children,i,1),this.children.splice(n,0,t),this.onChildrenChange(n)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(){for(var t=arguments,n=[],i=0;i<arguments.length;i++)n[i]=t[i];if(n.length>1)for(var a=0;a<n.length;a++)this.removeChild(n[a]);else{var s=n[0],o=this.children.indexOf(s);if(o===-1)return null;s.parent=null,s.transform._parentID=-1,lu(this.children,o,1),this._boundsID++,this.onChildrenChange(o),s.emit("removed",this),this.emit("childRemoved",s,this,o)}return n[0]},e.prototype.removeChildAt=function(t){var n=this.getChildAt(t);return n.parent=null,n.transform._parentID=-1,lu(this.children,t,1),this._boundsID++,this.onChildrenChange(t),n.emit("removed",this),this.emit("childRemoved",n,this,t),n},e.prototype.removeChildren=function(t,n){t===void 0&&(t=0),n===void 0&&(n=this.children.length);var i=t,a=n,s=a-i,o;if(s>0&&s<=a){o=this.children.splice(i,s);for(var l=0;l<o.length;++l)o[l].parent=null,o[l].transform&&(o[l].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(var l=0;l<o.length;++l)o[l].emit("removed",this),this.emit("childRemoved",o[l],this,l);return o}else if(s===0&&this.children.length===0)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},e.prototype.sortChildren=function(){for(var t=!1,n=0,i=this.children.length;n<i;++n){var a=this.children[n];a._lastSortedIndex=n,!t&&a.zIndex!==0&&(t=!0)}t&&this.children.length>1&&this.children.sort(M$),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,n=this.children.length;t<n;++t){var i=this.children[t];i.visible&&i.updateTransform()}},e.prototype.calculateBounds=function(){this._bounds.clear(),this._calculateBounds();for(var t=0;t<this.children.length;t++){var n=this.children[t];if(!(!n.visible||!n.renderable))if(n.calculateBounds(),n._mask){var i=n._mask.isMaskData?n._mask.maskObject:n._mask;i?(i.calculateBounds(),this._bounds.addBoundsMask(n._bounds,i._bounds)):this._bounds.addBounds(n._bounds)}else n.filterArea?this._bounds.addBoundsArea(n._bounds,n.filterArea):this._bounds.addBounds(n._bounds)}this._bounds.updateID=this._boundsID},e.prototype.getLocalBounds=function(t,n){n===void 0&&(n=!1);var i=r.prototype.getLocalBounds.call(this,t);if(!n)for(var a=0,s=this.children.length;a<s;++a){var o=this.children[a];o.visible&&o.updateTransform()}return i},e.prototype._calculateBounds=function(){},e.prototype._renderWithCulling=function(t){var n=t.renderTexture.sourceFrame;if(n.width>0&&n.height>0){var i,a;if(this.cullArea?(i=this.cullArea,a=this.worldTransform):this._render!==e.prototype._render&&(i=this.getBounds(!0)),i&&n.intersects(i,a))this._render(t);else if(this.cullArea)return;for(var s=0,o=this.children.length;s<o;++s){var l=this.children[s],c=l.cullable;l.cullable=c||!this.cullArea,l.render(t),l.cullable=c}}},e.prototype.render=function(t){if(!(!this.visible||this.worldAlpha<=0||!this.renderable))if(this._mask||this.filters&&this.filters.length)this.renderAdvanced(t);else if(this.cullable)this._renderWithCulling(t);else{this._render(t);for(var n=0,i=this.children.length;n<i;++n)this.children[n].render(t)}},e.prototype.renderAdvanced=function(t){var n=this.filters,i=this._mask;if(n){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(var a=0;a<n.length;a++)n[a].enabled&&this._enabledFilters.push(n[a])}var s=n&&this._enabledFilters&&this._enabledFilters.length||i&&(!i.isMaskData||i.enabled&&(i.autoDetect||i.type!==vn.NONE));if(s&&t.batch.flush(),n&&this._enabledFilters&&this._enabledFilters.length&&t.filter.push(this,this._enabledFilters),i&&t.mask.push(this,this._mask),this.cullable)this._renderWithCulling(t);else{this._render(t);for(var a=0,o=this.children.length;a<o;++a)this.children[a].render(t)}s&&t.batch.flush(),i&&t.mask.pop(this),n&&this._enabledFilters&&this._enabledFilters.length&&t.filter.pop()},e.prototype._render=function(t){},e.prototype.destroy=function(t){r.prototype.destroy.call(this),this.sortDirty=!1;var n=typeof t=="boolean"?t:t&&t.children,i=this.removeChildren(0,this.children.length);if(n)for(var a=0;a<i.length;++a)i[a].destroy(t)},Object.defineProperty(e.prototype,"width",{get:function(){return this.scale.x*this.getLocalBounds().width},set:function(t){var n=this.getLocalBounds().width;n!==0?this.scale.x=t/n:this.scale.x=1,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.scale.y*this.getLocalBounds().height},set:function(t){var n=this.getLocalBounds().height;n!==0?this.scale.y=t/n:this.scale.y=1,this._height=t},enumerable:!1,configurable:!0}),e})(ln);_a.prototype.containerUpdateTransform=_a.prototype.updateTransform;/*!
  424. * @pixi/extensions - v6.5.10
  425. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  426. *
  427. * @pixi/extensions is licensed under the MIT License.
  428. * http://www.opensource.org/licenses/mit-license
  429. *//*! *****************************************************************************
  430. Copyright (c) Microsoft Corporation.
  431. Permission to use, copy, modify, and/or distribute this software for any
  432. purpose with or without fee is hereby granted.
  433. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  434. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  435. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  436. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  437. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  438. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  439. PERFORMANCE OF THIS SOFTWARE.
  440. ***************************************************************************** */var Gf=function(){return Gf=Object.assign||function(e){for(var t=arguments,n,i=1,a=arguments.length;i<a;i++){n=t[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Gf.apply(this,arguments)},yr;(function(r){r.Application="application",r.RendererPlugin="renderer-webgl-plugin",r.CanvasRendererPlugin="renderer-canvas-plugin",r.Loader="loader",r.LoadParser="load-parser",r.ResolveParser="resolve-parser",r.CacheParser="cache-parser",r.DetectionParser="detection-parser"})(yr||(yr={}));var jC=function(r){if(typeof r=="function"||typeof r=="object"&&r.extension){if(!r.extension)throw new Error("Extension class must have an extension object");var e=typeof r.extension!="object"?{type:r.extension}:r.extension;r=Gf(Gf({},e),{ref:r})}if(typeof r=="object")r=Gf({},r);else throw new Error("Invalid extension type");return typeof r.type=="string"&&(r.type=[r.type]),r},us={_addHandlers:null,_removeHandlers:null,_queue:{},remove:function(){for(var r=arguments,e=this,t=[],n=0;n<arguments.length;n++)t[n]=r[n];return t.map(jC).forEach(function(i){i.type.forEach(function(a){var s,o;return(o=(s=e._removeHandlers)[a])===null||o===void 0?void 0:o.call(s,i)})}),this},add:function(){for(var r=arguments,e=this,t=[],n=0;n<arguments.length;n++)t[n]=r[n];return t.map(jC).forEach(function(i){i.type.forEach(function(a){var s=e._addHandlers,o=e._queue;s[a]?s[a](i):(o[a]=o[a]||[],o[a].push(i))})}),this},handle:function(r,e,t){var n=this._addHandlers=this._addHandlers||{},i=this._removeHandlers=this._removeHandlers||{};if(n[r]||i[r])throw new Error("Extension type "+r+" already has a handler");n[r]=e,i[r]=t;var a=this._queue;return a[r]&&(a[r].forEach(function(s){return e(s)}),delete a[r]),this},handleByMap:function(r,e){return this.handle(r,function(t){e[t.name]=t.ref},function(t){delete e[t.name]})},handleByList:function(r,e){return this.handle(r,function(t){var n,i;e.includes(t.ref)||(e.push(t.ref),r===yr.Loader&&((i=(n=t.ref).add)===null||i===void 0||i.call(n)))},function(t){var n=e.indexOf(t.ref);n!==-1&&e.splice(n,1)})}};/*!
  441. * @pixi/runner - v6.5.10
  442. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  443. *
  444. * @pixi/runner is licensed under the MIT License.
  445. * http://www.opensource.org/licenses/mit-license
  446. */var Bn=(function(){function r(e){this.items=[],this._name=e,this._aliasCount=0}return r.prototype.emit=function(e,t,n,i,a,s,o,l){if(arguments.length>8)throw new Error("max arguments reached");var c=this,h=c.name,d=c.items;this._aliasCount++;for(var v=0,g=d.length;v<g;v++)d[v][h](e,t,n,i,a,s,o,l);return d===this.items&&this._aliasCount--,this},r.prototype.ensureNonAliasedItems=function(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},r.prototype.add=function(e){return e[this._name]&&(this.ensureNonAliasedItems(),this.remove(e),this.items.push(e)),this},r.prototype.remove=function(e){var t=this.items.indexOf(e);return t!==-1&&(this.ensureNonAliasedItems(),this.items.splice(t,1)),this},r.prototype.contains=function(e){return this.items.indexOf(e)!==-1},r.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},r.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(r.prototype,"empty",{get:function(){return this.items.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),r})();Object.defineProperties(Bn.prototype,{dispatch:{value:Bn.prototype.emit},run:{value:Bn.prototype.emit}});/*!
  447. * @pixi/ticker - v6.5.10
  448. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  449. *
  450. * @pixi/ticker is licensed under the MIT License.
  451. * http://www.opensource.org/licenses/mit-license
  452. */ht.TARGET_FPMS=.06;var is;(function(r){r[r.INTERACTION=50]="INTERACTION",r[r.HIGH=25]="HIGH",r[r.NORMAL=0]="NORMAL",r[r.LOW=-25]="LOW",r[r.UTILITY=-50]="UTILITY"})(is||(is={}));var Vb=(function(){function r(e,t,n,i){t===void 0&&(t=null),n===void 0&&(n=0),i===void 0&&(i=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=e,this.context=t,this.priority=n,this.once=i}return r.prototype.match=function(e,t){return t===void 0&&(t=null),this.fn===e&&this.context===t},r.prototype.emit=function(e){this.fn&&(this.context?this.fn.call(this.context,e):this.fn(e));var t=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),t},r.prototype.connect=function(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this},r.prototype.destroy=function(e){e===void 0&&(e=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var t=this.next;return this.next=e?null:t,this.previous=null,t},r})(),Fn=(function(){function r(){var e=this;this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Vb(null,null,1/0),this.deltaMS=1/ht.TARGET_FPMS,this.elapsedMS=1/ht.TARGET_FPMS,this._tick=function(t){e._requestId=null,e.started&&(e.update(t),e.started&&e._requestId===null&&e._head.next&&(e._requestId=requestAnimationFrame(e._tick)))}}return r.prototype._requestIfNeeded=function(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},r.prototype._cancelIfNeeded=function(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)},r.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},r.prototype.add=function(e,t,n){return n===void 0&&(n=is.NORMAL),this._addListener(new Vb(e,t,n))},r.prototype.addOnce=function(e,t,n){return n===void 0&&(n=is.NORMAL),this._addListener(new Vb(e,t,n,!0))},r.prototype._addListener=function(e){var t=this._head.next,n=this._head;if(!t)e.connect(n);else{for(;t;){if(e.priority>t.priority){e.connect(n);break}n=t,t=t.next}e.previous||e.connect(n)}return this._startIfPossible(),this},r.prototype.remove=function(e,t){for(var n=this._head.next;n;)n.match(e,t)?n=n.destroy():n=n.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(r.prototype,"count",{get:function(){if(!this._head)return 0;for(var e=0,t=this._head;t=t.next;)e++;return e},enumerable:!1,configurable:!0}),r.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},r.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},r.prototype.destroy=function(){if(!this._protected){this.stop();for(var e=this._head.next;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}},r.prototype.update=function(e){e===void 0&&(e=performance.now());var t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){var n=e-this._lastFrame|0;if(n<this._minElapsedMS)return;this._lastFrame=e-n%this._minElapsedMS}this.deltaMS=t,this.deltaTime=this.deltaMS*ht.TARGET_FPMS;for(var i=this._head,a=i.next;a;)a=a.emit(this.deltaTime);i.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e},Object.defineProperty(r.prototype,"FPS",{get:function(){return 1e3/this.elapsedMS},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"minFPS",{get:function(){return 1e3/this._maxElapsedMS},set:function(e){var t=Math.min(this.maxFPS,e),n=Math.min(Math.max(0,t)/1e3,ht.TARGET_FPMS);this._maxElapsedMS=1/n},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"maxFPS",{get:function(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0},set:function(e){if(e===0)this._minElapsedMS=0;else{var t=Math.max(this.minFPS,e);this._minElapsedMS=1/(t/1e3)}},enumerable:!1,configurable:!0}),Object.defineProperty(r,"shared",{get:function(){if(!r._shared){var e=r._shared=new r;e.autoStart=!0,e._protected=!0}return r._shared},enumerable:!1,configurable:!0}),Object.defineProperty(r,"system",{get:function(){if(!r._system){var e=r._system=new r;e.autoStart=!0,e._protected=!0}return r._system},enumerable:!1,configurable:!0}),r})(),QO=(function(){function r(){}return r.init=function(e){var t=this;e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{set:function(n){this._ticker&&this._ticker.remove(this.render,this),this._ticker=n,n&&n.add(this.render,this,is.LOW)},get:function(){return this._ticker}}),this.stop=function(){t._ticker.stop()},this.start=function(){t._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?Fn.shared:new Fn,e.autoStart&&this.start()},r.destroy=function(){if(this._ticker){var e=this._ticker;this.ticker=null,e.destroy()}},r.extension=yr.Application,r})();/*!
  453. * @pixi/core - v6.5.10
  454. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  455. *
  456. * @pixi/core is licensed under the MIT License.
  457. * http://www.opensource.org/licenses/mit-license
  458. */ht.PREFER_ENV=ga.any?ns.WEBGL:ns.WEBGL2;ht.STRICT_TEXTURE_CACHE=!1;var fd=[];function Cg(r,e){if(!r)return null;var t="";if(typeof r=="string"){var n=/\.(\w{3,4})(?:$|\?|#)/i.exec(r);n&&(t=n[1].toLowerCase())}for(var i=fd.length-1;i>=0;--i){var a=fd[i];if(a.test&&a.test(r,t))return new a(r,e)}throw new Error("Unrecognized source type to auto-detect Resource")}/*! *****************************************************************************
  459. Copyright (c) Microsoft Corporation.
  460. Permission to use, copy, modify, and/or distribute this software for any
  461. purpose with or without fee is hereby granted.
  462. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  463. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  464. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  465. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  466. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  467. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  468. PERFORMANCE OF THIS SOFTWARE.
  469. ***************************************************************************** */var O4=function(r,e){return O4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},O4(r,e)};function Ir(r,e){O4(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var D4=function(){return D4=Object.assign||function(e){for(var t=arguments,n,i=1,a=arguments.length;i<a;i++){n=t[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},D4.apply(this,arguments)};function R$(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}var gu=(function(){function r(e,t){e===void 0&&(e=0),t===void 0&&(t=0),this._width=e,this._height=t,this.destroyed=!1,this.internal=!1,this.onResize=new Bn("setRealSize"),this.onUpdate=new Bn("update"),this.onError=new Bn("onError")}return r.prototype.bind=function(e){this.onResize.add(e),this.onUpdate.add(e),this.onError.add(e),(this._width||this._height)&&this.onResize.emit(this._width,this._height)},r.prototype.unbind=function(e){this.onResize.remove(e),this.onUpdate.remove(e),this.onError.remove(e)},r.prototype.resize=function(e,t){(e!==this._width||t!==this._height)&&(this._width=e,this._height=t,this.onResize.emit(e,t))},Object.defineProperty(r.prototype,"valid",{get:function(){return!!this._width&&!!this._height},enumerable:!1,configurable:!0}),r.prototype.update=function(){this.destroyed||this.onUpdate.emit()},r.prototype.load=function(){return Promise.resolve(this)},Object.defineProperty(r.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),r.prototype.style=function(e,t,n){return!1},r.prototype.dispose=function(){},r.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)},r.test=function(e,t){return!1},r})(),wu=(function(r){Ir(e,r);function e(t,n){var i=this,a=n||{},s=a.width,o=a.height;if(!s||!o)throw new Error("BufferResource width or height invalid");return i=r.call(this,s,o)||this,i.data=t,i}return e.prototype.upload=function(t,n,i){var a=t.gl;a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.alphaMode===xa.UNPACK);var s=n.realWidth,o=n.realHeight;return i.width===s&&i.height===o?a.texSubImage2D(n.target,0,0,0,s,o,n.format,i.type,this.data):(i.width=s,i.height=o,a.texImage2D(n.target,0,i.internalFormat,s,o,0,n.format,i.type,this.data)),!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e})(gu),O$={scaleMode:Da.NEAREST,format:at.RGBA,alphaMode:xa.NPM},Wt=(function(r){Ir(e,r);function e(t,n){t===void 0&&(t=null),n===void 0&&(n=null);var i=r.call(this)||this;n=n||{};var a=n.alphaMode,s=n.mipmap,o=n.anisotropicLevel,l=n.scaleMode,c=n.width,h=n.height,d=n.wrapMode,v=n.format,g=n.type,m=n.target,x=n.resolution,y=n.resourceOptions;return t&&!(t instanceof gu)&&(t=Cg(t,y),t.internal=!0),i.resolution=x||ht.RESOLUTION,i.width=Math.round((c||0)*i.resolution)/i.resolution,i.height=Math.round((h||0)*i.resolution)/i.resolution,i._mipmap=s!==void 0?s:ht.MIPMAP_TEXTURES,i.anisotropicLevel=o!==void 0?o:ht.ANISOTROPIC_LEVEL,i._wrapMode=d||ht.WRAP_MODE,i._scaleMode=l!==void 0?l:ht.SCALE_MODE,i.format=v||at.RGBA,i.type=g||wt.UNSIGNED_BYTE,i.target=m||Xo.TEXTURE_2D,i.alphaMode=a!==void 0?a:xa.UNPACK,i.uid=rl(),i.touched=0,i.isPowerOfTwo=!1,i._refreshPOT(),i._glTextures={},i.dirtyId=0,i.dirtyStyleId=0,i.cacheId=null,i.valid=c>0&&h>0,i.textureCacheIds=[],i.destroyed=!1,i.resource=null,i._batchEnabled=0,i._batchLocation=0,i.parentTextureArray=null,i.setResource(t),i}return Object.defineProperty(e.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mipmap",{get:function(){return this._mipmap},set:function(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),e.prototype.setStyle=function(t,n){var i;return t!==void 0&&t!==this.scaleMode&&(this.scaleMode=t,i=!0),n!==void 0&&n!==this.mipmap&&(this.mipmap=n,i=!0),i&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,n,i){return i=i||this.resolution,this.setRealSize(t*i,n*i,i)},e.prototype.setRealSize=function(t,n,i){return this.resolution=i||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(n)/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=E4(this.realWidth)&&E4(this.realHeight)},e.prototype.setResolution=function(t){var n=this.resolution;return n===t?this:(this.resolution=t,this.valid&&(this.width=Math.round(this.width*n)/t,this.height=Math.round(this.height*n)/t,this.emit("update",this)),this._refreshPOT(),this)},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.onError=function(t){this.emit("error",this,t)},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete ua[this.cacheId],delete Ti[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.prototype.castToBaseTexture=function(){return this},e.from=function(t,n,i){i===void 0&&(i=ht.STRICT_TEXTURE_CACHE);var a=typeof t=="string",s=null;if(a)s=t;else{if(!t._pixiId){var o=n&&n.pixiIdPrefix||"pixiid";t._pixiId=o+"_"+rl()}s=t._pixiId}var l=ua[s];if(a&&i&&!l)throw new Error('The cacheId "'+s+'" does not exist in BaseTextureCache.');return l||(l=new e(t,n),l.cacheId=s,e.addToCache(l,s)),l},e.fromBuffer=function(t,n,i,a){t=t||new Float32Array(n*i*4);var s=new wu(t,{width:n,height:i}),o=t instanceof Float32Array?wt.FLOAT:wt.UNSIGNED_BYTE;return new e(s,Object.assign({},O$,a||{width:n,height:i,type:o}))},e.addToCache=function(t,n){n&&(t.textureCacheIds.indexOf(n)===-1&&t.textureCacheIds.push(n),ua[n]&&console.warn("BaseTexture added to the cache with an id ["+n+"] that already had an entry"),ua[n]=t)},e.removeFromCache=function(t){if(typeof t=="string"){var n=ua[t];if(n){var i=n.textureCacheIds.indexOf(t);return i>-1&&n.textureCacheIds.splice(i,1),delete ua[t],n}}else if(t&&t.textureCacheIds){for(var a=0;a<t.textureCacheIds.length;++a)delete ua[t.textureCacheIds[a]];return t.textureCacheIds.length=0,t}return null},e._globalBatch=0,e})(Ks),Ag=(function(r){Ir(e,r);function e(t,n){var i=this,a=n||{},s=a.width,o=a.height;i=r.call(this,s,o)||this,i.items=[],i.itemDirtyIds=[];for(var l=0;l<t;l++){var c=new Wt;i.items.push(c),i.itemDirtyIds.push(-2)}return i.length=t,i._load=null,i.baseTexture=null,i}return e.prototype.initFromArray=function(t,n){for(var i=0;i<this.length;i++)t[i]&&(t[i].castToBaseTexture?this.addBaseTextureAt(t[i].castToBaseTexture(),i):t[i]instanceof gu?this.addResourceAt(t[i],i):this.addResourceAt(Cg(t[i],n),i))},e.prototype.dispose=function(){for(var t=0,n=this.length;t<n;t++)this.items[t].destroy();this.items=null,this.itemDirtyIds=null,this._load=null},e.prototype.addResourceAt=function(t,n){if(!this.items[n])throw new Error("Index "+n+" is out of bounds");return t.valid&&!this.valid&&this.resize(t.width,t.height),this.items[n].setResource(t),this},e.prototype.bind=function(t){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");r.prototype.bind.call(this,t);for(var n=0;n<this.length;n++)this.items[n].parentTextureArray=t,this.items[n].on("update",t.update,t)},e.prototype.unbind=function(t){r.prototype.unbind.call(this,t);for(var n=0;n<this.length;n++)this.items[n].parentTextureArray=null,this.items[n].off("update",t.update,t)},e.prototype.load=function(){var t=this;if(this._load)return this._load;var n=this.items.map(function(a){return a.resource}).filter(function(a){return a}),i=n.map(function(a){return a.load()});return this._load=Promise.all(i).then(function(){var a=t.items[0],s=a.realWidth,o=a.realHeight;return t.resize(s,o),Promise.resolve(t)}),this._load},e})(gu),Cw=(function(r){Ir(e,r);function e(t,n){var i=this,a=n||{},s=a.width,o=a.height,l,c;return Array.isArray(t)?(l=t,c=t.length):c=t,i=r.call(this,c,{width:s,height:o})||this,l&&i.initFromArray(l,n),i}return e.prototype.addBaseTextureAt=function(t,n){if(t.resource)this.addResourceAt(t.resource,n);else throw new Error("ArrayResource does not support RenderTexture");return this},e.prototype.bind=function(t){r.prototype.bind.call(this,t),t.target=Xo.TEXTURE_2D_ARRAY},e.prototype.upload=function(t,n,i){var a=this,s=a.length,o=a.itemDirtyIds,l=a.items,c=t.gl;i.dirtyId<0&&c.texImage3D(c.TEXTURE_2D_ARRAY,0,i.internalFormat,this._width,this._height,s,0,n.format,i.type,null);for(var h=0;h<s;h++){var d=l[h];o[h]<d.dirtyId&&(o[h]=d.dirtyId,d.valid&&c.texSubImage3D(c.TEXTURE_2D_ARRAY,0,0,0,h,d.resource.width,d.resource.height,1,n.format,i.type,d.resource.source))}return!0},e})(Ag),as=(function(r){Ir(e,r);function e(t){var n=this,i=t,a=i.naturalWidth||i.videoWidth||i.width,s=i.naturalHeight||i.videoHeight||i.height;return n=r.call(this,a,s)||this,n.source=t,n.noSubImage=!1,n}return e.crossOrigin=function(t,n,i){i===void 0&&n.indexOf("data:")!==0?t.crossOrigin=qO(n):i!==!1&&(t.crossOrigin=typeof i=="string"?i:"anonymous")},e.prototype.upload=function(t,n,i,a){var s=t.gl,o=n.realWidth,l=n.realHeight;if(a=a||this.source,a instanceof HTMLImageElement){if(!a.complete||a.naturalWidth===0)return!1}else if(a instanceof HTMLVideoElement&&a.readyState<=1)return!1;return s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.alphaMode===xa.UNPACK),!this.noSubImage&&n.target===s.TEXTURE_2D&&i.width===o&&i.height===l?s.texSubImage2D(s.TEXTURE_2D,0,0,0,n.format,i.type,a):(i.width=o,i.height=l,s.texImage2D(n.target,0,i.internalFormat,n.format,i.type,a)),!0},e.prototype.update=function(){if(!this.destroyed){var t=this.source,n=t.naturalWidth||t.videoWidth||t.width,i=t.naturalHeight||t.videoHeight||t.height;this.resize(n,i),r.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e})(gu),Aw=(function(r){Ir(e,r);function e(t){return r.call(this,t)||this}return e.test=function(t){var n=globalThis.OffscreenCanvas;return n&&t instanceof n?!0:globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement},e})(as),Mw=(function(r){Ir(e,r);function e(t,n){var i=this,a=n||{},s=a.width,o=a.height,l=a.autoLoad,c=a.linkBaseTexture;if(t&&t.length!==e.SIDES)throw new Error("Invalid length. Got "+t.length+", expected 6");i=r.call(this,6,{width:s,height:o})||this;for(var h=0;h<e.SIDES;h++)i.items[h].target=Xo.TEXTURE_CUBE_MAP_POSITIVE_X+h;return i.linkBaseTexture=c!==!1,t&&i.initFromArray(t,n),l!==!1&&i.load(),i}return e.prototype.bind=function(t){r.prototype.bind.call(this,t),t.target=Xo.TEXTURE_CUBE_MAP},e.prototype.addBaseTextureAt=function(t,n,i){if(!this.items[n])throw new Error("Index "+n+" is out of bounds");if(!this.linkBaseTexture||t.parentTextureArray||Object.keys(t._glTextures).length>0)if(t.resource)this.addResourceAt(t.resource,n);else throw new Error("CubeResource does not support copying of renderTexture.");else t.target=Xo.TEXTURE_CUBE_MAP_POSITIVE_X+n,t.parentTextureArray=this.baseTexture,this.items[n]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[n]=t,this},e.prototype.upload=function(t,n,i){for(var a=this.itemDirtyIds,s=0;s<e.SIDES;s++){var o=this.items[s];(a[s]<o.dirtyId||i.dirtyId<n.dirtyId)&&(o.valid&&o.resource?(o.resource.upload(t,o,i),a[s]=o.dirtyId):a[s]<-1&&(t.gl.texImage2D(o.target,0,i.internalFormat,n.realWidth,n.realHeight,0,n.format,i.type,null),a[s]=-1))}return!0},e.test=function(t){return Array.isArray(t)&&t.length===e.SIDES},e.SIDES=6,e})(Ag),Mg=(function(r){Ir(e,r);function e(t,n){var i=this;if(n=n||{},!(t instanceof HTMLImageElement)){var a=new Image;as.crossOrigin(a,t,n.crossorigin),a.src=t,t=a}return i=r.call(this,t)||this,!t.complete&&i._width&&i._height&&(i._width=0,i._height=0),i.url=t.src,i._process=null,i.preserveBitmap=!1,i.createBitmap=(n.createBitmap!==void 0?n.createBitmap:ht.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,i.alphaMode=typeof n.alphaMode=="number"?n.alphaMode:null,i.bitmap=null,i._load=null,n.autoLoad!==!1&&i.load(),i}return e.prototype.load=function(t){var n=this;return this._load?this._load:(t!==void 0&&(this.createBitmap=t),this._load=new Promise(function(i,a){var s=n.source;n.url=s.src;var o=function(){n.destroyed||(s.onload=null,s.onerror=null,n.resize(s.width,s.height),n._load=null,n.createBitmap?i(n.process()):i(n))};s.complete&&s.src?o():(s.onload=o,s.onerror=function(l){a(l),n.onError.emit(l)})}),this._load)},e.prototype.process=function(){var t=this,n=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);var i=globalThis.createImageBitmap,a=!n.crossOrigin||n.crossOrigin==="anonymous";return this._process=fetch(n.src,{mode:a?"cors":"no-cors"}).then(function(s){return s.blob()}).then(function(s){return i(s,0,0,n.width,n.height,{premultiplyAlpha:t.alphaMode===null||t.alphaMode===xa.UNPACK?"premultiply":"none"})}).then(function(s){return t.destroyed?Promise.reject():(t.bitmap=s,t.update(),t._process=null,Promise.resolve(t))}),this._process},e.prototype.upload=function(t,n,i){if(typeof this.alphaMode=="number"&&(n.alphaMode=this.alphaMode),!this.createBitmap)return r.prototype.upload.call(this,t,n,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(r.prototype.upload.call(this,t,n,i,this.bitmap),!this.preserveBitmap){var a=!0,s=n._glTextures;for(var o in s){var l=s[o];if(l!==i&&l.dirtyId!==n.dirtyId){a=!1;break}}a&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){this.source.onload=null,this.source.onerror=null,r.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e.test=function(t){return typeof t=="string"||t instanceof HTMLImageElement},e})(as),Rw=(function(r){Ir(e,r);function e(t,n){var i=this;return n=n||{},i=r.call(this,ht.ADAPTER.createCanvas())||this,i._width=0,i._height=0,i.svg=t,i.scale=n.scale||1,i._overrideWidth=n.width,i._overrideHeight=n.height,i._resolve=null,i._crossorigin=n.crossorigin,i._load=null,n.autoLoad!==!1&&i.load(),i}return e.prototype.load=function(){var t=this;return this._load?this._load:(this._load=new Promise(function(n){if(t._resolve=function(){t.resize(t.source.width,t.source.height),n(t)},e.SVG_XML.test(t.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");t.svg="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(t.svg)))}t._loadSvg()}),this._load)},e.prototype._loadSvg=function(){var t=this,n=new Image;as.crossOrigin(n,this.svg,this._crossorigin),n.src=this.svg,n.onerror=function(i){t._resolve&&(n.onerror=null,t.onError.emit(i))},n.onload=function(){if(t._resolve){var i=n.width,a=n.height;if(!i||!a)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");var s=i*t.scale,o=a*t.scale;(t._overrideWidth||t._overrideHeight)&&(s=t._overrideWidth||t._overrideHeight/a*i,o=t._overrideHeight||t._overrideWidth/i*a),s=Math.round(s),o=Math.round(o);var l=t.source;l.width=s,l.height=o,l._pixiId="canvas_"+rl(),l.getContext("2d").drawImage(n,0,0,i,a,0,0,s,o),t._resolve(),t._resolve=null}}},e.getSize=function(t){var n=e.SVG_SIZE.exec(t),i={};return n&&(i[n[1]]=Math.round(parseFloat(n[3])),i[n[5]]=Math.round(parseFloat(n[7]))),i},e.prototype.dispose=function(){r.prototype.dispose.call(this),this._resolve=null,this._crossorigin=null},e.test=function(t,n){return n==="svg"||typeof t=="string"&&t.startsWith("data:image/svg+xml")||typeof t=="string"&&e.SVG_XML.test(t)},e.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,e.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,e})(as),Ow=(function(r){Ir(e,r);function e(t,n){var i=this;if(n=n||{},!(t instanceof HTMLVideoElement)){var a=document.createElement("video");a.setAttribute("preload","auto"),a.setAttribute("webkit-playsinline",""),a.setAttribute("playsinline",""),typeof t=="string"&&(t=[t]);var s=t[0].src||t[0];as.crossOrigin(a,s,n.crossorigin);for(var o=0;o<t.length;++o){var l=document.createElement("source"),c=t[o],h=c.src,d=c.mime;h=h||t[o];var v=h.split("?").shift().toLowerCase(),g=v.slice(v.lastIndexOf(".")+1);d=d||e.MIME_TYPES[g]||"video/"+g,l.src=h,l.type=d,a.appendChild(l)}t=a}return i=r.call(this,t)||this,i.noSubImage=!0,i._autoUpdate=!0,i._isConnectedToTicker=!1,i._updateFPS=n.updateFPS||0,i._msToNextUpdate=0,i.autoPlay=n.autoPlay!==!1,i._load=null,i._resolve=null,i._onCanPlay=i._onCanPlay.bind(i),i._onError=i._onError.bind(i),n.autoLoad!==!1&&i.load(),i}return e.prototype.update=function(t){if(!this.destroyed){var n=Fn.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-n),(!this._updateFPS||this._msToNextUpdate<=0)&&(r.prototype.update.call(this),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}},e.prototype.load=function(){var t=this;if(this._load)return this._load;var n=this.source;return(n.readyState===n.HAVE_ENOUGH_DATA||n.readyState===n.HAVE_FUTURE_DATA)&&n.width&&n.height&&(n.complete=!0),n.addEventListener("play",this._onPlayStart.bind(this)),n.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(n.addEventListener("canplay",this._onCanPlay),n.addEventListener("canplaythrough",this._onCanPlay),n.addEventListener("error",this._onError,!0)),this._load=new Promise(function(i){t.valid?i(t):(t._resolve=i,n.load())}),this._load},e.prototype._onError=function(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t)},e.prototype._isSourcePlaying=function(){var t=this.source;return!t.paused&&!t.ended&&this._isSourceReady()},e.prototype._isSourceReady=function(){var t=this.source;return t.readyState>2},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(Fn.shared.add(this.update,this),this._isConnectedToTicker=!0)},e.prototype._onPlayStop=function(){this._isConnectedToTicker&&(Fn.shared.remove(this.update,this),this._isConnectedToTicker=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var n=this.valid;this.resize(t.videoWidth,t.videoHeight),!n&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isConnectedToTicker&&(Fn.shared.remove(this.update,this),this._isConnectedToTicker=!1);var t=this.source;t&&(t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),r.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(Fn.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(Fn.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(t){t!==this._updateFPS&&(this._updateFPS=t)},enumerable:!1,configurable:!0}),e.test=function(t,n){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||e.TYPES.indexOf(n)>-1},e.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],e.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},e})(as),Dw=(function(r){Ir(e,r);function e(t){return r.call(this,t)||this}return e.test=function(t){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&t instanceof ImageBitmap},e})(as);fd.push(Mg,Dw,Aw,Ow,Rw,wu,Mw,Cw);var JO={__proto__:null,Resource:gu,BaseImageResource:as,INSTALLED:fd,autoDetectResource:Cg,AbstractMultiResource:Ag,ArrayResource:Cw,BufferResource:wu,CanvasResource:Aw,CubeResource:Mw,ImageResource:Mg,SVGResource:Rw,VideoResource:Ow,ImageBitmapResource:Dw},D$=(function(r){Ir(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.upload=function(t,n,i){var a=t.gl;a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.alphaMode===xa.UNPACK);var s=n.realWidth,o=n.realHeight;return i.width===s&&i.height===o?a.texSubImage2D(n.target,0,0,0,s,o,n.format,i.type,this.data):(i.width=s,i.height=o,a.texImage2D(n.target,0,i.internalFormat,s,o,0,n.format,i.type,this.data)),!0},e})(wu),zp=(function(){function r(e,t){this.width=Math.round(e||100),this.height=Math.round(t||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Bn("disposeFramebuffer"),this.multisample=Fr.NONE}return Object.defineProperty(r.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),r.prototype.addColorTexture=function(e,t){return e===void 0&&(e=0),this.colorTextures[e]=t||new Wt(null,{scaleMode:Da.NEAREST,resolution:1,mipmap:ba.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},r.prototype.addDepthTexture=function(e){return this.depthTexture=e||new Wt(new D$(null,{width:this.width,height:this.height}),{scaleMode:Da.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:ba.OFF,format:at.DEPTH_COMPONENT,type:wt.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},r.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},r.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},r.prototype.resize=function(e,t){if(e=Math.round(e),t=Math.round(t),!(e===this.width&&t===this.height)){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(var n=0;n<this.colorTextures.length;n++){var i=this.colorTextures[n],a=i.resolution;i.setSize(e/a,t/a)}if(this.depthTexture){var a=this.depthTexture.resolution;this.depthTexture.setSize(e/a,t/a)}}},r.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},r.prototype.destroyDepthTexture=function(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)},r})(),Pw=(function(r){Ir(e,r);function e(t){t===void 0&&(t={});var n=this;if(typeof t=="number"){var i=arguments[0],a=arguments[1],s=arguments[2],o=arguments[3];t={width:i,height:a,scaleMode:s,resolution:o}}return t.width=t.width||100,t.height=t.height||100,t.multisample=t.multisample!==void 0?t.multisample:Fr.NONE,n=r.call(this,null,t)||this,n.mipmap=ba.OFF,n.valid=!0,n.clearColor=[0,0,0,0],n.framebuffer=new zp(n.realWidth,n.realHeight).addColorTexture(0,n),n.framebuffer.multisample=t.multisample,n.maskStack=[],n.filterStack=[{}],n}return e.prototype.resize=function(t,n){this.framebuffer.resize(t*this.resolution,n*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)},e.prototype.dispose=function(){this.framebuffer.dispose(),r.prototype.dispose.call(this)},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.framebuffer.destroyDepthTexture(),this.framebuffer=null},e})(Wt),Iw=(function(){function r(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}return r.prototype.set=function(e,t,n){var i=t.width,a=t.height;if(n){var s=e.width/2/i,o=e.height/2/a,l=e.x/i+s,c=e.y/a+o;n=Hr.add(n,Hr.NW),this.x0=l+s*Hr.uX(n),this.y0=c+o*Hr.uY(n),n=Hr.add(n,2),this.x1=l+s*Hr.uX(n),this.y1=c+o*Hr.uY(n),n=Hr.add(n,2),this.x2=l+s*Hr.uX(n),this.y2=c+o*Hr.uY(n),n=Hr.add(n,2),this.x3=l+s*Hr.uX(n),this.y3=c+o*Hr.uY(n)}else this.x0=e.x/i,this.y0=e.y/a,this.x1=(e.x+e.width)/i,this.y1=e.y/a,this.x2=(e.x+e.width)/i,this.y2=(e.y+e.height)/a,this.x3=e.x/i,this.y3=(e.y+e.height)/a;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3},r.prototype.toString=function(){return"[@pixi/core:TextureUvs "+("x0="+this.x0+" y0="+this.y0+" ")+("x1="+this.x1+" y1="+this.y1+" x2="+this.x2+" ")+("y2="+this.y2+" x3="+this.x3+" y3="+this.y3)+"]"},r})(),VC=new Iw;function _v(r){r.destroy=function(){},r.on=function(){},r.once=function(){},r.emit=function(){}}var Rt=(function(r){Ir(e,r);function e(t,n,i,a,s,o){var l=r.call(this)||this;if(l.noFrame=!1,n||(l.noFrame=!0,n=new $t(0,0,1,1)),t instanceof e&&(t=t.baseTexture),l.baseTexture=t,l._frame=n,l.trim=a,l.valid=!1,l._uvs=VC,l.uvMatrix=null,l.orig=i||n,l._rotate=Number(s||0),s===!0)l._rotate=2;else if(l._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");return l.defaultAnchor=o?new Ar(o.x,o.y):new Ar(0,0),l._updateID=0,l.textureCacheIds=[],t.valid?l.noFrame?t.valid&&l.onBaseTextureUpdated(t):l.frame=n:t.once("loaded",l.onBaseTextureUpdated,l),l.noFrame&&t.on("update",l.onBaseTextureUpdated,l),l}return e.prototype.update=function(){this.baseTexture.resource&&this.baseTexture.resource.update()},e.prototype.onBaseTextureUpdated=function(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)},e.prototype.destroy=function(t){if(this.baseTexture){if(t){var n=this.baseTexture.resource;n&&n.url&&Ti[n.url]&&e.removeFromCache(n.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,e.removeFromCache(this),this.textureCacheIds=null},e.prototype.clone=function(){var t=this._frame.clone(),n=this._frame===this.orig?t:this.orig.clone(),i=new e(this.baseTexture,!this.noFrame&&t,n,this.trim&&this.trim.clone(),this.rotate,this.defaultAnchor);return this.noFrame&&(i._frame=t),i},e.prototype.updateUvs=function(){this._uvs===VC&&(this._uvs=new Iw),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++},e.from=function(t,n,i){n===void 0&&(n={}),i===void 0&&(i=ht.STRICT_TEXTURE_CACHE);var a=typeof t=="string",s=null;if(a)s=t;else if(t instanceof Wt){if(!t.cacheId){var o=n&&n.pixiIdPrefix||"pixiid";t.cacheId=o+"-"+rl(),Wt.addToCache(t,t.cacheId)}s=t.cacheId}else{if(!t._pixiId){var o=n&&n.pixiIdPrefix||"pixiid";t._pixiId=o+"_"+rl()}s=t._pixiId}var l=Ti[s];if(a&&i&&!l)throw new Error('The cacheId "'+s+'" does not exist in TextureCache.');return!l&&!(t instanceof Wt)?(n.resolution||(n.resolution=ud(t)),l=new e(new Wt(t,n)),l.baseTexture.cacheId=s,Wt.addToCache(l.baseTexture,s),e.addToCache(l,s)):!l&&t instanceof Wt&&(l=new e(t),e.addToCache(l,s)),l},e.fromURL=function(t,n){var i=Object.assign({autoLoad:!1},n==null?void 0:n.resourceOptions),a=e.from(t,Object.assign({resourceOptions:i},n),!1),s=a.baseTexture.resource;return a.baseTexture.valid?Promise.resolve(a):s.load().then(function(){return Promise.resolve(a)})},e.fromBuffer=function(t,n,i,a){return new e(Wt.fromBuffer(t,n,i,a))},e.fromLoader=function(t,n,i,a){var s=new Wt(t,Object.assign({scaleMode:ht.SCALE_MODE,resolution:ud(n)},a)),o=s.resource;o instanceof Mg&&(o.url=n);var l=new e(s);return i||(i=n),Wt.addToCache(l.baseTexture,i),e.addToCache(l,i),i!==n&&(Wt.addToCache(l.baseTexture,n),e.addToCache(l,n)),l.baseTexture.valid?Promise.resolve(l):new Promise(function(c){l.baseTexture.once("loaded",function(){return c(l)})})},e.addToCache=function(t,n){n&&(t.textureCacheIds.indexOf(n)===-1&&t.textureCacheIds.push(n),Ti[n]&&console.warn("Texture added to the cache with an id ["+n+"] that already had an entry"),Ti[n]=t)},e.removeFromCache=function(t){if(typeof t=="string"){var n=Ti[t];if(n){var i=n.textureCacheIds.indexOf(t);return i>-1&&n.textureCacheIds.splice(i,1),delete Ti[t],n}}else if(t&&t.textureCacheIds){for(var a=0;a<t.textureCacheIds.length;++a)Ti[t.textureCacheIds[a]]===t&&delete Ti[t.textureCacheIds[a]];return t.textureCacheIds.length=0,t}return null},Object.defineProperty(e.prototype,"resolution",{get:function(){return this.baseTexture.resolution},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frame",{get:function(){return this._frame},set:function(t){this._frame=t,this.noFrame=!1;var n=t.x,i=t.y,a=t.width,s=t.height,o=n+a>this.baseTexture.width,l=i+s>this.baseTexture.height;if(o||l){var c=o&&l?"and":"or",h="X: "+n+" + "+a+" = "+(n+a)+" > "+this.baseTexture.width,d="Y: "+i+" + "+s+" = "+(i+s)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+(h+" "+c+" "+d))}this.valid=a&&s&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=t),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),e.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(e,"EMPTY",{get:function(){return e._EMPTY||(e._EMPTY=new e(new Wt),_v(e._EMPTY),_v(e._EMPTY.baseTexture)),e._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"WHITE",{get:function(){if(!e._WHITE){var t=ht.ADAPTER.createCanvas(16,16),n=t.getContext("2d");t.width=16,t.height=16,n.fillStyle="white",n.fillRect(0,0,16,16),e._WHITE=new e(Wt.from(t)),_v(e._WHITE),_v(e._WHITE.baseTexture)}return e._WHITE},enumerable:!1,configurable:!0}),e})(Ks),nl=(function(r){Ir(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.valid=!0,i.filterFrame=null,i.filterPoolKey=null,i.updateUvs(),i}return Object.defineProperty(e.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(t){this.framebuffer.multisample=t},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,n,i){i===void 0&&(i=!0);var a=this.baseTexture.resolution,s=Math.round(t*a)/a,o=Math.round(n*a)/a;this.valid=s>0&&o>0,this._frame.width=this.orig.width=s,this._frame.height=this.orig.height=o,i&&this.baseTexture.resize(s,o),this.updateUvs()},e.prototype.setResolution=function(t){var n=this.baseTexture;n.resolution!==t&&(n.setResolution(t),this.resize(n.width,n.height,!1))},e.create=function(t){for(var n=arguments,i=[],a=1;a<arguments.length;a++)i[a-1]=n[a];return typeof t=="number"&&(fi("6.0.0","Arguments (width, height, scaleMode, resolution) have been deprecated."),t={width:t,height:i[0],scaleMode:i[1],resolution:i[2]}),new e(new Pw(t))},e})(Rt),eD=(function(){function r(e){this.texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}return r.prototype.createTexture=function(e,t,n){n===void 0&&(n=Fr.NONE);var i=new Pw(Object.assign({width:e,height:t,resolution:1,multisample:n},this.textureOptions));return new nl(i)},r.prototype.getOptimalTexture=function(e,t,n,i){n===void 0&&(n=1),i===void 0&&(i=Fr.NONE);var a;e=Math.ceil(e*n-1e-6),t=Math.ceil(t*n-1e-6),!this.enableFullScreen||e!==this._pixelsWidth||t!==this._pixelsHeight?(e=ld(e),t=ld(t),a=((e&65535)<<16|t&65535)>>>0,i>1&&(a+=i*4294967296)):a=i>1?-i:-1,this.texturePool[a]||(this.texturePool[a]=[]);var s=this.texturePool[a].pop();return s||(s=this.createTexture(e,t,i)),s.filterPoolKey=a,s.setResolution(n),s},r.prototype.getFilterTexture=function(e,t,n){var i=this.getOptimalTexture(e.width,e.height,t||e.resolution,n||Fr.NONE);return i.filterFrame=e.filterFrame,i},r.prototype.returnTexture=function(e){var t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)},r.prototype.returnFilterTexture=function(e){this.returnTexture(e)},r.prototype.clear=function(e){if(e=e!==!1,e)for(var t in this.texturePool){var n=this.texturePool[t];if(n)for(var i=0;i<n.length;i++)n[i].destroy(!0)}this.texturePool={}},r.prototype.setScreenSize=function(e){if(!(e.width===this._pixelsWidth&&e.height===this._pixelsHeight)){this.enableFullScreen=e.width>0&&e.height>0;for(var t in this.texturePool)if(Number(t)<0){var n=this.texturePool[t];if(n)for(var i=0;i<n.length;i++)n[i].destroy(!0);this.texturePool[t]=[]}this._pixelsWidth=e.width,this._pixelsHeight=e.height}},r.SCREEN_KEY=-1,r})(),P4=(function(){function r(e,t,n,i,a,s,o){t===void 0&&(t=0),n===void 0&&(n=!1),i===void 0&&(i=wt.FLOAT),this.buffer=e,this.size=t,this.normalized=n,this.type=i,this.stride=a,this.start=s,this.instance=o}return r.prototype.destroy=function(){this.buffer=null},r.from=function(e,t,n,i,a){return new r(e,t,n,i,a)},r})(),P$=0,wn=(function(){function r(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=!1),this.data=e||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=n,this.static=t,this.id=P$++,this.disposeRunner=new Bn("disposeBuffer")}return r.prototype.update=function(e){e instanceof Array&&(e=new Float32Array(e)),this.data=e||this.data,this._updateID++},r.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},r.prototype.destroy=function(){this.dispose(),this.data=null},Object.defineProperty(r.prototype,"index",{get:function(){return this.type===Na.ELEMENT_ARRAY_BUFFER},set:function(e){this.type=e?Na.ELEMENT_ARRAY_BUFFER:Na.ARRAY_BUFFER},enumerable:!1,configurable:!0}),r.from=function(e){return e instanceof Array&&(e=new Float32Array(e)),new r(e)},r})(),I$={Float32Array,Uint32Array,Int32Array,Uint8Array};function N$(r,e){for(var t=0,n=0,i={},a=0;a<r.length;a++)n+=e[a],t+=r[a].length;for(var s=new ArrayBuffer(t*4),o=null,l=0,a=0;a<r.length;a++){var c=e[a],h=r[a],d=Eg(h);i[d]||(i[d]=new I$[d](s)),o=i[d];for(var v=0;v<h.length;v++){var g=(v/c|0)*n+l,m=v%c;o[g+m]=h[v]}l+=c}return new Float32Array(s)}var qC={5126:4,5123:2,5121:1},L$=0,k$={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array},ah=(function(){function r(e,t){e===void 0&&(e=[]),t===void 0&&(t={}),this.buffers=e,this.indexBuffer=null,this.attributes=t,this.glVertexArrayObjects={},this.id=L$++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new Bn("disposeGeometry"),this.refCount=0}return r.prototype.addAttribute=function(e,t,n,i,a,s,o,l){if(n===void 0&&(n=0),i===void 0&&(i=!1),l===void 0&&(l=!1),!t)throw new Error("You must pass a buffer when creating an attribute");t instanceof wn||(t instanceof Array&&(t=new Float32Array(t)),t=new wn(t));var c=e.split("|");if(c.length>1){for(var h=0;h<c.length;h++)this.addAttribute(c[h],t,n,i,a);return this}var d=this.buffers.indexOf(t);return d===-1&&(this.buffers.push(t),d=this.buffers.length-1),this.attributes[e]=new P4(d,n,i,a,s,o,l),this.instanced=this.instanced||l,this},r.prototype.getAttribute=function(e){return this.attributes[e]},r.prototype.getBuffer=function(e){return this.buffers[this.getAttribute(e).buffer]},r.prototype.addIndex=function(e){return e instanceof wn||(e instanceof Array&&(e=new Uint16Array(e)),e=new wn(e)),e.type=Na.ELEMENT_ARRAY_BUFFER,this.indexBuffer=e,this.buffers.indexOf(e)===-1&&this.buffers.push(e),this},r.prototype.getIndex=function(){return this.indexBuffer},r.prototype.interleave=function(){if(this.buffers.length===1||this.buffers.length===2&&this.indexBuffer)return this;var e=[],t=[],n=new wn,i;for(i in this.attributes){var a=this.attributes[i],s=this.buffers[a.buffer];e.push(s.data),t.push(a.size*qC[a.type]/4),a.buffer=0}for(n.data=N$(e,t),i=0;i<this.buffers.length;i++)this.buffers[i]!==this.indexBuffer&&this.buffers[i].destroy();return this.buffers=[n],this.indexBuffer&&this.buffers.push(this.indexBuffer),this},r.prototype.getSize=function(){for(var e in this.attributes){var t=this.attributes[e],n=this.buffers[t.buffer];return n.data.length/(t.stride/4||t.size)}return 0},r.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},r.prototype.destroy=function(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null},r.prototype.clone=function(){for(var e=new r,t=0;t<this.buffers.length;t++)e.buffers[t]=new wn(this.buffers[t].data.slice(0));for(var t in this.attributes){var n=this.attributes[t];e.attributes[t]=new P4(n.buffer,n.size,n.normalized,n.type,n.stride,n.start,n.instance)}return this.indexBuffer&&(e.indexBuffer=e.buffers[this.buffers.indexOf(this.indexBuffer)],e.indexBuffer.type=Na.ELEMENT_ARRAY_BUFFER),e},r.merge=function(e){for(var t=new r,n=[],i=[],a=[],s,o=0;o<e.length;o++){s=e[o];for(var l=0;l<s.buffers.length;l++)i[l]=i[l]||0,i[l]+=s.buffers[l].data.length,a[l]=0}for(var o=0;o<s.buffers.length;o++)n[o]=new k$[Eg(s.buffers[o].data)](i[o]),t.buffers[o]=new wn(n[o]);for(var o=0;o<e.length;o++){s=e[o];for(var l=0;l<s.buffers.length;l++)n[l].set(s.buffers[l].data,a[l]),a[l]+=s.buffers[l].data.length}if(t.attributes=s.attributes,s.indexBuffer){t.indexBuffer=t.buffers[s.buffers.indexOf(s.indexBuffer)],t.indexBuffer.type=Na.ELEMENT_ARRAY_BUFFER;for(var c=0,h=0,d=0,v=0,o=0;o<s.buffers.length;o++)if(s.buffers[o]!==s.indexBuffer){v=o;break}for(var o in s.attributes){var g=s.attributes[o];(g.buffer|0)===v&&(h+=g.size*qC[g.type]/4)}for(var o=0;o<e.length;o++){for(var m=e[o].indexBuffer.data,l=0;l<m.length;l++)t.indexBuffer.data[l+d]+=c;c+=e[o].buffers[v].data.length/h,d+=m.length}}return t},r})(),tD=(function(r){Ir(e,r);function e(){var t=r.call(this)||this;return t.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2]),t}return e})(ah),Nw=(function(r){Ir(e,r);function e(){var t=r.call(this)||this;return t.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),t.uvs=new Float32Array([0,0,1,0,1,1,0,1]),t.vertexBuffer=new wn(t.vertices),t.uvBuffer=new wn(t.uvs),t.addAttribute("aVertexPosition",t.vertexBuffer).addAttribute("aTextureCoord",t.uvBuffer).addIndex([0,1,2,0,2,3]),t}return e.prototype.map=function(t,n){var i=0,a=0;return this.uvs[0]=i,this.uvs[1]=a,this.uvs[2]=i+n.width/t.width,this.uvs[3]=a,this.uvs[4]=i+n.width/t.width,this.uvs[5]=a+n.height/t.height,this.uvs[6]=i,this.uvs[7]=a+n.height/t.height,i=n.x,a=n.y,this.vertices[0]=i,this.vertices[1]=a,this.vertices[2]=i+n.width,this.vertices[3]=a,this.vertices[4]=i+n.width,this.vertices[5]=a+n.height,this.vertices[6]=i,this.vertices[7]=a+n.height,this.invalidate(),this},e.prototype.invalidate=function(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this},e})(ah),B$=0,Yo=(function(){function r(e,t,n){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=B$++,this.static=!!t,this.ubo=!!n,e instanceof wn?(this.buffer=e,this.buffer.type=Na.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=e,this.ubo&&(this.buffer=new wn(new Float32Array(1)),this.buffer.type=Na.UNIFORM_BUFFER,this.autoManage=!0))}return r.prototype.update=function(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()},r.prototype.add=function(e,t,n){if(!this.ubo)this.uniforms[e]=new r(t,n);else throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them")},r.from=function(e,t,n){return new r(e,t,n)},r.uboFrom=function(e,t){return new r(e,t??!0,!0)},r})(),rD=(function(){function r(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=Fr.NONE,this.sourceFrame=new $t,this.destinationFrame=new $t,this.bindingSourceFrame=new $t,this.bindingDestinationFrame=new $t,this.filters=[],this.transform=null}return r.prototype.clear=function(){this.target=null,this.filters=null,this.renderTexture=null},r})(),wv=[new Ar,new Ar,new Ar,new Ar],qb=new qr,Lw=(function(){function r(e){this.renderer=e,this.defaultFilterStack=[{}],this.texturePool=new eD,this.texturePool.setScreenSize(e.view),this.statePool=[],this.quad=new tD,this.quadUv=new Nw,this.tempRect=new $t,this.activeState={},this.globalUniforms=new Yo({outputFrame:new $t,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}return r.prototype.push=function(e,t){for(var n,i,a=this.renderer,s=this.defaultFilterStack,o=this.statePool.pop()||new rD,l=this.renderer.renderTexture,c=t[0].resolution,h=t[0].multisample,d=t[0].padding,v=t[0].autoFit,g=(n=t[0].legacy)!==null&&n!==void 0?n:!0,m=1;m<t.length;m++){var x=t[m];c=Math.min(c,x.resolution),h=Math.min(h,x.multisample),d=this.useMaxPadding?Math.max(d,x.padding):d+x.padding,v=v&&x.autoFit,g=g||((i=x.legacy)!==null&&i!==void 0?i:!0)}s.length===1&&(this.defaultFilterStack[0].renderTexture=l.current),s.push(o),o.resolution=c,o.multisample=h,o.legacy=g,o.target=e,o.sourceFrame.copyFrom(e.filterArea||e.getBounds(!0)),o.sourceFrame.pad(d);var y=this.tempRect.copyFrom(l.sourceFrame);a.projection.transform&&this.transformAABB(qb.copyFrom(a.projection.transform).invert(),y),v?(o.sourceFrame.fit(y),(o.sourceFrame.width<=0||o.sourceFrame.height<=0)&&(o.sourceFrame.width=0,o.sourceFrame.height=0)):o.sourceFrame.intersects(y)||(o.sourceFrame.width=0,o.sourceFrame.height=0),this.roundFrame(o.sourceFrame,l.current?l.current.resolution:a.resolution,l.sourceFrame,l.destinationFrame,a.projection.transform),o.renderTexture=this.getOptimalFilterTexture(o.sourceFrame.width,o.sourceFrame.height,c,h),o.filters=t,o.destinationFrame.width=o.renderTexture.width,o.destinationFrame.height=o.renderTexture.height;var _=this.tempRect;_.x=0,_.y=0,_.width=o.sourceFrame.width,_.height=o.sourceFrame.height,o.renderTexture.filterFrame=o.sourceFrame,o.bindingSourceFrame.copyFrom(l.sourceFrame),o.bindingDestinationFrame.copyFrom(l.destinationFrame),o.transform=a.projection.transform,a.projection.transform=null,l.bind(o.renderTexture,o.sourceFrame,_),a.framebuffer.clear(0,0,0,0)},r.prototype.pop=function(){var e=this.defaultFilterStack,t=e.pop(),n=t.filters;this.activeState=t;var i=this.globalUniforms.uniforms;i.outputFrame=t.sourceFrame,i.resolution=t.resolution;var a=i.inputSize,s=i.inputPixel,o=i.inputClamp;if(a[0]=t.destinationFrame.width,a[1]=t.destinationFrame.height,a[2]=1/a[0],a[3]=1/a[1],s[0]=Math.round(a[0]*t.resolution),s[1]=Math.round(a[1]*t.resolution),s[2]=1/s[0],s[3]=1/s[1],o[0]=.5*s[2],o[1]=.5*s[3],o[2]=t.sourceFrame.width*a[2]-.5*s[2],o[3]=t.sourceFrame.height*a[3]-.5*s[3],t.legacy){var l=i.filterArea;l[0]=t.destinationFrame.width,l[1]=t.destinationFrame.height,l[2]=t.sourceFrame.x,l[3]=t.sourceFrame.y,i.filterClamp=i.inputClamp}this.globalUniforms.update();var c=e[e.length-1];if(this.renderer.framebuffer.blit(),n.length===1)n[0].apply(this,t.renderTexture,c.renderTexture,ha.BLEND,t),this.returnFilterTexture(t.renderTexture);else{var h=t.renderTexture,d=this.getOptimalFilterTexture(h.width,h.height,t.resolution);d.filterFrame=h.filterFrame;var v=0;for(v=0;v<n.length-1;++v){v===1&&t.multisample>1&&(d=this.getOptimalFilterTexture(h.width,h.height,t.resolution),d.filterFrame=h.filterFrame),n[v].apply(this,h,d,ha.CLEAR,t);var g=h;h=d,d=g}n[v].apply(this,h,c.renderTexture,ha.BLEND,t),v>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(h),this.returnFilterTexture(d)}t.clear(),this.statePool.push(t)},r.prototype.bindAndClear=function(e,t){t===void 0&&(t=ha.CLEAR);var n=this.renderer,i=n.renderTexture,a=n.state;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e&&e.filterFrame){var s=this.tempRect;s.x=0,s.y=0,s.width=e.filterFrame.width,s.height=e.filterFrame.height,i.bind(e,e.filterFrame,s)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?i.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var o=a.stateId&1||this.forceClear;(t===ha.CLEAR||t===ha.BLIT&&o)&&this.renderer.framebuffer.clear(0,0,0,0)},r.prototype.applyFilter=function(e,t,n,i){var a=this.renderer;a.state.set(e.state),this.bindAndClear(n,i),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,a.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(t._frame,t.filterFrame),a.geometry.bind(this.quadUv),a.geometry.draw(pa.TRIANGLES)):(a.geometry.bind(this.quad),a.geometry.draw(pa.TRIANGLE_STRIP))},r.prototype.calculateSpriteMatrix=function(e,t){var n=this.activeState,i=n.sourceFrame,a=n.destinationFrame,s=t._texture.orig,o=e.set(a.width,0,0,a.height,i.x,i.y),l=t.worldTransform.copyTo(qr.TEMP_MATRIX);return l.invert(),o.prepend(l),o.scale(1/s.width,1/s.height),o.translate(t.anchor.x,t.anchor.y),o},r.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},r.prototype.getOptimalFilterTexture=function(e,t,n,i){return n===void 0&&(n=1),i===void 0&&(i=Fr.NONE),this.texturePool.getOptimalTexture(e,t,n,i)},r.prototype.getFilterTexture=function(e,t,n){if(typeof e=="number"){var i=e;e=t,t=i}e=e||this.activeState.renderTexture;var a=this.texturePool.getOptimalTexture(e.width,e.height,t||e.resolution,n||Fr.NONE);return a.filterFrame=e.filterFrame,a},r.prototype.returnFilterTexture=function(e){this.texturePool.returnTexture(e)},r.prototype.emptyPool=function(){this.texturePool.clear(!0)},r.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},r.prototype.transformAABB=function(e,t){var n=wv[0],i=wv[1],a=wv[2],s=wv[3];n.set(t.left,t.top),i.set(t.left,t.bottom),a.set(t.right,t.top),s.set(t.right,t.bottom),e.apply(n,n),e.apply(i,i),e.apply(a,a),e.apply(s,s);var o=Math.min(n.x,i.x,a.x,s.x),l=Math.min(n.y,i.y,a.y,s.y),c=Math.max(n.x,i.x,a.x,s.x),h=Math.max(n.y,i.y,a.y,s.y);t.x=o,t.y=l,t.width=c-o,t.height=h-l},r.prototype.roundFrame=function(e,t,n,i,a){if(!(e.width<=0||e.height<=0||n.width<=0||n.height<=0)){if(a){var s=a.a,o=a.b,l=a.c,c=a.d;if((Math.abs(o)>1e-4||Math.abs(l)>1e-4)&&(Math.abs(s)>1e-4||Math.abs(c)>1e-4))return}a=a?qb.copyFrom(a):qb.identity(),a.translate(-n.x,-n.y).scale(i.width/n.width,i.height/n.height).translate(i.x,i.y),this.transformAABB(a,e),e.ceil(t),this.transformAABB(a.invert(),e)}},r})(),kd=(function(){function r(e){this.renderer=e}return r.prototype.flush=function(){},r.prototype.destroy=function(){this.renderer=null},r.prototype.start=function(){},r.prototype.stop=function(){this.flush()},r.prototype.render=function(e){},r})(),kw=(function(){function r(e){this.renderer=e,this.emptyRenderer=new kd(e),this.currentRenderer=this.emptyRenderer}return r.prototype.setObjectRenderer=function(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())},r.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},r.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},r.prototype.copyBoundTextures=function(e,t){for(var n=this.renderer.texture.boundTextures,i=t-1;i>=0;--i)e[i]=n[i]||null,e[i]&&(e[i]._batchLocation=i)},r.prototype.boundArray=function(e,t,n,i){for(var a=e.elements,s=e.ids,o=e.count,l=0,c=0;c<o;c++){var h=a[c],d=h._batchLocation;if(d>=0&&d<i&&t[d]===h){s[c]=d;continue}for(;l<i;){var v=t[l];if(v&&v._batchEnabled===n&&v._batchLocation===l){l++;continue}s[c]=l,h._batchLocation=l,t[l]=h;break}}},r.prototype.destroy=function(){this.renderer=null},r})(),XC=0,Bw=(function(){function r(e){this.renderer=e,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this),e.view.addEventListener("webglcontextlost",this.handleContextLost,!1),e.view.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}return Object.defineProperty(r.prototype,"isLost",{get:function(){return!this.gl||this.gl.isContextLost()},enumerable:!1,configurable:!0}),r.prototype.contextChange=function(e){this.gl=e,this.renderer.gl=e,this.renderer.CONTEXT_UID=XC++},r.prototype.initFromContext=function(e){this.gl=e,this.validateContext(e),this.renderer.gl=e,this.renderer.CONTEXT_UID=XC++,this.renderer.runners.contextChange.emit(e)},r.prototype.initFromOptions=function(e){var t=this.createContext(this.renderer.view,e);this.initFromContext(t)},r.prototype.createContext=function(e,t){var n;if(ht.PREFER_ENV>=ns.WEBGL2&&(n=e.getContext("webgl2",t)),n)this.webGLVersion=2;else if(this.webGLVersion=1,n=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),!n)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=n,this.getExtensions(),this.gl},r.prototype.getExtensions=function(){var e=this.gl,t={loseContext:e.getExtension("WEBGL_lose_context"),anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};this.webGLVersion===1?Object.assign(this.extensions,t,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})},r.prototype.handleContextLost=function(e){var t=this;e.preventDefault(),setTimeout(function(){t.gl.isContextLost()&&t.extensions.loseContext&&t.extensions.loseContext.restoreContext()},0)},r.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},r.prototype.destroy=function(){var e=this.renderer.view;this.renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},r.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},r.prototype.validateContext=function(e){var t=e.getContextAttributes(),n="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;n&&(this.webGLVersion=2),t&&!t.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var i=n||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=i,i||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},r})(),nD=(function(){function r(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=Fr.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}return r})(),F$=new $t,Fw=(function(){function r(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new zp(10,10),this.msaaSamples=null}return r.prototype.contextChange=function(){this.disposeAll(!0);var e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new $t,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){var t=this.renderer.context.extensions.drawBuffers,n=this.renderer.context.extensions.depthTexture;ht.PREFER_ENV===ns.WEBGL_LEGACY&&(t=null,n=null),t?e.drawBuffers=function(i){return t.drawBuffersWEBGL(i)}:(this.hasMRT=!1,e.drawBuffers=function(){}),n||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)},r.prototype.bind=function(e,t,n){n===void 0&&(n=0);var i=this.gl;if(e){var a=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,i.bindFramebuffer(i.FRAMEBUFFER,a.framebuffer)),a.mipLevel!==n&&(e.dirtyId++,e.dirtyFormat++,a.mipLevel=n),a.dirtyId!==e.dirtyId&&(a.dirtyId=e.dirtyId,a.dirtyFormat!==e.dirtyFormat?(a.dirtyFormat=e.dirtyFormat,a.dirtySize=e.dirtySize,this.updateFramebuffer(e,n)):a.dirtySize!==e.dirtySize&&(a.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(var s=0;s<e.colorTextures.length;s++){var o=e.colorTextures[s];this.renderer.texture.unbind(o.parentTextureArray||o)}if(e.depthTexture&&this.renderer.texture.unbind(e.depthTexture),t){var l=t.width>>n,c=t.height>>n,h=l/t.width;this.setViewport(t.x*h,t.y*h,l,c)}else{var l=e.width>>n,c=e.height>>n;this.setViewport(0,0,l,c)}}else this.current&&(this.current=null,i.bindFramebuffer(i.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},r.prototype.setViewport=function(e,t,n,i){var a=this.viewport;e=Math.round(e),t=Math.round(t),n=Math.round(n),i=Math.round(i),(a.width!==n||a.height!==i||a.x!==e||a.y!==t)&&(a.x=e,a.y=t,a.width=n,a.height=i,this.gl.viewport(e,t,n,i))},Object.defineProperty(r.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),r.prototype.clear=function(e,t,n,i,a){a===void 0&&(a=ad.COLOR|ad.DEPTH);var s=this.gl;s.clearColor(e,t,n,i),s.clear(a)},r.prototype.initFramebuffer=function(e){var t=this.gl,n=new nD(t.createFramebuffer());return n.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=n,this.managedFramebuffers.push(e),e.disposeRunner.add(this),n},r.prototype.resizeFramebuffer=function(e){var t=this.gl,n=e.glFramebuffers[this.CONTEXT_UID];n.msaaBuffer&&(t.bindRenderbuffer(t.RENDERBUFFER,n.msaaBuffer),t.renderbufferStorageMultisample(t.RENDERBUFFER,n.multisample,t.RGBA8,e.width,e.height)),n.stencil&&(t.bindRenderbuffer(t.RENDERBUFFER,n.stencil),n.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,n.multisample,t.DEPTH24_STENCIL8,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e.width,e.height));var i=e.colorTextures,a=i.length;t.drawBuffers||(a=Math.min(a,1));for(var s=0;s<a;s++){var o=i[s],l=o.parentTextureArray||o;this.renderer.texture.bind(l,0)}e.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(e.depthTexture,0)},r.prototype.updateFramebuffer=function(e,t){var n=this.gl,i=e.glFramebuffers[this.CONTEXT_UID],a=e.colorTextures,s=a.length;n.drawBuffers||(s=Math.min(s,1)),i.multisample>1&&this.canMultisampleFramebuffer(e)?(i.msaaBuffer=i.msaaBuffer||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,i.msaaBuffer),n.renderbufferStorageMultisample(n.RENDERBUFFER,i.multisample,n.RGBA8,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,i.msaaBuffer)):i.msaaBuffer&&(n.deleteRenderbuffer(i.msaaBuffer),i.msaaBuffer=null,i.blitFramebuffer&&(i.blitFramebuffer.dispose(),i.blitFramebuffer=null));for(var o=[],l=0;l<s;l++){var c=a[l],h=c.parentTextureArray||c;this.renderer.texture.bind(h,0),!(l===0&&i.msaaBuffer)&&(n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+l,c.target,h._glTextures[this.CONTEXT_UID].texture,t),o.push(n.COLOR_ATTACHMENT0+l))}if(o.length>1&&n.drawBuffers(o),e.depthTexture){var d=this.writeDepthTexture;if(d){var v=e.depthTexture;this.renderer.texture.bind(v,0),n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,v._glTextures[this.CONTEXT_UID].texture,t)}}(e.stencil||e.depth)&&!(e.depthTexture&&this.writeDepthTexture)?(i.stencil=i.stencil||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,i.stencil),i.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,i.multisample,n.DEPTH24_STENCIL8,e.width,e.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,i.stencil)):i.stencil&&(n.deleteRenderbuffer(i.stencil),i.stencil=null)},r.prototype.canMultisampleFramebuffer=function(e){return this.renderer.context.webGLVersion!==1&&e.colorTextures.length<=1&&!e.depthTexture},r.prototype.detectSamples=function(e){var t=this.msaaSamples,n=Fr.NONE;if(e<=1||t===null)return n;for(var i=0;i<t.length;i++)if(t[i]<=e){n=t[i];break}return n===1&&(n=Fr.NONE),n},r.prototype.blit=function(e,t,n){var i=this,a=i.current,s=i.renderer,o=i.gl,l=i.CONTEXT_UID;if(s.context.webGLVersion===2&&a){var c=a.glFramebuffers[l];if(c){if(!e){if(!c.msaaBuffer)return;var h=a.colorTextures[0];if(!h)return;c.blitFramebuffer||(c.blitFramebuffer=new zp(a.width,a.height),c.blitFramebuffer.addColorTexture(0,h)),e=c.blitFramebuffer,e.colorTextures[0]!==h&&(e.colorTextures[0]=h,e.dirtyId++,e.dirtyFormat++),(e.width!==a.width||e.height!==a.height)&&(e.width=a.width,e.height=a.height,e.dirtyId++,e.dirtySize++)}t||(t=F$,t.width=a.width,t.height=a.height),n||(n=t);var d=t.width===n.width&&t.height===n.height;this.bind(e),o.bindFramebuffer(o.READ_FRAMEBUFFER,c.framebuffer),o.blitFramebuffer(t.left,t.top,t.right,t.bottom,n.left,n.top,n.right,n.bottom,o.COLOR_BUFFER_BIT,d?o.NEAREST:o.LINEAR)}}},r.prototype.disposeFramebuffer=function(e,t){var n=e.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(n){delete e.glFramebuffers[this.CONTEXT_UID];var a=this.managedFramebuffers.indexOf(e);a>=0&&this.managedFramebuffers.splice(a,1),e.disposeRunner.remove(this),t||(i.deleteFramebuffer(n.framebuffer),n.msaaBuffer&&i.deleteRenderbuffer(n.msaaBuffer),n.stencil&&i.deleteRenderbuffer(n.stencil)),n.blitFramebuffer&&n.blitFramebuffer.dispose()}},r.prototype.disposeAll=function(e){var t=this.managedFramebuffers;this.managedFramebuffers=[];for(var n=0;n<t.length;n++)this.disposeFramebuffer(t[n],e)},r.prototype.forceStencil=function(){var e=this.current;if(e){var t=e.glFramebuffers[this.CONTEXT_UID];if(!(!t||t.stencil)){e.stencil=!0;var n=e.width,i=e.height,a=this.gl,s=a.createRenderbuffer();a.bindRenderbuffer(a.RENDERBUFFER,s),t.msaaBuffer?a.renderbufferStorageMultisample(a.RENDERBUFFER,t.multisample,a.DEPTH24_STENCIL8,n,i):a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_STENCIL,n,i),t.stencil=s,a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.RENDERBUFFER,s)}}},r.prototype.reset=function(){this.current=this.unknownFramebuffer,this.viewport=new $t},r.prototype.destroy=function(){this.renderer=null},r})(),Xb={5126:4,5123:2,5121:1},zw=(function(){function r(e){this.renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}return r.prototype.contextChange=function(){this.disposeAll(!0);var e=this.gl=this.renderer.gl,t=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,t.webGLVersion!==2){var n=this.renderer.context.extensions.vertexArrayObject;ht.PREFER_ENV===ns.WEBGL_LEGACY&&(n=null),n?(e.createVertexArray=function(){return n.createVertexArrayOES()},e.bindVertexArray=function(a){return n.bindVertexArrayOES(a)},e.deleteVertexArray=function(a){return n.deleteVertexArrayOES(a)}):(this.hasVao=!1,e.createVertexArray=function(){return null},e.bindVertexArray=function(){return null},e.deleteVertexArray=function(){return null})}if(t.webGLVersion!==2){var i=e.getExtension("ANGLE_instanced_arrays");i?(e.vertexAttribDivisor=function(a,s){return i.vertexAttribDivisorANGLE(a,s)},e.drawElementsInstanced=function(a,s,o,l,c){return i.drawElementsInstancedANGLE(a,s,o,l,c)},e.drawArraysInstanced=function(a,s,o,l){return i.drawArraysInstancedANGLE(a,s,o,l)}):this.hasInstance=!1}this.canUseUInt32ElementIndex=t.webGLVersion===2||!!t.extensions.uint32ElementIndex},r.prototype.bind=function(e,t){t=t||this.renderer.shader.shader;var n=this.gl,i=e.glVertexArrayObjects[this.CONTEXT_UID],a=!1;i||(this.managedGeometries[e.id]=e,e.disposeRunner.add(this),e.glVertexArrayObjects[this.CONTEXT_UID]=i={},a=!0);var s=i[t.program.id]||this.initGeometryVao(e,t,a);this._activeGeometry=e,this._activeVao!==s&&(this._activeVao=s,this.hasVao?n.bindVertexArray(s):this.activateVao(e,t.program)),this.updateBuffers()},r.prototype.reset=function(){this.unbind()},r.prototype.updateBuffers=function(){for(var e=this._activeGeometry,t=this.renderer.buffer,n=0;n<e.buffers.length;n++){var i=e.buffers[n];t.update(i)}},r.prototype.checkCompatibility=function(e,t){var n=e.attributes,i=t.attributeData;for(var a in i)if(!n[a])throw new Error('shader and geometry incompatible, geometry missing the "'+a+'" attribute')},r.prototype.getSignature=function(e,t){var n=e.attributes,i=t.attributeData,a=["g",e.id];for(var s in n)i[s]&&a.push(s,i[s].location);return a.join("-")},r.prototype.initGeometryVao=function(e,t,n){n===void 0&&(n=!0);var i=this.gl,a=this.CONTEXT_UID,s=this.renderer.buffer,o=t.program;o.glPrograms[a]||this.renderer.shader.generateProgram(t),this.checkCompatibility(e,o);var l=this.getSignature(e,o),c=e.glVertexArrayObjects[this.CONTEXT_UID],h=c[l];if(h)return c[o.id]=h,h;var d=e.buffers,v=e.attributes,g={},m={};for(var x in d)g[x]=0,m[x]=0;for(var x in v)!v[x].size&&o.attributeData[x]?v[x].size=o.attributeData[x].size:v[x].size||console.warn("PIXI Geometry attribute '"+x+"' size cannot be determined (likely the bound shader does not have the attribute)"),g[v[x].buffer]+=v[x].size*Xb[v[x].type];for(var x in v){var y=v[x],_=y.size;y.stride===void 0&&(g[y.buffer]===_*Xb[y.type]?y.stride=0:y.stride=g[y.buffer]),y.start===void 0&&(y.start=m[y.buffer],m[y.buffer]+=_*Xb[y.type])}h=i.createVertexArray(),i.bindVertexArray(h);for(var w=0;w<d.length;w++){var S=d[w];s.bind(S),n&&S._glBuffers[a].refCount++}return this.activateVao(e,o),this._activeVao=h,c[o.id]=h,c[l]=h,h},r.prototype.disposeGeometry=function(e,t){var n;if(this.managedGeometries[e.id]){delete this.managedGeometries[e.id];var i=e.glVertexArrayObjects[this.CONTEXT_UID],a=this.gl,s=e.buffers,o=(n=this.renderer)===null||n===void 0?void 0:n.buffer;if(e.disposeRunner.remove(this),!!i){if(o)for(var l=0;l<s.length;l++){var c=s[l]._glBuffers[this.CONTEXT_UID];c&&(c.refCount--,c.refCount===0&&!t&&o.dispose(s[l],t))}if(!t){for(var h in i)if(h[0]==="g"){var d=i[h];this._activeVao===d&&this.unbind(),a.deleteVertexArray(d)}}delete e.glVertexArrayObjects[this.CONTEXT_UID]}}},r.prototype.disposeAll=function(e){for(var t=Object.keys(this.managedGeometries),n=0;n<t.length;n++)this.disposeGeometry(this.managedGeometries[t[n]],e)},r.prototype.activateVao=function(e,t){var n=this.gl,i=this.CONTEXT_UID,a=this.renderer.buffer,s=e.buffers,o=e.attributes;e.indexBuffer&&a.bind(e.indexBuffer);var l=null;for(var c in o){var h=o[c],d=s[h.buffer],v=d._glBuffers[i];if(t.attributeData[c]){l!==v&&(a.bind(d),l=v);var g=t.attributeData[c].location;if(n.enableVertexAttribArray(g),n.vertexAttribPointer(g,h.size,h.type||n.FLOAT,h.normalized,h.stride,h.start),h.instance)if(this.hasInstance)n.vertexAttribDivisor(g,1);else throw new Error("geometry error, GPU Instancing is not supported on this device")}}},r.prototype.draw=function(e,t,n,i){var a=this.gl,s=this._activeGeometry;if(s.indexBuffer){var o=s.indexBuffer.data.BYTES_PER_ELEMENT,l=o===2?a.UNSIGNED_SHORT:a.UNSIGNED_INT;o===2||o===4&&this.canUseUInt32ElementIndex?s.instanced?a.drawElementsInstanced(e,t||s.indexBuffer.data.length,l,(n||0)*o,i||1):a.drawElements(e,t||s.indexBuffer.data.length,l,(n||0)*o):console.warn("unsupported index buffer type: uint32")}else s.instanced?a.drawArraysInstanced(e,n,t||s.getSize(),i||1):a.drawArrays(e,n,t||s.getSize());return this},r.prototype.unbind=function(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null},r.prototype.destroy=function(){this.renderer=null},r})(),iD=(function(){function r(e){e===void 0&&(e=null),this.type=vn.NONE,this.autoDetect=!0,this.maskObject=e||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=ht.FILTER_MULTISAMPLE,this.enabled=!0,this.colorMask=15,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._colorMask=15,this._target=null}return Object.defineProperty(r.prototype,"filter",{get:function(){return this._filters?this._filters[0]:null},set:function(e){e?this._filters?this._filters[0]=e:this._filters=[e]:this._filters=null},enumerable:!1,configurable:!0}),r.prototype.reset=function(){this.pooled&&(this.maskObject=null,this.type=vn.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null},r.prototype.copyCountersOrReset=function(e){e?(this._stencilCounter=e._stencilCounter,this._scissorCounter=e._scissorCounter,this._scissorRect=e._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)},r})();function YC(r,e,t){var n=r.createShader(e);return r.shaderSource(n,t),r.compileShader(n),n}function WC(r,e){var t=r.getShaderSource(e).split(`
  470. `).map(function(c,h){return h+": "+c}),n=r.getShaderInfoLog(e),i=n.split(`
  471. `),a={},s=i.map(function(c){return parseFloat(c.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))}).filter(function(c){return c&&!a[c]?(a[c]=!0,!0):!1}),o=[""];s.forEach(function(c){t[c-1]="%c"+t[c-1]+"%c",o.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});var l=t.join(`
  472. `);o[0]=l,console.error(n),console.groupCollapsed("click to view full shader code"),console.warn.apply(console,o),console.groupEnd()}function z$(r,e,t,n){r.getProgramParameter(e,r.LINK_STATUS)||(r.getShaderParameter(t,r.COMPILE_STATUS)||WC(r,t),r.getShaderParameter(n,r.COMPILE_STATUS)||WC(r,n),console.error("PixiJS Error: Could not initialize shader."),r.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",r.getProgramInfoLog(e)))}function Yb(r){for(var e=new Array(r),t=0;t<e.length;t++)e[t]=!1;return e}function aD(r,e){switch(r){case"float":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"uvec2":return new Uint32Array(2*e);case"uvec3":return new Uint32Array(3*e);case"uvec4":return new Uint32Array(4*e);case"bool":return!1;case"bvec2":return Yb(2*e);case"bvec3":return Yb(3*e);case"bvec4":return Yb(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}var sD={},vf=sD;function oD(){if(vf===sD||vf&&vf.isContextLost()){var r=ht.ADAPTER.createCanvas(),e=void 0;ht.PREFER_ENV>=ns.WEBGL2&&(e=r.getContext("webgl2",{})),e||(e=r.getContext("webgl",{})||r.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),vf=e}return vf}var Sv;function U$(){if(!Sv){Sv=Oi.MEDIUM;var r=oD();if(r&&r.getShaderPrecisionFormat){var e=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT);Sv=e.precision?Oi.HIGH:Oi.MEDIUM}}return Sv}function $C(r,e,t){if(r.substring(0,9)!=="precision"){var n=e;return e===Oi.HIGH&&t!==Oi.HIGH&&(n=Oi.MEDIUM),"precision "+n+` float;
  473. `+r}else if(t!==Oi.HIGH&&r.substring(0,15)==="precision highp")return r.replace("precision highp","precision mediump");return r}var G$={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function lD(r){return G$[r]}var Ev=null,KC={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function uD(r,e){if(!Ev){var t=Object.keys(KC);Ev={};for(var n=0;n<t.length;++n){var i=t[n];Ev[r[i]]=KC[i]}}return Ev[e]}var uu=[{test:function(r){return r.type==="float"&&r.size===1&&!r.isArray},code:function(r){return`
  474. if(uv["`+r+'"] !== ud["'+r+`"].value)
  475. {
  476. ud["`+r+'"].value = uv["'+r+`"]
  477. gl.uniform1f(ud["`+r+'"].location, uv["'+r+`"])
  478. }
  479. `}},{test:function(r,e){return(r.type==="sampler2D"||r.type==="samplerCube"||r.type==="sampler2DArray")&&r.size===1&&!r.isArray&&(e==null||e.castToBaseTexture!==void 0)},code:function(r){return`t = syncData.textureCount++;
  480. renderer.texture.bind(uv["`+r+`"], t);
  481. if(ud["`+r+`"].value !== t)
  482. {
  483. ud["`+r+`"].value = t;
  484. gl.uniform1i(ud["`+r+`"].location, t);
  485. ; // eslint-disable-line max-len
  486. }`}},{test:function(r,e){return r.type==="mat3"&&r.size===1&&!r.isArray&&e.a!==void 0},code:function(r){return`
  487. gl.uniformMatrix3fv(ud["`+r+'"].location, false, uv["'+r+`"].toArray(true));
  488. `},codeUbo:function(r){return`
  489. var `+r+"_matrix = uv."+r+`.toArray(true);
  490. data[offset] = `+r+`_matrix[0];
  491. data[offset+1] = `+r+`_matrix[1];
  492. data[offset+2] = `+r+`_matrix[2];
  493. data[offset + 4] = `+r+`_matrix[3];
  494. data[offset + 5] = `+r+`_matrix[4];
  495. data[offset + 6] = `+r+`_matrix[5];
  496. data[offset + 8] = `+r+`_matrix[6];
  497. data[offset + 9] = `+r+`_matrix[7];
  498. data[offset + 10] = `+r+`_matrix[8];
  499. `}},{test:function(r,e){return r.type==="vec2"&&r.size===1&&!r.isArray&&e.x!==void 0},code:function(r){return`
  500. cv = ud["`+r+`"].value;
  501. v = uv["`+r+`"];
  502. if(cv[0] !== v.x || cv[1] !== v.y)
  503. {
  504. cv[0] = v.x;
  505. cv[1] = v.y;
  506. gl.uniform2f(ud["`+r+`"].location, v.x, v.y);
  507. }`},codeUbo:function(r){return`
  508. v = uv.`+r+`;
  509. data[offset] = v.x;
  510. data[offset+1] = v.y;
  511. `}},{test:function(r){return r.type==="vec2"&&r.size===1&&!r.isArray},code:function(r){return`
  512. cv = ud["`+r+`"].value;
  513. v = uv["`+r+`"];
  514. if(cv[0] !== v[0] || cv[1] !== v[1])
  515. {
  516. cv[0] = v[0];
  517. cv[1] = v[1];
  518. gl.uniform2f(ud["`+r+`"].location, v[0], v[1]);
  519. }
  520. `}},{test:function(r,e){return r.type==="vec4"&&r.size===1&&!r.isArray&&e.width!==void 0},code:function(r){return`
  521. cv = ud["`+r+`"].value;
  522. v = uv["`+r+`"];
  523. if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)
  524. {
  525. cv[0] = v.x;
  526. cv[1] = v.y;
  527. cv[2] = v.width;
  528. cv[3] = v.height;
  529. gl.uniform4f(ud["`+r+`"].location, v.x, v.y, v.width, v.height)
  530. }`},codeUbo:function(r){return`
  531. v = uv.`+r+`;
  532. data[offset] = v.x;
  533. data[offset+1] = v.y;
  534. data[offset+2] = v.width;
  535. data[offset+3] = v.height;
  536. `}},{test:function(r){return r.type==="vec4"&&r.size===1&&!r.isArray},code:function(r){return`
  537. cv = ud["`+r+`"].value;
  538. v = uv["`+r+`"];
  539. if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
  540. {
  541. cv[0] = v[0];
  542. cv[1] = v[1];
  543. cv[2] = v[2];
  544. cv[3] = v[3];
  545. gl.uniform4f(ud["`+r+`"].location, v[0], v[1], v[2], v[3])
  546. }`}}],H$={float:`
  547. if (cv !== v)
  548. {
  549. cu.value = v;
  550. gl.uniform1f(location, v);
  551. }`,vec2:`
  552. if (cv[0] !== v[0] || cv[1] !== v[1])
  553. {
  554. cv[0] = v[0];
  555. cv[1] = v[1];
  556. gl.uniform2f(location, v[0], v[1])
  557. }`,vec3:`
  558. if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
  559. {
  560. cv[0] = v[0];
  561. cv[1] = v[1];
  562. cv[2] = v[2];
  563. gl.uniform3f(location, v[0], v[1], v[2])
  564. }`,vec4:`
  565. if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
  566. {
  567. cv[0] = v[0];
  568. cv[1] = v[1];
  569. cv[2] = v[2];
  570. cv[3] = v[3];
  571. gl.uniform4f(location, v[0], v[1], v[2], v[3]);
  572. }`,int:`
  573. if (cv !== v)
  574. {
  575. cu.value = v;
  576. gl.uniform1i(location, v);
  577. }`,ivec2:`
  578. if (cv[0] !== v[0] || cv[1] !== v[1])
  579. {
  580. cv[0] = v[0];
  581. cv[1] = v[1];
  582. gl.uniform2i(location, v[0], v[1]);
  583. }`,ivec3:`
  584. if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
  585. {
  586. cv[0] = v[0];
  587. cv[1] = v[1];
  588. cv[2] = v[2];
  589. gl.uniform3i(location, v[0], v[1], v[2]);
  590. }`,ivec4:`
  591. if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
  592. {
  593. cv[0] = v[0];
  594. cv[1] = v[1];
  595. cv[2] = v[2];
  596. cv[3] = v[3];
  597. gl.uniform4i(location, v[0], v[1], v[2], v[3]);
  598. }`,uint:`
  599. if (cv !== v)
  600. {
  601. cu.value = v;
  602. gl.uniform1ui(location, v);
  603. }`,uvec2:`
  604. if (cv[0] !== v[0] || cv[1] !== v[1])
  605. {
  606. cv[0] = v[0];
  607. cv[1] = v[1];
  608. gl.uniform2ui(location, v[0], v[1]);
  609. }`,uvec3:`
  610. if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
  611. {
  612. cv[0] = v[0];
  613. cv[1] = v[1];
  614. cv[2] = v[2];
  615. gl.uniform3ui(location, v[0], v[1], v[2]);
  616. }`,uvec4:`
  617. if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
  618. {
  619. cv[0] = v[0];
  620. cv[1] = v[1];
  621. cv[2] = v[2];
  622. cv[3] = v[3];
  623. gl.uniform4ui(location, v[0], v[1], v[2], v[3]);
  624. }`,bool:`
  625. if (cv !== v)
  626. {
  627. cu.value = v;
  628. gl.uniform1i(location, v);
  629. }`,bvec2:`
  630. if (cv[0] != v[0] || cv[1] != v[1])
  631. {
  632. cv[0] = v[0];
  633. cv[1] = v[1];
  634. gl.uniform2i(location, v[0], v[1]);
  635. }`,bvec3:`
  636. if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
  637. {
  638. cv[0] = v[0];
  639. cv[1] = v[1];
  640. cv[2] = v[2];
  641. gl.uniform3i(location, v[0], v[1], v[2]);
  642. }`,bvec4:`
  643. if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
  644. {
  645. cv[0] = v[0];
  646. cv[1] = v[1];
  647. cv[2] = v[2];
  648. cv[3] = v[3];
  649. gl.uniform4i(location, v[0], v[1], v[2], v[3]);
  650. }`,mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:`
  651. if (cv !== v)
  652. {
  653. cu.value = v;
  654. gl.uniform1i(location, v);
  655. }`,samplerCube:`
  656. if (cv !== v)
  657. {
  658. cu.value = v;
  659. gl.uniform1i(location, v);
  660. }`,sampler2DArray:`
  661. if (cv !== v)
  662. {
  663. cu.value = v;
  664. gl.uniform1i(location, v);
  665. }`},j$={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};function V$(r,e){var t,n=[`
  666. var v = null;
  667. var cv = null;
  668. var cu = null;
  669. var t = 0;
  670. var gl = renderer.gl;
  671. `];for(var i in r.uniforms){var a=e[i];if(!a){!((t=r.uniforms[i])===null||t===void 0)&&t.group&&(r.uniforms[i].ubo?n.push(`
  672. renderer.shader.syncUniformBufferGroup(uv.`+i+", '"+i+`');
  673. `):n.push(`
  674. renderer.shader.syncUniformGroup(uv.`+i+`, syncData);
  675. `));continue}for(var s=r.uniforms[i],o=!1,l=0;l<uu.length;l++)if(uu[l].test(a,s)){n.push(uu[l].code(i,s)),o=!0;break}if(!o){var c=a.size===1&&!a.isArray?H$:j$,h=c[a.type].replace("location",'ud["'+i+'"].location');n.push(`
  676. cu = ud["`+i+`"];
  677. cv = cu.value;
  678. v = uv["`+i+`"];
  679. `+h+";")}}return new Function("ud","uv","renderer","syncData",n.join(`
  680. `))}var q$=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
  681. `);function X$(r){for(var e="",t=0;t<r;++t)t>0&&(e+=`
  682. else `),t<r-1&&(e+="if(test == "+t+".0){}");return e}function cD(r,e){if(r===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");for(var t=e.createShader(e.FRAGMENT_SHADER);;){var n=q$.replace(/%forloop%/gi,X$(r));if(e.shaderSource(t,n),e.compileShader(t),!e.getShaderParameter(t,e.COMPILE_STATUS))r=r/2|0;else break}return r}var pf;function Y$(){if(typeof pf=="boolean")return pf;try{var r=new Function("param1","param2","param3","return param1[param2] === param3;");pf=r({a:"b"},"a","b")===!0}catch{pf=!1}return pf}var W$=`varying vec2 vTextureCoord;
  683. uniform sampler2D uSampler;
  684. void main(void){
  685. gl_FragColor *= texture2D(uSampler, vTextureCoord);
  686. }`,$$=`attribute vec2 aVertexPosition;
  687. attribute vec2 aTextureCoord;
  688. uniform mat3 projectionMatrix;
  689. varying vec2 vTextureCoord;
  690. void main(void){
  691. gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
  692. vTextureCoord = aTextureCoord;
  693. }
  694. `,K$=0,Tv={},sh=(function(){function r(e,t,n){n===void 0&&(n="pixi-shader"),this.id=K$++,this.vertexSrc=e||r.defaultVertexSrc,this.fragmentSrc=t||r.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),this.vertexSrc.substring(0,8)!=="#version"&&(n=n.replace(/\s+/g,"-"),Tv[n]?(Tv[n]++,n+="-"+Tv[n]):Tv[n]=1,this.vertexSrc="#define SHADER_NAME "+n+`
  695. `+this.vertexSrc,this.fragmentSrc="#define SHADER_NAME "+n+`
  696. `+this.fragmentSrc,this.vertexSrc=$C(this.vertexSrc,ht.PRECISION_VERTEX,Oi.HIGH),this.fragmentSrc=$C(this.fragmentSrc,ht.PRECISION_FRAGMENT,U$())),this.glPrograms={},this.syncUniforms=null}return Object.defineProperty(r,"defaultVertexSrc",{get:function(){return $$},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultFragmentSrc",{get:function(){return W$},enumerable:!1,configurable:!0}),r.from=function(e,t,n){var i=e+t,a=C4[i];return a||(C4[i]=a=new r(e,t,n)),a},r})(),Gs=(function(){function r(e,t){this.uniformBindCount=0,this.program=e,t?t instanceof Yo?this.uniformGroup=t:this.uniformGroup=new Yo(t):this.uniformGroup=new Yo({}),this.disposeRunner=new Bn("disposeShader")}return r.prototype.checkUniformExists=function(e,t){if(t.uniforms[e])return!0;for(var n in t.uniforms){var i=t.uniforms[n];if(i.group&&this.checkUniformExists(e,i))return!0}return!1},r.prototype.destroy=function(){this.uniformGroup=null,this.disposeRunner.emit(this),this.disposeRunner.destroy()},Object.defineProperty(r.prototype,"uniforms",{get:function(){return this.uniformGroup.uniforms},enumerable:!1,configurable:!0}),r.from=function(e,t,n){var i=sh.from(e,t);return new r(i,n)},r})(),Wb=0,$b=1,Kb=2,Zb=3,Qb=4,Jb=5,gl=(function(){function r(){this.data=0,this.blendMode=Et.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}return Object.defineProperty(r.prototype,"blend",{get:function(){return!!(this.data&1<<Wb)},set:function(e){!!(this.data&1<<Wb)!==e&&(this.data^=1<<Wb)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"offsets",{get:function(){return!!(this.data&1<<$b)},set:function(e){!!(this.data&1<<$b)!==e&&(this.data^=1<<$b)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"culling",{get:function(){return!!(this.data&1<<Kb)},set:function(e){!!(this.data&1<<Kb)!==e&&(this.data^=1<<Kb)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"depthTest",{get:function(){return!!(this.data&1<<Zb)},set:function(e){!!(this.data&1<<Zb)!==e&&(this.data^=1<<Zb)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"depthMask",{get:function(){return!!(this.data&1<<Jb)},set:function(e){!!(this.data&1<<Jb)!==e&&(this.data^=1<<Jb)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"clockwiseFrontFace",{get:function(){return!!(this.data&1<<Qb)},set:function(e){!!(this.data&1<<Qb)!==e&&(this.data^=1<<Qb)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"blendMode",{get:function(){return this._blendMode},set:function(e){this.blend=e!==Et.NONE,this._blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"polygonOffset",{get:function(){return this._polygonOffset},set:function(e){this.offsets=!!e,this._polygonOffset=e},enumerable:!1,configurable:!0}),r.prototype.toString=function(){return"[@pixi/core:State "+("blendMode="+this.blendMode+" ")+("clockwiseFrontFace="+this.clockwiseFrontFace+" ")+("culling="+this.culling+" ")+("depthMask="+this.depthMask+" ")+("polygonOffset="+this.polygonOffset)+"]"},r.for2d=function(){var e=new r;return e.depthTest=!1,e.blend=!0,e},r})(),Z$=`varying vec2 vTextureCoord;
  697. uniform sampler2D uSampler;
  698. void main(void){
  699. gl_FragColor = texture2D(uSampler, vTextureCoord);
  700. }
  701. `,Q$=`attribute vec2 aVertexPosition;
  702. uniform mat3 projectionMatrix;
  703. varying vec2 vTextureCoord;
  704. uniform vec4 inputSize;
  705. uniform vec4 outputFrame;
  706. vec4 filterVertexPosition( void )
  707. {
  708. vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
  709. return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
  710. }
  711. vec2 filterTextureCoord( void )
  712. {
  713. return aVertexPosition * (outputFrame.zw * inputSize.zw);
  714. }
  715. void main(void)
  716. {
  717. gl_Position = filterVertexPosition();
  718. vTextureCoord = filterTextureCoord();
  719. }
  720. `,Zs=(function(r){Ir(e,r);function e(t,n,i){var a=this,s=sh.from(t||e.defaultVertexSrc,n||e.defaultFragmentSrc);return a=r.call(this,s,i)||this,a.padding=0,a.resolution=ht.FILTER_RESOLUTION,a.multisample=ht.FILTER_MULTISAMPLE,a.enabled=!0,a.autoFit=!0,a.state=new gl,a}return e.prototype.apply=function(t,n,i,a,s){t.applyFilter(this,n,i,a)},Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._resolution=t},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultVertexSrc",{get:function(){return Q$},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultFragmentSrc",{get:function(){return Z$},enumerable:!1,configurable:!0}),e})(Gs),J$=`attribute vec2 aVertexPosition;
  721. attribute vec2 aTextureCoord;
  722. uniform mat3 projectionMatrix;
  723. uniform mat3 otherMatrix;
  724. varying vec2 vMaskCoord;
  725. varying vec2 vTextureCoord;
  726. void main(void)
  727. {
  728. gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
  729. vTextureCoord = aTextureCoord;
  730. vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;
  731. }
  732. `,eK=`varying vec2 vMaskCoord;
  733. varying vec2 vTextureCoord;
  734. uniform sampler2D uSampler;
  735. uniform sampler2D mask;
  736. uniform float alpha;
  737. uniform float npmAlpha;
  738. uniform vec4 maskClamp;
  739. void main(void)
  740. {
  741. float clip = step(3.5,
  742. step(maskClamp.x, vMaskCoord.x) +
  743. step(maskClamp.y, vMaskCoord.y) +
  744. step(vMaskCoord.x, maskClamp.z) +
  745. step(vMaskCoord.y, maskClamp.w));
  746. vec4 original = texture2D(uSampler, vTextureCoord);
  747. vec4 masky = texture2D(mask, vMaskCoord);
  748. float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);
  749. original *= (alphaMul * masky.r * alpha * clip);
  750. gl_FragColor = original;
  751. }
  752. `,ZC=new qr,Rg=(function(){function r(e,t){this._texture=e,this.mapCoord=new qr,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=typeof t>"u"?.5:t,this.isSimple=!1}return Object.defineProperty(r.prototype,"texture",{get:function(){return this._texture},set:function(e){this._texture=e,this._textureID=-1},enumerable:!1,configurable:!0}),r.prototype.multiplyUvs=function(e,t){t===void 0&&(t=e);for(var n=this.mapCoord,i=0;i<e.length;i+=2){var a=e[i],s=e[i+1];t[i]=a*n.a+s*n.c+n.tx,t[i+1]=a*n.b+s*n.d+n.ty}return t},r.prototype.update=function(e){var t=this._texture;if(!t||!t.valid||!e&&this._textureID===t._updateID)return!1;this._textureID=t._updateID,this._updateID++;var n=t._uvs;this.mapCoord.set(n.x1-n.x0,n.y1-n.y0,n.x3-n.x0,n.y3-n.y0,n.x0,n.y0);var i=t.orig,a=t.trim;a&&(ZC.set(i.width/a.width,0,0,i.height/a.height,-a.x/a.width,-a.y/a.height),this.mapCoord.append(ZC));var s=t.baseTexture,o=this.uClampFrame,l=this.clampMargin/s.resolution,c=this.clampOffset;return o[0]=(t._frame.x+l+c)/s.width,o[1]=(t._frame.y+l+c)/s.height,o[2]=(t._frame.x+t._frame.width-l+c)/s.width,o[3]=(t._frame.y+t._frame.height-l+c)/s.height,this.uClampOffset[0]=c/s.realWidth,this.uClampOffset[1]=c/s.realHeight,this.isSimple=t._frame.width===s.width&&t._frame.height===s.height&&t.rotate===0,!0},r})(),hD=(function(r){Ir(e,r);function e(t,n,i){var a=this,s=null;return typeof t!="string"&&n===void 0&&i===void 0&&(s=t,t=void 0,n=void 0,i=void 0),a=r.call(this,t||J$,n||eK,i)||this,a.maskSprite=s,a.maskMatrix=new qr,a}return Object.defineProperty(e.prototype,"maskSprite",{get:function(){return this._maskSprite},set:function(t){this._maskSprite=t,this._maskSprite&&(this._maskSprite.renderable=!1)},enumerable:!1,configurable:!0}),e.prototype.apply=function(t,n,i,a){var s=this._maskSprite,o=s._texture;o.valid&&(o.uvMatrix||(o.uvMatrix=new Rg(o,0)),o.uvMatrix.update(),this.uniforms.npmAlpha=o.baseTexture.alphaMode?0:1,this.uniforms.mask=o,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,s).prepend(o.uvMatrix.mapCoord),this.uniforms.alpha=s.worldAlpha,this.uniforms.maskClamp=o.uvMatrix.uClampFrame,t.applyFilter(this,n,i,a))},e})(Zs),Uw=(function(){function r(e){this.renderer=e,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}return r.prototype.setMaskStack=function(e){this.maskStack=e,this.renderer.scissor.setMaskStack(e),this.renderer.stencil.setMaskStack(e)},r.prototype.push=function(e,t){var n=t;if(!n.isMaskData){var i=this.maskDataPool.pop()||new iD;i.pooled=!0,i.maskObject=t,n=i}var a=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null;if(n.copyCountersOrReset(a),n._colorMask=a?a._colorMask:15,n.autoDetect&&this.detect(n),n._target=e,n.type!==vn.SPRITE&&this.maskStack.push(n),n.enabled)switch(n.type){case vn.SCISSOR:this.renderer.scissor.push(n);break;case vn.STENCIL:this.renderer.stencil.push(n);break;case vn.SPRITE:n.copyCountersOrReset(null),this.pushSpriteMask(n);break;case vn.COLOR:this.pushColorMask(n);break}n.type===vn.SPRITE&&this.maskStack.push(n)},r.prototype.pop=function(e){var t=this.maskStack.pop();if(!(!t||t._target!==e)){if(t.enabled)switch(t.type){case vn.SCISSOR:this.renderer.scissor.pop(t);break;case vn.STENCIL:this.renderer.stencil.pop(t.maskObject);break;case vn.SPRITE:this.popSpriteMask(t);break;case vn.COLOR:this.popColorMask(t);break}if(t.reset(),t.pooled&&this.maskDataPool.push(t),this.maskStack.length!==0){var n=this.maskStack[this.maskStack.length-1];n.type===vn.SPRITE&&n._filters&&(n._filters[0].maskSprite=n.maskObject)}}},r.prototype.detect=function(e){var t=e.maskObject;t?t.isSprite?e.type=vn.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(e)?e.type=vn.SCISSOR:e.type=vn.STENCIL:e.type=vn.COLOR},r.prototype.pushSpriteMask=function(e){var t,n,i=e.maskObject,a=e._target,s=e._filters;s||(s=this.alphaMaskPool[this.alphaMaskIndex],s||(s=this.alphaMaskPool[this.alphaMaskIndex]=[new hD]));var o=this.renderer,l=o.renderTexture,c,h;if(l.current){var d=l.current;c=e.resolution||d.resolution,h=(t=e.multisample)!==null&&t!==void 0?t:d.multisample}else c=e.resolution||o.resolution,h=(n=e.multisample)!==null&&n!==void 0?n:o.multisample;s[0].resolution=c,s[0].multisample=h,s[0].maskSprite=i;var v=a.filterArea;a.filterArea=i.getBounds(!0),o.filter.push(a,s),a.filterArea=v,e._filters||this.alphaMaskIndex++},r.prototype.popSpriteMask=function(e){this.renderer.filter.pop(),e._filters?e._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)},r.prototype.pushColorMask=function(e){var t=e._colorMask,n=e._colorMask=t&e.colorMask;n!==t&&this.renderer.gl.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)},r.prototype.popColorMask=function(e){var t=e._colorMask,n=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;n!==t&&this.renderer.gl.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)},r.prototype.destroy=function(){this.renderer=null},r})(),fD=(function(){function r(e){this.renderer=e,this.maskStack=[],this.glConst=0}return r.prototype.getStackLength=function(){return this.maskStack.length},r.prototype.setMaskStack=function(e){var t=this.renderer.gl,n=this.getStackLength();this.maskStack=e;var i=this.getStackLength();i!==n&&(i===0?t.disable(this.glConst):(t.enable(this.glConst),this._useCurrent()))},r.prototype._useCurrent=function(){},r.prototype.destroy=function(){this.renderer=null,this.maskStack=null},r})(),QC=new qr,JC=[],Gw=(function(r){Ir(e,r);function e(t){var n=r.call(this,t)||this;return n.glConst=ht.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST,n}return e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0},e.prototype.calcScissorRect=function(t){var n;if(!t._scissorRectLocal){var i=t._scissorRect,a=t.maskObject,s=this.renderer,o=s.renderTexture,l=a.getBounds(!0,(n=JC.pop())!==null&&n!==void 0?n:new $t);this.roundFrameToPixels(l,o.current?o.current.resolution:s.resolution,o.sourceFrame,o.destinationFrame,s.projection.transform),i&&l.fit(i),t._scissorRectLocal=l}},e.isMatrixRotated=function(t){if(!t)return!1;var n=t.a,i=t.b,a=t.c,s=t.d;return(Math.abs(i)>1e-4||Math.abs(a)>1e-4)&&(Math.abs(n)>1e-4||Math.abs(s)>1e-4)},e.prototype.testScissor=function(t){var n=t.maskObject;if(!n.isFastRect||!n.isFastRect()||e.isMatrixRotated(n.worldTransform)||e.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);var i=t._scissorRectLocal;return i.width>0&&i.height>0},e.prototype.roundFrameToPixels=function(t,n,i,a,s){e.isMatrixRotated(s)||(s=s?QC.copyFrom(s):QC.identity(),s.translate(-i.x,-i.y).scale(a.width/i.width,a.height/i.height).translate(a.x,a.y),this.renderer.filter.transformAABB(s,t),t.fit(a),t.x=Math.round(t.x*n),t.y=Math.round(t.y*n),t.width=Math.round(t.width*n),t.height=Math.round(t.height*n))},e.prototype.push=function(t){t._scissorRectLocal||this.calcScissorRect(t);var n=this.renderer.gl;t._scissorRect||n.enable(n.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()},e.prototype.pop=function(t){var n=this.renderer.gl;t&&JC.push(t._scissorRectLocal),this.getStackLength()>0?this._useCurrent():n.disable(n.SCISSOR_TEST)},e.prototype._useCurrent=function(){var t=this.maskStack[this.maskStack.length-1]._scissorRect,n;this.renderer.renderTexture.current?n=t.y:n=this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,n,t.width,t.height)},e})(fD),Hw=(function(r){Ir(e,r);function e(t){var n=r.call(this,t)||this;return n.glConst=ht.ADAPTER.getWebGLRenderingContext().STENCIL_TEST,n}return e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0},e.prototype.push=function(t){var n=t.maskObject,i=this.renderer.gl,a=t._stencilCounter;a===0&&(this.renderer.framebuffer.forceStencil(),i.clearStencil(0),i.clear(i.STENCIL_BUFFER_BIT),i.enable(i.STENCIL_TEST)),t._stencilCounter++;var s=t._colorMask;s!==0&&(t._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilFunc(i.EQUAL,a,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.INCR),n.renderable=!0,n.render(this.renderer),this.renderer.batch.flush(),n.renderable=!1,s!==0&&(t._colorMask=s,i.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)),this._useCurrent()},e.prototype.pop=function(t){var n=this.renderer.gl;if(this.getStackLength()===0)n.disable(n.STENCIL_TEST);else{var i=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,a=i?i._colorMask:15;a!==0&&(i._colorMask=0,n.colorMask(!1,!1,!1,!1)),n.stencilOp(n.KEEP,n.KEEP,n.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,a!==0&&(i._colorMask=a,n.colorMask((a&1)!==0,(a&2)!==0,(a&4)!==0,(a&8)!==0)),this._useCurrent()}},e.prototype._useCurrent=function(){var t=this.renderer.gl;t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)},e})(fD),jw=(function(){function r(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new qr,this.transform=null}return r.prototype.update=function(e,t,n,i){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=t||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,n,i),this.transform&&this.projectionMatrix.append(this.transform);var a=this.renderer;a.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,a.globalUniforms.update(),a.shader.shader&&a.shader.syncUniformGroup(a.shader.shader.uniforms.globals)},r.prototype.calculateProjection=function(e,t,n,i){var a=this.projectionMatrix,s=i?-1:1;a.identity(),a.a=1/t.width*2,a.d=s*(1/t.height*2),a.tx=-1-t.x*a.a,a.ty=-s-t.y*a.d},r.prototype.setTransform=function(e){},r.prototype.destroy=function(){this.renderer=null},r})(),zl=new $t,gf=new $t,Vw=(function(){function r(e){this.renderer=e,this.clearColor=e._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new $t,this.destinationFrame=new $t,this.viewportFrame=new $t}return r.prototype.bind=function(e,t,n){e===void 0&&(e=null);var i=this.renderer;this.current=e;var a,s,o;e?(a=e.baseTexture,o=a.resolution,t||(zl.width=e.frame.width,zl.height=e.frame.height,t=zl),n||(gf.x=e.frame.x,gf.y=e.frame.y,gf.width=t.width,gf.height=t.height,n=gf),s=a.framebuffer):(o=i.resolution,t||(zl.width=i.screen.width,zl.height=i.screen.height,t=zl),n||(n=zl,n.width=t.width,n.height=t.height));var l=this.viewportFrame;l.x=n.x*o,l.y=n.y*o,l.width=n.width*o,l.height=n.height*o,e||(l.y=i.view.height-(l.y+l.height)),l.ceil(),this.renderer.framebuffer.bind(s,l),this.renderer.projection.update(n,t,o,!s),e?this.renderer.mask.setMaskStack(a.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(t),this.destinationFrame.copyFrom(n)},r.prototype.clear=function(e,t){this.current?e=e||this.current.baseTexture.clearColor:e=e||this.clearColor;var n=this.destinationFrame,i=this.current?this.current.baseTexture:this.renderer.screen,a=n.width!==i.width||n.height!==i.height;if(a){var s=this.viewportFrame,o=s.x,l=s.y,c=s.width,h=s.height;o=Math.round(o),l=Math.round(l),c=Math.round(c),h=Math.round(h),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(o,l,c,h)}this.renderer.framebuffer.clear(e[0],e[1],e[2],e[3],t),a&&this.renderer.scissor.pop()},r.prototype.resize=function(){this.bind(null)},r.prototype.reset=function(){this.bind(null)},r.prototype.destroy=function(){this.renderer=null},r})();function tK(r,e,t,n,i){t.buffer.update(i)}var rK={float:`
  753. data[offset] = v;
  754. `,vec2:`
  755. data[offset] = v[0];
  756. data[offset+1] = v[1];
  757. `,vec3:`
  758. data[offset] = v[0];
  759. data[offset+1] = v[1];
  760. data[offset+2] = v[2];
  761. `,vec4:`
  762. data[offset] = v[0];
  763. data[offset+1] = v[1];
  764. data[offset+2] = v[2];
  765. data[offset+3] = v[3];
  766. `,mat2:`
  767. data[offset] = v[0];
  768. data[offset+1] = v[1];
  769. data[offset+4] = v[2];
  770. data[offset+5] = v[3];
  771. `,mat3:`
  772. data[offset] = v[0];
  773. data[offset+1] = v[1];
  774. data[offset+2] = v[2];
  775. data[offset + 4] = v[3];
  776. data[offset + 5] = v[4];
  777. data[offset + 6] = v[5];
  778. data[offset + 8] = v[6];
  779. data[offset + 9] = v[7];
  780. data[offset + 10] = v[8];
  781. `,mat4:`
  782. for(var i = 0; i < 16; i++)
  783. {
  784. data[offset + i] = v[i];
  785. }
  786. `},dD={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};function vD(r){for(var e=r.map(function(l){return{data:l,offset:0,dataLen:0,dirty:0}}),t=0,n=0,i=0,a=0;a<e.length;a++){var s=e[a];if(t=dD[s.data.type],s.data.size>1&&(t=Math.max(t,16)*s.data.size),s.dataLen=t,n%t!==0&&n<16){var o=n%t%16;n+=o,i+=o}n+t>16?(i=Math.ceil(i/16)*16,s.offset=i,i+=t,n=t):(s.offset=i,n+=t,i+=t)}return i=Math.ceil(i/16)*16,{uboElements:e,size:i}}function pD(r,e){var t=[];for(var n in r)e[n]&&t.push(e[n]);return t.sort(function(i,a){return i.index-a.index}),t}function gD(r,e){if(!r.autoManage)return{size:0,syncFunc:tK};for(var t=pD(r.uniforms,e),n=vD(t),i=n.uboElements,a=n.size,s=[`
  787. var v = null;
  788. var v2 = null;
  789. var cv = null;
  790. var t = 0;
  791. var gl = renderer.gl
  792. var index = 0;
  793. var data = buffer.data;
  794. `],o=0;o<i.length;o++){for(var l=i[o],c=r.uniforms[l.data.name],h=l.data.name,d=!1,v=0;v<uu.length;v++){var g=uu[v];if(g.codeUbo&&g.test(l.data,c)){s.push("offset = "+l.offset/4+";",uu[v].codeUbo(l.data.name,c)),d=!0;break}}if(!d)if(l.data.size>1){var m=lD(l.data.type),x=Math.max(dD[l.data.type]/16,1),y=m/x,_=(4-y%4)%4;s.push(`
  795. cv = ud.`+h+`.value;
  796. v = uv.`+h+`;
  797. offset = `+l.offset/4+`;
  798. t = 0;
  799. for(var i=0; i < `+l.data.size*x+`; i++)
  800. {
  801. for(var j = 0; j < `+y+`; j++)
  802. {
  803. data[offset++] = v[t++];
  804. }
  805. offset += `+_+`;
  806. }
  807. `)}else{var w=rK[l.data.type];s.push(`
  808. cv = ud.`+h+`.value;
  809. v = uv.`+h+`;
  810. offset = `+l.offset/4+`;
  811. `+w+`;
  812. `)}}return s.push(`
  813. renderer.buffer.update(buffer);
  814. `),{size:a,syncFunc:new Function("ud","uv","renderer","syncData","buffer",s.join(`
  815. `))}}var nK=(function(){function r(){}return r})(),mD=(function(){function r(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return r.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},r})();function iK(r,e){for(var t={},n=e.getProgramParameter(r,e.ACTIVE_ATTRIBUTES),i=0;i<n;i++){var a=e.getActiveAttrib(r,i);if(a.name.indexOf("gl_")!==0){var s=uD(e,a.type),o={type:s,name:a.name,size:lD(s),location:e.getAttribLocation(r,a.name)};t[a.name]=o}}return t}function aK(r,e){for(var t={},n=e.getProgramParameter(r,e.ACTIVE_UNIFORMS),i=0;i<n;i++){var a=e.getActiveUniform(r,i),s=a.name.replace(/\[.*?\]$/,""),o=!!a.name.match(/\[.*?\]$/),l=uD(e,a.type);t[s]={name:s,index:i,type:l,size:a.size,isArray:o,value:aD(l,a.size)}}return t}function yD(r,e){var t=YC(r,r.VERTEX_SHADER,e.vertexSrc),n=YC(r,r.FRAGMENT_SHADER,e.fragmentSrc),i=r.createProgram();if(r.attachShader(i,t),r.attachShader(i,n),r.linkProgram(i),r.getProgramParameter(i,r.LINK_STATUS)||z$(r,i,t,n),e.attributeData=iK(i,r),e.uniformData=aK(i,r),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertexSrc)){var a=Object.keys(e.attributeData);a.sort(function(h,d){return h>d?1:-1});for(var s=0;s<a.length;s++)e.attributeData[a[s]].location=s,r.bindAttribLocation(i,s,a[s]);r.linkProgram(i)}r.deleteShader(t),r.deleteShader(n);var o={};for(var s in e.uniformData){var l=e.uniformData[s];o[s]={location:r.getUniformLocation(i,s),value:aD(l.type,l.size)}}var c=new mD(i,o);return c}var sK=0,Cv={textureCount:0,uboCount:0},qw=(function(){function r(e){this.destroyed=!1,this.renderer=e,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=sK++}return r.prototype.systemCheck=function(){if(!Y$())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")},r.prototype.contextChange=function(e){this.gl=e,this.reset()},r.prototype.bind=function(e,t){e.disposeRunner.add(this),e.uniforms.globals=this.renderer.globalUniforms;var n=e.program,i=n.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(e);return this.shader=e,this.program!==n&&(this.program=n,this.gl.useProgram(i.program)),t||(Cv.textureCount=0,Cv.uboCount=0,this.syncUniformGroup(e.uniformGroup,Cv)),i},r.prototype.setUniforms=function(e){var t=this.shader.program,n=t.glPrograms[this.renderer.CONTEXT_UID];t.syncUniforms(n.uniformData,e,this.renderer)},r.prototype.syncUniformGroup=function(e,t){var n=this.getGlProgram();(!e.static||e.dirtyId!==n.uniformDirtyGroups[e.id])&&(n.uniformDirtyGroups[e.id]=e.dirtyId,this.syncUniforms(e,n,t))},r.prototype.syncUniforms=function(e,t,n){var i=e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e);i(t.uniformData,e.uniforms,this.renderer,n)},r.prototype.createSyncGroups=function(e){var t=this.getSignature(e,this.shader.program.uniformData,"u");return this.cache[t]||(this.cache[t]=V$(e,this.shader.program.uniformData)),e.syncUniforms[this.shader.program.id]=this.cache[t],e.syncUniforms[this.shader.program.id]},r.prototype.syncUniformBufferGroup=function(e,t){var n=this.getGlProgram();if(!e.static||e.dirtyId!==0||!n.uniformGroups[e.id]){e.dirtyId=0;var i=n.uniformGroups[e.id]||this.createSyncBufferGroup(e,n,t);e.buffer.update(),i(n.uniformData,e.uniforms,this.renderer,Cv,e.buffer)}this.renderer.buffer.bindBufferBase(e.buffer,n.uniformBufferBindings[t])},r.prototype.createSyncBufferGroup=function(e,t,n){var i=this.renderer.gl;this.renderer.buffer.bind(e.buffer);var a=this.gl.getUniformBlockIndex(t.program,n);t.uniformBufferBindings[n]=this.shader.uniformBindCount,i.uniformBlockBinding(t.program,a,this.shader.uniformBindCount),this.shader.uniformBindCount++;var s=this.getSignature(e,this.shader.program.uniformData,"ubo"),o=this._uboCache[s];if(o||(o=this._uboCache[s]=gD(e,this.shader.program.uniformData)),e.autoManage){var l=new Float32Array(o.size/4);e.buffer.update(l)}return t.uniformGroups[e.id]=o.syncFunc,t.uniformGroups[e.id]},r.prototype.getSignature=function(e,t,n){var i=e.uniforms,a=[n+"-"];for(var s in i)a.push(s),t[s]&&a.push(t[s].type);return a.join("-")},r.prototype.getGlProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},r.prototype.generateProgram=function(e){var t=this.gl,n=e.program,i=yD(t,n);return n.glPrograms[this.renderer.CONTEXT_UID]=i,i},r.prototype.reset=function(){this.program=null,this.shader=null},r.prototype.disposeShader=function(e){this.shader===e&&(this.shader=null)},r.prototype.destroy=function(){this.renderer=null,this.destroyed=!0},r})();function oK(r,e){return e===void 0&&(e=[]),e[Et.NORMAL]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[Et.ADD]=[r.ONE,r.ONE],e[Et.MULTIPLY]=[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],e[Et.SCREEN]=[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],e[Et.OVERLAY]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[Et.DARKEN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[Et.LIGHTEN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[Et.COLOR_DODGE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[Et.COLOR_BURN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[Et.HARD_LIGHT]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[Et.SOFT_LIGHT]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[Et.DIFFERENCE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[Et.EXCLUSION]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[Et.HUE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[Et.SATURATION]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[Et.COLOR]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[Et.LUMINOSITY]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[Et.NONE]=[0,0],e[Et.NORMAL_NPM]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],e[Et.ADD_NPM]=[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],e[Et.SCREEN_NPM]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],e[Et.SRC_IN]=[r.DST_ALPHA,r.ZERO],e[Et.SRC_OUT]=[r.ONE_MINUS_DST_ALPHA,r.ZERO],e[Et.SRC_ATOP]=[r.DST_ALPHA,r.ONE_MINUS_SRC_ALPHA],e[Et.DST_OVER]=[r.ONE_MINUS_DST_ALPHA,r.ONE],e[Et.DST_IN]=[r.ZERO,r.SRC_ALPHA],e[Et.DST_OUT]=[r.ZERO,r.ONE_MINUS_SRC_ALPHA],e[Et.DST_ATOP]=[r.ONE_MINUS_DST_ALPHA,r.SRC_ALPHA],e[Et.XOR]=[r.ONE_MINUS_DST_ALPHA,r.ONE_MINUS_SRC_ALPHA],e[Et.SUBTRACT]=[r.ONE,r.ONE,r.ONE,r.ONE,r.FUNC_REVERSE_SUBTRACT,r.FUNC_ADD],e}var lK=0,uK=1,cK=2,hK=3,fK=4,dK=5,Xw=(function(){function r(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=Et.NONE,this._blendEq=!1,this.map=[],this.map[lK]=this.setBlend,this.map[uK]=this.setOffset,this.map[cK]=this.setCullFace,this.map[hK]=this.setDepthTest,this.map[fK]=this.setFrontFace,this.map[dK]=this.setDepthMask,this.checks=[],this.defaultState=new gl,this.defaultState.blend=!0}return r.prototype.contextChange=function(e){this.gl=e,this.blendModes=oK(e),this.set(this.defaultState),this.reset()},r.prototype.set=function(e){if(e=e||this.defaultState,this.stateId!==e.data){for(var t=this.stateId^e.data,n=0;t;)t&1&&this.map[n].call(this,!!(e.data&1<<n)),t=t>>1,n++;this.stateId=e.data}for(var n=0;n<this.checks.length;n++)this.checks[n](this,e)},r.prototype.forceState=function(e){e=e||this.defaultState;for(var t=0;t<this.map.length;t++)this.map[t].call(this,!!(e.data&1<<t));for(var t=0;t<this.checks.length;t++)this.checks[t](this,e);this.stateId=e.data},r.prototype.setBlend=function(e){this.updateCheck(r.checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)},r.prototype.setOffset=function(e){this.updateCheck(r.checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)},r.prototype.setDepthTest=function(e){this.gl[e?"enable":"disable"](this.gl.DEPTH_TEST)},r.prototype.setDepthMask=function(e){this.gl.depthMask(e)},r.prototype.setCullFace=function(e){this.gl[e?"enable":"disable"](this.gl.CULL_FACE)},r.prototype.setFrontFace=function(e){this.gl.frontFace(this.gl[e?"CW":"CCW"])},r.prototype.setBlendMode=function(e){if(e!==this.blendMode){this.blendMode=e;var t=this.blendModes[e],n=this.gl;t.length===2?n.blendFunc(t[0],t[1]):n.blendFuncSeparate(t[0],t[1],t[2],t[3]),t.length===6?(this._blendEq=!0,n.blendEquationSeparate(t[4],t[5])):this._blendEq&&(this._blendEq=!1,n.blendEquationSeparate(n.FUNC_ADD,n.FUNC_ADD))}},r.prototype.setPolygonOffset=function(e,t){this.gl.polygonOffset(e,t)},r.prototype.reset=function(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)},r.prototype.updateCheck=function(e,t){var n=this.checks.indexOf(e);t&&n===-1?this.checks.push(e):!t&&n!==-1&&this.checks.splice(n,1)},r.checkBlendMode=function(e,t){e.setBlendMode(t.blendMode)},r.checkPolygonOffset=function(e,t){e.setPolygonOffset(1,t.polygonOffset)},r.prototype.destroy=function(){this.gl=null},r})(),Yw=(function(){function r(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=ht.GC_MAX_IDLE,this.checkCountMax=ht.GC_MAX_CHECK_COUNT,this.mode=ht.GC_MODE}return r.prototype.postrender=function(){this.renderer.renderingToScreen&&(this.count++,this.mode!==od.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))},r.prototype.run=function(){for(var e=this.renderer.texture,t=e.managedTextures,n=!1,i=0;i<t.length;i++){var a=t[i];!a.framebuffer&&this.count-a.touched>this.maxIdle&&(e.destroyTexture(a,!0),t[i]=null,n=!0)}if(n){for(var s=0,i=0;i<t.length;i++)t[i]!==null&&(t[s++]=t[i]);t.length=s}},r.prototype.unload=function(e){var t=this.renderer.texture,n=e._texture;n&&!n.framebuffer&&t.destroyTexture(n);for(var i=e.children.length-1;i>=0;i--)this.unload(e.children[i])},r.prototype.destroy=function(){this.renderer=null},r})();function vK(r){var e,t,n,i,a,s,o,l,c,h,d,v,g,m,x,y,_,w,S,A,C,M,E;return"WebGL2RenderingContext"in globalThis&&r instanceof globalThis.WebGL2RenderingContext?E=(e={},e[wt.UNSIGNED_BYTE]=(t={},t[at.RGBA]=r.RGBA8,t[at.RGB]=r.RGB8,t[at.RG]=r.RG8,t[at.RED]=r.R8,t[at.RGBA_INTEGER]=r.RGBA8UI,t[at.RGB_INTEGER]=r.RGB8UI,t[at.RG_INTEGER]=r.RG8UI,t[at.RED_INTEGER]=r.R8UI,t[at.ALPHA]=r.ALPHA,t[at.LUMINANCE]=r.LUMINANCE,t[at.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,t),e[wt.BYTE]=(n={},n[at.RGBA]=r.RGBA8_SNORM,n[at.RGB]=r.RGB8_SNORM,n[at.RG]=r.RG8_SNORM,n[at.RED]=r.R8_SNORM,n[at.RGBA_INTEGER]=r.RGBA8I,n[at.RGB_INTEGER]=r.RGB8I,n[at.RG_INTEGER]=r.RG8I,n[at.RED_INTEGER]=r.R8I,n),e[wt.UNSIGNED_SHORT]=(i={},i[at.RGBA_INTEGER]=r.RGBA16UI,i[at.RGB_INTEGER]=r.RGB16UI,i[at.RG_INTEGER]=r.RG16UI,i[at.RED_INTEGER]=r.R16UI,i[at.DEPTH_COMPONENT]=r.DEPTH_COMPONENT16,i),e[wt.SHORT]=(a={},a[at.RGBA_INTEGER]=r.RGBA16I,a[at.RGB_INTEGER]=r.RGB16I,a[at.RG_INTEGER]=r.RG16I,a[at.RED_INTEGER]=r.R16I,a),e[wt.UNSIGNED_INT]=(s={},s[at.RGBA_INTEGER]=r.RGBA32UI,s[at.RGB_INTEGER]=r.RGB32UI,s[at.RG_INTEGER]=r.RG32UI,s[at.RED_INTEGER]=r.R32UI,s[at.DEPTH_COMPONENT]=r.DEPTH_COMPONENT24,s),e[wt.INT]=(o={},o[at.RGBA_INTEGER]=r.RGBA32I,o[at.RGB_INTEGER]=r.RGB32I,o[at.RG_INTEGER]=r.RG32I,o[at.RED_INTEGER]=r.R32I,o),e[wt.FLOAT]=(l={},l[at.RGBA]=r.RGBA32F,l[at.RGB]=r.RGB32F,l[at.RG]=r.RG32F,l[at.RED]=r.R32F,l[at.DEPTH_COMPONENT]=r.DEPTH_COMPONENT32F,l),e[wt.HALF_FLOAT]=(c={},c[at.RGBA]=r.RGBA16F,c[at.RGB]=r.RGB16F,c[at.RG]=r.RG16F,c[at.RED]=r.R16F,c),e[wt.UNSIGNED_SHORT_5_6_5]=(h={},h[at.RGB]=r.RGB565,h),e[wt.UNSIGNED_SHORT_4_4_4_4]=(d={},d[at.RGBA]=r.RGBA4,d),e[wt.UNSIGNED_SHORT_5_5_5_1]=(v={},v[at.RGBA]=r.RGB5_A1,v),e[wt.UNSIGNED_INT_2_10_10_10_REV]=(g={},g[at.RGBA]=r.RGB10_A2,g[at.RGBA_INTEGER]=r.RGB10_A2UI,g),e[wt.UNSIGNED_INT_10F_11F_11F_REV]=(m={},m[at.RGB]=r.R11F_G11F_B10F,m),e[wt.UNSIGNED_INT_5_9_9_9_REV]=(x={},x[at.RGB]=r.RGB9_E5,x),e[wt.UNSIGNED_INT_24_8]=(y={},y[at.DEPTH_STENCIL]=r.DEPTH24_STENCIL8,y),e[wt.FLOAT_32_UNSIGNED_INT_24_8_REV]=(_={},_[at.DEPTH_STENCIL]=r.DEPTH32F_STENCIL8,_),e):E=(w={},w[wt.UNSIGNED_BYTE]=(S={},S[at.RGBA]=r.RGBA,S[at.RGB]=r.RGB,S[at.ALPHA]=r.ALPHA,S[at.LUMINANCE]=r.LUMINANCE,S[at.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,S),w[wt.UNSIGNED_SHORT_5_6_5]=(A={},A[at.RGB]=r.RGB,A),w[wt.UNSIGNED_SHORT_4_4_4_4]=(C={},C[at.RGBA]=r.RGBA,C),w[wt.UNSIGNED_SHORT_5_5_5_1]=(M={},M[at.RGBA]=r.RGBA,M),w),E}var vp=(function(){function r(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=wt.UNSIGNED_BYTE,this.internalFormat=at.RGBA,this.samplerType=0}return r})(),Ww=(function(){function r(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new Wt,this.hasIntegerTextures=!1}return r.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=vK(e);var t=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=t;for(var n=0;n<t;n++)this.boundTextures[n]=null;this.emptyTextures={};var i=new vp(e.createTexture());e.bindTexture(e.TEXTURE_2D,i.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[e.TEXTURE_2D]=i,this.emptyTextures[e.TEXTURE_CUBE_MAP]=new vp(e.createTexture()),e.bindTexture(e.TEXTURE_CUBE_MAP,this.emptyTextures[e.TEXTURE_CUBE_MAP].texture);for(var n=0;n<6;n++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,null);e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MIN_FILTER,e.LINEAR);for(var n=0;n<this.boundTextures.length;n++)this.bind(null,n)},r.prototype.bind=function(e,t){t===void 0&&(t=0);var n=this.gl;if(e=e==null?void 0:e.castToBaseTexture(),e&&e.valid&&!e.parentTextureArray){e.touched=this.renderer.textureGC.count;var i=e._glTextures[this.CONTEXT_UID]||this.initTexture(e);this.boundTextures[t]!==e&&(this.currentLocation!==t&&(this.currentLocation=t,n.activeTexture(n.TEXTURE0+t)),n.bindTexture(e.target,i.texture)),i.dirtyId!==e.dirtyId?(this.currentLocation!==t&&(this.currentLocation=t,n.activeTexture(n.TEXTURE0+t)),this.updateTexture(e)):i.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(e),this.boundTextures[t]=e}else this.currentLocation!==t&&(this.currentLocation=t,n.activeTexture(n.TEXTURE0+t)),n.bindTexture(n.TEXTURE_2D,this.emptyTextures[n.TEXTURE_2D].texture),this.boundTextures[t]=null},r.prototype.reset=function(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(var e=0;e<this.boundTextures.length;e++)this.boundTextures[e]=this.unknownTexture},r.prototype.unbind=function(e){var t=this,n=t.gl,i=t.boundTextures;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(var a=0;a<i.length;a++)i[a]===this.unknownTexture&&this.bind(null,a)}for(var a=0;a<i.length;a++)i[a]===e&&(this.currentLocation!==a&&(n.activeTexture(n.TEXTURE0+a),this.currentLocation=a),n.bindTexture(e.target,this.emptyTextures[e.target].texture),i[a]=null)},r.prototype.ensureSamplerType=function(e){var t=this,n=t.boundTextures,i=t.hasIntegerTextures,a=t.CONTEXT_UID;if(i)for(var s=e-1;s>=0;--s){var o=n[s];if(o){var l=o._glTextures[a];l.samplerType!==sd.FLOAT&&this.renderer.texture.unbind(o)}}},r.prototype.initTexture=function(e){var t=new vp(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),t},r.prototype.initTextureType=function(e,t){var n,i;t.internalFormat=(i=(n=this.internalFormats[e.type])===null||n===void 0?void 0:n[e.format])!==null&&i!==void 0?i:e.format,this.webGLVersion===2&&e.type===wt.HALF_FLOAT?t.type=this.gl.HALF_FLOAT:t.type=e.type},r.prototype.updateTexture=function(e){var t=e._glTextures[this.CONTEXT_UID];if(t){var n=this.renderer;if(this.initTextureType(e,t),e.resource&&e.resource.upload(n,e,t))t.samplerType!==sd.FLOAT&&(this.hasIntegerTextures=!0);else{var i=e.realWidth,a=e.realHeight,s=n.gl;(t.width!==i||t.height!==a||t.dirtyId<0)&&(t.width=i,t.height=a,s.texImage2D(e.target,0,t.internalFormat,i,a,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}},r.prototype.destroyTexture=function(e,t){var n=this.gl;if(e=e.castToBaseTexture(),e._glTextures[this.CONTEXT_UID]&&(this.unbind(e),n.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){var i=this.managedTextures.indexOf(e);i!==-1&&lu(this.managedTextures,i,1)}},r.prototype.updateTextureStyle=function(e){var t=e._glTextures[this.CONTEXT_UID];t&&((e.mipmap===ba.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?t.mipmap=!1:t.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?t.wrapMode=Ia.CLAMP:t.wrapMode=e.wrapMode,e.resource&&e.resource.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)},r.prototype.setStyle=function(e,t){var n=this.gl;if(t.mipmap&&e.mipmap!==ba.ON_MANUAL&&n.generateMipmap(e.target),n.texParameteri(e.target,n.TEXTURE_WRAP_S,t.wrapMode),n.texParameteri(e.target,n.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===Da.LINEAR?n.LINEAR_MIPMAP_LINEAR:n.NEAREST_MIPMAP_NEAREST);var i=this.renderer.context.extensions.anisotropicFiltering;if(i&&e.anisotropicLevel>0&&e.scaleMode===Da.LINEAR){var a=Math.min(e.anisotropicLevel,n.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT));n.texParameterf(e.target,i.TEXTURE_MAX_ANISOTROPY_EXT,a)}}else n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===Da.LINEAR?n.LINEAR:n.NEAREST);n.texParameteri(e.target,n.TEXTURE_MAG_FILTER,e.scaleMode===Da.LINEAR?n.LINEAR:n.NEAREST)},r.prototype.destroy=function(){this.renderer=null},r})(),bD={__proto__:null,FilterSystem:Lw,BatchSystem:kw,ContextSystem:Bw,FramebufferSystem:Fw,GeometrySystem:zw,MaskSystem:Uw,ScissorSystem:Gw,StencilSystem:Hw,ProjectionSystem:jw,RenderTextureSystem:Vw,ShaderSystem:qw,StateSystem:Xw,TextureGCSystem:Yw,TextureSystem:Ww},ex=new qr,xD=(function(r){Ir(e,r);function e(t,n){t===void 0&&(t=Gc.UNKNOWN);var i=r.call(this)||this;return n=Object.assign({},ht.RENDER_OPTIONS,n),i.options=n,i.type=t,i.screen=new $t(0,0,n.width,n.height),i.view=n.view||ht.ADAPTER.createCanvas(),i.resolution=n.resolution||ht.RESOLUTION,i.useContextAlpha=n.useContextAlpha,i.autoDensity=!!n.autoDensity,i.preserveDrawingBuffer=n.preserveDrawingBuffer,i.clearBeforeRender=n.clearBeforeRender,i._backgroundColor=0,i._backgroundColorRgba=[0,0,0,1],i._backgroundColorString="#000000",i.backgroundColor=n.backgroundColor||i._backgroundColor,i.backgroundAlpha=n.backgroundAlpha,n.transparent!==void 0&&(fi("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),i.useContextAlpha=n.transparent,i.backgroundAlpha=n.transparent?0:1),i._lastObjectRendered=null,i.plugins={},i}return e.prototype.initPlugins=function(t){for(var n in t)this.plugins[n]=new t[n](this)},Object.defineProperty(e.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,n){this.view.width=Math.round(t*this.resolution),this.view.height=Math.round(n*this.resolution);var i=this.view.width/this.resolution,a=this.view.height/this.resolution;this.screen.width=i,this.screen.height=a,this.autoDensity&&(this.view.style.width=i+"px",this.view.style.height=a+"px"),this.emit("resize",i,a)},e.prototype.generateTexture=function(t,n,i,a){n===void 0&&(n={}),typeof n=="number"&&(fi("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),n={scaleMode:n,resolution:i,region:a});var s=n.region,o=R$(n,["region"]);a=s||t.getLocalBounds(null,!0),a.width===0&&(a.width=1),a.height===0&&(a.height=1);var l=nl.create(D4({width:a.width,height:a.height},o));return ex.tx=-a.x,ex.ty=-a.y,this.render(t,{renderTexture:l,clear:!1,transform:ex,skipUpdateTransform:!!t.parent}),l},e.prototype.destroy=function(t){for(var n in this.plugins)this.plugins[n].destroy(),this.plugins[n]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view);var i=this;i.plugins=null,i.type=Gc.UNKNOWN,i.view=null,i.screen=null,i._tempDisplayObjectParent=null,i.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=bw(t),pu(t,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(t){this._backgroundColorRgba[3]=t},enumerable:!1,configurable:!0}),e})(Ks),pK=(function(){function r(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}return r})(),gK=(function(){function r(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}return r.prototype.destroy=function(){this.renderer=null},r.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},r.prototype.bind=function(e){var t=this,n=t.gl,i=t.CONTEXT_UID,a=e._glBuffers[i]||this.createGLBuffer(e);n.bindBuffer(e.type,a.buffer)},r.prototype.bindBufferBase=function(e,t){var n=this,i=n.gl,a=n.CONTEXT_UID;if(this.boundBufferBases[t]!==e){var s=e._glBuffers[a]||this.createGLBuffer(e);this.boundBufferBases[t]=e,i.bindBufferBase(i.UNIFORM_BUFFER,t,s.buffer)}},r.prototype.bindBufferRange=function(e,t,n){var i=this,a=i.gl,s=i.CONTEXT_UID;n=n||0;var o=e._glBuffers[s]||this.createGLBuffer(e);a.bindBufferRange(a.UNIFORM_BUFFER,t||0,o.buffer,n*256,256)},r.prototype.update=function(e){var t=this,n=t.gl,i=t.CONTEXT_UID,a=e._glBuffers[i];if(e._updateID!==a.updateID)if(a.updateID=e._updateID,n.bindBuffer(e.type,a.buffer),a.byteLength>=e.data.byteLength)n.bufferSubData(e.type,0,e.data);else{var s=e.static?n.STATIC_DRAW:n.DYNAMIC_DRAW;a.byteLength=e.data.byteLength,n.bufferData(e.type,e.data,s)}},r.prototype.dispose=function(e,t){if(this.managedBuffers[e.id]){delete this.managedBuffers[e.id];var n=e._glBuffers[this.CONTEXT_UID],i=this.gl;e.disposeRunner.remove(this),n&&(t||i.deleteBuffer(n.buffer),delete e._glBuffers[this.CONTEXT_UID])}},r.prototype.disposeAll=function(e){for(var t=Object.keys(this.managedBuffers),n=0;n<t.length;n++)this.dispose(this.managedBuffers[t[n]],e)},r.prototype.createGLBuffer=function(e){var t=this,n=t.CONTEXT_UID,i=t.gl;return e._glBuffers[n]=new pK(i.createBuffer()),this.managedBuffers[e.id]=e,e.disposeRunner.add(this),e._glBuffers[n]},r})(),$w=(function(r){Ir(e,r);function e(t){var n=r.call(this,Gc.WEBGL,t)||this;return t=n.options,n.gl=null,n.CONTEXT_UID=0,n.runners={destroy:new Bn("destroy"),contextChange:new Bn("contextChange"),reset:new Bn("reset"),update:new Bn("update"),postrender:new Bn("postrender"),prerender:new Bn("prerender"),resize:new Bn("resize")},n.runners.contextChange.add(n),n.globalUniforms=new Yo({projectionMatrix:new qr},!0),n.addSystem(Uw,"mask").addSystem(Bw,"context").addSystem(Xw,"state").addSystem(qw,"shader").addSystem(Ww,"texture").addSystem(gK,"buffer").addSystem(zw,"geometry").addSystem(Fw,"framebuffer").addSystem(Gw,"scissor").addSystem(Hw,"stencil").addSystem(jw,"projection").addSystem(Yw,"textureGC").addSystem(Lw,"filter").addSystem(Vw,"renderTexture").addSystem(kw,"batch"),n.initPlugins(e.__plugins),n.multisample=void 0,t.context?n.context.initFromContext(t.context):n.context.initFromOptions({alpha:!!n.useContextAlpha,antialias:t.antialias,premultipliedAlpha:n.useContextAlpha&&n.useContextAlpha!=="notMultiplied",stencil:!0,preserveDrawingBuffer:t.preserveDrawingBuffer,powerPreference:n.options.powerPreference}),n.renderingToScreen=!0,zO(n.context.webGLVersion===2?"WebGL 2":"WebGL 1"),n.resize(n.options.width,n.options.height),n}return e.create=function(t){if(UO())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.contextChange=function(){var t=this.gl,n;if(this.context.webGLVersion===1){var i=t.getParameter(t.FRAMEBUFFER_BINDING);t.bindFramebuffer(t.FRAMEBUFFER,null),n=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.FRAMEBUFFER,i)}else{var i=t.getParameter(t.DRAW_FRAMEBUFFER_BINDING);t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),n=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,i)}n>=Fr.HIGH?this.multisample=Fr.HIGH:n>=Fr.MEDIUM?this.multisample=Fr.MEDIUM:n>=Fr.LOW?this.multisample=Fr.LOW:this.multisample=Fr.NONE},e.prototype.addSystem=function(t,n){var i=new t(this);if(this[n])throw new Error('Whoops! The name "'+n+'" is already in use');this[n]=i;for(var a in this.runners)this.runners[a].add(i);return this},e.prototype.render=function(t,n){var i,a,s,o;if(n&&(n instanceof nl?(fi("6.0.0","Renderer#render arguments changed, use options instead."),i=n,a=arguments[2],s=arguments[3],o=arguments[4]):(i=n.renderTexture,a=n.clear,s=n.transform,o=n.skipUpdateTransform)),this.renderingToScreen=!i,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=s,!this.context.isLost){if(i||(this._lastObjectRendered=t),!o){var l=t.enableTempParent();t.updateTransform(),t.disableTempParent(l)}this.renderTexture.bind(i),this.batch.currentRenderer.start(),(a!==void 0?a:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),i&&i.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},e.prototype.generateTexture=function(t,n,i,a){n===void 0&&(n={});var s=r.prototype.generateTexture.call(this,t,n,i,a);return this.framebuffer.blit(),s},e.prototype.resize=function(t,n){r.prototype.resize.call(this,t,n),this.runners.resize.emit(this.screen.height,this.screen.width)},e.prototype.reset=function(){return this.runners.reset.emit(),this},e.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},e.prototype.destroy=function(t){this.runners.destroy.emit();for(var n in this.runners)this.runners[n].destroy();r.prototype.destroy.call(this,t),this.gl=null},Object.defineProperty(e.prototype,"extract",{get:function(){return fi("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),e.registerPlugin=function(t,n){fi("6.5.0","Renderer.registerPlugin() has been deprecated, please use extensions.add() instead."),us.add({name:t,type:yr.RendererPlugin,ref:n})},e.__plugins={},e})(xD);us.handleByMap(yr.RendererPlugin,$w.__plugins);function _D(r){return $w.create(r)}var mK=`attribute vec2 aVertexPosition;
  816. attribute vec2 aTextureCoord;
  817. uniform mat3 projectionMatrix;
  818. varying vec2 vTextureCoord;
  819. void main(void)
  820. {
  821. gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
  822. vTextureCoord = aTextureCoord;
  823. }`,yK=`attribute vec2 aVertexPosition;
  824. uniform mat3 projectionMatrix;
  825. varying vec2 vTextureCoord;
  826. uniform vec4 inputSize;
  827. uniform vec4 outputFrame;
  828. vec4 filterVertexPosition( void )
  829. {
  830. vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
  831. return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
  832. }
  833. vec2 filterTextureCoord( void )
  834. {
  835. return aVertexPosition * (outputFrame.zw * inputSize.zw);
  836. }
  837. void main(void)
  838. {
  839. gl_Position = filterVertexPosition();
  840. vTextureCoord = filterTextureCoord();
  841. }
  842. `,wD=mK,Kw=yK,bK=(function(){function r(e){fi("6.1.0","System class is deprecated, implemement ISystem interface instead."),this.renderer=e}return r.prototype.destroy=function(){this.renderer=null},r})(),Up=(function(){function r(){this.texArray=null,this.blend=0,this.type=pa.TRIANGLES,this.start=0,this.size=0,this.data=null}return r})(),Gp=(function(){function r(){this.elements=[],this.ids=[],this.count=0}return r.prototype.clear=function(){for(var e=0;e<this.count;e++)this.elements[e]=null;this.count=0},r})(),Hp=(function(){function r(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}return Object.defineProperty(r.prototype,"int8View",{get:function(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"uint8View",{get:function(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"int16View",{get:function(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"uint16View",{get:function(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"int32View",{get:function(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View},enumerable:!1,configurable:!0}),r.prototype.view=function(e){return this[e+"View"]},r.prototype.destroy=function(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null},r.sizeOf=function(e){switch(e){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(e+" isn't a valid view type")}},r})(),SD=(function(r){Ir(e,r);function e(t){var n=r.call(this,t)||this;return n.shaderGenerator=null,n.geometryClass=null,n.vertexSize=null,n.state=gl.for2d(),n.size=ht.SPRITE_BATCH_SIZE*4,n._vertexCount=0,n._indexCount=0,n._bufferedElements=[],n._bufferedTextures=[],n._bufferSize=0,n._shader=null,n._packedGeometries=[],n._packedGeometryPoolSize=2,n._flushId=0,n._aBuffers={},n._iBuffers={},n.MAX_TEXTURES=1,n.renderer.on("prerender",n.onPrerender,n),t.runners.contextChange.add(n),n._dcIndex=0,n._aIndex=0,n._iIndex=0,n._attributeBuffer=null,n._indexBuffer=null,n._tempBoundTextures=[],n}return e.prototype.contextChange=function(){var t=this.renderer.gl;ht.PREFER_ENV===ns.WEBGL_LEGACY?this.MAX_TEXTURES=1:(this.MAX_TEXTURES=Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),ht.SPRITE_MAX_TEXTURES),this.MAX_TEXTURES=cD(this.MAX_TEXTURES,t)),this._shader=this.shaderGenerator.generateShader(this.MAX_TEXTURES);for(var n=0;n<this._packedGeometryPoolSize;n++)this._packedGeometries[n]=new this.geometryClass;this.initFlushBuffers()},e.prototype.initFlushBuffers=function(){for(var t=e._drawCallPool,n=e._textureArrayPool,i=this.size/4,a=Math.floor(i/this.MAX_TEXTURES)+1;t.length<i;)t.push(new Up);for(;n.length<a;)n.push(new Gp);for(var s=0;s<this.MAX_TEXTURES;s++)this._tempBoundTextures[s]=null},e.prototype.onPrerender=function(){this._flushId=0},e.prototype.render=function(t){t._texture.valid&&(this._vertexCount+t.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)},e.prototype.buildTexturesAndDrawCalls=function(){var t=this,n=t._bufferedTextures,i=t.MAX_TEXTURES,a=e._textureArrayPool,s=this.renderer.batch,o=this._tempBoundTextures,l=this.renderer.textureGC.count,c=++Wt._globalBatch,h=0,d=a[0],v=0;s.copyBoundTextures(o,i);for(var g=0;g<this._bufferSize;++g){var m=n[g];n[g]=null,m._batchEnabled!==c&&(d.count>=i&&(s.boundArray(d,o,c,i),this.buildDrawCalls(d,v,g),v=g,d=a[++h],++c),m._batchEnabled=c,m.touched=l,d.elements[d.count++]=m)}d.count>0&&(s.boundArray(d,o,c,i),this.buildDrawCalls(d,v,this._bufferSize),++h,++c);for(var g=0;g<o.length;g++)o[g]=null;Wt._globalBatch=c},e.prototype.buildDrawCalls=function(t,n,i){var a=this,s=a._bufferedElements,o=a._attributeBuffer,l=a._indexBuffer,c=a.vertexSize,h=e._drawCallPool,d=this._dcIndex,v=this._aIndex,g=this._iIndex,m=h[d];m.start=this._iIndex,m.texArray=t;for(var x=n;x<i;++x){var y=s[x],_=y._texture.baseTexture,w=_w[_.alphaMode?1:0][y.blendMode];s[x]=null,n<x&&m.blend!==w&&(m.size=g-m.start,n=x,m=h[++d],m.texArray=t,m.start=g),this.packInterleavedGeometry(y,o,l,v,g),v+=y.vertexData.length/2*c,g+=y.indices.length,m.blend=w}n<i&&(m.size=g-m.start,++d),this._dcIndex=d,this._aIndex=v,this._iIndex=g},e.prototype.bindAndClearTexArray=function(t){for(var n=this.renderer.texture,i=0;i<t.count;i++)n.bind(t.elements[i],t.ids[i]),t.elements[i]=null;t.count=0},e.prototype.updateGeometry=function(){var t=this,n=t._packedGeometries,i=t._attributeBuffer,a=t._indexBuffer;ht.CAN_UPLOAD_SAME_BUFFER?(n[this._flushId]._buffer.update(i.rawBinaryData),n[this._flushId]._indexBuffer.update(a),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,n[this._flushId]=new this.geometryClass),n[this._flushId]._buffer.update(i.rawBinaryData),n[this._flushId]._indexBuffer.update(a),this.renderer.geometry.bind(n[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)},e.prototype.drawBatches=function(){for(var t=this._dcIndex,n=this.renderer,i=n.gl,a=n.state,s=e._drawCallPool,o=null,l=0;l<t;l++){var c=s[l],h=c.texArray,d=c.type,v=c.size,g=c.start,m=c.blend;o!==h&&(o=h,this.bindAndClearTexArray(h)),this.state.blendMode=m,a.set(this.state),i.drawElements(d,v,i.UNSIGNED_SHORT,g*2)}},e.prototype.flush=function(){this._vertexCount!==0&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)},e.prototype.start=function(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.MAX_TEXTURES),this.renderer.shader.bind(this._shader),ht.CAN_UPLOAD_SAME_BUFFER&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])},e.prototype.stop=function(){this.flush()},e.prototype.destroy=function(){for(var t=0;t<this._packedGeometryPoolSize;t++)this._packedGeometries[t]&&this._packedGeometries[t].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),r.prototype.destroy.call(this)},e.prototype.getAttributeBuffer=function(t){var n=ld(Math.ceil(t/8)),i=T4(n),a=n*8;this._aBuffers.length<=i&&(this._iBuffers.length=i+1);var s=this._aBuffers[a];return s||(this._aBuffers[a]=s=new Hp(a*this.vertexSize*4)),s},e.prototype.getIndexBuffer=function(t){var n=ld(Math.ceil(t/12)),i=T4(n),a=n*12;this._iBuffers.length<=i&&(this._iBuffers.length=i+1);var s=this._iBuffers[i];return s||(this._iBuffers[i]=s=new Uint16Array(a)),s},e.prototype.packInterleavedGeometry=function(t,n,i,a,s){for(var o=n.uint32View,l=n.float32View,c=a/this.vertexSize,h=t.uvs,d=t.indices,v=t.vertexData,g=t._texture.baseTexture._batchLocation,m=Math.min(t.worldAlpha,1),x=m<1&&t._texture.baseTexture.alphaMode?Sg(t._tintRGB,m):t._tintRGB+(m*255<<24),y=0;y<v.length;y+=2)l[a++]=v[y],l[a++]=v[y+1],l[a++]=h[y],l[a++]=h[y+1],o[a++]=x,l[a++]=g;for(var y=0;y<d.length;y++)i[s++]=c+d[y]},e._drawCallPool=[],e._textureArrayPool=[],e})(kd),ED=(function(){function r(e,t){if(this.vertexSrc=e,this.fragTemplate=t,this.programCache={},this.defaultGroupCache={},t.indexOf("%count%")<0)throw new Error('Fragment template must contain "%count%".');if(t.indexOf("%forloop%")<0)throw new Error('Fragment template must contain "%forloop%".')}return r.prototype.generateShader=function(e){if(!this.programCache[e]){for(var t=new Int32Array(e),n=0;n<e;n++)t[n]=n;this.defaultGroupCache[e]=Yo.from({uSamplers:t},!0);var i=this.fragTemplate;i=i.replace(/%count%/gi,""+e),i=i.replace(/%forloop%/gi,this.generateSampleSrc(e)),this.programCache[e]=new sh(this.vertexSrc,i)}var a={tint:new Float32Array([1,1,1,1]),translationMatrix:new qr,default:this.defaultGroupCache[e]};return new Gs(this.programCache[e],a)},r.prototype.generateSampleSrc=function(e){var t="";t+=`
  843. `,t+=`
  844. `;for(var n=0;n<e;n++)n>0&&(t+=`
  845. else `),n<e-1&&(t+="if(vTextureId < "+n+".5)"),t+=`
  846. {`,t+=`
  847. color = texture2D(uSamplers[`+n+"], vTextureCoord);",t+=`
  848. }`;return t+=`
  849. `,t+=`
  850. `,t},r})(),Zw=(function(r){Ir(e,r);function e(t){t===void 0&&(t=!1);var n=r.call(this)||this;return n._buffer=new wn(null,t,!1),n._indexBuffer=new wn(null,t,!0),n.addAttribute("aVertexPosition",n._buffer,2,!1,wt.FLOAT).addAttribute("aTextureCoord",n._buffer,2,!1,wt.FLOAT).addAttribute("aColor",n._buffer,4,!0,wt.UNSIGNED_BYTE).addAttribute("aTextureId",n._buffer,1,!0,wt.FLOAT).addIndex(n._indexBuffer),n}return e})(ah),eA=`precision highp float;
  851. attribute vec2 aVertexPosition;
  852. attribute vec2 aTextureCoord;
  853. attribute vec4 aColor;
  854. attribute float aTextureId;
  855. uniform mat3 projectionMatrix;
  856. uniform mat3 translationMatrix;
  857. uniform vec4 tint;
  858. varying vec2 vTextureCoord;
  859. varying vec4 vColor;
  860. varying float vTextureId;
  861. void main(void){
  862. gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
  863. vTextureCoord = aTextureCoord;
  864. vTextureId = aTextureId;
  865. vColor = aColor * tint;
  866. }
  867. `,tA=`varying vec2 vTextureCoord;
  868. varying vec4 vColor;
  869. varying float vTextureId;
  870. uniform sampler2D uSamplers[%count%];
  871. void main(void){
  872. vec4 color;
  873. %forloop%
  874. gl_FragColor = color * vColor;
  875. }
  876. `,TD=(function(){function r(){}return r.create=function(e){var t=Object.assign({vertex:eA,fragment:tA,geometryClass:Zw,vertexSize:6},e),n=t.vertex,i=t.fragment,a=t.vertexSize,s=t.geometryClass;return(function(o){Ir(l,o);function l(c){var h=o.call(this,c)||this;return h.shaderGenerator=new ED(n,i),h.geometryClass=s,h.vertexSize=a,h}return l})(SD)},Object.defineProperty(r,"defaultVertexSrc",{get:function(){return eA},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultFragmentTemplate",{get:function(){return tA},enumerable:!1,configurable:!0}),r})(),Qw=TD.create();Object.assign(Qw,{extension:{name:"batch",type:yr.RendererPlugin}});var CD={},xK=function(r){Object.defineProperty(CD,r,{get:function(){return fi("6.0.0","PIXI.systems."+r+" has moved to PIXI."+r),JO[r]}})};for(var Jw in JO)xK(Jw);var AD={},_K=function(r){Object.defineProperty(AD,r,{get:function(){return fi("6.0.0","PIXI.resources."+r+" has moved to PIXI."+r),bD[r]}})};for(var Jw in bD)_K(Jw);var wK="6.5.10";/*!
  877. * @pixi/accessibility - v6.5.10
  878. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  879. *
  880. * @pixi/accessibility is licensed under the MIT License.
  881. * http://www.opensource.org/licenses/mit-license
  882. */var MD={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};ln.mixin(MD);var SK=9,Av=100,EK=0,TK=0,rA=2,nA=1,CK=-1e3,AK=-1e3,MK=2,RD=(function(){function r(e){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(ga.tablet||ga.phone)&&this.createTouchHook();var t=document.createElement("div");t.style.width=Av+"px",t.style.height=Av+"px",t.style.position="absolute",t.style.top=EK+"px",t.style.left=TK+"px",t.style.zIndex=rA.toString(),this.div=t,this.renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}return Object.defineProperty(r.prototype,"isActive",{get:function(){return this._isActive},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isMobileAccessibility",{get:function(){return this._isMobileAccessibility},enumerable:!1,configurable:!0}),r.prototype.createTouchHook=function(){var e=this,t=document.createElement("button");t.style.width=nA+"px",t.style.height=nA+"px",t.style.position="absolute",t.style.top=CK+"px",t.style.left=AK+"px",t.style.zIndex=MK.toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",function(){e._isMobileAccessibility=!0,e.activate(),e.destroyTouchHook()}),document.body.appendChild(t),this._hookDiv=t},r.prototype.destroyTouchHook=function(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)},r.prototype.activate=function(){var e;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),(e=this.renderer.view.parentNode)===null||e===void 0||e.appendChild(this.div))},r.prototype.deactivate=function(){var e;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),(e=this.div.parentNode)===null||e===void 0||e.removeChild(this.div))},r.prototype.updateAccessibleObjects=function(e){if(!(!e.visible||!e.accessibleChildren)){e.accessible&&e.interactive&&(e._accessibleActive||this.addChild(e),e.renderId=this.renderId);var t=e.children;if(t)for(var n=0;n<t.length;n++)this.updateAccessibleObjects(t[n])}},r.prototype.update=function(){var e=performance.now();if(!(ga.android.device&&e<this.androidUpdateCount)&&(this.androidUpdateCount=e+this.androidUpdateFrequency,!!this.renderer.renderingToScreen)){this.renderer._lastObjectRendered&&this.updateAccessibleObjects(this.renderer._lastObjectRendered);var t=this.renderer.view.getBoundingClientRect(),n=t.left,i=t.top,a=t.width,s=t.height,o=this.renderer,l=o.width,c=o.height,h=o.resolution,d=a/l*h,v=s/c*h,g=this.div;g.style.left=n+"px",g.style.top=i+"px",g.style.width=l+"px",g.style.height=c+"px";for(var m=0;m<this.children.length;m++){var x=this.children[m];if(x.renderId!==this.renderId)x._accessibleActive=!1,lu(this.children,m,1),this.div.removeChild(x._accessibleDiv),this.pool.push(x._accessibleDiv),x._accessibleDiv=null,m--;else{g=x._accessibleDiv;var y=x.hitArea,_=x.worldTransform;x.hitArea?(g.style.left=(_.tx+y.x*_.a)*d+"px",g.style.top=(_.ty+y.y*_.d)*v+"px",g.style.width=y.width*_.a*d+"px",g.style.height=y.height*_.d*v+"px"):(y=x.getBounds(),this.capHitArea(y),g.style.left=y.x*d+"px",g.style.top=y.y*v+"px",g.style.width=y.width*d+"px",g.style.height=y.height*v+"px",g.title!==x.accessibleTitle&&x.accessibleTitle!==null&&(g.title=x.accessibleTitle),g.getAttribute("aria-label")!==x.accessibleHint&&x.accessibleHint!==null&&g.setAttribute("aria-label",x.accessibleHint)),(x.accessibleTitle!==g.title||x.tabIndex!==g.tabIndex)&&(g.title=x.accessibleTitle,g.tabIndex=x.tabIndex,this.debug&&this.updateDebugHTML(g))}}this.renderId++}},r.prototype.updateDebugHTML=function(e){e.innerHTML="type: "+e.type+"</br> title : "+e.title+"</br> tabIndex: "+e.tabIndex},r.prototype.capHitArea=function(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);var t=this.renderer,n=t.width,i=t.height;e.x+e.width>n&&(e.width=n-e.x),e.y+e.height>i&&(e.height=i-e.y)},r.prototype.addChild=function(e){var t=this.pool.pop();t||(t=document.createElement("button"),t.style.width=Av+"px",t.style.height=Av+"px",t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=rA.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title="displayObject "+e.tabIndex),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this.updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex},r.prototype._onClick=function(e){var t=this.renderer.plugins.interaction,n=e.target.displayObject,i=t.eventData;t.dispatchEvent(n,"click",i),t.dispatchEvent(n,"pointertap",i),t.dispatchEvent(n,"tap",i)},r.prototype._onFocus=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive");var t=this.renderer.plugins.interaction,n=e.target.displayObject,i=t.eventData;t.dispatchEvent(n,"mouseover",i)},r.prototype._onFocusOut=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite");var t=this.renderer.plugins.interaction,n=e.target.displayObject,i=t.eventData;t.dispatchEvent(n,"mouseout",i)},r.prototype._onKeyDown=function(e){e.keyCode===SK&&this.activate()},r.prototype._onMouseMove=function(e){e.movementX===0&&e.movementY===0||this.deactivate()},r.prototype.destroy=function(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},r.extension={name:"accessibility",type:[yr.RendererPlugin,yr.CanvasRendererPlugin]},r})();/*!
  883. * @pixi/interaction - v6.5.10
  884. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  885. *
  886. * @pixi/interaction is licensed under the MIT License.
  887. * http://www.opensource.org/licenses/mit-license
  888. */var I4=(function(){function r(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new Ar,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0}return Object.defineProperty(r.prototype,"pointerId",{get:function(){return this.identifier},enumerable:!1,configurable:!0}),r.prototype.getLocalPosition=function(e,t,n){return e.worldTransform.applyInverse(n||this.global,t)},r.prototype.copyEvent=function(e){"isPrimary"in e&&e.isPrimary&&(this.isPrimary=!0),this.button="button"in e&&e.button;var t="buttons"in e&&e.buttons;this.buttons=Number.isInteger(t)?t:"which"in e&&e.which,this.width="width"in e&&e.width,this.height="height"in e&&e.height,this.tiltX="tiltX"in e&&e.tiltX,this.tiltY="tiltY"in e&&e.tiltY,this.pointerType="pointerType"in e&&e.pointerType,this.pressure="pressure"in e&&e.pressure,this.rotationAngle="rotationAngle"in e&&e.rotationAngle,this.twist="twist"in e&&e.twist||0,this.tangentialPressure="tangentialPressure"in e&&e.tangentialPressure||0},r.prototype.reset=function(){this.isPrimary=!1},r})();/*! *****************************************************************************
  889. Copyright (c) Microsoft Corporation.
  890. Permission to use, copy, modify, and/or distribute this software for any
  891. purpose with or without fee is hereby granted.
  892. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  893. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  894. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  895. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  896. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  897. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  898. PERFORMANCE OF THIS SOFTWARE.
  899. ***************************************************************************** */var N4=function(r,e){return N4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},N4(r,e)};function RK(r,e){N4(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var OD=(function(){function r(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return r.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},r.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},r})(),pp=(function(){function r(e){this._pointerId=e,this._flags=r.FLAGS.NONE}return r.prototype._doSet=function(e,t){t?this._flags=this._flags|e:this._flags=this._flags&~e},Object.defineProperty(r.prototype,"pointerId",{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"flags",{get:function(){return this._flags},set:function(e){this._flags=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"none",{get:function(){return this._flags===r.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"over",{get:function(){return(this._flags&r.FLAGS.OVER)!==0},set:function(e){this._doSet(r.FLAGS.OVER,e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"rightDown",{get:function(){return(this._flags&r.FLAGS.RIGHT_DOWN)!==0},set:function(e){this._doSet(r.FLAGS.RIGHT_DOWN,e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"leftDown",{get:function(){return(this._flags&r.FLAGS.LEFT_DOWN)!==0},set:function(e){this._doSet(r.FLAGS.LEFT_DOWN,e)},enumerable:!1,configurable:!0}),r.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4}),r})(),OK=(function(){function r(){this._tempPoint=new Ar}return r.prototype.recursiveFindHit=function(e,t,n,i,a){var s;if(!t||!t.visible)return!1;var o=e.data.global;a=t.interactive||a;var l=!1,c=a,h=!0;if(t.hitArea)i&&(t.worldTransform.applyInverse(o,this._tempPoint),t.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?l=!0:(i=!1,h=!1)),c=!1;else if(t._mask&&i){var d=t._mask.isMaskData?t._mask.maskObject:t._mask;d&&!(!((s=d.containsPoint)===null||s===void 0)&&s.call(d,o))&&(i=!1)}if(h&&t.interactiveChildren&&t.children)for(var v=t.children,g=v.length-1;g>=0;g--){var m=v[g],x=this.recursiveFindHit(e,m,n,i,c);if(x){if(!m.parent)continue;c=!1,x&&(e.target&&(i=!1),l=!0)}}return a&&(i&&!e.target&&!t.hitArea&&t.containsPoint&&t.containsPoint(o)&&(l=!0),t.interactive&&(l&&!e.target&&(e.target=t),n&&n(e,t,!!l))),l},r.prototype.findHit=function(e,t,n,i){this.recursiveFindHit(e,t,n,i,!1)},r})(),DD={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return this.cursor==="pointer"},set buttonMode(r){r?this.cursor="pointer":this.cursor==="pointer"&&(this.cursor=null)},cursor:null,get trackedPointers(){return this._trackedPointers===void 0&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};ln.mixin(DD);var Mv=1,Rv={target:null,data:{global:null}},PD=(function(r){RK(e,r);function e(t,n){var i=r.call(this)||this;return n=n||{},i.renderer=t,i.autoPreventDefault=n.autoPreventDefault!==void 0?n.autoPreventDefault:!0,i.interactionFrequency=n.interactionFrequency||10,i.mouse=new I4,i.mouse.identifier=Mv,i.mouse.global.set(-999999),i.activeInteractionData={},i.activeInteractionData[Mv]=i.mouse,i.interactionDataPool=[],i.eventData=new OD,i.interactionDOMElement=null,i.moveWhenInside=!1,i.eventsAdded=!1,i.tickerAdded=!1,i.mouseOverRenderer=!("PointerEvent"in globalThis),i.supportsTouchEvents="ontouchstart"in globalThis,i.supportsPointerEvents=!!globalThis.PointerEvent,i.onPointerUp=i.onPointerUp.bind(i),i.processPointerUp=i.processPointerUp.bind(i),i.onPointerCancel=i.onPointerCancel.bind(i),i.processPointerCancel=i.processPointerCancel.bind(i),i.onPointerDown=i.onPointerDown.bind(i),i.processPointerDown=i.processPointerDown.bind(i),i.onPointerMove=i.onPointerMove.bind(i),i.processPointerMove=i.processPointerMove.bind(i),i.onPointerOut=i.onPointerOut.bind(i),i.processPointerOverOut=i.processPointerOverOut.bind(i),i.onPointerOver=i.onPointerOver.bind(i),i.cursorStyles={default:"inherit",pointer:"pointer"},i.currentCursorMode=null,i.cursor=null,i.resolution=1,i.delayedEvents=[],i.search=new OK,i._tempDisplayObject=new Tw,i._eventListenerOptions={capture:!0,passive:!1},i._useSystemTicker=n.useSystemTicker!==void 0?n.useSystemTicker:!0,i.setTargetElement(i.renderer.view,i.renderer.resolution),i}return Object.defineProperty(e.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(t){this._useSystemTicker=t,t?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),e.prototype.hitTest=function(t,n){return Rv.target=null,Rv.data.global=t,n||(n=this.lastObjectRendered),this.processInteractive(Rv,n,null,!0),Rv.target},e.prototype.setTargetElement=function(t,n){n===void 0&&(n=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=t,this.resolution=n,this.addEvents(),this.addTickerListener()},e.prototype.addTickerListener=function(){this.tickerAdded||!this.interactionDOMElement||!this._useSystemTicker||(Fn.system.add(this.tickerUpdate,this,is.INTERACTION),this.tickerAdded=!0)},e.prototype.removeTickerListener=function(){this.tickerAdded&&(Fn.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},e.prototype.addEvents=function(){if(!(this.eventsAdded||!this.interactionDOMElement)){var t=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none"),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.addEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},e.prototype.removeEvents=function(){if(!(!this.eventsAdded||!this.interactionDOMElement)){var t=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.removeEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},e.prototype.tickerUpdate=function(t){this._deltaTime+=t,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this.update())},e.prototype.update=function(){if(this.interactionDOMElement){if(this._didMove){this._didMove=!1;return}this.cursor=null;for(var t in this.activeInteractionData)if(this.activeInteractionData.hasOwnProperty(t)){var n=this.activeInteractionData[t];if(n.originalEvent&&n.pointerType!=="touch"){var i=this.configureInteractionEventForDOMEvent(this.eventData,n.originalEvent,n);this.processInteractive(i,this.lastObjectRendered,this.processPointerOverOut,!0)}}this.setCursorMode(this.cursor)}},e.prototype.setCursorMode=function(t){t=t||"default";var n=!0;if(globalThis.OffscreenCanvas&&this.interactionDOMElement instanceof OffscreenCanvas&&(n=!1),this.currentCursorMode!==t){this.currentCursorMode=t;var i=this.cursorStyles[t];if(i)switch(typeof i){case"string":n&&(this.interactionDOMElement.style.cursor=i);break;case"function":i(t);break;case"object":n&&Object.assign(this.interactionDOMElement.style,i);break}else n&&typeof t=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.interactionDOMElement.style.cursor=t)}},e.prototype.dispatchEvent=function(t,n,i){(!i.stopPropagationHint||t===i.stopsPropagatingAt)&&(i.currentTarget=t,i.type=n,t.emit(n,i),t[n]&&t[n](i))},e.prototype.delayDispatchEvent=function(t,n,i){this.delayedEvents.push({displayObject:t,eventString:n,eventData:i})},e.prototype.mapPositionToPoint=function(t,n,i){var a;this.interactionDOMElement.parentElement?a=this.interactionDOMElement.getBoundingClientRect():a={x:0,y:0,width:this.interactionDOMElement.width,height:this.interactionDOMElement.height,left:0,top:0};var s=1/this.resolution;t.x=(n-a.left)*(this.interactionDOMElement.width/a.width)*s,t.y=(i-a.top)*(this.interactionDOMElement.height/a.height)*s},e.prototype.processInteractive=function(t,n,i,a){var s=this.search.findHit(t,n,i,a),o=this.delayedEvents;if(!o.length)return s;t.stopPropagationHint=!1;var l=o.length;this.delayedEvents=[];for(var c=0;c<l;c++){var h=o[c],d=h.displayObject,v=h.eventString,g=h.eventData;g.stopsPropagatingAt===d&&(g.stopPropagationHint=!0),this.dispatchEvent(d,v,g)}return s},e.prototype.onPointerDown=function(t){if(!(this.supportsTouchEvents&&t.pointerType==="touch")){var n=this.normalizeToPointerData(t);if(this.autoPreventDefault&&n[0].isNormalized){var i=t.cancelable||!("cancelable"in t);i&&t.preventDefault()}for(var a=n.length,s=0;s<a;s++){var o=n[s],l=this.getInteractionDataForPointerId(o),c=this.configureInteractionEventForDOMEvent(this.eventData,o,l);if(c.data.originalEvent=t,this.processInteractive(c,this.lastObjectRendered,this.processPointerDown,!0),this.emit("pointerdown",c),o.pointerType==="touch")this.emit("touchstart",c);else if(o.pointerType==="mouse"||o.pointerType==="pen"){var h=o.button===2;this.emit(h?"rightdown":"mousedown",this.eventData)}}}},e.prototype.processPointerDown=function(t,n,i){var a=t.data,s=t.data.identifier;if(i){if(n.trackedPointers[s]||(n.trackedPointers[s]=new pp(s)),this.dispatchEvent(n,"pointerdown",t),a.pointerType==="touch")this.dispatchEvent(n,"touchstart",t);else if(a.pointerType==="mouse"||a.pointerType==="pen"){var o=a.button===2;o?n.trackedPointers[s].rightDown=!0:n.trackedPointers[s].leftDown=!0,this.dispatchEvent(n,o?"rightdown":"mousedown",t)}}},e.prototype.onPointerComplete=function(t,n,i){var a=this.normalizeToPointerData(t),s=a.length,o=t.target;t.composedPath&&t.composedPath().length>0&&(o=t.composedPath()[0]);for(var l=o!==this.interactionDOMElement?"outside":"",c=0;c<s;c++){var h=a[c],d=this.getInteractionDataForPointerId(h),v=this.configureInteractionEventForDOMEvent(this.eventData,h,d);if(v.data.originalEvent=t,this.processInteractive(v,this.lastObjectRendered,i,n||!l),this.emit(n?"pointercancel":"pointerup"+l,v),h.pointerType==="mouse"||h.pointerType==="pen"){var g=h.button===2;this.emit(g?"rightup"+l:"mouseup"+l,v)}else h.pointerType==="touch"&&(this.emit(n?"touchcancel":"touchend"+l,v),this.releaseInteractionDataForPointerId(h.pointerId))}},e.prototype.onPointerCancel=function(t){this.supportsTouchEvents&&t.pointerType==="touch"||this.onPointerComplete(t,!0,this.processPointerCancel)},e.prototype.processPointerCancel=function(t,n){var i=t.data,a=t.data.identifier;n.trackedPointers[a]!==void 0&&(delete n.trackedPointers[a],this.dispatchEvent(n,"pointercancel",t),i.pointerType==="touch"&&this.dispatchEvent(n,"touchcancel",t))},e.prototype.onPointerUp=function(t){this.supportsTouchEvents&&t.pointerType==="touch"||this.onPointerComplete(t,!1,this.processPointerUp)},e.prototype.processPointerUp=function(t,n,i){var a=t.data,s=t.data.identifier,o=n.trackedPointers[s],l=a.pointerType==="touch",c=a.pointerType==="mouse"||a.pointerType==="pen",h=!1;if(c){var d=a.button===2,v=pp.FLAGS,g=d?v.RIGHT_DOWN:v.LEFT_DOWN,m=o!==void 0&&o.flags&g;i?(this.dispatchEvent(n,d?"rightup":"mouseup",t),m&&(this.dispatchEvent(n,d?"rightclick":"click",t),h=!0)):m&&this.dispatchEvent(n,d?"rightupoutside":"mouseupoutside",t),o&&(d?o.rightDown=!1:o.leftDown=!1)}i?(this.dispatchEvent(n,"pointerup",t),l&&this.dispatchEvent(n,"touchend",t),o&&((!c||h)&&this.dispatchEvent(n,"pointertap",t),l&&(this.dispatchEvent(n,"tap",t),o.over=!1))):o&&(this.dispatchEvent(n,"pointerupoutside",t),l&&this.dispatchEvent(n,"touchendoutside",t)),o&&o.none&&delete n.trackedPointers[s]},e.prototype.onPointerMove=function(t){if(!(this.supportsTouchEvents&&t.pointerType==="touch")){var n=this.normalizeToPointerData(t);(n[0].pointerType==="mouse"||n[0].pointerType==="pen")&&(this._didMove=!0,this.cursor=null);for(var i=n.length,a=0;a<i;a++){var s=n[a],o=this.getInteractionDataForPointerId(s),l=this.configureInteractionEventForDOMEvent(this.eventData,s,o);l.data.originalEvent=t,this.processInteractive(l,this.lastObjectRendered,this.processPointerMove,!0),this.emit("pointermove",l),s.pointerType==="touch"&&this.emit("touchmove",l),(s.pointerType==="mouse"||s.pointerType==="pen")&&this.emit("mousemove",l)}n[0].pointerType==="mouse"&&this.setCursorMode(this.cursor)}},e.prototype.processPointerMove=function(t,n,i){var a=t.data,s=a.pointerType==="touch",o=a.pointerType==="mouse"||a.pointerType==="pen";o&&this.processPointerOverOut(t,n,i),(!this.moveWhenInside||i)&&(this.dispatchEvent(n,"pointermove",t),s&&this.dispatchEvent(n,"touchmove",t),o&&this.dispatchEvent(n,"mousemove",t))},e.prototype.onPointerOut=function(t){if(!(this.supportsTouchEvents&&t.pointerType==="touch")){var n=this.normalizeToPointerData(t),i=n[0];i.pointerType==="mouse"&&(this.mouseOverRenderer=!1,this.setCursorMode(null));var a=this.getInteractionDataForPointerId(i),s=this.configureInteractionEventForDOMEvent(this.eventData,i,a);s.data.originalEvent=i,this.processInteractive(s,this.lastObjectRendered,this.processPointerOverOut,!1),this.emit("pointerout",s),i.pointerType==="mouse"||i.pointerType==="pen"?this.emit("mouseout",s):this.releaseInteractionDataForPointerId(a.identifier)}},e.prototype.processPointerOverOut=function(t,n,i){var a=t.data,s=t.data.identifier,o=a.pointerType==="mouse"||a.pointerType==="pen",l=n.trackedPointers[s];i&&!l&&(l=n.trackedPointers[s]=new pp(s)),l!==void 0&&(i&&this.mouseOverRenderer?(l.over||(l.over=!0,this.delayDispatchEvent(n,"pointerover",t),o&&this.delayDispatchEvent(n,"mouseover",t)),o&&this.cursor===null&&(this.cursor=n.cursor)):l.over&&(l.over=!1,this.dispatchEvent(n,"pointerout",this.eventData),o&&this.dispatchEvent(n,"mouseout",t),l.none&&delete n.trackedPointers[s]))},e.prototype.onPointerOver=function(t){if(!(this.supportsTouchEvents&&t.pointerType==="touch")){var n=this.normalizeToPointerData(t),i=n[0],a=this.getInteractionDataForPointerId(i),s=this.configureInteractionEventForDOMEvent(this.eventData,i,a);s.data.originalEvent=i,i.pointerType==="mouse"&&(this.mouseOverRenderer=!0),this.emit("pointerover",s),(i.pointerType==="mouse"||i.pointerType==="pen")&&this.emit("mouseover",s)}},e.prototype.getInteractionDataForPointerId=function(t){var n=t.pointerId,i;return n===Mv||t.pointerType==="mouse"?i=this.mouse:this.activeInteractionData[n]?i=this.activeInteractionData[n]:(i=this.interactionDataPool.pop()||new I4,i.identifier=n,this.activeInteractionData[n]=i),i.copyEvent(t),i},e.prototype.releaseInteractionDataForPointerId=function(t){var n=this.activeInteractionData[t];n&&(delete this.activeInteractionData[t],n.reset(),this.interactionDataPool.push(n))},e.prototype.configureInteractionEventForDOMEvent=function(t,n,i){return t.data=i,this.mapPositionToPoint(i.global,n.clientX,n.clientY),n.pointerType==="touch"&&(n.globalX=i.global.x,n.globalY=i.global.y),i.originalEvent=n,t.reset(),t},e.prototype.normalizeToPointerData=function(t){var n=[];if(this.supportsTouchEvents&&t instanceof TouchEvent)for(var i=0,a=t.changedTouches.length;i<a;i++){var s=t.changedTouches[i];typeof s.button>"u"&&(s.button=t.touches.length?1:0),typeof s.buttons>"u"&&(s.buttons=t.touches.length?1:0),typeof s.isPrimary>"u"&&(s.isPrimary=t.touches.length===1&&t.type==="touchstart"),typeof s.width>"u"&&(s.width=s.radiusX||1),typeof s.height>"u"&&(s.height=s.radiusY||1),typeof s.tiltX>"u"&&(s.tiltX=0),typeof s.tiltY>"u"&&(s.tiltY=0),typeof s.pointerType>"u"&&(s.pointerType="touch"),typeof s.pointerId>"u"&&(s.pointerId=s.identifier||0),typeof s.pressure>"u"&&(s.pressure=s.force||.5),typeof s.twist>"u"&&(s.twist=0),typeof s.tangentialPressure>"u"&&(s.tangentialPressure=0),typeof s.layerX>"u"&&(s.layerX=s.offsetX=s.clientX),typeof s.layerY>"u"&&(s.layerY=s.offsetY=s.clientY),s.isNormalized=!0,n.push(s)}else if(!globalThis.MouseEvent||t instanceof MouseEvent&&(!this.supportsPointerEvents||!(t instanceof globalThis.PointerEvent))){var o=t;typeof o.isPrimary>"u"&&(o.isPrimary=!0),typeof o.width>"u"&&(o.width=1),typeof o.height>"u"&&(o.height=1),typeof o.tiltX>"u"&&(o.tiltX=0),typeof o.tiltY>"u"&&(o.tiltY=0),typeof o.pointerType>"u"&&(o.pointerType="mouse"),typeof o.pointerId>"u"&&(o.pointerId=Mv),typeof o.pressure>"u"&&(o.pressure=.5),typeof o.twist>"u"&&(o.twist=0),typeof o.tangentialPressure>"u"&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},e.prototype.destroy=function(){this.removeEvents(),this.removeTickerListener(),this.removeAllListeners(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactionDOMElement=null,this.onPointerDown=null,this.processPointerDown=null,this.onPointerUp=null,this.processPointerUp=null,this.onPointerCancel=null,this.processPointerCancel=null,this.onPointerMove=null,this.processPointerMove=null,this.onPointerOut=null,this.processPointerOverOut=null,this.onPointerOver=null,this.search=null},e.extension={name:"interaction",type:[yr.RendererPlugin,yr.CanvasRendererPlugin]},e})(Ks);/*!
  900. * @pixi/extract - v6.5.10
  901. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  902. *
  903. * @pixi/extract is licensed under the MIT License.
  904. * http://www.opensource.org/licenses/mit-license
  905. */var DK=new $t,PK=4,ID=(function(){function r(e){this.renderer=e}return r.prototype.image=function(e,t,n){var i=new Image;return i.src=this.base64(e,t,n),i},r.prototype.base64=function(e,t,n){return this.canvas(e).toDataURL(t,n)},r.prototype.canvas=function(e,t){var n=this._rawPixels(e,t),i=n.pixels,a=n.width,s=n.height,o=n.flipY,l=new A4(a,s,1),c=l.context.getImageData(0,0,a,s);if(r.arrayPostDivide(i,c.data),l.context.putImageData(c,0,0),o){var h=new A4(l.width,l.height,1);h.context.scale(1,-1),h.context.drawImage(l.canvas,0,-s),l.destroy(),l=h}return l.canvas},r.prototype.pixels=function(e,t){var n=this._rawPixels(e,t).pixels;return r.arrayPostDivide(n,n),n},r.prototype._rawPixels=function(e,t){var n=this.renderer,i,a=!1,s,o=!1;if(e)if(e instanceof nl)s=e;else{var l=n.context.webGLVersion>=2?n.multisample:Fr.NONE;if(s=this.renderer.generateTexture(e,{multisample:l}),l!==Fr.NONE){var c=nl.create({width:s.width,height:s.height});n.framebuffer.bind(s.framebuffer),n.framebuffer.blit(c.framebuffer),n.framebuffer.bind(null),s.destroy(!0),s=c}o=!0}s?(i=s.baseTexture.resolution,t=t??s.frame,a=!1,n.renderTexture.bind(s)):(i=n.resolution,t||(t=DK,t.width=n.width,t.height=n.height),a=!0,n.renderTexture.bind(null));var h=Math.round(t.width*i),d=Math.round(t.height*i),v=new Uint8Array(PK*h*d),g=n.gl;return g.readPixels(Math.round(t.x*i),Math.round(t.y*i),h,d,g.RGBA,g.UNSIGNED_BYTE,v),o&&s.destroy(!0),{pixels:v,width:h,height:d,flipY:a}},r.prototype.destroy=function(){this.renderer=null},r.arrayPostDivide=function(e,t){for(var n=0;n<e.length;n+=4){var i=t[n+3]=e[n+3];i!==0?(t[n]=Math.round(Math.min(e[n]*255/i,255)),t[n+1]=Math.round(Math.min(e[n+1]*255/i,255)),t[n+2]=Math.round(Math.min(e[n+2]*255/i,255))):(t[n]=e[n],t[n+1]=e[n+1],t[n+2]=e[n+2])}},r.extension={name:"extract",type:yr.RendererPlugin},r})();/*!
  906. * @pixi/loaders - v6.5.10
  907. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  908. *
  909. * @pixi/loaders is licensed under the MIT License.
  910. * http://www.opensource.org/licenses/mit-license
  911. */var Ov=(function(){function r(e,t,n){t===void 0&&(t=!1),this._fn=e,this._once=t,this._thisArg=n,this._next=this._prev=this._owner=null}return r.prototype.detach=function(){return this._owner===null?!1:(this._owner.detach(this),!0)},r})();function iA(r,e){return r._head?(r._tail._next=e,e._prev=r._tail,r._tail=e):(r._head=e,r._tail=e),e._owner=r,e}var Fs=(function(){function r(){this._head=this._tail=void 0}return r.prototype.handlers=function(e){e===void 0&&(e=!1);var t=this._head;if(e)return!!t;for(var n=[];t;)n.push(t),t=t._next;return n},r.prototype.has=function(e){if(!(e instanceof Ov))throw new Error("MiniSignal#has(): First arg must be a SignalBinding object.");return e._owner===this},r.prototype.dispatch=function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];var i=this._head;if(!i)return!1;for(;i;)i._once&&this.detach(i),i._fn.apply(i._thisArg,t),i=i._next;return!0},r.prototype.add=function(e,t){if(t===void 0&&(t=null),typeof e!="function")throw new Error("MiniSignal#add(): First arg must be a Function.");return iA(this,new Ov(e,!1,t))},r.prototype.once=function(e,t){if(t===void 0&&(t=null),typeof e!="function")throw new Error("MiniSignal#once(): First arg must be a Function.");return iA(this,new Ov(e,!0,t))},r.prototype.detach=function(e){if(!(e instanceof Ov))throw new Error("MiniSignal#detach(): First arg must be a SignalBinding object.");return e._owner!==this?this:(e._prev&&(e._prev._next=e._next),e._next&&(e._next._prev=e._prev),e===this._head?(this._head=e._next,e._next===null&&(this._tail=null)):e===this._tail&&(this._tail=e._prev,this._tail._next=null),e._owner=null,this)},r.prototype.detachAll=function(){var e=this._head;if(!e)return this;for(this._head=this._tail=null;e;)e._owner=null,e=e._next;return this},r})();function ND(r,e){e=e||{};for(var t={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},n=t.parser[e.strictMode?"strict":"loose"].exec(r),i={},a=14;a--;)i[t.key[a]]=n[a]||"";return i[t.q.name]={},i[t.key[12]].replace(t.q.parser,function(s,o,l){o&&(i[t.q.name][o]=l)}),i}var tx,Dv=null,IK=0,aA=200,NK=204,LK=1223,kK=2;function sA(){}function oA(r,e,t){e&&e.indexOf(".")===0&&(e=e.substring(1)),e&&(r[e]=t)}function rx(r){return r.toString().replace("object ","")}var Qr=(function(){function r(e,t,n){if(this._dequeue=sA,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=null,this._boundOnError=null,this._boundOnProgress=null,this._boundOnTimeout=null,this._boundXhrOnError=null,this._boundXhrOnTimeout=null,this._boundXhrOnAbort=null,this._boundXhrOnLoad=null,typeof e!="string"||typeof t!="string")throw new Error("Both name and url are required for constructing a resource.");n=n||{},this._flags=0,this._setFlag(r.STATUS_FLAGS.DATA_URL,t.indexOf("data:")===0),this.name=e,this.url=t,this.extension=this._getExtension(),this.data=null,this.crossOrigin=n.crossOrigin===!0?"anonymous":n.crossOrigin,this.timeout=n.timeout||0,this.loadType=n.loadType||this._determineLoadType(),this.xhrType=n.xhrType,this.metadata=n.metadata||{},this.error=null,this.xhr=null,this.children=[],this.type=r.TYPE.UNKNOWN,this.progressChunk=0,this._dequeue=sA,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=this.complete.bind(this),this._boundOnError=this._onError.bind(this),this._boundOnProgress=this._onProgress.bind(this),this._boundOnTimeout=this._onTimeout.bind(this),this._boundXhrOnError=this._xhrOnError.bind(this),this._boundXhrOnTimeout=this._xhrOnTimeout.bind(this),this._boundXhrOnAbort=this._xhrOnAbort.bind(this),this._boundXhrOnLoad=this._xhrOnLoad.bind(this),this.onStart=new Fs,this.onProgress=new Fs,this.onComplete=new Fs,this.onAfterMiddleware=new Fs}return r.setExtensionLoadType=function(e,t){oA(r._loadTypeMap,e,t)},r.setExtensionXhrType=function(e,t){oA(r._xhrTypeMap,e,t)},Object.defineProperty(r.prototype,"isDataUrl",{get:function(){return this._hasFlag(r.STATUS_FLAGS.DATA_URL)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isComplete",{get:function(){return this._hasFlag(r.STATUS_FLAGS.COMPLETE)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isLoading",{get:function(){return this._hasFlag(r.STATUS_FLAGS.LOADING)},enumerable:!1,configurable:!0}),r.prototype.complete=function(){this._clearEvents(),this._finish()},r.prototype.abort=function(e){if(!this.error){if(this.error=new Error(e),this._clearEvents(),this.xhr)this.xhr.abort();else if(this.xdr)this.xdr.abort();else if(this.data)if(this.data.src)this.data.src=r.EMPTY_GIF;else for(;this.data.firstChild;)this.data.removeChild(this.data.firstChild);this._finish()}},r.prototype.load=function(e){var t=this;if(!this.isLoading){if(this.isComplete){e&&setTimeout(function(){return e(t)},1);return}else e&&this.onComplete.once(e);switch(this._setFlag(r.STATUS_FLAGS.LOADING,!0),this.onStart.dispatch(this),(this.crossOrigin===!1||typeof this.crossOrigin!="string")&&(this.crossOrigin=this._determineCrossOrigin(this.url)),this.loadType){case r.LOAD_TYPE.IMAGE:this.type=r.TYPE.IMAGE,this._loadElement("image");break;case r.LOAD_TYPE.AUDIO:this.type=r.TYPE.AUDIO,this._loadSourceElement("audio");break;case r.LOAD_TYPE.VIDEO:this.type=r.TYPE.VIDEO,this._loadSourceElement("video");break;case r.LOAD_TYPE.XHR:default:typeof tx>"u"&&(tx=!!(globalThis.XDomainRequest&&!("withCredentials"in new XMLHttpRequest))),tx&&this.crossOrigin?this._loadXdr():this._loadXhr();break}}},r.prototype._hasFlag=function(e){return(this._flags&e)!==0},r.prototype._setFlag=function(e,t){this._flags=t?this._flags|e:this._flags&~e},r.prototype._clearEvents=function(){clearTimeout(this._elementTimer),this.data&&this.data.removeEventListener&&(this.data.removeEventListener("error",this._boundOnError,!1),this.data.removeEventListener("load",this._boundComplete,!1),this.data.removeEventListener("progress",this._boundOnProgress,!1),this.data.removeEventListener("canplaythrough",this._boundComplete,!1)),this.xhr&&(this.xhr.removeEventListener?(this.xhr.removeEventListener("error",this._boundXhrOnError,!1),this.xhr.removeEventListener("timeout",this._boundXhrOnTimeout,!1),this.xhr.removeEventListener("abort",this._boundXhrOnAbort,!1),this.xhr.removeEventListener("progress",this._boundOnProgress,!1),this.xhr.removeEventListener("load",this._boundXhrOnLoad,!1)):(this.xhr.onerror=null,this.xhr.ontimeout=null,this.xhr.onprogress=null,this.xhr.onload=null))},r.prototype._finish=function(){if(this.isComplete)throw new Error("Complete called again for an already completed resource.");this._setFlag(r.STATUS_FLAGS.COMPLETE,!0),this._setFlag(r.STATUS_FLAGS.LOADING,!1),this.onComplete.dispatch(this)},r.prototype._loadElement=function(e){this.metadata.loadElement?this.data=this.metadata.loadElement:e==="image"&&typeof globalThis.Image<"u"?this.data=new Image:this.data=document.createElement(e),this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),this.metadata.skipSource||(this.data.src=this.url),this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))},r.prototype._loadSourceElement=function(e){if(this.metadata.loadElement?this.data=this.metadata.loadElement:e==="audio"&&typeof globalThis.Audio<"u"?this.data=new Audio:this.data=document.createElement(e),this.data===null){this.abort("Unsupported element: "+e);return}if(this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),!this.metadata.skipSource)if(navigator.isCocoonJS)this.data.src=Array.isArray(this.url)?this.url[0]:this.url;else if(Array.isArray(this.url))for(var t=this.metadata.mimeType,n=0;n<this.url.length;++n)this.data.appendChild(this._createSource(e,this.url[n],Array.isArray(t)?t[n]:t));else{var t=this.metadata.mimeType;this.data.appendChild(this._createSource(e,this.url,Array.isArray(t)?t[0]:t))}this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.data.addEventListener("canplaythrough",this._boundComplete,!1),this.data.load(),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))},r.prototype._loadXhr=function(){typeof this.xhrType!="string"&&(this.xhrType=this._determineXhrType());var e=this.xhr=new XMLHttpRequest;this.crossOrigin==="use-credentials"&&(e.withCredentials=!0),e.open("GET",this.url,!0),e.timeout=this.timeout,this.xhrType===r.XHR_RESPONSE_TYPE.JSON||this.xhrType===r.XHR_RESPONSE_TYPE.DOCUMENT?e.responseType=r.XHR_RESPONSE_TYPE.TEXT:e.responseType=this.xhrType,e.addEventListener("error",this._boundXhrOnError,!1),e.addEventListener("timeout",this._boundXhrOnTimeout,!1),e.addEventListener("abort",this._boundXhrOnAbort,!1),e.addEventListener("progress",this._boundOnProgress,!1),e.addEventListener("load",this._boundXhrOnLoad,!1),e.send()},r.prototype._loadXdr=function(){typeof this.xhrType!="string"&&(this.xhrType=this._determineXhrType());var e=this.xhr=new globalThis.XDomainRequest;e.timeout=this.timeout||5e3,e.onerror=this._boundXhrOnError,e.ontimeout=this._boundXhrOnTimeout,e.onprogress=this._boundOnProgress,e.onload=this._boundXhrOnLoad,e.open("GET",this.url,!0),setTimeout(function(){return e.send()},1)},r.prototype._createSource=function(e,t,n){n||(n=e+"/"+this._getExtension(t));var i=document.createElement("source");return i.src=t,i.type=n,i},r.prototype._onError=function(e){this.abort("Failed to load element using: "+e.target.nodeName)},r.prototype._onProgress=function(e){e&&e.lengthComputable&&this.onProgress.dispatch(this,e.loaded/e.total)},r.prototype._onTimeout=function(){this.abort("Load timed out.")},r.prototype._xhrOnError=function(){var e=this.xhr;this.abort(rx(e)+" Request failed. Status: "+e.status+', text: "'+e.statusText+'"')},r.prototype._xhrOnTimeout=function(){var e=this.xhr;this.abort(rx(e)+" Request timed out.")},r.prototype._xhrOnAbort=function(){var e=this.xhr;this.abort(rx(e)+" Request was aborted by the user.")},r.prototype._xhrOnLoad=function(){var e=this.xhr,t="",n=typeof e.status>"u"?aA:e.status;(e.responseType===""||e.responseType==="text"||typeof e.responseType>"u")&&(t=e.responseText),n===IK&&(t.length>0||e.responseType===r.XHR_RESPONSE_TYPE.BUFFER)?n=aA:n===LK&&(n=NK);var i=n/100|0;if(i===kK)if(this.xhrType===r.XHR_RESPONSE_TYPE.TEXT)this.data=t,this.type=r.TYPE.TEXT;else if(this.xhrType===r.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(t),this.type=r.TYPE.JSON}catch(o){this.abort("Error trying to parse loaded json: "+o);return}else if(this.xhrType===r.XHR_RESPONSE_TYPE.DOCUMENT)try{if(globalThis.DOMParser){var a=new DOMParser;this.data=a.parseFromString(t,"text/xml")}else{var s=document.createElement("div");s.innerHTML=t,this.data=s}this.type=r.TYPE.XML}catch(o){this.abort("Error trying to parse loaded xml: "+o);return}else this.data=e.response||t;else{this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL);return}this.complete()},r.prototype._determineCrossOrigin=function(e,t){if(e.indexOf("data:")===0)return"";if(globalThis.origin!==globalThis.location.origin)return"anonymous";t=t||globalThis.location,Dv||(Dv=document.createElement("a")),Dv.href=e;var n=ND(Dv.href,{strictMode:!0}),i=!n.port&&t.port===""||n.port===t.port,a=n.protocol?n.protocol+":":"";return n.host!==t.hostname||!i||a!==t.protocol?"anonymous":""},r.prototype._determineXhrType=function(){return r._xhrTypeMap[this.extension]||r.XHR_RESPONSE_TYPE.TEXT},r.prototype._determineLoadType=function(){return r._loadTypeMap[this.extension]||r.LOAD_TYPE.XHR},r.prototype._getExtension=function(e){e===void 0&&(e=this.url);var t="";if(this.isDataUrl){var n=e.indexOf("/");t=e.substring(n+1,e.indexOf(";",n))}else{var i=e.indexOf("?"),a=e.indexOf("#"),s=Math.min(i>-1?i:e.length,a>-1?a:e.length);e=e.substring(0,s),t=e.substring(e.lastIndexOf(".")+1)}return t.toLowerCase()},r.prototype._getMimeFromXhrType=function(e){switch(e){case r.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case r.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case r.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case r.XHR_RESPONSE_TYPE.JSON:return"application/json";case r.XHR_RESPONSE_TYPE.DEFAULT:case r.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r})();(function(r){(function(e){e[e.NONE=0]="NONE",e[e.DATA_URL=1]="DATA_URL",e[e.COMPLETE=2]="COMPLETE",e[e.LOADING=4]="LOADING"})(r.STATUS_FLAGS||(r.STATUS_FLAGS={})),(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.JSON=1]="JSON",e[e.XML=2]="XML",e[e.IMAGE=3]="IMAGE",e[e.AUDIO=4]="AUDIO",e[e.VIDEO=5]="VIDEO",e[e.TEXT=6]="TEXT"})(r.TYPE||(r.TYPE={})),(function(e){e[e.XHR=1]="XHR",e[e.IMAGE=2]="IMAGE",e[e.AUDIO=3]="AUDIO",e[e.VIDEO=4]="VIDEO"})(r.LOAD_TYPE||(r.LOAD_TYPE={})),(function(e){e.DEFAULT="text",e.BUFFER="arraybuffer",e.BLOB="blob",e.DOCUMENT="document",e.JSON="json",e.TEXT="text"})(r.XHR_RESPONSE_TYPE||(r.XHR_RESPONSE_TYPE={})),r._loadTypeMap={gif:r.LOAD_TYPE.IMAGE,png:r.LOAD_TYPE.IMAGE,bmp:r.LOAD_TYPE.IMAGE,jpg:r.LOAD_TYPE.IMAGE,jpeg:r.LOAD_TYPE.IMAGE,tif:r.LOAD_TYPE.IMAGE,tiff:r.LOAD_TYPE.IMAGE,webp:r.LOAD_TYPE.IMAGE,tga:r.LOAD_TYPE.IMAGE,avif:r.LOAD_TYPE.IMAGE,svg:r.LOAD_TYPE.IMAGE,"svg+xml":r.LOAD_TYPE.IMAGE,mp3:r.LOAD_TYPE.AUDIO,ogg:r.LOAD_TYPE.AUDIO,wav:r.LOAD_TYPE.AUDIO,mp4:r.LOAD_TYPE.VIDEO,webm:r.LOAD_TYPE.VIDEO},r._xhrTypeMap={xhtml:r.XHR_RESPONSE_TYPE.DOCUMENT,html:r.XHR_RESPONSE_TYPE.DOCUMENT,htm:r.XHR_RESPONSE_TYPE.DOCUMENT,xml:r.XHR_RESPONSE_TYPE.DOCUMENT,tmx:r.XHR_RESPONSE_TYPE.DOCUMENT,svg:r.XHR_RESPONSE_TYPE.DOCUMENT,tsx:r.XHR_RESPONSE_TYPE.DOCUMENT,gif:r.XHR_RESPONSE_TYPE.BLOB,png:r.XHR_RESPONSE_TYPE.BLOB,bmp:r.XHR_RESPONSE_TYPE.BLOB,jpg:r.XHR_RESPONSE_TYPE.BLOB,jpeg:r.XHR_RESPONSE_TYPE.BLOB,tif:r.XHR_RESPONSE_TYPE.BLOB,tiff:r.XHR_RESPONSE_TYPE.BLOB,webp:r.XHR_RESPONSE_TYPE.BLOB,tga:r.XHR_RESPONSE_TYPE.BLOB,avif:r.XHR_RESPONSE_TYPE.BLOB,json:r.XHR_RESPONSE_TYPE.JSON,text:r.XHR_RESPONSE_TYPE.TEXT,txt:r.XHR_RESPONSE_TYPE.TEXT,ttf:r.XHR_RESPONSE_TYPE.BUFFER,otf:r.XHR_RESPONSE_TYPE.BUFFER},r.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="})(Qr||(Qr={}));function Ul(){}function BK(r){return function(){for(var t=arguments,n=[],i=0;i<arguments.length;i++)n[i]=t[i];if(r===null)throw new Error("Callback was already called.");var a=r;r=null,a.apply(this,n)}}var FK=(function(){function r(e,t){this.data=e,this.callback=t}return r})(),nx=(function(){function r(e,t){var n=this;if(t===void 0&&(t=1),this.workers=0,this.saturated=Ul,this.unsaturated=Ul,this.empty=Ul,this.drain=Ul,this.error=Ul,this.started=!1,this.paused=!1,this._tasks=[],this._insert=function(i,a,s){if(s&&typeof s!="function")throw new Error("task callback must be a function");if(n.started=!0,i==null&&n.idle()){setTimeout(function(){return n.drain()},1);return}var o=new FK(i,typeof s=="function"?s:Ul);a?n._tasks.unshift(o):n._tasks.push(o),setTimeout(n.process,1)},this.process=function(){for(;!n.paused&&n.workers<n.concurrency&&n._tasks.length;){var i=n._tasks.shift();n._tasks.length===0&&n.empty(),n.workers+=1,n.workers===n.concurrency&&n.saturated(),n._worker(i.data,BK(n._next(i)))}},this._worker=e,t===0)throw new Error("Concurrency must not be zero");this.concurrency=t,this.buffer=t/4}return r.prototype._next=function(e){var t=this;return function(){for(var n=arguments,i=[],a=0;a<arguments.length;a++)i[a]=n[a];t.workers-=1,e.callback.apply(e,i),i[0]!=null&&t.error(i[0],e.data),t.workers<=t.concurrency-t.buffer&&t.unsaturated(),t.idle()&&t.drain(),t.process()}},r.prototype.push=function(e,t){this._insert(e,!1,t)},r.prototype.kill=function(){this.workers=0,this.drain=Ul,this.started=!1,this._tasks=[]},r.prototype.unshift=function(e,t){this._insert(e,!0,t)},r.prototype.length=function(){return this._tasks.length},r.prototype.running=function(){return this.workers},r.prototype.idle=function(){return this._tasks.length+this.workers===0},r.prototype.pause=function(){this.paused!==!0&&(this.paused=!0)},r.prototype.resume=function(){if(this.paused!==!1){this.paused=!1;for(var e=1;e<=this.concurrency;e++)this.process()}},r.eachSeries=function(e,t,n,i){var a=0,s=e.length;function o(l){if(l||a===s){n&&n(l);return}i?setTimeout(function(){t(e[a++],o)},1):t(e[a++],o)}o()},r.queue=function(e,t){return new r(e,t)},r})(),ix=100,zK=/(#[\w-]+)?$/,dd=(function(){function r(e,t){var n=this;e===void 0&&(e=""),t===void 0&&(t=10),this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(l,c){return n._loadResource(l,c)},this.resources={},this.baseUrl=e,this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(l,c){return n._loadResource(l,c)},this._queue=nx.queue(this._boundLoadResource,t),this._queue.pause(),this.resources={},this.onProgress=new Fs,this.onError=new Fs,this.onLoad=new Fs,this.onStart=new Fs,this.onComplete=new Fs;for(var i=0;i<r._plugins.length;++i){var a=r._plugins[i],s=a.pre,o=a.use;s&&this.pre(s),o&&this.use(o)}this._protected=!1}return r.prototype._add=function(e,t,n,i){if(this.loading&&(!n||!n.parentResource))throw new Error("Cannot add resources while the loader is running.");if(this.resources[e])throw new Error('Resource named "'+e+'" already exists.');if(t=this._prepareUrl(t),this.resources[e]=new Qr(e,t,n),typeof i=="function"&&this.resources[e].onAfterMiddleware.once(i),this.loading){for(var a=n.parentResource,s=[],o=0;o<a.children.length;++o)a.children[o].isComplete||s.push(a.children[o]);var l=a.progressChunk*(s.length+1),c=l/(s.length+2);a.children.push(this.resources[e]),a.progressChunk=c;for(var o=0;o<s.length;++o)s[o].progressChunk=c;this.resources[e].progressChunk=c}return this._queue.push(this.resources[e]),this},r.prototype.pre=function(e){return this._beforeMiddleware.push(e),this},r.prototype.use=function(e){return this._afterMiddleware.push(e),this},r.prototype.reset=function(){this.progress=0,this.loading=!1,this._queue.kill(),this._queue.pause();for(var e in this.resources){var t=this.resources[e];t._onLoadBinding&&t._onLoadBinding.detach(),t.isLoading&&t.abort("loader reset")}return this.resources={},this},r.prototype.load=function(e){if(fi("6.5.0","@pixi/loaders is being replaced with @pixi/assets in the next major release."),typeof e=="function"&&this.onComplete.once(e),this.loading)return this;if(this._queue.idle())this._onStart(),this._onComplete();else{for(var t=this._queue._tasks.length,n=ix/t,i=0;i<this._queue._tasks.length;++i)this._queue._tasks[i].data.progressChunk=n;this._onStart(),this._queue.resume()}return this},Object.defineProperty(r.prototype,"concurrency",{get:function(){return this._queue.concurrency},set:function(e){this._queue.concurrency=e},enumerable:!1,configurable:!0}),r.prototype._prepareUrl=function(e){var t=ND(e,{strictMode:!0}),n;if(t.protocol||!t.path||e.indexOf("//")===0?n=e:this.baseUrl.length&&this.baseUrl.lastIndexOf("/")!==this.baseUrl.length-1&&e.charAt(0)!=="/"?n=this.baseUrl+"/"+e:n=this.baseUrl+e,this.defaultQueryString){var i=zK.exec(n)[0];n=n.slice(0,n.length-i.length),n.indexOf("?")!==-1?n+="&"+this.defaultQueryString:n+="?"+this.defaultQueryString,n+=i}return n},r.prototype._loadResource=function(e,t){var n=this;e._dequeue=t,nx.eachSeries(this._beforeMiddleware,function(i,a){i.call(n,e,function(){a(e.isComplete?{}:null)})},function(){e.isComplete?n._onLoad(e):(e._onLoadBinding=e.onComplete.once(n._onLoad,n),e.load())},!0)},r.prototype._onStart=function(){this.progress=0,this.loading=!0,this.onStart.dispatch(this)},r.prototype._onComplete=function(){this.progress=ix,this.loading=!1,this.onComplete.dispatch(this,this.resources)},r.prototype._onLoad=function(e){var t=this;e._onLoadBinding=null,this._resourcesParsing.push(e),e._dequeue(),nx.eachSeries(this._afterMiddleware,function(n,i){n.call(t,e,i)},function(){e.onAfterMiddleware.dispatch(e),t.progress=Math.min(ix,t.progress+e.progressChunk),t.onProgress.dispatch(t,e),e.error?t.onError.dispatch(e.error,t,e):t.onLoad.dispatch(t,e),t._resourcesParsing.splice(t._resourcesParsing.indexOf(e),1),t._queue.idle()&&t._resourcesParsing.length===0&&t._onComplete()},!0)},r.prototype.destroy=function(){this._protected||this.reset()},Object.defineProperty(r,"shared",{get:function(){var e=r._shared;return e||(e=new r,e._protected=!0,r._shared=e),e},enumerable:!1,configurable:!0}),r.registerPlugin=function(e){return fi("6.5.0","Loader.registerPlugin() is deprecated, use extensions.add() instead."),us.add({type:yr.Loader,ref:e}),r},r._plugins=[],r})();us.handleByList(yr.Loader,dd._plugins);dd.prototype.add=function(e,t,n,i){if(Array.isArray(e)){for(var a=0;a<e.length;++a)this.add(e[a]);return this}if(typeof e=="object"&&(n=e,i=t||n.callback||n.onComplete,t=n.url,e=n.name||n.key||n.url),typeof t!="string"&&(i=n,n=t,t=e),typeof t!="string")throw new Error("No url passed to add resource to loader.");return typeof n=="function"&&(i=n,n=null),this._add(e,t,n,i)};var LD=(function(){function r(){}return r.init=function(e){e=Object.assign({sharedLoader:!1},e),this.loader=e.sharedLoader?dd.shared:new dd},r.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},r.extension=yr.Application,r})(),kD=(function(){function r(){}return r.add=function(){Qr.setExtensionLoadType("svg",Qr.LOAD_TYPE.XHR),Qr.setExtensionXhrType("svg",Qr.XHR_RESPONSE_TYPE.TEXT)},r.use=function(e,t){if(e.data&&(e.type===Qr.TYPE.IMAGE||e.extension==="svg")){var n=e.data,i=e.url,a=e.name,s=e.metadata;Rt.fromLoader(n,i,a,s).then(function(o){e.texture=o,t()}).catch(t)}else t()},r.extension=yr.Loader,r})(),UK="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function GK(r){for(var e="",t=0;t<r.length;){for(var n=[0,0,0],i=[0,0,0,0],a=0;a<n.length;++a)t<r.length?n[a]=r.charCodeAt(t++)&255:n[a]=0;i[0]=n[0]>>2,i[1]=(n[0]&3)<<4|n[1]>>4,i[2]=(n[1]&15)<<2|n[2]>>6,i[3]=n[2]&63;var s=t-(r.length-1);switch(s){case 2:i[3]=64,i[2]=64;break;case 1:i[3]=64;break}for(var a=0;a<i.length;++a)e+=UK.charAt(i[a])}return e}function HK(r,e){if(!r.data){e();return}if(r.xhr&&r.xhrType===Qr.XHR_RESPONSE_TYPE.BLOB){if(!self.Blob||typeof r.data=="string"){var t=r.xhr.getResponseHeader("content-type");if(t&&t.indexOf("image")===0){r.data=new Image,r.data.src="data:"+t+";base64,"+GK(r.xhr.responseText),r.type=Qr.TYPE.IMAGE,r.data.onload=function(){r.data.onload=null,e()};return}}else if(r.data.type.indexOf("image")===0){var n=globalThis.URL||globalThis.webkitURL,i=n.createObjectURL(r.data);r.blob=r.data,r.data=new Image,r.data.src=i,r.type=Qr.TYPE.IMAGE,r.data.onload=function(){n.revokeObjectURL(i),r.data.onload=null,e()};return}}e()}var jK=(function(){function r(){}return r.extension=yr.Loader,r.use=HK,r})();us.add(kD,jK);/*!
  912. * @pixi/compressed-textures - v6.5.10
  913. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  914. *
  915. * @pixi/compressed-textures is licensed under the MIT License.
  916. * http://www.opensource.org/licenses/mit-license
  917. */var mr,Lt;(function(r){r[r.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",r[r.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",r[r.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",r[r.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",r[r.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",r[r.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",r[r.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",r[r.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",r[r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",r[r.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",r[r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",r[r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",r[r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",r[r.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",r[r.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",r[r.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",r[r.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",r[r.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR"})(Lt||(Lt={}));var vd=(mr={},mr[Lt.COMPRESSED_RGB_S3TC_DXT1_EXT]=.5,mr[Lt.COMPRESSED_RGBA_S3TC_DXT1_EXT]=.5,mr[Lt.COMPRESSED_RGBA_S3TC_DXT3_EXT]=1,mr[Lt.COMPRESSED_RGBA_S3TC_DXT5_EXT]=1,mr[Lt.COMPRESSED_SRGB_S3TC_DXT1_EXT]=.5,mr[Lt.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT]=.5,mr[Lt.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT]=1,mr[Lt.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT]=1,mr[Lt.COMPRESSED_R11_EAC]=.5,mr[Lt.COMPRESSED_SIGNED_R11_EAC]=.5,mr[Lt.COMPRESSED_RG11_EAC]=1,mr[Lt.COMPRESSED_SIGNED_RG11_EAC]=1,mr[Lt.COMPRESSED_RGB8_ETC2]=.5,mr[Lt.COMPRESSED_RGBA8_ETC2_EAC]=1,mr[Lt.COMPRESSED_SRGB8_ETC2]=.5,mr[Lt.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC]=1,mr[Lt.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,mr[Lt.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,mr[Lt.COMPRESSED_RGB_PVRTC_4BPPV1_IMG]=.5,mr[Lt.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG]=.5,mr[Lt.COMPRESSED_RGB_PVRTC_2BPPV1_IMG]=.25,mr[Lt.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG]=.25,mr[Lt.COMPRESSED_RGB_ETC1_WEBGL]=.5,mr[Lt.COMPRESSED_RGB_ATC_WEBGL]=.5,mr[Lt.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL]=1,mr[Lt.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL]=1,mr[Lt.COMPRESSED_RGBA_ASTC_4x4_KHR]=1,mr);/*! *****************************************************************************
  918. Copyright (c) Microsoft Corporation.
  919. Permission to use, copy, modify, and/or distribute this software for any
  920. purpose with or without fee is hereby granted.
  921. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  922. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  923. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  924. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  925. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  926. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  927. PERFORMANCE OF THIS SOFTWARE.
  928. ***************************************************************************** */var L4=function(r,e){return L4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},L4(r,e)};function BD(r,e){L4(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function VK(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(h){try{c(n.next(h))}catch(d){s(d)}}function l(h){try{c(n.throw(h))}catch(d){s(d)}}function c(h){h.done?a(h.value):i(h.value).then(o,l)}c((n=n.apply(r,[])).next())})}function qK(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(c){return function(h){return l([c,h])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,i=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){t.label=c[1];break}if(c[0]===6&&t.label<a[1]){t.label=a[1],a=c;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(c);break}a[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(h){c=[6,h],i=0}finally{n=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}var FD=(function(r){BD(e,r);function e(t,n){n===void 0&&(n={width:1,height:1,autoLoad:!0});var i=this,a,s;return typeof t=="string"?(a=t,s=new Uint8Array):(a=null,s=t),i=r.call(this,s,n)||this,i.origin=a,i.buffer=s?new Hp(s):null,i.origin&&n.autoLoad!==!1&&i.load(),s&&s.length&&(i.loaded=!0,i.onBlobLoaded(i.buffer.rawBinaryData)),i}return e.prototype.onBlobLoaded=function(t){},e.prototype.load=function(){return VK(this,void 0,Promise,function(){var t,n,i;return qK(this,function(a){switch(a.label){case 0:return[4,fetch(this.origin)];case 1:return t=a.sent(),[4,t.blob()];case 2:return n=a.sent(),[4,n.arrayBuffer()];case 3:return i=a.sent(),this.data=new Uint32Array(i),this.buffer=new Hp(i),this.loaded=!0,this.onBlobLoaded(i),this.update(),[2,this]}})})},e})(wu),jp=(function(r){BD(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.format=n.format,i.levels=n.levels||1,i._width=n.width,i._height=n.height,i._extension=e._formatToExtension(i.format),(n.levelBuffers||i.buffer)&&(i._levelBuffers=n.levelBuffers||e._createLevelBuffers(t instanceof Uint8Array?t:i.buffer.uint8View,i.format,i.levels,4,4,i.width,i.height)),i}return e.prototype.upload=function(t,n,i){var a=t.gl,s=t.context.extensions[this._extension];if(!s)throw new Error(this._extension+" textures are not supported on the current machine");if(!this._levelBuffers)return!1;for(var o=0,l=this.levels;o<l;o++){var c=this._levelBuffers[o],h=c.levelID,d=c.levelWidth,v=c.levelHeight,g=c.levelBuffer;a.compressedTexImage2D(a.TEXTURE_2D,h,this.format,d,v,0,g)}return!0},e.prototype.onBlobLoaded=function(){this._levelBuffers=e._createLevelBuffers(this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height)},e._formatToExtension=function(t){if(t>=33776&&t<=33779)return"s3tc";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(t>=36196)return"etc1";if(t>=35986&&t<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")},e._createLevelBuffers=function(t,n,i,a,s,o,l){for(var c=new Array(i),h=t.byteOffset,d=o,v=l,g=d+a-1&~(a-1),m=v+s-1&~(s-1),x=g*m*vd[n],y=0;y<i;y++)c[y]={levelID:y,levelWidth:i>1?d:g,levelHeight:i>1?v:m,levelBuffer:new Uint8Array(t.buffer,h,x)},h+=x,d=d>>1||1,v=v>>1||1,g=d+a-1&~(a-1),m=v+s-1&~(s-1),x=g*m*vd[n];return c},e})(FD),zD=(function(){function r(){}return r.use=function(e,t){var n=e.data,i=this;if(e.type===Qr.TYPE.JSON&&n&&n.cacheID&&n.textures){for(var a=n.textures,s=void 0,o=void 0,l=0,c=a.length;l<c;l++){var h=a[l],d=h.src,v=h.format;if(v||(o=d),r.textureFormats[v]){s=d;break}}if(s=s||o,!s){t(new Error("Cannot load compressed-textures in "+e.url+", make sure you provide a fallback"));return}if(s===e.url){t(new Error("URL of compressed texture cannot be the same as the manifest's URL"));return}var g={crossOrigin:e.crossOrigin,metadata:e.metadata.imageMetadata,parentResource:e},m=es.resolve(e.url.replace(i.baseUrl,""),s),x=n.cacheID;i.add(x,m,g,function(y){if(y.error){t(y.error);return}var _=y.texture,w=_===void 0?null:_,S=y.textures,A=S===void 0?{}:S;Object.assign(e,{texture:w,textures:A}),t()})}else t()},Object.defineProperty(r,"textureExtensions",{get:function(){if(!r._textureExtensions){var e=ht.ADAPTER.createCanvas(),t=e.getContext("webgl");if(!t)return console.warn("WebGL not available for compressed textures. Silently failing."),{};var n={s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};r._textureExtensions=n}return r._textureExtensions},enumerable:!1,configurable:!0}),Object.defineProperty(r,"textureFormats",{get:function(){if(!r._textureFormats){var e=r.textureExtensions;r._textureFormats={};for(var t in e){var n=e[t];n&&Object.assign(r._textureFormats,Object.getPrototypeOf(n))}}return r._textureFormats},enumerable:!1,configurable:!0}),r.extension=yr.Loader,r})();function UD(r,e,t){var n={textures:{},texture:null};if(!e)return n;var i=e.map(function(a){return new Rt(new Wt(a,Object.assign({mipmap:ba.OFF,alphaMode:xa.NO_PREMULTIPLIED_ALPHA},t)))});return i.forEach(function(a,s){var o=a.baseTexture,l=r+"-"+(s+1);Wt.addToCache(o,l),Rt.addToCache(a,l),s===0&&(Wt.addToCache(o,r),Rt.addToCache(a,r),n.texture=a),n.textures[l]=a}),n}var mf,Aa,ax=4,Pv=124,XK=32,lA=20,YK=542327876,Iv={HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},WK={FOURCC:2},Nv={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3},Ra;(function(r){r[r.DXGI_FORMAT_UNKNOWN=0]="DXGI_FORMAT_UNKNOWN",r[r.DXGI_FORMAT_R32G32B32A32_TYPELESS=1]="DXGI_FORMAT_R32G32B32A32_TYPELESS",r[r.DXGI_FORMAT_R32G32B32A32_FLOAT=2]="DXGI_FORMAT_R32G32B32A32_FLOAT",r[r.DXGI_FORMAT_R32G32B32A32_UINT=3]="DXGI_FORMAT_R32G32B32A32_UINT",r[r.DXGI_FORMAT_R32G32B32A32_SINT=4]="DXGI_FORMAT_R32G32B32A32_SINT",r[r.DXGI_FORMAT_R32G32B32_TYPELESS=5]="DXGI_FORMAT_R32G32B32_TYPELESS",r[r.DXGI_FORMAT_R32G32B32_FLOAT=6]="DXGI_FORMAT_R32G32B32_FLOAT",r[r.DXGI_FORMAT_R32G32B32_UINT=7]="DXGI_FORMAT_R32G32B32_UINT",r[r.DXGI_FORMAT_R32G32B32_SINT=8]="DXGI_FORMAT_R32G32B32_SINT",r[r.DXGI_FORMAT_R16G16B16A16_TYPELESS=9]="DXGI_FORMAT_R16G16B16A16_TYPELESS",r[r.DXGI_FORMAT_R16G16B16A16_FLOAT=10]="DXGI_FORMAT_R16G16B16A16_FLOAT",r[r.DXGI_FORMAT_R16G16B16A16_UNORM=11]="DXGI_FORMAT_R16G16B16A16_UNORM",r[r.DXGI_FORMAT_R16G16B16A16_UINT=12]="DXGI_FORMAT_R16G16B16A16_UINT",r[r.DXGI_FORMAT_R16G16B16A16_SNORM=13]="DXGI_FORMAT_R16G16B16A16_SNORM",r[r.DXGI_FORMAT_R16G16B16A16_SINT=14]="DXGI_FORMAT_R16G16B16A16_SINT",r[r.DXGI_FORMAT_R32G32_TYPELESS=15]="DXGI_FORMAT_R32G32_TYPELESS",r[r.DXGI_FORMAT_R32G32_FLOAT=16]="DXGI_FORMAT_R32G32_FLOAT",r[r.DXGI_FORMAT_R32G32_UINT=17]="DXGI_FORMAT_R32G32_UINT",r[r.DXGI_FORMAT_R32G32_SINT=18]="DXGI_FORMAT_R32G32_SINT",r[r.DXGI_FORMAT_R32G8X24_TYPELESS=19]="DXGI_FORMAT_R32G8X24_TYPELESS",r[r.DXGI_FORMAT_D32_FLOAT_S8X24_UINT=20]="DXGI_FORMAT_D32_FLOAT_S8X24_UINT",r[r.DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS=21]="DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS",r[r.DXGI_FORMAT_X32_TYPELESS_G8X24_UINT=22]="DXGI_FORMAT_X32_TYPELESS_G8X24_UINT",r[r.DXGI_FORMAT_R10G10B10A2_TYPELESS=23]="DXGI_FORMAT_R10G10B10A2_TYPELESS",r[r.DXGI_FORMAT_R10G10B10A2_UNORM=24]="DXGI_FORMAT_R10G10B10A2_UNORM",r[r.DXGI_FORMAT_R10G10B10A2_UINT=25]="DXGI_FORMAT_R10G10B10A2_UINT",r[r.DXGI_FORMAT_R11G11B10_FLOAT=26]="DXGI_FORMAT_R11G11B10_FLOAT",r[r.DXGI_FORMAT_R8G8B8A8_TYPELESS=27]="DXGI_FORMAT_R8G8B8A8_TYPELESS",r[r.DXGI_FORMAT_R8G8B8A8_UNORM=28]="DXGI_FORMAT_R8G8B8A8_UNORM",r[r.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB=29]="DXGI_FORMAT_R8G8B8A8_UNORM_SRGB",r[r.DXGI_FORMAT_R8G8B8A8_UINT=30]="DXGI_FORMAT_R8G8B8A8_UINT",r[r.DXGI_FORMAT_R8G8B8A8_SNORM=31]="DXGI_FORMAT_R8G8B8A8_SNORM",r[r.DXGI_FORMAT_R8G8B8A8_SINT=32]="DXGI_FORMAT_R8G8B8A8_SINT",r[r.DXGI_FORMAT_R16G16_TYPELESS=33]="DXGI_FORMAT_R16G16_TYPELESS",r[r.DXGI_FORMAT_R16G16_FLOAT=34]="DXGI_FORMAT_R16G16_FLOAT",r[r.DXGI_FORMAT_R16G16_UNORM=35]="DXGI_FORMAT_R16G16_UNORM",r[r.DXGI_FORMAT_R16G16_UINT=36]="DXGI_FORMAT_R16G16_UINT",r[r.DXGI_FORMAT_R16G16_SNORM=37]="DXGI_FORMAT_R16G16_SNORM",r[r.DXGI_FORMAT_R16G16_SINT=38]="DXGI_FORMAT_R16G16_SINT",r[r.DXGI_FORMAT_R32_TYPELESS=39]="DXGI_FORMAT_R32_TYPELESS",r[r.DXGI_FORMAT_D32_FLOAT=40]="DXGI_FORMAT_D32_FLOAT",r[r.DXGI_FORMAT_R32_FLOAT=41]="DXGI_FORMAT_R32_FLOAT",r[r.DXGI_FORMAT_R32_UINT=42]="DXGI_FORMAT_R32_UINT",r[r.DXGI_FORMAT_R32_SINT=43]="DXGI_FORMAT_R32_SINT",r[r.DXGI_FORMAT_R24G8_TYPELESS=44]="DXGI_FORMAT_R24G8_TYPELESS",r[r.DXGI_FORMAT_D24_UNORM_S8_UINT=45]="DXGI_FORMAT_D24_UNORM_S8_UINT",r[r.DXGI_FORMAT_R24_UNORM_X8_TYPELESS=46]="DXGI_FORMAT_R24_UNORM_X8_TYPELESS",r[r.DXGI_FORMAT_X24_TYPELESS_G8_UINT=47]="DXGI_FORMAT_X24_TYPELESS_G8_UINT",r[r.DXGI_FORMAT_R8G8_TYPELESS=48]="DXGI_FORMAT_R8G8_TYPELESS",r[r.DXGI_FORMAT_R8G8_UNORM=49]="DXGI_FORMAT_R8G8_UNORM",r[r.DXGI_FORMAT_R8G8_UINT=50]="DXGI_FORMAT_R8G8_UINT",r[r.DXGI_FORMAT_R8G8_SNORM=51]="DXGI_FORMAT_R8G8_SNORM",r[r.DXGI_FORMAT_R8G8_SINT=52]="DXGI_FORMAT_R8G8_SINT",r[r.DXGI_FORMAT_R16_TYPELESS=53]="DXGI_FORMAT_R16_TYPELESS",r[r.DXGI_FORMAT_R16_FLOAT=54]="DXGI_FORMAT_R16_FLOAT",r[r.DXGI_FORMAT_D16_UNORM=55]="DXGI_FORMAT_D16_UNORM",r[r.DXGI_FORMAT_R16_UNORM=56]="DXGI_FORMAT_R16_UNORM",r[r.DXGI_FORMAT_R16_UINT=57]="DXGI_FORMAT_R16_UINT",r[r.DXGI_FORMAT_R16_SNORM=58]="DXGI_FORMAT_R16_SNORM",r[r.DXGI_FORMAT_R16_SINT=59]="DXGI_FORMAT_R16_SINT",r[r.DXGI_FORMAT_R8_TYPELESS=60]="DXGI_FORMAT_R8_TYPELESS",r[r.DXGI_FORMAT_R8_UNORM=61]="DXGI_FORMAT_R8_UNORM",r[r.DXGI_FORMAT_R8_UINT=62]="DXGI_FORMAT_R8_UINT",r[r.DXGI_FORMAT_R8_SNORM=63]="DXGI_FORMAT_R8_SNORM",r[r.DXGI_FORMAT_R8_SINT=64]="DXGI_FORMAT_R8_SINT",r[r.DXGI_FORMAT_A8_UNORM=65]="DXGI_FORMAT_A8_UNORM",r[r.DXGI_FORMAT_R1_UNORM=66]="DXGI_FORMAT_R1_UNORM",r[r.DXGI_FORMAT_R9G9B9E5_SHAREDEXP=67]="DXGI_FORMAT_R9G9B9E5_SHAREDEXP",r[r.DXGI_FORMAT_R8G8_B8G8_UNORM=68]="DXGI_FORMAT_R8G8_B8G8_UNORM",r[r.DXGI_FORMAT_G8R8_G8B8_UNORM=69]="DXGI_FORMAT_G8R8_G8B8_UNORM",r[r.DXGI_FORMAT_BC1_TYPELESS=70]="DXGI_FORMAT_BC1_TYPELESS",r[r.DXGI_FORMAT_BC1_UNORM=71]="DXGI_FORMAT_BC1_UNORM",r[r.DXGI_FORMAT_BC1_UNORM_SRGB=72]="DXGI_FORMAT_BC1_UNORM_SRGB",r[r.DXGI_FORMAT_BC2_TYPELESS=73]="DXGI_FORMAT_BC2_TYPELESS",r[r.DXGI_FORMAT_BC2_UNORM=74]="DXGI_FORMAT_BC2_UNORM",r[r.DXGI_FORMAT_BC2_UNORM_SRGB=75]="DXGI_FORMAT_BC2_UNORM_SRGB",r[r.DXGI_FORMAT_BC3_TYPELESS=76]="DXGI_FORMAT_BC3_TYPELESS",r[r.DXGI_FORMAT_BC3_UNORM=77]="DXGI_FORMAT_BC3_UNORM",r[r.DXGI_FORMAT_BC3_UNORM_SRGB=78]="DXGI_FORMAT_BC3_UNORM_SRGB",r[r.DXGI_FORMAT_BC4_TYPELESS=79]="DXGI_FORMAT_BC4_TYPELESS",r[r.DXGI_FORMAT_BC4_UNORM=80]="DXGI_FORMAT_BC4_UNORM",r[r.DXGI_FORMAT_BC4_SNORM=81]="DXGI_FORMAT_BC4_SNORM",r[r.DXGI_FORMAT_BC5_TYPELESS=82]="DXGI_FORMAT_BC5_TYPELESS",r[r.DXGI_FORMAT_BC5_UNORM=83]="DXGI_FORMAT_BC5_UNORM",r[r.DXGI_FORMAT_BC5_SNORM=84]="DXGI_FORMAT_BC5_SNORM",r[r.DXGI_FORMAT_B5G6R5_UNORM=85]="DXGI_FORMAT_B5G6R5_UNORM",r[r.DXGI_FORMAT_B5G5R5A1_UNORM=86]="DXGI_FORMAT_B5G5R5A1_UNORM",r[r.DXGI_FORMAT_B8G8R8A8_UNORM=87]="DXGI_FORMAT_B8G8R8A8_UNORM",r[r.DXGI_FORMAT_B8G8R8X8_UNORM=88]="DXGI_FORMAT_B8G8R8X8_UNORM",r[r.DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM=89]="DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM",r[r.DXGI_FORMAT_B8G8R8A8_TYPELESS=90]="DXGI_FORMAT_B8G8R8A8_TYPELESS",r[r.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB=91]="DXGI_FORMAT_B8G8R8A8_UNORM_SRGB",r[r.DXGI_FORMAT_B8G8R8X8_TYPELESS=92]="DXGI_FORMAT_B8G8R8X8_TYPELESS",r[r.DXGI_FORMAT_B8G8R8X8_UNORM_SRGB=93]="DXGI_FORMAT_B8G8R8X8_UNORM_SRGB",r[r.DXGI_FORMAT_BC6H_TYPELESS=94]="DXGI_FORMAT_BC6H_TYPELESS",r[r.DXGI_FORMAT_BC6H_UF16=95]="DXGI_FORMAT_BC6H_UF16",r[r.DXGI_FORMAT_BC6H_SF16=96]="DXGI_FORMAT_BC6H_SF16",r[r.DXGI_FORMAT_BC7_TYPELESS=97]="DXGI_FORMAT_BC7_TYPELESS",r[r.DXGI_FORMAT_BC7_UNORM=98]="DXGI_FORMAT_BC7_UNORM",r[r.DXGI_FORMAT_BC7_UNORM_SRGB=99]="DXGI_FORMAT_BC7_UNORM_SRGB",r[r.DXGI_FORMAT_AYUV=100]="DXGI_FORMAT_AYUV",r[r.DXGI_FORMAT_Y410=101]="DXGI_FORMAT_Y410",r[r.DXGI_FORMAT_Y416=102]="DXGI_FORMAT_Y416",r[r.DXGI_FORMAT_NV12=103]="DXGI_FORMAT_NV12",r[r.DXGI_FORMAT_P010=104]="DXGI_FORMAT_P010",r[r.DXGI_FORMAT_P016=105]="DXGI_FORMAT_P016",r[r.DXGI_FORMAT_420_OPAQUE=106]="DXGI_FORMAT_420_OPAQUE",r[r.DXGI_FORMAT_YUY2=107]="DXGI_FORMAT_YUY2",r[r.DXGI_FORMAT_Y210=108]="DXGI_FORMAT_Y210",r[r.DXGI_FORMAT_Y216=109]="DXGI_FORMAT_Y216",r[r.DXGI_FORMAT_NV11=110]="DXGI_FORMAT_NV11",r[r.DXGI_FORMAT_AI44=111]="DXGI_FORMAT_AI44",r[r.DXGI_FORMAT_IA44=112]="DXGI_FORMAT_IA44",r[r.DXGI_FORMAT_P8=113]="DXGI_FORMAT_P8",r[r.DXGI_FORMAT_A8P8=114]="DXGI_FORMAT_A8P8",r[r.DXGI_FORMAT_B4G4R4A4_UNORM=115]="DXGI_FORMAT_B4G4R4A4_UNORM",r[r.DXGI_FORMAT_P208=116]="DXGI_FORMAT_P208",r[r.DXGI_FORMAT_V208=117]="DXGI_FORMAT_V208",r[r.DXGI_FORMAT_V408=118]="DXGI_FORMAT_V408",r[r.DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE=119]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE",r[r.DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE=120]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE",r[r.DXGI_FORMAT_FORCE_UINT=121]="DXGI_FORMAT_FORCE_UINT"})(Ra||(Ra={}));var k4;(function(r){r[r.DDS_DIMENSION_TEXTURE1D=2]="DDS_DIMENSION_TEXTURE1D",r[r.DDS_DIMENSION_TEXTURE2D=3]="DDS_DIMENSION_TEXTURE2D",r[r.DDS_DIMENSION_TEXTURE3D=6]="DDS_DIMENSION_TEXTURE3D"})(k4||(k4={}));var $K=1,KK=2,ZK=4,QK=64,JK=512,eZ=131072,tZ=827611204,rZ=861165636,nZ=894720068,iZ=808540228,aZ=4,sZ=(mf={},mf[tZ]=Lt.COMPRESSED_RGBA_S3TC_DXT1_EXT,mf[rZ]=Lt.COMPRESSED_RGBA_S3TC_DXT3_EXT,mf[nZ]=Lt.COMPRESSED_RGBA_S3TC_DXT5_EXT,mf),oZ=(Aa={},Aa[Ra.DXGI_FORMAT_BC1_TYPELESS]=Lt.COMPRESSED_RGBA_S3TC_DXT1_EXT,Aa[Ra.DXGI_FORMAT_BC1_UNORM]=Lt.COMPRESSED_RGBA_S3TC_DXT1_EXT,Aa[Ra.DXGI_FORMAT_BC2_TYPELESS]=Lt.COMPRESSED_RGBA_S3TC_DXT3_EXT,Aa[Ra.DXGI_FORMAT_BC2_UNORM]=Lt.COMPRESSED_RGBA_S3TC_DXT3_EXT,Aa[Ra.DXGI_FORMAT_BC3_TYPELESS]=Lt.COMPRESSED_RGBA_S3TC_DXT5_EXT,Aa[Ra.DXGI_FORMAT_BC3_UNORM]=Lt.COMPRESSED_RGBA_S3TC_DXT5_EXT,Aa[Ra.DXGI_FORMAT_BC1_UNORM_SRGB]=Lt.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,Aa[Ra.DXGI_FORMAT_BC2_UNORM_SRGB]=Lt.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,Aa[Ra.DXGI_FORMAT_BC3_UNORM_SRGB]=Lt.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,Aa);function GD(r){var e=new Uint32Array(r),t=e[0];if(t!==YK)throw new Error("Invalid DDS file magic word");var n=new Uint32Array(r,0,Pv/Uint32Array.BYTES_PER_ELEMENT),i=n[Iv.HEIGHT],a=n[Iv.WIDTH],s=n[Iv.MIPMAP_COUNT],o=new Uint32Array(r,Iv.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,XK/Uint32Array.BYTES_PER_ELEMENT),l=o[$K];if(l&ZK){var c=o[WK.FOURCC];if(c!==iZ){var h=sZ[c],d=ax+Pv,v=new Uint8Array(r,d),g=new jp(v,{format:h,width:a,height:i,levels:s});return[g]}var m=ax+Pv,x=new Uint32Array(e.buffer,m,lA/Uint32Array.BYTES_PER_ELEMENT),y=x[Nv.DXGI_FORMAT],_=x[Nv.RESOURCE_DIMENSION],w=x[Nv.MISC_FLAG],S=x[Nv.ARRAY_SIZE],A=oZ[y];if(A===void 0)throw new Error("DDSParser cannot parse texture data with DXGI format "+y);if(w===aZ)throw new Error("DDSParser does not support cubemap textures");if(_===k4.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSParser does not supported 3D texture data");var C=new Array,M=ax+Pv+lA;if(S===1)C.push(new Uint8Array(r,M));else{for(var E=vd[A],O=0,D=a,I=i,k=0;k<s;k++){var U=Math.max(1,D+3&-4),V=Math.max(1,I+3&-4),X=U*V*E;O+=X,D=D>>>1,I=I>>>1}for(var W=M,k=0;k<S;k++)C.push(new Uint8Array(r,W,O)),W+=O}return C.map(function(P){return new jp(P,{format:A,width:a,height:i,levels:s})})}throw l&QK?new Error("DDSParser does not support uncompressed texture data."):l&JK?new Error("DDSParser does not supported YUV uncompressed texture data."):l&eZ?new Error("DDSParser does not support single-channel (lumninance) texture data!"):l&KK?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}var Ro,Is,yf,uA=[171,75,84,88,32,49,49,187,13,10,26,10],lZ=67305985,Ma={ENDIANNESS:12,GL_TYPE:16,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},B4=64,F4=(Ro={},Ro[wt.UNSIGNED_BYTE]=1,Ro[wt.UNSIGNED_SHORT]=2,Ro[wt.INT]=4,Ro[wt.UNSIGNED_INT]=4,Ro[wt.FLOAT]=4,Ro[wt.HALF_FLOAT]=8,Ro),HD=(Is={},Is[at.RGBA]=4,Is[at.RGB]=3,Is[at.RG]=2,Is[at.RED]=1,Is[at.LUMINANCE]=1,Is[at.LUMINANCE_ALPHA]=2,Is[at.ALPHA]=1,Is),jD=(yf={},yf[wt.UNSIGNED_SHORT_4_4_4_4]=2,yf[wt.UNSIGNED_SHORT_5_5_5_1]=2,yf[wt.UNSIGNED_SHORT_5_6_5]=2,yf);function VD(r,e,t){t===void 0&&(t=!1);var n=new DataView(e);if(!uZ(r,n))return null;var i=n.getUint32(Ma.ENDIANNESS,!0)===lZ,a=n.getUint32(Ma.GL_TYPE,i),s=n.getUint32(Ma.GL_FORMAT,i),o=n.getUint32(Ma.GL_INTERNAL_FORMAT,i),l=n.getUint32(Ma.PIXEL_WIDTH,i),c=n.getUint32(Ma.PIXEL_HEIGHT,i)||1,h=n.getUint32(Ma.PIXEL_DEPTH,i)||1,d=n.getUint32(Ma.NUMBER_OF_ARRAY_ELEMENTS,i)||1,v=n.getUint32(Ma.NUMBER_OF_FACES,i),g=n.getUint32(Ma.NUMBER_OF_MIPMAP_LEVELS,i),m=n.getUint32(Ma.BYTES_OF_KEY_VALUE_DATA,i);if(c===0||h!==1)throw new Error("Only 2D textures are supported");if(v!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(d!==1)throw new Error("WebGL does not support array textures");var x=4,y=4,_=l+3&-4,w=c+3&-4,S=new Array(d),A=l*c;a===0&&(A=_*w);var C;if(a!==0?F4[a]?C=F4[a]*HD[s]:C=jD[a]:C=vd[o],C===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");for(var M=t?hZ(n,m,i):null,E=A*C,O=E,D=l,I=c,k=_,U=w,V=B4+m,X=0;X<g;X++){for(var W=n.getUint32(V,i),P=V+4,H=0;H<d;H++){var z=S[H];z||(z=S[H]=new Array(g)),z[X]={levelID:X,levelWidth:g>1||a!==0?D:k,levelHeight:g>1||a!==0?I:U,levelBuffer:new Uint8Array(e,P,O)},P+=O}V+=W+4,V=V%4!==0?V+4-V%4:V,D=D>>1||1,I=I>>1||1,k=D+x-1&-4,U=I+y-1&-4,O=k*U*C}return a!==0?{uncompressed:S.map(function($){var B=$[0].levelBuffer,L=!1;return a===wt.FLOAT?B=new Float32Array($[0].levelBuffer.buffer,$[0].levelBuffer.byteOffset,$[0].levelBuffer.byteLength/4):a===wt.UNSIGNED_INT?(L=!0,B=new Uint32Array($[0].levelBuffer.buffer,$[0].levelBuffer.byteOffset,$[0].levelBuffer.byteLength/4)):a===wt.INT&&(L=!0,B=new Int32Array($[0].levelBuffer.buffer,$[0].levelBuffer.byteOffset,$[0].levelBuffer.byteLength/4)),{resource:new wu(B,{width:$[0].levelWidth,height:$[0].levelHeight}),type:a,format:L?cZ(s):s}}),kvData:M}:{compressed:S.map(function($){return new jp(null,{format:o,width:l,height:c,levels:g,levelBuffers:$})}),kvData:M}}function uZ(r,e){for(var t=0;t<uA.length;t++)if(e.getUint8(t)!==uA[t])return console.error(r+" is not a valid *.ktx file!"),!1;return!0}function cZ(r){switch(r){case at.RGBA:return at.RGBA_INTEGER;case at.RGB:return at.RGB_INTEGER;case at.RG:return at.RG_INTEGER;case at.RED:return at.RED_INTEGER;default:return r}}function hZ(r,e,t){for(var n=new Map,i=0;i<e;){var a=r.getUint32(B4+i,t),s=B4+i+4,o=3-(a+3)%4;if(a===0||a>e-i){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}for(var l=0;l<a&&r.getUint8(s+l)!==0;l++);if(l===-1){console.error("KTXLoader: Failed to find null byte terminating kvData key");break}var c=new TextDecoder().decode(new Uint8Array(r.buffer,s,l)),h=new DataView(r.buffer,s+l+1,a-l-1);n.set(c,h),i+=4+a+o}return n}Qr.setExtensionXhrType("dds",Qr.XHR_RESPONSE_TYPE.BUFFER);var qD=(function(){function r(){}return r.use=function(e,t){if(e.extension==="dds"&&e.data)try{Object.assign(e,UD(e.name||e.url,GD(e.data),e.metadata))}catch(n){t(n);return}t()},r.extension=yr.Loader,r})();Qr.setExtensionXhrType("ktx",Qr.XHR_RESPONSE_TYPE.BUFFER);var XD=(function(){function r(){}return r.use=function(e,t){if(e.extension==="ktx"&&e.data)try{var n=e.name||e.url,i=VD(n,e.data,this.loadKeyValueData),a=i.compressed,s=i.uncompressed,o=i.kvData;if(a){var l=UD(n,a,e.metadata);if(o&&l.textures)for(var c in l.textures)l.textures[c].baseTexture.ktxKeyValueData=o;Object.assign(e,l)}else if(s){var h={};s.forEach(function(d,v){var g=new Rt(new Wt(d.resource,{mipmap:ba.OFF,alphaMode:xa.NO_PREMULTIPLIED_ALPHA,type:d.type,format:d.format})),m=n+"-"+(v+1);o&&(g.baseTexture.ktxKeyValueData=o),Wt.addToCache(g.baseTexture,m),Rt.addToCache(g,m),v===0&&(h[n]=g,Wt.addToCache(g.baseTexture,n),Rt.addToCache(g,n)),h[m]=g}),Object.assign(e,{textures:h})}}catch(d){t(d);return}t()},r.extension=yr.Loader,r.loadKeyValueData=!1,r})();/*!
  929. * @pixi/particle-container - v6.5.10
  930. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  931. *
  932. * @pixi/particle-container is licensed under the MIT License.
  933. * http://www.opensource.org/licenses/mit-license
  934. *//*! *****************************************************************************
  935. Copyright (c) Microsoft Corporation.
  936. Permission to use, copy, modify, and/or distribute this software for any
  937. purpose with or without fee is hereby granted.
  938. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  939. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  940. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  941. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  942. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  943. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  944. PERFORMANCE OF THIS SOFTWARE.
  945. ***************************************************************************** */var z4=function(r,e){return z4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},z4(r,e)};function YD(r,e){z4(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var fZ=(function(r){YD(e,r);function e(t,n,i,a){t===void 0&&(t=1500),i===void 0&&(i=16384),a===void 0&&(a=!1);var s=r.call(this)||this,o=16384;return i>o&&(i=o),s._properties=[!1,!0,!1,!1,!1],s._maxSize=t,s._batchSize=i,s._buffers=null,s._bufferUpdateIDs=[],s._updateID=0,s.interactiveChildren=!1,s.blendMode=Et.NORMAL,s.autoResize=a,s.roundPixels=!0,s.baseTexture=null,s.setProperties(n),s._tint=0,s.tintRgb=new Float32Array(4),s.tint=16777215,s}return e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,pu(t,this.tintRgb)},enumerable:!1,configurable:!0}),e.prototype.render=function(t){var n=this;!this.visible||this.worldAlpha<=0||!this.children.length||!this.renderable||(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return n.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var n=Math.floor(t/this._batchSize);this._bufferUpdateIDs.length<n;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[n]=++this._updateID},e.prototype.dispose=function(){if(this._buffers){for(var t=0;t<this._buffers.length;++t)this._buffers[t].destroy();this._buffers=null}},e.prototype.destroy=function(t){r.prototype.destroy.call(this,t),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null},e})(_a),cA=(function(){function r(e,t,n){this.geometry=new ah,this.indexBuffer=null,this.size=n,this.dynamicProperties=[],this.staticProperties=[];for(var i=0;i<e.length;++i){var a=e[i];a={attributeName:a.attributeName,size:a.size,uploadFunction:a.uploadFunction,type:a.type||wt.FLOAT,offset:a.offset},t[i]?this.dynamicProperties.push(a):this.staticProperties.push(a)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()}return r.prototype.initBuffers=function(){var e=this.geometry,t=0;this.indexBuffer=new wn(HO(this.size),!0,!0),e.addIndex(this.indexBuffer),this.dynamicStride=0;for(var n=0;n<this.dynamicProperties.length;++n){var i=this.dynamicProperties[n];i.offset=t,t+=i.size,this.dynamicStride+=i.size}var a=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(a),this.dynamicDataUint32=new Uint32Array(a),this.dynamicBuffer=new wn(this.dynamicData,!1,!1);var s=0;this.staticStride=0;for(var n=0;n<this.staticProperties.length;++n){var i=this.staticProperties[n];i.offset=s,s+=i.size,this.staticStride+=i.size}var o=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(o),this.staticDataUint32=new Uint32Array(o),this.staticBuffer=new wn(this.staticData,!0,!1);for(var n=0;n<this.dynamicProperties.length;++n){var i=this.dynamicProperties[n];e.addAttribute(i.attributeName,this.dynamicBuffer,0,i.type===wt.UNSIGNED_BYTE,i.type,this.dynamicStride*4,i.offset*4)}for(var n=0;n<this.staticProperties.length;++n){var i=this.staticProperties[n];e.addAttribute(i.attributeName,this.staticBuffer,0,i.type===wt.UNSIGNED_BYTE,i.type,this.staticStride*4,i.offset*4)}},r.prototype.uploadDynamic=function(e,t,n){for(var i=0;i<this.dynamicProperties.length;i++){var a=this.dynamicProperties[i];a.uploadFunction(e,t,n,a.type===wt.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,a.offset)}this.dynamicBuffer._updateID++},r.prototype.uploadStatic=function(e,t,n){for(var i=0;i<this.staticProperties.length;i++){var a=this.staticProperties[i];a.uploadFunction(e,t,n,a.type===wt.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,a.offset)}this.staticBuffer._updateID++},r.prototype.destroy=function(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()},r})(),dZ=`varying vec2 vTextureCoord;
  946. varying vec4 vColor;
  947. uniform sampler2D uSampler;
  948. void main(void){
  949. vec4 color = texture2D(uSampler, vTextureCoord) * vColor;
  950. gl_FragColor = color;
  951. }`,vZ=`attribute vec2 aVertexPosition;
  952. attribute vec2 aTextureCoord;
  953. attribute vec4 aColor;
  954. attribute vec2 aPositionCoord;
  955. attribute float aRotation;
  956. uniform mat3 translationMatrix;
  957. uniform vec4 uColor;
  958. varying vec2 vTextureCoord;
  959. varying vec4 vColor;
  960. void main(void){
  961. float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);
  962. float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);
  963. vec2 v = vec2(x, y);
  964. v = v + aPositionCoord;
  965. gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);
  966. vTextureCoord = aTextureCoord;
  967. vColor = aColor * uColor;
  968. }
  969. `,WD=(function(r){YD(e,r);function e(t){var n=r.call(this,t)||this;return n.shader=null,n.properties=null,n.tempMatrix=new qr,n.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:n.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:n.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:n.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:n.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:wt.UNSIGNED_BYTE,uploadFunction:n.uploadTint,offset:0}],n.shader=Gs.from(vZ,dZ,{}),n.state=gl.for2d(),n}return e.prototype.render=function(t){var n=t.children,i=t._maxSize,a=t._batchSize,s=this.renderer,o=n.length;if(o!==0){o>i&&!t.autoResize&&(o=i);var l=t._buffers;l||(l=t._buffers=this.generateBuffers(t));var c=n[0]._texture.baseTexture,h=c.alphaMode>0;this.state.blendMode=ww(t.blendMode,h),s.state.set(this.state);var d=s.gl,v=t.worldTransform.copyTo(this.tempMatrix);v.prepend(s.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=v.toArray(!0),this.shader.uniforms.uColor=GO(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,h),this.shader.uniforms.uSampler=c,this.renderer.shader.bind(this.shader);for(var g=!1,m=0,x=0;m<o;m+=a,x+=1){var y=o-m;y>a&&(y=a),x>=l.length&&l.push(this._generateOneMoreBuffer(t));var _=l[x];_.uploadDynamic(n,m,y);var w=t._bufferUpdateIDs[x]||0;g=g||_._updateID<w,g&&(_._updateID=t._updateID,_.uploadStatic(n,m,y)),s.geometry.bind(_.geometry),d.drawElements(d.TRIANGLES,y*6,d.UNSIGNED_SHORT,0)}}},e.prototype.generateBuffers=function(t){for(var n=[],i=t._maxSize,a=t._batchSize,s=t._properties,o=0;o<i;o+=a)n.push(new cA(this.properties,s,a));return n},e.prototype._generateOneMoreBuffer=function(t){var n=t._batchSize,i=t._properties;return new cA(this.properties,i,n)},e.prototype.uploadVertices=function(t,n,i,a,s,o){for(var l=0,c=0,h=0,d=0,v=0;v<i;++v){var g=t[n+v],m=g._texture,x=g.scale.x,y=g.scale.y,_=m.trim,w=m.orig;_?(c=_.x-g.anchor.x*w.width,l=c+_.width,d=_.y-g.anchor.y*w.height,h=d+_.height):(l=w.width*(1-g.anchor.x),c=w.width*-g.anchor.x,h=w.height*(1-g.anchor.y),d=w.height*-g.anchor.y),a[o]=c*x,a[o+1]=d*y,a[o+s]=l*x,a[o+s+1]=d*y,a[o+s*2]=l*x,a[o+s*2+1]=h*y,a[o+s*3]=c*x,a[o+s*3+1]=h*y,o+=s*4}},e.prototype.uploadPosition=function(t,n,i,a,s,o){for(var l=0;l<i;l++){var c=t[n+l].position;a[o]=c.x,a[o+1]=c.y,a[o+s]=c.x,a[o+s+1]=c.y,a[o+s*2]=c.x,a[o+s*2+1]=c.y,a[o+s*3]=c.x,a[o+s*3+1]=c.y,o+=s*4}},e.prototype.uploadRotation=function(t,n,i,a,s,o){for(var l=0;l<i;l++){var c=t[n+l].rotation;a[o]=c,a[o+s]=c,a[o+s*2]=c,a[o+s*3]=c,o+=s*4}},e.prototype.uploadUvs=function(t,n,i,a,s,o){for(var l=0;l<i;++l){var c=t[n+l]._texture._uvs;c?(a[o]=c.x0,a[o+1]=c.y0,a[o+s]=c.x1,a[o+s+1]=c.y1,a[o+s*2]=c.x2,a[o+s*2+1]=c.y2,a[o+s*3]=c.x3,a[o+s*3+1]=c.y3,o+=s*4):(a[o]=0,a[o+1]=0,a[o+s]=0,a[o+s+1]=0,a[o+s*2]=0,a[o+s*2+1]=0,a[o+s*3]=0,a[o+s*3+1]=0,o+=s*4)}},e.prototype.uploadTint=function(t,n,i,a,s,o){for(var l=0;l<i;++l){var c=t[n+l],h=c._texture.baseTexture.alphaMode>0,d=c.alpha,v=d<1&&h?Sg(c._tintRGB,d):c._tintRGB+(d*255<<24);a[o]=v,a[o+s]=v,a[o+s*2]=v,a[o+s*3]=v,o+=s*4}},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},e.extension={name:"particle",type:yr.RendererPlugin},e})(kd);/*!
  970. * @pixi/graphics - v6.5.10
  971. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  972. *
  973. * @pixi/graphics is licensed under the MIT License.
  974. * http://www.opensource.org/licenses/mit-license
  975. */var Za;(function(r){r.MITER="miter",r.BEVEL="bevel",r.ROUND="round"})(Za||(Za={}));var Us;(function(r){r.BUTT="butt",r.ROUND="round",r.SQUARE="square"})(Us||(Us={}));var Hc={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(r,e){if(e===void 0&&(e=20),!this.adaptive||!r||isNaN(r))return e;var t=Math.ceil(r/this.maxLength);return t<this.minSegments?t=this.minSegments:t>this.maxSegments&&(t=this.maxSegments),t}},e3=(function(){function r(){this.color=16777215,this.alpha=1,this.texture=Rt.WHITE,this.matrix=null,this.visible=!1,this.reset()}return r.prototype.clone=function(){var e=new r;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e},r.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=Rt.WHITE,this.matrix=null,this.visible=!1},r.prototype.destroy=function(){this.texture=null,this.matrix=null},r})();/*! *****************************************************************************
  976. Copyright (c) Microsoft Corporation.
  977. Permission to use, copy, modify, and/or distribute this software for any
  978. purpose with or without fee is hereby granted.
  979. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  980. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  981. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  982. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  983. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  984. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  985. PERFORMANCE OF THIS SOFTWARE.
  986. ***************************************************************************** */var U4=function(r,e){return U4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},U4(r,e)};function t3(r,e){U4(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function hA(r,e){var t,n;e===void 0&&(e=!1);var i=r.length;if(!(i<6)){for(var a=0,s=0,o=r[i-2],l=r[i-1];s<i;s+=2){var c=r[s],h=r[s+1];a+=(c-o)*(h+l),o=c,l=h}if(!e&&a>0||e&&a<=0)for(var d=i/2,s=d+d%2;s<i;s+=2){var v=i-s-2,g=i-s-1,m=s,x=s+1;t=[r[m],r[v]],r[v]=t[0],r[m]=t[1],n=[r[x],r[g]],r[g]=n[0],r[x]=n[1]}}}var r3={build:function(r){r.points=r.shape.points.slice()},triangulate:function(r,e){var t=r.points,n=r.holes,i=e.points,a=e.indices;if(t.length>=6){hA(t,!1);for(var s=[],o=0;o<n.length;o++){var l=n[o];hA(l.points,!0),s.push(t.length/2),t=t.concat(l.points)}var c=pw(t,s,2);if(!c)return;for(var h=i.length/2,o=0;o<c.length;o+=3)a.push(c[o]+h),a.push(c[o+1]+h),a.push(c[o+2]+h);for(var o=0;o<t.length;o++)i.push(t[o])}}},pd={build:function(r){var e=r.points,t,n,i,a,s,o;if(r.type===Mn.CIRC){var l=r.shape;t=l.x,n=l.y,s=o=l.radius,i=a=0}else if(r.type===Mn.ELIP){var c=r.shape;t=c.x,n=c.y,s=c.width,o=c.height,i=a=0}else{var h=r.shape,d=h.width/2,v=h.height/2;t=h.x+d,n=h.y+v,s=o=Math.max(0,Math.min(h.radius,Math.min(d,v))),i=d-s,a=v-o}if(!(s>=0&&o>=0&&i>=0&&a>=0)){e.length=0;return}var g=Math.ceil(2.3*Math.sqrt(s+o)),m=g*8+(i?4:0)+(a?4:0);if(e.length=m,m!==0){if(g===0){e.length=8,e[0]=e[6]=t+i,e[1]=e[3]=n+a,e[2]=e[4]=t-i,e[5]=e[7]=n-a;return}var x=0,y=g*4+(i?2:0)+2,_=y,w=m;{var S=i+s,A=a,C=t+S,M=t-S,E=n+A;if(e[x++]=C,e[x++]=E,e[--y]=E,e[--y]=M,a){var O=n-A;e[_++]=M,e[_++]=O,e[--w]=O,e[--w]=C}}for(var D=1;D<g;D++){var I=Math.PI/2*(D/g),S=i+Math.cos(I)*s,A=a+Math.sin(I)*o,C=t+S,M=t-S,E=n+A,O=n-A;e[x++]=C,e[x++]=E,e[--y]=E,e[--y]=M,e[_++]=M,e[_++]=O,e[--w]=O,e[--w]=C}{var S=i,A=a+o,C=t+S,M=t-S,E=n+A,O=n-A;e[x++]=C,e[x++]=E,e[--w]=O,e[--w]=C,i&&(e[x++]=M,e[x++]=E,e[--w]=O,e[--w]=M)}}},triangulate:function(r,e){var t=r.points,n=e.points,i=e.indices;if(t.length!==0){var a=n.length/2,s=a,o,l;if(r.type!==Mn.RREC){var c=r.shape;o=c.x,l=c.y}else{var h=r.shape;o=h.x+h.width/2,l=h.y+h.height/2}var d=r.matrix;n.push(r.matrix?d.a*o+d.c*l+d.tx:o,r.matrix?d.b*o+d.d*l+d.ty:l),a++,n.push(t[0],t[1]);for(var v=2;v<t.length;v+=2)n.push(t[v],t[v+1]),i.push(a++,s,a);i.push(s+1,s,a)}}},$D={build:function(r){var e=r.shape,t=e.x,n=e.y,i=e.width,a=e.height,s=r.points;s.length=0,s.push(t,n,t+i,n,t+i,n+a,t,n+a)},triangulate:function(r,e){var t=r.points,n=e.points,i=n.length/2;n.push(t[0],t[1],t[2],t[3],t[6],t[7],t[4],t[5]),e.indices.push(i,i+1,i+2,i+1,i+2,i+3)}};function pc(r,e,t){var n=e-r;return r+n*t}function Lv(r,e,t,n,i,a,s){s===void 0&&(s=[]);for(var o=20,l=s,c=0,h=0,d=0,v=0,g=0,m=0,x=0,y=0;x<=o;++x)y=x/o,c=pc(r,t,y),h=pc(e,n,y),d=pc(t,i,y),v=pc(n,a,y),g=pc(c,d,y),m=pc(h,v,y),!(x===0&&l[l.length-2]===g&&l[l.length-1]===m)&&l.push(g,m);return l}var KD={build:function(r){if(gd.nextRoundedRectBehavior){pd.build(r);return}var e=r.shape,t=r.points,n=e.x,i=e.y,a=e.width,s=e.height,o=Math.max(0,Math.min(e.radius,Math.min(a,s)/2));t.length=0,o?(Lv(n,i+o,n,i,n+o,i,t),Lv(n+a-o,i,n+a,i,n+a,i+o,t),Lv(n+a,i+s-o,n+a,i+s,n+a-o,i+s,t),Lv(n+o,i+s,n,i+s,n,i+s-o,t)):t.push(n,i,n+a,i,n+a,i+s,n,i+s)},triangulate:function(r,e){if(gd.nextRoundedRectBehavior){pd.triangulate(r,e);return}for(var t=r.points,n=e.points,i=e.indices,a=n.length/2,s=pw(t,null,2),o=0,l=s.length;o<l;o+=3)i.push(s[o]+a),i.push(s[o+1]+a),i.push(s[o+2]+a);for(var o=0,l=t.length;o<l;o++)n.push(t[o],t[++o])}};function fA(r,e,t,n,i,a,s,o){var l=r-t*i,c=e-n*i,h=r+t*a,d=e+n*a,v,g;s?(v=n,g=-t):(v=-n,g=t);var m=l+v,x=c+g,y=h+v,_=d+g;return o.push(m,x),o.push(y,_),2}function Gl(r,e,t,n,i,a,s,o){var l=t-r,c=n-e,h=Math.atan2(l,c),d=Math.atan2(i-r,a-e);o&&h<d?h+=Math.PI*2:!o&&h>d&&(d+=Math.PI*2);var v=h,g=d-h,m=Math.abs(g),x=Math.sqrt(l*l+c*c),y=(15*m*Math.sqrt(x)/Math.PI>>0)+1,_=g/y;if(v+=_,o){s.push(r,e),s.push(t,n);for(var w=1,S=v;w<y;w++,S+=_)s.push(r,e),s.push(r+Math.sin(S)*x,e+Math.cos(S)*x);s.push(r,e),s.push(i,a)}else{s.push(t,n),s.push(r,e);for(var w=1,S=v;w<y;w++,S+=_)s.push(r+Math.sin(S)*x,e+Math.cos(S)*x),s.push(r,e);s.push(i,a),s.push(r,e)}return y*2}function pZ(r,e){var t=r.shape,n=r.points||t.points.slice(),i=e.closePointEps;if(n.length!==0){var a=r.lineStyle,s=new Ar(n[0],n[1]),o=new Ar(n[n.length-2],n[n.length-1]),l=t.type!==Mn.POLY||t.closeStroke,c=Math.abs(s.x-o.x)<i&&Math.abs(s.y-o.y)<i;if(l){n=n.slice(),c&&(n.pop(),n.pop(),o.set(n[n.length-2],n[n.length-1]));var h=(s.x+o.x)*.5,d=(o.y+s.y)*.5;n.unshift(h,d),n.push(h,d)}var v=e.points,g=n.length/2,m=n.length,x=v.length/2,y=a.width/2,_=y*y,w=a.miterLimit*a.miterLimit,S=n[0],A=n[1],C=n[2],M=n[3],E=0,O=0,D=-(A-M),I=S-C,k=0,U=0,V=Math.sqrt(D*D+I*I);D/=V,I/=V,D*=y,I*=y;var X=a.alignment,W=(1-X)*2,P=X*2;l||(a.cap===Us.ROUND?m+=Gl(S-D*(W-P)*.5,A-I*(W-P)*.5,S-D*W,A-I*W,S+D*P,A+I*P,v,!0)+2:a.cap===Us.SQUARE&&(m+=fA(S,A,D,I,W,P,!0,v))),v.push(S-D*W,A-I*W),v.push(S+D*P,A+I*P);for(var H=1;H<g-1;++H){S=n[(H-1)*2],A=n[(H-1)*2+1],C=n[H*2],M=n[H*2+1],E=n[(H+1)*2],O=n[(H+1)*2+1],D=-(A-M),I=S-C,V=Math.sqrt(D*D+I*I),D/=V,I/=V,D*=y,I*=y,k=-(M-O),U=C-E,V=Math.sqrt(k*k+U*U),k/=V,U/=V,k*=y,U*=y;var z=C-S,$=A-M,B=C-E,L=O-M,Y=z*B+$*L,G=$*B-L*z,re=G<0;if(Math.abs(G)<.001*Math.abs(Y)){v.push(C-D*W,M-I*W),v.push(C+D*P,M+I*P),Y>=0&&(a.join===Za.ROUND?m+=Gl(C,M,C-D*W,M-I*W,C-k*W,M-U*W,v,!1)+4:m+=2,v.push(C-k*P,M-U*P),v.push(C+k*W,M+U*W));continue}var ie=(-D+S)*(-I+M)-(-D+C)*(-I+A),le=(-k+E)*(-U+M)-(-k+C)*(-U+O),ce=(z*le-B*ie)/G,_e=(L*ie-$*le)/G,pe=(ce-C)*(ce-C)+(_e-M)*(_e-M),ae=C+(ce-C)*W,oe=M+(_e-M)*W,de=C-(ce-C)*P,ye=M-(_e-M)*P,Ee=Math.min(z*z+$*$,B*B+L*L),Re=re?W:P,Ne=Ee+Re*Re*_,Be=pe<=Ne;Be?a.join===Za.BEVEL||pe/_>w?(re?(v.push(ae,oe),v.push(C+D*P,M+I*P),v.push(ae,oe),v.push(C+k*P,M+U*P)):(v.push(C-D*W,M-I*W),v.push(de,ye),v.push(C-k*W,M-U*W),v.push(de,ye)),m+=2):a.join===Za.ROUND?re?(v.push(ae,oe),v.push(C+D*P,M+I*P),m+=Gl(C,M,C+D*P,M+I*P,C+k*P,M+U*P,v,!0)+4,v.push(ae,oe),v.push(C+k*P,M+U*P)):(v.push(C-D*W,M-I*W),v.push(de,ye),m+=Gl(C,M,C-D*W,M-I*W,C-k*W,M-U*W,v,!1)+4,v.push(C-k*W,M-U*W),v.push(de,ye)):(v.push(ae,oe),v.push(de,ye)):(v.push(C-D*W,M-I*W),v.push(C+D*P,M+I*P),a.join===Za.ROUND?re?m+=Gl(C,M,C+D*P,M+I*P,C+k*P,M+U*P,v,!0)+2:m+=Gl(C,M,C-D*W,M-I*W,C-k*W,M-U*W,v,!1)+2:a.join===Za.MITER&&pe/_<=w&&(re?(v.push(de,ye),v.push(de,ye)):(v.push(ae,oe),v.push(ae,oe)),m+=2),v.push(C-k*W,M-U*W),v.push(C+k*P,M+U*P),m+=2)}S=n[(g-2)*2],A=n[(g-2)*2+1],C=n[(g-1)*2],M=n[(g-1)*2+1],D=-(A-M),I=S-C,V=Math.sqrt(D*D+I*I),D/=V,I/=V,D*=y,I*=y,v.push(C-D*W,M-I*W),v.push(C+D*P,M+I*P),l||(a.cap===Us.ROUND?m+=Gl(C-D*(W-P)*.5,M-I*(W-P)*.5,C-D*W,M-I*W,C+D*P,M+I*P,v,!1)+2:a.cap===Us.SQUARE&&(m+=fA(C,M,D,I,W,P,!1,v)));for(var $e=e.indices,Ye=Hc.epsilon*Hc.epsilon,H=x;H<m+x-2;++H)S=v[H*2],A=v[H*2+1],C=v[(H+1)*2],M=v[(H+1)*2+1],E=v[(H+2)*2],O=v[(H+2)*2+1],!(Math.abs(S*(M-O)+C*(O-A)+E*(A-M))<Ye)&&$e.push(H,H+1,H+2)}}function gZ(r,e){var t=0,n=r.shape,i=r.points||n.points,a=n.type!==Mn.POLY||n.closeStroke;if(i.length!==0){var s=e.points,o=e.indices,l=i.length/2,c=s.length/2,h=c;for(s.push(i[0],i[1]),t=1;t<l;t++)s.push(i[t*2],i[t*2+1]),o.push(h,h+1),h++;a&&o.push(h,c)}}function G4(r,e){r.lineStyle.native?gZ(r,e):pZ(r,e)}var H4=(function(){function r(){}return r.curveTo=function(e,t,n,i,a,s){var o=s[s.length-2],l=s[s.length-1],c=l-t,h=o-e,d=i-t,v=n-e,g=Math.abs(c*v-h*d);if(g<1e-8||a===0)return(s[s.length-2]!==e||s[s.length-1]!==t)&&s.push(e,t),null;var m=c*c+h*h,x=d*d+v*v,y=c*d+h*v,_=a*Math.sqrt(m)/g,w=a*Math.sqrt(x)/g,S=_*y/m,A=w*y/x,C=_*v+w*h,M=_*d+w*c,E=h*(w+S),O=c*(w+S),D=v*(_+A),I=d*(_+A),k=Math.atan2(O-M,E-C),U=Math.atan2(I-M,D-C);return{cx:C+e,cy:M+t,radius:a,startAngle:k,endAngle:U,anticlockwise:h*d>v*c}},r.arc=function(e,t,n,i,a,s,o,l,c){for(var h=o-s,d=Hc._segmentsCount(Math.abs(h)*a,Math.ceil(Math.abs(h)/cd)*40),v=h/(d*2),g=v*2,m=Math.cos(v),x=Math.sin(v),y=d-1,_=y%1/y,w=0;w<=y;++w){var S=w+_*w,A=v+s+g*S,C=Math.cos(A),M=-Math.sin(A);c.push((m*C+x*M)*a+n,(m*-M+x*C)*a+i)}},r})(),ZD=(function(){function r(){}return r.curveLength=function(e,t,n,i,a,s,o,l){for(var c=10,h=0,d=0,v=0,g=0,m=0,x=0,y=0,_=0,w=0,S=0,A=0,C=e,M=t,E=1;E<=c;++E)d=E/c,v=d*d,g=v*d,m=1-d,x=m*m,y=x*m,_=y*e+3*x*d*n+3*m*v*a+g*o,w=y*t+3*x*d*i+3*m*v*s+g*l,S=C-_,A=M-w,C=_,M=w,h+=Math.sqrt(S*S+A*A);return h},r.curveTo=function(e,t,n,i,a,s,o){var l=o[o.length-2],c=o[o.length-1];o.length-=2;var h=Hc._segmentsCount(r.curveLength(l,c,e,t,n,i,a,s)),d=0,v=0,g=0,m=0,x=0;o.push(l,c);for(var y=1,_=0;y<=h;++y)_=y/h,d=1-_,v=d*d,g=v*d,m=_*_,x=m*_,o.push(g*l+3*v*_*e+3*d*m*n+x*a,g*c+3*v*_*t+3*d*m*i+x*s)},r})(),QD=(function(){function r(){}return r.curveLength=function(e,t,n,i,a,s){var o=e-2*n+a,l=t-2*i+s,c=2*n-2*e,h=2*i-2*t,d=4*(o*o+l*l),v=4*(o*c+l*h),g=c*c+h*h,m=2*Math.sqrt(d+v+g),x=Math.sqrt(d),y=2*d*x,_=2*Math.sqrt(g),w=v/x;return(y*m+x*v*(m-_)+(4*g*d-v*v)*Math.log((2*x+w+m)/(w+_)))/(4*y)},r.curveTo=function(e,t,n,i,a){for(var s=a[a.length-2],o=a[a.length-1],l=Hc._segmentsCount(r.curveLength(s,o,e,t,n,i)),c=0,h=0,d=1;d<=l;++d){var v=d/l;c=s+(e-s)*v,h=o+(t-o)*v,a.push(c+(e+(n-e)*v-c)*v,h+(t+(i-t)*v-h)*v)}},r})(),JD=(function(){function r(){this.reset()}return r.prototype.begin=function(e,t,n){this.reset(),this.style=e,this.start=t,this.attribStart=n},r.prototype.end=function(e,t){this.attribSize=t-this.attribStart,this.size=e-this.start},r.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},r})(),Hl,gp=(Hl={},Hl[Mn.POLY]=r3,Hl[Mn.CIRC]=pd,Hl[Mn.ELIP]=pd,Hl[Mn.RECT]=$D,Hl[Mn.RREC]=KD,Hl),j4=[],Df=[],V4=(function(){function r(e,t,n,i){t===void 0&&(t=null),n===void 0&&(n=null),i===void 0&&(i=null),this.points=[],this.holes=[],this.shape=e,this.lineStyle=n,this.fillStyle=t,this.matrix=i,this.type=e.type}return r.prototype.clone=function(){return new r(this.shape,this.fillStyle,this.lineStyle,this.matrix)},r.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},r})(),gc=new Ar,eP=(function(r){t3(e,r);function e(){var t=r.call(this)||this;return t.closePointEps=1e-4,t.boundsPadding=0,t.uvsFloat32=null,t.indicesUint16=null,t.batchable=!1,t.points=[],t.colors=[],t.uvs=[],t.indices=[],t.textureIds=[],t.graphicsData=[],t.drawCalls=[],t.batchDirty=-1,t.batches=[],t.dirty=0,t.cacheDirty=-1,t.clearDirty=0,t.shapeIndex=0,t._bounds=new hd,t.boundsDirty=-1,t}return Object.defineProperty(e.prototype,"bounds",{get:function(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),e.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),Df.push(this.drawCalls[t]);this.drawCalls.length=0;for(var t=0;t<this.batches.length;t++){var n=this.batches[t];n.reset(),j4.push(n)}this.batches.length=0},e.prototype.clear=function(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},e.prototype.drawShape=function(t,n,i,a){n===void 0&&(n=null),i===void 0&&(i=null),a===void 0&&(a=null);var s=new V4(t,n,i,a);return this.graphicsData.push(s),this.dirty++,this},e.prototype.drawHole=function(t,n){if(n===void 0&&(n=null),!this.graphicsData.length)return null;var i=new V4(t,null,null,n),a=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=a.lineStyle,a.holes.push(i),this.dirty++,this},e.prototype.destroy=function(){r.prototype.destroy.call(this);for(var t=0;t<this.graphicsData.length;++t)this.graphicsData[t].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null},e.prototype.containsPoint=function(t){for(var n=this.graphicsData,i=0;i<n.length;++i){var a=n[i];if(a.fillStyle.visible&&a.shape&&(a.matrix?a.matrix.applyInverse(t,gc):gc.copyFrom(t),a.shape.contains(gc.x,gc.y))){var s=!1;if(a.holes)for(var o=0;o<a.holes.length;o++){var l=a.holes[o];if(l.shape.contains(gc.x,gc.y)){s=!0;break}}if(!s)return!0}}return!1},e.prototype.updateBatches=function(){if(!this.graphicsData.length){this.batchable=!0;return}if(this.validateBatching()){this.cacheDirty=this.dirty;var t=this.uvs,n=this.graphicsData,i=null,a=null;this.batches.length>0&&(i=this.batches[this.batches.length-1],a=i.style);for(var s=this.shapeIndex;s<n.length;s++){this.shapeIndex++;var o=n[s],l=o.fillStyle,c=o.lineStyle,h=gp[o.type];h.build(o),o.matrix&&this.transformPoints(o.points,o.matrix),(l.visible||c.visible)&&this.processHoles(o.holes);for(var d=0;d<2;d++){var v=d===0?l:c;if(v.visible){var g=v.texture.baseTexture,m=this.indices.length,x=this.points.length/2;g.wrapMode=Ia.REPEAT,d===0?this.processFill(o):this.processLine(o);var y=this.points.length/2-x;y!==0&&(i&&!this._compareStyles(a,v)&&(i.end(m,x),i=null),i||(i=j4.pop()||new JD,i.begin(v,m,x),this.batches.push(i),a=v),this.addUvs(this.points,t,v.texture,x,y,v.matrix))}}}var _=this.indices.length,w=this.points.length/2;if(i&&i.end(_,w),this.batches.length===0){this.batchable=!0;return}var S=w>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&S===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=S?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}},e.prototype._compareStyles=function(t,n){return!(!t||!n||t.texture.baseTexture!==n.texture.baseTexture||t.color+t.alpha!==n.color+n.alpha||!!t.native!=!!n.native)},e.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var t=0,n=this.graphicsData.length;t<n;t++){var i=this.graphicsData[t],a=i.fillStyle,s=i.lineStyle;if(a&&!a.texture.baseTexture.valid||s&&!s.texture.baseTexture.valid)return!1}return!0},e.prototype.packBatches=function(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);for(var t=this.batches,n=0,i=t.length;n<i;n++)for(var a=t[n],s=0;s<a.size;s++){var o=a.start+s;this.indicesUint16[o]=this.indicesUint16[o]-a.attribStart}},e.prototype.isBatchable=function(){if(this.points.length>65535*2)return!1;for(var t=this.batches,n=0;n<t.length;n++)if(t[n].style.native)return!1;return this.points.length<e.BATCHABLE_SIZE*2},e.prototype.buildDrawCalls=function(){for(var t=++Wt._globalBatch,n=0;n<this.drawCalls.length;n++)this.drawCalls[n].texArray.clear(),Df.push(this.drawCalls[n]);this.drawCalls.length=0;var i=this.colors,a=this.textureIds,s=Df.pop();s||(s=new Up,s.texArray=new Gp),s.texArray.count=0,s.start=0,s.size=0,s.type=pa.TRIANGLES;var o=0,l=null,c=0,h=!1,d=pa.TRIANGLES,v=0;this.drawCalls.push(s);for(var n=0;n<this.batches.length;n++){var g=this.batches[n],m=8,x=g.style,y=x.texture.baseTexture;h!==!!x.native&&(h=!!x.native,d=h?pa.LINES:pa.TRIANGLES,l=null,o=m,t++),l!==y&&(l=y,y._batchEnabled!==t&&(o===m&&(t++,o=0,s.size>0&&(s=Df.pop(),s||(s=new Up,s.texArray=new Gp),this.drawCalls.push(s)),s.start=v,s.size=0,s.texArray.count=0,s.type=d),y.touched=1,y._batchEnabled=t,y._batchLocation=o,y.wrapMode=Ia.REPEAT,s.texArray.elements[s.texArray.count++]=y,o++)),s.size+=g.size,v+=g.size,c=y._batchLocation,this.addColors(i,x.color,x.alpha,g.attribSize,g.attribStart),this.addTextureIds(a,c,g.attribSize,g.attribStart)}Wt._globalBatch=t,this.packAttributes()},e.prototype.packAttributes=function(){for(var t=this.points,n=this.uvs,i=this.colors,a=this.textureIds,s=new ArrayBuffer(t.length*3*4),o=new Float32Array(s),l=new Uint32Array(s),c=0,h=0;h<t.length/2;h++)o[c++]=t[h*2],o[c++]=t[h*2+1],o[c++]=n[h*2],o[c++]=n[h*2+1],l[c++]=i[h],o[c++]=a[h];this._buffer.update(s),this._indexBuffer.update(this.indicesUint16)},e.prototype.processFill=function(t){if(t.holes.length)r3.triangulate(t,this);else{var n=gp[t.type];n.triangulate(t,this)}},e.prototype.processLine=function(t){G4(t,this);for(var n=0;n<t.holes.length;n++)G4(t.holes[n],this)},e.prototype.processHoles=function(t){for(var n=0;n<t.length;n++){var i=t[n],a=gp[i.type];a.build(i),i.matrix&&this.transformPoints(i.points,i.matrix)}},e.prototype.calculateBounds=function(){var t=this._bounds;t.clear(),t.addVertexData(this.points,0,this.points.length),t.pad(this.boundsPadding,this.boundsPadding)},e.prototype.transformPoints=function(t,n){for(var i=0;i<t.length/2;i++){var a=t[i*2],s=t[i*2+1];t[i*2]=n.a*a+n.c*s+n.tx,t[i*2+1]=n.b*a+n.d*s+n.ty}},e.prototype.addColors=function(t,n,i,a,s){s===void 0&&(s=0);var o=(n>>16)+(n&65280)+((n&255)<<16),l=Sg(o,i);t.length=Math.max(t.length,s+a);for(var c=0;c<a;c++)t[s+c]=l},e.prototype.addTextureIds=function(t,n,i,a){a===void 0&&(a=0),t.length=Math.max(t.length,a+i);for(var s=0;s<i;s++)t[a+s]=n},e.prototype.addUvs=function(t,n,i,a,s,o){o===void 0&&(o=null);for(var l=0,c=n.length,h=i.frame;l<s;){var d=t[(a+l)*2],v=t[(a+l)*2+1];if(o){var g=o.a*d+o.c*v+o.tx;v=o.b*d+o.d*v+o.ty,d=g}l++,n.push(d/h.width,v/h.height)}var m=i.baseTexture;(h.width<m.width||h.height<m.height)&&this.adjustUvs(n,i,c,s)},e.prototype.adjustUvs=function(t,n,i,a){for(var s=n.baseTexture,o=1e-6,l=i+a*2,c=n.frame,h=c.width/s.width,d=c.height/s.height,v=c.x/c.width,g=c.y/c.height,m=Math.floor(t[i]+o),x=Math.floor(t[i+1]+o),y=i+2;y<l;y+=2)m=Math.min(m,Math.floor(t[y]+o)),x=Math.min(x,Math.floor(t[y+1]+o));v-=m,g-=x;for(var y=i;y<l;y+=2)t[y]=(t[y]+v)*h,t[y+1]=(t[y+1]+g)*d},e.BATCHABLE_SIZE=100,e})(Zw),tP=(function(r){t3(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.width=0,t.alignment=.5,t.native=!1,t.cap=Us.BUTT,t.join=Za.MITER,t.miterLimit=10,t}return e.prototype.clone=function(){var t=new e;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t.width=this.width,t.alignment=this.alignment,t.native=this.native,t.cap=this.cap,t.join=this.join,t.miterLimit=this.miterLimit,t},e.prototype.reset=function(){r.prototype.reset.call(this),this.color=0,this.alignment=.5,this.width=0,this.native=!1},e})(e3),mZ=new Float32Array(3),sx={},gd=(function(r){t3(e,r);function e(t){t===void 0&&(t=null);var n=r.call(this)||this;return n.shader=null,n.pluginName="batch",n.currentPath=null,n.batches=[],n.batchTint=-1,n.batchDirty=-1,n.vertexData=null,n._fillStyle=new e3,n._lineStyle=new tP,n._matrix=null,n._holeMode=!1,n.state=gl.for2d(),n._geometry=t||new eP,n._geometry.refCount++,n._transformID=-1,n.tint=16777215,n.blendMode=Et.NORMAL,n}return Object.defineProperty(e.prototype,"geometry",{get:function(){return this._geometry},enumerable:!1,configurable:!0}),e.prototype.clone=function(){return this.finishPoly(),new e(this._geometry)},Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fill",{get:function(){return this._fillStyle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"line",{get:function(){return this._lineStyle},enumerable:!1,configurable:!0}),e.prototype.lineStyle=function(t,n,i,a,s){return t===void 0&&(t=null),n===void 0&&(n=0),i===void 0&&(i=1),a===void 0&&(a=.5),s===void 0&&(s=!1),typeof t=="number"&&(t={width:t,color:n,alpha:i,alignment:a,native:s}),this.lineTextureStyle(t)},e.prototype.lineTextureStyle=function(t){t=Object.assign({width:0,texture:Rt.WHITE,color:t&&t.texture?16777215:0,alpha:1,matrix:null,alignment:.5,native:!1,cap:Us.BUTT,join:Za.MITER,miterLimit:10},t),this.currentPath&&this.startPoly();var n=t.width>0&&t.alpha>0;return n?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:n},t)):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,n=this.currentPath.points.length;n>2&&(this.drawShape(this.currentPath),this.currentPath=new Uf,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[n-2],t[n-1]))}else this.currentPath=new Uf,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,n){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=n,this},e.prototype.lineTo=function(t,n){this.currentPath||this.moveTo(0,0);var i=this.currentPath.points,a=i[i.length-2],s=i[i.length-1];return(a!==t||s!==n)&&i.push(t,n),this},e.prototype._initCurve=function(t,n){t===void 0&&(t=0),n===void 0&&(n=0),this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[t,n]):this.moveTo(t,n)},e.prototype.quadraticCurveTo=function(t,n,i,a){this._initCurve();var s=this.currentPath.points;return s.length===0&&this.moveTo(0,0),QD.curveTo(t,n,i,a,s),this},e.prototype.bezierCurveTo=function(t,n,i,a,s,o){return this._initCurve(),ZD.curveTo(t,n,i,a,s,o,this.currentPath.points),this},e.prototype.arcTo=function(t,n,i,a,s){this._initCurve(t,n);var o=this.currentPath.points,l=H4.curveTo(t,n,i,a,s,o);if(l){var c=l.cx,h=l.cy,d=l.radius,v=l.startAngle,g=l.endAngle,m=l.anticlockwise;this.arc(c,h,d,v,g,m)}return this},e.prototype.arc=function(t,n,i,a,s,o){if(o===void 0&&(o=!1),a===s)return this;!o&&s<=a?s+=cd:o&&a<=s&&(a+=cd);var l=s-a;if(l===0)return this;var c=t+Math.cos(a)*i,h=n+Math.sin(a)*i,d=this._geometry.closePointEps,v=this.currentPath?this.currentPath.points:null;if(v){var g=Math.abs(v[v.length-2]-c),m=Math.abs(v[v.length-1]-h);g<d&&m<d||v.push(c,h)}else this.moveTo(c,h),v=this.currentPath.points;return H4.arc(c,h,t,n,i,a,s,o,v),this},e.prototype.beginFill=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=1),this.beginTextureFill({texture:Rt.WHITE,color:t,alpha:n})},e.prototype.beginTextureFill=function(t){t=Object.assign({texture:Rt.WHITE,color:16777215,alpha:1,matrix:null},t),this.currentPath&&this.startPoly();var n=t.alpha>0;return n?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:n},t)):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,n,i,a){return this.drawShape(new $t(t,n,i,a))},e.prototype.drawRoundedRect=function(t,n,i,a,s){return this.drawShape(new KO(t,n,i,a,s))},e.prototype.drawCircle=function(t,n,i){return this.drawShape(new WO(t,n,i))},e.prototype.drawEllipse=function(t,n,i,a){return this.drawShape(new $O(t,n,i,a))},e.prototype.drawPolygon=function(){for(var t=arguments,n=[],i=0;i<arguments.length;i++)n[i]=t[i];var a,s=!0,o=n[0];o.points?(s=o.closeStroke,a=o.points):Array.isArray(n[0])?a=n[0]:a=n;var l=new Uf(a);return l.closeStroke=s,this.drawShape(l),this},e.prototype.drawShape=function(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this},e.prototype.clear=function(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this},e.prototype.isFastRect=function(){var t=this._geometry.graphicsData;return t.length===1&&t[0].shape.type===Mn.RECT&&!t[0].matrix&&!t[0].holes.length&&!(t[0].lineStyle.visible&&t[0].lineStyle.width)},e.prototype._render=function(t){this.finishPoly();var n=this._geometry;n.updateBatches(),n.batchable?(this.batchDirty!==n.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))},e.prototype._populateBatches=function(){var t=this._geometry,n=this.blendMode,i=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=i,this.vertexData=new Float32Array(t.points);for(var a=0;a<i;a++){var s=t.batches[a],o=s.style.color,l=new Float32Array(this.vertexData.buffer,s.attribStart*4*2,s.attribSize*2),c=new Float32Array(t.uvsFloat32.buffer,s.attribStart*4*2,s.attribSize*2),h=new Uint16Array(t.indicesUint16.buffer,s.start*2,s.size),d={vertexData:l,blendMode:n,indices:h,uvs:c,_batchRGB:pu(o),_tintRGB:o,_texture:s.style.texture,alpha:s.style.alpha,worldAlpha:1};this.batches[a]=d}},e.prototype._renderBatched=function(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(var n=0,i=this.batches.length;n<i;n++){var a=this.batches[n];a.worldAlpha=this.worldAlpha*a.alpha,t.plugins[this.pluginName].render(a)}}},e.prototype._renderDirect=function(t){var n=this._resolveDirectShader(t),i=this._geometry,a=this.tint,s=this.worldAlpha,o=n.uniforms,l=i.drawCalls;o.translationMatrix=this.transform.worldTransform,o.tint[0]=(a>>16&255)/255*s,o.tint[1]=(a>>8&255)/255*s,o.tint[2]=(a&255)/255*s,o.tint[3]=s,t.shader.bind(n),t.geometry.bind(i,n),t.state.set(this.state);for(var c=0,h=l.length;c<h;c++)this._renderDrawCallDirect(t,i.drawCalls[c])},e.prototype._renderDrawCallDirect=function(t,n){for(var i=n.texArray,a=n.type,s=n.size,o=n.start,l=i.count,c=0;c<l;c++)t.texture.bind(i.elements[c],c);t.geometry.draw(a,s,o)},e.prototype._resolveDirectShader=function(t){var n=this.shader,i=this.pluginName;if(!n){if(!sx[i]){for(var a=t.plugins[i].MAX_TEXTURES,s=new Int32Array(a),o=0;o<a;o++)s[o]=o;var l={tint:new Float32Array([1,1,1,1]),translationMatrix:new qr,default:Yo.from({uSamplers:s},!0)},c=t.plugins[i]._shader.program;sx[i]=new Gs(c,l)}n=sx[i]}return n},e.prototype._calculateBounds=function(){this.finishPoly();var t=this._geometry;if(t.graphicsData.length){var n=t.bounds,i=n.minX,a=n.minY,s=n.maxX,o=n.maxY;this._bounds.addFrame(this.transform,i,a,s,o)}},e.prototype.containsPoint=function(t){return this.worldTransform.applyInverse(t,e._TEMP_POINT),this._geometry.containsPoint(e._TEMP_POINT)},e.prototype.calculateTints=function(){if(this.batchTint!==this.tint){this.batchTint=this.tint;for(var t=pu(this.tint,mZ),n=0;n<this.batches.length;n++){var i=this.batches[n],a=i._batchRGB,s=t[0]*a[0]*255,o=t[1]*a[1]*255,l=t[2]*a[2]*255,c=(s<<16)+(o<<8)+(l|0);i._tintRGB=(c>>16)+(c&65280)+((c&255)<<16)}}},e.prototype.calculateVertices=function(){var t=this.transform._worldID;if(this._transformID!==t){this._transformID=t;for(var n=this.transform.worldTransform,i=n.a,a=n.b,s=n.c,o=n.d,l=n.tx,c=n.ty,h=this._geometry.points,d=this.vertexData,v=0,g=0;g<h.length;g+=2){var m=h[g],x=h[g+1];d[v++]=i*m+s*x+l,d[v++]=o*x+a*m+c}}},e.prototype.closePath=function(){var t=this.currentPath;return t&&(t.closeStroke=!0,this.finishPoly()),this},e.prototype.setMatrix=function(t){return this._matrix=t,this},e.prototype.beginHole=function(){return this.finishPoly(),this._holeMode=!0,this},e.prototype.endHole=function(){return this.finishPoly(),this._holeMode=!1,this},e.prototype.destroy=function(t){this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,r.prototype.destroy.call(this,t)},e.nextRoundedRectBehavior=!1,e._TEMP_POINT=new Ar,e})(_a),yZ={buildPoly:r3,buildCircle:pd,buildRectangle:$D,buildRoundedRectangle:KD,buildLine:G4,ArcUtils:H4,BezierUtils:ZD,QuadraticUtils:QD,BatchPart:JD,FILL_COMMANDS:gp,BATCH_POOL:j4,DRAW_CALL_POOL:Df};/*!
  987. * @pixi/sprite - v6.5.10
  988. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  989. *
  990. * @pixi/sprite is licensed under the MIT License.
  991. * http://www.opensource.org/licenses/mit-license
  992. *//*! *****************************************************************************
  993. Copyright (c) Microsoft Corporation.
  994. Permission to use, copy, modify, and/or distribute this software for any
  995. purpose with or without fee is hereby granted.
  996. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  997. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  998. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  999. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  1000. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  1001. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  1002. PERFORMANCE OF THIS SOFTWARE.
  1003. ***************************************************************************** */var q4=function(r,e){return q4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},q4(r,e)};function bZ(r,e){q4(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var bf=new Ar,xZ=new Uint16Array([0,1,2,0,2,3]),oh=(function(r){bZ(e,r);function e(t){var n=r.call(this)||this;return n._anchor=new Go(n._onAnchorUpdate,n,t?t.defaultAnchor.x:0,t?t.defaultAnchor.y:0),n._texture=null,n._width=0,n._height=0,n._tint=null,n._tintRGB=null,n.tint=16777215,n.blendMode=Et.NORMAL,n._cachedTint=16777215,n.uvs=null,n.texture=t||Rt.EMPTY,n.vertexData=new Float32Array(8),n.vertexTrimmedData=null,n._transformID=-1,n._textureID=-1,n._transformTrimmedID=-1,n._textureTrimmedID=-1,n.indices=xZ,n.pluginName="batch",n.isSprite=!0,n._roundPixels=ht.ROUND_PIXELS,n}return e.prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=ou(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=ou(this.scale.y)*this._height/this._texture.orig.height)},e.prototype._onAnchorUpdate=function(){this._transformID=-1,this._transformTrimmedID=-1},e.prototype.calculateVertices=function(){var t=this._texture;if(!(this._transformID===this.transform._worldID&&this._textureID===t._updateID)){this._textureID!==t._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=t._updateID;var n=this.transform.worldTransform,i=n.a,a=n.b,s=n.c,o=n.d,l=n.tx,c=n.ty,h=this.vertexData,d=t.trim,v=t.orig,g=this._anchor,m=0,x=0,y=0,_=0;if(d?(x=d.x-g._x*v.width,m=x+d.width,_=d.y-g._y*v.height,y=_+d.height):(x=-g._x*v.width,m=x+v.width,_=-g._y*v.height,y=_+v.height),h[0]=i*x+s*_+l,h[1]=o*_+a*x+c,h[2]=i*m+s*_+l,h[3]=o*_+a*m+c,h[4]=i*m+s*y+l,h[5]=o*y+a*m+c,h[6]=i*x+s*y+l,h[7]=o*y+a*x+c,this._roundPixels)for(var w=ht.RESOLUTION,S=0;S<h.length;++S)h[S]=Math.round((h[S]*w|0)/w)}},e.prototype.calculateTrimmedVertices=function(){if(!this.vertexTrimmedData)this.vertexTrimmedData=new Float32Array(8);else if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return;this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;var t=this._texture,n=this.vertexTrimmedData,i=t.orig,a=this._anchor,s=this.transform.worldTransform,o=s.a,l=s.b,c=s.c,h=s.d,d=s.tx,v=s.ty,g=-a._x*i.width,m=g+i.width,x=-a._y*i.height,y=x+i.height;n[0]=o*g+c*x+d,n[1]=h*x+l*g+v,n[2]=o*m+c*x+d,n[3]=h*x+l*m+v,n[4]=o*m+c*y+d,n[5]=h*y+l*m+v,n[6]=o*g+c*y+d,n[7]=h*y+l*g+v},e.prototype._render=function(t){this.calculateVertices(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)},e.prototype._calculateBounds=function(){var t=this._texture.trim,n=this._texture.orig;!t||t.width===n.width&&t.height===n.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))},e.prototype.getLocalBounds=function(t){return this.children.length===0?(this._localBounds||(this._localBounds=new hd),this._localBounds.minX=this._texture.orig.width*-this._anchor._x,this._localBounds.minY=this._texture.orig.height*-this._anchor._y,this._localBounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._localBounds.maxY=this._texture.orig.height*(1-this._anchor._y),t||(this._localBoundsRect||(this._localBoundsRect=new $t),t=this._localBoundsRect),this._localBounds.getRectangle(t)):r.prototype.getLocalBounds.call(this,t)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,bf);var n=this._texture.orig.width,i=this._texture.orig.height,a=-n*this.anchor.x,s=0;return bf.x>=a&&bf.x<a+n&&(s=-i*this.anchor.y,bf.y>=s&&bf.y<s+i)},e.prototype.destroy=function(t){r.prototype.destroy.call(this,t),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null;var n=typeof t=="boolean"?t:t&&t.texture;if(n){var i=typeof t=="boolean"?t:t&&t.baseTexture;this._texture.destroy(!!i)}this._texture=null},e.from=function(t,n){var i=t instanceof Rt?t:Rt.from(t,n);return new e(i)},Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){var n=ou(this.scale.x)||1;this.scale.x=n*t/this._texture.orig.width,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return Math.abs(this.scale.y)*this._texture.orig.height},set:function(t){var n=ou(this.scale.y)||1;this.scale.y=n*t/this._texture.orig.height,this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchor",{get:function(){return this._anchor},set:function(t){this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,this._tintRGB=(t>>16)+(t&65280)+((t&255)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||Rt.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),e})(_a);/*!
  1004. * @pixi/text - v6.5.10
  1005. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  1006. *
  1007. * @pixi/text is licensed under the MIT License.
  1008. * http://www.opensource.org/licenses/mit-license
  1009. *//*! *****************************************************************************
  1010. Copyright (c) Microsoft Corporation.
  1011. Permission to use, copy, modify, and/or distribute this software for any
  1012. purpose with or without fee is hereby granted.
  1013. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  1014. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  1015. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  1016. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  1017. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  1018. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  1019. PERFORMANCE OF THIS SOFTWARE.
  1020. ***************************************************************************** */var X4=function(r,e){return X4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},X4(r,e)};function _Z(r,e){X4(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var jc;(function(r){r[r.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",r[r.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"})(jc||(jc={}));var ox={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:jc.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},wZ=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],mu=(function(){function r(e){this.styleID=0,this.reset(),ux(this,e,e)}return r.prototype.clone=function(){var e={};return ux(e,this,ox),new r(e)},r.prototype.reset=function(){ux(this,ox,ox)},Object.defineProperty(r.prototype,"align",{get:function(){return this._align},set:function(e){this._align!==e&&(this._align=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"breakWords",{get:function(){return this._breakWords},set:function(e){this._breakWords!==e&&(this._breakWords=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(e){this._dropShadow!==e&&(this._dropShadow=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(e){this._dropShadowAlpha!==e&&(this._dropShadowAlpha=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(e){this._dropShadowAngle!==e&&(this._dropShadowAngle=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(e){this._dropShadowBlur!==e&&(this._dropShadowBlur=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(e){var t=lx(e);this._dropShadowColor!==t&&(this._dropShadowColor=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(e){this._dropShadowDistance!==e&&(this._dropShadowDistance=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fill",{get:function(){return this._fill},set:function(e){var t=lx(e);this._fill!==t&&(this._fill=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(e){this._fillGradientType!==e&&(this._fillGradientType=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(e){SZ(this._fillGradientStops,e)||(this._fillGradientStops=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(e){this.fontFamily!==e&&(this._fontFamily=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontSize",{get:function(){return this._fontSize},set:function(e){this._fontSize!==e&&(this._fontSize=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(e){this._fontStyle!==e&&(this._fontStyle=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontVariant",{get:function(){return this._fontVariant},set:function(e){this._fontVariant!==e&&(this._fontVariant=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontWeight",{get:function(){return this._fontWeight},set:function(e){this._fontWeight!==e&&(this._fontWeight=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lineHeight",{get:function(){return this._lineHeight},set:function(e){this._lineHeight!==e&&(this._lineHeight=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"leading",{get:function(){return this._leading},set:function(e){this._leading!==e&&(this._leading=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lineJoin",{get:function(){return this._lineJoin},set:function(e){this._lineJoin!==e&&(this._lineJoin=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"miterLimit",{get:function(){return this._miterLimit},set:function(e){this._miterLimit!==e&&(this._miterLimit=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"padding",{get:function(){return this._padding},set:function(e){this._padding!==e&&(this._padding=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"stroke",{get:function(){return this._stroke},set:function(e){var t=lx(e);this._stroke!==t&&(this._stroke=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"strokeThickness",{get:function(){return this._strokeThickness},set:function(e){this._strokeThickness!==e&&(this._strokeThickness=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"textBaseline",{get:function(){return this._textBaseline},set:function(e){this._textBaseline!==e&&(this._textBaseline=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"trim",{get:function(){return this._trim},set:function(e){this._trim!==e&&(this._trim=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"whiteSpace",{get:function(){return this._whiteSpace},set:function(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wordWrap",{get:function(){return this._wordWrap},set:function(e){this._wordWrap!==e&&(this._wordWrap=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wordWrapWidth",{get:function(){return this._wordWrapWidth},set:function(e){this._wordWrapWidth!==e&&(this._wordWrapWidth=e,this.styleID++)},enumerable:!1,configurable:!0}),r.prototype.toFontString=function(){var e=typeof this.fontSize=="number"?this.fontSize+"px":this.fontSize,t=this.fontFamily;Array.isArray(this.fontFamily)||(t=this.fontFamily.split(","));for(var n=t.length-1;n>=0;n--){var i=t[n].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&wZ.indexOf(i)<0&&(i='"'+i+'"'),t[n]=i}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+e+" "+t.join(",")},r})();function dA(r){return typeof r=="number"?bw(r):(typeof r=="string"&&r.indexOf("0x")===0&&(r=r.replace("0x","#")),r)}function lx(r){if(Array.isArray(r)){for(var e=0;e<r.length;++e)r[e]=dA(r[e]);return r}else return dA(r)}function SZ(r,e){if(!Array.isArray(r)||!Array.isArray(e)||r.length!==e.length)return!1;for(var t=0;t<r.length;++t)if(r[t]!==e[t])return!1;return!0}function ux(r,e,t){for(var n in t)Array.isArray(e[n])?r[n]=e[n].slice():r[n]=e[n]}var kv={willReadFrequently:!0},ka=(function(){function r(e,t,n,i,a,s,o,l,c){this.text=e,this.style=t,this.width=n,this.height=i,this.lines=a,this.lineWidths=s,this.lineHeight=o,this.maxLineWidth=l,this.fontProperties=c}return r.measureText=function(e,t,n,i){i===void 0&&(i=r._canvas),n=n??t.wordWrap;var a=t.toFontString(),s=r.measureFont(a);s.fontSize===0&&(s.fontSize=t.fontSize,s.ascent=t.fontSize);var o=i.getContext("2d",kv);o.font=a;for(var l=n?r.wordWrap(e,t,i):e,c=l.split(/(?:\r\n|\r|\n)/),h=new Array(c.length),d=0,v=0;v<c.length;v++){var g=o.measureText(c[v]).width+(c[v].length-1)*t.letterSpacing;h[v]=g,d=Math.max(d,g)}var m=d+t.strokeThickness;t.dropShadow&&(m+=t.dropShadowDistance);var x=t.lineHeight||s.fontSize+t.strokeThickness,y=Math.max(x,s.fontSize+t.strokeThickness)+(c.length-1)*(x+t.leading);return t.dropShadow&&(y+=t.dropShadowDistance),new r(e,t,m,y,c,h,x+t.leading,d,s)},r.wordWrap=function(e,t,n){n===void 0&&(n=r._canvas);for(var i=n.getContext("2d",kv),a=0,s="",o="",l=Object.create(null),c=t.letterSpacing,h=t.whiteSpace,d=r.collapseSpaces(h),v=r.collapseNewlines(h),g=!d,m=t.wordWrapWidth+c,x=r.tokenize(e),y=0;y<x.length;y++){var _=x[y];if(r.isNewline(_)){if(!v){o+=r.addLine(s),g=!d,s="",a=0;continue}_=" "}if(d){var w=r.isBreakingSpace(_),S=r.isBreakingSpace(s[s.length-1]);if(w&&S)continue}var A=r.getFromCache(_,c,l,i);if(A>m)if(s!==""&&(o+=r.addLine(s),s="",a=0),r.canBreakWords(_,t.breakWords))for(var C=r.wordWrapSplit(_),M=0;M<C.length;M++){for(var E=C[M],O=1;C[M+O];){var D=C[M+O],I=E[E.length-1];if(!r.canBreakChars(I,D,_,M,t.breakWords))E+=D;else break;O++}M+=E.length-1;var k=r.getFromCache(E,c,l,i);k+a>m&&(o+=r.addLine(s),g=!1,s="",a=0),s+=E,a+=k}else{s.length>0&&(o+=r.addLine(s),s="",a=0);var U=y===x.length-1;o+=r.addLine(_,!U),g=!1,s="",a=0}else A+a>m&&(g=!1,o+=r.addLine(s),s="",a=0),(s.length>0||!r.isBreakingSpace(_)||g)&&(s+=_,a+=A)}return o+=r.addLine(s,!1),o},r.addLine=function(e,t){return t===void 0&&(t=!0),e=r.trimRight(e),e=t?e+`
  1021. `:e,e},r.getFromCache=function(e,t,n,i){var a=n[e];if(typeof a!="number"){var s=e.length*t;a=i.measureText(e).width+s,n[e]=a}return a},r.collapseSpaces=function(e){return e==="normal"||e==="pre-line"},r.collapseNewlines=function(e){return e==="normal"},r.trimRight=function(e){if(typeof e!="string")return"";for(var t=e.length-1;t>=0;t--){var n=e[t];if(!r.isBreakingSpace(n))break;e=e.slice(0,-1)}return e},r.isNewline=function(e){return typeof e!="string"?!1:r._newlines.indexOf(e.charCodeAt(0))>=0},r.isBreakingSpace=function(e,t){return typeof e!="string"?!1:r._breakingSpaces.indexOf(e.charCodeAt(0))>=0},r.tokenize=function(e){var t=[],n="";if(typeof e!="string")return t;for(var i=0;i<e.length;i++){var a=e[i],s=e[i+1];if(r.isBreakingSpace(a,s)||r.isNewline(a)){n!==""&&(t.push(n),n=""),t.push(a);continue}n+=a}return n!==""&&t.push(n),t},r.canBreakWords=function(e,t){return t},r.canBreakChars=function(e,t,n,i,a){return!0},r.wordWrapSplit=function(e){return e.split("")},r.measureFont=function(e){if(r._fonts[e])return r._fonts[e];var t={ascent:0,descent:0,fontSize:0},n=r._canvas,i=r._context;i.font=e;var a=r.METRICS_STRING+r.BASELINE_SYMBOL,s=Math.ceil(i.measureText(a).width),o=Math.ceil(i.measureText(r.BASELINE_SYMBOL).width),l=Math.ceil(r.HEIGHT_MULTIPLIER*o);o=o*r.BASELINE_MULTIPLIER|0,n.width=s,n.height=l,i.fillStyle="#f00",i.fillRect(0,0,s,l),i.font=e,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(a,0,o);var c=i.getImageData(0,0,s,l).data,h=c.length,d=s*4,v=0,g=0,m=!1;for(v=0;v<o;++v){for(var x=0;x<d;x+=4)if(c[g+x]!==255){m=!0;break}if(!m)g+=d;else break}for(t.ascent=o-v,g=h-d,m=!1,v=l;v>o;--v){for(var x=0;x<d;x+=4)if(c[g+x]!==255){m=!0;break}if(!m)g-=d;else break}return t.descent=v-o,t.fontSize=t.ascent+t.descent,r._fonts[e]=t,t},r.clearMetrics=function(e){e===void 0&&(e=""),e?delete r._fonts[e]:r._fonts={}},Object.defineProperty(r,"_canvas",{get:function(){if(!r.__canvas){var e=void 0;try{var t=new OffscreenCanvas(0,0),n=t.getContext("2d",kv);if(n&&n.measureText)return r.__canvas=t,t;e=ht.ADAPTER.createCanvas()}catch{e=ht.ADAPTER.createCanvas()}e.width=e.height=10,r.__canvas=e}return r.__canvas},enumerable:!1,configurable:!0}),Object.defineProperty(r,"_context",{get:function(){return r.__context||(r.__context=r._canvas.getContext("2d",kv)),r.__context},enumerable:!1,configurable:!0}),r})();ka._fonts={};ka.METRICS_STRING="|ÉqÅ";ka.BASELINE_SYMBOL="M";ka.BASELINE_MULTIPLIER=1.4;ka.HEIGHT_MULTIPLIER=2;ka._newlines=[10,13];ka._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];var EZ={texture:!0,children:!1,baseTexture:!0},n3=(function(r){_Z(e,r);function e(t,n,i){var a=this,s=!1;i||(i=ht.ADAPTER.createCanvas(),s=!0),i.width=3,i.height=3;var o=Rt.from(i);return o.orig=new $t,o.trim=new $t,a=r.call(this,o)||this,a._ownCanvas=s,a.canvas=i,a.context=i.getContext("2d",{willReadFrequently:!0}),a._resolution=ht.RESOLUTION,a._autoResolution=!0,a._text=null,a._style=null,a._styleListener=null,a._font="",a.text=t,a.style=n,a.localStyleID=-1,a}return e.prototype.updateText=function(t){var n=this._style;if(this.localStyleID!==n.styleID&&(this.dirty=!0,this.localStyleID=n.styleID),!(!this.dirty&&t)){this._font=this._style.toFontString();var i=this.context,a=ka.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),s=a.width,o=a.height,l=a.lines,c=a.lineHeight,h=a.lineWidths,d=a.maxLineWidth,v=a.fontProperties;this.canvas.width=Math.ceil(Math.ceil(Math.max(1,s)+n.padding*2)*this._resolution),this.canvas.height=Math.ceil(Math.ceil(Math.max(1,o)+n.padding*2)*this._resolution),i.scale(this._resolution,this._resolution),i.clearRect(0,0,this.canvas.width,this.canvas.height),i.font=this._font,i.lineWidth=n.strokeThickness,i.textBaseline=n.textBaseline,i.lineJoin=n.lineJoin,i.miterLimit=n.miterLimit;for(var g,m,x=n.dropShadow?2:1,y=0;y<x;++y){var _=n.dropShadow&&y===0,w=_?Math.ceil(Math.max(1,o)+n.padding*2):0,S=w*this._resolution;if(_){i.fillStyle="black",i.strokeStyle="black";var A=n.dropShadowColor,C=pu(typeof A=="number"?A:xw(A)),M=n.dropShadowBlur*this._resolution,E=n.dropShadowDistance*this._resolution;i.shadowColor="rgba("+C[0]*255+","+C[1]*255+","+C[2]*255+","+n.dropShadowAlpha+")",i.shadowBlur=M,i.shadowOffsetX=Math.cos(n.dropShadowAngle)*E,i.shadowOffsetY=Math.sin(n.dropShadowAngle)*E+S}else i.fillStyle=this._generateFillStyle(n,l,a),i.strokeStyle=n.stroke,i.shadowColor="black",i.shadowBlur=0,i.shadowOffsetX=0,i.shadowOffsetY=0;var O=(c-v.fontSize)/2;(!e.nextLineHeightBehavior||c-v.fontSize<0)&&(O=0);for(var D=0;D<l.length;D++)g=n.strokeThickness/2,m=n.strokeThickness/2+D*c+v.ascent+O,n.align==="right"?g+=d-h[D]:n.align==="center"&&(g+=(d-h[D])/2),n.stroke&&n.strokeThickness&&this.drawLetterSpacing(l[D],g+n.padding,m+n.padding-w,!0),n.fill&&this.drawLetterSpacing(l[D],g+n.padding,m+n.padding-w)}this.updateTexture()}},e.prototype.drawLetterSpacing=function(t,n,i,a){a===void 0&&(a=!1);var s=this._style,o=s.letterSpacing,l=e.experimentalLetterSpacing&&("letterSpacing"in CanvasRenderingContext2D.prototype||"textLetterSpacing"in CanvasRenderingContext2D.prototype);if(o===0||l){l&&(this.context.letterSpacing=o,this.context.textLetterSpacing=o),a?this.context.strokeText(t,n,i):this.context.fillText(t,n,i);return}for(var c=n,h=Array.from?Array.from(t):t.split(""),d=this.context.measureText(t).width,v=0,g=0;g<h.length;++g){var m=h[g];a?this.context.strokeText(m,c,i):this.context.fillText(m,c,i);for(var x="",y=g+1;y<h.length;++y)x+=h[y];v=this.context.measureText(x).width,c+=d-v+o,d=v}},e.prototype.updateTexture=function(){var t=this.canvas;if(this._style.trim){var n=jO(t);n.data&&(t.width=n.width,t.height=n.height,this.context.putImageData(n.data,0,0))}var i=this._texture,a=this._style,s=a.trim?0:a.padding,o=i.baseTexture;i.trim.width=i._frame.width=t.width/this._resolution,i.trim.height=i._frame.height=t.height/this._resolution,i.trim.x=-s,i.trim.y=-s,i.orig.width=i._frame.width-s*2,i.orig.height=i._frame.height-s*2,this._onTextureUpdate(),o.setRealSize(t.width,t.height,this._resolution),i.updateUvs(),this.dirty=!1},e.prototype._render=function(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),r.prototype._render.call(this,t)},e.prototype.updateTransform=function(){this.updateText(!0),r.prototype.updateTransform.call(this)},e.prototype.getBounds=function(t,n){return this.updateText(!0),this._textureID===-1&&(t=!1),r.prototype.getBounds.call(this,t,n)},e.prototype.getLocalBounds=function(t){return this.updateText(!0),r.prototype.getLocalBounds.call(this,t)},e.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addQuad(this.vertexData)},e.prototype._generateFillStyle=function(t,n,i){var a=t.fill;if(Array.isArray(a)){if(a.length===1)return a[0]}else return a;var s,o=t.dropShadow?t.dropShadowDistance:0,l=t.padding||0,c=this.canvas.width/this._resolution-o-l*2,h=this.canvas.height/this._resolution-o-l*2,d=a.slice(),v=t.fillGradientStops.slice();if(!v.length)for(var g=d.length+1,m=1;m<g;++m)v.push(m/g);if(d.unshift(a[0]),v.unshift(0),d.push(a[a.length-1]),v.push(1),t.fillGradientType===jc.LINEAR_VERTICAL){s=this.context.createLinearGradient(c/2,l,c/2,h+l);for(var x=i.fontProperties.fontSize+t.strokeThickness,m=0;m<n.length;m++){var y=i.lineHeight*(m-1)+x,_=i.lineHeight*m,w=_;m>0&&y>_&&(w=(_+y)/2);var S=_+x,A=i.lineHeight*(m+1),C=S;m+1<n.length&&A<S&&(C=(S+A)/2);for(var M=(C-w)/h,E=0;E<d.length;E++){var O=0;typeof v[E]=="number"?O=v[E]:O=E/d.length;var D=Math.min(1,Math.max(0,w/h+O*M));D=Number(D.toFixed(5)),s.addColorStop(D,d[E])}}}else{s=this.context.createLinearGradient(l,h/2,c+l,h/2);for(var I=d.length+1,k=1,m=0;m<d.length;m++){var U=void 0;typeof v[m]=="number"?U=v[m]:U=k/I,s.addColorStop(U,d[m]),k++}}return s},e.prototype.destroy=function(t){typeof t=="boolean"&&(t={children:t}),t=Object.assign({},EZ,t),r.prototype.destroy.call(this,t),this._ownCanvas&&(this.canvas.height=this.canvas.width=0),this.context=null,this.canvas=null,this._style=null},Object.defineProperty(e.prototype,"width",{get:function(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){this.updateText(!0);var n=ou(this.scale.x)||1;this.scale.x=n*t/this._texture.orig.width,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height},set:function(t){this.updateText(!0);var n=ou(this.scale.y)||1;this.scale.y=n*t/this._texture.orig.height,this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return this._style},set:function(t){t=t||{},t instanceof mu?this._style=t:this._style=new mu(t),this.localStyleID=-1,this.dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){t=String(t??""),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)},enumerable:!1,configurable:!0}),e.nextLineHeightBehavior=!1,e.experimentalLetterSpacing=!1,e})(oh);/*!
  1022. * @pixi/prepare - v6.5.10
  1023. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  1024. *
  1025. * @pixi/prepare is licensed under the MIT License.
  1026. * http://www.opensource.org/licenses/mit-license
  1027. */ht.UPLOADS_PER_FRAME=4;/*! *****************************************************************************
  1028. Copyright (c) Microsoft Corporation.
  1029. Permission to use, copy, modify, and/or distribute this software for any
  1030. purpose with or without fee is hereby granted.
  1031. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  1032. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  1033. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  1034. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  1035. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  1036. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  1037. PERFORMANCE OF THIS SOFTWARE.
  1038. ***************************************************************************** */var Y4=function(r,e){return Y4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},Y4(r,e)};function TZ(r,e){Y4(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var rP=(function(){function r(e){this.maxItemsPerFrame=e,this.itemsLeft=0}return r.prototype.beginFrame=function(){this.itemsLeft=this.maxItemsPerFrame},r.prototype.allowedToUpload=function(){return this.itemsLeft-- >0},r})();function CZ(r,e){var t=!1;if(r&&r._textures&&r._textures.length){for(var n=0;n<r._textures.length;n++)if(r._textures[n]instanceof Rt){var i=r._textures[n].baseTexture;e.indexOf(i)===-1&&(e.push(i),t=!0)}}return t}function AZ(r,e){if(r.baseTexture instanceof Wt){var t=r.baseTexture;return e.indexOf(t)===-1&&e.push(t),!0}return!1}function MZ(r,e){if(r._texture&&r._texture instanceof Rt){var t=r._texture.baseTexture;return e.indexOf(t)===-1&&e.push(t),!0}return!1}function RZ(r,e){return e instanceof n3?(e.updateText(!0),!0):!1}function OZ(r,e){if(e instanceof mu){var t=e.toFontString();return ka.measureFont(t),!0}return!1}function DZ(r,e){if(r instanceof n3){e.indexOf(r.style)===-1&&e.push(r.style),e.indexOf(r)===-1&&e.push(r);var t=r._texture.baseTexture;return e.indexOf(t)===-1&&e.push(t),!0}return!1}function PZ(r,e){return r instanceof mu?(e.indexOf(r)===-1&&e.push(r),!0):!1}var nP=(function(){function r(e){var t=this;this.limiter=new rP(ht.UPLOADS_PER_FRAME),this.renderer=e,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){t.queue&&t.prepareItems()},this.registerFindHook(DZ),this.registerFindHook(PZ),this.registerFindHook(CZ),this.registerFindHook(AZ),this.registerFindHook(MZ),this.registerUploadHook(RZ),this.registerUploadHook(OZ)}return r.prototype.upload=function(e,t){var n=this;return typeof e=="function"&&(t=e,e=null),t&&fi("6.5.0","BasePrepare.upload callback is deprecated, use the return Promise instead."),new Promise(function(i){e&&n.add(e);var a=function(){t==null||t(),i()};n.queue.length?(n.completes.push(a),n.ticking||(n.ticking=!0,Fn.system.addOnce(n.tick,n,is.UTILITY))):a()})},r.prototype.tick=function(){setTimeout(this.delayedTick,0)},r.prototype.prepareItems=function(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){var e=this.queue[0],t=!1;if(e&&!e._destroyed){for(var n=0,i=this.uploadHooks.length;n<i;n++)if(this.uploadHooks[n](this.uploadHookHelper,e)){this.queue.shift(),t=!0;break}}t||this.queue.shift()}if(this.queue.length)Fn.system.addOnce(this.tick,this,is.UTILITY);else{this.ticking=!1;var a=this.completes.slice(0);this.completes.length=0;for(var n=0,i=a.length;n<i;n++)a[n]()}},r.prototype.registerFindHook=function(e){return e&&this.addHooks.push(e),this},r.prototype.registerUploadHook=function(e){return e&&this.uploadHooks.push(e),this},r.prototype.add=function(e){for(var t=0,n=this.addHooks.length;t<n&&!this.addHooks[t](e,this.queue);t++);if(e instanceof _a)for(var t=e.children.length-1;t>=0;t--)this.add(e.children[t]);return this},r.prototype.destroy=function(){this.ticking&&Fn.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null},r})();function iP(r,e){return e instanceof Wt?(e._glTextures[r.CONTEXT_UID]||r.texture.bind(e),!0):!1}function IZ(r,e){if(!(e instanceof gd))return!1;var t=e.geometry;e.finishPoly(),t.updateBatches();for(var n=t.batches,i=0;i<n.length;i++){var a=n[i].style.texture;a&&iP(r,a.baseTexture)}return t.batchable||r.geometry.bind(t,e._resolveDirectShader(r)),!0}function NZ(r,e){return r instanceof gd?(e.push(r),!0):!1}var aP=(function(r){TZ(e,r);function e(t){var n=r.call(this,t)||this;return n.uploadHookHelper=n.renderer,n.registerFindHook(NZ),n.registerUploadHook(iP),n.registerUploadHook(IZ),n}return e.extension={name:"prepare",type:yr.RendererPlugin},e})(nP),LZ=(function(){function r(e){this.maxMilliseconds=e,this.frameStart=0}return r.prototype.beginFrame=function(){this.frameStart=Date.now()},r.prototype.allowedToUpload=function(){return Date.now()-this.frameStart<this.maxMilliseconds},r})();/*!
  1039. * @pixi/spritesheet - v6.5.10
  1040. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  1041. *
  1042. * @pixi/spritesheet is licensed under the MIT License.
  1043. * http://www.opensource.org/licenses/mit-license
  1044. */var sP=(function(){function r(e,t,n){n===void 0&&(n=null),this.linkedSheets=[],this._texture=e instanceof Rt?e:null,this.baseTexture=e instanceof Wt?e:this._texture.baseTexture,this.textures={},this.animations={},this.data=t;var i=this.baseTexture.resource;this.resolution=this._updateResolution(n||(i?i.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}return r.prototype._updateResolution=function(e){e===void 0&&(e=null);var t=this.data.meta.scale,n=ud(e,null);return n===null&&(n=t!==void 0?parseFloat(t):1),n!==1&&this.baseTexture.setResolution(n),n},r.prototype.parse=function(e){var t=this;return e&&fi("6.5.0","Spritesheet.parse callback is deprecated, use the return Promise instead."),new Promise(function(n){t._callback=function(i){e==null||e(i),n(i)},t._batchIndex=0,t._frameKeys.length<=r.BATCH_SIZE?(t._processFrames(0),t._processAnimations(),t._parseComplete()):t._nextBatch()})},r.prototype._processFrames=function(e){for(var t=e,n=r.BATCH_SIZE;t-e<n&&t<this._frameKeys.length;){var i=this._frameKeys[t],a=this._frames[i],s=a.frame;if(s){var o=null,l=null,c=a.trimmed!==!1&&a.sourceSize?a.sourceSize:a.frame,h=new $t(0,0,Math.floor(c.w)/this.resolution,Math.floor(c.h)/this.resolution);a.rotated?o=new $t(Math.floor(s.x)/this.resolution,Math.floor(s.y)/this.resolution,Math.floor(s.h)/this.resolution,Math.floor(s.w)/this.resolution):o=new $t(Math.floor(s.x)/this.resolution,Math.floor(s.y)/this.resolution,Math.floor(s.w)/this.resolution,Math.floor(s.h)/this.resolution),a.trimmed!==!1&&a.spriteSourceSize&&(l=new $t(Math.floor(a.spriteSourceSize.x)/this.resolution,Math.floor(a.spriteSourceSize.y)/this.resolution,Math.floor(s.w)/this.resolution,Math.floor(s.h)/this.resolution)),this.textures[i]=new Rt(this.baseTexture,o,h,l,a.rotated?2:0,a.anchor),Rt.addToCache(this.textures[i],i)}t++}},r.prototype._processAnimations=function(){var e=this.data.animations||{};for(var t in e){this.animations[t]=[];for(var n=0;n<e[t].length;n++){var i=e[t][n];this.animations[t].push(this.textures[i])}}},r.prototype._parseComplete=function(){var e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)},r.prototype._nextBatch=function(){var e=this;this._processFrames(this._batchIndex*r.BATCH_SIZE),this._batchIndex++,setTimeout(function(){e._batchIndex*r.BATCH_SIZE<e._frameKeys.length?e._nextBatch():(e._processAnimations(),e._parseComplete())},0)},r.prototype.destroy=function(e){var t;e===void 0&&(e=!1);for(var n in this.textures)this.textures[n].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&((t=this._texture)===null||t===void 0||t.destroy(),this.baseTexture.destroy()),this._texture=null,this.baseTexture=null,this.linkedSheets=[]},r.BATCH_SIZE=1e3,r})(),oP=(function(){function r(){}return r.use=function(e,t){var n,i,a=this,s=e.name+"_image";if(!e.data||e.type!==Qr.TYPE.JSON||!e.data.frames||a.resources[s]){t();return}var o=(i=(n=e.data)===null||n===void 0?void 0:n.meta)===null||i===void 0?void 0:i.related_multi_packs;if(Array.isArray(o))for(var l=function(m){if(typeof m!="string")return"continue";var x=m.replace(".json",""),y=es.resolve(e.url.replace(a.baseUrl,""),m);if(a.resources[x]||Object.values(a.resources).some(function(w){return es.format(es.parse(w.url))===y}))return"continue";var _={crossOrigin:e.crossOrigin,loadType:Qr.LOAD_TYPE.XHR,xhrType:Qr.XHR_RESPONSE_TYPE.JSON,parentResource:e,metadata:e.metadata};a.add(x,y,_)},c=0,h=o;c<h.length;c++){var d=h[c];l(d)}var v={crossOrigin:e.crossOrigin,metadata:e.metadata.imageMetadata,parentResource:e},g=r.getResourcePath(e,a.baseUrl);a.add(s,g,v,function(x){if(x.error){t(x.error);return}var y=new sP(x.texture,e.data,e.url);y.parse().then(function(){e.spritesheet=y,e.textures=y.textures,t()})})},r.getResourcePath=function(e,t){return e.isDataUrl?e.data.meta.image:es.resolve(e.url.replace(t,""),e.data.meta.image)},r.extension=yr.Loader,r})();/*!
  1045. * @pixi/sprite-tiling - v6.5.10
  1046. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  1047. *
  1048. * @pixi/sprite-tiling is licensed under the MIT License.
  1049. * http://www.opensource.org/licenses/mit-license
  1050. *//*! *****************************************************************************
  1051. Copyright (c) Microsoft Corporation.
  1052. Permission to use, copy, modify, and/or distribute this software for any
  1053. purpose with or without fee is hereby granted.
  1054. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  1055. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  1056. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  1057. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  1058. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  1059. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  1060. PERFORMANCE OF THIS SOFTWARE.
  1061. ***************************************************************************** */var W4=function(r,e){return W4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},W4(r,e)};function lP(r,e){W4(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var xf=new Ar,kZ=(function(r){lP(e,r);function e(t,n,i){n===void 0&&(n=100),i===void 0&&(i=100);var a=r.call(this,t)||this;return a.tileTransform=new Tg,a._width=n,a._height=i,a.uvMatrix=a.texture.uvMatrix||new Rg(t),a.pluginName="tilingSprite",a.uvRespectAnchor=!1,a}return Object.defineProperty(e.prototype,"clampMargin",{get:function(){return this.uvMatrix.clampMargin},set:function(t){this.uvMatrix.clampMargin=t,this.uvMatrix.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileScale",{get:function(){return this.tileTransform.scale},set:function(t){this.tileTransform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tilePosition",{get:function(){return this.tileTransform.position},set:function(t){this.tileTransform.position.copyFrom(t)},enumerable:!1,configurable:!0}),e.prototype._onTextureUpdate=function(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215},e.prototype._render=function(t){var n=this._texture;!n||!n.valid||(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))},e.prototype._calculateBounds=function(){var t=this._width*-this._anchor._x,n=this._height*-this._anchor._y,i=this._width*(1-this._anchor._x),a=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,t,n,i,a)},e.prototype.getLocalBounds=function(t){return this.children.length===0?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),t||(this._localBoundsRect||(this._localBoundsRect=new $t),t=this._localBoundsRect),this._bounds.getRectangle(t)):r.prototype.getLocalBounds.call(this,t)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,xf);var n=this._width,i=this._height,a=-n*this.anchor._x;if(xf.x>=a&&xf.x<a+n){var s=-i*this.anchor._y;if(xf.y>=s&&xf.y<s+i)return!0}return!1},e.prototype.destroy=function(t){r.prototype.destroy.call(this,t),this.tileTransform=null,this.uvMatrix=null},e.from=function(t,n){var i=t instanceof Rt?t:Rt.from(t,n);return new e(i,n.width,n.height)},Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),e})(oh),BZ=`#version 100
  1062. #define SHADER_NAME Tiling-Sprite-Simple-100
  1063. precision lowp float;
  1064. varying vec2 vTextureCoord;
  1065. uniform sampler2D uSampler;
  1066. uniform vec4 uColor;
  1067. void main(void)
  1068. {
  1069. vec4 texSample = texture2D(uSampler, vTextureCoord);
  1070. gl_FragColor = texSample * uColor;
  1071. }
  1072. `,vA=`#version 100
  1073. #define SHADER_NAME Tiling-Sprite-100
  1074. precision lowp float;
  1075. attribute vec2 aVertexPosition;
  1076. attribute vec2 aTextureCoord;
  1077. uniform mat3 projectionMatrix;
  1078. uniform mat3 translationMatrix;
  1079. uniform mat3 uTransform;
  1080. varying vec2 vTextureCoord;
  1081. void main(void)
  1082. {
  1083. gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
  1084. vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;
  1085. }
  1086. `,FZ=`#version 100
  1087. #ifdef GL_EXT_shader_texture_lod
  1088. #extension GL_EXT_shader_texture_lod : enable
  1089. #endif
  1090. #define SHADER_NAME Tiling-Sprite-100
  1091. precision lowp float;
  1092. varying vec2 vTextureCoord;
  1093. uniform sampler2D uSampler;
  1094. uniform vec4 uColor;
  1095. uniform mat3 uMapCoord;
  1096. uniform vec4 uClampFrame;
  1097. uniform vec2 uClampOffset;
  1098. void main(void)
  1099. {
  1100. vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);
  1101. coord = (uMapCoord * vec3(coord, 1.0)).xy;
  1102. vec2 unclamped = coord;
  1103. coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);
  1104. #ifdef GL_EXT_shader_texture_lod
  1105. vec4 texSample = unclamped == coord
  1106. ? texture2D(uSampler, coord)
  1107. : texture2DLodEXT(uSampler, coord, 0);
  1108. #else
  1109. vec4 texSample = texture2D(uSampler, coord);
  1110. #endif
  1111. gl_FragColor = texSample * uColor;
  1112. }
  1113. `,zZ=`#version 300 es
  1114. #define SHADER_NAME Tiling-Sprite-300
  1115. precision lowp float;
  1116. in vec2 aVertexPosition;
  1117. in vec2 aTextureCoord;
  1118. uniform mat3 projectionMatrix;
  1119. uniform mat3 translationMatrix;
  1120. uniform mat3 uTransform;
  1121. out vec2 vTextureCoord;
  1122. void main(void)
  1123. {
  1124. gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
  1125. vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;
  1126. }
  1127. `,UZ=`#version 300 es
  1128. #define SHADER_NAME Tiling-Sprite-100
  1129. precision lowp float;
  1130. in vec2 vTextureCoord;
  1131. out vec4 fragmentColor;
  1132. uniform sampler2D uSampler;
  1133. uniform vec4 uColor;
  1134. uniform mat3 uMapCoord;
  1135. uniform vec4 uClampFrame;
  1136. uniform vec2 uClampOffset;
  1137. void main(void)
  1138. {
  1139. vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);
  1140. coord = (uMapCoord * vec3(coord, 1.0)).xy;
  1141. vec2 unclamped = coord;
  1142. coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);
  1143. vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0
  1144. fragmentColor = texSample * uColor;
  1145. }
  1146. `,Bv=new qr,uP=(function(r){lP(e,r);function e(t){var n=r.call(this,t)||this;return t.runners.contextChange.add(n),n.quad=new Nw,n.state=gl.for2d(),n}return e.prototype.contextChange=function(){var t=this.renderer,n={globals:t.globalUniforms};this.simpleShader=Gs.from(vA,BZ,n),this.shader=t.context.webGLVersion>1?Gs.from(zZ,UZ,n):Gs.from(vA,FZ,n)},e.prototype.render=function(t){var n=this.renderer,i=this.quad,a=i.vertices;a[0]=a[6]=t._width*-t.anchor.x,a[1]=a[3]=t._height*-t.anchor.y,a[2]=a[4]=t._width*(1-t.anchor.x),a[5]=a[7]=t._height*(1-t.anchor.y);var s=t.uvRespectAnchor?t.anchor.x:0,o=t.uvRespectAnchor?t.anchor.y:0;a=i.uvs,a[0]=a[6]=-s,a[1]=a[3]=-o,a[2]=a[4]=1-s,a[5]=a[7]=1-o,i.invalidate();var l=t._texture,c=l.baseTexture,h=c.alphaMode>0,d=t.tileTransform.localTransform,v=t.uvMatrix,g=c.isPowerOfTwo&&l.frame.width===c.width&&l.frame.height===c.height;g&&(c._glTextures[n.CONTEXT_UID]?g=c.wrapMode!==Ia.CLAMP:c.wrapMode===Ia.CLAMP&&(c.wrapMode=Ia.REPEAT));var m=g?this.simpleShader:this.shader,x=l.width,y=l.height,_=t._width,w=t._height;Bv.set(d.a*x/_,d.b*x/w,d.c*y/_,d.d*y/w,d.tx/_,d.ty/w),Bv.invert(),g?Bv.prepend(v.mapCoord):(m.uniforms.uMapCoord=v.mapCoord.toArray(!0),m.uniforms.uClampFrame=v.uClampFrame,m.uniforms.uClampOffset=v.uClampOffset),m.uniforms.uTransform=Bv.toArray(!0),m.uniforms.uColor=Sw(t.tint,t.worldAlpha,m.uniforms.uColor,h),m.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),m.uniforms.uSampler=l,n.shader.bind(m),n.geometry.bind(i),this.state.blendMode=ww(t.blendMode,h),n.state.set(this.state),n.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},e.extension={name:"tilingSprite",type:yr.RendererPlugin},e})(kd);/*!
  1147. * @pixi/mesh - v6.5.10
  1148. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  1149. *
  1150. * @pixi/mesh is licensed under the MIT License.
  1151. * http://www.opensource.org/licenses/mit-license
  1152. *//*! *****************************************************************************
  1153. Copyright (c) Microsoft Corporation.
  1154. Permission to use, copy, modify, and/or distribute this software for any
  1155. purpose with or without fee is hereby granted.
  1156. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  1157. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  1158. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  1159. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  1160. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  1161. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  1162. PERFORMANCE OF THIS SOFTWARE.
  1163. ***************************************************************************** */var $4=function(r,e){return $4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},$4(r,e)};function i3(r,e){$4(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var cP=(function(){function r(e,t){this.uvBuffer=e,this.uvMatrix=t,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}return r.prototype.update=function(e){if(!(!e&&this._bufferUpdateId===this.uvBuffer._updateID&&this._textureUpdateId===this.uvMatrix._updateID)){this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;var t=this.uvBuffer.data;(!this.data||this.data.length!==t.length)&&(this.data=new Float32Array(t.length)),this.uvMatrix.multiplyUvs(t,this.data),this._updateID++}},r})(),cx=new Ar,pA=new Uf,Vc=(function(r){i3(e,r);function e(t,n,i,a){a===void 0&&(a=pa.TRIANGLES);var s=r.call(this)||this;return s.geometry=t,s.shader=n,s.state=i||gl.for2d(),s.drawMode=a,s.start=0,s.size=0,s.uvs=null,s.indices=null,s.vertexData=new Float32Array(1),s.vertexDirty=-1,s._transformID=-1,s._roundPixels=ht.ROUND_PIXELS,s.batchUvs=null,s}return Object.defineProperty(e.prototype,"geometry",{get:function(){return this._geometry},set:function(t){this._geometry!==t&&(this._geometry&&(this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose()),this._geometry=t,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"uvBuffer",{get:function(){return this.geometry.buffers[1]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"verticesBuffer",{get:function(){return this.geometry.buffers[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"material",{get:function(){return this.shader},set:function(t){this.shader=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return"tint"in this.shader?this.shader.tint:null},set:function(t){this.shader.tint=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return"texture"in this.shader?this.shader.texture:null},set:function(t){this.shader.texture=t},enumerable:!1,configurable:!0}),e.prototype._render=function(t){var n=this.geometry.buffers[0].data,i=this.shader;i.batchable&&this.drawMode===pa.TRIANGLES&&n.length<e.BATCHABLE_SIZE*2?this._renderToBatch(t):this._renderDefault(t)},e.prototype._renderDefault=function(t){var n=this.shader;n.alpha=this.worldAlpha,n.update&&n.update(),t.batch.flush(),n.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),t.shader.bind(n),t.state.set(this.state),t.geometry.bind(this.geometry,n),t.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)},e.prototype._renderToBatch=function(t){var n=this.geometry,i=this.shader;i.uvMatrix&&(i.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=n.indexBuffer.data,this._tintRGB=i._tintRGB,this._texture=i.texture;var a=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[a]),t.plugins[a].render(this)},e.prototype.calculateVertices=function(){var t=this.geometry,n=t.buffers[0],i=n.data,a=n._updateID;if(!(a===this.vertexDirty&&this._transformID===this.transform._worldID)){this._transformID=this.transform._worldID,this.vertexData.length!==i.length&&(this.vertexData=new Float32Array(i.length));for(var s=this.transform.worldTransform,o=s.a,l=s.b,c=s.c,h=s.d,d=s.tx,v=s.ty,g=this.vertexData,m=0;m<g.length/2;m++){var x=i[m*2],y=i[m*2+1];g[m*2]=o*x+c*y+d,g[m*2+1]=l*x+h*y+v}if(this._roundPixels)for(var _=ht.RESOLUTION,m=0;m<g.length;++m)g[m]=Math.round((g[m]*_|0)/_);this.vertexDirty=a}},e.prototype.calculateUvs=function(){var t=this.geometry.buffers[1],n=this.shader;n.uvMatrix.isSimple?this.uvs=t.data:(this.batchUvs||(this.batchUvs=new cP(t,n.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)},e.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)},e.prototype.containsPoint=function(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,cx);for(var n=this.geometry.getBuffer("aVertexPosition").data,i=pA.points,a=this.geometry.getIndex().data,s=a.length,o=this.drawMode===4?3:1,l=0;l+2<s;l+=o){var c=a[l]*2,h=a[l+1]*2,d=a[l+2]*2;if(i[0]=n[c],i[1]=n[c+1],i[2]=n[h],i[3]=n[h+1],i[4]=n[d],i[5]=n[d+1],pA.contains(cx.x,cx.y))return!0}return!1},e.prototype.destroy=function(t){r.prototype.destroy.call(this,t),this._cachedTexture&&(this._cachedTexture.destroy(),this._cachedTexture=null),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null},e.BATCHABLE_SIZE=100,e})(_a),GZ=`varying vec2 vTextureCoord;
  1164. uniform vec4 uColor;
  1165. uniform sampler2D uSampler;
  1166. void main(void)
  1167. {
  1168. gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;
  1169. }
  1170. `,HZ=`attribute vec2 aVertexPosition;
  1171. attribute vec2 aTextureCoord;
  1172. uniform mat3 projectionMatrix;
  1173. uniform mat3 translationMatrix;
  1174. uniform mat3 uTextureMatrix;
  1175. varying vec2 vTextureCoord;
  1176. void main(void)
  1177. {
  1178. gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
  1179. vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;
  1180. }
  1181. `,qc=(function(r){i3(e,r);function e(t,n){var i=this,a={uSampler:t,alpha:1,uTextureMatrix:qr.IDENTITY,uColor:new Float32Array([1,1,1,1])};return n=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},n),n.uniforms&&Object.assign(a,n.uniforms),i=r.call(this,n.program||sh.from(HZ,GZ),a)||this,i._colorDirty=!1,i.uvMatrix=new Rg(t),i.batchable=n.program===void 0,i.pluginName=n.pluginName,i.tint=n.tint,i.alpha=n.alpha,i}return Object.defineProperty(e.prototype,"texture",{get:function(){return this.uniforms.uSampler},set:function(t){this.uniforms.uSampler!==t&&(!this.uniforms.uSampler.baseTexture.alphaMode!=!t.baseTexture.alphaMode&&(this._colorDirty=!0),this.uniforms.uSampler=t,this.uvMatrix.texture=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this._alpha},set:function(t){t!==this._alpha&&(this._alpha=t,this._colorDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){t!==this._tint&&(this._tint=t,this._tintRGB=(t>>16)+(t&65280)+((t&255)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;Sw(this._tint,this._alpha,this.uniforms.uColor,t.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},e})(Gs),Bd=(function(r){i3(e,r);function e(t,n,i){var a=r.call(this)||this,s=new wn(t),o=new wn(n,!0),l=new wn(i,!0,!0);return a.addAttribute("aVertexPosition",s,2,!1,wt.FLOAT).addAttribute("aTextureCoord",o,2,!1,wt.FLOAT).addIndex(l),a._updateId=-1,a}return Object.defineProperty(e.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),e})(ah);/*!
  1182. * @pixi/text-bitmap - v6.5.10
  1183. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  1184. *
  1185. * @pixi/text-bitmap is licensed under the MIT License.
  1186. * http://www.opensource.org/licenses/mit-license
  1187. *//*! *****************************************************************************
  1188. Copyright (c) Microsoft Corporation.
  1189. Permission to use, copy, modify, and/or distribute this software for any
  1190. purpose with or without fee is hereby granted.
  1191. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  1192. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  1193. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  1194. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  1195. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  1196. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  1197. PERFORMANCE OF THIS SOFTWARE.
  1198. ***************************************************************************** */var K4=function(r,e){return K4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},K4(r,e)};function jZ(r,e){K4(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var md=(function(){function r(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}return r})(),hP=(function(){function r(){}return r.test=function(e){return typeof e=="string"&&e.indexOf("info face=")===0},r.parse=function(e){var t=e.match(/^[a-z]+\s+.+$/gm),n={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(var i in t){var a=t[i].match(/^[a-z]+/gm)[0],s=t[i].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),o={};for(var l in s){var c=s[l].split("="),h=c[0],d=c[1].replace(/"/gm,""),v=parseFloat(d),g=isNaN(v)?d:v;o[h]=g}n[a].push(o)}var m=new md;return n.info.forEach(function(x){return m.info.push({face:x.face,size:parseInt(x.size,10)})}),n.common.forEach(function(x){return m.common.push({lineHeight:parseInt(x.lineHeight,10)})}),n.page.forEach(function(x){return m.page.push({id:parseInt(x.id,10),file:x.file})}),n.char.forEach(function(x){return m.char.push({id:parseInt(x.id,10),page:parseInt(x.page,10),x:parseInt(x.x,10),y:parseInt(x.y,10),width:parseInt(x.width,10),height:parseInt(x.height,10),xoffset:parseInt(x.xoffset,10),yoffset:parseInt(x.yoffset,10),xadvance:parseInt(x.xadvance,10)})}),n.kerning.forEach(function(x){return m.kerning.push({first:parseInt(x.first,10),second:parseInt(x.second,10),amount:parseInt(x.amount,10)})}),n.distanceField.forEach(function(x){return m.distanceField.push({distanceRange:parseInt(x.distanceRange,10),fieldType:x.fieldType})}),m},r})(),Vp=(function(){function r(){}return r.test=function(e){return e instanceof XMLDocument&&e.getElementsByTagName("page").length&&e.getElementsByTagName("info")[0].getAttribute("face")!==null},r.parse=function(e){for(var t=new md,n=e.getElementsByTagName("info"),i=e.getElementsByTagName("common"),a=e.getElementsByTagName("page"),s=e.getElementsByTagName("char"),o=e.getElementsByTagName("kerning"),l=e.getElementsByTagName("distanceField"),c=0;c<n.length;c++)t.info.push({face:n[c].getAttribute("face"),size:parseInt(n[c].getAttribute("size"),10)});for(var c=0;c<i.length;c++)t.common.push({lineHeight:parseInt(i[c].getAttribute("lineHeight"),10)});for(var c=0;c<a.length;c++)t.page.push({id:parseInt(a[c].getAttribute("id"),10)||0,file:a[c].getAttribute("file")});for(var c=0;c<s.length;c++){var h=s[c];t.char.push({id:parseInt(h.getAttribute("id"),10),page:parseInt(h.getAttribute("page"),10)||0,x:parseInt(h.getAttribute("x"),10),y:parseInt(h.getAttribute("y"),10),width:parseInt(h.getAttribute("width"),10),height:parseInt(h.getAttribute("height"),10),xoffset:parseInt(h.getAttribute("xoffset"),10),yoffset:parseInt(h.getAttribute("yoffset"),10),xadvance:parseInt(h.getAttribute("xadvance"),10)})}for(var c=0;c<o.length;c++)t.kerning.push({first:parseInt(o[c].getAttribute("first"),10),second:parseInt(o[c].getAttribute("second"),10),amount:parseInt(o[c].getAttribute("amount"),10)});for(var c=0;c<l.length;c++)t.distanceField.push({fieldType:l[c].getAttribute("fieldType"),distanceRange:parseInt(l[c].getAttribute("distanceRange"),10)});return t},r})(),fP=(function(){function r(){}return r.test=function(e){if(typeof e=="string"&&e.indexOf("<font>")>-1){var t=new globalThis.DOMParser().parseFromString(e,"text/xml");return Vp.test(t)}return!1},r.parse=function(e){var t=new globalThis.DOMParser().parseFromString(e,"text/xml");return Vp.parse(t)},r})(),hx=[hP,Vp,fP];function a3(r){for(var e=0;e<hx.length;e++)if(hx[e].test(r))return hx[e];return null}function VZ(r,e,t,n,i,a){var s=t.fill;if(Array.isArray(s)){if(s.length===1)return s[0]}else return s;var o,l=t.dropShadow?t.dropShadowDistance:0,c=t.padding||0,h=r.width/n-l-c*2,d=r.height/n-l-c*2,v=s.slice(),g=t.fillGradientStops.slice();if(!g.length)for(var m=v.length+1,x=1;x<m;++x)g.push(x/m);if(v.unshift(s[0]),g.unshift(0),v.push(s[s.length-1]),g.push(1),t.fillGradientType===jc.LINEAR_VERTICAL){o=e.createLinearGradient(h/2,c,h/2,d+c);for(var y=0,_=a.fontProperties.fontSize+t.strokeThickness,w=_/d,x=0;x<i.length;x++)for(var S=a.lineHeight*x,A=0;A<v.length;A++){var C=0;typeof g[A]=="number"?C=g[A]:C=A/v.length;var M=S/d+C*w,E=Math.max(y,M);E=Math.min(E,1),o.addColorStop(E,v[A]),y=E}}else{o=e.createLinearGradient(c,d/2,h+c,d/2);for(var O=v.length+1,D=1,x=0;x<v.length;x++){var I=void 0;typeof g[x]=="number"?I=g[x]:I=D/O,o.addColorStop(I,v[x]),D++}}return o}function qZ(r,e,t,n,i,a,s){var o=t.text,l=t.fontProperties;e.translate(n,i),e.scale(a,a);var c=s.strokeThickness/2,h=-(s.strokeThickness/2);if(e.font=s.toFontString(),e.lineWidth=s.strokeThickness,e.textBaseline=s.textBaseline,e.lineJoin=s.lineJoin,e.miterLimit=s.miterLimit,e.fillStyle=VZ(r,e,s,a,[o],t),e.strokeStyle=s.stroke,s.dropShadow){var d=s.dropShadowColor,v=pu(typeof d=="number"?d:xw(d)),g=s.dropShadowBlur*a,m=s.dropShadowDistance*a;e.shadowColor="rgba("+v[0]*255+","+v[1]*255+","+v[2]*255+","+s.dropShadowAlpha+")",e.shadowBlur=g,e.shadowOffsetX=Math.cos(s.dropShadowAngle)*m,e.shadowOffsetY=Math.sin(s.dropShadowAngle)*m}else e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0;s.stroke&&s.strokeThickness&&e.strokeText(o,c,h+t.lineHeight-l.descent),s.fill&&e.fillText(o,c,h+t.lineHeight-l.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}function dP(r){return Array.from?Array.from(r):r.split("")}function XZ(r){typeof r=="string"&&(r=[r]);for(var e=[],t=0,n=r.length;t<n;t++){var i=r[t];if(Array.isArray(i)){if(i.length!==2)throw new Error("[BitmapFont]: Invalid character range length, expecting 2 got "+i.length+".");var a=i[0].charCodeAt(0),s=i[1].charCodeAt(0);if(s<a)throw new Error("[BitmapFont]: Invalid character range.");for(var o=a,l=s;o<=l;o++)e.push(String.fromCharCode(o))}else e.push.apply(e,dP(i))}if(e.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}function mp(r){return r.codePointAt?r.codePointAt(0):r.charCodeAt(0)}var Ls=(function(){function r(e,t,n){var i,a,s=e.info[0],o=e.common[0],l=e.page[0],c=e.distanceField[0],h=ud(l.file),d={};this._ownsTextures=n,this.font=s.face,this.size=s.size,this.lineHeight=o.lineHeight/h,this.chars={},this.pageTextures=d;for(var v=0;v<e.page.length;v++){var g=e.page[v],m=g.id,x=g.file;d[m]=t instanceof Array?t[v]:t[x],c!=null&&c.fieldType&&c.fieldType!=="none"&&(d[m].baseTexture.alphaMode=xa.NO_PREMULTIPLIED_ALPHA,d[m].baseTexture.mipmap=ba.OFF)}for(var v=0;v<e.char.length;v++){var y=e.char[v],m=y.id,_=y.page,w=e.char[v],S=w.x,A=w.y,C=w.width,M=w.height,E=w.xoffset,O=w.yoffset,D=w.xadvance;S/=h,A/=h,C/=h,M/=h,E/=h,O/=h,D/=h;var I=new $t(S+d[_].frame.x/h,A+d[_].frame.y/h,C,M);this.chars[m]={xOffset:E,yOffset:O,xAdvance:D,kerning:{},texture:new Rt(d[_].baseTexture,I),page:_}}for(var v=0;v<e.kerning.length;v++){var k=e.kerning[v],U=k.first,V=k.second,X=k.amount;U/=h,V/=h,X/=h,this.chars[V]&&(this.chars[V].kerning[U]=X)}this.distanceFieldRange=c==null?void 0:c.distanceRange,this.distanceFieldType=(a=(i=c==null?void 0:c.fieldType)===null||i===void 0?void 0:i.toLowerCase())!==null&&a!==void 0?a:"none"}return r.prototype.destroy=function(){for(var e in this.chars)this.chars[e].texture.destroy(),this.chars[e].texture=null;for(var e in this.pageTextures)this._ownsTextures&&this.pageTextures[e].destroy(!0),this.pageTextures[e]=null;this.chars=null,this.pageTextures=null},r.install=function(e,t,n){var i;if(e instanceof md)i=e;else{var a=a3(e);if(!a)throw new Error("Unrecognized data format for font.");i=a.parse(e)}t instanceof Rt&&(t=[t]);var s=new r(i,t,n);return r.available[s.font]=s,s},r.uninstall=function(e){var t=r.available[e];if(!t)throw new Error("No font found named '"+e+"'");t.destroy(),delete r.available[e]},r.from=function(e,t,n){if(!e)throw new Error("[BitmapFont] Property `name` is required.");var i=Object.assign({},r.defaultOptions,n),a=i.chars,s=i.padding,o=i.resolution,l=i.textureWidth,c=i.textureHeight,h=XZ(a),d=t instanceof mu?t:new mu(t),v=l,g=new md;g.info[0]={face:d.fontFamily,size:d.fontSize},g.common[0]={lineHeight:d.fontSize};for(var m=0,x=0,y,_,w,S=0,A=[],C=0;C<h.length;C++){y||(y=ht.ADAPTER.createCanvas(),y.width=l,y.height=c,_=y.getContext("2d"),w=new Wt(y,{resolution:o}),A.push(new Rt(w)),g.page.push({id:A.length-1,file:""}));var M=h[C],E=ka.measureText(M,d,!1,y),O=E.width,D=Math.ceil(E.height),I=Math.ceil((d.fontStyle==="italic"?2:1)*O);if(x>=c-D*o){if(x===0)throw new Error("[BitmapFont] textureHeight "+c+"px is too small "+("(fontFamily: '"+d.fontFamily+"', fontSize: "+d.fontSize+"px, char: '"+M+"')"));--C,y=null,_=null,w=null,x=0,m=0,S=0;continue}if(S=Math.max(D+E.fontProperties.descent,S),I*o+m>=v){if(m===0)throw new Error("[BitmapFont] textureWidth "+l+"px is too small "+("(fontFamily: '"+d.fontFamily+"', fontSize: "+d.fontSize+"px, char: '"+M+"')"));--C,x+=S*o,x=Math.ceil(x),m=0,S=0;continue}qZ(y,_,E,m,x,o,d);var k=mp(E.text);g.char.push({id:k,page:A.length-1,x:m/o,y:x/o,width:I,height:D,xoffset:0,yoffset:0,xadvance:Math.ceil(O-(d.dropShadow?d.dropShadowDistance:0)-(d.stroke?d.strokeThickness:0))}),m+=(I+2*s)*o,m=Math.ceil(m)}if(!(n!=null&&n.skipKerning))for(var C=0,U=h.length;C<U;C++)for(var V=h[C],X=0;X<U;X++){var W=h[X],P=_.measureText(V).width,H=_.measureText(W).width,z=_.measureText(V+W).width,$=z-(P+H);$&&g.kerning.push({first:mp(V),second:mp(W),amount:$})}var B=new r(g,A,!0);return r.available[e]!==void 0&&r.uninstall(e),r.available[e]=B,B},r.ALPHA=[["a","z"],["A","Z"]," "],r.NUMERIC=[["0","9"]],r.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],r.ASCII=[[" ","~"]],r.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:r.ALPHANUMERIC},r.available={},r})(),YZ=`// Pixi texture info\r
  1199. varying vec2 vTextureCoord;\r
  1200. uniform sampler2D uSampler;\r
  1201. \r
  1202. // Tint\r
  1203. uniform vec4 uColor;\r
  1204. \r
  1205. // on 2D applications fwidth is screenScale / glyphAtlasScale * distanceFieldRange\r
  1206. uniform float uFWidth;\r
  1207. \r
  1208. void main(void) {\r
  1209. \r
  1210. // To stack MSDF and SDF we need a non-pre-multiplied-alpha texture.\r
  1211. vec4 texColor = texture2D(uSampler, vTextureCoord);\r
  1212. \r
  1213. // MSDF\r
  1214. float median = texColor.r + texColor.g + texColor.b -\r
  1215. min(texColor.r, min(texColor.g, texColor.b)) -\r
  1216. max(texColor.r, max(texColor.g, texColor.b));\r
  1217. // SDF\r
  1218. median = min(median, texColor.a);\r
  1219. \r
  1220. float screenPxDistance = uFWidth * (median - 0.5);\r
  1221. float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\r
  1222. if (median < 0.01) {\r
  1223. alpha = 0.0;\r
  1224. } else if (median > 0.99) {\r
  1225. alpha = 1.0;\r
  1226. }\r
  1227. \r
  1228. // NPM Textures, NPM outputs\r
  1229. gl_FragColor = vec4(uColor.rgb, uColor.a * alpha);\r
  1230. \r
  1231. }\r
  1232. `,WZ=`// Mesh material default fragment\r
  1233. attribute vec2 aVertexPosition;\r
  1234. attribute vec2 aTextureCoord;\r
  1235. \r
  1236. uniform mat3 projectionMatrix;\r
  1237. uniform mat3 translationMatrix;\r
  1238. uniform mat3 uTextureMatrix;\r
  1239. \r
  1240. varying vec2 vTextureCoord;\r
  1241. \r
  1242. void main(void)\r
  1243. {\r
  1244. gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r
  1245. \r
  1246. vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r
  1247. }\r
  1248. `,gA=[],mA=[],yA=[],$Z=(function(r){jZ(e,r);function e(t,n){n===void 0&&(n={});var i=r.call(this)||this;i._tint=16777215;var a=Object.assign({},e.styleDefaults,n),s=a.align,o=a.tint,l=a.maxWidth,c=a.letterSpacing,h=a.fontName,d=a.fontSize;if(!Ls.available[h])throw new Error('Missing BitmapFont "'+h+'"');return i._activePagesMeshData=[],i._textWidth=0,i._textHeight=0,i._align=s,i._tint=o,i._font=void 0,i._fontName=h,i._fontSize=d,i.text=t,i._maxWidth=l,i._maxLineHeight=0,i._letterSpacing=c,i._anchor=new Go(function(){i.dirty=!0},i,0,0),i._roundPixels=ht.ROUND_PIXELS,i.dirty=!0,i._resolution=ht.RESOLUTION,i._autoResolution=!0,i._textureCache={},i}return e.prototype.updateText=function(){for(var t,n=Ls.available[this._fontName],i=this.fontSize,a=i/n.size,s=new Ar,o=[],l=[],c=[],h=this._text.replace(/(?:\r\n|\r)/g,`
  1249. `)||" ",d=dP(h),v=this._maxWidth*n.size/i,g=n.distanceFieldType==="none"?gA:mA,m=null,x=0,y=0,_=0,w=-1,S=0,A=0,C=0,M=0,E=0;E<d.length;E++){var O=d[E],D=mp(O);if(/(?:\s)/.test(O)&&(w=E,S=x,M++),O==="\r"||O===`
  1250. `){l.push(x),c.push(-1),y=Math.max(y,x),++_,++A,s.x=0,s.y+=n.lineHeight,m=null,M=0;continue}var I=n.chars[D];if(I){m&&I.kerning[m]&&(s.x+=I.kerning[m]);var k=yA.pop()||{texture:Rt.EMPTY,line:0,charCode:0,prevSpaces:0,position:new Ar};k.texture=I.texture,k.line=_,k.charCode=D,k.position.x=s.x+I.xOffset+this._letterSpacing/2,k.position.y=s.y+I.yOffset,k.prevSpaces=M,o.push(k),x=k.position.x+Math.max(I.xAdvance-I.xOffset,I.texture.orig.width),s.x+=I.xAdvance+this._letterSpacing,C=Math.max(C,I.yOffset+I.texture.height),m=D,w!==-1&&v>0&&s.x>v&&(++A,lu(o,1+w-A,1+E-w),E=w,w=-1,l.push(S),c.push(o.length>0?o[o.length-1].prevSpaces:0),y=Math.max(y,S),_++,s.x=0,s.y+=n.lineHeight,m=null,M=0)}}var U=d[d.length-1];U!=="\r"&&U!==`
  1251. `&&(/(?:\s)/.test(U)&&(x=S),l.push(x),y=Math.max(y,x),c.push(-1));for(var V=[],E=0;E<=_;E++){var X=0;this._align==="right"?X=y-l[E]:this._align==="center"?X=(y-l[E])/2:this._align==="justify"&&(X=c[E]<0?0:(y-l[E])/c[E]),V.push(X)}var W=o.length,P={},H=[],z=this._activePagesMeshData;g.push.apply(g,z);for(var E=0;E<W;E++){var $=o[E].texture,B=$.baseTexture.uid;if(!P[B]){var L=g.pop();if(!L){var Y=new Bd,G=void 0,re=void 0;n.distanceFieldType==="none"?(G=new qc(Rt.EMPTY),re=Et.NORMAL):(G=new qc(Rt.EMPTY,{program:sh.from(WZ,YZ),uniforms:{uFWidth:0}}),re=Et.NORMAL_NPM);var ie=new Vc(Y,G);ie.blendMode=re,L={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:ie,vertices:null,uvs:null,indices:null}}L.index=0,L.indexCount=0,L.vertexCount=0,L.uvsCount=0,L.total=0;var le=this._textureCache;le[B]=le[B]||new Rt($.baseTexture),L.mesh.texture=le[B],L.mesh.tint=this._tint,H.push(L),P[B]=L}P[B].total++}for(var E=0;E<z.length;E++)H.indexOf(z[E])===-1&&this.removeChild(z[E].mesh);for(var E=0;E<H.length;E++)H[E].mesh.parent!==this&&this.addChild(H[E].mesh);this._activePagesMeshData=H;for(var E in P){var L=P[E],ce=L.total;if(!(((t=L.indices)===null||t===void 0?void 0:t.length)>6*ce)||L.vertices.length<Vc.BATCHABLE_SIZE*2)L.vertices=new Float32Array(8*ce),L.uvs=new Float32Array(8*ce),L.indices=new Uint16Array(6*ce);else for(var _e=L.total,pe=L.vertices,ae=_e*4*2;ae<pe.length;ae++)pe[ae]=0;L.mesh.size=6*ce}for(var E=0;E<W;E++){var O=o[E],oe=O.position.x+V[O.line]*(this._align==="justify"?O.prevSpaces:1);this._roundPixels&&(oe=Math.round(oe));var de=oe*a,ye=O.position.y*a,$=O.texture,Ee=P[$.baseTexture.uid],Re=$.frame,Ne=$._uvs,Be=Ee.index++;Ee.indices[Be*6+0]=0+Be*4,Ee.indices[Be*6+1]=1+Be*4,Ee.indices[Be*6+2]=2+Be*4,Ee.indices[Be*6+3]=0+Be*4,Ee.indices[Be*6+4]=2+Be*4,Ee.indices[Be*6+5]=3+Be*4,Ee.vertices[Be*8+0]=de,Ee.vertices[Be*8+1]=ye,Ee.vertices[Be*8+2]=de+Re.width*a,Ee.vertices[Be*8+3]=ye,Ee.vertices[Be*8+4]=de+Re.width*a,Ee.vertices[Be*8+5]=ye+Re.height*a,Ee.vertices[Be*8+6]=de,Ee.vertices[Be*8+7]=ye+Re.height*a,Ee.uvs[Be*8+0]=Ne.x0,Ee.uvs[Be*8+1]=Ne.y0,Ee.uvs[Be*8+2]=Ne.x1,Ee.uvs[Be*8+3]=Ne.y1,Ee.uvs[Be*8+4]=Ne.x2,Ee.uvs[Be*8+5]=Ne.y2,Ee.uvs[Be*8+6]=Ne.x3,Ee.uvs[Be*8+7]=Ne.y3}this._textWidth=y*a,this._textHeight=(s.y+n.lineHeight)*a;for(var E in P){var L=P[E];if(this.anchor.x!==0||this.anchor.y!==0)for(var $e=0,Ye=this._textWidth*this.anchor.x,He=this._textHeight*this.anchor.y,tt=0;tt<L.total;tt++)L.vertices[$e++]-=Ye,L.vertices[$e++]-=He,L.vertices[$e++]-=Ye,L.vertices[$e++]-=He,L.vertices[$e++]-=Ye,L.vertices[$e++]-=He,L.vertices[$e++]-=Ye,L.vertices[$e++]-=He;this._maxLineHeight=C*a;var ot=L.mesh.geometry.getBuffer("aVertexPosition"),ct=L.mesh.geometry.getBuffer("aTextureCoord"),Ze=L.mesh.geometry.getIndex();ot.data=L.vertices,ct.data=L.uvs,Ze.data=L.indices,ot.update(),ct.update(),Ze.update()}for(var E=0;E<o.length;E++)yA.push(o[E]);this._font=n,this.dirty=!1},e.prototype.updateTransform=function(){this.validate(),this.containerUpdateTransform()},e.prototype._render=function(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0);var n=Ls.available[this._fontName],i=n.distanceFieldRange,a=n.distanceFieldType,s=n.size;if(a!=="none")for(var o=this.worldTransform,l=o.a,c=o.b,h=o.c,d=o.d,v=Math.sqrt(l*l+c*c),g=Math.sqrt(h*h+d*d),m=(Math.abs(v)+Math.abs(g))/2,x=this.fontSize/s,y=0,_=this._activePagesMeshData;y<_.length;y++){var w=_[y];w.mesh.shader.uniforms.uFWidth=m*i*x*this._resolution}r.prototype._render.call(this,t)},e.prototype.getLocalBounds=function(){return this.validate(),r.prototype.getLocalBounds.call(this)},e.prototype.validate=function(){var t=Ls.available[this._fontName];if(!t)throw new Error('Missing BitmapFont "'+this._fontName+'"');this._font!==t&&(this.dirty=!0),this.dirty&&this.updateText()},Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){if(this._tint!==t){this._tint=t;for(var n=0;n<this._activePagesMeshData.length;n++)this._activePagesMeshData[n].mesh.tint=t}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontName",{get:function(){return this._fontName},set:function(t){if(!Ls.available[t])throw new Error('Missing BitmapFont "'+t+'"');this._fontName!==t&&(this._fontName=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontSize",{get:function(){var t;return(t=this._fontSize)!==null&&t!==void 0?t:Ls.available[this._fontName].size},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchor",{get:function(){return this._anchor},set:function(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){t=String(t??""),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxWidth",{get:function(){return this._maxWidth},set:function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxLineHeight",{get:function(){return this.validate(),this._maxLineHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textWidth",{get:function(){return this.validate(),this._textWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){t!==this._roundPixels&&(this._roundPixels=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textHeight",{get:function(){return this.validate(),this._textHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)},enumerable:!1,configurable:!0}),e.prototype.destroy=function(t){var n=this._textureCache,i=Ls.available[this._fontName],a=i.distanceFieldType==="none"?gA:mA;a.push.apply(a,this._activePagesMeshData);for(var s=0,o=this._activePagesMeshData;s<o.length;s++){var l=o[s];this.removeChild(l.mesh)}this._activePagesMeshData=[],a.filter(function(d){return n[d.mesh.texture.baseTexture.uid]}).forEach(function(d){d.mesh.texture=Rt.EMPTY});for(var c in n){var h=n[c];h.destroy(),delete n[c]}this._font=null,this._textureCache=null,r.prototype.destroy.call(this,t)},e.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0},e})(_a),vP=(function(){function r(){}return r.add=function(){Qr.setExtensionXhrType("fnt",Qr.XHR_RESPONSE_TYPE.TEXT)},r.use=function(e,t){var n=a3(e.data);if(!n){t();return}for(var i=r.getBaseUrl(this,e),a=n.parse(e.data),s={},o=function(x){s[x.metadata.pageFile]=x.texture,Object.keys(s).length===a.page.length&&(e.bitmapFont=Ls.install(a,s,!0),t())},l=0;l<a.page.length;++l){var c=a.page[l].file,h=i+c,d=!1;for(var v in this.resources){var g=this.resources[v];if(g.url===h){g.metadata.pageFile=c,g.texture?o(g):g.onAfterMiddleware.add(o),d=!0;break}}if(!d){var m={crossOrigin:e.crossOrigin,loadType:Qr.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:c},e.metadata.imageMetadata),parentResource:e};this.add(h,m,o)}}},r.getBaseUrl=function(e,t){var n=t.isDataUrl?"":r.dirname(t.url);return t.isDataUrl&&(n==="."&&(n=""),e.baseUrl&&n&&e.baseUrl.charAt(e.baseUrl.length-1)==="/"&&(n+="/")),n=n.replace(e.baseUrl,""),n&&n.charAt(n.length-1)!=="/"&&(n+="/"),n},r.dirname=function(e){var t=e.replace(/\\/g,"/").replace(/\/$/,"").replace(/\/[^\/]*$/,"");return t===e?".":t===""?"/":t},r.extension=yr.Loader,r})();/*!
  1252. * @pixi/filter-alpha - v6.5.10
  1253. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  1254. *
  1255. * @pixi/filter-alpha is licensed under the MIT License.
  1256. * http://www.opensource.org/licenses/mit-license
  1257. *//*! *****************************************************************************
  1258. Copyright (c) Microsoft Corporation.
  1259. Permission to use, copy, modify, and/or distribute this software for any
  1260. purpose with or without fee is hereby granted.
  1261. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  1262. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  1263. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  1264. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  1265. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  1266. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  1267. PERFORMANCE OF THIS SOFTWARE.
  1268. ***************************************************************************** */var Z4=function(r,e){return Z4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},Z4(r,e)};function KZ(r,e){Z4(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var ZZ=`varying vec2 vTextureCoord;
  1269. uniform sampler2D uSampler;
  1270. uniform float uAlpha;
  1271. void main(void)
  1272. {
  1273. gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;
  1274. }
  1275. `,QZ=(function(r){KZ(e,r);function e(t){t===void 0&&(t=1);var n=r.call(this,wD,ZZ,{uAlpha:1})||this;return n.alpha=t,n}return Object.defineProperty(e.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0}),e})(Zs);/*!
  1276. * @pixi/filter-blur - v6.5.10
  1277. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  1278. *
  1279. * @pixi/filter-blur is licensed under the MIT License.
  1280. * http://www.opensource.org/licenses/mit-license
  1281. *//*! *****************************************************************************
  1282. Copyright (c) Microsoft Corporation.
  1283. Permission to use, copy, modify, and/or distribute this software for any
  1284. purpose with or without fee is hereby granted.
  1285. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  1286. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  1287. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  1288. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  1289. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  1290. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  1291. PERFORMANCE OF THIS SOFTWARE.
  1292. ***************************************************************************** */var Q4=function(r,e){return Q4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},Q4(r,e)};function pP(r,e){Q4(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var JZ=`
  1293. attribute vec2 aVertexPosition;
  1294. uniform mat3 projectionMatrix;
  1295. uniform float strength;
  1296. varying vec2 vBlurTexCoords[%size%];
  1297. uniform vec4 inputSize;
  1298. uniform vec4 outputFrame;
  1299. vec4 filterVertexPosition( void )
  1300. {
  1301. vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
  1302. return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
  1303. }
  1304. vec2 filterTextureCoord( void )
  1305. {
  1306. return aVertexPosition * (outputFrame.zw * inputSize.zw);
  1307. }
  1308. void main(void)
  1309. {
  1310. gl_Position = filterVertexPosition();
  1311. vec2 textureCoord = filterTextureCoord();
  1312. %blur%
  1313. }`;function eQ(r,e){var t=Math.ceil(r/2),n=JZ,i="",a;e?a="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":a="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(var s=0;s<r;s++){var o=a.replace("%index%",s.toString());o=o.replace("%sampleIndex%",s-(t-1)+".0"),i+=o,i+=`
  1314. `}return n=n.replace("%blur%",i),n=n.replace("%size%",r.toString()),n}var tQ={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]},rQ=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{"," gl_FragColor = vec4(0.0);"," %blur%","}"].join(`
  1315. `);function nQ(r){for(var e=tQ[r],t=e.length,n=rQ,i="",a="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;",s,o=0;o<r;o++){var l=a.replace("%index%",o.toString());s=o,o>=t&&(s=r-o-1),l=l.replace("%value%",e[s].toString()),i+=l,i+=`
  1316. `}return n=n.replace("%blur%",i),n=n.replace("%size%",r.toString()),n}var J4=(function(r){pP(e,r);function e(t,n,i,a,s){n===void 0&&(n=8),i===void 0&&(i=4),a===void 0&&(a=ht.FILTER_RESOLUTION),s===void 0&&(s=5);var o=this,l=eQ(s,t),c=nQ(s);return o=r.call(this,l,c)||this,o.horizontal=t,o.resolution=a,o._quality=0,o.quality=i,o.blur=n,o}return e.prototype.apply=function(t,n,i,a){if(i?this.horizontal?this.uniforms.strength=1/i.width*(i.width/n.width):this.uniforms.strength=1/i.height*(i.height/n.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/n.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/n.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,this.passes===1)t.applyFilter(this,n,i,a);else{var s=t.getFilterTexture(),o=t.renderer,l=n,c=s;this.state.blend=!1,t.applyFilter(this,l,c,ha.CLEAR);for(var h=1;h<this.passes-1;h++){t.bindAndClear(l,ha.BLIT),this.uniforms.uSampler=c;var d=c;c=l,l=d,o.shader.bind(this),o.geometry.draw(5)}this.state.blend=!0,t.applyFilter(this,c,i,a),t.returnFilterTexture(s)}},Object.defineProperty(e.prototype,"blur",{get:function(){return this.strength},set:function(t){this.padding=1+Math.abs(t)*2,this.strength=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"quality",{get:function(){return this._quality},set:function(t){this._quality=t,this.passes=t},enumerable:!1,configurable:!0}),e})(Zs),iQ=(function(r){pP(e,r);function e(t,n,i,a){t===void 0&&(t=8),n===void 0&&(n=4),i===void 0&&(i=ht.FILTER_RESOLUTION),a===void 0&&(a=5);var s=r.call(this)||this;return s.blurXFilter=new J4(!0,t,n,i,a),s.blurYFilter=new J4(!1,t,n,i,a),s.resolution=i,s.quality=n,s.blur=t,s.repeatEdgePixels=!1,s}return e.prototype.apply=function(t,n,i,a){var s=Math.abs(this.blurXFilter.strength),o=Math.abs(this.blurYFilter.strength);if(s&&o){var l=t.getFilterTexture();this.blurXFilter.apply(t,n,l,ha.CLEAR),this.blurYFilter.apply(t,l,i,a),t.returnFilterTexture(l)}else o?this.blurYFilter.apply(t,n,i,a):this.blurXFilter.apply(t,n,i,a)},e.prototype.updatePadding=function(){this._repeatEdgePixels?this.padding=0:this.padding=Math.max(Math.abs(this.blurXFilter.strength),Math.abs(this.blurYFilter.strength))*2},Object.defineProperty(e.prototype,"blur",{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=this.blurYFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"quality",{get:function(){return this.blurXFilter.quality},set:function(t){this.blurXFilter.quality=this.blurYFilter.quality=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blurX",{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blurY",{get:function(){return this.blurYFilter.blur},set:function(t){this.blurYFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.blurYFilter.blendMode},set:function(t){this.blurYFilter.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"repeatEdgePixels",{get:function(){return this._repeatEdgePixels},set:function(t){this._repeatEdgePixels=t,this.updatePadding()},enumerable:!1,configurable:!0}),e})(Zs);/*!
  1317. * @pixi/filter-color-matrix - v6.5.10
  1318. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  1319. *
  1320. * @pixi/filter-color-matrix is licensed under the MIT License.
  1321. * http://www.opensource.org/licenses/mit-license
  1322. *//*! *****************************************************************************
  1323. Copyright (c) Microsoft Corporation.
  1324. Permission to use, copy, modify, and/or distribute this software for any
  1325. purpose with or without fee is hereby granted.
  1326. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  1327. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  1328. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  1329. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  1330. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  1331. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  1332. PERFORMANCE OF THIS SOFTWARE.
  1333. ***************************************************************************** */var e_=function(r,e){return e_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},e_(r,e)};function aQ(r,e){e_(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var sQ=`varying vec2 vTextureCoord;
  1334. uniform sampler2D uSampler;
  1335. uniform float m[20];
  1336. uniform float uAlpha;
  1337. void main(void)
  1338. {
  1339. vec4 c = texture2D(uSampler, vTextureCoord);
  1340. if (uAlpha == 0.0) {
  1341. gl_FragColor = c;
  1342. return;
  1343. }
  1344. // Un-premultiply alpha before applying the color matrix. See issue #3539.
  1345. if (c.a > 0.0) {
  1346. c.rgb /= c.a;
  1347. }
  1348. vec4 result;
  1349. result.r = (m[0] * c.r);
  1350. result.r += (m[1] * c.g);
  1351. result.r += (m[2] * c.b);
  1352. result.r += (m[3] * c.a);
  1353. result.r += m[4];
  1354. result.g = (m[5] * c.r);
  1355. result.g += (m[6] * c.g);
  1356. result.g += (m[7] * c.b);
  1357. result.g += (m[8] * c.a);
  1358. result.g += m[9];
  1359. result.b = (m[10] * c.r);
  1360. result.b += (m[11] * c.g);
  1361. result.b += (m[12] * c.b);
  1362. result.b += (m[13] * c.a);
  1363. result.b += m[14];
  1364. result.a = (m[15] * c.r);
  1365. result.a += (m[16] * c.g);
  1366. result.a += (m[17] * c.b);
  1367. result.a += (m[18] * c.a);
  1368. result.a += m[19];
  1369. vec3 rgb = mix(c.rgb, result.rgb, uAlpha);
  1370. // Premultiply alpha again.
  1371. rgb *= result.a;
  1372. gl_FragColor = vec4(rgb, result.a);
  1373. }
  1374. `,t_=(function(r){aQ(e,r);function e(){var t=this,n={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};return t=r.call(this,Kw,sQ,n)||this,t.alpha=1,t}return e.prototype._loadMatrix=function(t,n){n===void 0&&(n=!1);var i=t;n&&(this._multiply(i,this.uniforms.m,t),i=this._colorMatrix(i)),this.uniforms.m=i},e.prototype._multiply=function(t,n,i){return t[0]=n[0]*i[0]+n[1]*i[5]+n[2]*i[10]+n[3]*i[15],t[1]=n[0]*i[1]+n[1]*i[6]+n[2]*i[11]+n[3]*i[16],t[2]=n[0]*i[2]+n[1]*i[7]+n[2]*i[12]+n[3]*i[17],t[3]=n[0]*i[3]+n[1]*i[8]+n[2]*i[13]+n[3]*i[18],t[4]=n[0]*i[4]+n[1]*i[9]+n[2]*i[14]+n[3]*i[19]+n[4],t[5]=n[5]*i[0]+n[6]*i[5]+n[7]*i[10]+n[8]*i[15],t[6]=n[5]*i[1]+n[6]*i[6]+n[7]*i[11]+n[8]*i[16],t[7]=n[5]*i[2]+n[6]*i[7]+n[7]*i[12]+n[8]*i[17],t[8]=n[5]*i[3]+n[6]*i[8]+n[7]*i[13]+n[8]*i[18],t[9]=n[5]*i[4]+n[6]*i[9]+n[7]*i[14]+n[8]*i[19]+n[9],t[10]=n[10]*i[0]+n[11]*i[5]+n[12]*i[10]+n[13]*i[15],t[11]=n[10]*i[1]+n[11]*i[6]+n[12]*i[11]+n[13]*i[16],t[12]=n[10]*i[2]+n[11]*i[7]+n[12]*i[12]+n[13]*i[17],t[13]=n[10]*i[3]+n[11]*i[8]+n[12]*i[13]+n[13]*i[18],t[14]=n[10]*i[4]+n[11]*i[9]+n[12]*i[14]+n[13]*i[19]+n[14],t[15]=n[15]*i[0]+n[16]*i[5]+n[17]*i[10]+n[18]*i[15],t[16]=n[15]*i[1]+n[16]*i[6]+n[17]*i[11]+n[18]*i[16],t[17]=n[15]*i[2]+n[16]*i[7]+n[17]*i[12]+n[18]*i[17],t[18]=n[15]*i[3]+n[16]*i[8]+n[17]*i[13]+n[18]*i[18],t[19]=n[15]*i[4]+n[16]*i[9]+n[17]*i[14]+n[18]*i[19]+n[19],t},e.prototype._colorMatrix=function(t){var n=new Float32Array(t);return n[4]/=255,n[9]/=255,n[14]/=255,n[19]/=255,n},e.prototype.brightness=function(t,n){var i=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(i,n)},e.prototype.tint=function(t,n){var i=t>>16&255,a=t>>8&255,s=t&255,o=[i/255,0,0,0,0,0,a/255,0,0,0,0,0,s/255,0,0,0,0,0,1,0];this._loadMatrix(o,n)},e.prototype.greyscale=function(t,n){var i=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(i,n)},e.prototype.blackAndWhite=function(t){var n=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(n,t)},e.prototype.hue=function(t,n){t=(t||0)/180*Math.PI;var i=Math.cos(t),a=Math.sin(t),s=Math.sqrt,o=1/3,l=s(o),c=i+(1-i)*o,h=o*(1-i)-l*a,d=o*(1-i)+l*a,v=o*(1-i)+l*a,g=i+o*(1-i),m=o*(1-i)-l*a,x=o*(1-i)-l*a,y=o*(1-i)+l*a,_=i+o*(1-i),w=[c,h,d,0,0,v,g,m,0,0,x,y,_,0,0,0,0,0,1,0];this._loadMatrix(w,n)},e.prototype.contrast=function(t,n){var i=(t||0)+1,a=-.5*(i-1),s=[i,0,0,0,a,0,i,0,0,a,0,0,i,0,a,0,0,0,1,0];this._loadMatrix(s,n)},e.prototype.saturate=function(t,n){t===void 0&&(t=0);var i=t*2/3+1,a=(i-1)*-.5,s=[i,a,a,0,0,a,i,a,0,0,a,a,i,0,0,0,0,0,1,0];this._loadMatrix(s,n)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){var n=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0];this._loadMatrix(n,t)},e.prototype.sepia=function(t){var n=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(n,t)},e.prototype.technicolor=function(t){var n=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(n,t)},e.prototype.polaroid=function(t){var n=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(n,t)},e.prototype.toBGR=function(t){var n=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(n,t)},e.prototype.kodachrome=function(t){var n=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(n,t)},e.prototype.browni=function(t){var n=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(n,t)},e.prototype.vintage=function(t){var n=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(n,t)},e.prototype.colorTone=function(t,n,i,a,s){t=t||.2,n=n||.15,i=i||16770432,a=a||3375104;var o=(i>>16&255)/255,l=(i>>8&255)/255,c=(i&255)/255,h=(a>>16&255)/255,d=(a>>8&255)/255,v=(a&255)/255,g=[.3,.59,.11,0,0,o,l,c,t,0,h,d,v,n,0,o-h,l-d,c-v,0,0];this._loadMatrix(g,s)},e.prototype.night=function(t,n){t=t||.1;var i=[t*-2,-t,0,0,0,-t,0,t,0,0,0,t,t*2,0,0,0,0,0,1,0];this._loadMatrix(i,n)},e.prototype.predator=function(t,n){var i=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(i,n)},e.prototype.lsd=function(t){var n=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(n,t)},e.prototype.reset=function(){var t=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(t,!1)},Object.defineProperty(e.prototype,"matrix",{get:function(){return this.uniforms.m},set:function(t){this.uniforms.m=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0}),e})(Zs);t_.prototype.grayscale=t_.prototype.greyscale;/*!
  1375. * @pixi/filter-displacement - v6.5.10
  1376. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  1377. *
  1378. * @pixi/filter-displacement is licensed under the MIT License.
  1379. * http://www.opensource.org/licenses/mit-license
  1380. *//*! *****************************************************************************
  1381. Copyright (c) Microsoft Corporation.
  1382. Permission to use, copy, modify, and/or distribute this software for any
  1383. purpose with or without fee is hereby granted.
  1384. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  1385. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  1386. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  1387. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  1388. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  1389. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  1390. PERFORMANCE OF THIS SOFTWARE.
  1391. ***************************************************************************** */var r_=function(r,e){return r_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},r_(r,e)};function oQ(r,e){r_(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var lQ=`varying vec2 vFilterCoord;
  1392. varying vec2 vTextureCoord;
  1393. uniform vec2 scale;
  1394. uniform mat2 rotation;
  1395. uniform sampler2D uSampler;
  1396. uniform sampler2D mapSampler;
  1397. uniform highp vec4 inputSize;
  1398. uniform vec4 inputClamp;
  1399. void main(void)
  1400. {
  1401. vec4 map = texture2D(mapSampler, vFilterCoord);
  1402. map -= 0.5;
  1403. map.xy = scale * inputSize.zw * (rotation * map.xy);
  1404. gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));
  1405. }
  1406. `,uQ=`attribute vec2 aVertexPosition;
  1407. uniform mat3 projectionMatrix;
  1408. uniform mat3 filterMatrix;
  1409. varying vec2 vTextureCoord;
  1410. varying vec2 vFilterCoord;
  1411. uniform vec4 inputSize;
  1412. uniform vec4 outputFrame;
  1413. vec4 filterVertexPosition( void )
  1414. {
  1415. vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
  1416. return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
  1417. }
  1418. vec2 filterTextureCoord( void )
  1419. {
  1420. return aVertexPosition * (outputFrame.zw * inputSize.zw);
  1421. }
  1422. void main(void)
  1423. {
  1424. gl_Position = filterVertexPosition();
  1425. vTextureCoord = filterTextureCoord();
  1426. vFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;
  1427. }
  1428. `,cQ=(function(r){oQ(e,r);function e(t,n){var i=this,a=new qr;return t.renderable=!1,i=r.call(this,uQ,lQ,{mapSampler:t._texture,filterMatrix:a,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])})||this,i.maskSprite=t,i.maskMatrix=a,n==null&&(n=20),i.scale=new Ar(n,n),i}return e.prototype.apply=function(t,n,i,a){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var s=this.maskSprite.worldTransform,o=Math.sqrt(s.a*s.a+s.b*s.b),l=Math.sqrt(s.c*s.c+s.d*s.d);o!==0&&l!==0&&(this.uniforms.rotation[0]=s.a/o,this.uniforms.rotation[1]=s.b/o,this.uniforms.rotation[2]=s.c/l,this.uniforms.rotation[3]=s.d/l),t.applyFilter(this,n,i,a)},Object.defineProperty(e.prototype,"map",{get:function(){return this.uniforms.mapSampler},set:function(t){this.uniforms.mapSampler=t},enumerable:!1,configurable:!0}),e})(Zs);/*!
  1429. * @pixi/filter-fxaa - v6.5.10
  1430. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  1431. *
  1432. * @pixi/filter-fxaa is licensed under the MIT License.
  1433. * http://www.opensource.org/licenses/mit-license
  1434. *//*! *****************************************************************************
  1435. Copyright (c) Microsoft Corporation.
  1436. Permission to use, copy, modify, and/or distribute this software for any
  1437. purpose with or without fee is hereby granted.
  1438. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  1439. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  1440. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  1441. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  1442. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  1443. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  1444. PERFORMANCE OF THIS SOFTWARE.
  1445. ***************************************************************************** */var n_=function(r,e){return n_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},n_(r,e)};function hQ(r,e){n_(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var fQ=`
  1446. attribute vec2 aVertexPosition;
  1447. uniform mat3 projectionMatrix;
  1448. varying vec2 v_rgbNW;
  1449. varying vec2 v_rgbNE;
  1450. varying vec2 v_rgbSW;
  1451. varying vec2 v_rgbSE;
  1452. varying vec2 v_rgbM;
  1453. varying vec2 vFragCoord;
  1454. uniform vec4 inputSize;
  1455. uniform vec4 outputFrame;
  1456. vec4 filterVertexPosition( void )
  1457. {
  1458. vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
  1459. return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
  1460. }
  1461. void texcoords(vec2 fragCoord, vec2 inverseVP,
  1462. out vec2 v_rgbNW, out vec2 v_rgbNE,
  1463. out vec2 v_rgbSW, out vec2 v_rgbSE,
  1464. out vec2 v_rgbM) {
  1465. v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;
  1466. v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;
  1467. v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;
  1468. v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;
  1469. v_rgbM = vec2(fragCoord * inverseVP);
  1470. }
  1471. void main(void) {
  1472. gl_Position = filterVertexPosition();
  1473. vFragCoord = aVertexPosition * outputFrame.zw;
  1474. texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);
  1475. }
  1476. `,dQ=`varying vec2 v_rgbNW;
  1477. varying vec2 v_rgbNE;
  1478. varying vec2 v_rgbSW;
  1479. varying vec2 v_rgbSE;
  1480. varying vec2 v_rgbM;
  1481. varying vec2 vFragCoord;
  1482. uniform sampler2D uSampler;
  1483. uniform highp vec4 inputSize;
  1484. /**
  1485. Basic FXAA implementation based on the code on geeks3d.com with the
  1486. modification that the texture2DLod stuff was removed since it's
  1487. unsupported by WebGL.
  1488. --
  1489. From:
  1490. https://github.com/mitsuhiko/webgl-meincraft
  1491. Copyright (c) 2011 by Armin Ronacher.
  1492. Some rights reserved.
  1493. Redistribution and use in source and binary forms, with or without
  1494. modification, are permitted provided that the following conditions are
  1495. met:
  1496. * Redistributions of source code must retain the above copyright
  1497. notice, this list of conditions and the following disclaimer.
  1498. * Redistributions in binary form must reproduce the above
  1499. copyright notice, this list of conditions and the following
  1500. disclaimer in the documentation and/or other materials provided
  1501. with the distribution.
  1502. * The names of the contributors may not be used to endorse or
  1503. promote products derived from this software without specific
  1504. prior written permission.
  1505. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  1506. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  1507. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  1508. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  1509. OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  1510. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  1511. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  1512. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  1513. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  1514. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  1515. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  1516. */
  1517. #ifndef FXAA_REDUCE_MIN
  1518. #define FXAA_REDUCE_MIN (1.0/ 128.0)
  1519. #endif
  1520. #ifndef FXAA_REDUCE_MUL
  1521. #define FXAA_REDUCE_MUL (1.0 / 8.0)
  1522. #endif
  1523. #ifndef FXAA_SPAN_MAX
  1524. #define FXAA_SPAN_MAX 8.0
  1525. #endif
  1526. //optimized version for mobile, where dependent
  1527. //texture reads can be a bottleneck
  1528. vec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,
  1529. vec2 v_rgbNW, vec2 v_rgbNE,
  1530. vec2 v_rgbSW, vec2 v_rgbSE,
  1531. vec2 v_rgbM) {
  1532. vec4 color;
  1533. vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;
  1534. vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;
  1535. vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;
  1536. vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;
  1537. vec4 texColor = texture2D(tex, v_rgbM);
  1538. vec3 rgbM = texColor.xyz;
  1539. vec3 luma = vec3(0.299, 0.587, 0.114);
  1540. float lumaNW = dot(rgbNW, luma);
  1541. float lumaNE = dot(rgbNE, luma);
  1542. float lumaSW = dot(rgbSW, luma);
  1543. float lumaSE = dot(rgbSE, luma);
  1544. float lumaM = dot(rgbM, luma);
  1545. float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));
  1546. float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));
  1547. mediump vec2 dir;
  1548. dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));
  1549. dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));
  1550. float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *
  1551. (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);
  1552. float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);
  1553. dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),
  1554. max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),
  1555. dir * rcpDirMin)) * inverseVP;
  1556. vec3 rgbA = 0.5 * (
  1557. texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +
  1558. texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);
  1559. vec3 rgbB = rgbA * 0.5 + 0.25 * (
  1560. texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +
  1561. texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);
  1562. float lumaB = dot(rgbB, luma);
  1563. if ((lumaB < lumaMin) || (lumaB > lumaMax))
  1564. color = vec4(rgbA, texColor.a);
  1565. else
  1566. color = vec4(rgbB, texColor.a);
  1567. return color;
  1568. }
  1569. void main() {
  1570. vec4 color;
  1571. color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);
  1572. gl_FragColor = color;
  1573. }
  1574. `,vQ=(function(r){hQ(e,r);function e(){return r.call(this,fQ,dQ)||this}return e})(Zs);/*!
  1575. * @pixi/filter-noise - v6.5.10
  1576. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  1577. *
  1578. * @pixi/filter-noise is licensed under the MIT License.
  1579. * http://www.opensource.org/licenses/mit-license
  1580. *//*! *****************************************************************************
  1581. Copyright (c) Microsoft Corporation.
  1582. Permission to use, copy, modify, and/or distribute this software for any
  1583. purpose with or without fee is hereby granted.
  1584. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  1585. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  1586. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  1587. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  1588. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  1589. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  1590. PERFORMANCE OF THIS SOFTWARE.
  1591. ***************************************************************************** */var i_=function(r,e){return i_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},i_(r,e)};function pQ(r,e){i_(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var gQ=`precision highp float;
  1592. varying vec2 vTextureCoord;
  1593. varying vec4 vColor;
  1594. uniform float uNoise;
  1595. uniform float uSeed;
  1596. uniform sampler2D uSampler;
  1597. float rand(vec2 co)
  1598. {
  1599. return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);
  1600. }
  1601. void main()
  1602. {
  1603. vec4 color = texture2D(uSampler, vTextureCoord);
  1604. float randomValue = rand(gl_FragCoord.xy * uSeed);
  1605. float diff = (randomValue - 0.5) * uNoise;
  1606. // Un-premultiply alpha before applying the color matrix. See issue #3539.
  1607. if (color.a > 0.0) {
  1608. color.rgb /= color.a;
  1609. }
  1610. color.r += diff;
  1611. color.g += diff;
  1612. color.b += diff;
  1613. // Premultiply alpha again.
  1614. color.rgb *= color.a;
  1615. gl_FragColor = color;
  1616. }
  1617. `,mQ=(function(r){pQ(e,r);function e(t,n){t===void 0&&(t=.5),n===void 0&&(n=Math.random());var i=r.call(this,Kw,gQ,{uNoise:0,uSeed:0})||this;return i.noise=t,i.seed=n,i}return Object.defineProperty(e.prototype,"noise",{get:function(){return this.uniforms.uNoise},set:function(t){this.uniforms.uNoise=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"seed",{get:function(){return this.uniforms.uSeed},set:function(t){this.uniforms.uSeed=t},enumerable:!1,configurable:!0}),e})(Zs);/*!
  1618. * @pixi/mixin-cache-as-bitmap - v6.5.10
  1619. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  1620. *
  1621. * @pixi/mixin-cache-as-bitmap is licensed under the MIT License.
  1622. * http://www.opensource.org/licenses/mit-license
  1623. */var gP=new qr;ln.prototype._cacheAsBitmap=!1;ln.prototype._cacheData=null;ln.prototype._cacheAsBitmapResolution=null;ln.prototype._cacheAsBitmapMultisample=Fr.NONE;var yQ=(function(){function r(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null}return r})();Object.defineProperties(ln.prototype,{cacheAsBitmapResolution:{get:function(){return this._cacheAsBitmapResolution},set:function(r){r!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=r,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get:function(){return this._cacheAsBitmapMultisample},set:function(r){r!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=r,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(r){if(this._cacheAsBitmap!==r){this._cacheAsBitmap=r;var e;r?(this._cacheData||(this._cacheData=new yQ),e=this._cacheData,e.originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):(e=this._cacheData,e.sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea)}}}});ln.prototype._renderCached=function(e){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(e),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(e))};ln.prototype._initCachedDisplayObject=function(e){var t;if(!(this._cacheData&&this._cacheData.sprite)){var n=this.alpha;this.alpha=1,e.batch.flush();var i=this.getLocalBounds(null,!0).clone();if(this.filters&&this.filters.length){var a=this.filters[0].padding;i.pad(a)}i.ceil(ht.RESOLUTION);var s=e.renderTexture.current,o=e.renderTexture.sourceFrame.clone(),l=e.renderTexture.destinationFrame.clone(),c=e.projection.transform,h=nl.create({width:i.width,height:i.height,resolution:this.cacheAsBitmapResolution||e.resolution,multisample:(t=this.cacheAsBitmapMultisample)!==null&&t!==void 0?t:e.multisample}),d="cacheAsBitmap_"+rl();this._cacheData.textureCacheId=d,Wt.addToCache(h.baseTexture,d),Rt.addToCache(h,d);var v=this.transform.localTransform.copyTo(gP).invert().translate(-i.x,-i.y);this.render=this._cacheData.originalRender,e.render(this,{renderTexture:h,clear:!0,transform:v,skipUpdateTransform:!1}),e.framebuffer.blit(),e.projection.transform=c,e.renderTexture.bind(s,o,l),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=n;var g=new oh(h);g.transform.worldTransform=this.transform.worldTransform,g.anchor.x=-(i.x/i.width),g.anchor.y=-(i.y/i.height),g.alpha=n,g._bounds=this._bounds,this._cacheData.sprite=g,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=g.containsPoint.bind(g)}};ln.prototype._renderCachedCanvas=function(e){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(e),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(e))};ln.prototype._initCachedDisplayObjectCanvas=function(e){if(!(this._cacheData&&this._cacheData.sprite)){var t=this.getLocalBounds(null,!0),n=this.alpha;this.alpha=1;var i=e.context,a=e._projTransform;t.ceil(ht.RESOLUTION);var s=nl.create({width:t.width,height:t.height}),o="cacheAsBitmap_"+rl();this._cacheData.textureCacheId=o,Wt.addToCache(s.baseTexture,o),Rt.addToCache(s,o);var l=gP;this.transform.localTransform.copyTo(l),l.invert(),l.tx-=t.x,l.ty-=t.y,this.renderCanvas=this._cacheData.originalRenderCanvas,e.render(this,{renderTexture:s,clear:!0,transform:l,skipUpdateTransform:!1}),e.context=i,e._projTransform=a,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=n;var c=new oh(s);c.transform.worldTransform=this.transform.worldTransform,c.anchor.x=-(t.x/t.width),c.anchor.y=-(t.y/t.height),c.alpha=n,c._bounds=this._bounds,this._cacheData.sprite=c,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=e._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=c.containsPoint.bind(c)}};ln.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID};ln.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)};ln.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,Wt.removeFromCache(this._cacheData.textureCacheId),Rt.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null};ln.prototype._cacheAsBitmapDestroy=function(e){this.cacheAsBitmap=!1,this.destroy(e)};/*!
  1624. * @pixi/mixin-get-child-by-name - v6.5.10
  1625. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  1626. *
  1627. * @pixi/mixin-get-child-by-name is licensed under the MIT License.
  1628. * http://www.opensource.org/licenses/mit-license
  1629. */ln.prototype.name=null;_a.prototype.getChildByName=function(e,t){for(var n=0,i=this.children.length;n<i;n++)if(this.children[n].name===e)return this.children[n];if(t)for(var n=0,i=this.children.length;n<i;n++){var a=this.children[n];if(a.getChildByName){var s=a.getChildByName(e,!0);if(s)return s}}return null};/*!
  1630. * @pixi/mixin-get-global-position - v6.5.10
  1631. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  1632. *
  1633. * @pixi/mixin-get-global-position is licensed under the MIT License.
  1634. * http://www.opensource.org/licenses/mit-license
  1635. */ln.prototype.getGlobalPosition=function(e,t){return e===void 0&&(e=new Ar),t===void 0&&(t=!1),this.parent?this.parent.toGlobal(this.position,e,t):(e.x=this.position.x,e.y=this.position.y),e};/*!
  1636. * @pixi/app - v6.5.10
  1637. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  1638. *
  1639. * @pixi/app is licensed under the MIT License.
  1640. * http://www.opensource.org/licenses/mit-license
  1641. */var mP=(function(){function r(){}return r.init=function(e){var t=this;Object.defineProperty(this,"resizeTo",{set:function(n){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=n,n&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get:function(){return this._resizeTo}}),this.queueResize=function(){t._resizeTo&&(t.cancelResize(),t._resizeId=requestAnimationFrame(function(){return t.resize()}))},this.cancelResize=function(){t._resizeId&&(cancelAnimationFrame(t._resizeId),t._resizeId=null)},this.resize=function(){if(t._resizeTo){t.cancelResize();var n,i;if(t._resizeTo===globalThis.window)n=globalThis.innerWidth,i=globalThis.innerHeight;else{var a=t._resizeTo,s=a.clientWidth,o=a.clientHeight;n=s,i=o}t.renderer.resize(n,i)}},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null},r.destroy=function(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null},r.extension=yr.Application,r})(),s3=(function(){function r(e){var t=this;this.stage=new _a,e=Object.assign({forceCanvas:!1},e),this.renderer=_D(e),r._plugins.forEach(function(n){n.init.call(t,e)})}return r.registerPlugin=function(e){fi("6.5.0","Application.registerPlugin() is deprecated, use extensions.add()"),us.add({type:yr.Application,ref:e})},r.prototype.render=function(){this.renderer.render(this.stage)},Object.defineProperty(r.prototype,"view",{get:function(){return this.renderer.view},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"screen",{get:function(){return this.renderer.screen},enumerable:!1,configurable:!0}),r.prototype.destroy=function(e,t){var n=this,i=r._plugins.slice(0);i.reverse(),i.forEach(function(a){a.destroy.call(n)}),this.stage.destroy(t),this.stage=null,this.renderer.destroy(e),this.renderer=null},r._plugins=[],r})();us.handleByList(yr.Application,s3._plugins);us.add(mP);/*!
  1642. * @pixi/mesh-extras - v6.5.10
  1643. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  1644. *
  1645. * @pixi/mesh-extras is licensed under the MIT License.
  1646. * http://www.opensource.org/licenses/mit-license
  1647. *//*! *****************************************************************************
  1648. Copyright (c) Microsoft Corporation.
  1649. Permission to use, copy, modify, and/or distribute this software for any
  1650. purpose with or without fee is hereby granted.
  1651. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  1652. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  1653. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  1654. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  1655. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  1656. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  1657. PERFORMANCE OF THIS SOFTWARE.
  1658. ***************************************************************************** */var a_=function(r,e){return a_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},a_(r,e)};function lh(r,e){a_(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var yP=(function(r){lh(e,r);function e(t,n,i,a){t===void 0&&(t=100),n===void 0&&(n=100),i===void 0&&(i=10),a===void 0&&(a=10);var s=r.call(this)||this;return s.segWidth=i,s.segHeight=a,s.width=t,s.height=n,s.build(),s}return e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,n=[],i=[],a=[],s=this.segWidth-1,o=this.segHeight-1,l=this.width/s,c=this.height/o,h=0;h<t;h++){var d=h%this.segWidth,v=h/this.segWidth|0;n.push(d*l,v*c),i.push(d/s,v/o)}for(var g=s*o,h=0;h<g;h++){var m=h%s,x=h/s|0,y=x*this.segWidth+m,_=x*this.segWidth+m+1,w=(x+1)*this.segWidth+m,S=(x+1)*this.segWidth+m+1;a.push(y,_,w,_,S,w)}this.buffers[0].data=new Float32Array(n),this.buffers[1].data=new Float32Array(i),this.indexBuffer.data=new Uint16Array(a),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()},e})(Bd),bP=(function(r){lh(e,r);function e(t,n,i){t===void 0&&(t=200),i===void 0&&(i=0);var a=r.call(this,new Float32Array(n.length*4),new Float32Array(n.length*4),new Uint16Array((n.length-1)*6))||this;return a.points=n,a._width=t,a.textureScale=i,a.build(),a}return Object.defineProperty(e.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),e.prototype.build=function(){var t=this.points;if(t){var n=this.getBuffer("aVertexPosition"),i=this.getBuffer("aTextureCoord"),a=this.getIndex();if(!(t.length<1)){n.data.length/4!==t.length&&(n.data=new Float32Array(t.length*4),i.data=new Float32Array(t.length*4),a.data=new Uint16Array((t.length-1)*6));var s=i.data,o=a.data;s[0]=0,s[1]=0,s[2]=0,s[3]=1;for(var l=0,c=t[0],h=this._width*this.textureScale,d=t.length,v=0;v<d;v++){var g=v*4;if(this.textureScale>0){var m=c.x-t[v].x,x=c.y-t[v].y,y=Math.sqrt(m*m+x*x);c=t[v],l+=y/h}else l=v/(d-1);s[g]=l,s[g+1]=0,s[g+2]=l,s[g+3]=1}for(var _=0,v=0;v<d-1;v++){var g=v*2;o[_++]=g,o[_++]=g+1,o[_++]=g+2,o[_++]=g+2,o[_++]=g+1,o[_++]=g+3}i.update(),a.update(),this.updateVertices()}}},e.prototype.updateVertices=function(){var t=this.points;if(!(t.length<1)){for(var n=t[0],i,a=0,s=0,o=this.buffers[0].data,l=t.length,c=0;c<l;c++){var h=t[c],d=c*4;c<t.length-1?i=t[c+1]:i=h,s=-(i.x-n.x),a=i.y-n.y;var v=Math.sqrt(a*a+s*s),g=this.textureScale>0?this.textureScale*this._width/2:this._width/2;a/=v,s/=v,a*=g,s*=g,o[d]=h.x+a,o[d+1]=h.y+s,o[d+2]=h.x-a,o[d+3]=h.y-s,n=h}this.buffers[0].update()}},e.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},e})(Bd),bQ=(function(r){lh(e,r);function e(t,n,i){i===void 0&&(i=0);var a=this,s=new bP(t.height,n,i),o=new qc(t);return i>0&&(t.baseTexture.wrapMode=Ia.REPEAT),a=r.call(this,s,o)||this,a.autoUpdate=!0,a}return e.prototype._render=function(t){var n=this.geometry;(this.autoUpdate||n._width!==this.shader.texture.height)&&(n._width=this.shader.texture.height,n.update()),r.prototype._render.call(this,t)},e})(Vc),xP=(function(r){lh(e,r);function e(t,n,i){var a=this,s=new yP(t.width,t.height,n,i),o=new qc(Rt.WHITE);return a=r.call(this,s,o)||this,a.texture=t,a.autoResize=!0,a}return e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var t=this.geometry,n=this.shader.texture,i=n.width,a=n.height;this.autoResize&&(t.width!==i||t.height!==a)&&(t.width=this.shader.texture.width,t.height=this.shader.texture.height,t.build())},Object.defineProperty(e.prototype,"texture",{get:function(){return this.shader.texture},set:function(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureID=-1,t.baseTexture.valid?this.textureUpdated():t.once("update",this.textureUpdated,this))},enumerable:!1,configurable:!0}),e.prototype._render=function(t){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),r.prototype._render.call(this,t)},e.prototype.destroy=function(t){this.shader.texture.off("update",this.textureUpdated,this),r.prototype.destroy.call(this,t)},e})(Vc),xQ=(function(r){lh(e,r);function e(t,n,i,a,s){t===void 0&&(t=Rt.EMPTY);var o=this,l=new Bd(n,i,a);l.getBuffer("aVertexPosition").static=!1;var c=new qc(t);return o=r.call(this,l,c,null,s)||this,o.autoUpdate=!0,o}return Object.defineProperty(e.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),e.prototype._render=function(t){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),r.prototype._render.call(this,t)},e})(Vc),Fv=10,_Q=(function(r){lh(e,r);function e(t,n,i,a,s){n===void 0&&(n=Fv),i===void 0&&(i=Fv),a===void 0&&(a=Fv),s===void 0&&(s=Fv);var o=r.call(this,Rt.WHITE,4,4)||this;return o._origWidth=t.orig.width,o._origHeight=t.orig.height,o._width=o._origWidth,o._height=o._origHeight,o._leftWidth=n,o._rightWidth=a,o._topHeight=i,o._bottomHeight=s,o.texture=t,o}return e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(e.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),e.prototype.updateHorizontalVertices=function(){var t=this.vertices,n=this._getMinScale();t[9]=t[11]=t[13]=t[15]=this._topHeight*n,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*n,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,n=this._getMinScale();t[2]=t[10]=t[18]=t[26]=this._leftWidth*n,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*n,t[6]=t[14]=t[22]=t[30]=this._width},e.prototype._getMinScale=function(){var t=this._leftWidth+this._rightWidth,n=this._width>t?1:this._width/t,i=this._topHeight+this._bottomHeight,a=this._height>i?1:this._height/i,s=Math.min(n,a);return s},Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(t){this._leftWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(t){this._rightWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"topHeight",{get:function(){return this._topHeight},set:function(t){this._topHeight=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(t){this._bottomHeight=t,this._refresh()},enumerable:!1,configurable:!0}),e.prototype._refresh=function(){var t=this.texture,n=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var i=1/this._origWidth,a=1/this._origHeight;n[0]=n[8]=n[16]=n[24]=0,n[1]=n[3]=n[5]=n[7]=0,n[6]=n[14]=n[22]=n[30]=1,n[25]=n[27]=n[29]=n[31]=1,n[2]=n[10]=n[18]=n[26]=i*this._leftWidth,n[4]=n[12]=n[20]=n[28]=1-i*this._rightWidth,n[9]=n[11]=n[13]=n[15]=a*this._topHeight,n[17]=n[19]=n[21]=n[23]=1-a*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},e})(xP);/*!
  1659. * @pixi/sprite-animated - v6.5.10
  1660. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  1661. *
  1662. * @pixi/sprite-animated is licensed under the MIT License.
  1663. * http://www.opensource.org/licenses/mit-license
  1664. *//*! *****************************************************************************
  1665. Copyright (c) Microsoft Corporation.
  1666. Permission to use, copy, modify, and/or distribute this software for any
  1667. purpose with or without fee is hereby granted.
  1668. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  1669. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  1670. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  1671. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  1672. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  1673. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  1674. PERFORMANCE OF THIS SOFTWARE.
  1675. ***************************************************************************** */var s_=function(r,e){return s_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},s_(r,e)};function wQ(r,e){s_(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var SQ=(function(r){wQ(e,r);function e(t,n){n===void 0&&(n=!0);var i=r.call(this,t[0]instanceof Rt?t[0]:t[0].texture)||this;return i._textures=null,i._durations=null,i._autoUpdate=n,i._isConnectedToTicker=!1,i.animationSpeed=1,i.loop=!0,i.updateAnchor=!1,i.onComplete=null,i.onFrameChange=null,i.onLoop=null,i._currentTime=0,i._playing=!1,i._previousFrame=null,i.textures=t,i}return e.prototype.stop=function(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(Fn.shared.remove(this.update,this),this._isConnectedToTicker=!1))},e.prototype.play=function(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(Fn.shared.add(this.update,this,is.HIGH),this._isConnectedToTicker=!0))},e.prototype.gotoAndStop=function(t){this.stop();var n=this.currentFrame;this._currentTime=t,n!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var n=this.currentFrame;this._currentTime=t,n!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){if(this._playing){var n=this.animationSpeed*t,i=this.currentFrame;if(this._durations!==null){var a=this._currentTime%1*this._durations[this.currentFrame];for(a+=n/60*1e3;a<0;)this._currentTime--,a+=this._durations[this.currentFrame];var s=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);a>=this._durations[this.currentFrame];)a-=this._durations[this.currentFrame]*s,this._currentTime+=s;this._currentTime+=a/this._durations[this.currentFrame]}else this._currentTime+=n;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):i!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<i?this.onLoop():this.animationSpeed<0&&this.currentFrame>i&&this.onLoop()),this.updateTexture())}},e.prototype.updateTexture=function(){var t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this._texture=this._textures[t],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))},e.prototype.destroy=function(t){this.stop(),r.prototype.destroy.call(this,t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var n=[],i=0;i<t.length;++i)n.push(Rt.from(t[i]));return new e(n)},e.fromImages=function(t){for(var n=[],i=0;i<t.length;++i)n.push(Rt.from(t[i]));return new e(n)},Object.defineProperty(e.prototype,"totalFrames",{get:function(){return this._textures.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textures",{get:function(){return this._textures},set:function(t){if(t[0]instanceof Rt)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(var n=0;n<t.length;n++)this._textures.push(t[n].texture),this._durations.push(t[n].time)}this._previousFrame=null,this.gotoAndStop(0),this.updateTexture()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentFrame",{get:function(){var t=Math.floor(this._currentTime)%this._textures.length;return t<0&&(t+=this._textures.length),t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"playing",{get:function(){return this._playing},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(Fn.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(Fn.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),e})(oh);/*!
  1676. * pixi.js - v6.5.10
  1677. * Compiled Thu, 06 Jul 2023 15:25:11 UTC
  1678. *
  1679. * pixi.js is licensed under the MIT License.
  1680. * http://www.opensource.org/licenses/mit-license
  1681. */us.add(RD,ID,PD,WD,aP,Qw,uP,vP,zD,qD,XD,oP,QO,LD);var EQ={AlphaFilter:QZ,BlurFilter:iQ,BlurFilterPass:J4,ColorMatrixFilter:t_,DisplacementFilter:cQ,FXAAFilter:vQ,NoiseFilter:mQ};const TQ=Object.freeze(Object.defineProperty({__proto__:null,get ALPHA_MODES(){return xa},AbstractBatchRenderer:SD,AbstractMultiResource:Ag,AbstractRenderer:xD,AccessibilityManager:RD,AnimatedSprite:SQ,AppLoaderPlugin:LD,Application:s3,ArrayResource:Cw,Attribute:P4,get BLEND_MODES(){return Et},get BUFFER_BITS(){return ad},get BUFFER_TYPE(){return Na},BaseImageResource:as,BasePrepare:nP,BaseRenderTexture:Pw,BaseTexture:Wt,BatchDrawCall:Up,BatchGeometry:Zw,BatchPluginFactory:TD,BatchRenderer:Qw,BatchShaderGenerator:ED,BatchSystem:kw,BatchTextureArray:Gp,BitmapFont:Ls,BitmapFontData:md,BitmapFontLoader:vP,BitmapText:$Z,BlobResource:FD,Bounds:hd,BrowserAdapter:AO,Buffer:wn,BufferResource:wu,get CLEAR_MODES(){return ha},get COLOR_MASK_BITS(){return w4},CanvasResource:Aw,Circle:WO,CompressedTextureLoader:zD,CompressedTextureResource:jp,Container:_a,ContextSystem:Bw,CountLimiter:rP,CubeResource:Mw,DDSLoader:qD,DEG_TO_RAD:YO,get DRAW_MODES(){return pa},DisplayObject:ln,get ENV(){return ns},Ellipse:$O,get ExtensionType(){return yr},Extract:ID,get FORMATS(){return at},FORMATS_TO_COMPONENTS:HD,FillStyle:e3,Filter:Zs,FilterState:rD,FilterSystem:Lw,Framebuffer:zp,FramebufferSystem:Fw,get GC_MODES(){return od},GLFramebuffer:nD,GLProgram:mD,GLTexture:vp,GRAPHICS_CURVES:Hc,Geometry:ah,GeometrySystem:zw,Graphics:gd,GraphicsData:V4,GraphicsGeometry:eP,IGLUniformData:nK,INSTALLED:fd,get INTERNAL_FORMATS(){return Lt},INTERNAL_FORMAT_TO_BYTES_PER_PIXEL:vd,ImageBitmapResource:Dw,ImageResource:Mg,InteractionData:I4,InteractionEvent:OD,InteractionManager:PD,InteractionTrackingData:pp,KTXLoader:XD,get LINE_CAP(){return Us},get LINE_JOIN(){return Za},LineStyle:tP,Loader:dd,get LoaderResource(){return Qr},get MASK_TYPES(){return vn},get MIPMAP_MODES(){return ba},get MSAA_QUALITY(){return Fr},MaskData:iD,MaskSystem:Uw,Matrix:qr,Mesh:Vc,MeshBatchUvs:cP,MeshGeometry:Bd,MeshMaterial:qc,NineSlicePlane:_Q,ObjectRenderer:kd,ObservablePoint:Go,PI_2:cd,get PRECISION(){return Oi},ParticleContainer:fZ,ParticleRenderer:WD,PlaneGeometry:yP,Point:Ar,Polygon:Uf,Prepare:aP,Program:sh,ProjectionSystem:jw,Quad:tD,QuadUv:Nw,RAD_TO_DEG:XO,get RENDERER_TYPE(){return Gc},Rectangle:$t,RenderTexture:nl,RenderTexturePool:eD,RenderTextureSystem:Vw,Renderer:$w,ResizePlugin:mP,Resource:gu,RopeGeometry:bP,RoundedRectangle:KO,Runner:Bn,get SAMPLER_TYPES(){return sd},get SCALE_MODES(){return Da},get SHAPES(){return Mn},SVGResource:Rw,ScissorSystem:Gw,Shader:Gs,ShaderSystem:qw,SimpleMesh:xQ,SimplePlane:xP,SimpleRope:bQ,Sprite:oh,SpriteMaskFilter:hD,Spritesheet:sP,SpritesheetLoader:oP,State:gl,StateSystem:Xw,StencilSystem:Hw,System:bK,get TARGETS(){return Xo},get TEXT_GRADIENT(){return jc},get TYPES(){return wt},TYPES_TO_BYTES_PER_COMPONENT:F4,TYPES_TO_BYTES_PER_PIXEL:jD,TemporaryDisplayObject:Tw,Text:n3,TextFormat:hP,TextMetrics:ka,TextStyle:mu,Texture:Rt,TextureGCSystem:Yw,TextureLoader:kD,TextureMatrix:Rg,TextureSystem:Ww,TextureUvs:Iw,Ticker:Fn,TickerPlugin:QO,TilingSprite:kZ,TilingSpriteRenderer:uP,TimeLimiter:LZ,Transform:Tg,get UPDATE_PRIORITY(){return is},UniformGroup:Yo,VERSION:wK,VideoResource:Ow,ViewableBuffer:Hp,get WRAP_MODES(){return Ia},XMLFormat:Vp,XMLStringFormat:fP,accessibleTarget:MD,autoDetectFormat:a3,autoDetectRenderer:_D,autoDetectResource:Cg,checkMaxIfStatementsInShader:cD,createUBOElements:vD,defaultFilterVertex:Kw,defaultVertex:wD,extensions:us,filters:EQ,generateProgram:yD,generateUniformBufferSync:gD,getTestContext:oD,getUBOData:pD,graphicsUtils:yZ,groupD8:Hr,interactiveTarget:DD,isMobile:ga,parseDDS:GD,parseKTX:VD,resources:CD,settings:ht,systems:AD,uniformParsers:uu,utils:C$},Symbol.toStringTag,{value:"Module"}));var jl=Math.pow,Kr=(r,e,t)=>new Promise((n,i)=>{var a=l=>{try{o(t.next(l))}catch(c){i(c)}},s=l=>{try{o(t.throw(l))}catch(c){i(c)}},o=l=>l.done?n(l.value):Promise.resolve(l.value).then(a,s);o((t=t.apply(r,e)).next())});class o3{constructor(){this._breathParameters=[],this._currentTime=0}static create(){return new o3}setParameters(e){this._breathParameters=e}getParameters(){return this._breathParameters}updateParameters(e,t){this._currentTime+=t;const n=this._currentTime*2*3.14159;for(let i=0;i<this._breathParameters.length;++i){const a=this._breathParameters[i];e.addParameterValueById(a.parameterId,a.offset+a.peak*Math.sin(n/a.cycle),a.weight)}}}class _f{constructor(e,t,n,i,a){this.parameterId=e??void 0,this.offset=t??0,this.peak=n??0,this.cycle=i??0,this.weight=a??0}}const o_=class{static create(r){return new o_(r)}setBlinkingInterval(r){this._blinkingIntervalSeconds=r}setBlinkingSetting(r,e,t){this._closingSeconds=r,this._closedSeconds=e,this._openingSeconds=t}setParameterIds(r){this._parameterIds=r}getParameterIds(){return this._parameterIds}updateParameters(r,e){this._userTimeSeconds+=e;let t,n=0;switch(this._blinkingState){case la.EyeState_Closing:n=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._closingSeconds,n>=1&&(n=1,this._blinkingState=la.EyeState_Closed,this._stateStartTimeSeconds=this._userTimeSeconds),t=1-n;break;case la.EyeState_Closed:n=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._closedSeconds,n>=1&&(this._blinkingState=la.EyeState_Opening,this._stateStartTimeSeconds=this._userTimeSeconds),t=0;break;case la.EyeState_Opening:n=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._openingSeconds,n>=1&&(n=1,this._blinkingState=la.EyeState_Interval,this._nextBlinkingTime=this.determinNextBlinkingTiming()),t=n;break;case la.EyeState_Interval:this._nextBlinkingTime<this._userTimeSeconds&&(this._blinkingState=la.EyeState_Closing,this._stateStartTimeSeconds=this._userTimeSeconds),t=1;break;case la.EyeState_First:default:this._blinkingState=la.EyeState_Interval,this._nextBlinkingTime=this.determinNextBlinkingTiming(),t=1;break}o_.CloseIfZero||(t=-t);for(let i=0;i<this._parameterIds.length;++i)r.setParameterValueById(this._parameterIds[i],t)}constructor(r){var e,t;this._blinkingState=la.EyeState_First,this._nextBlinkingTime=0,this._stateStartTimeSeconds=0,this._blinkingIntervalSeconds=4,this._closingSeconds=.1,this._closedSeconds=.05,this._openingSeconds=.15,this._userTimeSeconds=0,this._parameterIds=[],r!=null&&(this._parameterIds=(t=(e=r.getEyeBlinkParameters())==null?void 0:e.slice())!=null?t:this._parameterIds)}determinNextBlinkingTiming(){const r=Math.random();return this._userTimeSeconds+r*(2*this._blinkingIntervalSeconds-1)}};let _P=o_;_P.CloseIfZero=!0;var la=(r=>(r[r.EyeState_First=0]="EyeState_First",r[r.EyeState_Interval=1]="EyeState_Interval",r[r.EyeState_Closing=2]="EyeState_Closing",r[r.EyeState_Closed=3]="EyeState_Closed",r[r.EyeState_Opening=4]="EyeState_Opening",r))(la||{});const CQ=.001,bA=.5;class l3{static create(e){const t=new l3;typeof e.FadeInTime=="number"&&(t._fadeTimeSeconds=e.FadeInTime,t._fadeTimeSeconds<=0&&(t._fadeTimeSeconds=bA));const n=e.Groups,i=n.length;for(let a=0;a<i;++a){const s=n[a],o=s.length;let l=0;for(let c=0;c<o;++c){const h=s[c],d=new qp;d.partId=h.Id;const v=h.Link;if(v){const g=v.length;for(let m=0;m<g;++m){const x=new qp;x.partId=v[m],d.link.push(x)}}t._partGroups.push(d),++l}t._partGroupCounts.push(l)}return t}updateParameters(e,t){e!=this._lastModel&&this.reset(e),this._lastModel=e,t<0&&(t=0);let n=0;for(let i=0;i<this._partGroupCounts.length;i++){const a=this._partGroupCounts[i];this.doFade(e,t,n,a),n+=a}this.copyPartOpacities(e)}reset(e){let t=0;for(let n=0;n<this._partGroupCounts.length;++n){const i=this._partGroupCounts[n];for(let a=t;a<t+i;++a){this._partGroups[a].initialize(e);const s=this._partGroups[a].partIndex,o=this._partGroups[a].parameterIndex;if(!(s<0)){e.setPartOpacityByIndex(s,a==t?1:0),e.setParameterValueByIndex(o,a==t?1:0);for(let l=0;l<this._partGroups[a].link.length;++l)this._partGroups[a].link[l].initialize(e)}}t+=i}}copyPartOpacities(e){for(let t=0;t<this._partGroups.length;++t){const n=this._partGroups[t];if(n.link.length==0)continue;const i=this._partGroups[t].partIndex,a=e.getPartOpacityByIndex(i);for(let s=0;s<n.link.length;++s){const l=n.link[s].partIndex;l<0||e.setPartOpacityByIndex(l,a)}}}doFade(e,t,n,i){let a=-1,s=1;const o=.5,l=.15;for(let c=n;c<n+i;++c){const h=this._partGroups[c].partIndex,d=this._partGroups[c].parameterIndex;if(e.getParameterValueByIndex(d)>CQ){if(a>=0)break;a=c,s=e.getPartOpacityByIndex(h),s+=t/this._fadeTimeSeconds,s>1&&(s=1)}}a<0&&(a=0,s=1);for(let c=n;c<n+i;++c){const h=this._partGroups[c].partIndex;if(a==c)e.setPartOpacityByIndex(h,s);else{let d=e.getPartOpacityByIndex(h),v;s<o?v=s*(o-1)/o+1:v=(1-s)*o/(1-o),(1-v)*(1-s)>l&&(v=1-l/(1-s)),d>v&&(d=v),e.setPartOpacityByIndex(h,d)}}}constructor(){this._fadeTimeSeconds=bA,this._lastModel=void 0,this._partGroups=[],this._partGroupCounts=[]}}class qp{constructor(e){this.parameterIndex=0,this.partIndex=0,this.partId="",this.link=[],e!=null&&this.assignment(e)}assignment(e){return this.partId=e.partId,this.link=e.link.map(t=>t.clone()),this}initialize(e){this.parameterIndex=e.getParameterIndex(this.partId),this.partIndex=e.getPartIndex(this.partId),e.setParameterValueByIndex(this.parameterIndex,1)}clone(){const e=new qp;return e.partId=this.partId,e.parameterIndex=this.parameterIndex,e.partIndex=this.partIndex,e.link=this.link.map(t=>t.clone()),e}}class It{constructor(e,t){this.x=e||0,this.y=t||0}add(e){const t=new It(0,0);return t.x=this.x+e.x,t.y=this.y+e.y,t}substract(e){const t=new It(0,0);return t.x=this.x-e.x,t.y=this.y-e.y,t}multiply(e){const t=new It(0,0);return t.x=this.x*e.x,t.y=this.y*e.y,t}multiplyByScaler(e){return this.multiply(new It(e,e))}division(e){const t=new It(0,0);return t.x=this.x/e.x,t.y=this.y/e.y,t}divisionByScalar(e){return this.division(new It(e,e))}getLength(){return Math.sqrt(this.x*this.x+this.y*this.y)}getDistanceWith(e){return Math.sqrt((this.x-e.x)*(this.x-e.x)+(this.y-e.y)*(this.y-e.y))}dot(e){return this.x*e.x+this.y*e.y}normalize(){const e=Math.pow(this.x*this.x+this.y*this.y,.5);this.x=this.x/e,this.y=this.y/e}isEqual(e){return this.x==e.x&&this.y==e.y}isNotEqual(e){return!this.isEqual(e)}}const yp=class{static range(r,e,t){return r<e?r=e:r>t&&(r=t),r}static sin(r){return Math.sin(r)}static cos(r){return Math.cos(r)}static abs(r){return Math.abs(r)}static sqrt(r){return Math.sqrt(r)}static cbrt(r){if(r===0)return r;let e=r;const t=e<0;t&&(e=-e);let n;return e===1/0?n=1/0:(n=Math.exp(Math.log(e)/3),n=(e/(n*n)+2*n)/3),t?-n:n}static getEasingSine(r){return r<0?0:r>1?1:.5-.5*this.cos(r*Math.PI)}static max(r,e){return r>e?r:e}static min(r,e){return r>e?e:r}static degreesToRadian(r){return r/180*Math.PI}static radianToDegrees(r){return r*180/Math.PI}static directionToRadian(r,e){const t=Math.atan2(e.y,e.x),n=Math.atan2(r.y,r.x);let i=t-n;for(;i<-Math.PI;)i+=Math.PI*2;for(;i>Math.PI;)i-=Math.PI*2;return i}static directionToDegrees(r,e){const t=this.directionToRadian(r,e);let n=this.radianToDegrees(t);return e.x-r.x>0&&(n=-n),n}static radianToDirection(r){const e=new It;return e.x=this.sin(r),e.y=this.cos(r),e}static quadraticEquation(r,e,t){return this.abs(r)<yp.Epsilon?this.abs(e)<yp.Epsilon?-t:-t/e:-(e+this.sqrt(e*e-4*r*t))/(2*r)}static cardanoAlgorithmForBezier(r,e,t,n){if(this.sqrt(r)<yp.Epsilon)return this.range(this.quadraticEquation(e,t,n),0,1);const i=e/r,a=t/r,s=n/r,o=(3*a-i*i)/3,l=o/3,c=(2*i*i*i-9*i*a+27*s)/27,h=c/2,d=h*h+l*l*l,v=.5,g=v+.01;if(d<0){const w=-o/3,S=w*w*w,A=this.sqrt(S),C=-c/(2*A),M=this.range(C,-1,1),E=Math.acos(M),D=2*this.cbrt(A),I=D*this.cos(E/3)-i/3;if(this.abs(I-v)<g)return this.range(I,0,1);const k=D*this.cos((E+2*Math.PI)/3)-i/3;if(this.abs(k-v)<g)return this.range(k,0,1);const U=D*this.cos((E+4*Math.PI)/3)-i/3;return this.range(U,0,1)}if(d==0){let w;h<0?w=this.cbrt(-h):w=-this.cbrt(h);const S=2*w-i/3;if(this.abs(S-v)<g)return this.range(S,0,1);const A=-w-i/3;return this.range(A,0,1)}const m=this.sqrt(d),x=this.cbrt(m-h),y=this.cbrt(m+h),_=x-y-i/3;return this.range(_,0,1)}constructor(){}};let Dr=yp;Dr.Epsilon=1e-5;class ma{constructor(){this._tr=new Float32Array(16),this.loadIdentity()}static multiply(e,t,n){const i=new Float32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),a=4;for(let s=0;s<a;++s)for(let o=0;o<a;++o)for(let l=0;l<a;++l)i[o+s*4]+=e[l+s*4]*t[o+l*4];for(let s=0;s<16;++s)n[s]=i[s]}loadIdentity(){const e=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);this.setMatrix(e)}setMatrix(e){for(let t=0;t<16;++t)this._tr[t]=e[t]}getArray(){return this._tr}getScaleX(){return this._tr[0]}getScaleY(){return this._tr[5]}getTranslateX(){return this._tr[12]}getTranslateY(){return this._tr[13]}transformX(e){return this._tr[0]*e+this._tr[12]}transformY(e){return this._tr[5]*e+this._tr[13]}invertTransformX(e){return(e-this._tr[12])/this._tr[0]}invertTransformY(e){return(e-this._tr[13])/this._tr[5]}translateRelative(e,t){const n=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,e,t,0,1]);ma.multiply(n,this._tr,this._tr)}translate(e,t){this._tr[12]=e,this._tr[13]=t}translateX(e){this._tr[12]=e}translateY(e){this._tr[13]=e}scaleRelative(e,t){const n=new Float32Array([e,0,0,0,0,t,0,0,0,0,1,0,0,0,0,1]);ma.multiply(n,this._tr,this._tr)}scale(e,t){this._tr[0]=e,this._tr[5]=t}multiplyByMatrix(e){ma.multiply(e.getArray(),this._tr,this._tr)}clone(){const e=new ma;for(let t=0;t<this._tr.length;t++)e._tr[t]=this._tr[t];return e}}class u3{initialize(e){this._model=e}drawModel(){this.getModel()!=null&&this.doDrawModel()}setMvpMatrix(e){this._mvpMatrix4x4.setMatrix(e.getArray())}getMvpMatrix(){return this._mvpMatrix4x4}setModelColor(e,t,n,i){e<0?e=0:e>1&&(e=1),t<0?t=0:t>1&&(t=1),n<0?n=0:n>1&&(n=1),i<0?i=0:i>1&&(i=1),this._modelColor.R=e,this._modelColor.G=t,this._modelColor.B=n,this._modelColor.A=i}getModelColor(){return Object.assign({},this._modelColor)}setIsPremultipliedAlpha(e){this._isPremultipliedAlpha=e}isPremultipliedAlpha(){return this._isPremultipliedAlpha}setIsCulling(e){this._isCulling=e}isCulling(){return this._isCulling}setAnisotropy(e){this._anisortopy=e}getAnisotropy(){return this._anisortopy}getModel(){return this._model}constructor(){this._isCulling=!1,this._isPremultipliedAlpha=!1,this._anisortopy=0,this._modelColor=new Pf,this._mvpMatrix4x4=new ma,this._mvpMatrix4x4.loadIdentity()}}var Wo=(r=>(r[r.CubismBlendMode_Normal=0]="CubismBlendMode_Normal",r[r.CubismBlendMode_Additive=1]="CubismBlendMode_Additive",r[r.CubismBlendMode_Multiplicative=2]="CubismBlendMode_Multiplicative",r))(Wo||{});class Pf{constructor(){this.R=1,this.G=1,this.B=1,this.A=1}}let Va=!1,mc=!1,yc;const fx={vertexOffset:0,vertexStep:2};class yd{static startUp(e){if(Va)return wf("CubismFramework.startUp() is already done."),Va;if(Live2DCubismCore._isStarted)return Va=!0,!0;if(Live2DCubismCore._isStarted=!0,yc=e,yc&&Live2DCubismCore.Logging.csmSetLogFunction(yc.logFunction),Va=!0,Va){const t=Live2DCubismCore.Version.csmGetVersion(),n=(t&4278190080)>>24,i=(t&16711680)>>16,a=t&65535,s=t;wf("Live2D Cubism Core version: {0}.{1}.{2} ({3})",("00"+n).slice(-2),("00"+i).slice(-2),("0000"+a).slice(-4),s)}return wf("CubismFramework.startUp() is complete."),Va}static cleanUp(){Va=!1,mc=!1,yc=void 0}static initialize(){if(!Va){If("CubismFramework is not started.");return}if(mc){If("CubismFramework.initialize() skipped, already initialized.");return}mc=!0,wf("CubismFramework.initialize() is complete.")}static dispose(){if(!Va){If("CubismFramework is not started.");return}if(!mc){If("CubismFramework.dispose() skipped, not initialized.");return}u3.staticRelease(),mc=!1,wf("CubismFramework.dispose() is complete.")}static isStarted(){return Va}static isInitialized(){return mc}static coreLogFunction(e){Live2DCubismCore.Logging.csmGetLogFunction()&&Live2DCubismCore.Logging.csmGetLogFunction()(e)}static getLoggingLevel(){return yc!=null?yc.loggingLevel:Su.LogLevel_Off}constructor(){}}var Su=(r=>(r[r.LogLevel_Verbose=0]="LogLevel_Verbose",r[r.LogLevel_Debug=1]="LogLevel_Debug",r[r.LogLevel_Info=2]="LogLevel_Info",r[r.LogLevel_Warning=3]="LogLevel_Warning",r[r.LogLevel_Error=4]="LogLevel_Error",r[r.LogLevel_Off=5]="LogLevel_Off",r))(Su||{});const zv=()=>{};function xA(r,...e){Og.print(Su.LogLevel_Debug,"[CSM][D]"+r+`
  1682. `,e)}function wf(r,...e){Og.print(Su.LogLevel_Info,"[CSM][I]"+r+`
  1683. `,e)}function If(r,...e){Og.print(Su.LogLevel_Warning,"[CSM][W]"+r+`
  1684. `,e)}function Sc(r,...e){Og.print(Su.LogLevel_Error,"[CSM][E]"+r+`
  1685. `,e)}class Og{static print(e,t,n){if(e<yd.getLoggingLevel())return;const i=yd.coreLogFunction;if(!i)return;const a=t.replace(/{(\d+)}/g,(s,o)=>n[o]);i(a)}static dumpBytes(e,t,n){for(let i=0;i<n;i++)i%16==0&&i>0?this.print(e,`
  1686. `):i%8==0&&i>0&&this.print(e," "),this.print(e,"{0} ",[t[i]&255]);this.print(e,`
  1687. `)}constructor(){}}class AQ{update(){this._model.update(),this._model.drawables.resetDynamicFlags()}getCanvasWidth(){return this._model==null?0:this._model.canvasinfo.CanvasWidth/this._model.canvasinfo.PixelsPerUnit}getCanvasHeight(){return this._model==null?0:this._model.canvasinfo.CanvasHeight/this._model.canvasinfo.PixelsPerUnit}saveParameters(){const e=this._model.parameters.count,t=this._savedParameters.length;for(let n=0;n<e;++n)n<t?this._savedParameters[n]=this._parameterValues[n]:this._savedParameters.push(this._parameterValues[n])}getModel(){return this._model}getPartIndex(e){let t;const n=this._model.parts.count;for(t=0;t<n;++t)if(e==this._partIds[t])return t;return e in this._notExistPartId?this._notExistPartId[e]:(t=n+this._notExistPartId.length,this._notExistPartId[e]=t,this._notExistPartOpacities[t]=0,t)}getPartCount(){return this._model.parts.count}setPartOpacityByIndex(e,t){if(e in this._notExistPartOpacities){this._notExistPartOpacities[e]=t;return}zv(0<=e&&e<this.getPartCount()),this._partOpacities[e]=t}setPartOpacityById(e,t){const n=this.getPartIndex(e);n<0||this.setPartOpacityByIndex(n,t)}getPartOpacityByIndex(e){return e in this._notExistPartOpacities?this._notExistPartOpacities[e]:(zv(0<=e&&e<this.getPartCount()),this._partOpacities[e])}getPartOpacityById(e){const t=this.getPartIndex(e);return t<0?0:this.getPartOpacityByIndex(t)}getParameterIndex(e){let t;const n=this._model.parameters.count;for(t=0;t<n;++t)if(e==this._parameterIds[t])return t;return e in this._notExistParameterId?this._notExistParameterId[e]:(t=this._model.parameters.count+Object.keys(this._notExistParameterId).length,this._notExistParameterId[e]=t,this._notExistParameterValues[t]=0,t)}getParameterCount(){return this._model.parameters.count}getParameterMaximumValue(e){return this._model.parameters.maximumValues[e]}getParameterMinimumValue(e){return this._model.parameters.minimumValues[e]}getParameterDefaultValue(e){return this._model.parameters.defaultValues[e]}getParameterValueByIndex(e){return e in this._notExistParameterValues?this._notExistParameterValues[e]:(zv(0<=e&&e<this.getParameterCount()),this._parameterValues[e])}getParameterValueById(e){const t=this.getParameterIndex(e);return this.getParameterValueByIndex(t)}setParameterValueByIndex(e,t,n=1){if(e in this._notExistParameterValues){this._notExistParameterValues[e]=n==1?t:this._notExistParameterValues[e]*(1-n)+t*n;return}zv(0<=e&&e<this.getParameterCount()),this._model.parameters.maximumValues[e]<t&&(t=this._model.parameters.maximumValues[e]),this._model.parameters.minimumValues[e]>t&&(t=this._model.parameters.minimumValues[e]),this._parameterValues[e]=n==1?t:this._parameterValues[e]=this._parameterValues[e]*(1-n)+t*n}setParameterValueById(e,t,n=1){const i=this.getParameterIndex(e);this.setParameterValueByIndex(i,t,n)}addParameterValueByIndex(e,t,n=1){this.setParameterValueByIndex(e,this.getParameterValueByIndex(e)+t*n)}addParameterValueById(e,t,n=1){const i=this.getParameterIndex(e);this.addParameterValueByIndex(i,t,n)}multiplyParameterValueById(e,t,n=1){const i=this.getParameterIndex(e);this.multiplyParameterValueByIndex(i,t,n)}multiplyParameterValueByIndex(e,t,n=1){this.setParameterValueByIndex(e,this.getParameterValueByIndex(e)*(1+(t-1)*n))}getDrawableIds(){return this._drawableIds.slice()}getDrawableIndex(e){const t=this._model.drawables.count;for(let n=0;n<t;++n)if(this._drawableIds[n]==e)return n;return-1}getDrawableCount(){return this._model.drawables.count}getDrawableId(e){return this._model.drawables.ids[e]}getDrawableRenderOrders(){return this._model.drawables.renderOrders}getDrawableTextureIndices(e){return this._model.drawables.textureIndices[e]}getDrawableDynamicFlagVertexPositionsDidChange(e){const t=this._model.drawables.dynamicFlags;return Live2DCubismCore.Utils.hasVertexPositionsDidChangeBit(t[e])}getDrawableVertexIndexCount(e){return this._model.drawables.indexCounts[e]}getDrawableVertexCount(e){return this._model.drawables.vertexCounts[e]}getDrawableVertices(e){return this.getDrawableVertexPositions(e)}getDrawableVertexIndices(e){return this._model.drawables.indices[e]}getDrawableVertexPositions(e){return this._model.drawables.vertexPositions[e]}getDrawableVertexUvs(e){return this._model.drawables.vertexUvs[e]}getDrawableOpacity(e){return this._model.drawables.opacities[e]}getDrawableCulling(e){const t=this._model.drawables.constantFlags;return!Live2DCubismCore.Utils.hasIsDoubleSidedBit(t[e])}getDrawableBlendMode(e){const t=this._model.drawables.constantFlags;return Live2DCubismCore.Utils.hasBlendAdditiveBit(t[e])?Wo.CubismBlendMode_Additive:Live2DCubismCore.Utils.hasBlendMultiplicativeBit(t[e])?Wo.CubismBlendMode_Multiplicative:Wo.CubismBlendMode_Normal}getDrawableInvertedMaskBit(e){const t=this._model.drawables.constantFlags;return Live2DCubismCore.Utils.hasIsInvertedMaskBit(t[e])}getDrawableMasks(){return this._model.drawables.masks}getDrawableMaskCounts(){return this._model.drawables.maskCounts}isUsingMasking(){for(let e=0;e<this._model.drawables.count;++e)if(!(this._model.drawables.maskCounts[e]<=0))return!0;return!1}getDrawableDynamicFlagIsVisible(e){const t=this._model.drawables.dynamicFlags;return Live2DCubismCore.Utils.hasIsVisibleBit(t[e])}getDrawableDynamicFlagVisibilityDidChange(e){const t=this._model.drawables.dynamicFlags;return Live2DCubismCore.Utils.hasVisibilityDidChangeBit(t[e])}getDrawableDynamicFlagOpacityDidChange(e){const t=this._model.drawables.dynamicFlags;return Live2DCubismCore.Utils.hasOpacityDidChangeBit(t[e])}getDrawableDynamicFlagRenderOrderDidChange(e){const t=this._model.drawables.dynamicFlags;return Live2DCubismCore.Utils.hasRenderOrderDidChangeBit(t[e])}loadParameters(){let e=this._model.parameters.count;const t=this._savedParameters.length;e>t&&(e=t);for(let n=0;n<e;++n)this._parameterValues[n]=this._savedParameters[n]}initialize(){this._parameterValues=this._model.parameters.values,this._partOpacities=this._model.parts.opacities,this._parameterMaximumValues=this._model.parameters.maximumValues,this._parameterMinimumValues=this._model.parameters.minimumValues;{const e=this._model.parameters.ids,t=this._model.parameters.count;for(let n=0;n<t;++n)this._parameterIds.push(e[n])}{const e=this._model.parts.ids,t=this._model.parts.count;for(let n=0;n<t;++n)this._partIds.push(e[n])}{const e=this._model.drawables.ids,t=this._model.drawables.count;for(let n=0;n<t;++n)this._drawableIds.push(e[n])}}constructor(e){this._model=e,this._savedParameters=[],this._parameterIds=[],this._drawableIds=[],this._partIds=[],this._notExistPartId={},this._notExistParameterId={},this._notExistParameterValues={},this._notExistPartOpacities={},this.initialize()}release(){this._model.release(),this._model=void 0}}class c3{static create(e){const t=Live2DCubismCore.Moc.fromArrayBuffer(e);if(t)return new c3(t);throw new Error("Unknown error")}createModel(){let e;const t=Live2DCubismCore.Model.fromMoc(this._moc);if(t)return e=new AQ(t),++this._modelCount,e;throw new Error("Unknown error")}deleteModel(e){e!=null&&--this._modelCount}constructor(e){this._moc=e,this._modelCount=0}release(){this._moc._release(),this._moc=void 0}}class wP{constructor(){this._fadeInSeconds=-1,this._fadeOutSeconds=-1,this._weight=1,this._offsetSeconds=0,this._firedEventValues=[]}release(){this._weight=0}updateParameters(e,t,n){if(!t.isAvailable()||t.isFinished())return;if(!t.isStarted()){t.setIsStarted(!0),t.setStartTime(n-this._offsetSeconds),t.setFadeInStartTime(n);const o=this.getDuration();t.getEndTime()<0&&t.setEndTime(o<=0?-1:t.getStartTime()+o)}let i=this._weight;const a=this._fadeInSeconds==0?1:Dr.getEasingSine((n-t.getFadeInStartTime())/this._fadeInSeconds),s=this._fadeOutSeconds==0||t.getEndTime()<0?1:Dr.getEasingSine((t.getEndTime()-n)/this._fadeOutSeconds);i=i*a*s,t.setState(n,i),this.doUpdateParameters(e,n,i,t),t.getEndTime()>0&&t.getEndTime()<n&&t.setIsFinished(!0)}setFadeInTime(e){this._fadeInSeconds=e}setFadeOutTime(e){this._fadeOutSeconds=e}getFadeOutTime(){return this._fadeOutSeconds}getFadeInTime(){return this._fadeInSeconds}setWeight(e){this._weight=e}getWeight(){return this._weight}getDuration(){return-1}getLoopDuration(){return-1}setOffsetTime(e){this._offsetSeconds=e}getFiredEvent(e,t){return this._firedEventValues}setFinishedMotionHandler(e){this._onFinishedMotion=e}getFinishedMotionHandler(){return this._onFinishedMotion}}const _A=1;class h3 extends wP{constructor(){super(),this._parameters=[]}static create(e){const t=new h3,n=e.FadeInTime,i=e.FadeOutTime;t.setFadeInTime(n!==void 0?n:_A),t.setFadeOutTime(i!==void 0?i:_A);const a=e.Parameters||[];for(let s=0;s<a.length;++s){const o=a[s],l=o.Id,c=o.Value;let h;switch(o.Blend){case"Multiply":h=eu.ExpressionBlendType_Multiply;break;case"Overwrite":h=eu.ExpressionBlendType_Overwrite;break;case"Add":default:h=eu.ExpressionBlendType_Add;break}const d={parameterId:l,blendType:h,value:c};t._parameters.push(d)}return t}doUpdateParameters(e,t,n,i){for(let a=0;a<this._parameters.length;++a){const s=this._parameters[a];switch(s.blendType){case eu.ExpressionBlendType_Add:{e.addParameterValueById(s.parameterId,s.value,n);break}case eu.ExpressionBlendType_Multiply:{e.multiplyParameterValueById(s.parameterId,s.value,n);break}case eu.ExpressionBlendType_Overwrite:{e.setParameterValueById(s.parameterId,s.value,n);break}}}}}var eu=(r=>(r[r.ExpressionBlendType_Add=0]="ExpressionBlendType_Add",r[r.ExpressionBlendType_Multiply=1]="ExpressionBlendType_Multiply",r[r.ExpressionBlendType_Overwrite=2]="ExpressionBlendType_Overwrite",r))(eu||{}),bd;(r=>{r.supportMoreMaskDivisions=!0,r.setOpacityFromMotion=!1})(bd||(bd={}));var tu=(r=>(r[r.CubismMotionCurveTarget_Model=0]="CubismMotionCurveTarget_Model",r[r.CubismMotionCurveTarget_Parameter=1]="CubismMotionCurveTarget_Parameter",r[r.CubismMotionCurveTarget_PartOpacity=2]="CubismMotionCurveTarget_PartOpacity",r))(tu||{}),Ya=(r=>(r[r.CubismMotionSegmentType_Linear=0]="CubismMotionSegmentType_Linear",r[r.CubismMotionSegmentType_Bezier=1]="CubismMotionSegmentType_Bezier",r[r.CubismMotionSegmentType_Stepped=2]="CubismMotionSegmentType_Stepped",r[r.CubismMotionSegmentType_InverseStepped=3]="CubismMotionSegmentType_InverseStepped",r))(Ya||{});class No{constructor(e=0,t=0){this.time=e,this.value=t}}class MQ{constructor(){this.basePointIndex=0,this.segmentType=0}}class RQ{constructor(){this.id="",this.type=0,this.segmentCount=0,this.baseSegmentIndex=0,this.fadeInTime=0,this.fadeOutTime=0}}class OQ{constructor(){this.fireTime=0,this.value=""}}class DQ{constructor(){this.duration=0,this.loop=!1,this.curveCount=0,this.eventCount=0,this.fps=0,this.curves=[],this.segments=[],this.points=[],this.events=[]}}class SP{constructor(e){this._json=e}release(){this._json=void 0}getMotionDuration(){return this._json.Meta.Duration}isMotionLoop(){return this._json.Meta.Loop||!1}getEvaluationOptionFlag(e){return f3.EvaluationOptionFlag_AreBeziersRistricted==e?!!this._json.Meta.AreBeziersRestricted:!1}getMotionCurveCount(){return this._json.Meta.CurveCount}getMotionFps(){return this._json.Meta.Fps}getMotionTotalSegmentCount(){return this._json.Meta.TotalSegmentCount}getMotionTotalPointCount(){return this._json.Meta.TotalPointCount}getMotionFadeInTime(){return this._json.Meta.FadeInTime}getMotionFadeOutTime(){return this._json.Meta.FadeOutTime}getMotionCurveTarget(e){return this._json.Curves[e].Target}getMotionCurveId(e){return this._json.Curves[e].Id}getMotionCurveFadeInTime(e){return this._json.Curves[e].FadeInTime}getMotionCurveFadeOutTime(e){return this._json.Curves[e].FadeOutTime}getMotionCurveSegmentCount(e){return this._json.Curves[e].Segments.length}getMotionCurveSegment(e,t){return this._json.Curves[e].Segments[t]}getEventCount(){return this._json.Meta.UserDataCount||0}getTotalEventValueSize(){return this._json.Meta.TotalUserDataSize}getEventTime(e){return this._json.UserData[e].Time}getEventValue(e){return this._json.UserData[e].Value}}var f3=(r=>(r[r.EvaluationOptionFlag_AreBeziersRistricted=0]="EvaluationOptionFlag_AreBeziersRistricted",r))(f3||{});const PQ="EyeBlink",IQ="LipSync",NQ="Model",LQ="Parameter",kQ="PartOpacity",BQ=!1;function fa(r,e,t){const n=new No;return n.time=r.time+(e.time-r.time)*t,n.value=r.value+(e.value-r.value)*t,n}function FQ(r,e){let t=(e-r[0].time)/(r[1].time-r[0].time);return t<0&&(t=0),r[0].value+(r[1].value-r[0].value)*t}function zQ(r,e){let t=(e-r[0].time)/(r[3].time-r[0].time);t<0&&(t=0);const n=fa(r[0],r[1],t),i=fa(r[1],r[2],t),a=fa(r[2],r[3],t),s=fa(n,i,t),o=fa(i,a,t);return fa(s,o,t).value}function UQ(r,e){const t=e,n=r[0].time,i=r[3].time,a=r[1].time,s=r[2].time,o=i-3*s+3*a-n,l=3*s-6*a+3*n,c=3*a-3*n,h=n-t,d=Dr.cardanoAlgorithmForBezier(o,l,c,h),v=fa(r[0],r[1],d),g=fa(r[1],r[2],d),m=fa(r[2],r[3],d),x=fa(v,g,d),y=fa(g,m,d);return fa(x,y,d).value}function GQ(r,e){return r[0].value}function HQ(r,e){return r[1].value}function dx(r,e,t){const n=r.curves[e];let i=-1;const a=n.baseSegmentIndex+n.segmentCount;let s=0;for(let l=n.baseSegmentIndex;l<a;++l)if(s=r.segments[l].basePointIndex+(r.segments[l].segmentType==Ya.CubismMotionSegmentType_Bezier?3:1),r.points[s].time>t){i=l;break}if(i==-1)return r.points[s].value;const o=r.segments[i];return o.evaluate(r.points.slice(o.basePointIndex),t)}class d3 extends wP{constructor(){super(),this._eyeBlinkParameterIds=[],this._lipSyncParameterIds=[],this._sourceFrameRate=30,this._loopDurationSeconds=-1,this._isLoop=!1,this._isLoopFadeIn=!0,this._lastWeight=0}static create(e,t){const n=new d3;return n.parse(e),n._sourceFrameRate=n._motionData.fps,n._loopDurationSeconds=n._motionData.duration,n._onFinishedMotion=t,n}doUpdateParameters(e,t,n,i){this._modelCurveIdEyeBlink==null&&(this._modelCurveIdEyeBlink=PQ),this._modelCurveIdLipSync==null&&(this._modelCurveIdLipSync=IQ);let a=t-i.getStartTime();a<0&&(a=0);let s=Number.MAX_VALUE,o=Number.MAX_VALUE;const l=64;let c=0,h=0;this._eyeBlinkParameterIds.length>l&&xA("too many eye blink targets : {0}",this._eyeBlinkParameterIds.length),this._lipSyncParameterIds.length>l&&xA("too many lip sync targets : {0}",this._lipSyncParameterIds.length);const d=this._fadeInSeconds<=0?1:Dr.getEasingSine((t-i.getFadeInStartTime())/this._fadeInSeconds),v=this._fadeOutSeconds<=0||i.getEndTime()<0?1:Dr.getEasingSine((i.getEndTime()-t)/this._fadeOutSeconds);let g,m,x,y=a;if(this._isLoop)for(;y>this._motionData.duration;)y-=this._motionData.duration;const _=this._motionData.curves;for(m=0;m<this._motionData.curveCount&&_[m].type==tu.CubismMotionCurveTarget_Model;++m)g=dx(this._motionData,m,y),_[m].id==this._modelCurveIdEyeBlink?o=g:_[m].id==this._modelCurveIdLipSync&&(s=g);for(;m<this._motionData.curveCount&&_[m].type==tu.CubismMotionCurveTarget_Parameter;++m){if(x=e.getParameterIndex(_[m].id),x==-1)continue;const w=e.getParameterValueByIndex(x);if(g=dx(this._motionData,m,y),o!=Number.MAX_VALUE){for(let A=0;A<this._eyeBlinkParameterIds.length&&A<l;++A)if(this._eyeBlinkParameterIds[A]==_[m].id){g*=o,h|=1<<A;break}}if(s!=Number.MAX_VALUE){for(let A=0;A<this._lipSyncParameterIds.length&&A<l;++A)if(this._lipSyncParameterIds[A]==_[m].id){g+=s,c|=1<<A;break}}let S;if(_[m].fadeInTime<0&&_[m].fadeOutTime<0)S=w+(g-w)*n;else{let A,C;_[m].fadeInTime<0?A=d:A=_[m].fadeInTime==0?1:Dr.getEasingSine((t-i.getFadeInStartTime())/_[m].fadeInTime),_[m].fadeOutTime<0?C=v:C=_[m].fadeOutTime==0||i.getEndTime()<0?1:Dr.getEasingSine((i.getEndTime()-t)/_[m].fadeOutTime);const M=this._weight*A*C;S=w+(g-w)*M}e.setParameterValueByIndex(x,S,1)}{if(o!=Number.MAX_VALUE)for(let w=0;w<this._eyeBlinkParameterIds.length&&w<l;++w){const S=e.getParameterValueById(this._eyeBlinkParameterIds[w]);if(h>>w&1)continue;const A=S+(o-S)*n;e.setParameterValueById(this._eyeBlinkParameterIds[w],A)}if(s!=Number.MAX_VALUE)for(let w=0;w<this._lipSyncParameterIds.length&&w<l;++w){const S=e.getParameterValueById(this._lipSyncParameterIds[w]);if(c>>w&1)continue;const A=S+(s-S)*n;e.setParameterValueById(this._lipSyncParameterIds[w],A)}}for(;m<this._motionData.curveCount&&_[m].type==tu.CubismMotionCurveTarget_PartOpacity;++m)if(g=dx(this._motionData,m,y),bd.setOpacityFromMotion)e.setPartOpacityById(_[m].id,g);else{if(x=e.getParameterIndex(_[m].id),x==-1)continue;e.setParameterValueByIndex(x,g)}a>=this._motionData.duration&&(this._isLoop?(i.setStartTime(t),this._isLoopFadeIn&&i.setFadeInStartTime(t)):(this._onFinishedMotion&&this._onFinishedMotion(this),i.setIsFinished(!0))),this._lastWeight=n}setIsLoop(e){this._isLoop=e}isLoop(){return this._isLoop}setIsLoopFadeIn(e){this._isLoopFadeIn=e}isLoopFadeIn(){return this._isLoopFadeIn}getDuration(){return this._isLoop?-1:this._loopDurationSeconds}getLoopDuration(){return this._loopDurationSeconds}setParameterFadeInTime(e,t){const n=this._motionData.curves;for(let i=0;i<this._motionData.curveCount;++i)if(e==n[i].id){n[i].fadeInTime=t;return}}setParameterFadeOutTime(e,t){const n=this._motionData.curves;for(let i=0;i<this._motionData.curveCount;++i)if(e==n[i].id){n[i].fadeOutTime=t;return}}getParameterFadeInTime(e){const t=this._motionData.curves;for(let n=0;n<this._motionData.curveCount;++n)if(e==t[n].id)return t[n].fadeInTime;return-1}getParameterFadeOutTime(e){const t=this._motionData.curves;for(let n=0;n<this._motionData.curveCount;++n)if(e==t[n].id)return t[n].fadeOutTime;return-1}setEffectIds(e,t){this._eyeBlinkParameterIds=e,this._lipSyncParameterIds=t}release(){this._motionData=void 0}parse(e){this._motionData=new DQ;let t=new SP(e);this._motionData.duration=t.getMotionDuration(),this._motionData.loop=t.isMotionLoop(),this._motionData.curveCount=t.getMotionCurveCount(),this._motionData.fps=t.getMotionFps(),this._motionData.eventCount=t.getEventCount();const n=t.getEvaluationOptionFlag(f3.EvaluationOptionFlag_AreBeziersRistricted),i=t.getMotionFadeInTime(),a=t.getMotionFadeOutTime();i!==void 0?this._fadeInSeconds=i<0?1:i:this._fadeInSeconds=1,a!==void 0?this._fadeOutSeconds=a<0?1:a:this._fadeOutSeconds=1,this._motionData.curves=Array.from({length:this._motionData.curveCount}).map(()=>new RQ),this._motionData.segments=Array.from({length:t.getMotionTotalSegmentCount()}).map(()=>new MQ),this._motionData.events=Array.from({length:this._motionData.eventCount}).map(()=>new OQ),this._motionData.points=[];let s=0,o=0;for(let l=0;l<this._motionData.curveCount;++l){const c=this._motionData.curves[l];switch(t.getMotionCurveTarget(l)){case NQ:c.type=tu.CubismMotionCurveTarget_Model;break;case LQ:c.type=tu.CubismMotionCurveTarget_Parameter;break;case kQ:c.type=tu.CubismMotionCurveTarget_PartOpacity;break;default:If('Warning : Unable to get segment type from Curve! The number of "CurveCount" may be incorrect!')}c.id=t.getMotionCurveId(l),c.baseSegmentIndex=o;const h=t.getMotionCurveFadeInTime(l),d=t.getMotionCurveFadeOutTime(l);c.fadeInTime=h!==void 0?h:-1,c.fadeOutTime=d!==void 0?d:-1;for(let v=0;v<t.getMotionCurveSegmentCount(l);){switch(v==0?(this._motionData.segments[o].basePointIndex=s,this._motionData.points[s]=new No(t.getMotionCurveSegment(l,v),t.getMotionCurveSegment(l,v+1)),s+=1,v+=2):this._motionData.segments[o].basePointIndex=s-1,t.getMotionCurveSegment(l,v)){case Ya.CubismMotionSegmentType_Linear:{this._motionData.segments[o].segmentType=Ya.CubismMotionSegmentType_Linear,this._motionData.segments[o].evaluate=FQ,this._motionData.points[s]=new No(t.getMotionCurveSegment(l,v+1),t.getMotionCurveSegment(l,v+2)),s+=1,v+=3;break}case Ya.CubismMotionSegmentType_Bezier:{this._motionData.segments[o].segmentType=Ya.CubismMotionSegmentType_Bezier,n||BQ?this._motionData.segments[o].evaluate=zQ:this._motionData.segments[o].evaluate=UQ,this._motionData.points[s]=new No(t.getMotionCurveSegment(l,v+1),t.getMotionCurveSegment(l,v+2)),this._motionData.points[s+1]=new No(t.getMotionCurveSegment(l,v+3),t.getMotionCurveSegment(l,v+4)),this._motionData.points[s+2]=new No(t.getMotionCurveSegment(l,v+5),t.getMotionCurveSegment(l,v+6)),s+=3,v+=7;break}case Ya.CubismMotionSegmentType_Stepped:{this._motionData.segments[o].segmentType=Ya.CubismMotionSegmentType_Stepped,this._motionData.segments[o].evaluate=GQ,this._motionData.points[s]=new No(t.getMotionCurveSegment(l,v+1),t.getMotionCurveSegment(l,v+2)),s+=1,v+=3;break}case Ya.CubismMotionSegmentType_InverseStepped:{this._motionData.segments[o].segmentType=Ya.CubismMotionSegmentType_InverseStepped,this._motionData.segments[o].evaluate=HQ,this._motionData.points[s]=new No(t.getMotionCurveSegment(l,v+1),t.getMotionCurveSegment(l,v+2)),s+=1,v+=3;break}}++c.segmentCount,++o}this._motionData.curves.push(c)}for(let l=0;l<t.getEventCount();++l)this._motionData.events[l].fireTime=t.getEventTime(l),this._motionData.events[l].value=t.getEventValue(l);t.release()}getFiredEvent(e,t){this._firedEventValues.length=0;for(let n=0;n<this._motionData.eventCount;++n)this._motionData.events[n].fireTime>e&&this._motionData.events[n].fireTime<=t&&this._firedEventValues.push(this._motionData.events[n].value);return this._firedEventValues}}class jQ{constructor(){this._autoDelete=!1,this._available=!0,this._finished=!1,this._started=!1,this._startTimeSeconds=-1,this._fadeInStartTimeSeconds=0,this._endTimeSeconds=-1,this._stateTimeSeconds=0,this._stateWeight=0,this._lastEventCheckSeconds=0,this._motionQueueEntryHandle=this,this._fadeOutSeconds=0,this._isTriggeredFadeOut=!1}release(){this._autoDelete&&this._motion&&this._motion.release()}setFadeOut(e){this._fadeOutSeconds=e,this._isTriggeredFadeOut=!0}startFadeOut(e,t){const n=t+e;this._isTriggeredFadeOut=!0,(this._endTimeSeconds<0||n<this._endTimeSeconds)&&(this._endTimeSeconds=n)}isFinished(){return this._finished}isStarted(){return this._started}getStartTime(){return this._startTimeSeconds}getFadeInStartTime(){return this._fadeInStartTimeSeconds}getEndTime(){return this._endTimeSeconds}setStartTime(e){this._startTimeSeconds=e}setFadeInStartTime(e){this._fadeInStartTimeSeconds=e}setEndTime(e){this._endTimeSeconds=e}setIsFinished(e){this._finished=e}setIsStarted(e){this._started=e}isAvailable(){return this._available}setIsAvailable(e){this._available=e}setState(e,t){this._stateTimeSeconds=e,this._stateWeight=t}getStateTime(){return this._stateTimeSeconds}getStateWeight(){return this._stateWeight}getLastCheckEventSeconds(){return this._lastEventCheckSeconds}setLastCheckEventSeconds(e){this._lastEventCheckSeconds=e}isTriggeredFadeOut(){return this._isTriggeredFadeOut}getFadeOutSeconds(){return this._fadeOutSeconds}}class EP{constructor(){this._userTimeSeconds=0,this._eventCustomData=null,this._motions=[]}release(){for(let e=0;e<this._motions.length;++e)this._motions[e]&&this._motions[e].release();this._motions=void 0}startMotion(e,t,n){if(e==null)return VQ;let i;for(let a=0;a<this._motions.length;++a)i=this._motions[a],i!=null&&i.setFadeOut(i._motion.getFadeOutTime());return i=new jQ,i._autoDelete=t,i._motion=e,this._motions.push(i),i._motionQueueEntryHandle}isFinished(){let e=0;for(;e<this._motions.length;){const t=this._motions[e];if(t==null){this._motions.splice(e,1);continue}if(t._motion==null){t.release(),this._motions.splice(e,1);continue}if(!t.isFinished())return!1;e++}return!0}isFinishedByHandle(e){for(let t=0;t<this._motions.length;t++){const n=this._motions[t];if(n!=null&&n._motionQueueEntryHandle==e&&!n.isFinished())return!1}return!0}stopAllMotions(){for(let e=0;e<this._motions.length;e++){const t=this._motions[e];t!=null&&t.release()}this._motions=[]}getCubismMotionQueueEntry(e){return this._motions.find(t=>t!=null&&t._motionQueueEntryHandle==e)}setEventCallback(e,t=null){this._eventCallBack=e,this._eventCustomData=t}doUpdateMotion(e,t){let n=!1,i=0;for(;i<this._motions.length;){const a=this._motions[i];if(a==null){this._motions.splice(i,1);continue}const s=a._motion;if(s==null){a.release(),this._motions.splice(i,1);continue}s.updateParameters(e,a,t),n=!0;const o=s.getFiredEvent(a.getLastCheckEventSeconds()-a.getStartTime(),t-a.getStartTime());for(let l=0;l<o.length;++l)this._eventCallBack(this,o[l],this._eventCustomData);a.setLastCheckEventSeconds(t),a.isFinished()?(a.release(),this._motions.splice(i,1)):(a.isTriggeredFadeOut()&&a.startFadeOut(a.getFadeOutSeconds(),t),i++)}return n}}const VQ=-1;var l_=(r=>(r[r.CubismPhysicsTargetType_Parameter=0]="CubismPhysicsTargetType_Parameter",r))(l_||{}),ru=(r=>(r[r.CubismPhysicsSource_X=0]="CubismPhysicsSource_X",r[r.CubismPhysicsSource_Y=1]="CubismPhysicsSource_Y",r[r.CubismPhysicsSource_Angle=2]="CubismPhysicsSource_Angle",r))(ru||{});class qQ{constructor(){this.initialPosition=new It(0,0),this.position=new It(0,0),this.lastPosition=new It(0,0),this.lastGravity=new It(0,0),this.force=new It(0,0),this.velocity=new It(0,0)}}class XQ{constructor(){this.normalizationPosition={},this.normalizationAngle={}}}class YQ{constructor(){this.source={}}}class WQ{constructor(){this.destination={},this.translationScale=new It(0,0)}}class $Q{constructor(){this.settings=[],this.inputs=[],this.outputs=[],this.particles=[],this.gravity=new It(0,0),this.wind=new It(0,0)}}class KQ{constructor(e){this._json=e}release(){this._json=void 0}getGravity(){const e=new It(0,0);return e.x=this._json.Meta.EffectiveForces.Gravity.X,e.y=this._json.Meta.EffectiveForces.Gravity.Y,e}getWind(){const e=new It(0,0);return e.x=this._json.Meta.EffectiveForces.Wind.X,e.y=this._json.Meta.EffectiveForces.Wind.Y,e}getSubRigCount(){return this._json.Meta.PhysicsSettingCount}getTotalInputCount(){return this._json.Meta.TotalInputCount}getTotalOutputCount(){return this._json.Meta.TotalOutputCount}getVertexCount(){return this._json.Meta.VertexCount}getNormalizationPositionMinimumValue(e){return this._json.PhysicsSettings[e].Normalization.Position.Minimum}getNormalizationPositionMaximumValue(e){return this._json.PhysicsSettings[e].Normalization.Position.Maximum}getNormalizationPositionDefaultValue(e){return this._json.PhysicsSettings[e].Normalization.Position.Default}getNormalizationAngleMinimumValue(e){return this._json.PhysicsSettings[e].Normalization.Angle.Minimum}getNormalizationAngleMaximumValue(e){return this._json.PhysicsSettings[e].Normalization.Angle.Maximum}getNormalizationAngleDefaultValue(e){return this._json.PhysicsSettings[e].Normalization.Angle.Default}getInputCount(e){return this._json.PhysicsSettings[e].Input.length}getInputWeight(e,t){return this._json.PhysicsSettings[e].Input[t].Weight}getInputReflect(e,t){return this._json.PhysicsSettings[e].Input[t].Reflect}getInputType(e,t){return this._json.PhysicsSettings[e].Input[t].Type}getInputSourceId(e,t){return this._json.PhysicsSettings[e].Input[t].Source.Id}getOutputCount(e){return this._json.PhysicsSettings[e].Output.length}getOutputVertexIndex(e,t){return this._json.PhysicsSettings[e].Output[t].VertexIndex}getOutputAngleScale(e,t){return this._json.PhysicsSettings[e].Output[t].Scale}getOutputWeight(e,t){return this._json.PhysicsSettings[e].Output[t].Weight}getOutputDestinationId(e,t){return this._json.PhysicsSettings[e].Output[t].Destination.Id}getOutputType(e,t){return this._json.PhysicsSettings[e].Output[t].Type}getOutputReflect(e,t){return this._json.PhysicsSettings[e].Output[t].Reflect}getParticleCount(e){return this._json.PhysicsSettings[e].Vertices.length}getParticleMobility(e,t){return this._json.PhysicsSettings[e].Vertices[t].Mobility}getParticleDelay(e,t){return this._json.PhysicsSettings[e].Vertices[t].Delay}getParticleAcceleration(e,t){return this._json.PhysicsSettings[e].Vertices[t].Acceleration}getParticleRadius(e,t){return this._json.PhysicsSettings[e].Vertices[t].Radius}getParticlePosition(e,t){const n=new It(0,0);return n.x=this._json.PhysicsSettings[e].Vertices[t].Position.X,n.y=this._json.PhysicsSettings[e].Vertices[t].Position.Y,n}}const wA="X",SA="Y",EA="Angle",ZQ=5,TP=100,QQ=.001;class v3{static create(e){const t=new v3;return t.parse(e),t._physicsRig.gravity.y=0,t}evaluate(e,t){let n,i,a,s;const o=new It;let l,c,h,d,v,g,m,x;v=e.getModel().parameters.values,g=e.getModel().parameters.maximumValues,m=e.getModel().parameters.minimumValues,x=e.getModel().parameters.defaultValues;for(let y=0;y<this._physicsRig.subRigCount;++y){n={angle:0},o.x=0,o.y=0,l=this._physicsRig.settings[y],c=this._physicsRig.inputs.slice(l.baseInputIndex),h=this._physicsRig.outputs.slice(l.baseOutputIndex),d=this._physicsRig.particles.slice(l.baseParticleIndex);for(let _=0;_<l.inputCount;++_)i=c[_].weight/TP,c[_].sourceParameterIndex==-1&&(c[_].sourceParameterIndex=e.getParameterIndex(c[_].source.id)),c[_].getNormalizedParameterValue(o,n,v[c[_].sourceParameterIndex],m[c[_].sourceParameterIndex],g[c[_].sourceParameterIndex],x[c[_].sourceParameterIndex],l.normalizationPosition,l.normalizationAngle,c[_].reflect,i);a=Dr.degreesToRadian(-n.angle),o.x=o.x*Dr.cos(a)-o.y*Dr.sin(a),o.y=o.x*Dr.sin(a)+o.y*Dr.cos(a),hJ(d,l.particleCount,o,n.angle,this._options.wind,QQ*l.normalizationPosition.maximum,t,ZQ);for(let _=0;_<l.outputCount;++_){const w=h[_].vertexIndex;if(w<1||w>=l.particleCount)break;h[_].destinationParameterIndex==-1&&(h[_].destinationParameterIndex=e.getParameterIndex(h[_].destination.id));const S=new It;S.x=d[w].position.x-d[w-1].position.x,S.y=d[w].position.y-d[w-1].position.y,s=h[_].getValue(S,d,w,h[_].reflect,this._options.gravity);const A=h[_].destinationParameterIndex,C=!Float32Array.prototype.slice&&"subarray"in Float32Array.prototype?JSON.parse(JSON.stringify(v.subarray(A))):v.slice(A);fJ(C,m[A],g[A],s,h[_]);for(let M=A,E=0;M<v.length;M++,E++)v[M]=C[E]}}}setOptions(e){this._options=e}getOption(){return this._options}constructor(){this._options=new JQ,this._options.gravity.y=-1,this._options.gravity.x=0,this._options.wind.x=0,this._options.wind.y=0}release(){this._physicsRig=void 0}parse(e){this._physicsRig=new $Q;let t=new KQ(e);this._physicsRig.gravity=t.getGravity(),this._physicsRig.wind=t.getWind(),this._physicsRig.subRigCount=t.getSubRigCount();let n=0,i=0,a=0;for(let s=0;s<this._physicsRig.subRigCount;++s){const o=new XQ;o.normalizationPosition.minimum=t.getNormalizationPositionMinimumValue(s),o.normalizationPosition.maximum=t.getNormalizationPositionMaximumValue(s),o.normalizationPosition.defalut=t.getNormalizationPositionDefaultValue(s),o.normalizationAngle.minimum=t.getNormalizationAngleMinimumValue(s),o.normalizationAngle.maximum=t.getNormalizationAngleMaximumValue(s),o.normalizationAngle.defalut=t.getNormalizationAngleDefaultValue(s),o.inputCount=t.getInputCount(s),o.baseInputIndex=n,n+=o.inputCount;for(let l=0;l<o.inputCount;++l){const c=new YQ;switch(c.sourceParameterIndex=-1,c.weight=t.getInputWeight(s,l),c.reflect=t.getInputReflect(s,l),t.getInputType(s,l)){case wA:c.type=ru.CubismPhysicsSource_X,c.getNormalizedParameterValue=eJ;break;case SA:c.type=ru.CubismPhysicsSource_Y,c.getNormalizedParameterValue=tJ;break;case EA:c.type=ru.CubismPhysicsSource_Angle,c.getNormalizedParameterValue=rJ;break}c.source.targetType=l_.CubismPhysicsTargetType_Parameter,c.source.id=t.getInputSourceId(s,l),this._physicsRig.inputs.push(c)}o.outputCount=t.getOutputCount(s),o.baseOutputIndex=i,i+=o.outputCount;for(let l=0;l<o.outputCount;++l){const c=new WQ;switch(c.destinationParameterIndex=-1,c.vertexIndex=t.getOutputVertexIndex(s,l),c.angleScale=t.getOutputAngleScale(s,l),c.weight=t.getOutputWeight(s,l),c.destination.targetType=l_.CubismPhysicsTargetType_Parameter,c.destination.id=t.getOutputDestinationId(s,l),t.getOutputType(s,l)){case wA:c.type=ru.CubismPhysicsSource_X,c.getValue=nJ,c.getScale=lJ;break;case SA:c.type=ru.CubismPhysicsSource_Y,c.getValue=iJ,c.getScale=uJ;break;case EA:c.type=ru.CubismPhysicsSource_Angle,c.getValue=aJ,c.getScale=cJ;break}c.reflect=t.getOutputReflect(s,l),this._physicsRig.outputs.push(c)}o.particleCount=t.getParticleCount(s),o.baseParticleIndex=a,a+=o.particleCount;for(let l=0;l<o.particleCount;++l){const c=new qQ;c.mobility=t.getParticleMobility(s,l),c.delay=t.getParticleDelay(s,l),c.acceleration=t.getParticleAcceleration(s,l),c.radius=t.getParticleRadius(s,l),c.position=t.getParticlePosition(s,l),this._physicsRig.particles.push(c)}this._physicsRig.settings.push(o)}this.initialize(),t.release()}initialize(){let e,t,n;for(let i=0;i<this._physicsRig.subRigCount;++i){t=this._physicsRig.settings[i],e=this._physicsRig.particles.slice(t.baseParticleIndex),e[0].initialPosition=new It(0,0),e[0].lastPosition=new It(e[0].initialPosition.x,e[0].initialPosition.y),e[0].lastGravity=new It(0,-1),e[0].lastGravity.y*=-1,e[0].velocity=new It(0,0),e[0].force=new It(0,0);for(let a=1;a<t.particleCount;++a)n=new It(0,0),n.y=e[a].radius,e[a].initialPosition=new It(e[a-1].initialPosition.x+n.x,e[a-1].initialPosition.y+n.y),e[a].position=new It(e[a].initialPosition.x,e[a].initialPosition.y),e[a].lastPosition=new It(e[a].initialPosition.x,e[a].initialPosition.y),e[a].lastGravity=new It(0,-1),e[a].lastGravity.y*=-1,e[a].velocity=new It(0,0),e[a].force=new It(0,0)}}}let JQ=class{constructor(){this.gravity=new It(0,0),this.wind=new It(0,0)}};function eJ(r,e,t,n,i,a,s,o,l,c){r.x+=p3(t,n,i,a,s.minimum,s.maximum,s.defalut,l)*c}function tJ(r,e,t,n,i,a,s,o,l,c){r.y+=p3(t,n,i,a,s.minimum,s.maximum,s.defalut,l)*c}function rJ(r,e,t,n,i,a,s,o,l,c){e.angle+=p3(t,n,i,a,o.minimum,o.maximum,o.defalut,l)*c}function nJ(r,e,t,n,i){let a=r.x;return n&&(a*=-1),a}function iJ(r,e,t,n,i){let a=r.y;return n&&(a*=-1),a}function aJ(r,e,t,n,i){let a;return t>=2?i=e[t-1].position.substract(e[t-2].position):i=i.multiplyByScaler(-1),a=Dr.directionToRadian(i,r),n&&(a*=-1),a}function sJ(r,e){return Math.abs(Math.max(r,e)-Math.min(r,e))}function oJ(r,e){return Math.min(r,e)+sJ(r,e)/2}function lJ(r,e){return r.x}function uJ(r,e){return r.y}function cJ(r,e){return e}function hJ(r,e,t,n,i,a,s,o){let l,c,h,d,v=new It(0,0),g=new It(0,0),m=new It(0,0),x=new It(0,0);r[0].position=new It(t.x,t.y),l=Dr.degreesToRadian(n),d=Dr.radianToDirection(l),d.normalize();for(let y=1;y<e;++y)r[y].force=d.multiplyByScaler(r[y].acceleration).add(i),r[y].lastPosition=new It(r[y].position.x,r[y].position.y),c=r[y].delay*s*30,v=r[y].position.substract(r[y-1].position),h=Dr.directionToRadian(r[y].lastGravity,d)/o,v.x=Dr.cos(h)*v.x-v.y*Dr.sin(h),v.y=Dr.sin(h)*v.x+v.y*Dr.cos(h),r[y].position=r[y-1].position.add(v),g=r[y].velocity.multiplyByScaler(c),m=r[y].force.multiplyByScaler(c).multiplyByScaler(c),r[y].position=r[y].position.add(g).add(m),x=r[y].position.substract(r[y-1].position),x.normalize(),r[y].position=r[y-1].position.add(x.multiplyByScaler(r[y].radius)),Dr.abs(r[y].position.x)<a&&(r[y].position.x=0),c!=0&&(r[y].velocity=r[y].position.substract(r[y].lastPosition),r[y].velocity=r[y].velocity.divisionByScalar(c),r[y].velocity=r[y].velocity.multiplyByScaler(r[y].mobility)),r[y].force=new It(0,0),r[y].lastGravity=new It(d.x,d.y)}function fJ(r,e,t,n,i){let a,s,o;a=i.getScale(i.translationScale,i.angleScale),s=n*a,s<e?(s<i.valueBelowMinimum&&(i.valueBelowMinimum=s),s=e):s>t&&(s>i.valueExceededMaximum&&(i.valueExceededMaximum=s),s=t),o=i.weight/TP,o>=1||(s=r[0]*(1-o)+s*o),r[0]=s}function p3(r,e,t,n,i,a,s,o){let l=0;const c=Dr.max(t,e);c<r&&(r=c);const h=Dr.min(t,e);h>r&&(r=h);const d=Dr.min(i,a),v=Dr.max(i,a),g=s,m=oJ(h,c),x=r-m;switch(Math.sign(x)){case 1:{const y=v-g,_=c-m;_!=0&&(l=x*(y/_),l+=g);break}case-1:{const y=d-g,_=h-m;_!=0&&(l=x*(y/_),l+=g);break}case 0:{l=g;break}}return o?l:l*-1}class u_{constructor(e=0,t=0,n=0,i=0){this.x=e,this.y=t,this.width=n,this.height=i}getCenterX(){return this.x+.5*this.width}getCenterY(){return this.y+.5*this.height}getRight(){return this.x+this.width}getBottom(){return this.y+this.height}setRect(e){this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height}expand(e,t){this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2}}const vx=4,dJ=10;let Vl,Nf,c_;class px{getChannelFlagAsColor(e){return this._channelColors[e]}getMaskRenderTexture(){let e=0;if(this._maskTexture&&this._maskTexture.texture!=0&&(this._maskTexture.frameNo=this._currentFrameNo,e=this._maskTexture.texture),e==0){const t=this._clippingMaskBufferSize;this._colorBuffer=this.gl.createTexture(),this.gl.bindTexture(this.gl.TEXTURE_2D,this._colorBuffer),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,t,t,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,null),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR),this.gl.bindTexture(this.gl.TEXTURE_2D,null),e=this.gl.createFramebuffer(),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,e),this.gl.framebufferTexture2D(this.gl.FRAMEBUFFER,this.gl.COLOR_ATTACHMENT0,this.gl.TEXTURE_2D,this._colorBuffer,0),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,c_),this._maskTexture=new vJ(this._currentFrameNo,e)}return e}setGL(e){this.gl=e}calcClippedDrawTotalBounds(e,t){let n=Number.MAX_VALUE,i=Number.MAX_VALUE,a=Number.MIN_VALUE,s=Number.MIN_VALUE;const o=t._clippedDrawableIndexList.length;for(let l=0;l<o;l++){const c=t._clippedDrawableIndexList[l],h=e.getDrawableVertexCount(c),d=e.getDrawableVertices(c);let v=Number.MAX_VALUE,g=Number.MAX_VALUE,m=Number.MIN_VALUE,x=Number.MIN_VALUE;const y=h*fx.vertexStep;for(let _=fx.vertexOffset;_<y;_+=fx.vertexStep){const w=d[_],S=d[_+1];w<v&&(v=w),w>m&&(m=w),S<g&&(g=S),S>x&&(x=S)}if(v!=Number.MAX_VALUE)if(v<n&&(n=v),g<i&&(i=g),m>a&&(a=m),x>s&&(s=x),n==Number.MAX_VALUE)t._allClippedDrawRect.x=0,t._allClippedDrawRect.y=0,t._allClippedDrawRect.width=0,t._allClippedDrawRect.height=0,t._isUsing=!1;else{t._isUsing=!0;const _=a-n,w=s-i;t._allClippedDrawRect.x=n,t._allClippedDrawRect.y=i,t._allClippedDrawRect.width=_,t._allClippedDrawRect.height=w}}}constructor(){this._maskRenderTexture=null,this._colorBuffer=null,this._currentFrameNo=0,this._clippingMaskBufferSize=256,this._clippingContextListForMask=[],this._clippingContextListForDraw=[],this._channelColors=[],this._tmpBoundsOnModel=new u_,this._tmpMatrix=new ma,this._tmpMatrixForMask=new ma,this._tmpMatrixForDraw=new ma;let e=new Pf;e.R=1,e.G=0,e.B=0,e.A=0,this._channelColors.push(e),e=new Pf,e.R=0,e.G=1,e.B=0,e.A=0,this._channelColors.push(e),e=new Pf,e.R=0,e.G=0,e.B=1,e.A=0,this._channelColors.push(e),e=new Pf,e.R=0,e.G=0,e.B=0,e.A=1,this._channelColors.push(e)}release(){var e,t,n;const i=this;for(let a=0;a<this._clippingContextListForMask.length;a++)this._clippingContextListForMask[a]&&((e=this._clippingContextListForMask[a])==null||e.release());i._clippingContextListForMask=void 0,i._clippingContextListForDraw=void 0,this._maskTexture&&((t=this.gl)==null||t.deleteFramebuffer(this._maskTexture.texture),i._maskTexture=void 0),i._channelColors=void 0,(n=this.gl)==null||n.deleteTexture(this._colorBuffer),this._colorBuffer=null}initialize(e,t,n,i){for(let a=0;a<t;a++){if(i[a]<=0){this._clippingContextListForDraw.push(null);continue}let s=this.findSameClip(n[a],i[a]);s==null&&(s=new pJ(this,n[a],i[a]),this._clippingContextListForMask.push(s)),s.addClippedDrawable(a),this._clippingContextListForDraw.push(s)}}setupClippingContext(e,t){this._currentFrameNo++;let n=0;for(let i=0;i<this._clippingContextListForMask.length;i++){const a=this._clippingContextListForMask[i];this.calcClippedDrawTotalBounds(e,a),a._isUsing&&n++}if(n>0){this.gl.viewport(0,0,this._clippingMaskBufferSize,this._clippingMaskBufferSize),this._maskRenderTexture=this.getMaskRenderTexture(),t.getMvpMatrix(),t.preDraw(),this.setupLayoutBounds(n),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,this._maskRenderTexture),this.gl.clearColor(1,1,1,1),this.gl.clear(this.gl.COLOR_BUFFER_BIT);for(let i=0;i<this._clippingContextListForMask.length;i++){const a=this._clippingContextListForMask[i],s=a._allClippedDrawRect,o=a._layoutBounds,l=.05;this._tmpBoundsOnModel.setRect(s),this._tmpBoundsOnModel.expand(s.width*l,s.height*l);const c=o.width/this._tmpBoundsOnModel.width,h=o.height/this._tmpBoundsOnModel.height;this._tmpMatrix.loadIdentity(),this._tmpMatrix.translateRelative(-1,-1),this._tmpMatrix.scaleRelative(2,2),this._tmpMatrix.translateRelative(o.x,o.y),this._tmpMatrix.scaleRelative(c,h),this._tmpMatrix.translateRelative(-this._tmpBoundsOnModel.x,-this._tmpBoundsOnModel.y),this._tmpMatrixForMask.setMatrix(this._tmpMatrix.getArray()),this._tmpMatrix.loadIdentity(),this._tmpMatrix.translateRelative(o.x,o.y),this._tmpMatrix.scaleRelative(c,h),this._tmpMatrix.translateRelative(-this._tmpBoundsOnModel.x,-this._tmpBoundsOnModel.y),this._tmpMatrixForDraw.setMatrix(this._tmpMatrix.getArray()),a._matrixForMask.setMatrix(this._tmpMatrixForMask.getArray()),a._matrixForDraw.setMatrix(this._tmpMatrixForDraw.getArray());const d=a._clippingIdCount;for(let v=0;v<d;v++){const g=a._clippingIdList[v];e.getDrawableDynamicFlagVertexPositionsDidChange(g)&&(t.setIsCulling(e.getDrawableCulling(g)!=!1),t.setClippingContextBufferForMask(a),t.drawMesh(e.getDrawableTextureIndices(g),e.getDrawableVertexIndexCount(g),e.getDrawableVertexCount(g),e.getDrawableVertexIndices(g),e.getDrawableVertices(g),e.getDrawableVertexUvs(g),e.getDrawableOpacity(g),Wo.CubismBlendMode_Normal,!1))}}this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,c_),t.setClippingContextBufferForMask(null),this.gl.viewport(Nf[0],Nf[1],Nf[2],Nf[3])}}findSameClip(e,t){for(let n=0;n<this._clippingContextListForMask.length;n++){const i=this._clippingContextListForMask[n],a=i._clippingIdCount;if(a!=t)continue;let s=0;for(let o=0;o<a;o++){const l=i._clippingIdList[o];for(let c=0;c<a;c++)if(e[c]==l){s++;break}}if(s==a)return i}return null}setupLayoutBounds(e){let t=e/vx,n=e%vx;t=~~t,n=~~n;let i=0;for(let a=0;a<vx;a++){const s=t+(a<n?1:0);if(s!=0)if(s==1){const o=this._clippingContextListForMask[i++];o._layoutChannelNo=a,o._layoutBounds.x=0,o._layoutBounds.y=0,o._layoutBounds.width=1,o._layoutBounds.height=1}else if(s==2)for(let o=0;o<s;o++){let l=o%2;l=~~l;const c=this._clippingContextListForMask[i++];c._layoutChannelNo=a,c._layoutBounds.x=l*.5,c._layoutBounds.y=0,c._layoutBounds.width=.5,c._layoutBounds.height=1}else if(s<=4)for(let o=0;o<s;o++){let l=o%2,c=o/2;l=~~l,c=~~c;const h=this._clippingContextListForMask[i++];h._layoutChannelNo=a,h._layoutBounds.x=l*.5,h._layoutBounds.y=c*.5,h._layoutBounds.width=.5,h._layoutBounds.height=.5}else if(s<=9)for(let o=0;o<s;o++){let l=o%3,c=o/3;l=~~l,c=~~c;const h=this._clippingContextListForMask[i++];h._layoutChannelNo=a,h._layoutBounds.x=l/3,h._layoutBounds.y=c/3,h._layoutBounds.width=1/3,h._layoutBounds.height=1/3}else if(bd.supportMoreMaskDivisions&&s<=16)for(let o=0;o<s;o++){let l=o%4,c=o/4;l=~~l,c=~~c;const h=this._clippingContextListForMask[i++];h._layoutChannelNo=a,h._layoutBounds.x=l/4,h._layoutBounds.y=c/4,h._layoutBounds.width=1/4,h._layoutBounds.height=1/4}else Sc("not supported mask count : {0}",s)}}getColorBuffer(){return this._colorBuffer}getClippingContextListForDraw(){return this._clippingContextListForDraw}setClippingMaskBufferSize(e){this._clippingMaskBufferSize=e}getClippingMaskBufferSize(){return this._clippingMaskBufferSize}}class vJ{constructor(e,t){this.frameNo=e,this.texture=t}}class pJ{constructor(e,t,n){this._isUsing=!1,this._owner=e,this._clippingIdList=t,this._clippingIdCount=n,this._allClippedDrawRect=new u_,this._layoutBounds=new u_,this._clippedDrawableIndexList=[],this._matrixForMask=new ma,this._matrixForDraw=new ma}release(){const e=this;e._layoutBounds=void 0,e._allClippedDrawRect=void 0,e._clippedDrawableIndexList=void 0}addClippedDrawable(e){this._clippedDrawableIndexList.push(e)}getClippingManager(){return this._owner}setGl(e){this._owner.setGL(e)}}class Pc{static getInstance(){return Vl==null&&(Vl=new Pc),Vl}static deleteInstance(){Vl&&(Vl.release(),Vl=void 0)}constructor(){this._shaderSets=[]}release(){this.releaseShaderProgram()}setupShaderProgram(e,t,n,i,a,s,o,l,c,h,d,v,g){d||Sc("NoPremultipliedAlpha is not allowed"),this._shaderSets.length==0&&this.generateShaders();let m,x,y,_;const w=e.getClippingContextBufferForMask();if(w!=null){const S=this._shaderSets[Lf.ShaderNames_SetupMask];this.gl.useProgram(S.shaderProgram),this.gl.activeTexture(this.gl.TEXTURE0),this.gl.bindTexture(this.gl.TEXTURE_2D,t),this.gl.uniform1i(S.samplerTexture0Location,0),o.vertex==null&&(o.vertex=this.gl.createBuffer()),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,o.vertex),this.gl.bufferData(this.gl.ARRAY_BUFFER,i,this.gl.DYNAMIC_DRAW),this.gl.enableVertexAttribArray(S.attributePositionLocation),this.gl.vertexAttribPointer(S.attributePositionLocation,2,this.gl.FLOAT,!1,0,0),o.uv==null&&(o.uv=this.gl.createBuffer()),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,o.uv),this.gl.bufferData(this.gl.ARRAY_BUFFER,s,this.gl.DYNAMIC_DRAW),this.gl.enableVertexAttribArray(S.attributeTexCoordLocation),this.gl.vertexAttribPointer(S.attributeTexCoordLocation,2,this.gl.FLOAT,!1,0,0);const A=w._layoutChannelNo,C=w.getClippingManager().getChannelFlagAsColor(A);this.gl.uniform4f(S.uniformChannelFlagLocation,C.R,C.G,C.B,C.A),this.gl.uniformMatrix4fv(S.uniformClipMatrixLocation,!1,w._matrixForMask.getArray());const M=w._layoutBounds;this.gl.uniform4f(S.uniformBaseColorLocation,M.x*2-1,M.y*2-1,M.getRight()*2-1,M.getBottom()*2-1),m=this.gl.ZERO,x=this.gl.ONE_MINUS_SRC_COLOR,y=this.gl.ZERO,_=this.gl.ONE_MINUS_SRC_ALPHA}else{const S=e.getClippingContextBufferForDraw(),C=S!=null?g?2:1:0;let M;switch(c){case Wo.CubismBlendMode_Normal:default:M=this._shaderSets[Lf.ShaderNames_NormalPremultipliedAlpha+C],m=this.gl.ONE,x=this.gl.ONE_MINUS_SRC_ALPHA,y=this.gl.ONE,_=this.gl.ONE_MINUS_SRC_ALPHA;break;case Wo.CubismBlendMode_Additive:M=this._shaderSets[Lf.ShaderNames_AddPremultipliedAlpha+C],m=this.gl.ONE,x=this.gl.ONE,y=this.gl.ZERO,_=this.gl.ONE;break;case Wo.CubismBlendMode_Multiplicative:M=this._shaderSets[Lf.ShaderNames_MultPremultipliedAlpha+C],m=this.gl.DST_COLOR,x=this.gl.ONE_MINUS_SRC_ALPHA,y=this.gl.ZERO,_=this.gl.ONE;break}if(this.gl.useProgram(M.shaderProgram),o.vertex==null&&(o.vertex=this.gl.createBuffer()),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,o.vertex),this.gl.bufferData(this.gl.ARRAY_BUFFER,i,this.gl.DYNAMIC_DRAW),this.gl.enableVertexAttribArray(M.attributePositionLocation),this.gl.vertexAttribPointer(M.attributePositionLocation,2,this.gl.FLOAT,!1,0,0),o.uv==null&&(o.uv=this.gl.createBuffer()),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,o.uv),this.gl.bufferData(this.gl.ARRAY_BUFFER,s,this.gl.DYNAMIC_DRAW),this.gl.enableVertexAttribArray(M.attributeTexCoordLocation),this.gl.vertexAttribPointer(M.attributeTexCoordLocation,2,this.gl.FLOAT,!1,0,0),S!=null){this.gl.activeTexture(this.gl.TEXTURE1);const E=S.getClippingManager().getColorBuffer();this.gl.bindTexture(this.gl.TEXTURE_2D,E),this.gl.uniform1i(M.samplerTexture1Location,1),this.gl.uniformMatrix4fv(M.uniformClipMatrixLocation,!1,S._matrixForDraw.getArray());const O=S._layoutChannelNo,D=S.getClippingManager().getChannelFlagAsColor(O);this.gl.uniform4f(M.uniformChannelFlagLocation,D.R,D.G,D.B,D.A)}this.gl.activeTexture(this.gl.TEXTURE0),this.gl.bindTexture(this.gl.TEXTURE_2D,t),this.gl.uniform1i(M.samplerTexture0Location,0),this.gl.uniformMatrix4fv(M.uniformMatrixLocation,!1,v.getArray()),this.gl.uniform4f(M.uniformBaseColorLocation,h.R,h.G,h.B,h.A)}o.index==null&&(o.index=this.gl.createBuffer()),this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,o.index),this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER,a,this.gl.DYNAMIC_DRAW),this.gl.blendFuncSeparate(m,x,y,_)}releaseShaderProgram(){for(let e=0;e<this._shaderSets.length;e++)this.gl.deleteProgram(this._shaderSets[e].shaderProgram),this._shaderSets[e].shaderProgram=0;this._shaderSets=[]}generateShaders(){for(let e=0;e<dJ;e++)this._shaderSets.push({});this._shaderSets[0].shaderProgram=this.loadShaderProgram(gJ,mJ),this._shaderSets[1].shaderProgram=this.loadShaderProgram(yJ,bJ),this._shaderSets[2].shaderProgram=this.loadShaderProgram(TA,xJ),this._shaderSets[3].shaderProgram=this.loadShaderProgram(TA,_J),this._shaderSets[4].shaderProgram=this._shaderSets[1].shaderProgram,this._shaderSets[5].shaderProgram=this._shaderSets[2].shaderProgram,this._shaderSets[6].shaderProgram=this._shaderSets[3].shaderProgram,this._shaderSets[7].shaderProgram=this._shaderSets[1].shaderProgram,this._shaderSets[8].shaderProgram=this._shaderSets[2].shaderProgram,this._shaderSets[9].shaderProgram=this._shaderSets[3].shaderProgram,this._shaderSets[0].attributePositionLocation=this.gl.getAttribLocation(this._shaderSets[0].shaderProgram,"a_position"),this._shaderSets[0].attributeTexCoordLocation=this.gl.getAttribLocation(this._shaderSets[0].shaderProgram,"a_texCoord"),this._shaderSets[0].samplerTexture0Location=this.gl.getUniformLocation(this._shaderSets[0].shaderProgram,"s_texture0"),this._shaderSets[0].uniformClipMatrixLocation=this.gl.getUniformLocation(this._shaderSets[0].shaderProgram,"u_clipMatrix"),this._shaderSets[0].uniformChannelFlagLocation=this.gl.getUniformLocation(this._shaderSets[0].shaderProgram,"u_channelFlag"),this._shaderSets[0].uniformBaseColorLocation=this.gl.getUniformLocation(this._shaderSets[0].shaderProgram,"u_baseColor"),this._shaderSets[1].attributePositionLocation=this.gl.getAttribLocation(this._shaderSets[1].shaderProgram,"a_position"),this._shaderSets[1].attributeTexCoordLocation=this.gl.getAttribLocation(this._shaderSets[1].shaderProgram,"a_texCoord"),this._shaderSets[1].samplerTexture0Location=this.gl.getUniformLocation(this._shaderSets[1].shaderProgram,"s_texture0"),this._shaderSets[1].uniformMatrixLocation=this.gl.getUniformLocation(this._shaderSets[1].shaderProgram,"u_matrix"),this._shaderSets[1].uniformBaseColorLocation=this.gl.getUniformLocation(this._shaderSets[1].shaderProgram,"u_baseColor"),this._shaderSets[2].attributePositionLocation=this.gl.getAttribLocation(this._shaderSets[2].shaderProgram,"a_position"),this._shaderSets[2].attributeTexCoordLocation=this.gl.getAttribLocation(this._shaderSets[2].shaderProgram,"a_texCoord"),this._shaderSets[2].samplerTexture0Location=this.gl.getUniformLocation(this._shaderSets[2].shaderProgram,"s_texture0"),this._shaderSets[2].samplerTexture1Location=this.gl.getUniformLocation(this._shaderSets[2].shaderProgram,"s_texture1"),this._shaderSets[2].uniformMatrixLocation=this.gl.getUniformLocation(this._shaderSets[2].shaderProgram,"u_matrix"),this._shaderSets[2].uniformClipMatrixLocation=this.gl.getUniformLocation(this._shaderSets[2].shaderProgram,"u_clipMatrix"),this._shaderSets[2].uniformChannelFlagLocation=this.gl.getUniformLocation(this._shaderSets[2].shaderProgram,"u_channelFlag"),this._shaderSets[2].uniformBaseColorLocation=this.gl.getUniformLocation(this._shaderSets[2].shaderProgram,"u_baseColor"),this._shaderSets[3].attributePositionLocation=this.gl.getAttribLocation(this._shaderSets[3].shaderProgram,"a_position"),this._shaderSets[3].attributeTexCoordLocation=this.gl.getAttribLocation(this._shaderSets[3].shaderProgram,"a_texCoord"),this._shaderSets[3].samplerTexture0Location=this.gl.getUniformLocation(this._shaderSets[3].shaderProgram,"s_texture0"),this._shaderSets[3].samplerTexture1Location=this.gl.getUniformLocation(this._shaderSets[3].shaderProgram,"s_texture1"),this._shaderSets[3].uniformMatrixLocation=this.gl.getUniformLocation(this._shaderSets[3].shaderProgram,"u_matrix"),this._shaderSets[3].uniformClipMatrixLocation=this.gl.getUniformLocation(this._shaderSets[3].shaderProgram,"u_clipMatrix"),this._shaderSets[3].uniformChannelFlagLocation=this.gl.getUniformLocation(this._shaderSets[3].shaderProgram,"u_channelFlag"),this._shaderSets[3].uniformBaseColorLocation=this.gl.getUniformLocation(this._shaderSets[3].shaderProgram,"u_baseColor"),this._shaderSets[4].attributePositionLocation=this.gl.getAttribLocation(this._shaderSets[4].shaderProgram,"a_position"),this._shaderSets[4].attributeTexCoordLocation=this.gl.getAttribLocation(this._shaderSets[4].shaderProgram,"a_texCoord"),this._shaderSets[4].samplerTexture0Location=this.gl.getUniformLocation(this._shaderSets[4].shaderProgram,"s_texture0"),this._shaderSets[4].uniformMatrixLocation=this.gl.getUniformLocation(this._shaderSets[4].shaderProgram,"u_matrix"),this._shaderSets[4].uniformBaseColorLocation=this.gl.getUniformLocation(this._shaderSets[4].shaderProgram,"u_baseColor"),this._shaderSets[5].attributePositionLocation=this.gl.getAttribLocation(this._shaderSets[5].shaderProgram,"a_position"),this._shaderSets[5].attributeTexCoordLocation=this.gl.getAttribLocation(this._shaderSets[5].shaderProgram,"a_texCoord"),this._shaderSets[5].samplerTexture0Location=this.gl.getUniformLocation(this._shaderSets[5].shaderProgram,"s_texture0"),this._shaderSets[5].samplerTexture1Location=this.gl.getUniformLocation(this._shaderSets[5].shaderProgram,"s_texture1"),this._shaderSets[5].uniformMatrixLocation=this.gl.getUniformLocation(this._shaderSets[5].shaderProgram,"u_matrix"),this._shaderSets[5].uniformClipMatrixLocation=this.gl.getUniformLocation(this._shaderSets[5].shaderProgram,"u_clipMatrix"),this._shaderSets[5].uniformChannelFlagLocation=this.gl.getUniformLocation(this._shaderSets[5].shaderProgram,"u_channelFlag"),this._shaderSets[5].uniformBaseColorLocation=this.gl.getUniformLocation(this._shaderSets[5].shaderProgram,"u_baseColor"),this._shaderSets[6].attributePositionLocation=this.gl.getAttribLocation(this._shaderSets[6].shaderProgram,"a_position"),this._shaderSets[6].attributeTexCoordLocation=this.gl.getAttribLocation(this._shaderSets[6].shaderProgram,"a_texCoord"),this._shaderSets[6].samplerTexture0Location=this.gl.getUniformLocation(this._shaderSets[6].shaderProgram,"s_texture0"),this._shaderSets[6].samplerTexture1Location=this.gl.getUniformLocation(this._shaderSets[6].shaderProgram,"s_texture1"),this._shaderSets[6].uniformMatrixLocation=this.gl.getUniformLocation(this._shaderSets[6].shaderProgram,"u_matrix"),this._shaderSets[6].uniformClipMatrixLocation=this.gl.getUniformLocation(this._shaderSets[6].shaderProgram,"u_clipMatrix"),this._shaderSets[6].uniformChannelFlagLocation=this.gl.getUniformLocation(this._shaderSets[6].shaderProgram,"u_channelFlag"),this._shaderSets[6].uniformBaseColorLocation=this.gl.getUniformLocation(this._shaderSets[6].shaderProgram,"u_baseColor"),this._shaderSets[7].attributePositionLocation=this.gl.getAttribLocation(this._shaderSets[7].shaderProgram,"a_position"),this._shaderSets[7].attributeTexCoordLocation=this.gl.getAttribLocation(this._shaderSets[7].shaderProgram,"a_texCoord"),this._shaderSets[7].samplerTexture0Location=this.gl.getUniformLocation(this._shaderSets[7].shaderProgram,"s_texture0"),this._shaderSets[7].uniformMatrixLocation=this.gl.getUniformLocation(this._shaderSets[7].shaderProgram,"u_matrix"),this._shaderSets[7].uniformBaseColorLocation=this.gl.getUniformLocation(this._shaderSets[7].shaderProgram,"u_baseColor"),this._shaderSets[8].attributePositionLocation=this.gl.getAttribLocation(this._shaderSets[8].shaderProgram,"a_position"),this._shaderSets[8].attributeTexCoordLocation=this.gl.getAttribLocation(this._shaderSets[8].shaderProgram,"a_texCoord"),this._shaderSets[8].samplerTexture0Location=this.gl.getUniformLocation(this._shaderSets[8].shaderProgram,"s_texture0"),this._shaderSets[8].samplerTexture1Location=this.gl.getUniformLocation(this._shaderSets[8].shaderProgram,"s_texture1"),this._shaderSets[8].uniformMatrixLocation=this.gl.getUniformLocation(this._shaderSets[8].shaderProgram,"u_matrix"),this._shaderSets[8].uniformClipMatrixLocation=this.gl.getUniformLocation(this._shaderSets[8].shaderProgram,"u_clipMatrix"),this._shaderSets[8].uniformChannelFlagLocation=this.gl.getUniformLocation(this._shaderSets[8].shaderProgram,"u_channelFlag"),this._shaderSets[8].uniformBaseColorLocation=this.gl.getUniformLocation(this._shaderSets[8].shaderProgram,"u_baseColor"),this._shaderSets[9].attributePositionLocation=this.gl.getAttribLocation(this._shaderSets[9].shaderProgram,"a_position"),this._shaderSets[9].attributeTexCoordLocation=this.gl.getAttribLocation(this._shaderSets[9].shaderProgram,"a_texCoord"),this._shaderSets[9].samplerTexture0Location=this.gl.getUniformLocation(this._shaderSets[9].shaderProgram,"s_texture0"),this._shaderSets[9].samplerTexture1Location=this.gl.getUniformLocation(this._shaderSets[9].shaderProgram,"s_texture1"),this._shaderSets[9].uniformMatrixLocation=this.gl.getUniformLocation(this._shaderSets[9].shaderProgram,"u_matrix"),this._shaderSets[9].uniformClipMatrixLocation=this.gl.getUniformLocation(this._shaderSets[9].shaderProgram,"u_clipMatrix"),this._shaderSets[9].uniformChannelFlagLocation=this.gl.getUniformLocation(this._shaderSets[9].shaderProgram,"u_channelFlag"),this._shaderSets[9].uniformBaseColorLocation=this.gl.getUniformLocation(this._shaderSets[9].shaderProgram,"u_baseColor")}loadShaderProgram(e,t){let n=this.gl.createProgram(),i=this.compileShaderSource(this.gl.VERTEX_SHADER,e);if(!i)return Sc("Vertex shader compile error!"),0;let a=this.compileShaderSource(this.gl.FRAGMENT_SHADER,t);return a?(this.gl.attachShader(n,i),this.gl.attachShader(n,a),this.gl.linkProgram(n),this.gl.getProgramParameter(n,this.gl.LINK_STATUS)?(this.gl.deleteShader(i),this.gl.deleteShader(a),n):(Sc("Failed to link program: {0}",n),this.gl.deleteShader(i),this.gl.deleteShader(a),n&&this.gl.deleteProgram(n),0)):(Sc("Vertex shader compile error!"),0)}compileShaderSource(e,t){const n=t,i=this.gl.createShader(e);if(this.gl.shaderSource(i,n),this.gl.compileShader(i),!i){const s=this.gl.getShaderInfoLog(i);Sc("Shader compile log: {0} ",s)}return this.gl.getShaderParameter(i,this.gl.COMPILE_STATUS)?i:(this.gl.deleteShader(i),null)}setGl(e){this.gl=e}}var Lf=(r=>(r[r.ShaderNames_SetupMask=0]="ShaderNames_SetupMask",r[r.ShaderNames_NormalPremultipliedAlpha=1]="ShaderNames_NormalPremultipliedAlpha",r[r.ShaderNames_NormalMaskedPremultipliedAlpha=2]="ShaderNames_NormalMaskedPremultipliedAlpha",r[r.ShaderNames_NomralMaskedInvertedPremultipliedAlpha=3]="ShaderNames_NomralMaskedInvertedPremultipliedAlpha",r[r.ShaderNames_AddPremultipliedAlpha=4]="ShaderNames_AddPremultipliedAlpha",r[r.ShaderNames_AddMaskedPremultipliedAlpha=5]="ShaderNames_AddMaskedPremultipliedAlpha",r[r.ShaderNames_AddMaskedPremultipliedAlphaInverted=6]="ShaderNames_AddMaskedPremultipliedAlphaInverted",r[r.ShaderNames_MultPremultipliedAlpha=7]="ShaderNames_MultPremultipliedAlpha",r[r.ShaderNames_MultMaskedPremultipliedAlpha=8]="ShaderNames_MultMaskedPremultipliedAlpha",r[r.ShaderNames_MultMaskedPremultipliedAlphaInverted=9]="ShaderNames_MultMaskedPremultipliedAlphaInverted",r))(Lf||{});const gJ="attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;varying vec4 v_myPos;uniform mat4 u_clipMatrix;void main(){ gl_Position = u_clipMatrix * a_position; v_myPos = u_clipMatrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}",mJ="precision mediump float;varying vec2 v_texCoord;varying vec4 v_myPos;uniform vec4 u_baseColor;uniform vec4 u_channelFlag;uniform sampler2D s_texture0;void main(){ float isInside = step(u_baseColor.x, v_myPos.x/v_myPos.w) * step(u_baseColor.y, v_myPos.y/v_myPos.w) * step(v_myPos.x/v_myPos.w, u_baseColor.z) * step(v_myPos.y/v_myPos.w, u_baseColor.w); gl_FragColor = u_channelFlag * texture2D(s_texture0, v_texCoord).a * isInside;}",yJ="attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;uniform mat4 u_matrix;void main(){ gl_Position = u_matrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}",TA="attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform mat4 u_matrix;uniform mat4 u_clipMatrix;void main(){ gl_Position = u_matrix * a_position; v_clipPos = u_clipMatrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}",bJ="precision mediump float;varying vec2 v_texCoord;uniform vec4 u_baseColor;uniform sampler2D s_texture0;void main(){ gl_FragColor = texture2D(s_texture0 , v_texCoord) * u_baseColor;}",xJ="precision mediump float;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform vec4 u_baseColor;uniform vec4 u_channelFlag;uniform sampler2D s_texture0;uniform sampler2D s_texture1;void main(){ vec4 col_formask = texture2D(s_texture0 , v_texCoord) * u_baseColor; vec4 clipMask = (1.0 - texture2D(s_texture1, v_clipPos.xy / v_clipPos.w)) * u_channelFlag; float maskVal = clipMask.r + clipMask.g + clipMask.b + clipMask.a; col_formask = col_formask * maskVal; gl_FragColor = col_formask;}",_J="precision mediump float;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform sampler2D s_texture0;uniform sampler2D s_texture1;uniform vec4 u_channelFlag;uniform vec4 u_baseColor;void main(){vec4 col_formask = texture2D(s_texture0, v_texCoord) * u_baseColor;vec4 clipMask = (1.0 - texture2D(s_texture1, v_clipPos.xy / v_clipPos.w)) * u_channelFlag;float maskVal = clipMask.r + clipMask.g + clipMask.b + clipMask.a;col_formask = col_formask * (1.0 - maskVal);gl_FragColor = col_formask;}";class CP extends u3{constructor(){super(),this._clippingContextBufferForMask=null,this._clippingContextBufferForDraw=null,this._clippingManager=new px,this.firstDraw=!0,this._textures={},this._sortedDrawableIndexList=[],this._bufferData={vertex:null,uv:null,index:null}}initialize(e){e.isUsingMasking()&&(this._clippingManager=new px,this._clippingManager.initialize(e,e.getDrawableCount(),e.getDrawableMasks(),e.getDrawableMaskCounts()));for(let t=e.getDrawableCount()-1;t>=0;t--)this._sortedDrawableIndexList[t]=0;super.initialize(e)}bindTexture(e,t){this._textures[e]=t}getBindedTextures(){return this._textures}setClippingMaskBufferSize(e){this._clippingManager.release(),this._clippingManager=new px,this._clippingManager.setClippingMaskBufferSize(e),this._clippingManager.initialize(this.getModel(),this.getModel().getDrawableCount(),this.getModel().getDrawableMasks(),this.getModel().getDrawableMaskCounts())}getClippingMaskBufferSize(){return this._clippingManager.getClippingMaskBufferSize()}release(){var e,t,n;const i=this;this._clippingManager.release(),i._clippingManager=void 0,(e=this.gl)==null||e.deleteBuffer(this._bufferData.vertex),this._bufferData.vertex=null,(t=this.gl)==null||t.deleteBuffer(this._bufferData.uv),this._bufferData.uv=null,(n=this.gl)==null||n.deleteBuffer(this._bufferData.index),this._bufferData.index=null,i._bufferData=void 0,i._textures=void 0}doDrawModel(){this.preDraw(),this._clippingManager!=null&&this._clippingManager.setupClippingContext(this.getModel(),this);const e=this.getModel().getDrawableCount(),t=this.getModel().getDrawableRenderOrders();for(let n=0;n<e;++n){const i=t[n];this._sortedDrawableIndexList[i]=n}for(let n=0;n<e;++n){const i=this._sortedDrawableIndexList[n];this.getModel().getDrawableDynamicFlagIsVisible(i)&&(this.setClippingContextBufferForDraw(this._clippingManager!=null?this._clippingManager.getClippingContextListForDraw()[i]:null),this.setIsCulling(this.getModel().getDrawableCulling(i)),this.drawMesh(this.getModel().getDrawableTextureIndices(i),this.getModel().getDrawableVertexIndexCount(i),this.getModel().getDrawableVertexCount(i),this.getModel().getDrawableVertexIndices(i),this.getModel().getDrawableVertices(i),this.getModel().getDrawableVertexUvs(i),this.getModel().getDrawableOpacity(i),this.getModel().getDrawableBlendMode(i),this.getModel().getDrawableInvertedMaskBit(i)))}}drawMesh(e,t,n,i,a,s,o,l,c){this.isCulling()?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this.gl.frontFace(this.gl.CCW);const h=this.getModelColor();this.getClippingContextBufferForMask()==null&&(h.A*=o,this.isPremultipliedAlpha()&&(h.R*=h.A,h.G*=h.A,h.B*=h.A));let d=null;this._textures[e]!=null&&(d=this._textures[e]),Pc.getInstance().setupShaderProgram(this,d,n,a,i,s,this._bufferData,o,l,h,this.isPremultipliedAlpha(),this.getMvpMatrix(),c),this.gl.drawElements(this.gl.TRIANGLES,t,this.gl.UNSIGNED_SHORT,0),this.gl.useProgram(null),this.setClippingContextBufferForDraw(null),this.setClippingContextBufferForMask(null)}static doStaticRelease(){Pc.deleteInstance()}setRenderState(e,t){c_=e,Nf=t}preDraw(){this.firstDraw&&(this.firstDraw=!1,this._anisortopy=this.gl.getExtension("EXT_texture_filter_anisotropic")||this.gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||this.gl.getExtension("MOZ_EXT_texture_filter_anisotropic")),this.gl.disable(this.gl.SCISSOR_TEST),this.gl.disable(this.gl.STENCIL_TEST),this.gl.disable(this.gl.DEPTH_TEST),this.gl.frontFace(this.gl.CW),this.gl.enable(this.gl.BLEND),this.gl.colorMask(!0,!0,!0,!0),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,null)}setClippingContextBufferForMask(e){this._clippingContextBufferForMask=e}getClippingContextBufferForMask(){return this._clippingContextBufferForMask}setClippingContextBufferForDraw(e){this._clippingContextBufferForDraw=e}getClippingContextBufferForDraw(){return this._clippingContextBufferForDraw}startUp(e){this.gl=e,this._clippingManager.setGL(e),Pc.getInstance().setGl(e)}}u3.staticRelease=()=>{CP.doStaticRelease()};class AP{constructor(e){this.groups=e.Groups,this.hitAreas=e.HitAreas,this.layout=e.Layout,this.moc=e.FileReferences.Moc,this.expressions=e.FileReferences.Expressions,this.motions=e.FileReferences.Motions,this.textures=e.FileReferences.Textures,this.physics=e.FileReferences.Physics,this.pose=e.FileReferences.Pose}getEyeBlinkParameters(){var e,t;return(t=(e=this.groups)==null?void 0:e.find(n=>n.Name==="EyeBlink"))==null?void 0:t.Ids}getLipSyncParameters(){var e,t;return(t=(e=this.groups)==null?void 0:e.find(n=>n.Name==="LipSync"))==null?void 0:t.Ids}}const wJ="ParamAngleX",SJ="ParamAngleY",EJ="ParamAngleZ",TJ="ParamEyeBallX",CJ="ParamEyeBallY",AJ="ParamBodyAngleX",MJ="ParamBreath",CA=2,AA=2;var ji;(r=>{r.LOG_LEVEL_VERBOSE=0,r.LOG_LEVEL_WARNING=1,r.LOG_LEVEL_ERROR=2,r.LOG_LEVEL_NONE=999,r.logLevel=r.LOG_LEVEL_WARNING,r.sound=!0,r.motionSync=!0,r.motionFadingDuration=500,r.idleMotionFadingDuration=2e3,r.expressionFadingDuration=500,r.preserveExpressionOnMotion=!0,r.cubism4=bd})(ji||(ji={}));const Tr={log(r,...e){ji.logLevel<=ji.LOG_LEVEL_VERBOSE&&console.log(`[${r}]`,...e)},warn(r,...e){ji.logLevel<=ji.LOG_LEVEL_WARNING&&console.warn(`[${r}]`,...e)},error(r,...e){ji.logLevel<=ji.LOG_LEVEL_ERROR&&console.error(`[${r}]`,...e)}};function MA(r,e,t){return r<e?e:r>t?t:r}function MP(r,e){e.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(n=>{n!=="constructor"&&Object.defineProperty(r.prototype,n,Object.getOwnPropertyDescriptor(t.prototype,n))})})}function RJ(r){let e=r.lastIndexOf("/");return e!=-1&&(r=r.slice(0,e)),e=r.lastIndexOf("/"),e!==-1&&(r=r.slice(e+1)),r}function OJ(r,e){const t=r.indexOf(e);t!==-1&&r.splice(t,1)}class RP extends Ks{constructor(e,t){super(),this.expressions=[],this.reserveExpressionIndex=-1,this.destroyed=!1,this.settings=e,this.tag=`ExpressionManager(${e.name})`}init(){this.defaultExpression=this.createExpression({},void 0),this.currentExpression=this.defaultExpression,this.stopAllExpressions()}loadExpression(e){return Kr(this,null,function*(){if(!this.definitions[e]){Tr.warn(this.tag,`Undefined expression at [${e}]`);return}if(this.expressions[e]===null){Tr.warn(this.tag,`Cannot set expression at [${e}] because it's already failed in loading.`);return}if(this.expressions[e])return this.expressions[e];const t=yield this._loadExpression(e);return this.expressions[e]=t,t})}_loadExpression(e){throw new Error("Not implemented.")}setRandomExpression(){return Kr(this,null,function*(){if(this.definitions.length){const e=[];for(let t=0;t<this.definitions.length;t++)this.expressions[t]!==null&&this.expressions[t]!==this.currentExpression&&t!==this.reserveExpressionIndex&&e.push(t);if(e.length){const t=Math.floor(Math.random()*e.length);return this.setExpression(t)}}return!1})}resetExpression(){this._setExpression(this.defaultExpression)}restoreExpression(){this._setExpression(this.currentExpression)}setExpression(e){return Kr(this,null,function*(){if(typeof e!="number"&&(e=this.getExpressionIndex(e)),!(e>-1&&e<this.definitions.length)||e===this.expressions.indexOf(this.currentExpression))return!1;this.reserveExpressionIndex=e;const t=yield this.loadExpression(e);return!t||this.reserveExpressionIndex!==e?!1:(this.reserveExpressionIndex=-1,this.currentExpression=t,this._setExpression(t),!0)})}update(e,t){return this.isFinished()?!1:this.updateParameters(e,t)}destroy(){this.destroyed=!0,this.emit("destroy");const e=this;e.definitions=void 0,e.expressions=void 0}}const RA=.01,DJ=40/7.5,PJ=1/(.15*1e3);class IJ{constructor(){this.targetX=0,this.targetY=0,this.x=0,this.y=0,this.vx=0,this.vy=0}focus(e,t,n=!1){this.targetX=MA(e,-1,1),this.targetY=MA(t,-1,1),n&&(this.x=this.targetX,this.y=this.targetY)}update(e){const t=this.targetX-this.x,n=this.targetY-this.y;if(Math.abs(t)<RA&&Math.abs(n)<RA)return;const i=Math.sqrt(jl(t,2)+jl(n,2)),a=DJ/(1e3/e);let s=a*(t/i)-this.vx,o=a*(n/i)-this.vy;const l=Math.sqrt(jl(s,2)+jl(o,2)),c=a*PJ*e;l>c&&(s*=c/l,o*=c/l),this.vx+=s,this.vy+=o;const h=Math.sqrt(jl(this.vx,2)+jl(this.vy,2)),d=.5*(Math.sqrt(jl(c,2)+8*c*i)-c);h>d&&(this.vx*=d/h,this.vy*=d/h),this.x+=this.vx,this.y+=this.vy}}class g3{constructor(e){this.json=e;let t=e.url;if(typeof t!="string")throw new TypeError("The `url` field in settings JSON must be defined as a string.");this.url=t,this.name=RJ(this.url)}resolveURL(e){return es.resolve(this.url,e)}replaceFiles(e){this.moc=e(this.moc,"moc"),this.pose!==void 0&&(this.pose=e(this.pose,"pose")),this.physics!==void 0&&(this.physics=e(this.physics,"physics"));for(let t=0;t<this.textures.length;t++)this.textures[t]=e(this.textures[t],`textures[${t}]`)}getDefinedFiles(){const e=[];return this.replaceFiles(t=>(e.push(t),t)),e}validateFiles(e){const t=(a,s)=>{const o=this.resolveURL(a);if(!e.includes(o)){if(s)throw new Error(`File "${a}" is defined in settings, but doesn't exist in given files`);return!1}return!0};return[this.moc,...this.textures].forEach(a=>t(a,!0)),this.getDefinedFiles().filter(a=>t(a,!1))}}var h_=(r=>(r[r.NONE=0]="NONE",r[r.IDLE=1]="IDLE",r[r.NORMAL=2]="NORMAL",r[r.FORCE=3]="FORCE",r))(h_||{});class NJ{constructor(){this.debug=!1,this.currentPriority=0,this.reservePriority=0}reserve(e,t,n){if(n<=0)return Tr.log(this.tag,"Cannot start a motion with MotionPriority.NONE."),!1;if(e===this.currentGroup&&t===this.currentIndex)return Tr.log(this.tag,"Motion is already playing.",this.dump(e,t)),!1;if(e===this.reservedGroup&&t===this.reservedIndex||e===this.reservedIdleGroup&&t===this.reservedIdleIndex)return Tr.log(this.tag,"Motion is already reserved.",this.dump(e,t)),!1;if(n===1){if(this.currentPriority!==0)return Tr.log(this.tag,"Cannot start idle motion because another motion is playing.",this.dump(e,t)),!1;if(this.reservedIdleGroup!==void 0)return Tr.log(this.tag,"Cannot start idle motion because another idle motion has reserved.",this.dump(e,t)),!1;this.setReservedIdle(e,t)}else{if(n<3){if(n<=this.currentPriority)return Tr.log(this.tag,"Cannot start motion because another motion is playing as an equivalent or higher priority.",this.dump(e,t)),!1;if(n<=this.reservePriority)return Tr.log(this.tag,"Cannot start motion because another motion has reserved as an equivalent or higher priority.",this.dump(e,t)),!1}this.setReserved(e,t,n)}return!0}start(e,t,n,i){if(i===1){if(this.setReservedIdle(void 0,void 0),this.currentPriority!==0)return Tr.log(this.tag,"Cannot start idle motion because another motion is playing.",this.dump(t,n)),!1}else{if(t!==this.reservedGroup||n!==this.reservedIndex)return Tr.log(this.tag,"Cannot start motion because another motion has taken the place.",this.dump(t,n)),!1;this.setReserved(void 0,void 0,0)}return e?(this.setCurrent(t,n,i),!0):!1}complete(){this.setCurrent(void 0,void 0,0)}setCurrent(e,t,n){this.currentPriority=n,this.currentGroup=e,this.currentIndex=t}setReserved(e,t,n){this.reservePriority=n,this.reservedGroup=e,this.reservedIndex=t}setReservedIdle(e,t){this.reservedIdleGroup=e,this.reservedIdleIndex=t}isActive(e,t){return e===this.currentGroup&&t===this.currentIndex||e===this.reservedGroup&&t===this.reservedIndex||e===this.reservedIdleGroup&&t===this.reservedIdleIndex}reset(){this.setCurrent(void 0,void 0,0),this.setReserved(void 0,void 0,0),this.setReservedIdle(void 0,void 0)}shouldRequestIdleMotion(){return this.currentGroup===void 0&&this.reservedIdleGroup===void 0}shouldOverrideExpression(){return!ji.preserveExpressionOnMotion&&this.currentPriority>1}dump(e,t){if(this.debug){const n=["currentPriority","reservePriority","currentGroup","currentIndex","reservedGroup","reservedIndex","reservedIdleGroup","reservedIdleIndex"];return`
  1688. <Requested> group = "${e}", index = ${t}
  1689. `+n.map(i=>"["+i+"] "+this[i]).join(`
  1690. `)}return""}}const LJ="SoundManager",kJ=.5;class au{static get volume(){return this._volume}static set volume(e){this._volume=(e>1?1:e<0?0:e)||0,this.audios.forEach(t=>t.volume=this._volume)}static add(e,t,n){const i=new Audio(e);return i.volume=this._volume,i.preload="auto",i.addEventListener("ended",()=>{this.dispose(i),t==null||t()}),i.addEventListener("error",a=>{this.dispose(i),Tr.warn(LJ,`Error occurred on "${e}"`,a.error),n==null||n(a.error)}),this.audios.push(i),i}static play(e){return new Promise((t,n)=>{var i;(i=e.play())==null||i.catch(a=>{e.dispatchEvent(new ErrorEvent("error",{error:a})),n(a)}),e.readyState===e.HAVE_ENOUGH_DATA?t():e.addEventListener("canplaythrough",t)})}static dispose(e){e.pause(),e.removeAttribute("src"),OJ(this.audios,e)}static destroy(){for(let e=this.audios.length-1;e>=0;e--)this.dispose(this.audios[e])}}au.audios=[];au._volume=kJ;class m3 extends Ks{constructor(e,t){super(),this.motionGroups={},this.state=new NJ,this.playing=!1,this.destroyed=!1,this.settings=e,this.tag=`MotionManager(${e.name})`,this.state.tag=this.tag}init(e){e!=null&&e.idleMotionGroup&&(this.groups.idle=e.idleMotionGroup),this.setupMotions(e),this.stopAllMotions()}setupMotions(e){for(const n of Object.keys(this.definitions))this.motionGroups[n]=[];let t;switch(e==null?void 0:e.motionPreload){case"NONE":return;case"ALL":t=Object.keys(this.definitions);break;case"IDLE":default:t=[this.groups.idle];break}for(const n of t)if(this.definitions[n])for(let i=0;i<this.definitions[n].length;i++)this.loadMotion(n,i).then()}loadMotion(e,t){return Kr(this,null,function*(){var n;if(!((n=this.definitions[e])!=null&&n[t])){Tr.warn(this.tag,`Undefined motion at "${e}"[${t}]`);return}if(this.motionGroups[e][t]===null){Tr.warn(this.tag,`Cannot start motion at "${e}"[${t}] because it's already failed in loading.`);return}if(this.motionGroups[e][t])return this.motionGroups[e][t];const i=yield this._loadMotion(e,t);if(!this.destroyed)return this.motionGroups[e][t]=i??null,i})}_loadMotion(e,t){throw new Error("Not implemented.")}startMotion(e,t){return Kr(this,arguments,function*(n,i,a=h_.NORMAL){var s;if(!this.state.reserve(n,i,a))return!1;const o=(s=this.definitions[n])==null?void 0:s[i];if(!o)return!1;this.currentAudio&&au.dispose(this.currentAudio);let l;if(ji.sound){const h=this.getSoundFile(o);if(h)try{l=au.add(this.settings.resolveURL(h),()=>this.currentAudio=void 0,()=>this.currentAudio=void 0),this.currentAudio=l}catch(d){Tr.warn(this.tag,"Failed to create audio",h,d)}}const c=yield this.loadMotion(n,i);if(l){const h=au.play(l).catch(d=>Tr.warn(this.tag,"Failed to play audio",l.src,d));ji.motionSync&&(yield h)}return this.state.start(c,n,i,a)?(Tr.log(this.tag,"Start motion:",this.getMotionName(o)),this.emit("motionStart",n,i,l),this.state.shouldOverrideExpression()&&this.expressionManager&&this.expressionManager.resetExpression(),this.playing=!0,this._startMotion(c),!0):(l&&(au.dispose(l),this.currentAudio=void 0),!1)})}startRandomMotion(e,t){return Kr(this,null,function*(){const n=this.definitions[e];if(n!=null&&n.length){const i=[];for(let a=0;a<n.length;a++)this.motionGroups[e][a]!==null&&!this.state.isActive(e,a)&&i.push(a);if(i.length){const a=Math.floor(Math.random()*i.length);return this.startMotion(e,i[a],t)}}return!1})}stopAllMotions(){this._stopAllMotions(),this.state.reset(),this.currentAudio&&(au.dispose(this.currentAudio),this.currentAudio=void 0)}update(e,t){var n;return this.isFinished()&&(this.playing&&(this.playing=!1,this.emit("motionFinish")),this.state.shouldOverrideExpression()&&((n=this.expressionManager)==null||n.restoreExpression()),this.state.complete(),this.state.shouldRequestIdleMotion()&&this.startRandomMotion(this.groups.idle,h_.IDLE)),this.updateParameters(e,t)}destroy(){var e;this.destroyed=!0,this.emit("destroy"),this.stopAllMotions(),(e=this.expressionManager)==null||e.destroy();const t=this;t.definitions=void 0,t.motionGroups=void 0}}const BJ={x:0,y:0,width:0,height:0};class FJ extends Ks{constructor(){super(...arguments),this.focusController=new IJ,this.originalWidth=0,this.originalHeight=0,this.width=0,this.height=0,this.localTransform=new qr,this.drawingMatrix=new qr,this.hitAreas={},this.textureFlipY=!1,this.viewport=[0,0,0,0],this.destroyed=!1}init(){this.setupLayout(),this.setupHitAreas()}setupLayout(){const e=this,t=this.getSize();e.originalWidth=t[0],e.originalHeight=t[1];const n=Object.assign({width:CA,height:AA},this.getLayout());this.localTransform.scale(n.width/CA,n.height/AA),e.width=this.originalWidth*this.localTransform.a,e.height=this.originalHeight*this.localTransform.d;const i=n.x!==void 0&&n.x-n.width/2||n.centerX!==void 0&&n.centerX||n.left!==void 0&&n.left-n.width/2||n.right!==void 0&&n.right+n.width/2||0,a=n.y!==void 0&&n.y-n.height/2||n.centerY!==void 0&&n.centerY||n.top!==void 0&&n.top-n.height/2||n.bottom!==void 0&&n.bottom+n.height/2||0;this.localTransform.translate(this.width*i,-this.height*a)}setupHitAreas(){const e=this.getHitAreaDefs().filter(t=>t.index>=0);for(const t of e)this.hitAreas[t.name]=t}hitTest(e,t){return Object.keys(this.hitAreas).filter(n=>this.isHit(n,e,t))}isHit(e,t,n){if(!this.hitAreas[e])return!1;const i=this.hitAreas[e].index,a=this.getDrawableBounds(i,BJ);return a.x<=t&&t<=a.x+a.width&&a.y<=n&&n<=a.y+a.height}getDrawableBounds(e,t){const n=this.getDrawableVertices(e);let i=n[0],a=n[0],s=n[1],o=n[1];for(let l=0;l<n.length;l+=2){const c=n[l],h=n[l+1];i=Math.min(c,i),a=Math.max(c,a),s=Math.min(h,s),o=Math.max(h,o)}return t??(t={}),t.x=i,t.y=s,t.width=a-i,t.height=o-s,t}updateTransform(e){this.drawingMatrix.copyFrom(e).append(this.localTransform)}update(e,t){this.focusController.update(e)}destroy(){this.destroyed=!0,this.emit("destroy"),this.motionManager.destroy(),this.motionManager=void 0}}const zJ="XHRLoader";class OA extends Error{constructor(e,t,n,i=!1){super(e),this.url=t,this.status=n,this.aborted=i}}const li=class{static createXHR(r,e,t,n,i){const a=new XMLHttpRequest;if(li.allXhrSet.add(a),r){let s=li.xhrMap.get(r);s?s.add(a):(s=new Set([a]),li.xhrMap.set(r,s)),r.listeners("destroy").includes(li.cancelXHRs)||r.once("destroy",li.cancelXHRs)}return a.open("GET",e),a.responseType=t,a.onload=()=>{(a.status===200||a.status===0)&&a.response?n(a.response):a.onerror()},a.onerror=()=>{Tr.warn(zJ,`Failed to load resource as ${a.responseType} (Status ${a.status}): ${e}`),i(new OA("Network error.",e,a.status))},a.onabort=()=>i(new OA("Aborted.",e,a.status,!0)),a.onloadend=()=>{var s;li.allXhrSet.delete(a),r&&((s=li.xhrMap.get(r))==null||s.delete(a))},a}static cancelXHRs(){var r;(r=li.xhrMap.get(this))==null||r.forEach(e=>{e.abort(),li.allXhrSet.delete(e)}),li.xhrMap.delete(this)}static release(){li.allXhrSet.forEach(r=>r.abort()),li.allXhrSet.clear(),li.xhrMap=new WeakMap}};let Dg=li;Dg.xhrMap=new WeakMap;Dg.allXhrSet=new Set;Dg.loader=(r,e)=>new Promise((t,n)=>{li.createXHR(r.target,r.settings?r.settings.resolveURL(r.url):r.url,r.type,a=>{r.result=a,t()},n).send()});function OP(r,e){let t=-1;return n(0);function n(i,a){if(a)return Promise.reject(a);if(i<=t)return Promise.reject(new Error("next() called multiple times"));t=i;const s=r[i];if(!s)return Promise.resolve();try{return Promise.resolve(s(e,n.bind(null,i+1)))}catch(o){return Promise.reject(o)}}}class il{static load(e){return OP(this.middlewares,e).then(()=>e.result)}}il.middlewares=[Dg.loader];function UJ(r,e={}){var t;const n={resourceOptions:{crossorigin:e.crossOrigin}};if(Rt.fromURL)return Rt.fromURL(r,n).catch(s=>{if(s instanceof Error)throw s;const o=new Error("Texture loading error");throw o.event=s,o});n.resourceOptions.autoLoad=!1;const i=Rt.from(r,n);if(i.baseTexture.valid)return Promise.resolve(i);const a=i.baseTexture.resource;return(t=a._live2d_load)!=null||(a._live2d_load=new Promise((s,o)=>{const l=c=>{a.source.removeEventListener("error",l);const h=new Error("Texture loading error");h.event=c,o(h)};a.source.addEventListener("error",l),a.load().then(()=>s(i)).catch(l)})),a._live2d_load}const DA="Live2DFactory",DP=(r,e)=>Kr(void 0,null,function*(){if(typeof r.source=="string"){const t=yield il.load({url:r.source,type:"json",target:r.live2dModel});t.url=r.source,r.source=t,r.live2dModel.emit("settingsJSONLoaded",t)}return e()}),PP=(r,e)=>Kr(void 0,null,function*(){if(r.source instanceof g3)return r.settings=r.source,e();if(typeof r.source=="object"){const t=rn.findRuntime(r.source);if(t){const n=t.createModelSettings(r.source);return r.settings=n,r.live2dModel.emit("settingsLoaded",n),e()}}throw new TypeError("Unknown settings format.")}),IP=(r,e)=>{if(r.settings){const t=rn.findRuntime(r.settings);if(t)return t.ready().then(e)}return e()},NP=(r,e)=>Kr(void 0,null,function*(){yield e();const t=r.internalModel;if(t){const n=r.settings,i=rn.findRuntime(n);if(i){const a=[];n.pose&&a.push(il.load({settings:n,url:n.pose,type:"json",target:t}).then(s=>{t.pose=i.createPose(t.coreModel,s),r.live2dModel.emit("poseLoaded",t.pose)}).catch(s=>{r.live2dModel.emit("poseLoadError",s),Tr.warn(DA,"Failed to load pose.",s)})),n.physics&&a.push(il.load({settings:n,url:n.physics,type:"json",target:t}).then(s=>{t.physics=i.createPhysics(t.coreModel,s),r.live2dModel.emit("physicsLoaded",t.physics)}).catch(s=>{r.live2dModel.emit("physicsLoadError",s),Tr.warn(DA,"Failed to load physics.",s)})),a.length&&(yield Promise.all(a))}}}),LP=(r,e)=>Kr(void 0,null,function*(){if(r.settings){const t=r.live2dModel,n=r.settings.textures.map(i=>{const a=r.settings.resolveURL(i);return UJ(a,{crossOrigin:r.options.crossOrigin})});if(yield e(),r.internalModel)t.internalModel=r.internalModel,t.emit("modelLoaded",r.internalModel);else throw new TypeError("Missing internal model.");t.textures=yield Promise.all(n),t.emit("textureLoaded",t.textures)}else throw new TypeError("Missing settings.")}),kP=(r,e)=>Kr(void 0,null,function*(){const t=r.settings;if(t instanceof g3){const n=rn.findRuntime(t);if(!n)throw new TypeError("Unknown model settings.");const i=yield il.load({settings:t,url:t.moc,type:"arraybuffer",target:r.live2dModel});if(!n.isValidMoc(i))throw new Error("Invalid moc data");const a=n.createCoreModel(i);return r.internalModel=n.createInternalModel(a,t,r.options),e()}throw new TypeError("Missing settings.")}),Xn=class{static registerRuntime(r){Xn.runtimes.push(r),Xn.runtimes.sort((e,t)=>t.version-e.version)}static findRuntime(r){for(const e of Xn.runtimes)if(e.test(r))return e}static setupLive2DModel(r,e,t){return Kr(this,null,function*(){const n=new Promise(s=>r.once("textureLoaded",s)),i=new Promise(s=>r.once("modelLoaded",s)),a=Promise.all([n,i]).then(()=>r.emit("ready"));yield OP(Xn.live2DModelMiddlewares,{live2dModel:r,source:e,options:t||{}}),yield a,r.emit("load")})}static loadMotion(r,e,t){var n,i;const a=s=>r.emit("motionLoadError",e,t,s);try{const s=(n=r.definitions[e])==null?void 0:n[t];if(!s)return Promise.resolve(void 0);r.listeners("destroy").includes(Xn.releaseTasks)||r.once("destroy",Xn.releaseTasks);let o=Xn.motionTasksMap.get(r);o||(o={},Xn.motionTasksMap.set(r,o));let l=o[e];l||(l=[],o[e]=l);const c=r.getMotionFile(s);return(i=l[t])!=null||(l[t]=il.load({url:c,settings:r.settings,type:r.motionDataType,target:r}).then(h=>{var d;const v=(d=Xn.motionTasksMap.get(r))==null?void 0:d[e];v&&delete v[t];const g=r.createMotion(h,e,s);return r.emit("motionLoaded",e,t,g),g}).catch(h=>{Tr.warn(r.tag,`Failed to load motion: ${c}
  1691. `,h),a(h)})),l[t]}catch(s){Tr.warn(r.tag,`Failed to load motion at "${e}"[${t}]
  1692. `,s),a(s)}return Promise.resolve(void 0)}static loadExpression(r,e){var t;const n=i=>r.emit("expressionLoadError",e,i);try{const i=r.definitions[e];if(!i)return Promise.resolve(void 0);r.listeners("destroy").includes(Xn.releaseTasks)||r.once("destroy",Xn.releaseTasks);let a=Xn.expressionTasksMap.get(r);a||(a=[],Xn.expressionTasksMap.set(r,a));const s=r.getExpressionFile(i);return(t=a[e])!=null||(a[e]=il.load({url:s,settings:r.settings,type:"json",target:r}).then(o=>{const l=Xn.expressionTasksMap.get(r);l&&delete l[e];const c=r.createExpression(o,i);return r.emit("expressionLoaded",e,c),c}).catch(o=>{Tr.warn(r.tag,`Failed to load expression: ${s}
  1693. `,o),n(o)})),a[e]}catch(i){Tr.warn(r.tag,`Failed to load expression at [${e}]
  1694. `,i),n(i)}return Promise.resolve(void 0)}static releaseTasks(){this instanceof m3?Xn.motionTasksMap.delete(this):Xn.expressionTasksMap.delete(this)}};let rn=Xn;rn.runtimes=[];rn.urlToJSON=DP;rn.jsonToSettings=PP;rn.waitUntilReady=IP;rn.setupOptionals=NP;rn.setupEssentials=LP;rn.createInternalModel=kP;rn.live2DModelMiddlewares=[DP,PP,IP,NP,LP,kP];rn.motionTasksMap=new WeakMap;rn.expressionTasksMap=new WeakMap;m3.prototype._loadMotion=function(r,e){return rn.loadMotion(this,r,e)};RP.prototype._loadExpression=function(r){return rn.loadExpression(this,r)};class GJ{constructor(){this._autoInteract=!1}get autoInteract(){return this._autoInteract}set autoInteract(e){e!==this._autoInteract&&(e?this.on("pointertap",PA,this):this.off("pointertap",PA,this),this._autoInteract=e)}registerInteraction(e){e!==this.interactionManager&&(this.unregisterInteraction(),this._autoInteract&&e&&(this.interactionManager=e,e.on("pointermove",IA,this)))}unregisterInteraction(){var e;this.interactionManager&&((e=this.interactionManager)==null||e.off("pointermove",IA,this),this.interactionManager=void 0)}}function PA(r){this.tap(r.data.global.x,r.data.global.y)}function IA(r){this.focus(r.data.global.x,r.data.global.y)}class HJ extends Tg{}const sa=new Ar,jJ=new qr;let Oo;class BP extends _a{constructor(e){super(),this.tag="Live2DModel(uninitialized)",this.textures=[],this.transform=new HJ,this.anchor=new Go(this.onAnchorChange,this,0,0),this.glContextID=-1,this.elapsedTime=performance.now(),this.deltaTime=0,this._autoUpdate=!1,this.once("modelLoaded",()=>this.init(e))}static from(e,t){const n=new this(t);return rn.setupLive2DModel(n,e,t).then(()=>n)}static fromSync(e,t){const n=new this(t);return rn.setupLive2DModel(n,e,t).then(t==null?void 0:t.onLoad).catch(t==null?void 0:t.onError),n}static registerTicker(e){Oo=e}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){var t;Oo||(Oo=(t=window.PIXI)==null?void 0:t.Ticker),e?this._destroyed||(Oo?(Oo.shared.add(this.onTickerUpdate,this),this._autoUpdate=!0):Tr.warn(this.tag,"No Ticker registered, please call Live2DModel.registerTicker(Ticker).")):(Oo==null||Oo.shared.remove(this.onTickerUpdate,this),this._autoUpdate=!1)}init(e){this.tag=`Live2DModel(${this.internalModel.settings.name})`;const t=Object.assign({autoUpdate:!0,autoInteract:!0},e);t.autoInteract&&(this.interactive=!0),this.autoInteract=t.autoInteract,this.autoUpdate=t.autoUpdate}onAnchorChange(){this.pivot.set(this.anchor.x*this.internalModel.width,this.anchor.y*this.internalModel.height)}motion(e,t,n){return t===void 0?this.internalModel.motionManager.startRandomMotion(e,n):this.internalModel.motionManager.startMotion(e,t,n)}expression(e){return this.internalModel.motionManager.expressionManager?e===void 0?this.internalModel.motionManager.expressionManager.setRandomExpression():this.internalModel.motionManager.expressionManager.setExpression(e):Promise.resolve(!1)}focus(e,t,n=!1){sa.x=e,sa.y=t,this.toModelPosition(sa,sa,!0);let i=sa.x/this.internalModel.originalWidth*2-1,a=sa.y/this.internalModel.originalHeight*2-1,s=Math.atan2(a,i);this.internalModel.focusController.focus(Math.cos(s),-Math.sin(s),n)}tap(e,t){const n=this.hitTest(e,t);n.length&&(Tr.log(this.tag,"Hit",n),this.emit("hit",n))}hitTest(e,t){return sa.x=e,sa.y=t,this.toModelPosition(sa,sa),this.internalModel.hitTest(sa.x,sa.y)}toModelPosition(e,t=e.clone(),n){return n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.transform.worldTransform.applyInverse(e,t),this.internalModel.localTransform.applyInverse(t,t),t}containsPoint(e){return this.getBounds(!0).contains(e.x,e.y)}_calculateBounds(){this._bounds.addFrame(this.transform,0,0,this.internalModel.width,this.internalModel.height)}onTickerUpdate(){this.update(Oo.shared.deltaMS)}update(e){this.deltaTime+=e,this.elapsedTime+=e}_render(e){this.registerInteraction(e.plugins.interaction),e.batch.reset(),e.geometry.reset(),e.shader.reset(),e.state.reset();let t=!1;this.glContextID!==e.CONTEXT_UID&&(this.glContextID=e.CONTEXT_UID,this.internalModel.updateWebGLContext(e.gl,this.glContextID),t=!0);for(let a=0;a<this.textures.length;a++){const s=this.textures[a];s.valid&&((t||!s.baseTexture._glTextures[this.glContextID])&&(e.gl.pixelStorei(WebGLRenderingContext.UNPACK_FLIP_Y_WEBGL,this.internalModel.textureFlipY),e.texture.bind(s.baseTexture,0)),this.internalModel.bindTexture(a,s.baseTexture._glTextures[this.glContextID].texture),s.baseTexture.touched=e.textureGC.count)}const n=e.framebuffer.viewport;this.internalModel.viewport=[n.x,n.y,n.width,n.height],this.deltaTime&&(this.internalModel.update(this.deltaTime,this.elapsedTime),this.deltaTime=0);const i=jJ.copyFrom(e.globalUniforms.uniforms.projectionMatrix).append(this.worldTransform);this.internalModel.updateTransform(i),this.internalModel.draw(e.gl),e.state.reset(),e.texture.reset()}destroy(e){this.emit("destroy"),this.autoUpdate=!1,this.unregisterInteraction(),e!=null&&e.texture&&this.textures.forEach(t=>t.destroy(e.baseTexture)),this.internalModel.destroy(),super.destroy(e)}}MP(BP,[GJ]);const $a=class{static resolveURL(r,e){var t;const n=(t=$a.filesMap[r])==null?void 0:t[e];if(n===void 0)throw new Error("Cannot find this file from uploaded files: "+e);return n}static upload(r,e){return Kr(this,null,function*(){const t={};for(const n of e.getDefinedFiles()){const i=decodeURI(es.resolve(e.url,n)),a=r.find(s=>s.webkitRelativePath===i);a&&(t[n]=URL.createObjectURL(a))}$a.filesMap[e._objectURL]=t})}static createSettings(r){return Kr(this,null,function*(){const e=r.find(s=>s.name.endsWith("model.json")||s.name.endsWith("model3.json"));if(!e)throw new TypeError("Settings file not found");const t=yield $a.readText(e),n=JSON.parse(t);n.url=e.webkitRelativePath;const i=rn.findRuntime(n);if(!i)throw new Error("Unknown settings JSON");const a=i.createModelSettings(n);return a._objectURL=URL.createObjectURL(e),a})}static readText(r){return Kr(this,null,function*(){return new Promise((e,t)=>{const n=new FileReader;n.onload=()=>e(n.result),n.onerror=t,n.readAsText(r,"utf8")})})}};let y3=$a;y3.filesMap={};y3.factory=(r,e)=>Kr(void 0,null,function*(){if(Array.isArray(r.source)&&r.source[0]instanceof File){const t=r.source;let n=t.settings;if(!n)n=yield $a.createSettings(t);else if(!n._objectURL)throw new Error('"_objectURL" must be specified in ModelSettings');n.validateFiles(t.map(i=>encodeURI(i.webkitRelativePath))),yield $a.upload(t,n),n.resolveURL=function(i){return $a.resolveURL(this._objectURL,i)},r.source=n,r.live2dModel.once("modelLoaded",i=>{i.once("destroy",function(){const a=this.settings._objectURL;if(URL.revokeObjectURL(a),$a.filesMap[a])for(const s of Object.values($a.filesMap[a]))URL.revokeObjectURL(s);delete $a.filesMap[a]})})}return e()});rn.live2DModelMiddlewares.unshift(y3.factory);const Ei=class{static unzip(r,e){return Kr(this,null,function*(){const t=yield Ei.getFilePaths(r),n=[];for(const a of e.getDefinedFiles()){const s=decodeURI(es.resolve(e.url,a));t.includes(s)&&n.push(s)}const i=yield Ei.getFiles(r,n);for(let a=0;a<i.length;a++){const s=n[a],o=i[a];Object.defineProperty(o,"webkitRelativePath",{value:s})}return i})}static createSettings(r){return Kr(this,null,function*(){const t=(yield Ei.getFilePaths(r)).find(s=>s.endsWith("model.json")||s.endsWith("model3.json"));if(!t)throw new Error("Settings file not found");const n=yield Ei.readText(r,t);if(!n)throw new Error("Empty settings file: "+t);const i=JSON.parse(n);i.url=t;const a=rn.findRuntime(i);if(!a)throw new Error("Unknown settings JSON");return a.createModelSettings(i)})}static zipReader(r,e){return Kr(this,null,function*(){throw new Error("Not implemented")})}static getFilePaths(r){return Kr(this,null,function*(){throw new Error("Not implemented")})}static getFiles(r,e){return Kr(this,null,function*(){throw new Error("Not implemented")})}static readText(r,e){return Kr(this,null,function*(){throw new Error("Not implemented")})}static releaseReader(r){}};let Pg=Ei;Pg.ZIP_PROTOCOL="zip://";Pg.uid=0;Pg.factory=(r,e)=>Kr(void 0,null,function*(){const t=r.source;let n,i,a;if(typeof t=="string"&&(t.endsWith(".zip")||t.startsWith(Ei.ZIP_PROTOCOL))?(t.startsWith(Ei.ZIP_PROTOCOL)?n=t.slice(Ei.ZIP_PROTOCOL.length):n=t,i=yield il.load({url:n,type:"blob",target:r.live2dModel})):Array.isArray(t)&&t.length===1&&t[0]instanceof File&&t[0].name.endsWith(".zip")&&(i=t[0],n=URL.createObjectURL(i),a=t.settings),i){if(!i.size)throw new Error("Empty zip file");const s=yield Ei.zipReader(i,n);a||(a=yield Ei.createSettings(s)),a._objectURL=Ei.ZIP_PROTOCOL+Ei.uid+"/"+a.url;const o=yield Ei.unzip(s,a);o.settings=a,r.source=o,n.startsWith("blob:")&&r.live2dModel.once("modelLoaded",l=>{l.once("destroy",function(){URL.revokeObjectURL(n)})}),Ei.releaseReader(s)}return e()});rn.live2DModelMiddlewares.unshift(Pg.factory);if(!window.Live2DCubismCore)throw new Error("Could not find Cubism 4 runtime. This plugin requires live2dcubismcore.js to be loaded.");class VJ extends RP{constructor(e,t){var n;super(e,t),this.queueManager=new EP,this.definitions=(n=e.expressions)!=null?n:[],this.init()}isFinished(){return this.queueManager.isFinished()}getExpressionIndex(e){return this.definitions.findIndex(t=>t.Name===e)}getExpressionFile(e){return e.File}createExpression(e,t){return h3.create(e)}_setExpression(e){return this.queueManager.startMotion(e,!1,performance.now())}stopAllExpressions(){this.queueManager.stopAllMotions()}updateParameters(e,t){return this.queueManager.doUpdateMotion(e,t)}}class Ic extends g3{constructor(e){if(super(e),!Ic.isValidJSON(e))throw new TypeError("Invalid JSON.");Object.assign(this,new AP(e))}static isValidJSON(e){var t;return!!(e!=null&&e.FileReferences)&&typeof e.FileReferences.Moc=="string"&&((t=e.FileReferences.Textures)==null?void 0:t.length)>0&&e.FileReferences.Textures.every(n=>typeof n=="string")}replaceFiles(e){if(super.replaceFiles(e),this.motions)for(const[t,n]of Object.entries(this.motions))for(let i=0;i<n.length;i++)n[i].File=e(n[i].File,`motions.${t}[${i}].File`),n[i].Sound!==void 0&&(n[i].Sound=e(n[i].Sound,`motions.${t}[${i}].Sound`));if(this.expressions)for(let t=0;t<this.expressions.length;t++)this.expressions[t].File=e(this.expressions[t].File,`expressions[${t}].File`)}}MP(Ic,[AP]);class qJ extends m3{constructor(e,t){var n;super(e,t),this.groups={idle:"Idle"},this.motionDataType="json",this.queueManager=new EP,this.definitions=(n=e.motions)!=null?n:{},this.eyeBlinkIds=e.getEyeBlinkParameters()||[],this.lipSyncIds=e.getLipSyncParameters()||[],this.init(t)}init(e){super.init(e),this.settings.expressions&&(this.expressionManager=new VJ(this.settings,e)),this.queueManager.setEventCallback((t,n,i)=>{this.emit("motion:"+n)})}isFinished(){return this.queueManager.isFinished()}_startMotion(e,t){return e.setFinishedMotionHandler(t),this.queueManager.stopAllMotions(),this.queueManager.startMotion(e,!1,performance.now())}_stopAllMotions(){this.queueManager.stopAllMotions()}createMotion(e,t,n){const i=d3.create(e),a=new SP(e),s=(t===this.groups.idle?ji.idleMotionFadingDuration:ji.motionFadingDuration)/1e3;return a.getMotionFadeInTime()===void 0&&i.setFadeInTime(n.FadeInTime>0?n.FadeInTime:s),a.getMotionFadeOutTime()===void 0&&i.setFadeOutTime(n.FadeOutTime>0?n.FadeOutTime:s),i.setEffectIds(this.eyeBlinkIds,this.lipSyncIds),i}getMotionFile(e){return e.File}getMotionName(e){return e.File}getSoundFile(e){return e.Sound}updateParameters(e,t){return this.queueManager.doUpdateMotion(e,t)}destroy(){super.destroy(),this.queueManager.release(),this.queueManager=void 0}}const NA=new ma;class XJ extends FJ{constructor(e,t,n){super(),this.lipSync=!0,this.breath=o3.create(),this.renderer=new CP,this.idParamAngleX=wJ,this.idParamAngleY=SJ,this.idParamAngleZ=EJ,this.idParamEyeBallX=TJ,this.idParamEyeBallY=CJ,this.idParamBodyAngleX=AJ,this.idParamBreath=MJ,this.pixelsPerUnit=1,this.centeringTransform=new qr,this.coreModel=e,this.settings=t,this.motionManager=new qJ(t,n),this.init()}init(){var e;super.init(),((e=this.settings.getEyeBlinkParameters())==null?void 0:e.length)>0&&(this.eyeBlink=_P.create(this.settings)),this.breath.setParameters([new _f(this.idParamAngleX,0,15,6.5345,.5),new _f(this.idParamAngleY,0,8,3.5345,.5),new _f(this.idParamAngleZ,0,10,5.5345,.5),new _f(this.idParamBodyAngleX,0,4,15.5345,.5),new _f(this.idParamBreath,0,.5,3.2345,.5)]),this.renderer.initialize(this.coreModel),this.renderer.setIsPremultipliedAlpha(!0)}getSize(){return[this.coreModel.getModel().canvasinfo.CanvasWidth,this.coreModel.getModel().canvasinfo.CanvasHeight]}getLayout(){const e={};if(this.settings.layout)for(const t of Object.keys(this.settings.layout)){const n=t.charAt(0).toLowerCase()+t.slice(1);e[n]=this.settings.layout[t]}return e}setupLayout(){super.setupLayout(),this.pixelsPerUnit=this.coreModel.getModel().canvasinfo.PixelsPerUnit,this.centeringTransform.scale(this.pixelsPerUnit,this.pixelsPerUnit).translate(this.originalWidth/2,this.originalHeight/2)}updateWebGLContext(e,t){this.renderer.firstDraw=!0,this.renderer._bufferData={vertex:null,uv:null,index:null},this.renderer.startUp(e),this.renderer._clippingManager._currentFrameNo=t,this.renderer._clippingManager._maskTexture=void 0,Pc.getInstance()._shaderSets=[]}bindTexture(e,t){this.renderer.bindTexture(e,t)}getHitAreaDefs(){var e,t;return(t=(e=this.settings.hitAreas)==null?void 0:e.map(n=>({id:n.Id,name:n.Name,index:this.coreModel.getDrawableIndex(n.Id)})))!=null?t:[]}getDrawableIDs(){return this.coreModel.getDrawableIds()}getDrawableIndex(e){return this.coreModel.getDrawableIndex(e)}getDrawableVertices(e){if(typeof e=="string"&&(e=this.coreModel.getDrawableIndex(e),e===-1))throw new TypeError("Unable to find drawable ID: "+e);const t=this.coreModel.getDrawableVertices(e).slice();for(let n=0;n<t.length;n+=2)t[n]=t[n]*this.pixelsPerUnit+this.originalWidth/2,t[n+1]=-t[n+1]*this.pixelsPerUnit+this.originalHeight/2;return t}updateTransform(e){this.drawingMatrix.copyFrom(this.centeringTransform).prepend(this.localTransform).prepend(e)}update(e,t){var n,i,a,s;super.update(e,t),e/=1e3,t/=1e3;const o=this.coreModel;this.emit("beforeMotionUpdate");const l=this.motionManager.update(this.coreModel,t);this.emit("afterMotionUpdate"),o.saveParameters(),(n=this.motionManager.expressionManager)==null||n.update(o,t),l||(i=this.eyeBlink)==null||i.updateParameters(o,e),this.updateFocus(),this.updateNaturalMovements(e*1e3,t*1e3),(a=this.physics)==null||a.evaluate(o,e),(s=this.pose)==null||s.updateParameters(o,e),this.emit("beforeModelUpdate"),o.update(),o.loadParameters()}updateFocus(){this.coreModel.addParameterValueById(this.idParamEyeBallX,this.focusController.x),this.coreModel.addParameterValueById(this.idParamEyeBallY,this.focusController.y),this.coreModel.addParameterValueById(this.idParamAngleX,this.focusController.x*30),this.coreModel.addParameterValueById(this.idParamAngleY,this.focusController.y*30),this.coreModel.addParameterValueById(this.idParamAngleZ,this.focusController.x*this.focusController.y*-30),this.coreModel.addParameterValueById(this.idParamBodyAngleX,this.focusController.x*10)}updateNaturalMovements(e,t){var n;(n=this.breath)==null||n.updateParameters(this.coreModel,e/1e3)}draw(e){const t=this.drawingMatrix,n=NA.getArray();n[0]=t.a,n[1]=t.b,n[4]=-t.c,n[5]=-t.d,n[12]=t.tx,n[13]=t.ty,this.renderer.setMvpMatrix(NA),this.renderer.setRenderState(e.getParameter(e.FRAMEBUFFER_BINDING),this.viewport),this.renderer.drawModel()}destroy(){super.destroy(),this.renderer.release(),this.coreModel.release(),this.renderer=void 0,this.coreModel=void 0}}let Uv,LA=20;function YJ(){return yd.isStarted()?Promise.resolve():(Uv??(Uv=new Promise((r,e)=>{function t(){try{WJ(),r()}catch(n){if(LA--,LA<0){const i=new Error("Failed to start up Cubism 4 framework.");i.cause=n,e(i);return}Tr.log("Cubism4","Startup failed, retrying 10ms later..."),setTimeout(t,10)}}t()})),Uv)}function WJ(r){r=Object.assign({logFunction:console.log,loggingLevel:Su.LogLevel_Verbose},r),yd.startUp(r),yd.initialize()}rn.registerRuntime({version:4,ready:YJ,test(r){return r instanceof Ic||Ic.isValidJSON(r)},isValidMoc(r){if(r.byteLength<4)return!1;const e=new Int8Array(r,0,4);return String.fromCharCode(...e)==="MOC3"},createModelSettings(r){return new Ic(r)},createCoreModel(r){const e=c3.create(r);try{const t=e.createModel();return t.__moc=e,t}catch(t){try{e.release()}catch{}throw t}},createInternalModel(r,e,t){const n=new XJ(r,e,t),i=r;return i.__moc&&(n.__moc=i.__moc,delete i.__moc,n.once("destroy",$J)),n},createPhysics(r,e){return v3.create(e)},createPose(r,e){return l3.create(e)}});function $J(){var r;(r=this.__moc)==null||r.release()}function kA(r){const e=[],t=String(r||"");let n=t.indexOf(","),i=0,a=!1;for(;!a;){n===-1&&(n=t.length,a=!0);const s=t.slice(i,n).trim();(s||!a)&&e.push(s),i=n+1,n=t.indexOf(",",i)}return e}function KJ(r,e){const t={};return(r[r.length-1]===""?[...r,""]:r).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const ZJ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,QJ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JJ={};function BA(r,e){return(JJ.jsx?QJ:ZJ).test(r)}const eee=/[ \t\n\f\r]/g;function tee(r){return typeof r=="object"?r.type==="text"?FA(r.value):!1:FA(r)}function FA(r){return r.replace(eee,"")===""}class Fd{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}Fd.prototype.normal={};Fd.prototype.property={};Fd.prototype.space=void 0;function FP(r,e){const t={},n={};for(const i of r)Object.assign(t,i.property),Object.assign(n,i.normal);return new Fd(t,n,e)}function xd(r){return r.toLowerCase()}class Pi{constructor(e,t){this.attribute=t,this.property=e}}Pi.prototype.attribute="";Pi.prototype.booleanish=!1;Pi.prototype.boolean=!1;Pi.prototype.commaOrSpaceSeparated=!1;Pi.prototype.commaSeparated=!1;Pi.prototype.defined=!1;Pi.prototype.mustUseProperty=!1;Pi.prototype.number=!1;Pi.prototype.overloadedBoolean=!1;Pi.prototype.property="";Pi.prototype.spaceSeparated=!1;Pi.prototype.space=void 0;let ree=0;const Bt=Eu(),bn=Eu(),f_=Eu(),Je=Eu(),Or=Eu(),Nc=Eu(),Hi=Eu();function Eu(){return 2**++ree}const d_=Object.freeze(Object.defineProperty({__proto__:null,boolean:Bt,booleanish:bn,commaOrSpaceSeparated:Hi,commaSeparated:Nc,number:Je,overloadedBoolean:f_,spaceSeparated:Or},Symbol.toStringTag,{value:"Module"})),gx=Object.keys(d_);class b3 extends Pi{constructor(e,t,n,i){let a=-1;if(super(e,t),zA(this,"space",i),typeof n=="number")for(;++a<gx.length;){const s=gx[a];zA(this,gx[a],(n&d_[s])===d_[s])}}}b3.prototype.defined=!0;function zA(r,e,t){t&&(r[e]=t)}function uh(r){const e={},t={};for(const[n,i]of Object.entries(r.properties)){const a=new b3(n,r.transform(r.attributes||{},n),i,r.space);r.mustUseProperty&&r.mustUseProperty.includes(n)&&(a.mustUseProperty=!0),e[n]=a,t[xd(n)]=n,t[xd(a.attribute)]=n}return new Fd(e,t,r.space)}const zP=uh({properties:{ariaActiveDescendant:null,ariaAtomic:bn,ariaAutoComplete:null,ariaBusy:bn,ariaChecked:bn,ariaColCount:Je,ariaColIndex:Je,ariaColSpan:Je,ariaControls:Or,ariaCurrent:null,ariaDescribedBy:Or,ariaDetails:null,ariaDisabled:bn,ariaDropEffect:Or,ariaErrorMessage:null,ariaExpanded:bn,ariaFlowTo:Or,ariaGrabbed:bn,ariaHasPopup:null,ariaHidden:bn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Or,ariaLevel:Je,ariaLive:null,ariaModal:bn,ariaMultiLine:bn,ariaMultiSelectable:bn,ariaOrientation:null,ariaOwns:Or,ariaPlaceholder:null,ariaPosInSet:Je,ariaPressed:bn,ariaReadOnly:bn,ariaRelevant:null,ariaRequired:bn,ariaRoleDescription:Or,ariaRowCount:Je,ariaRowIndex:Je,ariaRowSpan:Je,ariaSelected:bn,ariaSetSize:Je,ariaSort:null,ariaValueMax:Je,ariaValueMin:Je,ariaValueNow:Je,ariaValueText:null,role:null},transform(r,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function UP(r,e){return e in r?r[e]:e}function GP(r,e){return UP(r,e.toLowerCase())}const nee=uh({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Nc,acceptCharset:Or,accessKey:Or,action:null,allow:null,allowFullScreen:Bt,allowPaymentRequest:Bt,allowUserMedia:Bt,alt:null,as:null,async:Bt,autoCapitalize:null,autoComplete:Or,autoFocus:Bt,autoPlay:Bt,blocking:Or,capture:null,charSet:null,checked:Bt,cite:null,className:Or,cols:Je,colSpan:null,content:null,contentEditable:bn,controls:Bt,controlsList:Or,coords:Je|Nc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Bt,defer:Bt,dir:null,dirName:null,disabled:Bt,download:f_,draggable:bn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Bt,formTarget:null,headers:Or,height:Je,hidden:f_,high:Je,href:null,hrefLang:null,htmlFor:Or,httpEquiv:Or,id:null,imageSizes:null,imageSrcSet:null,inert:Bt,inputMode:null,integrity:null,is:null,isMap:Bt,itemId:null,itemProp:Or,itemRef:Or,itemScope:Bt,itemType:Or,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Bt,low:Je,manifest:null,max:null,maxLength:Je,media:null,method:null,min:null,minLength:Je,multiple:Bt,muted:Bt,name:null,nonce:null,noModule:Bt,noValidate:Bt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Bt,optimum:Je,pattern:null,ping:Or,placeholder:null,playsInline:Bt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Bt,referrerPolicy:null,rel:Or,required:Bt,reversed:Bt,rows:Je,rowSpan:Je,sandbox:Or,scope:null,scoped:Bt,seamless:Bt,selected:Bt,shadowRootClonable:Bt,shadowRootDelegatesFocus:Bt,shadowRootMode:null,shape:null,size:Je,sizes:null,slot:null,span:Je,spellCheck:bn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Je,step:null,style:null,tabIndex:Je,target:null,title:null,translate:null,type:null,typeMustMatch:Bt,useMap:null,value:bn,width:Je,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Or,axis:null,background:null,bgColor:null,border:Je,borderColor:null,bottomMargin:Je,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Bt,declare:Bt,event:null,face:null,frame:null,frameBorder:null,hSpace:Je,leftMargin:Je,link:null,longDesc:null,lowSrc:null,marginHeight:Je,marginWidth:Je,noResize:Bt,noHref:Bt,noShade:Bt,noWrap:Bt,object:null,profile:null,prompt:null,rev:null,rightMargin:Je,rules:null,scheme:null,scrolling:bn,standby:null,summary:null,text:null,topMargin:Je,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Je,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Bt,disableRemotePlayback:Bt,prefix:null,property:null,results:Je,security:null,unselectable:null},space:"html",transform:GP}),iee=uh({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Hi,accentHeight:Je,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Je,amplitude:Je,arabicForm:null,ascent:Je,attributeName:null,attributeType:null,azimuth:Je,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Je,by:null,calcMode:null,capHeight:Je,className:Or,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Je,diffuseConstant:Je,direction:null,display:null,dur:null,divisor:Je,dominantBaseline:null,download:Bt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Je,enableBackground:null,end:null,event:null,exponent:Je,externalResourcesRequired:null,fill:null,fillOpacity:Je,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Nc,g2:Nc,glyphName:Nc,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Je,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Je,horizOriginX:Je,horizOriginY:Je,id:null,ideographic:Je,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Je,k:Je,k1:Je,k2:Je,k3:Je,k4:Je,kernelMatrix:Hi,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Je,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Je,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Je,overlineThickness:Je,paintOrder:null,panose1:null,path:null,pathLength:Je,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Or,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Je,pointsAtY:Je,pointsAtZ:Je,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Hi,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Hi,rev:Hi,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Hi,requiredFeatures:Hi,requiredFonts:Hi,requiredFormats:Hi,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Je,specularExponent:Je,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Je,strikethroughThickness:Je,string:null,stroke:null,strokeDashArray:Hi,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Je,strokeOpacity:Je,strokeWidth:null,style:null,surfaceScale:Je,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Hi,tabIndex:Je,tableValues:null,target:null,targetX:Je,targetY:Je,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Hi,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Je,underlineThickness:Je,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Je,values:null,vAlphabetic:Je,vMathematical:Je,vectorEffect:null,vHanging:Je,vIdeographic:Je,version:null,vertAdvY:Je,vertOriginX:Je,vertOriginY:Je,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Je,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:UP}),HP=uh({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(r,e){return"xlink:"+e.slice(5).toLowerCase()}}),jP=uh({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:GP}),VP=uh({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(r,e){return"xml:"+e.slice(3).toLowerCase()}}),aee={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},see=/[A-Z]/g,UA=/-[a-z]/g,oee=/^data[-\w.:]+$/i;function qP(r,e){const t=xd(e);let n=e,i=Pi;if(t in r.normal)return r.property[r.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&oee.test(e)){if(e.charAt(4)==="-"){const a=e.slice(5).replace(UA,uee);n="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=e.slice(4);if(!UA.test(a)){let s=a.replace(see,lee);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}i=b3}return new i(n,e)}function lee(r){return"-"+r.toLowerCase()}function uee(r){return r.charAt(1).toUpperCase()}const XP=FP([zP,nee,HP,jP,VP],"html"),Ig=FP([zP,iee,HP,jP,VP],"svg");function GA(r){const e=String(r||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function cee(r){return r.join(" ").trim()}var bc={},mx,HA;function hee(){if(HA)return mx;HA=1;var r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,t=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,o=/^\s+|\s+$/g,l=`
  1695. `,c="/",h="*",d="",v="comment",g="declaration";function m(y,_){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];_=_||{};var w=1,S=1;function A(X){var W=X.match(e);W&&(w+=W.length);var P=X.lastIndexOf(l);S=~P?X.length-P:S+X.length}function C(){var X={line:w,column:S};return function(W){return W.position=new M(X),D(),W}}function M(X){this.start=X,this.end={line:w,column:S},this.source=_.source}M.prototype.content=y;function E(X){var W=new Error(_.source+":"+w+":"+S+": "+X);if(W.reason=X,W.filename=_.source,W.line=w,W.column=S,W.source=y,!_.silent)throw W}function O(X){var W=X.exec(y);if(W){var P=W[0];return A(P),y=y.slice(P.length),W}}function D(){O(t)}function I(X){var W;for(X=X||[];W=k();)W!==!1&&X.push(W);return X}function k(){var X=C();if(!(c!=y.charAt(0)||h!=y.charAt(1))){for(var W=2;d!=y.charAt(W)&&(h!=y.charAt(W)||c!=y.charAt(W+1));)++W;if(W+=2,d===y.charAt(W-1))return E("End of comment missing");var P=y.slice(2,W-2);return S+=2,A(P),y=y.slice(W),S+=2,X({type:v,comment:P})}}function U(){var X=C(),W=O(n);if(W){if(k(),!O(i))return E("property missing ':'");var P=O(a),H=X({type:g,property:x(W[0].replace(r,d)),value:P?x(P[0].replace(r,d)):d});return O(s),H}}function V(){var X=[];I(X);for(var W;W=U();)W!==!1&&(X.push(W),I(X));return X}return D(),V()}function x(y){return y?y.replace(o,d):d}return mx=m,mx}var jA;function fee(){if(jA)return bc;jA=1;var r=bc&&bc.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(bc,"__esModule",{value:!0}),bc.default=t;const e=r(hee());function t(n,i){let a=null;if(!n||typeof n!="string")return a;const s=(0,e.default)(n),o=typeof i=="function";return s.forEach(l=>{if(l.type!=="declaration")return;const{property:c,value:h}=l;o?i(c,h,l):h&&(a=a||{},a[c]=h)}),a}return bc}var Sf={},VA;function dee(){if(VA)return Sf;VA=1,Object.defineProperty(Sf,"__esModule",{value:!0}),Sf.camelCase=void 0;var r=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,t=/^[^-]+$/,n=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(c){return!c||t.test(c)||r.test(c)},s=function(c,h){return h.toUpperCase()},o=function(c,h){return"".concat(h,"-")},l=function(c,h){return h===void 0&&(h={}),a(c)?c:(c=c.toLowerCase(),h.reactCompat?c=c.replace(i,o):c=c.replace(n,o),c.replace(e,s))};return Sf.camelCase=l,Sf}var Ef,qA;function vee(){if(qA)return Ef;qA=1;var r=Ef&&Ef.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},e=r(fee()),t=dee();function n(i,a){var s={};return!i||typeof i!="string"||(0,e.default)(i,function(o,l){o&&l&&(s[(0,t.camelCase)(o,a)]=l)}),s}return n.default=n,Ef=n,Ef}var pee=vee();const gee=cl(pee),YP=WP("end"),x3=WP("start");function WP(r){return e;function e(t){const n=t&&t.position&&t.position[r]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function mee(r){const e=x3(r),t=YP(r);if(e&&t)return{start:e,end:t}}function Hf(r){return!r||typeof r!="object"?"":"position"in r||"type"in r?XA(r.position):"start"in r||"end"in r?XA(r):"line"in r||"column"in r?v_(r):""}function v_(r){return YA(r&&r.line)+":"+YA(r&&r.column)}function XA(r){return v_(r&&r.start)+"-"+v_(r&&r.end)}function YA(r){return r&&typeof r=="number"?r:1}class ai extends Error{constructor(e,t,n){super(),typeof t=="string"&&(n=t,t=void 0);let i="",a={},s=!1;if(t&&("line"in t&&"column"in t?a={place:t}:"start"in t&&"end"in t?a={place:t}:"type"in t?a={ancestors:[t],place:t.position}:a={...t}),typeof e=="string"?i=e:!a.cause&&e&&(s=!0,i=e.message,a.cause=e),!a.ruleId&&!a.source&&typeof n=="string"){const l=n.indexOf(":");l===-1?a.ruleId=n:(a.source=n.slice(0,l),a.ruleId=n.slice(l+1))}if(!a.place&&a.ancestors&&a.ancestors){const l=a.ancestors[a.ancestors.length-1];l&&(a.place=l.position)}const o=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=Hf(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=s&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ai.prototype.file="";ai.prototype.name="";ai.prototype.reason="";ai.prototype.message="";ai.prototype.stack="";ai.prototype.column=void 0;ai.prototype.line=void 0;ai.prototype.ancestors=void 0;ai.prototype.cause=void 0;ai.prototype.fatal=void 0;ai.prototype.place=void 0;ai.prototype.ruleId=void 0;ai.prototype.source=void 0;const _3={}.hasOwnProperty,yee=new Map,bee=/[A-Z]/g,xee=new Set(["table","tbody","thead","tfoot","tr"]),_ee=new Set(["td","th"]),$P="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function wee(r,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=e.filePath||void 0;let n;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=Oee(t,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=Ree(t,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:n,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Ig:XP,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},a=KP(i,r,void 0);return a&&typeof a!="string"?a:i.create(r,i.Fragment,{children:a||void 0},void 0)}function KP(r,e,t){if(e.type==="element")return See(r,e,t);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return Eee(r,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Cee(r,e,t);if(e.type==="mdxjsEsm")return Tee(r,e);if(e.type==="root")return Aee(r,e,t);if(e.type==="text")return Mee(r,e)}function See(r,e,t){const n=r.schema;let i=n;e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(i=Ig,r.schema=i),r.ancestors.push(e);const a=QP(r,e.tagName,!1),s=Dee(r,e);let o=S3(r,e);return xee.has(e.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!tee(l):!0})),ZP(r,s,a,e),w3(s,o),r.ancestors.pop(),r.schema=n,r.create(e,a,s,t)}function Eee(r,e){if(e.data&&e.data.estree&&r.evaluater){const n=e.data.estree.body[0];return n.type,r.evaluater.evaluateExpression(n.expression)}_d(r,e.position)}function Tee(r,e){if(e.data&&e.data.estree&&r.evaluater)return r.evaluater.evaluateProgram(e.data.estree);_d(r,e.position)}function Cee(r,e,t){const n=r.schema;let i=n;e.name==="svg"&&n.space==="html"&&(i=Ig,r.schema=i),r.ancestors.push(e);const a=e.name===null?r.Fragment:QP(r,e.name,!0),s=Pee(r,e),o=S3(r,e);return ZP(r,s,a,e),w3(s,o),r.ancestors.pop(),r.schema=n,r.create(e,a,s,t)}function Aee(r,e,t){const n={};return w3(n,S3(r,e)),r.create(e,r.Fragment,n,t)}function Mee(r,e){return e.value}function ZP(r,e,t,n){typeof t!="string"&&t!==r.Fragment&&r.passNode&&(e.node=n)}function w3(r,e){if(e.length>0){const t=e.length>1?e:e[0];t&&(r.children=t)}}function Ree(r,e,t){return n;function n(i,a,s,o){const c=Array.isArray(s.children)?t:e;return o?c(a,s,o):c(a,s)}}function Oee(r,e){return t;function t(n,i,a,s){const o=Array.isArray(a.children),l=x3(n);return e(i,a,s,o,{columnNumber:l?l.column-1:void 0,fileName:r,lineNumber:l?l.line:void 0},void 0)}}function Dee(r,e){const t={};let n,i;for(i in e.properties)if(i!=="children"&&_3.call(e.properties,i)){const a=Iee(r,i,e.properties[i]);if(a){const[s,o]=a;r.tableCellAlignToStyle&&s==="align"&&typeof o=="string"&&_ee.has(e.tagName)?n=o:t[s]=o}}if(n){const a=t.style||(t.style={});a[r.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return t}function Pee(r,e){const t={};for(const n of e.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&r.evaluater){const a=n.data.estree.body[0];a.type;const s=a.expression;s.type;const o=s.properties[0];o.type,Object.assign(t,r.evaluater.evaluateExpression(o.argument))}else _d(r,e.position);else{const i=n.name;let a;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&r.evaluater){const o=n.value.data.estree.body[0];o.type,a=r.evaluater.evaluateExpression(o.expression)}else _d(r,e.position);else a=n.value===null?!0:n.value;t[i]=a}return t}function S3(r,e){const t=[];let n=-1;const i=r.passKeys?new Map:yee;for(;++n<e.children.length;){const a=e.children[n];let s;if(r.passKeys){const l=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(l){const c=i.get(l)||0;s=l+"-"+c,i.set(l,c+1)}}const o=KP(r,a,s);o!==void 0&&t.push(o)}return t}function Iee(r,e,t){const n=qP(r.schema,e);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=n.commaSeparated?KJ(t):cee(t)),n.property==="style"){let i=typeof t=="object"?t:Nee(r,String(t));return r.stylePropertyNameCase==="css"&&(i=Lee(i)),["style",i]}return[r.elementAttributeNameCase==="react"&&n.space?aee[n.property]||n.property:n.attribute,t]}}function Nee(r,e){try{return gee(e,{reactCompat:!0})}catch(t){if(r.ignoreInvalidStyle)return{};const n=t,i=new ai("Cannot parse `style` attribute",{ancestors:r.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=r.filePath||void 0,i.url=$P+"#cannot-parse-style-attribute",i}}function QP(r,e,t){let n;if(!t)n={type:"Literal",value:e};else if(e.includes(".")){const i=e.split(".");let a=-1,s;for(;++a<i.length;){const o=BA(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};s=s?{type:"MemberExpression",object:s,property:o,computed:!!(a&&o.type==="Literal"),optional:!1}:o}n=s}else n=BA(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(n.type==="Literal"){const i=n.value;return _3.call(r.components,i)?r.components[i]:i}if(r.evaluater)return r.evaluater.evaluateExpression(n);_d(r)}function _d(r,e){const t=new ai("Cannot handle MDX estrees without `createEvaluater`",{ancestors:r.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw t.file=r.filePath||void 0,t.url=$P+"#cannot-handle-mdx-estrees-without-createevaluater",t}function Lee(r){const e={};let t;for(t in r)_3.call(r,t)&&(e[kee(t)]=r[t]);return e}function kee(r){let e=r.replace(bee,Bee);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function Bee(r){return"-"+r.toLowerCase()}const yx={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Fee={};function zee(r,e){const t=Fee,n=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return JP(r,n,i)}function JP(r,e,t){if(Uee(r)){if("value"in r)return r.type==="html"&&!t?"":r.value;if(e&&"alt"in r&&r.alt)return r.alt;if("children"in r)return WA(r.children,e,t)}return Array.isArray(r)?WA(r,e,t):""}function WA(r,e,t){const n=[];let i=-1;for(;++i<r.length;)n[i]=JP(r[i],e,t);return n.join("")}function Uee(r){return!!(r&&typeof r=="object")}const $A=document.createElement("i");function E3(r){const e="&"+r+";";$A.innerHTML=e;const t=$A.textContent;return t.charCodeAt(t.length-1)===59&&r!=="semi"||t===e?!1:t}function ss(r,e,t,n){const i=r.length;let a=0,s;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,t=t>0?t:0,n.length<1e4)s=Array.from(n),s.unshift(e,t),r.splice(...s);else for(t&&r.splice(e,t);a<n.length;)s=n.slice(a,a+1e4),s.unshift(e,0),r.splice(...s),a+=1e4,e+=1e4}function da(r,e){return r.length>0?(ss(r,r.length,0,e),r):e}const KA={}.hasOwnProperty;function Gee(r){const e={};let t=-1;for(;++t<r.length;)Hee(e,r[t]);return e}function Hee(r,e){let t;for(t in e){const i=(KA.call(r,t)?r[t]:void 0)||(r[t]={}),a=e[t];let s;if(a)for(s in a){KA.call(i,s)||(i[s]=[]);const o=a[s];jee(i[s],Array.isArray(o)?o:o?[o]:[])}}}function jee(r,e){let t=-1;const n=[];for(;++t<e.length;)(e[t].add==="after"?r:n).push(e[t]);ss(r,0,0,n)}function eI(r,e){const t=Number.parseInt(r,e);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Lc(r){return r.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Qa=ml(/[A-Za-z]/),Vi=ml(/[\dA-Za-z]/),Vee=ml(/[#-'*+\--9=?A-Z^-~]/);function p_(r){return r!==null&&(r<32||r===127)}const g_=ml(/\d/),qee=ml(/[\dA-Fa-f]/),Xee=ml(/[!-/:-@[-`{-~]/);function St(r){return r!==null&&r<-2}function Di(r){return r!==null&&(r<0||r===32)}function ar(r){return r===-2||r===-1||r===32}const Yee=ml(new RegExp("\\p{P}|\\p{S}","u")),Wee=ml(/\s/);function ml(r){return e;function e(t){return t!==null&&t>-1&&r.test(String.fromCharCode(t))}}function ch(r){const e=[];let t=-1,n=0,i=0;for(;++t<r.length;){const a=r.charCodeAt(t);let s="";if(a===37&&Vi(r.charCodeAt(t+1))&&Vi(r.charCodeAt(t+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(s=String.fromCharCode(a));else if(a>55295&&a<57344){const o=r.charCodeAt(t+1);a<56320&&o>56319&&o<57344?(s=String.fromCharCode(a,o),i=1):s="�"}else s=String.fromCharCode(a);s&&(e.push(r.slice(n,t),encodeURIComponent(s)),n=t+i+1,s=""),i&&(t+=i,i=0)}return e.join("")+r.slice(n)}function dr(r,e,t,n){const i=n?n-1:Number.POSITIVE_INFINITY;let a=0;return s;function s(l){return ar(l)?(r.enter(t),o(l)):e(l)}function o(l){return ar(l)&&a++<i?(r.consume(l),o):(r.exit(t),e(l))}}const $ee={tokenize:Kee};function Kee(r){const e=r.attempt(this.parser.constructs.contentInitial,n,i);let t;return e;function n(o){if(o===null){r.consume(o);return}return r.enter("lineEnding"),r.consume(o),r.exit("lineEnding"),dr(r,e,"linePrefix")}function i(o){return r.enter("paragraph"),a(o)}function a(o){const l=r.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=l),t=l,s(o)}function s(o){if(o===null){r.exit("chunkText"),r.exit("paragraph"),r.consume(o);return}return St(o)?(r.consume(o),r.exit("chunkText"),a):(r.consume(o),s)}}const Zee={tokenize:Qee},ZA={tokenize:Jee};function Qee(r){const e=this,t=[];let n=0,i,a,s;return o;function o(S){if(n<t.length){const A=t[n];return e.containerState=A[1],r.attempt(A[0].continuation,l,c)(S)}return c(S)}function l(S){if(n++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&w();const A=e.events.length;let C=A,M;for(;C--;)if(e.events[C][0]==="exit"&&e.events[C][1].type==="chunkFlow"){M=e.events[C][1].end;break}_(n);let E=A;for(;E<e.events.length;)e.events[E][1].end={...M},E++;return ss(e.events,C+1,0,e.events.slice(A)),e.events.length=E,c(S)}return o(S)}function c(S){if(n===t.length){if(!i)return v(S);if(i.currentConstruct&&i.currentConstruct.concrete)return m(S);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},r.check(ZA,h,d)(S)}function h(S){return i&&w(),_(n),v(S)}function d(S){return e.parser.lazy[e.now().line]=n!==t.length,s=e.now().offset,m(S)}function v(S){return e.containerState={},r.attempt(ZA,g,m)(S)}function g(S){return n++,t.push([e.currentConstruct,e.containerState]),v(S)}function m(S){if(S===null){i&&w(),_(0),r.consume(S);return}return i=i||e.parser.flow(e.now()),r.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),x(S)}function x(S){if(S===null){y(r.exit("chunkFlow"),!0),_(0),r.consume(S);return}return St(S)?(r.consume(S),y(r.exit("chunkFlow")),n=0,e.interrupt=void 0,o):(r.consume(S),x)}function y(S,A){const C=e.sliceStream(S);if(A&&C.push(null),S.previous=a,a&&(a.next=S),a=S,i.defineSkip(S.start),i.write(C),e.parser.lazy[S.start.line]){let M=i.events.length;for(;M--;)if(i.events[M][1].start.offset<s&&(!i.events[M][1].end||i.events[M][1].end.offset>s))return;const E=e.events.length;let O=E,D,I;for(;O--;)if(e.events[O][0]==="exit"&&e.events[O][1].type==="chunkFlow"){if(D){I=e.events[O][1].end;break}D=!0}for(_(n),M=E;M<e.events.length;)e.events[M][1].end={...I},M++;ss(e.events,O+1,0,e.events.slice(E)),e.events.length=M}}function _(S){let A=t.length;for(;A-- >S;){const C=t[A];e.containerState=C[1],C[0].exit.call(e,r)}t.length=S}function w(){i.write([null]),a=void 0,i=void 0,e.containerState._closeFlow=void 0}}function Jee(r,e,t){return dr(r,r.attempt(this.parser.constructs.document,e,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function QA(r){if(r===null||Di(r)||Wee(r))return 1;if(Yee(r))return 2}function T3(r,e,t){const n=[];let i=-1;for(;++i<r.length;){const a=r[i].resolveAll;a&&!n.includes(a)&&(e=a(e,t),n.push(a))}return e}const m_={name:"attention",resolveAll:ete,tokenize:tte};function ete(r,e){let t=-1,n,i,a,s,o,l,c,h;for(;++t<r.length;)if(r[t][0]==="enter"&&r[t][1].type==="attentionSequence"&&r[t][1]._close){for(n=t;n--;)if(r[n][0]==="exit"&&r[n][1].type==="attentionSequence"&&r[n][1]._open&&e.sliceSerialize(r[n][1]).charCodeAt(0)===e.sliceSerialize(r[t][1]).charCodeAt(0)){if((r[n][1]._close||r[t][1]._open)&&(r[t][1].end.offset-r[t][1].start.offset)%3&&!((r[n][1].end.offset-r[n][1].start.offset+r[t][1].end.offset-r[t][1].start.offset)%3))continue;l=r[n][1].end.offset-r[n][1].start.offset>1&&r[t][1].end.offset-r[t][1].start.offset>1?2:1;const d={...r[n][1].end},v={...r[t][1].start};JA(d,-l),JA(v,l),s={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...r[n][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...r[t][1].start},end:v},a={type:l>1?"strongText":"emphasisText",start:{...r[n][1].end},end:{...r[t][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...o.end}},r[n][1].end={...s.start},r[t][1].start={...o.end},c=[],r[n][1].end.offset-r[n][1].start.offset&&(c=da(c,[["enter",r[n][1],e],["exit",r[n][1],e]])),c=da(c,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",a,e]]),c=da(c,T3(e.parser.constructs.insideSpan.null,r.slice(n+1,t),e)),c=da(c,[["exit",a,e],["enter",o,e],["exit",o,e],["exit",i,e]]),r[t][1].end.offset-r[t][1].start.offset?(h=2,c=da(c,[["enter",r[t][1],e],["exit",r[t][1],e]])):h=0,ss(r,n-1,t-n+3,c),t=n+c.length-h-2;break}}for(t=-1;++t<r.length;)r[t][1].type==="attentionSequence"&&(r[t][1].type="data");return r}function tte(r,e){const t=this.parser.constructs.attentionMarkers.null,n=this.previous,i=QA(n);let a;return s;function s(l){return a=l,r.enter("attentionSequence"),o(l)}function o(l){if(l===a)return r.consume(l),o;const c=r.exit("attentionSequence"),h=QA(l),d=!h||h===2&&i||t.includes(l),v=!i||i===2&&h||t.includes(n);return c._open=!!(a===42?d:d&&(i||!v)),c._close=!!(a===42?v:v&&(h||!d)),e(l)}}function JA(r,e){r.column+=e,r.offset+=e,r._bufferIndex+=e}const rte={name:"autolink",tokenize:nte};function nte(r,e,t){let n=0;return i;function i(g){return r.enter("autolink"),r.enter("autolinkMarker"),r.consume(g),r.exit("autolinkMarker"),r.enter("autolinkProtocol"),a}function a(g){return Qa(g)?(r.consume(g),s):g===64?t(g):c(g)}function s(g){return g===43||g===45||g===46||Vi(g)?(n=1,o(g)):c(g)}function o(g){return g===58?(r.consume(g),n=0,l):(g===43||g===45||g===46||Vi(g))&&n++<32?(r.consume(g),o):(n=0,c(g))}function l(g){return g===62?(r.exit("autolinkProtocol"),r.enter("autolinkMarker"),r.consume(g),r.exit("autolinkMarker"),r.exit("autolink"),e):g===null||g===32||g===60||p_(g)?t(g):(r.consume(g),l)}function c(g){return g===64?(r.consume(g),h):Vee(g)?(r.consume(g),c):t(g)}function h(g){return Vi(g)?d(g):t(g)}function d(g){return g===46?(r.consume(g),n=0,h):g===62?(r.exit("autolinkProtocol").type="autolinkEmail",r.enter("autolinkMarker"),r.consume(g),r.exit("autolinkMarker"),r.exit("autolink"),e):v(g)}function v(g){if((g===45||Vi(g))&&n++<63){const m=g===45?v:d;return r.consume(g),m}return t(g)}}const Ng={partial:!0,tokenize:ite};function ite(r,e,t){return n;function n(a){return ar(a)?dr(r,i,"linePrefix")(a):i(a)}function i(a){return a===null||St(a)?e(a):t(a)}}const tI={continuation:{tokenize:ste},exit:ote,name:"blockQuote",tokenize:ate};function ate(r,e,t){const n=this;return i;function i(s){if(s===62){const o=n.containerState;return o.open||(r.enter("blockQuote",{_container:!0}),o.open=!0),r.enter("blockQuotePrefix"),r.enter("blockQuoteMarker"),r.consume(s),r.exit("blockQuoteMarker"),a}return t(s)}function a(s){return ar(s)?(r.enter("blockQuotePrefixWhitespace"),r.consume(s),r.exit("blockQuotePrefixWhitespace"),r.exit("blockQuotePrefix"),e):(r.exit("blockQuotePrefix"),e(s))}}function ste(r,e,t){const n=this;return i;function i(s){return ar(s)?dr(r,a,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):a(s)}function a(s){return r.attempt(tI,e,t)(s)}}function ote(r){r.exit("blockQuote")}const rI={name:"characterEscape",tokenize:lte};function lte(r,e,t){return n;function n(a){return r.enter("characterEscape"),r.enter("escapeMarker"),r.consume(a),r.exit("escapeMarker"),i}function i(a){return Xee(a)?(r.enter("characterEscapeValue"),r.consume(a),r.exit("characterEscapeValue"),r.exit("characterEscape"),e):t(a)}}const nI={name:"characterReference",tokenize:ute};function ute(r,e,t){const n=this;let i=0,a,s;return o;function o(d){return r.enter("characterReference"),r.enter("characterReferenceMarker"),r.consume(d),r.exit("characterReferenceMarker"),l}function l(d){return d===35?(r.enter("characterReferenceMarkerNumeric"),r.consume(d),r.exit("characterReferenceMarkerNumeric"),c):(r.enter("characterReferenceValue"),a=31,s=Vi,h(d))}function c(d){return d===88||d===120?(r.enter("characterReferenceMarkerHexadecimal"),r.consume(d),r.exit("characterReferenceMarkerHexadecimal"),r.enter("characterReferenceValue"),a=6,s=qee,h):(r.enter("characterReferenceValue"),a=7,s=g_,h(d))}function h(d){if(d===59&&i){const v=r.exit("characterReferenceValue");return s===Vi&&!E3(n.sliceSerialize(v))?t(d):(r.enter("characterReferenceMarker"),r.consume(d),r.exit("characterReferenceMarker"),r.exit("characterReference"),e)}return s(d)&&i++<a?(r.consume(d),h):t(d)}}const eM={partial:!0,tokenize:hte},tM={concrete:!0,name:"codeFenced",tokenize:cte};function cte(r,e,t){const n=this,i={partial:!0,tokenize:C};let a=0,s=0,o;return l;function l(M){return c(M)}function c(M){const E=n.events[n.events.length-1];return a=E&&E[1].type==="linePrefix"?E[2].sliceSerialize(E[1],!0).length:0,o=M,r.enter("codeFenced"),r.enter("codeFencedFence"),r.enter("codeFencedFenceSequence"),h(M)}function h(M){return M===o?(s++,r.consume(M),h):s<3?t(M):(r.exit("codeFencedFenceSequence"),ar(M)?dr(r,d,"whitespace")(M):d(M))}function d(M){return M===null||St(M)?(r.exit("codeFencedFence"),n.interrupt?e(M):r.check(eM,x,A)(M)):(r.enter("codeFencedFenceInfo"),r.enter("chunkString",{contentType:"string"}),v(M))}function v(M){return M===null||St(M)?(r.exit("chunkString"),r.exit("codeFencedFenceInfo"),d(M)):ar(M)?(r.exit("chunkString"),r.exit("codeFencedFenceInfo"),dr(r,g,"whitespace")(M)):M===96&&M===o?t(M):(r.consume(M),v)}function g(M){return M===null||St(M)?d(M):(r.enter("codeFencedFenceMeta"),r.enter("chunkString",{contentType:"string"}),m(M))}function m(M){return M===null||St(M)?(r.exit("chunkString"),r.exit("codeFencedFenceMeta"),d(M)):M===96&&M===o?t(M):(r.consume(M),m)}function x(M){return r.attempt(i,A,y)(M)}function y(M){return r.enter("lineEnding"),r.consume(M),r.exit("lineEnding"),_}function _(M){return a>0&&ar(M)?dr(r,w,"linePrefix",a+1)(M):w(M)}function w(M){return M===null||St(M)?r.check(eM,x,A)(M):(r.enter("codeFlowValue"),S(M))}function S(M){return M===null||St(M)?(r.exit("codeFlowValue"),w(M)):(r.consume(M),S)}function A(M){return r.exit("codeFenced"),e(M)}function C(M,E,O){let D=0;return I;function I(W){return M.enter("lineEnding"),M.consume(W),M.exit("lineEnding"),k}function k(W){return M.enter("codeFencedFence"),ar(W)?dr(M,U,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):U(W)}function U(W){return W===o?(M.enter("codeFencedFenceSequence"),V(W)):O(W)}function V(W){return W===o?(D++,M.consume(W),V):D>=s?(M.exit("codeFencedFenceSequence"),ar(W)?dr(M,X,"whitespace")(W):X(W)):O(W)}function X(W){return W===null||St(W)?(M.exit("codeFencedFence"),E(W)):O(W)}}}function hte(r,e,t){const n=this;return i;function i(s){return s===null?t(s):(r.enter("lineEnding"),r.consume(s),r.exit("lineEnding"),a)}function a(s){return n.parser.lazy[n.now().line]?t(s):e(s)}}const bx={name:"codeIndented",tokenize:dte},fte={partial:!0,tokenize:vte};function dte(r,e,t){const n=this;return i;function i(c){return r.enter("codeIndented"),dr(r,a,"linePrefix",5)(c)}function a(c){const h=n.events[n.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?s(c):t(c)}function s(c){return c===null?l(c):St(c)?r.attempt(fte,s,l)(c):(r.enter("codeFlowValue"),o(c))}function o(c){return c===null||St(c)?(r.exit("codeFlowValue"),s(c)):(r.consume(c),o)}function l(c){return r.exit("codeIndented"),e(c)}}function vte(r,e,t){const n=this;return i;function i(s){return n.parser.lazy[n.now().line]?t(s):St(s)?(r.enter("lineEnding"),r.consume(s),r.exit("lineEnding"),i):dr(r,a,"linePrefix",5)(s)}function a(s){const o=n.events[n.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(s):St(s)?i(s):t(s)}}const pte={name:"codeText",previous:mte,resolve:gte,tokenize:yte};function gte(r){let e=r.length-4,t=3,n,i;if((r[t][1].type==="lineEnding"||r[t][1].type==="space")&&(r[e][1].type==="lineEnding"||r[e][1].type==="space")){for(n=t;++n<e;)if(r[n][1].type==="codeTextData"){r[t][1].type="codeTextPadding",r[e][1].type="codeTextPadding",t+=2,e-=2;break}}for(n=t-1,e++;++n<=e;)i===void 0?n!==e&&r[n][1].type!=="lineEnding"&&(i=n):(n===e||r[n][1].type==="lineEnding")&&(r[i][1].type="codeTextData",n!==i+2&&(r[i][1].end=r[n-1][1].end,r.splice(i+2,n-i-2),e-=n-i-2,n=i+2),i=void 0);return r}function mte(r){return r!==96||this.events[this.events.length-1][1].type==="characterEscape"}function yte(r,e,t){let n=0,i,a;return s;function s(d){return r.enter("codeText"),r.enter("codeTextSequence"),o(d)}function o(d){return d===96?(r.consume(d),n++,o):(r.exit("codeTextSequence"),l(d))}function l(d){return d===null?t(d):d===32?(r.enter("space"),r.consume(d),r.exit("space"),l):d===96?(a=r.enter("codeTextSequence"),i=0,h(d)):St(d)?(r.enter("lineEnding"),r.consume(d),r.exit("lineEnding"),l):(r.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||St(d)?(r.exit("codeTextData"),l(d)):(r.consume(d),c)}function h(d){return d===96?(r.consume(d),i++,h):i===n?(r.exit("codeTextSequence"),r.exit("codeText"),e(d)):(a.type="codeTextData",c(d))}}class bte{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=t??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const i=t||0;this.setCursor(Math.trunc(e));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return n&&Tf(this.left,n),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Tf(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Tf(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);Tf(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Tf(this.left,t.reverse())}}}function Tf(r,e){let t=0;if(e.length<1e4)r.push(...e);else for(;t<e.length;)r.push(...e.slice(t,t+1e4)),t+=1e4}function iI(r){const e={};let t=-1,n,i,a,s,o,l,c;const h=new bte(r);for(;++t<h.length;){for(;t in e;)t=e[t];if(n=h.get(t),t&&n[1].type==="chunkFlow"&&h.get(t-1)[1].type==="listItemPrefix"&&(l=n[1]._tokenizer.events,a=0,a<l.length&&l[a][1].type==="lineEndingBlank"&&(a+=2),a<l.length&&l[a][1].type==="content"))for(;++a<l.length&&l[a][1].type!=="content";)l[a][1].type==="chunkText"&&(l[a][1]._isInFirstContentOfListItem=!0,a++);if(n[0]==="enter")n[1].contentType&&(Object.assign(e,xte(h,t)),t=e[t],c=!0);else if(n[1]._container){for(a=t,i=void 0;a--;)if(s=h.get(a),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=a);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(n[1].end={...h.get(i)[1].start},o=h.slice(i,t),o.unshift(n),h.splice(i,t-i+1,o))}}return ss(r,0,Number.POSITIVE_INFINITY,h.slice(0)),!c}function xte(r,e){const t=r.get(e)[1],n=r.get(e)[2];let i=e-1;const a=[];let s=t._tokenizer;s||(s=n.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const o=s.events,l=[],c={};let h,d,v=-1,g=t,m=0,x=0;const y=[x];for(;g;){for(;r.get(++i)[1]!==g;);a.push(i),g._tokenizer||(h=n.sliceStream(g),g.next||h.push(null),d&&s.defineSkip(g.start),g._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(h),g._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=g,g=g.next}for(g=t;++v<o.length;)o[v][0]==="exit"&&o[v-1][0]==="enter"&&o[v][1].type===o[v-1][1].type&&o[v][1].start.line!==o[v][1].end.line&&(x=v+1,y.push(x),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(s.events=[],g?(g._tokenizer=void 0,g.previous=void 0):y.pop(),v=y.length;v--;){const _=o.slice(y[v],y[v+1]),w=a.pop();l.push([w,w+_.length-1]),r.splice(w,2,_)}for(l.reverse(),v=-1;++v<l.length;)c[m+l[v][0]]=m+l[v][1],m+=l[v][1]-l[v][0]-1;return c}const _te={resolve:Ste,tokenize:Ete},wte={partial:!0,tokenize:Tte};function Ste(r){return iI(r),r}function Ete(r,e){let t;return n;function n(o){return r.enter("content"),t=r.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?a(o):St(o)?r.check(wte,s,a)(o):(r.consume(o),i)}function a(o){return r.exit("chunkContent"),r.exit("content"),e(o)}function s(o){return r.consume(o),r.exit("chunkContent"),t.next=r.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function Tte(r,e,t){const n=this;return i;function i(s){return r.exit("chunkContent"),r.enter("lineEnding"),r.consume(s),r.exit("lineEnding"),dr(r,a,"linePrefix")}function a(s){if(s===null||St(s))return t(s);const o=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(s):r.interrupt(n.parser.constructs.flow,t,e)(s)}}function aI(r,e,t,n,i,a,s,o,l){const c=l||Number.POSITIVE_INFINITY;let h=0;return d;function d(_){return _===60?(r.enter(n),r.enter(i),r.enter(a),r.consume(_),r.exit(a),v):_===null||_===32||_===41||p_(_)?t(_):(r.enter(n),r.enter(s),r.enter(o),r.enter("chunkString",{contentType:"string"}),x(_))}function v(_){return _===62?(r.enter(a),r.consume(_),r.exit(a),r.exit(i),r.exit(n),e):(r.enter(o),r.enter("chunkString",{contentType:"string"}),g(_))}function g(_){return _===62?(r.exit("chunkString"),r.exit(o),v(_)):_===null||_===60||St(_)?t(_):(r.consume(_),_===92?m:g)}function m(_){return _===60||_===62||_===92?(r.consume(_),g):g(_)}function x(_){return!h&&(_===null||_===41||Di(_))?(r.exit("chunkString"),r.exit(o),r.exit(s),r.exit(n),e(_)):h<c&&_===40?(r.consume(_),h++,x):_===41?(r.consume(_),h--,x):_===null||_===32||_===40||p_(_)?t(_):(r.consume(_),_===92?y:x)}function y(_){return _===40||_===41||_===92?(r.consume(_),x):x(_)}}function sI(r,e,t,n,i,a){const s=this;let o=0,l;return c;function c(g){return r.enter(n),r.enter(i),r.consume(g),r.exit(i),r.enter(a),h}function h(g){return o>999||g===null||g===91||g===93&&!l||g===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?t(g):g===93?(r.exit(a),r.enter(i),r.consume(g),r.exit(i),r.exit(n),e):St(g)?(r.enter("lineEnding"),r.consume(g),r.exit("lineEnding"),h):(r.enter("chunkString",{contentType:"string"}),d(g))}function d(g){return g===null||g===91||g===93||St(g)||o++>999?(r.exit("chunkString"),h(g)):(r.consume(g),l||(l=!ar(g)),g===92?v:d)}function v(g){return g===91||g===92||g===93?(r.consume(g),o++,d):d(g)}}function oI(r,e,t,n,i,a){let s;return o;function o(v){return v===34||v===39||v===40?(r.enter(n),r.enter(i),r.consume(v),r.exit(i),s=v===40?41:v,l):t(v)}function l(v){return v===s?(r.enter(i),r.consume(v),r.exit(i),r.exit(n),e):(r.enter(a),c(v))}function c(v){return v===s?(r.exit(a),l(s)):v===null?t(v):St(v)?(r.enter("lineEnding"),r.consume(v),r.exit("lineEnding"),dr(r,c,"linePrefix")):(r.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===s||v===null||St(v)?(r.exit("chunkString"),c(v)):(r.consume(v),v===92?d:h)}function d(v){return v===s||v===92?(r.consume(v),h):h(v)}}function jf(r,e){let t;return n;function n(i){return St(i)?(r.enter("lineEnding"),r.consume(i),r.exit("lineEnding"),t=!0,n):ar(i)?dr(r,n,t?"linePrefix":"lineSuffix")(i):e(i)}}const Cte={name:"definition",tokenize:Mte},Ate={partial:!0,tokenize:Rte};function Mte(r,e,t){const n=this;let i;return a;function a(g){return r.enter("definition"),s(g)}function s(g){return sI.call(n,r,o,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function o(g){return i=Lc(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),g===58?(r.enter("definitionMarker"),r.consume(g),r.exit("definitionMarker"),l):t(g)}function l(g){return Di(g)?jf(r,c)(g):c(g)}function c(g){return aI(r,h,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function h(g){return r.attempt(Ate,d,d)(g)}function d(g){return ar(g)?dr(r,v,"whitespace")(g):v(g)}function v(g){return g===null||St(g)?(r.exit("definition"),n.parser.defined.push(i),e(g)):t(g)}}function Rte(r,e,t){return n;function n(o){return Di(o)?jf(r,i)(o):t(o)}function i(o){return oI(r,a,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function a(o){return ar(o)?dr(r,s,"whitespace")(o):s(o)}function s(o){return o===null||St(o)?e(o):t(o)}}const Ote={name:"hardBreakEscape",tokenize:Dte};function Dte(r,e,t){return n;function n(a){return r.enter("hardBreakEscape"),r.consume(a),i}function i(a){return St(a)?(r.exit("hardBreakEscape"),e(a)):t(a)}}const Pte={name:"headingAtx",resolve:Ite,tokenize:Nte};function Ite(r,e){let t=r.length-2,n=3,i,a;return r[n][1].type==="whitespace"&&(n+=2),t-2>n&&r[t][1].type==="whitespace"&&(t-=2),r[t][1].type==="atxHeadingSequence"&&(n===t-1||t-4>n&&r[t-2][1].type==="whitespace")&&(t-=n+1===t?2:4),t>n&&(i={type:"atxHeadingText",start:r[n][1].start,end:r[t][1].end},a={type:"chunkText",start:r[n][1].start,end:r[t][1].end,contentType:"text"},ss(r,n,t-n+1,[["enter",i,e],["enter",a,e],["exit",a,e],["exit",i,e]])),r}function Nte(r,e,t){let n=0;return i;function i(h){return r.enter("atxHeading"),a(h)}function a(h){return r.enter("atxHeadingSequence"),s(h)}function s(h){return h===35&&n++<6?(r.consume(h),s):h===null||Di(h)?(r.exit("atxHeadingSequence"),o(h)):t(h)}function o(h){return h===35?(r.enter("atxHeadingSequence"),l(h)):h===null||St(h)?(r.exit("atxHeading"),e(h)):ar(h)?dr(r,o,"whitespace")(h):(r.enter("atxHeadingText"),c(h))}function l(h){return h===35?(r.consume(h),l):(r.exit("atxHeadingSequence"),o(h))}function c(h){return h===null||h===35||Di(h)?(r.exit("atxHeadingText"),o(h)):(r.consume(h),c)}}const Lte=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],rM=["pre","script","style","textarea"],kte={concrete:!0,name:"htmlFlow",resolveTo:zte,tokenize:Ute},Bte={partial:!0,tokenize:Hte},Fte={partial:!0,tokenize:Gte};function zte(r){let e=r.length;for(;e--&&!(r[e][0]==="enter"&&r[e][1].type==="htmlFlow"););return e>1&&r[e-2][1].type==="linePrefix"&&(r[e][1].start=r[e-2][1].start,r[e+1][1].start=r[e-2][1].start,r.splice(e-2,2)),r}function Ute(r,e,t){const n=this;let i,a,s,o,l;return c;function c(G){return h(G)}function h(G){return r.enter("htmlFlow"),r.enter("htmlFlowData"),r.consume(G),d}function d(G){return G===33?(r.consume(G),v):G===47?(r.consume(G),a=!0,x):G===63?(r.consume(G),i=3,n.interrupt?e:B):Qa(G)?(r.consume(G),s=String.fromCharCode(G),y):t(G)}function v(G){return G===45?(r.consume(G),i=2,g):G===91?(r.consume(G),i=5,o=0,m):Qa(G)?(r.consume(G),i=4,n.interrupt?e:B):t(G)}function g(G){return G===45?(r.consume(G),n.interrupt?e:B):t(G)}function m(G){const re="CDATA[";return G===re.charCodeAt(o++)?(r.consume(G),o===re.length?n.interrupt?e:U:m):t(G)}function x(G){return Qa(G)?(r.consume(G),s=String.fromCharCode(G),y):t(G)}function y(G){if(G===null||G===47||G===62||Di(G)){const re=G===47,ie=s.toLowerCase();return!re&&!a&&rM.includes(ie)?(i=1,n.interrupt?e(G):U(G)):Lte.includes(s.toLowerCase())?(i=6,re?(r.consume(G),_):n.interrupt?e(G):U(G)):(i=7,n.interrupt&&!n.parser.lazy[n.now().line]?t(G):a?w(G):S(G))}return G===45||Vi(G)?(r.consume(G),s+=String.fromCharCode(G),y):t(G)}function _(G){return G===62?(r.consume(G),n.interrupt?e:U):t(G)}function w(G){return ar(G)?(r.consume(G),w):I(G)}function S(G){return G===47?(r.consume(G),I):G===58||G===95||Qa(G)?(r.consume(G),A):ar(G)?(r.consume(G),S):I(G)}function A(G){return G===45||G===46||G===58||G===95||Vi(G)?(r.consume(G),A):C(G)}function C(G){return G===61?(r.consume(G),M):ar(G)?(r.consume(G),C):S(G)}function M(G){return G===null||G===60||G===61||G===62||G===96?t(G):G===34||G===39?(r.consume(G),l=G,E):ar(G)?(r.consume(G),M):O(G)}function E(G){return G===l?(r.consume(G),l=null,D):G===null||St(G)?t(G):(r.consume(G),E)}function O(G){return G===null||G===34||G===39||G===47||G===60||G===61||G===62||G===96||Di(G)?C(G):(r.consume(G),O)}function D(G){return G===47||G===62||ar(G)?S(G):t(G)}function I(G){return G===62?(r.consume(G),k):t(G)}function k(G){return G===null||St(G)?U(G):ar(G)?(r.consume(G),k):t(G)}function U(G){return G===45&&i===2?(r.consume(G),P):G===60&&i===1?(r.consume(G),H):G===62&&i===4?(r.consume(G),L):G===63&&i===3?(r.consume(G),B):G===93&&i===5?(r.consume(G),$):St(G)&&(i===6||i===7)?(r.exit("htmlFlowData"),r.check(Bte,Y,V)(G)):G===null||St(G)?(r.exit("htmlFlowData"),V(G)):(r.consume(G),U)}function V(G){return r.check(Fte,X,Y)(G)}function X(G){return r.enter("lineEnding"),r.consume(G),r.exit("lineEnding"),W}function W(G){return G===null||St(G)?V(G):(r.enter("htmlFlowData"),U(G))}function P(G){return G===45?(r.consume(G),B):U(G)}function H(G){return G===47?(r.consume(G),s="",z):U(G)}function z(G){if(G===62){const re=s.toLowerCase();return rM.includes(re)?(r.consume(G),L):U(G)}return Qa(G)&&s.length<8?(r.consume(G),s+=String.fromCharCode(G),z):U(G)}function $(G){return G===93?(r.consume(G),B):U(G)}function B(G){return G===62?(r.consume(G),L):G===45&&i===2?(r.consume(G),B):U(G)}function L(G){return G===null||St(G)?(r.exit("htmlFlowData"),Y(G)):(r.consume(G),L)}function Y(G){return r.exit("htmlFlow"),e(G)}}function Gte(r,e,t){const n=this;return i;function i(s){return St(s)?(r.enter("lineEnding"),r.consume(s),r.exit("lineEnding"),a):t(s)}function a(s){return n.parser.lazy[n.now().line]?t(s):e(s)}}function Hte(r,e,t){return n;function n(i){return r.enter("lineEnding"),r.consume(i),r.exit("lineEnding"),r.attempt(Ng,e,t)}}const jte={name:"htmlText",tokenize:Vte};function Vte(r,e,t){const n=this;let i,a,s;return o;function o(B){return r.enter("htmlText"),r.enter("htmlTextData"),r.consume(B),l}function l(B){return B===33?(r.consume(B),c):B===47?(r.consume(B),C):B===63?(r.consume(B),S):Qa(B)?(r.consume(B),O):t(B)}function c(B){return B===45?(r.consume(B),h):B===91?(r.consume(B),a=0,m):Qa(B)?(r.consume(B),w):t(B)}function h(B){return B===45?(r.consume(B),g):t(B)}function d(B){return B===null?t(B):B===45?(r.consume(B),v):St(B)?(s=d,H(B)):(r.consume(B),d)}function v(B){return B===45?(r.consume(B),g):d(B)}function g(B){return B===62?P(B):B===45?v(B):d(B)}function m(B){const L="CDATA[";return B===L.charCodeAt(a++)?(r.consume(B),a===L.length?x:m):t(B)}function x(B){return B===null?t(B):B===93?(r.consume(B),y):St(B)?(s=x,H(B)):(r.consume(B),x)}function y(B){return B===93?(r.consume(B),_):x(B)}function _(B){return B===62?P(B):B===93?(r.consume(B),_):x(B)}function w(B){return B===null||B===62?P(B):St(B)?(s=w,H(B)):(r.consume(B),w)}function S(B){return B===null?t(B):B===63?(r.consume(B),A):St(B)?(s=S,H(B)):(r.consume(B),S)}function A(B){return B===62?P(B):S(B)}function C(B){return Qa(B)?(r.consume(B),M):t(B)}function M(B){return B===45||Vi(B)?(r.consume(B),M):E(B)}function E(B){return St(B)?(s=E,H(B)):ar(B)?(r.consume(B),E):P(B)}function O(B){return B===45||Vi(B)?(r.consume(B),O):B===47||B===62||Di(B)?D(B):t(B)}function D(B){return B===47?(r.consume(B),P):B===58||B===95||Qa(B)?(r.consume(B),I):St(B)?(s=D,H(B)):ar(B)?(r.consume(B),D):P(B)}function I(B){return B===45||B===46||B===58||B===95||Vi(B)?(r.consume(B),I):k(B)}function k(B){return B===61?(r.consume(B),U):St(B)?(s=k,H(B)):ar(B)?(r.consume(B),k):D(B)}function U(B){return B===null||B===60||B===61||B===62||B===96?t(B):B===34||B===39?(r.consume(B),i=B,V):St(B)?(s=U,H(B)):ar(B)?(r.consume(B),U):(r.consume(B),X)}function V(B){return B===i?(r.consume(B),i=void 0,W):B===null?t(B):St(B)?(s=V,H(B)):(r.consume(B),V)}function X(B){return B===null||B===34||B===39||B===60||B===61||B===96?t(B):B===47||B===62||Di(B)?D(B):(r.consume(B),X)}function W(B){return B===47||B===62||Di(B)?D(B):t(B)}function P(B){return B===62?(r.consume(B),r.exit("htmlTextData"),r.exit("htmlText"),e):t(B)}function H(B){return r.exit("htmlTextData"),r.enter("lineEnding"),r.consume(B),r.exit("lineEnding"),z}function z(B){return ar(B)?dr(r,$,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):$(B)}function $(B){return r.enter("htmlTextData"),s(B)}}const C3={name:"labelEnd",resolveAll:Wte,resolveTo:$te,tokenize:Kte},qte={tokenize:Zte},Xte={tokenize:Qte},Yte={tokenize:Jte};function Wte(r){let e=-1;const t=[];for(;++e<r.length;){const n=r[e][1];if(t.push(r[e]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){const i=n.type==="labelImage"?4:2;n.type="data",e+=i}}return r.length!==t.length&&ss(r,0,r.length,t),r}function $te(r,e){let t=r.length,n=0,i,a,s,o;for(;t--;)if(i=r[t][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;r[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(r[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=t,i.type!=="labelLink")){n=2;break}}else i.type==="labelEnd"&&(s=t);const l={type:r[a][1].type==="labelLink"?"link":"image",start:{...r[a][1].start},end:{...r[r.length-1][1].end}},c={type:"label",start:{...r[a][1].start},end:{...r[s][1].end}},h={type:"labelText",start:{...r[a+n+2][1].end},end:{...r[s-2][1].start}};return o=[["enter",l,e],["enter",c,e]],o=da(o,r.slice(a+1,a+n+3)),o=da(o,[["enter",h,e]]),o=da(o,T3(e.parser.constructs.insideSpan.null,r.slice(a+n+4,s-3),e)),o=da(o,[["exit",h,e],r[s-2],r[s-1],["exit",c,e]]),o=da(o,r.slice(s+1)),o=da(o,[["exit",l,e]]),ss(r,a,r.length,o),r}function Kte(r,e,t){const n=this;let i=n.events.length,a,s;for(;i--;)if((n.events[i][1].type==="labelImage"||n.events[i][1].type==="labelLink")&&!n.events[i][1]._balanced){a=n.events[i][1];break}return o;function o(v){return a?a._inactive?d(v):(s=n.parser.defined.includes(Lc(n.sliceSerialize({start:a.end,end:n.now()}))),r.enter("labelEnd"),r.enter("labelMarker"),r.consume(v),r.exit("labelMarker"),r.exit("labelEnd"),l):t(v)}function l(v){return v===40?r.attempt(qte,h,s?h:d)(v):v===91?r.attempt(Xte,h,s?c:d)(v):s?h(v):d(v)}function c(v){return r.attempt(Yte,h,d)(v)}function h(v){return e(v)}function d(v){return a._balanced=!0,t(v)}}function Zte(r,e,t){return n;function n(d){return r.enter("resource"),r.enter("resourceMarker"),r.consume(d),r.exit("resourceMarker"),i}function i(d){return Di(d)?jf(r,a)(d):a(d)}function a(d){return d===41?h(d):aI(r,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return Di(d)?jf(r,l)(d):h(d)}function o(d){return t(d)}function l(d){return d===34||d===39||d===40?oI(r,c,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):h(d)}function c(d){return Di(d)?jf(r,h)(d):h(d)}function h(d){return d===41?(r.enter("resourceMarker"),r.consume(d),r.exit("resourceMarker"),r.exit("resource"),e):t(d)}}function Qte(r,e,t){const n=this;return i;function i(o){return sI.call(n,r,a,s,"reference","referenceMarker","referenceString")(o)}function a(o){return n.parser.defined.includes(Lc(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?e(o):t(o)}function s(o){return t(o)}}function Jte(r,e,t){return n;function n(a){return r.enter("reference"),r.enter("referenceMarker"),r.consume(a),r.exit("referenceMarker"),i}function i(a){return a===93?(r.enter("referenceMarker"),r.consume(a),r.exit("referenceMarker"),r.exit("reference"),e):t(a)}}const ere={name:"labelStartImage",resolveAll:C3.resolveAll,tokenize:tre};function tre(r,e,t){const n=this;return i;function i(o){return r.enter("labelImage"),r.enter("labelImageMarker"),r.consume(o),r.exit("labelImageMarker"),a}function a(o){return o===91?(r.enter("labelMarker"),r.consume(o),r.exit("labelMarker"),r.exit("labelImage"),s):t(o)}function s(o){return o===94&&"_hiddenFootnoteSupport"in n.parser.constructs?t(o):e(o)}}const rre={name:"labelStartLink",resolveAll:C3.resolveAll,tokenize:nre};function nre(r,e,t){const n=this;return i;function i(s){return r.enter("labelLink"),r.enter("labelMarker"),r.consume(s),r.exit("labelMarker"),r.exit("labelLink"),a}function a(s){return s===94&&"_hiddenFootnoteSupport"in n.parser.constructs?t(s):e(s)}}const xx={name:"lineEnding",tokenize:ire};function ire(r,e){return t;function t(n){return r.enter("lineEnding"),r.consume(n),r.exit("lineEnding"),dr(r,e,"linePrefix")}}const bp={name:"thematicBreak",tokenize:are};function are(r,e,t){let n=0,i;return a;function a(c){return r.enter("thematicBreak"),s(c)}function s(c){return i=c,o(c)}function o(c){return c===i?(r.enter("thematicBreakSequence"),l(c)):n>=3&&(c===null||St(c))?(r.exit("thematicBreak"),e(c)):t(c)}function l(c){return c===i?(r.consume(c),n++,l):(r.exit("thematicBreakSequence"),ar(c)?dr(r,o,"whitespace")(c):o(c))}}const Si={continuation:{tokenize:ure},exit:hre,name:"list",tokenize:lre},sre={partial:!0,tokenize:fre},ore={partial:!0,tokenize:cre};function lre(r,e,t){const n=this,i=n.events[n.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return o;function o(g){const m=n.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!n.containerState.marker||g===n.containerState.marker:g_(g)){if(n.containerState.type||(n.containerState.type=m,r.enter(m,{_container:!0})),m==="listUnordered")return r.enter("listItemPrefix"),g===42||g===45?r.check(bp,t,c)(g):c(g);if(!n.interrupt||g===49)return r.enter("listItemPrefix"),r.enter("listItemValue"),l(g)}return t(g)}function l(g){return g_(g)&&++s<10?(r.consume(g),l):(!n.interrupt||s<2)&&(n.containerState.marker?g===n.containerState.marker:g===41||g===46)?(r.exit("listItemValue"),c(g)):t(g)}function c(g){return r.enter("listItemMarker"),r.consume(g),r.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||g,r.check(Ng,n.interrupt?t:h,r.attempt(sre,v,d))}function h(g){return n.containerState.initialBlankLine=!0,a++,v(g)}function d(g){return ar(g)?(r.enter("listItemPrefixWhitespace"),r.consume(g),r.exit("listItemPrefixWhitespace"),v):t(g)}function v(g){return n.containerState.size=a+n.sliceSerialize(r.exit("listItemPrefix"),!0).length,e(g)}}function ure(r,e,t){const n=this;return n.containerState._closeFlow=void 0,r.check(Ng,i,a);function i(o){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,dr(r,e,"listItemIndent",n.containerState.size+1)(o)}function a(o){return n.containerState.furtherBlankLines||!ar(o)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,s(o)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,r.attempt(ore,e,s)(o))}function s(o){return n.containerState._closeFlow=!0,n.interrupt=void 0,dr(r,r.attempt(Si,e,t),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function cre(r,e,t){const n=this;return dr(r,i,"listItemIndent",n.containerState.size+1);function i(a){const s=n.events[n.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===n.containerState.size?e(a):t(a)}}function hre(r){r.exit(this.containerState.type)}function fre(r,e,t){const n=this;return dr(r,i,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const s=n.events[n.events.length-1];return!ar(a)&&s&&s[1].type==="listItemPrefixWhitespace"?e(a):t(a)}}const nM={name:"setextUnderline",resolveTo:dre,tokenize:vre};function dre(r,e){let t=r.length,n,i,a;for(;t--;)if(r[t][0]==="enter"){if(r[t][1].type==="content"){n=t;break}r[t][1].type==="paragraph"&&(i=t)}else r[t][1].type==="content"&&r.splice(t,1),!a&&r[t][1].type==="definition"&&(a=t);const s={type:"setextHeading",start:{...r[n][1].start},end:{...r[r.length-1][1].end}};return r[i][1].type="setextHeadingText",a?(r.splice(i,0,["enter",s,e]),r.splice(a+1,0,["exit",r[n][1],e]),r[n][1].end={...r[a][1].end}):r[n][1]=s,r.push(["exit",s,e]),r}function vre(r,e,t){const n=this;let i;return a;function a(c){let h=n.events.length,d;for(;h--;)if(n.events[h][1].type!=="lineEnding"&&n.events[h][1].type!=="linePrefix"&&n.events[h][1].type!=="content"){d=n.events[h][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||d)?(r.enter("setextHeadingLine"),i=c,s(c)):t(c)}function s(c){return r.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===i?(r.consume(c),o):(r.exit("setextHeadingLineSequence"),ar(c)?dr(r,l,"lineSuffix")(c):l(c))}function l(c){return c===null||St(c)?(r.exit("setextHeadingLine"),e(c)):t(c)}}const pre={tokenize:gre};function gre(r){const e=this,t=r.attempt(Ng,n,r.attempt(this.parser.constructs.flowInitial,i,dr(r,r.attempt(this.parser.constructs.flow,i,r.attempt(_te,i)),"linePrefix")));return t;function n(a){if(a===null){r.consume(a);return}return r.enter("lineEndingBlank"),r.consume(a),r.exit("lineEndingBlank"),e.currentConstruct=void 0,t}function i(a){if(a===null){r.consume(a);return}return r.enter("lineEnding"),r.consume(a),r.exit("lineEnding"),e.currentConstruct=void 0,t}}const mre={resolveAll:uI()},yre=lI("string"),bre=lI("text");function lI(r){return{resolveAll:uI(r==="text"?xre:void 0),tokenize:e};function e(t){const n=this,i=this.parser.constructs[r],a=t.attempt(i,s,o);return s;function s(h){return c(h)?a(h):o(h)}function o(h){if(h===null){t.consume(h);return}return t.enter("data"),t.consume(h),l}function l(h){return c(h)?(t.exit("data"),a(h)):(t.consume(h),l)}function c(h){if(h===null)return!0;const d=i[h];let v=-1;if(d)for(;++v<d.length;){const g=d[v];if(!g.previous||g.previous.call(n,n.previous))return!0}return!1}}}function uI(r){return e;function e(t,n){let i=-1,a;for(;++i<=t.length;)a===void 0?t[i]&&t[i][1].type==="data"&&(a=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==a+2&&(t[a][1].end=t[i-1][1].end,t.splice(a+2,i-a-2),i=a+2),a=void 0);return r?r(t,n):t}}function xre(r,e){let t=0;for(;++t<=r.length;)if((t===r.length||r[t][1].type==="lineEnding")&&r[t-1][1].type==="data"){const n=r[t-1][1],i=e.sliceStream(n);let a=i.length,s=-1,o=0,l;for(;a--;){const c=i[a];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)o++,s--;if(s)break;s=-1}else if(c===-2)l=!0,o++;else if(c!==-1){a++;break}}if(e._contentTypeTextTrailing&&t===r.length&&(o=0),o){const c={type:t===r.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:n.start._bufferIndex+s,_index:n.start._index+a,line:n.end.line,column:n.end.column-o,offset:n.end.offset-o},end:{...n.end}};n.end={...c.start},n.start.offset===n.end.offset?Object.assign(n,c):(r.splice(t,0,["enter",c,e],["exit",c,e]),t+=2)}t++}return r}const _re={42:Si,43:Si,45:Si,48:Si,49:Si,50:Si,51:Si,52:Si,53:Si,54:Si,55:Si,56:Si,57:Si,62:tI},wre={91:Cte},Sre={[-2]:bx,[-1]:bx,32:bx},Ere={35:Pte,42:bp,45:[nM,bp],60:kte,61:nM,95:bp,96:tM,126:tM},Tre={38:nI,92:rI},Cre={[-5]:xx,[-4]:xx,[-3]:xx,33:ere,38:nI,42:m_,60:[rte,jte],91:rre,92:[Ote,rI],93:C3,95:m_,96:pte},Are={null:[m_,mre]},Mre={null:[42,95]},Rre={null:[]},Ore=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Mre,contentInitial:wre,disable:Rre,document:_re,flow:Ere,flowInitial:Sre,insideSpan:Are,string:Tre,text:Cre},Symbol.toStringTag,{value:"Module"}));function Dre(r,e,t){let n={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const i={},a=[];let s=[],o=[];const l={attempt:E(C),check:E(M),consume:w,enter:S,exit:A,interrupt:E(M,{interrupt:!0})},c={code:null,containerState:{},defineSkip:x,events:[],now:m,parser:r,previous:null,sliceSerialize:v,sliceStream:g,write:d};let h=e.tokenize.call(c,l);return e.resolveAll&&a.push(e),c;function d(k){return s=da(s,k),y(),s[s.length-1]!==null?[]:(O(e,0),c.events=T3(a,c.events,c),c.events)}function v(k,U){return Ire(g(k),U)}function g(k){return Pre(s,k)}function m(){const{_bufferIndex:k,_index:U,line:V,column:X,offset:W}=n;return{_bufferIndex:k,_index:U,line:V,column:X,offset:W}}function x(k){i[k.line]=k.column,I()}function y(){let k;for(;n._index<s.length;){const U=s[n._index];if(typeof U=="string")for(k=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===k&&n._bufferIndex<U.length;)_(U.charCodeAt(n._bufferIndex));else _(U)}}function _(k){h=h(k)}function w(k){St(k)?(n.line++,n.column=1,n.offset+=k===-3?2:1,I()):k!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===s[n._index].length&&(n._bufferIndex=-1,n._index++)),c.previous=k}function S(k,U){const V=U||{};return V.type=k,V.start=m(),c.events.push(["enter",V,c]),o.push(V),V}function A(k){const U=o.pop();return U.end=m(),c.events.push(["exit",U,c]),U}function C(k,U){O(k,U.from)}function M(k,U){U.restore()}function E(k,U){return V;function V(X,W,P){let H,z,$,B;return Array.isArray(X)?Y(X):"tokenize"in X?Y([X]):L(X);function L(le){return ce;function ce(_e){const pe=_e!==null&&le[_e],ae=_e!==null&&le.null,oe=[...Array.isArray(pe)?pe:pe?[pe]:[],...Array.isArray(ae)?ae:ae?[ae]:[]];return Y(oe)(_e)}}function Y(le){return H=le,z=0,le.length===0?P:G(le[z])}function G(le){return ce;function ce(_e){return B=D(),$=le,le.partial||(c.currentConstruct=le),le.name&&c.parser.constructs.disable.null.includes(le.name)?ie():le.tokenize.call(U?Object.assign(Object.create(c),U):c,l,re,ie)(_e)}}function re(le){return k($,B),W}function ie(le){return B.restore(),++z<H.length?G(H[z]):P}}}function O(k,U){k.resolveAll&&!a.includes(k)&&a.push(k),k.resolve&&ss(c.events,U,c.events.length-U,k.resolve(c.events.slice(U),c)),k.resolveTo&&(c.events=k.resolveTo(c.events,c))}function D(){const k=m(),U=c.previous,V=c.currentConstruct,X=c.events.length,W=Array.from(o);return{from:X,restore:P};function P(){n=k,c.previous=U,c.currentConstruct=V,c.events.length=X,o=W,I()}}function I(){n.line in i&&n.column<2&&(n.column=i[n.line],n.offset+=i[n.line]-1)}}function Pre(r,e){const t=e.start._index,n=e.start._bufferIndex,i=e.end._index,a=e.end._bufferIndex;let s;if(t===i)s=[r[t].slice(n,a)];else{if(s=r.slice(t,i),n>-1){const o=s[0];typeof o=="string"?s[0]=o.slice(n):s.shift()}a>0&&s.push(r[i].slice(0,a))}return s}function Ire(r,e){let t=-1;const n=[];let i;for(;++t<r.length;){const a=r[t];let s;if(typeof a=="string")s=a;else switch(a){case-5:{s="\r";break}case-4:{s=`
  1696. `;break}case-3:{s=`\r
  1697. `;break}case-2:{s=e?" ":" ";break}case-1:{if(!e&&i)continue;s=" ";break}default:s=String.fromCharCode(a)}i=a===-2,n.push(s)}return n.join("")}function Nre(r){const n={constructs:Gee([Ore,...(r||{}).extensions||[]]),content:i($ee),defined:[],document:i(Zee),flow:i(pre),lazy:{},string:i(yre),text:i(bre)};return n;function i(a){return s;function s(o){return Dre(n,a,o)}}}function Lre(r){for(;!iI(r););return r}const iM=/[\0\t\n\r]/g;function kre(){let r=1,e="",t=!0,n;return i;function i(a,s,o){const l=[];let c,h,d,v,g;for(a=e+(typeof a=="string"?a.toString():new TextDecoder(s||void 0).decode(a)),d=0,e="",t&&(a.charCodeAt(0)===65279&&d++,t=void 0);d<a.length;){if(iM.lastIndex=d,c=iM.exec(a),v=c&&c.index!==void 0?c.index:a.length,g=a.charCodeAt(v),!c){e=a.slice(d);break}if(g===10&&d===v&&n)l.push(-3),n=void 0;else switch(n&&(l.push(-5),n=void 0),d<v&&(l.push(a.slice(d,v)),r+=v-d),g){case 0:{l.push(65533),r++;break}case 9:{for(h=Math.ceil(r/4)*4,l.push(-2);r++<h;)l.push(-1);break}case 10:{l.push(-4),r=1;break}default:n=!0,r=1}d=v+1}return o&&(n&&l.push(-5),e&&l.push(e),l.push(null)),l}}const Bre=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Fre(r){return r.replace(Bre,zre)}function zre(r,e,t){if(e)return e;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),a=i===120||i===88;return eI(t.slice(a?2:1),a?16:10)}return E3(t)||r}const cI={}.hasOwnProperty;function Ure(r,e,t){return e&&typeof e=="object"&&(t=e,e=void 0),Gre(t)(Lre(Nre(t).document().write(kre()(r,e,!0))))}function Gre(r){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Ye),autolinkProtocol:D,autolinkEmail:D,atxHeading:a(Re),blockQuote:a(ae),characterEscape:D,characterReference:D,codeFenced:a(oe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:a(oe,s),codeText:a(de,s),codeTextData:D,data:D,codeFlowValue:D,definition:a(ye),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:a(Ee),hardBreakEscape:a(Ne),hardBreakTrailing:a(Ne),htmlFlow:a(Be,s),htmlFlowData:D,htmlText:a(Be,s),htmlTextData:D,image:a($e),label:s,link:a(Ye),listItem:a(tt),listItemValue:v,listOrdered:a(He,d),listUnordered:a(He),paragraph:a(ot),reference:G,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:a(Re),strong:a(ct),thematicBreak:a(bt)},exit:{atxHeading:l(),atxHeadingSequence:C,autolink:l(),autolinkEmail:pe,autolinkProtocol:_e,blockQuote:l(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:le,characterReference:ce,codeFenced:l(y),codeFencedFence:x,codeFencedFenceInfo:g,codeFencedFenceMeta:m,codeFlowValue:I,codeIndented:l(_),codeText:l(W),codeTextData:I,data:I,definition:l(),definitionDestinationString:A,definitionLabelString:w,definitionTitleString:S,emphasis:l(),hardBreakEscape:l(U),hardBreakTrailing:l(U),htmlFlow:l(V),htmlFlowData:I,htmlText:l(X),htmlTextData:I,image:l(H),label:$,labelText:z,lineEnding:k,link:l(P),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:re,resourceDestinationString:B,resourceTitleString:L,resource:Y,setextHeading:l(O),setextHeadingLineSequence:E,setextHeadingText:M,strong:l(),thematicBreak:l()}};hI(e,(r||{}).mdastExtensions||[]);const t={};return n;function n(Se){let ke={type:"root",children:[]};const We={stack:[ke],tokenStack:[],config:e,enter:o,exit:c,buffer:s,resume:h,data:t},Ke=[];let rt=-1;for(;++rt<Se.length;)if(Se[rt][1].type==="listOrdered"||Se[rt][1].type==="listUnordered")if(Se[rt][0]==="enter")Ke.push(rt);else{const nt=Ke.pop();rt=i(Se,nt,rt)}for(rt=-1;++rt<Se.length;){const nt=e[Se[rt][0]];cI.call(nt,Se[rt][1].type)&&nt[Se[rt][1].type].call(Object.assign({sliceSerialize:Se[rt][2].sliceSerialize},We),Se[rt][1])}if(We.tokenStack.length>0){const nt=We.tokenStack[We.tokenStack.length-1];(nt[1]||aM).call(We,void 0,nt[0])}for(ke.position={start:Do(Se.length>0?Se[0][1].start:{line:1,column:1,offset:0}),end:Do(Se.length>0?Se[Se.length-2][1].end:{line:1,column:1,offset:0})},rt=-1;++rt<e.transforms.length;)ke=e.transforms[rt](ke)||ke;return ke}function i(Se,ke,We){let Ke=ke-1,rt=-1,nt=!1,De,Q,ne,be;for(;++Ke<=We;){const ee=Se[Ke];switch(ee[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ee[0]==="enter"?rt++:rt--,be=void 0;break}case"lineEndingBlank":{ee[0]==="enter"&&(De&&!be&&!rt&&!ne&&(ne=Ke),be=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:be=void 0}if(!rt&&ee[0]==="enter"&&ee[1].type==="listItemPrefix"||rt===-1&&ee[0]==="exit"&&(ee[1].type==="listUnordered"||ee[1].type==="listOrdered")){if(De){let se=Ke;for(Q=void 0;se--;){const Pe=Se[se];if(Pe[1].type==="lineEnding"||Pe[1].type==="lineEndingBlank"){if(Pe[0]==="exit")continue;Q&&(Se[Q][1].type="lineEndingBlank",nt=!0),Pe[1].type="lineEnding",Q=se}else if(!(Pe[1].type==="linePrefix"||Pe[1].type==="blockQuotePrefix"||Pe[1].type==="blockQuotePrefixWhitespace"||Pe[1].type==="blockQuoteMarker"||Pe[1].type==="listItemIndent"))break}ne&&(!Q||ne<Q)&&(De._spread=!0),De.end=Object.assign({},Q?Se[Q][1].start:ee[1].end),Se.splice(Q||Ke,0,["exit",De,ee[2]]),Ke++,We++}if(ee[1].type==="listItemPrefix"){const se={type:"listItem",_spread:!1,start:Object.assign({},ee[1].start),end:void 0};De=se,Se.splice(Ke,0,["enter",se,ee[2]]),Ke++,We++,ne=void 0,be=!0}}}return Se[ke][1]._spread=nt,We}function a(Se,ke){return We;function We(Ke){o.call(this,Se(Ke),Ke),ke&&ke.call(this,Ke)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(Se,ke,We){this.stack[this.stack.length-1].children.push(Se),this.stack.push(Se),this.tokenStack.push([ke,We||void 0]),Se.position={start:Do(ke.start),end:void 0}}function l(Se){return ke;function ke(We){Se&&Se.call(this,We),c.call(this,We)}}function c(Se,ke){const We=this.stack.pop(),Ke=this.tokenStack.pop();if(Ke)Ke[0].type!==Se.type&&(ke?ke.call(this,Se,Ke[0]):(Ke[1]||aM).call(this,Se,Ke[0]));else throw new Error("Cannot close `"+Se.type+"` ("+Hf({start:Se.start,end:Se.end})+"): it’s not open");We.position.end=Do(Se.end)}function h(){return zee(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function v(Se){if(this.data.expectingFirstListItemValue){const ke=this.stack[this.stack.length-2];ke.start=Number.parseInt(this.sliceSerialize(Se),10),this.data.expectingFirstListItemValue=void 0}}function g(){const Se=this.resume(),ke=this.stack[this.stack.length-1];ke.lang=Se}function m(){const Se=this.resume(),ke=this.stack[this.stack.length-1];ke.meta=Se}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const Se=this.resume(),ke=this.stack[this.stack.length-1];ke.value=Se.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const Se=this.resume(),ke=this.stack[this.stack.length-1];ke.value=Se.replace(/(\r?\n|\r)$/g,"")}function w(Se){const ke=this.resume(),We=this.stack[this.stack.length-1];We.label=ke,We.identifier=Lc(this.sliceSerialize(Se)).toLowerCase()}function S(){const Se=this.resume(),ke=this.stack[this.stack.length-1];ke.title=Se}function A(){const Se=this.resume(),ke=this.stack[this.stack.length-1];ke.url=Se}function C(Se){const ke=this.stack[this.stack.length-1];if(!ke.depth){const We=this.sliceSerialize(Se).length;ke.depth=We}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function E(Se){const ke=this.stack[this.stack.length-1];ke.depth=this.sliceSerialize(Se).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function D(Se){const We=this.stack[this.stack.length-1].children;let Ke=We[We.length-1];(!Ke||Ke.type!=="text")&&(Ke=Ze(),Ke.position={start:Do(Se.start),end:void 0},We.push(Ke)),this.stack.push(Ke)}function I(Se){const ke=this.stack.pop();ke.value+=this.sliceSerialize(Se),ke.position.end=Do(Se.end)}function k(Se){const ke=this.stack[this.stack.length-1];if(this.data.atHardBreak){const We=ke.children[ke.children.length-1];We.position.end=Do(Se.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(ke.type)&&(D.call(this,Se),I.call(this,Se))}function U(){this.data.atHardBreak=!0}function V(){const Se=this.resume(),ke=this.stack[this.stack.length-1];ke.value=Se}function X(){const Se=this.resume(),ke=this.stack[this.stack.length-1];ke.value=Se}function W(){const Se=this.resume(),ke=this.stack[this.stack.length-1];ke.value=Se}function P(){const Se=this.stack[this.stack.length-1];if(this.data.inReference){const ke=this.data.referenceType||"shortcut";Se.type+="Reference",Se.referenceType=ke,delete Se.url,delete Se.title}else delete Se.identifier,delete Se.label;this.data.referenceType=void 0}function H(){const Se=this.stack[this.stack.length-1];if(this.data.inReference){const ke=this.data.referenceType||"shortcut";Se.type+="Reference",Se.referenceType=ke,delete Se.url,delete Se.title}else delete Se.identifier,delete Se.label;this.data.referenceType=void 0}function z(Se){const ke=this.sliceSerialize(Se),We=this.stack[this.stack.length-2];We.label=Fre(ke),We.identifier=Lc(ke).toLowerCase()}function $(){const Se=this.stack[this.stack.length-1],ke=this.resume(),We=this.stack[this.stack.length-1];if(this.data.inReference=!0,We.type==="link"){const Ke=Se.children;We.children=Ke}else We.alt=ke}function B(){const Se=this.resume(),ke=this.stack[this.stack.length-1];ke.url=Se}function L(){const Se=this.resume(),ke=this.stack[this.stack.length-1];ke.title=Se}function Y(){this.data.inReference=void 0}function G(){this.data.referenceType="collapsed"}function re(Se){const ke=this.resume(),We=this.stack[this.stack.length-1];We.label=ke,We.identifier=Lc(this.sliceSerialize(Se)).toLowerCase(),this.data.referenceType="full"}function ie(Se){this.data.characterReferenceType=Se.type}function le(Se){const ke=this.sliceSerialize(Se),We=this.data.characterReferenceType;let Ke;We?(Ke=eI(ke,We==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ke=E3(ke);const rt=this.stack[this.stack.length-1];rt.value+=Ke}function ce(Se){const ke=this.stack.pop();ke.position.end=Do(Se.end)}function _e(Se){I.call(this,Se);const ke=this.stack[this.stack.length-1];ke.url=this.sliceSerialize(Se)}function pe(Se){I.call(this,Se);const ke=this.stack[this.stack.length-1];ke.url="mailto:"+this.sliceSerialize(Se)}function ae(){return{type:"blockquote",children:[]}}function oe(){return{type:"code",lang:null,meta:null,value:""}}function de(){return{type:"inlineCode",value:""}}function ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ee(){return{type:"emphasis",children:[]}}function Re(){return{type:"heading",depth:0,children:[]}}function Ne(){return{type:"break"}}function Be(){return{type:"html",value:""}}function $e(){return{type:"image",title:null,url:"",alt:null}}function Ye(){return{type:"link",title:null,url:"",children:[]}}function He(Se){return{type:"list",ordered:Se.type==="listOrdered",start:null,spread:Se._spread,children:[]}}function tt(Se){return{type:"listItem",spread:Se._spread,checked:null,children:[]}}function ot(){return{type:"paragraph",children:[]}}function ct(){return{type:"strong",children:[]}}function Ze(){return{type:"text",value:""}}function bt(){return{type:"thematicBreak"}}}function Do(r){return{line:r.line,column:r.column,offset:r.offset}}function hI(r,e){let t=-1;for(;++t<e.length;){const n=e[t];Array.isArray(n)?hI(r,n):Hre(r,n)}}function Hre(r,e){let t;for(t in e)if(cI.call(e,t))switch(t){case"canContainEols":{const n=e[t];n&&r[t].push(...n);break}case"transforms":{const n=e[t];n&&r[t].push(...n);break}case"enter":case"exit":{const n=e[t];n&&Object.assign(r[t],n);break}}}function aM(r,e){throw r?new Error("Cannot close `"+r.type+"` ("+Hf({start:r.start,end:r.end})+"): a different token (`"+e.type+"`, "+Hf({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+Hf({start:e.start,end:e.end})+") is still open")}function jre(r){const e=this;e.parser=t;function t(n){return Ure(n,{...e.data("settings"),...r,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function Vre(r,e){const t={type:"element",tagName:"blockquote",properties:{},children:r.wrap(r.all(e),!0)};return r.patch(e,t),r.applyData(e,t)}function qre(r,e){const t={type:"element",tagName:"br",properties:{},children:[]};return r.patch(e,t),[r.applyData(e,t),{type:"text",value:`
  1698. `}]}function Xre(r,e){const t=e.value?e.value+`
  1699. `:"",n={},i=e.lang?e.lang.split(/\s+/):[];i.length>0&&(n.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:n,children:[{type:"text",value:t}]};return e.meta&&(a.data={meta:e.meta}),r.patch(e,a),a=r.applyData(e,a),a={type:"element",tagName:"pre",properties:{},children:[a]},r.patch(e,a),a}function Yre(r,e){const t={type:"element",tagName:"del",properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}function Wre(r,e){const t={type:"element",tagName:"em",properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}function $re(r,e){const t=typeof r.options.clobberPrefix=="string"?r.options.clobberPrefix:"user-content-",n=String(e.identifier).toUpperCase(),i=ch(n.toLowerCase()),a=r.footnoteOrder.indexOf(n);let s,o=r.footnoteCounts.get(n);o===void 0?(o=0,r.footnoteOrder.push(n),s=r.footnoteOrder.length):s=a+1,o+=1,r.footnoteCounts.set(n,o);const l={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+i,id:t+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};r.patch(e,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return r.patch(e,c),r.applyData(e,c)}function Kre(r,e){const t={type:"element",tagName:"h"+e.depth,properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}function Zre(r,e){if(r.options.allowDangerousHtml){const t={type:"raw",value:e.value};return r.patch(e,t),r.applyData(e,t)}}function fI(r,e){const t=e.referenceType;let n="]";if(t==="collapsed"?n+="[]":t==="full"&&(n+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+n}];const i=r.all(e),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=n:i.push({type:"text",value:n}),i}function Qre(r,e){const t=String(e.identifier).toUpperCase(),n=r.definitionById.get(t);if(!n)return fI(r,e);const i={src:ch(n.url||""),alt:e.alt};n.title!==null&&n.title!==void 0&&(i.title=n.title);const a={type:"element",tagName:"img",properties:i,children:[]};return r.patch(e,a),r.applyData(e,a)}function Jre(r,e){const t={src:ch(e.url)};e.alt!==null&&e.alt!==void 0&&(t.alt=e.alt),e.title!==null&&e.title!==void 0&&(t.title=e.title);const n={type:"element",tagName:"img",properties:t,children:[]};return r.patch(e,n),r.applyData(e,n)}function ene(r,e){const t={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};r.patch(e,t);const n={type:"element",tagName:"code",properties:{},children:[t]};return r.patch(e,n),r.applyData(e,n)}function tne(r,e){const t=String(e.identifier).toUpperCase(),n=r.definitionById.get(t);if(!n)return fI(r,e);const i={href:ch(n.url||"")};n.title!==null&&n.title!==void 0&&(i.title=n.title);const a={type:"element",tagName:"a",properties:i,children:r.all(e)};return r.patch(e,a),r.applyData(e,a)}function rne(r,e){const t={href:ch(e.url)};e.title!==null&&e.title!==void 0&&(t.title=e.title);const n={type:"element",tagName:"a",properties:t,children:r.all(e)};return r.patch(e,n),r.applyData(e,n)}function nne(r,e,t){const n=r.all(e),i=t?ine(t):dI(e),a={},s=[];if(typeof e.checked=="boolean"){const h=n[0];let d;h&&h.type==="element"&&h.tagName==="p"?d=h:(d={type:"element",tagName:"p",properties:{},children:[]},n.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let o=-1;for(;++o<n.length;){const h=n[o];(i||o!==0||h.type!=="element"||h.tagName!=="p")&&s.push({type:"text",value:`
  1700. `}),h.type==="element"&&h.tagName==="p"&&!i?s.push(...h.children):s.push(h)}const l=n[n.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
  1701. `});const c={type:"element",tagName:"li",properties:a,children:s};return r.patch(e,c),r.applyData(e,c)}function ine(r){let e=!1;if(r.type==="list"){e=r.spread||!1;const t=r.children;let n=-1;for(;!e&&++n<t.length;)e=dI(t[n])}return e}function dI(r){const e=r.spread;return e??r.children.length>1}function ane(r,e){const t={},n=r.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(t.start=e.start);++i<n.length;){const s=n[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const a={type:"element",tagName:e.ordered?"ol":"ul",properties:t,children:r.wrap(n,!0)};return r.patch(e,a),r.applyData(e,a)}function sne(r,e){const t={type:"element",tagName:"p",properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}function one(r,e){const t={type:"root",children:r.wrap(r.all(e))};return r.patch(e,t),r.applyData(e,t)}function lne(r,e){const t={type:"element",tagName:"strong",properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}function une(r,e){const t=r.all(e),n=t.shift(),i=[];if(n){const s={type:"element",tagName:"thead",properties:{},children:r.wrap([n],!0)};r.patch(e.children[0],s),i.push(s)}if(t.length>0){const s={type:"element",tagName:"tbody",properties:{},children:r.wrap(t,!0)},o=x3(e.children[1]),l=YP(e.children[e.children.length-1]);o&&l&&(s.position={start:o,end:l}),i.push(s)}const a={type:"element",tagName:"table",properties:{},children:r.wrap(i,!0)};return r.patch(e,a),r.applyData(e,a)}function cne(r,e,t){const n=t?t.children:void 0,a=(n?n.indexOf(e):1)===0?"th":"td",s=t&&t.type==="table"?t.align:void 0,o=s?s.length:e.children.length;let l=-1;const c=[];for(;++l<o;){const d=e.children[l],v={},g=s?s[l]:void 0;g&&(v.align=g);let m={type:"element",tagName:a,properties:v,children:[]};d&&(m.children=r.all(d),r.patch(d,m),m=r.applyData(d,m)),c.push(m)}const h={type:"element",tagName:"tr",properties:{},children:r.wrap(c,!0)};return r.patch(e,h),r.applyData(e,h)}function hne(r,e){const t={type:"element",tagName:"td",properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}const sM=9,oM=32;function fne(r){const e=String(r),t=/\r?\n|\r/g;let n=t.exec(e),i=0;const a=[];for(;n;)a.push(lM(e.slice(i,n.index),i>0,!0),n[0]),i=n.index+n[0].length,n=t.exec(e);return a.push(lM(e.slice(i),i>0,!1)),a.join("")}function lM(r,e,t){let n=0,i=r.length;if(e){let a=r.codePointAt(n);for(;a===sM||a===oM;)n++,a=r.codePointAt(n)}if(t){let a=r.codePointAt(i-1);for(;a===sM||a===oM;)i--,a=r.codePointAt(i-1)}return i>n?r.slice(n,i):""}function dne(r,e){const t={type:"text",value:fne(String(e.value))};return r.patch(e,t),r.applyData(e,t)}function vne(r,e){const t={type:"element",tagName:"hr",properties:{},children:[]};return r.patch(e,t),r.applyData(e,t)}const pne={blockquote:Vre,break:qre,code:Xre,delete:Yre,emphasis:Wre,footnoteReference:$re,heading:Kre,html:Zre,imageReference:Qre,image:Jre,inlineCode:ene,linkReference:tne,link:rne,listItem:nne,list:ane,paragraph:sne,root:one,strong:lne,table:une,tableCell:hne,tableRow:cne,text:dne,thematicBreak:vne,toml:Gv,yaml:Gv,definition:Gv,footnoteDefinition:Gv};function Gv(){}const vI=-1,Lg=0,Vf=1,Xp=2,A3=3,M3=4,R3=5,O3=6,pI=7,gI=8,uM=typeof self=="object"?self:globalThis,gne=(r,e)=>{const t=(i,a)=>(r.set(a,i),i),n=i=>{if(r.has(i))return r.get(i);const[a,s]=e[i];switch(a){case Lg:case vI:return t(s,i);case Vf:{const o=t([],i);for(const l of s)o.push(n(l));return o}case Xp:{const o=t({},i);for(const[l,c]of s)o[n(l)]=n(c);return o}case A3:return t(new Date(s),i);case M3:{const{source:o,flags:l}=s;return t(new RegExp(o,l),i)}case R3:{const o=t(new Map,i);for(const[l,c]of s)o.set(n(l),n(c));return o}case O3:{const o=t(new Set,i);for(const l of s)o.add(n(l));return o}case pI:{const{name:o,message:l}=s;return t(new uM[o](l),i)}case gI:return t(BigInt(s),i);case"BigInt":return t(Object(BigInt(s)),i);case"ArrayBuffer":return t(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:o}=new Uint8Array(s);return t(new DataView(o),s)}}return t(new uM[a](s),i)};return n},cM=r=>gne(new Map,r)(0),xc="",{toString:mne}={},{keys:yne}=Object,Cf=r=>{const e=typeof r;if(e!=="object"||!r)return[Lg,e];const t=mne.call(r).slice(8,-1);switch(t){case"Array":return[Vf,xc];case"Object":return[Xp,xc];case"Date":return[A3,xc];case"RegExp":return[M3,xc];case"Map":return[R3,xc];case"Set":return[O3,xc];case"DataView":return[Vf,t]}return t.includes("Array")?[Vf,t]:t.includes("Error")?[pI,t]:[Xp,t]},Hv=([r,e])=>r===Lg&&(e==="function"||e==="symbol"),bne=(r,e,t,n)=>{const i=(s,o)=>{const l=n.push(s)-1;return t.set(o,l),l},a=s=>{if(t.has(s))return t.get(s);let[o,l]=Cf(s);switch(o){case Lg:{let h=s;switch(l){case"bigint":o=gI,h=s.toString();break;case"function":case"symbol":if(r)throw new TypeError("unable to serialize "+l);h=null;break;case"undefined":return i([vI],s)}return i([o,h],s)}case Vf:{if(l){let v=s;return l==="DataView"?v=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(v=new Uint8Array(s)),i([l,[...v]],s)}const h=[],d=i([o,h],s);for(const v of s)h.push(a(v));return d}case Xp:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(e&&"toJSON"in s)return a(s.toJSON());const h=[],d=i([o,h],s);for(const v of yne(s))(r||!Hv(Cf(s[v])))&&h.push([a(v),a(s[v])]);return d}case A3:return i([o,s.toISOString()],s);case M3:{const{source:h,flags:d}=s;return i([o,{source:h,flags:d}],s)}case R3:{const h=[],d=i([o,h],s);for(const[v,g]of s)(r||!(Hv(Cf(v))||Hv(Cf(g))))&&h.push([a(v),a(g)]);return d}case O3:{const h=[],d=i([o,h],s);for(const v of s)(r||!Hv(Cf(v)))&&h.push(a(v));return d}}const{message:c}=s;return i([o,{name:l,message:c}],s)};return a},hM=(r,{json:e,lossy:t}={})=>{const n=[];return bne(!(e||t),!!e,new Map,n)(r),n},Yp=typeof structuredClone=="function"?(r,e)=>e&&("json"in e||"lossy"in e)?cM(hM(r,e)):structuredClone(r):(r,e)=>cM(hM(r,e));function xne(r,e){const t=[{type:"text",value:"↩"}];return e>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),t}function _ne(r,e){return"Back to reference "+(r+1)+(e>1?"-"+e:"")}function wne(r){const e=typeof r.options.clobberPrefix=="string"?r.options.clobberPrefix:"user-content-",t=r.options.footnoteBackContent||xne,n=r.options.footnoteBackLabel||_ne,i=r.options.footnoteLabel||"Footnotes",a=r.options.footnoteLabelTagName||"h2",s=r.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l<r.footnoteOrder.length;){const c=r.footnoteById.get(r.footnoteOrder[l]);if(!c)continue;const h=r.all(c),d=String(c.identifier).toUpperCase(),v=ch(d.toLowerCase());let g=0;const m=[],x=r.footnoteCounts.get(d);for(;x!==void 0&&++g<=x;){m.length>0&&m.push({type:"text",value:" "});let w=typeof t=="string"?t:t(l,g);typeof w=="string"&&(w={type:"text",value:w}),m.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+v+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof n=="string"?n:n(l,g),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const y=h[h.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const w=y.children[y.children.length-1];w&&w.type==="text"?w.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...m)}else h.push(...m);const _={type:"element",tagName:"li",properties:{id:e+"fn-"+v},children:r.wrap(h,!0)};r.patch(c,_),o.push(_)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Yp(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
  1702. `},{type:"element",tagName:"ol",properties:{},children:r.wrap(o,!0)},{type:"text",value:`
  1703. `}]}}const D3=(function(r){if(r==null)return Cne;if(typeof r=="function")return kg(r);if(typeof r=="object")return Array.isArray(r)?Sne(r):Ene(r);if(typeof r=="string")return Tne(r);throw new Error("Expected function, string, or object as test")});function Sne(r){const e=[];let t=-1;for(;++t<r.length;)e[t]=D3(r[t]);return kg(n);function n(...i){let a=-1;for(;++a<e.length;)if(e[a].apply(this,i))return!0;return!1}}function Ene(r){const e=r;return kg(t);function t(n){const i=n;let a;for(a in r)if(i[a]!==e[a])return!1;return!0}}function Tne(r){return kg(e);function e(t){return t&&t.type===r}}function kg(r){return e;function e(t,n,i){return!!(Ane(t)&&r.call(this,t,typeof n=="number"?n:void 0,i||void 0))}}function Cne(){return!0}function Ane(r){return r!==null&&typeof r=="object"&&"type"in r}const mI=[],Mne=!0,fM=!1,yI="skip";function bI(r,e,t,n){let i;typeof e=="function"&&typeof t!="function"?(n=t,t=e):i=e;const a=D3(i),s=n?-1:1;o(r,void 0,[])();function o(l,c,h){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const g=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(l.type+(g?"<"+g+">":""))+")"})}return v;function v(){let g=mI,m,x,y;if((!e||a(l,c,h[h.length-1]||void 0))&&(g=Rne(t(l,h)),g[0]===fM))return g;if("children"in l&&l.children){const _=l;if(_.children&&g[0]!==yI)for(x=(n?_.children.length:-1)+s,y=h.concat(_);x>-1&&x<_.children.length;){const w=_.children[x];if(m=o(w,x,y)(),m[0]===fM)return m;x=typeof m[1]=="number"?m[1]:x+s}}return g}}}function Rne(r){return Array.isArray(r)?r:typeof r=="number"?[Mne,r]:r==null?mI:[r]}function xI(r,e,t,n){let i,a,s;typeof e=="function"&&typeof t!="function"?(a=void 0,s=e,i=t):(a=e,s=t,i=n),bI(r,a,o,i);function o(l,c){const h=c[c.length-1],d=h?h.children.indexOf(l):void 0;return s(l,d,h)}}const y_={}.hasOwnProperty,One={};function Dne(r,e){const t=e||One,n=new Map,i=new Map,a=new Map,s={...pne,...t.handlers},o={all:c,applyData:Ine,definitionById:n,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:s,one:l,options:t,patch:Pne,wrap:Lne};return xI(r,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const d=h.type==="definition"?n:i,v=String(h.identifier).toUpperCase();d.has(v)||d.set(v,h)}}),o;function l(h,d){const v=h.type,g=o.handlers[v];if(y_.call(o.handlers,v)&&g)return g(o,h,d);if(o.options.passThrough&&o.options.passThrough.includes(v)){if("children"in h){const{children:x,...y}=h,_=Yp(y);return _.children=o.all(h),_}return Yp(h)}return(o.options.unknownHandler||Nne)(o,h,d)}function c(h){const d=[];if("children"in h){const v=h.children;let g=-1;for(;++g<v.length;){const m=o.one(v[g],h);if(m){if(g&&v[g-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=dM(m.value)),!Array.isArray(m)&&m.type==="element")){const x=m.children[0];x&&x.type==="text"&&(x.value=dM(x.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function Pne(r,e){r.position&&(e.position=mee(r))}function Ine(r,e){let t=e;if(r&&r.data){const n=r.data.hName,i=r.data.hChildren,a=r.data.hProperties;if(typeof n=="string")if(t.type==="element")t.tagName=n;else{const s="children"in t?t.children:[t];t={type:"element",tagName:n,properties:{},children:s}}t.type==="element"&&a&&Object.assign(t.properties,Yp(a)),"children"in t&&t.children&&i!==null&&i!==void 0&&(t.children=i)}return t}function Nne(r,e){const t=e.data||{},n="value"in e&&!(y_.call(t,"hProperties")||y_.call(t,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:r.all(e)};return r.patch(e,n),r.applyData(e,n)}function Lne(r,e){const t=[];let n=-1;for(e&&t.push({type:"text",value:`
  1704. `});++n<r.length;)n&&t.push({type:"text",value:`
  1705. `}),t.push(r[n]);return e&&r.length>0&&t.push({type:"text",value:`
  1706. `}),t}function dM(r){let e=0,t=r.charCodeAt(e);for(;t===9||t===32;)e++,t=r.charCodeAt(e);return r.slice(e)}function vM(r,e){const t=Dne(r,e),n=t.one(r,void 0),i=wne(t),a=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
  1707. `},i),a}function kne(r,e){return r&&"run"in r?async function(t,n){const i=vM(t,{file:n,...e});await r.run(i,n)}:function(t,n){return vM(t,{file:n,...r||e})}}function pM(r){if(r)throw r}var _x,gM;function Bne(){if(gM)return _x;gM=1;var r=Object.prototype.hasOwnProperty,e=Object.prototype.toString,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):e.call(c)==="[object Array]"},a=function(c){if(!c||e.call(c)!=="[object Object]")return!1;var h=r.call(c,"constructor"),d=c.constructor&&c.constructor.prototype&&r.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!h&&!d)return!1;var v;for(v in c);return typeof v>"u"||r.call(c,v)},s=function(c,h){t&&h.name==="__proto__"?t(c,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):c[h.name]=h.newValue},o=function(c,h){if(h==="__proto__")if(r.call(c,h)){if(n)return n(c,h).value}else return;return c[h]};return _x=function l(){var c,h,d,v,g,m,x=arguments[0],y=1,_=arguments.length,w=!1;for(typeof x=="boolean"&&(w=x,x=arguments[1]||{},y=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});y<_;++y)if(c=arguments[y],c!=null)for(h in c)d=o(x,h),v=o(c,h),x!==v&&(w&&v&&(a(v)||(g=i(v)))?(g?(g=!1,m=d&&i(d)?d:[]):m=d&&a(d)?d:{},s(x,{name:h,newValue:l(w,m,v)})):typeof v<"u"&&s(x,{name:h,newValue:v}));return x},_x}var Fne=Bne();const wx=cl(Fne);function b_(r){if(typeof r!="object"||r===null)return!1;const e=Object.getPrototypeOf(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)}function zne(){const r=[],e={run:t,use:n};return e;function t(...i){let a=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);o(null,...i);function o(l,...c){const h=r[++a];let d=-1;if(l){s(l);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,h?Une(h,o)(...c):s(null,...c)}}function n(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return r.push(i),e}}function Une(r,e){let t;return n;function n(...s){const o=r.length>s.length;let l;o&&s.push(i);try{l=r.apply(this,s)}catch(c){const h=c;if(o&&t)throw h;return i(h)}o||(l&&l.then&&typeof l.then=="function"?l.then(a,i):l instanceof Error?i(l):a(l))}function i(s,...o){t||(t=!0,e(s,...o))}function a(s){i(null,s)}}const Wa={basename:Gne,dirname:Hne,extname:jne,join:Vne,sep:"/"};function Gne(r,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');zd(r);let t=0,n=-1,i=r.length,a;if(e===void 0||e.length===0||e.length>r.length){for(;i--;)if(r.codePointAt(i)===47){if(a){t=i+1;break}}else n<0&&(a=!0,n=i+1);return n<0?"":r.slice(t,n)}if(e===r)return"";let s=-1,o=e.length-1;for(;i--;)if(r.codePointAt(i)===47){if(a){t=i+1;break}}else s<0&&(a=!0,s=i+1),o>-1&&(r.codePointAt(i)===e.codePointAt(o--)?o<0&&(n=i):(o=-1,n=s));return t===n?n=s:n<0&&(n=r.length),r.slice(t,n)}function Hne(r){if(zd(r),r.length===0)return".";let e=-1,t=r.length,n;for(;--t;)if(r.codePointAt(t)===47){if(n){e=t;break}}else n||(n=!0);return e<0?r.codePointAt(0)===47?"/":".":e===1&&r.codePointAt(0)===47?"//":r.slice(0,e)}function jne(r){zd(r);let e=r.length,t=-1,n=0,i=-1,a=0,s;for(;e--;){const o=r.codePointAt(e);if(o===47){if(s){n=e+1;break}continue}t<0&&(s=!0,t=e+1),o===46?i<0?i=e:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||t<0||a===0||a===1&&i===t-1&&i===n+1?"":r.slice(i,t)}function Vne(...r){let e=-1,t;for(;++e<r.length;)zd(r[e]),r[e]&&(t=t===void 0?r[e]:t+"/"+r[e]);return t===void 0?".":qne(t)}function qne(r){zd(r);const e=r.codePointAt(0)===47;let t=Xne(r,!e);return t.length===0&&!e&&(t="."),t.length>0&&r.codePointAt(r.length-1)===47&&(t+="/"),e?"/"+t:t}function Xne(r,e){let t="",n=0,i=-1,a=0,s=-1,o,l;for(;++s<=r.length;){if(s<r.length)o=r.codePointAt(s);else{if(o===47)break;o=47}if(o===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(t.length<2||n!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(l=t.lastIndexOf("/"),l!==t.length-1){l<0?(t="",n=0):(t=t.slice(0,l),n=t.length-1-t.lastIndexOf("/")),i=s,a=0;continue}}else if(t.length>0){t="",n=0,i=s,a=0;continue}}e&&(t=t.length>0?t+"/..":"..",n=2)}else t.length>0?t+="/"+r.slice(i+1,s):t=r.slice(i+1,s),n=s-i-1;i=s,a=0}else o===46&&a>-1?a++:a=-1}return t}function zd(r){if(typeof r!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(r))}const Yne={cwd:Wne};function Wne(){return"/"}function x_(r){return!!(r!==null&&typeof r=="object"&&"href"in r&&r.href&&"protocol"in r&&r.protocol&&r.auth===void 0)}function $ne(r){if(typeof r=="string")r=new URL(r);else if(!x_(r)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+r+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(r.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return Kne(r)}function Kne(r){if(r.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const e=r.pathname;let t=-1;for(;++t<e.length;)if(e.codePointAt(t)===37&&e.codePointAt(t+1)===50){const n=e.codePointAt(t+2);if(n===70||n===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const Sx=["history","path","basename","stem","extname","dirname"];class _I{constructor(e){let t;e?x_(e)?t={path:e}:typeof e=="string"||Zne(e)?t={value:e}:t=e:t={},this.cwd="cwd"in t?"":Yne.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Sx.length;){const a=Sx[n];a in t&&t[a]!==void 0&&t[a]!==null&&(this[a]=a==="history"?[...t[a]]:t[a])}let i;for(i in t)Sx.includes(i)||(this[i]=t[i])}get basename(){return typeof this.path=="string"?Wa.basename(this.path):void 0}set basename(e){Tx(e,"basename"),Ex(e,"basename"),this.path=Wa.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?Wa.dirname(this.path):void 0}set dirname(e){mM(this.basename,"dirname"),this.path=Wa.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?Wa.extname(this.path):void 0}set extname(e){if(Ex(e,"extname"),mM(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Wa.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){x_(e)&&(e=$ne(e)),Tx(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?Wa.basename(this.path,this.extname):void 0}set stem(e){Tx(e,"stem"),Ex(e,"stem"),this.path=Wa.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const i=this.message(e,t,n);throw i.fatal=!0,i}info(e,t,n){const i=this.message(e,t,n);return i.fatal=void 0,i}message(e,t,n){const i=new ai(e,t,n);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function Ex(r,e){if(r&&r.includes(Wa.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+Wa.sep+"`")}function Tx(r,e){if(!r)throw new Error("`"+e+"` cannot be empty")}function mM(r,e){if(!r)throw new Error("Setting `"+e+"` requires `path` to be set too")}function Zne(r){return!!(r&&typeof r=="object"&&"byteLength"in r&&"byteOffset"in r)}const Qne=(function(r){const n=this.constructor.prototype,i=n[r],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,n),a}),Jne={}.hasOwnProperty;class P3 extends Qne{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=zne()}copy(){const e=new P3;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(wx(!0,{},this.namespace)),e}data(e,t){return typeof e=="string"?arguments.length===2?(Mx("data",this.frozen),this.namespace[e]=t,this):Jne.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Mx("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);const i=t.call(e,...n);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=jv(e),n=this.parser||this.Parser;return Cx("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),Cx("process",this.parser||this.Parser),Ax("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(a,s){const o=jv(e),l=n.parse(o);n.run(l,o,function(h,d,v){if(h||!d||!v)return c(h);const g=d,m=n.stringify(g,v);rie(m)?v.value=m:v.result=m,c(h,v)});function c(h,d){h||!d?s(h):a?a(d):t(void 0,d)}}}processSync(e){let t=!1,n;return this.freeze(),Cx("processSync",this.parser||this.Parser),Ax("processSync",this.compiler||this.Compiler),this.process(e,i),bM("processSync","process",t),n;function i(a,s){t=!0,pM(a),n=s}}run(e,t,n){yM(e),this.freeze();const i=this.transformers;return!n&&typeof t=="function"&&(n=t,t=void 0),n?a(void 0,n):new Promise(a);function a(s,o){const l=jv(t);i.run(e,l,c);function c(h,d,v){const g=d||e;h?o(h):s?s(g):n(void 0,g,v)}}}runSync(e,t){let n=!1,i;return this.run(e,t,a),bM("runSync","run",n),i;function a(s,o){pM(s),i=o,n=!0}}stringify(e,t){this.freeze();const n=jv(t),i=this.compiler||this.Compiler;return Ax("stringify",i),yM(e),i(e,n)}use(e,...t){const n=this.attachers,i=this.namespace;if(Mx("use",this.frozen),e!=null)if(typeof e=="function")l(e,t);else if(typeof e=="object")Array.isArray(e)?o(e):s(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function a(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[h,...d]=c;l(h,d)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(c.plugins),c.settings&&(i.settings=wx(!0,i.settings,c.settings))}function o(c){let h=-1;if(c!=null)if(Array.isArray(c))for(;++h<c.length;){const d=c[h];a(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,h){let d=-1,v=-1;for(;++d<n.length;)if(n[d][0]===c){v=d;break}if(v===-1)n.push([c,...h]);else if(h.length>0){let[g,...m]=h;const x=n[v][1];b_(x)&&b_(g)&&(g=wx(!0,x,g)),n[v]=[c,g,...m]}}}}const eie=new P3().freeze();function Cx(r,e){if(typeof e!="function")throw new TypeError("Cannot `"+r+"` without `parser`")}function Ax(r,e){if(typeof e!="function")throw new TypeError("Cannot `"+r+"` without `compiler`")}function Mx(r,e){if(e)throw new Error("Cannot call `"+r+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function yM(r){if(!b_(r)||typeof r.type!="string")throw new TypeError("Expected node, got `"+r+"`")}function bM(r,e,t){if(!t)throw new Error("`"+r+"` finished async. Use `"+e+"` instead")}function jv(r){return tie(r)?r:new _I(r)}function tie(r){return!!(r&&typeof r=="object"&&"message"in r&&"messages"in r)}function rie(r){return typeof r=="string"||nie(r)}function nie(r){return!!(r&&typeof r=="object"&&"byteLength"in r&&"byteOffset"in r)}const iie="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",xM=[],_M={allowDangerousHtml:!0},aie=/^(https?|ircs?|mailto|xmpp)$/i,sie=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function oie(r){const e=lie(r),t=uie(r);return cie(e.runSync(e.parse(t),t),r)}function lie(r){const e=r.rehypePlugins||xM,t=r.remarkPlugins||xM,n=r.remarkRehypeOptions?{...r.remarkRehypeOptions,..._M}:_M;return eie().use(jre).use(t).use(kne,n).use(e)}function uie(r){const e=r.children||"",t=new _I;return typeof e=="string"&&(t.value=e),t}function cie(r,e){const t=e.allowedElements,n=e.allowElement,i=e.components,a=e.disallowedElements,s=e.skipHtml,o=e.unwrapDisallowed,l=e.urlTransform||hie;for(const h of sie)Object.hasOwn(e,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+iie+h.id,void 0);return xI(r,c),wee(r,{Fragment:N.Fragment,components:i,ignoreInvalidStyle:!0,jsx:N.jsx,jsxs:N.jsxs,passKeys:!0,passNode:!0});function c(h,d,v){if(h.type==="raw"&&v&&typeof d=="number")return s?v.children.splice(d,1):v.children[d]={type:"text",value:h.value},d;if(h.type==="element"){let g;for(g in yx)if(Object.hasOwn(yx,g)&&Object.hasOwn(h.properties,g)){const m=h.properties[g],x=yx[g];(x===null||x.includes(h.tagName))&&(h.properties[g]=l(String(m||""),g,h))}}if(h.type==="element"){let g=t?!t.includes(h.tagName):a?a.includes(h.tagName):!1;if(!g&&n&&typeof d=="number"&&(g=!n(h,d,v)),g&&v&&typeof d=="number")return o&&h.children?v.children.splice(d,1,...h.children):v.children.splice(d,1),d}}}function hie(r){const e=r.indexOf(":"),t=r.indexOf("?"),n=r.indexOf("#"),i=r.indexOf("/");return e===-1||i!==-1&&e>i||t!==-1&&e>t||n!==-1&&e>n||aie.test(r.slice(0,e))?r:""}const wM=/[#.]/g;function fie(r,e){const t=r||"",n={};let i=0,a,s;for(;i<t.length;){wM.lastIndex=i;const o=wM.exec(t),l=t.slice(i,o?o.index:t.length);l&&(a?a==="#"?n.id=l:Array.isArray(n.className)?n.className.push(l):n.className=[l]:s=l,i+=l.length),o&&(a=o[0],i++)}return{type:"element",tagName:s||e||"div",properties:n,children:[]}}function wI(r,e,t){const n=t?gie(t):void 0;function i(a,s,...o){let l;if(a==null){l={type:"root",children:[]};const c=s;o.unshift(c)}else{l=fie(a,e);const c=l.tagName.toLowerCase(),h=n?n.get(c):void 0;if(l.tagName=h||c,die(s))o.unshift(s);else for(const[d,v]of Object.entries(s))vie(r,l.properties,d,v)}for(const c of o)__(l.children,c);return l.type==="element"&&l.tagName==="template"&&(l.content={type:"root",children:l.children},l.children=[]),l}return i}function die(r){if(r===null||typeof r!="object"||Array.isArray(r))return!0;if(typeof r.type!="string")return!1;const e=r,t=Object.keys(r);for(const n of t){const i=e[n];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const a=i;for(const s of a)if(typeof s!="number"&&typeof s!="string")return!0}}return!!("children"in r&&Array.isArray(r.children))}function vie(r,e,t,n){const i=qP(r,t);let a;if(n!=null){if(typeof n=="number"){if(Number.isNaN(n))return;a=n}else typeof n=="boolean"?a=n:typeof n=="string"?i.spaceSeparated?a=GA(n):i.commaSeparated?a=kA(n):i.commaOrSpaceSeparated?a=GA(kA(n).join(" ")):a=SM(i,i.property,n):Array.isArray(n)?a=[...n]:a=i.property==="style"?pie(n):String(n);if(Array.isArray(a)){const s=[];for(const o of a)s.push(SM(i,i.property,o));a=s}i.property==="className"&&Array.isArray(e.className)&&(a=e.className.concat(a)),e[i.property]=a}}function __(r,e){if(e!=null)if(typeof e=="number"||typeof e=="string")r.push({type:"text",value:String(e)});else if(Array.isArray(e))for(const t of e)__(r,t);else if(typeof e=="object"&&"type"in e)e.type==="root"?__(r,e.children):r.push(e);else throw new Error("Expected node, nodes, or string, got `"+e+"`")}function SM(r,e,t){if(typeof t=="string"){if(r.number&&t&&!Number.isNaN(Number(t)))return Number(t);if((r.boolean||r.overloadedBoolean)&&(t===""||xd(t)===xd(e)))return!0}return t}function pie(r){const e=[];for(const[t,n]of Object.entries(r))e.push([t,n].join(": "));return e.join("; ")}function gie(r){const e=new Map;for(const t of r)e.set(t.toLowerCase(),t);return e}const mie=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","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","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],yie=wI(XP,"div"),bie=wI(Ig,"g",mie),Rx={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function xie(r,e){return SI(r,{})||{type:"root",children:[]}}function SI(r,e){const t=_ie(r,e);return t&&e.afterTransform&&e.afterTransform(r,t),t}function _ie(r,e){switch(r.nodeType){case 1:return Tie(r,e);case 3:return Sie(r);case 8:return Eie(r);case 9:return EM(r,e);case 10:return wie();case 11:return EM(r,e);default:return}}function EM(r,e){return{type:"root",children:EI(r,e)}}function wie(){return{type:"doctype"}}function Sie(r){return{type:"text",value:r.nodeValue||""}}function Eie(r){return{type:"comment",value:r.nodeValue||""}}function Tie(r,e){const t=r.namespaceURI,n=t===Rx.svg?bie:yie,i=t===Rx.html?r.tagName.toLowerCase():r.tagName,a=t===Rx.html&&i==="template"?r.content:r,s=r.getAttributeNames(),o={};let l=-1;for(;++l<s.length;)o[s[l]]=r.getAttribute(s[l])||"";return n(i,o,EI(a,e))}function EI(r,e){const t=r.childNodes,n=[];let i=-1;for(;++i<t.length;){const a=SI(t[i],e);a!==void 0&&n.push(a)}return n}new DOMParser;function Cie(r,e){const t=Aie(r);return xie(t)}function Aie(r){const e=document.createElement("template");return e.innerHTML=r,e.content}const TM=(function(r,e,t){const n=D3(t);if(!r||!r.type||!r.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(e=r.children.indexOf(e),e<0)throw new Error("Expected child node or index");for(;++e<r.children.length;)if(n(r.children[e],e,r))return r.children[e]}),Tu=(function(r){if(r==null)return Oie;if(typeof r=="string")return Rie(r);if(typeof r=="object")return Mie(r);if(typeof r=="function")return I3(r);throw new Error("Expected function, string, or array as `test`")});function Mie(r){const e=[];let t=-1;for(;++t<r.length;)e[t]=Tu(r[t]);return I3(n);function n(...i){let a=-1;for(;++a<e.length;)if(e[a].apply(this,i))return!0;return!1}}function Rie(r){return I3(e);function e(t){return t.tagName===r}}function I3(r){return e;function e(t,n,i){return!!(Die(t)&&r.call(this,t,typeof n=="number"?n:void 0,i||void 0))}}function Oie(r){return!!(r&&typeof r=="object"&&"type"in r&&r.type==="element"&&"tagName"in r&&typeof r.tagName=="string")}function Die(r){return r!==null&&typeof r=="object"&&"type"in r&&"tagName"in r}const CM=/\n/g,AM=/[\t ]+/g,w_=Tu("br"),MM=Tu(zie),Pie=Tu("p"),RM=Tu("tr"),Iie=Tu(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",Fie,Uie]),TI=Tu(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function Nie(r,e){const t=e||{},n="children"in r?r.children:[],i=TI(r),a=MI(r,{whitespace:t.whitespace||"normal"}),s=[];(r.type==="text"||r.type==="comment")&&s.push(...AI(r,{breakBefore:!0,breakAfter:!0}));let o=-1;for(;++o<n.length;)s.push(...CI(n[o],r,{whitespace:a,breakBefore:o?void 0:i,breakAfter:o<n.length-1?w_(n[o+1]):i}));const l=[];let c;for(o=-1;++o<s.length;){const h=s[o];typeof h=="number"?c!==void 0&&h>c&&(c=h):h&&(c!==void 0&&c>-1&&l.push(`
  1708. `.repeat(c)||" "),c=-1,l.push(h))}return l.join("")}function CI(r,e,t){return r.type==="element"?Lie(r,e,t):r.type==="text"?t.whitespace==="normal"?AI(r,t):kie(r):[]}function Lie(r,e,t){const n=MI(r,t),i=r.children||[];let a=-1,s=[];if(Iie(r))return s;let o,l;for(w_(r)||RM(r)&&TM(e,r,RM)?l=`
  1709. `:Pie(r)?(o=2,l=2):TI(r)&&(o=1,l=1);++a<i.length;)s=s.concat(CI(i[a],r,{whitespace:n,breakBefore:a?void 0:o,breakAfter:a<i.length-1?w_(i[a+1]):l}));return MM(r)&&TM(e,r,MM)&&s.push(" "),o&&s.unshift(o),l&&s.push(l),s}function AI(r,e){const t=String(r.value),n=[],i=[];let a=0;for(;a<=t.length;){CM.lastIndex=a;const l=CM.exec(t),c=l&&"index"in l?l.index:t.length;n.push(Bie(t.slice(a,c).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),a===0?e.breakBefore:!0,c===t.length?e.breakAfter:!0)),a=c+1}let s=-1,o;for(;++s<n.length;)n[s].charCodeAt(n[s].length-1)===8203||s<n.length-1&&n[s+1].charCodeAt(0)===8203?(i.push(n[s]),o=void 0):n[s]?(typeof o=="number"&&i.push(o),i.push(n[s]),o=0):(s===0||s===n.length-1)&&i.push(0);return i}function kie(r){return[String(r.value)]}function Bie(r,e,t){const n=[];let i=0,a;for(;i<r.length;){AM.lastIndex=i;const s=AM.exec(r);a=s?s.index:r.length,!i&&!a&&s&&!e&&n.push(""),i!==a&&n.push(r.slice(i,a)),i=s?a+s[0].length:a}return i!==a&&!t&&n.push(""),n.join(" ")}function MI(r,e){if(r.type==="element"){const t=r.properties||{};switch(r.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return t.wrap?"pre-wrap":"pre";case"td":case"th":return t.noWrap?"nowrap":e.whitespace;case"textarea":return"pre-wrap"}}return e.whitespace}function Fie(r){return!!(r.properties||{}).hidden}function zie(r){return r.tagName==="td"||r.tagName==="th"}function Uie(r){return r.tagName==="dialog"&&!(r.properties||{}).open}class Qe extends Error{constructor(e,t){var n="KaTeX parse error: "+e,i,a,s=t&&t.loc;if(s&&s.start<=s.end){var o=s.lexer.input;i=s.start,a=s.end,i===o.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var l=o.slice(i,a).replace(/[^]/g,"$&̲"),c;i>15?c="…"+o.slice(i-15,i):c=o.slice(0,i);var h;a+15<o.length?h=o.slice(a,a+15)+"…":h=o.slice(a),n+=c+l+h}super(n),this.name="ParseError",Object.setPrototypeOf(this,Qe.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=e}}var Gie=/([A-Z])/g,N3=r=>r.replace(Gie,"-$1").toLowerCase(),Hie={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},jie=/[&><"']/g,ti=r=>String(r).replace(jie,e=>Hie[e]),xp=r=>r.type==="ordgroup"||r.type==="color"?r.body.length===1?xp(r.body[0]):r:r.type==="font"?xp(r.body):r,Vie=new Set(["mathord","textord","atom"]),Qs=r=>Vie.has(xp(r).type),qie=r=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(r);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},S_={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:r=>"#"+r},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(r,e)=>(e.push(r),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:r=>Math.max(0,r),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:r=>Math.max(0,r),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:r=>Math.max(0,r),cli:"-e, --max-expand <n>",cliProcessor:r=>r==="Infinity"?1/0:parseInt(r)},globalGroup:{type:"boolean",cli:!1}};function Xie(r){if("default"in r)return r.default;var e=r.type,t=Array.isArray(e)?e[0]:e;if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class L3{constructor(e){e===void 0&&(e={}),e=e||{};for(var t of Object.keys(S_)){var n=S_[t],i=e[t];this[t]=i!==void 0?n.processor?n.processor(i):i:Xie(n)}}reportNonstrict(e,t,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,t,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new Qe("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+t+" ["+e+"]"))}}useStrictBehavior(e,t,n){var i=this.strict;if(typeof i=="function")try{i=i(e,t,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+t+" ["+e+"]")),!1)}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var t=qie(e.url);if(t==null)return!1;e.protocol=t}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class Po{constructor(e,t,n){this.id=e,this.size=t,this.cramped=n}sup(){return Ka[Yie[this.id]]}sub(){return Ka[Wie[this.id]]}fracNum(){return Ka[$ie[this.id]]}fracDen(){return Ka[Kie[this.id]]}cramp(){return Ka[Zie[this.id]]}text(){return Ka[Qie[this.id]]}isTight(){return this.size>=2}}var k3=0,Wp=1,kc=2,Hs=3,wd=4,ya=5,Xc=6,hi=7,Ka=[new Po(k3,0,!1),new Po(Wp,0,!0),new Po(kc,1,!1),new Po(Hs,1,!0),new Po(wd,2,!1),new Po(ya,2,!0),new Po(Xc,3,!1),new Po(hi,3,!0)],Yie=[wd,ya,wd,ya,Xc,hi,Xc,hi],Wie=[ya,ya,ya,ya,hi,hi,hi,hi],$ie=[kc,Hs,wd,ya,Xc,hi,Xc,hi],Kie=[Hs,Hs,ya,ya,hi,hi,hi,hi],Zie=[Wp,Wp,Hs,Hs,ya,ya,hi,hi],Qie=[k3,Wp,kc,Hs,kc,Hs,kc,Hs],Dt={DISPLAY:Ka[k3],TEXT:Ka[kc],SCRIPT:Ka[wd],SCRIPTSCRIPT:Ka[Xc]},E_=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function Jie(r){for(var e=0;e<E_.length;e++)for(var t=E_[e],n=0;n<t.blocks.length;n++){var i=t.blocks[n];if(r>=i[0]&&r<=i[1])return t.name}return null}var _p=[];E_.forEach(r=>r.blocks.forEach(e=>_p.push(...e)));function RI(r){for(var e=0;e<_p.length;e+=2)if(r>=_p[e]&&r<=_p[e+1])return!0;return!1}var _c=80,eae=function(e,t){return"M95,"+(622+e+t)+`
  1710. c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
  1711. c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
  1712. c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
  1713. s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
  1714. c69,-144,104.5,-217.7,106.5,-221
  1715. l`+e/2.075+" -"+e+`
  1716. c5.3,-9.3,12,-14,20,-14
  1717. H400000v`+(40+e)+`H845.2724
  1718. s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
  1719. c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
  1720. M`+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},tae=function(e,t){return"M263,"+(601+e+t)+`c0.7,0,18,39.7,52,119
  1721. c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
  1722. c340,-704.7,510.7,-1060.3,512,-1067
  1723. l`+e/2.084+" -"+e+`
  1724. c4.7,-7.3,11,-11,19,-11
  1725. H40000v`+(40+e)+`H1012.3
  1726. s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
  1727. c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
  1728. s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
  1729. c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
  1730. M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},rae=function(e,t){return"M983 "+(10+e+t)+`
  1731. l`+e/3.13+" -"+e+`
  1732. c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
  1733. H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
  1734. s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
  1735. c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
  1736. c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
  1737. c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
  1738. c53.7,-170.3,84.5,-266.8,92.5,-289.5z
  1739. M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},nae=function(e,t){return"M424,"+(2398+e+t)+`
  1740. c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
  1741. c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
  1742. s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
  1743. s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
  1744. l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000
  1745. v`+(40+e)+`H1014.6
  1746. s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
  1747. c-2,6,-10,9,-24,9
  1748. c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+t+`
  1749. h400000v`+(40+e)+"h-400000z"},iae=function(e,t){return"M473,"+(2713+e+t)+`
  1750. c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+`
  1751. c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
  1752. s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
  1753. c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
  1754. c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
  1755. s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
  1756. 606zM`+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"},aae=function(e){var t=e/2;return"M400000 "+e+" H0 L"+t+" 0 l65 45 L145 "+(e-80)+" H400000z"},sae=function(e,t,n){var i=n-54-t-e;return"M702 "+(e+t)+"H400000"+(40+e)+`
  1757. H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
  1758. h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
  1759. c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
  1760. 219 661 l218 661zM702 `+t+"H400000v"+(40+e)+"H742z"},oae=function(e,t,n){t=1e3*t;var i="";switch(e){case"sqrtMain":i=eae(t,_c);break;case"sqrtSize1":i=tae(t,_c);break;case"sqrtSize2":i=rae(t,_c);break;case"sqrtSize3":i=nae(t,_c);break;case"sqrtSize4":i=iae(t,_c);break;case"sqrtTall":i=sae(t,_c,n)}return i},lae=function(e,t){switch(e){case"⎜":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"∣":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"∥":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z"+("M367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z");case"⎟":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"⎢":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"⎥":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"⎪":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"⏐":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"‖":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257z"+("M478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z");default:return""}},OM={doubleleftarrow:`M262 157
  1761. l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
  1762. 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
  1763. 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
  1764. c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
  1765. 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
  1766. -86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
  1767. -2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
  1768. m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
  1769. -10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
  1770. 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
  1771. -33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
  1772. -17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
  1773. -13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
  1774. c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
  1775. -107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
  1776. 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
  1777. -5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
  1778. c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
  1779. 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
  1780. 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
  1781. l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
  1782. -45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
  1783. 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
  1784. 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
  1785. 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
  1786. -331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
  1787. H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
  1788. 435 0h399565z`,leftgroupunder:`M400000 262
  1789. H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
  1790. 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
  1791. -3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
  1792. -18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
  1793. -196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
  1794. 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
  1795. -4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
  1796. -10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
  1797. m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
  1798. 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
  1799. 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
  1800. -152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
  1801. 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
  1802. -2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
  1803. v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
  1804. -83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
  1805. -68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
  1806. 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
  1807. M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftbracketunder:`M0 0 h120 V290 H399995 v120 H0z
  1808. M0 0 h120 V290 H399995 v120 H0z`,leftbracketover:`M0 440 h120 V150 H399995 v-120 H0z
  1809. M0 440 h120 V150 H399995 v-120 H0z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
  1810. M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
  1811. -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
  1812. c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
  1813. 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
  1814. M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
  1815. c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
  1816. -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
  1817. 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
  1818. 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
  1819. c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
  1820. 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
  1821. 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
  1822. -5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
  1823. -320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
  1824. m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
  1825. 60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
  1826. -451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
  1827. m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
  1828. c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
  1829. -480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
  1830. m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
  1831. 85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
  1832. -707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
  1833. m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
  1834. c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
  1835. -16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
  1836. 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
  1837. 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
  1838. -40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
  1839. -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
  1840. 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
  1841. -6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
  1842. s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
  1843. c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
  1844. 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
  1845. -174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
  1846. 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
  1847. 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
  1848. -3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
  1849. -10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
  1850. 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
  1851. -18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
  1852. 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
  1853. m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
  1854. 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
  1855. -7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
  1856. -27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
  1857. 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
  1858. 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
  1859. -64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
  1860. m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
  1861. 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
  1862. -13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
  1863. 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
  1864. M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightbracketunder:`M399995 0 h-120 V290 H0 v120 H400000z
  1865. M399995 0 h-120 V290 H0 v120 H400000z`,rightbracketover:`M399995 440 h-120 V150 H0 v-120 H399995z
  1866. M399995 440 h-120 V150 H0 v-120 H399995z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
  1867. 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
  1868. -52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
  1869. -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
  1870. 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
  1871. -70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
  1872. -40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
  1873. -37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
  1874. 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
  1875. c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
  1876. 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
  1877. 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
  1878. -19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
  1879. 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
  1880. -2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
  1881. 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
  1882. 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
  1883. -68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
  1884. -8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
  1885. 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
  1886. c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
  1887. 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
  1888. -11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
  1889. 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
  1890. 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
  1891. -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
  1892. -11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
  1893. 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
  1894. 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
  1895. -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
  1896. 3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
  1897. 10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
  1898. -1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
  1899. -7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
  1900. H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
  1901. c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
  1902. c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
  1903. -11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
  1904. -11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
  1905. -11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
  1906. -5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
  1907. -11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
  1908. -11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
  1909. -11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
  1910. c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
  1911. c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
  1912. s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
  1913. 121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
  1914. s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
  1915. c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
  1916. M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
  1917. -27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
  1918. 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
  1919. -84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
  1920. -119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
  1921. -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
  1922. 151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
  1923. c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
  1924. c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
  1925. c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
  1926. c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
  1927. M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
  1928. c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
  1929. -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
  1930. c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
  1931. M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
  1932. c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
  1933. 1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
  1934. -152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
  1935. M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
  1936. c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
  1937. -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
  1938. c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
  1939. M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},uae=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v1759 h347 v-84
  1940. H403z M403 1759 V0 H319 V1759 v`+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v1759 H0 v84 H347z
  1941. M347 1759 V0 H263 V1759 v`+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15
  1942. c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
  1943. c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15
  1944. c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
  1945. c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z
  1946. M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
  1947. c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
  1948. c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+` v1715 h263 v84 H319z
  1949. MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+` v1799 H0 v-84 H319z
  1950. MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v602 h84z
  1951. M403 1759 V0 H319 V1759 v`+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v602 h84z
  1952. M347 1759 V0 h-84 V1759 v`+t+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
  1953. c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
  1954. -36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
  1955. 949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
  1956. c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
  1957. -544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
  1958. l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
  1959. -210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
  1960. 63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
  1961. c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+`
  1962. c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
  1963. c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
  1964. c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
  1965. c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
  1966. l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
  1967. -470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class hh{constructor(e){this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){var e=t=>t.toText();return this.children.map(e).join("")}}var T_={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},cae={ex:!0,em:!0,mu:!0},OI=function(e){return typeof e!="string"&&(e=e.unit),e in T_||e in cae||e==="ex"},Zr=function(e,t){var n;if(e.unit in T_)n=T_[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit==="mu")n=t.fontMetrics().cssEmPerMu;else{var i;if(t.style.isTight()?i=t.havingStyle(t.style.text()):i=t,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new Qe("Invalid unit: '"+e.unit+"'");i!==t&&(n*=i.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},it=function(e){return+e.toFixed(4)+"em"},al=function(e){return e.filter(t=>t).join(" ")},DI=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var i=t.getColor();i&&(this.style.color=i)}},PI=function(e){var t=document.createElement(e);t.className=al(this.classes);for(var n of Object.keys(this.style))t.style[n]=this.style[n];for(var i of Object.keys(this.attributes))t.setAttribute(i,this.attributes[i]);for(var a=0;a<this.children.length;a++)t.appendChild(this.children[a].toNode());return t},hae=/[\s"'>/=\x00-\x1f]/,II=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+ti(al(this.classes))+'"');var n="";for(var i of Object.keys(this.style))n+=N3(i)+":"+this.style[i]+";";n&&(t+=' style="'+ti(n)+'"');for(var a of Object.keys(this.attributes)){if(hae.test(a))throw new Qe("Invalid attribute name '"+a+"'");t+=" "+a+'="'+ti(this.attributes[a])+'"'}t+=">";for(var s=0;s<this.children.length;s++)t+=this.children[s].toMarkup();return t+="</"+e+">",t};class fh{constructor(e,t,n,i){DI.call(this,e,n,i),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return PI.call(this,"span")}toMarkup(){return II.call(this,"span")}}class Bg{constructor(e,t,n,i){DI.call(this,t,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return PI.call(this,"a")}toMarkup(){return II.call(this,"a")}}class fae{constructor(e,t,n){this.alt=t,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var t of Object.keys(this.style))e.style[t]=this.style[t];return e}toMarkup(){var e='<img src="'+ti(this.src)+'"'+(' alt="'+ti(this.alt)+'"'),t="";for(var n of Object.keys(this.style))t+=N3(n)+":"+this.style[n]+";";return t&&(e+=' style="'+ti(t)+'"'),e+="'/>",e}}var dae={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class Yi{constructor(e,t,n,i,a,s,o,l){this.text=e,this.height=t||0,this.depth=n||0,this.italic=i||0,this.skew=a||0,this.width=s||0,this.classes=o||[],this.style=l||{},this.maxFontSize=0;var c=Jie(this.text.charCodeAt(0));c&&this.classes.push(c+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=dae[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;this.italic>0&&(t=document.createElement("span"),t.style.marginRight=it(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=al(this.classes));for(var n of Object.keys(this.style))t=t||document.createElement("span"),t.style[n]=this.style[n];return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=ti(al(this.classes)),t+='"');var n="";this.italic>0&&(n+="margin-right:"+it(this.italic)+";");for(var i of Object.keys(this.style))n+=N3(i)+":"+this.style[i]+";";n&&(e=!0,t+=' style="'+ti(n)+'"');var a=ti(this.text);return e?(t+=">",t+=a,t+="</span>",t):a}}class qs{constructor(e,t){this.children=e||[],this.attributes=t||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);for(var i=0;i<this.children.length;i++)t.appendChild(this.children[i].toNode());return t}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t of Object.keys(this.attributes))e+=" "+t+'="'+ti(this.attributes[t])+'"';e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</svg>",e}}class sl{constructor(e,t){this.pathName=e,this.alternate=t}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"path");return this.alternate?t.setAttribute("d",this.alternate):t.setAttribute("d",OM[this.pathName]),t}toMarkup(){return this.alternate?'<path d="'+ti(this.alternate)+'"/>':'<path d="'+ti(OM[this.pathName])+'"/>'}}class C_{constructor(e){this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"line");for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);return t}toMarkup(){var e="<line";for(var t of Object.keys(this.attributes))e+=" "+t+'="'+ti(this.attributes[t])+'"';return e+="/>",e}}function vae(r){if(r instanceof Yi)return r;throw new Error("Expected symbolNode but got "+String(r)+".")}function pae(r){if(r instanceof fh)return r;throw new Error("Expected span<HtmlDomNode> but got "+String(r)+".")}var gae=r=>r instanceof fh||r instanceof Bg||r instanceof hh,ts={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Vv={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},DM={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function mae(r,e){ts[r]=e}function B3(r,e,t){if(!ts[e])throw new Error("Font metrics not found for font: "+e+".");var n=r.charCodeAt(0),i=ts[e][n];if(!i&&r[0]in DM&&(n=DM[r[0]].charCodeAt(0),i=ts[e][n]),!i&&t==="text"&&RI(n)&&(i=ts[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var Ox={};function yae(r){var e;if(r>=5?e=0:r>=3?e=1:e=2,!Ox[e]){var t=Ox[e]={cssEmPerMu:Vv.quad[e]/18};for(var n in Vv)Vv.hasOwnProperty(n)&&(t[n]=Vv[n][e])}return Ox[e]}var bae={bin:1,close:1,inner:1,open:1,punct:1,rel:1},xae={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Vr={math:{},text:{}};function F(r,e,t,n,i,a){Vr[r][i]={font:e,group:t,replace:n},a&&n&&(Vr[r][n]=Vr[r][i])}var j="math",qe="text",K="main",ue="ams",Xr="accent-token",dt="bin",pi="close",dh="inner",Tt="mathord",Tn="op-token",Wi="open",Ud="punct",fe="rel",Js="spacing",me="textord";F(j,K,fe,"≡","\\equiv",!0);F(j,K,fe,"≺","\\prec",!0);F(j,K,fe,"≻","\\succ",!0);F(j,K,fe,"∼","\\sim",!0);F(j,K,fe,"⊥","\\perp");F(j,K,fe,"⪯","\\preceq",!0);F(j,K,fe,"⪰","\\succeq",!0);F(j,K,fe,"≃","\\simeq",!0);F(j,K,fe,"∣","\\mid",!0);F(j,K,fe,"≪","\\ll",!0);F(j,K,fe,"≫","\\gg",!0);F(j,K,fe,"≍","\\asymp",!0);F(j,K,fe,"∥","\\parallel");F(j,K,fe,"⋈","\\bowtie",!0);F(j,K,fe,"⌣","\\smile",!0);F(j,K,fe,"⊑","\\sqsubseteq",!0);F(j,K,fe,"⊒","\\sqsupseteq",!0);F(j,K,fe,"≐","\\doteq",!0);F(j,K,fe,"⌢","\\frown",!0);F(j,K,fe,"∋","\\ni",!0);F(j,K,fe,"∝","\\propto",!0);F(j,K,fe,"⊢","\\vdash",!0);F(j,K,fe,"⊣","\\dashv",!0);F(j,K,fe,"∋","\\owns");F(j,K,Ud,".","\\ldotp");F(j,K,Ud,"⋅","\\cdotp");F(j,K,Ud,"⋅","·");F(qe,K,me,"⋅","·");F(j,K,me,"#","\\#");F(qe,K,me,"#","\\#");F(j,K,me,"&","\\&");F(qe,K,me,"&","\\&");F(j,K,me,"ℵ","\\aleph",!0);F(j,K,me,"∀","\\forall",!0);F(j,K,me,"ℏ","\\hbar",!0);F(j,K,me,"∃","\\exists",!0);F(j,K,me,"∇","\\nabla",!0);F(j,K,me,"♭","\\flat",!0);F(j,K,me,"ℓ","\\ell",!0);F(j,K,me,"♮","\\natural",!0);F(j,K,me,"♣","\\clubsuit",!0);F(j,K,me,"℘","\\wp",!0);F(j,K,me,"♯","\\sharp",!0);F(j,K,me,"♢","\\diamondsuit",!0);F(j,K,me,"ℜ","\\Re",!0);F(j,K,me,"♡","\\heartsuit",!0);F(j,K,me,"ℑ","\\Im",!0);F(j,K,me,"♠","\\spadesuit",!0);F(j,K,me,"§","\\S",!0);F(qe,K,me,"§","\\S");F(j,K,me,"¶","\\P",!0);F(qe,K,me,"¶","\\P");F(j,K,me,"†","\\dag");F(qe,K,me,"†","\\dag");F(qe,K,me,"†","\\textdagger");F(j,K,me,"‡","\\ddag");F(qe,K,me,"‡","\\ddag");F(qe,K,me,"‡","\\textdaggerdbl");F(j,K,pi,"⎱","\\rmoustache",!0);F(j,K,Wi,"⎰","\\lmoustache",!0);F(j,K,pi,"⟯","\\rgroup",!0);F(j,K,Wi,"⟮","\\lgroup",!0);F(j,K,dt,"∓","\\mp",!0);F(j,K,dt,"⊖","\\ominus",!0);F(j,K,dt,"⊎","\\uplus",!0);F(j,K,dt,"⊓","\\sqcap",!0);F(j,K,dt,"∗","\\ast");F(j,K,dt,"⊔","\\sqcup",!0);F(j,K,dt,"◯","\\bigcirc",!0);F(j,K,dt,"∙","\\bullet",!0);F(j,K,dt,"‡","\\ddagger");F(j,K,dt,"≀","\\wr",!0);F(j,K,dt,"⨿","\\amalg");F(j,K,dt,"&","\\And");F(j,K,fe,"⟵","\\longleftarrow",!0);F(j,K,fe,"⇐","\\Leftarrow",!0);F(j,K,fe,"⟸","\\Longleftarrow",!0);F(j,K,fe,"⟶","\\longrightarrow",!0);F(j,K,fe,"⇒","\\Rightarrow",!0);F(j,K,fe,"⟹","\\Longrightarrow",!0);F(j,K,fe,"↔","\\leftrightarrow",!0);F(j,K,fe,"⟷","\\longleftrightarrow",!0);F(j,K,fe,"⇔","\\Leftrightarrow",!0);F(j,K,fe,"⟺","\\Longleftrightarrow",!0);F(j,K,fe,"↦","\\mapsto",!0);F(j,K,fe,"⟼","\\longmapsto",!0);F(j,K,fe,"↗","\\nearrow",!0);F(j,K,fe,"↩","\\hookleftarrow",!0);F(j,K,fe,"↪","\\hookrightarrow",!0);F(j,K,fe,"↘","\\searrow",!0);F(j,K,fe,"↼","\\leftharpoonup",!0);F(j,K,fe,"⇀","\\rightharpoonup",!0);F(j,K,fe,"↙","\\swarrow",!0);F(j,K,fe,"↽","\\leftharpoondown",!0);F(j,K,fe,"⇁","\\rightharpoondown",!0);F(j,K,fe,"↖","\\nwarrow",!0);F(j,K,fe,"⇌","\\rightleftharpoons",!0);F(j,ue,fe,"≮","\\nless",!0);F(j,ue,fe,"","\\@nleqslant");F(j,ue,fe,"","\\@nleqq");F(j,ue,fe,"⪇","\\lneq",!0);F(j,ue,fe,"≨","\\lneqq",!0);F(j,ue,fe,"","\\@lvertneqq");F(j,ue,fe,"⋦","\\lnsim",!0);F(j,ue,fe,"⪉","\\lnapprox",!0);F(j,ue,fe,"⊀","\\nprec",!0);F(j,ue,fe,"⋠","\\npreceq",!0);F(j,ue,fe,"⋨","\\precnsim",!0);F(j,ue,fe,"⪹","\\precnapprox",!0);F(j,ue,fe,"≁","\\nsim",!0);F(j,ue,fe,"","\\@nshortmid");F(j,ue,fe,"∤","\\nmid",!0);F(j,ue,fe,"⊬","\\nvdash",!0);F(j,ue,fe,"⊭","\\nvDash",!0);F(j,ue,fe,"⋪","\\ntriangleleft");F(j,ue,fe,"⋬","\\ntrianglelefteq",!0);F(j,ue,fe,"⊊","\\subsetneq",!0);F(j,ue,fe,"","\\@varsubsetneq");F(j,ue,fe,"⫋","\\subsetneqq",!0);F(j,ue,fe,"","\\@varsubsetneqq");F(j,ue,fe,"≯","\\ngtr",!0);F(j,ue,fe,"","\\@ngeqslant");F(j,ue,fe,"","\\@ngeqq");F(j,ue,fe,"⪈","\\gneq",!0);F(j,ue,fe,"≩","\\gneqq",!0);F(j,ue,fe,"","\\@gvertneqq");F(j,ue,fe,"⋧","\\gnsim",!0);F(j,ue,fe,"⪊","\\gnapprox",!0);F(j,ue,fe,"⊁","\\nsucc",!0);F(j,ue,fe,"⋡","\\nsucceq",!0);F(j,ue,fe,"⋩","\\succnsim",!0);F(j,ue,fe,"⪺","\\succnapprox",!0);F(j,ue,fe,"≆","\\ncong",!0);F(j,ue,fe,"","\\@nshortparallel");F(j,ue,fe,"∦","\\nparallel",!0);F(j,ue,fe,"⊯","\\nVDash",!0);F(j,ue,fe,"⋫","\\ntriangleright");F(j,ue,fe,"⋭","\\ntrianglerighteq",!0);F(j,ue,fe,"","\\@nsupseteqq");F(j,ue,fe,"⊋","\\supsetneq",!0);F(j,ue,fe,"","\\@varsupsetneq");F(j,ue,fe,"⫌","\\supsetneqq",!0);F(j,ue,fe,"","\\@varsupsetneqq");F(j,ue,fe,"⊮","\\nVdash",!0);F(j,ue,fe,"⪵","\\precneqq",!0);F(j,ue,fe,"⪶","\\succneqq",!0);F(j,ue,fe,"","\\@nsubseteqq");F(j,ue,dt,"⊴","\\unlhd");F(j,ue,dt,"⊵","\\unrhd");F(j,ue,fe,"↚","\\nleftarrow",!0);F(j,ue,fe,"↛","\\nrightarrow",!0);F(j,ue,fe,"⇍","\\nLeftarrow",!0);F(j,ue,fe,"⇏","\\nRightarrow",!0);F(j,ue,fe,"↮","\\nleftrightarrow",!0);F(j,ue,fe,"⇎","\\nLeftrightarrow",!0);F(j,ue,fe,"△","\\vartriangle");F(j,ue,me,"ℏ","\\hslash");F(j,ue,me,"▽","\\triangledown");F(j,ue,me,"◊","\\lozenge");F(j,ue,me,"Ⓢ","\\circledS");F(j,ue,me,"®","\\circledR");F(qe,ue,me,"®","\\circledR");F(j,ue,me,"∡","\\measuredangle",!0);F(j,ue,me,"∄","\\nexists");F(j,ue,me,"℧","\\mho");F(j,ue,me,"Ⅎ","\\Finv",!0);F(j,ue,me,"⅁","\\Game",!0);F(j,ue,me,"‵","\\backprime");F(j,ue,me,"▲","\\blacktriangle");F(j,ue,me,"▼","\\blacktriangledown");F(j,ue,me,"■","\\blacksquare");F(j,ue,me,"⧫","\\blacklozenge");F(j,ue,me,"★","\\bigstar");F(j,ue,me,"∢","\\sphericalangle",!0);F(j,ue,me,"∁","\\complement",!0);F(j,ue,me,"ð","\\eth",!0);F(qe,K,me,"ð","ð");F(j,ue,me,"╱","\\diagup");F(j,ue,me,"╲","\\diagdown");F(j,ue,me,"□","\\square");F(j,ue,me,"□","\\Box");F(j,ue,me,"◊","\\Diamond");F(j,ue,me,"¥","\\yen",!0);F(qe,ue,me,"¥","\\yen",!0);F(j,ue,me,"✓","\\checkmark",!0);F(qe,ue,me,"✓","\\checkmark");F(j,ue,me,"ℶ","\\beth",!0);F(j,ue,me,"ℸ","\\daleth",!0);F(j,ue,me,"ℷ","\\gimel",!0);F(j,ue,me,"ϝ","\\digamma",!0);F(j,ue,me,"ϰ","\\varkappa");F(j,ue,Wi,"┌","\\@ulcorner",!0);F(j,ue,pi,"┐","\\@urcorner",!0);F(j,ue,Wi,"└","\\@llcorner",!0);F(j,ue,pi,"┘","\\@lrcorner",!0);F(j,ue,fe,"≦","\\leqq",!0);F(j,ue,fe,"⩽","\\leqslant",!0);F(j,ue,fe,"⪕","\\eqslantless",!0);F(j,ue,fe,"≲","\\lesssim",!0);F(j,ue,fe,"⪅","\\lessapprox",!0);F(j,ue,fe,"≊","\\approxeq",!0);F(j,ue,dt,"⋖","\\lessdot");F(j,ue,fe,"⋘","\\lll",!0);F(j,ue,fe,"≶","\\lessgtr",!0);F(j,ue,fe,"⋚","\\lesseqgtr",!0);F(j,ue,fe,"⪋","\\lesseqqgtr",!0);F(j,ue,fe,"≑","\\doteqdot");F(j,ue,fe,"≓","\\risingdotseq",!0);F(j,ue,fe,"≒","\\fallingdotseq",!0);F(j,ue,fe,"∽","\\backsim",!0);F(j,ue,fe,"⋍","\\backsimeq",!0);F(j,ue,fe,"⫅","\\subseteqq",!0);F(j,ue,fe,"⋐","\\Subset",!0);F(j,ue,fe,"⊏","\\sqsubset",!0);F(j,ue,fe,"≼","\\preccurlyeq",!0);F(j,ue,fe,"⋞","\\curlyeqprec",!0);F(j,ue,fe,"≾","\\precsim",!0);F(j,ue,fe,"⪷","\\precapprox",!0);F(j,ue,fe,"⊲","\\vartriangleleft");F(j,ue,fe,"⊴","\\trianglelefteq");F(j,ue,fe,"⊨","\\vDash",!0);F(j,ue,fe,"⊪","\\Vvdash",!0);F(j,ue,fe,"⌣","\\smallsmile");F(j,ue,fe,"⌢","\\smallfrown");F(j,ue,fe,"≏","\\bumpeq",!0);F(j,ue,fe,"≎","\\Bumpeq",!0);F(j,ue,fe,"≧","\\geqq",!0);F(j,ue,fe,"⩾","\\geqslant",!0);F(j,ue,fe,"⪖","\\eqslantgtr",!0);F(j,ue,fe,"≳","\\gtrsim",!0);F(j,ue,fe,"⪆","\\gtrapprox",!0);F(j,ue,dt,"⋗","\\gtrdot");F(j,ue,fe,"⋙","\\ggg",!0);F(j,ue,fe,"≷","\\gtrless",!0);F(j,ue,fe,"⋛","\\gtreqless",!0);F(j,ue,fe,"⪌","\\gtreqqless",!0);F(j,ue,fe,"≖","\\eqcirc",!0);F(j,ue,fe,"≗","\\circeq",!0);F(j,ue,fe,"≜","\\triangleq",!0);F(j,ue,fe,"∼","\\thicksim");F(j,ue,fe,"≈","\\thickapprox");F(j,ue,fe,"⫆","\\supseteqq",!0);F(j,ue,fe,"⋑","\\Supset",!0);F(j,ue,fe,"⊐","\\sqsupset",!0);F(j,ue,fe,"≽","\\succcurlyeq",!0);F(j,ue,fe,"⋟","\\curlyeqsucc",!0);F(j,ue,fe,"≿","\\succsim",!0);F(j,ue,fe,"⪸","\\succapprox",!0);F(j,ue,fe,"⊳","\\vartriangleright");F(j,ue,fe,"⊵","\\trianglerighteq");F(j,ue,fe,"⊩","\\Vdash",!0);F(j,ue,fe,"∣","\\shortmid");F(j,ue,fe,"∥","\\shortparallel");F(j,ue,fe,"≬","\\between",!0);F(j,ue,fe,"⋔","\\pitchfork",!0);F(j,ue,fe,"∝","\\varpropto");F(j,ue,fe,"◀","\\blacktriangleleft");F(j,ue,fe,"∴","\\therefore",!0);F(j,ue,fe,"∍","\\backepsilon");F(j,ue,fe,"▶","\\blacktriangleright");F(j,ue,fe,"∵","\\because",!0);F(j,ue,fe,"⋘","\\llless");F(j,ue,fe,"⋙","\\gggtr");F(j,ue,dt,"⊲","\\lhd");F(j,ue,dt,"⊳","\\rhd");F(j,ue,fe,"≂","\\eqsim",!0);F(j,K,fe,"⋈","\\Join");F(j,ue,fe,"≑","\\Doteq",!0);F(j,ue,dt,"∔","\\dotplus",!0);F(j,ue,dt,"∖","\\smallsetminus");F(j,ue,dt,"⋒","\\Cap",!0);F(j,ue,dt,"⋓","\\Cup",!0);F(j,ue,dt,"⩞","\\doublebarwedge",!0);F(j,ue,dt,"⊟","\\boxminus",!0);F(j,ue,dt,"⊞","\\boxplus",!0);F(j,ue,dt,"⋇","\\divideontimes",!0);F(j,ue,dt,"⋉","\\ltimes",!0);F(j,ue,dt,"⋊","\\rtimes",!0);F(j,ue,dt,"⋋","\\leftthreetimes",!0);F(j,ue,dt,"⋌","\\rightthreetimes",!0);F(j,ue,dt,"⋏","\\curlywedge",!0);F(j,ue,dt,"⋎","\\curlyvee",!0);F(j,ue,dt,"⊝","\\circleddash",!0);F(j,ue,dt,"⊛","\\circledast",!0);F(j,ue,dt,"⋅","\\centerdot");F(j,ue,dt,"⊺","\\intercal",!0);F(j,ue,dt,"⋒","\\doublecap");F(j,ue,dt,"⋓","\\doublecup");F(j,ue,dt,"⊠","\\boxtimes",!0);F(j,ue,fe,"⇢","\\dashrightarrow",!0);F(j,ue,fe,"⇠","\\dashleftarrow",!0);F(j,ue,fe,"⇇","\\leftleftarrows",!0);F(j,ue,fe,"⇆","\\leftrightarrows",!0);F(j,ue,fe,"⇚","\\Lleftarrow",!0);F(j,ue,fe,"↞","\\twoheadleftarrow",!0);F(j,ue,fe,"↢","\\leftarrowtail",!0);F(j,ue,fe,"↫","\\looparrowleft",!0);F(j,ue,fe,"⇋","\\leftrightharpoons",!0);F(j,ue,fe,"↶","\\curvearrowleft",!0);F(j,ue,fe,"↺","\\circlearrowleft",!0);F(j,ue,fe,"↰","\\Lsh",!0);F(j,ue,fe,"⇈","\\upuparrows",!0);F(j,ue,fe,"↿","\\upharpoonleft",!0);F(j,ue,fe,"⇃","\\downharpoonleft",!0);F(j,K,fe,"⊶","\\origof",!0);F(j,K,fe,"⊷","\\imageof",!0);F(j,ue,fe,"⊸","\\multimap",!0);F(j,ue,fe,"↭","\\leftrightsquigarrow",!0);F(j,ue,fe,"⇉","\\rightrightarrows",!0);F(j,ue,fe,"⇄","\\rightleftarrows",!0);F(j,ue,fe,"↠","\\twoheadrightarrow",!0);F(j,ue,fe,"↣","\\rightarrowtail",!0);F(j,ue,fe,"↬","\\looparrowright",!0);F(j,ue,fe,"↷","\\curvearrowright",!0);F(j,ue,fe,"↻","\\circlearrowright",!0);F(j,ue,fe,"↱","\\Rsh",!0);F(j,ue,fe,"⇊","\\downdownarrows",!0);F(j,ue,fe,"↾","\\upharpoonright",!0);F(j,ue,fe,"⇂","\\downharpoonright",!0);F(j,ue,fe,"⇝","\\rightsquigarrow",!0);F(j,ue,fe,"⇝","\\leadsto");F(j,ue,fe,"⇛","\\Rrightarrow",!0);F(j,ue,fe,"↾","\\restriction");F(j,K,me,"‘","`");F(j,K,me,"$","\\$");F(qe,K,me,"$","\\$");F(qe,K,me,"$","\\textdollar");F(j,K,me,"%","\\%");F(qe,K,me,"%","\\%");F(j,K,me,"_","\\_");F(qe,K,me,"_","\\_");F(qe,K,me,"_","\\textunderscore");F(j,K,me,"∠","\\angle",!0);F(j,K,me,"∞","\\infty",!0);F(j,K,me,"′","\\prime");F(j,K,me,"△","\\triangle");F(j,K,me,"Γ","\\Gamma",!0);F(j,K,me,"Δ","\\Delta",!0);F(j,K,me,"Θ","\\Theta",!0);F(j,K,me,"Λ","\\Lambda",!0);F(j,K,me,"Ξ","\\Xi",!0);F(j,K,me,"Π","\\Pi",!0);F(j,K,me,"Σ","\\Sigma",!0);F(j,K,me,"Υ","\\Upsilon",!0);F(j,K,me,"Φ","\\Phi",!0);F(j,K,me,"Ψ","\\Psi",!0);F(j,K,me,"Ω","\\Omega",!0);F(j,K,me,"A","Α");F(j,K,me,"B","Β");F(j,K,me,"E","Ε");F(j,K,me,"Z","Ζ");F(j,K,me,"H","Η");F(j,K,me,"I","Ι");F(j,K,me,"K","Κ");F(j,K,me,"M","Μ");F(j,K,me,"N","Ν");F(j,K,me,"O","Ο");F(j,K,me,"P","Ρ");F(j,K,me,"T","Τ");F(j,K,me,"X","Χ");F(j,K,me,"¬","\\neg",!0);F(j,K,me,"¬","\\lnot");F(j,K,me,"⊤","\\top");F(j,K,me,"⊥","\\bot");F(j,K,me,"∅","\\emptyset");F(j,ue,me,"∅","\\varnothing");F(j,K,Tt,"α","\\alpha",!0);F(j,K,Tt,"β","\\beta",!0);F(j,K,Tt,"γ","\\gamma",!0);F(j,K,Tt,"δ","\\delta",!0);F(j,K,Tt,"ϵ","\\epsilon",!0);F(j,K,Tt,"ζ","\\zeta",!0);F(j,K,Tt,"η","\\eta",!0);F(j,K,Tt,"θ","\\theta",!0);F(j,K,Tt,"ι","\\iota",!0);F(j,K,Tt,"κ","\\kappa",!0);F(j,K,Tt,"λ","\\lambda",!0);F(j,K,Tt,"μ","\\mu",!0);F(j,K,Tt,"ν","\\nu",!0);F(j,K,Tt,"ξ","\\xi",!0);F(j,K,Tt,"ο","\\omicron",!0);F(j,K,Tt,"π","\\pi",!0);F(j,K,Tt,"ρ","\\rho",!0);F(j,K,Tt,"σ","\\sigma",!0);F(j,K,Tt,"τ","\\tau",!0);F(j,K,Tt,"υ","\\upsilon",!0);F(j,K,Tt,"ϕ","\\phi",!0);F(j,K,Tt,"χ","\\chi",!0);F(j,K,Tt,"ψ","\\psi",!0);F(j,K,Tt,"ω","\\omega",!0);F(j,K,Tt,"ε","\\varepsilon",!0);F(j,K,Tt,"ϑ","\\vartheta",!0);F(j,K,Tt,"ϖ","\\varpi",!0);F(j,K,Tt,"ϱ","\\varrho",!0);F(j,K,Tt,"ς","\\varsigma",!0);F(j,K,Tt,"φ","\\varphi",!0);F(j,K,dt,"∗","*",!0);F(j,K,dt,"+","+");F(j,K,dt,"−","-",!0);F(j,K,dt,"⋅","\\cdot",!0);F(j,K,dt,"∘","\\circ",!0);F(j,K,dt,"÷","\\div",!0);F(j,K,dt,"±","\\pm",!0);F(j,K,dt,"×","\\times",!0);F(j,K,dt,"∩","\\cap",!0);F(j,K,dt,"∪","\\cup",!0);F(j,K,dt,"∖","\\setminus",!0);F(j,K,dt,"∧","\\land");F(j,K,dt,"∨","\\lor");F(j,K,dt,"∧","\\wedge",!0);F(j,K,dt,"∨","\\vee",!0);F(j,K,me,"√","\\surd");F(j,K,Wi,"⟨","\\langle",!0);F(j,K,Wi,"∣","\\lvert");F(j,K,Wi,"∥","\\lVert");F(j,K,pi,"?","?");F(j,K,pi,"!","!");F(j,K,pi,"⟩","\\rangle",!0);F(j,K,pi,"∣","\\rvert");F(j,K,pi,"∥","\\rVert");F(j,K,fe,"=","=");F(j,K,fe,":",":");F(j,K,fe,"≈","\\approx",!0);F(j,K,fe,"≅","\\cong",!0);F(j,K,fe,"≥","\\ge");F(j,K,fe,"≥","\\geq",!0);F(j,K,fe,"←","\\gets");F(j,K,fe,">","\\gt",!0);F(j,K,fe,"∈","\\in",!0);F(j,K,fe,"","\\@not");F(j,K,fe,"⊂","\\subset",!0);F(j,K,fe,"⊃","\\supset",!0);F(j,K,fe,"⊆","\\subseteq",!0);F(j,K,fe,"⊇","\\supseteq",!0);F(j,ue,fe,"⊈","\\nsubseteq",!0);F(j,ue,fe,"⊉","\\nsupseteq",!0);F(j,K,fe,"⊨","\\models");F(j,K,fe,"←","\\leftarrow",!0);F(j,K,fe,"≤","\\le");F(j,K,fe,"≤","\\leq",!0);F(j,K,fe,"<","\\lt",!0);F(j,K,fe,"→","\\rightarrow",!0);F(j,K,fe,"→","\\to");F(j,ue,fe,"≱","\\ngeq",!0);F(j,ue,fe,"≰","\\nleq",!0);F(j,K,Js," ","\\ ");F(j,K,Js," ","\\space");F(j,K,Js," ","\\nobreakspace");F(qe,K,Js," ","\\ ");F(qe,K,Js," "," ");F(qe,K,Js," ","\\space");F(qe,K,Js," ","\\nobreakspace");F(j,K,Js,null,"\\nobreak");F(j,K,Js,null,"\\allowbreak");F(j,K,Ud,",",",");F(j,K,Ud,";",";");F(j,ue,dt,"⊼","\\barwedge",!0);F(j,ue,dt,"⊻","\\veebar",!0);F(j,K,dt,"⊙","\\odot",!0);F(j,K,dt,"⊕","\\oplus",!0);F(j,K,dt,"⊗","\\otimes",!0);F(j,K,me,"∂","\\partial",!0);F(j,K,dt,"⊘","\\oslash",!0);F(j,ue,dt,"⊚","\\circledcirc",!0);F(j,ue,dt,"⊡","\\boxdot",!0);F(j,K,dt,"△","\\bigtriangleup");F(j,K,dt,"▽","\\bigtriangledown");F(j,K,dt,"†","\\dagger");F(j,K,dt,"⋄","\\diamond");F(j,K,dt,"⋆","\\star");F(j,K,dt,"◃","\\triangleleft");F(j,K,dt,"▹","\\triangleright");F(j,K,Wi,"{","\\{");F(qe,K,me,"{","\\{");F(qe,K,me,"{","\\textbraceleft");F(j,K,pi,"}","\\}");F(qe,K,me,"}","\\}");F(qe,K,me,"}","\\textbraceright");F(j,K,Wi,"{","\\lbrace");F(j,K,pi,"}","\\rbrace");F(j,K,Wi,"[","\\lbrack",!0);F(qe,K,me,"[","\\lbrack",!0);F(j,K,pi,"]","\\rbrack",!0);F(qe,K,me,"]","\\rbrack",!0);F(j,K,Wi,"(","\\lparen",!0);F(j,K,pi,")","\\rparen",!0);F(qe,K,me,"<","\\textless",!0);F(qe,K,me,">","\\textgreater",!0);F(j,K,Wi,"⌊","\\lfloor",!0);F(j,K,pi,"⌋","\\rfloor",!0);F(j,K,Wi,"⌈","\\lceil",!0);F(j,K,pi,"⌉","\\rceil",!0);F(j,K,me,"\\","\\backslash");F(j,K,me,"∣","|");F(j,K,me,"∣","\\vert");F(qe,K,me,"|","\\textbar",!0);F(j,K,me,"∥","\\|");F(j,K,me,"∥","\\Vert");F(qe,K,me,"∥","\\textbardbl");F(qe,K,me,"~","\\textasciitilde");F(qe,K,me,"\\","\\textbackslash");F(qe,K,me,"^","\\textasciicircum");F(j,K,fe,"↑","\\uparrow",!0);F(j,K,fe,"⇑","\\Uparrow",!0);F(j,K,fe,"↓","\\downarrow",!0);F(j,K,fe,"⇓","\\Downarrow",!0);F(j,K,fe,"↕","\\updownarrow",!0);F(j,K,fe,"⇕","\\Updownarrow",!0);F(j,K,Tn,"∐","\\coprod");F(j,K,Tn,"⋁","\\bigvee");F(j,K,Tn,"⋀","\\bigwedge");F(j,K,Tn,"⨄","\\biguplus");F(j,K,Tn,"⋂","\\bigcap");F(j,K,Tn,"⋃","\\bigcup");F(j,K,Tn,"∫","\\int");F(j,K,Tn,"∫","\\intop");F(j,K,Tn,"∬","\\iint");F(j,K,Tn,"∭","\\iiint");F(j,K,Tn,"∏","\\prod");F(j,K,Tn,"∑","\\sum");F(j,K,Tn,"⨂","\\bigotimes");F(j,K,Tn,"⨁","\\bigoplus");F(j,K,Tn,"⨀","\\bigodot");F(j,K,Tn,"∮","\\oint");F(j,K,Tn,"∯","\\oiint");F(j,K,Tn,"∰","\\oiiint");F(j,K,Tn,"⨆","\\bigsqcup");F(j,K,Tn,"∫","\\smallint");F(qe,K,dh,"…","\\textellipsis");F(j,K,dh,"…","\\mathellipsis");F(qe,K,dh,"…","\\ldots",!0);F(j,K,dh,"…","\\ldots",!0);F(j,K,dh,"⋯","\\@cdots",!0);F(j,K,dh,"⋱","\\ddots",!0);F(j,K,me,"⋮","\\varvdots");F(qe,K,me,"⋮","\\varvdots");F(j,K,Xr,"ˊ","\\acute");F(j,K,Xr,"ˋ","\\grave");F(j,K,Xr,"¨","\\ddot");F(j,K,Xr,"~","\\tilde");F(j,K,Xr,"ˉ","\\bar");F(j,K,Xr,"˘","\\breve");F(j,K,Xr,"ˇ","\\check");F(j,K,Xr,"^","\\hat");F(j,K,Xr,"⃗","\\vec");F(j,K,Xr,"˙","\\dot");F(j,K,Xr,"˚","\\mathring");F(j,K,Tt,"","\\@imath");F(j,K,Tt,"","\\@jmath");F(j,K,me,"ı","ı");F(j,K,me,"ȷ","ȷ");F(qe,K,me,"ı","\\i",!0);F(qe,K,me,"ȷ","\\j",!0);F(qe,K,me,"ß","\\ss",!0);F(qe,K,me,"æ","\\ae",!0);F(qe,K,me,"œ","\\oe",!0);F(qe,K,me,"ø","\\o",!0);F(qe,K,me,"Æ","\\AE",!0);F(qe,K,me,"Œ","\\OE",!0);F(qe,K,me,"Ø","\\O",!0);F(qe,K,Xr,"ˊ","\\'");F(qe,K,Xr,"ˋ","\\`");F(qe,K,Xr,"ˆ","\\^");F(qe,K,Xr,"˜","\\~");F(qe,K,Xr,"ˉ","\\=");F(qe,K,Xr,"˘","\\u");F(qe,K,Xr,"˙","\\.");F(qe,K,Xr,"¸","\\c");F(qe,K,Xr,"˚","\\r");F(qe,K,Xr,"ˇ","\\v");F(qe,K,Xr,"¨",'\\"');F(qe,K,Xr,"˝","\\H");F(qe,K,Xr,"◯","\\textcircled");var NI={"--":!0,"---":!0,"``":!0,"''":!0};F(qe,K,me,"–","--",!0);F(qe,K,me,"–","\\textendash");F(qe,K,me,"—","---",!0);F(qe,K,me,"—","\\textemdash");F(qe,K,me,"‘","`",!0);F(qe,K,me,"‘","\\textquoteleft");F(qe,K,me,"’","'",!0);F(qe,K,me,"’","\\textquoteright");F(qe,K,me,"“","``",!0);F(qe,K,me,"“","\\textquotedblleft");F(qe,K,me,"”","''",!0);F(qe,K,me,"”","\\textquotedblright");F(j,K,me,"°","\\degree",!0);F(qe,K,me,"°","\\degree");F(qe,K,me,"°","\\textdegree",!0);F(j,K,me,"£","\\pounds");F(j,K,me,"£","\\mathsterling",!0);F(qe,K,me,"£","\\pounds");F(qe,K,me,"£","\\textsterling",!0);F(j,ue,me,"✠","\\maltese");F(qe,ue,me,"✠","\\maltese");var PM='0123456789/@."';for(var Dx=0;Dx<PM.length;Dx++){var IM=PM.charAt(Dx);F(j,K,me,IM,IM)}var NM='0123456789!@*()-=+";:?/.,';for(var Px=0;Px<NM.length;Px++){var LM=NM.charAt(Px);F(qe,K,me,LM,LM)}var $p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var Ix=0;Ix<$p.length;Ix++){var qv=$p.charAt(Ix);F(j,K,Tt,qv,qv),F(qe,K,me,qv,qv)}F(j,ue,me,"C","ℂ");F(qe,ue,me,"C","ℂ");F(j,ue,me,"H","ℍ");F(qe,ue,me,"H","ℍ");F(j,ue,me,"N","ℕ");F(qe,ue,me,"N","ℕ");F(j,ue,me,"P","ℙ");F(qe,ue,me,"P","ℙ");F(j,ue,me,"Q","ℚ");F(qe,ue,me,"Q","ℚ");F(j,ue,me,"R","ℝ");F(qe,ue,me,"R","ℝ");F(j,ue,me,"Z","ℤ");F(qe,ue,me,"Z","ℤ");F(j,K,Tt,"h","ℎ");F(qe,K,Tt,"h","ℎ");var Mt="";for(var oi=0;oi<$p.length;oi++){var on=$p.charAt(oi);Mt=String.fromCharCode(55349,56320+oi),F(j,K,Tt,on,Mt),F(qe,K,me,on,Mt),Mt=String.fromCharCode(55349,56372+oi),F(j,K,Tt,on,Mt),F(qe,K,me,on,Mt),Mt=String.fromCharCode(55349,56424+oi),F(j,K,Tt,on,Mt),F(qe,K,me,on,Mt),Mt=String.fromCharCode(55349,56580+oi),F(j,K,Tt,on,Mt),F(qe,K,me,on,Mt),Mt=String.fromCharCode(55349,56684+oi),F(j,K,Tt,on,Mt),F(qe,K,me,on,Mt),Mt=String.fromCharCode(55349,56736+oi),F(j,K,Tt,on,Mt),F(qe,K,me,on,Mt),Mt=String.fromCharCode(55349,56788+oi),F(j,K,Tt,on,Mt),F(qe,K,me,on,Mt),Mt=String.fromCharCode(55349,56840+oi),F(j,K,Tt,on,Mt),F(qe,K,me,on,Mt),Mt=String.fromCharCode(55349,56944+oi),F(j,K,Tt,on,Mt),F(qe,K,me,on,Mt),oi<26&&(Mt=String.fromCharCode(55349,56632+oi),F(j,K,Tt,on,Mt),F(qe,K,me,on,Mt),Mt=String.fromCharCode(55349,56476+oi),F(j,K,Tt,on,Mt),F(qe,K,me,on,Mt))}Mt="𝕜";F(j,K,Tt,"k",Mt);F(qe,K,me,"k",Mt);for(var ql=0;ql<10;ql++){var Io=ql.toString();Mt=String.fromCharCode(55349,57294+ql),F(j,K,Tt,Io,Mt),F(qe,K,me,Io,Mt),Mt=String.fromCharCode(55349,57314+ql),F(j,K,Tt,Io,Mt),F(qe,K,me,Io,Mt),Mt=String.fromCharCode(55349,57324+ql),F(j,K,Tt,Io,Mt),F(qe,K,me,Io,Mt),Mt=String.fromCharCode(55349,57334+ql),F(j,K,Tt,Io,Mt),F(qe,K,me,Io,Mt)}var A_="ÐÞþ";for(var Nx=0;Nx<A_.length;Nx++){var Xv=A_.charAt(Nx);F(j,K,Tt,Xv,Xv),F(qe,K,me,Xv,Xv)}var Yv=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],kM=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],_ae=(r,e)=>{var t=r.charCodeAt(0),n=r.charCodeAt(1),i=(t-55296)*1024+(n-56320)+65536,a=e==="math"?0:1;if(119808<=i&&i<120484){var s=Math.floor((i-119808)/26);return[Yv[s][2],Yv[s][a]]}else if(120782<=i&&i<=120831){var o=Math.floor((i-120782)/10);return[kM[o][2],kM[o][a]]}else{if(i===120485||i===120486)return[Yv[0][2],Yv[0][a]];if(120486<i&&i<120782)return["",""];throw new Qe("Unsupported character: "+r)}},Fg=function(e,t,n){if(Vr[n][e]){var i=Vr[n][e].replace;i&&(e=i)}return{value:e,metrics:B3(e,t,n)}},ci=function(e,t,n,i,a){var s=Fg(e,t,n),o=s.metrics;e=s.value;var l;if(o){var c=o.italic;(n==="text"||i&&i.font==="mathit")&&(c=0),l=new Yi(e,o.height,o.depth,c,o.skew,o.width,a)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+e+"' in style '"+t+"' and mode '"+n+"'")),l=new Yi(e,0,0,0,0,0,a);if(i){l.maxFontSize=i.sizeMultiplier,i.style.isTight()&&l.classes.push("mtight");var h=i.getColor();h&&(l.style.color=h)}return l},F3=function(e,t,n,i){return i===void 0&&(i=[]),n.font==="boldsymbol"&&Fg(e,"Main-Bold",t).metrics?ci(e,"Main-Bold",t,n,i.concat(["mathbf"])):e==="\\"||Vr[t][e].font==="main"?ci(e,"Main-Regular",t,n,i):ci(e,"AMS-Regular",t,n,i.concat(["amsrm"]))},wae=function(e,t,n,i,a){return a!=="textord"&&Fg(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},zg=function(e,t,n){var i=e.mode,a=e.text,s=["mord"],o=i==="math"||i==="text"&&t.font,l=o?t.font:t.fontFamily,c="",h="";if(a.charCodeAt(0)===55349&&([c,h]=_ae(a,i)),c.length>0)return ci(a,c,i,t,s.concat(h));if(l){var d,v;if(l==="boldsymbol"){var g=wae(a,i,t,s,n);d=g.fontName,v=[g.fontClass]}else o?(d=M_[l].fontName,v=[l]):(d=Wv(l,t.fontWeight,t.fontShape),v=[l,t.fontWeight,t.fontShape]);if(Fg(a,d,i).metrics)return ci(a,d,i,t,s.concat(v));if(NI.hasOwnProperty(a)&&d.slice(0,10)==="Typewriter"){for(var m=[],x=0;x<a.length;x++)m.push(ci(a[x],d,i,t,s.concat(v)));return eo(m)}}if(n==="mathord")return ci(a,"Math-Italic",i,t,s.concat(["mathnormal"]));if(n==="textord"){var y=Vr[i][a]&&Vr[i][a].font;if(y==="ams"){var _=Wv("amsrm",t.fontWeight,t.fontShape);return ci(a,_,i,t,s.concat("amsrm",t.fontWeight,t.fontShape))}else if(y==="main"||!y){var w=Wv("textrm",t.fontWeight,t.fontShape);return ci(a,w,i,t,s.concat(t.fontWeight,t.fontShape))}else{var S=Wv(y,t.fontWeight,t.fontShape);return ci(a,S,i,t,s.concat(S,t.fontWeight,t.fontShape))}}else throw new Error("unexpected type: "+n+" in makeOrd")},Sae=(r,e)=>{if(al(r.classes)!==al(e.classes)||r.skew!==e.skew||r.maxFontSize!==e.maxFontSize||r.italic!==0&&r.hasClass("mathnormal"))return!1;if(r.classes.length===1){var t=r.classes[0];if(t==="mbin"||t==="mord")return!1}for(var n of Object.keys(r.style))if(r.style[n]!==e.style[n])return!1;for(var i of Object.keys(e.style))if(r.style[i]!==e.style[i])return!1;return!0},LI=r=>{for(var e=0;e<r.length-1;e++){var t=r[e],n=r[e+1];t instanceof Yi&&n instanceof Yi&&Sae(t,n)&&(t.text+=n.text,t.height=Math.max(t.height,n.height),t.depth=Math.max(t.depth,n.depth),t.italic=n.italic,r.splice(e+1,1),e--)}return r},z3=function(e){for(var t=0,n=0,i=0,a=0;a<e.children.length;a++){var s=e.children[a];s.height>t&&(t=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=i},Xe=function(e,t,n,i){var a=new fh(e,t,n,i);return z3(a),a},ol=(r,e,t,n)=>new fh(r,e,t,n),Yc=function(e,t,n){var i=Xe([e],[],t);return i.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),i.style.borderBottomWidth=it(i.height),i.maxFontSize=1,i},Eae=function(e,t,n,i){var a=new Bg(e,t,n,i);return z3(a),a},eo=function(e){var t=new hh(e);return z3(t),t},Wc=function(e,t){return e instanceof hh?Xe([],[e],t):e},Tae=function(e){if(e.positionType==="individualShift"){for(var t=e.children,n=[t[0]],i=-t[0].shift-t[0].elem.depth,a=i,s=1;s<t.length;s++){var o=-t[s].shift-a-t[s].elem.depth,l=o-(t[s-1].elem.height+t[s-1].elem.depth);a=a+o,n.push({type:"kern",size:l}),n.push(t[s])}return{children:n,depth:i}}var c;if(e.positionType==="top"){for(var h=e.positionData,d=0;d<e.children.length;d++){var v=e.children[d];h-=v.type==="kern"?v.size:v.elem.height+v.elem.depth}c=h}else if(e.positionType==="bottom")c=-e.positionData;else{var g=e.children[0];if(g.type!=="elem")throw new Error('First child must have type "elem".');if(e.positionType==="shift")c=-g.elem.depth-e.positionData;else if(e.positionType==="firstBaseline")c=-g.elem.depth;else throw new Error("Invalid positionType "+e.positionType+".")}return{children:e.children,depth:c}},sr=function(e,t){for(var{children:n,depth:i}=Tae(e),a=0,s=0;s<n.length;s++){var o=n[s];if(o.type==="elem"){var l=o.elem;a=Math.max(a,l.maxFontSize,l.height)}}a+=2;var c=Xe(["pstrut"],[]);c.style.height=it(a);for(var h=[],d=i,v=i,g=i,m=0;m<n.length;m++){var x=n[m];if(x.type==="kern")g+=x.size;else{var y=x.elem,_=x.wrapperClasses||[],w=x.wrapperStyle||{},S=Xe(_,[c,y],void 0,w);S.style.top=it(-a-g-y.depth),x.marginLeft&&(S.style.marginLeft=x.marginLeft),x.marginRight&&(S.style.marginRight=x.marginRight),h.push(S),g+=y.height+y.depth}d=Math.min(d,g),v=Math.max(v,g)}var A=Xe(["vlist"],h);A.style.height=it(v);var C;if(d<0){var M=Xe([],[]),E=Xe(["vlist"],[M]);E.style.height=it(-d);var O=Xe(["vlist-s"],[new Yi("​")]);C=[Xe(["vlist-r"],[A,O]),Xe(["vlist-r"],[E])]}else C=[Xe(["vlist-r"],[A])];var D=Xe(["vlist-t"],C);return C.length===2&&D.classes.push("vlist-t2"),D.height=v,D.depth=-d,D},kI=(r,e)=>{var t=Xe(["mspace"],[],e),n=Zr(r,e);return t.style.marginRight=it(n),t},Wv=function(e,t,n){var i="";switch(e){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=e}var a;return t==="textbf"&&n==="textit"?a="BoldItalic":t==="textbf"?a="Bold":t==="textit"?a="Italic":a="Regular",i+"-"+a},M_={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},BI={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},FI=function(e,t){var[n,i,a]=BI[e],s=new sl(n),o=new qs([s],{width:it(i),height:it(a),style:"width:"+it(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=ol(["overlay"],[o],t);return l.height=a,l.style.height=it(a),l.style.width=it(i),l},$r={number:3,unit:"mu"},Xl={number:4,unit:"mu"},Ns={number:5,unit:"mu"},Cae={mord:{mop:$r,mbin:Xl,mrel:Ns,minner:$r},mop:{mord:$r,mop:$r,mrel:Ns,minner:$r},mbin:{mord:Xl,mop:Xl,mopen:Xl,minner:Xl},mrel:{mord:Ns,mop:Ns,mopen:Ns,minner:Ns},mopen:{},mclose:{mop:$r,mbin:Xl,mrel:Ns,minner:$r},mpunct:{mord:$r,mop:$r,mrel:Ns,mopen:$r,mclose:$r,mpunct:$r,minner:$r},minner:{mord:$r,mop:$r,mbin:Xl,mrel:Ns,mopen:$r,mpunct:$r,minner:$r}},Aae={mord:{mop:$r},mop:{mord:$r,mop:$r},mbin:{},mrel:{},mopen:{},mclose:{mop:$r},mpunct:{},minner:{mop:$r}},zI={},Kp={},Zp={};function ft(r){for(var{type:e,names:t,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=r,o={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},l=0;l<t.length;++l)zI[t[l]]=o;e&&(a&&(Kp[e]=a),s&&(Zp[e]=s))}function Cu(r){var{type:e,htmlBuilder:t,mathmlBuilder:n}=r;ft({type:e,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:t,mathmlBuilder:n})}var Qp=function(e){return e.type==="ordgroup"&&e.body.length===1?e.body[0]:e},Sn=function(e){return e.type==="ordgroup"?e.body:[e]},Mae=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),Rae=new Set(["rightmost","mrel","mclose","mpunct"]),Oae={display:Dt.DISPLAY,text:Dt.TEXT,script:Dt.SCRIPT,scriptscript:Dt.SCRIPTSCRIPT},Dae={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Dn=function(e,t,n,i){i===void 0&&(i=[null,null]);for(var a=[],s=0;s<e.length;s++){var o=or(e[s],t);if(o instanceof hh){var l=o.children;a.push(...l)}else a.push(o)}if(LI(a),!n)return a;var c=t;if(e.length===1){var h=e[0];h.type==="sizing"?c=t.havingSize(h.size):h.type==="styling"&&(c=t.havingStyle(Oae[h.style]))}var d=Xe([i[0]||"leftmost"],[],t),v=Xe([i[1]||"rightmost"],[],t),g=n==="root";return R_(a,(m,x)=>{var y=x.classes[0],_=m.classes[0];y==="mbin"&&Rae.has(_)?x.classes[0]="mord":_==="mbin"&&Mae.has(y)&&(m.classes[0]="mord")},{node:d},v,g),R_(a,(m,x)=>{var y,_,w=D_(x),S=D_(m),A=w&&S?m.hasClass("mtight")?(y=Aae[w])==null?void 0:y[S]:(_=Cae[w])==null?void 0:_[S]:null;if(A)return kI(A,c)},{node:d},v,g),a},R_=function(e,t,n,i,a){i&&e.push(i);for(var s=0;s<e.length;s++){var o=e[s],l=UI(o);if(l){R_(l.children,t,n,null,a);continue}var c=!o.hasClass("mspace");if(c){var h=t(o,n.node);h&&(n.insertAfter?n.insertAfter(h):(e.unshift(h),s++))}c?n.node=o:a&&o.hasClass("newline")&&(n.node=Xe(["leftmost"])),n.insertAfter=(d=>v=>{e.splice(d+1,0,v),s++})(s)}i&&e.pop()},UI=function(e){return e instanceof hh||e instanceof Bg||e instanceof fh&&e.hasClass("enclosing")?e:null},O_=function(e,t){var n=UI(e);if(n){var i=n.children;if(i.length){if(t==="right")return O_(i[i.length-1],"right");if(t==="left")return O_(i[0],"left")}}return e},D_=function(e,t){if(!e)return null;t&&(e=O_(e,t));var n=e.classes[0];return Dae[n]||null},Sd=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Xe(t.concat(n))},or=function(e,t,n){if(!e)return Xe();if(Kp[e.type]){var i=Kp[e.type](e,t);if(n&&t.size!==n.size){i=Xe(t.sizingClasses(n),[i],t);var a=t.sizeMultiplier/n.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new Qe("Got group of unknown type: '"+e.type+"'")};function $v(r,e){var t=Xe(["base"],r,e),n=Xe(["strut"]);return n.style.height=it(t.height+t.depth),t.depth&&(n.style.verticalAlign=it(-t.depth)),t.children.unshift(n),t}function P_(r,e){var t=null;r.length===1&&r[0].type==="tag"&&(t=r[0].tag,r=r[0].body);var n=Dn(r,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var a=[],s=[],o=0;o<n.length;o++)if(s.push(n[o]),n[o].hasClass("mbin")||n[o].hasClass("mrel")||n[o].hasClass("allowbreak")){for(var l=!1;o<n.length-1&&n[o+1].hasClass("mspace")&&!n[o+1].hasClass("newline");)o++,s.push(n[o]),n[o].hasClass("nobreak")&&(l=!0);l||(a.push($v(s,e)),s=[])}else n[o].hasClass("newline")&&(s.pop(),s.length>0&&(a.push($v(s,e)),s=[]),a.push(n[o]));s.length>0&&a.push($v(s,e));var c;t?(c=$v(Dn(t,e,!0),e),c.classes=["tag"],a.push(c)):i&&a.push(i);var h=Xe(["katex-html"],a);if(h.setAttribute("aria-hidden","true"),c){var d=c.children[0];d.style.height=it(h.height+h.depth),h.depth&&(d.style.verticalAlign=it(-h.depth))}return h}function GI(r){return new hh(r)}class et{constructor(e,t,n){this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=al(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof En&&this.children[n+1]instanceof En){for(var i=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof En;)i+=this.children[++n].toText();e.appendChild(new En(i).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=ti(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+ti(al(this.classes))+'"'),e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</"+this.type+">",e}toText(){return this.children.map(e=>e.toText()).join("")}}class En{constructor(e){this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return ti(this.toText())}toText(){return this.text}}class HI{constructor(e){this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",it(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+it(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var Pae=new Set(["\\imath","\\jmath"]),Iae=new Set(["mrow","mtable"]),wa=function(e,t,n){return Vr[t][e]&&Vr[t][e].replace&&e.charCodeAt(0)!==55349&&!(NI.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=Vr[t][e].replace),new En(e)},U3=function(e){return e.length===1?e[0]:new et("mrow",e)},G3=function(e,t){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold";var n=t.font;if(!n||n==="mathnormal")return null;var i=e.mode;if(n==="mathit")return"italic";if(n==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(n==="mathbf")return"bold";if(n==="mathbb")return"double-struck";if(n==="mathsfit")return"sans-serif-italic";if(n==="mathfrak")return"fraktur";if(n==="mathscr"||n==="mathcal")return"script";if(n==="mathsf")return"sans-serif";if(n==="mathtt")return"monospace";var a=e.text;if(Pae.has(a))return null;if(Vr[i][a]){var s=Vr[i][a].replace;s&&(a=s)}var o=M_[n].fontName;return B3(a,o,i)?M_[n].variant:null};function Lx(r){if(!r)return!1;if(r.type==="mi"&&r.children.length===1){var e=r.children[0];return e instanceof En&&e.text==="."}else if(r.type==="mo"&&r.children.length===1&&r.getAttribute("separator")==="true"&&r.getAttribute("lspace")==="0em"&&r.getAttribute("rspace")==="0em"){var t=r.children[0];return t instanceof En&&t.text===","}else return!1}var $i=function(e,t,n){if(e.length===1){var i=Mr(e[0],t);return n&&i instanceof et&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],s,o=0;o<e.length;o++){var l=Mr(e[o],t);if(l instanceof et&&s instanceof et){if(l.type==="mtext"&&s.type==="mtext"&&l.getAttribute("mathvariant")===s.getAttribute("mathvariant")){s.children.push(...l.children);continue}else if(l.type==="mn"&&s.type==="mn"){s.children.push(...l.children);continue}else if(Lx(l)&&s.type==="mn"){s.children.push(...l.children);continue}else if(l.type==="mn"&&Lx(s))l.children=[...s.children,...l.children],a.pop();else if((l.type==="msup"||l.type==="msub")&&l.children.length>=1&&(s.type==="mn"||Lx(s))){var c=l.children[0];c instanceof et&&c.type==="mn"&&(c.children=[...s.children,...c.children],a.pop())}else if(s.type==="mi"&&s.children.length===1){var h=s.children[0];if(h instanceof En&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof En&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),a.pop())}}}a.push(l),s=l}return a},ll=function(e,t,n){return U3($i(e,t,n))},Mr=function(e,t){if(!e)return new et("mrow");if(Zp[e.type]){var n=Zp[e.type](e,t);return n}else throw new Qe("Got group of unknown type: '"+e.type+"'")};function BM(r,e,t,n,i){var a=$i(r,t),s;a.length===1&&a[0]instanceof et&&Iae.has(a[0].type)?s=a[0]:s=new et("mrow",a);var o=new et("annotation",[new En(e)]);o.setAttribute("encoding","application/x-tex");var l=new et("semantics",[s,o]),c=new et("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&c.setAttribute("display","block");var h=i?"katex":"katex-mathml";return Xe([h],[c])}var Nae=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],FM=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],zM=function(e,t){return t.size<2?e:Nae[e-1][t.size-1]};class Bs{constructor(e){this.style=e.style,this.color=e.color,this.size=e.size||Bs.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=FM[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(t,e),new Bs(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:zM(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:FM[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=zM(Bs.BASESIZE,e);return this.size===t&&this.textSize===Bs.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Bs.BASESIZE?["sizing","reset-size"+this.size,"size"+Bs.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=yae(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Bs.BASESIZE=6;var jI=function(e){return new Bs({style:e.displayMode?Dt.DISPLAY:Dt.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},VI=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=Xe(n,[e])}return e},Lae=function(e,t,n){var i=jI(n),a;if(n.output==="mathml")return BM(e,t,i,n.displayMode,!0);if(n.output==="html"){var s=P_(e,i);a=Xe(["katex"],[s])}else{var o=BM(e,t,i,n.displayMode,!1),l=P_(e,i);a=Xe(["katex"],[o,l])}return VI(a,n)},kae=function(e,t,n){var i=jI(n),a=P_(e,i),s=Xe(["katex"],[a]);return VI(s,n)},Bae={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Ug=function(e){var t=new et("mo",[new En(Bae[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Fae={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},zae=new Set(["widehat","widecheck","widetilde","utilde"]),Gg=function(e,t){function n(){var o=4e5,l=e.label.slice(1);if(zae.has(l)){var c=e,h=c.base.type==="ordgroup"?c.base.body.length:1,d,v,g;if(h>5)l==="widehat"||l==="widecheck"?(d=420,o=2364,g=.42,v=l+"4"):(d=312,o=2340,g=.34,v="tilde4");else{var m=[1,1,2,2,3,3][h];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][m],d=[0,239,300,360,420][m],g=[0,.24,.3,.3,.36,.42][m],v=l+m):(o=[0,600,1033,2339,2340][m],d=[0,260,286,306,312][m],g=[0,.26,.286,.3,.306,.34][m],v="tilde"+m)}var x=new sl(v),y=new qs([x],{width:"100%",height:it(g),viewBox:"0 0 "+o+" "+d,preserveAspectRatio:"none"});return{span:ol([],[y],t),minWidth:0,height:g}}else{var _=[],w=Fae[l],[S,A,C]=w,M=C/1e3,E=S.length,O,D;if(E===1){var I=w[3];O=["hide-tail"],D=[I]}else if(E===2)O=["halfarrow-left","halfarrow-right"],D=["xMinYMin","xMaxYMin"];else if(E===3)O=["brace-left","brace-center","brace-right"],D=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
  1968. `+E+" children.");for(var k=0;k<E;k++){var U=new sl(S[k]),V=new qs([U],{width:"400em",height:it(M),viewBox:"0 0 "+o+" "+C,preserveAspectRatio:D[k]+" slice"}),X=ol([O[k]],[V],t);if(E===1)return{span:X,minWidth:A,height:M};X.style.height=it(M),_.push(X)}return{span:Xe(["stretchy"],_,t),minWidth:A,height:M}}}var{span:i,minWidth:a,height:s}=n();return i.height=s,i.style.height=it(s),a>0&&(i.style.minWidth=it(a)),i},Uae=function(e,t,n,i,a){var s,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(t)){if(s=Xe(["stretchy",t],[],a),t==="fbox"){var l=a.color&&a.getColor();l&&(s.style.borderColor=l)}}else{var c=[];/^[bx]cancel$/.test(t)&&c.push(new C_({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&c.push(new C_({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new qs(c,{width:"100%",height:it(o)});s=ol([],[h],a)}return s.height=o,s.style.height=it(o),s};function Ft(r,e){if(!r||r.type!==e)throw new Error("Expected node of type "+e+", but got "+(r?"node of type "+r.type:String(r)));return r}function Hg(r){var e=jg(r);if(!e)throw new Error("Expected node of symbol group type, but got "+(r?"node of type "+r.type:String(r)));return e}function jg(r){return r&&(r.type==="atom"||xae.hasOwnProperty(r.type))?r:null}var qI=r=>{if(r instanceof Yi)return r;if(gae(r)&&r.children.length===1)return qI(r.children[0])},H3=(r,e)=>{var t,n,i;r&&r.type==="supsub"?(n=Ft(r.base,"accent"),t=n.base,r.base=t,i=pae(or(r,e)),r.base=n):(n=Ft(r,"accent"),t=n.base);var a=or(t,e.havingCrampedStyle()),s=n.isShifty&&Qs(t),o=0;if(s){var l,c;o=(l=(c=qI(a))==null?void 0:c.skew)!=null?l:0}var h=n.label==="\\c",d=h?a.height+a.depth:Math.min(a.height,e.fontMetrics().xHeight),v;if(n.isStretchy)v=Gg(n,e),v=sr({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:v,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+it(2*o)+")",marginLeft:it(2*o)}:void 0}]});else{var g,m;n.label==="\\vec"?(g=FI("vec",e),m=BI.vec[1]):(g=zg({mode:n.mode,text:n.label},e,"textord"),g=vae(g),g.italic=0,m=g.width,h&&(d+=g.depth)),v=Xe(["accent-body"],[g]);var x=n.label==="\\textcircled";x&&(v.classes.push("accent-full"),d=a.height);var y=o;x||(y-=m/2),v.style.left=it(y),n.label==="\\textcircled"&&(v.style.top=".2em"),v=sr({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:v}]})}var _=Xe(["mord","accent"],[v],e);return i?(i.children[0]=_,i.height=Math.max(_.height,i.height),i.classes[0]="mord",i):_},XI=(r,e)=>{var t=r.isStretchy?Ug(r.label):new et("mo",[wa(r.label,r.mode)]),n=new et("mover",[Mr(r.base,e),t]);return n.setAttribute("accent","true"),n},Gae=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(r=>"\\"+r).join("|"));ft({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(r,e)=>{var t=Qp(e[0]),n=!Gae.test(r.funcName),i=!n||r.funcName==="\\widehat"||r.funcName==="\\widetilde"||r.funcName==="\\widecheck";return{type:"accent",mode:r.parser.mode,label:r.funcName,isStretchy:n,isShifty:i,base:t}},htmlBuilder:H3,mathmlBuilder:XI});ft({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(r,e)=>{var t=e[0],n=r.parser.mode;return n==="math"&&(r.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+r.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:r.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:H3,mathmlBuilder:XI});ft({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"accentUnder",mode:t.mode,label:n,base:i}},htmlBuilder:(r,e)=>{var t=or(r.base,e),n=Gg(r,e),i=r.label==="\\utilde"?.12:0,a=sr({positionType:"top",positionData:t.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:t}]});return Xe(["mord","accentunder"],[a],e)},mathmlBuilder:(r,e)=>{var t=Ug(r.label),n=new et("munder",[Mr(r.base,e),t]);return n.setAttribute("accentunder","true"),n}});var Kv=r=>{var e=new et("mpadded",r?[r]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};ft({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:n,funcName:i}=r;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:t[0]}},htmlBuilder(r,e){var t=e.style,n=e.havingStyle(t.sup()),i=Wc(or(r.body,n,e),e),a=r.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var s;r.below&&(n=e.havingStyle(t.sub()),s=Wc(or(r.below,n,e),e),s.classes.push(a+"-arrow-pad"));var o=Gg(r,e),l=-e.fontMetrics().axisHeight+.5*o.height,c=-e.fontMetrics().axisHeight-.5*o.height-.111;(i.depth>.25||r.label==="\\xleftequilibrium")&&(c-=i.depth);var h;if(s){var d=-e.fontMetrics().axisHeight+s.height+.5*o.height+.111;h=sr({positionType:"individualShift",children:[{type:"elem",elem:i,shift:c},{type:"elem",elem:o,shift:l},{type:"elem",elem:s,shift:d}]})}else h=sr({positionType:"individualShift",children:[{type:"elem",elem:i,shift:c},{type:"elem",elem:o,shift:l}]});return h.children[0].children[0].children[1].classes.push("svg-align"),Xe(["mrel","x-arrow"],[h],e)},mathmlBuilder(r,e){var t=Ug(r.label);t.setAttribute("minsize",r.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(r.body){var i=Kv(Mr(r.body,e));if(r.below){var a=Kv(Mr(r.below,e));n=new et("munderover",[t,a,i])}else n=new et("mover",[t,i])}else if(r.below){var s=Kv(Mr(r.below,e));n=new et("munder",[t,s])}else n=Kv(),n=new et("mover",[t,n]);return n}});function YI(r,e){var t=Dn(r.body,e,!0);return Xe([r.mclass],t,e)}function WI(r,e){var t,n=$i(r.body,e);return r.mclass==="minner"?t=new et("mpadded",n):r.mclass==="mord"?r.isCharacterBox?(t=n[0],t.type="mi"):t=new et("mi",n):(r.isCharacterBox?(t=n[0],t.type="mo"):t=new et("mo",n),r.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):r.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):r.mclass==="mopen"||r.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):r.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}ft({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"mclass",mode:t.mode,mclass:"m"+n.slice(5),body:Sn(i),isCharacterBox:Qs(i)}},htmlBuilder:YI,mathmlBuilder:WI});var Vg=r=>{var e=r.type==="ordgroup"&&r.body.length?r.body[0]:r;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};ft({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(r,e){var{parser:t}=r;return{type:"mclass",mode:t.mode,mclass:Vg(e[0]),body:Sn(e[1]),isCharacterBox:Qs(e[1])}}});ft({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(r,e){var{parser:t,funcName:n}=r,i=e[1],a=e[0],s;n!=="\\stackrel"?s=Vg(i):s="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Sn(i)},l={type:"supsub",mode:a.mode,base:o,sup:n==="\\underset"?null:a,sub:n==="\\underset"?a:null};return{type:"mclass",mode:t.mode,mclass:s,body:[l],isCharacterBox:Qs(l)}},htmlBuilder:YI,mathmlBuilder:WI});ft({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"pmb",mode:t.mode,mclass:Vg(e[0]),body:Sn(e[0])}},htmlBuilder(r,e){var t=Dn(r.body,e,!0),n=Xe([r.mclass],t,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(r,e){var t=$i(r.body,e),n=new et("mstyle",t);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var Hae={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},UM=()=>({type:"styling",body:[],mode:"math",style:"display"}),GM=r=>r.type==="textord"&&r.text==="@",jae=(r,e)=>(r.type==="mathord"||r.type==="atom")&&r.text===e;function Vae(r,e,t){var n=Hae[r];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=t.callFunction("\\\\cdleft",[e[0]],[]),a={type:"atom",text:n,mode:"math",family:"rel"},s=t.callFunction("\\Big",[a],[]),o=t.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,s,o]};return t.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var c={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[c],[])}default:return{type:"textord",text:" ",mode:"math"}}}function qae(r){var e=[];for(r.gullet.beginGroup(),r.gullet.macros.set("\\cr","\\\\\\relax"),r.gullet.beginGroup();;){e.push(r.parseExpression(!1,"\\\\")),r.gullet.endGroup(),r.gullet.beginGroup();var t=r.fetch().text;if(t==="&"||t==="\\\\")r.consume();else if(t==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new Qe("Expected \\\\ or \\cr or \\end",r.nextToken)}for(var n=[],i=[n],a=0;a<e.length;a++){for(var s=e[a],o=UM(),l=0;l<s.length;l++)if(!GM(s[l]))o.body.push(s[l]);else{n.push(o),l+=1;var c=Hg(s[l]).text,h=new Array(2);if(h[0]={type:"ordgroup",mode:"math",body:[]},h[1]={type:"ordgroup",mode:"math",body:[]},!"=|.".includes(c))if("<>AV".includes(c))for(var d=0;d<2;d++){for(var v=!0,g=l+1;g<s.length;g++){if(jae(s[g],c)){v=!1,l=g;break}if(GM(s[g]))throw new Qe("Missing a "+c+" character to complete a CD arrow.",s[g]);h[d].body.push(s[g])}if(v)throw new Qe("Missing a "+c+" character to complete a CD arrow.",s[l])}else throw new Qe('Expected one of "<>AV=|." after @',s[l]);var m=Vae(c,h,r),x={type:"styling",body:[m],mode:"math",style:"display"};n.push(x),o=UM()}a%2===0?n.push(o):n.shift(),n=[],i.push(n)}r.gullet.endGroup(),r.gullet.endGroup();var y=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:y,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}ft({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r;return{type:"cdlabel",mode:t.mode,side:n.slice(4),label:e[0]}},htmlBuilder(r,e){var t=e.havingStyle(e.style.sup()),n=Wc(or(r.label,t,e),e);return n.classes.push("cd-label-"+r.side),n.style.bottom=it(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(r,e){var t=new et("mrow",[Mr(r.label,e)]);return t=new et("mpadded",[t]),t.setAttribute("width","0"),r.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new et("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});ft({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(r,e){var{parser:t}=r;return{type:"cdlabelparent",mode:t.mode,fragment:e[0]}},htmlBuilder(r,e){var t=Wc(or(r.fragment,e),e);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(r,e){return new et("mrow",[Mr(r.fragment,e)])}});ft({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(r,e){for(var{parser:t}=r,n=Ft(e[0],"ordgroup"),i=n.body,a="",s=0;s<i.length;s++){var o=Ft(i[s],"textord");a+=o.text}var l=parseInt(a),c;if(isNaN(l))throw new Qe("\\@char has non-numeric argument "+a);if(l<0||l>=1114111)throw new Qe("\\@char with invalid code point "+a);return l<=65535?c=String.fromCharCode(l):(l-=65536,c=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:t.mode,text:c}}});var $I=(r,e)=>{var t=Dn(r.body,e.withColor(r.color),!1);return eo(t)},KI=(r,e)=>{var t=$i(r.body,e.withColor(r.color)),n=new et("mstyle",t);return n.setAttribute("mathcolor",r.color),n};ft({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(r,e){var{parser:t}=r,n=Ft(e[0],"color-token").color,i=e[1];return{type:"color",mode:t.mode,color:n,body:Sn(i)}},htmlBuilder:$I,mathmlBuilder:KI});ft({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(r,e){var{parser:t,breakOnTokenText:n}=r,i=Ft(e[0],"color-token").color;t.gullet.macros.set("\\current@color",i);var a=t.parseExpression(!0,n);return{type:"color",mode:t.mode,color:i,body:a}},htmlBuilder:$I,mathmlBuilder:KI});ft({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(r,e,t){var{parser:n}=r,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,a=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:a,size:i&&Ft(i,"size").value}},htmlBuilder(r,e){var t=Xe(["mspace"],[],e);return r.newLine&&(t.classes.push("newline"),r.size&&(t.style.marginTop=it(Zr(r.size,e)))),t},mathmlBuilder(r,e){var t=new et("mspace");return r.newLine&&(t.setAttribute("linebreak","newline"),r.size&&t.setAttribute("height",it(Zr(r.size,e)))),t}});var I_={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},ZI=r=>{var e=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Qe("Expected a control sequence",r);return e},Xae=r=>{var e=r.gullet.popToken();return e.text==="="&&(e=r.gullet.popToken(),e.text===" "&&(e=r.gullet.popToken())),e},QI=(r,e,t,n)=>{var i=r.gullet.macros.get(t.text);i==null&&(t.noexpand=!0,i={tokens:[t],numArgs:0,unexpandable:!r.gullet.isExpandable(t.text)}),r.gullet.macros.set(e,i,n)};ft({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(r){var{parser:e,funcName:t}=r;e.consumeSpaces();var n=e.fetch();if(I_[n.text])return(t==="\\global"||t==="\\\\globallong")&&(n.text=I_[n.text]),Ft(e.parseFunction(),"internal");throw new Qe("Invalid token after macro prefix",n)}});ft({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new Qe("Expected a control sequence",n);for(var a=0,s,o=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){s=e.gullet.future(),o[a].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new Qe('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==a+1)throw new Qe('Argument number "'+n.text+'" out of order');a++,o.push([])}else{if(n.text==="EOF")throw new Qe("Expected a macro definition");o[a].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return s&&l.unshift(s),(t==="\\edef"||t==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:a,delimiters:o},t===I_[t]),{type:"internal",mode:e.mode}}});ft({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=ZI(e.gullet.popToken());e.gullet.consumeSpaces();var i=Xae(e);return QI(e,n,i,t==="\\\\globallet"),{type:"internal",mode:e.mode}}});ft({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=ZI(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return QI(e,n,a,t==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var kf=function(e,t,n){var i=Vr.math[e]&&Vr.math[e].replace,a=B3(i||e,t,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return a},j3=function(e,t,n,i){var a=n.havingBaseStyle(t),s=Xe(i.concat(a.sizingClasses(n)),[e],n),o=a.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=a.sizeMultiplier,s},JI=function(e,t,n){var i=t.havingBaseStyle(n),a=(1-t.sizeMultiplier/i.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=it(a),e.height-=a,e.depth+=a},Yae=function(e,t,n,i,a,s){var o=ci(e,"Main-Regular",a,i),l=j3(o,t,i,s);return JI(l,i,t),l},Wae=function(e,t,n,i){return ci(e,"Size"+t+"-Regular",n,i)},eN=function(e,t,n,i,a,s){var o=Wae(e,t,a,i),l=j3(Xe(["delimsizing","size"+t],[o],i),Dt.TEXT,i,s);return n&&JI(l,i,Dt.TEXT),l},kx=function(e,t,n){var i;t==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Xe(["delimsizinginner",i],[Xe([],[ci(e,t,n)])]);return{type:"elem",elem:a}},Bx=function(e,t,n){var i=ts["Size4-Regular"][e.charCodeAt(0)]?ts["Size4-Regular"][e.charCodeAt(0)][4]:ts["Size1-Regular"][e.charCodeAt(0)][4],a=new sl("inner",lae(e,Math.round(1e3*t))),s=new qs([a],{width:it(i),height:it(t),style:"width:"+it(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=ol([],[s],n);return o.height=t,o.style.height=it(t),o.style.width=it(i),{type:"elem",elem:o}},N_=.008,Zv={type:"kern",size:-1*N_},$ae=new Set(["|","\\lvert","\\rvert","\\vert"]),Kae=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),tN=function(e,t,n,i,a,s){var o,l,c,h,d="",v=0;o=c=h=e,l=null;var g="Size1-Regular";e==="\\uparrow"?c=h="⏐":e==="\\Uparrow"?c=h="‖":e==="\\downarrow"?o=c="⏐":e==="\\Downarrow"?o=c="‖":e==="\\updownarrow"?(o="\\uparrow",c="⏐",h="\\downarrow"):e==="\\Updownarrow"?(o="\\Uparrow",c="‖",h="\\Downarrow"):$ae.has(e)?(c="∣",d="vert",v=333):Kae.has(e)?(c="∥",d="doublevert",v=556):e==="["||e==="\\lbrack"?(o="⎡",c="⎢",h="⎣",g="Size4-Regular",d="lbrack",v=667):e==="]"||e==="\\rbrack"?(o="⎤",c="⎥",h="⎦",g="Size4-Regular",d="rbrack",v=667):e==="\\lfloor"||e==="⌊"?(c=o="⎢",h="⎣",g="Size4-Regular",d="lfloor",v=667):e==="\\lceil"||e==="⌈"?(o="⎡",c=h="⎢",g="Size4-Regular",d="lceil",v=667):e==="\\rfloor"||e==="⌋"?(c=o="⎥",h="⎦",g="Size4-Regular",d="rfloor",v=667):e==="\\rceil"||e==="⌉"?(o="⎤",c=h="⎥",g="Size4-Regular",d="rceil",v=667):e==="("||e==="\\lparen"?(o="⎛",c="⎜",h="⎝",g="Size4-Regular",d="lparen",v=875):e===")"||e==="\\rparen"?(o="⎞",c="⎟",h="⎠",g="Size4-Regular",d="rparen",v=875):e==="\\{"||e==="\\lbrace"?(o="⎧",l="⎨",h="⎩",c="⎪",g="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(o="⎫",l="⎬",h="⎭",c="⎪",g="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(o="⎧",h="⎩",c="⎪",g="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(o="⎫",h="⎭",c="⎪",g="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(o="⎧",h="⎭",c="⎪",g="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(o="⎫",h="⎩",c="⎪",g="Size4-Regular");var m=kf(o,g,a),x=m.height+m.depth,y=kf(c,g,a),_=y.height+y.depth,w=kf(h,g,a),S=w.height+w.depth,A=0,C=1;if(l!==null){var M=kf(l,g,a);A=M.height+M.depth,C=2}var E=x+S+A,O=Math.max(0,Math.ceil((t-E)/(C*_))),D=E+O*C*_,I=i.fontMetrics().axisHeight;n&&(I*=i.sizeMultiplier);var k=D/2-I,U=[];if(d.length>0){var V=D-x-S,X=Math.round(D*1e3),W=uae(d,Math.round(V*1e3)),P=new sl(d,W),H=it(v/1e3),z=it(X/1e3),$=new qs([P],{width:H,height:z,viewBox:"0 0 "+v+" "+X}),B=ol([],[$],i);B.height=X/1e3,B.style.width=H,B.style.height=z,U.push({type:"elem",elem:B})}else{if(U.push(kx(h,g,a)),U.push(Zv),l===null){var L=D-x-S+2*N_;U.push(Bx(c,L,i))}else{var Y=(D-x-S-A)/2+2*N_;U.push(Bx(c,Y,i)),U.push(Zv),U.push(kx(l,g,a)),U.push(Zv),U.push(Bx(c,Y,i))}U.push(Zv),U.push(kx(o,g,a))}var G=i.havingBaseStyle(Dt.TEXT),re=sr({positionType:"bottom",positionData:k,children:U});return j3(Xe(["delimsizing","mult"],[re],G),Dt.TEXT,i,s)},Fx=80,zx=.08,Ux=function(e,t,n,i,a){var s=oae(e,i,n),o=new sl(e,s),l=new qs([o],{width:"400em",height:it(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return ol(["hide-tail"],[l],a)},Zae=function(e,t){var n=t.havingBaseSizing(),i=sN("\\surd",e*n.sizeMultiplier,aN,n),a=n.sizeMultiplier,s=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,l=0,c=0,h=0,d;return i.type==="small"?(h=1e3+1e3*s+Fx,e<1?a=1:e<1.4&&(a=.7),l=(1+s+zx)/a,c=(1+s)/a,o=Ux("sqrtMain",l,h,s,t),o.style.minWidth="0.853em",d=.833/a):i.type==="large"?(h=(1e3+Fx)*qf[i.size],c=(qf[i.size]+s)/a,l=(qf[i.size]+s+zx)/a,o=Ux("sqrtSize"+i.size,l,h,s,t),o.style.minWidth="1.02em",d=1/a):(l=e+s+zx,c=e+s,h=Math.floor(1e3*e+s)+Fx,o=Ux("sqrtTall",l,h,s,t),o.style.minWidth="0.742em",d=1.056),o.height=c,o.style.height=it(l),{span:o,advanceWidth:d,ruleWidth:(t.fontMetrics().sqrtRuleThickness+s)*a}},rN=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),Qae=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),nN=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),qf=[0,1.2,1.8,2.4,3],iN=function(e,t,n,i,a){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),rN.has(e)||nN.has(e))return eN(e,t,!1,n,i,a);if(Qae.has(e))return tN(e,qf[t],!1,n,i,a);throw new Qe("Illegal delimiter: '"+e+"'")},Jae=[{type:"small",style:Dt.SCRIPTSCRIPT},{type:"small",style:Dt.SCRIPT},{type:"small",style:Dt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],ese=[{type:"small",style:Dt.SCRIPTSCRIPT},{type:"small",style:Dt.SCRIPT},{type:"small",style:Dt.TEXT},{type:"stack"}],aN=[{type:"small",style:Dt.SCRIPTSCRIPT},{type:"small",style:Dt.SCRIPT},{type:"small",style:Dt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],tse=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";var t=e.type;throw new Error("Add support for delim type '"+t+"' here.")},sN=function(e,t,n,i){for(var a=Math.min(2,3-i.style.size),s=a;s<n.length;s++){var o=n[s];if(o.type==="stack")break;var l=kf(e,tse(o),"math"),c=l.height+l.depth;if(o.type==="small"){var h=i.havingBaseStyle(o.style);c*=h.sizeMultiplier}if(c>t)return o}return n[n.length-1]},L_=function(e,t,n,i,a,s){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;nN.has(e)?o=Jae:rN.has(e)?o=aN:o=ese;var l=sN(e,t,o,i);return l.type==="small"?Yae(e,l.style,n,i,a,s):l.type==="large"?eN(e,l.size,n,i,a,s):tN(e,t,n,i,a,s)},Gx=function(e,t,n,i,a,s){var o=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,c=5/i.fontMetrics().ptPerEm,h=Math.max(t-o,n+o),d=Math.max(h/500*l,2*h-c);return L_(e,d,!0,i,a,s)},HM={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},rse=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function qg(r,e){var t=jg(r);if(t&&rse.has(t.text))return t;throw t?new Qe("Invalid delimiter '"+t.text+"' after '"+e.funcName+"'",r):new Qe("Invalid delimiter type '"+r.type+"'",r)}ft({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(r,e)=>{var t=qg(e[0],r);return{type:"delimsizing",mode:r.parser.mode,size:HM[r.funcName].size,mclass:HM[r.funcName].mclass,delim:t.text}},htmlBuilder:(r,e)=>r.delim==="."?Xe([r.mclass]):iN(r.delim,r.size,e,r.mode,[r.mclass]),mathmlBuilder:r=>{var e=[];r.delim!=="."&&e.push(wa(r.delim,r.mode));var t=new et("mo",e);r.mclass==="mopen"||r.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var n=it(qf[r.size]);return t.setAttribute("minsize",n),t.setAttribute("maxsize",n),t}});function jM(r){if(!r.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ft({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=r.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new Qe("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:r.parser.mode,delim:qg(e[0],r).text,color:t}}});ft({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=qg(e[0],r),n=r.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=Ft(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:t.text,right:a.delim,rightColor:a.color}},htmlBuilder:(r,e)=>{jM(r);for(var t=Dn(r.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,s=0;s<t.length;s++)t[s].isMiddle?a=!0:(n=Math.max(t[s].height,n),i=Math.max(t[s].depth,i));n*=e.sizeMultiplier,i*=e.sizeMultiplier;var o;if(r.left==="."?o=Sd(e,["mopen"]):o=Gx(r.left,n,i,e,r.mode,["mopen"]),t.unshift(o),a)for(var l=1;l<t.length;l++){var c=t[l],h=c.isMiddle;h&&(t[l]=Gx(h.delim,n,i,h.options,r.mode,[]))}var d;if(r.right===".")d=Sd(e,["mclose"]);else{var v=r.rightColor?e.withColor(r.rightColor):e;d=Gx(r.right,n,i,v,r.mode,["mclose"])}return t.push(d),Xe(["minner"],t,e)},mathmlBuilder:(r,e)=>{jM(r);var t=$i(r.body,e);if(r.left!=="."){var n=new et("mo",[wa(r.left,r.mode)]);n.setAttribute("fence","true"),t.unshift(n)}if(r.right!=="."){var i=new et("mo",[wa(r.right,r.mode)]);i.setAttribute("fence","true"),r.rightColor&&i.setAttribute("mathcolor",r.rightColor),t.push(i)}return U3(t)}});ft({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=qg(e[0],r);if(!r.parser.leftrightDepth)throw new Qe("\\middle without preceding \\left",t);return{type:"middle",mode:r.parser.mode,delim:t.text}},htmlBuilder:(r,e)=>{var t;if(r.delim===".")t=Sd(e,[]);else{t=iN(r.delim,1,e,r.mode,[]);var n={delim:r.delim,options:e};t.isMiddle=n}return t},mathmlBuilder:(r,e)=>{var t=r.delim==="\\vert"||r.delim==="|"?wa("|","text"):wa(r.delim,r.mode),n=new et("mo",[t]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var Xg=(r,e)=>{var t=Wc(or(r.body,e),e),n=r.label.slice(1),i=e.sizeMultiplier,a,s=0,o=Qs(r.body);if(n==="sout")a=Xe(["stretchy","sout"]),a.height=e.fontMetrics().defaultRuleThickness/i,s=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=Zr({number:.6,unit:"pt"},e),c=Zr({number:.35,unit:"ex"},e),h=e.havingBaseSizing();i=i/h.sizeMultiplier;var d=t.height+t.depth+l+c;t.style.paddingLeft=it(d/2+l);var v=Math.floor(1e3*d*i),g=aae(v),m=new qs([new sl("phase",g)],{width:"400em",height:it(v/1e3),viewBox:"0 0 400000 "+v,preserveAspectRatio:"xMinYMin slice"});a=ol(["hide-tail"],[m],e),a.style.height=it(d),s=t.depth+l+c}else{/cancel/.test(n)?o||t.classes.push("cancel-pad"):n==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var x=0,y=0,_=0;/box/.test(n)?(_=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),x=e.fontMetrics().fboxsep+(n==="colorbox"?0:_),y=x):n==="angl"?(_=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),x=4*_,y=Math.max(0,.25-t.depth)):(x=o?.2:0,y=x),a=Uae(t,n,x,y,e),/fbox|boxed|fcolorbox/.test(n)?(a.style.borderStyle="solid",a.style.borderWidth=it(_)):n==="angl"&&_!==.049&&(a.style.borderTopWidth=it(_),a.style.borderRightWidth=it(_)),s=t.depth+y,r.backgroundColor&&(a.style.backgroundColor=r.backgroundColor,r.borderColor&&(a.style.borderColor=r.borderColor))}var w;if(r.backgroundColor)w=sr({positionType:"individualShift",children:[{type:"elem",elem:a,shift:s},{type:"elem",elem:t,shift:0}]});else{var S=/cancel|phase/.test(n)?["svg-align"]:[];w=sr({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:a,shift:s,wrapperClasses:S}]})}return/cancel/.test(n)&&(w.height=t.height,w.depth=t.depth),/cancel/.test(n)&&!o?Xe(["mord","cancel-lap"],[w],e):Xe(["mord"],[w],e)},Yg=(r,e)=>{var t=0,n=new et(r.label.includes("colorbox")?"mpadded":"menclose",[Mr(r.body,e)]);switch(r.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*t+"pt"),n.setAttribute("height","+"+2*t+"pt"),n.setAttribute("lspace",t+"pt"),n.setAttribute("voffset",t+"pt"),r.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+it(i)+" solid "+r.borderColor)}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return r.backgroundColor&&n.setAttribute("mathbackground",r.backgroundColor),n};ft({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(r,e,t){var{parser:n,funcName:i}=r,a=Ft(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:Xg,mathmlBuilder:Yg});ft({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(r,e,t){var{parser:n,funcName:i}=r,a=Ft(e[0],"color-token").color,s=Ft(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,borderColor:a,body:o}},htmlBuilder:Xg,mathmlBuilder:Yg});ft({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\fbox",body:e[0]}}});ft({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"enclose",mode:t.mode,label:n,body:i}},htmlBuilder:Xg,mathmlBuilder:Yg});ft({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t,funcName:n}=r;t.mode==="math"&&t.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=e[0];return{type:"enclose",mode:t.mode,label:n,body:i}},htmlBuilder:Xg,mathmlBuilder:Yg});ft({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\angl",body:e[0]}}});var oN={};function cs(r){for(var{type:e,names:t,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=r,o={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l<t.length;++l)oN[t[l]]=o;a&&(Kp[e]=a),s&&(Zp[e]=s)}var lN={};function te(r,e){lN[r]=e}class Ci{constructor(e,t,n){this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?!e||!e.loc||!t.loc||e.loc.lexer!==t.loc.lexer?null:new Ci(e.loc.lexer,e.loc.start,t.loc.end):e&&e.loc}}class Xi{constructor(e,t){this.text=e,this.loc=t}range(e,t){return new Xi(t,Ci.range(this,e))}}function VM(r){var e=[];r.consumeSpaces();var t=r.fetch().text;for(t==="\\relax"&&(r.consume(),r.consumeSpaces(),t=r.fetch().text);t==="\\hline"||t==="\\hdashline";)r.consume(),e.push(t==="\\hdashline"),r.consumeSpaces(),t=r.fetch().text;return e}var Wg=r=>{var e=r.parser.settings;if(!e.displayMode)throw new Qe("{"+r.envName+"} can be used only in display mode.")},nse=new Set(["gather","gather*"]);function V3(r){if(!r.includes("ed"))return!r.includes("*")}function yl(r,e,t){var{hskipBeforeAndAfter:n,addJot:i,cols:a,arraystretch:s,colSeparationType:o,autoTag:l,singleRow:c,emptySingleRow:h,maxNumCols:d,leqno:v}=e;if(r.gullet.beginGroup(),c||r.gullet.macros.set("\\cr","\\\\\\relax"),!s){var g=r.gullet.expandMacroAsText("\\arraystretch");if(g==null)s=1;else if(s=parseFloat(g),!s||s<0)throw new Qe("Invalid \\arraystretch: "+g)}r.gullet.beginGroup();var m=[],x=[m],y=[],_=[],w=l!=null?[]:void 0;function S(){l&&r.gullet.macros.set("\\@eqnsw","1",!0)}function A(){w&&(r.gullet.macros.get("\\df@tag")?(w.push(r.subparse([new Xi("\\df@tag")])),r.gullet.macros.set("\\df@tag",void 0,!0)):w.push(!!l&&r.gullet.macros.get("\\@eqnsw")==="1"))}for(S(),_.push(VM(r));;){var C=r.parseExpression(!1,c?"\\end":"\\\\");r.gullet.endGroup(),r.gullet.beginGroup();var M={type:"ordgroup",mode:r.mode,body:C};t&&(M={type:"styling",mode:r.mode,style:t,body:[M]}),m.push(M);var E=r.fetch().text;if(E==="&"){if(d&&m.length===d){if(c||o)throw new Qe("Too many tab characters: &",r.nextToken);r.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}r.consume()}else if(E==="\\end"){A(),m.length===1&&M.type==="styling"&&M.body.length===1&&M.body[0].type==="ordgroup"&&M.body[0].body.length===0&&(x.length>1||!h)&&x.pop(),_.length<x.length+1&&_.push([]);break}else if(E==="\\\\"){r.consume();var O=void 0;r.gullet.future().text!==" "&&(O=r.parseSizeGroup(!0)),y.push(O?O.value:null),A(),_.push(VM(r)),m=[],x.push(m),S()}else throw new Qe("Expected & or \\\\ or \\cr or \\end",r.nextToken)}return r.gullet.endGroup(),r.gullet.endGroup(),{type:"array",mode:r.mode,addJot:i,arraystretch:s,body:x,cols:a,rowGaps:y,hskipBeforeAndAfter:n,hLinesBeforeRow:_,colSeparationType:o,tags:w,leqno:v}}function q3(r){return r.slice(0,1)==="d"?"display":"text"}var hs=function(e,t){var n,i,a=e.body.length,s=e.hLinesBeforeRow,o=0,l=new Array(a),c=[],h=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),d=1/t.fontMetrics().ptPerEm,v=5*d;if(e.colSeparationType&&e.colSeparationType==="small"){var g=t.havingStyle(Dt.SCRIPT).sizeMultiplier;v=.2778*(g/t.sizeMultiplier)}var m=e.colSeparationType==="CD"?Zr({number:3,unit:"ex"},t):12*d,x=3*d,y=e.arraystretch*m,_=.7*y,w=.3*y,S=0;function A(We){for(var Ke=0;Ke<We.length;++Ke)Ke>0&&(S+=.25),c.push({pos:S,isDashed:We[Ke]})}for(A(s[0]),n=0;n<e.body.length;++n){var C=e.body[n],M=_,E=w;o<C.length&&(o=C.length);var O=new Array(C.length);for(i=0;i<C.length;++i){var D=or(C[i],t);E<D.depth&&(E=D.depth),M<D.height&&(M=D.height),O[i]=D}var I=e.rowGaps[n],k=0;I&&(k=Zr(I,t),k>0&&(k+=w,E<k&&(E=k),k=0)),e.addJot&&n<e.body.length-1&&(E+=x),O.height=M,O.depth=E,S+=M,O.pos=S,S+=E+k,l[n]=O,A(s[n+1])}var U=S/2+t.fontMetrics().axisHeight,V=e.cols||[],X=[],W,P,H=[];if(e.tags&&e.tags.some(We=>We))for(n=0;n<a;++n){var z=l[n],$=z.pos-U,B=e.tags[n],L=void 0;B===!0?L=Xe(["eqn-num"],[],t):B===!1?L=Xe([],[],t):L=Xe([],Dn(B,t,!0),t),L.depth=z.depth,L.height=z.height,H.push({type:"elem",elem:L,shift:$})}for(i=0,P=0;i<o||P<V.length;++i,++P){for(var Y,G=V[P],re=!0;((ie=G)==null?void 0:ie.type)==="separator";){var ie;if(re||(W=Xe(["arraycolsep"],[]),W.style.width=it(t.fontMetrics().doubleRuleSep),X.push(W)),G.separator==="|"||G.separator===":"){var le=G.separator==="|"?"solid":"dashed",ce=Xe(["vertical-separator"],[],t);ce.style.height=it(S),ce.style.borderRightWidth=it(h),ce.style.borderRightStyle=le,ce.style.margin="0 "+it(-h/2);var _e=S-U;_e&&(ce.style.verticalAlign=it(-_e)),X.push(ce)}else throw new Qe("Invalid separator type: "+G.separator);P++,G=V[P],re=!1}if(!(i>=o)){var pe=void 0;if(i>0||e.hskipBeforeAndAfter){var ae,oe;pe=(ae=(oe=G)==null?void 0:oe.pregap)!=null?ae:v,pe!==0&&(W=Xe(["arraycolsep"],[]),W.style.width=it(pe),X.push(W))}var de=[];for(n=0;n<a;++n){var ye=l[n],Ee=ye[i];if(Ee){var Re=ye.pos-U;Ee.depth=ye.depth,Ee.height=ye.height,de.push({type:"elem",elem:Ee,shift:Re})}}var Ne=sr({positionType:"individualShift",children:de}),Be=Xe(["col-align-"+(((Y=G)==null?void 0:Y.align)||"c")],[Ne]);if(X.push(Be),i<o-1||e.hskipBeforeAndAfter){var $e,Ye;pe=($e=(Ye=G)==null?void 0:Ye.postgap)!=null?$e:v,pe!==0&&(W=Xe(["arraycolsep"],[]),W.style.width=it(pe),X.push(W))}}}var He=Xe(["mtable"],X);if(c.length>0){for(var tt=Yc("hline",t,h),ot=Yc("hdashline",t,h),ct=[{type:"elem",elem:He,shift:0}];c.length>0;){var Ze=c.pop(),bt=Ze.pos-U;Ze.isDashed?ct.push({type:"elem",elem:ot,shift:bt}):ct.push({type:"elem",elem:tt,shift:bt})}He=sr({positionType:"individualShift",children:ct})}if(H.length===0)return Xe(["mord"],[He],t);var Se=sr({positionType:"individualShift",children:H}),ke=Xe(["tag"],[Se],t);return eo([He,ke])},ise={c:"center ",l:"left ",r:"right "},fs=function(e,t){for(var n=[],i=new et("mtd",[],["mtr-glue"]),a=new et("mtd",[],["mml-eqn-num"]),s=0;s<e.body.length;s++){for(var o=e.body[s],l=[],c=0;c<o.length;c++)l.push(new et("mtd",[Mr(o[c],t)]));e.tags&&e.tags[s]&&(l.unshift(i),l.push(i),e.leqno?l.unshift(a):l.push(a)),n.push(new et("mtr",l))}var h=new et("mtable",n),d=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);h.setAttribute("rowspacing",it(d));var v="",g="";if(e.cols&&e.cols.length>0){var m=e.cols,x="",y=!1,_=0,w=m.length;m[0].type==="separator"&&(v+="top ",_=1),m[m.length-1].type==="separator"&&(v+="bottom ",w-=1);for(var S=_;S<w;S++){var A=m[S];A.type==="align"?(g+=ise[A.align],y&&(x+="none "),y=!0):A.type==="separator"&&y&&(x+=A.separator==="|"?"solid ":"dashed ",y=!1)}h.setAttribute("columnalign",g.trim()),/[sd]/.test(x)&&h.setAttribute("columnlines",x.trim())}if(e.colSeparationType==="align"){for(var C=e.cols||[],M="",E=1;E<C.length;E++)M+=E%2?"0em ":"1em ";h.setAttribute("columnspacing",M.trim())}else e.colSeparationType==="alignat"||e.colSeparationType==="gather"?h.setAttribute("columnspacing","0em"):e.colSeparationType==="small"?h.setAttribute("columnspacing","0.2778em"):e.colSeparationType==="CD"?h.setAttribute("columnspacing","0.5em"):h.setAttribute("columnspacing","1em");var O="",D=e.hLinesBeforeRow;v+=D[0].length>0?"left ":"",v+=D[D.length-1].length>0?"right ":"";for(var I=1;I<D.length-1;I++)O+=D[I].length===0?"none ":D[I][0]?"dashed ":"solid ";return/[sd]/.test(O)&&h.setAttribute("rowlines",O.trim()),v!==""&&(h=new et("menclose",[h]),h.setAttribute("notation",v.trim())),e.arraystretch&&e.arraystretch<1&&(h=new et("mstyle",[h]),h.setAttribute("scriptlevel","1")),h},uN=function(e,t){e.envName.includes("ed")||Wg(e);var n=[],i=e.envName.includes("at")?"alignat":"align",a=e.envName==="split",s=yl(e.parser,{cols:n,addJot:!0,autoTag:a?void 0:V3(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:a?2:void 0,leqno:e.parser.settings.leqno},"display"),o=0,l=0,c={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&t[0].type==="ordgroup"){for(var h="",d=0;d<t[0].body.length;d++){var v=Ft(t[0].body[d],"textord");h+=v.text}o=Number(h),l=o*2}var g=!l;s.body.forEach(function(_){for(var w=1;w<_.length;w+=2){var S=Ft(_[w],"styling"),A=Ft(S.body[0],"ordgroup");A.body.unshift(c)}if(g)l<_.length&&(l=_.length);else{var C=_.length/2;if(o<C)throw new Qe("Too many math in a row: "+("expected "+o+", but got "+C),_[0])}});for(var m=0;m<l;++m){var x="r",y=0;m%2===1?x="l":m>0&&g&&(y=1),n[m]={type:"align",align:x,pregap:y,postgap:0}}return s.colSeparationType=g?"align":"alignat",s};cs({type:"array",names:["array","darray"],props:{numArgs:1},handler(r,e){var t=jg(e[0]),n=t?[e[0]]:Ft(e[0],"ordgroup").body,i=n.map(function(s){var o=Hg(s),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Qe("Unknown column alignment: "+l,s)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return yl(r.parser,a,q3(r.envName))},htmlBuilder:hs,mathmlBuilder:fs});cs({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(r){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[r.envName.replace("*","")],t="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(r.envName.charAt(r.envName.length-1)==="*"){var i=r.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),t=i.fetch().text,!"lcr".includes(t))throw new Qe("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:t}]}}var a=yl(r.parser,n,q3(r.envName)),s=Math.max(0,...a.body.map(o=>o.length));return a.cols=new Array(s).fill({type:"align",align:t}),e?{type:"leftright",mode:r.mode,body:[a],left:e[0],right:e[1],rightColor:void 0}:a},htmlBuilder:hs,mathmlBuilder:fs});cs({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(r){var e={arraystretch:.5},t=yl(r.parser,e,"script");return t.colSeparationType="small",t},htmlBuilder:hs,mathmlBuilder:fs});cs({type:"array",names:["subarray"],props:{numArgs:1},handler(r,e){var t=jg(e[0]),n=t?[e[0]]:Ft(e[0],"ordgroup").body,i=n.map(function(o){var l=Hg(o),c=l.text;if("lc".includes(c))return{type:"align",align:c};throw new Qe("Unknown column alignment: "+c,o)});if(i.length>1)throw new Qe("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},s=yl(r.parser,a,"script");if(s.body.length>0&&s.body[0].length>1)throw new Qe("{subarray} can contain only one column");return s},htmlBuilder:hs,mathmlBuilder:fs});cs({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(r){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=yl(r.parser,e,q3(r.envName));return{type:"leftright",mode:r.mode,body:[t],left:r.envName.includes("r")?".":"\\{",right:r.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:hs,mathmlBuilder:fs});cs({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:uN,htmlBuilder:hs,mathmlBuilder:fs});cs({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(r){nse.has(r.envName)&&Wg(r);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:V3(r.envName),emptySingleRow:!0,leqno:r.parser.settings.leqno};return yl(r.parser,e,"display")},htmlBuilder:hs,mathmlBuilder:fs});cs({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:uN,htmlBuilder:hs,mathmlBuilder:fs});cs({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(r){Wg(r);var e={autoTag:V3(r.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:r.parser.settings.leqno};return yl(r.parser,e,"display")},htmlBuilder:hs,mathmlBuilder:fs});cs({type:"array",names:["CD"],props:{numArgs:0},handler(r){return Wg(r),qae(r.parser)},htmlBuilder:hs,mathmlBuilder:fs});te("\\nonumber","\\gdef\\@eqnsw{0}");te("\\notag","\\nonumber");ft({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(r,e){throw new Qe(r.funcName+" valid only within array environment")}});var qM=oN;ft({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];if(i.type!=="ordgroup")throw new Qe("Invalid environment name",i);for(var a="",s=0;s<i.body.length;++s)a+=Ft(i.body[s],"textord").text;if(n==="\\begin"){if(!qM.hasOwnProperty(a))throw new Qe("No such environment: "+a,i);var o=qM[a],{args:l,optArgs:c}=t.parseArguments("\\begin{"+a+"}",o),h={mode:t.mode,envName:a,parser:t},d=o.handler(h,l,c);t.expect("\\end",!1);var v=t.nextToken,g=Ft(t.parseFunction(),"environment");if(g.name!==a)throw new Qe("Mismatch: \\begin{"+a+"} matched by \\end{"+g.name+"}",v);return d}return{type:"environment",mode:t.mode,name:a,nameGroup:i}}});var cN=(r,e)=>{var t=r.font,n=e.withFont(t);return or(r.body,n)},hN=(r,e)=>{var t=r.font,n=e.withFont(t);return Mr(r.body,n)},XM={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};ft({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=Qp(e[0]),a=n;return a in XM&&(a=XM[a]),{type:"font",mode:t.mode,font:a.slice(1),body:i}},htmlBuilder:cN,mathmlBuilder:hN});ft({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"mclass",mode:t.mode,mclass:Vg(n),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:n}],isCharacterBox:Qs(n)}}});ft({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n,breakOnTokenText:i}=r,{mode:a}=t,s=t.parseExpression(!0,i),o="math"+n.slice(1);return{type:"font",mode:a,font:o,body:{type:"ordgroup",mode:t.mode,body:s}}},htmlBuilder:cN,mathmlBuilder:hN});var ase=(r,e)=>{var t=e.style,n=t.fracNum(),i=t.fracDen(),a;a=e.havingStyle(n);var s=or(r.numer,a,e);if(r.continued){var o=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;s.height=s.height<o?o:s.height,s.depth=s.depth<l?l:s.depth}a=e.havingStyle(i);var c=or(r.denom,a,e),h,d,v;r.hasBarLine?(r.barSize?(d=Zr(r.barSize,e),h=Yc("frac-line",e,d)):h=Yc("frac-line",e),d=h.height,v=h.height):(h=null,d=0,v=e.fontMetrics().defaultRuleThickness);var g,m,x;t.size===Dt.DISPLAY.size?(g=e.fontMetrics().num1,d>0?m=3*v:m=7*v,x=e.fontMetrics().denom1):(d>0?(g=e.fontMetrics().num2,m=v):(g=e.fontMetrics().num3,m=3*v),x=e.fontMetrics().denom2);var y;if(h){var w=e.fontMetrics().axisHeight;g-s.depth-(w+.5*d)<m&&(g+=m-(g-s.depth-(w+.5*d))),w-.5*d-(c.height-x)<m&&(x+=m-(w-.5*d-(c.height-x)));var S=-(w-.5*d);y=sr({positionType:"individualShift",children:[{type:"elem",elem:c,shift:x},{type:"elem",elem:h,shift:S},{type:"elem",elem:s,shift:-g}]})}else{var _=g-s.depth-(c.height-x);_<m&&(g+=.5*(m-_),x+=.5*(m-_)),y=sr({positionType:"individualShift",children:[{type:"elem",elem:c,shift:x},{type:"elem",elem:s,shift:-g}]})}a=e.havingStyle(t),y.height*=a.sizeMultiplier/e.sizeMultiplier,y.depth*=a.sizeMultiplier/e.sizeMultiplier;var A;t.size===Dt.DISPLAY.size?A=e.fontMetrics().delim1:t.size===Dt.SCRIPTSCRIPT.size?A=e.havingStyle(Dt.SCRIPT).fontMetrics().delim2:A=e.fontMetrics().delim2;var C,M;return r.leftDelim==null?C=Sd(e,["mopen"]):C=L_(r.leftDelim,A,!0,e.havingStyle(t),r.mode,["mopen"]),r.continued?M=Xe([]):r.rightDelim==null?M=Sd(e,["mclose"]):M=L_(r.rightDelim,A,!0,e.havingStyle(t),r.mode,["mclose"]),Xe(["mord"].concat(a.sizingClasses(e)),[C,Xe(["mfrac"],[y]),M],e)},sse=(r,e)=>{var t=new et("mfrac",[Mr(r.numer,e),Mr(r.denom,e)]);if(!r.hasBarLine)t.setAttribute("linethickness","0px");else if(r.barSize){var n=Zr(r.barSize,e);t.setAttribute("linethickness",it(n))}if(r.leftDelim!=null||r.rightDelim!=null){var i=[];if(r.leftDelim!=null){var a=new et("mo",[new En(r.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(t),r.rightDelim!=null){var s=new et("mo",[new En(r.rightDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}return U3(i)}return t},fN=(r,e)=>{if(!e)return r;var t={type:"styling",mode:r.mode,style:e,body:[r]};return t};ft({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],a=e[1],s,o=null,l=null;switch(n){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":s=!0;break;case"\\\\atopfrac":s=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s=!1,o="(",l=")";break;case"\\\\bracefrac":s=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":s=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var c=n==="\\cfrac",h=null;return c||n.startsWith("\\d")?h="display":n.startsWith("\\t")&&(h="text"),fN({type:"genfrac",mode:t.mode,numer:i,denom:a,continued:c,hasBarLine:s,leftDelim:o,rightDelim:l,barSize:null},h)},htmlBuilder:ase,mathmlBuilder:sse});ft({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(r){var{parser:e,funcName:t,token:n}=r,i;switch(t){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var YM=["display","text","script","scriptscript"],WM=function(e){var t=null;return e.length>0&&(t=e,t=t==="."?null:t),t};ft({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(r,e){var{parser:t}=r,n=e[4],i=e[5],a=Qp(e[0]),s=a.type==="atom"&&a.family==="open"?WM(a.text):null,o=Qp(e[1]),l=o.type==="atom"&&o.family==="close"?WM(o.text):null,c=Ft(e[2],"size"),h,d=null;c.isBlank?h=!0:(d=c.value,h=d.number>0);var v=null,g=e[3];if(g.type==="ordgroup"){if(g.body.length>0){var m=Ft(g.body[0],"textord");v=YM[Number(m.text)]}}else g=Ft(g,"textord"),v=YM[Number(g.text)];return fN({type:"genfrac",mode:t.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:s,rightDelim:l},v)}});ft({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(r,e){var{parser:t,funcName:n,token:i}=r;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:Ft(e[0],"size").value,token:i}}});ft({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],a=Ft(e[1],"infix").size;if(!a)throw new Error("\\\\abovefrac expected size, but got "+String(a));var s=e[2],o=a.number>0;return{type:"genfrac",mode:t.mode,numer:i,denom:s,continued:!1,hasBarLine:o,barSize:a,leftDelim:null,rightDelim:null}}});var dN=(r,e)=>{var t=e.style,n,i;r.type==="supsub"?(n=r.sup?or(r.sup,e.havingStyle(t.sup()),e):or(r.sub,e.havingStyle(t.sub()),e),i=Ft(r.base,"horizBrace")):i=Ft(r,"horizBrace");var a=or(i.base,e.havingBaseStyle(Dt.DISPLAY)),s=Gg(i,e),o;if(i.isOver?(o=sr({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s}]}),o.children[0].children[0].children[1].classes.push("svg-align")):(o=sr({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:a}]}),o.children[0].children[0].children[0].classes.push("svg-align")),n){var l=Xe(["minner",i.isOver?"mover":"munder"],[o],e);i.isOver?o=sr({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):o=sr({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Xe(["minner",i.isOver?"mover":"munder"],[o],e)},ose=(r,e)=>{var t=Ug(r.label);return new et(r.isOver?"mover":"munder",[Mr(r.base,e),t])};ft({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r;return{type:"horizBrace",mode:t.mode,label:n,isOver:n.includes("\\over"),base:e[0]}},htmlBuilder:dN,mathmlBuilder:ose});ft({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[1],i=Ft(e[0],"url").url;return t.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:t.mode,href:i,body:Sn(n)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(r,e)=>{var t=Dn(r.body,e,!1);return Eae(r.href,[],t,e)},mathmlBuilder:(r,e)=>{var t=ll(r.body,e);return t instanceof et||(t=new et("mrow",[t])),t.setAttribute("href",r.href),t}});ft({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=Ft(e[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:n}))return t.formatUnsupportedCmd("\\url");for(var i=[],a=0;a<n.length;a++){var s=n[a];s==="~"&&(s="\\textasciitilde"),i.push({type:"textord",mode:"text",text:s})}var o={type:"text",mode:t.mode,font:"\\texttt",body:i};return{type:"href",mode:t.mode,href:n,body:Sn(o)}}});ft({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(r,e){var{parser:t}=r;return{type:"hbox",mode:t.mode,body:Sn(e[0])}},htmlBuilder(r,e){var t=Dn(r.body,e,!1);return eo(t)},mathmlBuilder(r,e){return new et("mrow",$i(r.body,e))}});ft({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n,token:i}=r,a=Ft(e[0],"raw").string,s=e[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(n){case"\\htmlClass":l.class=a,o={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,o={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,o={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var c=a.split(","),h=0;h<c.length;h++){var d=c[h],v=d.indexOf("=");if(v<0)throw new Qe("\\htmlData key/value '"+d+"' missing equals sign");var g=d.slice(0,v),m=d.slice(v+1);l["data-"+g.trim()]=m}o={command:"\\htmlData",attributes:l};break}default:throw new Error("Unrecognized html command")}return t.settings.isTrusted(o)?{type:"html",mode:t.mode,attributes:l,body:Sn(s)}:t.formatUnsupportedCmd(n)},htmlBuilder:(r,e)=>{var t=Dn(r.body,e,!1),n=["enclosing"];r.attributes.class&&n.push(...r.attributes.class.trim().split(/\s+/));var i=Xe(n,t,e);for(var a in r.attributes)a!=="class"&&r.attributes.hasOwnProperty(a)&&i.setAttribute(a,r.attributes[a]);return i},mathmlBuilder:(r,e)=>ll(r.body,e)});ft({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"htmlmathml",mode:t.mode,html:Sn(e[0]),mathml:Sn(e[1])}},htmlBuilder:(r,e)=>{var t=Dn(r.html,e,!1);return eo(t)},mathmlBuilder:(r,e)=>ll(r.mathml,e)});var Hx=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new Qe("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!OI(n))throw new Qe("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};ft({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(r,e,t)=>{var{parser:n}=r,i={number:0,unit:"em"},a={number:.9,unit:"em"},s={number:0,unit:"em"},o="";if(t[0])for(var l=Ft(t[0],"raw").string,c=l.split(","),h=0;h<c.length;h++){var d=c[h].split("=");if(d.length===2){var v=d[1].trim();switch(d[0].trim()){case"alt":o=v;break;case"width":i=Hx(v);break;case"height":a=Hx(v);break;case"totalheight":s=Hx(v);break;default:throw new Qe("Invalid key: '"+d[0]+"' in \\includegraphics.")}}}var g=Ft(e[0],"url").url;return o===""&&(o=g,o=o.replace(/^.*[\\/]/,""),o=o.substring(0,o.lastIndexOf("."))),n.settings.isTrusted({command:"\\includegraphics",url:g})?{type:"includegraphics",mode:n.mode,alt:o,width:i,height:a,totalheight:s,src:g}:n.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(r,e)=>{var t=Zr(r.height,e),n=0;r.totalheight.number>0&&(n=Zr(r.totalheight,e)-t);var i=0;r.width.number>0&&(i=Zr(r.width,e));var a={height:it(t+n)};i>0&&(a.width=it(i)),n>0&&(a.verticalAlign=it(-n));var s=new fae(r.src,r.alt,a);return s.height=t,s.depth=n,s},mathmlBuilder:(r,e)=>{var t=new et("mglyph",[]);t.setAttribute("alt",r.alt);var n=Zr(r.height,e),i=0;if(r.totalheight.number>0&&(i=Zr(r.totalheight,e)-n,t.setAttribute("valign",it(-i))),t.setAttribute("height",it(n+i)),r.width.number>0){var a=Zr(r.width,e);t.setAttribute("width",it(a))}return t.setAttribute("src",r.src),t}});ft({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:n}=r,i=Ft(e[0],"size");if(t.settings.strict){var a=n[1]==="m",s=i.value.unit==="mu";a?(s||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):s&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:i.value}},htmlBuilder(r,e){return kI(r.dimension,e)},mathmlBuilder(r,e){var t=Zr(r.dimension,e);return new HI(t)}});ft({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"lap",mode:t.mode,alignment:n.slice(5),body:i}},htmlBuilder:(r,e)=>{var t;r.alignment==="clap"?(t=Xe([],[or(r.body,e)]),t=Xe(["inner"],[t],e)):t=Xe(["inner"],[or(r.body,e)]);var n=Xe(["fix"],[]),i=Xe([r.alignment],[t,n],e),a=Xe(["strut"]);return a.style.height=it(i.height+i.depth),i.depth&&(a.style.verticalAlign=it(-i.depth)),i.children.unshift(a),i=Xe(["thinbox"],[i],e),Xe(["mord","vbox"],[i],e)},mathmlBuilder:(r,e)=>{var t=new et("mpadded",[Mr(r.body,e)]);if(r.alignment!=="rlap"){var n=r.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",n+"width")}return t.setAttribute("width","0px"),t}});ft({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){var{funcName:t,parser:n}=r,i=n.mode;n.switchMode("math");var a=t==="\\("?"\\)":"$",s=n.parseExpression(!1,a);return n.expect(a),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",body:s}}});ft({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){throw new Qe("Mismatched "+r.funcName)}});var $M=(r,e)=>{switch(e.style.size){case Dt.DISPLAY.size:return r.display;case Dt.TEXT.size:return r.text;case Dt.SCRIPT.size:return r.script;case Dt.SCRIPTSCRIPT.size:return r.scriptscript;default:return r.text}};ft({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"mathchoice",mode:t.mode,display:Sn(e[0]),text:Sn(e[1]),script:Sn(e[2]),scriptscript:Sn(e[3])}},htmlBuilder:(r,e)=>{var t=$M(r,e),n=Dn(t,e,!1);return eo(n)},mathmlBuilder:(r,e)=>{var t=$M(r,e);return ll(t,e)}});var vN=(r,e,t,n,i,a,s)=>{r=Xe([],[r]);var o=t&&Qs(t),l,c;if(e){var h=or(e,n.havingStyle(i.sup()),n);c={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(t){var d=or(t,n.havingStyle(i.sub()),n);l={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}var v;if(c&&l){var g=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+r.depth+s;v=sr({positionType:"bottom",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:it(-a)},{type:"kern",size:l.kern},{type:"elem",elem:r},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:it(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else if(l){var m=r.height-s;v=sr({positionType:"top",positionData:m,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:it(-a)},{type:"kern",size:l.kern},{type:"elem",elem:r}]})}else if(c){var x=r.depth+s;v=sr({positionType:"bottom",positionData:x,children:[{type:"elem",elem:r},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:it(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else return r;var y=[v];if(l&&a!==0&&!o){var _=Xe(["mspace"],[],n);_.style.marginRight=it(a),y.unshift(_)}return Xe(["mop","op-limits"],y,n)},pN=new Set(["\\smallint"]),vh=(r,e)=>{var t,n,i=!1,a;r.type==="supsub"?(t=r.sup,n=r.sub,a=Ft(r.base,"op"),i=!0):a=Ft(r,"op");var s=e.style,o=!1;s.size===Dt.DISPLAY.size&&a.symbol&&!pN.has(a.name)&&(o=!0);var l;if(a.symbol){var c=o?"Size2-Regular":"Size1-Regular",h="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(h=a.name.slice(1),a.name=h==="oiint"?"\\iint":"\\iiint"),l=ci(a.name,c,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),h.length>0){var d=l.italic,v=FI(h+"Size"+(o?"2":"1"),e);l=sr({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:v,shift:o?.08:0}]}),a.name="\\"+h,l.classes.unshift("mop"),l.italic=d}}else if(a.body){var g=Dn(a.body,e,!0);g.length===1&&g[0]instanceof Yi?(l=g[0],l.classes[0]="mop"):l=Xe(["mop"],g,e)}else{for(var m=[],x=1;x<a.name.length;x++)m.push(F3(a.name[x],a.mode,e));l=Xe(["mop"],m,e)}var y=0,_=0;return(l instanceof Yi||a.name==="\\oiint"||a.name==="\\oiiint")&&!a.suppressBaseShift&&(y=(l.height-l.depth)/2-e.fontMetrics().axisHeight,_=l.italic||0),i?vN(l,t,n,e,s,_,y):(y&&(l.style.position="relative",l.style.top=it(y)),l)},Gd=(r,e)=>{var t;if(r.symbol)t=new et("mo",[wa(r.name,r.mode)]),pN.has(r.name)&&t.setAttribute("largeop","false");else if(r.body)t=new et("mo",$i(r.body,e));else{t=new et("mi",[new En(r.name.slice(1))]);var n=new et("mo",[wa("⁡","text")]);r.parentIsSupSub?t=new et("mrow",[t,n]):t=GI([t,n])}return t},lse={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};ft({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=n;return i.length===1&&(i=lse[i]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:vh,mathmlBuilder:Gd});ft({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Sn(n)}},htmlBuilder:vh,mathmlBuilder:Gd});var use={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};ft({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:vh,mathmlBuilder:Gd});ft({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:vh,mathmlBuilder:Gd});ft({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(r){var{parser:e,funcName:t}=r,n=t;return n.length===1&&(n=use[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:vh,mathmlBuilder:Gd});var gN=(r,e)=>{var t,n,i=!1,a;r.type==="supsub"?(t=r.sup,n=r.sub,a=Ft(r.base,"operatorname"),i=!0):a=Ft(r,"operatorname");var s;if(a.body.length>0){for(var o=a.body.map(d=>{var v="text"in d?d.text:void 0;return typeof v=="string"?{type:"textord",mode:d.mode,text:v}:d}),l=Dn(o,e.withFont("mathrm"),!0),c=0;c<l.length;c++){var h=l[c];h instanceof Yi&&(h.text=h.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}s=Xe(["mop"],l,e)}else s=Xe(["mop"],[],e);return i?vN(s,t,n,e,e.style,0,0):s},cse=(r,e)=>{for(var t=$i(r.body,e.withFont("mathrm")),n=!0,i=0;i<t.length;i++){var a=t[i];if(!(a instanceof HI))if(a instanceof et)switch(a.type){case"mi":case"mn":case"mspace":case"mtext":break;case"mo":{var s=a.children[0];a.children.length===1&&s instanceof En?s.text=s.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):n=!1;break}default:n=!1}else n=!1}if(n){var o=t.map(h=>h.toText()).join("");t=[new En(o)]}var l=new et("mi",t);l.setAttribute("mathvariant","normal");var c=new et("mo",[wa("⁡","text")]);return r.parentIsSupSub?new et("mrow",[l,c]):GI([l,c])};ft({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"operatorname",mode:t.mode,body:Sn(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:gN,mathmlBuilder:cse});te("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Cu({type:"ordgroup",htmlBuilder(r,e){return r.semisimple?eo(Dn(r.body,e,!1)):Xe(["mord"],Dn(r.body,e,!0),e)},mathmlBuilder(r,e){return ll(r.body,e,!0)}});ft({type:"overline",names:["\\overline"],props:{numArgs:1},handler(r,e){var{parser:t}=r,n=e[0];return{type:"overline",mode:t.mode,body:n}},htmlBuilder(r,e){var t=or(r.body,e.havingCrampedStyle()),n=Yc("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=sr({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]});return Xe(["mord","overline"],[a],e)},mathmlBuilder(r,e){var t=new et("mo",[new En("‾")]);t.setAttribute("stretchy","true");var n=new et("mover",[Mr(r.body,e),t]);return n.setAttribute("accent","true"),n}});ft({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"phantom",mode:t.mode,body:Sn(n)}},htmlBuilder:(r,e)=>{var t=Dn(r.body,e.withPhantom(),!1);return eo(t)},mathmlBuilder:(r,e)=>{var t=$i(r.body,e);return new et("mphantom",t)}});te("\\hphantom","\\smash{\\phantom{#1}}");ft({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"vphantom",mode:t.mode,body:n}},htmlBuilder:(r,e)=>{var t=Xe(["inner"],[or(r.body,e.withPhantom())]),n=Xe(["fix"],[]);return Xe(["mord","rlap"],[t,n],e)},mathmlBuilder:(r,e)=>{var t=$i(Sn(r.body),e),n=new et("mphantom",t),i=new et("mpadded",[n]);return i.setAttribute("width","0px"),i}});ft({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r,n=Ft(e[0],"size").value,i=e[1];return{type:"raisebox",mode:t.mode,dy:n,body:i}},htmlBuilder(r,e){var t=or(r.body,e),n=Zr(r.dy,e);return sr({positionType:"shift",positionData:-n,children:[{type:"elem",elem:t}]})},mathmlBuilder(r,e){var t=new et("mpadded",[Mr(r.body,e)]),n=r.dy.number+r.dy.unit;return t.setAttribute("voffset",n),t}});ft({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(r){var{parser:e}=r;return{type:"internal",mode:e.mode}}});ft({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(r,e,t){var{parser:n}=r,i=t[0],a=Ft(e[0],"size"),s=Ft(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&Ft(i,"size").value,width:a.value,height:s.value}},htmlBuilder(r,e){var t=Xe(["mord","rule"],[],e),n=Zr(r.width,e),i=Zr(r.height,e),a=r.shift?Zr(r.shift,e):0;return t.style.borderRightWidth=it(n),t.style.borderTopWidth=it(i),t.style.bottom=it(a),t.width=n,t.height=i+a,t.depth=-a,t.maxFontSize=i*1.125*e.sizeMultiplier,t},mathmlBuilder(r,e){var t=Zr(r.width,e),n=Zr(r.height,e),i=r.shift?Zr(r.shift,e):0,a=e.color&&e.getColor()||"black",s=new et("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",it(t)),s.setAttribute("height",it(n));var o=new et("mpadded",[s]);return i>=0?o.setAttribute("height",it(i)):(o.setAttribute("height",it(i)),o.setAttribute("depth",it(-i))),o.setAttribute("voffset",it(i)),o}});function mN(r,e,t){for(var n=Dn(r,e,!1),i=e.sizeMultiplier/t.sizeMultiplier,a=0;a<n.length;a++){var s=n[a].classes.indexOf("sizing");s<0?Array.prototype.push.apply(n[a].classes,e.sizingClasses(t)):n[a].classes[s+1]==="reset-size"+e.size&&(n[a].classes[s+1]="reset-size"+t.size),n[a].height*=i,n[a].depth*=i}return eo(n)}var KM=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],hse=(r,e)=>{var t=e.havingSize(r.size);return mN(r.body,t,e)};ft({type:"sizing",names:KM,props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{breakOnTokenText:t,funcName:n,parser:i}=r,a=i.parseExpression(!1,t);return{type:"sizing",mode:i.mode,size:KM.indexOf(n)+1,body:a}},htmlBuilder:hse,mathmlBuilder:(r,e)=>{var t=e.havingSize(r.size),n=$i(r.body,t),i=new et("mstyle",n);return i.setAttribute("mathsize",it(t.sizeMultiplier)),i}});ft({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(r,e,t)=>{var{parser:n}=r,i=!1,a=!1,s=t[0]&&Ft(t[0],"ordgroup");if(s)for(var o="",l=0;l<s.body.length;++l){var c=s.body[l];if(o=Hg(c).text,o==="t")i=!0;else if(o==="b")a=!0;else{i=!1,a=!1;break}}else i=!0,a=!0;var h=e[0];return{type:"smash",mode:n.mode,body:h,smashHeight:i,smashDepth:a}},htmlBuilder:(r,e)=>{var t=Xe([],[or(r.body,e)]);if(!r.smashHeight&&!r.smashDepth)return t;if(r.smashHeight&&(t.height=0),r.smashDepth&&(t.depth=0),r.smashHeight&&r.smashDepth)return Xe(["mord","smash"],[t],e);if(t.children)for(var n=0;n<t.children.length;n++)r.smashHeight&&(t.children[n].height=0),r.smashDepth&&(t.children[n].depth=0);var i=sr({positionType:"firstBaseline",children:[{type:"elem",elem:t}]});return Xe(["mord"],[i],e)},mathmlBuilder:(r,e)=>{var t=new et("mpadded",[Mr(r.body,e)]);return r.smashHeight&&t.setAttribute("height","0px"),r.smashDepth&&t.setAttribute("depth","0px"),t}});ft({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:n}=r,i=t[0],a=e[0];return{type:"sqrt",mode:n.mode,body:a,index:i}},htmlBuilder(r,e){var t=or(r.body,e.havingCrampedStyle());t.height===0&&(t.height=e.fontMetrics().xHeight),t=Wc(t,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,a=i;e.style.id<Dt.TEXT.id&&(a=e.fontMetrics().xHeight);var s=i+a/4,o=t.height+t.depth+s+i,{span:l,ruleWidth:c,advanceWidth:h}=Zae(o,e),d=l.height-c;d>t.height+t.depth+s&&(s=(s+d-t.height-t.depth)/2);var v=l.height-t.height-s-c;t.style.paddingLeft=it(h);var g=sr({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+v)},{type:"elem",elem:l},{type:"kern",size:c}]});if(r.index){var m=e.havingStyle(Dt.SCRIPTSCRIPT),x=or(r.index,m,e),y=.6*(g.height-g.depth),_=sr({positionType:"shift",positionData:-y,children:[{type:"elem",elem:x}]}),w=Xe(["root"],[_]);return Xe(["mord","sqrt"],[w,g],e)}else return Xe(["mord","sqrt"],[g],e)},mathmlBuilder(r,e){var{body:t,index:n}=r;return n?new et("mroot",[Mr(t,e),Mr(n,e)]):new et("msqrt",[Mr(t,e)])}});var ZM={display:Dt.DISPLAY,text:Dt.TEXT,script:Dt.SCRIPT,scriptscript:Dt.SCRIPTSCRIPT};ft({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r,e){var{breakOnTokenText:t,funcName:n,parser:i}=r,a=i.parseExpression(!0,t),s=n.slice(1,n.length-5);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(r,e){var t=ZM[r.style],n=e.havingStyle(t).withFont("");return mN(r.body,n,e)},mathmlBuilder(r,e){var t=ZM[r.style],n=e.havingStyle(t),i=$i(r.body,n),a=new et("mstyle",i),s={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=s[r.style];return a.setAttribute("scriptlevel",o[0]),a.setAttribute("displaystyle",o[1]),a}});var fse=function(e,t){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(t.style.size===Dt.DISPLAY.size||n.alwaysHandleSupSub);return i?vh:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(t.style.size===Dt.DISPLAY.size||n.limits);return a?gN:null}else{if(n.type==="accent")return Qs(n.base)?H3:null;if(n.type==="horizBrace"){var s=!e.sub;return s===n.isOver?dN:null}else return null}else return null};Cu({type:"supsub",htmlBuilder(r,e){var t=fse(r,e);if(t)return t(r,e);var{base:n,sup:i,sub:a}=r,s=or(n,e),o,l,c=e.fontMetrics(),h=0,d=0,v=n&&Qs(n);if(i){var g=e.havingStyle(e.style.sup());o=or(i,g,e),v||(h=s.height-g.fontMetrics().supDrop*g.sizeMultiplier/e.sizeMultiplier)}if(a){var m=e.havingStyle(e.style.sub());l=or(a,m,e),v||(d=s.depth+m.fontMetrics().subDrop*m.sizeMultiplier/e.sizeMultiplier)}var x;e.style===Dt.DISPLAY?x=c.sup1:e.style.cramped?x=c.sup3:x=c.sup2;var y=e.sizeMultiplier,_=it(.5/c.ptPerEm/y),w=null;if(l){var S=r.base&&r.base.type==="op"&&r.base.name&&(r.base.name==="\\oiint"||r.base.name==="\\oiiint");(s instanceof Yi||S)&&(w=it(-s.italic))}var A;if(o&&l){h=Math.max(h,x,o.depth+.25*c.xHeight),d=Math.max(d,c.sub2);var C=c.defaultRuleThickness,M=4*C;if(h-o.depth-(l.height-d)<M){d=M-(h-o.depth)+l.height;var E=.8*c.xHeight-(h-o.depth);E>0&&(h+=E,d-=E)}var O=[{type:"elem",elem:l,shift:d,marginRight:_,marginLeft:w},{type:"elem",elem:o,shift:-h,marginRight:_}];A=sr({positionType:"individualShift",children:O})}else if(l){d=Math.max(d,c.sub1,l.height-.8*c.xHeight);var D=[{type:"elem",elem:l,marginLeft:w,marginRight:_}];A=sr({positionType:"shift",positionData:d,children:D})}else if(o)h=Math.max(h,x,o.depth+.25*c.xHeight),A=sr({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:_}]});else throw new Error("supsub must have either sup or sub.");var I=D_(s,"right")||"mord";return Xe([I],[s,Xe(["msupsub"],[A])],e)},mathmlBuilder(r,e){var t=!1,n,i;r.base&&r.base.type==="horizBrace"&&(i=!!r.sup,i===r.base.isOver&&(t=!0,n=r.base.isOver)),r.base&&(r.base.type==="op"||r.base.type==="operatorname")&&(r.base.parentIsSupSub=!0);var a=[Mr(r.base,e)];r.sub&&a.push(Mr(r.sub,e)),r.sup&&a.push(Mr(r.sup,e));var s;if(t)s=n?"mover":"munder";else if(r.sub)if(r.sup){var c=r.base;c&&c.type==="op"&&c.limits&&e.style===Dt.DISPLAY||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(e.style===Dt.DISPLAY||c.limits)?s="munderover":s="msubsup"}else{var l=r.base;l&&l.type==="op"&&l.limits&&(e.style===Dt.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===Dt.DISPLAY)?s="munder":s="msub"}else{var o=r.base;o&&o.type==="op"&&o.limits&&(e.style===Dt.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===Dt.DISPLAY)?s="mover":s="msup"}return new et(s,a)}});Cu({type:"atom",htmlBuilder(r,e){return F3(r.text,r.mode,e,["m"+r.family])},mathmlBuilder(r,e){var t=new et("mo",[wa(r.text,r.mode)]);if(r.family==="bin"){var n=G3(r,e);n==="bold-italic"&&t.setAttribute("mathvariant",n)}else r.family==="punct"?t.setAttribute("separator","true"):(r.family==="open"||r.family==="close")&&t.setAttribute("stretchy","false");return t}});var yN={mi:"italic",mn:"normal",mtext:"normal"};Cu({type:"mathord",htmlBuilder(r,e){return zg(r,e,"mathord")},mathmlBuilder(r,e){var t=new et("mi",[wa(r.text,r.mode,e)]),n=G3(r,e)||"italic";return n!==yN[t.type]&&t.setAttribute("mathvariant",n),t}});Cu({type:"textord",htmlBuilder(r,e){return zg(r,e,"textord")},mathmlBuilder(r,e){var t=wa(r.text,r.mode,e),n=G3(r,e)||"normal",i;return r.mode==="text"?i=new et("mtext",[t]):/[0-9]/.test(r.text)?i=new et("mn",[t]):r.text==="\\prime"?i=new et("mo",[t]):i=new et("mi",[t]),n!==yN[i.type]&&i.setAttribute("mathvariant",n),i}});var jx={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Vx={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Cu({type:"spacing",htmlBuilder(r,e){if(Vx.hasOwnProperty(r.text)){var t=Vx[r.text].className||"";if(r.mode==="text"){var n=zg(r,e,"textord");return n.classes.push(t),n}else return Xe(["mspace",t],[F3(r.text,r.mode,e)],e)}else{if(jx.hasOwnProperty(r.text))return Xe(["mspace",jx[r.text]],[],e);throw new Qe('Unknown type of space "'+r.text+'"')}},mathmlBuilder(r,e){var t;if(Vx.hasOwnProperty(r.text))t=new et("mtext",[new En(" ")]);else{if(jx.hasOwnProperty(r.text))return new et("mspace");throw new Qe('Unknown type of space "'+r.text+'"')}return t}});var QM=()=>{var r=new et("mtd",[]);return r.setAttribute("width","50%"),r};Cu({type:"tag",mathmlBuilder(r,e){var t=new et("mtable",[new et("mtr",[QM(),new et("mtd",[ll(r.body,e)]),QM(),new et("mtd",[ll(r.tag,e)])])]);return t.setAttribute("width","100%"),t}});var JM={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},e9={"\\textbf":"textbf","\\textmd":"textmd"},dse={"\\textit":"textit","\\textup":"textup"},t9=(r,e)=>{var t=r.font;if(t){if(JM[t])return e.withTextFontFamily(JM[t]);if(e9[t])return e.withTextFontWeight(e9[t]);if(t==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(dse[t])};ft({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"text",mode:t.mode,body:Sn(i),font:n}},htmlBuilder(r,e){var t=t9(r,e),n=Dn(r.body,t,!0);return Xe(["mord","text"],n,t)},mathmlBuilder(r,e){var t=t9(r,e);return ll(r.body,t)}});ft({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"underline",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=or(r.body,e),n=Yc("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=sr({positionType:"top",positionData:t.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:t}]});return Xe(["mord","underline"],[a],e)},mathmlBuilder(r,e){var t=new et("mo",[new En("‾")]);t.setAttribute("stretchy","true");var n=new et("munder",[Mr(r.body,e),t]);return n.setAttribute("accentunder","true"),n}});ft({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"vcenter",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=or(r.body,e),n=e.fontMetrics().axisHeight,i=.5*(t.height-n-(t.depth+n));return sr({positionType:"shift",positionData:i,children:[{type:"elem",elem:t}]})},mathmlBuilder(r,e){return new et("mpadded",[Mr(r.body,e)],["vcenter"])}});ft({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(r,e,t){throw new Qe("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(r,e){for(var t=r9(r),n=[],i=e.havingStyle(e.style.text()),a=0;a<t.length;a++){var s=t[a];s==="~"&&(s="\\textasciitilde"),n.push(ci(s,"Typewriter-Regular",r.mode,i,["mord","texttt"]))}return Xe(["mord","text"].concat(i.sizingClasses(e)),LI(n),i)},mathmlBuilder(r,e){var t=new En(r9(r)),n=new et("mtext",[t]);return n.setAttribute("mathvariant","monospace"),n}});var r9=r=>r.body.replace(/ /g,r.star?"␣":" "),Ho=zI,bN=`[ \r
  1969. ]`,vse="\\\\[a-zA-Z@]+",pse="\\\\[^\uD800-\uDFFF]",gse="("+vse+")"+bN+"*",mse=`\\\\(
  1970. |[ \r ]+
  1971. ?)[ \r ]*`,k_="[̀-ͯ]",yse=new RegExp(k_+"+$"),bse="("+bN+"+)|"+(mse+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(k_+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(k_+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+gse)+("|"+pse+")");class n9{constructor(e,t){this.input=e,this.settings=t,this.tokenRegex=new RegExp(bse,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new Xi("EOF",new Ci(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new Qe("Unexpected character: '"+e[t]+"'",new Xi(e[t],new Ci(this,t,t+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=e.indexOf(`
  1972. `,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new Xi(i,new Ci(this,t,this.tokenRegex.lastIndex))}}class xse{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Qe("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var i=0;i<this.undefStack.length;i++)delete this.undefStack[i][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(e)&&(a[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}}var _se=lN;te("\\noexpand",function(r){var e=r.popToken();return r.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});te("\\expandafter",function(r){var e=r.popToken();return r.expandOnce(!0),{tokens:[e],numArgs:0}});te("\\@firstoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[0],numArgs:0}});te("\\@secondoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[1],numArgs:0}});te("\\@ifnextchar",function(r){var e=r.consumeArgs(3);r.consumeSpaces();var t=r.future();return e[0].length===1&&e[0][0].text===t.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});te("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");te("\\TextOrMath",function(r){var e=r.consumeArgs(2);return r.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var i9={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};te("\\char",function(r){var e=r.popToken(),t,n=0;if(e.text==="'")t=8,e=r.popToken();else if(e.text==='"')t=16,e=r.popToken();else if(e.text==="`")if(e=r.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new Qe("\\char` missing argument");n=e.text.charCodeAt(0)}else t=10;if(t){if(n=i9[e.text],n==null||n>=t)throw new Qe("Invalid base-"+t+" digit "+e.text);for(var i;(i=i9[r.future().text])!=null&&i<t;)n*=t,n+=i,r.popToken()}return"\\@char{"+n+"}"});var X3=(r,e,t,n)=>{var i=r.consumeArg().tokens;if(i.length!==1)throw new Qe("\\newcommand's first argument must be a macro name");var a=i[0].text,s=r.isDefined(a);if(s&&!e)throw new Qe("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!s&&!t)throw new Qe("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var o=0;if(i=r.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",c=r.expandNextToken();c.text!=="]"&&c.text!=="EOF";)l+=c.text,c=r.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Qe("Invalid number of arguments: "+l);o=parseInt(l),i=r.consumeArg().tokens}return s&&n||r.macros.set(a,{tokens:i,numArgs:o}),""};te("\\newcommand",r=>X3(r,!1,!0,!1));te("\\renewcommand",r=>X3(r,!0,!1,!1));te("\\providecommand",r=>X3(r,!0,!0,!0));te("\\message",r=>{var e=r.consumeArgs(1)[0];return console.log(e.reverse().map(t=>t.text).join("")),""});te("\\errmessage",r=>{var e=r.consumeArgs(1)[0];return console.error(e.reverse().map(t=>t.text).join("")),""});te("\\show",r=>{var e=r.popToken(),t=e.text;return console.log(e,r.macros.get(t),Ho[t],Vr.math[t],Vr.text[t]),""});te("\\bgroup","{");te("\\egroup","}");te("~","\\nobreakspace");te("\\lq","`");te("\\rq","'");te("\\aa","\\r a");te("\\AA","\\r A");te("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");te("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");te("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");te("ℬ","\\mathscr{B}");te("ℰ","\\mathscr{E}");te("ℱ","\\mathscr{F}");te("ℋ","\\mathscr{H}");te("ℐ","\\mathscr{I}");te("ℒ","\\mathscr{L}");te("ℳ","\\mathscr{M}");te("ℛ","\\mathscr{R}");te("ℭ","\\mathfrak{C}");te("ℌ","\\mathfrak{H}");te("ℨ","\\mathfrak{Z}");te("\\Bbbk","\\Bbb{k}");te("\\llap","\\mathllap{\\textrm{#1}}");te("\\rlap","\\mathrlap{\\textrm{#1}}");te("\\clap","\\mathclap{\\textrm{#1}}");te("\\mathstrut","\\vphantom{(}");te("\\underbar","\\underline{\\text{#1}}");te("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');te("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");te("\\ne","\\neq");te("≠","\\neq");te("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");te("∉","\\notin");te("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");te("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");te("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");te("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");te("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");te("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");te("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");te("⟂","\\perp");te("‼","\\mathclose{!\\mkern-0.8mu!}");te("∌","\\notni");te("⌜","\\ulcorner");te("⌝","\\urcorner");te("⌞","\\llcorner");te("⌟","\\lrcorner");te("©","\\copyright");te("®","\\textregistered");te("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');te("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');te("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');te("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');te("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");te("⋮","\\vdots");te("\\varGamma","\\mathit{\\Gamma}");te("\\varDelta","\\mathit{\\Delta}");te("\\varTheta","\\mathit{\\Theta}");te("\\varLambda","\\mathit{\\Lambda}");te("\\varXi","\\mathit{\\Xi}");te("\\varPi","\\mathit{\\Pi}");te("\\varSigma","\\mathit{\\Sigma}");te("\\varUpsilon","\\mathit{\\Upsilon}");te("\\varPhi","\\mathit{\\Phi}");te("\\varPsi","\\mathit{\\Psi}");te("\\varOmega","\\mathit{\\Omega}");te("\\substack","\\begin{subarray}{c}#1\\end{subarray}");te("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");te("\\boxed","\\fbox{$\\displaystyle{#1}$}");te("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");te("\\implies","\\DOTSB\\;\\Longrightarrow\\;");te("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");te("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");te("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var a9={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},wse=new Set(["bin","rel"]);te("\\dots",function(r){var e="\\dotso",t=r.expandAfterFuture().text;return t in a9?e=a9[t]:(t.slice(0,4)==="\\not"||t in Vr.math&&wse.has(Vr.math[t].group))&&(e="\\dotsb"),e});var Y3={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};te("\\dotso",function(r){var e=r.future().text;return e in Y3?"\\ldots\\,":"\\ldots"});te("\\dotsc",function(r){var e=r.future().text;return e in Y3&&e!==","?"\\ldots\\,":"\\ldots"});te("\\cdots",function(r){var e=r.future().text;return e in Y3?"\\@cdots\\,":"\\@cdots"});te("\\dotsb","\\cdots");te("\\dotsm","\\cdots");te("\\dotsi","\\!\\cdots");te("\\dotsx","\\ldots\\,");te("\\DOTSI","\\relax");te("\\DOTSB","\\relax");te("\\DOTSX","\\relax");te("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");te("\\,","\\tmspace+{3mu}{.1667em}");te("\\thinspace","\\,");te("\\>","\\mskip{4mu}");te("\\:","\\tmspace+{4mu}{.2222em}");te("\\medspace","\\:");te("\\;","\\tmspace+{5mu}{.2777em}");te("\\thickspace","\\;");te("\\!","\\tmspace-{3mu}{.1667em}");te("\\negthinspace","\\!");te("\\negmedspace","\\tmspace-{4mu}{.2222em}");te("\\negthickspace","\\tmspace-{5mu}{.277em}");te("\\enspace","\\kern.5em ");te("\\enskip","\\hskip.5em\\relax");te("\\quad","\\hskip1em\\relax");te("\\qquad","\\hskip2em\\relax");te("\\tag","\\@ifstar\\tag@literal\\tag@paren");te("\\tag@paren","\\tag@literal{({#1})}");te("\\tag@literal",r=>{if(r.macros.get("\\df@tag"))throw new Qe("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});te("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");te("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");te("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");te("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");te("\\newline","\\\\\\relax");te("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var xN=it(ts["Main-Regular"][84][1]-.7*ts["Main-Regular"][65][1]);te("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+xN+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");te("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+xN+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");te("\\hspace","\\@ifstar\\@hspacer\\@hspace");te("\\@hspace","\\hskip #1\\relax");te("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");te("\\ordinarycolon",":");te("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");te("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');te("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');te("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');te("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');te("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');te("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');te("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');te("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');te("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');te("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');te("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');te("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');te("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');te("∷","\\dblcolon");te("∹","\\eqcolon");te("≔","\\coloneqq");te("≕","\\eqqcolon");te("⩴","\\Coloneqq");te("\\ratio","\\vcentcolon");te("\\coloncolon","\\dblcolon");te("\\colonequals","\\coloneqq");te("\\coloncolonequals","\\Coloneqq");te("\\equalscolon","\\eqqcolon");te("\\equalscoloncolon","\\Eqqcolon");te("\\colonminus","\\coloneq");te("\\coloncolonminus","\\Coloneq");te("\\minuscolon","\\eqcolon");te("\\minuscoloncolon","\\Eqcolon");te("\\coloncolonapprox","\\Colonapprox");te("\\coloncolonsim","\\Colonsim");te("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");te("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");te("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");te("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");te("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");te("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");te("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");te("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");te("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");te("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");te("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");te("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");te("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");te("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");te("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");te("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");te("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");te("\\nleqq","\\html@mathml{\\@nleqq}{≰}");te("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");te("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");te("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");te("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");te("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");te("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");te("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");te("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");te("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");te("\\imath","\\html@mathml{\\@imath}{ı}");te("\\jmath","\\html@mathml{\\@jmath}{ȷ}");te("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");te("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");te("⟦","\\llbracket");te("⟧","\\rrbracket");te("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");te("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");te("⦃","\\lBrace");te("⦄","\\rBrace");te("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");te("⦵","\\minuso");te("\\darr","\\downarrow");te("\\dArr","\\Downarrow");te("\\Darr","\\Downarrow");te("\\lang","\\langle");te("\\rang","\\rangle");te("\\uarr","\\uparrow");te("\\uArr","\\Uparrow");te("\\Uarr","\\Uparrow");te("\\N","\\mathbb{N}");te("\\R","\\mathbb{R}");te("\\Z","\\mathbb{Z}");te("\\alef","\\aleph");te("\\alefsym","\\aleph");te("\\Alpha","\\mathrm{A}");te("\\Beta","\\mathrm{B}");te("\\bull","\\bullet");te("\\Chi","\\mathrm{X}");te("\\clubs","\\clubsuit");te("\\cnums","\\mathbb{C}");te("\\Complex","\\mathbb{C}");te("\\Dagger","\\ddagger");te("\\diamonds","\\diamondsuit");te("\\empty","\\emptyset");te("\\Epsilon","\\mathrm{E}");te("\\Eta","\\mathrm{H}");te("\\exist","\\exists");te("\\harr","\\leftrightarrow");te("\\hArr","\\Leftrightarrow");te("\\Harr","\\Leftrightarrow");te("\\hearts","\\heartsuit");te("\\image","\\Im");te("\\infin","\\infty");te("\\Iota","\\mathrm{I}");te("\\isin","\\in");te("\\Kappa","\\mathrm{K}");te("\\larr","\\leftarrow");te("\\lArr","\\Leftarrow");te("\\Larr","\\Leftarrow");te("\\lrarr","\\leftrightarrow");te("\\lrArr","\\Leftrightarrow");te("\\Lrarr","\\Leftrightarrow");te("\\Mu","\\mathrm{M}");te("\\natnums","\\mathbb{N}");te("\\Nu","\\mathrm{N}");te("\\Omicron","\\mathrm{O}");te("\\plusmn","\\pm");te("\\rarr","\\rightarrow");te("\\rArr","\\Rightarrow");te("\\Rarr","\\Rightarrow");te("\\real","\\Re");te("\\reals","\\mathbb{R}");te("\\Reals","\\mathbb{R}");te("\\Rho","\\mathrm{P}");te("\\sdot","\\cdot");te("\\sect","\\S");te("\\spades","\\spadesuit");te("\\sub","\\subset");te("\\sube","\\subseteq");te("\\supe","\\supseteq");te("\\Tau","\\mathrm{T}");te("\\thetasym","\\vartheta");te("\\weierp","\\wp");te("\\Zeta","\\mathrm{Z}");te("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");te("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");te("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");te("\\bra","\\mathinner{\\langle{#1}|}");te("\\ket","\\mathinner{|{#1}\\rangle}");te("\\braket","\\mathinner{\\langle{#1}\\rangle}");te("\\Bra","\\left\\langle#1\\right|");te("\\Ket","\\left|#1\\right\\rangle");var _N=r=>e=>{var t=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.consumeArg().tokens,s=e.macros.get("|"),o=e.macros.get("\\|");e.macros.beginGroup();var l=d=>v=>{r&&(v.macros.set("|",s),i.length&&v.macros.set("\\|",o));var g=d;if(!d&&i.length){var m=v.future();m.text==="|"&&(v.popToken(),g=!0)}return{tokens:g?i:n,numArgs:0}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var c=e.consumeArg().tokens,h=e.expandTokens([...a,...c,...t]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};te("\\bra@ket",_N(!1));te("\\bra@set",_N(!0));te("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");te("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");te("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");te("\\angln","{\\angl n}");te("\\blue","\\textcolor{##6495ed}{#1}");te("\\orange","\\textcolor{##ffa500}{#1}");te("\\pink","\\textcolor{##ff00af}{#1}");te("\\red","\\textcolor{##df0030}{#1}");te("\\green","\\textcolor{##28ae7b}{#1}");te("\\gray","\\textcolor{gray}{#1}");te("\\purple","\\textcolor{##9d38bd}{#1}");te("\\blueA","\\textcolor{##ccfaff}{#1}");te("\\blueB","\\textcolor{##80f6ff}{#1}");te("\\blueC","\\textcolor{##63d9ea}{#1}");te("\\blueD","\\textcolor{##11accd}{#1}");te("\\blueE","\\textcolor{##0c7f99}{#1}");te("\\tealA","\\textcolor{##94fff5}{#1}");te("\\tealB","\\textcolor{##26edd5}{#1}");te("\\tealC","\\textcolor{##01d1c1}{#1}");te("\\tealD","\\textcolor{##01a995}{#1}");te("\\tealE","\\textcolor{##208170}{#1}");te("\\greenA","\\textcolor{##b6ffb0}{#1}");te("\\greenB","\\textcolor{##8af281}{#1}");te("\\greenC","\\textcolor{##74cf70}{#1}");te("\\greenD","\\textcolor{##1fab54}{#1}");te("\\greenE","\\textcolor{##0d923f}{#1}");te("\\goldA","\\textcolor{##ffd0a9}{#1}");te("\\goldB","\\textcolor{##ffbb71}{#1}");te("\\goldC","\\textcolor{##ff9c39}{#1}");te("\\goldD","\\textcolor{##e07d10}{#1}");te("\\goldE","\\textcolor{##a75a05}{#1}");te("\\redA","\\textcolor{##fca9a9}{#1}");te("\\redB","\\textcolor{##ff8482}{#1}");te("\\redC","\\textcolor{##f9685d}{#1}");te("\\redD","\\textcolor{##e84d39}{#1}");te("\\redE","\\textcolor{##bc2612}{#1}");te("\\maroonA","\\textcolor{##ffbde0}{#1}");te("\\maroonB","\\textcolor{##ff92c6}{#1}");te("\\maroonC","\\textcolor{##ed5fa6}{#1}");te("\\maroonD","\\textcolor{##ca337c}{#1}");te("\\maroonE","\\textcolor{##9e034e}{#1}");te("\\purpleA","\\textcolor{##ddd7ff}{#1}");te("\\purpleB","\\textcolor{##c6b9fc}{#1}");te("\\purpleC","\\textcolor{##aa87ff}{#1}");te("\\purpleD","\\textcolor{##7854ab}{#1}");te("\\purpleE","\\textcolor{##543b78}{#1}");te("\\mintA","\\textcolor{##f5f9e8}{#1}");te("\\mintB","\\textcolor{##edf2df}{#1}");te("\\mintC","\\textcolor{##e0e5cc}{#1}");te("\\grayA","\\textcolor{##f6f7f7}{#1}");te("\\grayB","\\textcolor{##f0f1f2}{#1}");te("\\grayC","\\textcolor{##e3e5e6}{#1}");te("\\grayD","\\textcolor{##d6d8da}{#1}");te("\\grayE","\\textcolor{##babec2}{#1}");te("\\grayF","\\textcolor{##888d93}{#1}");te("\\grayG","\\textcolor{##626569}{#1}");te("\\grayH","\\textcolor{##3b3e40}{#1}");te("\\grayI","\\textcolor{##21242c}{#1}");te("\\kaBlue","\\textcolor{##314453}{#1}");te("\\kaGreen","\\textcolor{##71B307}{#1}");var wN={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Sse{constructor(e,t,n){this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new xse(_se,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new n9(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:t,end:n}=this.consumeArg());return this.pushToken(new Xi("EOF",n.loc)),this.pushTokens(i),new Xi("",Ci.range(t,n))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),a,s=0,o=0;do{if(a=this.popToken(),t.push(a),a.text==="{")++s;else if(a.text==="}"){if(--s,s===-1)throw new Qe("Extra }",a)}else if(a.text==="EOF")throw new Qe("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",a);if(e&&n)if((s===0||s===1&&e[o]==="{")&&a.text===e[o]){if(++o,o===e.length){t.splice(-o,o);break}}else o=0}while(s!==0||n);return i.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:i,end:a}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new Qe("The length of delimiters doesn't match the number of args!");for(var n=t[0],i=0;i<n.length;i++){var a=this.popToken();if(n[i]!==a.text)throw new Qe("Use of the macro doesn't match its definition",a)}}for(var s=[],o=0;o<e;o++)s.push(this.consumeArg(t&&t[o+1]).tokens);return s}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new Qe("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),n=t.text,i=t.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new Qe("Undefined control sequence: "+n);return this.pushToken(t),!1}this.countExpansion(1);var a=i.tokens,s=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var o=a.length-1;o>=0;--o){var l=a[o];if(l.text==="#"){if(o===0)throw new Qe("Incomplete placeholder at end of macro body",l);if(l=a[--o],l.text==="#")a.splice(o+1,1);else if(/^[1-9]$/.test(l.text))a.splice(o,2,...s[+l.text-1]);else throw new Qe("Not a valid argument number",l)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Xi(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),t.push(i)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(n=>n.text).join("")}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof t=="function"?t(this):t;if(typeof i=="string"){var a=0;if(i.includes("#"))for(var s=i.replace(/##/g,"");s.includes("#"+(a+1));)++a;for(var o=new n9(i,this.settings),l=[],c=o.lex();c.text!=="EOF";)l.push(c),c=o.lex();l.reverse();var h={tokens:l,numArgs:a};return h}return i}isDefined(e){return this.macros.has(e)||Ho.hasOwnProperty(e)||Vr.math.hasOwnProperty(e)||Vr.text.hasOwnProperty(e)||wN.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:Ho.hasOwnProperty(e)&&!Ho[e].primitive}}var s9=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Qv=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),qx={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},o9={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class $g{constructor(e,t){this.mode="math",this.gullet=new Sse(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new Qe("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Xi("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(e,t){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if($g.endOfExpression.has(i.text)||t&&i.text===t||e&&Ho[i.text]&&Ho[i.text].infix)break;var a=this.parseAtom(t);if(a){if(a.type==="internal")continue}else break;n.push(a)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t=-1,n,i=0;i<e.length;i++){var a=e[i];if(a.type==="infix"){if(t!==-1)throw new Qe("only one infix operator per group",a.token);t=i,n=a.replaceWith}}if(t!==-1&&n){var s,o,l=e.slice(0,t),c=e.slice(t+1);l.length===1&&l[0].type==="ordgroup"?s=l[0]:s={type:"ordgroup",mode:this.mode,body:l},c.length===1&&c[0].type==="ordgroup"?o=c[0]:o={type:"ordgroup",mode:this.mode,body:c};var h;return n==="\\\\abovefrac"?h=this.callFunction(n,[s,e[t],o],[]):h=this.callFunction(n,[s,o],[]),[h]}else return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var i;do{var a;i=this.parseGroup(e)}while(((a=i)==null?void 0:a.type)==="internal");if(!i)throw new Qe("Expected group after '"+n+"'",t);return i}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:"textord",mode:"text",text:e[n]});var i={type:"text",mode:this.mode,body:t},a={type:"color",mode:this.mode,color:this.settings.errorColor,body:[i]};return a}parseAtom(e){var t=this.parseGroup("atom",e);if((t==null?void 0:t.type)==="internal"||this.mode==="text")return t;for(var n,i;;){this.consumeSpaces();var a=this.fetch();if(a.text==="\\limits"||a.text==="\\nolimits"){if(t&&t.type==="op"){var s=a.text==="\\limits";t.limits=s,t.alwaysHandleSupSub=!0}else if(t&&t.type==="operatorname")t.alwaysHandleSupSub&&(t.limits=a.text==="\\limits");else throw new Qe("Limit controls must follow a math operator",a);this.consume()}else if(a.text==="^"){if(n)throw new Qe("Double superscript",a);n=this.handleSupSubscript("superscript")}else if(a.text==="_"){if(i)throw new Qe("Double subscript",a);i=this.handleSupSubscript("subscript")}else if(a.text==="'"){if(n)throw new Qe("Double superscript",a);var o={type:"textord",mode:this.mode,text:"\\prime"},l=[o];for(this.consume();this.fetch().text==="'";)l.push(o),this.consume();this.fetch().text==="^"&&l.push(this.handleSupSubscript("superscript")),n={type:"ordgroup",mode:this.mode,body:l}}else if(Qv[a.text]){var c=s9.test(a.text),h=[];for(h.push(new Xi(Qv[a.text])),this.consume();;){var d=this.fetch().text;if(!Qv[d]||s9.test(d)!==c)break;h.unshift(new Xi(Qv[d])),this.consume()}var v=this.subparse(h);c?i={type:"ordgroup",mode:"math",body:v}:n={type:"ordgroup",mode:"math",body:v}}else break}return n||i?{type:"supsub",mode:this.mode,base:t,sup:n,sub:i}:t}parseFunction(e,t){var n=this.fetch(),i=n.text,a=Ho[i];if(!a)return null;if(this.consume(),t&&t!=="atom"&&!a.allowedInArgument)throw new Qe("Got function '"+i+"' with no arguments"+(t?" as "+t:""),n);if(this.mode==="text"&&!a.allowedInText)throw new Qe("Can't use function '"+i+"' in text mode",n);if(this.mode==="math"&&a.allowedInMath===!1)throw new Qe("Can't use function '"+i+"' in math mode",n);var{args:s,optArgs:o}=this.parseArguments(i,a);return this.callFunction(i,s,o,n,e)}callFunction(e,t,n,i,a){var s={funcName:e,parser:this,token:i,breakOnTokenText:a},o=Ho[e];if(o&&o.handler)return o.handler(s,t,n);throw new Qe("No function handler for "+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(n===0)return{args:[],optArgs:[]};for(var i=[],a=[],s=0;s<n;s++){var o=t.argTypes&&t.argTypes[s],l=s<t.numOptionalArgs;("primitive"in t&&t.primitive&&o==null||t.type==="sqrt"&&s===1&&a[0]==null)&&(o="primitive");var c=this.parseGroupOfType("argument to '"+e+"'",o,l);if(l)a.push(c);else if(c!=null)i.push(c);else throw new Qe("Null argument, please report this as a bug")}return{args:i,optArgs:a}}parseGroupOfType(e,t,n){switch(t){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,t);case"hbox":{var i=this.parseArgumentGroup(n,"text");return i!=null?{type:"styling",mode:i.mode,body:[i],style:"text"}:null}case"raw":{var a=this.parseStringGroup("raw",n);return a!=null?{type:"raw",mode:"text",string:a.text}:null}case"primitive":{if(n)throw new Qe("A primitive argument cannot be optional");var s=this.parseGroup(e);if(s==null)throw new Qe("Expected group as "+e,this.fetch());return s}case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new Qe("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(e,t){var n=this.gullet.scanArgument(t);if(n==null)return null;for(var i="",a;(a=this.fetch()).text!=="EOF";)i+=a.text,this.consume();return this.consume(),n.text=i,n}parseRegexGroup(e,t){for(var n=this.fetch(),i=n,a="",s;(s=this.fetch()).text!=="EOF"&&e.test(a+s.text);)i=s,a+=i.text,this.consume();if(a==="")throw new Qe("Invalid "+t+": '"+n.text+"'",n);return n.range(i,a)}parseColorGroup(e){var t=this.parseStringGroup("color",e);if(t==null)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new Qe("Invalid color: '"+t.text+"'",t);var i=n[0];return/^[0-9a-f]{6}$/i.test(i)&&(i="#"+i),{type:"color-token",mode:this.mode,color:i}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),!e&&this.gullet.future().text!=="{"?t=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):t=this.parseStringGroup("size",e),!t)return null;!e&&t.text.length===0&&(t.text="0pt",n=!0);var i=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!i)throw new Qe("Invalid size: '"+t.text+"'",t);var a={number:+(i[1]+i[2]),unit:i[3]};if(!OI(a))throw new Qe("Invalid unit: '"+a.unit+"'",t);return{type:"size",mode:this.mode,value:a,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var t=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),t==null)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(n==null)return null;var i=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var a=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var s={type:"ordgroup",mode:this.mode,loc:n.loc,body:a};return t&&this.switchMode(i),s}parseGroup(e,t){var n=this.fetch(),i=n.text,a;if(i==="{"||i==="\\begingroup"){this.consume();var s=i==="{"?"}":"\\endgroup";this.gullet.beginGroup();var o=this.parseExpression(!1,s),l=this.fetch();this.expect(s),this.gullet.endGroup(),a={type:"ordgroup",mode:this.mode,loc:Ci.range(n,l),body:o,semisimple:i==="\\begingroup"||void 0}}else if(a=this.parseFunction(t,e)||this.parseSymbol(),a==null&&i[0]==="\\"&&!wN.hasOwnProperty(i)){if(this.settings.throwOnError)throw new Qe("Undefined control sequence: "+i,n);a=this.formatUnsupportedCmd(i),this.consume()}return a}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var i=e[n];if(i.type==="textord"){var a=i.text,s=e[n+1];if(!(!s||s.type!=="textord")){if(a==="-"&&s.text==="-"){var o=e[n+2];n+1<t&&o&&o.type==="textord"&&o.text==="-"?(e.splice(n,3,{type:"textord",mode:"text",loc:Ci.range(i,o),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:Ci.range(i,s),text:"--"}),t-=1)}(a==="'"||a==="`")&&s.text===a&&(e.splice(n,2,{type:"textord",mode:"text",loc:Ci.range(i,s),text:a+a}),t-=1)}}}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),i=n.charAt(0)==="*";if(i&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new Qe(`\\verb assertion failed --
  1973. please report what input caused this bug`);return n=n.slice(1,-1),{type:"verb",mode:"text",body:n,star:i}}o9.hasOwnProperty(t[0])&&!Vr[this.mode][t[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=o9[t[0]]+t.slice(1));var a=yse.exec(t);a&&(t=t.substring(0,a.index),t==="i"?t="ı":t==="j"&&(t="ȷ"));var s;if(Vr[this.mode][t]){this.settings.strict&&this.mode==="math"&&A_.includes(t)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var o=Vr[this.mode][t].group,l=Ci.range(e),c;if(bae.hasOwnProperty(o)){var h=o;c={type:"atom",mode:this.mode,family:h,loc:l,text:t}}else c={type:o,mode:this.mode,loc:l,text:t};s=c}else if(t.charCodeAt(0)>=128)this.settings.strict&&(RI(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),e)),s={type:"textord",mode:"text",loc:Ci.range(e),text:t};else return null;if(this.consume(),a)for(var d=0;d<a[0].length;d++){var v=a[0][d];if(!qx[v])throw new Qe("Unknown accent ' "+v+"'",e);var g=qx[v][this.mode]||qx[v].text;if(!g)throw new Qe("Accent "+v+" unsupported in "+this.mode+" mode",e);s={type:"accent",mode:this.mode,loc:Ci.range(e),label:g,isStretchy:!1,isShifty:!0,base:s}}return s}}$g.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var W3=function(e,t){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new $g(e,t);delete n.gullet.macros.current["\\df@tag"];var i=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new Qe("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:n.subparse([new Xi("\\df@tag")])}]}return i},SN=function(e,t,n){t.textContent="";var i=$3(e,n).toNode();t.appendChild(i)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),SN=function(){throw new Qe("KaTeX doesn't work in quirks mode.")});var Ese=function(e,t){var n=$3(e,t).toMarkup();return n},Tse=function(e,t){var n=new L3(t);return W3(e,n)},EN=function(e,t,n){if(n.throwOnError||!(e instanceof Qe))throw e;var i=Xe(["katex-error"],[new Yi(t)]);return i.setAttribute("title",e.toString()),i.setAttribute("style","color:"+n.errorColor),i},$3=function(e,t){var n=new L3(t);try{var i=W3(e,n);return Lae(i,e,n)}catch(a){return EN(a,e,n)}},Cse=function(e,t){var n=new L3(t);try{var i=W3(e,n);return kae(i,e,n)}catch(a){return EN(a,e,n)}},Ase="0.16.44",Mse={Span:fh,Anchor:Bg,SymbolNode:Yi,SvgNode:qs,PathNode:sl,LineNode:C_},l9={version:Ase,render:SN,renderToString:Ese,ParseError:Qe,SETTINGS_SCHEMA:S_,__parse:Tse,__renderToDomTree:$3,__renderToHTMLTree:Cse,__setFontMetrics:mae,__defineSymbol:F,__defineFunction:ft,__defineMacro:te,__domTree:Mse};const Rse={},Ose=[];function Dse(r){const e=r||Rse;return function(t,n){bI(t,"element",function(i,a){const s=Array.isArray(i.properties.className)?i.properties.className:Ose,o=s.includes("language-math"),l=s.includes("math-display"),c=s.includes("math-inline");let h=l;if(!o&&!l&&!c)return;let d=a[a.length-1],v=i;if(i.tagName==="code"&&o&&d&&d.type==="element"&&d.tagName==="pre"&&(v=d,d=a[a.length-2],h=!0),!d)return;const g=Nie(v,{whitespace:"pre"});let m;try{m=l9.renderToString(g,{...e,displayMode:h,throwOnError:!0})}catch(y){const _=y,w=_.name.toLowerCase();n.message("Could not render math with KaTeX",{ancestors:[...a,i],cause:_,place:i.position,ruleId:w,source:"rehype-katex"});try{m=l9.renderToString(g,{...e,displayMode:h,strict:"ignore",throwOnError:!1})}catch{m=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(e.errorColor||"#cc0000"),title:String(y)},children:[{type:"text",value:g}]}]}}typeof m=="string"&&(m=Cie(m).children);const x=d.children.indexOf(v);return d.children.splice(x,1,...m),yI})}}function Pse(r,e){const t=String(r);let n=t.indexOf(e),i=n,a=0,s=0;for(;n!==-1;)n===i?++a>s&&(s=a):a=1,i=n+e.length,n=t.indexOf(e,i);return s}function Ise(){return{enter:{mathFlow:r,mathFlowFenceMeta:e,mathText:a},exit:{mathFlow:i,mathFlowFence:n,mathFlowFenceMeta:t,mathFlowValue:o,mathText:s,mathTextData:o}};function r(l){const c={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[c]}},l)}function e(){this.buffer()}function t(){const l=this.resume(),c=this.stack[this.stack.length-1];c.type,c.meta=l}function n(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(l){const c=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),h=this.stack[this.stack.length-1];h.type,this.exit(l),h.value=c;const d=h.data.hChildren[0];d.type,d.tagName,d.children.push({type:"text",value:c}),this.data.mathFlowInside=void 0}function a(l){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},l),this.buffer()}function s(l){const c=this.resume(),h=this.stack[this.stack.length-1];h.type,this.exit(l),h.value=c,h.data.hChildren.push({type:"text",value:c})}function o(l){this.config.enter.data.call(this,l),this.config.exit.data.call(this,l)}}function Nse(r){let e=(r||{}).singleDollarTextMath;return e==null&&(e=!0),n.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
  1974. `,inConstruct:"mathFlowMeta"},{character:"$",after:e?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:t,inlineMath:n}};function t(a,s,o,l){const c=a.value||"",h=o.createTracker(l),d="$".repeat(Math.max(Pse(c,"$")+1,2)),v=o.enter("mathFlow");let g=h.move(d);if(a.meta){const m=o.enter("mathFlowMeta");g+=h.move(o.safe(a.meta,{after:`
  1975. `,before:g,encode:["$"],...h.current()})),m()}return g+=h.move(`
  1976. `),c&&(g+=h.move(c+`
  1977. `)),g+=h.move(d),v(),g}function n(a,s,o){let l=a.value||"",c=1;for(e||c++;new RegExp("(^|[^$])"+"\\$".repeat(c)+"([^$]|$)").test(l);)c++;const h="$".repeat(c);/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^\$|\$$/.test(l))&&(l=" "+l+" ");let d=-1;for(;++d<o.unsafe.length;){const v=o.unsafe[d];if(!v.atBreak)continue;const g=o.compilePattern(v);let m;for(;m=g.exec(l);){let x=m.index;l.codePointAt(x)===10&&l.codePointAt(x-1)===13&&x--,l=l.slice(0,x)+" "+l.slice(m.index+1)}}return h+l+h}function i(){return"$"}}const Lse={tokenize:kse,concrete:!0,name:"mathFlow"},u9={tokenize:Bse,partial:!0};function kse(r,e,t){const n=this,i=n.events[n.events.length-1],a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0;let s=0;return o;function o(w){return r.enter("mathFlow"),r.enter("mathFlowFence"),r.enter("mathFlowFenceSequence"),l(w)}function l(w){return w===36?(r.consume(w),s++,l):s<2?t(w):(r.exit("mathFlowFenceSequence"),dr(r,c,"whitespace")(w))}function c(w){return w===null||St(w)?d(w):(r.enter("mathFlowFenceMeta"),r.enter("chunkString",{contentType:"string"}),h(w))}function h(w){return w===null||St(w)?(r.exit("chunkString"),r.exit("mathFlowFenceMeta"),d(w)):w===36?t(w):(r.consume(w),h)}function d(w){return r.exit("mathFlowFence"),n.interrupt?e(w):r.attempt(u9,v,y)(w)}function v(w){return r.attempt({tokenize:_,partial:!0},y,g)(w)}function g(w){return(a?dr(r,m,"linePrefix",a+1):m)(w)}function m(w){return w===null?y(w):St(w)?r.attempt(u9,v,y)(w):(r.enter("mathFlowValue"),x(w))}function x(w){return w===null||St(w)?(r.exit("mathFlowValue"),m(w)):(r.consume(w),x)}function y(w){return r.exit("mathFlow"),e(w)}function _(w,S,A){let C=0;return dr(w,M,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function M(D){return w.enter("mathFlowFence"),w.enter("mathFlowFenceSequence"),E(D)}function E(D){return D===36?(C++,w.consume(D),E):C<s?A(D):(w.exit("mathFlowFenceSequence"),dr(w,O,"whitespace")(D))}function O(D){return D===null||St(D)?(w.exit("mathFlowFence"),S(D)):A(D)}}}function Bse(r,e,t){const n=this;return i;function i(s){return s===null?e(s):(r.enter("lineEnding"),r.consume(s),r.exit("lineEnding"),a)}function a(s){return n.parser.lazy[n.now().line]?t(s):e(s)}}function Fse(r){let t=(r||{}).singleDollarTextMath;return t==null&&(t=!0),{tokenize:n,resolve:zse,previous:Use,name:"mathText"};function n(i,a,s){let o=0,l,c;return h;function h(x){return i.enter("mathText"),i.enter("mathTextSequence"),d(x)}function d(x){return x===36?(i.consume(x),o++,d):o<2&&!t?s(x):(i.exit("mathTextSequence"),v(x))}function v(x){return x===null?s(x):x===36?(c=i.enter("mathTextSequence"),l=0,m(x)):x===32?(i.enter("space"),i.consume(x),i.exit("space"),v):St(x)?(i.enter("lineEnding"),i.consume(x),i.exit("lineEnding"),v):(i.enter("mathTextData"),g(x))}function g(x){return x===null||x===32||x===36||St(x)?(i.exit("mathTextData"),v(x)):(i.consume(x),g)}function m(x){return x===36?(i.consume(x),l++,m):l===o?(i.exit("mathTextSequence"),i.exit("mathText"),a(x)):(c.type="mathTextData",g(x))}}}function zse(r){let e=r.length-4,t=3,n,i;if((r[t][1].type==="lineEnding"||r[t][1].type==="space")&&(r[e][1].type==="lineEnding"||r[e][1].type==="space")){for(n=t;++n<e;)if(r[n][1].type==="mathTextData"){r[e][1].type="mathTextPadding",r[t][1].type="mathTextPadding",t+=2,e-=2;break}}for(n=t-1,e++;++n<=e;)i===void 0?n!==e&&r[n][1].type!=="lineEnding"&&(i=n):(n===e||r[n][1].type==="lineEnding")&&(r[i][1].type="mathTextData",n!==i+2&&(r[i][1].end=r[n-1][1].end,r.splice(i+2,n-i-2),e-=n-i-2,n=i+2),i=void 0);return r}function Use(r){return r!==36||this.events[this.events.length-1][1].type==="characterEscape"}function Gse(r){return{flow:{36:Lse},text:{36:Fse(r)}}}const Hse={};function jse(r){const e=this,t=r||Hse,n=e.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),a=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),s=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(Gse(t)),a.push(Ise()),s.push(Nse(t))}const Xx=[{label:"内置占位模型",provider:"builtin"},{label:"OpenAI API(待接入)",provider:"openai",modelId:"gpt-4o-mini"},{label:"通义千问 API(待接入)",provider:"qwen",modelId:"qwen-plus"},{label:"DeepSeek API(已接入)",provider:"deepseek",modelId:"deepseek-chat"}],Ec=[{name:"Hiyori(日和)",modelPath:"/live2D/hiyori/hiyori_pro_t11.model3.json"},{name:"Rory(洛璃)",modelPath:"/live2D/Rory/Roxy_V1.model3.json"},{name:"UG(新形象)",modelPath:"/live2D/UG/ugofficial.model3.json"},{name:"静态数字人占位",modelPath:""}],Vse=Ec.map(r=>r.modelPath).filter(Boolean),Yx="kmb_teacher_model_options",Wx="kmb_teacher_avatar_options",Yl="系统默认",Jp="asset::";function qse(r){try{const e=localStorage.getItem(r);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function c9(r,e){localStorage.setItem(r,JSON.stringify(e))}function K3(r){const e=r.trim().toLowerCase();return e==="deepseek"||e==="openai"||e==="qwen"||e==="builtin"||e==="custom"?e:"custom"}function qa(r){return`${r.provider}|${r.label}|${r.modelId||""}`}function Xse(r){const[e="custom",t="",n=""]=r.split("|");return{provider:K3(e),label:t,modelId:n||void 0}}function Yse(r){try{const e=localStorage.getItem(r);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.every(n=>typeof n=="string")?t.map(n=>({label:n,provider:n.toLowerCase().includes("deepseek")?"deepseek":"custom"})).filter(n=>n.label.trim().length>0):t.map(n=>({label:typeof(n==null?void 0:n.label)=="string"?n.label.trim():"",provider:K3(typeof(n==null?void 0:n.provider)=="string"?n.provider:"custom"),modelId:typeof(n==null?void 0:n.modelId)=="string"&&n.modelId.trim()||void 0})).filter(n=>n.label.length>0):[]}catch{return[]}}function h9(r,e){localStorage.setItem(r,JSON.stringify(e))}function f9(r){return`${Jp}${r}`}function Jv(r){return r.startsWith(Jp)}function d9(r){return r.startsWith(Jp)?r.slice(Jp.length):""}function Wse(r){let e=r.replace(/\r\n/g,`
  1978. `).replace(/\u00a0/g," ");const t=e.trim();return t.startsWith("```")?e=t.replace(/^```(?:latex|tex|math)?\s*\n?/i,"").replace(/\n```\s*$/m,""):e=t,e=e.replace(/\\n/g,`
  1979. `),e=e.replace(/\n{4,}/g,`
  1980. `),e=e.replace(/\\\[([\s\S]*?)\\\]/g,(n,i)=>`
  1981. $$
  1982. ${i.trim()}
  1983. $$
  1984. `),e=e.replace(/\$\$([\s\S]*?)\$\$/g,(n,i)=>`
  1985. $$
  1986. ${i.trim()}
  1987. $$
  1988. `),e=e.replace(/\\\(([\s\S]*?)\\\)/g,(n,i)=>`$${i.trim()}$`),e.trim()}function $se({text:r}){const e=he.useMemo(()=>Wse(r),[r]);return N.jsx("div",{className:"assistant-math-md",style:{wordBreak:"break-word",lineHeight:1.55,fontSize:14},children:N.jsx(oie,{remarkPlugins:[jse],rehypePlugins:[Dse],components:{p:({children:t})=>N.jsx("p",{style:{margin:"0.45em 0"},children:t}),ul:({children:t})=>N.jsx("ul",{style:{margin:"0.35em 0",paddingLeft:22},children:t}),ol:({children:t})=>N.jsx("ol",{style:{margin:"0.35em 0",paddingLeft:22},children:t}),li:({children:t})=>N.jsx("li",{style:{margin:"0.2em 0"},children:t}),h1:({children:t})=>N.jsx("h3",{style:{margin:"0.5em 0 0.25em",fontSize:"1.08em"},children:t}),h2:({children:t})=>N.jsx("h3",{style:{margin:"0.5em 0 0.25em",fontSize:"1.06em"},children:t}),h3:({children:t})=>N.jsx("h4",{style:{margin:"0.45em 0 0.2em",fontSize:"1.02em"},children:t}),code:({className:t,children:n,...i})=>t!=null&&t.includes("math")||t!=null&&t.includes("katex")?N.jsx("code",{className:t,...i,children:n}):N.jsx("code",{style:{background:"#e5e7eb",padding:"1px 6px",borderRadius:4,fontSize:"0.92em"},...i,children:n})},children:e})})}function Kse(){var Lr,cn,Ur,Wr;const e=Object.keys(Uo)[0]||"",n=Object.keys(Uo[e]||{})[0]||"",i=((Ur=(cn=(Lr=Uo[e])==null?void 0:Lr[n])==null?void 0:cn[0])==null?void 0:Ur.code)||"",[a,s]=he.useState(Uo),o=Object.keys(a||{}),[l,c]=he.useState(e),[h,d]=he.useState(n),[v,g]=he.useState(i),m=he.useRef(null),x=he.useRef(null),y=he.useRef(null),_=he.useRef(null),w=he.useRef(null),S=he.useRef(null),[A,C]=he.useState(i||"J7-EQ-001"),[M,E]=he.useState("什么是一元一次方程?给我一个例题并讲解。"),[O,D]=he.useState(null),[I,k]=he.useState(null),[U,V]=he.useState(null),[X,W]=he.useState(!1),[P,H]=he.useState([]),{role:z}=bu(),[$,B]=he.useState([]),[L,Y]=he.useState([]),G=[...Xx,...$],re=[...Ec.map(xe=>xe.name),...L],[ie,le]=he.useState(qa(Xx[0])),[ce,_e]=he.useState(Ec[0].name),[pe,ae]=he.useState([]),[oe,de]=he.useState(Yl),[ye,Ee]=he.useState(!0),[Re,Ne]=he.useState([]),[Be,$e]=he.useState(Ec[0].modelPath),[Ye,He]=he.useState("未检测"),[tt,ot]=he.useState([]),[ct,Ze]=he.useState(0),[bt,Se]=he.useState(0),[ke,We]=he.useState(!1),[Ke,rt]=he.useState(!1),[nt,De]=he.useState(null),[Q,ne]=he.useState("未加载预览"),[be,ee]=he.useState(null),[se,Pe]=he.useState(""),[Ae,Ge]=he.useState("deepseek"),[J,Oe]=he.useState(""),[Ve,Ue]=he.useState(""),je=z==="teacher",yt=he.useMemo(()=>typeof window<"u"&&"speechSynthesis"in window,[]);he.useEffect(()=>{B(Yse(Yx)),Y(qse(Wx)),vF().then(xe=>{Ne(xe)}).catch(()=>Ne([])),H_().then(xe=>{xe&&Object.keys(xe).length&&s(xe)}).catch(()=>{})},[]),he.useEffect(()=>{G.some(xe=>qa(xe)===ie)||le(qa(G[0]||Xx[0])),re.includes(ce)||_e(re[0]||Ec[0].name)},[$,L]),he.useEffect(()=>{const xe=Object.keys(a||{});!xe.includes(l)&&xe[0]&&c(xe[0])},[a,l]),he.useEffect(()=>{const xe=Object.keys((a==null?void 0:a[l])||{});xe.includes(h)||d(xe[0]||"")},[a,l,h]),he.useEffect(()=>{var st,lt;const xe=((st=a==null?void 0:a[l])==null?void 0:st[h])||[];xe.some(Ut=>Ut.code===v)||g(((lt=xe[0])==null?void 0:lt.code)||"")},[a,l,h,v]),he.useEffect(()=>{var st;const xe=(((st=a==null?void 0:a[l])==null?void 0:st[h])||[]).find(lt=>lt.code===v);xe&&C(xe.code)},[a,l,h,v]),he.useEffect(()=>{const xe=Ec.find(st=>st.name===ce);if(xe){if(!xe.modelPath){rt(!0);return}rt(!1),$e(xe.modelPath)}},[ce]),he.useEffect(()=>{if(!yt)return;const xe=()=>{const st=window.speechSynthesis.getVoices();ae(st),!Jv(oe)&&oe!==Yl&&!st.some(lt=>lt.name===oe)&&de(Yl)};return xe(),window.speechSynthesis.onvoiceschanged=xe,()=>{window.speechSynthesis.onvoiceschanged=null}},[yt,oe]);function vt(){const xe=y.current;if(xe){xe.pause(),xe.currentTime=0;try{xe.removeAttribute("src"),xe.load()}catch{}y.current=null}}function Ot(xe){if(!ye||!yt||Jv(oe))return;vt();const st=new SpeechSynthesisUtterance(xe);if(st.lang="zh-CN",oe!==Yl){const lt=pe.find(Ut=>Ut.name===oe);lt&&(st.voice=lt)}window.speechSynthesis.cancel(),window.speechSynthesis.speak(st)}function jt(xe,st){vt();const lt=new Audio(`data:${st||"audio/wav"};base64,${xe}`);y.current=lt;const Ut=()=>{y.current===lt&&(y.current=null)};return lt.addEventListener("ended",Ut),lt.addEventListener("error",Ut),lt.play().catch(br=>{throw Ut(),br})}function Nr(){const xe=d9(oe);if(!xe)return;vt();const st=new Audio(xe);y.current=st;const lt=()=>{y.current===st&&(y.current=null)};st.addEventListener("ended",lt),st.addEventListener("error",lt),st.play().catch(()=>{lt(),k("语音文件播放失败")})}he.useEffect(()=>{m.current&&(m.current.scrollTop=m.current.scrollHeight)},[P]),he.useEffect(()=>()=>{const xe=y.current;xe&&(xe.pause(),y.current=null),typeof window<"u"&&"speechSynthesis"in window&&window.speechSynthesis.cancel()},[]);async function Vt(){k(null),W(!0);const xe=new AbortController;x.current=xe;try{const st=Xse(ie),lt=await dF(M,A||void 0,O||void 0,st.label,st.provider,st.modelId,xe.signal);if(D(lt.session_id),V(lt.tts_status??null),H(Ut=>[...Ut,{role:"user",content:M},{role:"assistant",content:lt.answer}]),ye)if(Jv(oe))Nr();else if(lt.audio_base64)try{await jt(lt.audio_base64,lt.audio_mime)}catch{Ot(lt.answer)}else Ot(lt.answer);E("")}catch(st){st instanceof Error&&st.name==="AbortError"?k("已终止当前对话请求"):k(st instanceof Error?st.message:"请求失败")}finally{x.current=null,W(!1)}}function Qt(){x.current&&x.current.abort(),vt(),typeof window<"u"&&"speechSynthesis"in window&&window.speechSynthesis.cancel(),D(null),V(null),k("已终止当前对话,会话已重置")}function rr(){const xe=se.trim(),st=J.trim();if(!xe)return;const lt={label:xe,provider:Ae,modelId:st||void 0};if(G.some(br=>qa(br)===qa(lt)))return;const Ut=[...$,lt];B(Ut),h9(Yx,Ut),Pe(""),Oe("")}function ur(xe){const st=$.filter(lt=>qa(lt)!==qa(xe));B(st),h9(Yx,st)}function In(){const xe=Ve.trim();if(!xe||re.includes(xe))return;const st=[...L,xe];Y(st),c9(Wx,st),Ue("")}function vr(xe){const st=L.filter(lt=>lt!==xe);Y(st),c9(Wx,st)}async function Gn(xe){if(!(!xe||xe.length===0)){k(null);try{const st=await pF(xe[0]),lt=[st,...Re.filter(Ut=>Ut.name!==st.name)];Ne(lt),de(f9(st.url))}catch(st){k(st instanceof Error?st.message:"语音文件上传失败")}}}async function Yr(xe){k(null);try{await gF(xe);const st=Re.filter(lt=>lt.name!==xe);if(Ne(st),Jv(oe)){const lt=d9(oe);st.some(Ut=>Ut.url===lt)||de(Yl)}}catch(st){k(st instanceof Error?st.message:"语音文件删除失败")}}async function nr(){He("检测中..."),ot([]),Ze(0),Se(0),We(!0);try{const xe=async(nn,Qn=5e3)=>{const Ba=new AbortController,bl=window.setTimeout(()=>Ba.abort(),Qn);try{return await fetch(nn,{signal:Ba.signal})}finally{clearTimeout(bl)}},st=await xe(Be);if(!st.ok){He(`model3.json 不可访问(HTTP ${st.status})`),We(!1);return}const lt=await st.text();if(lt.trimStart().startsWith("<!doctype")||lt.trimStart().startsWith("<html")){He("路径命中的是前端页面而不是模型文件,请检查大小写和目录(当前应为 /live2D/...)"),We(!1);return}let Ut;try{Ut=JSON.parse(lt)}catch{He("model3.json 解析失败,请确认文件内容为合法 JSON"),We(!1);return}const br=Ut.FileReferences||{},hn=Be.slice(0,Be.lastIndexOf("/")+1),Ii=(br.Expressions||[]).map(nn=>nn.File).filter(Boolean),Zn=Object.values(br.Motions||{}).flatMap(nn=>nn.map(Qn=>Qn.File)).filter(Boolean),cr=[br.Moc,br.Physics,br.Pose,br.DisplayInfo,...br.Textures||[],...Ii,...Zn].filter(Boolean);Se(cr.length);const ds=[];let to=0;for(const nn of cr){const Qn=`${hn}${nn}`;(await xe(Qn)).ok?to+=1:ds.push(nn)}Ze(to),ds.length?(ot(ds),He(`模型不完整:共 ${cr.length} 个依赖,成功 ${to},缺失 ${ds.length}`)):He(`模型文件完整:共 ${cr.length} 个依赖,全部可访问`)}catch{He("检测失败,请检查路径或 JSON 格式")}finally{We(!1)}}return he.useEffect(()=>{nr()},[Be]),he.useEffect(()=>{async function xe(){var st,lt;if(Ke||!Be){De(null),ne("占位模式");return}ne("加载预览中..."),De(null);try{const Ut=await fetch(Be);if(!Ut.ok){ne(`预览加载失败(HTTP ${Ut.status})`);return}const hn=(lt=(st=(await Ut.json()).FileReferences)==null?void 0:st.Textures)==null?void 0:lt[0];if(!hn){ne("模型未提供贴图路径");return}const Zn=`${Be.slice(0,Be.lastIndexOf("/")+1)}${hn}`,cr=await fetch(Zn);if(!cr.ok){ne(`贴图不可访问(HTTP ${cr.status})`);return}De(Zn),ne("预览加载成功(当前为静态贴图预览)")}catch{ne("预览加载失败")}}xe()},[Be,Ke]),he.useEffect(()=>{let xe=!1;async function st(){if(Ke||!Be||!_.current||!w.current){ee(null),S.current&&(S.current.destroy(!0,{children:!0,texture:!1,baseTexture:!1}),S.current=null),w.current&&(w.current.innerHTML="");return}try{ee(null);const lt=_.current,Ut=w.current;if(!lt||!Ut)return;Ut.innerHTML="",window.PIXI=TQ;const br=new s3({autoStart:!0,resizeTo:lt,antialias:!0,backgroundAlpha:0});S.current=br,Ut.appendChild(br.view);const hn=await BP.from(Be);if(xe)return;br.stage.addChild(hn);const Ii=lt.clientWidth||640,Zn=lt.clientHeight||220,cr=Math.min(Ii*.95/hn.width,Zn*1.12/hn.height);hn.scale.set(cr),hn.anchor.set(.5,1),hn.x=Ii/2,hn.y=Zn+18}catch(lt){const Ut=lt instanceof Error?lt.message:"Live2D 加载失败";ee(Ut)}}return st(),()=>{xe=!0}},[Be,Ke,ce]),N.jsxs("div",{className:"grid",children:[N.jsx("div",{className:"col-6",children:N.jsxs("div",{className:"card",style:{height:"100%"},children:[N.jsx("div",{className:"card-header",children:N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"学习交流区"})}),N.jsxs("div",{className:"card-body",style:{display:"flex",flexDirection:"column",gap:10,minHeight:640},children:[N.jsx("div",{ref:m,style:{flex:1,maxHeight:360,border:"1px solid #e5e7eb",borderRadius:12,padding:10,overflowY:"auto",background:"#fafafa"},children:P.length===0?N.jsx("div",{className:"muted",style:{fontSize:13},children:"开始提问后,这里会显示你和 AI 的对话记录。"}):P.map((xe,st)=>N.jsxs("div",{style:{marginBottom:8,padding:"8px 10px",borderRadius:10,background:xe.role==="assistant"?"#eef2ff":"#ffffff",border:"1px solid #e5e7eb"},children:[N.jsx("div",{style:{fontSize:12,color:"#6b7280",marginBottom:4},children:xe.role==="assistant"?"AI":"我"}),N.jsx("div",{style:{wordBreak:"break-word"},children:xe.role==="assistant"?N.jsx($se,{text:xe.content}):N.jsx("span",{style:{whiteSpace:"pre-wrap",lineHeight:1.45},children:xe.content})})]},`${xe.role}-${st}`))}),N.jsxs("div",{style:{borderTop:"1px solid #e5e7eb",paddingTop:10},children:[N.jsxs("div",{className:"row",style:{marginBottom:8},children:[N.jsx("div",{style:{flex:1},children:N.jsxs("div",{className:"row",style:{gap:8,flexWrap:"nowrap"},children:[N.jsxs("div",{style:{flex:1},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"年级"}),N.jsx("select",{className:"select",value:l,onChange:xe=>c(xe.target.value),children:o.map(xe=>N.jsx("option",{value:xe,children:xe},xe))})]}),N.jsxs("div",{style:{flex:1},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"类别"}),N.jsx("select",{className:"select",value:h,onChange:xe=>d(xe.target.value),children:Object.keys((a==null?void 0:a[l])||{}).map(xe=>N.jsx("option",{value:xe,children:xe},xe))})]}),N.jsxs("div",{style:{flex:1.2},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"具体知识点"}),N.jsx("select",{className:"select",value:v,onChange:xe=>g(xe.target.value),children:(((Wr=a==null?void 0:a[l])==null?void 0:Wr[h])||[]).map(xe=>N.jsx("option",{value:xe.code,children:xe.name},xe.code))})]})]})}),N.jsxs("label",{className:"row",style:{gap:6,marginTop:20},children:[N.jsx("input",{type:"checkbox",checked:ye,onChange:xe=>Ee(xe.target.checked)}),N.jsx("span",{className:"muted",style:{fontSize:12},children:"语音回复"})]})]}),N.jsxs("div",{className:"muted",style:{fontSize:12,marginBottom:8},children:["知识点编码:",A]}),N.jsx("textarea",{className:"textarea",value:M,onChange:xe=>E(xe.target.value),placeholder:"输入你想问的问题..."}),N.jsxs("div",{className:"row",style:{marginTop:8,justifyContent:"space-between",flexWrap:"nowrap",alignItems:"center",gap:8},children:[N.jsxs("span",{className:"mono",style:{fontSize:12,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["session_id: ",O??"(新会话)"]}),N.jsxs("div",{className:"row",style:{gap:8,marginLeft:"auto",flexShrink:0},children:[N.jsx("button",{className:"btn",onClick:Qt,disabled:!X&&!O,children:"终止对话"}),N.jsx("button",{className:"btn primary",onClick:Vt,disabled:X||!M.trim(),children:X?"思考中...":"发送"})]})]}),U?N.jsxs("div",{className:"muted",style:{marginTop:8,fontSize:12},children:["本地语音状态:",U]}):null,I?N.jsx("div",{className:"error",style:{marginTop:8},children:I}):null]})]})]})}),N.jsx("div",{className:"col-6",children:N.jsxs("div",{className:"card",style:{height:"100%"},children:[N.jsxs("div",{className:"card-header",children:[N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"数字人形象与模型配置"}),N.jsx("div",{className:"muted",style:{marginTop:6},children:"大模型切换、形象切换、Live2D 展示"})]}),N.jsxs("div",{className:"card-body",style:{display:"flex",flexDirection:"column",gap:12,minHeight:640},children:[N.jsxs("div",{className:"row",style:{gap:10},children:[N.jsxs("div",{style:{flex:1},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"大语言模型"}),N.jsx("select",{className:"select",value:ie,onChange:xe=>le(xe.target.value),children:G.map(xe=>N.jsx("option",{value:qa(xe),children:xe.label},qa(xe)))})]}),N.jsxs("div",{style:{flex:1},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"数字人形象(Live2D)"}),N.jsx("select",{className:"select",value:ce,onChange:xe=>_e(xe.target.value),children:re.map(xe=>N.jsx("option",{value:xe,children:xe},xe))})]}),N.jsxs("div",{style:{flex:1},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"语音选择"}),N.jsxs("select",{className:"select",value:oe,onChange:xe=>de(xe.target.value),children:[N.jsx("option",{value:Yl,children:Yl}),Re.map(xe=>N.jsxs("option",{value:f9(xe.url),children:["文件:",xe.name]},`asset-${xe.name}`)),pe.map(xe=>N.jsxs("option",{value:xe.name,children:["系统:",xe.name,"(",xe.lang,")"]},`${xe.name}-${xe.lang}`))]})]})]}),N.jsxs("div",{ref:_,style:{border:"1px solid #e5e7eb",borderRadius:12,minHeight:520,position:"relative",overflow:"hidden",background:"linear-gradient(180deg, #f9fafb, #eef2ff)"},children:[N.jsx("div",{ref:w,style:{position:"absolute",inset:0}}),N.jsx("div",{style:{position:"absolute",left:10,bottom:10,right:10,textAlign:"center",pointerEvents:"none"},children:!Ke&&!be&&nt?null:N.jsxs(N.Fragment,{children:[nt&&!Ke?N.jsx("img",{src:nt,alt:ce,style:{maxHeight:420,maxWidth:"100%",objectFit:"contain",borderRadius:10}}):N.jsx("div",{style:{fontSize:50},children:Ke?"🤖":"🧩"}),N.jsx("div",{style:{fontWeight:700,marginTop:6},children:ce}),N.jsx("div",{className:"muted",style:{fontSize:12,marginTop:4},children:Ke?"当前为占位模式":`当前模型:${Be}`}),N.jsx("div",{className:"muted",style:{fontSize:12,marginTop:2},children:Q}),be?N.jsx("div",{className:"error",style:{marginTop:8,pointerEvents:"auto"},children:be}):null]})})]}),je?N.jsxs("div",{style:{border:"1px dashed #c7d2fe",borderRadius:10,padding:10,background:"#f8faff"},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:8},children:"教师端:模型/形象管理与测试加载器"}),N.jsxs("div",{className:"row",style:{alignItems:"flex-end",gap:8},children:[N.jsxs("div",{style:{flex:1},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:4},children:"新增大语言模型名称"}),N.jsx("input",{className:"input",value:se,onChange:xe=>Pe(xe.target.value),placeholder:"如:DeepSeek Chat 教学版"})]}),N.jsxs("div",{style:{width:120},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:4},children:"Provider"}),N.jsxs("select",{className:"select",value:Ae,onChange:xe=>Ge(K3(xe.target.value)),children:[N.jsx("option",{value:"deepseek",children:"deepseek"}),N.jsx("option",{value:"openai",children:"openai"}),N.jsx("option",{value:"qwen",children:"qwen"}),N.jsx("option",{value:"custom",children:"custom"})]})]}),N.jsxs("div",{style:{flex:1},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:4},children:"Model ID"}),N.jsx("input",{className:"input",value:J,onChange:xe=>Oe(xe.target.value),placeholder:"如:deepseek-chat"})]}),N.jsx("button",{className:"btn",onClick:rr,children:"上传/添加模型"})]}),N.jsx("div",{className:"row",style:{marginTop:6,gap:6},children:$.map(xe=>N.jsxs("button",{className:"btn danger",onClick:()=>ur(xe),children:["删除模型:",xe.label,"(",xe.provider,xe.modelId?`/${xe.modelId}`:"",")"]},qa(xe)))}),N.jsxs("div",{className:"row",style:{alignItems:"flex-end",gap:8,marginTop:8},children:[N.jsxs("div",{style:{flex:1},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:4},children:"新增数字人形象名称"}),N.jsx("input",{className:"input",value:Ve,onChange:xe=>Ue(xe.target.value),placeholder:"如:Live2D 校园助手C"})]}),N.jsx("button",{className:"btn",onClick:In,children:"上传/添加形象"})]}),N.jsx("div",{className:"row",style:{marginTop:6,gap:6},children:L.map(xe=>N.jsxs("button",{className:"btn danger",onClick:()=>vr(xe),children:["删除形象:",xe]},xe))}),N.jsxs("div",{style:{marginTop:10,borderTop:"1px solid #dbe2ff",paddingTop:10},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"语音文件管理(教师端)"}),N.jsx("input",{className:"input",type:"file",accept:".wav,.mp3,.m4a,.ogg",onChange:xe=>Gn(xe.target.files)}),N.jsx("div",{className:"row",style:{marginTop:6,gap:6},children:Re.map(xe=>N.jsxs("button",{className:"btn danger",onClick:()=>Yr(xe.name),children:["删除语音:",xe.name]},xe.name))})]}),N.jsxs("div",{style:{marginTop:10,borderTop:"1px solid #dbe2ff",paddingTop:10},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"Live2D 测试加载器(教师端)"}),N.jsx("select",{className:"select",value:Be,onChange:xe=>$e(xe.target.value),style:{marginBottom:8},children:Vse.map(xe=>N.jsx("option",{value:xe,children:xe},xe))}),N.jsxs("div",{className:"row",style:{marginTop:8,justifyContent:"space-between"},children:[N.jsxs("label",{className:"row",style:{gap:6},children:[N.jsx("input",{type:"checkbox",checked:Ke,onChange:xe=>rt(xe.target.checked)}),N.jsx("span",{className:"muted",style:{fontSize:12},children:"占位模式"})]}),N.jsx("button",{className:"btn",onClick:nr,disabled:ke,children:ke?"检测中...":"检测模型文件"})]}),N.jsx("div",{className:"muted",style:{fontSize:12,marginTop:6},children:Ye}),N.jsxs("div",{className:"muted",style:{fontSize:12,marginTop:4},children:["已验证依赖:",ct,"/",bt]}),tt.length?N.jsxs("div",{className:"error",style:{marginTop:8},children:["缺失文件:",tt.join(",")]}):null]})]}):null]})]})})]})}const Zse={选择:"选择题",填空:"填空题",计算:"计算题",判断:"判断题"};function Qse(r){const e=(r||"").trim();return e?Zse[e]||e:"未标注"}function Jse(r,e){const t=Object.fromEntries(e.map(i=>[i.id,i])),n=[...r].sort((i,a)=>Date.parse(a.created_at)-Date.parse(i.created_at)).slice(0,50).map(i=>{var o;const a=((o=t[i.exercise_id])==null?void 0:o.title)||`题目 ${String(i.exercise_id).slice(0,8)}…`,s=i.is_correct===!0?"正确":i.is_correct===!1?"错误":"待判定";return`${a} — ${s}`});return n.length?n.join(`
  1989. `):"暂无作答记录"}function eoe(){var Q;const{role:r}=bu(),e=r==="teacher",t=Object.keys(Uo)[0]||"",n=Object.keys(Uo[t]||{})[0]||"",[i,a]=he.useState(Uo),s=Object.keys(i||{}),[o,l]=he.useState(t),c=Object.keys((i==null?void 0:i[o])||{}),[h,d]=he.useState(n),v=((Q=i==null?void 0:i[o])==null?void 0:Q[h])||[],[g,m]=he.useState([]),[x,y]=he.useState(""),[_,w]=he.useState("解一元一次方程"),[S,A]=he.useState("解方程:2x + 3 = 11。"),[C,M]=he.useState("选择"),[E,O]=he.useState(""),[D,I]=he.useState(""),[k,U]=he.useState(2),[V,X]=he.useState([]),[W,P]=he.useState(""),[H,z]=he.useState({}),[$,B]=he.useState(null),[L,Y]=he.useState(""),[G,re]=he.useState({}),[ie,le]=he.useState(!1),[ce,_e]=he.useState(!1),[pe,ae]=he.useState(null),[oe,de]=he.useState(null),[ye,Ee]=he.useState(null),[Re,Ne]=he.useState(!1),[Be,$e]=he.useState({}),[Ye,He]=he.useState(10),tt=he.useMemo(()=>{var be;const ne={};for(const ee of Object.keys(i||{}))for(const se of Object.keys((i==null?void 0:i[ee])||{}))for(const Pe of((be=i==null?void 0:i[ee])==null?void 0:be[se])||[])ne[Pe.code]=Pe.name;return ne},[i]);function ot(ne){m(be=>be.includes(ne)?be.filter(ee=>ee!==ne):be)}async function ct(){ae(null);try{const ne=await bF(x||void 0);X(ne),ne.length&&!W&&P(ne[0].id),$e({}),re({}),le(!1),_e(!1)}catch(ne){ae(ne instanceof Error?ne.message:"加载题目失败")}}function Ze(ne,be){const ee=new Set(ne.map(J=>J.id)),se=be.filter(J=>ee.has(J.exercise_id)),Pe=[...se].sort((J,Oe)=>Date.parse(J.created_at)-Date.parse(Oe.created_at)),Ae={};for(const J of Pe)Ae[J.exercise_id]=J;re(Ae);const Ge=new Set(se.map(J=>J.exercise_id)).size;le(ne.length>0&&Ge>=ne.length)}he.useEffect(()=>{const ne=Object.keys((i==null?void 0:i[o])||{});!ne.includes(h)&&ne[0]&&d(ne[0])},[i,o,h]),he.useEffect(()=>{y(g.length?g.join(","):"")},[g]),he.useEffect(()=>{ct()},[]),he.useEffect(()=>{H_().then(ne=>{ne&&Object.keys(ne).length&&a(ne)}).catch(()=>{})},[]),he.useEffect(()=>{r==="student"&&z(ne=>{const be={};for(const ee of V)be[ee.id]=ne[ee.id]??"";return be})},[V,r]);async function bt(ne,be,ee){var se;ae(null),de(null),Ne(!0);try{const Pe=await mF(ne,be,ee,ee==="topic_weight"?{knowledge_grade:o,knowledge_category:h}:void 0),Ae={},Ge=[],J=new Set;for(const Ue of Pe.items){const je=Ue.item_ref;J.has(je)||(J.add(je),Ae[je]=Ue.reason||"",Ge.push(je))}const Oe=await xF(Ge);if(Oe.length!==Ge.length)throw new Error(`组卷成功但仅加载 ${Oe.length}/${Ge.length} 道题目,请刷新后重试`);X(Oe),Oe.length&&P(Oe[0].id),z(Object.fromEntries(Oe.map(Ue=>[Ue.id,""]))),re({}),le(!1),_e(!1);const Ve=(se=Oe[0])==null?void 0:se.knowledge_code;Ve&&y(Ve),$e(Ae),B(null),Y("")}catch(Pe){ae(Pe instanceof Error?Pe.message:"获取推荐失败")}finally{Ne(!1)}}function Se(){if(g.length)return g.join(",")}function ke(){const Pe=`title,body,knowledge_code,difficulty,question_type,correct_answer,resolution
  1990. "解方程","解下列方程:2x+3=9","J7-EQ-001",1,"计算","x=3",""
  1991. "应用题","某数加4后等于10,求该数","J7-EQ-001",2,"填空","6",""
  1992. "判断","下列说法是否正确:0 是正数。","J7-EQ-001",1,"判断","错",""
  1993. `,Ae=new Blob([Pe],{type:"text/csv;charset=utf-8;"}),Ge=URL.createObjectURL(Ae),J=document.createElement("a");J.href=Ge,J.download="exercise_import_template.csv",J.click(),URL.revokeObjectURL(Ge)}async function We(){if(ae(null),de(null),!ye){ae("请先选择 CSV 或 JSON 文件");return}Ne(!0);try{const ne=await hF(ye,x||void 0);await ct(),de(`导入完成:成功 ${ne.created} 条,跳过 ${ne.skipped} 条`)}catch(ne){ae(ne instanceof Error?ne.message:"上传失败(需要 teacher 权限)")}finally{Ne(!1)}}async function Ke(){if(ae(null),de(null),!ye){ae("请先选择 CSV 或 JSON 文件");return}Ne(!0);try{const ne=await fF(ye,x||void 0);de(`预览完成:可导入 ${ne.valid} 条,不合格 ${ne.invalid} 条`)}catch(ne){ae(ne instanceof Error?ne.message:"预览失败(需要 teacher 权限)")}finally{Ne(!1)}}async function rt(){ae(null),de(null),Ne(!0);try{await yF({title:_,body:S,knowledge_code:x,difficulty:k,question_type:C,correct_answer:E,resolution:D}),await ct()}catch(ne){ae(ne instanceof Error?ne.message:"创建失败(需要teacher权限)")}finally{Ne(!1)}}async function nt(){if(V.length){ae(null),B(null),Ne(!0);try{for(const J of V)await _F(J.id,H[J.id]??"");const ne=await JT();Ze(V,ne),_e(!0);const be=new Set(V.map(J=>J.id)),ee=[...ne].filter(J=>be.has(J.exercise_id)).sort((J,Oe)=>Date.parse(J.created_at)-Date.parse(Oe.created_at)),se={};for(const J of ee)se[J.exercise_id]=J;let Pe=0,Ae=0,Ge=0;for(const J of V){const Oe=se[J.id];Oe?Oe.is_correct===!0?Pe+=1:Oe.is_correct===!1?Ae+=1:Ge+=1:Ge+=1}B({kind:"batch",correct:Pe,wrong:Ae,pending:Ge,total:V.length})}catch(ne){ae(ne instanceof Error?ne.message:"提交失败")}finally{Ne(!1)}}}async function De(){ae(null),Ne(!0);try{const ne=await JT();Ze(V,ne),Y(Jse(ne,V))}catch(ne){ae(ne instanceof Error?ne.message:"加载失败")}finally{Ne(!1)}}return N.jsxs("div",{className:"grid",children:[N.jsx("div",{className:e?"col-12":"col-5",children:N.jsxs("div",{className:"card",children:[N.jsxs("div",{className:"card-header",children:[N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"试卷规划"}),N.jsx("div",{className:"muted",style:{marginTop:6},children:e?"题目创建(教师)":null})]}),N.jsxs("div",{className:"card-body",children:[N.jsxs("div",{className:"grid",children:[N.jsxs("div",{className:"col-12",children:[N.jsxs("div",{className:"row",style:{gap:8,alignItems:"flex-start"},children:[N.jsxs("div",{style:{flex:1,minWidth:0},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"年级"}),N.jsx("select",{className:"select",value:o,onChange:ne=>l(ne.target.value),children:s.map(ne=>N.jsx("option",{value:ne,children:ne},ne))})]}),N.jsxs("div",{style:{flex:1,minWidth:0},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"类别"}),N.jsx("select",{className:"select",value:h,onChange:ne=>d(ne.target.value),children:c.map(ne=>N.jsx("option",{value:ne,children:ne},ne))})]})]}),N.jsxs("div",{style:{border:"1px solid #e5e7eb",borderRadius:12,padding:12,background:"#fff",marginTop:12},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"具体知识点(多选,作为题目内容)"}),N.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr",gap:8},children:v.map(ne=>{const be=g.includes(ne.code);return N.jsxs("label",{style:{display:"flex",flexDirection:"row",alignItems:"flex-start",gap:10,cursor:"pointer",width:"100%",flexWrap:"nowrap"},children:[N.jsx("input",{type:"checkbox",checked:be,style:{flexShrink:0,width:16,height:16,marginTop:2},onChange:ee=>{if(ee.target.checked){m(Pe=>Pe.includes(ne.code)?Pe:[...Pe,ne.code]);return}m(Pe=>Pe.includes(ne.code)?Pe.filter(Ae=>Ae!==ne.code):Pe)}}),N.jsxs("span",{className:"muted",style:{fontSize:12,flex:1,minWidth:0,lineHeight:1.45,wordBreak:"break-word",overflowWrap:"anywhere"},children:[ne.name,"(",ne.code,")"]})]},ne.code)})})]}),N.jsxs("div",{style:{border:"1px solid #e5e7eb",borderRadius:12,padding:12,background:"#fff",marginTop:12},children:[N.jsxs("div",{className:"row",style:{justifyContent:"space-between",alignItems:"center",gap:10},children:[N.jsx("div",{className:"muted",style:{fontSize:12},children:"已选择知识点"}),g.length?N.jsxs("div",{className:"muted",style:{fontSize:12},children:[g.length," 个"]}):null]}),g.length?N.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:8,marginTop:10},children:g.map(ne=>N.jsxs("button",{className:"btn",type:"button",style:{padding:"6px 10px",lineHeight:"20px",borderRadius:999},onClick:()=>ot(ne),title:"点击移除该知识点",children:[tt[ne]?`${tt[ne]}(${ne})`:ne," ×"]},ne))}):N.jsx("div",{className:"muted",style:{fontSize:12,marginTop:10},children:"暂无"})]})]}),r==="student"?N.jsx("div",{className:"col-12",style:{marginTop:10},children:N.jsxs("div",{className:"row",style:{alignItems:"center",gap:8,flexWrap:"nowrap"},children:[N.jsx("span",{className:"muted",style:{fontSize:12},children:"试卷题数"}),N.jsx("input",{className:"input",style:{width:120},type:"number",min:1,max:50,value:Ye,onChange:ne=>He(Number(ne.target.value))}),N.jsx("button",{className:"btn primary",onClick:()=>bt(Se(),Ye,"topic_weight"),disabled:Re||!g.length,children:"开始组卷"}),N.jsx("button",{className:"btn",onClick:()=>bt(void 0,Ye,"personalized"),disabled:Re,children:"个性推荐组卷"})]})}):null,e?N.jsxs(N.Fragment,{children:[N.jsxs("div",{className:"col-12",children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"题目类型"}),N.jsxs("select",{className:"select",value:C,onChange:ne=>M(ne.target.value),children:[N.jsx("option",{value:"选择",children:"选择题"}),N.jsx("option",{value:"填空",children:"填空题"}),N.jsx("option",{value:"计算",children:"计算题"}),N.jsx("option",{value:"判断",children:"判断题"})]})]}),N.jsxs("div",{className:"col-12",children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"题目标题"}),N.jsx("input",{className:"input",value:_,onChange:ne=>w(ne.target.value)})]}),N.jsxs("div",{className:"col-12",children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"题干"}),N.jsx("textarea",{className:"textarea",value:S,onChange:ne=>A(ne.target.value)})]}),N.jsxs("div",{className:"col-12",children:[N.jsxs("div",{className:"muted",style:{fontSize:12,marginBottom:6,display:"flex",alignItems:"baseline",gap:8,flexWrap:"wrap"},children:[N.jsx("span",{children:"正确答案"}),N.jsx("span",{style:{fontWeight:400},children:"如果有多个答案可用 / 分割"})]}),N.jsx("textarea",{className:"textarea",value:E,onChange:ne=>O(ne.target.value),placeholder:"用于判分与错题解析(可输入多个备选,用 / 或换行、| 分隔)"})]}),N.jsxs("div",{className:"col-12",children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"题目解析"}),N.jsx("textarea",{className:"textarea",value:D,onChange:ne=>I(ne.target.value),placeholder:"学生答错后,在“全部作答完”后显示解析"})]}),N.jsxs("div",{className:"col-12",children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"难度(1-5)"}),N.jsx("input",{className:"input",type:"number",min:1,max:5,value:k,onChange:ne=>U(Number(ne.target.value))})]})]}):null,N.jsx("div",{className:"col-12 row",children:e?N.jsxs(N.Fragment,{children:[N.jsx("button",{className:"btn primary",onClick:rt,disabled:Re,children:"创建题目(teacher)"}),N.jsx("button",{className:"btn",onClick:ct,disabled:Re,style:{marginLeft:8},children:"刷新题目列表"})]}):null})]}),pe?N.jsx("div",{className:"error",style:{marginTop:12},children:pe}):null,oe?N.jsx("div",{className:"success",style:{marginTop:12},children:oe}):null]})]})}),e?N.jsx("div",{className:"col-12",children:N.jsxs("div",{className:"card",children:[N.jsxs("div",{className:"card-header",children:[N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"题目上传导入"}),N.jsx("div",{className:"muted",style:{marginTop:6},children:"支持模板下载、预览校验、批量导入到题库"})]}),N.jsxs("div",{className:"card-body",style:{display:"flex",flexDirection:"column",gap:10},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"上传文件(CSV/JSON)"}),N.jsx("input",{className:"input",type:"file",accept:".csv,.json,application/json,text/csv",onChange:ne=>{var be;return Ee(((be=ne.target.files)==null?void 0:be[0])??null)}}),N.jsx("div",{className:"muted",style:{fontSize:12},children:"CSV 列名:title, body, knowledge_code, difficulty;可选 question_type(选择/填空/计算/判断), correct_answer, resolution。若文件缺少 knowledge_code,会使用上方勾选知识点对应的编码(多选时为逗号拼接)。"}),N.jsx("div",{style:{marginTop:8,display:"flex",justifyContent:"flex-end"},children:N.jsxs("div",{className:"row",style:{gap:8,alignItems:"center",flexWrap:"wrap"},children:[N.jsx("button",{className:"btn",type:"button",onClick:ke,disabled:Re,children:"下载CSV模板"}),N.jsx("button",{className:"btn",type:"button",onClick:Ke,disabled:Re,children:"预览校验"}),N.jsx("button",{className:"btn primary",type:"button",onClick:We,disabled:Re,children:"上传并导入题目"})]})})]})]})}):null,r==="student"?N.jsx("div",{className:"col-7",children:N.jsxs("div",{className:"card",children:[N.jsxs("div",{className:"card-header",children:[N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"作答"}),null]}),N.jsxs("div",{className:"card-body",children:[V.length?N.jsx("div",{style:{maxHeight:"min(70vh, 780px)",overflowY:"auto",paddingRight:6,marginBottom:12},children:V.map((ne,be)=>{const ee=G[ne.id],se=ce&&ie&&ee&&ee.is_correct===!1,Pe=ce&&ie&&ee&&ee.is_correct===!0,Ae=ce&&ie&&ee&&ee.is_correct!==!0&&ee.is_correct!==!1;return N.jsxs("div",{className:"card",style:{padding:12,borderRadius:12,marginBottom:12,border:"1px solid #e5e7eb"},children:[N.jsxs("div",{className:"muted",style:{fontSize:11,marginBottom:6},children:["第 ",be+1," 题 / 共 ",V.length," 题"]}),N.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:8,flexWrap:"wrap"},children:[N.jsx("span",{style:{fontWeight:700},children:ne.title}),N.jsx("span",{className:"pill",style:{fontSize:12,fontWeight:600},children:Qse(ne.question_type)})]}),N.jsx("div",{className:"muted",style:{marginTop:8,whiteSpace:"pre-wrap"},children:ne.body}),Be[ne.id]?N.jsxs("div",{className:"muted",style:{marginTop:8,fontSize:12},children:["推荐原因:",Be[ne.id]]}):null,N.jsxs("div",{style:{marginTop:10},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"你的答案"}),N.jsx("input",{className:"input",value:H[ne.id]??"",onChange:Ge=>z(J=>({...J,[ne.id]:Ge.target.value})),disabled:Re})]}),Ae?N.jsx("div",{className:"muted",style:{marginTop:8,fontSize:12,fontWeight:600},children:"本题:待判定"}):null,Pe?N.jsxs("div",{style:{marginTop:10,padding:12,borderRadius:10,border:"1px solid #bbf7d0",background:"#f0fdf4",boxSizing:"border-box"},children:[N.jsx("div",{style:{fontSize:12,fontWeight:700,color:"#166534",marginBottom:6},children:"作答正确"}),N.jsx("div",{style:{fontSize:13,color:"#1f2937",lineHeight:1.45},children:"本题回答正确。"})]}):null,se?N.jsxs("div",{style:{marginTop:10,padding:12,borderRadius:10,border:"1px solid #fecaca",background:"#fef2f2",boxSizing:"border-box"},children:[N.jsx("div",{style:{fontSize:12,fontWeight:700,color:"#b91c1c",marginBottom:8},children:"本题有误 · 参考答案与解析"}),N.jsxs("div",{style:{fontSize:13,whiteSpace:"pre-wrap",color:"#1f2937",lineHeight:1.45},children:[N.jsxs("div",{children:[N.jsx("span",{style:{color:"#991b1b",fontWeight:600},children:"正确答案:"}),(ne.correct_answer||"").trim()||"(未单独录入,请见题干)"]}),N.jsxs("div",{style:{marginTop:8},children:[N.jsx("span",{style:{color:"#991b1b",fontWeight:600},children:"解析:"}),(ne.resolution||"").trim()||"暂无"]})]})]}):null]},ne.id)})}):N.jsx("div",{className:"muted",style:{marginBottom:10},children:"请先在左侧组卷(开始组卷 / 个性推荐组卷)。"}),N.jsxs("div",{className:"row",style:{flexWrap:"wrap",gap:8},children:[N.jsx("button",{className:"btn primary",onClick:nt,disabled:Re||!V.length,children:"提交整卷作答"}),N.jsx("button",{className:"btn",onClick:De,disabled:Re,children:"查看我的作答记录"})]}),$?N.jsx("div",{style:{marginTop:12},children:$.kind==="batch"?N.jsxs("div",{className:"success",style:{padding:12,borderRadius:10},children:["已提交整卷共 ",$.total," 题:答对 ",$.correct,",答错 ",$.wrong,$.pending?`,待判定 ${$.pending}`:"","。错题解析已在各题下方显示。"]}):N.jsx("div",{className:"muted",style:{fontSize:13},children:$.message})}):null,L?N.jsxs("div",{style:{marginTop:12},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"作答记录(最近 50 条)"}),N.jsx("pre",{style:{margin:0,whiteSpace:"pre-wrap",fontSize:13,fontFamily:"inherit"},children:L})]}):null]})]})}):null]})}function toe(){const r=yu(),{role:e,loading:t}=bu();return he.useEffect(()=>{t||r(e==="teacher"?"/analytics/teacher":"/analytics/student",{replace:!0})},[t,e,r]),N.jsx("div",{className:"grid",children:N.jsx("div",{className:"col-12",children:N.jsxs("div",{className:"card",children:[N.jsxs("div",{className:"card-header",children:[N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"学情统计"}),N.jsx("div",{className:"muted",style:{marginTop:6},children:"跳转中..."})]}),N.jsx("div",{className:"card-body",children:N.jsx("div",{className:"muted",children:"根据当前角色自动跳转到学生/教师页面。"})})]})})})}const ul=["#3b82f6","#60a5fa","#2563eb","#93c5fd","#1d4ed8","#38bdf8","#0ea5e9"];function Hd(r){return`${(r*100).toFixed(1)}%`}function Kg(r,e){return r.length>e?`${r.slice(0,e)}…`:r}function roe({rows:r,kind:e}){return r.length?e==="pie"?N.jsx(TN,{rows:r,mode:"attempts"}):e==="line"?N.jsx(ioe,{rows:r}):N.jsx(noe,{rows:r}):N.jsx("div",{className:"muted",children:"暂无统计数据。"})}function noe({rows:r}){const a=Math.min(48,Math.max(24,516/r.length-12)),s=Math.max(320,44+r.length*(a+12)+24);return N.jsxs("div",{children:[N.jsx("div",{style:{overflowX:"auto"},children:N.jsxs("svg",{width:s,height:288,style:{display:"block",minWidth:"100%"},children:[[0,25,50,75,100].map(l=>{const c=216-l/100*200;return N.jsxs("g",{children:[N.jsx("line",{x1:44,y1:c,x2:s-12,y2:c,stroke:"#e5e7eb",strokeWidth:1}),N.jsxs("text",{x:38,y:c+4,textAnchor:"end",fontSize:10,fill:"#6b7280",children:[l,"%"]})]},l)}),r.map((l,c)=>{const h=44+c*(a+12),d=Math.max(0,Math.min(1,l.accuracy))*200,v=216-d;return N.jsxs("g",{children:[N.jsx("rect",{x:h,y:v,width:a,height:d,rx:4,fill:ul[c%ul.length]}),N.jsx("text",{x:h+a/2,y:v-4,textAnchor:"middle",fontSize:10,fill:"#374151",children:Hd(l.accuracy)}),N.jsx("text",{x:h+a/2,y:230,textAnchor:"middle",fontSize:11,fill:"#374151",children:Kg(l.label,8)})]},`${l.label}-${c}`)}),N.jsx("text",{x:44,y:12,fontSize:11,fill:"#6b7280",children:"正确率"})]})}),N.jsx(CN,{rows:r})]})}function ioe({rows:r}){const a=Math.max(40,516/Math.max(1,r.length-1)),s=Math.max(320,44+(r.length-1)*a+40),o=288,l=r.map((h,d)=>{const v=44+d*a,g=216-Math.max(0,Math.min(1,h.accuracy))*200;return{x:v,y:g,row:h}}),c=l.map(h=>`${h.x},${h.y}`).join(" ");return N.jsxs("div",{children:[N.jsx("div",{style:{overflowX:"auto"},children:N.jsxs("svg",{width:s,height:o,style:{display:"block"},children:[[0,25,50,75,100].map(h=>{const d=216-h/100*200;return N.jsxs("g",{children:[N.jsx("line",{x1:44,y1:d,x2:s-12,y2:d,stroke:"#e5e7eb",strokeWidth:1}),N.jsxs("text",{x:38,y:d+4,textAnchor:"end",fontSize:10,fill:"#6b7280",children:[h,"%"]})]},h)}),N.jsx("polyline",{points:c,fill:"none",stroke:"#3b82f6",strokeWidth:2.5,strokeLinejoin:"round",strokeLinecap:"round"}),l.map((h,d)=>N.jsxs("g",{children:[N.jsx("circle",{cx:h.x,cy:h.y,r:5,fill:"#3b82f6",stroke:"#fff",strokeWidth:2}),N.jsx("text",{x:h.x,y:h.y-10,textAnchor:"middle",fontSize:10,fill:"#374151",children:Hd(h.row.accuracy)}),N.jsx("text",{x:h.x,y:230,textAnchor:"middle",fontSize:11,fill:"#374151",children:Kg(h.row.label,8)})]},d))]})}),N.jsx(CN,{rows:r})]})}function aoe({rows:r,valueLabel:e="错题次数"}){if(!r.length)return N.jsx("div",{className:"muted",children:"暂无统计数据。"});const t=r.map(v=>v.wrong||v.attempts),n=Math.max(1,...t),i=44,a=72,s=16,o=200,l=Math.min(48,Math.max(24,(560-i)/r.length-12)),c=Math.max(320,i+r.length*(l+12)+24),h=s+o+a,d=[0,Math.round(n*.25),Math.round(n*.5),Math.round(n*.75),n].filter((v,g,m)=>m.indexOf(v)===g);return N.jsxs("div",{children:[N.jsx("div",{style:{overflowX:"auto"},children:N.jsxs("svg",{width:c,height:h,style:{display:"block",minWidth:"100%"},children:[d.map(v=>{const g=s+o-v/n*o;return N.jsxs("g",{children:[N.jsx("line",{x1:i,y1:g,x2:c-12,y2:g,stroke:"#e5e7eb",strokeWidth:1}),N.jsx("text",{x:i-6,y:g+4,textAnchor:"end",fontSize:10,fill:"#6b7280",children:v})]},v)}),r.map((v,g)=>{const m=v.wrong||v.attempts,x=i+g*(l+12),y=m/n*o,_=s+o-y;return N.jsxs("g",{children:[N.jsx("rect",{x,y:_,width:l,height:y,rx:4,fill:ul[g%ul.length]}),N.jsx("text",{x:x+l/2,y:_-4,textAnchor:"middle",fontSize:10,fill:"#374151",children:m}),N.jsx("text",{x:x+l/2,y:s+o+14,textAnchor:"middle",fontSize:11,fill:"#374151",children:Kg(v.label,10)})]},`${v.label}-${g}`)}),N.jsx("text",{x:i,y:12,fontSize:11,fill:"#6b7280",children:e})]})}),N.jsx("div",{style:{marginTop:12,fontSize:12,color:"#6b7280"},children:r.map((v,g)=>N.jsxs("div",{style:{marginBottom:6},children:[N.jsx("span",{style:{fontWeight:600,color:"#374151"},children:v.label}),N.jsxs("span",{children:[" — 错题 ",v.wrong||v.attempts," 次"]})]},`${v.label}-${g}`))})]})}function soe({rows:r}){if(!r.length)return N.jsx("div",{className:"muted",children:"暂无统计数据。"});const e=[...r].sort((l,c)=>c.accuracy-l.accuracy||c.attempts-l.attempts),t=108,n=420,i=40,s=t+n+52,o=e.length*i+8;return N.jsx("div",{style:{overflowY:"auto",maxHeight:520},children:N.jsx("svg",{width:s,height:o,style:{display:"block",minWidth:"100%"},children:e.map((l,c)=>{const h=c*i+8,d=Math.max(0,Math.min(1,l.accuracy)),v=d*n,g=l.attempts>0;return N.jsxs("g",{children:[N.jsx("text",{x:t-8,y:h+22,textAnchor:"end",fontSize:12,fill:"#374151",fontWeight:600,children:Kg(l.label,12)}),N.jsx("rect",{x:t,y:h+12,width:n,height:16,rx:8,fill:"#e5e7eb"}),N.jsx("rect",{x:t,y:h+12,width:g?Math.max(4,v):0,height:16,rx:8,fill:g?ul[c%ul.length]:"#d1d5db"}),N.jsx("text",{x:t+n+8,y:h+24,fontSize:11,fill:"#374151",children:g?Hd(d):"暂无作答"}),g?N.jsxs("text",{x:t,y:h+8,fontSize:10,fill:"#6b7280",children:["作答 ",l.attempts," · 对 ",l.correct]}):null]},`${l.label}-${c}`)})})})}function ooe({rows:r}){return N.jsx(TN,{rows:r,mode:"wrongCount"})}function TN({rows:r,mode:e="attempts"}){const t=r.reduce((d,v)=>d+v.attempts,0)||1,n=e==="wrongCount",i=220,a=i/2,s=i/2,o=88,l=he.useMemo(()=>{let d=-Math.PI/2;return r.map((v,g)=>{const m=v.attempts/t,x=m*Math.PI*2,y=d+x,_=a+o*Math.cos(d),w=s+o*Math.sin(d),S=a+o*Math.cos(y),A=s+o*Math.sin(y),C=x>Math.PI?1:0,E={d:m>=.999?`M ${a-o} ${s} A ${o} ${o} 0 1 1 ${a+o} ${s} A ${o} ${o} 0 1 1 ${a-o} ${s}`:`M ${a} ${s} L ${_} ${w} A ${o} ${o} 0 ${C} 1 ${S} ${A} Z`,color:ul[g%ul.length],row:v,frac:m};return d=y,E})},[r,t,a,s,o]),c=n?"错题分布":"作答分布",h=n?`共 ${t} 次错题`:`共 ${t} 次作答`;return N.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:24,alignItems:"flex-start"},children:[N.jsxs("div",{style:{flexShrink:0,textAlign:"center"},children:[N.jsx("svg",{width:i,height:i,style:{display:"block"},children:l.map((d,v)=>N.jsx("path",{d:d.d,fill:d.color,stroke:"#fff",strokeWidth:2},v))}),N.jsx("div",{style:{fontSize:13,fontWeight:600,color:"#374151",marginTop:8},children:c}),N.jsx("div",{className:"muted",style:{fontSize:12,marginTop:4},children:h})]}),N.jsxs("div",{style:{flex:"1 1 200px",minWidth:0},children:[l.map((d,v)=>N.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:8,marginBottom:10,fontSize:13},children:[N.jsx("span",{style:{width:12,height:12,borderRadius:2,background:d.color,flexShrink:0,marginTop:3}}),N.jsxs("div",{children:[N.jsx("div",{style:{fontWeight:600},children:d.row.label}),d.row.sub?N.jsx("div",{className:"muted",style:{fontSize:11},children:d.row.sub}):null,N.jsx("div",{className:"muted",style:{fontSize:12,marginTop:2},children:n?`占比 ${(d.frac*100).toFixed(1)}% · 错题 ${d.row.attempts} 次`:`占比 ${(d.frac*100).toFixed(1)}% · 正确率 ${Hd(d.row.accuracy)} · 共 ${d.row.attempts} 次`})]})]},v)),N.jsx("div",{className:"muted",style:{fontSize:11,marginTop:8},children:n?"饼图按各知识点错题次数占比展示。":"饼图按各维度作答次数占比展示;正确率见图例说明。"})]})]})}function CN({rows:r}){return N.jsx("div",{style:{marginTop:12,fontSize:12,color:"#6b7280"},children:r.map((e,t)=>N.jsxs("div",{style:{marginBottom:6},children:[N.jsx("span",{style:{fontWeight:600,color:"#374151"},children:e.label}),e.sub?N.jsxs("span",{className:"muted",children:[" · ",e.sub]}):null,N.jsxs("span",{children:[" ","— 正确率 ",Hd(e.accuracy),",对 ",e.correct," / 错 ",e.wrong,",共 ",e.attempts," 次"]})]},`${e.label}-${t}`))})}const loe={选择:"选择题",填空:"填空题",计算:"计算题",判断:"判断题"};function uoe(r){const e=(r||"").trim();return e?loe[e]||e:"未标注"}function coe(r){return`${(r*100).toFixed(1)}%`}function hoe(r,e){return e==="grade"?r.by_grade.map(t=>({label:t.grade,attempts:t.attempts,correct:t.correct,wrong:t.wrong,accuracy:t.accuracy})):e==="category"?r.by_category.map(t=>({label:t.category,sub:`年级:${t.grade}`,attempts:t.attempts,correct:t.correct,wrong:t.wrong,accuracy:t.accuracy})):r.by_topic.map(t=>({label:t.knowledge_point_name||t.knowledge_code,sub:`${t.knowledge_grade||"未标注"} · ${t.knowledge_category||"未标注"} · ${t.knowledge_code}`,attempts:t.attempts,correct:t.correct,wrong:t.wrong,accuracy:t.accuracy}))}const foe={bar:"条形图",line:"折线图",pie:"饼图"};function doe(){const r=yu(),{user:e,role:t,loading:n}=bu(),[i,a]=he.useState(null),[s,o]=he.useState(null),[l,c]=he.useState(null),[h,d]=he.useState("grade"),[v,g]=he.useState("bar"),[m,x]=he.useState(null),[y,_]=he.useState(null),[w,S]=he.useState(!1);he.useEffect(()=>{n||t&&t!=="student"&&r("/analytics/teacher",{replace:!0})},[n,t,r]);async function A(){_(null),x(null),S(!0);try{const O=await wF();a(O);try{const D=await SF();o(D),x(null)}catch(D){o(null);const I=D instanceof Error?D.message:"图表加载失败";x(I.includes("404")||/not\s*found/i.test(I)?`${I} — 多为后端未重启,请重启后再试(需包含接口 /learning-analytics/me/knowledge-breakdown)。`:I)}}catch(O){_(O instanceof Error?O.message:"加载失败")}finally{S(!1)}}const C=he.useMemo(()=>s?hoe(s,h):[],[s,h]),M=h==="grade"?"暂无按年级统计的数据(需有作答记录且题目绑定了知识点年级)。":h==="category"?"暂无按类别统计的数据。":"暂无按知识点统计的数据。";async function E(){_(null),S(!0);try{const O=await TF();c(O)}catch(O){_(O instanceof Error?O.message:"加载错题本失败")}finally{S(!1)}}return N.jsx("div",{className:"grid",children:N.jsx("div",{className:"col-12",children:N.jsxs("div",{className:"card",children:[N.jsx("div",{className:"card-header",children:N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"学情统计(学生)"})}),N.jsxs("div",{className:"card-body",children:[N.jsxs("div",{className:"row",children:[N.jsx("button",{className:"btn primary",onClick:A,disabled:w,children:w?"加载中...":"加载我的学情"}),N.jsx("button",{className:"btn",onClick:E,disabled:w,style:{marginLeft:8},children:w?"加载中...":"加载我的错题本"}),e?N.jsxs(N.Fragment,{children:[N.jsx("span",{className:"pill",children:"当前用户"}),N.jsx("span",{className:"mono",children:e.username})]}):null]}),y?N.jsx("div",{className:"error",style:{marginTop:12},children:y}):null,i?N.jsxs("div",{className:"row",style:{marginTop:16,gap:12,flexWrap:"wrap"},children:[N.jsxs("div",{className:"card",style:{padding:14,minWidth:140,flex:"1 1 140px"},children:[N.jsx("div",{className:"muted",style:{fontSize:12},children:"总作答次数"}),N.jsx("div",{style:{fontSize:22,fontWeight:800,marginTop:4},children:i.attempts_total})]}),N.jsxs("div",{className:"card",style:{padding:14,minWidth:140,flex:"1 1 140px"},children:[N.jsx("div",{className:"muted",style:{fontSize:12},children:"答对次数"}),N.jsx("div",{style:{fontSize:22,fontWeight:800,marginTop:4},children:i.correct_total})]}),N.jsxs("div",{className:"card",style:{padding:14,minWidth:140,flex:"1 1 140px"},children:[N.jsx("div",{className:"muted",style:{fontSize:12},children:"总正确率"}),N.jsx("div",{style:{fontSize:22,fontWeight:800,marginTop:4},children:coe(i.accuracy)})]})]}):N.jsx("div",{className:"muted",style:{marginTop:12},children:"(点击「加载我的学情」查看总览与图表)"}),m?N.jsx("div",{className:"muted",style:{marginTop:12,fontSize:13,padding:10,background:"#fffbeb",borderRadius:8},children:m}):null,s?N.jsxs("div",{style:{marginTop:20},children:[N.jsx("div",{style:{fontWeight:800,marginBottom:10},children:"练习情况可视化"}),N.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:10,marginBottom:12},children:[N.jsxs("div",{className:"row",style:{gap:8,flexWrap:"wrap",margin:0},children:[N.jsx("button",{type:"button",className:h==="grade"?"btn primary":"btn",onClick:()=>d("grade"),children:"按年级"}),N.jsx("button",{type:"button",className:h==="category"?"btn primary":"btn",onClick:()=>d("category"),children:"按类别"}),N.jsx("button",{type:"button",className:h==="topic"?"btn primary":"btn",onClick:()=>d("topic"),children:"按具体知识点"})]}),N.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[N.jsx("span",{className:"muted",style:{fontSize:12,marginRight:2},children:"图表类型"}),["bar","line","pie"].map(O=>N.jsx("button",{type:"button",className:v===O?"btn primary":"btn",style:{padding:"6px 12px",fontSize:13},onClick:()=>g(O),children:foe[O]},O))]})]}),N.jsx("div",{style:{padding:12,border:"1px solid #e5e7eb",borderRadius:12,background:"#fafafa",maxHeight:h==="topic"?520:void 0,overflowY:h==="topic"?"auto":void 0},children:C.length?N.jsx(roe,{rows:C,kind:v}):N.jsx("div",{className:"muted",children:M})})]}):null,l?N.jsxs("div",{style:{marginTop:20},children:[N.jsx("div",{style:{fontWeight:800,marginBottom:10},children:"我的错题本"}),l.length?l.map(O=>{var D,I;return N.jsxs("div",{className:"card",style:{padding:14,marginBottom:12,borderRadius:12,border:"1px solid #e5e7eb"},children:[N.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:8,flexWrap:"wrap"},children:[N.jsx("div",{style:{fontWeight:800,fontSize:15},children:((D=O.title)==null?void 0:D.trim())||((I=O.body)!=null&&I.trim()?`${O.body.trim().slice(0,48)}${O.body.trim().length>48?"…":""}`:`错题记录(${O.knowledge_code})`)}),N.jsx("span",{className:"pill",style:{fontSize:12,fontWeight:600},children:uoe(O.question_type)})]}),N.jsxs("div",{className:"muted",style:{fontSize:12,marginTop:6},children:[O.knowledge_grade||"未标注"," · ",O.knowledge_category||"未标注"," · ",O.knowledge_point_name||"—","(",N.jsx("span",{className:"mono",children:O.knowledge_code}),")"]}),O.body?N.jsx("div",{className:"muted",style:{marginTop:10,whiteSpace:"pre-wrap",fontSize:14},children:O.body}):null,N.jsxs("div",{style:{marginTop:12,fontSize:14},children:[N.jsx("span",{style:{fontWeight:600},children:"你的错误答案:"}),O.wrong_answer||"(空)"]}),N.jsxs("div",{style:{marginTop:8,fontSize:14,whiteSpace:"pre-wrap"},children:[N.jsx("span",{style:{fontWeight:600},children:"正确答案:"}),O.correct_answer||"(未录入,请见题干)"]}),N.jsxs("div",{style:{marginTop:8,fontSize:14,whiteSpace:"pre-wrap"},children:[N.jsx("span",{style:{fontWeight:600},children:"解析:"}),(O.resolution||"").trim()||"暂无"]}),N.jsxs("div",{className:"muted",style:{fontSize:11,marginTop:10},children:["记录时间:",new Date(O.created_at).toLocaleString()]})]},O.id)}):N.jsx("div",{className:"muted",children:"暂无错题记录。"})]}):null]})]})})})}function voe(r){return r.map(e=>({label:e.username,sub:void 0,attempts:e.attempts_total,correct:e.correct_total,wrong:Math.max(0,e.attempts_total-e.correct_total),accuracy:e.accuracy}))}function poe(r){return r.map(e=>({label:e.knowledge_code,attempts:e.wrong_count,correct:0,wrong:e.wrong_count,accuracy:0}))}function v9({label:r,options:e,value:t,onChange:n}){return N.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[N.jsx("span",{className:"muted",style:{fontSize:12,marginRight:2},children:r}),e.map(i=>N.jsx("button",{type:"button",className:t===i.id?"btn primary":"btn",style:{padding:"6px 12px",fontSize:13},onClick:()=>n(i.id),children:i.label},i.id))]})}function goe(){const r=yu(),{user:e,role:t,loading:n}=bu(),[i,a]=he.useState(null),[s,o]=he.useState(null),[l,c]=he.useState("hbar"),[h,d]=he.useState("pie"),[v,g]=he.useState(null),[m,x]=he.useState(!1),y=he.useMemo(()=>i?voe(i):[],[i]),_=he.useMemo(()=>s?poe(s):[],[s]);he.useEffect(()=>{n||t&&t!=="teacher"&&r("/analytics/student",{replace:!0})},[n,t,r]);async function w(){g(null),x(!0);try{const A=await EF();a(A)}catch(A){g(A instanceof Error?A.message:"加载失败")}finally{x(!1)}}async function S(){g(null),x(!0);try{const A=await CF();o(A)}catch(A){g(A instanceof Error?A.message:"加载错题本统计失败")}finally{x(!1)}}return N.jsx("div",{className:"grid",children:N.jsx("div",{className:"col-12",children:N.jsxs("div",{className:"card",children:[N.jsxs("div",{className:"card-header",children:[N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"学情统计(教师)"}),N.jsx("div",{className:"muted",style:{marginTop:6},children:"查看全体学生统计与班级错题分布。"})]}),N.jsxs("div",{className:"card-body",children:[N.jsxs("div",{className:"row",style:{alignItems:"center",flexWrap:"wrap",gap:8},children:[N.jsx("button",{className:"btn primary",onClick:w,disabled:m,children:m?"加载中...":"加载所有学生学情"}),N.jsx("button",{className:"btn",onClick:S,disabled:m,children:m?"加载中...":"加载错题本统计"}),e?N.jsxs(N.Fragment,{children:[N.jsx("span",{className:"pill",children:"当前用户"}),N.jsx("span",{className:"mono",children:e.username})]}):null]}),v?N.jsx("div",{className:"error",style:{marginTop:12},children:v}):null,i?N.jsxs("div",{style:{marginTop:20},children:[N.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:10,marginBottom:10},children:[N.jsxs("div",{style:{fontWeight:700},children:["全体学生学情",N.jsxs("span",{className:"muted",style:{fontSize:12,fontWeight:400,marginLeft:8},children:["共 ",i.length," 人"]})]}),N.jsx(v9,{label:"展示方式",value:l,onChange:c,options:[{id:"hbar",label:"横向条形图"},{id:"table",label:"表格"}]})]}),N.jsx("div",{style:{padding:12,border:"1px solid #e5e7eb",borderRadius:12,background:"#fafafa"},children:i.length?l==="table"?N.jsxs("table",{className:"table",children:[N.jsx("thead",{children:N.jsxs("tr",{children:[N.jsx("th",{children:"学生"}),N.jsx("th",{children:"作答总数"}),N.jsx("th",{children:"正确数"}),N.jsx("th",{children:"正确率"})]})}),N.jsx("tbody",{children:i.map(A=>N.jsxs("tr",{children:[N.jsx("td",{className:"mono",children:A.username}),N.jsx("td",{children:A.attempts_total}),N.jsx("td",{children:A.correct_total}),N.jsxs("td",{children:[(A.accuracy*100).toFixed(1),"%"]})]},A.user_id))})]}):N.jsx(soe,{rows:y}):N.jsx("div",{className:"muted",children:"(暂无学生或尚无作答)"})})]}):N.jsx("div",{style:{marginTop:12},className:"muted",children:"(点击「加载所有学生学情」查看)"}),s?N.jsxs("div",{style:{marginTop:20},children:[N.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:10,marginBottom:10},children:[N.jsx("div",{style:{fontWeight:700},children:"错题本(按知识点)"}),N.jsx(v9,{label:"展示方式",value:h,onChange:d,options:[{id:"pie",label:"饼图"},{id:"bar",label:"条形图"},{id:"table",label:"表格"}]})]}),N.jsx("div",{style:{padding:12,border:"1px solid #e5e7eb",borderRadius:12,background:"#fafafa"},children:s.length?h==="table"?N.jsxs("table",{className:"table",children:[N.jsx("thead",{children:N.jsxs("tr",{children:[N.jsx("th",{children:"知识点编码"}),N.jsx("th",{children:"错题次数"})]})}),N.jsx("tbody",{children:s.map(A=>N.jsxs("tr",{children:[N.jsx("td",{className:"mono",children:A.knowledge_code}),N.jsx("td",{children:A.wrong_count})]},A.knowledge_code))})]}):h==="bar"?N.jsx(aoe,{rows:_}):N.jsx(ooe,{rows:_}):N.jsx("div",{className:"muted",children:"(暂无错题记录)"})})]}):N.jsx("div",{style:{marginTop:12},className:"muted",children:"(点击「加载错题本统计」查看)"})]})]})})})}function moe(){const[r,e]=he.useState([]),[t,n]=he.useState("knowledge-graph"),[i,a]=he.useState("http://localhost:9001"),[s,o]=he.useState(!0),[l,c]=he.useState(null),[h,d]=he.useState(null),[v,g]=he.useState(!1);async function m(){c(null);try{e(await AF())}catch(y){c(y instanceof Error?y.message:"加载失败")}}he.useEffect(()=>{m()},[]);async function x(){c(null),d(null),g(!0);try{await MF(t,i,s),d("已注册/更新模块(需要教师权限)。"),await m()}catch(y){c(y instanceof Error?y.message:"注册失败(需要教师权限)")}finally{g(!1)}}return N.jsxs("div",{className:"grid",children:[N.jsx("div",{className:"col-6",children:N.jsxs("div",{className:"card",children:[N.jsxs("div",{className:"card-header",children:[N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"模块管理"}),N.jsx("div",{className:"muted",style:{marginTop:6},children:"用于登记外部模块服务地址(后续可做“中台转发/熔断/鉴权透传”)"})]}),N.jsxs("div",{className:"card-body",children:[N.jsxs("div",{style:{marginBottom:10},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"name"}),N.jsx("input",{className:"input",value:t,onChange:y=>n(y.target.value)})]}),N.jsxs("div",{style:{marginBottom:10},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"base_url"}),N.jsx("input",{className:"input",value:i,onChange:y=>a(y.target.value)})]}),N.jsx("div",{className:"row",style:{marginBottom:10},children:N.jsxs("label",{className:"row",style:{gap:8},children:[N.jsx("input",{type:"checkbox",checked:s,onChange:y=>o(y.target.checked)}),N.jsx("span",{className:"muted",children:"启用"})]})}),N.jsxs("div",{className:"row",children:[N.jsx("button",{className:"btn primary",onClick:x,disabled:v,children:"注册/更新(teacher)"}),N.jsx("button",{className:"btn",onClick:m,disabled:v,children:"刷新"})]}),l?N.jsx("div",{className:"error",style:{marginTop:12},children:l}):null,h?N.jsx("div",{className:"success",style:{marginTop:12},children:h}):null]})]})}),N.jsx("div",{className:"col-6",children:N.jsxs("div",{className:"card",children:[N.jsxs("div",{className:"card-header",children:[N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"已登记模块"}),N.jsx("div",{className:"muted",style:{marginTop:6},children:"这是“接口对接”的基础:把每个模块当作可替换的服务端点"})]}),N.jsx("div",{className:"card-body",children:N.jsxs("table",{className:"table",children:[N.jsx("thead",{children:N.jsxs("tr",{children:[N.jsx("th",{children:"name"}),N.jsx("th",{children:"base_url"}),N.jsx("th",{children:"enabled"})]})}),N.jsxs("tbody",{children:[r.map(y=>N.jsxs("tr",{children:[N.jsx("td",{className:"mono",children:y.name}),N.jsx("td",{className:"mono",children:y.base_url}),N.jsx("td",{children:y.is_enabled?"Y":"N"})]},y.id)),r.length?null:N.jsx("tr",{children:N.jsx("td",{colSpan:3,className:"muted",children:"(暂无)"})})]})]})})]})})]})}function yoe({children:r}){return M9()?N.jsx(N.Fragment,{children:r}):N.jsx(Zx,{to:"/login",replace:!0})}function boe(){return N.jsxs(FB,{children:[N.jsx(Gi,{path:"/login",element:N.jsx(NF,{})}),N.jsxs(Gi,{path:"/",element:N.jsx(yoe,{children:N.jsx(IF,{})}),children:[N.jsx(Gi,{index:!0,element:N.jsx(Zx,{to:"/knowledge",replace:!0})}),N.jsx(Gi,{path:"knowledge",element:N.jsx(Tq,{})}),N.jsx(Gi,{path:"digital-human",element:N.jsx(Kse,{})}),N.jsx(Gi,{path:"assessment",element:N.jsx(eoe,{})}),N.jsxs(Gi,{path:"analytics",children:[N.jsx(Gi,{index:!0,element:N.jsx(toe,{})}),N.jsx(Gi,{path:"student",element:N.jsx(doe,{})}),N.jsx(Gi,{path:"teacher",element:N.jsx(goe,{})})]}),N.jsx(Gi,{path:"modules",element:N.jsx(moe,{})})]}),N.jsx(Gi,{path:"*",element:N.jsx(Zx,{to:"/",replace:!0})})]})}qk.createRoot(document.getElementById("root")).render(N.jsx(p9.StrictMode,{children:N.jsx(XB,{children:N.jsx(boe,{})})}));