@piedata/pieui 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Common/IOEventsCard/types/index.d.ts +3 -2
- package/dist/components/Common/IOEventsCard/types/index.d.ts.map +1 -1
- package/dist/components/Common/IOEventsCard/ui/IOEventsCard.d.ts.map +1 -1
- package/dist/components/index.esm.js +1 -9
- package/dist/components/index.js +1 -20
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +2 -18
- package/dist/index.js +2 -41
- package/dist/util/useIsSupported.d.ts.map +1 -1
- package/package.json +9 -9
|
@@ -10,8 +10,9 @@ export interface IOEventsCardData {
|
|
|
10
10
|
}
|
|
11
11
|
export interface IOEventData extends Omit<ToastOptions, 'transition' | 'style' | 'className' | 'onClick' | 'onClose' | 'onOpen'> {
|
|
12
12
|
message: string;
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
alertType?: 'info' | 'error' | 'success' | 'warn';
|
|
14
|
+
transition?: 'bounce' | 'slide' | 'zoom' | 'flip';
|
|
15
|
+
sx?: CSSProperties;
|
|
15
16
|
}
|
|
16
17
|
export interface NotificationEvent extends NotificationOptions {
|
|
17
18
|
title: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/IOEventsCard/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,WAAW,WAAY,SAAQ,IAAI,CACrC,YAAY,EACZ,YAAY,GAAG,OAAO,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAC1E;IACG,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/IOEventsCard/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,WAAW,WAAY,SAAQ,IAAI,CACrC,YAAY,EACZ,YAAY,GAAG,OAAO,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAC1E;IACG,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAA;IACjD,UAAU,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;IACjD,EAAE,CAAC,EAAE,aAAa,CAAA;CACrB;AAED,MAAM,WAAW,iBAAkB,SAAQ,mBAAmB;IAC1D,KAAK,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,iBAAkB,SAAQ,uBAAuB,CAAC,gBAAgB,CAAC;CAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IOEventsCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/IOEventsCard/ui/IOEventsCard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IOEventsCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/IOEventsCard/ui/IOEventsCard.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAe,iBAAiB,EAAE,MAAM,UAAU,CAAA;AA8EzD,QAAA,MAAM,YAAY,GAAI,UAAU,iBAAiB,4CA6DhD,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -1,10 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var S8=Object.create;var{getPrototypeOf:T8,defineProperty:h0,getOwnPropertyNames:x8}=Object;var j8=Object.prototype.hasOwnProperty;var u9=($,Z,Q)=>{Q=$!=null?S8(T8($)):{};let J=Z||!$||!$.__esModule?h0(Q,"default",{value:$,enumerable:!0}):Q;for(let K of x8($))if(!j8.call(J,K))h0(J,K,{get:()=>$[K],enumerable:!0});return J};var E=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var g8=($,Z)=>{for(var Q in Z)h0($,Q,{get:Z[Q],enumerable:!0,configurable:!0,set:(J)=>Z[Q]=()=>J})};var K9=E((r1)=>{Object.defineProperty(r1,"__esModule",{value:!0});r1.Doctype=r1.CDATA=r1.Tag=r1.Style=r1.Script=r1.Comment=r1.Directive=r1.Text=r1.Root=r1.isTag=r1.ElementType=void 0;var i;(function($){$.Root="root",$.Text="text",$.Directive="directive",$.Comment="comment",$.Script="script",$.Style="style",$.Tag="tag",$.CDATA="cdata",$.Doctype="doctype"})(i=r1.ElementType||(r1.ElementType={}));function rZ($){return $.type===i.Tag||$.type===i.Script||$.type===i.Style}r1.isTag=rZ;r1.Root=i.Root;r1.Text=i.Text;r1.Directive=i.Directive;r1.Comment=i.Comment;r1.Script=i.Script;r1.Style=i.Style;r1.Tag=i.Tag;r1.CDATA=i.CDATA;r1.Doctype=i.Doctype});var X9=E((D)=>{var F$=D&&D.__extends||function(){var $=function(Z,Q){return $=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,K){J.__proto__=K}||function(J,K){for(var U in K)if(Object.prototype.hasOwnProperty.call(K,U))J[U]=K[U]},$(Z,Q)};return function(Z,Q){if(typeof Q!=="function"&&Q!==null)throw new TypeError("Class extends value "+String(Q)+" is not a constructor or null");$(Z,Q);function J(){this.constructor=Z}Z.prototype=Q===null?Object.create(Q):(J.prototype=Q.prototype,new J)}}(),l$=D&&D.__assign||function(){return l$=Object.assign||function($){for(var Z,Q=1,J=arguments.length;Q<J;Q++){Z=arguments[Q];for(var K in Z)if(Object.prototype.hasOwnProperty.call(Z,K))$[K]=Z[K]}return $},l$.apply(this,arguments)};Object.defineProperty(D,"__esModule",{value:!0});D.cloneNode=D.hasChildren=D.isDocument=D.isDirective=D.isComment=D.isText=D.isCDATA=D.isTag=D.Element=D.Document=D.CDATA=D.NodeWithChildren=D.ProcessingInstruction=D.Comment=D.Text=D.DataNode=D.Node=void 0;var c=K9(),Y9=function(){function $(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty($.prototype,"parentNode",{get:function(){return this.parent},set:function(Z){this.parent=Z},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"previousSibling",{get:function(){return this.prev},set:function(Z){this.prev=Z},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"nextSibling",{get:function(){return this.next},set:function(Z){this.next=Z},enumerable:!1,configurable:!0}),$.prototype.cloneNode=function(Z){if(Z===void 0)Z=!1;return G9(this,Z)},$}();D.Node=Y9;var w0=function($){F$(Z,$);function Z(Q){var J=$.call(this)||this;return J.data=Q,J}return Object.defineProperty(Z.prototype,"nodeValue",{get:function(){return this.data},set:function(Q){this.data=Q},enumerable:!1,configurable:!0}),Z}(Y9);D.DataNode=w0;var e1=function($){F$(Z,$);function Z(){var Q=$!==null&&$.apply(this,arguments)||this;return Q.type=c.ElementType.Text,Q}return Object.defineProperty(Z.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),Z}(w0);D.Text=e1;var $6=function($){F$(Z,$);function Z(){var Q=$!==null&&$.apply(this,arguments)||this;return Q.type=c.ElementType.Comment,Q}return Object.defineProperty(Z.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),Z}(w0);D.Comment=$6;var Z6=function($){F$(Z,$);function Z(Q,J){var K=$.call(this,J)||this;return K.name=Q,K.type=c.ElementType.Directive,K}return Object.defineProperty(Z.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Z}(w0);D.ProcessingInstruction=Z6;var A0=function($){F$(Z,$);function Z(Q){var J=$.call(this)||this;return J.children=Q,J}return Object.defineProperty(Z.prototype,"firstChild",{get:function(){var Q;return(Q=this.children[0])!==null&&Q!==void 0?Q:null},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"childNodes",{get:function(){return this.children},set:function(Q){this.children=Q},enumerable:!1,configurable:!0}),Z}(Y9);D.NodeWithChildren=A0;var Q6=function($){F$(Z,$);function Z(){var Q=$!==null&&$.apply(this,arguments)||this;return Q.type=c.ElementType.CDATA,Q}return Object.defineProperty(Z.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),Z}(A0);D.CDATA=Q6;var J6=function($){F$(Z,$);function Z(){var Q=$!==null&&$.apply(this,arguments)||this;return Q.type=c.ElementType.Root,Q}return Object.defineProperty(Z.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),Z}(A0);D.Document=J6;var K6=function($){F$(Z,$);function Z(Q,J,K,U){if(K===void 0)K=[];if(U===void 0)U=Q==="script"?c.ElementType.Script:Q==="style"?c.ElementType.Style:c.ElementType.Tag;var Y=$.call(this,K)||this;return Y.name=Q,Y.attribs=J,Y.type=U,Y}return Object.defineProperty(Z.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"tagName",{get:function(){return this.name},set:function(Q){this.name=Q},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"attributes",{get:function(){var Q=this;return Object.keys(this.attribs).map(function(J){var K,U;return{name:J,value:Q.attribs[J],namespace:(K=Q["x-attribsNamespace"])===null||K===void 0?void 0:K[J],prefix:(U=Q["x-attribsPrefix"])===null||U===void 0?void 0:U[J]}})},enumerable:!1,configurable:!0}),Z}(A0);D.Element=K6;function U6($){return c.isTag($)}D.isTag=U6;function Y6($){return $.type===c.ElementType.CDATA}D.isCDATA=Y6;function G6($){return $.type===c.ElementType.Text}D.isText=G6;function X6($){return $.type===c.ElementType.Comment}D.isComment=X6;function H6($){return $.type===c.ElementType.Directive}D.isDirective=H6;function V6($){return $.type===c.ElementType.Root}D.isDocument=V6;function GQ($){return Object.prototype.hasOwnProperty.call($,"children")}D.hasChildren=GQ;function G9($,Z){if(Z===void 0)Z=!1;var Q;if(G6($))Q=new e1($.data);else if(X6($))Q=new $6($.data);else if(U6($)){var J=Z?U9($.children):[],K=new K6($.name,l$({},$.attribs),J);if(J.forEach(function(X){return X.parent=K}),$.namespace!=null)K.namespace=$.namespace;if($["x-attribsNamespace"])K["x-attribsNamespace"]=l$({},$["x-attribsNamespace"]);if($["x-attribsPrefix"])K["x-attribsPrefix"]=l$({},$["x-attribsPrefix"]);Q=K}else if(Y6($)){var J=Z?U9($.children):[],U=new Q6(J);J.forEach(function(V){return V.parent=U}),Q=U}else if(V6($)){var J=Z?U9($.children):[],Y=new J6(J);if(J.forEach(function(V){return V.parent=Y}),$["x-mode"])Y["x-mode"]=$["x-mode"];Q=Y}else if(H6($)){var G=new Z6($.name,$.data);if($["x-name"]!=null)G["x-name"]=$["x-name"],G["x-publicId"]=$["x-publicId"],G["x-systemId"]=$["x-systemId"];Q=G}else throw new Error("Not implemented yet: ".concat($.type));if(Q.startIndex=$.startIndex,Q.endIndex=$.endIndex,$.sourceCodeLocation!=null)Q.sourceCodeLocation=$.sourceCodeLocation;return Q}D.cloneNode=G9;function U9($){var Z=$.map(function(J){return G9(J,!0)});for(var Q=1;Q<Z.length;Q++)Z[Q].prev=Z[Q-1],Z[Q-1].next=Z[Q];return Z}});var V9=E((e)=>{var XQ=e&&e.__createBinding||(Object.create?function($,Z,Q,J){if(J===void 0)J=Q;var K=Object.getOwnPropertyDescriptor(Z,Q);if(!K||("get"in K?!Z.__esModule:K.writable||K.configurable))K={enumerable:!0,get:function(){return Z[Q]}};Object.defineProperty($,J,K)}:function($,Z,Q,J){if(J===void 0)J=Q;$[J]=Z[Q]}),HQ=e&&e.__exportStar||function($,Z){for(var Q in $)if(Q!=="default"&&!Object.prototype.hasOwnProperty.call(Z,Q))XQ(Z,$,Q)};Object.defineProperty(e,"__esModule",{value:!0});e.DomHandler=void 0;var H9=K9(),z$=X9();HQ(X9(),e);var M6={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},F6=function(){function $(Z,Q,J){if(this.dom=[],this.root=new z$.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof Q==="function")J=Q,Q=M6;if(typeof Z==="object")Q=Z,Z=void 0;this.callback=Z!==null&&Z!==void 0?Z:null,this.options=Q!==null&&Q!==void 0?Q:M6,this.elementCB=J!==null&&J!==void 0?J:null}return $.prototype.onparserinit=function(Z){this.parser=Z},$.prototype.onreset=function(){this.dom=[],this.root=new z$.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},$.prototype.onend=function(){if(this.done)return;this.done=!0,this.parser=null,this.handleCallback(null)},$.prototype.onerror=function(Z){this.handleCallback(Z)},$.prototype.onclosetag=function(){this.lastNode=null;var Z=this.tagStack.pop();if(this.options.withEndIndices)Z.endIndex=this.parser.endIndex;if(this.elementCB)this.elementCB(Z)},$.prototype.onopentag=function(Z,Q){var J=this.options.xmlMode?H9.ElementType.Tag:void 0,K=new z$.Element(Z,Q,void 0,J);this.addNode(K),this.tagStack.push(K)},$.prototype.ontext=function(Z){var Q=this.lastNode;if(Q&&Q.type===H9.ElementType.Text){if(Q.data+=Z,this.options.withEndIndices)Q.endIndex=this.parser.endIndex}else{var J=new z$.Text(Z);this.addNode(J),this.lastNode=J}},$.prototype.oncomment=function(Z){if(this.lastNode&&this.lastNode.type===H9.ElementType.Comment){this.lastNode.data+=Z;return}var Q=new z$.Comment(Z);this.addNode(Q),this.lastNode=Q},$.prototype.oncommentend=function(){this.lastNode=null},$.prototype.oncdatastart=function(){var Z=new z$.Text(""),Q=new z$.CDATA([Z]);this.addNode(Q),Z.parent=Q,this.lastNode=Z},$.prototype.oncdataend=function(){this.lastNode=null},$.prototype.onprocessinginstruction=function(Z,Q){var J=new z$.ProcessingInstruction(Z,Q);this.addNode(J)},$.prototype.handleCallback=function(Z){if(typeof this.callback==="function")this.callback(Z,this.dom);else if(Z)throw Z},$.prototype.addNode=function(Z){var Q=this.tagStack[this.tagStack.length-1],J=Q.children[Q.children.length-1];if(this.options.withStartIndices)Z.startIndex=this.parser.startIndex;if(this.options.withEndIndices)Z.endIndex=this.parser.endIndex;if(Q.children.push(Z),J)Z.prev=J,J.next=Z;Z.parent=Q,this.lastNode=null},$}();e.DomHandler=F6;e.default=F6});var O6=E((z6)=>{Object.defineProperty(z6,"__esModule",{value:!0});z6.CARRIAGE_RETURN_PLACEHOLDER_REGEX=z6.CARRIAGE_RETURN_PLACEHOLDER=z6.CARRIAGE_RETURN_REGEX=z6.CARRIAGE_RETURN=z6.CASE_SENSITIVE_TAG_NAMES_MAP=z6.CASE_SENSITIVE_TAG_NAMES=void 0;z6.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"];z6.CASE_SENSITIVE_TAG_NAMES_MAP=z6.CASE_SENSITIVE_TAG_NAMES.reduce(function($,Z){return $[Z.toLowerCase()]=Z,$},{});z6.CARRIAGE_RETURN="\r";z6.CARRIAGE_RETURN_REGEX=new RegExp(z6.CARRIAGE_RETURN,"g");z6.CARRIAGE_RETURN_PLACEHOLDER="__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_".concat(Date.now().toString(),"__");z6.CARRIAGE_RETURN_PLACEHOLDER_REGEX=new RegExp(z6.CARRIAGE_RETURN_PLACEHOLDER,"g")});var M9=E((R6)=>{Object.defineProperty(R6,"__esModule",{value:!0});R6.formatAttributes=B6;R6.hasOpenTag=IQ;R6.escapeSpecialCharacters=WQ;R6.revertEscapedCharacters=w6;R6.formatDOM=A6;var R0=V9(),c$=O6();function FQ($){return c$.CASE_SENSITIVE_TAG_NAMES_MAP[$]}function B6($){var Z={},Q=0,J=$.length;for(;Q<J;Q++){var K=$[Q];Z[K.name]=K.value}return Z}function zQ($){$=$.toLowerCase();var Z=FQ($);if(Z)return Z;return $}function IQ($,Z){var Q="<"+Z,J=$.toLowerCase().indexOf(Q);if(J===-1)return!1;var K=$[J+Q.length];return K===">"||K===" "||K==="\t"||K===`
|
|
3
|
-
`||K==="\r"||K==="/"}function WQ($){return $.replace(c$.CARRIAGE_RETURN_REGEX,c$.CARRIAGE_RETURN_PLACEHOLDER)}function w6($){return $.replace(c$.CARRIAGE_RETURN_PLACEHOLDER_REGEX,c$.CARRIAGE_RETURN)}function A6($,Z,Q){var J,K,U,Y;if(Z===void 0)Z=null;var G=[],X,V=0,F=$.length;for(;V<F;V++){var z=$[V];switch(z.nodeType){case 1:{var W=zQ(z.nodeName);X=new R0.Element(W,B6(z.attributes)),X.children=A6(W==="template"?z.content.childNodes:z.childNodes,X);break}case 3:X=new R0.Text(w6((J=z.nodeValue)!==null&&J!==void 0?J:""));break;case 8:X=new R0.Comment((K=z.nodeValue)!==null&&K!==void 0?K:"");break;default:continue}var q=(U=G[V-1])!==null&&U!==void 0?U:null;if(q)q.next=X;X.parent=Z,X.prev=q,X.next=null,G.push(X)}if(Q){if(X=new R0.ProcessingInstruction(Q.substring(0,Q.indexOf(" ")).toLowerCase(),Q),X.next=(Y=G[0])!==null&&Y!==void 0?Y:null,X.parent=Z,G.unshift(X),G[1])G[1].prev=G[0]}return G}});var T6=E((S6)=>{Object.defineProperty(S6,"__esModule",{value:!0});S6.default=RQ;var p$=M9(),D6="html",D0="head",D$="body",AQ=/<([a-zA-Z]+[0-9]?)/,f0=function($,Z){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},F9=function($,Z){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},P6=typeof window==="object"&&window.DOMParser;if(typeof P6==="function")f6=new P6,C6="text/html",F9=function($,Z){if(Z)$="<".concat(Z,">").concat($,"</").concat(Z,">");return f6.parseFromString($,C6)},f0=F9;var f6,C6;if(typeof document==="object"&&document.implementation)i$=document.implementation.createHTMLDocument(),f0=function($,Z){if(Z){var Q=i$.documentElement.querySelector(Z);if(Q)Q.innerHTML=$;return i$}return i$.documentElement.innerHTML=$,i$};var i$,P0=typeof document==="object"&&document.createElement("template"),z9;if(P0&&P0.content)z9=function($){return P0.innerHTML=$,P0.content.childNodes};var N6=function(){return document.createDocumentFragment().childNodes};function RQ($){var Z,Q,J,K,U,Y;$=p$.escapeSpecialCharacters($);var G=AQ.exec($),X=(Z=G===null||G===void 0?void 0:G[1])===null||Z===void 0?void 0:Z.toLowerCase();switch(X){case D6:{var V=F9($);if(!p$.hasOpenTag($,D0)){var F=V.querySelector(D0);(Q=F===null||F===void 0?void 0:F.parentNode)===null||Q===void 0||Q.removeChild(F)}if(!p$.hasOpenTag($,D$)){var F=V.querySelector(D$);(J=F===null||F===void 0?void 0:F.parentNode)===null||J===void 0||J.removeChild(F)}return V.querySelectorAll(D6)}case D0:case D$:{var z=f0($).querySelectorAll(X);if(p$.hasOpenTag($,D$)&&p$.hasOpenTag($,D0))return(U=(K=z[0].parentNode)===null||K===void 0?void 0:K.childNodes)!==null&&U!==void 0?U:N6();return z}default:{if(z9)return z9($);var F=f0($,D$).querySelector(D$);return(Y=F===null||F===void 0?void 0:F.childNodes)!==null&&Y!==void 0?Y:N6()}}}});var x6=E((n$)=>{var PQ=n$&&n$.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(n$,"__esModule",{value:!0});n$.default=SQ;var fQ=PQ(T6()),CQ=M9(),NQ=/<(![a-zA-Z\s]+)>/;function SQ($){if(typeof $!=="string")throw new TypeError("First argument must be a string");if(!$)return[];var Z=NQ.exec($),Q=Z?Z[1]:void 0;return CQ.formatDOM(fQ.default($),null,Q)}});var j6=E((jQ)=>{var TQ=0;jQ.SAME=TQ;var xQ=1;jQ.CAMELCASE=xQ;jQ.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1}});var E6=E((cQ)=>{function vQ($){return _.hasOwnProperty($)?_[$]:null}function u($,Z,Q,J,K,U,Y){this.acceptsBooleans=Z===2||Z===3||Z===4,this.attributeName=J,this.attributeNamespace=K,this.mustUseProperty=Q,this.propertyName=$,this.type=Z,this.sanitizeURL=U,this.removeEmptyString=Y}var _={},yQ=["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"];yQ.forEach(($)=>{_[$]=new u($,0,!1,$,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([$,Z])=>{_[$]=new u($,1,!1,Z,null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(($)=>{_[$]=new u($,2,!1,$.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(($)=>{_[$]=new u($,2,!1,$,null,!1,!1)});["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(($)=>{_[$]=new u($,3,!1,$.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(($)=>{_[$]=new u($,3,!0,$,null,!1,!1)});["capture","download"].forEach(($)=>{_[$]=new u($,4,!1,$,null,!1,!1)});["cols","rows","size","span"].forEach(($)=>{_[$]=new u($,6,!1,$,null,!1,!1)});["rowSpan","start"].forEach(($)=>{_[$]=new u($,5,!1,$.toLowerCase(),null,!1,!1)});var I9=/[\-\:]([a-z])/g,W9=($)=>$[1].toUpperCase();["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(($)=>{let Z=$.replace(I9,W9);_[Z]=new u(Z,1,!1,$,null,!1,!1)});["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(($)=>{let Z=$.replace(I9,W9);_[Z]=new u(Z,1,!1,$,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(($)=>{let Z=$.replace(I9,W9);_[Z]=new u(Z,1,!1,$,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(($)=>{_[$]=new u($,1,!1,$.toLowerCase(),null,!1,!1)});var hQ="xlinkHref";_[hQ]=new u("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(($)=>{_[$]=new u($,1,!1,$.toLowerCase(),null,!0,!0)});var{CAMELCASE:kQ,SAME:bQ,possibleStandardNames:g6}=j6(),mQ=":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",uQ=mQ+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",dQ=RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+uQ+"]*$")),lQ=Object.keys(g6).reduce(($,Z)=>{let Q=g6[Z];if(Q===bQ)$[Z]=Z;else if(Q===kQ)$[Z.toLowerCase()]=Z;else $[Z]=Q;return $},{});cQ.BOOLEAN=3;cQ.BOOLEANISH_STRING=2;cQ.NUMERIC=5;cQ.OVERLOADED_BOOLEAN=4;cQ.POSITIVE_NUMERIC=6;cQ.RESERVED=0;cQ.STRING=1;cQ.getPropertyInfo=vQ;cQ.isCustomAttribute=dQ;cQ.possibleStandardNames=lQ});var b6=E((bY,k6)=>{var _6=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ZJ=/\n/g,QJ=/^\s*/,JJ=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,KJ=/^:\s*/,UJ=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,YJ=/^[;\s]*/,GJ=/^\s+|\s+$/g,XJ=`
|
|
4
|
-
`,v6="/",y6="*",O$="",HJ="comment",VJ="declaration";function MJ($,Z){if(typeof $!=="string")throw new TypeError("First argument must be a string");if(!$)return[];Z=Z||{};var Q=1,J=1;function K(M){var H=M.match(ZJ);if(H)Q+=H.length;var I=M.lastIndexOf(XJ);J=~I?M.length-I:J+M.length}function U(){var M={line:Q,column:J};return function(H){return H.position=new Y(M),V(),H}}function Y(M){this.start=M,this.end={line:Q,column:J},this.source=Z.source}Y.prototype.content=$;function G(M){var H=new Error(Z.source+":"+Q+":"+J+": "+M);if(H.reason=M,H.filename=Z.source,H.line=Q,H.column=J,H.source=$,Z.silent);else throw H}function X(M){var H=M.exec($);if(!H)return;var I=H[0];return K(I),$=$.slice(I.length),H}function V(){X(QJ)}function F(M){var H;M=M||[];while(H=z())if(H!==!1)M.push(H);return M}function z(){var M=U();if(v6!=$.charAt(0)||y6!=$.charAt(1))return;var H=2;while(O$!=$.charAt(H)&&(y6!=$.charAt(H)||v6!=$.charAt(H+1)))++H;if(H+=2,O$===$.charAt(H-1))return G("End of comment missing");var I=$.slice(2,H-2);return J+=2,K(I),$=$.slice(H),J+=2,M({type:HJ,comment:I})}function W(){var M=U(),H=X(JJ);if(!H)return;if(z(),!X(KJ))return G("property missing ':'");var I=X(UJ),w=M({type:VJ,property:h6(H[0].replace(_6,O$)),value:I?h6(I[0].replace(_6,O$)):O$});return X(YJ),w}function q(){var M=[];F(M);var H;while(H=W())if(H!==!1)M.push(H),F(M);return M}return V(),q()}function h6($){return $?$.replace(GJ,O$):O$}k6.exports=MJ});var m6=E((o$)=>{var FJ=o$&&o$.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(o$,"__esModule",{value:!0});o$.default=IJ;var zJ=FJ(b6());function IJ($,Z){let Q=null;if(!$||typeof $!=="string")return Q;let J=zJ.default($),K=typeof Z==="function";return J.forEach((U)=>{if(U.type!=="declaration")return;let{property:Y,value:G}=U;if(K)Z(Y,G,U);else if(G)Q=Q||{},Q[Y]=G}),Q}});var c6=E((d6)=>{Object.defineProperty(d6,"__esModule",{value:!0});d6.camelCase=void 0;var WJ=/^--[a-zA-Z0-9_-]+$/,qJ=/-([a-z])/g,LJ=/^[^-]+$/,OJ=/^-(webkit|moz|ms|o|khtml)-/,BJ=/^-(ms)-/,wJ=function($){return!$||LJ.test($)||WJ.test($)},AJ=function($,Z){return Z.toUpperCase()},u6=function($,Z){return"".concat(Z,"-")},RJ=function($,Z){if(Z===void 0)Z={};if(wJ($))return $;if($=$.toLowerCase(),Z.reactCompat)$=$.replace(BJ,u6);else $=$.replace(OJ,u6);return $.replace(qJ,AJ)};d6.camelCase=RJ});var i6=E((L9,p6)=>{var DJ=L9&&L9.__importDefault||function($){return $&&$.__esModule?$:{default:$}},PJ=DJ(m6()),fJ=c6();function q9($,Z){var Q={};if(!$||typeof $!=="string")return Q;return PJ.default($,function(J,K){if(J&&K)Q[fJ.camelCase(J,Z)]=K}),Q}q9.default=q9;p6.exports=q9});import*as n6 from"react";var O9=E((d)=>{var CJ=d&&d.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(d,"__esModule",{value:!0});d.returnFirstArg=d.canTextBeChildOfNode=d.ELEMENTS_WITH_NO_TEXT_CHILDREN=d.PRESERVE_CUSTOM_ATTRIBUTES=void 0;d.isCustomComponent=TJ;d.setStyleProp=jJ;var NJ=CJ(i6()),SJ=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function TJ($,Z){if(!$.includes("-"))return Boolean(Z&&typeof Z.is==="string");if(SJ.has($))return!1;return!0}var xJ={reactCompat:!0};function jJ($,Z){if(typeof $!=="string")return;if(!$.trim()){Z.style={};return}try{Z.style=NJ.default($,xJ)}catch(Q){Z.style={}}}d.PRESERVE_CUSTOM_ATTRIBUTES=Number(n6.version.split(".")[0])>=16;d.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);var gJ=function($){return!d.ELEMENTS_WITH_NO_TEXT_CHILDREN.has($.name)};d.canTextBeChildOfNode=gJ;var EJ=function($){return $};d.returnFirstArg=EJ});var B9=E((a6)=>{Object.defineProperty(a6,"__esModule",{value:!0});a6.default=hJ;var s$=E6(),o6=O9(),_J=["checked","value"],vJ=["input","select","textarea"],yJ={reset:!0,submit:!0};function hJ($,Z){if($===void 0)$={};var Q={},J=Boolean($.type&&yJ[$.type]);for(var K in $){var U=$[K];if(s$.isCustomAttribute(K)){Q[K]=U;continue}var Y=K.toLowerCase(),G=s6(Y);if(G){var X=s$.getPropertyInfo(G);if(_J.includes(G)&&vJ.includes(Z)&&!J)G=s6("default"+Y);switch(Q[G]=U,X===null||X===void 0?void 0:X.type){case s$.BOOLEAN:Q[G]=!0;break;case s$.OVERLOADED_BOOLEAN:if(U==="")Q[G]=!0;break}continue}if(o6.PRESERVE_CUSTOM_ATTRIBUTES)Q[K]=U}return o6.setStyleProp($.style,Q),Q}function s6($){return s$.possibleStandardNames[$]}});import*as P$ from"react";var t6=E((r$)=>{var bJ=r$&&r$.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(r$,"__esModule",{value:!0});r$.default=r6;var mJ=bJ(B9()),a$=O9(),uJ={cloneElement:P$.cloneElement,createElement:P$.createElement,isValidElement:P$.isValidElement};function r6($,Z){var Q,J,K,U,Y;if(Z===void 0)Z={};var G=[],X=typeof Z.replace==="function",V=(Q=Z.transform)!==null&&Q!==void 0?Q:a$.returnFirstArg,F=(J=Z.library)!==null&&J!==void 0?J:uJ,z=F.cloneElement,W=F.createElement,q=F.isValidElement,M=$.length;for(var H=0;H<M;H++){var I=$[H];if(X){var w=(K=Z.replace)===null||K===void 0?void 0:K.call(Z,I,H);if(q(w)){if(M>1)w=z(w,{key:(U=w.key)!==null&&U!==void 0?U:H});G.push(V(w,I,H));continue}}if(I.type==="text"){var O=!I.data.trim().length;if(O&&I.parent&&!a$.canTextBeChildOfNode(I.parent))continue;if(Z.trim&&O)continue;G.push(V(I.data,I,H));continue}var B=I,L={};if(dJ(B))a$.setStyleProp(B.attribs.style,B.attribs),L=B.attribs;else if(B.attribs)L=mJ.default(B.attribs,B.name);var S=void 0;switch(I.type){case"script":case"style":if(I.children[0])L.dangerouslySetInnerHTML={__html:I.children[0].data};break;case"tag":if(I.name==="textarea"&&I.children[0])L.defaultValue=I.children[0].data;else if((Y=I.children)===null||Y===void 0?void 0:Y.length)S=r6(I.children,Z);break;default:continue}if(M>1)L.key=H;G.push(V(W(I.name,L,S),I,H))}return G.length===1?G[0]:G}function dJ($){return a$.PRESERVE_CUSTOM_ATTRIBUTES&&$.type==="tag"&&a$.isCustomComponent($.name,$.attribs)}});var A9=E((g)=>{var w9=g&&g.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(g,"__esModule",{value:!0});g.htmlToDOM=g.domToReact=g.attributesToProps=g.Text=g.ProcessingInstruction=g.Element=g.Comment=void 0;g.default=pJ;var e6=w9(x6());g.htmlToDOM=e6.default;var lJ=w9(B9());g.attributesToProps=lJ.default;var $8=w9(t6());g.domToReact=$8.default;var C0=V9();Object.defineProperty(g,"Comment",{enumerable:!0,get:function(){return C0.Comment}});Object.defineProperty(g,"Element",{enumerable:!0,get:function(){return C0.Element}});Object.defineProperty(g,"ProcessingInstruction",{enumerable:!0,get:function(){return C0.ProcessingInstruction}});Object.defineProperty(g,"Text",{enumerable:!0,get:function(){return C0.Text}});var cJ={lowerCaseAttributeNames:!1};function pJ($,Z){var Q;if(typeof $!=="string")throw new TypeError("First argument must be a string");if(!$)return[];return $8.default(e6.default($,(Q=Z===null||Z===void 0?void 0:Z.htmlparser2)!==null&&Q!==void 0?Q:cJ),Z)}});import{useContext as $9,useEffect as L0,useRef as SZ}from"react";import{createContext as E8,useContext as _8}from"react";var v8=E8(null),y8=()=>{let $=_8(v8);if(!$)throw new Error("usePieConfig must be used within PieConfigProvider");return $};var S$=()=>{let{enableRenderingLog:$}=y8();return $},d9=S$;import{createContext as e8}from"react";function v($,Z,Q,J){function K(U){return U instanceof Q?U:new Q(function(Y){Y(U)})}return new(Q||(Q=Promise))(function(U,Y){function G(F){try{V(J.next(F))}catch(z){Y(z)}}function X(F){try{V(J.throw(F))}catch(z){Y(z)}}function V(F){F.done?U(F.value):K(F.value).then(G,X)}V((J=J.apply($,Z||[])).next())})}function h8($){return $&&$.__esModule&&Object.prototype.hasOwnProperty.call($,"default")?$.default:$}var u0={exports:{}},A$=typeof Reflect==="object"?Reflect:null,l9=A$&&typeof A$.apply==="function"?A$.apply:function $(Z,Q,J){return Function.prototype.apply.call(Z,Q,J)},Q0;if(A$&&typeof A$.ownKeys==="function")Q0=A$.ownKeys;else if(Object.getOwnPropertySymbols)Q0=function $(Z){return Object.getOwnPropertyNames(Z).concat(Object.getOwnPropertySymbols(Z))};else Q0=function $(Z){return Object.getOwnPropertyNames(Z)};function k8($){if(console&&console.warn)console.warn($)}var p9=Number.isNaN||function $(Z){return Z!==Z};function C(){C.init.call(this)}u0.exports=C;u0.exports.once=d8;C.EventEmitter=C;C.prototype._events=void 0;C.prototype._eventsCount=0;C.prototype._maxListeners=void 0;var c9=10;function G0($){if(typeof $!=="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof $)}Object.defineProperty(C,"defaultMaxListeners",{enumerable:!0,get:function(){return c9},set:function($){if(typeof $!=="number"||$<0||p9($))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+$+".");c9=$}});C.init=function(){if(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)this._events=Object.create(null),this._eventsCount=0;this._maxListeners=this._maxListeners||void 0};C.prototype.setMaxListeners=function $(Z){if(typeof Z!=="number"||Z<0||p9(Z))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+Z+".");return this._maxListeners=Z,this};function i9($){if($._maxListeners===void 0)return C.defaultMaxListeners;return $._maxListeners}C.prototype.getMaxListeners=function $(){return i9(this)};C.prototype.emit=function $(Z){var Q=[];for(var J=1;J<arguments.length;J++)Q.push(arguments[J]);var K=Z==="error",U=this._events;if(U!==void 0)K=K&&U.error===void 0;else if(!K)return!1;if(K){var Y;if(Q.length>0)Y=Q[0];if(Y instanceof Error)throw Y;var G=new Error("Unhandled error."+(Y?" ("+Y.message+")":""));throw G.context=Y,G}var X=U[Z];if(X===void 0)return!1;if(typeof X==="function")l9(X,this,Q);else{var V=X.length,F=r9(X,V);for(var J=0;J<V;++J)l9(F[J],this,Q)}return!0};function n9($,Z,Q,J){var K,U,Y;if(G0(Q),U=$._events,U===void 0)U=$._events=Object.create(null),$._eventsCount=0;else{if(U.newListener!==void 0)$.emit("newListener",Z,Q.listener?Q.listener:Q),U=$._events;Y=U[Z]}if(Y===void 0)Y=U[Z]=Q,++$._eventsCount;else{if(typeof Y==="function")Y=U[Z]=J?[Q,Y]:[Y,Q];else if(J)Y.unshift(Q);else Y.push(Q);if(K=i9($),K>0&&Y.length>K&&!Y.warned){Y.warned=!0;var G=new Error("Possible EventEmitter memory leak detected. "+Y.length+" "+String(Z)+" listeners added. Use emitter.setMaxListeners() to increase limit");G.name="MaxListenersExceededWarning",G.emitter=$,G.type=Z,G.count=Y.length,k8(G)}}return $}C.prototype.addListener=function $(Z,Q){return n9(this,Z,Q,!1)};C.prototype.on=C.prototype.addListener;C.prototype.prependListener=function $(Z,Q){return n9(this,Z,Q,!0)};function b8(){if(!this.fired){if(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0)return this.listener.call(this.target);return this.listener.apply(this.target,arguments)}}function o9($,Z,Q){var J={fired:!1,wrapFn:void 0,target:$,type:Z,listener:Q},K=b8.bind(J);return K.listener=Q,J.wrapFn=K,K}C.prototype.once=function $(Z,Q){return G0(Q),this.on(Z,o9(this,Z,Q)),this};C.prototype.prependOnceListener=function $(Z,Q){return G0(Q),this.prependListener(Z,o9(this,Z,Q)),this};C.prototype.removeListener=function $(Z,Q){var J,K,U,Y,G;if(G0(Q),K=this._events,K===void 0)return this;if(J=K[Z],J===void 0)return this;if(J===Q||J.listener===Q){if(--this._eventsCount===0)this._events=Object.create(null);else if(delete K[Z],K.removeListener)this.emit("removeListener",Z,J.listener||Q)}else if(typeof J!=="function"){U=-1;for(Y=J.length-1;Y>=0;Y--)if(J[Y]===Q||J[Y].listener===Q){G=J[Y].listener,U=Y;break}if(U<0)return this;if(U===0)J.shift();else m8(J,U);if(J.length===1)K[Z]=J[0];if(K.removeListener!==void 0)this.emit("removeListener",Z,G||Q)}return this};C.prototype.off=C.prototype.removeListener;C.prototype.removeAllListeners=function $(Z){var Q,J,K;if(J=this._events,J===void 0)return this;if(J.removeListener===void 0){if(arguments.length===0)this._events=Object.create(null),this._eventsCount=0;else if(J[Z]!==void 0)if(--this._eventsCount===0)this._events=Object.create(null);else delete J[Z];return this}if(arguments.length===0){var U=Object.keys(J),Y;for(K=0;K<U.length;++K){if(Y=U[K],Y==="removeListener")continue;this.removeAllListeners(Y)}return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(Q=J[Z],typeof Q==="function")this.removeListener(Z,Q);else if(Q!==void 0)for(K=Q.length-1;K>=0;K--)this.removeListener(Z,Q[K]);return this};function s9($,Z,Q){var J=$._events;if(J===void 0)return[];var K=J[Z];if(K===void 0)return[];if(typeof K==="function")return Q?[K.listener||K]:[K];return Q?u8(K):r9(K,K.length)}C.prototype.listeners=function $(Z){return s9(this,Z,!0)};C.prototype.rawListeners=function $(Z){return s9(this,Z,!1)};C.listenerCount=function($,Z){if(typeof $.listenerCount==="function")return $.listenerCount(Z);else return a9.call($,Z)};C.prototype.listenerCount=a9;function a9($){var Z=this._events;if(Z!==void 0){var Q=Z[$];if(typeof Q==="function")return 1;else if(Q!==void 0)return Q.length}return 0}C.prototype.eventNames=function $(){return this._eventsCount>0?Q0(this._events):[]};function r9($,Z){var Q=new Array(Z);for(var J=0;J<Z;++J)Q[J]=$[J];return Q}function m8($,Z){for(;Z+1<$.length;Z++)$[Z]=$[Z+1];$.pop()}function u8($){var Z=new Array($.length);for(var Q=0;Q<Z.length;++Q)Z[Q]=$[Q].listener||$[Q];return Z}function d8($,Z){return new Promise(function(Q,J){function K(Y){$.removeListener(Z,U),J(Y)}function U(){if(typeof $.removeListener==="function")$.removeListener("error",K);Q([].slice.call(arguments))}if(t9($,Z,U,{once:!0}),Z!=="error")l8($,K,{once:!0})})}function l8($,Z,Q){if(typeof $.on==="function")t9($,"error",Z,Q)}function t9($,Z,Q,J){if(typeof $.on==="function")if(J.once)$.once(Z,Q);else $.on(Z,Q);else if(typeof $.addEventListener==="function")$.addEventListener(Z,function K(U){if(J.once)$.removeEventListener(Z,K);Q(U)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof $)}var c8=u0.exports,e9=h8(c8),x;(function($){$[$.timeout=1]="timeout",$[$.transportClosed=2]="transportClosed",$[$.clientDisconnected=3]="clientDisconnected",$[$.clientClosed=4]="clientClosed",$[$.clientConnectToken=5]="clientConnectToken",$[$.clientRefreshToken=6]="clientRefreshToken",$[$.subscriptionUnsubscribed=7]="subscriptionUnsubscribed",$[$.subscriptionSubscribeToken=8]="subscriptionSubscribeToken",$[$.subscriptionRefreshToken=9]="subscriptionRefreshToken",$[$.transportWriteError=10]="transportWriteError",$[$.connectionClosed=11]="connectionClosed",$[$.badConfiguration=12]="badConfiguration"})(x||(x={}));var H$;(function($){$[$.connectCalled=0]="connectCalled",$[$.transportClosed=1]="transportClosed",$[$.noPing=2]="noPing",$[$.subscribeTimeout=3]="subscribeTimeout",$[$.unsubscribeError=4]="unsubscribeError"})(H$||(H$={}));var T$;(function($){$[$.disconnectCalled=0]="disconnectCalled",$[$.unauthorized=1]="unauthorized",$[$.badProtocol=2]="badProtocol",$[$.messageSizeLimit=3]="messageSizeLimit"})(T$||(T$={}));var J0;(function($){$[$.subscribeCalled=0]="subscribeCalled",$[$.transportClosed=1]="transportClosed"})(J0||(J0={}));var K0;(function($){$[$.unsubscribeCalled=0]="unsubscribeCalled",$[$.unauthorized=1]="unauthorized",$[$.clientClosed=2]="clientClosed"})(K0||(K0={}));var k0;(function($){$[$.channelCompaction=1]="channelCompaction"})(k0||(k0={}));var j;(function($){$.Disconnected="disconnected",$.Connecting="connecting",$.Connected="connected"})(j||(j={}));var k;(function($){$.Unsubscribed="unsubscribed",$.Subscribing="subscribing",$.Subscribed="subscribed"})(k||(k={}));function p8($,Z){return $.lastIndexOf(Z,0)===0}function $1($){if($===void 0||$===null)return!1;return typeof $==="function"}function i8($,Z){if(globalThis.console){let Q=globalThis.console[$];if($1(Q))Q.apply(globalThis.console,Z)}}function n8($,Z){return Math.floor(Math.random()*(Z-$+1)+$)}function U0($,Z,Q){if($>31)$=31;let J=n8(0,Math.min(Q,Z*Math.pow(2,$)));return Math.min(Q,Z+J)}function o8($){return"error"in $&&$.error!==null}function Y0($){return Math.min($*1000,2147483647)}class Z1 extends e9{constructor($,Z,Q){super();if(this._resubscribeTimeout=null,this._refreshTimeout=null,this.channel=Z,this.state=k.Unsubscribed,this._centrifuge=$,this._token="",this._getToken=null,this._data=null,this._getData=null,this._recover=!1,this._offset=null,this._epoch=null,this._id=0,this._recoverable=!1,this._positioned=!1,this._joinLeave=!1,this._minResubscribeDelay=500,this._maxResubscribeDelay=20000,this._resubscribeTimeout=null,this._resubscribeAttempts=0,this._promises={},this._promiseId=0,this._inflight=!1,this._refreshTimeout=null,this._delta="",this._delta_negotiated=!1,this._tagsFilter=null,this._prevValue=null,this._unsubPromise=Promise.resolve(),this._setOptions(Q),this._centrifuge._debugEnabled)this.on("state",(J)=>{this._debug("subscription state",Z,J.oldState,"->",J.newState)}),this.on("error",(J)=>{this._debug("subscription error",Z,J)});else this.on("error",function(){Function.prototype()})}ready($){if(this.state===k.Unsubscribed)return Promise.reject({code:x.subscriptionUnsubscribed,message:this.state});if(this.state===k.Subscribed)return Promise.resolve();return new Promise((Z,Q)=>{let J={resolve:Z,reject:Q};if($)J.timeout=setTimeout(function(){Q({code:x.timeout,message:"timeout"})},$);this._promises[this._nextPromiseId()]=J})}subscribe(){if(this._isSubscribed())return;this._resubscribeAttempts=0,this._setSubscribing(J0.subscribeCalled,"subscribe called")}unsubscribe(){this._unsubPromise=this._setUnsubscribed(K0.unsubscribeCalled,"unsubscribe called",!0)}publish($){return v(this,void 0,void 0,function*(){return yield this._methodCall(),this._centrifuge.publish(this.channel,$)})}presence(){return v(this,void 0,void 0,function*(){return yield this._methodCall(),this._centrifuge.presence(this.channel)})}presenceStats(){return v(this,void 0,void 0,function*(){return yield this._methodCall(),this._centrifuge.presenceStats(this.channel)})}history($){return v(this,void 0,void 0,function*(){return yield this._methodCall(),this._centrifuge.history(this.channel,$)})}setTagsFilter($){if($&&this._delta)throw new Error("cannot use delta and tagsFilter together");this._tagsFilter=$}setData($){this._data=$}_methodCall(){if(this._isSubscribed())return Promise.resolve();if(this._isUnsubscribed())return Promise.reject({code:x.subscriptionUnsubscribed,message:this.state});return new Promise(($,Z)=>{let Q=this._centrifuge._config.timeout,J=setTimeout(()=>{Z({code:x.timeout,message:"timeout"})},Q);this._promises[this._nextPromiseId()]={timeout:J,resolve:$,reject:Z}})}_nextPromiseId(){return++this._promiseId}_needRecover(){return this._recover===!0}_isUnsubscribed(){return this.state===k.Unsubscribed}_isSubscribing(){return this.state===k.Subscribing}_isSubscribed(){return this.state===k.Subscribed}_setState($){if(this.state!==$){let Z=this.state;return this.state=$,this.emit("state",{newState:$,oldState:Z,channel:this.channel}),!0}return!1}_usesToken(){return this._token!==""||this._getToken!==null}_clearSubscribingState(){this._resubscribeAttempts=0,this._clearResubscribeTimeout()}_clearSubscribedState(){this._clearRefreshTimeout()}_setSubscribed($){if(!this._isSubscribing())return;if(this._clearSubscribingState(),$.id)this._id=$.id;if($.recoverable)this._recover=!0,this._offset=$.offset||0,this._epoch=$.epoch||"";if($.delta)this._delta_negotiated=!0;else this._delta_negotiated=!1;this._setState(k.Subscribed);let Z=this._centrifuge._getSubscribeContext(this.channel,$);this.emit("subscribed",Z),this._resolvePromises();let Q=$.publications;if(Q&&Q.length>0)for(let J in Q){if(!Q.hasOwnProperty(J))continue;this._handlePublication(Q[J])}if($.expires===!0)this._refreshTimeout=setTimeout(()=>this._refresh(),Y0($.ttl))}_setSubscribing($,Z){return v(this,void 0,void 0,function*(){if(this._isSubscribing())return;if(this._isSubscribed())this._clearSubscribedState();if(this._setState(k.Subscribing))this.emit("subscribing",{channel:this.channel,code:$,reason:Z});if(this._centrifuge._transport&&this._centrifuge._transport.emulation())yield this._unsubPromise;if(!this._isSubscribing())return;this._subscribe()})}_subscribe(){if(this._debug("subscribing on",this.channel),!this._isTransportOpen())return this._debug("delay subscribe on",this.channel,"till connected"),null;if(this._inflight)return null;if(this._inflight=!0,this._canSubscribeWithoutGettingToken())return this._subscribeWithoutToken();return this._getSubscriptionToken().then(($)=>this._handleTokenResponse($)).catch(($)=>this._handleTokenError($)),null}_isTransportOpen(){return this._centrifuge._transportIsOpen}_canSubscribeWithoutGettingToken(){return!this._usesToken()||!!this._token}_subscribeWithoutToken(){if(this._getData)return this._getDataAndSubscribe(this._token),null;else return this._sendSubscribe(this._token)}_getDataAndSubscribe($){if(!this._getData){this._inflight=!1;return}this._getData({channel:this.channel}).then((Z)=>{if(!this._isSubscribing()){this._inflight=!1;return}this._data=Z,this._sendSubscribe($)}).catch((Z)=>this._handleGetDataError(Z))}_handleGetDataError($){if(!this._isSubscribing()){this._inflight=!1;return}if($ instanceof a){this._inflight=!1,this._failUnauthorized();return}this.emit("error",{type:"subscribeData",channel:this.channel,error:{code:x.badConfiguration,message:($===null||$===void 0?void 0:$.toString())||""}}),this._inflight=!1,this._scheduleResubscribe()}_handleTokenResponse($){if(!this._isSubscribing()){this._inflight=!1;return}if(!$){this._inflight=!1,this._failUnauthorized();return}if(this._token=$,this._getData)this._getDataAndSubscribe($);else this._sendSubscribe($)}_handleTokenError($){if(!this._isSubscribing()){this._inflight=!1;return}if($ instanceof a){this._inflight=!1,this._failUnauthorized();return}this.emit("error",{type:"subscribeToken",channel:this.channel,error:{code:x.subscriptionSubscribeToken,message:($===null||$===void 0?void 0:$.toString())||""}}),this._inflight=!1,this._scheduleResubscribe()}_sendSubscribe($){if(!this._isTransportOpen())return this._inflight=!1,null;let Z=this._buildSubscribeCommand($);return this._centrifuge._call(Z).then((Q)=>{this._inflight=!1;let J=Q.reply.subscribe;if(this._handleSubscribeResponse(J),Q.next)Q.next()},(Q)=>{if(this._inflight=!1,this._handleSubscribeError(Q.error),Q.next)Q.next()}),Z}_buildSubscribeCommand($){let Z={channel:this.channel};if($)Z.token=$;if(this._data)Z.data=this._data;if(this._positioned)Z.positioned=!0;if(this._recoverable)Z.recoverable=!0;if(this._joinLeave)Z.join_leave=!0;if(Z.flag=k0.channelCompaction,this._needRecover()){Z.recover=!0;let Q=this._getOffset();if(Q)Z.offset=Q;let J=this._getEpoch();if(J)Z.epoch=J}if(this._delta)Z.delta=this._delta;if(this._tagsFilter)Z.tf=this._tagsFilter;return{subscribe:Z}}_debug(...$){this._centrifuge._debug(...$)}_handleSubscribeError($){if(!this._isSubscribing())return;if($.code===x.timeout){this._centrifuge._disconnect(H$.subscribeTimeout,"subscribe timeout",!0);return}this._subscribeError($)}_handleSubscribeResponse($){if(!this._isSubscribing())return;this._setSubscribed($)}_setUnsubscribed($,Z,Q){if(this._isUnsubscribed())return Promise.resolve();let J=Promise.resolve();if(this._isSubscribed()){if(Q)J=this._centrifuge._unsubscribe(this);this._clearSubscribedState()}else if(this._isSubscribing()){if(this._inflight&&Q)J=this._centrifuge._unsubscribe(this);this._clearSubscribingState()}if(this._inflight=!1,this._setState(k.Unsubscribed))this.emit("unsubscribed",{channel:this.channel,code:$,reason:Z});return this._rejectPromises({code:x.subscriptionUnsubscribed,message:this.state}),J}_handlePublication($){if(this._delta&&this._delta_negotiated){let{newData:Q,newPrevValue:J}=this._centrifuge._codec.applyDeltaIfNeeded($,this._prevValue);$.data=Q,this._prevValue=J}let Z=this._centrifuge._getPublicationContext(this.channel,$);if(this.emit("publication",Z),$.offset)this._offset=$.offset}_handleJoin($){let Z=this._centrifuge._getJoinLeaveContext($.info);this.emit("join",{channel:this.channel,info:Z})}_handleLeave($){let Z=this._centrifuge._getJoinLeaveContext($.info);this.emit("leave",{channel:this.channel,info:Z})}_resolvePromises(){for(let $ in this._promises){if(!this._promises.hasOwnProperty($))continue;if(this._promises[$].timeout)clearTimeout(this._promises[$].timeout);this._promises[$].resolve(),delete this._promises[$]}}_rejectPromises($){for(let Z in this._promises){if(!this._promises.hasOwnProperty(Z))continue;if(this._promises[Z].timeout)clearTimeout(this._promises[Z].timeout);this._promises[Z].reject($),delete this._promises[Z]}}_scheduleResubscribe(){if(!this._isSubscribing()){this._debug("not in subscribing state, skip resubscribe scheduling",this.channel);return}let $=this,Z=this._getResubscribeDelay();this._resubscribeTimeout=setTimeout(function(){if($._isSubscribing())$._subscribe()},Z),this._debug("resubscribe scheduled after "+Z,this.channel)}_subscribeError($){if(!this._isSubscribing())return;if($.code<100||$.code===109||$.temporary===!0){if($.code===109)this._token="";let Z={channel:this.channel,type:"subscribe",error:$};if(this._centrifuge.state===j.Connected)this.emit("error",Z);this._scheduleResubscribe()}else this._setUnsubscribed($.code,$.message,!1)}_getResubscribeDelay(){let $=U0(this._resubscribeAttempts,this._minResubscribeDelay,this._maxResubscribeDelay);return this._resubscribeAttempts++,$}_setOptions($){if(!$)return;if($.since)this._offset=$.since.offset||0,this._epoch=$.since.epoch||"",this._recover=!0;if($.data)this._data=$.data;if($.getData)this._getData=$.getData;if($.minResubscribeDelay!==void 0)this._minResubscribeDelay=$.minResubscribeDelay;if($.maxResubscribeDelay!==void 0)this._maxResubscribeDelay=$.maxResubscribeDelay;if($.token)this._token=$.token;if($.getToken)this._getToken=$.getToken;if($.positioned===!0)this._positioned=!0;if($.recoverable===!0)this._recoverable=!0;if($.joinLeave===!0)this._joinLeave=!0;if($.delta){if($.delta!=="fossil")throw new Error("unsupported delta format");this._delta=$.delta}if($.tagsFilter)this._tagsFilter=$.tagsFilter;if(this._tagsFilter&&this._delta)throw new Error("cannot use delta and tagsFilter together")}_getOffset(){let $=this._offset;if($!==null)return $;return 0}_getEpoch(){let $=this._epoch;if($!==null)return $;return""}_clearRefreshTimeout(){if(this._refreshTimeout!==null)clearTimeout(this._refreshTimeout),this._refreshTimeout=null}_clearResubscribeTimeout(){if(this._resubscribeTimeout!==null)clearTimeout(this._resubscribeTimeout),this._resubscribeTimeout=null}_getSubscriptionToken(){this._debug("get subscription token for channel",this.channel);let $={channel:this.channel},Z=this._getToken;if(Z===null)return this.emit("error",{type:"configuration",channel:this.channel,error:{code:x.badConfiguration,message:"provide a function to get channel subscription token"}}),Promise.reject(new a(""));return Z($)}_refresh(){this._clearRefreshTimeout();let $=this;this._getSubscriptionToken().then(function(Z){if(!$._isSubscribed())return;if(!Z){$._failUnauthorized();return}$._token=Z;let J={sub_refresh:{channel:$.channel,token:Z}};$._centrifuge._call(J).then((K)=>{let U=K.reply.sub_refresh;if($._refreshResponse(U),K.next)K.next()},(K)=>{if($._refreshError(K.error),K.next)K.next()})}).catch(function(Z){if(Z instanceof a){$._failUnauthorized();return}$.emit("error",{type:"refreshToken",channel:$.channel,error:{code:x.subscriptionRefreshToken,message:Z!==void 0?Z.toString():""}}),$._refreshTimeout=setTimeout(()=>$._refresh(),$._getRefreshRetryDelay())})}_refreshResponse($){if(!this._isSubscribed())return;if(this._debug("subscription token refreshed, channel",this.channel),this._clearRefreshTimeout(),$.expires===!0)this._refreshTimeout=setTimeout(()=>this._refresh(),Y0($.ttl))}_refreshError($){if(!this._isSubscribed())return;if($.code<100||$.temporary===!0)this.emit("error",{type:"refresh",channel:this.channel,error:$}),this._refreshTimeout=setTimeout(()=>this._refresh(),this._getRefreshRetryDelay());else this._setUnsubscribed($.code,$.message,!0)}_getRefreshRetryDelay(){return U0(0,1e4,20000)}_failUnauthorized(){this._setUnsubscribed(K0.unauthorized,"unauthorized",!0)}}class Q1{constructor($,Z){this.endpoint=$,this.options=Z,this._transport=null}name(){return"sockjs"}subName(){return"sockjs-"+this._transport.transport}emulation(){return!1}supported(){return this.options.sockjs!==null}initialize($,Z){this._transport=new this.options.sockjs(this.endpoint,null,this.options.sockjsOptions),this._transport.onopen=()=>{Z.onOpen()},this._transport.onerror=(Q)=>{Z.onError(Q)},this._transport.onclose=(Q)=>{Z.onClose(Q)},this._transport.onmessage=(Q)=>{Z.onMessage(Q.data)}}close(){this._transport.close()}send($){this._transport.send($)}}class b0{constructor($,Z){this.endpoint=$,this.options=Z,this._transport=null}name(){return"websocket"}subName(){return"websocket"}emulation(){return!1}supported(){return this.options.websocket!==void 0&&this.options.websocket!==null}initialize($,Z){let Q="";if($==="protobuf")Q="centrifuge-protobuf";if(Q!=="")this._transport=new this.options.websocket(this.endpoint,Q);else this._transport=new this.options.websocket(this.endpoint);if($==="protobuf")this._transport.binaryType="arraybuffer";this._transport.onopen=()=>{Z.onOpen()},this._transport.onerror=(J)=>{Z.onError(J)},this._transport.onclose=(J)=>{Z.onClose(J)},this._transport.onmessage=(J)=>{Z.onMessage(J.data)}}close(){this._transport.close()}send($){this._transport.send($)}}class J1{constructor($,Z){this.endpoint=$,this.options=Z,this._abortController=null,this._utf8decoder=new TextDecoder,this._protocol="json"}name(){return"http_stream"}subName(){return"http_stream"}emulation(){return!0}_handleErrors($){if(!$.ok)throw new Error($.status);return $}_fetchEventTarget($,Z,Q){let J=new EventTarget,K=$.options.fetch;return K(Z,Q).then($._handleErrors).then((U)=>{J.dispatchEvent(new Event("open"));let Y="",G=0,X=new Uint8Array,V=U.body.getReader();return new $.options.readableStream({start(F){function z(){return V.read().then(({done:W,value:q})=>{if(W){J.dispatchEvent(new Event("close")),F.close();return}try{if($._protocol==="json"){Y+=$._utf8decoder.decode(q);while(G<Y.length)if(Y[G]===`
|
|
5
|
-
`){let M=Y.substring(0,G);J.dispatchEvent(new MessageEvent("message",{data:M})),Y=Y.substring(G+1),G=0}else++G}else{let M=new Uint8Array(X.length+q.length);M.set(X),M.set(q,X.length),X=M;while(!0){let H=$.options.decoder.decodeReply(X);if(H.ok){let I=X.slice(0,H.pos);J.dispatchEvent(new MessageEvent("message",{data:I})),X=X.slice(H.pos);continue}break}}}catch(M){J.dispatchEvent(new Event("error",{detail:M})),J.dispatchEvent(new Event("close")),F.close();return}z()}).catch(function(W){J.dispatchEvent(new Event("error",{detail:W})),J.dispatchEvent(new Event("close")),F.close();return})}return z()}})}).catch((U)=>{J.dispatchEvent(new Event("error",{detail:U})),J.dispatchEvent(new Event("close"))}),J}supported(){return this.options.fetch!==null&&this.options.readableStream!==null&&typeof TextDecoder!=="undefined"&&typeof AbortController!=="undefined"&&typeof EventTarget!=="undefined"&&typeof Event!=="undefined"&&typeof MessageEvent!=="undefined"&&typeof Error!=="undefined"}initialize($,Z,Q){this._protocol=$,this._abortController=new AbortController;let J,K;if($==="json")J={Accept:"application/json","Content-Type":"application/json"},K=Q;else J={Accept:"application/octet-stream","Content-Type":"application/octet-stream"},K=Q;let U={method:"POST",headers:J,body:K,mode:"cors",credentials:"same-origin",signal:this._abortController.signal},Y=this._fetchEventTarget(this,this.endpoint,U);Y.addEventListener("open",()=>{Z.onOpen()}),Y.addEventListener("error",(G)=>{this._abortController.abort(),Z.onError(G)}),Y.addEventListener("close",()=>{this._abortController.abort(),Z.onClose({code:4,reason:"connection closed"})}),Y.addEventListener("message",(G)=>{Z.onMessage(G.data)})}close(){this._abortController.abort()}send($,Z,Q){let J,K,U={session:Z,node:Q,data:$};if(this._protocol==="json")J={"Content-Type":"application/json"},K=JSON.stringify(U);else J={"Content-Type":"application/octet-stream"},K=this.options.encoder.encodeEmulationRequest(U);let Y=this.options.fetch,G={method:"POST",headers:J,body:K,mode:"cors",credentials:"same-origin"};Y(this.options.emulationEndpoint,G)}}class K1{constructor($,Z){this.endpoint=$,this.options=Z,this._protocol="json",this._transport=null,this._onClose=null}name(){return"sse"}subName(){return"sse"}emulation(){return!0}supported(){return this.options.eventsource!==null&&this.options.fetch!==null}initialize($,Z,Q){let J;if(globalThis&&globalThis.document&&globalThis.document.baseURI)J=new URL(this.endpoint,globalThis.document.baseURI);else J=new URL(this.endpoint);J.searchParams.append("cf_connect",Q);let K={},U=new this.options.eventsource(J.toString(),K);this._transport=U;let Y=this;U.onopen=function(){Z.onOpen()},U.onerror=function(G){U.close(),Z.onError(G),Z.onClose({code:4,reason:"connection closed"})},U.onmessage=function(G){Z.onMessage(G.data)},Y._onClose=function(){Z.onClose({code:4,reason:"connection closed"})}}close(){if(this._transport.close(),this._onClose!==null)this._onClose()}send($,Z,Q){let J={session:Z,node:Q,data:$},K={"Content-Type":"application/json"},U=JSON.stringify(J),Y=this.options.fetch,G={method:"POST",headers:K,body:U,mode:"cors",credentials:"same-origin"};Y(this.options.emulationEndpoint,G)}}class U1{constructor($,Z){this.endpoint=$,this.options=Z,this._transport=null,this._stream=null,this._writer=null,this._utf8decoder=new TextDecoder,this._protocol="json"}name(){return"webtransport"}subName(){return"webtransport"}emulation(){return!1}supported(){return this.options.webtransport!==void 0&&this.options.webtransport!==null}initialize($,Z){return v(this,void 0,void 0,function*(){let Q;if(globalThis&&globalThis.document&&globalThis.document.baseURI)Q=new URL(this.endpoint,globalThis.document.baseURI);else Q=new URL(this.endpoint);if($==="protobuf")Q.searchParams.append("cf_protocol","protobuf");this._protocol=$;let J=new EventTarget;this._transport=new this.options.webtransport(Q.toString()),this._transport.closed.then(()=>{Z.onClose({code:4,reason:"connection closed"})}).catch(()=>{Z.onClose({code:4,reason:"connection closed"})});try{yield this._transport.ready}catch(U){this.close();return}let K;try{K=yield this._transport.createBidirectionalStream()}catch(U){this.close();return}this._stream=K,this._writer=this._stream.writable.getWriter(),J.addEventListener("close",()=>{Z.onClose({code:4,reason:"connection closed"})}),J.addEventListener("message",(U)=>{Z.onMessage(U.data)}),this._startReading(J),Z.onOpen()})}_startReading($){return v(this,void 0,void 0,function*(){let Z=this._stream.readable.getReader(),Q="",J=0,K=new Uint8Array;try{while(!0){let{done:U,value:Y}=yield Z.read();if(Y.length>0)if(this._protocol==="json"){Q+=this._utf8decoder.decode(Y);while(J<Q.length)if(Q[J]===`
|
|
6
|
-
`){let G=Q.substring(0,J);$.dispatchEvent(new MessageEvent("message",{data:G})),Q=Q.substring(J+1),J=0}else++J}else{let G=new Uint8Array(K.length+Y.length);G.set(K),G.set(Y,K.length),K=G;while(!0){let X=this.options.decoder.decodeReply(K);if(X.ok){let V=K.slice(0,X.pos);$.dispatchEvent(new MessageEvent("message",{data:V})),K=K.slice(X.pos);continue}break}}if(U)break}}catch(U){$.dispatchEvent(new Event("close"))}})}close(){return v(this,void 0,void 0,function*(){try{if(this._writer)yield this._writer.close();this._transport.close()}catch($){}})}send($){return v(this,void 0,void 0,function*(){let Z;if(this._protocol==="json")Z=new TextEncoder().encode($+`
|
|
7
|
-
`);else Z=$;try{yield this._writer.write(Z)}catch(Q){this.close()}})}}var s8=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,36,-1,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,-1,-1,-1,63,-1];class Y1{constructor($){this.a=$,this.pos=0}haveBytes(){return this.pos<this.a.length}getByte(){let $=this.a[this.pos];if(this.pos++,this.pos>this.a.length)throw new RangeError("out of bounds");return $}getChar(){return String.fromCharCode(this.getByte())}getInt(){let $=0,Z;while(this.haveBytes()&&(Z=s8[127&this.getByte()])>=0)$=($<<6)+Z;return this.pos--,$>>>0}}class G1{constructor(){this.a=[]}toByteArray($){if(Array.isArray($))return this.a;return new Uint8Array(this.a)}putArray($,Z,Q){for(let J=Z;J<Q;J++)this.a.push($[J])}}function a8($){let Z=0,Q=0,J=0,K=0,U=0,Y=$.length;while(Y>=16)Z=Z+$[U+0]|0,Q=Q+$[U+1]|0,J=J+$[U+2]|0,K=K+$[U+3]|0,Z=Z+$[U+4]|0,Q=Q+$[U+5]|0,J=J+$[U+6]|0,K=K+$[U+7]|0,Z=Z+$[U+8]|0,Q=Q+$[U+9]|0,J=J+$[U+10]|0,K=K+$[U+11]|0,Z=Z+$[U+12]|0,Q=Q+$[U+13]|0,J=J+$[U+14]|0,K=K+$[U+15]|0,U+=16,Y-=16;while(Y>=4)Z=Z+$[U+0]|0,Q=Q+$[U+1]|0,J=J+$[U+2]|0,K=K+$[U+3]|0,U+=4,Y-=4;switch(K=((K+(J<<8)|0)+(Q<<16)|0)+(Z<<24)|0,Y){case 3:K=K+($[U+2]<<8)|0;case 2:K=K+($[U+1]<<16)|0;case 1:K=K+($[U+0]<<24)|0}return K>>>0}function r8($,Z){let Q=0,J=new Y1(Z),K=$.length,U=Z.length,Y=J.getInt();if(J.getChar()!==`
|
|
8
|
-
`)throw new Error("size integer not terminated by '\\n'");let G=new G1;while(J.haveBytes()){let X=J.getInt(),V;switch(J.getChar()){case"@":if(V=J.getInt(),J.haveBytes()&&J.getChar()!==",")throw new Error("copy command not terminated by ','");if(Q+=X,Q>Y)throw new Error("copy exceeds output file size");if(V+X>K)throw new Error("copy extends past end of input");G.putArray($,V,V+X);break;case":":if(Q+=X,Q>Y)throw new Error("insert command gives an output larger than predicted");if(X>U)throw new Error("insert count exceeds size of delta");G.putArray(J.a,J.pos,J.pos+X),J.pos+=X;break;case";":{let F=G.toByteArray($);if(X!==a8(F))throw new Error("bad checksum");if(Q!==Y)throw new Error("generated size does not match predicted size");return F}default:throw new Error("unknown delta operator")}}throw new Error("unterminated delta")}class m0{name(){return"json"}encodeCommands($){return $.map((Z)=>JSON.stringify(Z)).join(`
|
|
9
|
-
`)}decodeReplies($){return $.trim().split(`
|
|
10
|
-
`).map((Z)=>JSON.parse(Z))}applyDeltaIfNeeded($,Z){let Q,J;if($.delta){let K=r8(Z,new TextEncoder().encode($.data));Q=JSON.parse(new TextDecoder().decode(K)),J=K}else Q=JSON.parse($.data),J=new TextEncoder().encode($.data);return{newData:Q,newPrevValue:J}}}var t8={headers:{},token:"",getToken:null,data:null,getData:null,debug:!1,name:"js",version:"",fetch:null,readableStream:null,websocket:null,eventsource:null,sockjs:null,sockjsOptions:{},emulationEndpoint:"/emulation",minReconnectDelay:500,maxReconnectDelay:20000,timeout:5000,maxServerPingDelay:1e4,networkEventTarget:null};class a extends Error{constructor($){super($);this.name=this.constructor.name}}class x$ extends e9{constructor($,Z){super();if(this._reconnectTimeout=null,this._refreshTimeout=null,this._serverPingTimeout=null,this.state=j.Disconnected,this._transportIsOpen=!1,this._endpoint=$,this._emulation=!1,this._transports=[],this._currentTransportIndex=0,this._triedAllTransports=!1,this._transportWasOpen=!1,this._transport=null,this._transportId=0,this._deviceWentOffline=!1,this._transportClosed=!0,this._codec=new m0,this._reconnecting=!1,this._reconnectTimeout=null,this._reconnectAttempts=0,this._client=null,this._session="",this._node="",this._subs={},this._serverSubs={},this._commandId=0,this._commands=[],this._batching=!1,this._refreshRequired=!1,this._refreshTimeout=null,this._callbacks={},this._token="",this._data=null,this._dispatchPromise=Promise.resolve(),this._serverPing=0,this._serverPingTimeout=null,this._sendPong=!1,this._promises={},this._promiseId=0,this._debugEnabled=!1,this._networkEventsSet=!1,this._config=Object.assign(Object.assign({},t8),Z),this._configure(),this._debugEnabled)this.on("state",(Q)=>{this._debug("client state",Q.oldState,"->",Q.newState)}),this.on("error",(Q)=>{this._debug("client error",Q)});else this.on("error",function(){Function.prototype()})}newSubscription($,Z){if(this.getSubscription($)!==null)throw new Error("Subscription to the channel "+$+" already exists");let Q=new Z1(this,$,Z);return this._subs[$]=Q,Q}getSubscription($){return this._getSub($)}removeSubscription($){if(!$)return;if($.state!==k.Unsubscribed)$.unsubscribe();this._removeSubscription($)}subscriptions(){return this._subs}ready($){return v(this,void 0,void 0,function*(){switch(this.state){case j.Disconnected:throw{code:x.clientDisconnected,message:"client disconnected"};case j.Connected:return;default:return new Promise((Z,Q)=>{let J={resolve:Z,reject:Q};if($)J.timeout=setTimeout(()=>{Q({code:x.timeout,message:"timeout"})},$);this._promises[this._nextPromiseId()]=J})}})}connect(){if(this._isConnected()){this._debug("connect called when already connected");return}if(this._isConnecting()){this._debug("connect called when already connecting");return}this._debug("connect called"),this._reconnectAttempts=0,this._startConnecting()}disconnect(){this._disconnect(T$.disconnectCalled,"disconnect called",!1)}setToken($){this._token=$}setData($){this._data=$}setHeaders($){this._config.headers=$}send($){return v(this,void 0,void 0,function*(){let Z={send:{data:$}};if(yield this._methodCall(),!this._transportSendCommands([Z]))throw this._createErrorObject(x.transportWriteError,"transport write error")})}rpc($,Z){return v(this,void 0,void 0,function*(){let Q={rpc:{method:$,data:Z}};return yield this._methodCall(),{data:(yield this._callPromise(Q,(K)=>K.rpc)).data}})}publish($,Z){return v(this,void 0,void 0,function*(){let Q={publish:{channel:$,data:Z}};return yield this._methodCall(),yield this._callPromise(Q,()=>({})),{}})}history($,Z){return v(this,void 0,void 0,function*(){let Q={history:this._getHistoryRequest($,Z)};yield this._methodCall();let J=yield this._callPromise(Q,(U)=>U.history),K=[];if(J.publications)for(let U=0;U<J.publications.length;U++)K.push(this._getPublicationContext($,J.publications[U]));return{publications:K,epoch:J.epoch||"",offset:J.offset||0}})}presence($){return v(this,void 0,void 0,function*(){let Z={presence:{channel:$}};yield this._methodCall();let J=(yield this._callPromise(Z,(K)=>K.presence)).presence;for(let K in J)if(Object.prototype.hasOwnProperty.call(J,K)){let U=J[K],Y=U.conn_info,G=U.chan_info;if(Y)U.connInfo=Y;if(G)U.chanInfo=G}return{clients:J}})}presenceStats($){return v(this,void 0,void 0,function*(){let Z={presence_stats:{channel:$}};yield this._methodCall();let Q=yield this._callPromise(Z,(J)=>{return J.presence_stats});return{numUsers:Q.num_users,numClients:Q.num_clients}})}startBatching(){this._batching=!0}stopBatching(){let $=this;Promise.resolve().then(function(){Promise.resolve().then(function(){$._batching=!1,$._flush()})})}_debug(...$){if(!this._debugEnabled)return;i8("debug",$)}_codecName(){return this._codec.name()}_formatOverride(){return}_configure(){if(!("Promise"in globalThis))throw new Error("Promise polyfill required");if(!this._endpoint)throw new Error("endpoint configuration required");if(this._config.token!==null)this._token=this._config.token;if(this._config.data!==null)this._data=this._config.data;if(this._codec=new m0,this._formatOverride(),this._config.debug===!0||typeof localStorage!=="undefined"&&typeof localStorage.getItem==="function"&&localStorage.getItem("centrifuge.debug"))this._debugEnabled=!0;if(this._debug("config",this._config),typeof this._endpoint==="string");else if(Array.isArray(this._endpoint)){this._transports=this._endpoint,this._emulation=!0;for(let $ in this._transports)if(this._transports.hasOwnProperty($)){let Z=this._transports[$];if(!Z.endpoint||!Z.transport)throw new Error("malformed transport configuration");let Q=Z.transport;if(["websocket","http_stream","sse","sockjs","webtransport"].indexOf(Q)<0)throw new Error("unsupported transport name: "+Q)}}else throw new Error("unsupported url configuration type: only string or array of objects are supported")}_setState($){if(this.state!==$){this._reconnecting=!1;let Z=this.state;return this.state=$,this.emit("state",{newState:$,oldState:Z}),!0}return!1}_isDisconnected(){return this.state===j.Disconnected}_isConnecting(){return this.state===j.Connecting}_isConnected(){return this.state===j.Connected}_nextCommandId(){return++this._commandId}_setNetworkEvents(){if(this._networkEventsSet)return;let $=null;if(this._config.networkEventTarget!==null)$=this._config.networkEventTarget;else if(typeof globalThis.addEventListener!=="undefined")$=globalThis;if($)$.addEventListener("offline",()=>{if(this._debug("offline event triggered"),this.state===j.Connected||this.state===j.Connecting)this._disconnect(H$.transportClosed,"transport closed",!0),this._deviceWentOffline=!0}),$.addEventListener("online",()=>{if(this._debug("online event triggered"),this.state!==j.Connecting)return;if(this._deviceWentOffline&&!this._transportClosed)this._deviceWentOffline=!1,this._transportClosed=!0;this._clearReconnectTimeout(),this._startReconnecting()}),this._networkEventsSet=!0}_getReconnectDelay(){let $=U0(this._reconnectAttempts,this._config.minReconnectDelay,this._config.maxReconnectDelay);return this._reconnectAttempts+=1,$}_clearOutgoingRequests(){for(let $ in this._callbacks)if(this._callbacks.hasOwnProperty($)){let Z=this._callbacks[$];clearTimeout(Z.timeout);let Q=Z.errback;if(!Q)continue;Q({error:this._createErrorObject(x.connectionClosed,"connection closed")})}this._callbacks={}}_clearConnectedState(){this._client=null,this._clearServerPingTimeout(),this._clearRefreshTimeout();for(let $ in this._subs){if(!this._subs.hasOwnProperty($))continue;let Z=this._subs[$];if(Z.state===k.Subscribed)Z._setSubscribing(J0.transportClosed,"transport closed")}for(let $ in this._serverSubs)if(this._serverSubs.hasOwnProperty($))this.emit("subscribing",{channel:$})}_handleWriteError($){for(let Z of $){let Q=Z.id;if(!(Q in this._callbacks))continue;let J=this._callbacks[Q];clearTimeout(this._callbacks[Q].timeout),delete this._callbacks[Q];let K=J.errback;K({error:this._createErrorObject(x.transportWriteError,"transport write error")})}}_transportSendCommands($){if(!$.length)return!0;if(!this._transport)return!1;try{this._transport.send(this._codec.encodeCommands($),this._session,this._node)}catch(Z){return this._debug("error writing commands",Z),this._handleWriteError($),!1}return!0}_initializeTransport(){let $;if(this._config.websocket!==null)$=this._config.websocket;else if(!(typeof globalThis.WebSocket!=="function"&&typeof globalThis.WebSocket!=="object"))$=globalThis.WebSocket;let Z=null;if(this._config.sockjs!==null)Z=this._config.sockjs;else if(typeof globalThis.SockJS!=="undefined")Z=globalThis.SockJS;let Q=null;if(this._config.eventsource!==null)Q=this._config.eventsource;else if(typeof globalThis.EventSource!=="undefined")Q=globalThis.EventSource;let J=null;if(this._config.fetch!==null)J=this._config.fetch;else if(typeof globalThis.fetch!=="undefined")J=globalThis.fetch;let K=null;if(this._config.readableStream!==null)K=this._config.readableStream;else if(typeof globalThis.ReadableStream!=="undefined")K=globalThis.ReadableStream;if(!this._emulation){if(p8(this._endpoint,"http"))throw new Error("Provide explicit transport endpoints configuration in case of using HTTP (i.e. using array of TransportEndpoint instead of a single string), or use ws(s):// scheme in an endpoint if you aimed using WebSocket transport");else if(this._debug("client will use websocket"),this._transport=new b0(this._endpoint,{websocket:$}),!this._transport.supported())throw new Error("WebSocket constructor not found, make sure it is available globally or passed as a dependency in Centrifuge options")}else{if(this._currentTransportIndex>=this._transports.length)this._triedAllTransports=!0,this._currentTransportIndex=0;let W=0;while(!0){if(W>=this._transports.length)throw new Error("no supported transport found");let q=this._transports[this._currentTransportIndex],M=q.transport,H=q.endpoint;if(M==="websocket"){if(this._debug("trying websocket transport"),this._transport=new b0(H,{websocket:$}),!this._transport.supported()){this._debug("websocket transport not available"),this._currentTransportIndex++,W++;continue}}else if(M==="webtransport"){if(this._debug("trying webtransport transport"),this._transport=new U1(H,{webtransport:globalThis.WebTransport,decoder:this._codec,encoder:this._codec}),!this._transport.supported()){this._debug("webtransport transport not available"),this._currentTransportIndex++,W++;continue}}else if(M==="http_stream"){if(this._debug("trying http_stream transport"),this._transport=new J1(H,{fetch:J,readableStream:K,emulationEndpoint:this._config.emulationEndpoint,decoder:this._codec,encoder:this._codec}),!this._transport.supported()){this._debug("http_stream transport not available"),this._currentTransportIndex++,W++;continue}}else if(M==="sse"){if(this._debug("trying sse transport"),this._transport=new K1(H,{eventsource:Q,fetch:J,emulationEndpoint:this._config.emulationEndpoint}),!this._transport.supported()){this._debug("sse transport not available"),this._currentTransportIndex++,W++;continue}}else if(M==="sockjs"){if(this._debug("trying sockjs"),this._transport=new Q1(H,{sockjs:Z,sockjsOptions:this._config.sockjsOptions}),!this._transport.supported()){this._debug("sockjs transport not available"),this._currentTransportIndex++,W++;continue}}else throw new Error("unknown transport "+M);break}}let U=this,Y=this._transport,G=this._nextTransportId();U._debug("id of transport",G);let X=!1,V=[];if(this._transport.emulation()){let W=U._sendConnect(!0);V.push(W)}this._setNetworkEvents();let F=this._codec.encodeCommands(V);this._transportClosed=!1;let z;z=setTimeout(function(){Y.close()},this._config.timeout),this._transport.initialize(this._codecName(),{onOpen:function(){if(z)clearTimeout(z),z=null;if(U._transportId!=G){U._debug("open callback from non-actual transport"),Y.close();return}if(X=!0,U._debug(Y.subName(),"transport open"),Y.emulation())return;U._transportIsOpen=!0,U._transportWasOpen=!0,U.startBatching(),U._sendConnect(!1),U._sendSubscribeCommands(),U.stopBatching(),U.emit("__centrifuge_debug:connect_frame_sent",{})},onError:function(W){if(U._transportId!=G){U._debug("error callback from non-actual transport");return}U._debug("transport level error",W)},onClose:function(W){if(z)clearTimeout(z),z=null;if(U._transportId!=G){U._debug("close callback from non-actual transport");return}U._debug(Y.subName(),"transport closed"),U._transportClosed=!0,U._transportIsOpen=!1;let q="connection closed",M=!0,H=0;if(W&&"code"in W&&W.code)H=W.code;if(W&&W.reason)try{let I=JSON.parse(W.reason);q=I.reason,M=I.reconnect}catch(I){if(q=W.reason,H>=3500&&H<4000||H>=4500&&H<5000)M=!1}if(H<3000){if(H===1009)H=T$.messageSizeLimit,q="message size limit exceeded",M=!1;else H=H$.transportClosed,q="transport closed";if(U._emulation&&!U._transportWasOpen){if(U._currentTransportIndex++,U._currentTransportIndex>=U._transports.length)U._triedAllTransports=!0,U._currentTransportIndex=0}}else U._transportWasOpen=!0;if(U._isConnecting()&&!X)U.emit("error",{type:"transport",error:{code:x.transportClosed,message:"transport closed"},transport:Y.name()});U._reconnecting=!1,U._disconnect(H,q,M)},onMessage:function(W){U._dataReceived(W)}},F),U.emit("__centrifuge_debug:transport_initialized",{})}_sendConnect($){let Z=this._constructConnectCommand(),Q=this;return this._call(Z,$).then((J)=>{let K=J.reply.connect;if(Q._connectResponse(K),J.next)J.next()},(J)=>{if(Q._connectError(J.error),J.next)J.next()}),Z}_startReconnecting(){if(this._debug("start reconnecting"),!this._isConnecting()){this._debug("stop reconnecting: client not in connecting state");return}if(this._reconnecting){this._debug("reconnect already in progress, return from reconnect routine");return}if(this._transportClosed===!1){this._debug("waiting for transport close");return}this._reconnecting=!0;let $=this._token==="";if(!(this._refreshRequired||$&&this._config.getToken!==null)){if(this._config.getData)this._config.getData().then((J)=>{if(!this._isConnecting())return;this._data=J,this._initializeTransport()}).catch((J)=>this._handleGetDataError(J));else this._initializeTransport();return}let Q=this;this._getToken().then(function(J){if(!Q._isConnecting())return;if(J==null||J==null){Q._failUnauthorized();return}if(Q._token=J,Q._debug("connection token refreshed"),Q._config.getData)Q._config.getData().then(function(K){if(!Q._isConnecting())return;Q._data=K,Q._initializeTransport()}).catch((K)=>Q._handleGetDataError(K));else Q._initializeTransport()}).catch(function(J){if(!Q._isConnecting())return;if(J instanceof a){Q._failUnauthorized();return}Q.emit("error",{type:"connectToken",error:{code:x.clientConnectToken,message:J!==void 0?J.toString():""}});let K=Q._getReconnectDelay();Q._debug("error on getting connection token, reconnect after "+K+" milliseconds",J),Q._reconnecting=!1,Q._reconnectTimeout=setTimeout(()=>{Q._startReconnecting()},K)})}_handleGetDataError($){if($ instanceof a){this._failUnauthorized();return}this.emit("error",{type:"connectData",error:{code:x.badConfiguration,message:($===null||$===void 0?void 0:$.toString())||""}});let Z=this._getReconnectDelay();this._debug("error on getting connect data, reconnect after "+Z+" milliseconds",$),this._reconnecting=!1,this._reconnectTimeout=setTimeout(()=>{this._startReconnecting()},Z)}_connectError($){if(this.state!==j.Connecting)return;if($.code===109)this._refreshRequired=!0;if($.code<100||$.temporary===!0||$.code===109)this.emit("error",{type:"connect",error:$}),this._debug("closing transport due to connect error"),this._disconnect($.code,$.message,!0);else this._disconnect($.code,$.message,!1)}_scheduleReconnect(){if(!this._isConnecting())return;let $=!1;if(this._emulation&&!this._transportWasOpen&&!this._triedAllTransports)$=!0;let Z=this._getReconnectDelay();if($)Z=0;this._debug("reconnect after "+Z+" milliseconds"),this._clearReconnectTimeout(),this._reconnectTimeout=setTimeout(()=>{this._startReconnecting()},Z)}_constructConnectCommand(){let $={};if(this._token)$.token=this._token;if(this._data)$.data=this._data;if(this._config.name)$.name=this._config.name;if(this._config.version)$.version=this._config.version;if(Object.keys(this._config.headers).length>0)$.headers=this._config.headers;let Z={},Q=!1;for(let J in this._serverSubs)if(this._serverSubs.hasOwnProperty(J)&&this._serverSubs[J].recoverable){Q=!0;let K={recover:!0};if(this._serverSubs[J].offset)K.offset=this._serverSubs[J].offset;if(this._serverSubs[J].epoch)K.epoch=this._serverSubs[J].epoch;Z[J]=K}if(Q)$.subs=Z;return{connect:$}}_getHistoryRequest($,Z){let Q={channel:$};if(Z!==void 0){if(Z.since){if(Q.since={offset:Z.since.offset},Z.since.epoch)Q.since.epoch=Z.since.epoch}if(Z.limit!==void 0)Q.limit=Z.limit;if(Z.reverse===!0)Q.reverse=!0}return Q}_methodCall(){if(this._isConnected())return Promise.resolve();return new Promise(($,Z)=>{let Q=setTimeout(function(){Z({code:x.timeout,message:"timeout"})},this._config.timeout);this._promises[this._nextPromiseId()]={timeout:Q,resolve:$,reject:Z}})}_callPromise($,Z){return new Promise((Q,J)=>{this._call($,!1).then((K)=>{var U;let Y=Z(K.reply);Q(Y),(U=K.next)===null||U===void 0||U.call(K)},(K)=>{var U;J(K.error),(U=K.next)===null||U===void 0||U.call(K)})})}_dataReceived($){if(this._serverPing>0)this._waitServerPing();let Z=this._codec.decodeReplies($);this._dispatchPromise=this._dispatchPromise.then(()=>{let Q;this._dispatchPromise=new Promise((J)=>{Q=J}),this._dispatchSynchronized(Z,Q)})}_dispatchSynchronized($,Z){let Q=Promise.resolve();for(let J in $)if($.hasOwnProperty(J))Q=Q.then(()=>{return this._dispatchReply($[J])});Q=Q.then(()=>{Z()})}_dispatchReply($){let Z,Q=new Promise((K)=>{Z=K});if($===void 0||$===null)return this._debug("dispatch: got undefined or null reply"),Z(),Q;let J=$.id;if(J&&J>0)this._handleReply($,Z);else if(!$.push)this._handleServerPing(Z);else this._handlePush($.push,Z);return Q}_call($,Z){return new Promise((Q,J)=>{if($.id=this._nextCommandId(),this._registerCall($.id,Q,J),!Z)this._addCommand($)})}_startConnecting(){if(this._debug("start connecting"),this._setState(j.Connecting))this.emit("connecting",{code:H$.connectCalled,reason:"connect called"});this._client=null,this._startReconnecting()}_disconnect($,Z,Q){if(this._isDisconnected())return;this._transportIsOpen=!1;let J=this.state;this._reconnecting=!1;let K={code:$,reason:Z},U=!1;if(Q)U=this._setState(j.Connecting);else U=this._setState(j.Disconnected),this._rejectPromises({code:x.clientDisconnected,message:"disconnected"});if(this._clearOutgoingRequests(),J===j.Connecting)this._clearReconnectTimeout();if(J===j.Connected)this._clearConnectedState();if(U)if(this._isConnecting())this.emit("connecting",K);else this.emit("disconnected",K);if(this._transport){this._debug("closing existing transport");let Y=this._transport;this._transport=null,Y.close(),this._transportClosed=!0,this._nextTransportId()}else this._debug("no transport to close");this._scheduleReconnect()}_failUnauthorized(){this._disconnect(T$.unauthorized,"unauthorized",!1)}_getToken(){if(this._debug("get connection token"),!this._config.getToken)return this.emit("error",{type:"configuration",error:{code:x.badConfiguration,message:"token expired but no getToken function set in the configuration"}}),Promise.reject(new a(""));return this._config.getToken({})}_refresh(){let $=this._client,Z=this;this._getToken().then(function(Q){if($!==Z._client)return;if(!Q){Z._failUnauthorized();return}if(Z._token=Q,Z._debug("connection token refreshed"),!Z._isConnected())return;let J={refresh:{token:Z._token}};Z._call(J,!1).then((K)=>{let U=K.reply.refresh;if(Z._refreshResponse(U),K.next)K.next()},(K)=>{if(Z._refreshError(K.error),K.next)K.next()})}).catch(function(Q){if(!Z._isConnected())return;if(Q instanceof a){Z._failUnauthorized();return}Z.emit("error",{type:"refreshToken",error:{code:x.clientRefreshToken,message:Q!==void 0?Q.toString():""}}),Z._refreshTimeout=setTimeout(()=>Z._refresh(),Z._getRefreshRetryDelay())})}_refreshError($){if($.code<100||$.temporary===!0)this.emit("error",{type:"refresh",error:$}),this._refreshTimeout=setTimeout(()=>this._refresh(),this._getRefreshRetryDelay());else this._disconnect($.code,$.message,!1)}_getRefreshRetryDelay(){return U0(0,5000,1e4)}_refreshResponse($){if(this._refreshTimeout)clearTimeout(this._refreshTimeout),this._refreshTimeout=null;if($.expires)this._client=$.client,this._refreshTimeout=setTimeout(()=>this._refresh(),Y0($.ttl))}_removeSubscription($){if($===null)return;delete this._subs[$.channel]}_unsubscribe($){if(!this._transportIsOpen)return Promise.resolve();let Q={unsubscribe:{channel:$.channel}},J=this;return new Promise((U,Y)=>{this._call(Q,!1).then((G)=>{if(U(),G.next)G.next()},(G)=>{if(U(),G.next)G.next();J._disconnect(H$.unsubscribeError,"unsubscribe error",!0)})})}_getSub($,Z){if(Z&&Z>0){for(let J in this._subs)if(this._subs.hasOwnProperty(J)){let K=this._subs[J];if(K._id===Z)return K}return null}let Q=this._subs[$];if(!Q)return null;return Q}_isServerSub($){return this._serverSubs[$]!==void 0}_sendSubscribeCommands(){let $=[];for(let Z in this._subs){if(!this._subs.hasOwnProperty(Z))continue;let Q=this._subs[Z];if(Q._inflight===!0)continue;if(Q.state===k.Subscribing){let J=Q._subscribe();if(J)$.push(J)}}return $}_connectResponse($){if(this._transportIsOpen=!0,this._transportWasOpen=!0,this._reconnectAttempts=0,this._refreshRequired=!1,this._isConnected())return;if(this._client=$.client,this._setState(j.Connected),this._refreshTimeout)clearTimeout(this._refreshTimeout);if($.expires)this._refreshTimeout=setTimeout(()=>this._refresh(),Y0($.ttl));this._session=$.session,this._node=$.node,this.startBatching(),this._sendSubscribeCommands(),this.stopBatching();let Z={client:$.client,transport:this._transport.subName()};if($.data)Z.data=$.data;if(this.emit("connected",Z),this._resolvePromises(),this._processServerSubs($.subs||{}),$.ping&&$.ping>0)this._serverPing=$.ping*1000,this._sendPong=$.pong===!0,this._waitServerPing();else this._serverPing=0}_processServerSubs($){for(let Z in $){if(!$.hasOwnProperty(Z))continue;let Q=$[Z];this._serverSubs[Z]={offset:Q.offset,epoch:Q.epoch,recoverable:Q.recoverable||!1};let J=this._getSubscribeContext(Z,Q);this.emit("subscribed",J)}for(let Z in $){if(!$.hasOwnProperty(Z))continue;let Q=$[Z];if(Q.recovered){let J=Q.publications;if(J&&J.length>0){for(let K in J)if(J.hasOwnProperty(K))this._handlePublication(Z,J[K])}}}for(let Z in this._serverSubs){if(!this._serverSubs.hasOwnProperty(Z))continue;if(!$[Z])this.emit("unsubscribed",{channel:Z}),delete this._serverSubs[Z]}}_clearRefreshTimeout(){if(this._refreshTimeout!==null)clearTimeout(this._refreshTimeout),this._refreshTimeout=null}_clearReconnectTimeout(){if(this._reconnectTimeout!==null)clearTimeout(this._reconnectTimeout),this._reconnectTimeout=null}_clearServerPingTimeout(){if(this._serverPingTimeout!==null)clearTimeout(this._serverPingTimeout),this._serverPingTimeout=null}_waitServerPing(){if(this._config.maxServerPingDelay===0)return;if(!this._isConnected())return;this._clearServerPingTimeout(),this._serverPingTimeout=setTimeout(()=>{if(!this._isConnected())return;this._disconnect(H$.noPing,"no ping",!0)},this._serverPing+this._config.maxServerPingDelay)}_getSubscribeContext($,Z){let Q={channel:$,positioned:!1,recoverable:!1,wasRecovering:!1,recovered:!1,hasRecoveredPublications:!1};if(Z.recovered)Q.recovered=!0;if(Z.positioned)Q.positioned=!0;if(Z.recoverable)Q.recoverable=!0;if(Z.was_recovering)Q.wasRecovering=!0;let J="";if("epoch"in Z)J=Z.epoch;let K=0;if("offset"in Z)K=Z.offset;if(Q.positioned||Q.recoverable)Q.streamPosition={offset:K,epoch:J};if(Array.isArray(Z.publications)&&Z.publications.length>0)Q.hasRecoveredPublications=!0;if(Z.data)Q.data=Z.data;return Q}_handleReply($,Z){let Q=$.id;if(!(Q in this._callbacks)){Z();return}let J=this._callbacks[Q];if(clearTimeout(this._callbacks[Q].timeout),delete this._callbacks[Q],!o8($)){let K=J.callback;if(!K)return;K({reply:$,next:Z})}else{let K=J.errback;if(!K){Z();return}let U={code:$.error.code,message:$.error.message||"",temporary:$.error.temporary||!1};K({error:U,next:Z})}}_handleJoin($,Z,Q){let J=this._getSub($,Q);if(!J&&$){if(this._isServerSub($)){let K={channel:$,info:this._getJoinLeaveContext(Z.info)};this.emit("join",K)}return}J._handleJoin(Z)}_handleLeave($,Z,Q){let J=this._getSub($,Q);if(!J&&$){if(this._isServerSub($)){let K={channel:$,info:this._getJoinLeaveContext(Z.info)};this.emit("leave",K)}return}J._handleLeave(Z)}_handleUnsubscribe($,Z){let Q=this._getSub($,0);if(!Q&&$){if(this._isServerSub($))delete this._serverSubs[$],this.emit("unsubscribed",{channel:$});return}if(Z.code<2500)Q._setUnsubscribed(Z.code,Z.reason,!1);else Q._setSubscribing(Z.code,Z.reason)}_handleSubscribe($,Z){this._serverSubs[$]={offset:Z.offset,epoch:Z.epoch,recoverable:Z.recoverable||!1},this.emit("subscribed",this._getSubscribeContext($,Z))}_handleDisconnect($){let Z=$.code,Q=!0;if(Z>=3500&&Z<4000||Z>=4500&&Z<5000)Q=!1;this._disconnect(Z,$.reason,Q)}_getPublicationContext($,Z){let Q={channel:$,data:Z.data};if(Z.offset)Q.offset=Z.offset;if(Z.info)Q.info=this._getJoinLeaveContext(Z.info);if(Z.tags)Q.tags=Z.tags;return Q}_getJoinLeaveContext($){let Z={client:$.client,user:$.user},Q=$.conn_info;if(Q)Z.connInfo=Q;let J=$.chan_info;if(J)Z.chanInfo=J;return Z}_handlePublication($,Z,Q){let J=this._getSub($,Q);if(!J&&$){if(this._isServerSub($)){let K=this._getPublicationContext($,Z);if(this.emit("publication",K),Z.offset!==void 0)this._serverSubs[$].offset=Z.offset}return}J._handlePublication(Z)}_handleMessage($){this.emit("message",{data:$.data})}_handleServerPing($){if(this._sendPong){let Z={};this._transportSendCommands([Z])}$()}_handlePush($,Z){let{channel:Q,id:J}=$;if($.pub)this._handlePublication(Q,$.pub,J);else if($.message)this._handleMessage($.message);else if($.join)this._handleJoin(Q,$.join,J);else if($.leave)this._handleLeave(Q,$.leave,J);else if($.unsubscribe)this._handleUnsubscribe(Q,$.unsubscribe);else if($.subscribe)this._handleSubscribe(Q,$.subscribe);else if($.disconnect)this._handleDisconnect($.disconnect);Z()}_flush(){let $=this._commands.slice(0);this._commands=[],this._transportSendCommands($)}_createErrorObject($,Z,Q){let J={code:$,message:Z};if(Q)J.temporary=!0;return J}_registerCall($,Z,Q){this._callbacks[$]={callback:Z,errback:Q,timeout:null},this._callbacks[$].timeout=setTimeout(()=>{if(delete this._callbacks[$],$1(Q))Q({error:this._createErrorObject(x.timeout,"timeout")})},this._config.timeout)}_addCommand($){if(this._batching)this._commands.push($);else this._transportSendCommands([$])}_nextPromiseId(){return++this._promiseId}_nextTransportId(){return++this._transportId}_resolvePromises(){for(let $ in this._promises){if(!this._promises.hasOwnProperty($))continue;if(this._promises[$].timeout)clearTimeout(this._promises[$].timeout);this._promises[$].resolve(),delete this._promises[$]}}_rejectPromises($){for(let Z in this._promises){if(!this._promises.hasOwnProperty(Z))continue;if(this._promises[Z].timeout)clearTimeout(this._promises[Z].timeout);this._promises[Z].reject($),delete this._promises[Z]}}}x$.SubscriptionState=k;x$.State=j;x$.UnauthorizedError=a;var $Z=e8(null),X1=$Z;var o=Object.create(null);o.open="0";o.close="1";o.ping="2";o.pong="3";o.message="4";o.upgrade="5";o.noop="6";var j$=Object.create(null);Object.keys(o).forEach(($)=>{j$[o[$]]=$});var g$={type:"error",data:"parser error"};var M1=typeof Blob==="function"||typeof Blob!=="undefined"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",F1=typeof ArrayBuffer==="function",z1=($)=>{return typeof ArrayBuffer.isView==="function"?ArrayBuffer.isView($):$&&$.buffer instanceof ArrayBuffer},E$=({type:$,data:Z},Q,J)=>{if(M1&&Z instanceof Blob)if(Q)return J(Z);else return H1(Z,J);else if(F1&&(Z instanceof ArrayBuffer||z1(Z)))if(Q)return J(Z);else return H1(new Blob([Z]),J);return J(o[$]+(Z||""))},H1=($,Z)=>{let Q=new FileReader;return Q.onload=function(){let J=Q.result.split(",")[1];Z("b"+(J||""))},Q.readAsDataURL($)};function V1($){if($ instanceof Uint8Array)return $;else if($ instanceof ArrayBuffer)return new Uint8Array($);else return new Uint8Array($.buffer,$.byteOffset,$.byteLength)}var d0;function I1($,Z){if(M1&&$.data instanceof Blob)return $.data.arrayBuffer().then(V1).then(Z);else if(F1&&($.data instanceof ArrayBuffer||z1($.data)))return Z(V1($.data));E$($,!1,(Q)=>{if(!d0)d0=new TextEncoder;Z(d0.encode(Q))})}var _$=typeof Uint8Array==="undefined"?[]:new Uint8Array(256);for(let $=0;$<64;$++)_$["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt($)]=$;var W1=($)=>{let Z=$.length*0.75,Q=$.length,J,K=0,U,Y,G,X;if($[$.length-1]==="="){if(Z--,$[$.length-2]==="=")Z--}let V=new ArrayBuffer(Z),F=new Uint8Array(V);for(J=0;J<Q;J+=4)U=_$[$.charCodeAt(J)],Y=_$[$.charCodeAt(J+1)],G=_$[$.charCodeAt(J+2)],X=_$[$.charCodeAt(J+3)],F[K++]=U<<2|Y>>4,F[K++]=(Y&15)<<4|G>>2,F[K++]=(G&3)<<6|X&63;return V};var ZZ=typeof ArrayBuffer==="function",v$=($,Z)=>{if(typeof $!=="string")return{type:"message",data:q1($,Z)};let Q=$.charAt(0);if(Q==="b")return{type:"message",data:QZ($.substring(1),Z)};if(!j$[Q])return g$;return $.length>1?{type:j$[Q],data:$.substring(1)}:{type:j$[Q]}},QZ=($,Z)=>{if(ZZ){let Q=W1($);return q1(Q,Z)}else return{base64:!0,data:$}},q1=($,Z)=>{switch(Z){case"blob":if($ instanceof Blob)return $;else return new Blob([$]);case"arraybuffer":default:if($ instanceof ArrayBuffer)return $;else return $.buffer}};var L1=String.fromCharCode(30),O1=($,Z)=>{let Q=$.length,J=new Array(Q),K=0;$.forEach((U,Y)=>{E$(U,!1,(G)=>{if(J[Y]=G,++K===Q)Z(J.join(L1))})})},B1=($,Z)=>{let Q=$.split(L1),J=[];for(let K=0;K<Q.length;K++){let U=v$(Q[K],Z);if(J.push(U),U.type==="error")break}return J};function w1(){return new TransformStream({transform($,Z){I1($,(Q)=>{let J=Q.length,K;if(J<126)K=new Uint8Array(1),new DataView(K.buffer).setUint8(0,J);else if(J<65536){K=new Uint8Array(3);let U=new DataView(K.buffer);U.setUint8(0,126),U.setUint16(1,J)}else{K=new Uint8Array(9);let U=new DataView(K.buffer);U.setUint8(0,127),U.setBigUint64(1,BigInt(J))}if($.data&&typeof $.data!=="string")K[0]|=128;Z.enqueue(K),Z.enqueue(Q)})}})}var l0;function X0($){return $.reduce((Z,Q)=>Z+Q.length,0)}function H0($,Z){if($[0].length===Z)return $.shift();let Q=new Uint8Array(Z),J=0;for(let K=0;K<Z;K++)if(Q[K]=$[0][J++],J===$[0].length)$.shift(),J=0;if($.length&&J<$[0].length)$[0]=$[0].slice(J);return Q}function A1($,Z){if(!l0)l0=new TextDecoder;let Q=[],J=0,K=-1,U=!1;return new TransformStream({transform(Y,G){Q.push(Y);while(!0){if(J===0){if(X0(Q)<1)break;let X=H0(Q,1);if(U=(X[0]&128)===128,K=X[0]&127,K<126)J=3;else if(K===126)J=1;else J=2}else if(J===1){if(X0(Q)<2)break;let X=H0(Q,2);K=new DataView(X.buffer,X.byteOffset,X.length).getUint16(0),J=3}else if(J===2){if(X0(Q)<8)break;let X=H0(Q,8),V=new DataView(X.buffer,X.byteOffset,X.length),F=V.getUint32(0);if(F>Math.pow(2,21)-1){G.enqueue(g$);break}K=F*Math.pow(2,32)+V.getUint32(4),J=3}else{if(X0(Q)<K)break;let X=H0(Q,K);G.enqueue(v$(U?X:l0.decode(X),Z)),J=0}if(K===0||K>$){G.enqueue(g$);break}}}})}var c0=4;function T($){if($)return JZ($)}function JZ($){for(var Z in T.prototype)$[Z]=T.prototype[Z];return $}T.prototype.on=T.prototype.addEventListener=function($,Z){return this._callbacks=this._callbacks||{},(this._callbacks["$"+$]=this._callbacks["$"+$]||[]).push(Z),this};T.prototype.once=function($,Z){function Q(){this.off($,Q),Z.apply(this,arguments)}return Q.fn=Z,this.on($,Q),this};T.prototype.off=T.prototype.removeListener=T.prototype.removeAllListeners=T.prototype.removeEventListener=function($,Z){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var Q=this._callbacks["$"+$];if(!Q)return this;if(arguments.length==1)return delete this._callbacks["$"+$],this;var J;for(var K=0;K<Q.length;K++)if(J=Q[K],J===Z||J.fn===Z){Q.splice(K,1);break}if(Q.length===0)delete this._callbacks["$"+$];return this};T.prototype.emit=function($){this._callbacks=this._callbacks||{};var Z=new Array(arguments.length-1),Q=this._callbacks["$"+$];for(var J=1;J<arguments.length;J++)Z[J-1]=arguments[J];if(Q){Q=Q.slice(0);for(var J=0,K=Q.length;J<K;++J)Q[J].apply(this,Z)}return this};T.prototype.emitReserved=T.prototype.emit;T.prototype.listeners=function($){return this._callbacks=this._callbacks||{},this._callbacks["$"+$]||[]};T.prototype.hasListeners=function($){return!!this.listeners($).length};var J$=(()=>{if(typeof Promise==="function"&&typeof Promise.resolve==="function")return(Z)=>Promise.resolve().then(Z);else return(Z,Q)=>Q(Z,0)})(),b=(()=>{if(typeof self!=="undefined")return self;else if(typeof window!=="undefined")return window;else return Function("return this")()})(),R1="arraybuffer";function D1(){}function V0($,...Z){return Z.reduce((Q,J)=>{if($.hasOwnProperty(J))Q[J]=$[J];return Q},{})}var KZ=b.setTimeout,UZ=b.clearTimeout;function K$($,Z){if(Z.useNativeTimers)$.setTimeoutFn=KZ.bind(b),$.clearTimeoutFn=UZ.bind(b);else $.setTimeoutFn=b.setTimeout.bind(b),$.clearTimeoutFn=b.clearTimeout.bind(b)}var YZ=1.33;function P1($){if(typeof $==="string")return GZ($);return Math.ceil(($.byteLength||$.size)*YZ)}function GZ($){let Z=0,Q=0;for(let J=0,K=$.length;J<K;J++)if(Z=$.charCodeAt(J),Z<128)Q+=1;else if(Z<2048)Q+=2;else if(Z<55296||Z>=57344)Q+=3;else J++,Q+=4;return Q}function M0(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function f1($){let Z="";for(let Q in $)if($.hasOwnProperty(Q)){if(Z.length)Z+="&";Z+=encodeURIComponent(Q)+"="+encodeURIComponent($[Q])}return Z}function C1($){let Z={},Q=$.split("&");for(let J=0,K=Q.length;J<K;J++){let U=Q[J].split("=");Z[decodeURIComponent(U[0])]=decodeURIComponent(U[1])}return Z}class p0 extends Error{constructor($,Z,Q){super($);this.description=Z,this.context=Q,this.type="TransportError"}}class V$ extends T{constructor($){super();this.writable=!1,K$(this,$),this.opts=$,this.query=$.query,this.socket=$.socket,this.supportsBinary=!$.forceBase64}onError($,Z,Q){return super.emitReserved("error",new p0($,Z,Q)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){if(this.readyState==="opening"||this.readyState==="open")this.doClose(),this.onClose();return this}send($){if(this.readyState==="open")this.write($)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData($){let Z=v$($,this.socket.binaryType);this.onPacket(Z)}onPacket($){super.emitReserved("packet",$)}onClose($){this.readyState="closed",super.emitReserved("close",$)}pause($){}createUri($,Z={}){return $+"://"+this._hostname()+this._port()+this.opts.path+this._query(Z)}_hostname(){let $=this.opts.hostname;return $.indexOf(":")===-1?$:"["+$+"]"}_port(){if(this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80))return":"+this.opts.port;else return""}_query($){let Z=f1($);return Z.length?"?"+Z:""}}class F0 extends V${constructor(){super(...arguments);this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause($){this.readyState="pausing";let Z=()=>{this.readyState="paused",$()};if(this._polling||!this.writable){let Q=0;if(this._polling)Q++,this.once("pollComplete",function(){--Q||Z()});if(!this.writable)Q++,this.once("drain",function(){--Q||Z()})}else Z()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData($){let Z=(Q)=>{if(this.readyState==="opening"&&Q.type==="open")this.onOpen();if(Q.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(Q)};if(B1($,this.socket.binaryType).forEach(Z),this.readyState!=="closed"){if(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open")this._poll()}}doClose(){let $=()=>{this.write([{type:"close"}])};if(this.readyState==="open")$();else this.once("open",$)}write($){this.writable=!1,O1($,(Z)=>{this.doWrite(Z,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let $=this.opts.secure?"https":"http",Z=this.query||{};if(this.opts.timestampRequests!==!1)Z[this.opts.timestampParam]=M0();if(!this.supportsBinary&&!Z.sid)Z.b64=1;return this.createUri($,Z)}}var N1=!1;try{N1=typeof XMLHttpRequest!=="undefined"&&"withCredentials"in new XMLHttpRequest}catch($){}var S1=N1;function XZ(){}class x1 extends F0{constructor($){super($);if(typeof location!=="undefined"){let Z=location.protocol==="https:",Q=location.port;if(!Q)Q=Z?"443":"80";this.xd=typeof location!=="undefined"&&$.hostname!==location.hostname||Q!==$.port}}doWrite($,Z){let Q=this.request({method:"POST",data:$});Q.on("success",Z),Q.on("error",(J,K)=>{this.onError("xhr post error",J,K)})}doPoll(){let $=this.request();$.on("data",this.onData.bind(this)),$.on("error",(Z,Q)=>{this.onError("xhr poll error",Z,Q)}),this.pollXhr=$}}class r extends T{constructor($,Z,Q){super();this.createRequest=$,K$(this,Q),this._opts=Q,this._method=Q.method||"GET",this._uri=Z,this._data=Q.data!==void 0?Q.data:null,this._create()}_create(){var $;let Z=V0(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");Z.xdomain=!!this._opts.xd;let Q=this._xhr=this.createRequest(Z);try{Q.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){Q.setDisableHeaderCheck&&Q.setDisableHeaderCheck(!0);for(let J in this._opts.extraHeaders)if(this._opts.extraHeaders.hasOwnProperty(J))Q.setRequestHeader(J,this._opts.extraHeaders[J])}}catch(J){}if(this._method==="POST")try{Q.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(J){}try{Q.setRequestHeader("Accept","*/*")}catch(J){}if(($=this._opts.cookieJar)===null||$===void 0||$.addCookies(Q),"withCredentials"in Q)Q.withCredentials=this._opts.withCredentials;if(this._opts.requestTimeout)Q.timeout=this._opts.requestTimeout;Q.onreadystatechange=()=>{var J;if(Q.readyState===3)(J=this._opts.cookieJar)===null||J===void 0||J.parseCookies(Q.getResponseHeader("set-cookie"));if(Q.readyState!==4)return;if(Q.status===200||Q.status===1223)this._onLoad();else this.setTimeoutFn(()=>{this._onError(typeof Q.status==="number"?Q.status:0)},0)},Q.send(this._data)}catch(J){this.setTimeoutFn(()=>{this._onError(J)},0);return}if(typeof document!=="undefined")this._index=r.requestsCount++,r.requests[this._index]=this}_onError($){this.emitReserved("error",$,this._xhr),this._cleanup(!0)}_cleanup($){if(typeof this._xhr==="undefined"||this._xhr===null)return;if(this._xhr.onreadystatechange=XZ,$)try{this._xhr.abort()}catch(Z){}if(typeof document!=="undefined")delete r.requests[this._index];this._xhr=null}_onLoad(){let $=this._xhr.responseText;if($!==null)this.emitReserved("data",$),this.emitReserved("success"),this._cleanup()}abort(){this._cleanup()}}r.requestsCount=0;r.requests={};if(typeof document!=="undefined"){if(typeof attachEvent==="function")attachEvent("onunload",T1);else if(typeof addEventListener==="function"){let $="onpagehide"in b?"pagehide":"unload";addEventListener($,T1,!1)}}function T1(){for(let $ in r.requests)if(r.requests.hasOwnProperty($))r.requests[$].abort()}var HZ=function(){let $=j1({xdomain:!1});return $&&$.responseType!==null}();class W$ extends x1{constructor($){super($);let Z=$&&$.forceBase64;this.supportsBinary=HZ&&!Z}request($={}){return Object.assign($,{xd:this.xd},this.opts),new r(j1,this.uri(),$)}}function j1($){let Z=$.xdomain;try{if(typeof XMLHttpRequest!=="undefined"&&(!Z||S1))return new XMLHttpRequest}catch(Q){}if(!Z)try{return new b[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(Q){}}var g1=typeof navigator!=="undefined"&&typeof navigator.product==="string"&&navigator.product.toLowerCase()==="reactnative";class E1 extends V${get name(){return"websocket"}doOpen(){let $=this.uri(),Z=this.opts.protocols,Q=g1?{}:V0(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");if(this.opts.extraHeaders)Q.headers=this.opts.extraHeaders;try{this.ws=this.createSocket($,Z,Q)}catch(J){return this.emitReserved("error",J)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{if(this.opts.autoUnref)this.ws._socket.unref();this.onOpen()},this.ws.onclose=($)=>this.onClose({description:"websocket connection closed",context:$}),this.ws.onmessage=($)=>this.onData($.data),this.ws.onerror=($)=>this.onError("websocket error",$)}write($){this.writable=!1;for(let Z=0;Z<$.length;Z++){let Q=$[Z],J=Z===$.length-1;E$(Q,this.supportsBinary,(K)=>{try{this.doWrite(Q,K)}catch(U){}if(J)J$(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){if(typeof this.ws!=="undefined")this.ws.onerror=()=>{},this.ws.close(),this.ws=null}uri(){let $=this.opts.secure?"wss":"ws",Z=this.query||{};if(this.opts.timestampRequests)Z[this.opts.timestampParam]=M0();if(!this.supportsBinary)Z.b64=1;return this.createUri($,Z)}}var i0=b.WebSocket||b.MozWebSocket;class q$ extends E1{createSocket($,Z,Q){return!g1?Z?new i0($,Z):new i0($):new i0($,Z,Q)}doWrite($,Z){this.ws.send(Z)}}class y$ extends V${get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch($){return this.emitReserved("error",$)}this._transport.closed.then(()=>{this.onClose()}).catch(($)=>{this.onError("webtransport error",$)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(($)=>{let Z=A1(Number.MAX_SAFE_INTEGER,this.socket.binaryType),Q=$.readable.pipeThrough(Z).getReader(),J=w1();J.readable.pipeTo($.writable),this._writer=J.writable.getWriter();let K=()=>{Q.read().then(({done:Y,value:G})=>{if(Y)return;this.onPacket(G),K()}).catch((Y)=>{})};K();let U={type:"open"};if(this.query.sid)U.data=`{"sid":"${this.query.sid}"}`;this._writer.write(U).then(()=>this.onOpen())})})}write($){this.writable=!1;for(let Z=0;Z<$.length;Z++){let Q=$[Z],J=Z===$.length-1;this._writer.write(Q).then(()=>{if(J)J$(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var $;($=this._transport)===null||$===void 0||$.close()}}var n0={websocket:q$,webtransport:y$,polling:W$};var VZ=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,MZ=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function R$($){if($.length>8000)throw"URI too long";let Z=$,Q=$.indexOf("["),J=$.indexOf("]");if(Q!=-1&&J!=-1)$=$.substring(0,Q)+$.substring(Q,J).replace(/:/g,";")+$.substring(J,$.length);let K=VZ.exec($||""),U={},Y=14;while(Y--)U[MZ[Y]]=K[Y]||"";if(Q!=-1&&J!=-1)U.source=Z,U.host=U.host.substring(1,U.host.length-1).replace(/;/g,":"),U.authority=U.authority.replace("[","").replace("]","").replace(/;/g,":"),U.ipv6uri=!0;return U.pathNames=FZ(U,U.path),U.queryKey=zZ(U,U.query),U}function FZ($,Z){let Q=/\/{2,9}/g,J=Z.replace(Q,"/").split("/");if(Z.slice(0,1)=="/"||Z.length===0)J.splice(0,1);if(Z.slice(-1)=="/")J.splice(J.length-1,1);return J}function zZ($,Z){let Q={};return Z.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(J,K,U){if(K)Q[K]=U}),Q}var o0=typeof addEventListener==="function"&&typeof removeEventListener==="function",z0=[];if(o0)addEventListener("offline",()=>{z0.forEach(($)=>$())},!1);class U$ extends T{constructor($,Z){super();if(this.binaryType=R1,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,$&&typeof $==="object")Z=$,$=null;if($){let Q=R$($);if(Z.hostname=Q.host,Z.secure=Q.protocol==="https"||Q.protocol==="wss",Z.port=Q.port,Q.query)Z.query=Q.query}else if(Z.host)Z.hostname=R$(Z.host).host;if(K$(this,Z),this.secure=Z.secure!=null?Z.secure:typeof location!=="undefined"&&location.protocol==="https:",Z.hostname&&!Z.port)Z.port=this.secure?"443":"80";if(this.hostname=Z.hostname||(typeof location!=="undefined"?location.hostname:"localhost"),this.port=Z.port||(typeof location!=="undefined"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},Z.transports.forEach((Q)=>{let J=Q.prototype.name;this.transports.push(J),this._transportsByName[J]=Q}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},Z),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query==="string")this.opts.query=C1(this.opts.query);if(o0){if(this.opts.closeOnBeforeunload)this._beforeunloadEventListener=()=>{if(this.transport)this.transport.removeAllListeners(),this.transport.close()},addEventListener("beforeunload",this._beforeunloadEventListener,!1);if(this.hostname!=="localhost")this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},z0.push(this._offlineEventListener)}if(this.opts.withCredentials)this._cookieJar=D1();this._open()}createTransport($){let Z=Object.assign({},this.opts.query);if(Z.EIO=c0,Z.transport=$,this.id)Z.sid=this.id;let Q=Object.assign({},this.opts,{query:Z,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[$]);return new this._transportsByName[$](Q)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}let $=this.opts.rememberUpgrade&&U$.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";let Z=this.createTransport($);Z.open(),this.setTransport(Z)}setTransport($){if(this.transport)this.transport.removeAllListeners();this.transport=$,$.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",(Z)=>this._onClose("transport close",Z))}onOpen(){this.readyState="open",U$.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket($){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",$),this.emitReserved("heartbeat"),$.type){case"open":this.onHandshake(JSON.parse($.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let Z=new Error("server error");Z.code=$.data,this._onError(Z);break;case"message":this.emitReserved("data",$.data),this.emitReserved("message",$.data);break}}onHandshake($){if(this.emitReserved("handshake",$),this.id=$.sid,this.transport.query.sid=$.sid,this._pingInterval=$.pingInterval,this._pingTimeout=$.pingTimeout,this._maxPayload=$.maxPayload,this.onOpen(),this.readyState==="closed")return;this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let $=this._pingInterval+this._pingTimeout;if(this._pingTimeoutTime=Date.now()+$,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},$),this.opts.autoUnref)this._pingTimeoutTimer.unref()}_onDrain(){if(this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0)this.emitReserved("drain");else this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let $=this._getWritablePackets();this.transport.send($),this._prevBufferLen=$.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let Z=1;for(let Q=0;Q<this.writeBuffer.length;Q++){let J=this.writeBuffer[Q].data;if(J)Z+=P1(J);if(Q>0&&Z>this._maxPayload)return this.writeBuffer.slice(0,Q);Z+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let $=Date.now()>this._pingTimeoutTime;if($)this._pingTimeoutTime=0,J$(()=>{this._onClose("ping timeout")},this.setTimeoutFn);return $}write($,Z,Q){return this._sendPacket("message",$,Z,Q),this}send($,Z,Q){return this._sendPacket("message",$,Z,Q),this}_sendPacket($,Z,Q,J){if(typeof Z==="function")J=Z,Z=void 0;if(typeof Q==="function")J=Q,Q=null;if(this.readyState==="closing"||this.readyState==="closed")return;Q=Q||{},Q.compress=Q.compress!==!1;let K={type:$,data:Z,options:Q};if(this.emitReserved("packetCreate",K),this.writeBuffer.push(K),J)this.once("flush",J);this.flush()}close(){let $=()=>{this._onClose("forced close"),this.transport.close()},Z=()=>{this.off("upgrade",Z),this.off("upgradeError",Z),$()},Q=()=>{this.once("upgrade",Z),this.once("upgradeError",Z)};if(this.readyState==="opening"||this.readyState==="open")if(this.readyState="closing",this.writeBuffer.length)this.once("drain",()=>{if(this.upgrading)Q();else $()});else if(this.upgrading)Q();else $();return this}_onError($){if(U$.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",$),this._onClose("transport error",$)}_onClose($,Z){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),o0){if(this._beforeunloadEventListener)removeEventListener("beforeunload",this._beforeunloadEventListener,!1);if(this._offlineEventListener){let Q=z0.indexOf(this._offlineEventListener);if(Q!==-1)z0.splice(Q,1)}}this.readyState="closed",this.id=null,this.emitReserved("close",$,Z),this.writeBuffer=[],this._prevBufferLen=0}}}U$.protocol=c0;class s0 extends U${constructor(){super(...arguments);this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let $=0;$<this._upgrades.length;$++)this._probe(this._upgrades[$])}_probe($){let Z=this.createTransport($),Q=!1;U$.priorWebsocketSuccess=!1;let J=()=>{if(Q)return;Z.send([{type:"ping",data:"probe"}]),Z.once("packet",(F)=>{if(Q)return;if(F.type==="pong"&&F.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",Z),!Z)return;U$.priorWebsocketSuccess=Z.name==="websocket",this.transport.pause(()=>{if(Q)return;if(this.readyState==="closed")return;V(),this.setTransport(Z),Z.send([{type:"upgrade"}]),this.emitReserved("upgrade",Z),Z=null,this.upgrading=!1,this.flush()})}else{let z=new Error("probe error");z.transport=Z.name,this.emitReserved("upgradeError",z)}})};function K(){if(Q)return;Q=!0,V(),Z.close(),Z=null}let U=(F)=>{let z=new Error("probe error: "+F);z.transport=Z.name,K(),this.emitReserved("upgradeError",z)};function Y(){U("transport closed")}function G(){U("socket closed")}function X(F){if(Z&&F.name!==Z.name)K()}let V=()=>{Z.removeListener("open",J),Z.removeListener("error",U),Z.removeListener("close",Y),this.off("close",G),this.off("upgrading",X)};if(Z.once("open",J),Z.once("error",U),Z.once("close",Y),this.once("close",G),this.once("upgrading",X),this._upgrades.indexOf("webtransport")!==-1&&$!=="webtransport")this.setTimeoutFn(()=>{if(!Q)Z.open()},200);else Z.open()}onHandshake($){this._upgrades=this._filterUpgrades($.upgrades),super.onHandshake($)}_filterUpgrades($){let Z=[];for(let Q=0;Q<$.length;Q++)if(~this.transports.indexOf($[Q]))Z.push($[Q]);return Z}}class h$ extends s0{constructor($,Z={}){let Q=typeof $==="object"?$:Z;if(!Q.transports||Q.transports&&typeof Q.transports[0]==="string")Q.transports=(Q.transports||["polling","websocket","webtransport"]).map((J)=>n0[J]).filter((J)=>!!J);super($,Q)}}var y4=h$.protocol;function _1($,Z="",Q){let J=$;if(Q=Q||typeof location!=="undefined"&&location,$==null)$=Q.protocol+"//"+Q.host;if(typeof $==="string"){if($.charAt(0)==="/")if($.charAt(1)==="/")$=Q.protocol+$;else $=Q.host+$;if(!/^(https?|wss?):\/\//.test($))if(typeof Q!=="undefined")$=Q.protocol+"//"+$;else $="https://"+$;J=R$($)}if(!J.port){if(/^(http|ws)$/.test(J.protocol))J.port="80";else if(/^(http|ws)s$/.test(J.protocol))J.port="443"}J.path=J.path||"/";let U=J.host.indexOf(":")!==-1?"["+J.host+"]":J.host;return J.id=J.protocol+"://"+U+":"+J.port+Z,J.href=J.protocol+"://"+U+(Q&&Q.port===J.port?"":":"+J.port),J}var e0={};g8(e0,{protocol:()=>b1,isPacketValid:()=>RZ,PacketType:()=>R,Encoder:()=>m1,Decoder:()=>t0});var WZ=typeof ArrayBuffer==="function",qZ=($)=>{return typeof ArrayBuffer.isView==="function"?ArrayBuffer.isView($):$.buffer instanceof ArrayBuffer},v1=Object.prototype.toString,LZ=typeof Blob==="function"||typeof Blob!=="undefined"&&v1.call(Blob)==="[object BlobConstructor]",OZ=typeof File==="function"||typeof File!=="undefined"&&v1.call(File)==="[object FileConstructor]";function b$($){return WZ&&($ instanceof ArrayBuffer||qZ($))||LZ&&$ instanceof Blob||OZ&&$ instanceof File}function k$($,Z){if(!$||typeof $!=="object")return!1;if(Array.isArray($)){for(let Q=0,J=$.length;Q<J;Q++)if(k$($[Q]))return!0;return!1}if(b$($))return!0;if($.toJSON&&typeof $.toJSON==="function"&&arguments.length===1)return k$($.toJSON(),!0);for(let Q in $)if(Object.prototype.hasOwnProperty.call($,Q)&&k$($[Q]))return!0;return!1}function y1($){let Z=[],Q=$.data,J=$;return J.data=a0(Q,Z),J.attachments=Z.length,{packet:J,buffers:Z}}function a0($,Z){if(!$)return $;if(b$($)){let Q={_placeholder:!0,num:Z.length};return Z.push($),Q}else if(Array.isArray($)){let Q=new Array($.length);for(let J=0;J<$.length;J++)Q[J]=a0($[J],Z);return Q}else if(typeof $==="object"&&!($ instanceof Date)){let Q={};for(let J in $)if(Object.prototype.hasOwnProperty.call($,J))Q[J]=a0($[J],Z);return Q}return $}function h1($,Z){return $.data=r0($.data,Z),delete $.attachments,$}function r0($,Z){if(!$)return $;if($&&$._placeholder===!0)if(typeof $.num==="number"&&$.num>=0&&$.num<Z.length)return Z[$.num];else throw new Error("illegal attachments");else if(Array.isArray($))for(let Q=0;Q<$.length;Q++)$[Q]=r0($[Q],Z);else if(typeof $==="object"){for(let Q in $)if(Object.prototype.hasOwnProperty.call($,Q))$[Q]=r0($[Q],Z)}return $}var k1=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],b1=5,R;(function($){$[$.CONNECT=0]="CONNECT",$[$.DISCONNECT=1]="DISCONNECT",$[$.EVENT=2]="EVENT",$[$.ACK=3]="ACK",$[$.CONNECT_ERROR=4]="CONNECT_ERROR",$[$.BINARY_EVENT=5]="BINARY_EVENT",$[$.BINARY_ACK=6]="BINARY_ACK"})(R||(R={}));class m1{constructor($){this.replacer=$}encode($){if($.type===R.EVENT||$.type===R.ACK){if(k$($))return this.encodeAsBinary({type:$.type===R.EVENT?R.BINARY_EVENT:R.BINARY_ACK,nsp:$.nsp,data:$.data,id:$.id})}return[this.encodeAsString($)]}encodeAsString($){let Z=""+$.type;if($.type===R.BINARY_EVENT||$.type===R.BINARY_ACK)Z+=$.attachments+"-";if($.nsp&&$.nsp!=="/")Z+=$.nsp+",";if($.id!=null)Z+=$.id;if($.data!=null)Z+=JSON.stringify($.data,this.replacer);return Z}encodeAsBinary($){let Z=y1($),Q=this.encodeAsString(Z.packet),J=Z.buffers;return J.unshift(Q),J}}class t0 extends T{constructor($){super();this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof $==="function"?{reviver:$}:$)}add($){let Z;if(typeof $==="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");Z=this.decodeString($);let Q=Z.type===R.BINARY_EVENT;if(Q||Z.type===R.BINARY_ACK){if(Z.type=Q?R.EVENT:R.ACK,this.reconstructor=new u1(Z),Z.attachments===0)super.emitReserved("decoded",Z)}else super.emitReserved("decoded",Z)}else if(b$($)||$.base64){if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");else if(Z=this.reconstructor.takeBinaryData($),Z)this.reconstructor=null,super.emitReserved("decoded",Z)}else throw new Error("Unknown type: "+$)}decodeString($){let Z=0,Q={type:Number($.charAt(0))};if(R[Q.type]===void 0)throw new Error("unknown packet type "+Q.type);if(Q.type===R.BINARY_EVENT||Q.type===R.BINARY_ACK){let K=Z+1;while($.charAt(++Z)!=="-"&&Z!=$.length);let U=$.substring(K,Z);if(U!=Number(U)||$.charAt(Z)!=="-")throw new Error("Illegal attachments");let Y=Number(U);if(!d1(Y)||Y<0)throw new Error("Illegal attachments");else if(Y>this.opts.maxAttachments)throw new Error("too many attachments");Q.attachments=Y}if($.charAt(Z+1)==="/"){let K=Z+1;while(++Z){if($.charAt(Z)===",")break;if(Z===$.length)break}Q.nsp=$.substring(K,Z)}else Q.nsp="/";let J=$.charAt(Z+1);if(J!==""&&Number(J)==J){let K=Z+1;while(++Z){let U=$.charAt(Z);if(U==null||Number(U)!=U){--Z;break}if(Z===$.length)break}Q.id=Number($.substring(K,Z+1))}if($.charAt(++Z)){let K=this.tryParse($.substr(Z));if(t0.isPayloadValid(Q.type,K))Q.data=K;else throw new Error("invalid payload")}return Q}tryParse($){try{return JSON.parse($,this.opts.reviver)}catch(Z){return!1}}static isPayloadValid($,Z){switch($){case R.CONNECT:return I0(Z);case R.DISCONNECT:return Z===void 0;case R.CONNECT_ERROR:return typeof Z==="string"||I0(Z);case R.EVENT:case R.BINARY_EVENT:return Array.isArray(Z)&&(typeof Z[0]==="number"||typeof Z[0]==="string"&&k1.indexOf(Z[0])===-1);case R.ACK:case R.BINARY_ACK:return Array.isArray(Z)}}destroy(){if(this.reconstructor)this.reconstructor.finishedReconstruction(),this.reconstructor=null}}class u1{constructor($){this.packet=$,this.buffers=[],this.reconPack=$}takeBinaryData($){if(this.buffers.push($),this.buffers.length===this.reconPack.attachments){let Z=h1(this.reconPack,this.buffers);return this.finishedReconstruction(),Z}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function BZ($){return typeof $==="string"}var d1=Number.isInteger||function($){return typeof $==="number"&&isFinite($)&&Math.floor($)===$};function wZ($){return $===void 0||d1($)}function I0($){return Object.prototype.toString.call($)==="[object Object]"}function AZ($,Z){switch($){case R.CONNECT:return Z===void 0||I0(Z);case R.DISCONNECT:return Z===void 0;case R.EVENT:return Array.isArray(Z)&&(typeof Z[0]==="number"||typeof Z[0]==="string"&&k1.indexOf(Z[0])===-1);case R.ACK:return Array.isArray(Z);case R.CONNECT_ERROR:return typeof Z==="string"||I0(Z);default:return!1}}function RZ($){return BZ($.nsp)&&wZ($.id)&&AZ($.type,$.data)}function p($,Z,Q){return $.on(Z,Q),function J(){$.off(Z,Q)}}var DZ=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class m$ extends T{constructor($,Z,Q){super();if(this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=$,this.nsp=Z,Q&&Q.auth)this.auth=Q.auth;if(this._opts=Object.assign({},Q),this.io._autoConnect)this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let $=this.io;this.subs=[p($,"open",this.onopen.bind(this)),p($,"packet",this.onpacket.bind(this)),p($,"error",this.onerror.bind(this)),p($,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){if(this.connected)return this;if(this.subEvents(),!this.io._reconnecting)this.io.open();if(this.io._readyState==="open")this.onopen();return this}open(){return this.connect()}send(...$){return $.unshift("message"),this.emit.apply(this,$),this}emit($,...Z){var Q,J,K;if(DZ.hasOwnProperty($))throw new Error('"'+$.toString()+'" is a reserved event name');if(Z.unshift($),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(Z),this;let U={type:R.EVENT,data:Z};if(U.options={},U.options.compress=this.flags.compress!==!1,typeof Z[Z.length-1]==="function"){let V=this.ids++,F=Z.pop();this._registerAckCallback(V,F),U.id=V}let Y=(J=(Q=this.io.engine)===null||Q===void 0?void 0:Q.transport)===null||J===void 0?void 0:J.writable,G=this.connected&&!((K=this.io.engine)===null||K===void 0?void 0:K._hasPingExpired());if(this.flags.volatile&&!Y);else if(G)this.notifyOutgoingListeners(U),this.packet(U);else this.sendBuffer.push(U);return this.flags={},this}_registerAckCallback($,Z){var Q;let J=(Q=this.flags.timeout)!==null&&Q!==void 0?Q:this._opts.ackTimeout;if(J===void 0){this.acks[$]=Z;return}let K=this.io.setTimeoutFn(()=>{delete this.acks[$];for(let Y=0;Y<this.sendBuffer.length;Y++)if(this.sendBuffer[Y].id===$)this.sendBuffer.splice(Y,1);Z.call(this,new Error("operation has timed out"))},J),U=(...Y)=>{this.io.clearTimeoutFn(K),Z.apply(this,Y)};U.withError=!0,this.acks[$]=U}emitWithAck($,...Z){return new Promise((Q,J)=>{let K=(U,Y)=>{return U?J(U):Q(Y)};K.withError=!0,Z.push(K),this.emit($,...Z)})}_addToQueue($){let Z;if(typeof $[$.length-1]==="function")Z=$.pop();let Q={id:this._queueSeq++,tryCount:0,pending:!1,args:$,flags:Object.assign({fromQueue:!0},this.flags)};$.push((J,...K)=>{if(Q!==this._queue[0]);if(J!==null){if(Q.tryCount>this._opts.retries){if(this._queue.shift(),Z)Z(J)}}else if(this._queue.shift(),Z)Z(null,...K);return Q.pending=!1,this._drainQueue()}),this._queue.push(Q),this._drainQueue()}_drainQueue($=!1){if(!this.connected||this._queue.length===0)return;let Z=this._queue[0];if(Z.pending&&!$)return;Z.pending=!0,Z.tryCount++,this.flags=Z.flags,this.emit.apply(this,Z.args)}packet($){$.nsp=this.nsp,this.io._packet($)}onopen(){if(typeof this.auth=="function")this.auth(($)=>{this._sendConnectPacket($)});else this._sendConnectPacket(this.auth)}_sendConnectPacket($){this.packet({type:R.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},$):$})}onerror($){if(!this.connected)this.emitReserved("connect_error",$)}onclose($,Z){this.connected=!1,delete this.id,this.emitReserved("disconnect",$,Z),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(($)=>{if(!this.sendBuffer.some((Q)=>String(Q.id)===$)){let Q=this.acks[$];if(delete this.acks[$],Q.withError)Q.call(this,new Error("socket has been disconnected"))}})}onpacket($){if($.nsp!==this.nsp)return;switch($.type){case R.CONNECT:if($.data&&$.data.sid)this.onconnect($.data.sid,$.data.pid);else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case R.EVENT:case R.BINARY_EVENT:this.onevent($);break;case R.ACK:case R.BINARY_ACK:this.onack($);break;case R.DISCONNECT:this.ondisconnect();break;case R.CONNECT_ERROR:this.destroy();let Q=new Error($.data.message);Q.data=$.data.data,this.emitReserved("connect_error",Q);break}}onevent($){let Z=$.data||[];if($.id!=null)Z.push(this.ack($.id));if(this.connected)this.emitEvent(Z);else this.receiveBuffer.push(Object.freeze(Z))}emitEvent($){if(this._anyListeners&&this._anyListeners.length){let Z=this._anyListeners.slice();for(let Q of Z)Q.apply(this,$)}if(super.emit.apply(this,$),this._pid&&$.length&&typeof $[$.length-1]==="string")this._lastOffset=$[$.length-1]}ack($){let Z=this,Q=!1;return function(...J){if(Q)return;Q=!0,Z.packet({type:R.ACK,id:$,data:J})}}onack($){let Z=this.acks[$.id];if(typeof Z!=="function")return;if(delete this.acks[$.id],Z.withError)$.data.unshift(null);Z.apply(this,$.data)}onconnect($,Z){this.id=$,this.recovered=Z&&this._pid===Z,this._pid=Z,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(($)=>this.emitEvent($)),this.receiveBuffer=[],this.sendBuffer.forEach(($)=>{this.notifyOutgoingListeners($),this.packet($)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){if(this.subs)this.subs.forEach(($)=>$()),this.subs=void 0;this.io._destroy(this)}disconnect(){if(this.connected)this.packet({type:R.DISCONNECT});if(this.destroy(),this.connected)this.onclose("io client disconnect");return this}close(){return this.disconnect()}compress($){return this.flags.compress=$,this}get volatile(){return this.flags.volatile=!0,this}timeout($){return this.flags.timeout=$,this}onAny($){return this._anyListeners=this._anyListeners||[],this._anyListeners.push($),this}prependAny($){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift($),this}offAny($){if(!this._anyListeners)return this;if($){let Z=this._anyListeners;for(let Q=0;Q<Z.length;Q++)if($===Z[Q])return Z.splice(Q,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing($){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push($),this}prependAnyOutgoing($){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift($),this}offAnyOutgoing($){if(!this._anyOutgoingListeners)return this;if($){let Z=this._anyOutgoingListeners;for(let Q=0;Q<Z.length;Q++)if($===Z[Q])return Z.splice(Q,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners($){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let Z=this._anyOutgoingListeners.slice();for(let Q of Z)Q.apply(this,$.data)}}}function L$($){$=$||{},this.ms=$.min||100,this.max=$.max||1e4,this.factor=$.factor||2,this.jitter=$.jitter>0&&$.jitter<=1?$.jitter:0,this.attempts=0}L$.prototype.duration=function(){var $=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var Z=Math.random(),Q=Math.floor(Z*this.jitter*$);$=(Math.floor(Z*10)&1)==0?$-Q:$+Q}return Math.min($,this.max)|0};L$.prototype.reset=function(){this.attempts=0};L$.prototype.setMin=function($){this.ms=$};L$.prototype.setMax=function($){this.max=$};L$.prototype.setJitter=function($){this.jitter=$};class u$ extends T{constructor($,Z){var Q;super();if(this.nsps={},this.subs=[],$&&typeof $==="object")Z=$,$=void 0;Z=Z||{},Z.path=Z.path||"/socket.io",this.opts=Z,K$(this,Z),this.reconnection(Z.reconnection!==!1),this.reconnectionAttempts(Z.reconnectionAttempts||1/0),this.reconnectionDelay(Z.reconnectionDelay||1000),this.reconnectionDelayMax(Z.reconnectionDelayMax||5000),this.randomizationFactor((Q=Z.randomizationFactor)!==null&&Q!==void 0?Q:0.5),this.backoff=new L$({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(Z.timeout==null?20000:Z.timeout),this._readyState="closed",this.uri=$;let J=Z.parser||e0;if(this.encoder=new J.Encoder,this.decoder=new J.Decoder,this._autoConnect=Z.autoConnect!==!1,this._autoConnect)this.open()}reconnection($){if(!arguments.length)return this._reconnection;if(this._reconnection=!!$,!$)this.skipReconnect=!0;return this}reconnectionAttempts($){if($===void 0)return this._reconnectionAttempts;return this._reconnectionAttempts=$,this}reconnectionDelay($){var Z;if($===void 0)return this._reconnectionDelay;return this._reconnectionDelay=$,(Z=this.backoff)===null||Z===void 0||Z.setMin($),this}randomizationFactor($){var Z;if($===void 0)return this._randomizationFactor;return this._randomizationFactor=$,(Z=this.backoff)===null||Z===void 0||Z.setJitter($),this}reconnectionDelayMax($){var Z;if($===void 0)return this._reconnectionDelayMax;return this._reconnectionDelayMax=$,(Z=this.backoff)===null||Z===void 0||Z.setMax($),this}timeout($){if(!arguments.length)return this._timeout;return this._timeout=$,this}maybeReconnectOnOpen(){if(!this._reconnecting&&this._reconnection&&this.backoff.attempts===0)this.reconnect()}open($){if(~this._readyState.indexOf("open"))return this;this.engine=new h$(this.uri,this.opts);let Z=this.engine,Q=this;this._readyState="opening",this.skipReconnect=!1;let J=p(Z,"open",function(){Q.onopen(),$&&$()}),K=(Y)=>{if(this.cleanup(),this._readyState="closed",this.emitReserved("error",Y),$)$(Y);else this.maybeReconnectOnOpen()},U=p(Z,"error",K);if(this._timeout!==!1){let Y=this._timeout,G=this.setTimeoutFn(()=>{J(),K(new Error("timeout")),Z.close()},Y);if(this.opts.autoUnref)G.unref();this.subs.push(()=>{this.clearTimeoutFn(G)})}return this.subs.push(J),this.subs.push(U),this}connect($){return this.open($)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let $=this.engine;this.subs.push(p($,"ping",this.onping.bind(this)),p($,"data",this.ondata.bind(this)),p($,"error",this.onerror.bind(this)),p($,"close",this.onclose.bind(this)),p(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata($){try{this.decoder.add($)}catch(Z){this.onclose("parse error",Z)}}ondecoded($){J$(()=>{this.emitReserved("packet",$)},this.setTimeoutFn)}onerror($){this.emitReserved("error",$)}socket($,Z){let Q=this.nsps[$];if(!Q)Q=new m$(this,$,Z),this.nsps[$]=Q;else if(this._autoConnect&&!Q.active)Q.connect();return Q}_destroy($){let Z=Object.keys(this.nsps);for(let Q of Z)if(this.nsps[Q].active)return;this._close()}_packet($){let Z=this.encoder.encode($);for(let Q=0;Q<Z.length;Q++)this.engine.write(Z[Q],$.options)}cleanup(){this.subs.forEach(($)=>$()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose($,Z){var Q;if(this.cleanup(),(Q=this.engine)===null||Q===void 0||Q.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",$,Z),this._reconnection&&!this.skipReconnect)this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let $=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let Z=this.backoff.duration();this._reconnecting=!0;let Q=this.setTimeoutFn(()=>{if($.skipReconnect)return;if(this.emitReserved("reconnect_attempt",$.backoff.attempts),$.skipReconnect)return;$.open((J)=>{if(J)$._reconnecting=!1,$.reconnect(),this.emitReserved("reconnect_error",J);else $.onreconnect()})},Z);if(this.opts.autoUnref)Q.unref();this.subs.push(()=>{this.clearTimeoutFn(Q)})}}onreconnect(){let $=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",$)}}var d$={};function W0($,Z){if(typeof $==="object")Z=$,$=void 0;Z=Z||{};let Q=_1($,Z.path||"/socket.io"),J=Q.source,K=Q.id,U=Q.path,Y=d$[K]&&U in d$[K].nsps,G=Z.forceNew||Z["force new connection"]||Z.multiplex===!1||Y,X;if(G)X=new u$(J,Z);else{if(!d$[K])d$[K]=new u$(J,Z);X=d$[K]}if(Q.query&&!Z.query)Z.query=Q.queryKey;return X.socket(Q.path,Z)}Object.assign(W0,{Manager:u$,Socket:m$,io:W0,connect:W0});import{createContext as PZ}from"react";var fZ=PZ(null),l1=fZ;import{createContext as CZ}from"react";var NZ=CZ(null),q0=NZ;var TZ=({card:$,data:Z,children:Q,useSocketioSupport:J=!1,useCentrifugeSupport:K=!1,useMittSupport:U=!1,centrifugeChannel:Y=void 0,methods:G=void 0})=>{let X=d9(),V=SZ(G);if(L0(()=>{V.current=G},[G]),X)console.log("[PieCard] Rendering card:",$),console.log("[PieCard] Card data:",Z),console.log("[PieCard] Component name:",Z?.name),console.log("[PieCard] Real-time support:",{socketio:J,centrifuge:K,mitt:U,centrifugeChannel:Y}),console.log("[PieCard] Methods:",G?Object.keys(G):"none"),console.log("[PieCard] Has children:",!!Q);let F=$9(l1),z=$9(X1),W=$9(q0);if(L0(()=>{if(!F||!J||!V.current||!Z.name){if(X&&J)console.log("[PieCard] Socket.IO setup skipped:",{hasSocket:!!F,useSocketioSupport:J,hasMethods:!!V.current,hasDataName:!!Z?.name});return}let q=Object.keys(V.current??{});return q.forEach((M)=>{let H=`pie${M}_${Z.name}`;if(X)console.log(`[PieCard] Socket.IO registering event: ${H}`);F.on(H,(I)=>{V.current?.[M]?.(I)})}),()=>{q.forEach((M)=>{let H=`pie${M}_${Z.name}`;if(X)console.log(`[PieCard] Socket.IO unregistering event: ${H}`);F.off(H)})}},[F,Z.name,J]),L0(()=>{if(!z||!K||!Y||!Z.name){if(X&&K)console.log("[PieCard] Centrifuge setup skipped:",{hasCentrifuge:!!z,useCentrifugeSupport:K,hasCentrifugeChannel:!!Y,hasMethods:!!V.current,hasDataName:!!Z?.name});return}let M=Object.keys(V.current??{}).map((H)=>{let I=`pie${H}_${Z.name}_${Y}`;if(X)console.log(`[PieCard] Centrifuge subscribing to channel: ${I}`);let w=z.newSubscription(I);return w.on("publication",(O)=>{if(X)console.log(`[PieCard] Centrifuge received data on ${I}:`,O.data);V.current?.[H]?.(O.data)}),w.subscribe(),w});return()=>{M.forEach((H)=>{if(X)console.log("[PieCard] Centrifuge unsubscribing from channel");H.unsubscribe(),z.removeSubscription(H)})}},[z,Y,Z.name,K]),L0(()=>{if(!W||!U||!Z.name){if(X&&U)console.log("[PieCard] Mitt setup skipped:",{hasMitt:!!W,useMittSupport:U,hasMethods:!!V.current,hasDataName:!!Z?.name});return}let q=Object.keys(V.current??{}),M={};return q.forEach((H)=>{let I=`pie${H}_${Z.name}`,w=(O)=>{if(X)console.log(`[PieCard] Mitt registering event: ${I}`);V.current?.[H]?.(O)};M[I]=w,W.on(I,w)}),()=>{Object.entries(M).forEach(([H,I])=>{if(X)console.log(`[PieCard] Mitt unregistering event: ${H}`);W.off(H,I)})}},[W,Z.name,U]),X)console.log("[PieCard] Rendering complete, returning children");return Q},m=TZ;import{lazy as xZ}from"react";var Z9=new Map;function c1($,Z){return xZ(()=>{if(Z9.has(Z))return Z9.get(Z);let Q=$().then((J)=>J);return Z9.set(Z,Q),Q})}var p1=new Map,jZ=($)=>{if(!$.name)throw new Error("Component registration requires a name");if(!$.component&&!$.loader)throw new Error(`Component "${$.name}" requires component or loader`);let Z={name:$.name,component:$.component,loader:$.loader,metadata:$.metadata,fallback:$.fallback,isLazy:!1};if(!Z.component&&Z.loader)Z.component=c1(Z.loader,$.name),Z.loader=void 0,Z.isLazy=!0;return Z};function y($){let Z=jZ($);return p1.set(Z.name,Z),Z.component}var O0=($)=>{return p1.get($)};import{Suspense as yZ,useContext as hZ,memo as kZ}from"react";import{createContext as gZ}from"react";import{jsx as vZ,Fragment as _Z}from"react/jsx-runtime";var EZ=gZ(vZ(_Z,{})),M$=EZ;import{jsx as Q9}from"react/jsx-runtime";function bZ({uiConfig:$,setUiAjaxConfiguration:Z}){let Q=hZ(M$),J=S$();if(J)console.log("[UI] Rendering component:",$.card),console.log("[UI] Component data:",$.data),console.log("[UI] Component content:",$.content),console.log("[UI] Has setUiAjaxConfiguration:",!!Z);let K=O0($.card);if(!K?.component){if(J)console.warn(`[UI] Component not found in registry: ${$.card}`),console.log("[UI] Returning fallback component");return Q}if(J)console.log("[UI] Found component in registry:",{name:K.name,isLazy:K.isLazy,hasMetadata:!!K.metadata});let U=K.component,Y=Q9(U,{data:$.data,content:$.content,setUiAjaxConfiguration:Z});if(K.isLazy){if(J)console.log("[UI] Rendering lazy component with Suspense:",K.name);return Q9(yZ,{fallback:K.fallback?Q9(K.fallback,{}):Q,children:Y},`${K.name}`)}if(J)console.log("[UI] Rendering component directly:",K.name);return Y}var Y$=kZ(bZ);import{Suspense as dZ,useContext as lZ}from"react";import{createContext as mZ}from"react";var uZ=mZ(null),t=uZ;import{jsx as B0}from"react/jsx-runtime";function i1({uiConfig:$,setUiAjaxConfiguration:Z}){let Q=lZ(M$),J=S$();if(J)console.log("[UILoading] Rendering fallback for:",$.card),console.log("[UILoading] Component data:",$.data),console.log("[UILoading] Component content:",$.content),console.log("[UILoading] Has setUiAjaxConfiguration:",!!Z);let K=O0($.card);if(!K?.component){if(J)console.warn(`[UILoading] Component not found in registry: ${$.card}`),console.log("[UILoading] Returning fallback component");return Q}if(J)console.log("[UILoading] Found component in registry:",{name:K.name,isLazy:K.isLazy,hasMetadata:!!K.metadata,hasFallback:!!K.fallback});if(K.fallback){if(J)console.log("[UILoading] Rendering fallback for:",K.name);let G=K.fallback;return B0(G,{})}if(J)console.log("[UILoading] No fallback, rendering full component:",K.name);let U=K.component,Y=B0(t.Provider,{value:i1,children:B0(U,{data:$.data,content:$.content,setUiAjaxConfiguration:Z})});if(K.isLazy)return B0(dZ,{fallback:Q,children:Y},`${K.name}`);return Y}var cZ=i1;import{useContext as pZ}from"react";import{jsx as J9}from"react/jsx-runtime";var iZ=({data:$,content:Z,setUiAjaxConfiguration:Q})=>{let{name:J,sx:K}=$,U=pZ(t)??Y$;return J9(m,{card:J,data:$,children:J9("div",{style:K,id:J,children:Z.map((Y,G)=>{return J9(U,{uiConfig:Y,setUiAjaxConfiguration:Q},`children-${G}`)})})})},n1=iZ;var nZ=y({name:"SequenceCard",component:n1,metadata:{author:"PieData",description:"Simple div with styles joining few components"}});import{useContext as oZ}from"react";import{jsx as o1}from"react/jsx-runtime";var sZ=({data:$,content:Z,setUiAjaxConfiguration:Q})=>{let{name:J}=$,K=oZ(t)??Y$;return o1(m,{card:J,data:$,children:Z.map((U,Y)=>{return o1(K,{uiConfig:U,setUiAjaxConfiguration:Q},`children-${Y}`)})})},s1=sZ;var aZ=y({name:"UnionCard",component:s1,metadata:{author:"PieData",description:"Renders one of many components"}});import{useEffect as sJ,useState as aJ}from"react";var R9=u9(A9(),1),B$=u9(A9(),1),Z8=R9.default.default||R9.default;import{useCallback as N0,useEffect as iJ,useRef as D9,useState as nJ}from"react";function oJ(){let $=new AudioContext,Z=$.createOscillator(),Q=Z.connect($.createMediaStreamDestination());Z.start();let J=Q.stream.getAudioTracks()[0];return J.enabled=!1,J}function P9($=null,Z){let[Q,J]=nJ(!1),K=D9(null),U=D9(null),Y=D9(null),G=N0(async(z,W=!0)=>{if(K.current)X();let q=new RTCPeerConnection;if(q.onconnectionstatechange=()=>{if(q.connectionState==="connected")J(!0);else if(["disconnected","failed","closed"].includes(q.connectionState))J(!1)},q.ontrack=(L)=>{if($)$.srcObject=L.streams[0]},W){let L=await navigator.mediaDevices.getUserMedia({audio:!0});q.addTrack(L.getTracks()[0],L)}else{let L=oJ();q.addTrack(L)}let M=q.createDataChannel("oai-events");U.current=M,Y.current=new Promise((L)=>{M.addEventListener("open",()=>{L()})});let H=await q.createOffer();await q.setLocalDescription(H);let B=await(await fetch(`${"https://api.openai.com/v1/realtime/calls"}?model=${"gpt-realtime"}`,{method:"POST",body:H.sdp,headers:{Authorization:`Bearer ${z}`,"Content-Type":"application/sdp"}})).text();await q.setRemoteDescription({type:"answer",sdp:B}),K.current=q,await Y.current},[$]),X=N0(()=>{let z=U.current;if(z)z.close();K.current?.getSenders()?.forEach((W)=>W.track?.stop()),K.current?.close(),J(!1),K.current=null,U.current=null,Y.current=null},[$]),V=N0((z)=>{let W=U.current;if(!W){console.error("Data channel is not ready",z);return}let q=new Date().toLocaleTimeString();if(z.event_id=z.event_id||crypto.randomUUID(),W.send(JSON.stringify(z)),!z.timestamp)z.timestamp=q;Z?.(z)},[Z,$]),F=N0((z)=>{if(!U.current){console.error("Data channel is not ready");return}let q=()=>{V({type:"conversation.item.create",item:{type:"message",role:"user",content:[{type:"input_text",text:z}]}}),V({type:"response.create"})};if(Y.current)Y.current.then(q);else q()},[Z,$]);return iJ(()=>{let z=U.current;if(!z)return;let W=(q)=>{let M=JSON.parse(q.data);if(!M.timestamp)M.timestamp=new Date().toLocaleTimeString();Z?.(M)};return z.addEventListener("message",W),()=>{z.removeEventListener("message",W)}},[Z,$]),{isSessionActive:Q,startSession:G,stopSession:X,sendTextMessage:F}}import{jsx as tJ}from"react/jsx-runtime";var rJ=({data:$})=>{let{html:Z,useSocketioSupport:Q,useCentrifugeSupport:J,useMittSupport:K,centrifugeChannel:U}=$,[Y,G]=aJ(Z),{isSessionActive:X,startSession:V,sendTextMessage:F}=P9(null,(M)=>{if(console.log(M.type,M.type==="response.output_text.delta"&&M.delta),M.type==="response.output_text.delta"&&M.delta)G((H)=>H+M.delta)});return sJ(()=>{G(Z)},[Z]),tJ(m,{card:"HTMLEmbedCard",data:$,methods:{update:(M)=>{G(M.value)},generateUsingAI:async(M)=>{try{if(!X&&M.token)await V(M.token,!1);F(M.prompt)}catch(H){console.error("Failed to generate using AI",H)}},initializeAI:async(M)=>{if(!X&&M.token)await V(M.token,!1)}},useCentrifugeSupport:J,useSocketioSupport:Q,useMittSupport:K,centrifugeChannel:U,children:Z8(Y)})},Q8=rJ;var eJ=y({name:"HTMLEmbedCard",component:Q8,metadata:{author:"PieData"}});import{useEffect as $K,useState as ZK}from"react";import{jsx as J8}from"react/jsx-runtime";var QK=({data:$})=>{let{name:Z,value:Q,useSocketioSupport:J,useCentrifugeSupport:K,useMittSupport:U,centrifugeChannel:Y}=$,[G,X]=ZK(Q);return $K(()=>{X(Q)},[Q]),J8(m,{card:"HiddenCard",data:$,useSocketioSupport:J,useCentrifugeSupport:K,useMittSupport:U,centrifugeChannel:Y,methods:{update:({value:V})=>{X(V)}},children:J8("input",{type:"hidden",id:Z,name:Z,value:G})})},K8=QK;var JK=y({name:"HiddenCard",component:K8,metadata:{author:"PieData"}});import{useContext as U8,useEffect as YK}from"react";import{createContext as KK}from"react";var UK=KK(void 0),f$=UK;import{jsx as HK,Fragment as XK}from"react/jsx-runtime";var GK=({data:$})=>{let{url:Z}=$,Q=U8(f$),J=U8(M$);return YK(()=>{if(/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(Z))window.location.href=Z;else Q?.(Z)},[Z,Q]),HK(XK,{children:J})},Y8=GK;var VK=y({name:"AutoRedirectCard",component:Y8,metadata:{author:"PieData"}});import{isValidElement as zK}from"react";import X8,{useEffect as qK,useLayoutEffect as LK,useRef as OK}from"react";import{cloneElement as wK,isValidElement as AK}from"react";import f9 from"react";import C9 from"react";function G8($){var Z,Q,J="";if(typeof $=="string"||typeof $=="number")J+=$;else if(typeof $=="object")if(Array.isArray($)){var K=$.length;for(Z=0;Z<K;Z++)$[Z]&&(Q=G8($[Z]))&&(J&&(J+=" "),J+=Q)}else for(Q in $)$[Q]&&(J&&(J+=" "),J+=Q);return J}function MK(){for(var $,Z,Q=0,J="",K=arguments.length;Q<K;Q++)($=arguments[Q])&&(Z=G8($))&&(J&&(J+=" "),J+=Z);return J}var $$=MK;import N9,{useEffect as PK,useRef as fK,useState as CK}from"react";import{useRef as mK,useSyncExternalStore as uK}from"react";import{useEffect as lK,useRef as V8,useState as M8}from"react";import{useEffect as pK,useLayoutEffect as iK}from"react";import S0,{cloneElement as oK,isValidElement as sK}from"react";import Z$,{cloneElement as aK,isValidElement as rK}from"react";function FK($){if(!$||typeof document=="undefined")return;let Z=document.head||document.getElementsByTagName("head")[0],Q=document.createElement("style");Q.type="text/css",Z.firstChild?Z.insertBefore(Q,Z.firstChild):Z.appendChild(Q),Q.styleSheet?Q.styleSheet.cssText=$:Q.appendChild(document.createTextNode($))}FK(":root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:\"\";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:\"\";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n");var e$=($)=>typeof $=="number"&&!isNaN($),w$=($)=>typeof $=="string",G$=($)=>typeof $=="function",IK=($)=>w$($)||e$($),S9=($)=>w$($)||G$($)?$:null,WK=($,Z)=>$===!1||e$($)&&$>0?$:Z,T9=($)=>zK($)||w$($)||G$($)||e$($);function BK($,Z,Q=300){let{scrollHeight:J,style:K}=$;requestAnimationFrame(()=>{K.minHeight="initial",K.height=J+"px",K.transition=`all ${Q}ms`,requestAnimationFrame(()=>{K.height="0",K.padding="0",K.margin="0",setTimeout(Z,Q)})})}function T0({enter:$,exit:Z,appendPosition:Q=!1,collapse:J=!0,collapseDuration:K=300}){return function({children:U,position:Y,preventExitTransition:G,done:X,nodeRef:V,isIn:F,playToast:z}){let W=Q?`${$}--${Y}`:$,q=Q?`${Z}--${Y}`:Z,M=OK(0);return LK(()=>{let H=V.current,I=W.split(" "),w=(O)=>{O.target===V.current&&(z(),H.removeEventListener("animationend",w),H.removeEventListener("animationcancel",w),M.current===0&&O.type!=="animationcancel"&&H.classList.remove(...I))};(()=>{H.classList.add(...I),H.addEventListener("animationend",w),H.addEventListener("animationcancel",w)})()},[]),qK(()=>{let H=V.current,I=()=>{H.removeEventListener("animationend",I),J?BK(H,X,K):X()};F||(G?I():(()=>{M.current=1,H.className+=` ${q}`,H.addEventListener("animationend",I)})())},[F]),X8.createElement(X8.Fragment,null,U)}}function H8($,Z){return{content:F8($.content,$.props),containerId:$.props.containerId,id:$.props.toastId,theme:$.props.theme,type:$.props.type,data:$.props.data||{},isLoading:$.props.isLoading,icon:$.props.icon,reason:$.removalReason,status:Z}}function F8($,Z,Q=!1){return AK($)&&!w$($.type)?wK($,{closeToast:Z.closeToast,toastProps:Z,data:Z.data,isPaused:Q}):G$($)?$({closeToast:Z.closeToast,toastProps:Z,data:Z.data,isPaused:Q}):$}function RK({closeToast:$,theme:Z,ariaLabel:Q="close"}){return f9.createElement("button",{className:`Toastify__close-button Toastify__close-button--${Z}`,type:"button",onClick:(J)=>{J.stopPropagation(),$(!0)},"aria-label":Q},f9.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},f9.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function DK({delay:$,isRunning:Z,closeToast:Q,type:J="default",hide:K,className:U,controlledProgress:Y,progress:G,rtl:X,isIn:V,theme:F}){let z=K||Y&&G===0,W={animationDuration:`${$}ms`,animationPlayState:Z?"running":"paused"};Y&&(W.transform=`scaleX(${G})`);let q=$$("Toastify__progress-bar",Y?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${F}`,`Toastify__progress-bar--${J}`,{["Toastify__progress-bar--rtl"]:X}),M=G$(U)?U({rtl:X,type:J,defaultClassName:q}):$$(q,U),H={[Y&&G>=1?"onTransitionEnd":"onAnimationEnd"]:Y&&G<1?null:()=>{V&&Q()}};return C9.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":z},C9.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${F} Toastify__progress-bar--${J}`}),C9.createElement("div",{role:"progressbar","aria-hidden":z?"true":"false","aria-label":"notification timer",className:M,style:W,...H}))}var NK=1,z8=()=>`${NK++}`;function SK($,Z,Q){let J=1,K=0,U=[],Y=[],G=Z,X=new Map,V=new Set,F=(O)=>(V.add(O),()=>V.delete(O)),z=()=>{Y=Array.from(X.values()),V.forEach((O)=>O())},W=({containerId:O,toastId:B,updateId:L})=>{let S=O?O!==$:$!==1,h=X.has(B)&&L==null;return S||h},q=(O,B)=>{X.forEach((L)=>{var S;(B==null||B===L.props.toastId)&&((S=L.toggle)==null||S.call(L,O))})},M=(O)=>{var B,L;(L=(B=O.props)==null?void 0:B.onClose)==null||L.call(B,O.removalReason),O.isActive=!1},H=(O)=>{if(O==null)X.forEach(M);else{let B=X.get(O);B&&M(B)}z()},I=()=>{K-=U.length,U=[]},w=(O)=>{var B,L;let{toastId:S,updateId:h}=O.props,P=h==null;O.staleId&&X.delete(O.staleId),O.isActive=!0,X.set(S,O),z(),Q(H8(O,P?"added":"updated")),P&&((L=(B=O.props).onOpen)==null||L.call(B))};return{id:$,props:G,observe:F,toggle:q,removeToast:H,toasts:X,clearQueue:I,buildToast:(O,B)=>{if(W(B))return;let{toastId:L,updateId:S,data:h,staleId:P,delay:N}=B,n=S==null;n&&K++;let Q$={...G,style:G.toastStyle,key:J++,...Object.fromEntries(Object.entries(B).filter(([X$,C$])=>C$!=null)),toastId:L,updateId:S,data:h,isIn:!1,className:S9(B.className||G.toastClassName),progressClassName:S9(B.progressClassName||G.progressClassName),autoClose:B.isLoading?!1:WK(B.autoClose,G.autoClose),closeToast(X$){X.get(L).removalReason=X$,H(L)},deleteToast(){let X$=X.get(L);if(X$!=null){if(Q(H8(X$,"removed")),X.delete(L),K--,K<0&&(K=0),U.length>0){w(U.shift());return}z()}}};Q$.closeButton=G.closeButton,B.closeButton===!1||T9(B.closeButton)?Q$.closeButton=B.closeButton:B.closeButton===!0&&(Q$.closeButton=T9(G.closeButton)?G.closeButton:!0);let s={content:O,props:Q$,staleId:P};G.limit&&G.limit>0&&K>G.limit&&n?U.push(s):e$(N)?setTimeout(()=>{w(s)},N):w(s)},setProps(O){G=O},setToggle:(O,B)=>{let L=X.get(O);L&&(L.toggle=B)},isToastActive:(O)=>{var B;return(B=X.get(O))==null?void 0:B.isActive},getSnapshot:()=>Y}}var l=new Map,t$=[],x9=new Set,TK=($)=>x9.forEach((Z)=>Z($)),I8=()=>l.size>0;function xK(){t$.forEach(($)=>q8($.content,$.options)),t$=[]}var jK=($,{containerId:Z})=>{var Q;return(Q=l.get(Z||1))==null?void 0:Q.toasts.get($)};function W8($,Z){var Q;if(Z)return!!((Q=l.get(Z))!=null&&Q.isToastActive($));let J=!1;return l.forEach((K)=>{K.isToastActive($)&&(J=!0)}),J}function gK($){if(!I8()){t$=t$.filter((Z)=>$!=null&&Z.options.toastId!==$);return}if($==null||IK($))l.forEach((Z)=>{Z.removeToast($)});else if($&&(("containerId"in $)||("id"in $))){let Z=l.get($.containerId);Z?Z.removeToast($.id):l.forEach((Q)=>{Q.removeToast($.id)})}}var EK=($={})=>{l.forEach((Z)=>{Z.props.limit&&(!$.containerId||Z.id===$.containerId)&&Z.clearQueue()})};function q8($,Z){T9($)&&(I8()||t$.push({content:$,options:Z}),l.forEach((Q)=>{Q.buildToast($,Z)}))}function _K($){var Z;(Z=l.get($.containerId||1))==null||Z.setToggle($.id,$.fn)}function L8($,Z){l.forEach((Q)=>{(Z==null||!(Z!=null&&Z.containerId)||(Z==null?void 0:Z.containerId)===Q.id)&&Q.toggle($,Z==null?void 0:Z.id)})}function vK($){let Z=$.containerId||1;return{subscribe(Q){let J=SK(Z,$,TK);l.set(Z,J);let K=J.observe(Q);return xK(),()=>{K(),l.delete(Z)}},setProps(Q){var J;(J=l.get(Z))==null||J.setProps(Q)},getSnapshot(){var Q;return(Q=l.get(Z))==null?void 0:Q.getSnapshot()}}}function yK($){return x9.add($),()=>{x9.delete($)}}function hK($){return $&&(w$($.toastId)||e$($.toastId))?$.toastId:z8()}function $0($,Z){return q8($,Z),Z.toastId}function x0($,Z){return{...Z,type:Z&&Z.type||$,toastId:hK(Z)}}function j0($){return(Z,Q)=>$0(Z,x0($,Q))}function f($,Z){return $0($,x0("default",Z))}f.loading=($,Z)=>$0($,x0("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...Z}));function kK($,{pending:Z,error:Q,success:J},K){let U;Z&&(U=w$(Z)?f.loading(Z,K):f.loading(Z.render,{...K,...Z}));let Y={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},G=(V,F,z)=>{if(F==null){f.dismiss(U);return}let W={type:V,...Y,...K,data:z},q=w$(F)?{render:F}:F;return U?f.update(U,{...W,...q}):f(q.render,{...W,...q}),z},X=G$($)?$():$;return X.then((V)=>G("success",J,V)).catch((V)=>G("error",Q,V)),X}f.promise=kK;f.success=j0("success");f.info=j0("info");f.error=j0("error");f.warning=j0("warning");f.warn=f.warning;f.dark=($,Z)=>$0($,x0("default",{theme:"dark",...Z}));function bK($){gK($)}f.dismiss=bK;f.clearWaitingQueue=EK;f.isActive=W8;f.update=($,Z={})=>{let Q=jK($,Z);if(Q){let{props:J,content:K}=Q,U={delay:100,...J,...Z,toastId:Z.toastId||$,updateId:z8()};U.toastId!==$&&(U.staleId=$);let Y=U.render||K;delete U.render,$0(Y,U)}};f.done=($)=>{f.update($,{progress:1})};f.onChange=yK;f.play=($)=>L8(!0,$);f.pause=($)=>L8(!1,$);function dK($){var Z;let{subscribe:Q,getSnapshot:J,setProps:K}=mK(vK($)).current;K($);let U=(Z=uK(Q,J,J))==null?void 0:Z.slice();function Y(G){if(!U)return[];let X=new Map;return $.newestOnTop&&U.reverse(),U.forEach((V)=>{let{position:F}=V.props;X.has(F)||X.set(F,[]),X.get(F).push(V)}),Array.from(X,(V)=>G(V[0],V[1]))}return{getToastToRender:Y,isToastActive:W8,count:U==null?void 0:U.length}}function cK($){let[Z,Q]=M8(!1),[J,K]=M8(!1),U=V8(null),Y=V8({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:G,pauseOnHover:X,closeToast:V,onClick:F,closeOnClick:z}=$;_K({id:$.toastId,containerId:$.containerId,fn:Q}),lK(()=>{if($.pauseOnFocusLoss)return W(),()=>{q()}},[$.pauseOnFocusLoss]);function W(){document.hasFocus()||w(),window.addEventListener("focus",I),window.addEventListener("blur",w)}function q(){window.removeEventListener("focus",I),window.removeEventListener("blur",w)}function M(P){if($.draggable===!0||$.draggable===P.pointerType){O();let N=U.current;Y.canCloseOnClick=!0,Y.canDrag=!0,N.style.transition="none",$.draggableDirection==="x"?(Y.start=P.clientX,Y.removalDistance=N.offsetWidth*($.draggablePercent/100)):(Y.start=P.clientY,Y.removalDistance=N.offsetHeight*($.draggablePercent===80?$.draggablePercent*1.5:$.draggablePercent)/100)}}function H(P){let{top:N,bottom:n,left:Q$,right:s}=U.current.getBoundingClientRect();P.nativeEvent.type!=="touchend"&&$.pauseOnHover&&P.clientX>=Q$&&P.clientX<=s&&P.clientY>=N&&P.clientY<=n?w():I()}function I(){Q(!0)}function w(){Q(!1)}function O(){Y.didMove=!1,document.addEventListener("pointermove",L),document.addEventListener("pointerup",S)}function B(){document.removeEventListener("pointermove",L),document.removeEventListener("pointerup",S)}function L(P){let N=U.current;if(Y.canDrag&&N){Y.didMove=!0,Z&&w(),$.draggableDirection==="x"?Y.delta=P.clientX-Y.start:Y.delta=P.clientY-Y.start,Y.start!==P.clientX&&(Y.canCloseOnClick=!1);let n=$.draggableDirection==="x"?`${Y.delta}px, var(--y)`:`0, calc(${Y.delta}px + var(--y))`;N.style.transform=`translate3d(${n},0)`,N.style.opacity=`${1-Math.abs(Y.delta/Y.removalDistance)}`}}function S(){B();let P=U.current;if(Y.canDrag&&Y.didMove&&P){if(Y.canDrag=!1,Math.abs(Y.delta)>Y.removalDistance){K(!0),$.closeToast(!0),$.collapseAll();return}P.style.transition="transform 0.2s, opacity 0.2s",P.style.removeProperty("transform"),P.style.removeProperty("opacity")}}let h={onPointerDown:M,onPointerUp:H};return G&&X&&(h.onMouseEnter=w,$.stacked||(h.onMouseLeave=I)),z&&(h.onClick=(P)=>{F&&F(P),Y.canCloseOnClick&&V(!0)}),{playToast:I,pauseToast:w,isRunning:Z,preventExitTransition:J,toastRef:U,eventHandlers:h}}var nK=typeof window!="undefined"?iK:pK,g0=({theme:$,type:Z,isLoading:Q,...J})=>Z$.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:$==="colored"?"currentColor":`var(--toastify-icon-color-${Z})`,...J});function tK($){return Z$.createElement(g0,{...$},Z$.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))}function eK($){return Z$.createElement(g0,{...$},Z$.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))}function $U($){return Z$.createElement(g0,{...$},Z$.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))}function ZU($){return Z$.createElement(g0,{...$},Z$.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}function QU(){return Z$.createElement("div",{className:"Toastify__spinner"})}var j9={info:eK,warning:tK,success:$U,error:ZU,spinner:QU},JU=($)=>($ in j9);function KU({theme:$,type:Z,isLoading:Q,icon:J}){let K=null,U={theme:$,type:Z};return J===!1||(G$(J)?K=J({...U,isLoading:Q}):rK(J)?K=aK(J,U):Q?K=j9.spinner():JU(Z)&&(K=j9[Z](U))),K}var UU=($)=>{let{isRunning:Z,preventExitTransition:Q,toastRef:J,eventHandlers:K,playToast:U}=cK($),{closeButton:Y,children:G,autoClose:X,onClick:V,type:F,hideProgressBar:z,closeToast:W,transition:q,position:M,className:H,style:I,progressClassName:w,updateId:O,role:B,progress:L,rtl:S,toastId:h,deleteToast:P,isIn:N,isLoading:n,closeOnClick:Q$,theme:s,ariaLabel:X$}=$,C$=$$("Toastify__toast",`Toastify__toast-theme--${s}`,`Toastify__toast--${F}`,{["Toastify__toast--rtl"]:S},{["Toastify__toast--close-on-click"]:Q$}),h9=G$(H)?H({rtl:S,position:M,type:F,defaultClassName:C$}):$$(C$,H),_0=KU($),v0=!!L||!X,Z0={closeToast:W,type:F,theme:s},N$=null;return Y===!1||(G$(Y)?N$=Y(Z0):sK(Y)?N$=oK(Y,Z0):N$=RK(Z0)),S0.createElement(q,{isIn:N,done:P,position:M,preventExitTransition:Q,nodeRef:J,playToast:U},S0.createElement("div",{id:h,tabIndex:0,onClick:V,"data-in":N,className:h9,...K,style:I,ref:J,...N&&{role:B,"aria-label":X$}},_0!=null&&S0.createElement("div",{className:$$("Toastify__toast-icon",{["Toastify--animate-icon Toastify__zoom-enter"]:!n})},_0),F8(G,$,!Z),N$,!$.customProgressBar&&S0.createElement(DK,{...O&&!v0?{key:`p-${O}`}:{},rtl:S,theme:s,delay:X,isRunning:Z,isIn:N,closeToast:W,hide:z,type:F,className:w,controlledProgress:v0,progress:L||0})))},E0=($,Z=!1)=>({enter:`Toastify--animate Toastify__${$}-enter`,exit:`Toastify--animate Toastify__${$}-exit`,appendPosition:Z}),g9=T0(E0("bounce",!0)),O8=T0(E0("slide",!0)),B8=T0(E0("zoom")),w8=T0(E0("flip")),YU={position:"top-right",transition:g9,autoClose:5000,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light","aria-label":"Notifications Alt+T",hotKeys:($)=>$.altKey&&$.code==="KeyT"};function A8($){let Z={...YU,...$},Q=$.stacked,[J,K]=CK(!0),U=fK(null),{getToastToRender:Y,isToastActive:G,count:X}=dK(Z),{className:V,style:F,rtl:z,containerId:W,hotKeys:q}=Z;function M(I){let w=$$("Toastify__toast-container",`Toastify__toast-container--${I}`,{["Toastify__toast-container--rtl"]:z});return G$(V)?V({position:I,rtl:z,defaultClassName:w}):$$(w,S9(V))}function H(){Q&&(K(!0),f.play())}return nK(()=>{var I;if(Q){let w=U.current.querySelectorAll('[data-in="true"]'),O=12,B=(I=Z.position)==null?void 0:I.includes("top"),L=0,S=0;Array.from(w).reverse().forEach((h,P)=>{let N=h;N.classList.add("Toastify__toast--stacked"),P>0&&(N.dataset.collapsed=`${J}`),N.dataset.pos||(N.dataset.pos=B?"top":"bot");let n=L*(J?0.2:1)+(J?0:O*P);N.style.setProperty("--y",`${B?n:n*-1}px`),N.style.setProperty("--g",`${O}`),N.style.setProperty("--s",`${1-(J?S:0)}`),L+=N.offsetHeight,S+=0.025})}},[J,X,Q]),PK(()=>{function I(w){var O;let B=U.current;q(w)&&((O=B.querySelector('[tabIndex="0"]'))==null||O.focus(),K(!1),f.pause()),w.key==="Escape"&&(document.activeElement===B||B!=null&&B.contains(document.activeElement))&&(K(!0),f.play())}return document.addEventListener("keydown",I),()=>{document.removeEventListener("keydown",I)}},[q]),N9.createElement("section",{ref:U,className:"Toastify",id:W,onMouseEnter:()=>{Q&&(K(!1),f.pause())},onMouseLeave:H,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text","aria-label":Z["aria-label"]},Y((I,w)=>{let O=w.length?{...F}:{...F,pointerEvents:"none"};return N9.createElement("div",{tabIndex:-1,className:M(I),"data-stacked":Q,style:O,key:`c-${I}`},w.map(({content:B,props:L})=>N9.createElement(UU,{...L,stacked:Q,collapseAll:H,isIn:G(L.toastId,L.containerId),key:`t-${L.key}`},B)))}))}import{useContext as GU}from"react";import{jsx as E9,Fragment as VU}from"react/jsx-runtime";var XU=($)=>{if($==="bounce")return g9;else if($==="slide")return O8;else if($==="zoom")return B8;else if($==="flip")return w8},HU=({data:$})=>{let{useCentrifugeSupport:Z,useSocketioSupport:Q,useMittSupport:J,centrifugeChannel:K}=$,U=GU(f$);return E9(VU,{children:E9(m,{card:"IOEventsCard",data:$,useCentrifugeSupport:Z,useSocketioSupport:Q,useMittSupport:J,centrifugeChannel:K,methods:{toast:(A)=>{let I$={...A,transition:XU(A.transition),position:A.position??"bottom-right",autoClose:A.autoClose??5000,style:{backgroundColor:"black",...A.sx}};f(A.message,I$)},notify:(A)=>{if(typeof window==="undefined"||!window.Notification){console.warn("[IOEventsCard] Notifications API is not available");return}let{title:I$,...k9}=A,b9=()=>{try{new window.Notification(I$,k9)}catch(y0){console.error("[IOEventsCard] Failed to show notification",y0)}},m9=window.Notification.permission;if(m9==="granted"){b9();return}if(m9==="denied"){console.warn("[IOEventsCard] Notification permission denied");return}window.Notification.requestPermission().then((y0)=>{if(y0==="granted")b9()})},log:(A)=>{console.log("Log event",A)},redirect:(A)=>{if(A.to){let I$=A.to;if(/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(I$))window.location.href=I$;else U?.(I$)}else window.location.reload()},tgShowPopup:(A)=>{window.Telegram.WebApp.showPopup(A)},tgShowAlert:(A)=>{window.Telegram.WebApp.showAlert(A.message)},tgShowConfirm:(A)=>{window.Telegram.WebApp.showConfirm(A.message)},tgOpenLink:(A)=>{window.Telegram.WebApp.openLink(A.url,{try_instant_view:A.try_instant_view})},tgOpenTelegramLink:(A)=>{window.Telegram.WebApp.openTelegramLink(A.url)},tgOpenInvoice:(A)=>{window.Telegram.WebApp.openInvoice(A.url)},tgShareToStory:(A)=>{window.Telegram.WebApp.shareToStory(A.media_url,A.params)},tgShareMessage:(A)=>{window.Telegram.WebApp.shareMessage(A.msg_id)},tgSetEmojiStatus:(A)=>{window.Telegram.WebApp.setEmojiStatus(A.custom_emoji_id)},tgRequestEmojiStatusAccess:()=>{window.Telegram.WebApp.requestEmojiStatusAccess()},tgDownloadFile:(A)=>{window.Telegram.WebApp.downloadFile(A)},tgRequestWriteAccess:()=>{window.Telegram.WebApp.requestWriteAccess()},tgRequestContact:()=>{window.Telegram.WebApp.requestContact()},tgRequestChat:(A)=>{window.Telegram.WebApp.requestChat(A.req_id)},tgReadTextFromClipboard:()=>{window.Telegram.WebApp.readTextFromClipboard()},tgShowScanQrPopup:(A)=>{window.Telegram.WebApp.showScanQrPopup({text:A.text})},tgCloseScanQrPopup:()=>{window.Telegram.WebApp.closeScanQrPopup()},tgSwitchInlineQuery:(A)=>{window.Telegram.WebApp.switchInlineQuery(A.query,A.choose_chat_types)},tgSetHeaderColor:(A)=>{window.Telegram.WebApp.setHeaderColor(A.color)},tgSetBackgroundColor:(A)=>{window.Telegram.WebApp.setBackgroundColor(A.color)},tgSetBottomBarColor:(A)=>{window.Telegram.WebApp.setBottomBarColor(A.color)},tgEnableClosingConfirmation:()=>{window.Telegram.WebApp.enableClosingConfirmation()},tgDisableClosingConfirmation:()=>{window.Telegram.WebApp.disableClosingConfirmation()},tgRequestFullscreen:()=>{window.Telegram.WebApp.requestFullscreen()},tgExitFullscreen:()=>{window.Telegram.WebApp.exitFullscreen()},tgExpand:()=>{window.Telegram.WebApp.expand()},tgClose:()=>{window.Telegram.WebApp.close()},tgAddToHomeScreen:()=>{window.Telegram.WebApp.addToHomeScreen()},tgHideKeyboard:()=>{window.Telegram.WebApp.hideKeyboard()},tgLockOrientation:()=>{window.Telegram.WebApp.lockOrientation()},tgUnlockOrientation:()=>{window.Telegram.WebApp.unlockOrientation()},tgEnableVerticalSwipes:()=>{window.Telegram.WebApp.enableVerticalSwipes()},tgDisableVerticalSwipes:()=>{window.Telegram.WebApp.disableVerticalSwipes()}},children:E9(A8,{})})})},R8=HU;var MU=y({name:"IOEventsCard",component:R8,metadata:{author:"PieData"}});import{useCallback as _9,useContext as v9,useEffect as FU,useRef as zU,useState as D8}from"react";import{jsx as P8}from"react/jsx-runtime";var IU=({data:$,content:Z})=>{let{useLoader:Q,noReturn:J,returnType:K,useSocketioSupport:U,useCentrifugeSupport:Y,useMittSupport:G,centrifugeChannel:X}=$,V=v9(M$),F=v9(t)??Y$,[z,W]=D8(!1),[q,M]=D8(null),H=zU(Z),I=v9(q0),w=_9((L)=>{if(L===null)W(!0);else if(W(!1),!J)H.current=L;if(!J)M(L)},[J]),O=_9((L)=>{H.current=L.content,M(L.content)},[]),B=_9((L)=>{if(L===null)W(!0);else if(W(!1),!J)for(let S of L)I?.emit(S.name,S.data)},[J,I]);if(FU(()=>{M(Z),W(!1)},[Z]),!q&&Q)return V;return P8(m,{card:"AjaxGroupCard",data:$,methods:{changeContent:O},useSocketioSupport:U,useCentrifugeSupport:Y,useMittSupport:G,centrifugeChannel:X,children:P8(F,{uiConfig:q??H.current,setUiAjaxConfiguration:K==="events"?B:w})})},f8=IU;var WU=y({name:"AjaxGroupCard",component:f8,metadata:{author:"PieData",description:"Group card with AJAX support"}});import{useContext as C8}from"react";import{jsx as y9}from"react/jsx-runtime";var qU=({data:$,content:Z,setUiAjaxConfiguration:Q})=>{let{name:J,url:K,sx:U}=$,Y=C8(f$),G=C8(t)??Y$;return y9(m,{card:J,data:$,children:y9("div",{style:U,id:J,onClick:(V)=>{if(K)if(V.stopPropagation(),/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(K))window.location.href=K;else Y?.(K)},children:y9(G,{setUiAjaxConfiguration:Q,uiConfig:Z})})})},N8=qU;var LU=y({name:"BoxCard",component:N8,metadata:{author:"PieData",description:"Simple div with styles joining few components"}});export{aZ as UnionCard,cZ as UILoading,Y$ as UI,nZ as SequenceCard,m as PieCard,MU as IOEventsCard,JK as HiddenCard,eJ as HTMLEmbedCard,LU as BoxCard,VK as AutoRedirectCard,WU as AjaxGroupCard};
|
|
2
|
+
import{useContext as $,useEffect as E,useRef as Io}from"react";import{createContext as po,useContext as fo}from"react";var lo=po(null),uo=()=>{let o=fo(lo);if(!o)throw new Error("usePieConfig must be used within PieConfigProvider");return o};var R=()=>{let{enableRenderingLog:o}=uo();return o},G=R;import{createContext as go}from"react";import{Centrifuge as Ht}from"centrifuge";var Co=go(null),J=Co;import{io as Bt}from"socket.io-client";import{createContext as yo}from"react";var xo=yo(null),X=xo;import Gt from"mitt";import{createContext as Uo}from"react";var Po=Uo(null),T=Po;var bo=({card:o,data:t,children:r,useSocketioSupport:e=!1,useCentrifugeSupport:n=!1,useMittSupport:s=!1,centrifugeChannel:a=void 0,methods:l=void 0})=>{let c=G(),m=Io(l);if(E(()=>{m.current=l},[l]),c)console.log("[PieCard] Rendering card:",o),console.log("[PieCard] Card data:",t),console.log("[PieCard] Component name:",t?.name),console.log("[PieCard] Real-time support:",{socketio:e,centrifuge:n,mitt:s,centrifugeChannel:a}),console.log("[PieCard] Methods:",l?Object.keys(l):"none"),console.log("[PieCard] Has children:",!!r);let U=$(X),f=$(J),u=$(T);if(E(()=>{if(!U||!e||!m.current||!t.name){if(c&&e)console.log("[PieCard] Socket.IO setup skipped:",{hasSocket:!!U,useSocketioSupport:e,hasMethods:!!m.current,hasDataName:!!t?.name});return}let p=Object.keys(m.current??{});return p.forEach((i)=>{let d=`pie${i}_${t.name}`;if(c)console.log(`[PieCard] Socket.IO registering event: ${d}`);U.on(d,(y)=>{m.current?.[i]?.(y)})}),()=>{p.forEach((i)=>{let d=`pie${i}_${t.name}`;if(c)console.log(`[PieCard] Socket.IO unregistering event: ${d}`);U.off(d)})}},[U,t.name,e]),E(()=>{if(!f||!n||!a||!t.name){if(c&&n)console.log("[PieCard] Centrifuge setup skipped:",{hasCentrifuge:!!f,useCentrifugeSupport:n,hasCentrifugeChannel:!!a,hasMethods:!!m.current,hasDataName:!!t?.name});return}let i=Object.keys(m.current??{}).map((d)=>{let y=`pie${d}_${t.name}_${a}`;if(c)console.log(`[PieCard] Centrifuge subscribing to channel: ${y}`);let I=f.newSubscription(y);return I.on("publication",(k)=>{if(c)console.log(`[PieCard] Centrifuge received data on ${y}:`,k.data);m.current?.[d]?.(k.data)}),I.subscribe(),I});return()=>{i.forEach((d)=>{if(c)console.log("[PieCard] Centrifuge unsubscribing from channel");d.unsubscribe(),f.removeSubscription(d)})}},[f,a,t.name,n]),E(()=>{if(!u||!s||!t.name){if(c&&s)console.log("[PieCard] Mitt setup skipped:",{hasMitt:!!u,useMittSupport:s,hasMethods:!!m.current,hasDataName:!!t?.name});return}let p=Object.keys(m.current??{}),i={};return p.forEach((d)=>{let y=`pie${d}_${t.name}`,I=(k)=>{if(c)console.log(`[PieCard] Mitt registering event: ${y}`);m.current?.[d]?.(k)};i[y]=I,u.on(y,I)}),()=>{Object.entries(i).forEach(([d,y])=>{if(c)console.log(`[PieCard] Mitt unregistering event: ${d}`);u.off(d,y)})}},[u,t.name,s]),c)console.log("[PieCard] Rendering complete, returning children");return r},x=bo;import{lazy as ho}from"react";var M=new Map;function Q(o,t){return ho(()=>{if(M.has(t))return M.get(t);let r=o().then((e)=>e);return M.set(t,r),r})}var Y=new Map,ko=(o)=>{if(!o.name)throw new Error("Component registration requires a name");if(!o.component&&!o.loader)throw new Error(`Component "${o.name}" requires component or loader`);let t={name:o.name,component:o.component,loader:o.loader,metadata:o.metadata,fallback:o.fallback,isLazy:!1};if(!t.component&&t.loader)t.component=Q(t.loader,o.name),t.loader=void 0,t.isLazy=!0;return t};function C(o){let t=ko(o);return Y.set(t.name,t),t.component}var L=(o)=>{return Y.get(o)};import{Suspense as Lo,useContext as Ao,memo as No}from"react";import{createContext as wo}from"react";import{jsx as Eo,Fragment as To}from"react/jsx-runtime";var Ro=wo(Eo(To,{})),h=Ro;import{jsx as O}from"react/jsx-runtime";function zo({uiConfig:o,setUiAjaxConfiguration:t}){let r=Ao(h),e=R();if(e)console.log("[UI] Rendering component:",o.card),console.log("[UI] Component data:",o.data),console.log("[UI] Component content:",o.content),console.log("[UI] Has setUiAjaxConfiguration:",!!t);let n=L(o.card);if(!n?.component){if(e)console.warn(`[UI] Component not found in registry: ${o.card}`),console.log("[UI] Returning fallback component");return r}if(e)console.log("[UI] Found component in registry:",{name:n.name,isLazy:n.isLazy,hasMetadata:!!n.metadata});let s=n.component,a=O(s,{data:o.data,content:o.content,setUiAjaxConfiguration:t});if(n.isLazy){if(e)console.log("[UI] Rendering lazy component with Suspense:",n.name);return O(Lo,{fallback:n.fallback?O(n.fallback,{}):r,children:a},`${n.name}`)}if(e)console.log("[UI] Rendering component directly:",n.name);return a}var b=No(zo);import{Suspense as Oo,useContext as Ho}from"react";import{createContext as $o}from"react";var Mo=$o(null),P=Mo;import{jsx as A}from"react/jsx-runtime";function K({uiConfig:o,setUiAjaxConfiguration:t}){let r=Ho(h),e=R();if(e)console.log("[UILoading] Rendering fallback for:",o.card),console.log("[UILoading] Component data:",o.data),console.log("[UILoading] Component content:",o.content),console.log("[UILoading] Has setUiAjaxConfiguration:",!!t);let n=L(o.card);if(!n?.component){if(e)console.warn(`[UILoading] Component not found in registry: ${o.card}`),console.log("[UILoading] Returning fallback component");return r}if(e)console.log("[UILoading] Found component in registry:",{name:n.name,isLazy:n.isLazy,hasMetadata:!!n.metadata,hasFallback:!!n.fallback});if(n.fallback){if(e)console.log("[UILoading] Rendering fallback for:",n.name);let l=n.fallback;return A(l,{})}if(e)console.log("[UILoading] No fallback, rendering full component:",n.name);let s=n.component,a=A(P.Provider,{value:K,children:A(s,{data:o.data,content:o.content,setUiAjaxConfiguration:t})});if(n.isLazy)return A(Oo,{fallback:r,children:a},`${n.name}`);return a}var Do=K;import{useContext as qo}from"react";import{jsx as H}from"react/jsx-runtime";var Bo=({data:o,content:t,setUiAjaxConfiguration:r})=>{let{name:e,sx:n}=o,s=qo(P)??b;return H(x,{card:e,data:o,children:H("div",{style:n,id:e,children:t.map((a,l)=>{return H(s,{uiConfig:a,setUiAjaxConfiguration:r},`children-${l}`)})})})},V=Bo;var So=C({name:"SequenceCard",component:V,metadata:{author:"PieData",description:"Simple div with styles joining few components"}});import{useContext as Zo}from"react";import{jsx as W}from"react/jsx-runtime";var _o=({data:o,content:t,setUiAjaxConfiguration:r})=>{let{name:e}=o,n=Zo(P)??b;return W(x,{card:e,data:o,children:t.map((s,a)=>{return W(n,{uiConfig:s,setUiAjaxConfiguration:r},`children-${a}`)})})},j=_o;var Fo=C({name:"UnionCard",component:j,metadata:{author:"PieData",description:"Renders one of many components"}});import{useEffect as Qo,useState as Yo}from"react";import Ko from"html-react-parser";import{useCallback as N,useEffect as Go,useRef as D,useState as Jo}from"react";function Xo(){let o=new AudioContext,t=o.createOscillator(),r=t.connect(o.createMediaStreamDestination());t.start();let e=r.stream.getAudioTracks()[0];return e.enabled=!1,e}function q(o=null,t){let[r,e]=Jo(!1),n=D(null),s=D(null),a=D(null),l=N(async(f,u=!0)=>{if(n.current)c();let p=new RTCPeerConnection;if(p.onconnectionstatechange=()=>{if(p.connectionState==="connected")e(!0);else if(["disconnected","failed","closed"].includes(p.connectionState))e(!1)},p.ontrack=(g)=>{if(o)o.srcObject=g.streams[0]},u){let g=await navigator.mediaDevices.getUserMedia({audio:!0});p.addTrack(g.getTracks()[0],g)}else{let g=Xo();p.addTrack(g)}let i=p.createDataChannel("oai-events");s.current=i,a.current=new Promise((g)=>{i.addEventListener("open",()=>{g()})});let d=await p.createOffer();await p.setLocalDescription(d);let z=await(await fetch(`${"https://api.openai.com/v1/realtime/calls"}?model=${"gpt-realtime"}`,{method:"POST",body:d.sdp,headers:{Authorization:`Bearer ${f}`,"Content-Type":"application/sdp"}})).text();await p.setRemoteDescription({type:"answer",sdp:z}),n.current=p,await a.current},[o]),c=N(()=>{let f=s.current;if(f)f.close();n.current?.getSenders()?.forEach((u)=>u.track?.stop()),n.current?.close(),e(!1),n.current=null,s.current=null,a.current=null},[o]),m=N((f)=>{let u=s.current;if(!u){console.error("Data channel is not ready",f);return}let p=new Date().toLocaleTimeString();if(f.event_id=f.event_id||crypto.randomUUID(),u.send(JSON.stringify(f)),!f.timestamp)f.timestamp=p;t?.(f)},[t,o]),U=N((f)=>{if(!s.current){console.error("Data channel is not ready");return}let p=()=>{m({type:"conversation.item.create",item:{type:"message",role:"user",content:[{type:"input_text",text:f}]}}),m({type:"response.create"})};if(a.current)a.current.then(p);else p()},[t,o]);return Go(()=>{let f=s.current;if(!f)return;let u=(p)=>{let i=JSON.parse(p.data);if(!i.timestamp)i.timestamp=new Date().toLocaleTimeString();t?.(i)};return f.addEventListener("message",u),()=>{f.removeEventListener("message",u)}},[t,o]),{isSessionActive:r,startSession:l,stopSession:c,sendTextMessage:U}}import{jsx as Wo}from"react/jsx-runtime";var Vo=({data:o})=>{let{html:t,useSocketioSupport:r,useCentrifugeSupport:e,useMittSupport:n,centrifugeChannel:s}=o,[a,l]=Yo(t),{isSessionActive:c,startSession:m,sendTextMessage:U}=q(null,(i)=>{if(console.log(i.type,i.type==="response.output_text.delta"&&i.delta),i.type==="response.output_text.delta"&&i.delta)l((d)=>d+i.delta)});return Qo(()=>{l(t)},[t]),Wo(x,{card:"HTMLEmbedCard",data:o,methods:{update:(i)=>{l(i.value)},generateUsingAI:async(i)=>{try{if(!c&&i.token)await m(i.token,!1);U(i.prompt)}catch(d){console.error("Failed to generate using AI",d)}},initializeAI:async(i)=>{if(!c&&i.token)await m(i.token,!1)}},useCentrifugeSupport:e,useSocketioSupport:r,useMittSupport:n,centrifugeChannel:s,children:Ko(a)})},v=Vo;var jo=C({name:"HTMLEmbedCard",component:v,metadata:{author:"PieData"}});import{useEffect as vo,useState as ot}from"react";import{jsx as oo}from"react/jsx-runtime";var tt=({data:o})=>{let{name:t,value:r,useSocketioSupport:e,useCentrifugeSupport:n,useMittSupport:s,centrifugeChannel:a}=o,[l,c]=ot(r);return vo(()=>{c(r)},[r]),oo(x,{card:"HiddenCard",data:o,useSocketioSupport:e,useCentrifugeSupport:n,useMittSupport:s,centrifugeChannel:a,methods:{update:({value:m})=>{c(m)}},children:oo("input",{type:"hidden",id:t,name:t,value:l})})},to=tt;var nt=C({name:"HiddenCard",component:to,metadata:{author:"PieData"}});import{useContext as no,useEffect as it}from"react";import{createContext as et}from"react";var rt=et(void 0),w=rt;import{jsx as mt,Fragment as st}from"react/jsx-runtime";var at=({data:o})=>{let{url:t}=o,r=no(w),e=no(h);return it(()=>{if(/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(t))window.location.href=t;else r?.(t)},[t,r]),mt(st,{children:e})},eo=at;var ct=C({name:"AutoRedirectCard",component:eo,metadata:{author:"PieData"}});import{Bounce as pt,Slide as dt,Zoom as ft,Flip as lt}from"react-toastify";import{toast as ut,ToastContainer as gt}from"react-toastify";import{useContext as Ct,useMemo as yt,useRef as xt}from"react";import{jsx as B,Fragment as kt}from"react/jsx-runtime";var Ut={bounce:pt,slide:dt,zoom:ft,flip:lt},Pt=(o)=>{let t={...o,type:o.alertType,transition:o.transition?Ut[o.transition]:void 0,position:o.position??"bottom-right",autoClose:o.autoClose??3000,style:{backgroundColor:"black",...o.sx}};ut(o.message,t)},It=(o)=>{console.log("Log event",o)},bt=(o)=>{if(typeof window==="undefined"||!window.Notification){console.warn("[IOEventsCard] Notifications API is not available");return}let t=()=>{try{new window.Notification(o.title,{body:o.message??o.subtitle,icon:o.icon,silent:o.silent})}catch(e){console.error("[IOEventsCard] Failed to show notification",e)}},r=window.Notification.permission;if(r==="granted"){t();return}if(r==="denied"){console.warn("[IOEventsCard] Notification permission denied");return}window.Notification.requestPermission().then((e)=>{if(e==="granted")t()})},ht=({data:o})=>{let{useCentrifugeSupport:t,useSocketioSupport:r,useMittSupport:e,centrifugeChannel:n}=o,s=Ct(w),a=xt(s);a.current=s;let l=yt(()=>({alert:Pt,log:It,push:bt,redirect:(c)=>{if(c.to){let m=c.to;if(/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(m))window.location.href=m;else a.current?.(m)}else window.location.reload()},reload:(c)=>{if(c.to){let m=c.to;if(/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(m))window.location.href=m;else a.current?.(m)}else window.location.reload()}}),[]);return B(kt,{children:B(x,{card:"IOEventsCard",data:o,useCentrifugeSupport:t,useSocketioSupport:r,useMittSupport:e,centrifugeChannel:n,methods:l,children:B(gt,{})})})},ro=ht;var wt=C({name:"IOEventsCard",component:ro,metadata:{author:"PieData"}});import{useCallback as S,useContext as Z,useEffect as Rt,useRef as Tt,useState as io}from"react";import{jsx as ao}from"react/jsx-runtime";var Et=({data:o,content:t})=>{let{useLoader:r,noReturn:e,returnType:n,useSocketioSupport:s,useCentrifugeSupport:a,useMittSupport:l,centrifugeChannel:c}=o,m=Z(h),U=Z(P)??b,[f,u]=io(!1),[p,i]=io(null),d=Tt(t),y=Z(T),I=S((g)=>{if(g===null)u(!0);else if(u(!1),!e)d.current=g;if(!e)i(g)},[e]),k=S((g)=>{d.current=g.content,i(g.content)},[]),z=S((g)=>{if(g===null)u(!0);else if(u(!1),!e)for(let F of g)y?.emit(F.name,F.data)},[e,y]);if(Rt(()=>{i(t),u(!1)},[t]),!p&&r)return m;return ao(x,{card:"AjaxGroupCard",data:o,methods:{changeContent:k},useSocketioSupport:s,useCentrifugeSupport:a,useMittSupport:l,centrifugeChannel:c,children:ao(U,{uiConfig:p??d.current,setUiAjaxConfiguration:n==="events"?z:I})})},so=Et;var Lt=C({name:"AjaxGroupCard",component:so,metadata:{author:"PieData",description:"Group card with AJAX support"}});import{useContext as mo}from"react";import{jsx as _}from"react/jsx-runtime";var At=({data:o,content:t,setUiAjaxConfiguration:r})=>{let{name:e,url:n,sx:s}=o,a=mo(w),l=mo(P)??b;return _(x,{card:e,data:o,children:_("div",{style:s,id:e,onClick:(m)=>{if(n)if(m.stopPropagation(),/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(n))window.location.href=n;else a?.(n)},children:_(l,{setUiAjaxConfiguration:r,uiConfig:t})})})},co=At;var Nt=C({name:"BoxCard",component:co,metadata:{author:"PieData",description:"Simple div with styles joining few components"}});export{Fo as UnionCard,Do as UILoading,b as UI,So as SequenceCard,x as PieCard,wt as IOEventsCard,nt as HiddenCard,jo as HTMLEmbedCard,Nt as BoxCard,ct as AutoRedirectCard,Lt as AjaxGroupCard};
|