@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/index.esm.js CHANGED
@@ -1,19 +1,3 @@
1
1
  "use client";
2
- var u7=Object.create;var{getPrototypeOf:c7,defineProperty:t9,getOwnPropertyNames:vZ,getOwnPropertyDescriptor:l7}=Object,bZ=Object.prototype.hasOwnProperty;var e9=(Z,J,Y)=>{Y=Z!=null?u7(c7(Z)):{};let X=J||!Z||!Z.__esModule?t9(Y,"default",{value:Z,enumerable:!0}):Y;for(let G of vZ(Z))if(!bZ.call(X,G))t9(X,G,{get:()=>Z[G],enumerable:!0});return X},yZ=new WeakMap,i7=(Z)=>{var J=yZ.get(Z),Y;if(J)return J;if(J=t9({},"__esModule",{value:!0}),Z&&typeof Z==="object"||typeof Z==="function")vZ(Z).map((X)=>!bZ.call(J,X)&&t9(J,X,{get:()=>Z[X],enumerable:!(Y=l7(Z,X))||Y.enumerable}));return yZ.set(Z,J),J},a=(Z,J)=>()=>(J||Z((J={exports:{}}).exports,J),J.exports);var gZ=(Z,J)=>{for(var Y in J)t9(Z,Y,{get:J[Y],enumerable:!0,configurable:!0,set:(X)=>J[Y]=()=>X})};var n7=(Z,J)=>()=>(Z&&(J=Z(Z=0)),J);var D8=a((s4)=>{Object.defineProperty(s4,"__esModule",{value:!0});s4.Doctype=s4.CDATA=s4.Tag=s4.Style=s4.Script=s4.Comment=s4.Directive=s4.Text=s4.Root=s4.isTag=s4.ElementType=void 0;var R0;(function(Z){Z.Root="root",Z.Text="text",Z.Directive="directive",Z.Comment="comment",Z.Script="script",Z.Style="style",Z.Tag="tag",Z.CDATA="cdata",Z.Doctype="doctype"})(R0=s4.ElementType||(s4.ElementType={}));function FG(Z){return Z.type===R0.Tag||Z.type===R0.Script||Z.type===R0.Style}s4.isTag=FG;s4.Root=R0.Root;s4.Text=R0.Text;s4.Directive=R0.Directive;s4.Comment=R0.Comment;s4.Script=R0.Script;s4.Style=R0.Style;s4.Tag=R0.Tag;s4.CDATA=R0.CDATA;s4.Doctype=R0.Doctype});var P8=a((C)=>{var $9=C&&C.__extends||function(){var Z=function(J,Y){return Z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(X,G){X.__proto__=G}||function(X,G){for(var W in G)if(Object.prototype.hasOwnProperty.call(G,W))X[W]=G[W]},Z(J,Y)};return function(J,Y){if(typeof Y!=="function"&&Y!==null)throw new TypeError("Class extends value "+String(Y)+" is not a constructor or null");Z(J,Y);function X(){this.constructor=J}J.prototype=Y===null?Object.create(Y):(X.prototype=Y.prototype,new X)}}(),F1=C&&C.__assign||function(){return F1=Object.assign||function(Z){for(var J,Y=1,X=arguments.length;Y<X;Y++){J=arguments[Y];for(var G in J)if(Object.prototype.hasOwnProperty.call(J,G))Z[G]=J[G]}return Z},F1.apply(this,arguments)};Object.defineProperty(C,"__esModule",{value:!0});C.cloneNode=C.hasChildren=C.isDocument=C.isDirective=C.isComment=C.isText=C.isCDATA=C.isTag=C.Element=C.Document=C.CDATA=C.NodeWithChildren=C.ProcessingInstruction=C.Comment=C.Text=C.DataNode=C.Node=void 0;var M0=D8(),N8=function(){function Z(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(Z.prototype,"parentNode",{get:function(){return this.parent},set:function(J){this.parent=J},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"previousSibling",{get:function(){return this.prev},set:function(J){this.prev=J},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"nextSibling",{get:function(){return this.next},set:function(J){this.next=J},enumerable:!1,configurable:!0}),Z.prototype.cloneNode=function(J){if(J===void 0)J=!1;return A8(this,J)},Z}();C.Node=N8;var G6=function(Z){$9(J,Z);function J(Y){var X=Z.call(this)||this;return X.data=Y,X}return Object.defineProperty(J.prototype,"nodeValue",{get:function(){return this.data},set:function(Y){this.data=Y},enumerable:!1,configurable:!0}),J}(N8);C.DataNode=G6;var r4=function(Z){$9(J,Z);function J(){var Y=Z!==null&&Z.apply(this,arguments)||this;return Y.type=M0.ElementType.Text,Y}return Object.defineProperty(J.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),J}(G6);C.Text=r4;var t4=function(Z){$9(J,Z);function J(){var Y=Z!==null&&Z.apply(this,arguments)||this;return Y.type=M0.ElementType.Comment,Y}return Object.defineProperty(J.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),J}(G6);C.Comment=t4;var e4=function(Z){$9(J,Z);function J(Y,X){var G=Z.call(this,X)||this;return G.name=Y,G.type=M0.ElementType.Directive,G}return Object.defineProperty(J.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),J}(G6);C.ProcessingInstruction=e4;var W6=function(Z){$9(J,Z);function J(Y){var X=Z.call(this)||this;return X.children=Y,X}return Object.defineProperty(J.prototype,"firstChild",{get:function(){var Y;return(Y=this.children[0])!==null&&Y!==void 0?Y:null},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"childNodes",{get:function(){return this.children},set:function(Y){this.children=Y},enumerable:!1,configurable:!0}),J}(N8);C.NodeWithChildren=W6;var ZJ=function(Z){$9(J,Z);function J(){var Y=Z!==null&&Z.apply(this,arguments)||this;return Y.type=M0.ElementType.CDATA,Y}return Object.defineProperty(J.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),J}(W6);C.CDATA=ZJ;var JJ=function(Z){$9(J,Z);function J(){var Y=Z!==null&&Z.apply(this,arguments)||this;return Y.type=M0.ElementType.Root,Y}return Object.defineProperty(J.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),J}(W6);C.Document=JJ;var YJ=function(Z){$9(J,Z);function J(Y,X,G,W){if(G===void 0)G=[];if(W===void 0)W=Y==="script"?M0.ElementType.Script:Y==="style"?M0.ElementType.Style:M0.ElementType.Tag;var K=Z.call(this,G)||this;return K.name=Y,K.attribs=X,K.type=W,K}return Object.defineProperty(J.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"tagName",{get:function(){return this.name},set:function(Y){this.name=Y},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"attributes",{get:function(){var Y=this;return Object.keys(this.attribs).map(function(X){var G,W;return{name:X,value:Y.attribs[X],namespace:(G=Y["x-attribsNamespace"])===null||G===void 0?void 0:G[X],prefix:(W=Y["x-attribsPrefix"])===null||W===void 0?void 0:W[X]}})},enumerable:!1,configurable:!0}),J}(W6);C.Element=YJ;function XJ(Z){return M0.isTag(Z)}C.isTag=XJ;function GJ(Z){return Z.type===M0.ElementType.CDATA}C.isCDATA=GJ;function WJ(Z){return Z.type===M0.ElementType.Text}C.isText=WJ;function KJ(Z){return Z.type===M0.ElementType.Comment}C.isComment=KJ;function HJ(Z){return Z.type===M0.ElementType.Directive}C.isDirective=HJ;function zJ(Z){return Z.type===M0.ElementType.Root}C.isDocument=zJ;function qG(Z){return Object.prototype.hasOwnProperty.call(Z,"children")}C.hasChildren=qG;function A8(Z,J){if(J===void 0)J=!1;var Y;if(WJ(Z))Y=new r4(Z.data);else if(KJ(Z))Y=new t4(Z.data);else if(XJ(Z)){var X=J?w8(Z.children):[],G=new YJ(Z.name,F1({},Z.attribs),X);if(X.forEach(function(z){return z.parent=G}),Z.namespace!=null)G.namespace=Z.namespace;if(Z["x-attribsNamespace"])G["x-attribsNamespace"]=F1({},Z["x-attribsNamespace"]);if(Z["x-attribsPrefix"])G["x-attribsPrefix"]=F1({},Z["x-attribsPrefix"]);Y=G}else if(GJ(Z)){var X=J?w8(Z.children):[],W=new ZJ(X);X.forEach(function(V){return V.parent=W}),Y=W}else if(zJ(Z)){var X=J?w8(Z.children):[],K=new JJ(X);if(X.forEach(function(V){return V.parent=K}),Z["x-mode"])K["x-mode"]=Z["x-mode"];Y=K}else if(HJ(Z)){var H=new e4(Z.name,Z.data);if(Z["x-name"]!=null)H["x-name"]=Z["x-name"],H["x-publicId"]=Z["x-publicId"],H["x-systemId"]=Z["x-systemId"];Y=H}else throw new Error("Not implemented yet: ".concat(Z.type));if(Y.startIndex=Z.startIndex,Y.endIndex=Z.endIndex,Z.sourceCodeLocation!=null)Y.sourceCodeLocation=Z.sourceCodeLocation;return Y}C.cloneNode=A8;function w8(Z){var J=Z.map(function(X){return A8(X,!0)});for(var Y=1;Y<J.length;Y++)J[Y].prev=J[Y-1],J[Y-1].next=J[Y];return J}});var O8=a((d0)=>{var TG=d0&&d0.__createBinding||(Object.create?function(Z,J,Y,X){if(X===void 0)X=Y;var G=Object.getOwnPropertyDescriptor(J,Y);if(!G||("get"in G?!J.__esModule:G.writable||G.configurable))G={enumerable:!0,get:function(){return J[Y]}};Object.defineProperty(Z,X,G)}:function(Z,J,Y,X){if(X===void 0)X=Y;Z[X]=J[Y]}),EG=d0&&d0.__exportStar||function(Z,J){for(var Y in Z)if(Y!=="default"&&!Object.prototype.hasOwnProperty.call(J,Y))TG(J,Z,Y)};Object.defineProperty(d0,"__esModule",{value:!0});d0.DomHandler=void 0;var R8=D8(),U9=P8();EG(P8(),d0);var VJ={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},QJ=function(){function Z(J,Y,X){if(this.dom=[],this.root=new U9.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof Y==="function")X=Y,Y=VJ;if(typeof J==="object")Y=J,J=void 0;this.callback=J!==null&&J!==void 0?J:null,this.options=Y!==null&&Y!==void 0?Y:VJ,this.elementCB=X!==null&&X!==void 0?X:null}return Z.prototype.onparserinit=function(J){this.parser=J},Z.prototype.onreset=function(){this.dom=[],this.root=new U9.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},Z.prototype.onend=function(){if(this.done)return;this.done=!0,this.parser=null,this.handleCallback(null)},Z.prototype.onerror=function(J){this.handleCallback(J)},Z.prototype.onclosetag=function(){this.lastNode=null;var J=this.tagStack.pop();if(this.options.withEndIndices)J.endIndex=this.parser.endIndex;if(this.elementCB)this.elementCB(J)},Z.prototype.onopentag=function(J,Y){var X=this.options.xmlMode?R8.ElementType.Tag:void 0,G=new U9.Element(J,Y,void 0,X);this.addNode(G),this.tagStack.push(G)},Z.prototype.ontext=function(J){var Y=this.lastNode;if(Y&&Y.type===R8.ElementType.Text){if(Y.data+=J,this.options.withEndIndices)Y.endIndex=this.parser.endIndex}else{var X=new U9.Text(J);this.addNode(X),this.lastNode=X}},Z.prototype.oncomment=function(J){if(this.lastNode&&this.lastNode.type===R8.ElementType.Comment){this.lastNode.data+=J;return}var Y=new U9.Comment(J);this.addNode(Y),this.lastNode=Y},Z.prototype.oncommentend=function(){this.lastNode=null},Z.prototype.oncdatastart=function(){var J=new U9.Text(""),Y=new U9.CDATA([J]);this.addNode(Y),J.parent=Y,this.lastNode=J},Z.prototype.oncdataend=function(){this.lastNode=null},Z.prototype.onprocessinginstruction=function(J,Y){var X=new U9.ProcessingInstruction(J,Y);this.addNode(X)},Z.prototype.handleCallback=function(J){if(typeof this.callback==="function")this.callback(J,this.dom);else if(J)throw J},Z.prototype.addNode=function(J){var Y=this.tagStack[this.tagStack.length-1],X=Y.children[Y.children.length-1];if(this.options.withStartIndices)J.startIndex=this.parser.startIndex;if(this.options.withEndIndices)J.endIndex=this.parser.endIndex;if(Y.children.push(J),X)J.prev=X,X.next=J;J.parent=Y,this.lastNode=null},Z}();d0.DomHandler=QJ;d0.default=QJ});var MJ=a(($J)=>{Object.defineProperty($J,"__esModule",{value:!0});$J.CARRIAGE_RETURN_PLACEHOLDER_REGEX=$J.CARRIAGE_RETURN_PLACEHOLDER=$J.CARRIAGE_RETURN_REGEX=$J.CARRIAGE_RETURN=$J.CASE_SENSITIVE_TAG_NAMES_MAP=$J.CASE_SENSITIVE_TAG_NAMES=void 0;$J.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"];$J.CASE_SENSITIVE_TAG_NAMES_MAP=$J.CASE_SENSITIVE_TAG_NAMES.reduce(function(Z,J){return Z[J.toLowerCase()]=J,Z},{});$J.CARRIAGE_RETURN="\r";$J.CARRIAGE_RETURN_REGEX=new RegExp($J.CARRIAGE_RETURN,"g");$J.CARRIAGE_RETURN_PLACEHOLDER="__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_".concat(Date.now().toString(),"__");$J.CARRIAGE_RETURN_PLACEHOLDER_REGEX=new RegExp($J.CARRIAGE_RETURN_PLACEHOLDER,"g")});var q8=a((NJ)=>{Object.defineProperty(NJ,"__esModule",{value:!0});NJ.formatAttributes=IJ;NJ.hasOpenTag=xG;NJ.escapeSpecialCharacters=kG;NJ.revertEscapedCharacters=DJ;NJ.formatDOM=wJ;var K6=O8(),M1=MJ();function jG(Z){return M1.CASE_SENSITIVE_TAG_NAMES_MAP[Z]}function IJ(Z){var J={},Y=0,X=Z.length;for(;Y<X;Y++){var G=Z[Y];J[G.name]=G.value}return J}function CG(Z){Z=Z.toLowerCase();var J=jG(Z);if(J)return J;return Z}function xG(Z,J){var Y="<"+J,X=Z.toLowerCase().indexOf(Y);if(X===-1)return!1;var G=Z[X+Y.length];return G===">"||G===" "||G==="\t"||G===`
3
- `||G==="\r"||G==="/"}function kG(Z){return Z.replace(M1.CARRIAGE_RETURN_REGEX,M1.CARRIAGE_RETURN_PLACEHOLDER)}function DJ(Z){return Z.replace(M1.CARRIAGE_RETURN_PLACEHOLDER_REGEX,M1.CARRIAGE_RETURN)}function wJ(Z,J,Y){var X,G,W,K;if(J===void 0)J=null;var H=[],z,V=0,Q=Z.length;for(;V<Q;V++){var L=Z[V];switch(L.nodeType){case 1:{var F=CG(L.nodeName);z=new K6.Element(F,IJ(L.attributes)),z.children=wJ(F==="template"?L.content.childNodes:L.childNodes,z);break}case 3:z=new K6.Text(DJ((X=L.nodeValue)!==null&&X!==void 0?X:""));break;case 8:z=new K6.Comment((G=L.nodeValue)!==null&&G!==void 0?G:"");break;default:continue}var M=(W=H[V-1])!==null&&W!==void 0?W:null;if(M)M.next=z;z.parent=J,z.prev=M,z.next=null,H.push(z)}if(Y){if(z=new K6.ProcessingInstruction(Y.substring(0,Y.indexOf(" ")).toLowerCase(),Y),z.next=(K=H[0])!==null&&K!==void 0?K:null,z.parent=J,H.unshift(z),H[1])H[1].prev=H[0]}return H}});var EJ=a((TJ)=>{Object.defineProperty(TJ,"__esModule",{value:!0});TJ.default=mG;var I1=q8(),AJ="html",H6="head",m9="body",gG=/<([a-zA-Z]+[0-9]?)/,V6=function(Z,J){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},T8=function(Z,J){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},PJ=typeof window==="object"&&window.DOMParser;if(typeof PJ==="function")RJ=new PJ,OJ="text/html",T8=function(Z,J){if(J)Z="<".concat(J,">").concat(Z,"</").concat(J,">");return RJ.parseFromString(Z,OJ)},V6=T8;var RJ,OJ;if(typeof document==="object"&&document.implementation)D1=document.implementation.createHTMLDocument(),V6=function(Z,J){if(J){var Y=D1.documentElement.querySelector(J);if(Y)Y.innerHTML=Z;return D1}return D1.documentElement.innerHTML=Z,D1};var D1,z6=typeof document==="object"&&document.createElement("template"),E8;if(z6&&z6.content)E8=function(Z){return z6.innerHTML=Z,z6.content.childNodes};var qJ=function(){return document.createDocumentFragment().childNodes};function mG(Z){var J,Y,X,G,W,K;Z=I1.escapeSpecialCharacters(Z);var H=gG.exec(Z),z=(J=H===null||H===void 0?void 0:H[1])===null||J===void 0?void 0:J.toLowerCase();switch(z){case AJ:{var V=T8(Z);if(!I1.hasOpenTag(Z,H6)){var Q=V.querySelector(H6);(Y=Q===null||Q===void 0?void 0:Q.parentNode)===null||Y===void 0||Y.removeChild(Q)}if(!I1.hasOpenTag(Z,m9)){var Q=V.querySelector(m9);(X=Q===null||Q===void 0?void 0:Q.parentNode)===null||X===void 0||X.removeChild(Q)}return V.querySelectorAll(AJ)}case H6:case m9:{var L=V6(Z).querySelectorAll(z);if(I1.hasOpenTag(Z,m9)&&I1.hasOpenTag(Z,H6))return(W=(G=L[0].parentNode)===null||G===void 0?void 0:G.childNodes)!==null&&W!==void 0?W:qJ();return L}default:{if(E8)return E8(Z);var Q=V6(Z,m9).querySelector(m9);return(K=Q===null||Q===void 0?void 0:Q.childNodes)!==null&&K!==void 0?K:qJ()}}}});var _J=a((w1)=>{var pG=w1&&w1.__importDefault||function(Z){return Z&&Z.__esModule?Z:{default:Z}};Object.defineProperty(w1,"__esModule",{value:!0});w1.default=iG;var uG=pG(EJ()),cG=q8(),lG=/<(![a-zA-Z\s]+)>/;function iG(Z){if(typeof Z!=="string")throw new TypeError("First argument must be a string");if(!Z)return[];var J=lG.exec(Z),Y=J?J[1]:void 0;return cG.formatDOM(uG.default(Z),null,Y)}});var SJ=a((sG)=>{var nG=0;sG.SAME=nG;var oG=1;sG.CAMELCASE=oG;sG.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 CJ=a((z3)=>{function eG(Z){return J0.hasOwnProperty(Z)?J0[Z]:null}function $0(Z,J,Y,X,G,W,K){this.acceptsBooleans=J===2||J===3||J===4,this.attributeName=X,this.attributeNamespace=G,this.mustUseProperty=Y,this.propertyName=Z,this.type=J,this.sanitizeURL=W,this.removeEmptyString=K}var J0={},Z3=["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"];Z3.forEach((Z)=>{J0[Z]=new $0(Z,0,!1,Z,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([Z,J])=>{J0[Z]=new $0(Z,1,!1,J,null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach((Z)=>{J0[Z]=new $0(Z,2,!1,Z.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((Z)=>{J0[Z]=new $0(Z,2,!1,Z,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((Z)=>{J0[Z]=new $0(Z,3,!1,Z.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach((Z)=>{J0[Z]=new $0(Z,3,!0,Z,null,!1,!1)});["capture","download"].forEach((Z)=>{J0[Z]=new $0(Z,4,!1,Z,null,!1,!1)});["cols","rows","size","span"].forEach((Z)=>{J0[Z]=new $0(Z,6,!1,Z,null,!1,!1)});["rowSpan","start"].forEach((Z)=>{J0[Z]=new $0(Z,5,!1,Z.toLowerCase(),null,!1,!1)});var _8=/[\-\:]([a-z])/g,S8=(Z)=>Z[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((Z)=>{let J=Z.replace(_8,S8);J0[J]=new $0(J,1,!1,Z,null,!1,!1)});["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach((Z)=>{let J=Z.replace(_8,S8);J0[J]=new $0(J,1,!1,Z,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach((Z)=>{let J=Z.replace(_8,S8);J0[J]=new $0(J,1,!1,Z,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach((Z)=>{J0[Z]=new $0(Z,1,!1,Z.toLowerCase(),null,!1,!1)});var J3="xlinkHref";J0[J3]=new $0("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach((Z)=>{J0[Z]=new $0(Z,1,!1,Z.toLowerCase(),null,!0,!0)});var{CAMELCASE:Y3,SAME:X3,possibleStandardNames:jJ}=SJ(),G3=":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",W3=G3+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",K3=RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+W3+"]*$")),H3=Object.keys(jJ).reduce((Z,J)=>{let Y=jJ[J];if(Y===X3)Z[J]=J;else if(Y===Y3)Z[J.toLowerCase()]=J;else Z[J]=Y;return Z},{});z3.BOOLEAN=3;z3.BOOLEANISH_STRING=2;z3.NUMERIC=5;z3.OVERLOADED_BOOLEAN=4;z3.POSITIVE_NUMERIC=6;z3.RESERVED=0;z3.STRING=1;z3.getPropertyInfo=eG;z3.isCustomAttribute=K3;z3.possibleStandardNames=H3});var vJ=a((RB,yJ)=>{var xJ=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,w3=/\n/g,N3=/^\s*/,A3=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,P3=/^:\s*/,R3=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,O3=/^[;\s]*/,q3=/^\s+|\s+$/g,T3=`
4
- `,kJ="/",fJ="*",E9="",E3="comment",_3="declaration";function S3(Z,J){if(typeof Z!=="string")throw new TypeError("First argument must be a string");if(!Z)return[];J=J||{};var Y=1,X=1;function G($){var U=$.match(w3);if(U)Y+=U.length;var B=$.lastIndexOf(T3);X=~B?$.length-B:X+$.length}function W(){var $={line:Y,column:X};return function(U){return U.position=new K($),V(),U}}function K($){this.start=$,this.end={line:Y,column:X},this.source=J.source}K.prototype.content=Z;function H($){var U=new Error(J.source+":"+Y+":"+X+": "+$);if(U.reason=$,U.filename=J.source,U.line=Y,U.column=X,U.source=Z,J.silent);else throw U}function z($){var U=$.exec(Z);if(!U)return;var B=U[0];return G(B),Z=Z.slice(B.length),U}function V(){z(N3)}function Q($){var U;$=$||[];while(U=L())if(U!==!1)$.push(U);return $}function L(){var $=W();if(kJ!=Z.charAt(0)||fJ!=Z.charAt(1))return;var U=2;while(E9!=Z.charAt(U)&&(fJ!=Z.charAt(U)||kJ!=Z.charAt(U+1)))++U;if(U+=2,E9===Z.charAt(U-1))return H("End of comment missing");var B=Z.slice(2,U-2);return X+=2,G(B),Z=Z.slice(U),X+=2,$({type:E3,comment:B})}function F(){var $=W(),U=z(A3);if(!U)return;if(L(),!z(P3))return H("property missing ':'");var B=z(R3),D=$({type:_3,property:hJ(U[0].replace(xJ,E9)),value:B?hJ(B[0].replace(xJ,E9)):E9});return z(O3),D}function M(){var $=[];Q($);var U;while(U=F())if(U!==!1)$.push(U),Q($);return $}return V(),M()}function hJ(Z){return Z?Z.replace(q3,E9):E9}yJ.exports=S3});var bJ=a((N1)=>{var j3=N1&&N1.__importDefault||function(Z){return Z&&Z.__esModule?Z:{default:Z}};Object.defineProperty(N1,"__esModule",{value:!0});N1.default=x3;var C3=j3(vJ());function x3(Z,J){let Y=null;if(!Z||typeof Z!=="string")return Y;let X=C3.default(Z),G=typeof J==="function";return X.forEach((W)=>{if(W.type!=="declaration")return;let{property:K,value:H}=W;if(G)J(K,H,W);else if(H)Y=Y||{},Y[K]=H}),Y}});var pJ=a((mJ)=>{Object.defineProperty(mJ,"__esModule",{value:!0});mJ.camelCase=void 0;var k3=/^--[a-zA-Z0-9_-]+$/,f3=/-([a-z])/g,h3=/^[^-]+$/,y3=/^-(webkit|moz|ms|o|khtml)-/,v3=/^-(ms)-/,b3=function(Z){return!Z||h3.test(Z)||k3.test(Z)},g3=function(Z,J){return J.toUpperCase()},gJ=function(Z,J){return"".concat(J,"-")},m3=function(Z,J){if(J===void 0)J={};if(b3(Z))return Z;if(Z=Z.toLowerCase(),J.reactCompat)Z=Z.replace(v3,gJ);else Z=Z.replace(y3,gJ);return Z.replace(f3,g3)};mJ.camelCase=m3});var cJ=a((C8,uJ)=>{var d3=C8&&C8.__importDefault||function(Z){return Z&&Z.__esModule?Z:{default:Z}},p3=d3(bJ()),u3=pJ();function j8(Z,J){var Y={};if(!Z||typeof Z!=="string")return Y;return p3.default(Z,function(X,G){if(X&&G)Y[u3.camelCase(X,J)]=G}),Y}j8.default=j8;uJ.exports=j8});import*as lJ from"react";var x8=a((U0)=>{var c3=U0&&U0.__importDefault||function(Z){return Z&&Z.__esModule?Z:{default:Z}};Object.defineProperty(U0,"__esModule",{value:!0});U0.returnFirstArg=U0.canTextBeChildOfNode=U0.ELEMENTS_WITH_NO_TEXT_CHILDREN=U0.PRESERVE_CUSTOM_ATTRIBUTES=void 0;U0.isCustomComponent=n3;U0.setStyleProp=s3;var l3=c3(cJ()),i3=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function n3(Z,J){if(!Z.includes("-"))return Boolean(J&&typeof J.is==="string");if(i3.has(Z))return!1;return!0}var o3={reactCompat:!0};function s3(Z,J){if(typeof Z!=="string")return;if(!Z.trim()){J.style={};return}try{J.style=l3.default(Z,o3)}catch(Y){J.style={}}}U0.PRESERVE_CUSTOM_ATTRIBUTES=Number(lJ.version.split(".")[0])>=16;U0.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);var a3=function(Z){return!U0.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(Z.name)};U0.canTextBeChildOfNode=a3;var r3=function(Z){return Z};U0.returnFirstArg=r3});var k8=a((oJ)=>{Object.defineProperty(oJ,"__esModule",{value:!0});oJ.default=JW;var A1=CJ(),iJ=x8(),t3=["checked","value"],e3=["input","select","textarea"],ZW={reset:!0,submit:!0};function JW(Z,J){if(Z===void 0)Z={};var Y={},X=Boolean(Z.type&&ZW[Z.type]);for(var G in Z){var W=Z[G];if(A1.isCustomAttribute(G)){Y[G]=W;continue}var K=G.toLowerCase(),H=nJ(K);if(H){var z=A1.getPropertyInfo(H);if(t3.includes(H)&&e3.includes(J)&&!X)H=nJ("default"+K);switch(Y[H]=W,z===null||z===void 0?void 0:z.type){case A1.BOOLEAN:Y[H]=!0;break;case A1.OVERLOADED_BOOLEAN:if(W==="")Y[H]=!0;break}continue}if(iJ.PRESERVE_CUSTOM_ATTRIBUTES)Y[G]=W}return iJ.setStyleProp(Z.style,Y),Y}function nJ(Z){return A1.possibleStandardNames[Z]}});import*as d9 from"react";var aJ=a((R1)=>{var XW=R1&&R1.__importDefault||function(Z){return Z&&Z.__esModule?Z:{default:Z}};Object.defineProperty(R1,"__esModule",{value:!0});R1.default=sJ;var GW=XW(k8()),P1=x8(),WW={cloneElement:d9.cloneElement,createElement:d9.createElement,isValidElement:d9.isValidElement};function sJ(Z,J){var Y,X,G,W,K;if(J===void 0)J={};var H=[],z=typeof J.replace==="function",V=(Y=J.transform)!==null&&Y!==void 0?Y:P1.returnFirstArg,Q=(X=J.library)!==null&&X!==void 0?X:WW,L=Q.cloneElement,F=Q.createElement,M=Q.isValidElement,$=Z.length;for(var U=0;U<$;U++){var B=Z[U];if(z){var D=(G=J.replace)===null||G===void 0?void 0:G.call(J,B,U);if(M(D)){if($>1)D=L(D,{key:(W=D.key)!==null&&W!==void 0?W:U});H.push(V(D,B,U));continue}}if(B.type==="text"){var N=!B.data.trim().length;if(N&&B.parent&&!P1.canTextBeChildOfNode(B.parent))continue;if(J.trim&&N)continue;H.push(V(B.data,B,U));continue}var w=B,P={};if(KW(w))P1.setStyleProp(w.attribs.style,w.attribs),P=w.attribs;else if(w.attribs)P=GW.default(w.attribs,w.name);var T=void 0;switch(B.type){case"script":case"style":if(B.children[0])P.dangerouslySetInnerHTML={__html:B.children[0].data};break;case"tag":if(B.name==="textarea"&&B.children[0])P.defaultValue=B.children[0].data;else if((K=B.children)===null||K===void 0?void 0:K.length)T=sJ(B.children,J);break;default:continue}if($>1)P.key=U;H.push(V(F(B.name,P,T),B,U))}return H.length===1?H[0]:H}function KW(Z){return P1.PRESERVE_CUSTOM_ATTRIBUTES&&Z.type==="tag"&&P1.isCustomComponent(Z.name,Z.attribs)}});var h8=a((r)=>{var f8=r&&r.__importDefault||function(Z){return Z&&Z.__esModule?Z:{default:Z}};Object.defineProperty(r,"__esModule",{value:!0});r.htmlToDOM=r.domToReact=r.attributesToProps=r.Text=r.ProcessingInstruction=r.Element=r.Comment=void 0;r.default=VW;var rJ=f8(_J());r.htmlToDOM=rJ.default;var HW=f8(k8());r.attributesToProps=HW.default;var tJ=f8(aJ());r.domToReact=tJ.default;var Q6=O8();Object.defineProperty(r,"Comment",{enumerable:!0,get:function(){return Q6.Comment}});Object.defineProperty(r,"Element",{enumerable:!0,get:function(){return Q6.Element}});Object.defineProperty(r,"ProcessingInstruction",{enumerable:!0,get:function(){return Q6.ProcessingInstruction}});Object.defineProperty(r,"Text",{enumerable:!0,get:function(){return Q6.Text}});var zW={lowerCaseAttributeNames:!1};function VW(Z,J){var Y;if(typeof Z!=="string")throw new TypeError("First argument must be a string");if(!Z)return[];return tJ.default(rJ.default(Z,(Y=J===null||J===void 0?void 0:J.htmlparser2)!==null&&Y!==void 0?Y:zW),J)}});var j5={};gZ(j5,{default:()=>WH,__values:()=>x6,__spreadArrays:()=>M5,__spreadArray:()=>I5,__spread:()=>F5,__setFunctionName:()=>Q5,__runInitializers:()=>z5,__rewriteRelativeImportExtension:()=>S5,__rest:()=>G5,__read:()=>LZ,__propKey:()=>V5,__param:()=>K5,__metadata:()=>$5,__makeTemplateObject:()=>A5,__importStar:()=>P5,__importDefault:()=>R5,__generator:()=>B5,__extends:()=>X5,__exportStar:()=>L5,__esDecorate:()=>H5,__disposeResources:()=>_5,__decorate:()=>W5,__createBinding:()=>k6,__classPrivateFieldSet:()=>q5,__classPrivateFieldIn:()=>T5,__classPrivateFieldGet:()=>O5,__awaiter:()=>U5,__await:()=>i9,__asyncValues:()=>N5,__asyncGenerator:()=>D5,__asyncDelegator:()=>w5,__assign:()=>C6,__addDisposableResource:()=>E5});function X5(Z,J){if(typeof J!=="function"&&J!==null)throw new TypeError("Class extends value "+String(J)+" is not a constructor or null");UZ(Z,J);function Y(){this.constructor=Z}Z.prototype=J===null?Object.create(J):(Y.prototype=J.prototype,new Y)}function G5(Z,J){var Y={};for(var X in Z)if(Object.prototype.hasOwnProperty.call(Z,X)&&J.indexOf(X)<0)Y[X]=Z[X];if(Z!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var G=0,X=Object.getOwnPropertySymbols(Z);G<X.length;G++)if(J.indexOf(X[G])<0&&Object.prototype.propertyIsEnumerable.call(Z,X[G]))Y[X[G]]=Z[X[G]]}return Y}function W5(Z,J,Y,X){var G=arguments.length,W=G<3?J:X===null?X=Object.getOwnPropertyDescriptor(J,Y):X,K;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")W=Reflect.decorate(Z,J,Y,X);else for(var H=Z.length-1;H>=0;H--)if(K=Z[H])W=(G<3?K(W):G>3?K(J,Y,W):K(J,Y))||W;return G>3&&W&&Object.defineProperty(J,Y,W),W}function K5(Z,J){return function(Y,X){J(Y,X,Z)}}function H5(Z,J,Y,X,G,W){function K(D){if(D!==void 0&&typeof D!=="function")throw new TypeError("Function expected");return D}var H=X.kind,z=H==="getter"?"get":H==="setter"?"set":"value",V=!J&&Z?X.static?Z:Z.prototype:null,Q=J||(V?Object.getOwnPropertyDescriptor(V,X.name):{}),L,F=!1;for(var M=Y.length-1;M>=0;M--){var $={};for(var U in X)$[U]=U==="access"?{}:X[U];for(var U in X.access)$.access[U]=X.access[U];$.addInitializer=function(D){if(F)throw new TypeError("Cannot add initializers after decoration has completed");W.push(K(D||null))};var B=Y[M](H==="accessor"?{get:Q.get,set:Q.set}:Q[z],$);if(H==="accessor"){if(B===void 0)continue;if(B===null||typeof B!=="object")throw new TypeError("Object expected");if(L=K(B.get))Q.get=L;if(L=K(B.set))Q.set=L;if(L=K(B.init))G.unshift(L)}else if(L=K(B))if(H==="field")G.unshift(L);else Q[z]=L}if(V)Object.defineProperty(V,X.name,Q);F=!0}function z5(Z,J,Y){var X=arguments.length>2;for(var G=0;G<J.length;G++)Y=X?J[G].call(Z,Y):J[G].call(Z);return X?Y:void 0}function V5(Z){return typeof Z==="symbol"?Z:"".concat(Z)}function Q5(Z,J,Y){if(typeof J==="symbol")J=J.description?"[".concat(J.description,"]"):"";return Object.defineProperty(Z,"name",{configurable:!0,value:Y?"".concat(Y," ",J):J})}function $5(Z,J){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(Z,J)}function U5(Z,J,Y,X){function G(W){return W instanceof Y?W:new Y(function(K){K(W)})}return new(Y||(Y=Promise))(function(W,K){function H(Q){try{V(X.next(Q))}catch(L){K(L)}}function z(Q){try{V(X.throw(Q))}catch(L){K(L)}}function V(Q){Q.done?W(Q.value):G(Q.value).then(H,z)}V((X=X.apply(Z,J||[])).next())})}function B5(Z,J){var Y={label:0,sent:function(){if(W[0]&1)throw W[1];return W[1]},trys:[],ops:[]},X,G,W,K=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return K.next=H(0),K.throw=H(1),K.return=H(2),typeof Symbol==="function"&&(K[Symbol.iterator]=function(){return this}),K;function H(V){return function(Q){return z([V,Q])}}function z(V){if(X)throw new TypeError("Generator is already executing.");while(K&&(K=0,V[0]&&(Y=0)),Y)try{if(X=1,G&&(W=V[0]&2?G.return:V[0]?G.throw||((W=G.return)&&W.call(G),0):G.next)&&!(W=W.call(G,V[1])).done)return W;if(G=0,W)V=[V[0]&2,W.value];switch(V[0]){case 0:case 1:W=V;break;case 4:return Y.label++,{value:V[1],done:!1};case 5:Y.label++,G=V[1],V=[0];continue;case 7:V=Y.ops.pop(),Y.trys.pop();continue;default:if((W=Y.trys,!(W=W.length>0&&W[W.length-1]))&&(V[0]===6||V[0]===2)){Y=0;continue}if(V[0]===3&&(!W||V[1]>W[0]&&V[1]<W[3])){Y.label=V[1];break}if(V[0]===6&&Y.label<W[1]){Y.label=W[1],W=V;break}if(W&&Y.label<W[2]){Y.label=W[2],Y.ops.push(V);break}if(W[2])Y.ops.pop();Y.trys.pop();continue}V=J.call(Z,Y)}catch(Q){V=[6,Q],G=0}finally{X=W=0}if(V[0]&5)throw V[1];return{value:V[0]?V[1]:void 0,done:!0}}}function L5(Z,J){for(var Y in Z)if(Y!=="default"&&!Object.prototype.hasOwnProperty.call(J,Y))k6(J,Z,Y)}function x6(Z){var J=typeof Symbol==="function"&&Symbol.iterator,Y=J&&Z[J],X=0;if(Y)return Y.call(Z);if(Z&&typeof Z.length==="number")return{next:function(){if(Z&&X>=Z.length)Z=void 0;return{value:Z&&Z[X++],done:!Z}}};throw new TypeError(J?"Object is not iterable.":"Symbol.iterator is not defined.")}function LZ(Z,J){var Y=typeof Symbol==="function"&&Z[Symbol.iterator];if(!Y)return Z;var X=Y.call(Z),G,W=[],K;try{while((J===void 0||J-- >0)&&!(G=X.next()).done)W.push(G.value)}catch(H){K={error:H}}finally{try{if(G&&!G.done&&(Y=X.return))Y.call(X)}finally{if(K)throw K.error}}return W}function F5(){for(var Z=[],J=0;J<arguments.length;J++)Z=Z.concat(LZ(arguments[J]));return Z}function M5(){for(var Z=0,J=0,Y=arguments.length;J<Y;J++)Z+=arguments[J].length;for(var X=Array(Z),G=0,J=0;J<Y;J++)for(var W=arguments[J],K=0,H=W.length;K<H;K++,G++)X[G]=W[K];return X}function I5(Z,J,Y){if(Y||arguments.length===2){for(var X=0,G=J.length,W;X<G;X++)if(W||!(X in J)){if(!W)W=Array.prototype.slice.call(J,0,X);W[X]=J[X]}}return Z.concat(W||Array.prototype.slice.call(J))}function i9(Z){return this instanceof i9?(this.v=Z,this):new i9(Z)}function D5(Z,J,Y){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var X=Y.apply(Z,J||[]),G,W=[];return G=Object.create((typeof AsyncIterator==="function"?AsyncIterator:Object).prototype),H("next"),H("throw"),H("return",K),G[Symbol.asyncIterator]=function(){return this},G;function K(M){return function($){return Promise.resolve($).then(M,L)}}function H(M,$){if(X[M]){if(G[M]=function(U){return new Promise(function(B,D){W.push([M,U,B,D])>1||z(M,U)})},$)G[M]=$(G[M])}}function z(M,$){try{V(X[M]($))}catch(U){F(W[0][3],U)}}function V(M){M.value instanceof i9?Promise.resolve(M.value.v).then(Q,L):F(W[0][2],M)}function Q(M){z("next",M)}function L(M){z("throw",M)}function F(M,$){if(M($),W.shift(),W.length)z(W[0][0],W[0][1])}}function w5(Z){var J,Y;return J={},X("next"),X("throw",function(G){throw G}),X("return"),J[Symbol.iterator]=function(){return this},J;function X(G,W){J[G]=Z[G]?function(K){return(Y=!Y)?{value:i9(Z[G](K)),done:!1}:W?W(K):K}:W}}function N5(Z){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var J=Z[Symbol.asyncIterator],Y;return J?J.call(Z):(Z=typeof x6==="function"?x6(Z):Z[Symbol.iterator](),Y={},X("next"),X("throw"),X("return"),Y[Symbol.asyncIterator]=function(){return this},Y);function X(W){Y[W]=Z[W]&&function(K){return new Promise(function(H,z){K=Z[W](K),G(H,z,K.done,K.value)})}}function G(W,K,H,z){Promise.resolve(z).then(function(V){W({value:V,done:H})},K)}}function A5(Z,J){if(Object.defineProperty)Object.defineProperty(Z,"raw",{value:J});else Z.raw=J;return Z}function P5(Z){if(Z&&Z.__esModule)return Z;var J={};if(Z!=null){for(var Y=BZ(Z),X=0;X<Y.length;X++)if(Y[X]!=="default")k6(J,Z,Y[X])}return XH(J,Z),J}function R5(Z){return Z&&Z.__esModule?Z:{default:Z}}function O5(Z,J,Y,X){if(Y==="a"&&!X)throw new TypeError("Private accessor was defined without a getter");if(typeof J==="function"?Z!==J||!X:!J.has(Z))throw new TypeError("Cannot read private member from an object whose class did not declare it");return Y==="m"?X:Y==="a"?X.call(Z):X?X.value:J.get(Z)}function q5(Z,J,Y,X,G){if(X==="m")throw new TypeError("Private method is not writable");if(X==="a"&&!G)throw new TypeError("Private accessor was defined without a setter");if(typeof J==="function"?Z!==J||!G:!J.has(Z))throw new TypeError("Cannot write private member to an object whose class did not declare it");return X==="a"?G.call(Z,Y):G?G.value=Y:J.set(Z,Y),Y}function T5(Z,J){if(J===null||typeof J!=="object"&&typeof J!=="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof Z==="function"?J===Z:Z.has(J)}function E5(Z,J,Y){if(J!==null&&J!==void 0){if(typeof J!=="object"&&typeof J!=="function")throw new TypeError("Object expected.");var X,G;if(Y){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");X=J[Symbol.asyncDispose]}if(X===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");if(X=J[Symbol.dispose],Y)G=X}if(typeof X!=="function")throw new TypeError("Object not disposable.");if(G)X=function(){try{G.call(this)}catch(W){return Promise.reject(W)}};Z.stack.push({value:J,dispose:X,async:Y})}else if(Y)Z.stack.push({async:!0});return J}function _5(Z){function J(W){Z.error=Z.hasError?new GH(W,Z.error,"An error was suppressed during disposal."):W,Z.hasError=!0}var Y,X=0;function G(){while(Y=Z.stack.pop())try{if(!Y.async&&X===1)return X=0,Z.stack.push(Y),Promise.resolve().then(G);if(Y.dispose){var W=Y.dispose.call(Y.value);if(Y.async)return X|=2,Promise.resolve(W).then(G,function(K){return J(K),G()})}else X|=1}catch(K){J(K)}if(X===1)return Z.hasError?Promise.reject(Z.error):Promise.resolve();if(Z.hasError)throw Z.error}return G()}function S5(Z,J){if(typeof Z==="string"&&/^\.\.?\//.test(Z))return Z.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(Y,X,G,W,K){return X?J?".jsx":".js":G&&(!W||!K)?Y:G+W+"."+K.toLowerCase()+"js"});return Z}var UZ=function(Z,J){return UZ=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Y,X){Y.__proto__=X}||function(Y,X){for(var G in X)if(Object.prototype.hasOwnProperty.call(X,G))Y[G]=X[G]},UZ(Z,J)},C6=function(){return C6=Object.assign||function Z(J){for(var Y,X=1,G=arguments.length;X<G;X++){Y=arguments[X];for(var W in Y)if(Object.prototype.hasOwnProperty.call(Y,W))J[W]=Y[W]}return J},C6.apply(this,arguments)},k6,XH,BZ=function(Z){return BZ=Object.getOwnPropertyNames||function(J){var Y=[];for(var X in J)if(Object.prototype.hasOwnProperty.call(J,X))Y[Y.length]=X;return Y},BZ(Z)},GH,WH;var C5=n7(()=>{k6=Object.create?function(Z,J,Y,X){if(X===void 0)X=Y;var G=Object.getOwnPropertyDescriptor(J,Y);if(!G||("get"in G?!J.__esModule:G.writable||G.configurable))G={enumerable:!0,get:function(){return J[Y]}};Object.defineProperty(Z,X,G)}:function(Z,J,Y,X){if(X===void 0)X=Y;Z[X]=J[Y]};XH=Object.create?function(Z,J){Object.defineProperty(Z,"default",{enumerable:!0,value:J})}:function(Z,J){Z.default=J};GH=typeof SuppressedError==="function"?SuppressedError:function(Z,J,Y){var X=new Error(Y);return X.name="SuppressedError",X.error=Z,X.suppressed=J,X};WH={__extends:X5,__assign:C6,__rest:G5,__decorate:W5,__param:K5,__esDecorate:H5,__runInitializers:z5,__propKey:V5,__setFunctionName:Q5,__metadata:$5,__awaiter:U5,__generator:B5,__createBinding:k6,__exportStar:L5,__values:x6,__read:LZ,__spread:F5,__spreadArrays:M5,__spreadArray:I5,__await:i9,__asyncGenerator:D5,__asyncDelegator:w5,__asyncValues:N5,__makeTemplateObject:A5,__importStar:P5,__importDefault:R5,__classPrivateFieldGet:O5,__classPrivateFieldSet:q5,__classPrivateFieldIn:T5,__addDisposableResource:E5,__disposeResources:_5,__rewriteRelativeImportExtension:S5}});var M7=a((qM,F7)=>{/*! Axios v1.15.0 Copyright (c) 2026 Matt Zabriskie and contributors */function o5(Z,J){return function Y(){return Z.apply(J,arguments)}}var{toString:KH}=Object.prototype,{getPrototypeOf:OZ}=Object,{iterator:g6,toStringTag:s5}=Symbol,m6=((Z)=>(J)=>{let Y=KH.call(J);return Z[Y]||(Z[Y]=Y.slice(8,-1).toLowerCase())})(Object.create(null)),y0=(Z)=>{return Z=Z.toLowerCase(),(J)=>m6(J)===Z},d6=(Z)=>(J)=>typeof J===Z,{isArray:o9}=Array,n9=d6("undefined");function k1(Z){return Z!==null&&!n9(Z)&&Z.constructor!==null&&!n9(Z.constructor)&&w0(Z.constructor.isBuffer)&&Z.constructor.isBuffer(Z)}var a5=y0("ArrayBuffer");function HH(Z){let J;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView)J=ArrayBuffer.isView(Z);else J=Z&&Z.buffer&&a5(Z.buffer);return J}var zH=d6("string"),w0=d6("function"),r5=d6("number"),f1=(Z)=>Z!==null&&typeof Z==="object",VH=(Z)=>Z===!0||Z===!1,h6=(Z)=>{if(m6(Z)!=="object")return!1;let J=OZ(Z);return(J===null||J===Object.prototype||Object.getPrototypeOf(J)===null)&&!(s5 in Z)&&!(g6 in Z)},QH=(Z)=>{if(!f1(Z)||k1(Z))return!1;try{return Object.keys(Z).length===0&&Object.getPrototypeOf(Z)===Object.prototype}catch(J){return!1}},$H=y0("Date"),UH=y0("File"),BH=(Z)=>{return!!(Z&&typeof Z.uri!=="undefined")},LH=(Z)=>Z&&typeof Z.getParts!=="undefined",FH=y0("Blob"),MH=y0("FileList"),IH=(Z)=>f1(Z)&&w0(Z.pipe);function DH(){if(typeof globalThis!=="undefined")return globalThis;if(typeof self!=="undefined")return self;if(typeof window!=="undefined")return window;if(typeof global!=="undefined")return global;return{}}var x5=DH(),k5=typeof x5.FormData!=="undefined"?x5.FormData:void 0,wH=(Z)=>{let J;return Z&&(k5&&Z instanceof k5||w0(Z.append)&&((J=m6(Z))==="formdata"||J==="object"&&w0(Z.toString)&&Z.toString()==="[object FormData]"))},NH=y0("URLSearchParams"),[AH,PH,RH,OH]=["ReadableStream","Request","Response","Headers"].map(y0),qH=(Z)=>{return Z.trim?Z.trim():Z.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function h1(Z,J,{allOwnKeys:Y=!1}={}){if(Z===null||typeof Z==="undefined")return;let X,G;if(typeof Z!=="object")Z=[Z];if(o9(Z))for(X=0,G=Z.length;X<G;X++)J.call(null,Z[X],X,Z);else{if(k1(Z))return;let W=Y?Object.getOwnPropertyNames(Z):Object.keys(Z),K=W.length,H;for(X=0;X<K;X++)H=W[X],J.call(null,Z[H],H,Z)}}function t5(Z,J){if(k1(Z))return null;J=J.toLowerCase();let Y=Object.keys(Z),X=Y.length,G;while(X-- >0)if(G=Y[X],J===G.toLowerCase())return G;return null}var k9=(()=>{if(typeof globalThis!=="undefined")return globalThis;return typeof self!=="undefined"?self:typeof window!=="undefined"?window:global})(),e5=(Z)=>!n9(Z)&&Z!==k9;function wZ(){let{caseless:Z,skipUndefined:J}=e5(this)&&this||{},Y={},X=(G,W)=>{if(W==="__proto__"||W==="constructor"||W==="prototype")return;let K=Z&&t5(Y,W)||W;if(h6(Y[K])&&h6(G))Y[K]=wZ(Y[K],G);else if(h6(G))Y[K]=wZ({},G);else if(o9(G))Y[K]=G.slice();else if(!J||!n9(G))Y[K]=G};for(let G=0,W=arguments.length;G<W;G++)arguments[G]&&h1(arguments[G],X);return Y}var TH=(Z,J,Y,{allOwnKeys:X}={})=>{return h1(J,(G,W)=>{if(Y&&w0(G))Object.defineProperty(Z,W,{value:o5(G,Y),writable:!0,enumerable:!0,configurable:!0});else Object.defineProperty(Z,W,{value:G,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:X}),Z},EH=(Z)=>{if(Z.charCodeAt(0)===65279)Z=Z.slice(1);return Z},_H=(Z,J,Y,X)=>{Z.prototype=Object.create(J.prototype,X),Object.defineProperty(Z.prototype,"constructor",{value:Z,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(Z,"super",{value:J.prototype}),Y&&Object.assign(Z.prototype,Y)},SH=(Z,J,Y,X)=>{let G,W,K,H={};if(J=J||{},Z==null)return J;do{G=Object.getOwnPropertyNames(Z),W=G.length;while(W-- >0)if(K=G[W],(!X||X(K,Z,J))&&!H[K])J[K]=Z[K],H[K]=!0;Z=Y!==!1&&OZ(Z)}while(Z&&(!Y||Y(Z,J))&&Z!==Object.prototype);return J},jH=(Z,J,Y)=>{if(Z=String(Z),Y===void 0||Y>Z.length)Y=Z.length;Y-=J.length;let X=Z.indexOf(J,Y);return X!==-1&&X===Y},CH=(Z)=>{if(!Z)return null;if(o9(Z))return Z;let J=Z.length;if(!r5(J))return null;let Y=new Array(J);while(J-- >0)Y[J]=Z[J];return Y},xH=((Z)=>{return(J)=>{return Z&&J instanceof Z}})(typeof Uint8Array!=="undefined"&&OZ(Uint8Array)),kH=(Z,J)=>{let X=(Z&&Z[g6]).call(Z),G;while((G=X.next())&&!G.done){let W=G.value;J.call(Z,W[0],W[1])}},fH=(Z,J)=>{let Y,X=[];while((Y=Z.exec(J))!==null)X.push(Y);return X},hH=y0("HTMLFormElement"),yH=(Z)=>{return Z.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function J(Y,X,G){return X.toUpperCase()+G})},f5=(({hasOwnProperty:Z})=>(J,Y)=>Z.call(J,Y))(Object.prototype),vH=y0("RegExp"),Z7=(Z,J)=>{let Y=Object.getOwnPropertyDescriptors(Z),X={};h1(Y,(G,W)=>{let K;if((K=J(G,W,Z))!==!1)X[W]=K||G}),Object.defineProperties(Z,X)},bH=(Z)=>{Z7(Z,(J,Y)=>{if(w0(Z)&&["arguments","caller","callee"].indexOf(Y)!==-1)return!1;let X=Z[Y];if(!w0(X))return;if(J.enumerable=!1,"writable"in J){J.writable=!1;return}if(!J.set)J.set=()=>{throw Error("Can not rewrite read-only method '"+Y+"'")}})},gH=(Z,J)=>{let Y={},X=(G)=>{G.forEach((W)=>{Y[W]=!0})};return o9(Z)?X(Z):X(String(Z).split(J)),Y},mH=()=>{},dH=(Z,J)=>{return Z!=null&&Number.isFinite(Z=+Z)?Z:J};function pH(Z){return!!(Z&&w0(Z.append)&&Z[s5]==="FormData"&&Z[g6])}var uH=(Z)=>{let J=new Array(10),Y=(X,G)=>{if(f1(X)){if(J.indexOf(X)>=0)return;if(k1(X))return X;if(!("toJSON"in X)){J[G]=X;let W=o9(X)?[]:{};return h1(X,(K,H)=>{let z=Y(K,G+1);!n9(z)&&(W[H]=z)}),J[G]=void 0,W}}return X};return Y(Z,0)},cH=y0("AsyncFunction"),lH=(Z)=>Z&&(f1(Z)||w0(Z))&&w0(Z.then)&&w0(Z.catch),J7=((Z,J)=>{if(Z)return setImmediate;return J?((Y,X)=>{return k9.addEventListener("message",({source:G,data:W})=>{if(G===k9&&W===Y)X.length&&X.shift()()},!1),(G)=>{X.push(G),k9.postMessage(Y,"*")}})(`axios@${Math.random()}`,[]):(Y)=>setTimeout(Y)})(typeof setImmediate==="function",w0(k9.postMessage)),iH=typeof queueMicrotask!=="undefined"?queueMicrotask.bind(k9):typeof process!=="undefined"&&process.nextTick||J7,nH=(Z)=>Z!=null&&w0(Z[g6]),I={isArray:o9,isArrayBuffer:a5,isBuffer:k1,isFormData:wH,isArrayBufferView:HH,isString:zH,isNumber:r5,isBoolean:VH,isObject:f1,isPlainObject:h6,isEmptyObject:QH,isReadableStream:AH,isRequest:PH,isResponse:RH,isHeaders:OH,isUndefined:n9,isDate:$H,isFile:UH,isReactNativeBlob:BH,isReactNative:LH,isBlob:FH,isRegExp:vH,isFunction:w0,isStream:IH,isURLSearchParams:NH,isTypedArray:xH,isFileList:MH,forEach:h1,merge:wZ,extend:TH,trim:qH,stripBOM:EH,inherits:_H,toFlatObject:SH,kindOf:m6,kindOfTest:y0,endsWith:jH,toArray:CH,forEachEntry:kH,matchAll:fH,isHTMLForm:hH,hasOwnProperty:f5,hasOwnProp:f5,reduceDescriptors:Z7,freezeMethods:bH,toObjectSet:gH,toCamelCase:yH,noop:mH,toFiniteNumber:dH,findKey:t5,global:k9,isContextDefined:e5,isSpecCompliantForm:pH,toJSONObject:uH,isAsyncFn:cH,isThenable:lH,setImmediate:J7,asap:iH,isIterable:nH};class S extends Error{static from(Z,J,Y,X,G,W){let K=new S(Z.message,J||Z.code,Y,X,G);if(K.cause=Z,K.name=Z.name,Z.status!=null&&K.status==null)K.status=Z.status;return W&&Object.assign(K,W),K}constructor(Z,J,Y,X,G){super(Z);if(Object.defineProperty(this,"message",{value:Z,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,J&&(this.code=J),Y&&(this.config=Y),X&&(this.request=X),G)this.response=G,this.status=G.status}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:I.toJSONObject(this.config),code:this.code,status:this.status}}}S.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";S.ERR_BAD_OPTION="ERR_BAD_OPTION";S.ECONNABORTED="ECONNABORTED";S.ETIMEDOUT="ETIMEDOUT";S.ERR_NETWORK="ERR_NETWORK";S.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";S.ERR_DEPRECATED="ERR_DEPRECATED";S.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";S.ERR_BAD_REQUEST="ERR_BAD_REQUEST";S.ERR_CANCELED="ERR_CANCELED";S.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";S.ERR_INVALID_URL="ERR_INVALID_URL";var oH=null;function NZ(Z){return I.isPlainObject(Z)||I.isArray(Z)}function Y7(Z){return I.endsWith(Z,"[]")?Z.slice(0,-2):Z}function FZ(Z,J,Y){if(!Z)return J;return Z.concat(J).map(function X(G,W){return G=Y7(G),!Y&&W?"["+G+"]":G}).join(Y?".":"")}function sH(Z){return I.isArray(Z)&&!Z.some(NZ)}var aH=I.toFlatObject(I,{},null,function Z(J){return/^is[A-Z]/.test(J)});function p6(Z,J,Y){if(!I.isObject(Z))throw new TypeError("target must be an object");J=J||new FormData,Y=I.toFlatObject(Y,{metaTokens:!0,dots:!1,indexes:!1},!1,function $(U,B){return!I.isUndefined(B[U])});let X=Y.metaTokens,G=Y.visitor||Q,W=Y.dots,K=Y.indexes,z=(Y.Blob||typeof Blob!=="undefined"&&Blob)&&I.isSpecCompliantForm(J);if(!I.isFunction(G))throw new TypeError("visitor must be a function");function V($){if($===null)return"";if(I.isDate($))return $.toISOString();if(I.isBoolean($))return $.toString();if(!z&&I.isBlob($))throw new S("Blob is not supported. Use a Buffer instead.");if(I.isArrayBuffer($)||I.isTypedArray($))return z&&typeof Blob==="function"?new Blob([$]):Buffer.from($);return $}function Q($,U,B){let D=$;if(I.isReactNative(J)&&I.isReactNativeBlob($))return J.append(FZ(B,U,W),V($)),!1;if($&&!B&&typeof $==="object"){if(I.endsWith(U,"{}"))U=X?U:U.slice(0,-2),$=JSON.stringify($);else if(I.isArray($)&&sH($)||(I.isFileList($)||I.endsWith(U,"[]"))&&(D=I.toArray($)))return U=Y7(U),D.forEach(function N(w,P){!(I.isUndefined(w)||w===null)&&J.append(K===!0?FZ([U],P,W):K===null?U:U+"[]",V(w))}),!1}if(NZ($))return!0;return J.append(FZ(B,U,W),V($)),!1}let L=[],F=Object.assign(aH,{defaultVisitor:Q,convertValue:V,isVisitable:NZ});function M($,U){if(I.isUndefined($))return;if(L.indexOf($)!==-1)throw Error("Circular reference detected in "+U.join("."));L.push($),I.forEach($,function B(D,N){if((!(I.isUndefined(D)||D===null)&&G.call(J,D,I.isString(N)?N.trim():N,U,F))===!0)M(D,U?U.concat(N):[N])}),L.pop()}if(!I.isObject(Z))throw new TypeError("data must be an object");return M(Z),J}function h5(Z){let J={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\x00"};return encodeURIComponent(Z).replace(/[!'()~]|%20|%00/g,function Y(X){return J[X]})}function qZ(Z,J){this._pairs=[],Z&&p6(Z,this,J)}var X7=qZ.prototype;X7.append=function Z(J,Y){this._pairs.push([J,Y])};X7.toString=function Z(J){let Y=J?function(X){return J.call(this,X,h5)}:h5;return this._pairs.map(function X(G){return Y(G[0])+"="+Y(G[1])},"").join("&")};function rH(Z){return encodeURIComponent(Z).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function G7(Z,J,Y){if(!J)return Z;let X=Y&&Y.encode||rH,G=I.isFunction(Y)?{serialize:Y}:Y,W=G&&G.serialize,K;if(W)K=W(J,G);else K=I.isURLSearchParams(J)?J.toString():new qZ(J,G).toString(X);if(K){let H=Z.indexOf("#");if(H!==-1)Z=Z.slice(0,H);Z+=(Z.indexOf("?")===-1?"?":"&")+K}return Z}class AZ{constructor(){this.handlers=[]}use(Z,J,Y){return this.handlers.push({fulfilled:Z,rejected:J,synchronous:Y?Y.synchronous:!1,runWhen:Y?Y.runWhen:null}),this.handlers.length-1}eject(Z){if(this.handlers[Z])this.handlers[Z]=null}clear(){if(this.handlers)this.handlers=[]}forEach(Z){I.forEach(this.handlers,function J(Y){if(Y!==null)Z(Y)})}}var TZ={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},tH=typeof URLSearchParams!=="undefined"?URLSearchParams:qZ,eH=typeof FormData!=="undefined"?FormData:null,Zz=typeof Blob!=="undefined"?Blob:null,Jz={isBrowser:!0,classes:{URLSearchParams:tH,FormData:eH,Blob:Zz},protocols:["http","https","file","blob","url","data"]},EZ=typeof window!=="undefined"&&typeof document!=="undefined",PZ=typeof navigator==="object"&&navigator||void 0,Yz=EZ&&(!PZ||["ReactNative","NativeScript","NS"].indexOf(PZ.product)<0),Xz=(()=>{return typeof WorkerGlobalScope!=="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function"})(),Gz=EZ&&window.location.href||"http://localhost",Wz=Object.freeze({__proto__:null,hasBrowserEnv:EZ,hasStandardBrowserEnv:Yz,hasStandardBrowserWebWorkerEnv:Xz,navigator:PZ,origin:Gz}),W0={...Wz,...Jz};function Kz(Z,J){return p6(Z,new W0.classes.URLSearchParams,{visitor:function(Y,X,G,W){if(W0.isNode&&I.isBuffer(Y))return this.append(X,Y.toString("base64")),!1;return W.defaultVisitor.apply(this,arguments)},...J})}function Hz(Z){return I.matchAll(/\w+|\[(\w*)]/g,Z).map((J)=>{return J[0]==="[]"?"":J[1]||J[0]})}function zz(Z){let J={},Y=Object.keys(Z),X,G=Y.length,W;for(X=0;X<G;X++)W=Y[X],J[W]=Z[W];return J}function W7(Z){function J(Y,X,G,W){let K=Y[W++];if(K==="__proto__")return!0;let H=Number.isFinite(+K),z=W>=Y.length;if(K=!K&&I.isArray(G)?G.length:K,z){if(I.hasOwnProp(G,K))G[K]=[G[K],X];else G[K]=X;return!H}if(!G[K]||!I.isObject(G[K]))G[K]=[];if(J(Y,X,G[K],W)&&I.isArray(G[K]))G[K]=zz(G[K]);return!H}if(I.isFormData(Z)&&I.isFunction(Z.entries)){let Y={};return I.forEachEntry(Z,(X,G)=>{J(Hz(X),G,Y,0)}),Y}return null}function Vz(Z,J,Y){if(I.isString(Z))try{return(J||JSON.parse)(Z),I.trim(Z)}catch(X){if(X.name!=="SyntaxError")throw X}return(Y||JSON.stringify)(Z)}var y1={transitional:TZ,adapter:["xhr","http","fetch"],transformRequest:[function Z(J,Y){let X=Y.getContentType()||"",G=X.indexOf("application/json")>-1,W=I.isObject(J);if(W&&I.isHTMLForm(J))J=new FormData(J);if(I.isFormData(J))return G?JSON.stringify(W7(J)):J;if(I.isArrayBuffer(J)||I.isBuffer(J)||I.isStream(J)||I.isFile(J)||I.isBlob(J)||I.isReadableStream(J))return J;if(I.isArrayBufferView(J))return J.buffer;if(I.isURLSearchParams(J))return Y.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),J.toString();let H;if(W){if(X.indexOf("application/x-www-form-urlencoded")>-1)return Kz(J,this.formSerializer).toString();if((H=I.isFileList(J))||X.indexOf("multipart/form-data")>-1){let z=this.env&&this.env.FormData;return p6(H?{"files[]":J}:J,z&&new z,this.formSerializer)}}if(W||G)return Y.setContentType("application/json",!1),Vz(J);return J}],transformResponse:[function Z(J){let Y=this.transitional||y1.transitional,X=Y&&Y.forcedJSONParsing,G=this.responseType==="json";if(I.isResponse(J)||I.isReadableStream(J))return J;if(J&&I.isString(J)&&(X&&!this.responseType||G)){let K=!(Y&&Y.silentJSONParsing)&&G;try{return JSON.parse(J,this.parseReviver)}catch(H){if(K){if(H.name==="SyntaxError")throw S.from(H,S.ERR_BAD_RESPONSE,this,null,this.response);throw H}}}return J}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:W0.classes.FormData,Blob:W0.classes.Blob},validateStatus:function Z(J){return J>=200&&J<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};I.forEach(["delete","get","head","post","put","patch"],(Z)=>{y1.headers[Z]={}});var Qz=I.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),$z=(Z)=>{let J={},Y,X,G;return Z&&Z.split(`
5
- `).forEach(function W(K){if(G=K.indexOf(":"),Y=K.substring(0,G).trim().toLowerCase(),X=K.substring(G+1).trim(),!Y||J[Y]&&Qz[Y])return;if(Y==="set-cookie")if(J[Y])J[Y].push(X);else J[Y]=[X];else J[Y]=J[Y]?J[Y]+", "+X:X}),J},y5=Symbol("internals"),Uz=(Z)=>!/[\r\n]/.test(Z);function K7(Z,J){if(Z===!1||Z==null)return;if(I.isArray(Z)){Z.forEach((Y)=>K7(Y,J));return}if(!Uz(String(Z)))throw new Error(`Invalid character in header content ["${J}"]`)}function x1(Z){return Z&&String(Z).trim().toLowerCase()}function Bz(Z){let J=Z.length;while(J>0){let Y=Z.charCodeAt(J-1);if(Y!==10&&Y!==13)break;J-=1}return J===Z.length?Z:Z.slice(0,J)}function y6(Z){if(Z===!1||Z==null)return Z;return I.isArray(Z)?Z.map(y6):Bz(String(Z))}function Lz(Z){let J=Object.create(null),Y=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,X;while(X=Y.exec(Z))J[X[1]]=X[2];return J}var Fz=(Z)=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(Z.trim());function MZ(Z,J,Y,X,G){if(I.isFunction(X))return X.call(this,J,Y);if(G)J=Y;if(!I.isString(J))return;if(I.isString(X))return J.indexOf(X)!==-1;if(I.isRegExp(X))return X.test(J)}function Mz(Z){return Z.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(J,Y,X)=>{return Y.toUpperCase()+X})}function Iz(Z,J){let Y=I.toCamelCase(" "+J);["get","set","has"].forEach((X)=>{Object.defineProperty(Z,X+Y,{value:function(G,W,K){return this[X].call(this,J,G,W,K)},configurable:!0})})}class L0{constructor(Z){Z&&this.set(Z)}set(Z,J,Y){let X=this;function G(K,H,z){let V=x1(H);if(!V)throw new Error("header name must be a non-empty string");let Q=I.findKey(X,V);if(!Q||X[Q]===void 0||z===!0||z===void 0&&X[Q]!==!1)K7(K,H),X[Q||H]=y6(K)}let W=(K,H)=>I.forEach(K,(z,V)=>G(z,V,H));if(I.isPlainObject(Z)||Z instanceof this.constructor)W(Z,J);else if(I.isString(Z)&&(Z=Z.trim())&&!Fz(Z))W($z(Z),J);else if(I.isObject(Z)&&I.isIterable(Z)){let K={},H,z;for(let V of Z){if(!I.isArray(V))throw TypeError("Object iterator must return a key-value pair");K[z=V[0]]=(H=K[z])?I.isArray(H)?[...H,V[1]]:[H,V[1]]:V[1]}W(K,J)}else Z!=null&&G(J,Z,Y);return this}get(Z,J){if(Z=x1(Z),Z){let Y=I.findKey(this,Z);if(Y){let X=this[Y];if(!J)return X;if(J===!0)return Lz(X);if(I.isFunction(J))return J.call(this,X,Y);if(I.isRegExp(J))return J.exec(X);throw new TypeError("parser must be boolean|regexp|function")}}}has(Z,J){if(Z=x1(Z),Z){let Y=I.findKey(this,Z);return!!(Y&&this[Y]!==void 0&&(!J||MZ(this,this[Y],Y,J)))}return!1}delete(Z,J){let Y=this,X=!1;function G(W){if(W=x1(W),W){let K=I.findKey(Y,W);if(K&&(!J||MZ(Y,Y[K],K,J)))delete Y[K],X=!0}}if(I.isArray(Z))Z.forEach(G);else G(Z);return X}clear(Z){let J=Object.keys(this),Y=J.length,X=!1;while(Y--){let G=J[Y];if(!Z||MZ(this,this[G],G,Z,!0))delete this[G],X=!0}return X}normalize(Z){let J=this,Y={};return I.forEach(this,(X,G)=>{let W=I.findKey(Y,G);if(W){J[W]=y6(X),delete J[G];return}let K=Z?Mz(G):String(G).trim();if(K!==G)delete J[G];J[K]=y6(X),Y[K]=!0}),this}concat(...Z){return this.constructor.concat(this,...Z)}toJSON(Z){let J=Object.create(null);return I.forEach(this,(Y,X)=>{Y!=null&&Y!==!1&&(J[X]=Z&&I.isArray(Y)?Y.join(", "):Y)}),J}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([Z,J])=>Z+": "+J).join(`
6
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(Z){return Z instanceof this?Z:new this(Z)}static concat(Z,...J){let Y=new this(Z);return J.forEach((X)=>Y.set(X)),Y}static accessor(Z){let Y=(this[y5]=this[y5]={accessors:{}}).accessors,X=this.prototype;function G(W){let K=x1(W);if(!Y[K])Iz(X,W),Y[K]=!0}return I.isArray(Z)?Z.forEach(G):G(Z),this}}L0.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);I.reduceDescriptors(L0.prototype,({value:Z},J)=>{let Y=J[0].toUpperCase()+J.slice(1);return{get:()=>Z,set(X){this[Y]=X}}});I.freezeMethods(L0);function IZ(Z,J){let Y=this||y1,X=J||Y,G=L0.from(X.headers),W=X.data;return I.forEach(Z,function K(H){W=H.call(Y,W,G.normalize(),J?J.status:void 0)}),G.normalize(),W}function H7(Z){return!!(Z&&Z.__CANCEL__)}class s9 extends S{constructor(Z,J,Y){super(Z==null?"canceled":Z,S.ERR_CANCELED,J,Y);this.name="CanceledError",this.__CANCEL__=!0}}function z7(Z,J,Y){let X=Y.config.validateStatus;if(!Y.status||!X||X(Y.status))Z(Y);else J(new S("Request failed with status code "+Y.status,[S.ERR_BAD_REQUEST,S.ERR_BAD_RESPONSE][Math.floor(Y.status/100)-4],Y.config,Y.request,Y))}function Dz(Z){let J=/^([-+\w]{1,25})(:?\/\/|:)/.exec(Z);return J&&J[1]||""}function wz(Z,J){Z=Z||10;let Y=new Array(Z),X=new Array(Z),G=0,W=0,K;return J=J!==void 0?J:1000,function H(z){let V=Date.now(),Q=X[W];if(!K)K=V;Y[G]=z,X[G]=V;let L=W,F=0;while(L!==G)F+=Y[L++],L=L%Z;if(G=(G+1)%Z,G===W)W=(W+1)%Z;if(V-K<J)return;let M=Q&&V-Q;return M?Math.round(F*1000/M):void 0}}function Nz(Z,J){let Y=0,X=1000/J,G,W,K=(V,Q=Date.now())=>{if(Y=Q,G=null,W)clearTimeout(W),W=null;Z(...V)};return[(...V)=>{let Q=Date.now(),L=Q-Y;if(L>=X)K(V,Q);else if(G=V,!W)W=setTimeout(()=>{W=null,K(G)},X-L)},()=>G&&K(G)]}var b6=(Z,J,Y=3)=>{let X=0,G=wz(50,250);return Nz((W)=>{let K=W.loaded,H=W.lengthComputable?W.total:void 0,z=K-X,V=G(z),Q=K<=H;X=K;let L={loaded:K,total:H,progress:H?K/H:void 0,bytes:z,rate:V?V:void 0,estimated:V&&H&&Q?(H-K)/V:void 0,event:W,lengthComputable:H!=null,[J?"download":"upload"]:!0};Z(L)},Y)},v5=(Z,J)=>{let Y=Z!=null;return[(X)=>J[0]({lengthComputable:Y,total:Z,loaded:X}),J[1]]},b5=(Z)=>(...J)=>I.asap(()=>Z(...J)),Az=W0.hasStandardBrowserEnv?((Z,J)=>(Y)=>{return Y=new URL(Y,W0.origin),Z.protocol===Y.protocol&&Z.host===Y.host&&(J||Z.port===Y.port)})(new URL(W0.origin),W0.navigator&&/(msie|trident)/i.test(W0.navigator.userAgent)):()=>!0,Pz=W0.hasStandardBrowserEnv?{write(Z,J,Y,X,G,W,K){if(typeof document==="undefined")return;let H=[`${Z}=${encodeURIComponent(J)}`];if(I.isNumber(Y))H.push(`expires=${new Date(Y).toUTCString()}`);if(I.isString(X))H.push(`path=${X}`);if(I.isString(G))H.push(`domain=${G}`);if(W===!0)H.push("secure");if(I.isString(K))H.push(`SameSite=${K}`);document.cookie=H.join("; ")},read(Z){if(typeof document==="undefined")return null;let J=document.cookie.match(new RegExp("(?:^|; )"+Z+"=([^;]*)"));return J?decodeURIComponent(J[1]):null},remove(Z){this.write(Z,"",Date.now()-86400000,"/")}}:{write(){},read(){return null},remove(){}};function Rz(Z){if(typeof Z!=="string")return!1;return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(Z)}function Oz(Z,J){return J?Z.replace(/\/?\/$/,"")+"/"+J.replace(/^\/+/,""):Z}function V7(Z,J,Y){let X=!Rz(J);if(Z&&(X||Y==!1))return Oz(Z,J);return J}var g5=(Z)=>Z instanceof L0?{...Z}:Z;function f9(Z,J){J=J||{};let Y={};function X(V,Q,L,F){if(I.isPlainObject(V)&&I.isPlainObject(Q))return I.merge.call({caseless:F},V,Q);else if(I.isPlainObject(Q))return I.merge({},Q);else if(I.isArray(Q))return Q.slice();return Q}function G(V,Q,L,F){if(!I.isUndefined(Q))return X(V,Q,L,F);else if(!I.isUndefined(V))return X(void 0,V,L,F)}function W(V,Q){if(!I.isUndefined(Q))return X(void 0,Q)}function K(V,Q){if(!I.isUndefined(Q))return X(void 0,Q);else if(!I.isUndefined(V))return X(void 0,V)}function H(V,Q,L){if(L in J)return X(V,Q);else if(L in Z)return X(void 0,V)}let z={url:W,method:W,data:W,baseURL:K,transformRequest:K,transformResponse:K,paramsSerializer:K,timeout:K,timeoutMessage:K,withCredentials:K,withXSRFToken:K,adapter:K,responseType:K,xsrfCookieName:K,xsrfHeaderName:K,onUploadProgress:K,onDownloadProgress:K,decompress:K,maxContentLength:K,maxBodyLength:K,beforeRedirect:K,transport:K,httpAgent:K,httpsAgent:K,cancelToken:K,socketPath:K,responseEncoding:K,validateStatus:H,headers:(V,Q,L)=>G(g5(V),g5(Q),L,!0)};return I.forEach(Object.keys({...Z,...J}),function V(Q){if(Q==="__proto__"||Q==="constructor"||Q==="prototype")return;let L=I.hasOwnProp(z,Q)?z[Q]:G,F=L(Z[Q],J[Q],Q);I.isUndefined(F)&&L!==H||(Y[Q]=F)}),Y}var Q7=(Z)=>{let J=f9({},Z),{data:Y,withXSRFToken:X,xsrfHeaderName:G,xsrfCookieName:W,headers:K,auth:H}=J;if(J.headers=K=L0.from(K),J.url=G7(V7(J.baseURL,J.url,J.allowAbsoluteUrls),Z.params,Z.paramsSerializer),H)K.set("Authorization","Basic "+btoa((H.username||"")+":"+(H.password?unescape(encodeURIComponent(H.password)):"")));if(I.isFormData(Y)){if(W0.hasStandardBrowserEnv||W0.hasStandardBrowserWebWorkerEnv)K.setContentType(void 0);else if(I.isFunction(Y.getHeaders)){let z=Y.getHeaders(),V=["content-type","content-length"];Object.entries(z).forEach(([Q,L])=>{if(V.includes(Q.toLowerCase()))K.set(Q,L)})}}if(W0.hasStandardBrowserEnv){if(X&&I.isFunction(X)&&(X=X(J)),X||X!==!1&&Az(J.url)){let z=G&&W&&Pz.read(W);if(z)K.set(G,z)}}return J},qz=typeof XMLHttpRequest!=="undefined",Tz=qz&&function(Z){return new Promise(function J(Y,X){let G=Q7(Z),W=G.data,K=L0.from(G.headers).normalize(),{responseType:H,onUploadProgress:z,onDownloadProgress:V}=G,Q,L,F,M,$;function U(){M&&M(),$&&$(),G.cancelToken&&G.cancelToken.unsubscribe(Q),G.signal&&G.signal.removeEventListener("abort",Q)}let B=new XMLHttpRequest;B.open(G.method.toUpperCase(),G.url,!0),B.timeout=G.timeout;function D(){if(!B)return;let w=L0.from("getAllResponseHeaders"in B&&B.getAllResponseHeaders()),T={data:!H||H==="text"||H==="json"?B.responseText:B.response,status:B.status,statusText:B.statusText,headers:w,config:Z,request:B};z7(function k(q){Y(q),U()},function k(q){X(q),U()},T),B=null}if("onloadend"in B)B.onloadend=D;else B.onreadystatechange=function w(){if(!B||B.readyState!==4)return;if(B.status===0&&!(B.responseURL&&B.responseURL.indexOf("file:")===0))return;setTimeout(D)};if(B.onabort=function w(){if(!B)return;X(new S("Request aborted",S.ECONNABORTED,Z,B)),B=null},B.onerror=function w(P){let T=P&&P.message?P.message:"Network Error",k=new S(T,S.ERR_NETWORK,Z,B);k.event=P||null,X(k),B=null},B.ontimeout=function w(){let P=G.timeout?"timeout of "+G.timeout+"ms exceeded":"timeout exceeded",T=G.transitional||TZ;if(G.timeoutErrorMessage)P=G.timeoutErrorMessage;X(new S(P,T.clarifyTimeoutError?S.ETIMEDOUT:S.ECONNABORTED,Z,B)),B=null},W===void 0&&K.setContentType(null),"setRequestHeader"in B)I.forEach(K.toJSON(),function w(P,T){B.setRequestHeader(T,P)});if(!I.isUndefined(G.withCredentials))B.withCredentials=!!G.withCredentials;if(H&&H!=="json")B.responseType=G.responseType;if(V)[F,$]=b6(V,!0),B.addEventListener("progress",F);if(z&&B.upload)[L,M]=b6(z),B.upload.addEventListener("progress",L),B.upload.addEventListener("loadend",M);if(G.cancelToken||G.signal){if(Q=(w)=>{if(!B)return;X(!w||w.type?new s9(null,Z,B):w),B.abort(),B=null},G.cancelToken&&G.cancelToken.subscribe(Q),G.signal)G.signal.aborted?Q():G.signal.addEventListener("abort",Q)}let N=Dz(G.url);if(N&&W0.protocols.indexOf(N)===-1){X(new S("Unsupported protocol "+N+":",S.ERR_BAD_REQUEST,Z));return}B.send(W||null)})},Ez=(Z,J)=>{let{length:Y}=Z=Z?Z.filter(Boolean):[];if(J||Y){let X=new AbortController,G,W=function(V){if(!G){G=!0,H();let Q=V instanceof Error?V:this.reason;X.abort(Q instanceof S?Q:new s9(Q instanceof Error?Q.message:Q))}},K=J&&setTimeout(()=>{K=null,W(new S(`timeout of ${J}ms exceeded`,S.ETIMEDOUT))},J),H=()=>{if(Z)K&&clearTimeout(K),K=null,Z.forEach((V)=>{V.unsubscribe?V.unsubscribe(W):V.removeEventListener("abort",W)}),Z=null};Z.forEach((V)=>V.addEventListener("abort",W));let{signal:z}=X;return z.unsubscribe=()=>I.asap(H),z}},_z=function*(Z,J){let Y=Z.byteLength;if(Y<J){yield Z;return}let X=0,G;while(X<Y)G=X+J,yield Z.slice(X,G),X=G},Sz=async function*(Z,J){for await(let Y of jz(Z))yield*_z(Y,J)},jz=async function*(Z){if(Z[Symbol.asyncIterator]){yield*Z;return}let J=Z.getReader();try{for(;;){let{done:Y,value:X}=await J.read();if(Y)break;yield X}}finally{await J.cancel()}},m5=(Z,J,Y,X)=>{let G=Sz(Z,J),W=0,K,H=(z)=>{if(!K)K=!0,X&&X(z)};return new ReadableStream({async pull(z){try{let{done:V,value:Q}=await G.next();if(V){H(),z.close();return}let L=Q.byteLength;if(Y){let F=W+=L;Y(F)}z.enqueue(new Uint8Array(Q))}catch(V){throw H(V),V}},cancel(z){return H(z),G.return()}},{highWaterMark:2})},d5=65536,{isFunction:f6}=I,Cz=(({Request:Z,Response:J})=>({Request:Z,Response:J}))(I.global),{ReadableStream:p5,TextEncoder:u5}=I.global,c5=(Z,...J)=>{try{return!!Z(...J)}catch(Y){return!1}},xz=(Z)=>{Z=I.merge.call({skipUndefined:!0},Cz,Z);let{fetch:J,Request:Y,Response:X}=Z,G=J?f6(J):typeof fetch==="function",W=f6(Y),K=f6(X);if(!G)return!1;let H=G&&f6(p5),z=G&&(typeof u5==="function"?(($)=>(U)=>$.encode(U))(new u5):async($)=>new Uint8Array(await new Y($).arrayBuffer())),V=W&&H&&c5(()=>{let $=!1,U=new p5,B=new Y(W0.origin,{body:U,method:"POST",get duplex(){return $=!0,"half"}}).headers.has("Content-Type");return U.cancel(),$&&!B}),Q=K&&H&&c5(()=>I.isReadableStream(new X("").body)),L={stream:Q&&(($)=>$.body)};G&&(()=>{["text","arrayBuffer","blob","formData","stream"].forEach(($)=>{!L[$]&&(L[$]=(U,B)=>{let D=U&&U[$];if(D)return D.call(U);throw new S(`Response type '${$}' is not supported`,S.ERR_NOT_SUPPORT,B)})})})();let F=async($)=>{if($==null)return 0;if(I.isBlob($))return $.size;if(I.isSpecCompliantForm($))return(await new Y(W0.origin,{method:"POST",body:$}).arrayBuffer()).byteLength;if(I.isArrayBufferView($)||I.isArrayBuffer($))return $.byteLength;if(I.isURLSearchParams($))$=$+"";if(I.isString($))return(await z($)).byteLength},M=async($,U)=>{let B=I.toFiniteNumber($.getContentLength());return B==null?F(U):B};return async($)=>{let{url:U,method:B,data:D,signal:N,cancelToken:w,timeout:P,onDownloadProgress:T,onUploadProgress:k,responseType:q,headers:A,withCredentials:f="same-origin",fetchOptions:u}=Q7($),n=J||fetch;q=q?(q+"").toLowerCase():"text";let d=Ez([N,w&&w.toAbortSignal()],P),o=null,F0=d&&d.unsubscribe&&(()=>{d.unsubscribe()}),N0;try{if(k&&V&&B!=="get"&&B!=="head"&&(N0=await M(A,D))!==0){let E0=new Y(U,{method:"POST",body:D,duplex:"half"}),v0;if(I.isFormData(D)&&(v0=E0.headers.get("content-type")))A.setContentType(v0);if(E0.body){let[A9,n0]=v5(N0,b6(b5(k)));D=m5(E0.body,d5,A9,n0)}}if(!I.isString(f))f=f?"include":"omit";let h=W&&"credentials"in Y.prototype,K0={...u,signal:d,method:B.toUpperCase(),headers:A.normalize().toJSON(),body:D,duplex:"half",credentials:h?f:void 0};o=W&&new Y(U,K0);let e=await(W?n(o,u):n(U,K0)),N9=Q&&(q==="stream"||q==="response");if(Q&&(T||N9&&F0)){let E0={};["status","statusText","headers"].forEach((s)=>{E0[s]=e[s]});let v0=I.toFiniteNumber(e.headers.get("content-length")),[A9,n0]=T&&v5(v0,b6(b5(T),!0))||[];e=new X(m5(e.body,d5,A9,()=>{n0&&n0(),F0&&F0()}),E0)}q=q||"text";let _=await L[I.findKey(L,q)||"text"](e,$);return!N9&&F0&&F0(),await new Promise((E0,v0)=>{z7(E0,v0,{data:_,headers:L0.from(e.headers),status:e.status,statusText:e.statusText,config:$,request:o})})}catch(h){if(F0&&F0(),h&&h.name==="TypeError"&&/Load failed|fetch/i.test(h.message))throw Object.assign(new S("Network Error",S.ERR_NETWORK,$,o,h&&h.response),{cause:h.cause||h});throw S.from(h,h&&h.code,$,o,h&&h.response)}}},kz=new Map,$7=(Z)=>{let J=Z&&Z.env||{},{fetch:Y,Request:X,Response:G}=J,W=[X,G,Y],K=W.length,H=K,z,V,Q=kz;while(H--)z=W[H],V=Q.get(z),V===void 0&&Q.set(z,V=H?new Map:xz(J)),Q=V;return V};$7();var _Z={http:oH,xhr:Tz,fetch:{get:$7}};I.forEach(_Z,(Z,J)=>{if(Z){try{Object.defineProperty(Z,"name",{value:J})}catch(Y){}Object.defineProperty(Z,"adapterName",{value:J})}});var l5=(Z)=>`- ${Z}`,fz=(Z)=>I.isFunction(Z)||Z===null||Z===!1;function hz(Z,J){Z=I.isArray(Z)?Z:[Z];let{length:Y}=Z,X,G,W={};for(let K=0;K<Y;K++){X=Z[K];let H;if(G=X,!fz(X)){if(G=_Z[(H=String(X)).toLowerCase()],G===void 0)throw new S(`Unknown adapter '${H}'`)}if(G&&(I.isFunction(G)||(G=G.get(J))))break;W[H||"#"+K]=G}if(!G){let K=Object.entries(W).map(([z,V])=>`adapter ${z} `+(V===!1?"is not supported by the environment":"is not available in the build")),H=Y?K.length>1?`since :
7
- `+K.map(l5).join(`
8
- `):" "+l5(K[0]):"as no adapter specified";throw new S("There is no suitable adapter to dispatch the request "+H,"ERR_NOT_SUPPORT")}return G}var U7={getAdapter:hz,adapters:_Z};function DZ(Z){if(Z.cancelToken)Z.cancelToken.throwIfRequested();if(Z.signal&&Z.signal.aborted)throw new s9(null,Z)}function i5(Z){if(DZ(Z),Z.headers=L0.from(Z.headers),Z.data=IZ.call(Z,Z.transformRequest),["post","put","patch"].indexOf(Z.method)!==-1)Z.headers.setContentType("application/x-www-form-urlencoded",!1);return U7.getAdapter(Z.adapter||y1.adapter,Z)(Z).then(function Y(X){return DZ(Z),X.data=IZ.call(Z,Z.transformResponse,X),X.headers=L0.from(X.headers),X},function Y(X){if(!H7(X)){if(DZ(Z),X&&X.response)X.response.data=IZ.call(Z,Z.transformResponse,X.response),X.response.headers=L0.from(X.response.headers)}return Promise.reject(X)})}var B7="1.15.0",u6={};["object","boolean","number","function","string","symbol"].forEach((Z,J)=>{u6[Z]=function Y(X){return typeof X===Z||"a"+(J<1?"n ":" ")+Z}});var n5={};u6.transitional=function Z(J,Y,X){function G(W,K){return"[Axios v"+B7+"] Transitional option '"+W+"'"+K+(X?". "+X:"")}return(W,K,H)=>{if(J===!1)throw new S(G(K," has been removed"+(Y?" in "+Y:"")),S.ERR_DEPRECATED);if(Y&&!n5[K])n5[K]=!0,console.warn(G(K," has been deprecated since v"+Y+" and will be removed in the near future"));return J?J(W,K,H):!0}};u6.spelling=function Z(J){return(Y,X)=>{return console.warn(`${X} is likely a misspelling of ${J}`),!0}};function yz(Z,J,Y){if(typeof Z!=="object")throw new S("options must be an object",S.ERR_BAD_OPTION_VALUE);let X=Object.keys(Z),G=X.length;while(G-- >0){let W=X[G],K=J[W];if(K){let H=Z[W],z=H===void 0||K(H,W,Z);if(z!==!0)throw new S("option "+W+" must be "+z,S.ERR_BAD_OPTION_VALUE);continue}if(Y!==!0)throw new S("Unknown option "+W,S.ERR_BAD_OPTION)}}var v6={assertOptions:yz,validators:u6},C0=v6.validators;class M9{constructor(Z){this.defaults=Z||{},this.interceptors={request:new AZ,response:new AZ}}async request(Z,J){try{return await this._request(Z,J)}catch(Y){if(Y instanceof Error){let X={};Error.captureStackTrace?Error.captureStackTrace(X):X=new Error;let G=(()=>{if(!X.stack)return"";let W=X.stack.indexOf(`
9
- `);return W===-1?"":X.stack.slice(W+1)})();try{if(!Y.stack)Y.stack=G;else if(G){let W=G.indexOf(`
10
- `),K=W===-1?-1:G.indexOf(`
11
- `,W+1),H=K===-1?"":G.slice(K+1);if(!String(Y.stack).endsWith(H))Y.stack+=`
12
- `+G}}catch(W){}}throw Y}}_request(Z,J){if(typeof Z==="string")J=J||{},J.url=Z;else J=Z||{};J=f9(this.defaults,J);let{transitional:Y,paramsSerializer:X,headers:G}=J;if(Y!==void 0)v6.assertOptions(Y,{silentJSONParsing:C0.transitional(C0.boolean),forcedJSONParsing:C0.transitional(C0.boolean),clarifyTimeoutError:C0.transitional(C0.boolean),legacyInterceptorReqResOrdering:C0.transitional(C0.boolean)},!1);if(X!=null)if(I.isFunction(X))J.paramsSerializer={serialize:X};else v6.assertOptions(X,{encode:C0.function,serialize:C0.function},!0);if(J.allowAbsoluteUrls!==void 0);else if(this.defaults.allowAbsoluteUrls!==void 0)J.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls;else J.allowAbsoluteUrls=!0;v6.assertOptions(J,{baseUrl:C0.spelling("baseURL"),withXsrfToken:C0.spelling("withXSRFToken")},!0),J.method=(J.method||this.defaults.method||"get").toLowerCase();let W=G&&I.merge(G.common,G[J.method]);G&&I.forEach(["delete","get","head","post","put","patch","common"],(M)=>{delete G[M]}),J.headers=L0.concat(W,G);let K=[],H=!0;this.interceptors.request.forEach(function M($){if(typeof $.runWhen==="function"&&$.runWhen(J)===!1)return;H=H&&$.synchronous;let U=J.transitional||TZ;if(U&&U.legacyInterceptorReqResOrdering)K.unshift($.fulfilled,$.rejected);else K.push($.fulfilled,$.rejected)});let z=[];this.interceptors.response.forEach(function M($){z.push($.fulfilled,$.rejected)});let V,Q=0,L;if(!H){let M=[i5.bind(this),void 0];M.unshift(...K),M.push(...z),L=M.length,V=Promise.resolve(J);while(Q<L)V=V.then(M[Q++],M[Q++]);return V}L=K.length;let F=J;while(Q<L){let M=K[Q++],$=K[Q++];try{F=M(F)}catch(U){$.call(this,U);break}}try{V=i5.call(this,F)}catch(M){return Promise.reject(M)}Q=0,L=z.length;while(Q<L)V=V.then(z[Q++],z[Q++]);return V}getUri(Z){Z=f9(this.defaults,Z);let J=V7(Z.baseURL,Z.url,Z.allowAbsoluteUrls);return G7(J,Z.params,Z.paramsSerializer)}}I.forEach(["delete","get","head","options"],function Z(J){M9.prototype[J]=function(Y,X){return this.request(f9(X||{},{method:J,url:Y,data:(X||{}).data}))}});I.forEach(["post","put","patch"],function Z(J){function Y(X){return function G(W,K,H){return this.request(f9(H||{},{method:J,headers:X?{"Content-Type":"multipart/form-data"}:{},url:W,data:K}))}}M9.prototype[J]=Y(),M9.prototype[J+"Form"]=Y(!0)});class SZ{constructor(Z){if(typeof Z!=="function")throw new TypeError("executor must be a function.");let J;this.promise=new Promise(function X(G){J=G});let Y=this;this.promise.then((X)=>{if(!Y._listeners)return;let G=Y._listeners.length;while(G-- >0)Y._listeners[G](X);Y._listeners=null}),this.promise.then=(X)=>{let G,W=new Promise((K)=>{Y.subscribe(K),G=K}).then(X);return W.cancel=function K(){Y.unsubscribe(G)},W},Z(function X(G,W,K){if(Y.reason)return;Y.reason=new s9(G,W,K),J(Y.reason)})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(Z){if(this.reason){Z(this.reason);return}if(this._listeners)this._listeners.push(Z);else this._listeners=[Z]}unsubscribe(Z){if(!this._listeners)return;let J=this._listeners.indexOf(Z);if(J!==-1)this._listeners.splice(J,1)}toAbortSignal(){let Z=new AbortController,J=(Y)=>{Z.abort(Y)};return this.subscribe(J),Z.signal.unsubscribe=()=>this.unsubscribe(J),Z.signal}static source(){let Z;return{token:new SZ(function Y(X){Z=X}),cancel:Z}}}function vz(Z){return function J(Y){return Z.apply(null,Y)}}function bz(Z){return I.isObject(Z)&&Z.isAxiosError===!0}var RZ={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(RZ).forEach(([Z,J])=>{RZ[J]=Z});function L7(Z){let J=new M9(Z),Y=o5(M9.prototype.request,J);return I.extend(Y,M9.prototype,J,{allOwnKeys:!0}),I.extend(Y,J,null,{allOwnKeys:!0}),Y.create=function X(G){return L7(f9(Z,G))},Y}var i=L7(y1);i.Axios=M9;i.CanceledError=s9;i.CancelToken=SZ;i.isCancel=H7;i.VERSION=B7;i.toFormData=p6;i.AxiosError=S;i.Cancel=i.CanceledError;i.all=function Z(J){return Promise.all(J)};i.spread=vz;i.isAxiosError=bz;i.mergeConfig=f9;i.AxiosHeaders=L0;i.formToJSON=(Z)=>W7(I.isHTMLForm(Z)?new FormData(Z):Z);i.getAdapter=U7.getAdapter;i.HttpStatusCode=RZ;i.default=i;F7.exports=i});var c6=a((D7)=>{Object.defineProperty(D7,"__esModule",{value:!0});D7.addAxiosDateTransformer=D7.createAxiosDateTransformer=void 0;var gz=(C5(),i7(j5)),mz=gz.__importDefault(M7()),dz=/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(?:\.\d*)?(?:[-+]\d{2}:?\d{2}|Z)?)?$/,pz=(Z)=>{return dz.test(Z)},uz=(Z,J)=>{return!J||J.length===0||J.includes(Z)},cz=(Z,J,Y)=>{return typeof J==="string"&&pz(J)&&uz(Z,Y)},I7=(Z,J)=>{if(typeof Z==="object"){for(let Y in Z)if(cz(Y,Z[Y],J))Z[Y]=new Date(Z[Y]);else if(typeof Z[Y]==="object")Z[Y]=I7(Z[Y],J)}return Z},lz=(Z,J)=>{if(Z.data)Z.data=I7(Z.data,J);return Z},iz=(Z={})=>{return D7.addAxiosDateTransformer(mz.default.create(Z),Z)};D7.createAxiosDateTransformer=iz;var nz=(Z,J)=>{let Y=J===null||J===void 0?void 0:J.allowlist;return Z.interceptors.response.use((X)=>lz(X,Y)),Z};D7.addAxiosDateTransformer=nz});import{useContext as B8,useEffect as Y6,useRef as dX}from"react";import{createContext as o7,useContext as s7}from"react";var o0=o7(null),v9=()=>{let Z=s7(o0);if(!Z)throw new Error("usePieConfig must be used within PieConfigProvider");return Z},s0=()=>{let{apiServer:Z}=v9();return Z},p1=s0,G9=()=>{let{centrifugeServer:Z}=v9();return Z};var A0=()=>{let{enableRenderingLog:Z}=v9();return Z},mZ=A0,dZ=()=>{let{pageProcessor:Z}=v9();return Z};var o6="__piedemo__";import{createContext as UX}from"react";function X0(Z,J,Y,X){function G(W){return W instanceof Y?W:new Y(function(K){K(W)})}return new(Y||(Y=Promise))(function(W,K){function H(Q){try{V(X.next(Q))}catch(L){K(L)}}function z(Q){try{V(X.throw(Q))}catch(L){K(L)}}function V(Q){Q.done?W(Q.value):G(Q.value).then(H,z)}V((X=X.apply(Z,J||[])).next())})}function a7(Z){return Z&&Z.__esModule&&Object.prototype.hasOwnProperty.call(Z,"default")?Z.default:Z}var t6={exports:{}},b9=typeof Reflect==="object"?Reflect:null,pZ=b9&&typeof b9.apply==="function"?b9.apply:function Z(J,Y,X){return Function.prototype.apply.call(J,Y,X)},u1;if(b9&&typeof b9.ownKeys==="function")u1=b9.ownKeys;else if(Object.getOwnPropertySymbols)u1=function Z(J){return Object.getOwnPropertyNames(J).concat(Object.getOwnPropertySymbols(J))};else u1=function Z(J){return Object.getOwnPropertyNames(J)};function r7(Z){if(console&&console.warn)console.warn(Z)}var cZ=Number.isNaN||function Z(J){return J!==J};function v(){v.init.call(this)}t6.exports=v;t6.exports.once=JX;v.EventEmitter=v;v.prototype._events=void 0;v.prototype._eventsCount=0;v.prototype._maxListeners=void 0;var uZ=10;function o1(Z){if(typeof Z!=="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof Z)}Object.defineProperty(v,"defaultMaxListeners",{enumerable:!0,get:function(){return uZ},set:function(Z){if(typeof Z!=="number"||Z<0||cZ(Z))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+Z+".");uZ=Z}});v.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};v.prototype.setMaxListeners=function Z(J){if(typeof J!=="number"||J<0||cZ(J))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+J+".");return this._maxListeners=J,this};function lZ(Z){if(Z._maxListeners===void 0)return v.defaultMaxListeners;return Z._maxListeners}v.prototype.getMaxListeners=function Z(){return lZ(this)};v.prototype.emit=function Z(J){var Y=[];for(var X=1;X<arguments.length;X++)Y.push(arguments[X]);var G=J==="error",W=this._events;if(W!==void 0)G=G&&W.error===void 0;else if(!G)return!1;if(G){var K;if(Y.length>0)K=Y[0];if(K instanceof Error)throw K;var H=new Error("Unhandled error."+(K?" ("+K.message+")":""));throw H.context=K,H}var z=W[J];if(z===void 0)return!1;if(typeof z==="function")pZ(z,this,Y);else{var V=z.length,Q=aZ(z,V);for(var X=0;X<V;++X)pZ(Q[X],this,Y)}return!0};function iZ(Z,J,Y,X){var G,W,K;if(o1(Y),W=Z._events,W===void 0)W=Z._events=Object.create(null),Z._eventsCount=0;else{if(W.newListener!==void 0)Z.emit("newListener",J,Y.listener?Y.listener:Y),W=Z._events;K=W[J]}if(K===void 0)K=W[J]=Y,++Z._eventsCount;else{if(typeof K==="function")K=W[J]=X?[Y,K]:[K,Y];else if(X)K.unshift(Y);else K.push(Y);if(G=lZ(Z),G>0&&K.length>G&&!K.warned){K.warned=!0;var H=new Error("Possible EventEmitter memory leak detected. "+K.length+" "+String(J)+" listeners added. Use emitter.setMaxListeners() to increase limit");H.name="MaxListenersExceededWarning",H.emitter=Z,H.type=J,H.count=K.length,r7(H)}}return Z}v.prototype.addListener=function Z(J,Y){return iZ(this,J,Y,!1)};v.prototype.on=v.prototype.addListener;v.prototype.prependListener=function Z(J,Y){return iZ(this,J,Y,!0)};function t7(){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 nZ(Z,J,Y){var X={fired:!1,wrapFn:void 0,target:Z,type:J,listener:Y},G=t7.bind(X);return G.listener=Y,X.wrapFn=G,G}v.prototype.once=function Z(J,Y){return o1(Y),this.on(J,nZ(this,J,Y)),this};v.prototype.prependOnceListener=function Z(J,Y){return o1(Y),this.prependListener(J,nZ(this,J,Y)),this};v.prototype.removeListener=function Z(J,Y){var X,G,W,K,H;if(o1(Y),G=this._events,G===void 0)return this;if(X=G[J],X===void 0)return this;if(X===Y||X.listener===Y){if(--this._eventsCount===0)this._events=Object.create(null);else if(delete G[J],G.removeListener)this.emit("removeListener",J,X.listener||Y)}else if(typeof X!=="function"){W=-1;for(K=X.length-1;K>=0;K--)if(X[K]===Y||X[K].listener===Y){H=X[K].listener,W=K;break}if(W<0)return this;if(W===0)X.shift();else e7(X,W);if(X.length===1)G[J]=X[0];if(G.removeListener!==void 0)this.emit("removeListener",J,H||Y)}return this};v.prototype.off=v.prototype.removeListener;v.prototype.removeAllListeners=function Z(J){var Y,X,G;if(X=this._events,X===void 0)return this;if(X.removeListener===void 0){if(arguments.length===0)this._events=Object.create(null),this._eventsCount=0;else if(X[J]!==void 0)if(--this._eventsCount===0)this._events=Object.create(null);else delete X[J];return this}if(arguments.length===0){var W=Object.keys(X),K;for(G=0;G<W.length;++G){if(K=W[G],K==="removeListener")continue;this.removeAllListeners(K)}return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(Y=X[J],typeof Y==="function")this.removeListener(J,Y);else if(Y!==void 0)for(G=Y.length-1;G>=0;G--)this.removeListener(J,Y[G]);return this};function oZ(Z,J,Y){var X=Z._events;if(X===void 0)return[];var G=X[J];if(G===void 0)return[];if(typeof G==="function")return Y?[G.listener||G]:[G];return Y?ZX(G):aZ(G,G.length)}v.prototype.listeners=function Z(J){return oZ(this,J,!0)};v.prototype.rawListeners=function Z(J){return oZ(this,J,!1)};v.listenerCount=function(Z,J){if(typeof Z.listenerCount==="function")return Z.listenerCount(J);else return sZ.call(Z,J)};v.prototype.listenerCount=sZ;function sZ(Z){var J=this._events;if(J!==void 0){var Y=J[Z];if(typeof Y==="function")return 1;else if(Y!==void 0)return Y.length}return 0}v.prototype.eventNames=function Z(){return this._eventsCount>0?u1(this._events):[]};function aZ(Z,J){var Y=new Array(J);for(var X=0;X<J;++X)Y[X]=Z[X];return Y}function e7(Z,J){for(;J+1<Z.length;J++)Z[J]=Z[J+1];Z.pop()}function ZX(Z){var J=new Array(Z.length);for(var Y=0;Y<J.length;++Y)J[Y]=Z[Y].listener||Z[Y];return J}function JX(Z,J){return new Promise(function(Y,X){function G(K){Z.removeListener(J,W),X(K)}function W(){if(typeof Z.removeListener==="function")Z.removeListener("error",G);Y([].slice.call(arguments))}if(rZ(Z,J,W,{once:!0}),J!=="error")YX(Z,G,{once:!0})})}function YX(Z,J,Y){if(typeof Z.on==="function")rZ(Z,"error",J,Y)}function rZ(Z,J,Y,X){if(typeof Z.on==="function")if(X.once)Z.once(J,Y);else Z.on(J,Y);else if(typeof Z.addEventListener==="function")Z.addEventListener(J,function G(W){if(X.once)Z.removeEventListener(J,G);Y(W)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof Z)}var XX=t6.exports,tZ=a7(XX),g;(function(Z){Z[Z.timeout=1]="timeout",Z[Z.transportClosed=2]="transportClosed",Z[Z.clientDisconnected=3]="clientDisconnected",Z[Z.clientClosed=4]="clientClosed",Z[Z.clientConnectToken=5]="clientConnectToken",Z[Z.clientRefreshToken=6]="clientRefreshToken",Z[Z.subscriptionUnsubscribed=7]="subscriptionUnsubscribed",Z[Z.subscriptionSubscribeToken=8]="subscriptionSubscribeToken",Z[Z.subscriptionRefreshToken=9]="subscriptionRefreshToken",Z[Z.transportWriteError=10]="transportWriteError",Z[Z.connectionClosed=11]="connectionClosed",Z[Z.badConfiguration=12]="badConfiguration"})(g||(g={}));var W9;(function(Z){Z[Z.connectCalled=0]="connectCalled",Z[Z.transportClosed=1]="transportClosed",Z[Z.noPing=2]="noPing",Z[Z.subscribeTimeout=3]="subscribeTimeout",Z[Z.unsubscribeError=4]="unsubscribeError"})(W9||(W9={}));var Z1;(function(Z){Z[Z.disconnectCalled=0]="disconnectCalled",Z[Z.unauthorized=1]="unauthorized",Z[Z.badProtocol=2]="badProtocol",Z[Z.messageSizeLimit=3]="messageSizeLimit"})(Z1||(Z1={}));var c1;(function(Z){Z[Z.subscribeCalled=0]="subscribeCalled",Z[Z.transportClosed=1]="transportClosed"})(c1||(c1={}));var l1;(function(Z){Z[Z.unsubscribeCalled=0]="unsubscribeCalled",Z[Z.unauthorized=1]="unauthorized",Z[Z.clientClosed=2]="clientClosed"})(l1||(l1={}));var s6;(function(Z){Z[Z.channelCompaction=1]="channelCompaction"})(s6||(s6={}));var c;(function(Z){Z.Disconnected="disconnected",Z.Connecting="connecting",Z.Connected="connected"})(c||(c={}));var H0;(function(Z){Z.Unsubscribed="unsubscribed",Z.Subscribing="subscribing",Z.Subscribed="subscribed"})(H0||(H0={}));function GX(Z,J){return Z.lastIndexOf(J,0)===0}function eZ(Z){if(Z===void 0||Z===null)return!1;return typeof Z==="function"}function WX(Z,J){if(globalThis.console){let Y=globalThis.console[Z];if(eZ(Y))Y.apply(globalThis.console,J)}}function KX(Z,J){return Math.floor(Math.random()*(J-Z+1)+Z)}function i1(Z,J,Y){if(Z>31)Z=31;let X=KX(0,Math.min(Y,J*Math.pow(2,Z)));return Math.min(Y,J+X)}function HX(Z){return"error"in Z&&Z.error!==null}function n1(Z){return Math.min(Z*1000,2147483647)}class Z4 extends tZ{constructor(Z,J,Y){super();if(this._resubscribeTimeout=null,this._refreshTimeout=null,this.channel=J,this.state=H0.Unsubscribed,this._centrifuge=Z,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(Y),this._centrifuge._debugEnabled)this.on("state",(X)=>{this._debug("subscription state",J,X.oldState,"->",X.newState)}),this.on("error",(X)=>{this._debug("subscription error",J,X)});else this.on("error",function(){Function.prototype()})}ready(Z){if(this.state===H0.Unsubscribed)return Promise.reject({code:g.subscriptionUnsubscribed,message:this.state});if(this.state===H0.Subscribed)return Promise.resolve();return new Promise((J,Y)=>{let X={resolve:J,reject:Y};if(Z)X.timeout=setTimeout(function(){Y({code:g.timeout,message:"timeout"})},Z);this._promises[this._nextPromiseId()]=X})}subscribe(){if(this._isSubscribed())return;this._resubscribeAttempts=0,this._setSubscribing(c1.subscribeCalled,"subscribe called")}unsubscribe(){this._unsubPromise=this._setUnsubscribed(l1.unsubscribeCalled,"unsubscribe called",!0)}publish(Z){return X0(this,void 0,void 0,function*(){return yield this._methodCall(),this._centrifuge.publish(this.channel,Z)})}presence(){return X0(this,void 0,void 0,function*(){return yield this._methodCall(),this._centrifuge.presence(this.channel)})}presenceStats(){return X0(this,void 0,void 0,function*(){return yield this._methodCall(),this._centrifuge.presenceStats(this.channel)})}history(Z){return X0(this,void 0,void 0,function*(){return yield this._methodCall(),this._centrifuge.history(this.channel,Z)})}setTagsFilter(Z){if(Z&&this._delta)throw new Error("cannot use delta and tagsFilter together");this._tagsFilter=Z}setData(Z){this._data=Z}_methodCall(){if(this._isSubscribed())return Promise.resolve();if(this._isUnsubscribed())return Promise.reject({code:g.subscriptionUnsubscribed,message:this.state});return new Promise((Z,J)=>{let Y=this._centrifuge._config.timeout,X=setTimeout(()=>{J({code:g.timeout,message:"timeout"})},Y);this._promises[this._nextPromiseId()]={timeout:X,resolve:Z,reject:J}})}_nextPromiseId(){return++this._promiseId}_needRecover(){return this._recover===!0}_isUnsubscribed(){return this.state===H0.Unsubscribed}_isSubscribing(){return this.state===H0.Subscribing}_isSubscribed(){return this.state===H0.Subscribed}_setState(Z){if(this.state!==Z){let J=this.state;return this.state=Z,this.emit("state",{newState:Z,oldState:J,channel:this.channel}),!0}return!1}_usesToken(){return this._token!==""||this._getToken!==null}_clearSubscribingState(){this._resubscribeAttempts=0,this._clearResubscribeTimeout()}_clearSubscribedState(){this._clearRefreshTimeout()}_setSubscribed(Z){if(!this._isSubscribing())return;if(this._clearSubscribingState(),Z.id)this._id=Z.id;if(Z.recoverable)this._recover=!0,this._offset=Z.offset||0,this._epoch=Z.epoch||"";if(Z.delta)this._delta_negotiated=!0;else this._delta_negotiated=!1;this._setState(H0.Subscribed);let J=this._centrifuge._getSubscribeContext(this.channel,Z);this.emit("subscribed",J),this._resolvePromises();let Y=Z.publications;if(Y&&Y.length>0)for(let X in Y){if(!Y.hasOwnProperty(X))continue;this._handlePublication(Y[X])}if(Z.expires===!0)this._refreshTimeout=setTimeout(()=>this._refresh(),n1(Z.ttl))}_setSubscribing(Z,J){return X0(this,void 0,void 0,function*(){if(this._isSubscribing())return;if(this._isSubscribed())this._clearSubscribedState();if(this._setState(H0.Subscribing))this.emit("subscribing",{channel:this.channel,code:Z,reason:J});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((Z)=>this._handleTokenResponse(Z)).catch((Z)=>this._handleTokenError(Z)),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(Z){if(!this._getData){this._inflight=!1;return}this._getData({channel:this.channel}).then((J)=>{if(!this._isSubscribing()){this._inflight=!1;return}this._data=J,this._sendSubscribe(Z)}).catch((J)=>this._handleGetDataError(J))}_handleGetDataError(Z){if(!this._isSubscribing()){this._inflight=!1;return}if(Z instanceof g0){this._inflight=!1,this._failUnauthorized();return}this.emit("error",{type:"subscribeData",channel:this.channel,error:{code:g.badConfiguration,message:(Z===null||Z===void 0?void 0:Z.toString())||""}}),this._inflight=!1,this._scheduleResubscribe()}_handleTokenResponse(Z){if(!this._isSubscribing()){this._inflight=!1;return}if(!Z){this._inflight=!1,this._failUnauthorized();return}if(this._token=Z,this._getData)this._getDataAndSubscribe(Z);else this._sendSubscribe(Z)}_handleTokenError(Z){if(!this._isSubscribing()){this._inflight=!1;return}if(Z instanceof g0){this._inflight=!1,this._failUnauthorized();return}this.emit("error",{type:"subscribeToken",channel:this.channel,error:{code:g.subscriptionSubscribeToken,message:(Z===null||Z===void 0?void 0:Z.toString())||""}}),this._inflight=!1,this._scheduleResubscribe()}_sendSubscribe(Z){if(!this._isTransportOpen())return this._inflight=!1,null;let J=this._buildSubscribeCommand(Z);return this._centrifuge._call(J).then((Y)=>{this._inflight=!1;let X=Y.reply.subscribe;if(this._handleSubscribeResponse(X),Y.next)Y.next()},(Y)=>{if(this._inflight=!1,this._handleSubscribeError(Y.error),Y.next)Y.next()}),J}_buildSubscribeCommand(Z){let J={channel:this.channel};if(Z)J.token=Z;if(this._data)J.data=this._data;if(this._positioned)J.positioned=!0;if(this._recoverable)J.recoverable=!0;if(this._joinLeave)J.join_leave=!0;if(J.flag=s6.channelCompaction,this._needRecover()){J.recover=!0;let Y=this._getOffset();if(Y)J.offset=Y;let X=this._getEpoch();if(X)J.epoch=X}if(this._delta)J.delta=this._delta;if(this._tagsFilter)J.tf=this._tagsFilter;return{subscribe:J}}_debug(...Z){this._centrifuge._debug(...Z)}_handleSubscribeError(Z){if(!this._isSubscribing())return;if(Z.code===g.timeout){this._centrifuge._disconnect(W9.subscribeTimeout,"subscribe timeout",!0);return}this._subscribeError(Z)}_handleSubscribeResponse(Z){if(!this._isSubscribing())return;this._setSubscribed(Z)}_setUnsubscribed(Z,J,Y){if(this._isUnsubscribed())return Promise.resolve();let X=Promise.resolve();if(this._isSubscribed()){if(Y)X=this._centrifuge._unsubscribe(this);this._clearSubscribedState()}else if(this._isSubscribing()){if(this._inflight&&Y)X=this._centrifuge._unsubscribe(this);this._clearSubscribingState()}if(this._inflight=!1,this._setState(H0.Unsubscribed))this.emit("unsubscribed",{channel:this.channel,code:Z,reason:J});return this._rejectPromises({code:g.subscriptionUnsubscribed,message:this.state}),X}_handlePublication(Z){if(this._delta&&this._delta_negotiated){let{newData:Y,newPrevValue:X}=this._centrifuge._codec.applyDeltaIfNeeded(Z,this._prevValue);Z.data=Y,this._prevValue=X}let J=this._centrifuge._getPublicationContext(this.channel,Z);if(this.emit("publication",J),Z.offset)this._offset=Z.offset}_handleJoin(Z){let J=this._centrifuge._getJoinLeaveContext(Z.info);this.emit("join",{channel:this.channel,info:J})}_handleLeave(Z){let J=this._centrifuge._getJoinLeaveContext(Z.info);this.emit("leave",{channel:this.channel,info:J})}_resolvePromises(){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].resolve(),delete this._promises[Z]}}_rejectPromises(Z){for(let J in this._promises){if(!this._promises.hasOwnProperty(J))continue;if(this._promises[J].timeout)clearTimeout(this._promises[J].timeout);this._promises[J].reject(Z),delete this._promises[J]}}_scheduleResubscribe(){if(!this._isSubscribing()){this._debug("not in subscribing state, skip resubscribe scheduling",this.channel);return}let Z=this,J=this._getResubscribeDelay();this._resubscribeTimeout=setTimeout(function(){if(Z._isSubscribing())Z._subscribe()},J),this._debug("resubscribe scheduled after "+J,this.channel)}_subscribeError(Z){if(!this._isSubscribing())return;if(Z.code<100||Z.code===109||Z.temporary===!0){if(Z.code===109)this._token="";let J={channel:this.channel,type:"subscribe",error:Z};if(this._centrifuge.state===c.Connected)this.emit("error",J);this._scheduleResubscribe()}else this._setUnsubscribed(Z.code,Z.message,!1)}_getResubscribeDelay(){let Z=i1(this._resubscribeAttempts,this._minResubscribeDelay,this._maxResubscribeDelay);return this._resubscribeAttempts++,Z}_setOptions(Z){if(!Z)return;if(Z.since)this._offset=Z.since.offset||0,this._epoch=Z.since.epoch||"",this._recover=!0;if(Z.data)this._data=Z.data;if(Z.getData)this._getData=Z.getData;if(Z.minResubscribeDelay!==void 0)this._minResubscribeDelay=Z.minResubscribeDelay;if(Z.maxResubscribeDelay!==void 0)this._maxResubscribeDelay=Z.maxResubscribeDelay;if(Z.token)this._token=Z.token;if(Z.getToken)this._getToken=Z.getToken;if(Z.positioned===!0)this._positioned=!0;if(Z.recoverable===!0)this._recoverable=!0;if(Z.joinLeave===!0)this._joinLeave=!0;if(Z.delta){if(Z.delta!=="fossil")throw new Error("unsupported delta format");this._delta=Z.delta}if(Z.tagsFilter)this._tagsFilter=Z.tagsFilter;if(this._tagsFilter&&this._delta)throw new Error("cannot use delta and tagsFilter together")}_getOffset(){let Z=this._offset;if(Z!==null)return Z;return 0}_getEpoch(){let Z=this._epoch;if(Z!==null)return Z;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 Z={channel:this.channel},J=this._getToken;if(J===null)return this.emit("error",{type:"configuration",channel:this.channel,error:{code:g.badConfiguration,message:"provide a function to get channel subscription token"}}),Promise.reject(new g0(""));return J(Z)}_refresh(){this._clearRefreshTimeout();let Z=this;this._getSubscriptionToken().then(function(J){if(!Z._isSubscribed())return;if(!J){Z._failUnauthorized();return}Z._token=J;let X={sub_refresh:{channel:Z.channel,token:J}};Z._centrifuge._call(X).then((G)=>{let W=G.reply.sub_refresh;if(Z._refreshResponse(W),G.next)G.next()},(G)=>{if(Z._refreshError(G.error),G.next)G.next()})}).catch(function(J){if(J instanceof g0){Z._failUnauthorized();return}Z.emit("error",{type:"refreshToken",channel:Z.channel,error:{code:g.subscriptionRefreshToken,message:J!==void 0?J.toString():""}}),Z._refreshTimeout=setTimeout(()=>Z._refresh(),Z._getRefreshRetryDelay())})}_refreshResponse(Z){if(!this._isSubscribed())return;if(this._debug("subscription token refreshed, channel",this.channel),this._clearRefreshTimeout(),Z.expires===!0)this._refreshTimeout=setTimeout(()=>this._refresh(),n1(Z.ttl))}_refreshError(Z){if(!this._isSubscribed())return;if(Z.code<100||Z.temporary===!0)this.emit("error",{type:"refresh",channel:this.channel,error:Z}),this._refreshTimeout=setTimeout(()=>this._refresh(),this._getRefreshRetryDelay());else this._setUnsubscribed(Z.code,Z.message,!0)}_getRefreshRetryDelay(){return i1(0,1e4,20000)}_failUnauthorized(){this._setUnsubscribed(l1.unauthorized,"unauthorized",!0)}}class J4{constructor(Z,J){this.endpoint=Z,this.options=J,this._transport=null}name(){return"sockjs"}subName(){return"sockjs-"+this._transport.transport}emulation(){return!1}supported(){return this.options.sockjs!==null}initialize(Z,J){this._transport=new this.options.sockjs(this.endpoint,null,this.options.sockjsOptions),this._transport.onopen=()=>{J.onOpen()},this._transport.onerror=(Y)=>{J.onError(Y)},this._transport.onclose=(Y)=>{J.onClose(Y)},this._transport.onmessage=(Y)=>{J.onMessage(Y.data)}}close(){this._transport.close()}send(Z){this._transport.send(Z)}}class a6{constructor(Z,J){this.endpoint=Z,this.options=J,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,J){let Y="";if(Z==="protobuf")Y="centrifuge-protobuf";if(Y!=="")this._transport=new this.options.websocket(this.endpoint,Y);else this._transport=new this.options.websocket(this.endpoint);if(Z==="protobuf")this._transport.binaryType="arraybuffer";this._transport.onopen=()=>{J.onOpen()},this._transport.onerror=(X)=>{J.onError(X)},this._transport.onclose=(X)=>{J.onClose(X)},this._transport.onmessage=(X)=>{J.onMessage(X.data)}}close(){this._transport.close()}send(Z){this._transport.send(Z)}}class Y4{constructor(Z,J){this.endpoint=Z,this.options=J,this._abortController=null,this._utf8decoder=new TextDecoder,this._protocol="json"}name(){return"http_stream"}subName(){return"http_stream"}emulation(){return!0}_handleErrors(Z){if(!Z.ok)throw new Error(Z.status);return Z}_fetchEventTarget(Z,J,Y){let X=new EventTarget,G=Z.options.fetch;return G(J,Y).then(Z._handleErrors).then((W)=>{X.dispatchEvent(new Event("open"));let K="",H=0,z=new Uint8Array,V=W.body.getReader();return new Z.options.readableStream({start(Q){function L(){return V.read().then(({done:F,value:M})=>{if(F){X.dispatchEvent(new Event("close")),Q.close();return}try{if(Z._protocol==="json"){K+=Z._utf8decoder.decode(M);while(H<K.length)if(K[H]===`
13
- `){let $=K.substring(0,H);X.dispatchEvent(new MessageEvent("message",{data:$})),K=K.substring(H+1),H=0}else++H}else{let $=new Uint8Array(z.length+M.length);$.set(z),$.set(M,z.length),z=$;while(!0){let U=Z.options.decoder.decodeReply(z);if(U.ok){let B=z.slice(0,U.pos);X.dispatchEvent(new MessageEvent("message",{data:B})),z=z.slice(U.pos);continue}break}}}catch($){X.dispatchEvent(new Event("error",{detail:$})),X.dispatchEvent(new Event("close")),Q.close();return}L()}).catch(function(F){X.dispatchEvent(new Event("error",{detail:F})),X.dispatchEvent(new Event("close")),Q.close();return})}return L()}})}).catch((W)=>{X.dispatchEvent(new Event("error",{detail:W})),X.dispatchEvent(new Event("close"))}),X}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,J,Y){this._protocol=Z,this._abortController=new AbortController;let X,G;if(Z==="json")X={Accept:"application/json","Content-Type":"application/json"},G=Y;else X={Accept:"application/octet-stream","Content-Type":"application/octet-stream"},G=Y;let W={method:"POST",headers:X,body:G,mode:"cors",credentials:"same-origin",signal:this._abortController.signal},K=this._fetchEventTarget(this,this.endpoint,W);K.addEventListener("open",()=>{J.onOpen()}),K.addEventListener("error",(H)=>{this._abortController.abort(),J.onError(H)}),K.addEventListener("close",()=>{this._abortController.abort(),J.onClose({code:4,reason:"connection closed"})}),K.addEventListener("message",(H)=>{J.onMessage(H.data)})}close(){this._abortController.abort()}send(Z,J,Y){let X,G,W={session:J,node:Y,data:Z};if(this._protocol==="json")X={"Content-Type":"application/json"},G=JSON.stringify(W);else X={"Content-Type":"application/octet-stream"},G=this.options.encoder.encodeEmulationRequest(W);let K=this.options.fetch,H={method:"POST",headers:X,body:G,mode:"cors",credentials:"same-origin"};K(this.options.emulationEndpoint,H)}}class X4{constructor(Z,J){this.endpoint=Z,this.options=J,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,J,Y){let X;if(globalThis&&globalThis.document&&globalThis.document.baseURI)X=new URL(this.endpoint,globalThis.document.baseURI);else X=new URL(this.endpoint);X.searchParams.append("cf_connect",Y);let G={},W=new this.options.eventsource(X.toString(),G);this._transport=W;let K=this;W.onopen=function(){J.onOpen()},W.onerror=function(H){W.close(),J.onError(H),J.onClose({code:4,reason:"connection closed"})},W.onmessage=function(H){J.onMessage(H.data)},K._onClose=function(){J.onClose({code:4,reason:"connection closed"})}}close(){if(this._transport.close(),this._onClose!==null)this._onClose()}send(Z,J,Y){let X={session:J,node:Y,data:Z},G={"Content-Type":"application/json"},W=JSON.stringify(X),K=this.options.fetch,H={method:"POST",headers:G,body:W,mode:"cors",credentials:"same-origin"};K(this.options.emulationEndpoint,H)}}class G4{constructor(Z,J){this.endpoint=Z,this.options=J,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,J){return X0(this,void 0,void 0,function*(){let Y;if(globalThis&&globalThis.document&&globalThis.document.baseURI)Y=new URL(this.endpoint,globalThis.document.baseURI);else Y=new URL(this.endpoint);if(Z==="protobuf")Y.searchParams.append("cf_protocol","protobuf");this._protocol=Z;let X=new EventTarget;this._transport=new this.options.webtransport(Y.toString()),this._transport.closed.then(()=>{J.onClose({code:4,reason:"connection closed"})}).catch(()=>{J.onClose({code:4,reason:"connection closed"})});try{yield this._transport.ready}catch(W){this.close();return}let G;try{G=yield this._transport.createBidirectionalStream()}catch(W){this.close();return}this._stream=G,this._writer=this._stream.writable.getWriter(),X.addEventListener("close",()=>{J.onClose({code:4,reason:"connection closed"})}),X.addEventListener("message",(W)=>{J.onMessage(W.data)}),this._startReading(X),J.onOpen()})}_startReading(Z){return X0(this,void 0,void 0,function*(){let J=this._stream.readable.getReader(),Y="",X=0,G=new Uint8Array;try{while(!0){let{done:W,value:K}=yield J.read();if(K.length>0)if(this._protocol==="json"){Y+=this._utf8decoder.decode(K);while(X<Y.length)if(Y[X]===`
14
- `){let H=Y.substring(0,X);Z.dispatchEvent(new MessageEvent("message",{data:H})),Y=Y.substring(X+1),X=0}else++X}else{let H=new Uint8Array(G.length+K.length);H.set(G),H.set(K,G.length),G=H;while(!0){let z=this.options.decoder.decodeReply(G);if(z.ok){let V=G.slice(0,z.pos);Z.dispatchEvent(new MessageEvent("message",{data:V})),G=G.slice(z.pos);continue}break}}if(W)break}}catch(W){Z.dispatchEvent(new Event("close"))}})}close(){return X0(this,void 0,void 0,function*(){try{if(this._writer)yield this._writer.close();this._transport.close()}catch(Z){}})}send(Z){return X0(this,void 0,void 0,function*(){let J;if(this._protocol==="json")J=new TextEncoder().encode(Z+`
15
- `);else J=Z;try{yield this._writer.write(J)}catch(Y){this.close()}})}}var zX=[-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 W4{constructor(Z){this.a=Z,this.pos=0}haveBytes(){return this.pos<this.a.length}getByte(){let Z=this.a[this.pos];if(this.pos++,this.pos>this.a.length)throw new RangeError("out of bounds");return Z}getChar(){return String.fromCharCode(this.getByte())}getInt(){let Z=0,J;while(this.haveBytes()&&(J=zX[127&this.getByte()])>=0)Z=(Z<<6)+J;return this.pos--,Z>>>0}}class K4{constructor(){this.a=[]}toByteArray(Z){if(Array.isArray(Z))return this.a;return new Uint8Array(this.a)}putArray(Z,J,Y){for(let X=J;X<Y;X++)this.a.push(Z[X])}}function VX(Z){let J=0,Y=0,X=0,G=0,W=0,K=Z.length;while(K>=16)J=J+Z[W+0]|0,Y=Y+Z[W+1]|0,X=X+Z[W+2]|0,G=G+Z[W+3]|0,J=J+Z[W+4]|0,Y=Y+Z[W+5]|0,X=X+Z[W+6]|0,G=G+Z[W+7]|0,J=J+Z[W+8]|0,Y=Y+Z[W+9]|0,X=X+Z[W+10]|0,G=G+Z[W+11]|0,J=J+Z[W+12]|0,Y=Y+Z[W+13]|0,X=X+Z[W+14]|0,G=G+Z[W+15]|0,W+=16,K-=16;while(K>=4)J=J+Z[W+0]|0,Y=Y+Z[W+1]|0,X=X+Z[W+2]|0,G=G+Z[W+3]|0,W+=4,K-=4;switch(G=((G+(X<<8)|0)+(Y<<16)|0)+(J<<24)|0,K){case 3:G=G+(Z[W+2]<<8)|0;case 2:G=G+(Z[W+1]<<16)|0;case 1:G=G+(Z[W+0]<<24)|0}return G>>>0}function QX(Z,J){let Y=0,X=new W4(J),G=Z.length,W=J.length,K=X.getInt();if(X.getChar()!==`
16
- `)throw new Error("size integer not terminated by '\\n'");let H=new K4;while(X.haveBytes()){let z=X.getInt(),V;switch(X.getChar()){case"@":if(V=X.getInt(),X.haveBytes()&&X.getChar()!==",")throw new Error("copy command not terminated by ','");if(Y+=z,Y>K)throw new Error("copy exceeds output file size");if(V+z>G)throw new Error("copy extends past end of input");H.putArray(Z,V,V+z);break;case":":if(Y+=z,Y>K)throw new Error("insert command gives an output larger than predicted");if(z>W)throw new Error("insert count exceeds size of delta");H.putArray(X.a,X.pos,X.pos+z),X.pos+=z;break;case";":{let Q=H.toByteArray(Z);if(z!==VX(Q))throw new Error("bad checksum");if(Y!==K)throw new Error("generated size does not match predicted size");return Q}default:throw new Error("unknown delta operator")}}throw new Error("unterminated delta")}class r6{name(){return"json"}encodeCommands(Z){return Z.map((J)=>JSON.stringify(J)).join(`
17
- `)}decodeReplies(Z){return Z.trim().split(`
18
- `).map((J)=>JSON.parse(J))}applyDeltaIfNeeded(Z,J){let Y,X;if(Z.delta){let G=QX(J,new TextEncoder().encode(Z.data));Y=JSON.parse(new TextDecoder().decode(G)),X=G}else Y=JSON.parse(Z.data),X=new TextEncoder().encode(Z.data);return{newData:Y,newPrevValue:X}}}var $X={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 g0 extends Error{constructor(Z){super(Z);this.name=this.constructor.name}}class R9 extends tZ{constructor(Z,J){super();if(this._reconnectTimeout=null,this._refreshTimeout=null,this._serverPingTimeout=null,this.state=c.Disconnected,this._transportIsOpen=!1,this._endpoint=Z,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 r6,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({},$X),J),this._configure(),this._debugEnabled)this.on("state",(Y)=>{this._debug("client state",Y.oldState,"->",Y.newState)}),this.on("error",(Y)=>{this._debug("client error",Y)});else this.on("error",function(){Function.prototype()})}newSubscription(Z,J){if(this.getSubscription(Z)!==null)throw new Error("Subscription to the channel "+Z+" already exists");let Y=new Z4(this,Z,J);return this._subs[Z]=Y,Y}getSubscription(Z){return this._getSub(Z)}removeSubscription(Z){if(!Z)return;if(Z.state!==H0.Unsubscribed)Z.unsubscribe();this._removeSubscription(Z)}subscriptions(){return this._subs}ready(Z){return X0(this,void 0,void 0,function*(){switch(this.state){case c.Disconnected:throw{code:g.clientDisconnected,message:"client disconnected"};case c.Connected:return;default:return new Promise((J,Y)=>{let X={resolve:J,reject:Y};if(Z)X.timeout=setTimeout(()=>{Y({code:g.timeout,message:"timeout"})},Z);this._promises[this._nextPromiseId()]=X})}})}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(Z1.disconnectCalled,"disconnect called",!1)}setToken(Z){this._token=Z}setData(Z){this._data=Z}setHeaders(Z){this._config.headers=Z}send(Z){return X0(this,void 0,void 0,function*(){let J={send:{data:Z}};if(yield this._methodCall(),!this._transportSendCommands([J]))throw this._createErrorObject(g.transportWriteError,"transport write error")})}rpc(Z,J){return X0(this,void 0,void 0,function*(){let Y={rpc:{method:Z,data:J}};return yield this._methodCall(),{data:(yield this._callPromise(Y,(G)=>G.rpc)).data}})}publish(Z,J){return X0(this,void 0,void 0,function*(){let Y={publish:{channel:Z,data:J}};return yield this._methodCall(),yield this._callPromise(Y,()=>({})),{}})}history(Z,J){return X0(this,void 0,void 0,function*(){let Y={history:this._getHistoryRequest(Z,J)};yield this._methodCall();let X=yield this._callPromise(Y,(W)=>W.history),G=[];if(X.publications)for(let W=0;W<X.publications.length;W++)G.push(this._getPublicationContext(Z,X.publications[W]));return{publications:G,epoch:X.epoch||"",offset:X.offset||0}})}presence(Z){return X0(this,void 0,void 0,function*(){let J={presence:{channel:Z}};yield this._methodCall();let X=(yield this._callPromise(J,(G)=>G.presence)).presence;for(let G in X)if(Object.prototype.hasOwnProperty.call(X,G)){let W=X[G],K=W.conn_info,H=W.chan_info;if(K)W.connInfo=K;if(H)W.chanInfo=H}return{clients:X}})}presenceStats(Z){return X0(this,void 0,void 0,function*(){let J={presence_stats:{channel:Z}};yield this._methodCall();let Y=yield this._callPromise(J,(X)=>{return X.presence_stats});return{numUsers:Y.num_users,numClients:Y.num_clients}})}startBatching(){this._batching=!0}stopBatching(){let Z=this;Promise.resolve().then(function(){Promise.resolve().then(function(){Z._batching=!1,Z._flush()})})}_debug(...Z){if(!this._debugEnabled)return;WX("debug",Z)}_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 r6,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 Z in this._transports)if(this._transports.hasOwnProperty(Z)){let J=this._transports[Z];if(!J.endpoint||!J.transport)throw new Error("malformed transport configuration");let Y=J.transport;if(["websocket","http_stream","sse","sockjs","webtransport"].indexOf(Y)<0)throw new Error("unsupported transport name: "+Y)}}else throw new Error("unsupported url configuration type: only string or array of objects are supported")}_setState(Z){if(this.state!==Z){this._reconnecting=!1;let J=this.state;return this.state=Z,this.emit("state",{newState:Z,oldState:J}),!0}return!1}_isDisconnected(){return this.state===c.Disconnected}_isConnecting(){return this.state===c.Connecting}_isConnected(){return this.state===c.Connected}_nextCommandId(){return++this._commandId}_setNetworkEvents(){if(this._networkEventsSet)return;let Z=null;if(this._config.networkEventTarget!==null)Z=this._config.networkEventTarget;else if(typeof globalThis.addEventListener!=="undefined")Z=globalThis;if(Z)Z.addEventListener("offline",()=>{if(this._debug("offline event triggered"),this.state===c.Connected||this.state===c.Connecting)this._disconnect(W9.transportClosed,"transport closed",!0),this._deviceWentOffline=!0}),Z.addEventListener("online",()=>{if(this._debug("online event triggered"),this.state!==c.Connecting)return;if(this._deviceWentOffline&&!this._transportClosed)this._deviceWentOffline=!1,this._transportClosed=!0;this._clearReconnectTimeout(),this._startReconnecting()}),this._networkEventsSet=!0}_getReconnectDelay(){let Z=i1(this._reconnectAttempts,this._config.minReconnectDelay,this._config.maxReconnectDelay);return this._reconnectAttempts+=1,Z}_clearOutgoingRequests(){for(let Z in this._callbacks)if(this._callbacks.hasOwnProperty(Z)){let J=this._callbacks[Z];clearTimeout(J.timeout);let Y=J.errback;if(!Y)continue;Y({error:this._createErrorObject(g.connectionClosed,"connection closed")})}this._callbacks={}}_clearConnectedState(){this._client=null,this._clearServerPingTimeout(),this._clearRefreshTimeout();for(let Z in this._subs){if(!this._subs.hasOwnProperty(Z))continue;let J=this._subs[Z];if(J.state===H0.Subscribed)J._setSubscribing(c1.transportClosed,"transport closed")}for(let Z in this._serverSubs)if(this._serverSubs.hasOwnProperty(Z))this.emit("subscribing",{channel:Z})}_handleWriteError(Z){for(let J of Z){let Y=J.id;if(!(Y in this._callbacks))continue;let X=this._callbacks[Y];clearTimeout(this._callbacks[Y].timeout),delete this._callbacks[Y];let G=X.errback;G({error:this._createErrorObject(g.transportWriteError,"transport write error")})}}_transportSendCommands(Z){if(!Z.length)return!0;if(!this._transport)return!1;try{this._transport.send(this._codec.encodeCommands(Z),this._session,this._node)}catch(J){return this._debug("error writing commands",J),this._handleWriteError(Z),!1}return!0}_initializeTransport(){let Z;if(this._config.websocket!==null)Z=this._config.websocket;else if(!(typeof globalThis.WebSocket!=="function"&&typeof globalThis.WebSocket!=="object"))Z=globalThis.WebSocket;let J=null;if(this._config.sockjs!==null)J=this._config.sockjs;else if(typeof globalThis.SockJS!=="undefined")J=globalThis.SockJS;let Y=null;if(this._config.eventsource!==null)Y=this._config.eventsource;else if(typeof globalThis.EventSource!=="undefined")Y=globalThis.EventSource;let X=null;if(this._config.fetch!==null)X=this._config.fetch;else if(typeof globalThis.fetch!=="undefined")X=globalThis.fetch;let G=null;if(this._config.readableStream!==null)G=this._config.readableStream;else if(typeof globalThis.ReadableStream!=="undefined")G=globalThis.ReadableStream;if(!this._emulation){if(GX(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 a6(this._endpoint,{websocket:Z}),!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 F=0;while(!0){if(F>=this._transports.length)throw new Error("no supported transport found");let M=this._transports[this._currentTransportIndex],$=M.transport,U=M.endpoint;if($==="websocket"){if(this._debug("trying websocket transport"),this._transport=new a6(U,{websocket:Z}),!this._transport.supported()){this._debug("websocket transport not available"),this._currentTransportIndex++,F++;continue}}else if($==="webtransport"){if(this._debug("trying webtransport transport"),this._transport=new G4(U,{webtransport:globalThis.WebTransport,decoder:this._codec,encoder:this._codec}),!this._transport.supported()){this._debug("webtransport transport not available"),this._currentTransportIndex++,F++;continue}}else if($==="http_stream"){if(this._debug("trying http_stream transport"),this._transport=new Y4(U,{fetch:X,readableStream:G,emulationEndpoint:this._config.emulationEndpoint,decoder:this._codec,encoder:this._codec}),!this._transport.supported()){this._debug("http_stream transport not available"),this._currentTransportIndex++,F++;continue}}else if($==="sse"){if(this._debug("trying sse transport"),this._transport=new X4(U,{eventsource:Y,fetch:X,emulationEndpoint:this._config.emulationEndpoint}),!this._transport.supported()){this._debug("sse transport not available"),this._currentTransportIndex++,F++;continue}}else if($==="sockjs"){if(this._debug("trying sockjs"),this._transport=new J4(U,{sockjs:J,sockjsOptions:this._config.sockjsOptions}),!this._transport.supported()){this._debug("sockjs transport not available"),this._currentTransportIndex++,F++;continue}}else throw new Error("unknown transport "+$);break}}let W=this,K=this._transport,H=this._nextTransportId();W._debug("id of transport",H);let z=!1,V=[];if(this._transport.emulation()){let F=W._sendConnect(!0);V.push(F)}this._setNetworkEvents();let Q=this._codec.encodeCommands(V);this._transportClosed=!1;let L;L=setTimeout(function(){K.close()},this._config.timeout),this._transport.initialize(this._codecName(),{onOpen:function(){if(L)clearTimeout(L),L=null;if(W._transportId!=H){W._debug("open callback from non-actual transport"),K.close();return}if(z=!0,W._debug(K.subName(),"transport open"),K.emulation())return;W._transportIsOpen=!0,W._transportWasOpen=!0,W.startBatching(),W._sendConnect(!1),W._sendSubscribeCommands(),W.stopBatching(),W.emit("__centrifuge_debug:connect_frame_sent",{})},onError:function(F){if(W._transportId!=H){W._debug("error callback from non-actual transport");return}W._debug("transport level error",F)},onClose:function(F){if(L)clearTimeout(L),L=null;if(W._transportId!=H){W._debug("close callback from non-actual transport");return}W._debug(K.subName(),"transport closed"),W._transportClosed=!0,W._transportIsOpen=!1;let M="connection closed",$=!0,U=0;if(F&&"code"in F&&F.code)U=F.code;if(F&&F.reason)try{let B=JSON.parse(F.reason);M=B.reason,$=B.reconnect}catch(B){if(M=F.reason,U>=3500&&U<4000||U>=4500&&U<5000)$=!1}if(U<3000){if(U===1009)U=Z1.messageSizeLimit,M="message size limit exceeded",$=!1;else U=W9.transportClosed,M="transport closed";if(W._emulation&&!W._transportWasOpen){if(W._currentTransportIndex++,W._currentTransportIndex>=W._transports.length)W._triedAllTransports=!0,W._currentTransportIndex=0}}else W._transportWasOpen=!0;if(W._isConnecting()&&!z)W.emit("error",{type:"transport",error:{code:g.transportClosed,message:"transport closed"},transport:K.name()});W._reconnecting=!1,W._disconnect(U,M,$)},onMessage:function(F){W._dataReceived(F)}},Q),W.emit("__centrifuge_debug:transport_initialized",{})}_sendConnect(Z){let J=this._constructConnectCommand(),Y=this;return this._call(J,Z).then((X)=>{let G=X.reply.connect;if(Y._connectResponse(G),X.next)X.next()},(X)=>{if(Y._connectError(X.error),X.next)X.next()}),J}_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 Z=this._token==="";if(!(this._refreshRequired||Z&&this._config.getToken!==null)){if(this._config.getData)this._config.getData().then((X)=>{if(!this._isConnecting())return;this._data=X,this._initializeTransport()}).catch((X)=>this._handleGetDataError(X));else this._initializeTransport();return}let Y=this;this._getToken().then(function(X){if(!Y._isConnecting())return;if(X==null||X==null){Y._failUnauthorized();return}if(Y._token=X,Y._debug("connection token refreshed"),Y._config.getData)Y._config.getData().then(function(G){if(!Y._isConnecting())return;Y._data=G,Y._initializeTransport()}).catch((G)=>Y._handleGetDataError(G));else Y._initializeTransport()}).catch(function(X){if(!Y._isConnecting())return;if(X instanceof g0){Y._failUnauthorized();return}Y.emit("error",{type:"connectToken",error:{code:g.clientConnectToken,message:X!==void 0?X.toString():""}});let G=Y._getReconnectDelay();Y._debug("error on getting connection token, reconnect after "+G+" milliseconds",X),Y._reconnecting=!1,Y._reconnectTimeout=setTimeout(()=>{Y._startReconnecting()},G)})}_handleGetDataError(Z){if(Z instanceof g0){this._failUnauthorized();return}this.emit("error",{type:"connectData",error:{code:g.badConfiguration,message:(Z===null||Z===void 0?void 0:Z.toString())||""}});let J=this._getReconnectDelay();this._debug("error on getting connect data, reconnect after "+J+" milliseconds",Z),this._reconnecting=!1,this._reconnectTimeout=setTimeout(()=>{this._startReconnecting()},J)}_connectError(Z){if(this.state!==c.Connecting)return;if(Z.code===109)this._refreshRequired=!0;if(Z.code<100||Z.temporary===!0||Z.code===109)this.emit("error",{type:"connect",error:Z}),this._debug("closing transport due to connect error"),this._disconnect(Z.code,Z.message,!0);else this._disconnect(Z.code,Z.message,!1)}_scheduleReconnect(){if(!this._isConnecting())return;let Z=!1;if(this._emulation&&!this._transportWasOpen&&!this._triedAllTransports)Z=!0;let J=this._getReconnectDelay();if(Z)J=0;this._debug("reconnect after "+J+" milliseconds"),this._clearReconnectTimeout(),this._reconnectTimeout=setTimeout(()=>{this._startReconnecting()},J)}_constructConnectCommand(){let Z={};if(this._token)Z.token=this._token;if(this._data)Z.data=this._data;if(this._config.name)Z.name=this._config.name;if(this._config.version)Z.version=this._config.version;if(Object.keys(this._config.headers).length>0)Z.headers=this._config.headers;let J={},Y=!1;for(let X in this._serverSubs)if(this._serverSubs.hasOwnProperty(X)&&this._serverSubs[X].recoverable){Y=!0;let G={recover:!0};if(this._serverSubs[X].offset)G.offset=this._serverSubs[X].offset;if(this._serverSubs[X].epoch)G.epoch=this._serverSubs[X].epoch;J[X]=G}if(Y)Z.subs=J;return{connect:Z}}_getHistoryRequest(Z,J){let Y={channel:Z};if(J!==void 0){if(J.since){if(Y.since={offset:J.since.offset},J.since.epoch)Y.since.epoch=J.since.epoch}if(J.limit!==void 0)Y.limit=J.limit;if(J.reverse===!0)Y.reverse=!0}return Y}_methodCall(){if(this._isConnected())return Promise.resolve();return new Promise((Z,J)=>{let Y=setTimeout(function(){J({code:g.timeout,message:"timeout"})},this._config.timeout);this._promises[this._nextPromiseId()]={timeout:Y,resolve:Z,reject:J}})}_callPromise(Z,J){return new Promise((Y,X)=>{this._call(Z,!1).then((G)=>{var W;let K=J(G.reply);Y(K),(W=G.next)===null||W===void 0||W.call(G)},(G)=>{var W;X(G.error),(W=G.next)===null||W===void 0||W.call(G)})})}_dataReceived(Z){if(this._serverPing>0)this._waitServerPing();let J=this._codec.decodeReplies(Z);this._dispatchPromise=this._dispatchPromise.then(()=>{let Y;this._dispatchPromise=new Promise((X)=>{Y=X}),this._dispatchSynchronized(J,Y)})}_dispatchSynchronized(Z,J){let Y=Promise.resolve();for(let X in Z)if(Z.hasOwnProperty(X))Y=Y.then(()=>{return this._dispatchReply(Z[X])});Y=Y.then(()=>{J()})}_dispatchReply(Z){let J,Y=new Promise((G)=>{J=G});if(Z===void 0||Z===null)return this._debug("dispatch: got undefined or null reply"),J(),Y;let X=Z.id;if(X&&X>0)this._handleReply(Z,J);else if(!Z.push)this._handleServerPing(J);else this._handlePush(Z.push,J);return Y}_call(Z,J){return new Promise((Y,X)=>{if(Z.id=this._nextCommandId(),this._registerCall(Z.id,Y,X),!J)this._addCommand(Z)})}_startConnecting(){if(this._debug("start connecting"),this._setState(c.Connecting))this.emit("connecting",{code:W9.connectCalled,reason:"connect called"});this._client=null,this._startReconnecting()}_disconnect(Z,J,Y){if(this._isDisconnected())return;this._transportIsOpen=!1;let X=this.state;this._reconnecting=!1;let G={code:Z,reason:J},W=!1;if(Y)W=this._setState(c.Connecting);else W=this._setState(c.Disconnected),this._rejectPromises({code:g.clientDisconnected,message:"disconnected"});if(this._clearOutgoingRequests(),X===c.Connecting)this._clearReconnectTimeout();if(X===c.Connected)this._clearConnectedState();if(W)if(this._isConnecting())this.emit("connecting",G);else this.emit("disconnected",G);if(this._transport){this._debug("closing existing transport");let K=this._transport;this._transport=null,K.close(),this._transportClosed=!0,this._nextTransportId()}else this._debug("no transport to close");this._scheduleReconnect()}_failUnauthorized(){this._disconnect(Z1.unauthorized,"unauthorized",!1)}_getToken(){if(this._debug("get connection token"),!this._config.getToken)return this.emit("error",{type:"configuration",error:{code:g.badConfiguration,message:"token expired but no getToken function set in the configuration"}}),Promise.reject(new g0(""));return this._config.getToken({})}_refresh(){let Z=this._client,J=this;this._getToken().then(function(Y){if(Z!==J._client)return;if(!Y){J._failUnauthorized();return}if(J._token=Y,J._debug("connection token refreshed"),!J._isConnected())return;let X={refresh:{token:J._token}};J._call(X,!1).then((G)=>{let W=G.reply.refresh;if(J._refreshResponse(W),G.next)G.next()},(G)=>{if(J._refreshError(G.error),G.next)G.next()})}).catch(function(Y){if(!J._isConnected())return;if(Y instanceof g0){J._failUnauthorized();return}J.emit("error",{type:"refreshToken",error:{code:g.clientRefreshToken,message:Y!==void 0?Y.toString():""}}),J._refreshTimeout=setTimeout(()=>J._refresh(),J._getRefreshRetryDelay())})}_refreshError(Z){if(Z.code<100||Z.temporary===!0)this.emit("error",{type:"refresh",error:Z}),this._refreshTimeout=setTimeout(()=>this._refresh(),this._getRefreshRetryDelay());else this._disconnect(Z.code,Z.message,!1)}_getRefreshRetryDelay(){return i1(0,5000,1e4)}_refreshResponse(Z){if(this._refreshTimeout)clearTimeout(this._refreshTimeout),this._refreshTimeout=null;if(Z.expires)this._client=Z.client,this._refreshTimeout=setTimeout(()=>this._refresh(),n1(Z.ttl))}_removeSubscription(Z){if(Z===null)return;delete this._subs[Z.channel]}_unsubscribe(Z){if(!this._transportIsOpen)return Promise.resolve();let Y={unsubscribe:{channel:Z.channel}},X=this;return new Promise((W,K)=>{this._call(Y,!1).then((H)=>{if(W(),H.next)H.next()},(H)=>{if(W(),H.next)H.next();X._disconnect(W9.unsubscribeError,"unsubscribe error",!0)})})}_getSub(Z,J){if(J&&J>0){for(let X in this._subs)if(this._subs.hasOwnProperty(X)){let G=this._subs[X];if(G._id===J)return G}return null}let Y=this._subs[Z];if(!Y)return null;return Y}_isServerSub(Z){return this._serverSubs[Z]!==void 0}_sendSubscribeCommands(){let Z=[];for(let J in this._subs){if(!this._subs.hasOwnProperty(J))continue;let Y=this._subs[J];if(Y._inflight===!0)continue;if(Y.state===H0.Subscribing){let X=Y._subscribe();if(X)Z.push(X)}}return Z}_connectResponse(Z){if(this._transportIsOpen=!0,this._transportWasOpen=!0,this._reconnectAttempts=0,this._refreshRequired=!1,this._isConnected())return;if(this._client=Z.client,this._setState(c.Connected),this._refreshTimeout)clearTimeout(this._refreshTimeout);if(Z.expires)this._refreshTimeout=setTimeout(()=>this._refresh(),n1(Z.ttl));this._session=Z.session,this._node=Z.node,this.startBatching(),this._sendSubscribeCommands(),this.stopBatching();let J={client:Z.client,transport:this._transport.subName()};if(Z.data)J.data=Z.data;if(this.emit("connected",J),this._resolvePromises(),this._processServerSubs(Z.subs||{}),Z.ping&&Z.ping>0)this._serverPing=Z.ping*1000,this._sendPong=Z.pong===!0,this._waitServerPing();else this._serverPing=0}_processServerSubs(Z){for(let J in Z){if(!Z.hasOwnProperty(J))continue;let Y=Z[J];this._serverSubs[J]={offset:Y.offset,epoch:Y.epoch,recoverable:Y.recoverable||!1};let X=this._getSubscribeContext(J,Y);this.emit("subscribed",X)}for(let J in Z){if(!Z.hasOwnProperty(J))continue;let Y=Z[J];if(Y.recovered){let X=Y.publications;if(X&&X.length>0){for(let G in X)if(X.hasOwnProperty(G))this._handlePublication(J,X[G])}}}for(let J in this._serverSubs){if(!this._serverSubs.hasOwnProperty(J))continue;if(!Z[J])this.emit("unsubscribed",{channel:J}),delete this._serverSubs[J]}}_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(W9.noPing,"no ping",!0)},this._serverPing+this._config.maxServerPingDelay)}_getSubscribeContext(Z,J){let Y={channel:Z,positioned:!1,recoverable:!1,wasRecovering:!1,recovered:!1,hasRecoveredPublications:!1};if(J.recovered)Y.recovered=!0;if(J.positioned)Y.positioned=!0;if(J.recoverable)Y.recoverable=!0;if(J.was_recovering)Y.wasRecovering=!0;let X="";if("epoch"in J)X=J.epoch;let G=0;if("offset"in J)G=J.offset;if(Y.positioned||Y.recoverable)Y.streamPosition={offset:G,epoch:X};if(Array.isArray(J.publications)&&J.publications.length>0)Y.hasRecoveredPublications=!0;if(J.data)Y.data=J.data;return Y}_handleReply(Z,J){let Y=Z.id;if(!(Y in this._callbacks)){J();return}let X=this._callbacks[Y];if(clearTimeout(this._callbacks[Y].timeout),delete this._callbacks[Y],!HX(Z)){let G=X.callback;if(!G)return;G({reply:Z,next:J})}else{let G=X.errback;if(!G){J();return}let W={code:Z.error.code,message:Z.error.message||"",temporary:Z.error.temporary||!1};G({error:W,next:J})}}_handleJoin(Z,J,Y){let X=this._getSub(Z,Y);if(!X&&Z){if(this._isServerSub(Z)){let G={channel:Z,info:this._getJoinLeaveContext(J.info)};this.emit("join",G)}return}X._handleJoin(J)}_handleLeave(Z,J,Y){let X=this._getSub(Z,Y);if(!X&&Z){if(this._isServerSub(Z)){let G={channel:Z,info:this._getJoinLeaveContext(J.info)};this.emit("leave",G)}return}X._handleLeave(J)}_handleUnsubscribe(Z,J){let Y=this._getSub(Z,0);if(!Y&&Z){if(this._isServerSub(Z))delete this._serverSubs[Z],this.emit("unsubscribed",{channel:Z});return}if(J.code<2500)Y._setUnsubscribed(J.code,J.reason,!1);else Y._setSubscribing(J.code,J.reason)}_handleSubscribe(Z,J){this._serverSubs[Z]={offset:J.offset,epoch:J.epoch,recoverable:J.recoverable||!1},this.emit("subscribed",this._getSubscribeContext(Z,J))}_handleDisconnect(Z){let J=Z.code,Y=!0;if(J>=3500&&J<4000||J>=4500&&J<5000)Y=!1;this._disconnect(J,Z.reason,Y)}_getPublicationContext(Z,J){let Y={channel:Z,data:J.data};if(J.offset)Y.offset=J.offset;if(J.info)Y.info=this._getJoinLeaveContext(J.info);if(J.tags)Y.tags=J.tags;return Y}_getJoinLeaveContext(Z){let J={client:Z.client,user:Z.user},Y=Z.conn_info;if(Y)J.connInfo=Y;let X=Z.chan_info;if(X)J.chanInfo=X;return J}_handlePublication(Z,J,Y){let X=this._getSub(Z,Y);if(!X&&Z){if(this._isServerSub(Z)){let G=this._getPublicationContext(Z,J);if(this.emit("publication",G),J.offset!==void 0)this._serverSubs[Z].offset=J.offset}return}X._handlePublication(J)}_handleMessage(Z){this.emit("message",{data:Z.data})}_handleServerPing(Z){if(this._sendPong){let J={};this._transportSendCommands([J])}Z()}_handlePush(Z,J){let{channel:Y,id:X}=Z;if(Z.pub)this._handlePublication(Y,Z.pub,X);else if(Z.message)this._handleMessage(Z.message);else if(Z.join)this._handleJoin(Y,Z.join,X);else if(Z.leave)this._handleLeave(Y,Z.leave,X);else if(Z.unsubscribe)this._handleUnsubscribe(Y,Z.unsubscribe);else if(Z.subscribe)this._handleSubscribe(Y,Z.subscribe);else if(Z.disconnect)this._handleDisconnect(Z.disconnect);J()}_flush(){let Z=this._commands.slice(0);this._commands=[],this._transportSendCommands(Z)}_createErrorObject(Z,J,Y){let X={code:Z,message:J};if(Y)X.temporary=!0;return X}_registerCall(Z,J,Y){this._callbacks[Z]={callback:J,errback:Y,timeout:null},this._callbacks[Z].timeout=setTimeout(()=>{if(delete this._callbacks[Z],eZ(Y))Y({error:this._createErrorObject(g.timeout,"timeout")})},this._config.timeout)}_addCommand(Z){if(this._batching)this._commands.push(Z);else this._transportSendCommands([Z])}_nextPromiseId(){return++this._promiseId}_nextTransportId(){return++this._transportId}_resolvePromises(){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].resolve(),delete this._promises[Z]}}_rejectPromises(Z){for(let J in this._promises){if(!this._promises.hasOwnProperty(J))continue;if(this._promises[J].timeout)clearTimeout(this._promises[J].timeout);this._promises[J].reject(Z),delete this._promises[J]}}}R9.SubscriptionState=H0;R9.State=c;R9.UnauthorizedError=g0;var H4=new Map,K9=(Z,J)=>{if(!J)return null;let Y=`${Z}::${J}`,X=H4.get(Y);if(X)return X;async function G(){let K=await fetch(Z+"api/centrifuge/gen_token");if(!K.ok){if(K.status===403)throw new R9.UnauthorizedError("Backend is not answering");throw new Error(`Unexpected status code ${K.status}`)}return(await K.json()).token}let W=new R9(J,{getToken:G});return H4.set(Y,W),W},BX=UX(null),_0=BX;var k0=Object.create(null);k0.open="0";k0.close="1";k0.ping="2";k0.pong="3";k0.message="4";k0.upgrade="5";k0.noop="6";var J1=Object.create(null);Object.keys(k0).forEach((Z)=>{J1[k0[Z]]=Z});var Y1={type:"error",data:"parser error"};var Q4=typeof Blob==="function"||typeof Blob!=="undefined"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",$4=typeof ArrayBuffer==="function",U4=(Z)=>{return typeof ArrayBuffer.isView==="function"?ArrayBuffer.isView(Z):Z&&Z.buffer instanceof ArrayBuffer},X1=({type:Z,data:J},Y,X)=>{if(Q4&&J instanceof Blob)if(Y)return X(J);else return z4(J,X);else if($4&&(J instanceof ArrayBuffer||U4(J)))if(Y)return X(J);else return z4(new Blob([J]),X);return X(k0[Z]+(J||""))},z4=(Z,J)=>{let Y=new FileReader;return Y.onload=function(){let X=Y.result.split(",")[1];J("b"+(X||""))},Y.readAsDataURL(Z)};function V4(Z){if(Z instanceof Uint8Array)return Z;else if(Z instanceof ArrayBuffer)return new Uint8Array(Z);else return new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength)}var e6;function B4(Z,J){if(Q4&&Z.data instanceof Blob)return Z.data.arrayBuffer().then(V4).then(J);else if($4&&(Z.data instanceof ArrayBuffer||U4(Z.data)))return J(V4(Z.data));X1(Z,!1,(Y)=>{if(!e6)e6=new TextEncoder;J(e6.encode(Y))})}var G1=typeof Uint8Array==="undefined"?[]:new Uint8Array(256);for(let Z=0;Z<64;Z++)G1["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(Z)]=Z;var L4=(Z)=>{let J=Z.length*0.75,Y=Z.length,X,G=0,W,K,H,z;if(Z[Z.length-1]==="="){if(J--,Z[Z.length-2]==="=")J--}let V=new ArrayBuffer(J),Q=new Uint8Array(V);for(X=0;X<Y;X+=4)W=G1[Z.charCodeAt(X)],K=G1[Z.charCodeAt(X+1)],H=G1[Z.charCodeAt(X+2)],z=G1[Z.charCodeAt(X+3)],Q[G++]=W<<2|K>>4,Q[G++]=(K&15)<<4|H>>2,Q[G++]=(H&3)<<6|z&63;return V};var LX=typeof ArrayBuffer==="function",W1=(Z,J)=>{if(typeof Z!=="string")return{type:"message",data:F4(Z,J)};let Y=Z.charAt(0);if(Y==="b")return{type:"message",data:FX(Z.substring(1),J)};if(!J1[Y])return Y1;return Z.length>1?{type:J1[Y],data:Z.substring(1)}:{type:J1[Y]}},FX=(Z,J)=>{if(LX){let Y=L4(Z);return F4(Y,J)}else return{base64:!0,data:Z}},F4=(Z,J)=>{switch(J){case"blob":if(Z instanceof Blob)return Z;else return new Blob([Z]);case"arraybuffer":default:if(Z instanceof ArrayBuffer)return Z;else return Z.buffer}};var M4=String.fromCharCode(30),I4=(Z,J)=>{let Y=Z.length,X=new Array(Y),G=0;Z.forEach((W,K)=>{X1(W,!1,(H)=>{if(X[K]=H,++G===Y)J(X.join(M4))})})},D4=(Z,J)=>{let Y=Z.split(M4),X=[];for(let G=0;G<Y.length;G++){let W=W1(Y[G],J);if(X.push(W),W.type==="error")break}return X};function w4(){return new TransformStream({transform(Z,J){B4(Z,(Y)=>{let X=Y.length,G;if(X<126)G=new Uint8Array(1),new DataView(G.buffer).setUint8(0,X);else if(X<65536){G=new Uint8Array(3);let W=new DataView(G.buffer);W.setUint8(0,126),W.setUint16(1,X)}else{G=new Uint8Array(9);let W=new DataView(G.buffer);W.setUint8(0,127),W.setBigUint64(1,BigInt(X))}if(Z.data&&typeof Z.data!=="string")G[0]|=128;J.enqueue(G),J.enqueue(Y)})}})}var Z8;function s1(Z){return Z.reduce((J,Y)=>J+Y.length,0)}function a1(Z,J){if(Z[0].length===J)return Z.shift();let Y=new Uint8Array(J),X=0;for(let G=0;G<J;G++)if(Y[G]=Z[0][X++],X===Z[0].length)Z.shift(),X=0;if(Z.length&&X<Z[0].length)Z[0]=Z[0].slice(X);return Y}function N4(Z,J){if(!Z8)Z8=new TextDecoder;let Y=[],X=0,G=-1,W=!1;return new TransformStream({transform(K,H){Y.push(K);while(!0){if(X===0){if(s1(Y)<1)break;let z=a1(Y,1);if(W=(z[0]&128)===128,G=z[0]&127,G<126)X=3;else if(G===126)X=1;else X=2}else if(X===1){if(s1(Y)<2)break;let z=a1(Y,2);G=new DataView(z.buffer,z.byteOffset,z.length).getUint16(0),X=3}else if(X===2){if(s1(Y)<8)break;let z=a1(Y,8),V=new DataView(z.buffer,z.byteOffset,z.length),Q=V.getUint32(0);if(Q>Math.pow(2,21)-1){H.enqueue(Y1);break}G=Q*Math.pow(2,32)+V.getUint32(4),X=3}else{if(s1(Y)<G)break;let z=a1(Y,G);H.enqueue(W1(W?z:Z8.decode(z),J)),X=0}if(G===0||G>Z){H.enqueue(Y1);break}}}})}var J8=4;function b(Z){if(Z)return MX(Z)}function MX(Z){for(var J in b.prototype)Z[J]=b.prototype[J];return Z}b.prototype.on=b.prototype.addEventListener=function(Z,J){return this._callbacks=this._callbacks||{},(this._callbacks["$"+Z]=this._callbacks["$"+Z]||[]).push(J),this};b.prototype.once=function(Z,J){function Y(){this.off(Z,Y),J.apply(this,arguments)}return Y.fn=J,this.on(Z,Y),this};b.prototype.off=b.prototype.removeListener=b.prototype.removeAllListeners=b.prototype.removeEventListener=function(Z,J){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var Y=this._callbacks["$"+Z];if(!Y)return this;if(arguments.length==1)return delete this._callbacks["$"+Z],this;var X;for(var G=0;G<Y.length;G++)if(X=Y[G],X===J||X.fn===J){Y.splice(G,1);break}if(Y.length===0)delete this._callbacks["$"+Z];return this};b.prototype.emit=function(Z){this._callbacks=this._callbacks||{};var J=new Array(arguments.length-1),Y=this._callbacks["$"+Z];for(var X=1;X<arguments.length;X++)J[X-1]=arguments[X];if(Y){Y=Y.slice(0);for(var X=0,G=Y.length;X<G;++X)Y[X].apply(this,J)}return this};b.prototype.emitReserved=b.prototype.emit;b.prototype.listeners=function(Z){return this._callbacks=this._callbacks||{},this._callbacks["$"+Z]||[]};b.prototype.hasListeners=function(Z){return!!this.listeners(Z).length};var a0=(()=>{if(typeof Promise==="function"&&typeof Promise.resolve==="function")return(J)=>Promise.resolve().then(J);else return(J,Y)=>Y(J,0)})(),z0=(()=>{if(typeof self!=="undefined")return self;else if(typeof window!=="undefined")return window;else return Function("return this")()})(),A4="arraybuffer";function P4(){}function r1(Z,...J){return J.reduce((Y,X)=>{if(Z.hasOwnProperty(X))Y[X]=Z[X];return Y},{})}var IX=z0.setTimeout,DX=z0.clearTimeout;function r0(Z,J){if(J.useNativeTimers)Z.setTimeoutFn=IX.bind(z0),Z.clearTimeoutFn=DX.bind(z0);else Z.setTimeoutFn=z0.setTimeout.bind(z0),Z.clearTimeoutFn=z0.clearTimeout.bind(z0)}var wX=1.33;function R4(Z){if(typeof Z==="string")return NX(Z);return Math.ceil((Z.byteLength||Z.size)*wX)}function NX(Z){let J=0,Y=0;for(let X=0,G=Z.length;X<G;X++)if(J=Z.charCodeAt(X),J<128)Y+=1;else if(J<2048)Y+=2;else if(J<55296||J>=57344)Y+=3;else X++,Y+=4;return Y}function t1(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function O4(Z){let J="";for(let Y in Z)if(Z.hasOwnProperty(Y)){if(J.length)J+="&";J+=encodeURIComponent(Y)+"="+encodeURIComponent(Z[Y])}return J}function q4(Z){let J={},Y=Z.split("&");for(let X=0,G=Y.length;X<G;X++){let W=Y[X].split("=");J[decodeURIComponent(W[0])]=decodeURIComponent(W[1])}return J}class Y8 extends Error{constructor(Z,J,Y){super(Z);this.description=J,this.context=Y,this.type="TransportError"}}class H9 extends b{constructor(Z){super();this.writable=!1,r0(this,Z),this.opts=Z,this.query=Z.query,this.socket=Z.socket,this.supportsBinary=!Z.forceBase64}onError(Z,J,Y){return super.emitReserved("error",new Y8(Z,J,Y)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){if(this.readyState==="opening"||this.readyState==="open")this.doClose(),this.onClose();return this}send(Z){if(this.readyState==="open")this.write(Z)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(Z){let J=W1(Z,this.socket.binaryType);this.onPacket(J)}onPacket(Z){super.emitReserved("packet",Z)}onClose(Z){this.readyState="closed",super.emitReserved("close",Z)}pause(Z){}createUri(Z,J={}){return Z+"://"+this._hostname()+this._port()+this.opts.path+this._query(J)}_hostname(){let Z=this.opts.hostname;return Z.indexOf(":")===-1?Z:"["+Z+"]"}_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(Z){let J=O4(Z);return J.length?"?"+J:""}}class e1 extends H9{constructor(){super(...arguments);this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(Z){this.readyState="pausing";let J=()=>{this.readyState="paused",Z()};if(this._polling||!this.writable){let Y=0;if(this._polling)Y++,this.once("pollComplete",function(){--Y||J()});if(!this.writable)Y++,this.once("drain",function(){--Y||J()})}else J()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(Z){let J=(Y)=>{if(this.readyState==="opening"&&Y.type==="open")this.onOpen();if(Y.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(Y)};if(D4(Z,this.socket.binaryType).forEach(J),this.readyState!=="closed"){if(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open")this._poll()}}doClose(){let Z=()=>{this.write([{type:"close"}])};if(this.readyState==="open")Z();else this.once("open",Z)}write(Z){this.writable=!1,I4(Z,(J)=>{this.doWrite(J,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let Z=this.opts.secure?"https":"http",J=this.query||{};if(this.opts.timestampRequests!==!1)J[this.opts.timestampParam]=t1();if(!this.supportsBinary&&!J.sid)J.b64=1;return this.createUri(Z,J)}}var T4=!1;try{T4=typeof XMLHttpRequest!=="undefined"&&"withCredentials"in new XMLHttpRequest}catch(Z){}var E4=T4;function AX(){}class S4 extends e1{constructor(Z){super(Z);if(typeof location!=="undefined"){let J=location.protocol==="https:",Y=location.port;if(!Y)Y=J?"443":"80";this.xd=typeof location!=="undefined"&&Z.hostname!==location.hostname||Y!==Z.port}}doWrite(Z,J){let Y=this.request({method:"POST",data:Z});Y.on("success",J),Y.on("error",(X,G)=>{this.onError("xhr post error",X,G)})}doPoll(){let Z=this.request();Z.on("data",this.onData.bind(this)),Z.on("error",(J,Y)=>{this.onError("xhr poll error",J,Y)}),this.pollXhr=Z}}class m0 extends b{constructor(Z,J,Y){super();this.createRequest=Z,r0(this,Y),this._opts=Y,this._method=Y.method||"GET",this._uri=J,this._data=Y.data!==void 0?Y.data:null,this._create()}_create(){var Z;let J=r1(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");J.xdomain=!!this._opts.xd;let Y=this._xhr=this.createRequest(J);try{Y.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){Y.setDisableHeaderCheck&&Y.setDisableHeaderCheck(!0);for(let X in this._opts.extraHeaders)if(this._opts.extraHeaders.hasOwnProperty(X))Y.setRequestHeader(X,this._opts.extraHeaders[X])}}catch(X){}if(this._method==="POST")try{Y.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(X){}try{Y.setRequestHeader("Accept","*/*")}catch(X){}if((Z=this._opts.cookieJar)===null||Z===void 0||Z.addCookies(Y),"withCredentials"in Y)Y.withCredentials=this._opts.withCredentials;if(this._opts.requestTimeout)Y.timeout=this._opts.requestTimeout;Y.onreadystatechange=()=>{var X;if(Y.readyState===3)(X=this._opts.cookieJar)===null||X===void 0||X.parseCookies(Y.getResponseHeader("set-cookie"));if(Y.readyState!==4)return;if(Y.status===200||Y.status===1223)this._onLoad();else this.setTimeoutFn(()=>{this._onError(typeof Y.status==="number"?Y.status:0)},0)},Y.send(this._data)}catch(X){this.setTimeoutFn(()=>{this._onError(X)},0);return}if(typeof document!=="undefined")this._index=m0.requestsCount++,m0.requests[this._index]=this}_onError(Z){this.emitReserved("error",Z,this._xhr),this._cleanup(!0)}_cleanup(Z){if(typeof this._xhr==="undefined"||this._xhr===null)return;if(this._xhr.onreadystatechange=AX,Z)try{this._xhr.abort()}catch(J){}if(typeof document!=="undefined")delete m0.requests[this._index];this._xhr=null}_onLoad(){let Z=this._xhr.responseText;if(Z!==null)this.emitReserved("data",Z),this.emitReserved("success"),this._cleanup()}abort(){this._cleanup()}}m0.requestsCount=0;m0.requests={};if(typeof document!=="undefined"){if(typeof attachEvent==="function")attachEvent("onunload",_4);else if(typeof addEventListener==="function"){let Z="onpagehide"in z0?"pagehide":"unload";addEventListener(Z,_4,!1)}}function _4(){for(let Z in m0.requests)if(m0.requests.hasOwnProperty(Z))m0.requests[Z].abort()}var PX=function(){let Z=j4({xdomain:!1});return Z&&Z.responseType!==null}();class O9 extends S4{constructor(Z){super(Z);let J=Z&&Z.forceBase64;this.supportsBinary=PX&&!J}request(Z={}){return Object.assign(Z,{xd:this.xd},this.opts),new m0(j4,this.uri(),Z)}}function j4(Z){let J=Z.xdomain;try{if(typeof XMLHttpRequest!=="undefined"&&(!J||E4))return new XMLHttpRequest}catch(Y){}if(!J)try{return new z0[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(Y){}}var C4=typeof navigator!=="undefined"&&typeof navigator.product==="string"&&navigator.product.toLowerCase()==="reactnative";class x4 extends H9{get name(){return"websocket"}doOpen(){let Z=this.uri(),J=this.opts.protocols,Y=C4?{}:r1(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");if(this.opts.extraHeaders)Y.headers=this.opts.extraHeaders;try{this.ws=this.createSocket(Z,J,Y)}catch(X){return this.emitReserved("error",X)}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=(Z)=>this.onClose({description:"websocket connection closed",context:Z}),this.ws.onmessage=(Z)=>this.onData(Z.data),this.ws.onerror=(Z)=>this.onError("websocket error",Z)}write(Z){this.writable=!1;for(let J=0;J<Z.length;J++){let Y=Z[J],X=J===Z.length-1;X1(Y,this.supportsBinary,(G)=>{try{this.doWrite(Y,G)}catch(W){}if(X)a0(()=>{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 Z=this.opts.secure?"wss":"ws",J=this.query||{};if(this.opts.timestampRequests)J[this.opts.timestampParam]=t1();if(!this.supportsBinary)J.b64=1;return this.createUri(Z,J)}}var X8=z0.WebSocket||z0.MozWebSocket;class q9 extends x4{createSocket(Z,J,Y){return!C4?J?new X8(Z,J):new X8(Z):new X8(Z,J,Y)}doWrite(Z,J){this.ws.send(J)}}class K1 extends H9{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(Z){return this.emitReserved("error",Z)}this._transport.closed.then(()=>{this.onClose()}).catch((Z)=>{this.onError("webtransport error",Z)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then((Z)=>{let J=N4(Number.MAX_SAFE_INTEGER,this.socket.binaryType),Y=Z.readable.pipeThrough(J).getReader(),X=w4();X.readable.pipeTo(Z.writable),this._writer=X.writable.getWriter();let G=()=>{Y.read().then(({done:K,value:H})=>{if(K)return;this.onPacket(H),G()}).catch((K)=>{})};G();let W={type:"open"};if(this.query.sid)W.data=`{"sid":"${this.query.sid}"}`;this._writer.write(W).then(()=>this.onOpen())})})}write(Z){this.writable=!1;for(let J=0;J<Z.length;J++){let Y=Z[J],X=J===Z.length-1;this._writer.write(Y).then(()=>{if(X)a0(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var Z;(Z=this._transport)===null||Z===void 0||Z.close()}}var G8={websocket:q9,webtransport:K1,polling:O9};var RX=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,OX=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function g9(Z){if(Z.length>8000)throw"URI too long";let J=Z,Y=Z.indexOf("["),X=Z.indexOf("]");if(Y!=-1&&X!=-1)Z=Z.substring(0,Y)+Z.substring(Y,X).replace(/:/g,";")+Z.substring(X,Z.length);let G=RX.exec(Z||""),W={},K=14;while(K--)W[OX[K]]=G[K]||"";if(Y!=-1&&X!=-1)W.source=J,W.host=W.host.substring(1,W.host.length-1).replace(/;/g,":"),W.authority=W.authority.replace("[","").replace("]","").replace(/;/g,":"),W.ipv6uri=!0;return W.pathNames=qX(W,W.path),W.queryKey=TX(W,W.query),W}function qX(Z,J){let Y=/\/{2,9}/g,X=J.replace(Y,"/").split("/");if(J.slice(0,1)=="/"||J.length===0)X.splice(0,1);if(J.slice(-1)=="/")X.splice(X.length-1,1);return X}function TX(Z,J){let Y={};return J.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(X,G,W){if(G)Y[G]=W}),Y}var W8=typeof addEventListener==="function"&&typeof removeEventListener==="function",Z6=[];if(W8)addEventListener("offline",()=>{Z6.forEach((Z)=>Z())},!1);class t0 extends b{constructor(Z,J){super();if(this.binaryType=A4,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,Z&&typeof Z==="object")J=Z,Z=null;if(Z){let Y=g9(Z);if(J.hostname=Y.host,J.secure=Y.protocol==="https"||Y.protocol==="wss",J.port=Y.port,Y.query)J.query=Y.query}else if(J.host)J.hostname=g9(J.host).host;if(r0(this,J),this.secure=J.secure!=null?J.secure:typeof location!=="undefined"&&location.protocol==="https:",J.hostname&&!J.port)J.port=this.secure?"443":"80";if(this.hostname=J.hostname||(typeof location!=="undefined"?location.hostname:"localhost"),this.port=J.port||(typeof location!=="undefined"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},J.transports.forEach((Y)=>{let X=Y.prototype.name;this.transports.push(X),this._transportsByName[X]=Y}),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},J),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query==="string")this.opts.query=q4(this.opts.query);if(W8){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"})},Z6.push(this._offlineEventListener)}if(this.opts.withCredentials)this._cookieJar=P4();this._open()}createTransport(Z){let J=Object.assign({},this.opts.query);if(J.EIO=J8,J.transport=Z,this.id)J.sid=this.id;let Y=Object.assign({},this.opts,{query:J,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[Z]);return new this._transportsByName[Z](Y)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}let Z=this.opts.rememberUpgrade&&t0.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";let J=this.createTransport(Z);J.open(),this.setTransport(J)}setTransport(Z){if(this.transport)this.transport.removeAllListeners();this.transport=Z,Z.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",(J)=>this._onClose("transport close",J))}onOpen(){this.readyState="open",t0.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(Z){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",Z),this.emitReserved("heartbeat"),Z.type){case"open":this.onHandshake(JSON.parse(Z.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let J=new Error("server error");J.code=Z.data,this._onError(J);break;case"message":this.emitReserved("data",Z.data),this.emitReserved("message",Z.data);break}}onHandshake(Z){if(this.emitReserved("handshake",Z),this.id=Z.sid,this.transport.query.sid=Z.sid,this._pingInterval=Z.pingInterval,this._pingTimeout=Z.pingTimeout,this._maxPayload=Z.maxPayload,this.onOpen(),this.readyState==="closed")return;this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let Z=this._pingInterval+this._pingTimeout;if(this._pingTimeoutTime=Date.now()+Z,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},Z),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 Z=this._getWritablePackets();this.transport.send(Z),this._prevBufferLen=Z.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let J=1;for(let Y=0;Y<this.writeBuffer.length;Y++){let X=this.writeBuffer[Y].data;if(X)J+=R4(X);if(Y>0&&J>this._maxPayload)return this.writeBuffer.slice(0,Y);J+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let Z=Date.now()>this._pingTimeoutTime;if(Z)this._pingTimeoutTime=0,a0(()=>{this._onClose("ping timeout")},this.setTimeoutFn);return Z}write(Z,J,Y){return this._sendPacket("message",Z,J,Y),this}send(Z,J,Y){return this._sendPacket("message",Z,J,Y),this}_sendPacket(Z,J,Y,X){if(typeof J==="function")X=J,J=void 0;if(typeof Y==="function")X=Y,Y=null;if(this.readyState==="closing"||this.readyState==="closed")return;Y=Y||{},Y.compress=Y.compress!==!1;let G={type:Z,data:J,options:Y};if(this.emitReserved("packetCreate",G),this.writeBuffer.push(G),X)this.once("flush",X);this.flush()}close(){let Z=()=>{this._onClose("forced close"),this.transport.close()},J=()=>{this.off("upgrade",J),this.off("upgradeError",J),Z()},Y=()=>{this.once("upgrade",J),this.once("upgradeError",J)};if(this.readyState==="opening"||this.readyState==="open")if(this.readyState="closing",this.writeBuffer.length)this.once("drain",()=>{if(this.upgrading)Y();else Z()});else if(this.upgrading)Y();else Z();return this}_onError(Z){if(t0.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",Z),this._onClose("transport error",Z)}_onClose(Z,J){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(),W8){if(this._beforeunloadEventListener)removeEventListener("beforeunload",this._beforeunloadEventListener,!1);if(this._offlineEventListener){let Y=Z6.indexOf(this._offlineEventListener);if(Y!==-1)Z6.splice(Y,1)}}this.readyState="closed",this.id=null,this.emitReserved("close",Z,J),this.writeBuffer=[],this._prevBufferLen=0}}}t0.protocol=J8;class K8 extends t0{constructor(){super(...arguments);this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let Z=0;Z<this._upgrades.length;Z++)this._probe(this._upgrades[Z])}_probe(Z){let J=this.createTransport(Z),Y=!1;t0.priorWebsocketSuccess=!1;let X=()=>{if(Y)return;J.send([{type:"ping",data:"probe"}]),J.once("packet",(Q)=>{if(Y)return;if(Q.type==="pong"&&Q.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",J),!J)return;t0.priorWebsocketSuccess=J.name==="websocket",this.transport.pause(()=>{if(Y)return;if(this.readyState==="closed")return;V(),this.setTransport(J),J.send([{type:"upgrade"}]),this.emitReserved("upgrade",J),J=null,this.upgrading=!1,this.flush()})}else{let L=new Error("probe error");L.transport=J.name,this.emitReserved("upgradeError",L)}})};function G(){if(Y)return;Y=!0,V(),J.close(),J=null}let W=(Q)=>{let L=new Error("probe error: "+Q);L.transport=J.name,G(),this.emitReserved("upgradeError",L)};function K(){W("transport closed")}function H(){W("socket closed")}function z(Q){if(J&&Q.name!==J.name)G()}let V=()=>{J.removeListener("open",X),J.removeListener("error",W),J.removeListener("close",K),this.off("close",H),this.off("upgrading",z)};if(J.once("open",X),J.once("error",W),J.once("close",K),this.once("close",H),this.once("upgrading",z),this._upgrades.indexOf("webtransport")!==-1&&Z!=="webtransport")this.setTimeoutFn(()=>{if(!Y)J.open()},200);else J.open()}onHandshake(Z){this._upgrades=this._filterUpgrades(Z.upgrades),super.onHandshake(Z)}_filterUpgrades(Z){let J=[];for(let Y=0;Y<Z.length;Y++)if(~this.transports.indexOf(Z[Y]))J.push(Z[Y]);return J}}class H1 extends K8{constructor(Z,J={}){let Y=typeof Z==="object"?Z:J;if(!Y.transports||Y.transports&&typeof Y.transports[0]==="string")Y.transports=(Y.transports||["polling","websocket","webtransport"]).map((X)=>G8[X]).filter((X)=>!!X);super(Z,Y)}}var A$=H1.protocol;function k4(Z,J="",Y){let X=Z;if(Y=Y||typeof location!=="undefined"&&location,Z==null)Z=Y.protocol+"//"+Y.host;if(typeof Z==="string"){if(Z.charAt(0)==="/")if(Z.charAt(1)==="/")Z=Y.protocol+Z;else Z=Y.host+Z;if(!/^(https?|wss?):\/\//.test(Z))if(typeof Y!=="undefined")Z=Y.protocol+"//"+Z;else Z="https://"+Z;X=g9(Z)}if(!X.port){if(/^(http|ws)$/.test(X.protocol))X.port="80";else if(/^(http|ws)s$/.test(X.protocol))X.port="443"}X.path=X.path||"/";let W=X.host.indexOf(":")!==-1?"["+X.host+"]":X.host;return X.id=X.protocol+"://"+W+":"+X.port+J,X.href=X.protocol+"://"+W+(Y&&Y.port===X.port?"":":"+X.port),X}var Q8={};gZ(Q8,{protocol:()=>b4,isPacketValid:()=>hX,PacketType:()=>j,Encoder:()=>g4,Decoder:()=>V8});var _X=typeof ArrayBuffer==="function",SX=(Z)=>{return typeof ArrayBuffer.isView==="function"?ArrayBuffer.isView(Z):Z.buffer instanceof ArrayBuffer},f4=Object.prototype.toString,jX=typeof Blob==="function"||typeof Blob!=="undefined"&&f4.call(Blob)==="[object BlobConstructor]",CX=typeof File==="function"||typeof File!=="undefined"&&f4.call(File)==="[object FileConstructor]";function V1(Z){return _X&&(Z instanceof ArrayBuffer||SX(Z))||jX&&Z instanceof Blob||CX&&Z instanceof File}function z1(Z,J){if(!Z||typeof Z!=="object")return!1;if(Array.isArray(Z)){for(let Y=0,X=Z.length;Y<X;Y++)if(z1(Z[Y]))return!0;return!1}if(V1(Z))return!0;if(Z.toJSON&&typeof Z.toJSON==="function"&&arguments.length===1)return z1(Z.toJSON(),!0);for(let Y in Z)if(Object.prototype.hasOwnProperty.call(Z,Y)&&z1(Z[Y]))return!0;return!1}function h4(Z){let J=[],Y=Z.data,X=Z;return X.data=H8(Y,J),X.attachments=J.length,{packet:X,buffers:J}}function H8(Z,J){if(!Z)return Z;if(V1(Z)){let Y={_placeholder:!0,num:J.length};return J.push(Z),Y}else if(Array.isArray(Z)){let Y=new Array(Z.length);for(let X=0;X<Z.length;X++)Y[X]=H8(Z[X],J);return Y}else if(typeof Z==="object"&&!(Z instanceof Date)){let Y={};for(let X in Z)if(Object.prototype.hasOwnProperty.call(Z,X))Y[X]=H8(Z[X],J);return Y}return Z}function y4(Z,J){return Z.data=z8(Z.data,J),delete Z.attachments,Z}function z8(Z,J){if(!Z)return Z;if(Z&&Z._placeholder===!0)if(typeof Z.num==="number"&&Z.num>=0&&Z.num<J.length)return J[Z.num];else throw new Error("illegal attachments");else if(Array.isArray(Z))for(let Y=0;Y<Z.length;Y++)Z[Y]=z8(Z[Y],J);else if(typeof Z==="object"){for(let Y in Z)if(Object.prototype.hasOwnProperty.call(Z,Y))Z[Y]=z8(Z[Y],J)}return Z}var v4=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],b4=5,j;(function(Z){Z[Z.CONNECT=0]="CONNECT",Z[Z.DISCONNECT=1]="DISCONNECT",Z[Z.EVENT=2]="EVENT",Z[Z.ACK=3]="ACK",Z[Z.CONNECT_ERROR=4]="CONNECT_ERROR",Z[Z.BINARY_EVENT=5]="BINARY_EVENT",Z[Z.BINARY_ACK=6]="BINARY_ACK"})(j||(j={}));class g4{constructor(Z){this.replacer=Z}encode(Z){if(Z.type===j.EVENT||Z.type===j.ACK){if(z1(Z))return this.encodeAsBinary({type:Z.type===j.EVENT?j.BINARY_EVENT:j.BINARY_ACK,nsp:Z.nsp,data:Z.data,id:Z.id})}return[this.encodeAsString(Z)]}encodeAsString(Z){let J=""+Z.type;if(Z.type===j.BINARY_EVENT||Z.type===j.BINARY_ACK)J+=Z.attachments+"-";if(Z.nsp&&Z.nsp!=="/")J+=Z.nsp+",";if(Z.id!=null)J+=Z.id;if(Z.data!=null)J+=JSON.stringify(Z.data,this.replacer);return J}encodeAsBinary(Z){let J=h4(Z),Y=this.encodeAsString(J.packet),X=J.buffers;return X.unshift(Y),X}}class V8 extends b{constructor(Z){super();this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof Z==="function"?{reviver:Z}:Z)}add(Z){let J;if(typeof Z==="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");J=this.decodeString(Z);let Y=J.type===j.BINARY_EVENT;if(Y||J.type===j.BINARY_ACK){if(J.type=Y?j.EVENT:j.ACK,this.reconstructor=new m4(J),J.attachments===0)super.emitReserved("decoded",J)}else super.emitReserved("decoded",J)}else if(V1(Z)||Z.base64){if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");else if(J=this.reconstructor.takeBinaryData(Z),J)this.reconstructor=null,super.emitReserved("decoded",J)}else throw new Error("Unknown type: "+Z)}decodeString(Z){let J=0,Y={type:Number(Z.charAt(0))};if(j[Y.type]===void 0)throw new Error("unknown packet type "+Y.type);if(Y.type===j.BINARY_EVENT||Y.type===j.BINARY_ACK){let G=J+1;while(Z.charAt(++J)!=="-"&&J!=Z.length);let W=Z.substring(G,J);if(W!=Number(W)||Z.charAt(J)!=="-")throw new Error("Illegal attachments");let K=Number(W);if(!d4(K)||K<0)throw new Error("Illegal attachments");else if(K>this.opts.maxAttachments)throw new Error("too many attachments");Y.attachments=K}if(Z.charAt(J+1)==="/"){let G=J+1;while(++J){if(Z.charAt(J)===",")break;if(J===Z.length)break}Y.nsp=Z.substring(G,J)}else Y.nsp="/";let X=Z.charAt(J+1);if(X!==""&&Number(X)==X){let G=J+1;while(++J){let W=Z.charAt(J);if(W==null||Number(W)!=W){--J;break}if(J===Z.length)break}Y.id=Number(Z.substring(G,J+1))}if(Z.charAt(++J)){let G=this.tryParse(Z.substr(J));if(V8.isPayloadValid(Y.type,G))Y.data=G;else throw new Error("invalid payload")}return Y}tryParse(Z){try{return JSON.parse(Z,this.opts.reviver)}catch(J){return!1}}static isPayloadValid(Z,J){switch(Z){case j.CONNECT:return J6(J);case j.DISCONNECT:return J===void 0;case j.CONNECT_ERROR:return typeof J==="string"||J6(J);case j.EVENT:case j.BINARY_EVENT:return Array.isArray(J)&&(typeof J[0]==="number"||typeof J[0]==="string"&&v4.indexOf(J[0])===-1);case j.ACK:case j.BINARY_ACK:return Array.isArray(J)}}destroy(){if(this.reconstructor)this.reconstructor.finishedReconstruction(),this.reconstructor=null}}class m4{constructor(Z){this.packet=Z,this.buffers=[],this.reconPack=Z}takeBinaryData(Z){if(this.buffers.push(Z),this.buffers.length===this.reconPack.attachments){let J=y4(this.reconPack,this.buffers);return this.finishedReconstruction(),J}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function xX(Z){return typeof Z==="string"}var d4=Number.isInteger||function(Z){return typeof Z==="number"&&isFinite(Z)&&Math.floor(Z)===Z};function kX(Z){return Z===void 0||d4(Z)}function J6(Z){return Object.prototype.toString.call(Z)==="[object Object]"}function fX(Z,J){switch(Z){case j.CONNECT:return J===void 0||J6(J);case j.DISCONNECT:return J===void 0;case j.EVENT:return Array.isArray(J)&&(typeof J[0]==="number"||typeof J[0]==="string"&&v4.indexOf(J[0])===-1);case j.ACK:return Array.isArray(J);case j.CONNECT_ERROR:return typeof J==="string"||J6(J);default:return!1}}function hX(Z){return xX(Z.nsp)&&kX(Z.id)&&fX(Z.type,Z.data)}function P0(Z,J,Y){return Z.on(J,Y),function X(){Z.off(J,Y)}}var yX=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Q1 extends b{constructor(Z,J,Y){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=Z,this.nsp=J,Y&&Y.auth)this.auth=Y.auth;if(this._opts=Object.assign({},Y),this.io._autoConnect)this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let Z=this.io;this.subs=[P0(Z,"open",this.onopen.bind(this)),P0(Z,"packet",this.onpacket.bind(this)),P0(Z,"error",this.onerror.bind(this)),P0(Z,"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(...Z){return Z.unshift("message"),this.emit.apply(this,Z),this}emit(Z,...J){var Y,X,G;if(yX.hasOwnProperty(Z))throw new Error('"'+Z.toString()+'" is a reserved event name');if(J.unshift(Z),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(J),this;let W={type:j.EVENT,data:J};if(W.options={},W.options.compress=this.flags.compress!==!1,typeof J[J.length-1]==="function"){let V=this.ids++,Q=J.pop();this._registerAckCallback(V,Q),W.id=V}let K=(X=(Y=this.io.engine)===null||Y===void 0?void 0:Y.transport)===null||X===void 0?void 0:X.writable,H=this.connected&&!((G=this.io.engine)===null||G===void 0?void 0:G._hasPingExpired());if(this.flags.volatile&&!K);else if(H)this.notifyOutgoingListeners(W),this.packet(W);else this.sendBuffer.push(W);return this.flags={},this}_registerAckCallback(Z,J){var Y;let X=(Y=this.flags.timeout)!==null&&Y!==void 0?Y:this._opts.ackTimeout;if(X===void 0){this.acks[Z]=J;return}let G=this.io.setTimeoutFn(()=>{delete this.acks[Z];for(let K=0;K<this.sendBuffer.length;K++)if(this.sendBuffer[K].id===Z)this.sendBuffer.splice(K,1);J.call(this,new Error("operation has timed out"))},X),W=(...K)=>{this.io.clearTimeoutFn(G),J.apply(this,K)};W.withError=!0,this.acks[Z]=W}emitWithAck(Z,...J){return new Promise((Y,X)=>{let G=(W,K)=>{return W?X(W):Y(K)};G.withError=!0,J.push(G),this.emit(Z,...J)})}_addToQueue(Z){let J;if(typeof Z[Z.length-1]==="function")J=Z.pop();let Y={id:this._queueSeq++,tryCount:0,pending:!1,args:Z,flags:Object.assign({fromQueue:!0},this.flags)};Z.push((X,...G)=>{if(Y!==this._queue[0]);if(X!==null){if(Y.tryCount>this._opts.retries){if(this._queue.shift(),J)J(X)}}else if(this._queue.shift(),J)J(null,...G);return Y.pending=!1,this._drainQueue()}),this._queue.push(Y),this._drainQueue()}_drainQueue(Z=!1){if(!this.connected||this._queue.length===0)return;let J=this._queue[0];if(J.pending&&!Z)return;J.pending=!0,J.tryCount++,this.flags=J.flags,this.emit.apply(this,J.args)}packet(Z){Z.nsp=this.nsp,this.io._packet(Z)}onopen(){if(typeof this.auth=="function")this.auth((Z)=>{this._sendConnectPacket(Z)});else this._sendConnectPacket(this.auth)}_sendConnectPacket(Z){this.packet({type:j.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},Z):Z})}onerror(Z){if(!this.connected)this.emitReserved("connect_error",Z)}onclose(Z,J){this.connected=!1,delete this.id,this.emitReserved("disconnect",Z,J),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach((Z)=>{if(!this.sendBuffer.some((Y)=>String(Y.id)===Z)){let Y=this.acks[Z];if(delete this.acks[Z],Y.withError)Y.call(this,new Error("socket has been disconnected"))}})}onpacket(Z){if(Z.nsp!==this.nsp)return;switch(Z.type){case j.CONNECT:if(Z.data&&Z.data.sid)this.onconnect(Z.data.sid,Z.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 j.EVENT:case j.BINARY_EVENT:this.onevent(Z);break;case j.ACK:case j.BINARY_ACK:this.onack(Z);break;case j.DISCONNECT:this.ondisconnect();break;case j.CONNECT_ERROR:this.destroy();let Y=new Error(Z.data.message);Y.data=Z.data.data,this.emitReserved("connect_error",Y);break}}onevent(Z){let J=Z.data||[];if(Z.id!=null)J.push(this.ack(Z.id));if(this.connected)this.emitEvent(J);else this.receiveBuffer.push(Object.freeze(J))}emitEvent(Z){if(this._anyListeners&&this._anyListeners.length){let J=this._anyListeners.slice();for(let Y of J)Y.apply(this,Z)}if(super.emit.apply(this,Z),this._pid&&Z.length&&typeof Z[Z.length-1]==="string")this._lastOffset=Z[Z.length-1]}ack(Z){let J=this,Y=!1;return function(...X){if(Y)return;Y=!0,J.packet({type:j.ACK,id:Z,data:X})}}onack(Z){let J=this.acks[Z.id];if(typeof J!=="function")return;if(delete this.acks[Z.id],J.withError)Z.data.unshift(null);J.apply(this,Z.data)}onconnect(Z,J){this.id=Z,this.recovered=J&&this._pid===J,this._pid=J,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach((Z)=>this.emitEvent(Z)),this.receiveBuffer=[],this.sendBuffer.forEach((Z)=>{this.notifyOutgoingListeners(Z),this.packet(Z)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){if(this.subs)this.subs.forEach((Z)=>Z()),this.subs=void 0;this.io._destroy(this)}disconnect(){if(this.connected)this.packet({type:j.DISCONNECT});if(this.destroy(),this.connected)this.onclose("io client disconnect");return this}close(){return this.disconnect()}compress(Z){return this.flags.compress=Z,this}get volatile(){return this.flags.volatile=!0,this}timeout(Z){return this.flags.timeout=Z,this}onAny(Z){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(Z),this}prependAny(Z){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(Z),this}offAny(Z){if(!this._anyListeners)return this;if(Z){let J=this._anyListeners;for(let Y=0;Y<J.length;Y++)if(Z===J[Y])return J.splice(Y,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(Z){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(Z),this}prependAnyOutgoing(Z){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(Z),this}offAnyOutgoing(Z){if(!this._anyOutgoingListeners)return this;if(Z){let J=this._anyOutgoingListeners;for(let Y=0;Y<J.length;Y++)if(Z===J[Y])return J.splice(Y,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(Z){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let J=this._anyOutgoingListeners.slice();for(let Y of J)Y.apply(this,Z.data)}}}function T9(Z){Z=Z||{},this.ms=Z.min||100,this.max=Z.max||1e4,this.factor=Z.factor||2,this.jitter=Z.jitter>0&&Z.jitter<=1?Z.jitter:0,this.attempts=0}T9.prototype.duration=function(){var Z=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var J=Math.random(),Y=Math.floor(J*this.jitter*Z);Z=(Math.floor(J*10)&1)==0?Z-Y:Z+Y}return Math.min(Z,this.max)|0};T9.prototype.reset=function(){this.attempts=0};T9.prototype.setMin=function(Z){this.ms=Z};T9.prototype.setMax=function(Z){this.max=Z};T9.prototype.setJitter=function(Z){this.jitter=Z};class $1 extends b{constructor(Z,J){var Y;super();if(this.nsps={},this.subs=[],Z&&typeof Z==="object")J=Z,Z=void 0;J=J||{},J.path=J.path||"/socket.io",this.opts=J,r0(this,J),this.reconnection(J.reconnection!==!1),this.reconnectionAttempts(J.reconnectionAttempts||1/0),this.reconnectionDelay(J.reconnectionDelay||1000),this.reconnectionDelayMax(J.reconnectionDelayMax||5000),this.randomizationFactor((Y=J.randomizationFactor)!==null&&Y!==void 0?Y:0.5),this.backoff=new T9({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(J.timeout==null?20000:J.timeout),this._readyState="closed",this.uri=Z;let X=J.parser||Q8;if(this.encoder=new X.Encoder,this.decoder=new X.Decoder,this._autoConnect=J.autoConnect!==!1,this._autoConnect)this.open()}reconnection(Z){if(!arguments.length)return this._reconnection;if(this._reconnection=!!Z,!Z)this.skipReconnect=!0;return this}reconnectionAttempts(Z){if(Z===void 0)return this._reconnectionAttempts;return this._reconnectionAttempts=Z,this}reconnectionDelay(Z){var J;if(Z===void 0)return this._reconnectionDelay;return this._reconnectionDelay=Z,(J=this.backoff)===null||J===void 0||J.setMin(Z),this}randomizationFactor(Z){var J;if(Z===void 0)return this._randomizationFactor;return this._randomizationFactor=Z,(J=this.backoff)===null||J===void 0||J.setJitter(Z),this}reconnectionDelayMax(Z){var J;if(Z===void 0)return this._reconnectionDelayMax;return this._reconnectionDelayMax=Z,(J=this.backoff)===null||J===void 0||J.setMax(Z),this}timeout(Z){if(!arguments.length)return this._timeout;return this._timeout=Z,this}maybeReconnectOnOpen(){if(!this._reconnecting&&this._reconnection&&this.backoff.attempts===0)this.reconnect()}open(Z){if(~this._readyState.indexOf("open"))return this;this.engine=new H1(this.uri,this.opts);let J=this.engine,Y=this;this._readyState="opening",this.skipReconnect=!1;let X=P0(J,"open",function(){Y.onopen(),Z&&Z()}),G=(K)=>{if(this.cleanup(),this._readyState="closed",this.emitReserved("error",K),Z)Z(K);else this.maybeReconnectOnOpen()},W=P0(J,"error",G);if(this._timeout!==!1){let K=this._timeout,H=this.setTimeoutFn(()=>{X(),G(new Error("timeout")),J.close()},K);if(this.opts.autoUnref)H.unref();this.subs.push(()=>{this.clearTimeoutFn(H)})}return this.subs.push(X),this.subs.push(W),this}connect(Z){return this.open(Z)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let Z=this.engine;this.subs.push(P0(Z,"ping",this.onping.bind(this)),P0(Z,"data",this.ondata.bind(this)),P0(Z,"error",this.onerror.bind(this)),P0(Z,"close",this.onclose.bind(this)),P0(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(Z){try{this.decoder.add(Z)}catch(J){this.onclose("parse error",J)}}ondecoded(Z){a0(()=>{this.emitReserved("packet",Z)},this.setTimeoutFn)}onerror(Z){this.emitReserved("error",Z)}socket(Z,J){let Y=this.nsps[Z];if(!Y)Y=new Q1(this,Z,J),this.nsps[Z]=Y;else if(this._autoConnect&&!Y.active)Y.connect();return Y}_destroy(Z){let J=Object.keys(this.nsps);for(let Y of J)if(this.nsps[Y].active)return;this._close()}_packet(Z){let J=this.encoder.encode(Z);for(let Y=0;Y<J.length;Y++)this.engine.write(J[Y],Z.options)}cleanup(){this.subs.forEach((Z)=>Z()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(Z,J){var Y;if(this.cleanup(),(Y=this.engine)===null||Y===void 0||Y.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",Z,J),this._reconnection&&!this.skipReconnect)this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let Z=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let J=this.backoff.duration();this._reconnecting=!0;let Y=this.setTimeoutFn(()=>{if(Z.skipReconnect)return;if(this.emitReserved("reconnect_attempt",Z.backoff.attempts),Z.skipReconnect)return;Z.open((X)=>{if(X)Z._reconnecting=!1,Z.reconnect(),this.emitReserved("reconnect_error",X);else Z.onreconnect()})},J);if(this.opts.autoUnref)Y.unref();this.subs.push(()=>{this.clearTimeoutFn(Y)})}}onreconnect(){let Z=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",Z)}}var U1={};function B1(Z,J){if(typeof Z==="object")J=Z,Z=void 0;J=J||{};let Y=k4(Z,J.path||"/socket.io"),X=Y.source,G=Y.id,W=Y.path,K=U1[G]&&W in U1[G].nsps,H=J.forceNew||J["force new connection"]||J.multiplex===!1||K,z;if(H)z=new $1(X,J);else{if(!U1[G])U1[G]=new $1(X,J);z=U1[G]}if(Y.query&&!J.query)J.query=Y.queryKey;return z.socket(Y.path,J)}Object.assign(B1,{Manager:$1,Socket:Q1,io:B1,connect:B1});import{createContext as vX}from"react";var p4=new Map,z9=(Z)=>{let J=p4.get(Z);if(J)return J;let Y=B1(Z,{autoConnect:!1,transports:["websocket"]});return p4.set(Z,Y),Y},bX=vX(null),S0=bX;function $8(Z){return{all:Z=Z||new Map,on:function(J,Y){var X=Z.get(J);X?X.push(Y):Z.set(J,[Y])},off:function(J,Y){var X=Z.get(J);X&&(Y?X.splice(X.indexOf(Y)>>>0,1):Z.set(J,[]))},emit:function(J,Y){var X=Z.get(J);X&&X.slice().map(function(G){G(Y)}),(X=Z.get("*"))&&X.slice().map(function(G){G(J,Y)})}}}import{createContext as gX}from"react";var U8=null;function V9(){if(!U8)U8=$8();return U8}var mX=gX(null),j0=mX;var pX=({card:Z,data:J,children:Y,useSocketioSupport:X=!1,useCentrifugeSupport:G=!1,useMittSupport:W=!1,centrifugeChannel:K=void 0,methods:H=void 0})=>{let z=mZ(),V=dX(H);if(Y6(()=>{V.current=H},[H]),z)console.log("[PieCard] Rendering card:",Z),console.log("[PieCard] Card data:",J),console.log("[PieCard] Component name:",J?.name),console.log("[PieCard] Real-time support:",{socketio:X,centrifuge:G,mitt:W,centrifugeChannel:K}),console.log("[PieCard] Methods:",H?Object.keys(H):"none"),console.log("[PieCard] Has children:",!!Y);let Q=B8(S0),L=B8(_0),F=B8(j0);if(Y6(()=>{if(!Q||!X||!V.current||!J.name){if(z&&X)console.log("[PieCard] Socket.IO setup skipped:",{hasSocket:!!Q,useSocketioSupport:X,hasMethods:!!V.current,hasDataName:!!J?.name});return}let M=Object.keys(V.current??{});return M.forEach(($)=>{let U=`pie${$}_${J.name}`;if(z)console.log(`[PieCard] Socket.IO registering event: ${U}`);Q.on(U,(B)=>{V.current?.[$]?.(B)})}),()=>{M.forEach(($)=>{let U=`pie${$}_${J.name}`;if(z)console.log(`[PieCard] Socket.IO unregistering event: ${U}`);Q.off(U)})}},[Q,J.name,X]),Y6(()=>{if(!L||!G||!K||!J.name){if(z&&G)console.log("[PieCard] Centrifuge setup skipped:",{hasCentrifuge:!!L,useCentrifugeSupport:G,hasCentrifugeChannel:!!K,hasMethods:!!V.current,hasDataName:!!J?.name});return}let $=Object.keys(V.current??{}).map((U)=>{let B=`pie${U}_${J.name}_${K}`;if(z)console.log(`[PieCard] Centrifuge subscribing to channel: ${B}`);let D=L.newSubscription(B);return D.on("publication",(N)=>{if(z)console.log(`[PieCard] Centrifuge received data on ${B}:`,N.data);V.current?.[U]?.(N.data)}),D.subscribe(),D});return()=>{$.forEach((U)=>{if(z)console.log("[PieCard] Centrifuge unsubscribing from channel");U.unsubscribe(),L.removeSubscription(U)})}},[L,K,J.name,G]),Y6(()=>{if(!F||!W||!J.name){if(z&&W)console.log("[PieCard] Mitt setup skipped:",{hasMitt:!!F,useMittSupport:W,hasMethods:!!V.current,hasDataName:!!J?.name});return}let M=Object.keys(V.current??{}),$={};return M.forEach((U)=>{let B=`pie${U}_${J.name}`,D=(N)=>{if(z)console.log(`[PieCard] Mitt registering event: ${B}`);V.current?.[U]?.(N)};$[B]=D,F.on(B,D)}),()=>{Object.entries($).forEach(([U,B])=>{if(z)console.log(`[PieCard] Mitt unregistering event: ${U}`);F.off(U,B)})}},[F,J.name,W]),z)console.log("[PieCard] Rendering complete, returning children");return Y},V0=pX;import{lazy as uX}from"react";var L8=new Map;function u4(Z,J){return uX(()=>{if(L8.has(J))return L8.get(J);let Y=Z().then((X)=>X);return L8.set(J,Y),Y})}var Q9=new Map,cX=(Z)=>{if(!Z.name)throw new Error("Component registration requires a name");if(!Z.component&&!Z.loader)throw new Error(`Component "${Z.name}" requires component or loader`);let J={name:Z.name,component:Z.component,loader:Z.loader,metadata:Z.metadata,fallback:Z.fallback,isLazy:!1};if(!J.component&&J.loader)J.component=u4(J.loader,Z.name),J.loader=void 0,J.isLazy=!0;return J};function Z0(Z){let J=cX(Z);return Q9.set(J.name,J),J.component}var lX=(Z)=>{Z.forEach((J)=>Z0(J))},iX=(Z)=>{Q9.delete(Z)},nX=(Z)=>{return Q9.has(Z)},oX=(Z)=>{return Q9.get(Z)?.metadata},L1=(Z)=>{return Q9.get(Z)},sX=()=>{return Array.from(Q9.keys())},aX=()=>{return Q9.size};import{Suspense as JG,useContext as YG,memo as XG}from"react";import{createContext as rX}from"react";import{jsx as ZG,Fragment as eX}from"react/jsx-runtime";var tX=rX(ZG(eX,{})),G0=tX;import{jsx as F8}from"react/jsx-runtime";function GG({uiConfig:Z,setUiAjaxConfiguration:J}){let Y=YG(G0),X=A0();if(X)console.log("[UI] Rendering component:",Z.card),console.log("[UI] Component data:",Z.data),console.log("[UI] Component content:",Z.content),console.log("[UI] Has setUiAjaxConfiguration:",!!J);let G=L1(Z.card);if(!G?.component){if(X)console.warn(`[UI] Component not found in registry: ${Z.card}`),console.log("[UI] Returning fallback component");return Y}if(X)console.log("[UI] Found component in registry:",{name:G.name,isLazy:G.isLazy,hasMetadata:!!G.metadata});let W=G.component,K=F8(W,{data:Z.data,content:Z.content,setUiAjaxConfiguration:J});if(G.isLazy){if(X)console.log("[UI] Rendering lazy component with Suspense:",G.name);return F8(JG,{fallback:G.fallback?F8(G.fallback,{}):Y,children:K},`${G.name}`)}if(X)console.log("[UI] Rendering component directly:",G.name);return K}var Q0=XG(GG);import{Suspense as HG,useContext as zG}from"react";import{createContext as WG}from"react";var KG=WG(null),f0=KG;import{jsx as X6}from"react/jsx-runtime";function c4({uiConfig:Z,setUiAjaxConfiguration:J}){let Y=zG(G0),X=A0();if(X)console.log("[UILoading] Rendering fallback for:",Z.card),console.log("[UILoading] Component data:",Z.data),console.log("[UILoading] Component content:",Z.content),console.log("[UILoading] Has setUiAjaxConfiguration:",!!J);let G=L1(Z.card);if(!G?.component){if(X)console.warn(`[UILoading] Component not found in registry: ${Z.card}`),console.log("[UILoading] Returning fallback component");return Y}if(X)console.log("[UILoading] Found component in registry:",{name:G.name,isLazy:G.isLazy,hasMetadata:!!G.metadata,hasFallback:!!G.fallback});if(G.fallback){if(X)console.log("[UILoading] Rendering fallback for:",G.name);let H=G.fallback;return X6(H,{})}if(X)console.log("[UILoading] No fallback, rendering full component:",G.name);let W=G.component,K=X6(f0.Provider,{value:c4,children:X6(W,{data:Z.data,content:Z.content,setUiAjaxConfiguration:J})});if(G.isLazy)return X6(HG,{fallback:Y,children:K},`${G.name}`);return K}var M8=c4;import{useContext as VG}from"react";import{jsx as I8}from"react/jsx-runtime";var QG=({data:Z,content:J,setUiAjaxConfiguration:Y})=>{let{name:X,sx:G}=Z,W=VG(f0)??Q0;return I8(V0,{card:X,data:Z,children:I8("div",{style:G,id:X,children:J.map((K,H)=>{return I8(W,{uiConfig:K,setUiAjaxConfiguration:Y},`children-${H}`)})})})},l4=QG;var $G=Z0({name:"SequenceCard",component:l4,metadata:{author:"PieData",description:"Simple div with styles joining few components"}});import{useContext as UG}from"react";import{jsx as i4}from"react/jsx-runtime";var BG=({data:Z,content:J,setUiAjaxConfiguration:Y})=>{let{name:X}=Z,G=UG(f0)??Q0;return i4(V0,{card:X,data:Z,children:J.map((W,K)=>{return i4(G,{uiConfig:W,setUiAjaxConfiguration:Y},`children-${K}`)})})},n4=BG;var LG=Z0({name:"UnionCard",component:n4,metadata:{author:"PieData",description:"Renders one of many components"}});import{useEffect as BW,useState as LW}from"react";var y8=e9(h8(),1),_9=e9(h8(),1),eJ=y8.default.default||y8.default;import{useCallback as $6,useEffect as QW,useRef as v8,useState as $W}from"react";function UW(){let Z=new AudioContext,J=Z.createOscillator(),Y=J.connect(Z.createMediaStreamDestination());J.start();let X=Y.stream.getAudioTracks()[0];return X.enabled=!1,X}function U6(Z=null,J){let[Y,X]=$W(!1),G=v8(null),W=v8(null),K=v8(null),H=$6(async(L,F=!0)=>{if(G.current)z();let M=new RTCPeerConnection;if(M.onconnectionstatechange=()=>{if(M.connectionState==="connected")X(!0);else if(["disconnected","failed","closed"].includes(M.connectionState))X(!1)},M.ontrack=(P)=>{if(Z)Z.srcObject=P.streams[0]},F){let P=await navigator.mediaDevices.getUserMedia({audio:!0});M.addTrack(P.getTracks()[0],P)}else{let P=UW();M.addTrack(P)}let $=M.createDataChannel("oai-events");W.current=$,K.current=new Promise((P)=>{$.addEventListener("open",()=>{P()})});let U=await M.createOffer();await M.setLocalDescription(U);let w=await(await fetch(`${"https://api.openai.com/v1/realtime/calls"}?model=${"gpt-realtime"}`,{method:"POST",body:U.sdp,headers:{Authorization:`Bearer ${L}`,"Content-Type":"application/sdp"}})).text();await M.setRemoteDescription({type:"answer",sdp:w}),G.current=M,await K.current},[Z]),z=$6(()=>{let L=W.current;if(L)L.close();G.current?.getSenders()?.forEach((F)=>F.track?.stop()),G.current?.close(),X(!1),G.current=null,W.current=null,K.current=null},[Z]),V=$6((L)=>{let F=W.current;if(!F){console.error("Data channel is not ready",L);return}let M=new Date().toLocaleTimeString();if(L.event_id=L.event_id||crypto.randomUUID(),F.send(JSON.stringify(L)),!L.timestamp)L.timestamp=M;J?.(L)},[J,Z]),Q=$6((L)=>{if(!W.current){console.error("Data channel is not ready");return}let M=()=>{V({type:"conversation.item.create",item:{type:"message",role:"user",content:[{type:"input_text",text:L}]}}),V({type:"response.create"})};if(K.current)K.current.then(M);else M()},[J,Z]);return QW(()=>{let L=W.current;if(!L)return;let F=(M)=>{let $=JSON.parse(M.data);if(!$.timestamp)$.timestamp=new Date().toLocaleTimeString();J?.($)};return L.addEventListener("message",F),()=>{L.removeEventListener("message",F)}},[J,Z]),{isSessionActive:Y,startSession:H,stopSession:z,sendTextMessage:Q}}import{jsx as MW}from"react/jsx-runtime";var FW=({data:Z})=>{let{html:J,useSocketioSupport:Y,useCentrifugeSupport:X,useMittSupport:G,centrifugeChannel:W}=Z,[K,H]=LW(J),{isSessionActive:z,startSession:V,sendTextMessage:Q}=U6(null,($)=>{if(console.log($.type,$.type==="response.output_text.delta"&&$.delta),$.type==="response.output_text.delta"&&$.delta)H((U)=>U+$.delta)});return BW(()=>{H(J)},[J]),MW(V0,{card:"HTMLEmbedCard",data:Z,methods:{update:($)=>{H($.value)},generateUsingAI:async($)=>{try{if(!z&&$.token)await V($.token,!1);Q($.prompt)}catch(U){console.error("Failed to generate using AI",U)}},initializeAI:async($)=>{if(!z&&$.token)await V($.token,!1)}},useCentrifugeSupport:X,useSocketioSupport:Y,useMittSupport:G,centrifugeChannel:W,children:eJ(K)})},ZY=FW;var IW=Z0({name:"HTMLEmbedCard",component:ZY,metadata:{author:"PieData"}});import{useEffect as DW,useState as wW}from"react";import{jsx as JY}from"react/jsx-runtime";var NW=({data:Z})=>{let{name:J,value:Y,useSocketioSupport:X,useCentrifugeSupport:G,useMittSupport:W,centrifugeChannel:K}=Z,[H,z]=wW(Y);return DW(()=>{z(Y)},[Y]),JY(V0,{card:"HiddenCard",data:Z,useSocketioSupport:X,useCentrifugeSupport:G,useMittSupport:W,centrifugeChannel:K,methods:{update:({value:V})=>{z(V)}},children:JY("input",{type:"hidden",id:J,name:J,value:H})})},YY=NW;var AW=Z0({name:"HiddenCard",component:YY,metadata:{author:"PieData"}});import{useContext as XY,useEffect as OW}from"react";import{createContext as PW}from"react";var RW=PW(void 0),I0=RW;import{jsx as EW,Fragment as TW}from"react/jsx-runtime";var qW=({data:Z})=>{let{url:J}=Z,Y=XY(I0),X=XY(G0);return OW(()=>{if(/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(J))window.location.href=J;else Y?.(J)},[J,Y]),EW(TW,{children:X})},GY=qW;var _W=Z0({name:"AutoRedirectCard",component:GY,metadata:{author:"PieData"}});import{isValidElement as jW}from"react";import KY,{useEffect as kW,useLayoutEffect as fW,useRef as hW}from"react";import{cloneElement as vW,isValidElement as bW}from"react";import g8 from"react";import m8 from"react";function WY(Z){var J,Y,X="";if(typeof Z=="string"||typeof Z=="number")X+=Z;else if(typeof Z=="object")if(Array.isArray(Z)){var G=Z.length;for(J=0;J<G;J++)Z[J]&&(Y=WY(Z[J]))&&(X&&(X+=" "),X+=Y)}else for(Y in Z)Z[Y]&&(X&&(X+=" "),X+=Y);return X}function b8(){for(var Z,J,Y=0,X="",G=arguments.length;Y<G;Y++)(Z=arguments[Y])&&(J=WY(Z))&&(X&&(X+=" "),X+=J);return X}var p0=b8;import d8,{useEffect as dW,useRef as pW,useState as uW}from"react";import{useRef as XK,useSyncExternalStore as GK}from"react";import{useEffect as KK,useRef as zY,useState as VY}from"react";import{useEffect as zK,useLayoutEffect as VK}from"react";import B6,{cloneElement as $K,isValidElement as UK}from"react";import u0,{cloneElement as BK,isValidElement as LK}from"react";function SW(Z){if(!Z||typeof document=="undefined")return;let J=document.head||document.getElementsByTagName("head")[0],Y=document.createElement("style");Y.type="text/css",J.firstChild?J.insertBefore(Y,J.firstChild):J.appendChild(Y),Y.styleSheet?Y.styleSheet.cssText=Z:Y.appendChild(document.createTextNode(Z))}SW(":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 q1=(Z)=>typeof Z=="number"&&!isNaN(Z),S9=(Z)=>typeof Z=="string",e0=(Z)=>typeof Z=="function",CW=(Z)=>S9(Z)||q1(Z),p8=(Z)=>S9(Z)||e0(Z)?Z:null,xW=(Z,J)=>Z===!1||q1(Z)&&Z>0?Z:J,u8=(Z)=>jW(Z)||S9(Z)||e0(Z)||q1(Z);function yW(Z,J,Y=300){let{scrollHeight:X,style:G}=Z;requestAnimationFrame(()=>{G.minHeight="initial",G.height=X+"px",G.transition=`all ${Y}ms`,requestAnimationFrame(()=>{G.height="0",G.padding="0",G.margin="0",setTimeout(J,Y)})})}function L6({enter:Z,exit:J,appendPosition:Y=!1,collapse:X=!0,collapseDuration:G=300}){return function({children:W,position:K,preventExitTransition:H,done:z,nodeRef:V,isIn:Q,playToast:L}){let F=Y?`${Z}--${K}`:Z,M=Y?`${J}--${K}`:J,$=hW(0);return fW(()=>{let U=V.current,B=F.split(" "),D=(N)=>{N.target===V.current&&(L(),U.removeEventListener("animationend",D),U.removeEventListener("animationcancel",D),$.current===0&&N.type!=="animationcancel"&&U.classList.remove(...B))};(()=>{U.classList.add(...B),U.addEventListener("animationend",D),U.addEventListener("animationcancel",D)})()},[]),kW(()=>{let U=V.current,B=()=>{U.removeEventListener("animationend",B),X?yW(U,z,G):z()};Q||(H?B():(()=>{$.current=1,U.className+=` ${M}`,U.addEventListener("animationend",B)})())},[Q]),KY.createElement(KY.Fragment,null,W)}}function HY(Z,J){return{content:QY(Z.content,Z.props),containerId:Z.props.containerId,id:Z.props.toastId,theme:Z.props.theme,type:Z.props.type,data:Z.props.data||{},isLoading:Z.props.isLoading,icon:Z.props.icon,reason:Z.removalReason,status:J}}function QY(Z,J,Y=!1){return bW(Z)&&!S9(Z.type)?vW(Z,{closeToast:J.closeToast,toastProps:J,data:J.data,isPaused:Y}):e0(Z)?Z({closeToast:J.closeToast,toastProps:J,data:J.data,isPaused:Y}):Z}function gW({closeToast:Z,theme:J,ariaLabel:Y="close"}){return g8.createElement("button",{className:`Toastify__close-button Toastify__close-button--${J}`,type:"button",onClick:(X)=>{X.stopPropagation(),Z(!0)},"aria-label":Y},g8.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},g8.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 mW({delay:Z,isRunning:J,closeToast:Y,type:X="default",hide:G,className:W,controlledProgress:K,progress:H,rtl:z,isIn:V,theme:Q}){let L=G||K&&H===0,F={animationDuration:`${Z}ms`,animationPlayState:J?"running":"paused"};K&&(F.transform=`scaleX(${H})`);let M=p0("Toastify__progress-bar",K?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${Q}`,`Toastify__progress-bar--${X}`,{["Toastify__progress-bar--rtl"]:z}),$=e0(W)?W({rtl:z,type:X,defaultClassName:M}):p0(M,W),U={[K&&H>=1?"onTransitionEnd":"onAnimationEnd"]:K&&H<1?null:()=>{V&&Y()}};return m8.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":L},m8.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${Q} Toastify__progress-bar--${X}`}),m8.createElement("div",{role:"progressbar","aria-hidden":L?"true":"false","aria-label":"notification timer",className:$,style:F,...U}))}var cW=1,$Y=()=>`${cW++}`;function lW(Z,J,Y){let X=1,G=0,W=[],K=[],H=J,z=new Map,V=new Set,Q=(N)=>(V.add(N),()=>V.delete(N)),L=()=>{K=Array.from(z.values()),V.forEach((N)=>N())},F=({containerId:N,toastId:w,updateId:P})=>{let T=N?N!==Z:Z!==1,k=z.has(w)&&P==null;return T||k},M=(N,w)=>{z.forEach((P)=>{var T;(w==null||w===P.props.toastId)&&((T=P.toggle)==null||T.call(P,N))})},$=(N)=>{var w,P;(P=(w=N.props)==null?void 0:w.onClose)==null||P.call(w,N.removalReason),N.isActive=!1},U=(N)=>{if(N==null)z.forEach($);else{let w=z.get(N);w&&$(w)}L()},B=()=>{G-=W.length,W=[]},D=(N)=>{var w,P;let{toastId:T,updateId:k}=N.props,q=k==null;N.staleId&&z.delete(N.staleId),N.isActive=!0,z.set(T,N),L(),Y(HY(N,q?"added":"updated")),q&&((P=(w=N.props).onOpen)==null||P.call(w))};return{id:Z,props:H,observe:Q,toggle:M,removeToast:U,toasts:z,clearQueue:B,buildToast:(N,w)=>{if(F(w))return;let{toastId:P,updateId:T,data:k,staleId:q,delay:A}=w,f=T==null;f&&G++;let u={...H,style:H.toastStyle,key:X++,...Object.fromEntries(Object.entries(w).filter(([d,o])=>o!=null)),toastId:P,updateId:T,data:k,isIn:!1,className:p8(w.className||H.toastClassName),progressClassName:p8(w.progressClassName||H.progressClassName),autoClose:w.isLoading?!1:xW(w.autoClose,H.autoClose),closeToast(d){z.get(P).removalReason=d,U(P)},deleteToast(){let d=z.get(P);if(d!=null){if(Y(HY(d,"removed")),z.delete(P),G--,G<0&&(G=0),W.length>0){D(W.shift());return}L()}}};u.closeButton=H.closeButton,w.closeButton===!1||u8(w.closeButton)?u.closeButton=w.closeButton:w.closeButton===!0&&(u.closeButton=u8(H.closeButton)?H.closeButton:!0);let n={content:N,props:u,staleId:q};H.limit&&H.limit>0&&G>H.limit&&f?W.push(n):q1(A)?setTimeout(()=>{D(n)},A):D(n)},setProps(N){H=N},setToggle:(N,w)=>{let P=z.get(N);P&&(P.toggle=w)},isToastActive:(N)=>{var w;return(w=z.get(N))==null?void 0:w.isActive},getSnapshot:()=>K}}var B0=new Map,O1=[],c8=new Set,iW=(Z)=>c8.forEach((J)=>J(Z)),UY=()=>B0.size>0;function nW(){O1.forEach((Z)=>LY(Z.content,Z.options)),O1=[]}var oW=(Z,{containerId:J})=>{var Y;return(Y=B0.get(J||1))==null?void 0:Y.toasts.get(Z)};function BY(Z,J){var Y;if(J)return!!((Y=B0.get(J))!=null&&Y.isToastActive(Z));let X=!1;return B0.forEach((G)=>{G.isToastActive(Z)&&(X=!0)}),X}function sW(Z){if(!UY()){O1=O1.filter((J)=>Z!=null&&J.options.toastId!==Z);return}if(Z==null||CW(Z))B0.forEach((J)=>{J.removeToast(Z)});else if(Z&&(("containerId"in Z)||("id"in Z))){let J=B0.get(Z.containerId);J?J.removeToast(Z.id):B0.forEach((Y)=>{Y.removeToast(Z.id)})}}var aW=(Z={})=>{B0.forEach((J)=>{J.props.limit&&(!Z.containerId||J.id===Z.containerId)&&J.clearQueue()})};function LY(Z,J){u8(Z)&&(UY()||O1.push({content:Z,options:J}),B0.forEach((Y)=>{Y.buildToast(Z,J)}))}function rW(Z){var J;(J=B0.get(Z.containerId||1))==null||J.setToggle(Z.id,Z.fn)}function FY(Z,J){B0.forEach((Y)=>{(J==null||!(J!=null&&J.containerId)||(J==null?void 0:J.containerId)===Y.id)&&Y.toggle(Z,J==null?void 0:J.id)})}function tW(Z){let J=Z.containerId||1;return{subscribe(Y){let X=lW(J,Z,iW);B0.set(J,X);let G=X.observe(Y);return nW(),()=>{G(),B0.delete(J)}},setProps(Y){var X;(X=B0.get(J))==null||X.setProps(Y)},getSnapshot(){var Y;return(Y=B0.get(J))==null?void 0:Y.getSnapshot()}}}function eW(Z){return c8.add(Z),()=>{c8.delete(Z)}}function ZK(Z){return Z&&(S9(Z.toastId)||q1(Z.toastId))?Z.toastId:$Y()}function T1(Z,J){return LY(Z,J),J.toastId}function F6(Z,J){return{...J,type:J&&J.type||Z,toastId:ZK(J)}}function M6(Z){return(J,Y)=>T1(J,F6(Z,Y))}function y(Z,J){return T1(Z,F6("default",J))}y.loading=(Z,J)=>T1(Z,F6("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...J}));function JK(Z,{pending:J,error:Y,success:X},G){let W;J&&(W=S9(J)?y.loading(J,G):y.loading(J.render,{...G,...J}));let K={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},H=(V,Q,L)=>{if(Q==null){y.dismiss(W);return}let F={type:V,...K,...G,data:L},M=S9(Q)?{render:Q}:Q;return W?y.update(W,{...F,...M}):y(M.render,{...F,...M}),L},z=e0(Z)?Z():Z;return z.then((V)=>H("success",X,V)).catch((V)=>H("error",Y,V)),z}y.promise=JK;y.success=M6("success");y.info=M6("info");y.error=M6("error");y.warning=M6("warning");y.warn=y.warning;y.dark=(Z,J)=>T1(Z,F6("default",{theme:"dark",...J}));function YK(Z){sW(Z)}y.dismiss=YK;y.clearWaitingQueue=aW;y.isActive=BY;y.update=(Z,J={})=>{let Y=oW(Z,J);if(Y){let{props:X,content:G}=Y,W={delay:100,...X,...J,toastId:J.toastId||Z,updateId:$Y()};W.toastId!==Z&&(W.staleId=Z);let K=W.render||G;delete W.render,T1(K,W)}};y.done=(Z)=>{y.update(Z,{progress:1})};y.onChange=eW;y.play=(Z)=>FY(!0,Z);y.pause=(Z)=>FY(!1,Z);function WK(Z){var J;let{subscribe:Y,getSnapshot:X,setProps:G}=XK(tW(Z)).current;G(Z);let W=(J=GK(Y,X,X))==null?void 0:J.slice();function K(H){if(!W)return[];let z=new Map;return Z.newestOnTop&&W.reverse(),W.forEach((V)=>{let{position:Q}=V.props;z.has(Q)||z.set(Q,[]),z.get(Q).push(V)}),Array.from(z,(V)=>H(V[0],V[1]))}return{getToastToRender:K,isToastActive:BY,count:W==null?void 0:W.length}}function HK(Z){let[J,Y]=VY(!1),[X,G]=VY(!1),W=zY(null),K=zY({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:H,pauseOnHover:z,closeToast:V,onClick:Q,closeOnClick:L}=Z;rW({id:Z.toastId,containerId:Z.containerId,fn:Y}),KK(()=>{if(Z.pauseOnFocusLoss)return F(),()=>{M()}},[Z.pauseOnFocusLoss]);function F(){document.hasFocus()||D(),window.addEventListener("focus",B),window.addEventListener("blur",D)}function M(){window.removeEventListener("focus",B),window.removeEventListener("blur",D)}function $(q){if(Z.draggable===!0||Z.draggable===q.pointerType){N();let A=W.current;K.canCloseOnClick=!0,K.canDrag=!0,A.style.transition="none",Z.draggableDirection==="x"?(K.start=q.clientX,K.removalDistance=A.offsetWidth*(Z.draggablePercent/100)):(K.start=q.clientY,K.removalDistance=A.offsetHeight*(Z.draggablePercent===80?Z.draggablePercent*1.5:Z.draggablePercent)/100)}}function U(q){let{top:A,bottom:f,left:u,right:n}=W.current.getBoundingClientRect();q.nativeEvent.type!=="touchend"&&Z.pauseOnHover&&q.clientX>=u&&q.clientX<=n&&q.clientY>=A&&q.clientY<=f?D():B()}function B(){Y(!0)}function D(){Y(!1)}function N(){K.didMove=!1,document.addEventListener("pointermove",P),document.addEventListener("pointerup",T)}function w(){document.removeEventListener("pointermove",P),document.removeEventListener("pointerup",T)}function P(q){let A=W.current;if(K.canDrag&&A){K.didMove=!0,J&&D(),Z.draggableDirection==="x"?K.delta=q.clientX-K.start:K.delta=q.clientY-K.start,K.start!==q.clientX&&(K.canCloseOnClick=!1);let f=Z.draggableDirection==="x"?`${K.delta}px, var(--y)`:`0, calc(${K.delta}px + var(--y))`;A.style.transform=`translate3d(${f},0)`,A.style.opacity=`${1-Math.abs(K.delta/K.removalDistance)}`}}function T(){w();let q=W.current;if(K.canDrag&&K.didMove&&q){if(K.canDrag=!1,Math.abs(K.delta)>K.removalDistance){G(!0),Z.closeToast(!0),Z.collapseAll();return}q.style.transition="transform 0.2s, opacity 0.2s",q.style.removeProperty("transform"),q.style.removeProperty("opacity")}}let k={onPointerDown:$,onPointerUp:U};return H&&z&&(k.onMouseEnter=D,Z.stacked||(k.onMouseLeave=B)),L&&(k.onClick=(q)=>{Q&&Q(q),K.canCloseOnClick&&V(!0)}),{playToast:B,pauseToast:D,isRunning:J,preventExitTransition:X,toastRef:W,eventHandlers:k}}var QK=typeof window!="undefined"?VK:zK,I6=({theme:Z,type:J,isLoading:Y,...X})=>u0.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:Z==="colored"?"currentColor":`var(--toastify-icon-color-${J})`,...X});function FK(Z){return u0.createElement(I6,{...Z},u0.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 MK(Z){return u0.createElement(I6,{...Z},u0.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 IK(Z){return u0.createElement(I6,{...Z},u0.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 DK(Z){return u0.createElement(I6,{...Z},u0.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 wK(){return u0.createElement("div",{className:"Toastify__spinner"})}var l8={info:MK,warning:FK,success:IK,error:DK,spinner:wK},NK=(Z)=>(Z in l8);function AK({theme:Z,type:J,isLoading:Y,icon:X}){let G=null,W={theme:Z,type:J};return X===!1||(e0(X)?G=X({...W,isLoading:Y}):LK(X)?G=BK(X,W):Y?G=l8.spinner():NK(J)&&(G=l8[J](W))),G}var PK=(Z)=>{let{isRunning:J,preventExitTransition:Y,toastRef:X,eventHandlers:G,playToast:W}=HK(Z),{closeButton:K,children:H,autoClose:z,onClick:V,type:Q,hideProgressBar:L,closeToast:F,transition:M,position:$,className:U,style:B,progressClassName:D,updateId:N,role:w,progress:P,rtl:T,toastId:k,deleteToast:q,isIn:A,isLoading:f,closeOnClick:u,theme:n,ariaLabel:d}=Z,o=p0("Toastify__toast",`Toastify__toast-theme--${n}`,`Toastify__toast--${Q}`,{["Toastify__toast--rtl"]:T},{["Toastify__toast--close-on-click"]:u}),F0=e0(U)?U({rtl:T,position:$,type:Q,defaultClassName:o}):p0(o,U),N0=AK(Z),h=!!P||!z,K0={closeToast:F,type:Q,theme:n},e=null;return K===!1||(e0(K)?e=K(K0):UK(K)?e=$K(K,K0):e=gW(K0)),B6.createElement(M,{isIn:A,done:q,position:$,preventExitTransition:Y,nodeRef:X,playToast:W},B6.createElement("div",{id:k,tabIndex:0,onClick:V,"data-in":A,className:F0,...G,style:B,ref:X,...A&&{role:w,"aria-label":d}},N0!=null&&B6.createElement("div",{className:p0("Toastify__toast-icon",{["Toastify--animate-icon Toastify__zoom-enter"]:!f})},N0),QY(H,Z,!J),e,!Z.customProgressBar&&B6.createElement(mW,{...N&&!h?{key:`p-${N}`}:{},rtl:T,theme:n,delay:z,isRunning:J,isIn:A,closeToast:F,hide:L,type:Q,className:D,controlledProgress:h,progress:P||0})))},D6=(Z,J=!1)=>({enter:`Toastify--animate Toastify__${Z}-enter`,exit:`Toastify--animate Toastify__${Z}-exit`,appendPosition:J}),i8=L6(D6("bounce",!0)),MY=L6(D6("slide",!0)),IY=L6(D6("zoom")),DY=L6(D6("flip")),RK={position:"top-right",transition:i8,autoClose:5000,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light","aria-label":"Notifications Alt+T",hotKeys:(Z)=>Z.altKey&&Z.code==="KeyT"};function wY(Z){let J={...RK,...Z},Y=Z.stacked,[X,G]=uW(!0),W=pW(null),{getToastToRender:K,isToastActive:H,count:z}=WK(J),{className:V,style:Q,rtl:L,containerId:F,hotKeys:M}=J;function $(B){let D=p0("Toastify__toast-container",`Toastify__toast-container--${B}`,{["Toastify__toast-container--rtl"]:L});return e0(V)?V({position:B,rtl:L,defaultClassName:D}):p0(D,p8(V))}function U(){Y&&(G(!0),y.play())}return QK(()=>{var B;if(Y){let D=W.current.querySelectorAll('[data-in="true"]'),N=12,w=(B=J.position)==null?void 0:B.includes("top"),P=0,T=0;Array.from(D).reverse().forEach((k,q)=>{let A=k;A.classList.add("Toastify__toast--stacked"),q>0&&(A.dataset.collapsed=`${X}`),A.dataset.pos||(A.dataset.pos=w?"top":"bot");let f=P*(X?0.2:1)+(X?0:N*q);A.style.setProperty("--y",`${w?f:f*-1}px`),A.style.setProperty("--g",`${N}`),A.style.setProperty("--s",`${1-(X?T:0)}`),P+=A.offsetHeight,T+=0.025})}},[X,z,Y]),dW(()=>{function B(D){var N;let w=W.current;M(D)&&((N=w.querySelector('[tabIndex="0"]'))==null||N.focus(),G(!1),y.pause()),D.key==="Escape"&&(document.activeElement===w||w!=null&&w.contains(document.activeElement))&&(G(!0),y.play())}return document.addEventListener("keydown",B),()=>{document.removeEventListener("keydown",B)}},[M]),d8.createElement("section",{ref:W,className:"Toastify",id:F,onMouseEnter:()=>{Y&&(G(!1),y.pause())},onMouseLeave:U,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text","aria-label":J["aria-label"]},K((B,D)=>{let N=D.length?{...Q}:{...Q,pointerEvents:"none"};return d8.createElement("div",{tabIndex:-1,className:$(B),"data-stacked":Y,style:N,key:`c-${B}`},D.map(({content:w,props:P})=>d8.createElement(PK,{...P,stacked:Y,collapseAll:U,isIn:H(P.toastId,P.containerId),key:`t-${P.key}`},w)))}))}import{useContext as OK}from"react";import{jsx as n8,Fragment as EK}from"react/jsx-runtime";var qK=(Z)=>{if(Z==="bounce")return i8;else if(Z==="slide")return MY;else if(Z==="zoom")return IY;else if(Z==="flip")return DY},TK=({data:Z})=>{let{useCentrifugeSupport:J,useSocketioSupport:Y,useMittSupport:X,centrifugeChannel:G}=Z,W=OK(I0);return n8(EK,{children:n8(V0,{card:"IOEventsCard",data:Z,useCentrifugeSupport:J,useSocketioSupport:Y,useMittSupport:X,centrifugeChannel:G,methods:{toast:(E)=>{let b0={...E,transition:qK(E.transition),position:E.position??"bottom-right",autoClose:E.autoClose??5000,style:{backgroundColor:"black",...E.sx}};y(E.message,b0)},notify:(E)=>{if(typeof window==="undefined"||!window.Notification){console.warn("[IOEventsCard] Notifications API is not available");return}let{title:b0,...p}=E,r9=()=>{try{new window.Notification(b0,p)}catch(X9){console.error("[IOEventsCard] Failed to show notification",X9)}},P9=window.Notification.permission;if(P9==="granted"){r9();return}if(P9==="denied"){console.warn("[IOEventsCard] Notification permission denied");return}window.Notification.requestPermission().then((X9)=>{if(X9==="granted")r9()})},log:(E)=>{console.log("Log event",E)},redirect:(E)=>{if(E.to){let b0=E.to;if(/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(b0))window.location.href=b0;else W?.(b0)}else window.location.reload()},tgShowPopup:(E)=>{window.Telegram.WebApp.showPopup(E)},tgShowAlert:(E)=>{window.Telegram.WebApp.showAlert(E.message)},tgShowConfirm:(E)=>{window.Telegram.WebApp.showConfirm(E.message)},tgOpenLink:(E)=>{window.Telegram.WebApp.openLink(E.url,{try_instant_view:E.try_instant_view})},tgOpenTelegramLink:(E)=>{window.Telegram.WebApp.openTelegramLink(E.url)},tgOpenInvoice:(E)=>{window.Telegram.WebApp.openInvoice(E.url)},tgShareToStory:(E)=>{window.Telegram.WebApp.shareToStory(E.media_url,E.params)},tgShareMessage:(E)=>{window.Telegram.WebApp.shareMessage(E.msg_id)},tgSetEmojiStatus:(E)=>{window.Telegram.WebApp.setEmojiStatus(E.custom_emoji_id)},tgRequestEmojiStatusAccess:()=>{window.Telegram.WebApp.requestEmojiStatusAccess()},tgDownloadFile:(E)=>{window.Telegram.WebApp.downloadFile(E)},tgRequestWriteAccess:()=>{window.Telegram.WebApp.requestWriteAccess()},tgRequestContact:()=>{window.Telegram.WebApp.requestContact()},tgRequestChat:(E)=>{window.Telegram.WebApp.requestChat(E.req_id)},tgReadTextFromClipboard:()=>{window.Telegram.WebApp.readTextFromClipboard()},tgShowScanQrPopup:(E)=>{window.Telegram.WebApp.showScanQrPopup({text:E.text})},tgCloseScanQrPopup:()=>{window.Telegram.WebApp.closeScanQrPopup()},tgSwitchInlineQuery:(E)=>{window.Telegram.WebApp.switchInlineQuery(E.query,E.choose_chat_types)},tgSetHeaderColor:(E)=>{window.Telegram.WebApp.setHeaderColor(E.color)},tgSetBackgroundColor:(E)=>{window.Telegram.WebApp.setBackgroundColor(E.color)},tgSetBottomBarColor:(E)=>{window.Telegram.WebApp.setBottomBarColor(E.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:n8(wY,{})})})},NY=TK;var _K=Z0({name:"IOEventsCard",component:NY,metadata:{author:"PieData"}});import{useCallback as o8,useContext as s8,useEffect as SK,useRef as jK,useState as AY}from"react";import{jsx as PY}from"react/jsx-runtime";var CK=({data:Z,content:J})=>{let{useLoader:Y,noReturn:X,returnType:G,useSocketioSupport:W,useCentrifugeSupport:K,useMittSupport:H,centrifugeChannel:z}=Z,V=s8(G0),Q=s8(f0)??Q0,[L,F]=AY(!1),[M,$]=AY(null),U=jK(J),B=s8(j0),D=o8((P)=>{if(P===null)F(!0);else if(F(!1),!X)U.current=P;if(!X)$(P)},[X]),N=o8((P)=>{U.current=P.content,$(P.content)},[]),w=o8((P)=>{if(P===null)F(!0);else if(F(!1),!X)for(let T of P)B?.emit(T.name,T.data)},[X,B]);if(SK(()=>{$(J),F(!1)},[J]),!M&&Y)return V;return PY(V0,{card:"AjaxGroupCard",data:Z,methods:{changeContent:N},useSocketioSupport:W,useCentrifugeSupport:K,useMittSupport:H,centrifugeChannel:z,children:PY(Q,{uiConfig:M??U.current,setUiAjaxConfiguration:G==="events"?w:D})})},RY=CK;var xK=Z0({name:"AjaxGroupCard",component:RY,metadata:{author:"PieData",description:"Group card with AJAX support"}});import{useContext as OY}from"react";import{jsx as a8}from"react/jsx-runtime";var kK=({data:Z,content:J,setUiAjaxConfiguration:Y})=>{let{name:X,url:G,sx:W}=Z,K=OY(I0),H=OY(f0)??Q0;return a8(V0,{card:X,data:Z,children:a8("div",{style:W,id:X,onClick:(V)=>{if(G)if(V.stopPropagation(),/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(G))window.location.href=G;else K?.(G)},children:a8(H,{setUiAjaxConfiguration:Y,uiConfig:J})})})},qY=kK;var fK=Z0({name:"BoxCard",component:qY,metadata:{author:"PieData",description:"Simple div with styles joining few components"}});import{useMemo as v1}from"react";var c0=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(Z){return this.listeners.add(Z),this.onSubscribe(),()=>{this.listeners.delete(Z),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};var hK=class extends c0{#Z;#J;#Y;constructor(){super();this.#Y=(Z)=>{if(typeof window!=="undefined"&&window.addEventListener){let J=()=>Z();return window.addEventListener("visibilitychange",J,!1),()=>{window.removeEventListener("visibilitychange",J)}}return}}onSubscribe(){if(!this.#J)this.setEventListener(this.#Y)}onUnsubscribe(){if(!this.hasListeners())this.#J?.(),this.#J=void 0}setEventListener(Z){this.#Y=Z,this.#J?.(),this.#J=Z((J)=>{if(typeof J==="boolean")this.setFocused(J);else this.onFocus()})}setFocused(Z){if(this.#Z!==Z)this.#Z=Z,this.onFocus()}onFocus(){let Z=this.isFocused();this.listeners.forEach((J)=>{J(Z)})}isFocused(){if(typeof this.#Z==="boolean")return this.#Z;return globalThis.document?.visibilityState!=="hidden"}},p9=new hK;var yK={setTimeout:(Z,J)=>setTimeout(Z,J),clearTimeout:(Z)=>clearTimeout(Z),setInterval:(Z,J)=>setInterval(Z,J),clearInterval:(Z)=>clearInterval(Z)},vK=class{#Z=yK;#J=!1;setTimeoutProvider(Z){this.#Z=Z}setTimeout(Z,J){return this.#Z.setTimeout(Z,J)}clearTimeout(Z){this.#Z.clearTimeout(Z)}setInterval(Z,J){return this.#Z.setInterval(Z,J)}clearInterval(Z){this.#Z.clearInterval(Z)}},l0=new vK;function TY(Z){setTimeout(Z,0)}var t8=typeof window==="undefined"||"Deno"in globalThis;function l(){}function SY(Z,J){return typeof Z==="function"?Z(J):Z}function E1(Z){return typeof Z==="number"&&Z>=0&&Z!==1/0}function w6(Z,J){return Math.max(Z+(J||0)-Date.now(),0)}function h0(Z,J){return typeof Z==="function"?Z(J):Z}function D0(Z,J){return typeof Z==="function"?Z(J):Z}function N6(Z,J){let{type:Y="all",exact:X,fetchStatus:G,predicate:W,queryKey:K,stale:H}=Z;if(K){if(X){if(J.queryHash!==_1(K,J.options))return!1}else if(!C9(J.queryKey,K))return!1}if(Y!=="all"){let z=J.isActive();if(Y==="active"&&!z)return!1;if(Y==="inactive"&&z)return!1}if(typeof H==="boolean"&&J.isStale()!==H)return!1;if(G&&G!==J.state.fetchStatus)return!1;if(W&&!W(J))return!1;return!0}function A6(Z,J){let{exact:Y,status:X,predicate:G,mutationKey:W}=Z;if(W){if(!J.options.mutationKey)return!1;if(Y){if(j9(J.options.mutationKey)!==j9(W))return!1}else if(!C9(J.options.mutationKey,W))return!1}if(X&&J.state.status!==X)return!1;if(G&&!G(J))return!1;return!0}function _1(Z,J){return(J?.queryKeyHashFn||j9)(Z)}function j9(Z){return JSON.stringify(Z,(J,Y)=>r8(Y)?Object.keys(Y).sort().reduce((X,G)=>{return X[G]=Y[G],X},{}):Y)}function C9(Z,J){if(Z===J)return!0;if(typeof Z!==typeof J)return!1;if(Z&&J&&typeof Z==="object"&&typeof J==="object")return Object.keys(J).every((Y)=>C9(Z[Y],J[Y]));return!1}var bK=Object.prototype.hasOwnProperty;function e8(Z,J,Y=0){if(Z===J)return Z;if(Y>500)return J;let X=EY(Z)&&EY(J);if(!X&&!(r8(Z)&&r8(J)))return J;let W=(X?Z:Object.keys(Z)).length,K=X?J:Object.keys(J),H=K.length,z=X?new Array(H):{},V=0;for(let Q=0;Q<H;Q++){let L=X?Q:K[Q],F=Z[L],M=J[L];if(F===M){if(z[L]=F,X?Q<W:bK.call(Z,L))V++;continue}if(F===null||M===null||typeof F!=="object"||typeof M!=="object"){z[L]=M;continue}let $=e8(F,M,Y+1);if(z[L]=$,$===F)V++}return W===H&&V===W?Z:z}function P6(Z,J){if(!J||Object.keys(Z).length!==Object.keys(J).length)return!1;for(let Y in Z)if(Z[Y]!==J[Y])return!1;return!0}function EY(Z){return Array.isArray(Z)&&Z.length===Object.keys(Z).length}function r8(Z){if(!_Y(Z))return!1;let J=Z.constructor;if(J===void 0)return!0;let Y=J.prototype;if(!_Y(Y))return!1;if(!Y.hasOwnProperty("isPrototypeOf"))return!1;if(Object.getPrototypeOf(Z)!==Object.prototype)return!1;return!0}function _Y(Z){return Object.prototype.toString.call(Z)==="[object Object]"}function jY(Z){return new Promise((J)=>{l0.setTimeout(J,Z)})}function S1(Z,J,Y){if(typeof Y.structuralSharing==="function")return Y.structuralSharing(Z,J);else if(Y.structuralSharing!==!1){if(!1)try{}catch(X){}return e8(Z,J)}return J}function CY(Z,J,Y=0){let X=[...Z,J];return Y&&X.length>Y?X.slice(1):X}function xY(Z,J,Y=0){let X=[J,...Z];return Y&&X.length>Y?X.slice(0,-1):X}var u9=Symbol();function R6(Z,J){if(!Z.queryFn&&J?.initialPromise)return()=>J.initialPromise;if(!Z.queryFn||Z.queryFn===u9)return()=>Promise.reject(new Error(`Missing queryFn: '${Z.queryHash}'`));return Z.queryFn}function O6(Z,J){if(typeof Z==="function")return Z(...J);return!!Z}function kY(Z,J,Y){let X=!1,G;return Object.defineProperty(Z,"signal",{enumerable:!0,get:()=>{if(G??=J(),X)return G;if(X=!0,G.aborted)Y();else G.addEventListener("abort",Y,{once:!0});return G}}),Z}var i0=(()=>{let Z=()=>t8;return{isServer(){return Z()},setIsServer(J){Z=J}}})();function j1(){let Z,J,Y=new Promise((G,W)=>{Z=G,J=W});Y.status="pending",Y.catch(()=>{});function X(G){Object.assign(Y,G),delete Y.resolve,delete Y.reject}return Y.resolve=(G)=>{X({status:"fulfilled",value:G}),Z(G)},Y.reject=(G)=>{X({status:"rejected",reason:G}),J(G)},Y}var fY=TY;function gK(){let Z=[],J=0,Y=(H)=>{H()},X=(H)=>{H()},G=fY,W=(H)=>{if(J)Z.push(H);else G(()=>{Y(H)})},K=()=>{let H=Z;if(Z=[],H.length)G(()=>{X(()=>{H.forEach((z)=>{Y(z)})})})};return{batch:(H)=>{let z;J++;try{z=H()}finally{if(J--,!J)K()}return z},batchCalls:(H)=>{return(...z)=>{W(()=>{H(...z)})}},schedule:W,setNotifyFunction:(H)=>{Y=H},setBatchNotifyFunction:(H)=>{X=H},setScheduler:(H)=>{G=H}}}var m=gK();var mK=class extends c0{#Z=!0;#J;#Y;constructor(){super();this.#Y=(Z)=>{if(typeof window!=="undefined"&&window.addEventListener){let J=()=>Z(!0),Y=()=>Z(!1);return window.addEventListener("online",J,!1),window.addEventListener("offline",Y,!1),()=>{window.removeEventListener("online",J),window.removeEventListener("offline",Y)}}return}}onSubscribe(){if(!this.#J)this.setEventListener(this.#Y)}onUnsubscribe(){if(!this.hasListeners())this.#J?.(),this.#J=void 0}setEventListener(Z){this.#Y=Z,this.#J?.(),this.#J=Z(this.setOnline.bind(this))}setOnline(Z){if(this.#Z!==Z)this.#Z=Z,this.listeners.forEach((Y)=>{Y(Z)})}isOnline(){return this.#Z}},c9=new mK;function dK(Z){return Math.min(1000*2**Z,30000)}function ZZ(Z){return(Z??"online")==="online"?c9.isOnline():!0}var q6=class extends Error{constructor(Z){super("CancelledError");this.revert=Z?.revert,this.silent=Z?.silent}};function T6(Z){let J=!1,Y=0,X,G=j1(),W=()=>G.status!=="pending",K=(U)=>{if(!W()){let B=new q6(U);F(B),Z.onCancel?.(B)}},H=()=>{J=!0},z=()=>{J=!1},V=()=>p9.isFocused()&&(Z.networkMode==="always"||c9.isOnline())&&Z.canRun(),Q=()=>ZZ(Z.networkMode)&&Z.canRun(),L=(U)=>{if(!W())X?.(),G.resolve(U)},F=(U)=>{if(!W())X?.(),G.reject(U)},M=()=>{return new Promise((U)=>{X=(B)=>{if(W()||V())U(B)},Z.onPause?.()}).then(()=>{if(X=void 0,!W())Z.onContinue?.()})},$=()=>{if(W())return;let U,B=Y===0?Z.initialPromise:void 0;try{U=B??Z.fn()}catch(D){U=Promise.reject(D)}Promise.resolve(U).then(L).catch((D)=>{if(W())return;let N=Z.retry??(i0.isServer()?0:3),w=Z.retryDelay??dK,P=typeof w==="function"?w(Y,D):w,T=N===!0||typeof N==="number"&&Y<N||typeof N==="function"&&N(Y,D);if(J||!T){F(D);return}Y++,Z.onFail?.(Y,D),jY(P).then(()=>{return V()?void 0:M()}).then(()=>{if(J)F(D);else $()})})};return{promise:G,status:()=>G.status,cancel:K,continue:()=>{return X?.(),G},cancelRetry:H,continueRetry:z,canStart:Q,start:()=>{if(Q())$();else M().then($);return G}}}var E6=class{#Z;destroy(){this.clearGcTimeout()}scheduleGc(){if(this.clearGcTimeout(),E1(this.gcTime))this.#Z=l0.setTimeout(()=>{this.optionalRemove()},this.gcTime)}updateGcTime(Z){this.gcTime=Math.max(this.gcTime||0,Z??(i0.isServer()?1/0:300000))}clearGcTimeout(){if(this.#Z!==void 0)l0.clearTimeout(this.#Z),this.#Z=void 0}};var vY=class extends E6{#Z;#J;#Y;#G;#X;#K;#W;constructor(Z){super();this.#W=!1,this.#K=Z.defaultOptions,this.setOptions(Z.options),this.observers=[],this.#G=Z.client,this.#Y=this.#G.getQueryCache(),this.queryKey=Z.queryKey,this.queryHash=Z.queryHash,this.#Z=yY(this.options),this.state=Z.state??this.#Z,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#X?.promise}setOptions(Z){if(this.options={...this.#K,...Z},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let J=yY(this.options);if(J.data!==void 0)this.setState(hY(J.data,J.dataUpdatedAt)),this.#Z=J}}optionalRemove(){if(!this.observers.length&&this.state.fetchStatus==="idle")this.#Y.remove(this)}setData(Z,J){let Y=S1(this.state.data,Z,this.options);return this.#z({data:Y,type:"success",dataUpdatedAt:J?.updatedAt,manual:J?.manual}),Y}setState(Z,J){this.#z({type:"setState",state:Z,setStateOptions:J})}cancel(Z){let J=this.#X?.promise;return this.#X?.cancel(Z),J?J.then(l).catch(l):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#Z}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some((Z)=>D0(Z.options.enabled,this)!==!1)}isDisabled(){if(this.getObserversCount()>0)return!this.isActive();return this.options.queryFn===u9||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){if(this.getObserversCount()>0)return this.observers.some((Z)=>h0(Z.options.staleTime,this)==="static");return!1}isStale(){if(this.getObserversCount()>0)return this.observers.some((Z)=>Z.getCurrentResult().isStale);return this.state.data===void 0||this.state.isInvalidated}isStaleByTime(Z=0){if(this.state.data===void 0)return!0;if(Z==="static")return!1;if(this.state.isInvalidated)return!0;return!w6(this.state.dataUpdatedAt,Z)}onFocus(){this.observers.find((J)=>J.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#X?.continue()}onOnline(){this.observers.find((J)=>J.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#X?.continue()}addObserver(Z){if(!this.observers.includes(Z))this.observers.push(Z),this.clearGcTimeout(),this.#Y.notify({type:"observerAdded",query:this,observer:Z})}removeObserver(Z){if(this.observers.includes(Z)){if(this.observers=this.observers.filter((J)=>J!==Z),!this.observers.length){if(this.#X)if(this.#W||this.#H())this.#X.cancel({revert:!0});else this.#X.cancelRetry();this.scheduleGc()}this.#Y.notify({type:"observerRemoved",query:this,observer:Z})}}getObserversCount(){return this.observers.length}#H(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){if(!this.state.isInvalidated)this.#z({type:"invalidate"})}async fetch(Z,J){if(this.state.fetchStatus!=="idle"&&this.#X?.status()!=="rejected"){if(this.state.data!==void 0&&J?.cancelRefetch)this.cancel({silent:!0});else if(this.#X)return this.#X.continueRetry(),this.#X.promise}if(Z)this.setOptions(Z);if(!this.options.queryFn){let H=this.observers.find((z)=>z.options.queryFn);if(H)this.setOptions(H.options)}let Y=new AbortController,X=(H)=>{Object.defineProperty(H,"signal",{enumerable:!0,get:()=>{return this.#W=!0,Y.signal}})},G=()=>{let H=R6(this.options,J),V=(()=>{let Q={client:this.#G,queryKey:this.queryKey,meta:this.meta};return X(Q),Q})();if(this.#W=!1,this.options.persister)return this.options.persister(H,V,this);return H(V)},K=(()=>{let H={fetchOptions:J,options:this.options,queryKey:this.queryKey,client:this.#G,state:this.state,fetchFn:G};return X(H),H})();if(this.options.behavior?.onFetch(K,this),this.#J=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==K.fetchOptions?.meta)this.#z({type:"fetch",meta:K.fetchOptions?.meta});this.#X=T6({initialPromise:J?.initialPromise,fn:K.fetchFn,onCancel:(H)=>{if(H instanceof q6&&H.revert)this.setState({...this.#J,fetchStatus:"idle"});Y.abort()},onFail:(H,z)=>{this.#z({type:"failed",failureCount:H,error:z})},onPause:()=>{this.#z({type:"pause"})},onContinue:()=>{this.#z({type:"continue"})},retry:K.options.retry,retryDelay:K.options.retryDelay,networkMode:K.options.networkMode,canRun:()=>!0});try{let H=await this.#X.start();if(H===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(H),this.#Y.config.onSuccess?.(H,this),this.#Y.config.onSettled?.(H,this.state.error,this),H}catch(H){if(H instanceof q6){if(H.silent)return this.#X.promise;else if(H.revert){if(this.state.data===void 0)throw H;return this.state.data}}throw this.#z({type:"error",error:H}),this.#Y.config.onError?.(H,this),this.#Y.config.onSettled?.(this.state.data,H,this),H}finally{this.scheduleGc()}}#z(Z){let J=(Y)=>{switch(Z.type){case"failed":return{...Y,fetchFailureCount:Z.failureCount,fetchFailureReason:Z.error};case"pause":return{...Y,fetchStatus:"paused"};case"continue":return{...Y,fetchStatus:"fetching"};case"fetch":return{...Y,...JZ(Y.data,this.options),fetchMeta:Z.meta??null};case"success":let X={...Y,...hY(Z.data,Z.dataUpdatedAt),dataUpdateCount:Y.dataUpdateCount+1,...!Z.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#J=Z.manual?X:void 0,X;case"error":let G=Z.error;return{...Y,error:G,errorUpdateCount:Y.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:Y.fetchFailureCount+1,fetchFailureReason:G,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...Y,isInvalidated:!0};case"setState":return{...Y,...Z.state}}};this.state=J(this.state),m.batch(()=>{this.observers.forEach((Y)=>{Y.onQueryUpdate()}),this.#Y.notify({query:this,type:"updated",action:Z})})}};function JZ(Z,J){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ZZ(J.networkMode)?"fetching":"paused",...Z===void 0&&{error:null,status:"pending"}}}function hY(Z,J){return{data:Z,dataUpdatedAt:J??Date.now(),error:null,isInvalidated:!1,status:"success"}}function yY(Z){let J=typeof Z.initialData==="function"?Z.initialData():Z.initialData,Y=J!==void 0,X=Y?typeof Z.initialDataUpdatedAt==="function"?Z.initialDataUpdatedAt():Z.initialDataUpdatedAt:0;return{data:J,dataUpdateCount:0,dataUpdatedAt:Y?X??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:Y?"success":"pending",fetchStatus:"idle"}}var XZ=class extends c0{constructor(Z,J){super();this.options=J,this.#Z=Z,this.#H=null,this.#W=j1(),this.bindMethods(),this.setOptions(J)}#Z;#J=void 0;#Y=void 0;#G=void 0;#X;#K;#W;#H;#z;#B;#L;#Q;#$;#V;#F=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){if(this.listeners.size===1){if(this.#J.addObserver(this),bY(this.#J,this.options))this.#U();else this.updateResult();this.#w()}}onUnsubscribe(){if(!this.hasListeners())this.destroy()}shouldFetchOnReconnect(){return YZ(this.#J,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return YZ(this.#J,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#N(),this.#A(),this.#J.removeObserver(this)}setOptions(Z){let J=this.options,Y=this.#J;if(this.options=this.#Z.defaultQueryOptions(Z),this.options.enabled!==void 0&&typeof this.options.enabled!=="boolean"&&typeof this.options.enabled!=="function"&&typeof D0(this.options.enabled,this.#J)!=="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");if(this.#P(),this.#J.setOptions(this.options),J._defaulted&&!P6(this.options,J))this.#Z.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#J,observer:this});let X=this.hasListeners();if(X&&gY(this.#J,Y,this.options,J))this.#U();if(this.updateResult(),X&&(this.#J!==Y||D0(this.options.enabled,this.#J)!==D0(J.enabled,this.#J)||h0(this.options.staleTime,this.#J)!==h0(J.staleTime,this.#J)))this.#M();let G=this.#I();if(X&&(this.#J!==Y||D0(this.options.enabled,this.#J)!==D0(J.enabled,this.#J)||G!==this.#V))this.#D(G)}getOptimisticResult(Z){let J=this.#Z.getQueryCache().build(this.#Z,Z),Y=this.createResult(J,Z);if(uK(this,Y))this.#G=Y,this.#K=this.options,this.#X=this.#J.state;return Y}getCurrentResult(){return this.#G}trackResult(Z,J){return new Proxy(Z,{get:(Y,X)=>{if(this.trackProp(X),J?.(X),X==="promise"){if(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#W.status==="pending")this.#W.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))}return Reflect.get(Y,X)}})}trackProp(Z){this.#F.add(Z)}getCurrentQuery(){return this.#J}refetch({...Z}={}){return this.fetch({...Z})}fetchOptimistic(Z){let J=this.#Z.defaultQueryOptions(Z),Y=this.#Z.getQueryCache().build(this.#Z,J);return Y.fetch().then(()=>this.createResult(Y,J))}fetch(Z){return this.#U({...Z,cancelRefetch:Z.cancelRefetch??!0}).then(()=>{return this.updateResult(),this.#G})}#U(Z){this.#P();let J=this.#J.fetch(this.options,Z);if(!Z?.throwOnError)J=J.catch(l);return J}#M(){this.#N();let Z=h0(this.options.staleTime,this.#J);if(i0.isServer()||this.#G.isStale||!E1(Z))return;let Y=w6(this.#G.dataUpdatedAt,Z)+1;this.#Q=l0.setTimeout(()=>{if(!this.#G.isStale)this.updateResult()},Y)}#I(){return(typeof this.options.refetchInterval==="function"?this.options.refetchInterval(this.#J):this.options.refetchInterval)??!1}#D(Z){if(this.#A(),this.#V=Z,i0.isServer()||D0(this.options.enabled,this.#J)===!1||!E1(this.#V)||this.#V===0)return;this.#$=l0.setInterval(()=>{if(this.options.refetchIntervalInBackground||p9.isFocused())this.#U()},this.#V)}#w(){this.#M(),this.#D(this.#I())}#N(){if(this.#Q!==void 0)l0.clearTimeout(this.#Q),this.#Q=void 0}#A(){if(this.#$!==void 0)l0.clearInterval(this.#$),this.#$=void 0}createResult(Z,J){let Y=this.#J,X=this.options,G=this.#G,W=this.#X,K=this.#K,z=Z!==Y?Z.state:this.#Y,{state:V}=Z,Q={...V},L=!1,F;if(J._optimisticResults){let A=this.hasListeners(),f=!A&&bY(Z,J),u=A&&gY(Z,Y,J,X);if(f||u)Q={...Q,...JZ(V.data,Z.options)};if(J._optimisticResults==="isRestoring")Q.fetchStatus="idle"}let{error:M,errorUpdatedAt:$,status:U}=Q;F=Q.data;let B=!1;if(J.placeholderData!==void 0&&F===void 0&&U==="pending"){let A;if(G?.isPlaceholderData&&J.placeholderData===K?.placeholderData)A=G.data,B=!0;else A=typeof J.placeholderData==="function"?J.placeholderData(this.#L?.state.data,this.#L):J.placeholderData;if(A!==void 0)U="success",F=S1(G?.data,A,J),L=!0}if(J.select&&F!==void 0&&!B)if(G&&F===W?.data&&J.select===this.#z)F=this.#B;else try{this.#z=J.select,F=J.select(F),F=S1(G?.data,F,J),this.#B=F,this.#H=null}catch(A){this.#H=A}if(this.#H)M=this.#H,F=this.#B,$=Date.now(),U="error";let D=Q.fetchStatus==="fetching",N=U==="pending",w=U==="error",P=N&&D,T=F!==void 0,q={status:U,fetchStatus:Q.fetchStatus,isPending:N,isSuccess:U==="success",isError:w,isInitialLoading:P,isLoading:P,data:F,dataUpdatedAt:Q.dataUpdatedAt,error:M,errorUpdatedAt:$,failureCount:Q.fetchFailureCount,failureReason:Q.fetchFailureReason,errorUpdateCount:Q.errorUpdateCount,isFetched:Z.isFetched(),isFetchedAfterMount:Q.dataUpdateCount>z.dataUpdateCount||Q.errorUpdateCount>z.errorUpdateCount,isFetching:D,isRefetching:D&&!N,isLoadingError:w&&!T,isPaused:Q.fetchStatus==="paused",isPlaceholderData:L,isRefetchError:w&&T,isStale:GZ(Z,J),refetch:this.refetch,promise:this.#W,isEnabled:D0(J.enabled,Z)!==!1};if(this.options.experimental_prefetchInRender){let A=q.data!==void 0,f=q.status==="error"&&!A,u=(o)=>{if(f)o.reject(q.error);else if(A)o.resolve(q.data)},n=()=>{let o=this.#W=q.promise=j1();u(o)},d=this.#W;switch(d.status){case"pending":if(Z.queryHash===Y.queryHash)u(d);break;case"fulfilled":if(f||q.data!==d.value)n();break;case"rejected":if(!f||q.error!==d.reason)n();break}}return q}updateResult(){let Z=this.#G,J=this.createResult(this.#J,this.options);if(this.#X=this.#J.state,this.#K=this.options,this.#X.data!==void 0)this.#L=this.#J;if(P6(J,Z))return;this.#G=J;let Y=()=>{if(!Z)return!0;let{notifyOnChangeProps:X}=this.options,G=typeof X==="function"?X():X;if(G==="all"||!G&&!this.#F.size)return!0;let W=new Set(G??this.#F);if(this.options.throwOnError)W.add("error");return Object.keys(this.#G).some((K)=>{let H=K;return this.#G[H]!==Z[H]&&W.has(H)})};this.#R({listeners:Y()})}#P(){let Z=this.#Z.getQueryCache().build(this.#Z,this.options);if(Z===this.#J)return;let J=this.#J;if(this.#J=Z,this.#Y=Z.state,this.hasListeners())J?.removeObserver(this),Z.addObserver(this)}onQueryUpdate(){if(this.updateResult(),this.hasListeners())this.#w()}#R(Z){m.batch(()=>{if(Z.listeners)this.listeners.forEach((J)=>{J(this.#G)});this.#Z.getQueryCache().notify({query:this.#J,type:"observerResultsUpdated"})})}};function pK(Z,J){return D0(J.enabled,Z)!==!1&&Z.state.data===void 0&&!(Z.state.status==="error"&&J.retryOnMount===!1)}function bY(Z,J){return pK(Z,J)||Z.state.data!==void 0&&YZ(Z,J,J.refetchOnMount)}function YZ(Z,J,Y){if(D0(J.enabled,Z)!==!1&&h0(J.staleTime,Z)!=="static"){let X=typeof Y==="function"?Y(Z):Y;return X==="always"||X!==!1&&GZ(Z,J)}return!1}function gY(Z,J,Y,X){return(Z!==J||D0(X.enabled,Z)===!1)&&(!Y.suspense||Z.state.status!=="error")&&GZ(Z,Y)}function GZ(Z,J){return D0(J.enabled,Z)!==!1&&Z.isStaleByTime(h0(J.staleTime,Z))}function uK(Z,J){if(!P6(Z.getCurrentResult(),J))return!0;return!1}function WZ(Z){return{onFetch:(J,Y)=>{let X=J.options,G=J.fetchOptions?.meta?.fetchMore?.direction,W=J.state.data?.pages||[],K=J.state.data?.pageParams||[],H={pages:[],pageParams:[]},z=0,V=async()=>{let Q=!1,L=($)=>{kY($,()=>J.signal,()=>Q=!0)},F=R6(J.options,J.fetchOptions),M=async($,U,B)=>{if(Q)return Promise.reject();if(U==null&&$.pages.length)return Promise.resolve($);let N=(()=>{let k={client:J.client,queryKey:J.queryKey,pageParam:U,direction:B?"backward":"forward",meta:J.options.meta};return L(k),k})(),w=await F(N),{maxPages:P}=J.options,T=B?xY:CY;return{pages:T($.pages,w,P),pageParams:T($.pageParams,U,P)}};if(G&&W.length){let $=G==="backward",U=$?cK:mY,B={pages:W,pageParams:K},D=U(X,B);H=await M(B,D,$)}else{let $=Z??W.length;do{let U=z===0?K[0]??X.initialPageParam:mY(X,H);if(z>0&&U==null)break;H=await M(H,U),z++}while(z<$)}return H};if(J.options.persister)J.fetchFn=()=>{return J.options.persister?.(V,{client:J.client,queryKey:J.queryKey,meta:J.options.meta,signal:J.signal},Y)};else J.fetchFn=V}}}function mY(Z,{pages:J,pageParams:Y}){let X=J.length-1;return J.length>0?Z.getNextPageParam(J[X],J,Y[X],Y):void 0}function cK(Z,{pages:J,pageParams:Y}){return J.length>0?Z.getPreviousPageParam?.(J[0],J,Y[0],Y):void 0}var dY=class extends E6{#Z;#J;#Y;#G;constructor(Z){super();this.#Z=Z.client,this.mutationId=Z.mutationId,this.#Y=Z.mutationCache,this.#J=[],this.state=Z.state||lK(),this.setOptions(Z.options),this.scheduleGc()}setOptions(Z){this.options=Z,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(Z){if(!this.#J.includes(Z))this.#J.push(Z),this.clearGcTimeout(),this.#Y.notify({type:"observerAdded",mutation:this,observer:Z})}removeObserver(Z){this.#J=this.#J.filter((J)=>J!==Z),this.scheduleGc(),this.#Y.notify({type:"observerRemoved",mutation:this,observer:Z})}optionalRemove(){if(!this.#J.length)if(this.state.status==="pending")this.scheduleGc();else this.#Y.remove(this)}continue(){return this.#G?.continue()??this.execute(this.state.variables)}async execute(Z){let J=()=>{this.#X({type:"continue"})},Y={client:this.#Z,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#G=T6({fn:()=>{if(!this.options.mutationFn)return Promise.reject(new Error("No mutationFn found"));return this.options.mutationFn(Z,Y)},onFail:(W,K)=>{this.#X({type:"failed",failureCount:W,error:K})},onPause:()=>{this.#X({type:"pause"})},onContinue:J,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#Y.canRun(this)});let X=this.state.status==="pending",G=!this.#G.canStart();try{if(X)J();else{if(this.#X({type:"pending",variables:Z,isPaused:G}),this.#Y.config.onMutate)await this.#Y.config.onMutate(Z,this,Y);let K=await this.options.onMutate?.(Z,Y);if(K!==this.state.context)this.#X({type:"pending",context:K,variables:Z,isPaused:G})}let W=await this.#G.start();return await this.#Y.config.onSuccess?.(W,Z,this.state.context,this,Y),await this.options.onSuccess?.(W,Z,this.state.context,Y),await this.#Y.config.onSettled?.(W,null,this.state.variables,this.state.context,this,Y),await this.options.onSettled?.(W,null,Z,this.state.context,Y),this.#X({type:"success",data:W}),W}catch(W){try{await this.#Y.config.onError?.(W,Z,this.state.context,this,Y)}catch(K){Promise.reject(K)}try{await this.options.onError?.(W,Z,this.state.context,Y)}catch(K){Promise.reject(K)}try{await this.#Y.config.onSettled?.(void 0,W,this.state.variables,this.state.context,this,Y)}catch(K){Promise.reject(K)}try{await this.options.onSettled?.(void 0,W,Z,this.state.context,Y)}catch(K){Promise.reject(K)}throw this.#X({type:"error",error:W}),W}finally{this.#Y.runNext(this)}}#X(Z){let J=(Y)=>{switch(Z.type){case"failed":return{...Y,failureCount:Z.failureCount,failureReason:Z.error};case"pause":return{...Y,isPaused:!0};case"continue":return{...Y,isPaused:!1};case"pending":return{...Y,context:Z.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:Z.isPaused,status:"pending",variables:Z.variables,submittedAt:Date.now()};case"success":return{...Y,data:Z.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...Y,data:void 0,error:Z.error,failureCount:Y.failureCount+1,failureReason:Z.error,isPaused:!1,status:"error"}}};this.state=J(this.state),m.batch(()=>{this.#J.forEach((Y)=>{Y.onMutationUpdate(Z)}),this.#Y.notify({mutation:this,type:"updated",action:Z})})}};function lK(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var pY=class extends c0{constructor(Z={}){super();this.config=Z,this.#Z=new Set,this.#J=new Map,this.#Y=0}#Z;#J;#Y;build(Z,J,Y){let X=new dY({client:Z,mutationCache:this,mutationId:++this.#Y,options:Z.defaultMutationOptions(J),state:Y});return this.add(X),X}add(Z){this.#Z.add(Z);let J=_6(Z);if(typeof J==="string"){let Y=this.#J.get(J);if(Y)Y.push(Z);else this.#J.set(J,[Z])}this.notify({type:"added",mutation:Z})}remove(Z){if(this.#Z.delete(Z)){let J=_6(Z);if(typeof J==="string"){let Y=this.#J.get(J);if(Y){if(Y.length>1){let X=Y.indexOf(Z);if(X!==-1)Y.splice(X,1)}else if(Y[0]===Z)this.#J.delete(J)}}}this.notify({type:"removed",mutation:Z})}canRun(Z){let J=_6(Z);if(typeof J==="string"){let X=this.#J.get(J)?.find((G)=>G.state.status==="pending");return!X||X===Z}else return!0}runNext(Z){let J=_6(Z);if(typeof J==="string")return this.#J.get(J)?.find((X)=>X!==Z&&X.state.isPaused)?.continue()??Promise.resolve();else return Promise.resolve()}clear(){m.batch(()=>{this.#Z.forEach((Z)=>{this.notify({type:"removed",mutation:Z})}),this.#Z.clear(),this.#J.clear()})}getAll(){return Array.from(this.#Z)}find(Z){let J={exact:!0,...Z};return this.getAll().find((Y)=>A6(J,Y))}findAll(Z={}){return this.getAll().filter((J)=>A6(Z,J))}notify(Z){m.batch(()=>{this.listeners.forEach((J)=>{J(Z)})})}resumePausedMutations(){let Z=this.getAll().filter((J)=>J.state.isPaused);return m.batch(()=>Promise.all(Z.map((J)=>J.continue().catch(l))))}};function _6(Z){return Z.options.scope?.id}var uY=class extends c0{constructor(Z={}){super();this.config=Z,this.#Z=new Map}#Z;build(Z,J,Y){let X=J.queryKey,G=J.queryHash??_1(X,J),W=this.get(G);if(!W)W=new vY({client:Z,queryKey:X,queryHash:G,options:Z.defaultQueryOptions(J),state:Y,defaultOptions:Z.getQueryDefaults(X)}),this.add(W);return W}add(Z){if(!this.#Z.has(Z.queryHash))this.#Z.set(Z.queryHash,Z),this.notify({type:"added",query:Z})}remove(Z){let J=this.#Z.get(Z.queryHash);if(J){if(Z.destroy(),J===Z)this.#Z.delete(Z.queryHash);this.notify({type:"removed",query:Z})}}clear(){m.batch(()=>{this.getAll().forEach((Z)=>{this.remove(Z)})})}get(Z){return this.#Z.get(Z)}getAll(){return[...this.#Z.values()]}find(Z){let J={exact:!0,...Z};return this.getAll().find((Y)=>N6(J,Y))}findAll(Z={}){let J=this.getAll();return Object.keys(Z).length>0?J.filter((Y)=>N6(Z,Y)):J}notify(Z){m.batch(()=>{this.listeners.forEach((J)=>{J(Z)})})}onFocus(){m.batch(()=>{this.getAll().forEach((Z)=>{Z.onFocus()})})}onOnline(){m.batch(()=>{this.getAll().forEach((Z)=>{Z.onOnline()})})}};var Z9=class{#Z;#J;#Y;#G;#X;#K;#W;#H;constructor(Z={}){this.#Z=Z.queryCache||new uY,this.#J=Z.mutationCache||new pY,this.#Y=Z.defaultOptions||{},this.#G=new Map,this.#X=new Map,this.#K=0}mount(){if(this.#K++,this.#K!==1)return;this.#W=p9.subscribe(async(Z)=>{if(Z)await this.resumePausedMutations(),this.#Z.onFocus()}),this.#H=c9.subscribe(async(Z)=>{if(Z)await this.resumePausedMutations(),this.#Z.onOnline()})}unmount(){if(this.#K--,this.#K!==0)return;this.#W?.(),this.#W=void 0,this.#H?.(),this.#H=void 0}isFetching(Z){return this.#Z.findAll({...Z,fetchStatus:"fetching"}).length}isMutating(Z){return this.#J.findAll({...Z,status:"pending"}).length}getQueryData(Z){let J=this.defaultQueryOptions({queryKey:Z});return this.#Z.get(J.queryHash)?.state.data}ensureQueryData(Z){let J=this.defaultQueryOptions(Z),Y=this.#Z.build(this,J),X=Y.state.data;if(X===void 0)return this.fetchQuery(Z);if(Z.revalidateIfStale&&Y.isStaleByTime(h0(J.staleTime,Y)))this.prefetchQuery(J);return Promise.resolve(X)}getQueriesData(Z){return this.#Z.findAll(Z).map(({queryKey:J,state:Y})=>{let X=Y.data;return[J,X]})}setQueryData(Z,J,Y){let X=this.defaultQueryOptions({queryKey:Z}),W=this.#Z.get(X.queryHash)?.state.data,K=SY(J,W);if(K===void 0)return;return this.#Z.build(this,X).setData(K,{...Y,manual:!0})}setQueriesData(Z,J,Y){return m.batch(()=>this.#Z.findAll(Z).map(({queryKey:X})=>[X,this.setQueryData(X,J,Y)]))}getQueryState(Z){let J=this.defaultQueryOptions({queryKey:Z});return this.#Z.get(J.queryHash)?.state}removeQueries(Z){let J=this.#Z;m.batch(()=>{J.findAll(Z).forEach((Y)=>{J.remove(Y)})})}resetQueries(Z,J){let Y=this.#Z;return m.batch(()=>{return Y.findAll(Z).forEach((X)=>{X.reset()}),this.refetchQueries({type:"active",...Z},J)})}cancelQueries(Z,J={}){let Y={revert:!0,...J},X=m.batch(()=>this.#Z.findAll(Z).map((G)=>G.cancel(Y)));return Promise.all(X).then(l).catch(l)}invalidateQueries(Z,J={}){return m.batch(()=>{if(this.#Z.findAll(Z).forEach((Y)=>{Y.invalidate()}),Z?.refetchType==="none")return Promise.resolve();return this.refetchQueries({...Z,type:Z?.refetchType??Z?.type??"active"},J)})}refetchQueries(Z,J={}){let Y={...J,cancelRefetch:J.cancelRefetch??!0},X=m.batch(()=>this.#Z.findAll(Z).filter((G)=>!G.isDisabled()&&!G.isStatic()).map((G)=>{let W=G.fetch(void 0,Y);if(!Y.throwOnError)W=W.catch(l);return G.state.fetchStatus==="paused"?Promise.resolve():W}));return Promise.all(X).then(l)}fetchQuery(Z){let J=this.defaultQueryOptions(Z);if(J.retry===void 0)J.retry=!1;let Y=this.#Z.build(this,J);return Y.isStaleByTime(h0(J.staleTime,Y))?Y.fetch(J):Promise.resolve(Y.state.data)}prefetchQuery(Z){return this.fetchQuery(Z).then(l).catch(l)}fetchInfiniteQuery(Z){return Z.behavior=WZ(Z.pages),this.fetchQuery(Z)}prefetchInfiniteQuery(Z){return this.fetchInfiniteQuery(Z).then(l).catch(l)}ensureInfiniteQueryData(Z){return Z.behavior=WZ(Z.pages),this.ensureQueryData(Z)}resumePausedMutations(){if(c9.isOnline())return this.#J.resumePausedMutations();return Promise.resolve()}getQueryCache(){return this.#Z}getMutationCache(){return this.#J}getDefaultOptions(){return this.#Y}setDefaultOptions(Z){this.#Y=Z}setQueryDefaults(Z,J){this.#G.set(j9(Z),{queryKey:Z,defaultOptions:J})}getQueryDefaults(Z){let J=[...this.#G.values()],Y={};return J.forEach((X)=>{if(C9(Z,X.queryKey))Object.assign(Y,X.defaultOptions)}),Y}setMutationDefaults(Z,J){this.#X.set(j9(Z),{mutationKey:Z,defaultOptions:J})}getMutationDefaults(Z){let J=[...this.#X.values()],Y={};return J.forEach((X)=>{if(C9(Z,X.mutationKey))Object.assign(Y,X.defaultOptions)}),Y}defaultQueryOptions(Z){if(Z._defaulted)return Z;let J={...this.#Y.queries,...this.getQueryDefaults(Z.queryKey),...Z,_defaulted:!0};if(!J.queryHash)J.queryHash=_1(J.queryKey,J);if(J.refetchOnReconnect===void 0)J.refetchOnReconnect=J.networkMode!=="always";if(J.throwOnError===void 0)J.throwOnError=!!J.suspense;if(!J.networkMode&&J.persister)J.networkMode="offlineFirst";if(J.queryFn===u9)J.enabled=!1;return J}defaultMutationOptions(Z){if(Z?._defaulted)return Z;return{...this.#Y.mutations,...Z?.mutationKey&&this.getMutationDefaults(Z.mutationKey),...Z,_defaulted:!0}}clear(){this.#Z.clear(),this.#J.clear()}};import*as l9 from"react";import{jsx as iK}from"react/jsx-runtime";var KZ=l9.createContext(void 0),HZ=(Z)=>{let J=l9.useContext(KZ);if(Z)return Z;if(!J)throw new Error("No QueryClient set, use QueryClientProvider to set one");return J},J9=({client:Z,children:J})=>{return l9.useEffect(()=>{return Z.mount(),()=>{Z.unmount()}},[Z]),iK(KZ.Provider,{value:Z,children:J})};import*as S6 from"react";var cY=S6.createContext(!1),lY=()=>S6.useContext(cY),m2=cY.Provider;import*as C1 from"react";import{jsx as u2}from"react/jsx-runtime";function nK(){let Z=!1;return{clearReset:()=>{Z=!1},reset:()=>{Z=!0},isReset:()=>{return Z}}}var oK=C1.createContext(nK()),iY=()=>C1.useContext(oK);import*as nY from"react";var oY=(Z,J,Y)=>{let X=Y?.state.error&&typeof Z.throwOnError==="function"?O6(Z.throwOnError,[Y.state.error,Y]):Z.throwOnError;if(Z.suspense||Z.experimental_prefetchInRender||X){if(!J.isReset())Z.retryOnMount=!1}},sY=(Z)=>{nY.useEffect(()=>{Z.clearReset()},[Z])},aY=({result:Z,errorResetBoundary:J,throwOnError:Y,query:X,suspense:G})=>{return Z.isError&&!J.isReset()&&!Z.isFetching&&X&&(G&&Z.data===void 0||O6(Y,[Z.error,X]))};var rY=(Z)=>{if(Z.suspense){let Y=(G)=>G==="static"?G:Math.max(G??1000,1000),X=Z.staleTime;if(Z.staleTime=typeof X==="function"?(...G)=>Y(X(...G)):Y(X),typeof Z.gcTime==="number")Z.gcTime=Math.max(Z.gcTime,1000)}},tY=(Z,J)=>Z.isLoading&&Z.isFetching&&!J,eY=(Z,J)=>Z?.suspense&&J.isPending,zZ=(Z,J,Y)=>J.fetchOptimistic(Z).catch(()=>{Y.clearReset()});import*as B9 from"react";function Z5(Z,J,Y){let X=lY(),G=iY(),W=HZ(Y),K=W.defaultQueryOptions(Z);W.getDefaultOptions().queries?._experimental_beforeQuery?.(K);let H=W.getQueryCache().get(K.queryHash);K._optimisticResults=X?"isRestoring":"optimistic",rY(K),oY(K,G,H),sY(G);let z=!W.getQueryCache().get(K.queryHash),[V]=B9.useState(()=>new J(W,K)),Q=V.getOptimisticResult(K),L=!X&&Z.subscribed!==!1;if(B9.useSyncExternalStore(B9.useCallback((F)=>{let M=L?V.subscribe(m.batchCalls(F)):l;return V.updateResult(),M},[V,L]),()=>V.getCurrentResult(),()=>V.getCurrentResult()),B9.useEffect(()=>{V.setOptions(K)},[K,V]),eY(K,Q))throw zZ(K,V,G);if(aY({result:Q,errorResetBoundary:G,throwOnError:K.throwOnError,query:H,suspense:K.suspense}))throw Q.error;if(W.getDefaultOptions().queries?._experimental_afterQuery?.(K,Q),K.experimental_prefetchInRender&&!i0.isServer()&&tY(Q,X))(z?zZ(K,V,G):H?.promise)?.catch(l).finally(()=>{V.updateResult()});return!K.notifyOnChangeProps?V.trackResult(Q):Q}function x9(Z,J){return Z5(Z,XZ,J)}import{useContext as rK,useEffect as tK}from"react";import{useEffect as sK,useState as aK}from"react";var VZ=new Map;function j6(Z,J){let[Y,X]=aK(null);return sK(()=>{if(!Z)return;let G=`${Z}::${J}`,W=VZ.get(G);if(!W)W=fetch(Z+`api/support/${J}`,{method:"GET"}).then((H)=>H.json()).catch((H)=>{throw VZ.delete(G),H}),VZ.set(G,W);let K=!1;return W.then((H)=>{if(!K)X(H)}).catch(()=>{}),()=>{K=!0}},[Z,J]),Y}var QZ=null,J5=null;function Y5(){J5?.()}function $Z(){if(typeof window==="undefined")return Promise.resolve();if(typeof window.sid!=="undefined")return Promise.resolve();if(!QZ)QZ=new Promise((Z)=>{J5=()=>{Z()}});return QZ}var eK=({children:Z})=>{let J=rK(S0),Y=p1(),X=j6(Y,"socketIO"),G=(W)=>{if(typeof window!=="undefined")window.sid=W.sid,Y5(),console.log(`SocketIO initialized: ${window.sid}`)};return tK(()=>{if(!J)return;let W=()=>{console.log("SocketIO connected")},K=(H)=>{console.log(`SocketIO disconnected: ${H}`),J.connect()};if(X)J.on("pieinit",G),J.on("connect",W),J.on("disconnect",K),J.connect();return()=>{if(X)J.off("pieinit",G),J.off("connect",W),J.off("disconnect",K),J.disconnect()}},[J,X]),Z},L9=eK;import{useContext as ZH,useEffect as JH}from"react";var YH=({children:Z})=>{let J=ZH(_0),Y=p1(),X=j6(Y,"centrifuge");return JH(()=>{if(!J)return;let G=()=>{console.log("Centrifuge connected")},W=(K)=>{console.log("Centrifuge disconnected:",K)};if(X)J.on("connected",G),J.on("disconnected",W),J.connect();return()=>{if(X)J.disconnect()}},[J,X]),Z},F9=YH;var w7=e9(c6(),1);import{jsx as sz}from"react/jsx-runtime";function a9(Z,J,Y){if(!J)return Y;let X=Z.replace(/^\//,""),G=J[X];if(!G)return Y;return sz(M8,{uiConfig:G})}import{jsx as O0,Fragment as tz}from"react/jsx-runtime";var az=({location:Z,fallback:J,piecache:Y,onError:X,queryOptions:G})=>{let W=s0(),K=G9(),H=A0(),z=v1(()=>w7.createAxiosDateTransformer({baseURL:W||""}),[W]),V=v1(()=>V9(),[]),Q=v1(()=>W?z9(W):null,[W]),L=v1(()=>W?K9(W,K):null,[W,K]),{data:F,isLoading:M,error:$}=x9({queryKey:["uiConfig",Z.pathname+Z.search,W],enabled:!!W,queryFn:async()=>{let B=new URLSearchParams(Z.search);B.set("__pieroot","web");let D="/api/content"+Z.pathname+"?"+B.toString();if(H)console.log("[PieRoot] Fetching UI configuration from:",D);let N=await z.get(D,{headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET,PUT,POST,DELETE,PATCH,OPTIONS","Content-type":"application/json"},withCredentials:!0});if(H)console.log("[PieRoot] Received UI configuration:",N.data);return N.data},staleTime:1/0,gcTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,retry:!0,retryDelay:(B)=>Math.min(1000*2**B,30000),...G}),U=a9(Z.pathname,Y,J);if(!W)return U??null;if(H)console.log("[PieRoot] Rendering with location:",Z),console.log("[PieRoot] API_SERVER:",W),console.log("[PieRoot] CENTRIFUGE_SERVER:",K),console.log("[PieRoot] Fallback provided:",!!J),console.log("[PieRoot] Piecache provided:",!!Y);if($){if(H)console.error("[PieRoot] Error fetching UI configuration:",$),console.error("[PieRoot] Error details:",{message:$.message,status:$.response?.status,data:$.response?.data});return X?.(),U}if(M||!F){if(H)console.log("[PieRoot] Loading state:",{isLoading:M,hasUiConfiguration:!!F});return U}if(H)console.log("[PieRoot] UI configuration loaded successfully:",F),console.log("[PieRoot] Rendering UI with configuration");return O0(j0.Provider,{value:V,children:O0(S0.Provider,{value:Q,children:O0(_0.Provider,{value:L,children:O0(G0.Provider,{value:J??O0(tz,{}),children:O0(L9,{children:O0(F9,{children:O0("form",{id:"piedata_global_form",action:W+"api/process"+Z.pathname,method:"post",encType:"multipart/form-data",children:O0(Q0,{uiConfig:F})})})})})})})})},rz=(Z)=>{let J=v1(()=>new Z9,[]);return O0(I0.Provider,{value:Z.onNavigate,children:O0(o0.Provider,{value:Z.config,children:O0(J9,{client:J,children:O0(az,{...Z})})})})},ez=rz;import{useMemo as b1}from"react";var N7=e9(c6(),1);import{useEffect as ZV,useState as JV}from"react";var CZ=({onError:Z}={})=>{let[J,Y]=JV(null),X=dZ();return ZV(()=>{if(typeof window==="undefined")return;let G=window.Telegram?.WebApp;if(!G)return;try{G.ready?.()}catch(W){Z?.()}if(X==="telegram_expanded"&&(G.platform==="ios"||G.platform==="android"))G.expand();Y(G)},[]),J};import{jsx as q0,Fragment as GV}from"react/jsx-runtime";var YV=({location:Z,fallback:J,piecache:Y,onError:X,queryOptions:G})=>{let W=s0(),K=G9(),H=A0(),z=b1(()=>N7.createAxiosDateTransformer({baseURL:W}),[W]),V=b1(()=>V9(),[]),Q=b1(()=>W?z9(W):null,[W]),L=b1(()=>W?K9(W,K):null,[W,K]),F=CZ({onError:X}),{data:M,isLoading:$,error:U}=x9({queryKey:["uiConfig",Z.pathname+Z.search,F?.initData],enabled:!!F?.initData,queryFn:async()=>{let D=new URLSearchParams(Z.search);if(D.set("__pieroot","telegram"),F?.initData)D.set("initData",F.initData);let N="/api/content"+Z.pathname+"?"+D.toString();if(H)console.log("[PieRoot] Fetching UI configuration from:",N);let w=await z.get(N,{headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET,PUT,POST,DELETE,PATCH,OPTIONS","Content-type":"application/json"},withCredentials:!0});if(H)console.log("[PieRoot] Received UI configuration:",w.data);return w.data},staleTime:1/0,gcTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,retry:!0,retryDelay:(D)=>Math.min(1000*2**D,30000),...G}),B=a9(Z.pathname,Y,J);if(!W)throw Error("Set PIE_API_SERVER and PIE_CENTRIFUGE_SERVER");if(U&&H)return console.error("[PieRoot] Error fetching UI configuration:",U),console.error("[PieRoot] Error details:",{message:U.message,status:U.response?.status,data:U.response?.data}),X?.(),B;if($||!M){if(H)console.log("[PieRoot] Loading state:",{isLoading:$,hasUiConfiguration:!!M});return B}if(H)console.log("[PieRoot] UI configuration loaded successfully:",M),console.log("[PieRoot] Rendering UI with configuration");return q0(j0.Provider,{value:V,children:q0(S0.Provider,{value:Q,children:q0(_0.Provider,{value:L,children:q0(G0.Provider,{value:J??q0(GV,{}),children:q0(L9,{children:q0(F9,{children:q0("form",{id:"piedata_global_form",action:W+"api/process"+Z.pathname,method:"post",encType:"multipart/form-data",children:q0(Q0,{uiConfig:M})})})})})})})})},XV=(Z)=>{let J=b1(()=>new Z9,[]);return q0(I0.Provider,{value:Z.onNavigate,children:q0(o0.Provider,{value:Z.config,children:q0(J9,{client:J,children:q0(YV,{...Z})})})})},WV=XV;import{useMemo as xZ,useState as KV}from"react";import{jsx as x0,Fragment as VV}from"react/jsx-runtime";var HV=({location:Z,fallback:J,children:Y})=>{let X=s0(),G=G9(),W=A0(),K=xZ(()=>V9(),[]),H=xZ(()=>X?z9(X):null,[X]),z=xZ(()=>X?K9(X,G):null,[X,G]);if(W)console.log("[PieRoot] Rendering with location:",Z),console.log("[PieRoot] API_SERVER:",X),console.log("[PieRoot] CENTRIFUGE_SERVER:",G),console.log("[PieRoot] Fallback provided:",!!J);return x0(j0.Provider,{value:K,children:x0(S0.Provider,{value:H,children:x0(_0.Provider,{value:z,children:x0(G0.Provider,{value:J??x0(VV,{}),children:x0(L9,{children:x0(F9,{children:x0("form",{id:"piedata_global_form",action:X+"api/process"+Z.pathname,method:"post",encType:"multipart/form-data",children:Y})})})})})})})},zV=(Z)=>{let[J]=KV(()=>new Z9);return x0(I0.Provider,{value:Z.onNavigate,children:x0(o0.Provider,{value:Z.config,children:x0(J9,{client:J,children:x0(HV,{...Z})})})})},QV=zV;import{useMemo as g1}from"react";var P7=e9(c6(),1);import{useEffect as $V,useState as UV}from"react";var A7=()=>{let[Z,J]=UV(null);return $V(()=>{if(typeof window==="undefined")return;let Y=window.WebApp;if(!Y)return;Y.ready(),J(Y)},[]),Z};import{jsx as T0,Fragment as FV}from"react/jsx-runtime";var BV=({location:Z,fallback:J,piecache:Y,onError:X,queryOptions:G})=>{let W=s0(),K=G9(),H=A0(),z=g1(()=>P7.createAxiosDateTransformer({baseURL:W}),[W]),V=g1(()=>V9(),[]),Q=g1(()=>W?z9(W):null,[W]),L=g1(()=>W?K9(W,K):null,[W,K]),F=A7(),{data:M,isLoading:$,error:U}=x9({queryKey:["uiConfig",Z.pathname+Z.search,F?.initData],queryFn:async()=>{let D=new URLSearchParams(Z.search);if(D.set("__pieroot","max"),F?.initData)D.set("initData",F.initData);let N="/api/content"+Z.pathname+"?"+D.toString();if(H)console.log("[PieRoot] Fetching UI configuration from:",N);let w=await z.get(N,{headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET,PUT,POST,DELETE,PATCH,OPTIONS","Content-type":"application/json"},withCredentials:!0});if(H)console.log("[PieRoot] Received UI configuration:",w.data);return w.data},enabled:!!F?.initData,staleTime:1/0,gcTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,retry:!0,retryDelay:(D)=>Math.min(1000*2**D,30000),...G}),B=a9(Z.pathname,Y,J);if(!W)throw Error("Set PIE_API_SERVER and PIE_CENTRIFUGE_SERVER");if(U&&H)return console.error("[PieRoot] Error fetching UI configuration:",U),console.error("[PieRoot] Error details:",{message:U.message,status:U.response?.status,data:U.response?.data}),X?.(),B;if($||!M){if(H)console.log("[PieRoot] Loading state:",{isLoading:$,hasUiConfiguration:!!M});return B}if(H)console.log("[PieRoot] UI configuration loaded successfully:",M),console.log("[PieRoot] Rendering UI with configuration");return T0(j0.Provider,{value:V,children:T0(S0.Provider,{value:Q,children:T0(_0.Provider,{value:L,children:T0(G0.Provider,{value:J??T0(FV,{}),children:T0(L9,{children:T0(F9,{children:T0("form",{id:"piedata_global_form",action:W+"api/process"+Z.pathname,method:"post",encType:"multipart/form-data",children:T0(Q0,{uiConfig:M})})})})})})})})},LV=(Z)=>{let J=g1(()=>new Z9,[]);return T0(I0.Provider,{value:Z.onNavigate,children:T0(o0.Provider,{value:Z.config,children:T0(J9,{client:J,children:T0(BV,{...Z})})})})},MV=LV;import{useMemo as IV}from"react";var DV=(Z,J={},Y=[],X,G)=>{let W=G?.renderingLogEnabled??!1;if(!G?.apiServer){if(W)console.warn("Registration FAILED: apiServer is missing!");return()=>{}}let K=G?.apiServer;if(W)console.log("Registering AJAX: ",X,J,Y);if(!X||!Z){if(W)console.warn("Registration FAILED: pathname or setUiAjaxConfiguration is missing!");return()=>{}}return async(H={})=>{if(typeof window==="undefined"||typeof document==="undefined"){if(W)console.warn("getAjaxSubmit called on server, skipping DOM-dependent logic");return}if(Y.includes("sid"))await $Z();let z=new FormData;for(let[Q,L]of Object.entries({...J,...H}))z.append(Q,L);for(let Q of Y)if(Q==="sid"){if(!window.sid)throw new Error("SocketIO isn't initialized properly");z.append("sid",window.sid)}else{let L=document.getElementsByName(Q);if(!L.length){if(W)console.warn(`No input found with name ${Q}`);continue}let F=L[0];if(F instanceof HTMLInputElement)if(F.type==="file"&&F.files)Array.from(F.files).forEach((M)=>z.append(Q,M));else z.append(Q,F.value);else if(F instanceof HTMLTextAreaElement)z.append(Q,F.value)}let V=K+"api/ajax_content"+X;return Z(null),await fetch(V,{method:"POST",body:z}).then(async(Q)=>{let F=(Q.headers.get("content-type")||"").includes("application/json");if(!!Q.body?.getReader&&!F){let $=Q.body.getReader(),U=new TextDecoder,B="";while(!0){let{done:D,value:N}=await $.read();if(D)break;B+=U.decode(N,{stream:!0});let w=B.split(`
19
- `);B=w.pop()??"";for(let P of w){let T=P.trim();if(!T)continue;try{let k=JSON.parse(T);Z([k])}catch{if(W)console.warn("Failed to parse streamed line:",T)}}}if(B.trim())try{let D=JSON.parse(B);Z([D])}catch{if(W)console.warn("Failed to parse final streamed line:",B)}return{}}else{let $=await Q.json();return Z($),$}}).catch((Q)=>{if(W)console.error("AJAX request failed:",Q);return Z(null),Q})}},wV=(Z,J={},Y=[],X)=>{let{apiServer:G,enableRenderingLog:W}=v9(),K=JSON.stringify(J),H=JSON.stringify(Y);return IV(()=>DV(Z,J,Y,X,{apiServer:G,renderingLogEnabled:W}),[Z,K,H,X,G,W])};function NV(Z){if(!Z)return{};return{...Z}}var AV=(Z,J)=>{let Y=new Array(Z.length+J.length);for(let X=0;X<Z.length;X++)Y[X]=Z[X];for(let X=0;X<J.length;X++)Y[Z.length+X]=J[X];return Y},PV=(Z,J)=>({classGroupId:Z,validator:J}),_7=(Z=new Map,J=null,Y)=>({nextPart:Z,validators:J,classGroupId:Y});var R7=[];var RV=(Z)=>{let J=qV(Z),{conflictingClassGroups:Y,conflictingClassGroupModifiers:X}=Z;return{getClassGroupId:(K)=>{if(K.startsWith("[")&&K.endsWith("]"))return OV(K);let H=K.split("-"),z=H[0]===""&&H.length>1?1:0;return S7(H,z,J)},getConflictingClassGroupIds:(K,H)=>{if(H){let z=X[K],V=Y[K];if(z){if(V)return AV(V,z);return z}return V||R7}return Y[K]||R7}}},S7=(Z,J,Y)=>{if(Z.length-J===0)return Y.classGroupId;let G=Z[J],W=Y.nextPart.get(G);if(W){let V=S7(Z,J+1,W);if(V)return V}let K=Y.validators;if(K===null)return;let H=J===0?Z.join("-"):Z.slice(J).join("-"),z=K.length;for(let V=0;V<z;V++){let Q=K[V];if(Q.validator(H))return Q.classGroupId}return},OV=(Z)=>Z.slice(1,-1).indexOf(":")===-1?void 0:(()=>{let J=Z.slice(1,-1),Y=J.indexOf(":"),X=J.slice(0,Y);return X?"arbitrary.."+X:void 0})(),qV=(Z)=>{let{theme:J,classGroups:Y}=Z;return TV(Y,J)},TV=(Z,J)=>{let Y=_7();for(let X in Z){let G=Z[X];fZ(G,Y,X,J)}return Y},fZ=(Z,J,Y,X)=>{let G=Z.length;for(let W=0;W<G;W++){let K=Z[W];EV(K,J,Y,X)}},EV=(Z,J,Y,X)=>{if(typeof Z==="string"){_V(Z,J,Y);return}if(typeof Z==="function"){SV(Z,J,Y,X);return}jV(Z,J,Y,X)},_V=(Z,J,Y)=>{let X=Z===""?J:j7(J,Z);X.classGroupId=Y},SV=(Z,J,Y,X)=>{if(CV(Z)){fZ(Z(X),J,Y,X);return}if(J.validators===null)J.validators=[];J.validators.push(PV(Y,Z))},jV=(Z,J,Y,X)=>{let G=Object.entries(Z),W=G.length;for(let K=0;K<W;K++){let[H,z]=G[K];fZ(z,j7(J,H),Y,X)}},j7=(Z,J)=>{let Y=Z,X=J.split("-"),G=X.length;for(let W=0;W<G;W++){let K=X[W],H=Y.nextPart.get(K);if(!H)H=_7(),Y.nextPart.set(K,H);Y=H}return Y},CV=(Z)=>("isThemeGetter"in Z)&&Z.isThemeGetter===!0,xV=(Z)=>{if(Z<1)return{get:()=>{return},set:()=>{}};let J=0,Y=Object.create(null),X=Object.create(null),G=(W,K)=>{if(Y[W]=K,J++,J>Z)J=0,X=Y,Y=Object.create(null)};return{get(W){let K=Y[W];if(K!==void 0)return K;if((K=X[W])!==void 0)return G(W,K),K},set(W,K){if(W in Y)Y[W]=K;else G(W,K)}}};var kV=[],O7=(Z,J,Y,X,G)=>({modifiers:Z,hasImportantModifier:J,baseClassName:Y,maybePostfixModifierPosition:X,isExternal:G}),fV=(Z)=>{let{prefix:J,experimentalParseClassName:Y}=Z,X=(G)=>{let W=[],K=0,H=0,z=0,V,Q=G.length;for(let U=0;U<Q;U++){let B=G[U];if(K===0&&H===0){if(B===":"){W.push(G.slice(z,U)),z=U+1;continue}if(B==="/"){V=U;continue}}if(B==="[")K++;else if(B==="]")K--;else if(B==="(")H++;else if(B===")")H--}let L=W.length===0?G:G.slice(z),F=L,M=!1;if(L.endsWith("!"))F=L.slice(0,-1),M=!0;else if(L.startsWith("!"))F=L.slice(1),M=!0;let $=V&&V>z?V-z:void 0;return O7(W,M,F,$)};if(J){let G=J+":",W=X;X=(K)=>K.startsWith(G)?W(K.slice(G.length)):O7(kV,!1,K,void 0,!0)}if(Y){let G=X;X=(W)=>Y({className:W,parseClassName:G})}return X},hV=(Z)=>{let J=new Map;return Z.orderSensitiveModifiers.forEach((Y,X)=>{J.set(Y,1e6+X)}),(Y)=>{let X=[],G=[];for(let W=0;W<Y.length;W++){let K=Y[W],H=K[0]==="[",z=J.has(K);if(H||z){if(G.length>0)G.sort(),X.push(...G),G=[];X.push(K)}else G.push(K)}if(G.length>0)G.sort(),X.push(...G);return X}},yV=(Z)=>({cache:xV(Z.cacheSize),parseClassName:fV(Z),sortModifiers:hV(Z),...RV(Z)}),vV=/\s+/,bV=(Z,J)=>{let{parseClassName:Y,getClassGroupId:X,getConflictingClassGroupIds:G,sortModifiers:W}=J,K=[],H=Z.trim().split(vV),z="";for(let V=H.length-1;V>=0;V-=1){let Q=H[V],{isExternal:L,modifiers:F,hasImportantModifier:M,baseClassName:$,maybePostfixModifierPosition:U}=Y(Q);if(L){z=Q+(z.length>0?" "+z:z);continue}let B=!!U,D=X(B?$.substring(0,U):$);if(!D){if(!B){z=Q+(z.length>0?" "+z:z);continue}if(D=X($),!D){z=Q+(z.length>0?" "+z:z);continue}B=!1}let N=F.length===0?"":F.length===1?F[0]:W(F).join(":"),w=M?N+"!":N,P=w+D;if(K.indexOf(P)>-1)continue;K.push(P);let T=G(D,B);for(let k=0;k<T.length;++k){let q=T[k];K.push(w+q)}z=Q+(z.length>0?" "+z:z)}return z},gV=(...Z)=>{let J=0,Y,X,G="";while(J<Z.length)if(Y=Z[J++]){if(X=C7(Y))G&&(G+=" "),G+=X}return G},C7=(Z)=>{if(typeof Z==="string")return Z;let J,Y="";for(let X=0;X<Z.length;X++)if(Z[X]){if(J=C7(Z[X]))Y&&(Y+=" "),Y+=J}return Y},mV=(Z,...J)=>{let Y,X,G,W,K=(z)=>{let V=J.reduce((Q,L)=>L(Q),Z());return Y=yV(V),X=Y.cache.get,G=Y.cache.set,W=H,H(z)},H=(z)=>{let V=X(z);if(V)return V;let Q=bV(z,Y);return G(z,Q),Q};return W=K,(...z)=>W(gV(...z))},dV=[],t=(Z)=>{let J=(Y)=>Y[Z]||dV;return J.isThemeGetter=!0,J},x7=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,k7=/^\((?:(\w[\w-]*):)?(.+)\)$/i,pV=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,uV=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cV=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,lV=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,iV=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,nV=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,I9=(Z)=>pV.test(Z),x=(Z)=>!!Z&&!Number.isNaN(Number(Z)),D9=(Z)=>!!Z&&Number.isInteger(Number(Z)),kZ=(Z)=>Z.endsWith("%")&&x(Z.slice(0,-1)),Y9=(Z)=>uV.test(Z),f7=()=>!0,oV=(Z)=>cV.test(Z)&&!lV.test(Z),hZ=()=>!1,sV=(Z)=>iV.test(Z),aV=(Z)=>nV.test(Z),rV=(Z)=>!R(Z)&&!O(Z),tV=(Z)=>w9(Z,v7,hZ),R=(Z)=>x7.test(Z),h9=(Z)=>w9(Z,b7,oV),q7=(Z)=>w9(Z,KQ,x),eV=(Z)=>w9(Z,m7,f7),ZQ=(Z)=>w9(Z,g7,hZ),T7=(Z)=>w9(Z,h7,hZ),JQ=(Z)=>w9(Z,y7,aV),l6=(Z)=>w9(Z,d7,sV),O=(Z)=>k7.test(Z),m1=(Z)=>y9(Z,b7),YQ=(Z)=>y9(Z,g7),E7=(Z)=>y9(Z,h7),XQ=(Z)=>y9(Z,v7),GQ=(Z)=>y9(Z,y7),i6=(Z)=>y9(Z,d7,!0),WQ=(Z)=>y9(Z,m7,!0),w9=(Z,J,Y)=>{let X=x7.exec(Z);if(X){if(X[1])return J(X[1]);return Y(X[2])}return!1},y9=(Z,J,Y=!1)=>{let X=k7.exec(Z);if(X){if(X[1])return J(X[1]);return Y}return!1},h7=(Z)=>Z==="position"||Z==="percentage",y7=(Z)=>Z==="image"||Z==="url",v7=(Z)=>Z==="length"||Z==="size"||Z==="bg-size",b7=(Z)=>Z==="length",KQ=(Z)=>Z==="number",g7=(Z)=>Z==="family-name",m7=(Z)=>Z==="number"||Z==="weight",d7=(Z)=>Z==="shadow";var HQ=()=>{let Z=t("color"),J=t("font"),Y=t("text"),X=t("font-weight"),G=t("tracking"),W=t("leading"),K=t("breakpoint"),H=t("container"),z=t("spacing"),V=t("radius"),Q=t("shadow"),L=t("inset-shadow"),F=t("text-shadow"),M=t("drop-shadow"),$=t("blur"),U=t("perspective"),B=t("aspect"),D=t("ease"),N=t("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...P(),O,R],k=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto","contain","none"],A=()=>[O,R,z],f=()=>[I9,"full","auto",...A()],u=()=>[D9,"none","subgrid",O,R],n=()=>["auto",{span:["full",D9,O,R]},D9,O,R],d=()=>[D9,"auto",O,R],o=()=>["auto","min","max","fr",O,R],F0=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],N0=()=>["start","end","center","stretch","center-safe","end-safe"],h=()=>["auto",...A()],K0=()=>[I9,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],e=()=>[I9,"screen","full","dvw","lvw","svw","min","max","fit",...A()],N9=()=>[I9,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],_=()=>[Z,O,R],E0=()=>[...P(),E7,T7,{position:[O,R]}],v0=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A9=()=>["auto","cover","contain",XQ,tV,{size:[O,R]}],n0=()=>[kZ,m1,h9],s=()=>["","none","full",V,O,R],Y0=()=>["",x,m1,h9],E=()=>["solid","dashed","dotted","double"],b0=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],p=()=>[x,kZ,E7,T7],r9=()=>["","none",$,O,R],P9=()=>["none",x,O,R],X9=()=>["none",x,O,R],n6=()=>[x,O,R],d1=()=>[I9,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Y9],breakpoint:[Y9],color:[f7],container:[Y9],"drop-shadow":[Y9],ease:["in","out","in-out"],font:[rV],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Y9],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Y9],shadow:[Y9],spacing:["px",x],text:[Y9],"text-shadow":[Y9],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",I9,R,O,B]}],container:["container"],columns:[{columns:[x,R,O,H]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:T()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:q()}],"overscroll-x":[{"overscroll-x":q()}],"overscroll-y":[{"overscroll-y":q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:f()}],"inset-x":[{"inset-x":f()}],"inset-y":[{"inset-y":f()}],start:[{"inset-s":f(),start:f()}],end:[{"inset-e":f(),end:f()}],"inset-bs":[{"inset-bs":f()}],"inset-be":[{"inset-be":f()}],top:[{top:f()}],right:[{right:f()}],bottom:[{bottom:f()}],left:[{left:f()}],visibility:["visible","invisible","collapse"],z:[{z:[D9,"auto",O,R]}],basis:[{basis:[I9,"full","auto",H,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[x,I9,"auto","initial","none",R]}],grow:[{grow:["",x,O,R]}],shrink:[{shrink:["",x,O,R]}],order:[{order:[D9,"first","last","none",O,R]}],"grid-cols":[{"grid-cols":u()}],"col-start-end":[{col:n()}],"col-start":[{"col-start":d()}],"col-end":[{"col-end":d()}],"grid-rows":[{"grid-rows":u()}],"row-start-end":[{row:n()}],"row-start":[{"row-start":d()}],"row-end":[{"row-end":d()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":o()}],"auto-rows":[{"auto-rows":o()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...F0(),"normal"]}],"justify-items":[{"justify-items":[...N0(),"normal"]}],"justify-self":[{"justify-self":["auto",...N0()]}],"align-content":[{content:["normal",...F0()]}],"align-items":[{items:[...N0(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...N0(),{baseline:["","last"]}]}],"place-content":[{"place-content":F0()}],"place-items":[{"place-items":[...N0(),"baseline"]}],"place-self":[{"place-self":["auto",...N0()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:h()}],mx:[{mx:h()}],my:[{my:h()}],ms:[{ms:h()}],me:[{me:h()}],mbs:[{mbs:h()}],mbe:[{mbe:h()}],mt:[{mt:h()}],mr:[{mr:h()}],mb:[{mb:h()}],ml:[{ml:h()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:K0()}],"inline-size":[{inline:["auto",...e()]}],"min-inline-size":[{"min-inline":["auto",...e()]}],"max-inline-size":[{"max-inline":["none",...e()]}],"block-size":[{block:["auto",...N9()]}],"min-block-size":[{"min-block":["auto",...N9()]}],"max-block-size":[{"max-block":["none",...N9()]}],w:[{w:[H,"screen",...K0()]}],"min-w":[{"min-w":[H,"screen","none",...K0()]}],"max-w":[{"max-w":[H,"screen","none","prose",{screen:[K]},...K0()]}],h:[{h:["screen","lh",...K0()]}],"min-h":[{"min-h":["screen","lh","none",...K0()]}],"max-h":[{"max-h":["screen","lh",...K0()]}],"font-size":[{text:["base",Y,m1,h9]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[X,WQ,eV]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",kZ,R]}],"font-family":[{font:[YQ,ZQ,J]}],"font-features":[{"font-features":[R]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[G,O,R]}],"line-clamp":[{"line-clamp":[x,"none",O,q7]}],leading:[{leading:[W,...A()]}],"list-image":[{"list-image":["none",O,R]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",O,R]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:_()}],"text-color":[{text:_()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...E(),"wavy"]}],"text-decoration-thickness":[{decoration:[x,"from-font","auto",O,h9]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[x,"auto",O,R]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",O,R]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",O,R]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:E0()}],"bg-repeat":[{bg:v0()}],"bg-size":[{bg:A9()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},D9,O,R],radial:["",O,R],conic:[D9,O,R]},GQ,JQ]}],"bg-color":[{bg:_()}],"gradient-from-pos":[{from:n0()}],"gradient-via-pos":[{via:n0()}],"gradient-to-pos":[{to:n0()}],"gradient-from":[{from:_()}],"gradient-via":[{via:_()}],"gradient-to":[{to:_()}],rounded:[{rounded:s()}],"rounded-s":[{"rounded-s":s()}],"rounded-e":[{"rounded-e":s()}],"rounded-t":[{"rounded-t":s()}],"rounded-r":[{"rounded-r":s()}],"rounded-b":[{"rounded-b":s()}],"rounded-l":[{"rounded-l":s()}],"rounded-ss":[{"rounded-ss":s()}],"rounded-se":[{"rounded-se":s()}],"rounded-ee":[{"rounded-ee":s()}],"rounded-es":[{"rounded-es":s()}],"rounded-tl":[{"rounded-tl":s()}],"rounded-tr":[{"rounded-tr":s()}],"rounded-br":[{"rounded-br":s()}],"rounded-bl":[{"rounded-bl":s()}],"border-w":[{border:Y0()}],"border-w-x":[{"border-x":Y0()}],"border-w-y":[{"border-y":Y0()}],"border-w-s":[{"border-s":Y0()}],"border-w-e":[{"border-e":Y0()}],"border-w-bs":[{"border-bs":Y0()}],"border-w-be":[{"border-be":Y0()}],"border-w-t":[{"border-t":Y0()}],"border-w-r":[{"border-r":Y0()}],"border-w-b":[{"border-b":Y0()}],"border-w-l":[{"border-l":Y0()}],"divide-x":[{"divide-x":Y0()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Y0()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...E(),"hidden","none"]}],"divide-style":[{divide:[...E(),"hidden","none"]}],"border-color":[{border:_()}],"border-color-x":[{"border-x":_()}],"border-color-y":[{"border-y":_()}],"border-color-s":[{"border-s":_()}],"border-color-e":[{"border-e":_()}],"border-color-bs":[{"border-bs":_()}],"border-color-be":[{"border-be":_()}],"border-color-t":[{"border-t":_()}],"border-color-r":[{"border-r":_()}],"border-color-b":[{"border-b":_()}],"border-color-l":[{"border-l":_()}],"divide-color":[{divide:_()}],"outline-style":[{outline:[...E(),"none","hidden"]}],"outline-offset":[{"outline-offset":[x,O,R]}],"outline-w":[{outline:["",x,m1,h9]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","none",Q,i6,l6]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",L,i6,l6]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:Y0()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[x,h9]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":Y0()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",F,i6,l6]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[x,O,R]}],"mix-blend":[{"mix-blend":[...b0(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":b0()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[x]}],"mask-image-linear-from-pos":[{"mask-linear-from":p()}],"mask-image-linear-to-pos":[{"mask-linear-to":p()}],"mask-image-linear-from-color":[{"mask-linear-from":_()}],"mask-image-linear-to-color":[{"mask-linear-to":_()}],"mask-image-t-from-pos":[{"mask-t-from":p()}],"mask-image-t-to-pos":[{"mask-t-to":p()}],"mask-image-t-from-color":[{"mask-t-from":_()}],"mask-image-t-to-color":[{"mask-t-to":_()}],"mask-image-r-from-pos":[{"mask-r-from":p()}],"mask-image-r-to-pos":[{"mask-r-to":p()}],"mask-image-r-from-color":[{"mask-r-from":_()}],"mask-image-r-to-color":[{"mask-r-to":_()}],"mask-image-b-from-pos":[{"mask-b-from":p()}],"mask-image-b-to-pos":[{"mask-b-to":p()}],"mask-image-b-from-color":[{"mask-b-from":_()}],"mask-image-b-to-color":[{"mask-b-to":_()}],"mask-image-l-from-pos":[{"mask-l-from":p()}],"mask-image-l-to-pos":[{"mask-l-to":p()}],"mask-image-l-from-color":[{"mask-l-from":_()}],"mask-image-l-to-color":[{"mask-l-to":_()}],"mask-image-x-from-pos":[{"mask-x-from":p()}],"mask-image-x-to-pos":[{"mask-x-to":p()}],"mask-image-x-from-color":[{"mask-x-from":_()}],"mask-image-x-to-color":[{"mask-x-to":_()}],"mask-image-y-from-pos":[{"mask-y-from":p()}],"mask-image-y-to-pos":[{"mask-y-to":p()}],"mask-image-y-from-color":[{"mask-y-from":_()}],"mask-image-y-to-color":[{"mask-y-to":_()}],"mask-image-radial":[{"mask-radial":[O,R]}],"mask-image-radial-from-pos":[{"mask-radial-from":p()}],"mask-image-radial-to-pos":[{"mask-radial-to":p()}],"mask-image-radial-from-color":[{"mask-radial-from":_()}],"mask-image-radial-to-color":[{"mask-radial-to":_()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":P()}],"mask-image-conic-pos":[{"mask-conic":[x]}],"mask-image-conic-from-pos":[{"mask-conic-from":p()}],"mask-image-conic-to-pos":[{"mask-conic-to":p()}],"mask-image-conic-from-color":[{"mask-conic-from":_()}],"mask-image-conic-to-color":[{"mask-conic-to":_()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:E0()}],"mask-repeat":[{mask:v0()}],"mask-size":[{mask:A9()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",O,R]}],filter:[{filter:["","none",O,R]}],blur:[{blur:r9()}],brightness:[{brightness:[x,O,R]}],contrast:[{contrast:[x,O,R]}],"drop-shadow":[{"drop-shadow":["","none",M,i6,l6]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",x,O,R]}],"hue-rotate":[{"hue-rotate":[x,O,R]}],invert:[{invert:["",x,O,R]}],saturate:[{saturate:[x,O,R]}],sepia:[{sepia:["",x,O,R]}],"backdrop-filter":[{"backdrop-filter":["","none",O,R]}],"backdrop-blur":[{"backdrop-blur":r9()}],"backdrop-brightness":[{"backdrop-brightness":[x,O,R]}],"backdrop-contrast":[{"backdrop-contrast":[x,O,R]}],"backdrop-grayscale":[{"backdrop-grayscale":["",x,O,R]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[x,O,R]}],"backdrop-invert":[{"backdrop-invert":["",x,O,R]}],"backdrop-opacity":[{"backdrop-opacity":[x,O,R]}],"backdrop-saturate":[{"backdrop-saturate":[x,O,R]}],"backdrop-sepia":[{"backdrop-sepia":["",x,O,R]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",O,R]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[x,"initial",O,R]}],ease:[{ease:["linear","initial",D,O,R]}],delay:[{delay:[x,O,R]}],animate:[{animate:["none",N,O,R]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[U,O,R]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:P9()}],"rotate-x":[{"rotate-x":P9()}],"rotate-y":[{"rotate-y":P9()}],"rotate-z":[{"rotate-z":P9()}],scale:[{scale:X9()}],"scale-x":[{"scale-x":X9()}],"scale-y":[{"scale-y":X9()}],"scale-z":[{"scale-z":X9()}],"scale-3d":["scale-3d"],skew:[{skew:n6()}],"skew-x":[{"skew-x":n6()}],"skew-y":[{"skew-y":n6()}],transform:[{transform:[O,R,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:d1()}],"translate-x":[{"translate-x":d1()}],"translate-y":[{"translate-y":d1()}],"translate-z":[{"translate-z":d1()}],"translate-none":["translate-none"],accent:[{accent:_()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:_()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",O,R]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",O,R]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[x,m1,h9,q7]}],stroke:[{stroke:["none",..._()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}};var p7=mV(HQ);function zQ(...Z){return p7(b8(Z))}var VQ=()=>{if(typeof document==="undefined")return;let Z=document.getElementById("piedata_global_form");Z&&Z.submit()};var QQ=(Z,J)=>`${Z}${o6}${J}`;export{CZ as useWebApp,U6 as useOpenAIWebRTC,wV as useAjaxSubmit,iX as unregisterComponent,NV as sx2radium,VQ as submitGlobalForm,Q9 as registry,Z0 as registerPieComponent,lX as registerMultipleComponents,QQ as pieName,nX as hasComponent,aX as getRegistrySize,L1 as getRegistryEntry,oX as getComponentMeta,sX as getAllRegisteredComponents,zQ as cn,LG as UnionCard,f0 as UIRendererContext,M8 as UILoading,Q0 as UI,$G as SequenceCard,WV as PieTelegramRoot,ez as PieRoot,MV as PieMaxRoot,V0 as PieCard,QV as PieBaseRoot,o6 as PIEBREAK,_K as IOEventsCard,AW as HiddenCard,IW as HTMLEmbedCard,fK as BoxCard,_W as AutoRedirectCard,xK as AjaxGroupCard};
2
+ import{useContext as eo,useEffect as j,useRef as rt}from"react";import{createContext as Ko,useContext as Lo}from"react";var _=Ko(null),Y=()=>{let o=Lo(_);if(!o)throw new Error("usePieConfig must be used within PieConfigProvider");return o},Z=()=>{let{apiServer:o}=Y();return o},S=Z,O=()=>{let{centrifugeServer:o}=Y();return o};var z=()=>{let{enableRenderingLog:o}=Y();return o},To=z,go=()=>{let{pageProcessor:o}=Y();return o};var fo="__piedemo__";import{createContext as Fo}from"react";import{Centrifuge as $o}from"centrifuge";var zo=new Map,G=(o,t)=>{if(!t)return null;let f=`${o}::${t}`,r=zo.get(f);if(r)return r;async function m(){let c=await fetch(o+"api/centrifuge/gen_token");if(!c.ok){if(c.status===403)throw new $o.UnauthorizedError("Backend is not answering");throw new Error(`Unexpected status code ${c.status}`)}return(await c.json()).token}let n=new $o(t,{getToken:m});return zo.set(f,n),n},Qo=Fo(null),H=Qo;import{io as So}from"socket.io-client";import{createContext as jo}from"react";var Ao=new Map,b=(o)=>{let t=Ao.get(o);if(t)return t;let f=So(o,{autoConnect:!1,transports:["websocket"]});return Ao.set(o,f),f},vo=jo(null),N=vo;import ot from"mitt";import{createContext as tt}from"react";var co=null;function E(){if(!co)co=ot();return co}var nt=tt(null),x=nt;var mt=({card:o,data:t,children:f,useSocketioSupport:r=!1,useCentrifugeSupport:m=!1,useMittSupport:n=!1,centrifugeChannel:c=void 0,methods:d=void 0})=>{let e=To(),s=rt(d);if(j(()=>{s.current=d},[d]),e)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:r,centrifuge:m,mitt:n,centrifugeChannel:c}),console.log("[PieCard] Methods:",d?Object.keys(d):"none"),console.log("[PieCard] Has children:",!!f);let C=eo(N),l=eo(H),p=eo(x);if(j(()=>{if(!C||!r||!s.current||!t.name){if(e&&r)console.log("[PieCard] Socket.IO setup skipped:",{hasSocket:!!C,useSocketioSupport:r,hasMethods:!!s.current,hasDataName:!!t?.name});return}let u=Object.keys(s.current??{});return u.forEach((i)=>{let a=`pie${i}_${t.name}`;if(e)console.log(`[PieCard] Socket.IO registering event: ${a}`);C.on(a,(y)=>{s.current?.[i]?.(y)})}),()=>{u.forEach((i)=>{let a=`pie${i}_${t.name}`;if(e)console.log(`[PieCard] Socket.IO unregistering event: ${a}`);C.off(a)})}},[C,t.name,r]),j(()=>{if(!l||!m||!c||!t.name){if(e&&m)console.log("[PieCard] Centrifuge setup skipped:",{hasCentrifuge:!!l,useCentrifugeSupport:m,hasCentrifugeChannel:!!c,hasMethods:!!s.current,hasDataName:!!t?.name});return}let i=Object.keys(s.current??{}).map((a)=>{let y=`pie${a}_${t.name}_${c}`;if(e)console.log(`[PieCard] Centrifuge subscribing to channel: ${y}`);let P=l.newSubscription(y);return P.on("publication",(R)=>{if(e)console.log(`[PieCard] Centrifuge received data on ${y}:`,R.data);s.current?.[a]?.(R.data)}),P.subscribe(),P});return()=>{i.forEach((a)=>{if(e)console.log("[PieCard] Centrifuge unsubscribing from channel");a.unsubscribe(),l.removeSubscription(a)})}},[l,c,t.name,m]),j(()=>{if(!p||!n||!t.name){if(e&&n)console.log("[PieCard] Mitt setup skipped:",{hasMitt:!!p,useMittSupport:n,hasMethods:!!s.current,hasDataName:!!t?.name});return}let u=Object.keys(s.current??{}),i={};return u.forEach((a)=>{let y=`pie${a}_${t.name}`,P=(R)=>{if(e)console.log(`[PieCard] Mitt registering event: ${y}`);s.current?.[a]?.(R)};i[y]=P,p.on(y,P)}),()=>{Object.entries(i).forEach(([a,y])=>{if(e)console.log(`[PieCard] Mitt unregistering event: ${a}`);p.off(a,y)})}},[p,t.name,n]),e)console.log("[PieCard] Rendering complete, returning children");return f},T=mt;import{lazy as ft}from"react";var io=new Map;function Bo(o,t){return ft(()=>{if(io.has(t))return io.get(t);let f=o().then((r)=>r);return io.set(t,f),f})}var k=new Map,ct=(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=Bo(t.loader,o.name),t.loader=void 0,t.isLazy=!0;return t};function w(o){let t=ct(o);return k.set(t.name,t),t.component}var dt=(o)=>{o.forEach((t)=>w(t))},et=(o)=>{k.delete(o)},it=(o)=>{return k.has(o)},pt=(o)=>{return k.get(o)?.metadata},K=(o)=>{return k.get(o)},at=()=>{return Array.from(k.keys())},ut=()=>{return k.size};import{Suspense as Pt,useContext as Ut,memo as Rt}from"react";import{createContext as st}from"react";import{jsx as yt,Fragment as Ct}from"react/jsx-runtime";var lt=st(yt(Ct,{})),I=lt;import{jsx as po}from"react/jsx-runtime";function wt({uiConfig:o,setUiAjaxConfiguration:t}){let f=Ut(I),r=z();if(r)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 m=K(o.card);if(!m?.component){if(r)console.warn(`[UI] Component not found in registry: ${o.card}`),console.log("[UI] Returning fallback component");return f}if(r)console.log("[UI] Found component in registry:",{name:m.name,isLazy:m.isLazy,hasMetadata:!!m.metadata});let n=m.component,c=po(n,{data:o.data,content:o.content,setUiAjaxConfiguration:t});if(m.isLazy){if(r)console.log("[UI] Rendering lazy component with Suspense:",m.name);return po(Pt,{fallback:m.fallback?po(m.fallback,{}):f,children:c},`${m.name}`)}if(r)console.log("[UI] Rendering component directly:",m.name);return c}var g=Rt(wt);import{Suspense as gt,useContext as $t}from"react";import{createContext as It}from"react";var Tt=It(null),W=Tt;import{jsx as v}from"react/jsx-runtime";function Do({uiConfig:o,setUiAjaxConfiguration:t}){let f=$t(I),r=z();if(r)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 m=K(o.card);if(!m?.component){if(r)console.warn(`[UILoading] Component not found in registry: ${o.card}`),console.log("[UILoading] Returning fallback component");return f}if(r)console.log("[UILoading] Found component in registry:",{name:m.name,isLazy:m.isLazy,hasMetadata:!!m.metadata,hasFallback:!!m.fallback});if(m.fallback){if(r)console.log("[UILoading] Rendering fallback for:",m.name);let d=m.fallback;return v(d,{})}if(r)console.log("[UILoading] No fallback, rendering full component:",m.name);let n=m.component,c=v(W.Provider,{value:Do,children:v(n,{data:o.data,content:o.content,setUiAjaxConfiguration:t})});if(m.isLazy)return v(gt,{fallback:f,children:c},`${m.name}`);return c}var ao=Do;import{useContext as zt}from"react";import{jsx as uo}from"react/jsx-runtime";var At=({data:o,content:t,setUiAjaxConfiguration:f})=>{let{name:r,sx:m}=o,n=zt(W)??g;return uo(T,{card:r,data:o,children:uo("div",{style:m,id:r,children:t.map((c,d)=>{return uo(n,{uiConfig:c,setUiAjaxConfiguration:f},`children-${d}`)})})})},ho=At;var Bt=w({name:"SequenceCard",component:ho,metadata:{author:"PieData",description:"Simple div with styles joining few components"}});import{useContext as Dt}from"react";import{jsx as Ho}from"react/jsx-runtime";var ht=({data:o,content:t,setUiAjaxConfiguration:f})=>{let{name:r}=o,m=Dt(W)??g;return Ho(T,{card:r,data:o,children:t.map((n,c)=>{return Ho(m,{uiConfig:n,setUiAjaxConfiguration:f},`children-${c}`)})})},No=ht;var Ht=w({name:"UnionCard",component:No,metadata:{author:"PieData",description:"Renders one of many components"}});import{useEffect as Wt,useState as _t}from"react";import Zt from"html-react-parser";import{useCallback as oo,useEffect as Nt,useRef as so,useState as xt}from"react";function Mt(){let o=new AudioContext,t=o.createOscillator(),f=t.connect(o.createMediaStreamDestination());t.start();let r=f.stream.getAudioTracks()[0];return r.enabled=!1,r}function to(o=null,t){let[f,r]=xt(!1),m=so(null),n=so(null),c=so(null),d=oo(async(l,p=!0)=>{if(m.current)e();let u=new RTCPeerConnection;if(u.onconnectionstatechange=()=>{if(u.connectionState==="connected")r(!0);else if(["disconnected","failed","closed"].includes(u.connectionState))r(!1)},u.ontrack=(U)=>{if(o)o.srcObject=U.streams[0]},p){let U=await navigator.mediaDevices.getUserMedia({audio:!0});u.addTrack(U.getTracks()[0],U)}else{let U=Mt();u.addTrack(U)}let i=u.createDataChannel("oai-events");n.current=i,c.current=new Promise((U)=>{i.addEventListener("open",()=>{U()})});let a=await u.createOffer();await u.setLocalDescription(a);let h=await(await fetch(`${"https://api.openai.com/v1/realtime/calls"}?model=${"gpt-realtime"}`,{method:"POST",body:a.sdp,headers:{Authorization:`Bearer ${l}`,"Content-Type":"application/sdp"}})).text();await u.setRemoteDescription({type:"answer",sdp:h}),m.current=u,await c.current},[o]),e=oo(()=>{let l=n.current;if(l)l.close();m.current?.getSenders()?.forEach((p)=>p.track?.stop()),m.current?.close(),r(!1),m.current=null,n.current=null,c.current=null},[o]),s=oo((l)=>{let p=n.current;if(!p){console.error("Data channel is not ready",l);return}let u=new Date().toLocaleTimeString();if(l.event_id=l.event_id||crypto.randomUUID(),p.send(JSON.stringify(l)),!l.timestamp)l.timestamp=u;t?.(l)},[t,o]),C=oo((l)=>{if(!n.current){console.error("Data channel is not ready");return}let u=()=>{s({type:"conversation.item.create",item:{type:"message",role:"user",content:[{type:"input_text",text:l}]}}),s({type:"response.create"})};if(c.current)c.current.then(u);else u()},[t,o]);return Nt(()=>{let l=n.current;if(!l)return;let p=(u)=>{let i=JSON.parse(u.data);if(!i.timestamp)i.timestamp=new Date().toLocaleTimeString();t?.(i)};return l.addEventListener("message",p),()=>{l.removeEventListener("message",p)}},[t,o]),{isSessionActive:f,startSession:d,stopSession:e,sendTextMessage:C}}import{jsx as Gt}from"react/jsx-runtime";var Ot=({data:o})=>{let{html:t,useSocketioSupport:f,useCentrifugeSupport:r,useMittSupport:m,centrifugeChannel:n}=o,[c,d]=_t(t),{isSessionActive:e,startSession:s,sendTextMessage:C}=to(null,(i)=>{if(console.log(i.type,i.type==="response.output_text.delta"&&i.delta),i.type==="response.output_text.delta"&&i.delta)d((a)=>a+i.delta)});return Wt(()=>{d(t)},[t]),Gt(T,{card:"HTMLEmbedCard",data:o,methods:{update:(i)=>{d(i.value)},generateUsingAI:async(i)=>{try{if(!e&&i.token)await s(i.token,!1);C(i.prompt)}catch(a){console.error("Failed to generate using AI",a)}},initializeAI:async(i)=>{if(!e&&i.token)await s(i.token,!1)}},useCentrifugeSupport:r,useSocketioSupport:f,useMittSupport:m,centrifugeChannel:n,children:Zt(c)})},xo=Ot;var bt=w({name:"HTMLEmbedCard",component:xo,metadata:{author:"PieData"}});import{useEffect as Et,useState as kt}from"react";import{jsx as Mo}from"react/jsx-runtime";var Vt=({data:o})=>{let{name:t,value:f,useSocketioSupport:r,useCentrifugeSupport:m,useMittSupport:n,centrifugeChannel:c}=o,[d,e]=kt(f);return Et(()=>{e(f)},[f]),Mo(T,{card:"HiddenCard",data:o,useSocketioSupport:r,useCentrifugeSupport:m,useMittSupport:n,centrifugeChannel:c,methods:{update:({value:s})=>{e(s)}},children:Mo("input",{type:"hidden",id:t,name:t,value:d})})},Wo=Vt;var Xt=w({name:"HiddenCard",component:Wo,metadata:{author:"PieData"}});import{useContext as _o,useEffect as qt}from"react";import{createContext as Jt}from"react";var Yt=Jt(void 0),$=Yt;import{jsx as Ft,Fragment as Lt}from"react/jsx-runtime";var Kt=({data:o})=>{let{url:t}=o,f=_o($),r=_o(I);return qt(()=>{if(/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(t))window.location.href=t;else f?.(t)},[t,f]),Ft(Lt,{children:r})},Zo=Kt;var Qt=w({name:"AutoRedirectCard",component:Zo,metadata:{author:"PieData"}});import{Bounce as St,Slide as jt,Zoom as vt,Flip as on}from"react-toastify";import{toast as tn,ToastContainer as nn}from"react-toastify";import{useContext as rn,useMemo as mn,useRef as fn}from"react";import{jsx as lo,Fragment as un}from"react/jsx-runtime";var cn={bounce:St,slide:jt,zoom:vt,flip:on},dn=(o)=>{let t={...o,type:o.alertType,transition:o.transition?cn[o.transition]:void 0,position:o.position??"bottom-right",autoClose:o.autoClose??3000,style:{backgroundColor:"black",...o.sx}};tn(o.message,t)},en=(o)=>{console.log("Log event",o)},pn=(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(r){console.error("[IOEventsCard] Failed to show notification",r)}},f=window.Notification.permission;if(f==="granted"){t();return}if(f==="denied"){console.warn("[IOEventsCard] Notification permission denied");return}window.Notification.requestPermission().then((r)=>{if(r==="granted")t()})},an=({data:o})=>{let{useCentrifugeSupport:t,useSocketioSupport:f,useMittSupport:r,centrifugeChannel:m}=o,n=rn($),c=fn(n);c.current=n;let d=mn(()=>({alert:dn,log:en,push:pn,redirect:(e)=>{if(e.to){let s=e.to;if(/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(s))window.location.href=s;else c.current?.(s)}else window.location.reload()},reload:(e)=>{if(e.to){let s=e.to;if(/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(s))window.location.href=s;else c.current?.(s)}else window.location.reload()}}),[]);return lo(un,{children:lo(T,{card:"IOEventsCard",data:o,useCentrifugeSupport:t,useSocketioSupport:f,useMittSupport:r,centrifugeChannel:m,methods:d,children:lo(nn,{})})})},Oo=an;var sn=w({name:"IOEventsCard",component:Oo,metadata:{author:"PieData"}});import{useCallback as Co,useContext as yo,useEffect as ln,useRef as Cn,useState as Go}from"react";import{jsx as bo}from"react/jsx-runtime";var yn=({data:o,content:t})=>{let{useLoader:f,noReturn:r,returnType:m,useSocketioSupport:n,useCentrifugeSupport:c,useMittSupport:d,centrifugeChannel:e}=o,s=yo(I),C=yo(W)??g,[l,p]=Go(!1),[u,i]=Go(null),a=Cn(t),y=yo(x),P=Co((U)=>{if(U===null)p(!0);else if(p(!1),!r)a.current=U;if(!r)i(U)},[r]),R=Co((U)=>{a.current=U.content,i(U.content)},[]),h=Co((U)=>{if(U===null)p(!0);else if(p(!1),!r)for(let J of U)y?.emit(J.name,J.data)},[r,y]);if(ln(()=>{i(t),p(!1)},[t]),!u&&f)return s;return bo(T,{card:"AjaxGroupCard",data:o,methods:{changeContent:R},useSocketioSupport:n,useCentrifugeSupport:c,useMittSupport:d,centrifugeChannel:e,children:bo(C,{uiConfig:u??a.current,setUiAjaxConfiguration:m==="events"?h:P})})},Eo=yn;var Pn=w({name:"AjaxGroupCard",component:Eo,metadata:{author:"PieData",description:"Group card with AJAX support"}});import{useContext as ko}from"react";import{jsx as Po}from"react/jsx-runtime";var Un=({data:o,content:t,setUiAjaxConfiguration:f})=>{let{name:r,url:m,sx:n}=o,c=ko($),d=ko(W)??g;return Po(T,{card:r,data:o,children:Po("div",{style:n,id:r,onClick:(s)=>{if(m)if(s.stopPropagation(),/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(m))window.location.href=m;else c?.(m)},children:Po(d,{setUiAjaxConfiguration:f,uiConfig:t})})})},Vo=Un;var Rn=w({name:"BoxCard",component:Vo,metadata:{author:"PieData",description:"Simple div with styles joining few components"}});import{useMemo as L}from"react";import{QueryClient as hn,QueryClientProvider as Hn,useQuery as Nn}from"@tanstack/react-query";import{useContext as Tn,useEffect as gn}from"react";import{useEffect as wn,useState as In}from"react";var no=new Map,ro=new Map;function mo(o,t){let f=`${o}::${t}`,r=o?no.get(f):void 0,[m,n]=In(r??null);return wn(()=>{if(!o)return;if(no.has(f)){n(no.get(f));return}let c=ro.get(f);if(!c)c=fetch(o+`api/support/${t}`,{method:"GET"}).then((e)=>e.json()).then((e)=>{return no.set(f,e),ro.delete(f),e}).catch((e)=>{throw ro.delete(f),e}),ro.set(f,c);let d=!1;return c.then((e)=>{if(!d)n(e)}).catch(()=>{}),()=>{d=!0}},[o,t,f]),m}var Uo=null,Xo=null;function Jo(){Xo?.()}function Ro(){if(typeof window==="undefined")return Promise.resolve();if(typeof window.sid!=="undefined")return Promise.resolve();if(!Uo)Uo=new Promise((o)=>{Xo=()=>{o()}});return Uo}var $n=({children:o})=>{let t=Tn(N),f=S(),r=mo(f,"socketIO"),m=(n)=>{if(typeof window!=="undefined")window.sid=n.sid,Jo(),console.log(`SocketIO initialized: ${window.sid}`)};return gn(()=>{if(!t)return;let n=()=>{console.log("SocketIO connected")},c=(d)=>{console.log(`SocketIO disconnected: ${d}`),t.connect()};if(r)t.on("pieinit",m),t.on("connect",n),t.on("disconnect",c),t.connect();return()=>{if(r)t.off("pieinit",m),t.off("connect",n),t.off("disconnect",c),t.disconnect()}},[t,r]),o},V=$n;import{useContext as zn,useEffect as An}from"react";var Bn=({children:o})=>{let t=zn(H),f=S(),r=mo(f,"centrifuge");return An(()=>{if(!t)return;let m=()=>{console.log("Centrifuge connected")},n=(c)=>{console.log("Centrifuge disconnected:",c)};if(r)t.on("connected",m),t.on("disconnected",n),t.connect();return()=>{if(r)t.disconnect()}},[t,r]),o},X=Bn;import{createAxiosDateTransformer as xn}from"axios-date-transformer";import{jsx as Dn}from"react/jsx-runtime";function q(o,t,f){if(!t)return f;let r=o.replace(/^\//,""),m=t[r];if(!m)return f;return Dn(ao,{uiConfig:m})}import{jsx as A,Fragment as _n}from"react/jsx-runtime";var Mn=({location:o,fallback:t,piecache:f,onError:r,queryOptions:m})=>{let n=Z(),c=O(),d=z(),e=L(()=>xn({baseURL:n||""}),[n]),s=L(()=>E(),[]),C=L(()=>n?b(n):null,[n]),l=L(()=>n?G(n,c):null,[n,c]),{data:p,isLoading:u,error:i}=Nn({queryKey:["uiConfig",o.pathname+o.search,n],enabled:!!n,queryFn:async()=>{let y=new URLSearchParams(o.search);y.set("__pieroot","web");let P="/api/content"+o.pathname+"?"+y.toString();if(d)console.log("[PieRoot] Fetching UI configuration from:",P);let R=await e.get(P,{headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET,PUT,POST,DELETE,PATCH,OPTIONS","Content-type":"application/json"},withCredentials:!0});if(d)console.log("[PieRoot] Received UI configuration:",R.data);return R.data},staleTime:1/0,gcTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,retry:!0,retryDelay:(y)=>Math.min(1000*2**y,30000),...m}),a=q(o.pathname,f,t);if(!n)return a??null;if(d)console.log("[PieRoot] Rendering with location:",o),console.log("[PieRoot] API_SERVER:",n),console.log("[PieRoot] CENTRIFUGE_SERVER:",c),console.log("[PieRoot] Fallback provided:",!!t),console.log("[PieRoot] Piecache provided:",!!f);if(i){if(d)console.error("[PieRoot] Error fetching UI configuration:",i),console.error("[PieRoot] Error details:",{message:i.message,status:i.response?.status,data:i.response?.data});return r?.(),a}if(u||!p){if(d)console.log("[PieRoot] Loading state:",{isLoading:u,hasUiConfiguration:!!p});return a}if(d)console.log("[PieRoot] UI configuration loaded successfully:",p),console.log("[PieRoot] Rendering UI with configuration");return A(x.Provider,{value:s,children:A(N.Provider,{value:C,children:A(H.Provider,{value:l,children:A(I.Provider,{value:t??A(_n,{}),children:A(V,{children:A(X,{children:A("form",{id:"piedata_global_form",action:n+"api/process"+o.pathname,method:"post",encType:"multipart/form-data",children:A(g,{uiConfig:p})})})})})})})})},Wn=(o)=>{let t=L(()=>new hn,[]);return A($.Provider,{value:o.onNavigate,children:A(_.Provider,{value:o.config,children:A(Hn,{client:t,children:A(Mn,{...o})})})})},Zn=Wn;import{useMemo as F}from"react";import{QueryClient as bn,QueryClientProvider as En,useQuery as kn}from"@tanstack/react-query";import{createAxiosDateTransformer as Vn}from"axios-date-transformer";import{useEffect as On,useState as Gn}from"react";var wo=({onError:o}={})=>{let[t,f]=Gn(null),r=go();return On(()=>{if(typeof window==="undefined")return;let m=window.Telegram?.WebApp;if(!m)return;try{m.ready?.()}catch(n){o?.()}if(r==="telegram_expanded"&&(m.platform==="ios"||m.platform==="android"))m.expand();f(m)},[]),t};import{jsx as B,Fragment as Yn}from"react/jsx-runtime";var Xn=({location:o,fallback:t,piecache:f,onError:r,queryOptions:m})=>{let n=Z(),c=O(),d=z(),e=F(()=>Vn({baseURL:n}),[n]),s=F(()=>E(),[]),C=F(()=>n?b(n):null,[n]),l=F(()=>n?G(n,c):null,[n,c]),p=wo({onError:r}),{data:u,isLoading:i,error:a}=kn({queryKey:["uiConfig",o.pathname+o.search,p?.initData],enabled:!!p?.initData,queryFn:async()=>{let P=new URLSearchParams(o.search);if(P.set("__pieroot","telegram"),p?.initData)P.set("initData",p.initData);let R="/api/content"+o.pathname+"?"+P.toString();if(d)console.log("[PieRoot] Fetching UI configuration from:",R);let h=await e.get(R,{headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET,PUT,POST,DELETE,PATCH,OPTIONS","Content-type":"application/json"},withCredentials:!0});if(d)console.log("[PieRoot] Received UI configuration:",h.data);return h.data},staleTime:1/0,gcTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,retry:!0,retryDelay:(P)=>Math.min(1000*2**P,30000),...m}),y=q(o.pathname,f,t);if(!n)throw Error("Set PIE_API_SERVER and PIE_CENTRIFUGE_SERVER");if(a&&d)return console.error("[PieRoot] Error fetching UI configuration:",a),console.error("[PieRoot] Error details:",{message:a.message,status:a.response?.status,data:a.response?.data}),r?.(),y;if(i||!u){if(d)console.log("[PieRoot] Loading state:",{isLoading:i,hasUiConfiguration:!!u});return y}if(d)console.log("[PieRoot] UI configuration loaded successfully:",u),console.log("[PieRoot] Rendering UI with configuration");return B(x.Provider,{value:s,children:B(N.Provider,{value:C,children:B(H.Provider,{value:l,children:B(I.Provider,{value:t??B(Yn,{}),children:B(V,{children:B(X,{children:B("form",{id:"piedata_global_form",action:n+"api/process"+o.pathname,method:"post",encType:"multipart/form-data",children:B(g,{uiConfig:u})})})})})})})})},Jn=(o)=>{let t=F(()=>new bn,[]);return B($.Provider,{value:o.onNavigate,children:B(_.Provider,{value:o.config,children:B(En,{client:t,children:B(Xn,{...o})})})})},qn=Jn;import{useMemo as Io,useState as Kn}from"react";import{QueryClient as Ln,QueryClientProvider as Fn}from"@tanstack/react-query";import{jsx as M,Fragment as jn}from"react/jsx-runtime";var Qn=({location:o,fallback:t,children:f})=>{let r=Z(),m=O(),n=z(),c=Io(()=>E(),[]),d=Io(()=>r?b(r):null,[r]),e=Io(()=>r?G(r,m):null,[r,m]);if(n)console.log("[PieRoot] Rendering with location:",o),console.log("[PieRoot] API_SERVER:",r),console.log("[PieRoot] CENTRIFUGE_SERVER:",m),console.log("[PieRoot] Fallback provided:",!!t);return M(x.Provider,{value:c,children:M(N.Provider,{value:d,children:M(H.Provider,{value:e,children:M(I.Provider,{value:t??M(jn,{}),children:M(V,{children:M(X,{children:M("form",{id:"piedata_global_form",action:r+"api/process"+o.pathname,method:"post",encType:"multipart/form-data",children:f})})})})})})})},Sn=(o)=>{let[t]=Kn(()=>new Ln);return M($.Provider,{value:o.onNavigate,children:M(_.Provider,{value:o.config,children:M(Fn,{client:t,children:M(Qn,{...o})})})})},vn=Sn;import{useMemo as Q}from"react";import{QueryClient as nr,QueryClientProvider as rr,useQuery as mr}from"@tanstack/react-query";import{createAxiosDateTransformer as fr}from"axios-date-transformer";import{useEffect as or,useState as tr}from"react";var Yo=()=>{let[o,t]=tr(null);return or(()=>{if(typeof window==="undefined")return;let f=window.WebApp;if(!f)return;f.ready(),t(f)},[]),o};import{jsx as D,Fragment as er}from"react/jsx-runtime";var cr=({location:o,fallback:t,piecache:f,onError:r,queryOptions:m})=>{let n=Z(),c=O(),d=z(),e=Q(()=>fr({baseURL:n}),[n]),s=Q(()=>E(),[]),C=Q(()=>n?b(n):null,[n]),l=Q(()=>n?G(n,c):null,[n,c]),p=Yo(),{data:u,isLoading:i,error:a}=mr({queryKey:["uiConfig",o.pathname+o.search,p?.initData],queryFn:async()=>{let P=new URLSearchParams(o.search);if(P.set("__pieroot","max"),p?.initData)P.set("initData",p.initData);let R="/api/content"+o.pathname+"?"+P.toString();if(d)console.log("[PieRoot] Fetching UI configuration from:",R);let h=await e.get(R,{headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET,PUT,POST,DELETE,PATCH,OPTIONS","Content-type":"application/json"},withCredentials:!0});if(d)console.log("[PieRoot] Received UI configuration:",h.data);return h.data},enabled:!!p?.initData,staleTime:1/0,gcTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,retry:!0,retryDelay:(P)=>Math.min(1000*2**P,30000),...m}),y=q(o.pathname,f,t);if(!n)throw Error("Set PIE_API_SERVER and PIE_CENTRIFUGE_SERVER");if(a&&d)return console.error("[PieRoot] Error fetching UI configuration:",a),console.error("[PieRoot] Error details:",{message:a.message,status:a.response?.status,data:a.response?.data}),r?.(),y;if(i||!u){if(d)console.log("[PieRoot] Loading state:",{isLoading:i,hasUiConfiguration:!!u});return y}if(d)console.log("[PieRoot] UI configuration loaded successfully:",u),console.log("[PieRoot] Rendering UI with configuration");return D(x.Provider,{value:s,children:D(N.Provider,{value:C,children:D(H.Provider,{value:l,children:D(I.Provider,{value:t??D(er,{}),children:D(V,{children:D(X,{children:D("form",{id:"piedata_global_form",action:n+"api/process"+o.pathname,method:"post",encType:"multipart/form-data",children:D(g,{uiConfig:u})})})})})})})})},dr=(o)=>{let t=Q(()=>new nr,[]);return D($.Provider,{value:o.onNavigate,children:D(_.Provider,{value:o.config,children:D(rr,{client:t,children:D(cr,{...o})})})})},ir=dr;import{useMemo as pr}from"react";var ar=(o,t={},f=[],r,m)=>{let n=m?.renderingLogEnabled??!1;if(!m?.apiServer){if(n)console.warn("Registration FAILED: apiServer is missing!");return()=>{}}let c=m?.apiServer;if(n)console.log("Registering AJAX: ",r,t,f);if(!r||!o){if(n)console.warn("Registration FAILED: pathname or setUiAjaxConfiguration is missing!");return()=>{}}return async(d={})=>{if(typeof window==="undefined"||typeof document==="undefined"){if(n)console.warn("getAjaxSubmit called on server, skipping DOM-dependent logic");return}if(f.includes("sid"))await Ro();let e=new FormData;for(let[C,l]of Object.entries({...t,...d}))e.append(C,l);for(let C of f)if(C==="sid"){if(!window.sid)throw new Error("SocketIO isn't initialized properly");e.append("sid",window.sid)}else{let l=document.getElementsByName(C);if(!l.length){if(n)console.warn(`No input found with name ${C}`);continue}let p=l[0];if(p instanceof HTMLInputElement)if(p.type==="file"&&p.files)Array.from(p.files).forEach((u)=>e.append(C,u));else e.append(C,p.value);else if(p instanceof HTMLTextAreaElement)e.append(C,p.value)}let s=c+"api/ajax_content"+r;return o(null),await fetch(s,{method:"POST",body:e}).then(async(C)=>{let p=(C.headers.get("content-type")||"").includes("application/json");if(!!C.body?.getReader&&!p){let i=C.body.getReader(),a=new TextDecoder,y="";while(!0){let{done:P,value:R}=await i.read();if(P)break;y+=a.decode(R,{stream:!0});let h=y.split(`
3
+ `);y=h.pop()??"";for(let U of h){let J=U.trim();if(!J)continue;try{let qo=JSON.parse(J);o([qo])}catch{if(n)console.warn("Failed to parse streamed line:",J)}}}if(y.trim())try{let P=JSON.parse(y);o([P])}catch{if(n)console.warn("Failed to parse final streamed line:",y)}return{}}else{let i=await C.json();return o(i),i}}).catch((C)=>{if(n)console.error("AJAX request failed:",C);return o(null),C})}},ur=(o,t={},f=[],r)=>{let{apiServer:m,enableRenderingLog:n}=Y(),c=JSON.stringify(t),d=JSON.stringify(f);return pr(()=>ar(o,t,f,r,{apiServer:m,renderingLogEnabled:n}),[o,c,d,r,m,n])};import{clsx as sr}from"clsx";import{twMerge as lr}from"tailwind-merge";function Cr(...o){return lr(sr(o))}var yr=()=>{if(typeof document==="undefined")return;let o=document.getElementById("piedata_global_form");o&&o.submit()};var Pr=(o,t)=>`${o}${fo}${t}`;export{wo as useWebApp,to as useOpenAIWebRTC,ur as useAjaxSubmit,et as unregisterComponent,yr as submitGlobalForm,k as registry,w as registerPieComponent,dt as registerMultipleComponents,Pr as pieName,it as hasComponent,ut as getRegistrySize,K as getRegistryEntry,pt as getComponentMeta,at as getAllRegisteredComponents,Cr as cn,Ht as UnionCard,W as UIRendererContext,ao as UILoading,g as UI,Bt as SequenceCard,qn as PieTelegramRoot,Zn as PieRoot,ir as PieMaxRoot,T as PieCard,vn as PieBaseRoot,fo as PIEBREAK,sn as IOEventsCard,Xt as HiddenCard,bt as HTMLEmbedCard,Rn as BoxCard,Qt as AutoRedirectCard,Pn as AjaxGroupCard};