From 4fb3893be25dd12f6e016e3578be4397a47d39ee Mon Sep 17 00:00:00 2001 From: Aziz Chynaliev Date: Fri, 2 Aug 2024 20:40:59 +0500 Subject: [PATCH] server: experiment with autoreconnection --- .../configuration/entries/config.dm | 2 + code/game/world.dm | 4 +- code/modules/tgui/tgui_panel/tgui_panel.dm | 7 +- tgui/packages/tgui-panel/game/middleware.js | 14 +- tgui/packages/tgui-panel/game/reducer.js | 14 +- tgui/packages/tgui-panel/reconnect.tsx | 2 +- tgui/public/tgui-panel.bundle.js | 244 +++++++++--------- 7 files changed, 149 insertions(+), 138 deletions(-) diff --git a/code/controllers/configuration/entries/config.dm b/code/controllers/configuration/entries/config.dm index fb96a8c22a1..d04d5e33f71 100644 --- a/code/controllers/configuration/entries/config.dm +++ b/code/controllers/configuration/entries/config.dm @@ -594,6 +594,8 @@ /datum/config_entry/flag/shutdown_on_reboot +/datum/config_entry/flag/autoreconnect + /datum/config_entry/flag/disable_karma /datum/config_entry/number/base_mc_tick_rate diff --git a/code/game/world.dm b/code/game/world.dm index b4bef205358..6b89f481652 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -158,8 +158,10 @@ GLOBAL_LIST_EMPTY(world_topic_handlers) to_chat(world, span_boldannounceooc("Reboot will take a little longer, due to pending updates.")) // Send the reboot banner to all players + var/position = 0 // queue autoreconnect for(var/client/C in GLOB.clients) - C?.tgui_panel?.send_roundrestart() + C?.tgui_panel?.send_roundrestart(position) + position++ if(CONFIG_GET(string/server)) // If you set a server location in config.txt, it sends you there instead of trying to reconnect to the same world address. -- NeoFite C << link("byond://[CONFIG_GET(string/server)]") diff --git a/code/modules/tgui/tgui_panel/tgui_panel.dm b/code/modules/tgui/tgui_panel/tgui_panel.dm index 9229de1da49..62a7316bc8f 100644 --- a/code/modules/tgui/tgui_panel/tgui_panel.dm +++ b/code/modules/tgui/tgui_panel/tgui_panel.dm @@ -104,5 +104,8 @@ * * Sends a round restart notification. */ -/datum/tgui_panel/proc/send_roundrestart() - window.send_message("roundrestart") +/datum/tgui_panel/proc/send_roundrestart(position) + window.send_message("roundrestart", list( + "autoreconnect" = CONFIG_GET(flag/autoreconnect) && CONFIG_GET(flag/shutdown_on_reboot), + "position" = position, + )) diff --git a/tgui/packages/tgui-panel/game/middleware.js b/tgui/packages/tgui-panel/game/middleware.js index 1df96dd27e0..a6a2f8d9065 100644 --- a/tgui/packages/tgui-panel/game/middleware.js +++ b/tgui/packages/tgui-panel/game/middleware.js @@ -13,6 +13,7 @@ import { } from './actions'; import { selectGame } from './selectors'; import { CONNECTION_LOST_AFTER, AUTO_RECONNECT_AFTER } from './constants'; +import { url } from '../reconnect'; const withTimestamp = (action) => ({ ...action, @@ -55,8 +56,17 @@ export const gameMiddleware = (store) => { return next(withTimestamp(action)); } if (type === autoReconnect.type) { - // Byond.command('.reconnect'); - return; + Byond.command('.reconnect'); + + // const link = document.createElement('a'); + // link.id = 'reconnectLink'; + // link.href = `byond://${url}`; + // link.textContent = 'reconnectLink'; + // document.body.appendChild(link); + // document.getElementById('reconnectLink')?.click(); + // Byond.command('.quit'); + + return next(action); } return next(action); diff --git a/tgui/packages/tgui-panel/game/reducer.js b/tgui/packages/tgui-panel/game/reducer.js index b2d13b098f5..e69541cc6e6 100644 --- a/tgui/packages/tgui-panel/game/reducer.js +++ b/tgui/packages/tgui-panel/game/reducer.js @@ -9,12 +9,6 @@ import { connectionRestored } from './actions'; import { roundRestarted } from './actions'; import { AUTO_RECONNECT_AFTER } from './constants'; -const getRandomIntInclusive = (min, max) => { - const minCeiled = Math.ceil(min); - const maxFloored = Math.floor(max); - return Math.floor(Math.random() * (maxFloored - minCeiled + 1) + minCeiled); -}; - const initialState = { // TODO: This is where round info should be. roundId: null, @@ -27,14 +21,14 @@ const initialState = { export const gameReducer = (state = initialState, action) => { const { type, payload, meta } = action; if (type === roundRestarted.type) { + const { autoreconnect, position } = payload; return { ...state, roundRestartedAt: meta.now, autoReconnectAfter: - // Add a random amount of time to the auto reconnect time - // to avoid all clients reconnecting at the same time - // from 0 to 15 seconds with 100ms step - meta.now + AUTO_RECONNECT_AFTER + getRandomIntInclusive(0, 150) * 100, + // Add a delay to the auto reconnect time to avoid all clients + // reconnecting at the same time with 500ms step + autoreconnect ? meta.now + AUTO_RECONNECT_AFTER + position * 500 : null, }; } if (type === connectionLost.type) { diff --git a/tgui/packages/tgui-panel/reconnect.tsx b/tgui/packages/tgui-panel/reconnect.tsx index aacd245b75b..f8bdbae4aa7 100644 --- a/tgui/packages/tgui-panel/reconnect.tsx +++ b/tgui/packages/tgui-panel/reconnect.tsx @@ -1,6 +1,6 @@ import { Button, Stack } from 'tgui/components'; -let url: string | null = null; +export let url: string | null = null; setInterval(() => { Byond.winget('', 'url').then((currentUrl) => { diff --git a/tgui/public/tgui-panel.bundle.js b/tgui/public/tgui-panel.bundle.js index ff4fd6ee0da..46b14e5f0b0 100644 --- a/tgui/public/tgui-panel.bundle.js +++ b/tgui/public/tgui-panel.bundle.js @@ -1,30 +1,30 @@ -(function(){(function(){var An={66641:function(S,n,t){"use strict";n.__esModule=!0,n.createPopper=void 0,n.popperGenerator=g;var e=i(t(8823)),r=i(t(19820)),o=i(t(54826)),a=i(t(43243)),s=i(t(17859)),u=i(t(80798)),l=i(t(46343)),m=i(t(31584));n.detectOverflow=m.default;var d=t(72600);function i(h){return h&&h.__esModule?h:{default:h}}var v={placement:"bottom",modifiers:[],strategy:"absolute"};function c(){for(var h=arguments.length,p=new Array(h),E=0;E0&&(0,r.round)(i.width)/l.offsetWidth||1,c=l.offsetHeight>0&&(0,r.round)(i.height)/l.offsetHeight||1);var g=(0,e.isElement)(l)?(0,o.default)(l):window,f=g.visualViewport,h=!(0,a.default)()&&d,p=(i.left+(h&&f?f.offsetLeft:0))/v,E=(i.top+(h&&f?f.offsetTop:0))/c,O=i.width/v,I=i.height/c;return{width:O,height:I,top:E,right:p+O,bottom:E+I,left:p,x:p,y:E}}},86380:function(S,n,t){"use strict";n.__esModule=!0,n.default=I;var e=t(41521),r=h(t(2868)),o=h(t(39799)),a=h(t(54826)),s=h(t(43243)),u=h(t(33733)),l=h(t(14522)),m=t(72600),d=h(t(32125)),i=h(t(34972)),v=h(t(96343)),c=h(t(13203)),g=h(t(31855)),f=t(69031);function h(T){return T&&T.__esModule?T:{default:T}}function p(T,C){var y=(0,d.default)(T,!1,C==="fixed");return y.top=y.top+T.clientTop,y.left=y.left+T.clientLeft,y.bottom=y.top+T.clientHeight,y.right=y.left+T.clientWidth,y.width=T.clientWidth,y.height=T.clientHeight,y.x=y.left,y.y=y.top,y}function E(T,C,y){return C===e.viewport?(0,g.default)((0,r.default)(T,y)):(0,m.isElement)(C)?p(C,y):(0,g.default)((0,o.default)((0,u.default)(T)))}function O(T){var C=(0,a.default)((0,i.default)(T)),y=["absolute","fixed"].indexOf((0,l.default)(T).position)>=0,b=y&&(0,m.isHTMLElement)(T)?(0,s.default)(T):T;return(0,m.isElement)(b)?C.filter(function(A){return(0,m.isElement)(A)&&(0,v.default)(A,b)&&(0,c.default)(A)!=="body"}):[]}function I(T,C,y,b){var A=C==="clippingParents"?O(T):[].concat(C),N=[].concat(A,[y]),M=N[0],R=N.reduce(function(L,V){var F=E(T,V,b);return L.top=(0,f.max)(F.top,L.top),L.right=(0,f.min)(F.right,L.right),L.bottom=(0,f.min)(F.bottom,L.bottom),L.left=(0,f.max)(F.left,L.left),L},E(T,M,b));return R.width=R.right-R.left,R.height=R.bottom-R.top,R.x=R.left,R.y=R.top,R}},8823:function(S,n,t){"use strict";n.__esModule=!0,n.default=v;var e=d(t(32125)),r=d(t(45401)),o=d(t(13203)),a=t(72600),s=d(t(85750)),u=d(t(33733)),l=d(t(44011)),m=t(69031);function d(c){return c&&c.__esModule?c:{default:c}}function i(c){var g=c.getBoundingClientRect(),f=(0,m.round)(g.width)/c.offsetWidth||1,h=(0,m.round)(g.height)/c.offsetHeight||1;return f!==1||h!==1}function v(c,g,f){f===void 0&&(f=!1);var h=(0,a.isHTMLElement)(g),p=(0,a.isHTMLElement)(g)&&i(g),E=(0,u.default)(g),O=(0,e.default)(c,p,f),I={scrollLeft:0,scrollTop:0},T={x:0,y:0};return(h||!h&&!f)&&(((0,o.default)(g)!=="body"||(0,l.default)(E))&&(I=(0,r.default)(g)),(0,a.isHTMLElement)(g)?(T=(0,e.default)(g,!0),T.x+=g.clientLeft,T.y+=g.clientTop):E&&(T.x=(0,s.default)(E))),{x:O.left+I.scrollLeft-T.x,y:O.top+I.scrollTop-T.y,width:O.width,height:O.height}}},14522:function(S,n,t){"use strict";n.__esModule=!0,n.default=o;var e=r(t(81020));function r(a){return a&&a.__esModule?a:{default:a}}function o(a){return(0,e.default)(a).getComputedStyle(a)}},33733:function(S,n,t){"use strict";n.__esModule=!0,n.default=r;var e=t(72600);function r(o){return(((0,e.isElement)(o)?o.ownerDocument:o.document)||window.document).documentElement}},39799:function(S,n,t){"use strict";n.__esModule=!0,n.default=l;var e=u(t(33733)),r=u(t(14522)),o=u(t(85750)),a=u(t(79569)),s=t(69031);function u(m){return m&&m.__esModule?m:{default:m}}function l(m){var d,i=(0,e.default)(m),v=(0,a.default)(m),c=(d=m.ownerDocument)==null?void 0:d.body,g=(0,s.max)(i.scrollWidth,i.clientWidth,c?c.scrollWidth:0,c?c.clientWidth:0),f=(0,s.max)(i.scrollHeight,i.clientHeight,c?c.scrollHeight:0,c?c.clientHeight:0),h=-v.scrollLeft+(0,o.default)(m),p=-v.scrollTop;return(0,r.default)(c||i).direction==="rtl"&&(h+=(0,s.max)(i.clientWidth,c?c.clientWidth:0)-g),{width:g,height:f,x:h,y:p}}},75680:function(S,n){"use strict";n.__esModule=!0,n.default=t;function t(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}},19820:function(S,n,t){"use strict";n.__esModule=!0,n.default=o;var e=r(t(32125));function r(a){return a&&a.__esModule?a:{default:a}}function o(a){var s=(0,e.default)(a),u=a.offsetWidth,l=a.offsetHeight;return Math.abs(s.width-u)<=1&&(u=s.width),Math.abs(s.height-l)<=1&&(l=s.height),{x:a.offsetLeft,y:a.offsetTop,width:u,height:l}}},13203:function(S,n){"use strict";n.__esModule=!0,n.default=t;function t(e){return e?(e.nodeName||"").toLowerCase():null}},45401:function(S,n,t){"use strict";n.__esModule=!0,n.default=u;var e=s(t(79569)),r=s(t(81020)),o=t(72600),a=s(t(75680));function s(l){return l&&l.__esModule?l:{default:l}}function u(l){return l===(0,r.default)(l)||!(0,o.isHTMLElement)(l)?(0,e.default)(l):(0,a.default)(l)}},43243:function(S,n,t){"use strict";n.__esModule=!0,n.default=v;var e=m(t(81020)),r=m(t(13203)),o=m(t(14522)),a=t(72600),s=m(t(25658)),u=m(t(34972)),l=m(t(97353));function m(c){return c&&c.__esModule?c:{default:c}}function d(c){return!(0,a.isHTMLElement)(c)||(0,o.default)(c).position==="fixed"?null:c.offsetParent}function i(c){var g=/firefox/i.test((0,l.default)()),f=/Trident/i.test((0,l.default)());if(f&&(0,a.isHTMLElement)(c)){var h=(0,o.default)(c);if(h.position==="fixed")return null}var p=(0,u.default)(c);for((0,a.isShadowRoot)(p)&&(p=p.host);(0,a.isHTMLElement)(p)&&["html","body"].indexOf((0,r.default)(p))<0;){var E=(0,o.default)(p);if(E.transform!=="none"||E.perspective!=="none"||E.contain==="paint"||["transform","perspective"].indexOf(E.willChange)!==-1||g&&E.willChange==="filter"||g&&E.filter&&E.filter!=="none")return p;p=p.parentNode}return null}function v(c){for(var g=(0,e.default)(c),f=d(c);f&&(0,s.default)(f)&&(0,o.default)(f).position==="static";)f=d(f);return f&&((0,r.default)(f)==="html"||(0,r.default)(f)==="body"&&(0,o.default)(f).position==="static")?g:f||i(c)||g}},34972:function(S,n,t){"use strict";n.__esModule=!0,n.default=s;var e=a(t(13203)),r=a(t(33733)),o=t(72600);function a(u){return u&&u.__esModule?u:{default:u}}function s(u){return(0,e.default)(u)==="html"?u:u.assignedSlot||u.parentNode||((0,o.isShadowRoot)(u)?u.host:null)||(0,r.default)(u)}},65329:function(S,n,t){"use strict";n.__esModule=!0,n.default=u;var e=s(t(34972)),r=s(t(44011)),o=s(t(13203)),a=t(72600);function s(l){return l&&l.__esModule?l:{default:l}}function u(l){return["html","body","#document"].indexOf((0,o.default)(l))>=0?l.ownerDocument.body:(0,a.isHTMLElement)(l)&&(0,r.default)(l)?l:u((0,e.default)(l))}},2868:function(S,n,t){"use strict";n.__esModule=!0,n.default=u;var e=s(t(81020)),r=s(t(33733)),o=s(t(85750)),a=s(t(14894));function s(l){return l&&l.__esModule?l:{default:l}}function u(l,m){var d=(0,e.default)(l),i=(0,r.default)(l),v=d.visualViewport,c=i.clientWidth,g=i.clientHeight,f=0,h=0;if(v){c=v.width,g=v.height;var p=(0,a.default)();(p||!p&&m==="fixed")&&(f=v.offsetLeft,h=v.offsetTop)}return{width:c,height:g,x:f+(0,o.default)(l),y:h}}},81020:function(S,n){"use strict";n.__esModule=!0,n.default=t;function t(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var r=e.ownerDocument;return r&&r.defaultView||window}return e}},79569:function(S,n,t){"use strict";n.__esModule=!0,n.default=o;var e=r(t(81020));function r(a){return a&&a.__esModule?a:{default:a}}function o(a){var s=(0,e.default)(a),u=s.pageXOffset,l=s.pageYOffset;return{scrollLeft:u,scrollTop:l}}},85750:function(S,n,t){"use strict";n.__esModule=!0,n.default=s;var e=a(t(32125)),r=a(t(33733)),o=a(t(79569));function a(u){return u&&u.__esModule?u:{default:u}}function s(u){return(0,e.default)((0,r.default)(u)).left+(0,o.default)(u).scrollLeft}},72600:function(S,n,t){"use strict";n.__esModule=!0,n.isElement=o,n.isHTMLElement=a,n.isShadowRoot=s;var e=r(t(81020));function r(u){return u&&u.__esModule?u:{default:u}}function o(u){var l=(0,e.default)(u).Element;return u instanceof l||u instanceof Element}function a(u){var l=(0,e.default)(u).HTMLElement;return u instanceof l||u instanceof HTMLElement}function s(u){if(typeof ShadowRoot=="undefined")return!1;var l=(0,e.default)(u).ShadowRoot;return u instanceof l||u instanceof ShadowRoot}},14894:function(S,n,t){"use strict";n.__esModule=!0,n.default=o;var e=r(t(97353));function r(a){return a&&a.__esModule?a:{default:a}}function o(){return!/^((?!chrome|android).)*safari/i.test((0,e.default)())}},44011:function(S,n,t){"use strict";n.__esModule=!0,n.default=o;var e=r(t(14522));function r(a){return a&&a.__esModule?a:{default:a}}function o(a){var s=(0,e.default)(a),u=s.overflow,l=s.overflowX,m=s.overflowY;return/auto|scroll|overlay|hidden/.test(u+m+l)}},25658:function(S,n,t){"use strict";n.__esModule=!0,n.default=o;var e=r(t(13203));function r(a){return a&&a.__esModule?a:{default:a}}function o(a){return["table","td","th"].indexOf((0,e.default)(a))>=0}},54826:function(S,n,t){"use strict";n.__esModule=!0,n.default=u;var e=s(t(65329)),r=s(t(34972)),o=s(t(81020)),a=s(t(44011));function s(l){return l&&l.__esModule?l:{default:l}}function u(l,m){var d;m===void 0&&(m=[]);var i=(0,e.default)(l),v=i===((d=l.ownerDocument)==null?void 0:d.body),c=(0,o.default)(i),g=v?[c].concat(c.visualViewport||[],(0,a.default)(i)?i:[]):i,f=m.concat(g);return v?f:f.concat(u((0,r.default)(g)))}},41521:function(S,n){"use strict";n.__esModule=!0,n.write=n.viewport=n.variationPlacements=n.top=n.start=n.right=n.reference=n.read=n.popper=n.placements=n.modifierPhases=n.main=n.left=n.end=n.clippingParents=n.bottom=n.beforeWrite=n.beforeRead=n.beforeMain=n.basePlacements=n.auto=n.afterWrite=n.afterRead=n.afterMain=void 0;var t=n.top="top",e=n.bottom="bottom",r=n.right="right",o=n.left="left",a=n.auto="auto",s=n.basePlacements=[t,e,r,o],u=n.start="start",l=n.end="end",m=n.clippingParents="clippingParents",d=n.viewport="viewport",i=n.popper="popper",v=n.reference="reference",c=n.variationPlacements=s.reduce(function(A,N){return A.concat([N+"-"+u,N+"-"+l])},[]),g=n.placements=[].concat(s,[a]).reduce(function(A,N){return A.concat([N,N+"-"+u,N+"-"+l])},[]),f=n.beforeRead="beforeRead",h=n.read="read",p=n.afterRead="afterRead",E=n.beforeMain="beforeMain",O=n.main="main",I=n.afterMain="afterMain",T=n.beforeWrite="beforeWrite",C=n.write="write",y=n.afterWrite="afterWrite",b=n.modifierPhases=[f,h,p,E,O,I,T,C,y]},60023:function(S,n,t){"use strict";n.__esModule=!0;var e={popperGenerator:!0,detectOverflow:!0,createPopperBase:!0,createPopper:!0,createPopperLite:!0};n.popperGenerator=n.detectOverflow=n.createPopperLite=n.createPopperBase=n.createPopper=void 0;var r=t(41521);Object.keys(r).forEach(function(l){l==="default"||l==="__esModule"||Object.prototype.hasOwnProperty.call(e,l)||l in n&&n[l]===r[l]||(n[l]=r[l])});var o=t(91078);Object.keys(o).forEach(function(l){l==="default"||l==="__esModule"||Object.prototype.hasOwnProperty.call(e,l)||l in n&&n[l]===o[l]||(n[l]=o[l])});var a=t(66641);n.popperGenerator=a.popperGenerator,n.detectOverflow=a.detectOverflow,n.createPopperBase=a.createPopper;var s=t(7925);n.createPopper=s.createPopper;var u=t(62642);n.createPopperLite=u.createPopper},56304:function(S,n,t){"use strict";n.__esModule=!0,n.default=void 0;var e=o(t(13203)),r=t(72600);function o(l){return l&&l.__esModule?l:{default:l}}function a(l){var m=l.state;Object.keys(m.elements).forEach(function(d){var i=m.styles[d]||{},v=m.attributes[d]||{},c=m.elements[d];!(0,r.isHTMLElement)(c)||!(0,e.default)(c)||(Object.assign(c.style,i),Object.keys(v).forEach(function(g){var f=v[g];f===!1?c.removeAttribute(g):c.setAttribute(g,f===!0?"":f)}))})}function s(l){var m=l.state,d={popper:{position:m.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(m.elements.popper.style,d.popper),m.styles=d,m.elements.arrow&&Object.assign(m.elements.arrow.style,d.arrow),function(){Object.keys(m.elements).forEach(function(i){var v=m.elements[i],c=m.attributes[i]||{},g=Object.keys(m.styles.hasOwnProperty(i)?m.styles[i]:d[i]),f=g.reduce(function(h,p){return h[p]="",h},{});!(0,r.isHTMLElement)(v)||!(0,e.default)(v)||(Object.assign(v.style,f),Object.keys(c).forEach(function(h){v.removeAttribute(h)}))})}}var u=n.default={name:"applyStyles",enabled:!0,phase:"write",fn:a,effect:s,requires:["computeStyles"]}},57243:function(S,n,t){"use strict";n.__esModule=!0,n.default=void 0;var e=i(t(38141)),r=i(t(19820)),o=i(t(96343)),a=i(t(43243)),s=i(t(7770)),u=t(76770),l=i(t(77631)),m=i(t(54824)),d=t(41521);function i(h){return h&&h.__esModule?h:{default:h}}var v=function(){function h(p,E){return p=typeof p=="function"?p(Object.assign({},E.rects,{placement:E.placement})):p,(0,l.default)(typeof p!="number"?p:(0,m.default)(p,d.basePlacements))}return h}();function c(h){var p,E=h.state,O=h.name,I=h.options,T=E.elements.arrow,C=E.modifiersData.popperOffsets,y=(0,e.default)(E.placement),b=(0,s.default)(y),A=[d.left,d.right].indexOf(y)>=0,N=A?"height":"width";if(!(!T||!C)){var M=v(I.padding,E),R=(0,r.default)(T),L=b==="y"?d.top:d.left,V=b==="y"?d.bottom:d.right,F=E.rects.reference[N]+E.rects.reference[b]-C[b]-E.rects.popper[N],x=C[b]-E.rects.reference[b],G=(0,a.default)(T),B=G?b==="y"?G.clientHeight||0:G.clientWidth||0:0,j=F/2-x/2,U=M[L],K=B-R[N]-M[V],$=B/2-R[N]/2+j,H=(0,u.within)(U,$,K),tt=b;E.modifiersData[O]=(p={},p[tt]=H,p.centerOffset=H-$,p)}}function g(h){var p=h.state,E=h.options,O=E.element,I=O===void 0?"[data-popper-arrow]":O;I!=null&&(typeof I=="string"&&(I=p.elements.popper.querySelector(I),!I)||(0,o.default)(p.elements.popper,I)&&(p.elements.arrow=I))}var f=n.default={name:"arrow",enabled:!0,phase:"main",fn:c,effect:g,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]}},60421:function(S,n,t){"use strict";n.__esModule=!0,n.default=void 0,n.mapToStyles=c;var e=t(41521),r=d(t(43243)),o=d(t(81020)),a=d(t(33733)),s=d(t(14522)),u=d(t(38141)),l=d(t(14380)),m=t(69031);function d(h){return h&&h.__esModule?h:{default:h}}var i={top:"auto",right:"auto",bottom:"auto",left:"auto"};function v(h,p){var E=h.x,O=h.y,I=p.devicePixelRatio||1;return{x:(0,m.round)(E*I)/I||0,y:(0,m.round)(O*I)/I||0}}function c(h){var p,E=h.popper,O=h.popperRect,I=h.placement,T=h.variation,C=h.offsets,y=h.position,b=h.gpuAcceleration,A=h.adaptive,N=h.roundOffsets,M=h.isFixed,R=C.x,L=R===void 0?0:R,V=C.y,F=V===void 0?0:V,x=typeof N=="function"?N({x:L,y:F}):{x:L,y:F};L=x.x,F=x.y;var G=C.hasOwnProperty("x"),B=C.hasOwnProperty("y"),j=e.left,U=e.top,K=window;if(A){var $=(0,r.default)(E),H="clientHeight",tt="clientWidth";if($===(0,o.default)(E)&&($=(0,a.default)(E),(0,s.default)($).position!=="static"&&y==="absolute"&&(H="scrollHeight",tt="scrollWidth")),$=$,I===e.top||(I===e.left||I===e.right)&&T===e.end){U=e.bottom;var ft=M&&$===K&&K.visualViewport?K.visualViewport.height:$[H];F-=ft-O.height,F*=b?1:-1}if(I===e.left||(I===e.top||I===e.bottom)&&T===e.end){j=e.right;var dt=M&&$===K&&K.visualViewport?K.visualViewport.width:$[tt];L-=dt-O.width,L*=b?1:-1}}var z=Object.assign({position:y},A&&i),X=N===!0?v({x:L,y:F},(0,o.default)(E)):{x:L,y:F};if(L=X.x,F=X.y,b){var et;return Object.assign({},z,(et={},et[U]=B?"0":"",et[j]=G?"0":"",et.transform=(K.devicePixelRatio||1)<=1?"translate("+L+"px, "+F+"px)":"translate3d("+L+"px, "+F+"px, 0)",et))}return Object.assign({},z,(p={},p[U]=B?F+"px":"",p[j]=G?L+"px":"",p.transform="",p))}function g(h){var p=h.state,E=h.options,O=E.gpuAcceleration,I=O===void 0?!0:O,T=E.adaptive,C=T===void 0?!0:T,y=E.roundOffsets,b=y===void 0?!0:y,A={placement:(0,u.default)(p.placement),variation:(0,l.default)(p.placement),popper:p.elements.popper,popperRect:p.rects.popper,gpuAcceleration:I,isFixed:p.options.strategy==="fixed"};p.modifiersData.popperOffsets!=null&&(p.styles.popper=Object.assign({},p.styles.popper,c(Object.assign({},A,{offsets:p.modifiersData.popperOffsets,position:p.options.strategy,adaptive:C,roundOffsets:b})))),p.modifiersData.arrow!=null&&(p.styles.arrow=Object.assign({},p.styles.arrow,c(Object.assign({},A,{offsets:p.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:b})))),p.attributes.popper=Object.assign({},p.attributes.popper,{"data-popper-placement":p.placement})}var f=n.default={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:g,data:{}}},84601:function(S,n,t){"use strict";n.__esModule=!0,n.default=void 0;var e=r(t(81020));function r(u){return u&&u.__esModule?u:{default:u}}var o={passive:!0};function a(u){var l=u.state,m=u.instance,d=u.options,i=d.scroll,v=i===void 0?!0:i,c=d.resize,g=c===void 0?!0:c,f=(0,e.default)(l.elements.popper),h=[].concat(l.scrollParents.reference,l.scrollParents.popper);return v&&h.forEach(function(p){p.addEventListener("scroll",m.update,o)}),g&&f.addEventListener("resize",m.update,o),function(){v&&h.forEach(function(p){p.removeEventListener("scroll",m.update,o)}),g&&f.removeEventListener("resize",m.update,o)}}var s=n.default={name:"eventListeners",enabled:!0,phase:"write",fn:function(){function u(){}return u}(),effect:a,data:{}}},17267:function(S,n,t){"use strict";n.__esModule=!0,n.default=void 0;var e=m(t(79641)),r=m(t(38141)),o=m(t(71976)),a=m(t(31584)),s=m(t(44744)),u=t(41521),l=m(t(14380));function m(c){return c&&c.__esModule?c:{default:c}}function d(c){if((0,r.default)(c)===u.auto)return[];var g=(0,e.default)(c);return[(0,o.default)(c),g,(0,o.default)(g)]}function i(c){var g=c.state,f=c.options,h=c.name;if(!g.modifiersData[h]._skip){for(var p=f.mainAxis,E=p===void 0?!0:p,O=f.altAxis,I=O===void 0?!0:O,T=f.fallbackPlacements,C=f.padding,y=f.boundary,b=f.rootBoundary,A=f.altBoundary,N=f.flipVariations,M=N===void 0?!0:N,R=f.allowedAutoPlacements,L=g.options.placement,V=(0,r.default)(L),F=V===L,x=T||(F||!M?[(0,e.default)(L)]:d(L)),G=[L].concat(x).reduce(function(rt,gt){return rt.concat((0,r.default)(gt)===u.auto?(0,s.default)(g,{placement:gt,boundary:y,rootBoundary:b,padding:C,flipVariations:M,allowedAutoPlacements:R}):gt)},[]),B=g.rects.reference,j=g.rects.popper,U=new Map,K=!0,$=G[0],H=0;H=0,X=z?"width":"height",et=(0,a.default)(g,{placement:tt,boundary:y,rootBoundary:b,altBoundary:A,padding:C}),ct=z?dt?u.right:u.left:dt?u.bottom:u.top;B[X]>j[X]&&(ct=(0,e.default)(ct));var ut=(0,e.default)(ct),St=[];if(E&&St.push(et[ft]<=0),I&&St.push(et[ct]<=0,et[ut]<=0),St.every(function(rt){return rt})){$=tt,K=!1;break}U.set(tt,St)}if(K)for(var Mt=M?3:1,wt=function(){function rt(gt){var Q=G.find(function(q){var nt=U.get(q);if(nt)return nt.slice(0,gt).every(function(Et){return Et})});if(Q)return $=Q,"break"}return rt}(),Rt=Mt;Rt>0;Rt--){var ht=wt(Rt);if(ht==="break")break}g.placement!==$&&(g.modifiersData[h]._skip=!0,g.placement=$,g.reset=!0)}}var v=n.default={name:"flip",enabled:!0,phase:"main",fn:i,requiresIfExists:["offset"],data:{_skip:!1}}},66095:function(S,n,t){"use strict";n.__esModule=!0,n.default=void 0;var e=t(41521),r=o(t(31584));function o(m){return m&&m.__esModule?m:{default:m}}function a(m,d,i){return i===void 0&&(i={x:0,y:0}),{top:m.top-d.height-i.y,right:m.right-d.width+i.x,bottom:m.bottom-d.height+i.y,left:m.left-d.width-i.x}}function s(m){return[e.top,e.right,e.bottom,e.left].some(function(d){return m[d]>=0})}function u(m){var d=m.state,i=m.name,v=d.rects.reference,c=d.rects.popper,g=d.modifiersData.preventOverflow,f=(0,r.default)(d,{elementContext:"reference"}),h=(0,r.default)(d,{altBoundary:!0}),p=a(f,v),E=a(h,c,g),O=s(p),I=s(E);d.modifiersData[i]={referenceClippingOffsets:p,popperEscapeOffsets:E,isReferenceHidden:O,hasPopperEscaped:I},d.attributes.popper=Object.assign({},d.attributes.popper,{"data-popper-reference-hidden":O,"data-popper-escaped":I})}var l=n.default={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:u}},91078:function(S,n,t){"use strict";n.__esModule=!0,n.preventOverflow=n.popperOffsets=n.offset=n.hide=n.flip=n.eventListeners=n.computeStyles=n.arrow=n.applyStyles=void 0;var e=i(t(56304));n.applyStyles=e.default;var r=i(t(57243));n.arrow=r.default;var o=i(t(60421));n.computeStyles=o.default;var a=i(t(84601));n.eventListeners=a.default;var s=i(t(17267));n.flip=s.default;var u=i(t(66095));n.hide=u.default;var l=i(t(36707));n.offset=l.default;var m=i(t(98916));n.popperOffsets=m.default;var d=i(t(44454));n.preventOverflow=d.default;function i(v){return v&&v.__esModule?v:{default:v}}},36707:function(S,n,t){"use strict";n.__esModule=!0,n.default=void 0,n.distanceAndSkiddingToXY=a;var e=o(t(38141)),r=t(41521);function o(l){return l&&l.__esModule?l:{default:l}}function a(l,m,d){var i=(0,e.default)(l),v=[r.left,r.top].indexOf(i)>=0?-1:1,c=typeof d=="function"?d(Object.assign({},m,{placement:l})):d,g=c[0],f=c[1];return g=g||0,f=(f||0)*v,[r.left,r.right].indexOf(i)>=0?{x:f,y:g}:{x:g,y:f}}function s(l){var m=l.state,d=l.options,i=l.name,v=d.offset,c=v===void 0?[0,0]:v,g=r.placements.reduce(function(E,O){return E[O]=a(O,m.rects,c),E},{}),f=g[m.placement],h=f.x,p=f.y;m.modifiersData.popperOffsets!=null&&(m.modifiersData.popperOffsets.x+=h,m.modifiersData.popperOffsets.y+=p),m.modifiersData[i]=g}var u=n.default={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:s}},98916:function(S,n,t){"use strict";n.__esModule=!0,n.default=void 0;var e=r(t(47566));function r(s){return s&&s.__esModule?s:{default:s}}function o(s){var u=s.state,l=s.name;u.modifiersData[l]=(0,e.default)({reference:u.rects.reference,element:u.rects.popper,strategy:"absolute",placement:u.placement})}var a=n.default={name:"popperOffsets",enabled:!0,phase:"read",fn:o,data:{}}},44454:function(S,n,t){"use strict";n.__esModule=!0,n.default=void 0;var e=t(41521),r=c(t(38141)),o=c(t(7770)),a=c(t(39571)),s=t(76770),u=c(t(19820)),l=c(t(43243)),m=c(t(31584)),d=c(t(14380)),i=c(t(92385)),v=t(69031);function c(h){return h&&h.__esModule?h:{default:h}}function g(h){var p=h.state,E=h.options,O=h.name,I=E.mainAxis,T=I===void 0?!0:I,C=E.altAxis,y=C===void 0?!1:C,b=E.boundary,A=E.rootBoundary,N=E.altBoundary,M=E.padding,R=E.tether,L=R===void 0?!0:R,V=E.tetherOffset,F=V===void 0?0:V,x=(0,m.default)(p,{boundary:b,rootBoundary:A,padding:M,altBoundary:N}),G=(0,r.default)(p.placement),B=(0,d.default)(p.placement),j=!B,U=(0,o.default)(G),K=(0,a.default)(U),$=p.modifiersData.popperOffsets,H=p.rects.reference,tt=p.rects.popper,ft=typeof F=="function"?F(Object.assign({},p.rects,{placement:p.placement})):F,dt=typeof ft=="number"?{mainAxis:ft,altAxis:ft}:Object.assign({mainAxis:0,altAxis:0},ft),z=p.modifiersData.offset?p.modifiersData.offset[p.placement]:null,X={x:0,y:0};if($){if(T){var et,ct=U==="y"?e.top:e.left,ut=U==="y"?e.bottom:e.right,St=U==="y"?"height":"width",Mt=$[U],wt=Mt+x[ct],Rt=Mt-x[ut],ht=L?-tt[St]/2:0,rt=B===e.start?H[St]:tt[St],gt=B===e.start?-tt[St]:-H[St],Q=p.elements.arrow,q=L&&Q?(0,u.default)(Q):{width:0,height:0},nt=p.modifiersData["arrow#persistent"]?p.modifiersData["arrow#persistent"].padding:(0,i.default)(),Et=nt[ct],it=nt[ut],ot=(0,s.within)(0,H[St],q[St]),Pt=j?H[St]/2-ht-ot-Et-dt.mainAxis:rt-ot-Et-dt.mainAxis,J=j?-H[St]/2+ht+ot+it+dt.mainAxis:gt+ot+it+dt.mainAxis,st=p.elements.arrow&&(0,l.default)(p.elements.arrow),Ct=st?U==="y"?st.clientTop||0:st.clientLeft||0:0,At=(et=z==null?void 0:z[U])!=null?et:0,Bt=Mt+Pt-At-Ct,Ut=Mt+J-At,bt=(0,s.within)(L?(0,v.min)(wt,Bt):wt,Mt,L?(0,v.max)(Rt,Ut):Rt);$[U]=bt,X[U]=bt-Mt}if(y){var lt,pt=U==="x"?e.top:e.left,It=U==="x"?e.bottom:e.right,Tt=$[K],Nt=K==="y"?"height":"width",Ft=Tt+x[pt],jt=Tt-x[It],Kt=[e.top,e.left].indexOf(G)!==-1,Wt=(lt=z==null?void 0:z[K])!=null?lt:0,$t=Kt?Ft:Tt-H[Nt]-tt[Nt]-Wt+dt.altAxis,zt=Kt?Tt+H[Nt]+tt[Nt]-Wt-dt.altAxis:jt,Zt=L&&Kt?(0,s.withinMaxClamp)($t,Tt,zt):(0,s.within)(L?$t:Ft,Tt,L?zt:jt);$[K]=Zt,X[K]=Zt-Tt}p.modifiersData[O]=X}}var f=n.default={name:"preventOverflow",enabled:!0,phase:"main",fn:g,requiresIfExists:["offset"]}},62642:function(S,n,t){"use strict";n.__esModule=!0,n.defaultModifiers=n.createPopper=void 0;var e=t(66641);n.popperGenerator=e.popperGenerator,n.detectOverflow=e.detectOverflow;var r=u(t(84601)),o=u(t(98916)),a=u(t(60421)),s=u(t(56304));function u(d){return d&&d.__esModule?d:{default:d}}var l=n.defaultModifiers=[r.default,o.default,a.default,s.default],m=n.createPopper=(0,e.popperGenerator)({defaultModifiers:l})},7925:function(S,n,t){"use strict";n.__esModule=!0;var e={createPopper:!0,createPopperLite:!0,defaultModifiers:!0,popperGenerator:!0,detectOverflow:!0};n.defaultModifiers=n.createPopperLite=n.createPopper=void 0;var r=t(66641);n.popperGenerator=r.popperGenerator,n.detectOverflow=r.detectOverflow;var o=f(t(84601)),a=f(t(98916)),s=f(t(60421)),u=f(t(56304)),l=f(t(36707)),m=f(t(17267)),d=f(t(44454)),i=f(t(57243)),v=f(t(66095)),c=t(62642);n.createPopperLite=c.createPopper;var g=t(91078);Object.keys(g).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===g[E]||(n[E]=g[E])});function f(E){return E&&E.__esModule?E:{default:E}}var h=n.defaultModifiers=[o.default,a.default,s.default,u.default,l.default,m.default,d.default,i.default,v.default],p=n.createPopperLite=n.createPopper=(0,r.popperGenerator)({defaultModifiers:h})},44744:function(S,n,t){"use strict";n.__esModule=!0,n.default=u;var e=s(t(14380)),r=t(41521),o=s(t(31584)),a=s(t(38141));function s(l){return l&&l.__esModule?l:{default:l}}function u(l,m){m===void 0&&(m={});var d=m,i=d.placement,v=d.boundary,c=d.rootBoundary,g=d.padding,f=d.flipVariations,h=d.allowedAutoPlacements,p=h===void 0?r.placements:h,E=(0,e.default)(i),O=E?f?r.variationPlacements:r.variationPlacements.filter(function(C){return(0,e.default)(C)===E}):r.basePlacements,I=O.filter(function(C){return p.indexOf(C)>=0});I.length===0&&(I=O);var T=I.reduce(function(C,y){return C[y]=(0,o.default)(l,{placement:y,boundary:v,rootBoundary:c,padding:g})[(0,a.default)(y)],C},{});return Object.keys(T).sort(function(C,y){return T[C]-T[y]})}},47566:function(S,n,t){"use strict";n.__esModule=!0,n.default=u;var e=s(t(38141)),r=s(t(14380)),o=s(t(7770)),a=t(41521);function s(l){return l&&l.__esModule?l:{default:l}}function u(l){var m=l.reference,d=l.element,i=l.placement,v=i?(0,e.default)(i):null,c=i?(0,r.default)(i):null,g=m.x+m.width/2-d.width/2,f=m.y+m.height/2-d.height/2,h;switch(v){case a.top:h={x:g,y:m.y-d.height};break;case a.bottom:h={x:g,y:m.y+m.height};break;case a.right:h={x:m.x+m.width,y:f};break;case a.left:h={x:m.x-d.width,y:f};break;default:h={x:m.x,y:m.y}}var p=v?(0,o.default)(v):null;if(p!=null){var E=p==="y"?"height":"width";switch(c){case a.start:h[p]=h[p]-(m[E]/2-d[E]/2);break;case a.end:h[p]=h[p]+(m[E]/2-d[E]/2);break;default:}}return h}},80798:function(S,n){"use strict";n.__esModule=!0,n.default=t;function t(e){var r;return function(){return r||(r=new Promise(function(o){Promise.resolve().then(function(){r=void 0,o(e())})})),r}}},31584:function(S,n,t){"use strict";n.__esModule=!0,n.default=v;var e=i(t(86380)),r=i(t(33733)),o=i(t(32125)),a=i(t(47566)),s=i(t(31855)),u=t(41521),l=t(72600),m=i(t(77631)),d=i(t(54824));function i(c){return c&&c.__esModule?c:{default:c}}function v(c,g){g===void 0&&(g={});var f=g,h=f.placement,p=h===void 0?c.placement:h,E=f.strategy,O=E===void 0?c.strategy:E,I=f.boundary,T=I===void 0?u.clippingParents:I,C=f.rootBoundary,y=C===void 0?u.viewport:C,b=f.elementContext,A=b===void 0?u.popper:b,N=f.altBoundary,M=N===void 0?!1:N,R=f.padding,L=R===void 0?0:R,V=(0,m.default)(typeof L!="number"?L:(0,d.default)(L,u.basePlacements)),F=A===u.popper?u.reference:u.popper,x=c.rects.popper,G=c.elements[M?F:A],B=(0,e.default)((0,l.isElement)(G)?G:G.contextElement||(0,r.default)(c.elements.popper),T,y,O),j=(0,o.default)(c.elements.reference),U=(0,a.default)({reference:j,element:x,strategy:"absolute",placement:p}),K=(0,s.default)(Object.assign({},x,U)),$=A===u.popper?K:j,H={top:B.top-$.top+V.top,bottom:$.bottom-B.bottom+V.bottom,left:B.left-$.left+V.left,right:$.right-B.right+V.right},tt=c.modifiersData.offset;if(A===u.popper&&tt){var ft=tt[p];Object.keys(H).forEach(function(dt){var z=[u.right,u.bottom].indexOf(dt)>=0?1:-1,X=[u.top,u.bottom].indexOf(dt)>=0?"y":"x";H[dt]+=ft[X]*z})}return H}},54824:function(S,n){"use strict";n.__esModule=!0,n.default=t;function t(e,r){return r.reduce(function(o,a){return o[a]=e,o},{})}},39571:function(S,n){"use strict";n.__esModule=!0,n.default=t;function t(e){return e==="x"?"y":"x"}},38141:function(S,n,t){"use strict";n.__esModule=!0,n.default=r;var e=t(41521);function r(o){return o.split("-")[0]}},92385:function(S,n){"use strict";n.__esModule=!0,n.default=t;function t(){return{top:0,right:0,bottom:0,left:0}}},7770:function(S,n){"use strict";n.__esModule=!0,n.default=t;function t(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}},79641:function(S,n){"use strict";n.__esModule=!0,n.default=e;var t={left:"right",right:"left",bottom:"top",top:"bottom"};function e(r){return r.replace(/left|right|bottom|top/g,function(o){return t[o]})}},71976:function(S,n){"use strict";n.__esModule=!0,n.default=e;var t={start:"end",end:"start"};function e(r){return r.replace(/start|end/g,function(o){return t[o]})}},14380:function(S,n){"use strict";n.__esModule=!0,n.default=t;function t(e){return e.split("-")[1]}},69031:function(S,n){"use strict";n.__esModule=!0,n.round=n.min=n.max=void 0;var t=n.max=Math.max,e=n.min=Math.min,r=n.round=Math.round},46343:function(S,n){"use strict";n.__esModule=!0,n.default=t;function t(e){var r=e.reduce(function(o,a){var s=o[a.name];return o[a.name]=s?Object.assign({},s,a,{options:Object.assign({},s.options,a.options),data:Object.assign({},s.data,a.data)}):a,o},{});return Object.keys(r).map(function(o){return r[o]})}},77631:function(S,n,t){"use strict";n.__esModule=!0,n.default=o;var e=r(t(92385));function r(a){return a&&a.__esModule?a:{default:a}}function o(a){return Object.assign({},(0,e.default)(),a)}},17859:function(S,n,t){"use strict";n.__esModule=!0,n.default=o;var e=t(41521);function r(a){var s=new Map,u=new Set,l=[];a.forEach(function(d){s.set(d.name,d)});function m(d){u.add(d.name);var i=[].concat(d.requires||[],d.requiresIfExists||[]);i.forEach(function(v){if(!u.has(v)){var c=s.get(v);c&&m(c)}}),l.push(d)}return a.forEach(function(d){u.has(d.name)||m(d)}),l}function o(a){var s=r(a);return e.modifierPhases.reduce(function(u,l){return u.concat(s.filter(function(m){return m.phase===l}))},[])}},31855:function(S,n){"use strict";n.__esModule=!0,n.default=t;function t(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}},97353:function(S,n){"use strict";n.__esModule=!0,n.default=t;function t(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(r){return r.brand+"/"+r.version}).join(" "):navigator.userAgent}},76770:function(S,n,t){"use strict";n.__esModule=!0,n.within=r,n.withinMaxClamp=o;var e=t(69031);function r(a,s,u){return(0,e.max)(a,(0,e.min)(s,u))}function o(a,s,u){var l=r(a,s,u);return l>u?u:l}},27061:function(S){"use strict";/*! @license DOMPurify 2.5.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.5.0/LICENSE */(function(n,t){S.exports=t()})(void 0,function(){"use strict";function n(J){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(st){return typeof st}:function(st){return st&&typeof Symbol=="function"&&st.constructor===Symbol&&st!==Symbol.prototype?"symbol":typeof st},n(J)}function t(J,st){return t=Object.setPrototypeOf||function(){function Ct(At,Bt){return At.__proto__=Bt,At}return Ct}(),t(J,st)}function e(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(J){return!1}}function r(J,st,Ct){return e()?r=Reflect.construct:r=function(){function At(Bt,Ut,bt){var lt=[null];lt.push.apply(lt,Ut);var pt=Function.bind.apply(Bt,lt),It=new pt;return bt&&t(It,bt.prototype),It}return At}(),r.apply(null,arguments)}function o(J){return a(J)||s(J)||u(J)||m()}function a(J){if(Array.isArray(J))return l(J)}function s(J){if(typeof Symbol!="undefined"&&J[Symbol.iterator]!=null||J["@@iterator"]!=null)return Array.from(J)}function u(J,st){if(J){if(typeof J=="string")return l(J,st);var Ct=Object.prototype.toString.call(J).slice(8,-1);if(Ct==="Object"&&J.constructor&&(Ct=J.constructor.name),Ct==="Map"||Ct==="Set")return Array.from(J);if(Ct==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ct))return l(J,st)}}function l(J,st){(st==null||st>J.length)&&(st=J.length);for(var Ct=0,At=new Array(st);Ct1?Ct-1:0),Bt=1;Bt/gm),wt=h(/\${[\w\W]*}/gm),Rt=h(/^data-[\-\w.\u00B7-\uFFFF]/),ht=h(/^aria-[\-\w]+$/),rt=h(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),gt=h(/^(?:\w+script|data):/i),Q=h(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),q=h(/^html$/i),nt=h(/^[a-z][.\w]*(-[.\w]+)+$/i),Et=function(){function J(){return typeof window=="undefined"?null:window}return J}(),it=function(){function J(st,Ct){if(n(st)!=="object"||typeof st.createPolicy!="function")return null;var At=null,Bt="data-tt-policy-suffix";Ct.currentScript&&Ct.currentScript.hasAttribute(Bt)&&(At=Ct.currentScript.getAttribute(Bt));var Ut="dompurify"+(At?"#"+At:"");try{return st.createPolicy(Ut,{createHTML:function(){function bt(lt){return lt}return bt}(),createScriptURL:function(){function bt(lt){return lt}return bt}()})}catch(bt){return null}}return J}();function ot(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Et(),st=function(){function mt(Y){return ot(Y)}return mt}();if(st.version="2.5.0",st.removed=[],!J||!J.document||J.document.nodeType!==9)return st.isSupported=!1,st;var Ct=J.document,At=J.document,Bt=J.DocumentFragment,Ut=J.HTMLTemplateElement,bt=J.Node,lt=J.Element,pt=J.NodeFilter,It=J.NamedNodeMap,Tt=It===void 0?J.NamedNodeMap||J.MozNamedAttrMap:It,Nt=J.HTMLFormElement,Ft=J.DOMParser,jt=J.trustedTypes,Kt=lt.prototype,Wt=U(Kt,"cloneNode"),$t=U(Kt,"nextSibling"),zt=U(Kt,"childNodes"),Zt=U(Kt,"parentNode");if(typeof Ut=="function"){var Be=At.createElement("template");Be.content&&Be.content.ownerDocument&&(At=Be.content.ownerDocument)}var te=it(jt,Ct),De=te?te.createHTML(""):"",ve=At,Fe=ve.implementation,nn=ve.createNodeIterator,rn=ve.createDocumentFragment,Ye=ve.getElementsByTagName,on=Ct.importNode,an={};try{an=j(At).documentMode?At.documentMode:{}}catch(mt){}var re={};st.isSupported=typeof Zt=="function"&&Fe&&Fe.createHTMLDocument!==void 0&&an!==9;var $e=St,He=Mt,he=wt,Oe=Rt,oe=ht,ue=gt,ge=Q,xe=nt,me=rt,Xt=null,un=B({},[].concat(o(K),o($),o(H),o(ft),o(z))),Jt=null,sn=B({},[].concat(o(X),o(et),o(ct),o(ut))),Ht=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),pe=null,Ve=null,We=!0,Ie=!0,kt=!1,cn=!0,ye=!1,ze=!0,le=!1,se=!1,ke=!1,Se=!1,je=!1,Ae=!1,ln=!0,Xe=!1,Sn="user-content-",ae=!0,Pe=!1,Ee={},Ce=null,fn=B({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),dn=null,vn=B({},["audio","video","img","source","image","track"]),Ne=null,hn=B({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Me="http://www.w3.org/1998/Math/MathML",Ue="http://www.w3.org/2000/svg",ce="http://www.w3.org/1999/xhtml",Te=ce,Je=!1,Qe=null,En=B({},[Me,Ue,ce],A),qt,Ke=["application/xhtml+xml","text/html"],gn="text/html",Qt,be=null,mn=At.createElement("form"),Ze=function(){function mt(Y){return Y instanceof RegExp||Y instanceof Function}return mt}(),qe=function(){function mt(Y){be&&be===Y||((!Y||n(Y)!=="object")&&(Y={}),Y=j(Y),qt=Ke.indexOf(Y.PARSER_MEDIA_TYPE)===-1?qt=gn:qt=Y.PARSER_MEDIA_TYPE,Qt=qt==="application/xhtml+xml"?A:b,Xt="ALLOWED_TAGS"in Y?B({},Y.ALLOWED_TAGS,Qt):un,Jt="ALLOWED_ATTR"in Y?B({},Y.ALLOWED_ATTR,Qt):sn,Qe="ALLOWED_NAMESPACES"in Y?B({},Y.ALLOWED_NAMESPACES,A):En,Ne="ADD_URI_SAFE_ATTR"in Y?B(j(hn),Y.ADD_URI_SAFE_ATTR,Qt):hn,dn="ADD_DATA_URI_TAGS"in Y?B(j(vn),Y.ADD_DATA_URI_TAGS,Qt):vn,Ce="FORBID_CONTENTS"in Y?B({},Y.FORBID_CONTENTS,Qt):fn,pe="FORBID_TAGS"in Y?B({},Y.FORBID_TAGS,Qt):{},Ve="FORBID_ATTR"in Y?B({},Y.FORBID_ATTR,Qt):{},Ee="USE_PROFILES"in Y?Y.USE_PROFILES:!1,We=Y.ALLOW_ARIA_ATTR!==!1,Ie=Y.ALLOW_DATA_ATTR!==!1,kt=Y.ALLOW_UNKNOWN_PROTOCOLS||!1,cn=Y.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ye=Y.SAFE_FOR_TEMPLATES||!1,ze=Y.SAFE_FOR_XML!==!1,le=Y.WHOLE_DOCUMENT||!1,Se=Y.RETURN_DOM||!1,je=Y.RETURN_DOM_FRAGMENT||!1,Ae=Y.RETURN_TRUSTED_TYPE||!1,ke=Y.FORCE_BODY||!1,ln=Y.SANITIZE_DOM!==!1,Xe=Y.SANITIZE_NAMED_PROPS||!1,ae=Y.KEEP_CONTENT!==!1,Pe=Y.IN_PLACE||!1,me=Y.ALLOWED_URI_REGEXP||me,Te=Y.NAMESPACE||ce,Ht=Y.CUSTOM_ELEMENT_HANDLING||{},Y.CUSTOM_ELEMENT_HANDLING&&Ze(Y.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ht.tagNameCheck=Y.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Y.CUSTOM_ELEMENT_HANDLING&&Ze(Y.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ht.attributeNameCheck=Y.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Y.CUSTOM_ELEMENT_HANDLING&&typeof Y.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Ht.allowCustomizedBuiltInElements=Y.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ye&&(Ie=!1),je&&(Se=!0),Ee&&(Xt=B({},o(z)),Jt=[],Ee.html===!0&&(B(Xt,K),B(Jt,X)),Ee.svg===!0&&(B(Xt,$),B(Jt,et),B(Jt,ut)),Ee.svgFilters===!0&&(B(Xt,H),B(Jt,et),B(Jt,ut)),Ee.mathMl===!0&&(B(Xt,ft),B(Jt,ct),B(Jt,ut))),Y.ADD_TAGS&&(Xt===un&&(Xt=j(Xt)),B(Xt,Y.ADD_TAGS,Qt)),Y.ADD_ATTR&&(Jt===sn&&(Jt=j(Jt)),B(Jt,Y.ADD_ATTR,Qt)),Y.ADD_URI_SAFE_ATTR&&B(Ne,Y.ADD_URI_SAFE_ATTR,Qt),Y.FORBID_CONTENTS&&(Ce===fn&&(Ce=j(Ce)),B(Ce,Y.FORBID_CONTENTS,Qt)),ae&&(Xt["#text"]=!0),le&&B(Xt,["html","head","body"]),Xt.table&&(B(Xt,["tbody"]),delete pe.tbody),f&&f(Y),be=Y)}return mt}(),Re=B({},["mi","mo","mn","ms","mtext"]),pn=B({},["foreignobject","desc","title","annotation-xml"]),_e=B({},["title","style","font","a","script"]),we=B({},$);B(we,H),B(we,tt);var tn=B({},ft);B(tn,dt);var yn=function(){function mt(Y){var vt=Zt(Y);(!vt||!vt.tagName)&&(vt={namespaceURI:Te,tagName:"template"});var Ot=b(Y.tagName),xt=b(vt.tagName);return Qe[Y.namespaceURI]?Y.namespaceURI===Ue?vt.namespaceURI===ce?Ot==="svg":vt.namespaceURI===Me?Ot==="svg"&&(xt==="annotation-xml"||Re[xt]):!!we[Ot]:Y.namespaceURI===Me?vt.namespaceURI===ce?Ot==="math":vt.namespaceURI===Ue?Ot==="math"&&pn[xt]:!!tn[Ot]:Y.namespaceURI===ce?vt.namespaceURI===Ue&&!pn[xt]||vt.namespaceURI===Me&&!Re[xt]?!1:!tn[Ot]&&(_e[Ot]||!we[Ot]):!!(qt==="application/xhtml+xml"&&Qe[Y.namespaceURI]):!1}return mt}(),ee=function(){function mt(Y){y(st.removed,{element:Y});try{Y.parentNode.removeChild(Y)}catch(vt){try{Y.outerHTML=De}catch(Ot){Y.remove()}}}return mt}(),Le=function(){function mt(Y,vt){try{y(st.removed,{attribute:vt.getAttributeNode(Y),from:vt})}catch(Ot){y(st.removed,{attribute:null,from:vt})}if(vt.removeAttribute(Y),Y==="is"&&!Jt[Y])if(Se||je)try{ee(vt)}catch(Ot){}else try{vt.setAttribute(Y,"")}catch(Ot){}}return mt}(),Cn=function(){function mt(Y){var vt,Ot;if(ke)Y=""+Y;else{var xt=N(Y,/^[\r\n\t ]+/);Ot=xt&&xt[0]}qt==="application/xhtml+xml"&&Te===ce&&(Y=''+Y+"");var Dt=te?te.createHTML(Y):Y;if(Te===ce)try{vt=new Ft().parseFromString(Dt,qt)}catch(Vt){}if(!vt||!vt.documentElement){vt=Fe.createDocument(Te,"template",null);try{vt.documentElement.innerHTML=Je?De:Dt}catch(Vt){}}var Gt=vt.body||vt.documentElement;return Y&&Ot&&Gt.insertBefore(At.createTextNode(Ot),Gt.childNodes[0]||null),Te===ce?Ye.call(vt,le?"html":"body")[0]:le?vt.documentElement:Gt}return mt}(),P=function(){function mt(Y){return nn.call(Y.ownerDocument||Y,Y,pt.SHOW_ELEMENT|pt.SHOW_COMMENT|pt.SHOW_TEXT|pt.SHOW_PROCESSING_INSTRUCTION|pt.SHOW_CDATA_SECTION,null,!1)}return mt}(),w=function(){function mt(Y){return Y instanceof Nt&&(typeof Y.nodeName!="string"||typeof Y.textContent!="string"||typeof Y.removeChild!="function"||!(Y.attributes instanceof Tt)||typeof Y.removeAttribute!="function"||typeof Y.setAttribute!="function"||typeof Y.namespaceURI!="string"||typeof Y.insertBefore!="function"||typeof Y.hasChildNodes!="function")}return mt}(),D=function(){function mt(Y){return n(bt)==="object"?Y instanceof bt:Y&&n(Y)==="object"&&typeof Y.nodeType=="number"&&typeof Y.nodeName=="string"}return mt}(),W=function(){function mt(Y,vt,Ot){re[Y]&&T(re[Y],function(xt){xt.call(st,vt,Ot,be)})}return mt}(),Z=function(){function mt(Y){var vt;if(W("beforeSanitizeElements",Y,null),w(Y)||V(/[\u0080-\uFFFF]/,Y.nodeName))return ee(Y),!0;var Ot=Qt(Y.nodeName);if(W("uponSanitizeElement",Y,{tagName:Ot,allowedTags:Xt}),Y.hasChildNodes()&&!D(Y.firstElementChild)&&(!D(Y.content)||!D(Y.content.firstElementChild))&&V(/<[/\w]/g,Y.innerHTML)&&V(/<[/\w]/g,Y.textContent)||Ot==="select"&&V(/