randmarcomps 1.264.0 → 1.265.0

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.
@@ -60584,7 +60584,8 @@ const TableHead = React.forwardRef(({ className: t, ...e }, n) => /* @__PURE__ *
60584
60584
  "h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
60585
60585
  t
60586
60586
  ),
60587
- ...e
60587
+ ...e,
60588
+ children: /* @__PURE__ */ jsx("span", { children: e.children })
60588
60589
  }
60589
60590
  ));
60590
60591
  TableHead.displayName = "TableHead";
@@ -60596,7 +60597,8 @@ const TableCell = React.forwardRef(({ className: t, ...e }, n) => /* @__PURE__ *
60596
60597
  "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
60597
60598
  t
60598
60599
  ),
60599
- ...e
60600
+ ...e,
60601
+ children: /* @__PURE__ */ jsx("span", { children: e.children })
60600
60602
  }
60601
60603
  ));
60602
60604
  TableCell.displayName = "TableCell";
@@ -1043,7 +1043,7 @@ Please report this to https://github.com/markedjs/marked.`,t){const o="<p>An err
1043
1043
  * @license MIT
1044
1044
  */var isBuffer_1,hasRequiredIsBuffer;function requireIsBuffer(){if(hasRequiredIsBuffer)return isBuffer_1;hasRequiredIsBuffer=1,isBuffer_1=function(n){return n!=null&&(t(n)||e(n)||!!n._isBuffer)};function t(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function e(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&t(n.slice(0,0))}return isBuffer_1}var hasRequiredMd5;function requireMd5(){return hasRequiredMd5||(hasRequiredMd5=1,function(){var t=requireCrypt(),e=requireCharenc().utf8,n=requireIsBuffer(),o=requireCharenc().bin,l=function(d,f){d.constructor==String?f&&f.encoding==="binary"?d=o.stringToBytes(d):d=e.stringToBytes(d):n(d)?d=Array.prototype.slice.call(d,0):!Array.isArray(d)&&d.constructor!==Uint8Array&&(d=d.toString());for(var g=t.bytesToWords(d),b=d.length*8,_=1732584193,S=-271733879,R=-1732584194,C=271733878,E=0;E<g.length;E++)g[E]=(g[E]<<8|g[E]>>>24)&16711935|(g[E]<<24|g[E]>>>8)&4278255360;g[b>>>5]|=128<<b%32,g[(b+64>>>9<<4)+14]=b;for(var A=l._ff,I=l._gg,M=l._hh,j=l._ii,E=0;E<g.length;E+=16){var q=_,z=S,Q=R,F=C;_=A(_,S,R,C,g[E+0],7,-680876936),C=A(C,_,S,R,g[E+1],12,-389564586),R=A(R,C,_,S,g[E+2],17,606105819),S=A(S,R,C,_,g[E+3],22,-1044525330),_=A(_,S,R,C,g[E+4],7,-176418897),C=A(C,_,S,R,g[E+5],12,1200080426),R=A(R,C,_,S,g[E+6],17,-1473231341),S=A(S,R,C,_,g[E+7],22,-45705983),_=A(_,S,R,C,g[E+8],7,1770035416),C=A(C,_,S,R,g[E+9],12,-1958414417),R=A(R,C,_,S,g[E+10],17,-42063),S=A(S,R,C,_,g[E+11],22,-1990404162),_=A(_,S,R,C,g[E+12],7,1804603682),C=A(C,_,S,R,g[E+13],12,-40341101),R=A(R,C,_,S,g[E+14],17,-1502002290),S=A(S,R,C,_,g[E+15],22,1236535329),_=I(_,S,R,C,g[E+1],5,-165796510),C=I(C,_,S,R,g[E+6],9,-1069501632),R=I(R,C,_,S,g[E+11],14,643717713),S=I(S,R,C,_,g[E+0],20,-373897302),_=I(_,S,R,C,g[E+5],5,-701558691),C=I(C,_,S,R,g[E+10],9,38016083),R=I(R,C,_,S,g[E+15],14,-660478335),S=I(S,R,C,_,g[E+4],20,-405537848),_=I(_,S,R,C,g[E+9],5,568446438),C=I(C,_,S,R,g[E+14],9,-1019803690),R=I(R,C,_,S,g[E+3],14,-187363961),S=I(S,R,C,_,g[E+8],20,1163531501),_=I(_,S,R,C,g[E+13],5,-1444681467),C=I(C,_,S,R,g[E+2],9,-51403784),R=I(R,C,_,S,g[E+7],14,1735328473),S=I(S,R,C,_,g[E+12],20,-1926607734),_=M(_,S,R,C,g[E+5],4,-378558),C=M(C,_,S,R,g[E+8],11,-2022574463),R=M(R,C,_,S,g[E+11],16,1839030562),S=M(S,R,C,_,g[E+14],23,-35309556),_=M(_,S,R,C,g[E+1],4,-1530992060),C=M(C,_,S,R,g[E+4],11,1272893353),R=M(R,C,_,S,g[E+7],16,-155497632),S=M(S,R,C,_,g[E+10],23,-1094730640),_=M(_,S,R,C,g[E+13],4,681279174),C=M(C,_,S,R,g[E+0],11,-358537222),R=M(R,C,_,S,g[E+3],16,-722521979),S=M(S,R,C,_,g[E+6],23,76029189),_=M(_,S,R,C,g[E+9],4,-640364487),C=M(C,_,S,R,g[E+12],11,-421815835),R=M(R,C,_,S,g[E+15],16,530742520),S=M(S,R,C,_,g[E+2],23,-995338651),_=j(_,S,R,C,g[E+0],6,-198630844),C=j(C,_,S,R,g[E+7],10,1126891415),R=j(R,C,_,S,g[E+14],15,-1416354905),S=j(S,R,C,_,g[E+5],21,-57434055),_=j(_,S,R,C,g[E+12],6,1700485571),C=j(C,_,S,R,g[E+3],10,-1894986606),R=j(R,C,_,S,g[E+10],15,-1051523),S=j(S,R,C,_,g[E+1],21,-2054922799),_=j(_,S,R,C,g[E+8],6,1873313359),C=j(C,_,S,R,g[E+15],10,-30611744),R=j(R,C,_,S,g[E+6],15,-1560198380),S=j(S,R,C,_,g[E+13],21,1309151649),_=j(_,S,R,C,g[E+4],6,-145523070),C=j(C,_,S,R,g[E+11],10,-1120210379),R=j(R,C,_,S,g[E+2],15,718787259),S=j(S,R,C,_,g[E+9],21,-343485551),_=_+q>>>0,S=S+z>>>0,R=R+Q>>>0,C=C+F>>>0}return t.endian([_,S,R,C])};l._ff=function(d,f,g,b,_,S,R){var C=d+(f&g|~f&b)+(_>>>0)+R;return(C<<S|C>>>32-S)+f},l._gg=function(d,f,g,b,_,S,R){var C=d+(f&b|g&~b)+(_>>>0)+R;return(C<<S|C>>>32-S)+f},l._hh=function(d,f,g,b,_,S,R){var C=d+(f^g^b)+(_>>>0)+R;return(C<<S|C>>>32-S)+f},l._ii=function(d,f,g,b,_,S,R){var C=d+(g^(f|~b))+(_>>>0)+R;return(C<<S|C>>>32-S)+f},l._blocksize=16,l._digestsize=16,md5$1.exports=function(d,f){if(d==null)throw new Error("Illegal argument "+d);var g=t.wordsToBytes(l(d,f));return f&&f.asBytes?g:f&&f.asString?o.bytesToString(g):t.bytesToHex(g)}}()),md5$1.exports}var md5Exports=requireMd5();const md5=getDefaultExportFromCjs$1(md5Exports),constructFromSymbol=Symbol.for("constructDateFrom");function constructFrom(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&constructFromSymbol in t?t[constructFromSymbol](e):t instanceof Date?new t.constructor(e):new Date(e)}function toDate(t,e){return constructFrom(t,t)}function addDays(t,e,n){const o=toDate(t);return isNaN(e)?constructFrom(t,NaN):(o.setDate(o.getDate()+e),o)}function normalizeDates(t,...e){const n=constructFrom.bind(null,e.find(o=>typeof o=="object"));return e.map(n)}function startOfDay(t,e){const n=toDate(t);return n.setHours(0,0,0,0),n}function constructNow(t){return constructFrom(t,Date.now())}function isSameDay(t,e,n){const[o,l]=normalizeDates(n==null?void 0:n.in,t,e);return+startOfDay(o)==+startOfDay(l)}function isToday(t,e){return isSameDay(constructFrom(t,t),constructNow(t))}function subDays(t,e,n){return addDays(t,-1)}function isYesterday(t,e){return isSameDay(constructFrom(t,t),subDays(constructNow(t)))}var lib$3={},htmlToDom={},domparser={},utilities$2={},lib$2={},lib$1={},hasRequiredLib$3;function requireLib$3(){return hasRequiredLib$3||(hasRequiredLib$3=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Doctype=t.CDATA=t.Tag=t.Style=t.Script=t.Comment=t.Directive=t.Text=t.Root=t.isTag=t.ElementType=void 0;var e;(function(o){o.Root="root",o.Text="text",o.Directive="directive",o.Comment="comment",o.Script="script",o.Style="style",o.Tag="tag",o.CDATA="cdata",o.Doctype="doctype"})(e=t.ElementType||(t.ElementType={}));function n(o){return o.type===e.Tag||o.type===e.Script||o.type===e.Style}t.isTag=n,t.Root=e.Root,t.Text=e.Text,t.Directive=e.Directive,t.Comment=e.Comment,t.Script=e.Script,t.Style=e.Style,t.Tag=e.Tag,t.CDATA=e.CDATA,t.Doctype=e.Doctype}(lib$1)),lib$1}var node={},hasRequiredNode;function requireNode(){if(hasRequiredNode)return node;hasRequiredNode=1;var t=node&&node.__extends||function(){var F=function(O,te){return F=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ne,ae){ne.__proto__=ae}||function(ne,ae){for(var ge in ae)Object.prototype.hasOwnProperty.call(ae,ge)&&(ne[ge]=ae[ge])},F(O,te)};return function(O,te){if(typeof te!="function"&&te!==null)throw new TypeError("Class extends value "+String(te)+" is not a constructor or null");F(O,te);function ne(){this.constructor=O}O.prototype=te===null?Object.create(te):(ne.prototype=te.prototype,new ne)}}(),e=node&&node.__assign||function(){return e=Object.assign||function(F){for(var O,te=1,ne=arguments.length;te<ne;te++){O=arguments[te];for(var ae in O)Object.prototype.hasOwnProperty.call(O,ae)&&(F[ae]=O[ae])}return F},e.apply(this,arguments)};Object.defineProperty(node,"__esModule",{value:!0}),node.cloneNode=node.hasChildren=node.isDocument=node.isDirective=node.isComment=node.isText=node.isCDATA=node.isTag=node.Element=node.Document=node.CDATA=node.NodeWithChildren=node.ProcessingInstruction=node.Comment=node.Text=node.DataNode=node.Node=void 0;var n=requireLib$3(),o=function(){function F(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(F.prototype,"parentNode",{get:function(){return this.parent},set:function(O){this.parent=O},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"previousSibling",{get:function(){return this.prev},set:function(O){this.prev=O},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"nextSibling",{get:function(){return this.next},set:function(O){this.next=O},enumerable:!1,configurable:!0}),F.prototype.cloneNode=function(O){return O===void 0&&(O=!1),z(this,O)},F}();node.Node=o;var l=function(F){t(O,F);function O(te){var ne=F.call(this)||this;return ne.data=te,ne}return Object.defineProperty(O.prototype,"nodeValue",{get:function(){return this.data},set:function(te){this.data=te},enumerable:!1,configurable:!0}),O}(o);node.DataNode=l;var d=function(F){t(O,F);function O(){var te=F!==null&&F.apply(this,arguments)||this;return te.type=n.ElementType.Text,te}return Object.defineProperty(O.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),O}(l);node.Text=d;var f=function(F){t(O,F);function O(){var te=F!==null&&F.apply(this,arguments)||this;return te.type=n.ElementType.Comment,te}return Object.defineProperty(O.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),O}(l);node.Comment=f;var g=function(F){t(O,F);function O(te,ne){var ae=F.call(this,ne)||this;return ae.name=te,ae.type=n.ElementType.Directive,ae}return Object.defineProperty(O.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),O}(l);node.ProcessingInstruction=g;var b=function(F){t(O,F);function O(te){var ne=F.call(this)||this;return ne.children=te,ne}return Object.defineProperty(O.prototype,"firstChild",{get:function(){var te;return(te=this.children[0])!==null&&te!==void 0?te:null},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"childNodes",{get:function(){return this.children},set:function(te){this.children=te},enumerable:!1,configurable:!0}),O}(o);node.NodeWithChildren=b;var _=function(F){t(O,F);function O(){var te=F!==null&&F.apply(this,arguments)||this;return te.type=n.ElementType.CDATA,te}return Object.defineProperty(O.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),O}(b);node.CDATA=_;var S=function(F){t(O,F);function O(){var te=F!==null&&F.apply(this,arguments)||this;return te.type=n.ElementType.Root,te}return Object.defineProperty(O.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),O}(b);node.Document=S;var R=function(F){t(O,F);function O(te,ne,ae,ge){ae===void 0&&(ae=[]),ge===void 0&&(ge=te==="script"?n.ElementType.Script:te==="style"?n.ElementType.Style:n.ElementType.Tag);var oe=F.call(this,ae)||this;return oe.name=te,oe.attribs=ne,oe.type=ge,oe}return Object.defineProperty(O.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"tagName",{get:function(){return this.name},set:function(te){this.name=te},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"attributes",{get:function(){var te=this;return Object.keys(this.attribs).map(function(ne){var ae,ge;return{name:ne,value:te.attribs[ne],namespace:(ae=te["x-attribsNamespace"])===null||ae===void 0?void 0:ae[ne],prefix:(ge=te["x-attribsPrefix"])===null||ge===void 0?void 0:ge[ne]}})},enumerable:!1,configurable:!0}),O}(b);node.Element=R;function C(F){return(0,n.isTag)(F)}node.isTag=C;function E(F){return F.type===n.ElementType.CDATA}node.isCDATA=E;function A(F){return F.type===n.ElementType.Text}node.isText=A;function I(F){return F.type===n.ElementType.Comment}node.isComment=I;function M(F){return F.type===n.ElementType.Directive}node.isDirective=M;function j(F){return F.type===n.ElementType.Root}node.isDocument=j;function q(F){return Object.prototype.hasOwnProperty.call(F,"children")}node.hasChildren=q;function z(F,O){O===void 0&&(O=!1);var te;if(A(F))te=new d(F.data);else if(I(F))te=new f(F.data);else if(C(F)){var ne=O?Q(F.children):[],ae=new R(F.name,e({},F.attribs),ne);ne.forEach(function(Ne){return Ne.parent=ae}),F.namespace!=null&&(ae.namespace=F.namespace),F["x-attribsNamespace"]&&(ae["x-attribsNamespace"]=e({},F["x-attribsNamespace"])),F["x-attribsPrefix"]&&(ae["x-attribsPrefix"]=e({},F["x-attribsPrefix"])),te=ae}else if(E(F)){var ne=O?Q(F.children):[],ge=new _(ne);ne.forEach(function(je){return je.parent=ge}),te=ge}else if(j(F)){var ne=O?Q(F.children):[],oe=new S(ne);ne.forEach(function(je){return je.parent=oe}),F["x-mode"]&&(oe["x-mode"]=F["x-mode"]),te=oe}else if(M(F)){var Ae=new g(F.name,F.data);F["x-name"]!=null&&(Ae["x-name"]=F["x-name"],Ae["x-publicId"]=F["x-publicId"],Ae["x-systemId"]=F["x-systemId"]),te=Ae}else throw new Error("Not implemented yet: ".concat(F.type));return te.startIndex=F.startIndex,te.endIndex=F.endIndex,F.sourceCodeLocation!=null&&(te.sourceCodeLocation=F.sourceCodeLocation),te}node.cloneNode=z;function Q(F){for(var O=F.map(function(ne){return z(ne,!0)}),te=1;te<O.length;te++)O[te].prev=O[te-1],O[te-1].next=O[te];return O}return node}var hasRequiredLib$2;function requireLib$2(){return hasRequiredLib$2||(hasRequiredLib$2=1,function(t){var e=lib$2&&lib$2.__createBinding||(Object.create?function(g,b,_,S){S===void 0&&(S=_);var R=Object.getOwnPropertyDescriptor(b,_);(!R||("get"in R?!b.__esModule:R.writable||R.configurable))&&(R={enumerable:!0,get:function(){return b[_]}}),Object.defineProperty(g,S,R)}:function(g,b,_,S){S===void 0&&(S=_),g[S]=b[_]}),n=lib$2&&lib$2.__exportStar||function(g,b){for(var _ in g)_!=="default"&&!Object.prototype.hasOwnProperty.call(b,_)&&e(b,g,_)};Object.defineProperty(t,"__esModule",{value:!0}),t.DomHandler=void 0;var o=requireLib$3(),l=requireNode();n(requireNode(),t);var d={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},f=function(){function g(b,_,S){this.dom=[],this.root=new l.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof _=="function"&&(S=_,_=d),typeof b=="object"&&(_=b,b=void 0),this.callback=b??null,this.options=_??d,this.elementCB=S??null}return g.prototype.onparserinit=function(b){this.parser=b},g.prototype.onreset=function(){this.dom=[],this.root=new l.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},g.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},g.prototype.onerror=function(b){this.handleCallback(b)},g.prototype.onclosetag=function(){this.lastNode=null;var b=this.tagStack.pop();this.options.withEndIndices&&(b.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(b)},g.prototype.onopentag=function(b,_){var S=this.options.xmlMode?o.ElementType.Tag:void 0,R=new l.Element(b,_,void 0,S);this.addNode(R),this.tagStack.push(R)},g.prototype.ontext=function(b){var _=this.lastNode;if(_&&_.type===o.ElementType.Text)_.data+=b,this.options.withEndIndices&&(_.endIndex=this.parser.endIndex);else{var S=new l.Text(b);this.addNode(S),this.lastNode=S}},g.prototype.oncomment=function(b){if(this.lastNode&&this.lastNode.type===o.ElementType.Comment){this.lastNode.data+=b;return}var _=new l.Comment(b);this.addNode(_),this.lastNode=_},g.prototype.oncommentend=function(){this.lastNode=null},g.prototype.oncdatastart=function(){var b=new l.Text(""),_=new l.CDATA([b]);this.addNode(_),b.parent=_,this.lastNode=b},g.prototype.oncdataend=function(){this.lastNode=null},g.prototype.onprocessinginstruction=function(b,_){var S=new l.ProcessingInstruction(b,_);this.addNode(S)},g.prototype.handleCallback=function(b){if(typeof this.callback=="function")this.callback(b,this.dom);else if(b)throw b},g.prototype.addNode=function(b){var _=this.tagStack[this.tagStack.length-1],S=_.children[_.children.length-1];this.options.withStartIndices&&(b.startIndex=this.parser.startIndex),this.options.withEndIndices&&(b.endIndex=this.parser.endIndex),_.children.push(b),S&&(b.prev=S,S.next=b),b.parent=_,this.lastNode=null},g}();t.DomHandler=f,t.default=f}(lib$2)),lib$2}var constants={},hasRequiredConstants;function requireConstants(){return hasRequiredConstants||(hasRequiredConstants=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CARRIAGE_RETURN_PLACEHOLDER_REGEX=t.CARRIAGE_RETURN_PLACEHOLDER=t.CARRIAGE_RETURN_REGEX=t.CARRIAGE_RETURN=t.CASE_SENSITIVE_TAG_NAMES_MAP=t.CASE_SENSITIVE_TAG_NAMES=void 0,t.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"],t.CASE_SENSITIVE_TAG_NAMES_MAP=t.CASE_SENSITIVE_TAG_NAMES.reduce(function(e,n){return e[n.toLowerCase()]=n,e},{}),t.CARRIAGE_RETURN="\r",t.CARRIAGE_RETURN_REGEX=new RegExp(t.CARRIAGE_RETURN,"g"),t.CARRIAGE_RETURN_PLACEHOLDER="__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_".concat(Date.now(),"__"),t.CARRIAGE_RETURN_PLACEHOLDER_REGEX=new RegExp(t.CARRIAGE_RETURN_PLACEHOLDER,"g")}(constants)),constants}var hasRequiredUtilities$2;function requireUtilities$2(){if(hasRequiredUtilities$2)return utilities$2;hasRequiredUtilities$2=1,Object.defineProperty(utilities$2,"__esModule",{value:!0}),utilities$2.formatAttributes=o,utilities$2.escapeSpecialCharacters=d,utilities$2.revertEscapedCharacters=f,utilities$2.formatDOM=g;var t=requireLib$2(),e=requireConstants();function n(b){return e.CASE_SENSITIVE_TAG_NAMES_MAP[b]}function o(b){for(var _={},S=0,R=b.length;S<R;S++){var C=b[S];_[C.name]=C.value}return _}function l(b){b=b.toLowerCase();var _=n(b);return _||b}function d(b){return b.replace(e.CARRIAGE_RETURN_REGEX,e.CARRIAGE_RETURN_PLACEHOLDER)}function f(b){return b.replace(e.CARRIAGE_RETURN_PLACEHOLDER_REGEX,e.CARRIAGE_RETURN)}function g(b,_,S){_===void 0&&(_=null);for(var R=[],C,E=0,A=b.length;E<A;E++){var I=b[E];switch(I.nodeType){case 1:{var M=l(I.nodeName);C=new t.Element(M,o(I.attributes)),C.children=g(M==="template"?I.content.childNodes:I.childNodes,C);break}case 3:C=new t.Text(f(I.nodeValue));break;case 8:C=new t.Comment(I.nodeValue);break;default:continue}var j=R[E-1]||null;j&&(j.next=C),C.parent=_,C.prev=j,C.next=null,R.push(C)}return S&&(C=new t.ProcessingInstruction(S.substring(0,S.indexOf(" ")).toLowerCase(),S),C.next=R[0]||null,C.parent=_,R.unshift(C),R[1]&&(R[1].prev=R[0])),R}return utilities$2}var hasRequiredDomparser;function requireDomparser(){if(hasRequiredDomparser)return domparser;hasRequiredDomparser=1,Object.defineProperty(domparser,"__esModule",{value:!0}),domparser.default=I;var t=requireUtilities$2(),e="html",n="head",o="body",l=/<([a-zA-Z]+[0-9]?)/,d=/<head[^]*>/i,f=/<body[^]*>/i,g=function(M,j){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},b=function(M,j){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},_=typeof window=="object"&&window.DOMParser;if(typeof _=="function"){var S=new _,R="text/html";b=function(M,j){return j&&(M="<".concat(j,">").concat(M,"</").concat(j,">")),S.parseFromString(M,R)},g=b}if(typeof document=="object"&&document.implementation){var C=document.implementation.createHTMLDocument();g=function(M,j){if(j){var q=C.documentElement.querySelector(j);return q&&(q.innerHTML=M),C}return C.documentElement.innerHTML=M,C}}var E=typeof document=="object"&&document.createElement("template"),A;E&&E.content&&(A=function(M){return E.innerHTML=M,E.content.childNodes});function I(M){var j,q;M=(0,t.escapeSpecialCharacters)(M);var z=M.match(l),Q=z&&z[1]?z[1].toLowerCase():"";switch(Q){case e:{var F=b(M);if(!d.test(M)){var O=F.querySelector(n);(j=O==null?void 0:O.parentNode)===null||j===void 0||j.removeChild(O)}if(!f.test(M)){var O=F.querySelector(o);(q=O==null?void 0:O.parentNode)===null||q===void 0||q.removeChild(O)}return F.querySelectorAll(e)}case n:case o:{var te=g(M).querySelectorAll(Q);return f.test(M)&&d.test(M)?te[0].parentNode.childNodes:te}default:{if(A)return A(M);var O=g(M,o).querySelector(o);return O.childNodes}}}return domparser}var hasRequiredHtmlToDom;function requireHtmlToDom(){if(hasRequiredHtmlToDom)return htmlToDom;hasRequiredHtmlToDom=1;var t=htmlToDom&&htmlToDom.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(htmlToDom,"__esModule",{value:!0}),htmlToDom.default=l;var e=t(requireDomparser()),n=requireUtilities$2(),o=/<(![a-zA-Z\s]+)>/;function l(d){if(typeof d!="string")throw new TypeError("First argument must be a string");if(!d)return[];var f=d.match(o),g=f?f[1]:void 0;return(0,n.formatDOM)((0,e.default)(d),null,g)}return htmlToDom}var attributesToProps={},lib={},possibleStandardNamesOptimized={},hasRequiredPossibleStandardNamesOptimized;function requirePossibleStandardNamesOptimized(){if(hasRequiredPossibleStandardNamesOptimized)return possibleStandardNamesOptimized;hasRequiredPossibleStandardNamesOptimized=1;var t=0;possibleStandardNamesOptimized.SAME=t;var e=1;return possibleStandardNamesOptimized.CAMELCASE=e,possibleStandardNamesOptimized.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},possibleStandardNamesOptimized}var hasRequiredLib$1;function requireLib$1(){if(hasRequiredLib$1)return lib;hasRequiredLib$1=1;const t=0,e=1,n=2,o=3,l=4,d=5,f=6;function g(F){return _.hasOwnProperty(F)?_[F]:null}function b(F,O,te,ne,ae,ge,oe){this.acceptsBooleans=O===n||O===o||O===l,this.attributeName=ne,this.attributeNamespace=ae,this.mustUseProperty=te,this.propertyName=F,this.type=O,this.sanitizeURL=ge,this.removeEmptyString=oe}const _={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(F=>{_[F]=new b(F,t,!1,F,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([F,O])=>{_[F]=new b(F,e,!1,O,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(F=>{_[F]=new b(F,n,!1,F.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(F=>{_[F]=new b(F,n,!1,F,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(F=>{_[F]=new b(F,o,!1,F.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(F=>{_[F]=new b(F,o,!0,F,null,!1,!1)}),["capture","download"].forEach(F=>{_[F]=new b(F,l,!1,F,null,!1,!1)}),["cols","rows","size","span"].forEach(F=>{_[F]=new b(F,f,!1,F,null,!1,!1)}),["rowSpan","start"].forEach(F=>{_[F]=new b(F,d,!1,F.toLowerCase(),null,!1,!1)});const R=/[\-\:]([a-z])/g,C=F=>F[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(F=>{const O=F.replace(R,C);_[O]=new b(O,e,!1,F,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(F=>{const O=F.replace(R,C);_[O]=new b(O,e,!1,F,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(F=>{const O=F.replace(R,C);_[O]=new b(O,e,!1,F,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(F=>{_[F]=new b(F,e,!1,F.toLowerCase(),null,!1,!1)});const E="xlinkHref";_[E]=new b("xlinkHref",e,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(F=>{_[F]=new b(F,e,!1,F.toLowerCase(),null,!0,!0)});const{CAMELCASE:A,SAME:I,possibleStandardNames:M}=requirePossibleStandardNamesOptimized(),q=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",z=RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+q+"]*$")),Q=Object.keys(M).reduce((F,O)=>{const te=M[O];return te===I?F[O]=O:te===A?F[O.toLowerCase()]=O:F[O]=te,F},{});return lib.BOOLEAN=o,lib.BOOLEANISH_STRING=n,lib.NUMERIC=d,lib.OVERLOADED_BOOLEAN=l,lib.POSITIVE_NUMERIC=f,lib.RESERVED=t,lib.STRING=e,lib.getPropertyInfo=g,lib.isCustomAttribute=z,lib.possibleStandardNames=Q,lib}var utilities$1={},cjs$1={},inlineStyleParser,hasRequiredInlineStyleParser;function requireInlineStyleParser(){if(hasRequiredInlineStyleParser)return inlineStyleParser;hasRequiredInlineStyleParser=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,d=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,f=/^[;\s]*/,g=/^\s+|\s+$/g,b=`
1045
1045
  `,_="/",S="*",R="",C="comment",E="declaration";inlineStyleParser=function(I,M){if(typeof I!="string")throw new TypeError("First argument must be a string");if(!I)return[];M=M||{};var j=1,q=1;function z(Ne){var je=Ne.match(e);je&&(j+=je.length);var $e=Ne.lastIndexOf(b);q=~$e?Ne.length-$e:q+Ne.length}function Q(){var Ne={line:j,column:q};return function(je){return je.position=new F(Ne),ne(),je}}function F(Ne){this.start=Ne,this.end={line:j,column:q},this.source=M.source}F.prototype.content=I;function O(Ne){var je=new Error(M.source+":"+j+":"+q+": "+Ne);if(je.reason=Ne,je.filename=M.source,je.line=j,je.column=q,je.source=I,!M.silent)throw je}function te(Ne){var je=Ne.exec(I);if(je){var $e=je[0];return z($e),I=I.slice($e.length),je}}function ne(){te(n)}function ae(Ne){var je;for(Ne=Ne||[];je=ge();)je!==!1&&Ne.push(je);return Ne}function ge(){var Ne=Q();if(!(_!=I.charAt(0)||S!=I.charAt(1))){for(var je=2;R!=I.charAt(je)&&(S!=I.charAt(je)||_!=I.charAt(je+1));)++je;if(je+=2,R===I.charAt(je-1))return O("End of comment missing");var $e=I.slice(2,je-2);return q+=2,z($e),I=I.slice(je),q+=2,Ne({type:C,comment:$e})}}function oe(){var Ne=Q(),je=te(o);if(je){if(ge(),!te(l))return O("property missing ':'");var $e=te(d),Le=Ne({type:E,property:A(je[0].replace(t,R)),value:$e?A($e[0].replace(t,R)):R});return te(f),Le}}function Ae(){var Ne=[];ae(Ne);for(var je;je=oe();)je!==!1&&(Ne.push(je),ae(Ne));return Ne}return ne(),Ae()};function A(I){return I?I.replace(g,R):R}return inlineStyleParser}var hasRequiredCjs$1;function requireCjs$1(){if(hasRequiredCjs$1)return cjs$1;hasRequiredCjs$1=1;var t=cjs$1&&cjs$1.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(cjs$1,"__esModule",{value:!0}),cjs$1.default=n;var e=t(requireInlineStyleParser());function n(o,l){var d=null;if(!o||typeof o!="string")return d;var f=(0,e.default)(o),g=typeof l=="function";return f.forEach(function(b){if(b.type==="declaration"){var _=b.property,S=b.value;g?l(_,S,b):S&&(d=d||{},d[_]=S)}}),d}return cjs$1}var utilities={},hasRequiredUtilities$1;function requireUtilities$1(){if(hasRequiredUtilities$1)return utilities;hasRequiredUtilities$1=1,Object.defineProperty(utilities,"__esModule",{value:!0}),utilities.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,d=function(_){return!_||n.test(_)||t.test(_)},f=function(_,S){return S.toUpperCase()},g=function(_,S){return"".concat(S,"-")},b=function(_,S){return S===void 0&&(S={}),d(_)?_:(_=_.toLowerCase(),S.reactCompat?_=_.replace(l,g):_=_.replace(o,g),_.replace(e,f))};return utilities.camelCase=b,utilities}var cjs,hasRequiredCjs;function requireCjs(){if(hasRequiredCjs)return cjs;hasRequiredCjs=1;var t=cjs&&cjs.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},e=t(requireCjs$1()),n=requireUtilities$1();function o(l,d){var f={};return!l||typeof l!="string"||(0,e.default)(l,function(g,b){g&&b&&(f[(0,n.camelCase)(g,d)]=b)}),f}return o.default=o,cjs=o,cjs}var hasRequiredUtilities;function requireUtilities(){return hasRequiredUtilities||(hasRequiredUtilities=1,function(t){var e=utilities$1&&utilities$1.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(t,"__esModule",{value:!0}),t.returnFirstArg=t.canTextBeChildOfNode=t.ELEMENTS_WITH_NO_TEXT_CHILDREN=t.PRESERVE_CUSTOM_ATTRIBUTES=void 0,t.isCustomComponent=d,t.setStyleProp=g;var n=React,o=e(requireCjs()),l=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function d(S,R){return S.includes("-")?!l.has(S):!!(R&&typeof R.is=="string")}var f={reactCompat:!0};function g(S,R){if(typeof S=="string"){if(!S.trim()){R.style={};return}try{R.style=(0,o.default)(S,f)}catch{R.style={}}}}t.PRESERVE_CUSTOM_ATTRIBUTES=Number(n.version.split(".")[0])>=16,t.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);var b=function(S){return!t.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(S.name)};t.canTextBeChildOfNode=b;var _=function(S){return S};t.returnFirstArg=_}(utilities$1)),utilities$1}var hasRequiredAttributesToProps;function requireAttributesToProps(){if(hasRequiredAttributesToProps)return attributesToProps;hasRequiredAttributesToProps=1,Object.defineProperty(attributesToProps,"__esModule",{value:!0}),attributesToProps.default=d;var t=requireLib$1(),e=requireUtilities(),n=["checked","value"],o=["input","select","textarea"],l={reset:!0,submit:!0};function d(g,b){g===void 0&&(g={});var _={},S=!!(g.type&&l[g.type]);for(var R in g){var C=g[R];if((0,t.isCustomAttribute)(R)){_[R]=C;continue}var E=R.toLowerCase(),A=f(E);if(A){var I=(0,t.getPropertyInfo)(A);switch(n.includes(A)&&o.includes(b)&&!S&&(A=f("default"+E)),_[A]=C,I&&I.type){case t.BOOLEAN:_[A]=!0;break;case t.OVERLOADED_BOOLEAN:C===""&&(_[A]=!0);break}continue}e.PRESERVE_CUSTOM_ATTRIBUTES&&(_[R]=C)}return(0,e.setStyleProp)(g.style,_),_}function f(g){return t.possibleStandardNames[g]}return attributesToProps}var domToReact={},hasRequiredDomToReact;function requireDomToReact(){if(hasRequiredDomToReact)return domToReact;hasRequiredDomToReact=1;var t=domToReact&&domToReact.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(domToReact,"__esModule",{value:!0}),domToReact.default=d;var e=React,n=t(requireAttributesToProps()),o=requireUtilities(),l={cloneElement:e.cloneElement,createElement:e.createElement,isValidElement:e.isValidElement};function d(g,b){b===void 0&&(b={});for(var _=[],S=typeof b.replace=="function",R=b.transform||o.returnFirstArg,C=b.library||l,E=C.cloneElement,A=C.createElement,I=C.isValidElement,M=g.length,j=0;j<M;j++){var q=g[j];if(S){var z=b.replace(q,j);if(I(z)){M>1&&(z=E(z,{key:z.key||j})),_.push(R(z,q,j));continue}}if(q.type==="text"){var Q=!q.data.trim().length;if(Q&&q.parent&&!(0,o.canTextBeChildOfNode)(q.parent)||b.trim&&Q)continue;_.push(R(q.data,q,j));continue}var F=q,O={};f(F)?((0,o.setStyleProp)(F.attribs.style,F.attribs),O=F.attribs):F.attribs&&(O=(0,n.default)(F.attribs,F.name));var te=void 0;switch(q.type){case"script":case"style":q.children[0]&&(O.dangerouslySetInnerHTML={__html:q.children[0].data});break;case"tag":q.name==="textarea"&&q.children[0]?O.defaultValue=q.children[0].data:q.children&&q.children.length&&(te=d(q.children,b));break;default:continue}M>1&&(O.key=j),_.push(R(A(q.name,O,te),q,j))}return _.length===1?_[0]:_}function f(g){return o.PRESERVE_CUSTOM_ATTRIBUTES&&g.type==="tag"&&(0,o.isCustomComponent)(g.name,g.attribs)}return domToReact}var hasRequiredLib;function requireLib(){return hasRequiredLib||(hasRequiredLib=1,function(t){var e=lib$3&&lib$3.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(t,"__esModule",{value:!0}),t.htmlToDOM=t.domToReact=t.attributesToProps=t.Text=t.ProcessingInstruction=t.Element=t.Comment=void 0,t.default=g;var n=e(requireHtmlToDom());t.htmlToDOM=n.default;var o=e(requireAttributesToProps());t.attributesToProps=o.default;var l=e(requireDomToReact());t.domToReact=l.default;var d=requireLib$2();Object.defineProperty(t,"Comment",{enumerable:!0,get:function(){return d.Comment}}),Object.defineProperty(t,"Element",{enumerable:!0,get:function(){return d.Element}}),Object.defineProperty(t,"ProcessingInstruction",{enumerable:!0,get:function(){return d.ProcessingInstruction}}),Object.defineProperty(t,"Text",{enumerable:!0,get:function(){return d.Text}});var f={lowerCaseAttributeNames:!1};function g(b,_){if(typeof b!="string")throw new TypeError("First argument must be a string");return b?(0,l.default)((0,n.default)(b,(_==null?void 0:_.htmlparser2)||f),_):[]}}(lib$3)),lib$3}var libExports=requireLib();const HTMLReactParser=getDefaultExportFromCjs$1(libExports),parser=HTMLReactParser.default||HTMLReactParser;function SkeletonMessage({botStatus:t}){return jsxRuntime.jsxs("div",{className:"flex items-start gap-2",children:[jsxRuntime.jsx("div",{className:"h-8 w-8 mt-1 rounded-full bg-gray-300 animate-pulse flex-shrink-0"}),jsxRuntime.jsxs("div",{className:"flex flex-col max-w-[70%]",children:[jsxRuntime.jsxs("p",{className:"mb-1",children:["Assistant",jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground mt-1 ml-3",children:new Date().toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})})]}),jsxRuntime.jsx("div",{className:"rounded-md p-3 break-words bg-white border rounded-tl-none",children:jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("div",{className:"h-2 w-2 rounded-full bg-primary animate-pulse"}),jsxRuntime.jsx("div",{className:"h-2 w-2 rounded-full bg-primary animate-pulse delay-150"}),jsxRuntime.jsx("div",{className:"h-2 w-2 rounded-full bg-primary animate-pulse delay-300"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground ml-1",children:t})]})})]})]})}const toHTML=t=>t.split(`
1046
- `).map(e=>jsxRuntime.jsx("p",{children:e}));function ChatMessages({messages:t,currentUserId:e,botStatus:n,isAssistantChat:o}){return jsxRuntime.jsxs("div",{children:[t.map(l=>{const d=l.fromPartnerID===e;return jsxRuntime.jsxs("div",{className:cn("flex items-start gap-2 mt-2 mb-2",d&&"flex-row-reverse"),children:[jsxRuntime.jsx(Avatar,{className:"h-8 w-8 mt-1",children:jsxRuntime.jsx(AvatarImage,{src:`https://api.dicebear.com/9.x/thumbs/svg?seed=${md5(l.senderName+l.fromPartnerID)}&flip=${d}`})}),jsxRuntime.jsxs("div",{className:"flex flex-col max-w-[70%]",children:[jsxRuntime.jsxs("p",{className:"mb-1",children:[l.senderName,jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground mt-1 ml-3",children:(()=>{const f=new Date(l.timestamp);return isToday(f)?f.toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0}):isYesterday(f)?`Yesterday, ${f.toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})}`:`${f.toLocaleDateString([],{month:"short",day:"numeric"})} ${f.toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})}`})()})]}),jsxRuntime.jsx("div",{className:cn("rounded-md p-3 break-words [&_li]:ml-6 [&_li]:list-disc [&_h1]:text-lg [&_h1]:font-bold [&_h1]:mt-4 [&_h2]:font-bold [&_h2]:mt-4 [&_h3]:mt-4 ",d?"bg-primary text-white rounded-tr-none":"bg-white border rounded-tl-none"),children:l.fromPartnerID===ASSISTANT_ID?parser(l.content):toHTML(l.content)})]})]},l.id)}),n!==""&&jsxRuntime.jsx(SkeletonMessage,{botStatus:n}),t.length===0&&!o&&jsxRuntime.jsx("div",{className:"text-center text-muted-foreground py-8",children:"No messages yet"}),t.length===0&&n===""&&o&&jsxRuntime.jsxs("div",{className:"text-center py-8",children:[jsxRuntime.jsx("p",{children:"The Randmar Assistant is ready to help you. Ask anything about products, orders, carts, shipments and tracking numbers."}),jsxRuntime.jsx("p",{children:jsxRuntime.jsx("strong",{children:'Try it now, type "my open orders"!'})})]})]})}var SWITCH_NAME="Switch",[createSwitchContext,createSwitchScope]=createContextScope(SWITCH_NAME),[SwitchProvider,useSwitchContext]=createSwitchContext(SWITCH_NAME),Switch$1=React__namespace.forwardRef((t,e)=>{const{__scopeSwitch:n,name:o,checked:l,defaultChecked:d,required:f,disabled:g,value:b="on",onCheckedChange:_,form:S,...R}=t,[C,E]=React__namespace.useState(null),A=useComposedRefs(e,z=>E(z)),I=React__namespace.useRef(!1),M=C?S||!!C.closest("form"):!0,[j,q]=useControllableState({prop:l,defaultProp:d??!1,onChange:_,caller:SWITCH_NAME});return jsxRuntime.jsxs(SwitchProvider,{scope:n,checked:j,disabled:g,children:[jsxRuntime.jsx(Primitive.button,{type:"button",role:"switch","aria-checked":j,"aria-required":f,"data-state":getState$2(j),"data-disabled":g?"":void 0,disabled:g,value:b,...R,ref:A,onClick:composeEventHandlers(t.onClick,z=>{q(Q=>!Q),M&&(I.current=z.isPropagationStopped(),I.current||z.stopPropagation())})}),M&&jsxRuntime.jsx(SwitchBubbleInput,{control:C,bubbles:!I.current,name:o,value:b,checked:j,required:f,disabled:g,form:S,style:{transform:"translateX(-100%)"}})]})});Switch$1.displayName=SWITCH_NAME;var THUMB_NAME="SwitchThumb",SwitchThumb=React__namespace.forwardRef((t,e)=>{const{__scopeSwitch:n,...o}=t,l=useSwitchContext(THUMB_NAME,n);return jsxRuntime.jsx(Primitive.span,{"data-state":getState$2(l.checked),"data-disabled":l.disabled?"":void 0,...o,ref:e})});SwitchThumb.displayName=THUMB_NAME;var BUBBLE_INPUT_NAME$2="SwitchBubbleInput",SwitchBubbleInput=React__namespace.forwardRef(({__scopeSwitch:t,control:e,checked:n,bubbles:o=!0,...l},d)=>{const f=React__namespace.useRef(null),g=useComposedRefs(f,d),b=usePrevious(n),_=useSize(e);return React__namespace.useEffect(()=>{const S=f.current;if(!S)return;const R=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(R,"checked").set;if(b!==n&&E){const A=new Event("click",{bubbles:o});E.call(S,n),S.dispatchEvent(A)}},[b,n,o]),jsxRuntime.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...l,tabIndex:-1,ref:g,style:{...l.style,..._,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});SwitchBubbleInput.displayName=BUBBLE_INPUT_NAME$2;function getState$2(t){return t?"checked":"unchecked"}var Root$1=Switch$1,Thumb=SwitchThumb;const Switch=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx(Root$1,{className:cn("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...e,ref:n,children:jsxRuntime.jsx(Thumb,{className:cn("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Switch.displayName=Root$1.displayName;const DebugMessageDisplay=({debugMessages:t})=>{const[e,n]=React.useState({}),o=l=>{n(d=>({...d,[l]:!d[l]}))};return jsxRuntime.jsx("div",{children:t.map((l,d)=>{if(typeof l=="string")return jsxRuntime.jsx("p",{className:"text-slate-600",children:l},d);{const f=e[d];return jsxRuntime.jsxs("div",{className:"cursor-pointer",onClick:()=>o(d),children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("p",{className:"text-slate-600 mr-2",children:l[0]}),jsxRuntime.jsx("span",{className:"text-slate-500 text-xs",children:f?"▲":"▼"})]}),f&&jsxRuntime.jsx("p",{className:"text-slate-400 pl-4",children:l[1]})]},d)}})})},ASSISTANT_ID="RandmarAIChatAssistant",ChatLayout=React.forwardRef(({userId:t,userName:e,apiKey:n,inputRef:o},l)=>{const{data:d,refetch:f}=useGetV4PartnerByRouteApplicationIdBusinessDevelopmentConversationsQuery({routeApplicationId:t}),[g]=useLazyGetV4PartnerByApplicationIdAccountQuery(),[b]=usePostV4PartnerByApplicationIdAccountDebugFeedbackMutation(),[_,{isLoading:S}]=usePostV4PartnerByRouteApplicationIdBusinessDevelopmentConversationPartnerAndPartnerIdMutation(),[R,C]=React.useState(!1),E=React.useRef(null),[A]=usePostV4PartnerByRouteApplicationIdBusinessDevelopmentConversationPartnerAndPartnerIdMutation(),[I]=useLazyGetV4PartnerByRouteApplicationIdBusinessDevelopmentConversationAndConversationIdMessagesQuery(),{handleSubmitToBot:M,botMessages:j,clearBotMessages:q,botReady:z,debugMessages:Q,botStatus:F,reset:O}=useAIAssistant({userId:t,apiKey:n,smartAndSlow:R});React.useEffect(()=>{if(!d)return;const ut={partner1:t,partner2:ASSISTANT_ID,name:"Randmar Assistant",unread:0,pending:!1,historyFetched:!0,messages:[],conversationID:-1},Mt=d.map(Ut=>{var yt;return{partner1:Ut.Participant1,partner2:Ut.Participant2,name:((yt=Ut.Participant)==null?void 0:yt.PublicName)??"missing public name",unread:0,pending:Ut.Status!="Approved",historyFetched:!1,messages:[],conversationID:Ut.ConversationId}});setTimeout(()=>{var Ut;return(Ut=it.current)==null?void 0:Ut.focus()},50),Le([ut,...Mt])},[d]);const[te,ne]=React.useState("approved"),[ae,ge]=React.useState([t,ASSISTANT_ID]),[oe,Ae]=React.useState(""),[Ne,je]=React.useState(null),[$e,Le]=React.useState([]),[ze,Ve]=React.useState(""),[Fe,qe]=React.useState(null),[Ke,He]=React.useState([]),[,Xe]=React.useState(0),tt=React.useRef(null),Ye=React.useRef(null),[et,Ze]=React.useState(null),[at,rt]=React.useState([]),it=o||Ye,st=React.useRef(null),{toast:Ue}=useToast(),Rt=$e.filter(ut=>{const Mt=ut.name.toLowerCase().includes(ze.toLowerCase());return te==="approved"?Mt&&!ut.pending:te==="pending"?Mt&&ut.pending:Mt});React.useEffect(()=>{var ut;et!==null&&(Ue({title:"File attached",description:"Add your instruction before sending.",variant:"success"}),(ut=it.current)==null||ut.focus())},[et]),React.useEffect(()=>{j.length!==0&&(j.forEach(ut=>{if(!ut)return;if(ut.isComponent){He(Ut=>[...Ut,ut.content]),Xe(0);return}const Mt={id:ut.timestamp.toString(),fromPartnerID:ASSISTANT_ID,toPartnerID:t,senderName:"Assistant",timestamp:ut.timestamp.getTime(),content:ut.content};Mt.content=marked(Mt.content,{async:!1}),Je(Mt)}),q())},[j]);function Je(ut){const Mt=[ut.fromPartnerID,ut.toPartnerID];Mt.sort(),Le(Ut=>{let yt=!1;const nr=Ut.map(er=>er.partner1!==Mt[0]||er.partner2!==Mt[1]||er.messages.findIndex(lr=>lr.id==ut.id)!==-1?er:(yt=!0,{...er,unread:er.unread+1,messages:[...er.messages,ut]}));return yt&&je([Mt[0],Mt[1]]),nr})}React.useEffect(()=>{const ut=new HubConnectionBuilder().withUrl("https://api.randmar.io/hub",{accessTokenFactory:()=>localStorage.getItem("access_token"),headers:{"X-Impersonated-Id":t}}).configureLogging(LogLevel.Information).withAutomaticReconnect().withHubProtocol(new JsonHubProtocol).build();return ut.on("ReceiveMessage",Je),ut.start().catch(Mt=>console.error("Error connecting to SignalR hub:",Mt)),qe(ut),()=>{ut&&ut.stop()}},[t]),React.useEffect(()=>{(Ne==null?void 0:Ne[0])!==(ae==null?void 0:ae[0])||(Ne==null?void 0:Ne[1])!==(ae==null?void 0:ae[1])||(Le(ut=>ut.map(Mt=>Mt.partner1===(ae==null?void 0:ae[0])&&Mt.partner2===(ae==null?void 0:ae[1])?{...Mt,unread:0}:Mt)),setTimeout(()=>{var ut;return(ut=tt.current)==null?void 0:ut.scrollIntoView({behavior:"smooth"})},50))},[Ne,ae]),React.useEffect(()=>{if(!ae)return;const ut=getActiveChatObject($e,ae);if(ut){if(ut.historyFetched){ut.unread>0&&Le(Mt=>Mt.map(Ut=>Ut.partner1===ae[0]&&Ut.partner2===ae[1]?{...Ut,unread:0}:Ut)),setTimeout(()=>{var Mt;return(Mt=tt.current)==null?void 0:Mt.scrollIntoView({behavior:"smooth"})},50);return}I({routeApplicationId:t,conversationId:ut.conversationID}).unwrap().then(Mt=>{const Ut=Mt.map(yt=>({id:"history"+yt.MessageId,fromPartnerID:yt.SenderId,toPartnerID:yt.SenderId==ae[0]?ae[1]:ae[0],senderName:yt.SenderName??"missing name",timestamp:new Date(yt.SentDate+"Z").getTime(),content:yt.Content??"no content"}));Le(yt=>yt.map(nr=>nr.partner1===ae[0]&&nr.partner2===ae[1]?{...nr,messages:Ut,historyFetched:!0}:nr))}).catch(Mt=>{console.error("Error fetching conversation messages:",Mt)})}},[$e,ae,I,t]),React.useEffect(()=>{var Mt;if(Xe(Ke.length),!ae)return;const ut=getActiveChatObject($e,ae);ut&&((Mt=it.current)==null||Mt.focus(),g({applicationId:ut.partner1===t?ut.partner2:ut.partner1}).then(Ut=>{Ut.data&&(He(yt=>[...yt,jsxRuntime.jsx("div",{className:"mt-2",children:jsxRuntime.jsx(PartnerCard,{account:Ut.data,action:jsxRuntime.jsx(jsxRuntime.Fragment,{}),withVoice:!1})})]),Xe(0))}))},[ae,t]);const mt=(ut,Mt,Ut)=>{const yt={id:crypto.randomUUID(),senderName:e,fromPartnerID:t,toPartnerID:Mt[0]===t?Mt[1]:Mt[0],content:ut+(et?` (${et==null?void 0:et.name} attached)`:""),timestamp:Date.now()};Le(nr=>nr.map(er=>er.partner1===Mt[0]&&er.partner2===Mt[1]?{...er,messages:[...er.messages,yt]}:er)),je([Mt[0],Mt[1]]),yt.toPartnerID==ASSISTANT_ID?(M(yt.content,et??void 0),et&&rt(nr=>[...nr,et.name])):Ut.invoke("NewMessage",yt).catch(nr=>console.error("Error sending message:",nr)),Ae(""),Ze(null),st.current&&(st.current.value="")},$t=(ut,Mt)=>{if(!$e.length||!Fe||!z)return!1;const Ut=$e.find(yt=>yt.conversationID===ut);return Ut?(Ut.pending&&setTimeout(()=>ne("pending"),300),ge([Ut.partner1,Ut.partner2]),Mt&&setTimeout(()=>mt(Mt,[Ut.partner1,Ut.partner2],Fe),300),!0):!1};if(React.useImperativeHandle(l,()=>({setActiveChatAndSendMessage:$t})),!z)return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),jsxRuntime.jsx("p",{children:"Loading API functions..."})]})})});const Dt=ut=>{var Ut;if(!isAssistantChat(ae))return;const Mt=(Ut=ut.clipboardData)==null?void 0:Ut.items;if(Mt){for(let yt=0;yt<Mt.length;yt++)if(Mt[yt].type.indexOf("image")!==-1){const nr=Mt[yt].getAsFile();if(nr){Ze(nr);return}}}},Ht=()=>{!oe.trim()||!ae||!Fe||(Xe(Ke.length),mt(oe,ae,Fe))},Vt=ut=>{ut.target.files&&ut.target.files[0]?Ze(ut.target.files[0]):Ze(null)},We=()=>{var ut;(ut=st.current)==null||ut.click()},nt=()=>{var ut;Ze(null),Ue({title:"File removed",description:"No file will be sent to the assistant.",variant:"secondary"}),(ut=it.current)==null||ut.focus()},Qe=()=>{const Mt={messages:$e.find(Ut=>Ut.partner1===ASSISTANT_ID||Ut.partner2===ASSISTANT_ID),debug:Q};b({applicationId:t,emailAddress:e,body:Mt})},dt=async()=>{E.current&&(E.current.disabled=!0),await A({routeApplicationId:t,partnerId:"2"}),await f()},pt=()=>{Le(ut=>ut.map(Ut=>Ut.partner1!==ASSISTANT_ID&&Ut.partner2!==ASSISTANT_ID?Ut:{...Ut,messages:[]})),rt([]),O()},ft=()=>{ae&&_({routeApplicationId:t,partnerId:ae[0]==t?ae[1]:ae[0]}).then(()=>{ne("approved")})},ct=getActiveChatObject($e,ae),qt=$e.filter(ut=>ut.pending).length;return jsxRuntime.jsxs("div",{className:"flex h-[85vh] overflow-hidden",children:[jsxRuntime.jsxs("div",{className:"w-[260px] p-4 pt-3 flex flex-col border-r",children:[jsxRuntime.jsx("div",{className:"p-4 font-semibold border-b",children:"Communications"}),$e.length>1&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"p-2",children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(Search,{className:"absolute left-2 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),jsxRuntime.jsx(Input,{placeholder:"Search chats...",className:"pl-8 h-9",value:ze,onChange:ut=>Ve(ut.target.value)})]})}),jsxRuntime.jsx(Tabs,{value:te,onValueChange:ne,className:"w-full mb-1",children:jsxRuntime.jsxs(TabsList,{className:"grid grid-cols-6 h-9 mx-2",children:[jsxRuntime.jsx(TabsTrigger,{value:"approved",className:"text-xs col-span-3",children:"Approved"}),jsxRuntime.jsxs(TabsTrigger,{value:"pending",className:"text-xs col-span-3",children:["Pending ",qt>0&&`(${qt})`]})]})})]}),jsxRuntime.jsx("div",{className:"mt-1 mb-1",children:$e.findIndex(ut=>ut.partner1==="2"||ut.partner2==="2")<0?jsxRuntime.jsx(Button,{className:"w-full",ref:E,onClick:()=>dt(),children:"Chat with Randmar"},"b1"):jsxRuntime.jsx("a",{target:"_blank",href:`https://dashboard.randmar.io/${t}/ExploreManufacturers`,children:jsxRuntime.jsx(Button,{className:"w-full",children:"Explore manufacturers"},"b2")})}),jsxRuntime.jsx(ScrollArea,{className:"flex-1",children:$e.length&&jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(ChatList,{userId:t,chats:Rt.filter(ut=>ut.partner1!=ASSISTANT_ID&&ut.partner2!=ASSISTANT_ID),activeChat:ct??null,onSelectChat:ge,assistantChat:$e.find(ut=>ut.partner1==ASSISTANT_ID||ut.partner2==ASSISTANT_ID)})})})]}),jsxRuntime.jsx("div",{className:"flex-3 flex flex-col",children:ae?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"flex items-center p-4 border-b",children:ae[0]==ASSISTANT_ID||ae[1]==ASSISTANT_ID?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Avatar,{className:"h-8 w-8 flex-shrink-0 rounded-none",children:jsxRuntime.jsx(Bot,{className:"text-primary fill-white min-h-full"})}),jsxRuntime.jsx("div",{className:"ml-3 font-medium",children:"Randmar Assistant"}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2 ml-auto",children:[jsxRuntime.jsx(Switch,{id:"smartSwitch",disabled:!!F,checked:R,onCheckedChange:ut=>{pt(),setTimeout(()=>C(ut),20)}}),jsxRuntime.jsx(Label$2,{htmlFor:"smartSwitch",children:"Think harder"})]}),jsxRuntime.jsx(Button,{variant:"ghost",size:"icon",className:"ml-1",onClick:()=>pt(),children:jsxRuntime.jsx(MessageCircleX,{className:"h-5 w-5"})}),jsxRuntime.jsx(Button,{variant:"ghost",size:"icon",className:"ml-1",confirmationDialog:{title:"Report Issue",content:"This action will send a copy of your chat to Randmar. Send it?",onConfirm:()=>Qe()},children:jsxRuntime.jsx(MessageSquareShare,{className:"h-5 w-5"})})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Avatar,{className:"h-8 w-8 flex-shrink-0 rounded-none",children:[jsxRuntime.jsx(AvatarImage,{src:`https://api.randmar.io/v4/Partner/${ae[0]===t?ae[1]:ae[0]}/Account/Logo?height=72&width=72`,className:" object-contain "}),jsxRuntime.jsx(AvatarFallback,{children:jsxRuntime.jsx(Handshake,{className:"text-primary fill-white min-h-full"})})]}),jsxRuntime.jsx("div",{className:"ml-3 font-medium",children:ct==null?void 0:ct.name}),jsxRuntime.jsx("div",{className:"flex items-center space-x-2 ml-auto",children:jsxRuntime.jsx("a",{href:`https://dashboard.randmar.io/${t}/Partner/${ae[0]===t?ae[1]:ae[0]}`,target:"_blank",children:jsxRuntime.jsx(Button,{children:"View Partner"})})})]})}),ct!=null&&ct.pending&&ct.partner1==t?jsxRuntime.jsx("p",{className:"mt-8 p-2 mx-auto",children:"This conversation is awaiting approval by the other party — please check back later."}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(ScrollArea,{className:"flex-1 pl-2 pr-2 bg-slate-50",children:[jsxRuntime.jsx(ChatMessages,{messages:(ct==null?void 0:ct.messages)??[],currentUserId:t,isAssistantChat:isAssistantChat(ae),botStatus:isAssistantChat(ae)?F:""}),jsxRuntime.jsx("div",{ref:tt})]}),jsxRuntime.jsxs("div",{className:"p-4 border-t flex",children:[(ct==null?void 0:ct.pending)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Button,{disabled:S,onClick:()=>ft(),children:[jsxRuntime.jsx(Handshake,{}),"Accept Conversation Request"]}),jsxRuntime.jsxs(Button,{disabled:!0,className:"ml-2",children:[jsxRuntime.jsx(ThumbsDown,{}),"Block Partner"]})]}),jsxRuntime.jsx(Textarea,{ref:it,placeholder:"Type a message...",value:oe,onPaste:Dt,onChange:ut=>Ae(ut.target.value),onKeyDown:ut=>{ut.key!=="Enter"||ut.shiftKey||(ut.preventDefault(),Ht())},className:ct!=null&&ct.pending?"collapse":"flex-1 resize-none"}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx(Button,{size:"icon",variant:"default",className:ct!=null&&ct.pending?"collapse":"ml-2 h-8 w-8",disabled:!!F||(ct==null?void 0:ct.pending),onClick:Ht,children:jsxRuntime.jsx(Send,{className:"h-6 w-6"})}),isAssistantChat(ae)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Input,{type:"file",onChange:Vt,className:"hidden",ref:st}),jsxRuntime.jsx(Button,{size:"icon",variant:"default",onClick:We,className:ct!=null&&ct.pending?"collapse":"ml-2 h-8 w-8",disabled:F!==""||(ct==null?void 0:ct.pending)||!!et,children:jsxRuntime.jsx(Paperclip,{className:"h-5 w-5"})}),jsxRuntime.jsx(Button,{size:"icon",variant:"default",onClick:nt,className:ct!=null&&ct.pending?"collapse":"ml-2 h-8 w-8",disabled:F!==""||(ct==null?void 0:ct.pending)||!et,children:jsxRuntime.jsx(Trash,{className:"h-5 w-5"})})]})]})]})]})]}):jsxRuntime.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Select a chat to start messaging"})}),jsxRuntime.jsx("div",{className:"w-[480px] flex flex-2 flex-col border-l",children:isAssistantChat(ae)?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"flex items-center p-4 border-b",children:jsxRuntime.jsx("p",{className:"h-9 text-base/9",children:"Sources and System Info"})}),jsxRuntime.jsx(ScrollArea,{className:"flex-1 pl-2 pr-2 bg-slate-50",children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[et?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"flex",children:[jsxRuntime.jsx(File,{})," ",et.name," (pending send...)"]})}):at.length?jsxRuntime.jsx(jsxRuntime.Fragment,{}):jsxRuntime.jsx("p",{children:"No files attached to this conversation yet."}),at.slice().reverse().map(ut=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"flex",children:[jsxRuntime.jsx(File,{})," ",ut]})}))]})}),jsxRuntime.jsx(ScrollArea,{className:"flex-4 border-t pl-2 pr-2 bg-slate-50",children:jsxRuntime.jsx("div",{className:"space-y-2",children:jsxRuntime.jsx(DebugMessageDisplay,{debugMessages:Q})})})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"flex items-center p-4 border-b",children:jsxRuntime.jsx("p",{className:"h-9 text-base/9",children:"Partner Overview"})}),jsxRuntime.jsx(ScrollArea,{className:"flex-1 pl-2 pr-2 bg-slate-50",children:jsxRuntime.jsx(PartnerRelationshipPage,{applicationId:t,partnerId:((ae==null?void 0:ae[0])===t?ae[1]:ae==null?void 0:ae[0])??t,userEmail:e,shopifyHostName:void 0,isSuperAdmin:!1})})]})})]})});function getActiveChatObject(t,e){return t.find(n=>n.partner1==(e==null?void 0:e[0])&&n.partner2==(e==null?void 0:e[1]))}function isAssistantChat(t){return(t==null?void 0:t[0])==ASSISTANT_ID||(t==null?void 0:t[1])==ASSISTANT_ID}const alertVariants=cva("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",success:"border-green-500/50 bg-green-50 text-green-700 dark:border-green-500 dark:bg-green-950 dark:text-green-400 [&>svg]:text-green-500",warning:"border-yellow-500/50 bg-yellow-50 text-yellow-700 dark:border-yellow-500 dark:bg-yellow-950 dark:text-yellow-400 [&>svg]:text-yellow-500",info:"border-blue-500/50 bg-blue-50 text-blue-700 dark:border-blue-500 dark:bg-blue-950 dark:text-blue-400 [&>svg]:text-blue-500"}},defaultVariants:{variant:"default"}}),Alert=React__namespace.forwardRef(({className:t,variant:e,...n},o)=>jsxRuntime.jsx("div",{ref:o,role:"alert",className:cn(alertVariants({variant:e}),t),...n}));Alert.displayName="Alert";const AlertTitle=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx("h5",{ref:n,className:cn("mb-1 font-medium leading-none tracking-tight",t),...e}));AlertTitle.displayName="AlertTitle";const AlertDescription=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx("div",{ref:n,className:cn("text-sm [&_p]:leading-relaxed",t),...e}));AlertDescription.displayName="AlertDescription";function QualificationBadge({qualification:t}){return!t.QualificationId||t.QualificationId==="Suspended"?null:t.QualificationId==="Do Not Sell"?jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs(Badge,{variant:"destructive",children:[jsxRuntime.jsx(X$1,{className:"h-3 w-3 mr-1"}),"Do Not Sell"]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Qualification"})})]})}):jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs(Badge,{variant:"info",className:t.DefaultOpportunityNumber?"pr-1":"",children:[jsxRuntime.jsx(BadgeCheck,{className:"h-3 w-3 mr-1"}),t.QualificationId,t.DefaultOpportunityNumber&&jsxRuntime.jsx(Badge,{variant:"secondary",size:"sm",className:"ml-1",children:t.DefaultOpportunityNumber})]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Qualification"})})]})})}function ManufacturerCard({manufacturer:t,link:e,linkNewTab:n=!0,actions:o,mainAction:l,loading:d=!1}){var E,A,I;if(d||!t)return jsxRuntime.jsxs(Card,{className:"flex flex-col h-full",children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-12 rounded-md"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-24 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-40 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-48"})]})]}),jsxRuntime.jsx(Skeleton,{className:"h-16 w-24"})]}),jsxRuntime.jsx(CardContent,{className:"pb-2 flex-grow",children:jsxRuntime.jsxs("div",{className:"flex flex-col space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-16 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-14 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-40"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-36"})]})]})]})}),jsxRuntime.jsxs(CardFooter,{className:"flex justify-between pt-2 gap-2 mt-auto",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-40"})]})]});const f=t.ManufacturerId||"N/A",g=[t.City,t.Province,t.Country].filter(Boolean),b=g.length>0?g.join(", "):"",_=((E=t.Tags)==null?void 0:E.split(",").map(M=>M.trim()).filter(Boolean))||[],S=M=>M===void 0?"n/a":new Intl.NumberFormat("en-CA",{style:"currency",currency:"CAD",minimumFractionDigits:0,maximumFractionDigits:0}).format(M),C=(M=>!M||M.length===0?[]:[...M].sort((j,q)=>(j.Day||0)-(q.Day||0)).map(j=>({date:j.Day||0,amount:j.ExtendedPrice||0})))(t.SalesStatistics);return jsxRuntime.jsxs(Card,{className:"manufacturer-theme flex flex-col h-full",children:[jsxRuntime.jsx(reactRouterDom.Link,{to:e??"#",target:e&&n?"_blank":"_self",children:jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:"h-12 w-12 overflow-hidden rounded-md",children:jsxRuntime.jsx(PartnerLogo,{id:t.ManufacturerId,width:48,height:48})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs text-primary",children:"Manufacturer"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:"|"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:f})]}),jsxRuntime.jsx("h3",{className:"font-semibold",children:t.PublicName||"N/A"}),t.Name&&jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:t.Name}),b&&jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:b})]})]}),jsxRuntime.jsx("div",{className:"flex flex-col items-end gap-2",children:C.length>0&&jsxRuntime.jsx("div",{className:"h-16 w-24",children:jsxRuntime.jsx(AreaChart,{data:C,height:60,size:"mini"})})})]})}),jsxRuntime.jsx(CardContent,{className:"pb-2 flex-grow",children:jsxRuntime.jsxs("div",{className:"flex",children:[jsxRuntime.jsxs("div",{className:"flex flex-col flex-1 space-y-2",children:[(!!((A=t.Qualification)!=null&&A.QualificationId)&&((I=t.Qualification)==null?void 0:I.QualificationId)!=="Suspended"||!!t.OpenToWork||_.length>0)&&jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(QualificationBadge,{qualification:t.Qualification??{}}),!!t.OpenToWork&&jsxRuntime.jsxs(Badge,{variant:"success",children:[jsxRuntime.jsx(HardHat,{className:"h-3 w-3 mr-1"}),"Open To Work"]}),!!t.OnHold&&t.OnHold!==0&&jsxRuntime.jsx(Badge,{variant:"warning",children:"On Hold"}),_.map((M,j)=>jsxRuntime.jsx(Badge,{variant:"outline",children:M},j))]}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[t.Phone&&jsxRuntime.jsxs(reactRouterDom.Link,{to:`tel:${t.Phone}`,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Phone,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:t.Phone})]}),t.PublicEmail&&jsxRuntime.jsxs(reactRouterDom.Link,{to:`mailto:${t.PublicEmail}`,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Mail,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:t.PublicEmail})]}),t.Website&&jsxRuntime.jsxs(reactRouterDom.Link,{to:t.Website,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Globe,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:t.Website})]}),t.CurrencyCode&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(DollarSign,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:t.CurrencyCode})]})]})]}),t.SalesData&&jsxRuntime.jsxs("div",{className:"border-l pl-2 ml-2 flex flex-col text-sm",children:[jsxRuntime.jsx("strong",{className:"",children:"YTD"}),jsxRuntime.jsx("p",{children:S(t.SalesData.SalesYearToDay)}),jsxRuntime.jsx("strong",{className:"mt-2",children:"3 mo."}),jsxRuntime.jsx("p",{children:S(t.SalesData.SalesLast3Months)}),jsxRuntime.jsx("strong",{className:"mt-2",children:"30 days"}),jsxRuntime.jsx("p",{children:S(t.SalesData.SalesLast30Days)})]})]})}),(o||l)&&jsxRuntime.jsxs(CardFooter,{className:"flex pt-2 gap-2 justify-between mt-auto",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:o&&o}),l&&jsxRuntime.jsx("div",{children:l})]})]})}function ResellerCard({reseller:t,link:e,actions:n,loading:o=!1}){var b,_;const l=S=>S===void 0?"n/a":new Intl.NumberFormat("en-CA",{style:"currency",currency:"CAD",minimumFractionDigits:0,maximumFractionDigits:0}).format(S);if(o||!t)return jsxRuntime.jsxs(Card,{className:"flex flex-col h-full",children:[jsxRuntime.jsx(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-12 rounded-md"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-24 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-40 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-48"})]})]})}),jsxRuntime.jsx(CardContent,{className:"pb-2 flex-grow",children:jsxRuntime.jsx("div",{className:"flex",children:jsxRuntime.jsxs("div",{className:"flex flex-col flex-1 space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-16 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-14 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-40"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-36"})]})]})]})})}),jsxRuntime.jsxs(CardFooter,{className:"flex justify-between pt-2 gap-2 mt-auto",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-40"})]})]});const d=t.ResellerId||"N/A",f=[t.City,t.Province,t.Country].filter(Boolean),g=f.length>0?f.join(", "):"Location not provided";return jsxRuntime.jsxs(Card,{className:"reseller-theme flex flex-col h-full",children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:"h-12 w-12 overflow-hidden rounded-md",children:jsxRuntime.jsx(PartnerLogo,{id:t.ResellerId,width:48,height:48})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs text-primary",children:"Reseller"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:"|"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:d})]}),jsxRuntime.jsx("h3",{className:"font-semibold",children:t.PublicName||"N/A"}),t.Name&&jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:t.Name}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:g})]})]}),!!t.OnHold&&t.OnHold!==0&&jsxRuntime.jsx(Badge,{variant:"warning",children:"On Hold"})]}),jsxRuntime.jsx(CardContent,{className:"pb-2 flex-grow",children:jsxRuntime.jsxs("div",{className:"flex",children:[jsxRuntime.jsxs("div",{className:"flex flex-col flex-1 space-y-2",children:[!!((b=t.Qualification)!=null&&b.QualificationId)&&((_=t.Qualification)==null?void 0:_.QualificationId)!=="Suspended"&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2",children:jsxRuntime.jsx(QualificationBadge,{qualification:t.Qualification??{}})}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[t.Phone&&jsxRuntime.jsxs(reactRouterDom.Link,{to:`tel:${t.Phone}`,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Phone,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:t.Phone})]}),t.PublicEmail&&jsxRuntime.jsxs(reactRouterDom.Link,{to:`mailto:${t.PublicEmail}`,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Mail,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:t.PublicEmail})]}),t.Website&&jsxRuntime.jsxs(reactRouterDom.Link,{to:t.Website,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Globe,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:t.Website})]}),t.CurrencyCode&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(DollarSign,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:t.CurrencyCode})]})]})]}),(t==null?void 0:t.SalesData)&&jsxRuntime.jsxs("div",{className:"border-l pl-2 ml-2 flex flex-col text-sm",children:[jsxRuntime.jsx("strong",{className:"",children:"YTD"}),jsxRuntime.jsx("p",{children:l(t==null?void 0:t.SalesData.SalesYearToDay)}),jsxRuntime.jsx("strong",{className:"mt-2",children:"3 mo."}),jsxRuntime.jsx("p",{children:l(t==null?void 0:t.SalesData.SalesLast3Months)}),jsxRuntime.jsx("strong",{className:"mt-2",children:"30 days"}),jsxRuntime.jsx("p",{children:l(t==null?void 0:t.SalesData.SalesLast30Days)})]})]})}),(n||e)&&jsxRuntime.jsxs(CardFooter,{className:`flex pt-2 gap-2 mt-auto ${n?"justify-between":"justify-end"}`,children:[n&&n,e&&jsxRuntime.jsx(Button,{className:"flex items-center gap-1",asChild:!0,children:jsxRuntime.jsxs(reactRouterDom.Link,{to:e,target:"_blank",children:[jsxRuntime.jsx(ExternalLink,{className:"h-4 w-4"}),"Go to Reseller"]})})]})]})}const Table=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx("div",{className:"relative w-full overflow-auto",children:jsxRuntime.jsx("table",{ref:n,className:cn("w-full caption-bottom text-sm",t),...e})}));Table.displayName="Table";const TableHeader=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx("thead",{ref:n,className:cn("[&_tr]:border-b",t),...e}));TableHeader.displayName="TableHeader";const TableBody=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx("tbody",{ref:n,className:cn("[&_tr:last-child]:border-0",t),...e}));TableBody.displayName="TableBody";const TableFooter=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx("tfoot",{ref:n,className:cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));TableFooter.displayName="TableFooter";const TableRow=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx("tr",{ref:n,className:cn("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...e}));TableRow.displayName="TableRow";const TableHead=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx("th",{ref:n,className:cn("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e}));TableHead.displayName="TableHead";const TableCell=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx("td",{ref:n,className:cn("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e}));TableCell.displayName="TableCell";const TableCaption=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx("caption",{ref:n,className:cn("mt-4 text-sm text-muted-foreground",t),...e}));TableCaption.displayName="TableCaption";const Topbar=React.forwardRef(({onSignOut:t,handleValidSearch:e,rightMenu:n,searchPlaceholder:o},l)=>{const[d,f]=React.useState(""),g=reactRouterDom.useLocation(),{toast:b}=useToast();React.useEffect(()=>{const C=new URLSearchParams(g.search).get("q");C&&f(C)},[g.search]);const _=()=>{const R=d.trim();if(!R||R.length<2){b({title:"Enter more characters to search",description:"At least 2 characters are needed to search products.",variant:"destructive",duration:5e3});return}e(R)},S=R=>{R.key==="Enter"&&_()};return jsxRuntime.jsxs("header",{className:"flex h-16 items-center gap-4 border-b sidebar-foreground bg-sidebar px-6 fixed top-0 right-0 z-50 lg:left-64 left-0 border-sidebar-border",children:[jsxRuntime.jsx(SidebarTrigger,{className:"lg:hidden",children:jsxRuntime.jsx(Menu$1,{className:"h-6 w-6"})}),jsxRuntime.jsx("div",{className:"flex flex-1 items-center gap-4",children:jsxRuntime.jsx("div",{className:"relative w-full max-w-sm",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("button",{type:"button",className:"absolute left-2 top-1/2 -translate-y-1/2",onClick:_,"aria-label":"Search",children:jsxRuntime.jsx(Search,{className:"h-4 w-4 text-muted-foreground"})}),jsxRuntime.jsx(Input,{placeholder:o??"Search...",className:"w-full pl-8 bg-white text-black",value:d,onChange:R=>f(R.target.value),onKeyDown:S,ref:l},"topbar-search")]})})}),n||jsxRuntime.jsx(jsxRuntime.Fragment,{}),t&&jsxRuntime.jsx("div",{className:"flex items-center gap-4",children:jsxRuntime.jsxs(Button,{variant:"ghost",size:"icon",className:"h-9 w-9",onClick:t,children:[jsxRuntime.jsx(LogOut,{className:"h-4 w-4 text-sidebar-foreground"}),jsxRuntime.jsx("span",{className:"sr-only",children:"Sign out"})]})})]})});Topbar.displayName="Topbar";function ActiveOrdersCard({orders:t,loading:e=!1}){const n=d=>new Intl.NumberFormat("en-CA",{style:"currency",currency:"CAD",minimumFractionDigits:2,maximumFractionDigits:2}).format(d),o=React.useMemo(()=>{if(!t||t.length===0)return{all:{orders:0,amount:0},processing:{orders:0,amount:0},shipped:{orders:0,amount:0},delayed:{orders:0,amount:0}};const d=t.filter(j=>j.DocumentType==="Order"),f=t.filter(j=>j.DocumentType==="Shipment"),g=d.filter(j=>j.WarehouseCode!=="3PLE"),b=g.reduce((j,q)=>j+(q.Quantity||0),0),_=g.reduce((j,q)=>j+(q.ExtendedPrice||0),0),S=d.filter(j=>j.WarehouseCode==="3PLE"),R=S.reduce((j,q)=>j+(q.Quantity||0),0),C=S.reduce((j,q)=>j+(q.ExtendedPrice||0),0),E=f.length,A=f.reduce((j,q)=>j+(q.ExtendedPrice||0),0),I=b+R+E,M=_+C+A;return{all:{orders:I,amount:M},processing:{orders:b,amount:_},shipped:{orders:E,amount:A},delayed:{orders:R,amount:C}}},[t]),l=[{name:"All",icon:Package,color:"bg-blue-500",textColor:"text-blue-600",orders:o.all.orders,amount:o.all.amount},{name:"Processing",icon:RefreshCcw,color:"bg-yellow-500",textColor:"text-yellow-600",orders:o.processing.orders,amount:o.processing.amount},{name:"Shipped",icon:Truck,color:"bg-green-500",textColor:"text-green-600",orders:o.shipped.orders,amount:o.shipped.amount},{name:"Delayed",icon:CircleAlert,color:"bg-red-500",textColor:"text-red-600",orders:o.delayed.orders,amount:o.delayed.amount}];return e?jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{className:"pb-0",children:jsxRuntime.jsx(CardTitle,{className:"text-lg font-bold",children:"Active Orders"})}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 @sm:grid-cols-2 gap-4 p-4",children:[1,2,3,4].map(d=>jsxRuntime.jsxs("div",{className:"overflow-hidden rounded-md border",children:[jsxRuntime.jsx("div",{className:"bg-slate-200 dark:bg-slate-700 h-[3px]"}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-16 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-7 w-12"})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-16 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]})]})]})]},d))})]}):jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{className:"pb-0",children:jsxRuntime.jsx(CardTitle,{className:"text-lg font-bold",children:"Active Orders"})}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 @sm:grid-cols-2 gap-4 p-4",children:l.map(d=>jsxRuntime.jsxs("div",{className:"overflow-hidden rounded-md border",children:[jsxRuntime.jsx("div",{className:`${d.color} bg-opacity-60 h-[3px]`}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-base",children:d.name}),jsxRuntime.jsx("div",{className:`${d.color} bg-opacity-90 p-2 rounded-full`,children:jsxRuntime.jsx(d.icon,{className:"size-4 shrink-0 text-white"})})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Orders"}),jsxRuntime.jsx("p",{className:"text-xl font-bold",children:d.orders})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Amount"}),jsxRuntime.jsx("p",{className:"text-base font-semibold",children:n(d.amount)})]})]})]})]},d.name))})]})}var __create=Object.create,__getProtoOf=Object.getPrototypeOf,__defProp=Object.defineProperty,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__toESM=(t,e,n)=>{n=t!=null?__create(__getProtoOf(t)):{};const o=e||!t||!t.__esModule?__defProp(n,"default",{value:t,enumerable:!0}):n;for(let l of __getOwnPropNames(t))__hasOwnProp.call(o,l)||__defProp(o,l,{get:()=>t[l],enumerable:!0});return o},__commonJS=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),require_xhtml=__commonJS((t,e)=>{e.exports={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}}),require_acorn=__commonJS((t,e)=>{(function(n,o){typeof t=="object"&&typeof e<"u"?o(t):typeof define=="function"&&define.amd?define(["exports"],o):(n=typeof globalThis<"u"?globalThis:n||self,o(n.acorn={}))})(t,function(n){var o=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],l=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],d="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",f="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",g={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},b="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",_={5:b,"5module":b+" export import",6:b+" const class extends export import super"},S=/^in(stanceof)?$/,R=new RegExp("["+f+"]"),C=new RegExp("["+f+d+"]");function E(V,se){for(var Oe=65536,Be=0;Be<se.length;Be+=2){if(Oe+=se[Be],Oe>V)return!1;if(Oe+=se[Be+1],Oe>=V)return!0}return!1}function A(V,se){return V<65?V===36:V<91?!0:V<97?V===95:V<123?!0:V<=65535?V>=170&&R.test(String.fromCharCode(V)):se===!1?!1:E(V,l)}function I(V,se){return V<48?V===36:V<58?!0:V<65?!1:V<91?!0:V<97?V===95:V<123?!0:V<=65535?V>=170&&C.test(String.fromCharCode(V)):se===!1?!1:E(V,l)||E(V,o)}var M=function(se,Oe){Oe===void 0&&(Oe={}),this.label=se,this.keyword=Oe.keyword,this.beforeExpr=!!Oe.beforeExpr,this.startsExpr=!!Oe.startsExpr,this.isLoop=!!Oe.isLoop,this.isAssign=!!Oe.isAssign,this.prefix=!!Oe.prefix,this.postfix=!!Oe.postfix,this.binop=Oe.binop||null,this.updateContext=null};function j(V,se){return new M(V,{beforeExpr:!0,binop:se})}var q={beforeExpr:!0},z={startsExpr:!0},Q={};function F(V,se){return se===void 0&&(se={}),se.keyword=V,Q[V]=new M(V,se)}var O={num:new M("num",z),regexp:new M("regexp",z),string:new M("string",z),name:new M("name",z),privateId:new M("privateId",z),eof:new M("eof"),bracketL:new M("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new M("]"),braceL:new M("{",{beforeExpr:!0,startsExpr:!0}),braceR:new M("}"),parenL:new M("(",{beforeExpr:!0,startsExpr:!0}),parenR:new M(")"),comma:new M(",",q),semi:new M(";",q),colon:new M(":",q),dot:new M("."),question:new M("?",q),questionDot:new M("?."),arrow:new M("=>",q),template:new M("template"),invalidTemplate:new M("invalidTemplate"),ellipsis:new M("...",q),backQuote:new M("`",z),dollarBraceL:new M("${",{beforeExpr:!0,startsExpr:!0}),eq:new M("=",{beforeExpr:!0,isAssign:!0}),assign:new M("_=",{beforeExpr:!0,isAssign:!0}),incDec:new M("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new M("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:j("||",1),logicalAND:j("&&",2),bitwiseOR:j("|",3),bitwiseXOR:j("^",4),bitwiseAND:j("&",5),equality:j("==/!=/===/!==",6),relational:j("</>/<=/>=",7),bitShift:j("<</>>/>>>",8),plusMin:new M("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:j("%",10),star:j("*",10),slash:j("/",10),starstar:new M("**",{beforeExpr:!0}),coalesce:j("??",1),_break:F("break"),_case:F("case",q),_catch:F("catch"),_continue:F("continue"),_debugger:F("debugger"),_default:F("default",q),_do:F("do",{isLoop:!0,beforeExpr:!0}),_else:F("else",q),_finally:F("finally"),_for:F("for",{isLoop:!0}),_function:F("function",z),_if:F("if"),_return:F("return",q),_switch:F("switch"),_throw:F("throw",q),_try:F("try"),_var:F("var"),_const:F("const"),_while:F("while",{isLoop:!0}),_with:F("with"),_new:F("new",{beforeExpr:!0,startsExpr:!0}),_this:F("this",z),_super:F("super",z),_class:F("class",z),_extends:F("extends",q),_export:F("export"),_import:F("import",z),_null:F("null",z),_true:F("true",z),_false:F("false",z),_in:F("in",{beforeExpr:!0,binop:7}),_instanceof:F("instanceof",{beforeExpr:!0,binop:7}),_typeof:F("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:F("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:F("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},te=/\r\n?|\n|\u2028|\u2029/,ne=new RegExp(te.source,"g");function ae(V){return V===10||V===13||V===8232||V===8233}function ge(V,se,Oe){Oe===void 0&&(Oe=V.length);for(var Be=se;Be<Oe;Be++){var Ge=V.charCodeAt(Be);if(ae(Ge))return Be<Oe-1&&Ge===13&&V.charCodeAt(Be+1)===10?Be+2:Be+1}return-1}var oe=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Ae=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Ne=Object.prototype,je=Ne.hasOwnProperty,$e=Ne.toString,Le=Object.hasOwn||function(V,se){return je.call(V,se)},ze=Array.isArray||function(V){return $e.call(V)==="[object Array]"},Ve=Object.create(null);function Fe(V){return Ve[V]||(Ve[V]=new RegExp("^(?:"+V.replace(/ /g,"|")+")$"))}function qe(V){return V<=65535?String.fromCharCode(V):(V-=65536,String.fromCharCode((V>>10)+55296,(V&1023)+56320))}var Ke=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,He=function(se,Oe){this.line=se,this.column=Oe};He.prototype.offset=function(se){return new He(this.line,this.column+se)};var Xe=function(se,Oe,Be){this.start=Oe,this.end=Be,se.sourceFile!==null&&(this.source=se.sourceFile)};function tt(V,se){for(var Oe=1,Be=0;;){var Ge=ge(V,Be,se);if(Ge<0)return new He(Oe,se-Be);++Oe,Be=Ge}}var Ye={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},et=!1;function Ze(V){var se={};for(var Oe in Ye)se[Oe]=V&&Le(V,Oe)?V[Oe]:Ye[Oe];if(se.ecmaVersion==="latest"?se.ecmaVersion=1e8:se.ecmaVersion==null?(!et&&typeof console=="object"&&console.warn&&(et=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
1046
+ `).map(e=>jsxRuntime.jsx("p",{children:e}));function ChatMessages({messages:t,currentUserId:e,botStatus:n,isAssistantChat:o}){return jsxRuntime.jsxs("div",{children:[t.map(l=>{const d=l.fromPartnerID===e;return jsxRuntime.jsxs("div",{className:cn("flex items-start gap-2 mt-2 mb-2",d&&"flex-row-reverse"),children:[jsxRuntime.jsx(Avatar,{className:"h-8 w-8 mt-1",children:jsxRuntime.jsx(AvatarImage,{src:`https://api.dicebear.com/9.x/thumbs/svg?seed=${md5(l.senderName+l.fromPartnerID)}&flip=${d}`})}),jsxRuntime.jsxs("div",{className:"flex flex-col max-w-[70%]",children:[jsxRuntime.jsxs("p",{className:"mb-1",children:[l.senderName,jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground mt-1 ml-3",children:(()=>{const f=new Date(l.timestamp);return isToday(f)?f.toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0}):isYesterday(f)?`Yesterday, ${f.toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})}`:`${f.toLocaleDateString([],{month:"short",day:"numeric"})} ${f.toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})}`})()})]}),jsxRuntime.jsx("div",{className:cn("rounded-md p-3 break-words [&_li]:ml-6 [&_li]:list-disc [&_h1]:text-lg [&_h1]:font-bold [&_h1]:mt-4 [&_h2]:font-bold [&_h2]:mt-4 [&_h3]:mt-4 ",d?"bg-primary text-white rounded-tr-none":"bg-white border rounded-tl-none"),children:l.fromPartnerID===ASSISTANT_ID?parser(l.content):toHTML(l.content)})]})]},l.id)}),n!==""&&jsxRuntime.jsx(SkeletonMessage,{botStatus:n}),t.length===0&&!o&&jsxRuntime.jsx("div",{className:"text-center text-muted-foreground py-8",children:"No messages yet"}),t.length===0&&n===""&&o&&jsxRuntime.jsxs("div",{className:"text-center py-8",children:[jsxRuntime.jsx("p",{children:"The Randmar Assistant is ready to help you. Ask anything about products, orders, carts, shipments and tracking numbers."}),jsxRuntime.jsx("p",{children:jsxRuntime.jsx("strong",{children:'Try it now, type "my open orders"!'})})]})]})}var SWITCH_NAME="Switch",[createSwitchContext,createSwitchScope]=createContextScope(SWITCH_NAME),[SwitchProvider,useSwitchContext]=createSwitchContext(SWITCH_NAME),Switch$1=React__namespace.forwardRef((t,e)=>{const{__scopeSwitch:n,name:o,checked:l,defaultChecked:d,required:f,disabled:g,value:b="on",onCheckedChange:_,form:S,...R}=t,[C,E]=React__namespace.useState(null),A=useComposedRefs(e,z=>E(z)),I=React__namespace.useRef(!1),M=C?S||!!C.closest("form"):!0,[j,q]=useControllableState({prop:l,defaultProp:d??!1,onChange:_,caller:SWITCH_NAME});return jsxRuntime.jsxs(SwitchProvider,{scope:n,checked:j,disabled:g,children:[jsxRuntime.jsx(Primitive.button,{type:"button",role:"switch","aria-checked":j,"aria-required":f,"data-state":getState$2(j),"data-disabled":g?"":void 0,disabled:g,value:b,...R,ref:A,onClick:composeEventHandlers(t.onClick,z=>{q(Q=>!Q),M&&(I.current=z.isPropagationStopped(),I.current||z.stopPropagation())})}),M&&jsxRuntime.jsx(SwitchBubbleInput,{control:C,bubbles:!I.current,name:o,value:b,checked:j,required:f,disabled:g,form:S,style:{transform:"translateX(-100%)"}})]})});Switch$1.displayName=SWITCH_NAME;var THUMB_NAME="SwitchThumb",SwitchThumb=React__namespace.forwardRef((t,e)=>{const{__scopeSwitch:n,...o}=t,l=useSwitchContext(THUMB_NAME,n);return jsxRuntime.jsx(Primitive.span,{"data-state":getState$2(l.checked),"data-disabled":l.disabled?"":void 0,...o,ref:e})});SwitchThumb.displayName=THUMB_NAME;var BUBBLE_INPUT_NAME$2="SwitchBubbleInput",SwitchBubbleInput=React__namespace.forwardRef(({__scopeSwitch:t,control:e,checked:n,bubbles:o=!0,...l},d)=>{const f=React__namespace.useRef(null),g=useComposedRefs(f,d),b=usePrevious(n),_=useSize(e);return React__namespace.useEffect(()=>{const S=f.current;if(!S)return;const R=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(R,"checked").set;if(b!==n&&E){const A=new Event("click",{bubbles:o});E.call(S,n),S.dispatchEvent(A)}},[b,n,o]),jsxRuntime.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...l,tabIndex:-1,ref:g,style:{...l.style,..._,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});SwitchBubbleInput.displayName=BUBBLE_INPUT_NAME$2;function getState$2(t){return t?"checked":"unchecked"}var Root$1=Switch$1,Thumb=SwitchThumb;const Switch=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx(Root$1,{className:cn("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...e,ref:n,children:jsxRuntime.jsx(Thumb,{className:cn("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Switch.displayName=Root$1.displayName;const DebugMessageDisplay=({debugMessages:t})=>{const[e,n]=React.useState({}),o=l=>{n(d=>({...d,[l]:!d[l]}))};return jsxRuntime.jsx("div",{children:t.map((l,d)=>{if(typeof l=="string")return jsxRuntime.jsx("p",{className:"text-slate-600",children:l},d);{const f=e[d];return jsxRuntime.jsxs("div",{className:"cursor-pointer",onClick:()=>o(d),children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("p",{className:"text-slate-600 mr-2",children:l[0]}),jsxRuntime.jsx("span",{className:"text-slate-500 text-xs",children:f?"▲":"▼"})]}),f&&jsxRuntime.jsx("p",{className:"text-slate-400 pl-4",children:l[1]})]},d)}})})},ASSISTANT_ID="RandmarAIChatAssistant",ChatLayout=React.forwardRef(({userId:t,userName:e,apiKey:n,inputRef:o},l)=>{const{data:d,refetch:f}=useGetV4PartnerByRouteApplicationIdBusinessDevelopmentConversationsQuery({routeApplicationId:t}),[g]=useLazyGetV4PartnerByApplicationIdAccountQuery(),[b]=usePostV4PartnerByApplicationIdAccountDebugFeedbackMutation(),[_,{isLoading:S}]=usePostV4PartnerByRouteApplicationIdBusinessDevelopmentConversationPartnerAndPartnerIdMutation(),[R,C]=React.useState(!1),E=React.useRef(null),[A]=usePostV4PartnerByRouteApplicationIdBusinessDevelopmentConversationPartnerAndPartnerIdMutation(),[I]=useLazyGetV4PartnerByRouteApplicationIdBusinessDevelopmentConversationAndConversationIdMessagesQuery(),{handleSubmitToBot:M,botMessages:j,clearBotMessages:q,botReady:z,debugMessages:Q,botStatus:F,reset:O}=useAIAssistant({userId:t,apiKey:n,smartAndSlow:R});React.useEffect(()=>{if(!d)return;const ut={partner1:t,partner2:ASSISTANT_ID,name:"Randmar Assistant",unread:0,pending:!1,historyFetched:!0,messages:[],conversationID:-1},Mt=d.map(Ut=>{var yt;return{partner1:Ut.Participant1,partner2:Ut.Participant2,name:((yt=Ut.Participant)==null?void 0:yt.PublicName)??"missing public name",unread:0,pending:Ut.Status!="Approved",historyFetched:!1,messages:[],conversationID:Ut.ConversationId}});setTimeout(()=>{var Ut;return(Ut=it.current)==null?void 0:Ut.focus()},50),Le([ut,...Mt])},[d]);const[te,ne]=React.useState("approved"),[ae,ge]=React.useState([t,ASSISTANT_ID]),[oe,Ae]=React.useState(""),[Ne,je]=React.useState(null),[$e,Le]=React.useState([]),[ze,Ve]=React.useState(""),[Fe,qe]=React.useState(null),[Ke,He]=React.useState([]),[,Xe]=React.useState(0),tt=React.useRef(null),Ye=React.useRef(null),[et,Ze]=React.useState(null),[at,rt]=React.useState([]),it=o||Ye,st=React.useRef(null),{toast:Ue}=useToast(),Rt=$e.filter(ut=>{const Mt=ut.name.toLowerCase().includes(ze.toLowerCase());return te==="approved"?Mt&&!ut.pending:te==="pending"?Mt&&ut.pending:Mt});React.useEffect(()=>{var ut;et!==null&&(Ue({title:"File attached",description:"Add your instruction before sending.",variant:"success"}),(ut=it.current)==null||ut.focus())},[et]),React.useEffect(()=>{j.length!==0&&(j.forEach(ut=>{if(!ut)return;if(ut.isComponent){He(Ut=>[...Ut,ut.content]),Xe(0);return}const Mt={id:ut.timestamp.toString(),fromPartnerID:ASSISTANT_ID,toPartnerID:t,senderName:"Assistant",timestamp:ut.timestamp.getTime(),content:ut.content};Mt.content=marked(Mt.content,{async:!1}),Je(Mt)}),q())},[j]);function Je(ut){const Mt=[ut.fromPartnerID,ut.toPartnerID];Mt.sort(),Le(Ut=>{let yt=!1;const nr=Ut.map(er=>er.partner1!==Mt[0]||er.partner2!==Mt[1]||er.messages.findIndex(lr=>lr.id==ut.id)!==-1?er:(yt=!0,{...er,unread:er.unread+1,messages:[...er.messages,ut]}));return yt&&je([Mt[0],Mt[1]]),nr})}React.useEffect(()=>{const ut=new HubConnectionBuilder().withUrl("https://api.randmar.io/hub",{accessTokenFactory:()=>localStorage.getItem("access_token"),headers:{"X-Impersonated-Id":t}}).configureLogging(LogLevel.Information).withAutomaticReconnect().withHubProtocol(new JsonHubProtocol).build();return ut.on("ReceiveMessage",Je),ut.start().catch(Mt=>console.error("Error connecting to SignalR hub:",Mt)),qe(ut),()=>{ut&&ut.stop()}},[t]),React.useEffect(()=>{(Ne==null?void 0:Ne[0])!==(ae==null?void 0:ae[0])||(Ne==null?void 0:Ne[1])!==(ae==null?void 0:ae[1])||(Le(ut=>ut.map(Mt=>Mt.partner1===(ae==null?void 0:ae[0])&&Mt.partner2===(ae==null?void 0:ae[1])?{...Mt,unread:0}:Mt)),setTimeout(()=>{var ut;return(ut=tt.current)==null?void 0:ut.scrollIntoView({behavior:"smooth"})},50))},[Ne,ae]),React.useEffect(()=>{if(!ae)return;const ut=getActiveChatObject($e,ae);if(ut){if(ut.historyFetched){ut.unread>0&&Le(Mt=>Mt.map(Ut=>Ut.partner1===ae[0]&&Ut.partner2===ae[1]?{...Ut,unread:0}:Ut)),setTimeout(()=>{var Mt;return(Mt=tt.current)==null?void 0:Mt.scrollIntoView({behavior:"smooth"})},50);return}I({routeApplicationId:t,conversationId:ut.conversationID}).unwrap().then(Mt=>{const Ut=Mt.map(yt=>({id:"history"+yt.MessageId,fromPartnerID:yt.SenderId,toPartnerID:yt.SenderId==ae[0]?ae[1]:ae[0],senderName:yt.SenderName??"missing name",timestamp:new Date(yt.SentDate+"Z").getTime(),content:yt.Content??"no content"}));Le(yt=>yt.map(nr=>nr.partner1===ae[0]&&nr.partner2===ae[1]?{...nr,messages:Ut,historyFetched:!0}:nr))}).catch(Mt=>{console.error("Error fetching conversation messages:",Mt)})}},[$e,ae,I,t]),React.useEffect(()=>{var Mt;if(Xe(Ke.length),!ae)return;const ut=getActiveChatObject($e,ae);ut&&((Mt=it.current)==null||Mt.focus(),g({applicationId:ut.partner1===t?ut.partner2:ut.partner1}).then(Ut=>{Ut.data&&(He(yt=>[...yt,jsxRuntime.jsx("div",{className:"mt-2",children:jsxRuntime.jsx(PartnerCard,{account:Ut.data,action:jsxRuntime.jsx(jsxRuntime.Fragment,{}),withVoice:!1})})]),Xe(0))}))},[ae,t]);const mt=(ut,Mt,Ut)=>{const yt={id:crypto.randomUUID(),senderName:e,fromPartnerID:t,toPartnerID:Mt[0]===t?Mt[1]:Mt[0],content:ut+(et?` (${et==null?void 0:et.name} attached)`:""),timestamp:Date.now()};Le(nr=>nr.map(er=>er.partner1===Mt[0]&&er.partner2===Mt[1]?{...er,messages:[...er.messages,yt]}:er)),je([Mt[0],Mt[1]]),yt.toPartnerID==ASSISTANT_ID?(M(yt.content,et??void 0),et&&rt(nr=>[...nr,et.name])):Ut.invoke("NewMessage",yt).catch(nr=>console.error("Error sending message:",nr)),Ae(""),Ze(null),st.current&&(st.current.value="")},$t=(ut,Mt)=>{if(!$e.length||!Fe||!z)return!1;const Ut=$e.find(yt=>yt.conversationID===ut);return Ut?(Ut.pending&&setTimeout(()=>ne("pending"),300),ge([Ut.partner1,Ut.partner2]),Mt&&setTimeout(()=>mt(Mt,[Ut.partner1,Ut.partner2],Fe),300),!0):!1};if(React.useImperativeHandle(l,()=>({setActiveChatAndSendMessage:$t})),!z)return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),jsxRuntime.jsx("p",{children:"Loading API functions..."})]})})});const Dt=ut=>{var Ut;if(!isAssistantChat(ae))return;const Mt=(Ut=ut.clipboardData)==null?void 0:Ut.items;if(Mt){for(let yt=0;yt<Mt.length;yt++)if(Mt[yt].type.indexOf("image")!==-1){const nr=Mt[yt].getAsFile();if(nr){Ze(nr);return}}}},Ht=()=>{!oe.trim()||!ae||!Fe||(Xe(Ke.length),mt(oe,ae,Fe))},Vt=ut=>{ut.target.files&&ut.target.files[0]?Ze(ut.target.files[0]):Ze(null)},We=()=>{var ut;(ut=st.current)==null||ut.click()},nt=()=>{var ut;Ze(null),Ue({title:"File removed",description:"No file will be sent to the assistant.",variant:"secondary"}),(ut=it.current)==null||ut.focus()},Qe=()=>{const Mt={messages:$e.find(Ut=>Ut.partner1===ASSISTANT_ID||Ut.partner2===ASSISTANT_ID),debug:Q};b({applicationId:t,emailAddress:e,body:Mt})},dt=async()=>{E.current&&(E.current.disabled=!0),await A({routeApplicationId:t,partnerId:"2"}),await f()},pt=()=>{Le(ut=>ut.map(Ut=>Ut.partner1!==ASSISTANT_ID&&Ut.partner2!==ASSISTANT_ID?Ut:{...Ut,messages:[]})),rt([]),O()},ft=()=>{ae&&_({routeApplicationId:t,partnerId:ae[0]==t?ae[1]:ae[0]}).then(()=>{ne("approved")})},ct=getActiveChatObject($e,ae),qt=$e.filter(ut=>ut.pending).length;return jsxRuntime.jsxs("div",{className:"flex h-[85vh] overflow-hidden",children:[jsxRuntime.jsxs("div",{className:"w-[260px] p-4 pt-3 flex flex-col border-r",children:[jsxRuntime.jsx("div",{className:"p-4 font-semibold border-b",children:"Communications"}),$e.length>1&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"p-2",children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(Search,{className:"absolute left-2 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),jsxRuntime.jsx(Input,{placeholder:"Search chats...",className:"pl-8 h-9",value:ze,onChange:ut=>Ve(ut.target.value)})]})}),jsxRuntime.jsx(Tabs,{value:te,onValueChange:ne,className:"w-full mb-1",children:jsxRuntime.jsxs(TabsList,{className:"grid grid-cols-6 h-9 mx-2",children:[jsxRuntime.jsx(TabsTrigger,{value:"approved",className:"text-xs col-span-3",children:"Approved"}),jsxRuntime.jsxs(TabsTrigger,{value:"pending",className:"text-xs col-span-3",children:["Pending ",qt>0&&`(${qt})`]})]})})]}),jsxRuntime.jsx("div",{className:"mt-1 mb-1",children:$e.findIndex(ut=>ut.partner1==="2"||ut.partner2==="2")<0?jsxRuntime.jsx(Button,{className:"w-full",ref:E,onClick:()=>dt(),children:"Chat with Randmar"},"b1"):jsxRuntime.jsx("a",{target:"_blank",href:`https://dashboard.randmar.io/${t}/ExploreManufacturers`,children:jsxRuntime.jsx(Button,{className:"w-full",children:"Explore manufacturers"},"b2")})}),jsxRuntime.jsx(ScrollArea,{className:"flex-1",children:$e.length&&jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(ChatList,{userId:t,chats:Rt.filter(ut=>ut.partner1!=ASSISTANT_ID&&ut.partner2!=ASSISTANT_ID),activeChat:ct??null,onSelectChat:ge,assistantChat:$e.find(ut=>ut.partner1==ASSISTANT_ID||ut.partner2==ASSISTANT_ID)})})})]}),jsxRuntime.jsx("div",{className:"flex-3 flex flex-col",children:ae?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"flex items-center p-4 border-b",children:ae[0]==ASSISTANT_ID||ae[1]==ASSISTANT_ID?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Avatar,{className:"h-8 w-8 flex-shrink-0 rounded-none",children:jsxRuntime.jsx(Bot,{className:"text-primary fill-white min-h-full"})}),jsxRuntime.jsx("div",{className:"ml-3 font-medium",children:"Randmar Assistant"}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2 ml-auto",children:[jsxRuntime.jsx(Switch,{id:"smartSwitch",disabled:!!F,checked:R,onCheckedChange:ut=>{pt(),setTimeout(()=>C(ut),20)}}),jsxRuntime.jsx(Label$2,{htmlFor:"smartSwitch",children:"Think harder"})]}),jsxRuntime.jsx(Button,{variant:"ghost",size:"icon",className:"ml-1",onClick:()=>pt(),children:jsxRuntime.jsx(MessageCircleX,{className:"h-5 w-5"})}),jsxRuntime.jsx(Button,{variant:"ghost",size:"icon",className:"ml-1",confirmationDialog:{title:"Report Issue",content:"This action will send a copy of your chat to Randmar. Send it?",onConfirm:()=>Qe()},children:jsxRuntime.jsx(MessageSquareShare,{className:"h-5 w-5"})})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Avatar,{className:"h-8 w-8 flex-shrink-0 rounded-none",children:[jsxRuntime.jsx(AvatarImage,{src:`https://api.randmar.io/v4/Partner/${ae[0]===t?ae[1]:ae[0]}/Account/Logo?height=72&width=72`,className:" object-contain "}),jsxRuntime.jsx(AvatarFallback,{children:jsxRuntime.jsx(Handshake,{className:"text-primary fill-white min-h-full"})})]}),jsxRuntime.jsx("div",{className:"ml-3 font-medium",children:ct==null?void 0:ct.name}),jsxRuntime.jsx("div",{className:"flex items-center space-x-2 ml-auto",children:jsxRuntime.jsx("a",{href:`https://dashboard.randmar.io/${t}/Partner/${ae[0]===t?ae[1]:ae[0]}`,target:"_blank",children:jsxRuntime.jsx(Button,{children:"View Partner"})})})]})}),ct!=null&&ct.pending&&ct.partner1==t?jsxRuntime.jsx("p",{className:"mt-8 p-2 mx-auto",children:"This conversation is awaiting approval by the other party — please check back later."}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(ScrollArea,{className:"flex-1 pl-2 pr-2 bg-slate-50",children:[jsxRuntime.jsx(ChatMessages,{messages:(ct==null?void 0:ct.messages)??[],currentUserId:t,isAssistantChat:isAssistantChat(ae),botStatus:isAssistantChat(ae)?F:""}),jsxRuntime.jsx("div",{ref:tt})]}),jsxRuntime.jsxs("div",{className:"p-4 border-t flex",children:[(ct==null?void 0:ct.pending)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Button,{disabled:S,onClick:()=>ft(),children:[jsxRuntime.jsx(Handshake,{}),"Accept Conversation Request"]}),jsxRuntime.jsxs(Button,{disabled:!0,className:"ml-2",children:[jsxRuntime.jsx(ThumbsDown,{}),"Block Partner"]})]}),jsxRuntime.jsx(Textarea,{ref:it,placeholder:"Type a message...",value:oe,onPaste:Dt,onChange:ut=>Ae(ut.target.value),onKeyDown:ut=>{ut.key!=="Enter"||ut.shiftKey||(ut.preventDefault(),Ht())},className:ct!=null&&ct.pending?"collapse":"flex-1 resize-none"}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx(Button,{size:"icon",variant:"default",className:ct!=null&&ct.pending?"collapse":"ml-2 h-8 w-8",disabled:!!F||(ct==null?void 0:ct.pending),onClick:Ht,children:jsxRuntime.jsx(Send,{className:"h-6 w-6"})}),isAssistantChat(ae)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Input,{type:"file",onChange:Vt,className:"hidden",ref:st}),jsxRuntime.jsx(Button,{size:"icon",variant:"default",onClick:We,className:ct!=null&&ct.pending?"collapse":"ml-2 h-8 w-8",disabled:F!==""||(ct==null?void 0:ct.pending)||!!et,children:jsxRuntime.jsx(Paperclip,{className:"h-5 w-5"})}),jsxRuntime.jsx(Button,{size:"icon",variant:"default",onClick:nt,className:ct!=null&&ct.pending?"collapse":"ml-2 h-8 w-8",disabled:F!==""||(ct==null?void 0:ct.pending)||!et,children:jsxRuntime.jsx(Trash,{className:"h-5 w-5"})})]})]})]})]})]}):jsxRuntime.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Select a chat to start messaging"})}),jsxRuntime.jsx("div",{className:"w-[480px] flex flex-2 flex-col border-l",children:isAssistantChat(ae)?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"flex items-center p-4 border-b",children:jsxRuntime.jsx("p",{className:"h-9 text-base/9",children:"Sources and System Info"})}),jsxRuntime.jsx(ScrollArea,{className:"flex-1 pl-2 pr-2 bg-slate-50",children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[et?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"flex",children:[jsxRuntime.jsx(File,{})," ",et.name," (pending send...)"]})}):at.length?jsxRuntime.jsx(jsxRuntime.Fragment,{}):jsxRuntime.jsx("p",{children:"No files attached to this conversation yet."}),at.slice().reverse().map(ut=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"flex",children:[jsxRuntime.jsx(File,{})," ",ut]})}))]})}),jsxRuntime.jsx(ScrollArea,{className:"flex-4 border-t pl-2 pr-2 bg-slate-50",children:jsxRuntime.jsx("div",{className:"space-y-2",children:jsxRuntime.jsx(DebugMessageDisplay,{debugMessages:Q})})})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"flex items-center p-4 border-b",children:jsxRuntime.jsx("p",{className:"h-9 text-base/9",children:"Partner Overview"})}),jsxRuntime.jsx(ScrollArea,{className:"flex-1 pl-2 pr-2 bg-slate-50",children:jsxRuntime.jsx(PartnerRelationshipPage,{applicationId:t,partnerId:((ae==null?void 0:ae[0])===t?ae[1]:ae==null?void 0:ae[0])??t,userEmail:e,shopifyHostName:void 0,isSuperAdmin:!1})})]})})]})});function getActiveChatObject(t,e){return t.find(n=>n.partner1==(e==null?void 0:e[0])&&n.partner2==(e==null?void 0:e[1]))}function isAssistantChat(t){return(t==null?void 0:t[0])==ASSISTANT_ID||(t==null?void 0:t[1])==ASSISTANT_ID}const alertVariants=cva("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",success:"border-green-500/50 bg-green-50 text-green-700 dark:border-green-500 dark:bg-green-950 dark:text-green-400 [&>svg]:text-green-500",warning:"border-yellow-500/50 bg-yellow-50 text-yellow-700 dark:border-yellow-500 dark:bg-yellow-950 dark:text-yellow-400 [&>svg]:text-yellow-500",info:"border-blue-500/50 bg-blue-50 text-blue-700 dark:border-blue-500 dark:bg-blue-950 dark:text-blue-400 [&>svg]:text-blue-500"}},defaultVariants:{variant:"default"}}),Alert=React__namespace.forwardRef(({className:t,variant:e,...n},o)=>jsxRuntime.jsx("div",{ref:o,role:"alert",className:cn(alertVariants({variant:e}),t),...n}));Alert.displayName="Alert";const AlertTitle=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx("h5",{ref:n,className:cn("mb-1 font-medium leading-none tracking-tight",t),...e}));AlertTitle.displayName="AlertTitle";const AlertDescription=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx("div",{ref:n,className:cn("text-sm [&_p]:leading-relaxed",t),...e}));AlertDescription.displayName="AlertDescription";function QualificationBadge({qualification:t}){return!t.QualificationId||t.QualificationId==="Suspended"?null:t.QualificationId==="Do Not Sell"?jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs(Badge,{variant:"destructive",children:[jsxRuntime.jsx(X$1,{className:"h-3 w-3 mr-1"}),"Do Not Sell"]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Qualification"})})]})}):jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs(Badge,{variant:"info",className:t.DefaultOpportunityNumber?"pr-1":"",children:[jsxRuntime.jsx(BadgeCheck,{className:"h-3 w-3 mr-1"}),t.QualificationId,t.DefaultOpportunityNumber&&jsxRuntime.jsx(Badge,{variant:"secondary",size:"sm",className:"ml-1",children:t.DefaultOpportunityNumber})]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Qualification"})})]})})}function ManufacturerCard({manufacturer:t,link:e,linkNewTab:n=!0,actions:o,mainAction:l,loading:d=!1}){var E,A,I;if(d||!t)return jsxRuntime.jsxs(Card,{className:"flex flex-col h-full",children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-12 rounded-md"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-24 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-40 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-48"})]})]}),jsxRuntime.jsx(Skeleton,{className:"h-16 w-24"})]}),jsxRuntime.jsx(CardContent,{className:"pb-2 flex-grow",children:jsxRuntime.jsxs("div",{className:"flex flex-col space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-16 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-14 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-40"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-36"})]})]})]})}),jsxRuntime.jsxs(CardFooter,{className:"flex justify-between pt-2 gap-2 mt-auto",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-40"})]})]});const f=t.ManufacturerId||"N/A",g=[t.City,t.Province,t.Country].filter(Boolean),b=g.length>0?g.join(", "):"",_=((E=t.Tags)==null?void 0:E.split(",").map(M=>M.trim()).filter(Boolean))||[],S=M=>M===void 0?"n/a":new Intl.NumberFormat("en-CA",{style:"currency",currency:"CAD",minimumFractionDigits:0,maximumFractionDigits:0}).format(M),C=(M=>!M||M.length===0?[]:[...M].sort((j,q)=>(j.Day||0)-(q.Day||0)).map(j=>({date:j.Day||0,amount:j.ExtendedPrice||0})))(t.SalesStatistics);return jsxRuntime.jsxs(Card,{className:"manufacturer-theme flex flex-col h-full",children:[jsxRuntime.jsx(reactRouterDom.Link,{to:e??"#",target:e&&n?"_blank":"_self",children:jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:"h-12 w-12 overflow-hidden rounded-md",children:jsxRuntime.jsx(PartnerLogo,{id:t.ManufacturerId,width:48,height:48})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs text-primary",children:"Manufacturer"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:"|"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:f})]}),jsxRuntime.jsx("h3",{className:"font-semibold",children:t.PublicName||"N/A"}),t.Name&&jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:t.Name}),b&&jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:b})]})]}),jsxRuntime.jsx("div",{className:"flex flex-col items-end gap-2",children:C.length>0&&jsxRuntime.jsx("div",{className:"h-16 w-24",children:jsxRuntime.jsx(AreaChart,{data:C,height:60,size:"mini"})})})]})}),jsxRuntime.jsx(CardContent,{className:"pb-2 flex-grow",children:jsxRuntime.jsxs("div",{className:"flex",children:[jsxRuntime.jsxs("div",{className:"flex flex-col flex-1 space-y-2",children:[(!!((A=t.Qualification)!=null&&A.QualificationId)&&((I=t.Qualification)==null?void 0:I.QualificationId)!=="Suspended"||!!t.OpenToWork||_.length>0)&&jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(QualificationBadge,{qualification:t.Qualification??{}}),!!t.OpenToWork&&jsxRuntime.jsxs(Badge,{variant:"success",children:[jsxRuntime.jsx(HardHat,{className:"h-3 w-3 mr-1"}),"Open To Work"]}),!!t.OnHold&&t.OnHold!==0&&jsxRuntime.jsx(Badge,{variant:"warning",children:"On Hold"}),_.map((M,j)=>jsxRuntime.jsx(Badge,{variant:"outline",children:M},j))]}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[t.Phone&&jsxRuntime.jsxs(reactRouterDom.Link,{to:`tel:${t.Phone}`,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Phone,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:t.Phone})]}),t.PublicEmail&&jsxRuntime.jsxs(reactRouterDom.Link,{to:`mailto:${t.PublicEmail}`,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Mail,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:t.PublicEmail})]}),t.Website&&jsxRuntime.jsxs(reactRouterDom.Link,{to:t.Website,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Globe,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:t.Website})]}),t.CurrencyCode&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(DollarSign,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:t.CurrencyCode})]})]})]}),t.SalesData&&jsxRuntime.jsxs("div",{className:"border-l pl-2 ml-2 flex flex-col text-sm",children:[jsxRuntime.jsx("strong",{className:"",children:"YTD"}),jsxRuntime.jsx("p",{children:S(t.SalesData.SalesYearToDay)}),jsxRuntime.jsx("strong",{className:"mt-2",children:"3 mo."}),jsxRuntime.jsx("p",{children:S(t.SalesData.SalesLast3Months)}),jsxRuntime.jsx("strong",{className:"mt-2",children:"30 days"}),jsxRuntime.jsx("p",{children:S(t.SalesData.SalesLast30Days)})]})]})}),(o||l)&&jsxRuntime.jsxs(CardFooter,{className:"flex pt-2 gap-2 justify-between mt-auto",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:o&&o}),l&&jsxRuntime.jsx("div",{children:l})]})]})}function ResellerCard({reseller:t,link:e,actions:n,loading:o=!1}){var b,_;const l=S=>S===void 0?"n/a":new Intl.NumberFormat("en-CA",{style:"currency",currency:"CAD",minimumFractionDigits:0,maximumFractionDigits:0}).format(S);if(o||!t)return jsxRuntime.jsxs(Card,{className:"flex flex-col h-full",children:[jsxRuntime.jsx(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-12 rounded-md"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-24 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-40 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-48"})]})]})}),jsxRuntime.jsx(CardContent,{className:"pb-2 flex-grow",children:jsxRuntime.jsx("div",{className:"flex",children:jsxRuntime.jsxs("div",{className:"flex flex-col flex-1 space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-16 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-14 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-40"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-36"})]})]})]})})}),jsxRuntime.jsxs(CardFooter,{className:"flex justify-between pt-2 gap-2 mt-auto",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-40"})]})]});const d=t.ResellerId||"N/A",f=[t.City,t.Province,t.Country].filter(Boolean),g=f.length>0?f.join(", "):"Location not provided";return jsxRuntime.jsxs(Card,{className:"reseller-theme flex flex-col h-full",children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:"h-12 w-12 overflow-hidden rounded-md",children:jsxRuntime.jsx(PartnerLogo,{id:t.ResellerId,width:48,height:48})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs text-primary",children:"Reseller"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:"|"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:d})]}),jsxRuntime.jsx("h3",{className:"font-semibold",children:t.PublicName||"N/A"}),t.Name&&jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:t.Name}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:g})]})]}),!!t.OnHold&&t.OnHold!==0&&jsxRuntime.jsx(Badge,{variant:"warning",children:"On Hold"})]}),jsxRuntime.jsx(CardContent,{className:"pb-2 flex-grow",children:jsxRuntime.jsxs("div",{className:"flex",children:[jsxRuntime.jsxs("div",{className:"flex flex-col flex-1 space-y-2",children:[!!((b=t.Qualification)!=null&&b.QualificationId)&&((_=t.Qualification)==null?void 0:_.QualificationId)!=="Suspended"&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2",children:jsxRuntime.jsx(QualificationBadge,{qualification:t.Qualification??{}})}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[t.Phone&&jsxRuntime.jsxs(reactRouterDom.Link,{to:`tel:${t.Phone}`,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Phone,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:t.Phone})]}),t.PublicEmail&&jsxRuntime.jsxs(reactRouterDom.Link,{to:`mailto:${t.PublicEmail}`,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Mail,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:t.PublicEmail})]}),t.Website&&jsxRuntime.jsxs(reactRouterDom.Link,{to:t.Website,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Globe,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:t.Website})]}),t.CurrencyCode&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(DollarSign,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:t.CurrencyCode})]})]})]}),(t==null?void 0:t.SalesData)&&jsxRuntime.jsxs("div",{className:"border-l pl-2 ml-2 flex flex-col text-sm",children:[jsxRuntime.jsx("strong",{className:"",children:"YTD"}),jsxRuntime.jsx("p",{children:l(t==null?void 0:t.SalesData.SalesYearToDay)}),jsxRuntime.jsx("strong",{className:"mt-2",children:"3 mo."}),jsxRuntime.jsx("p",{children:l(t==null?void 0:t.SalesData.SalesLast3Months)}),jsxRuntime.jsx("strong",{className:"mt-2",children:"30 days"}),jsxRuntime.jsx("p",{children:l(t==null?void 0:t.SalesData.SalesLast30Days)})]})]})}),(n||e)&&jsxRuntime.jsxs(CardFooter,{className:`flex pt-2 gap-2 mt-auto ${n?"justify-between":"justify-end"}`,children:[n&&n,e&&jsxRuntime.jsx(Button,{className:"flex items-center gap-1",asChild:!0,children:jsxRuntime.jsxs(reactRouterDom.Link,{to:e,target:"_blank",children:[jsxRuntime.jsx(ExternalLink,{className:"h-4 w-4"}),"Go to Reseller"]})})]})]})}const Table=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx("div",{className:"relative w-full overflow-auto",children:jsxRuntime.jsx("table",{ref:n,className:cn("w-full caption-bottom text-sm",t),...e})}));Table.displayName="Table";const TableHeader=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx("thead",{ref:n,className:cn("[&_tr]:border-b",t),...e}));TableHeader.displayName="TableHeader";const TableBody=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx("tbody",{ref:n,className:cn("[&_tr:last-child]:border-0",t),...e}));TableBody.displayName="TableBody";const TableFooter=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx("tfoot",{ref:n,className:cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));TableFooter.displayName="TableFooter";const TableRow=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx("tr",{ref:n,className:cn("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...e}));TableRow.displayName="TableRow";const TableHead=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx("th",{ref:n,className:cn("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e,children:jsxRuntime.jsx("span",{children:e.children})}));TableHead.displayName="TableHead";const TableCell=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx("td",{ref:n,className:cn("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e,children:jsxRuntime.jsx("span",{children:e.children})}));TableCell.displayName="TableCell";const TableCaption=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx("caption",{ref:n,className:cn("mt-4 text-sm text-muted-foreground",t),...e}));TableCaption.displayName="TableCaption";const Topbar=React.forwardRef(({onSignOut:t,handleValidSearch:e,rightMenu:n,searchPlaceholder:o},l)=>{const[d,f]=React.useState(""),g=reactRouterDom.useLocation(),{toast:b}=useToast();React.useEffect(()=>{const C=new URLSearchParams(g.search).get("q");C&&f(C)},[g.search]);const _=()=>{const R=d.trim();if(!R||R.length<2){b({title:"Enter more characters to search",description:"At least 2 characters are needed to search products.",variant:"destructive",duration:5e3});return}e(R)},S=R=>{R.key==="Enter"&&_()};return jsxRuntime.jsxs("header",{className:"flex h-16 items-center gap-4 border-b sidebar-foreground bg-sidebar px-6 fixed top-0 right-0 z-50 lg:left-64 left-0 border-sidebar-border",children:[jsxRuntime.jsx(SidebarTrigger,{className:"lg:hidden",children:jsxRuntime.jsx(Menu$1,{className:"h-6 w-6"})}),jsxRuntime.jsx("div",{className:"flex flex-1 items-center gap-4",children:jsxRuntime.jsx("div",{className:"relative w-full max-w-sm",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("button",{type:"button",className:"absolute left-2 top-1/2 -translate-y-1/2",onClick:_,"aria-label":"Search",children:jsxRuntime.jsx(Search,{className:"h-4 w-4 text-muted-foreground"})}),jsxRuntime.jsx(Input,{placeholder:o??"Search...",className:"w-full pl-8 bg-white text-black",value:d,onChange:R=>f(R.target.value),onKeyDown:S,ref:l},"topbar-search")]})})}),n||jsxRuntime.jsx(jsxRuntime.Fragment,{}),t&&jsxRuntime.jsx("div",{className:"flex items-center gap-4",children:jsxRuntime.jsxs(Button,{variant:"ghost",size:"icon",className:"h-9 w-9",onClick:t,children:[jsxRuntime.jsx(LogOut,{className:"h-4 w-4 text-sidebar-foreground"}),jsxRuntime.jsx("span",{className:"sr-only",children:"Sign out"})]})})]})});Topbar.displayName="Topbar";function ActiveOrdersCard({orders:t,loading:e=!1}){const n=d=>new Intl.NumberFormat("en-CA",{style:"currency",currency:"CAD",minimumFractionDigits:2,maximumFractionDigits:2}).format(d),o=React.useMemo(()=>{if(!t||t.length===0)return{all:{orders:0,amount:0},processing:{orders:0,amount:0},shipped:{orders:0,amount:0},delayed:{orders:0,amount:0}};const d=t.filter(j=>j.DocumentType==="Order"),f=t.filter(j=>j.DocumentType==="Shipment"),g=d.filter(j=>j.WarehouseCode!=="3PLE"),b=g.reduce((j,q)=>j+(q.Quantity||0),0),_=g.reduce((j,q)=>j+(q.ExtendedPrice||0),0),S=d.filter(j=>j.WarehouseCode==="3PLE"),R=S.reduce((j,q)=>j+(q.Quantity||0),0),C=S.reduce((j,q)=>j+(q.ExtendedPrice||0),0),E=f.length,A=f.reduce((j,q)=>j+(q.ExtendedPrice||0),0),I=b+R+E,M=_+C+A;return{all:{orders:I,amount:M},processing:{orders:b,amount:_},shipped:{orders:E,amount:A},delayed:{orders:R,amount:C}}},[t]),l=[{name:"All",icon:Package,color:"bg-blue-500",textColor:"text-blue-600",orders:o.all.orders,amount:o.all.amount},{name:"Processing",icon:RefreshCcw,color:"bg-yellow-500",textColor:"text-yellow-600",orders:o.processing.orders,amount:o.processing.amount},{name:"Shipped",icon:Truck,color:"bg-green-500",textColor:"text-green-600",orders:o.shipped.orders,amount:o.shipped.amount},{name:"Delayed",icon:CircleAlert,color:"bg-red-500",textColor:"text-red-600",orders:o.delayed.orders,amount:o.delayed.amount}];return e?jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{className:"pb-0",children:jsxRuntime.jsx(CardTitle,{className:"text-lg font-bold",children:"Active Orders"})}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 @sm:grid-cols-2 gap-4 p-4",children:[1,2,3,4].map(d=>jsxRuntime.jsxs("div",{className:"overflow-hidden rounded-md border",children:[jsxRuntime.jsx("div",{className:"bg-slate-200 dark:bg-slate-700 h-[3px]"}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-16 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-7 w-12"})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-16 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]})]})]})]},d))})]}):jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{className:"pb-0",children:jsxRuntime.jsx(CardTitle,{className:"text-lg font-bold",children:"Active Orders"})}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 @sm:grid-cols-2 gap-4 p-4",children:l.map(d=>jsxRuntime.jsxs("div",{className:"overflow-hidden rounded-md border",children:[jsxRuntime.jsx("div",{className:`${d.color} bg-opacity-60 h-[3px]`}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-base",children:d.name}),jsxRuntime.jsx("div",{className:`${d.color} bg-opacity-90 p-2 rounded-full`,children:jsxRuntime.jsx(d.icon,{className:"size-4 shrink-0 text-white"})})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Orders"}),jsxRuntime.jsx("p",{className:"text-xl font-bold",children:d.orders})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Amount"}),jsxRuntime.jsx("p",{className:"text-base font-semibold",children:n(d.amount)})]})]})]})]},d.name))})]})}var __create=Object.create,__getProtoOf=Object.getPrototypeOf,__defProp=Object.defineProperty,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__toESM=(t,e,n)=>{n=t!=null?__create(__getProtoOf(t)):{};const o=e||!t||!t.__esModule?__defProp(n,"default",{value:t,enumerable:!0}):n;for(let l of __getOwnPropNames(t))__hasOwnProp.call(o,l)||__defProp(o,l,{get:()=>t[l],enumerable:!0});return o},__commonJS=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),require_xhtml=__commonJS((t,e)=>{e.exports={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}}),require_acorn=__commonJS((t,e)=>{(function(n,o){typeof t=="object"&&typeof e<"u"?o(t):typeof define=="function"&&define.amd?define(["exports"],o):(n=typeof globalThis<"u"?globalThis:n||self,o(n.acorn={}))})(t,function(n){var o=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],l=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],d="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",f="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",g={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},b="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",_={5:b,"5module":b+" export import",6:b+" const class extends export import super"},S=/^in(stanceof)?$/,R=new RegExp("["+f+"]"),C=new RegExp("["+f+d+"]");function E(V,se){for(var Oe=65536,Be=0;Be<se.length;Be+=2){if(Oe+=se[Be],Oe>V)return!1;if(Oe+=se[Be+1],Oe>=V)return!0}return!1}function A(V,se){return V<65?V===36:V<91?!0:V<97?V===95:V<123?!0:V<=65535?V>=170&&R.test(String.fromCharCode(V)):se===!1?!1:E(V,l)}function I(V,se){return V<48?V===36:V<58?!0:V<65?!1:V<91?!0:V<97?V===95:V<123?!0:V<=65535?V>=170&&C.test(String.fromCharCode(V)):se===!1?!1:E(V,l)||E(V,o)}var M=function(se,Oe){Oe===void 0&&(Oe={}),this.label=se,this.keyword=Oe.keyword,this.beforeExpr=!!Oe.beforeExpr,this.startsExpr=!!Oe.startsExpr,this.isLoop=!!Oe.isLoop,this.isAssign=!!Oe.isAssign,this.prefix=!!Oe.prefix,this.postfix=!!Oe.postfix,this.binop=Oe.binop||null,this.updateContext=null};function j(V,se){return new M(V,{beforeExpr:!0,binop:se})}var q={beforeExpr:!0},z={startsExpr:!0},Q={};function F(V,se){return se===void 0&&(se={}),se.keyword=V,Q[V]=new M(V,se)}var O={num:new M("num",z),regexp:new M("regexp",z),string:new M("string",z),name:new M("name",z),privateId:new M("privateId",z),eof:new M("eof"),bracketL:new M("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new M("]"),braceL:new M("{",{beforeExpr:!0,startsExpr:!0}),braceR:new M("}"),parenL:new M("(",{beforeExpr:!0,startsExpr:!0}),parenR:new M(")"),comma:new M(",",q),semi:new M(";",q),colon:new M(":",q),dot:new M("."),question:new M("?",q),questionDot:new M("?."),arrow:new M("=>",q),template:new M("template"),invalidTemplate:new M("invalidTemplate"),ellipsis:new M("...",q),backQuote:new M("`",z),dollarBraceL:new M("${",{beforeExpr:!0,startsExpr:!0}),eq:new M("=",{beforeExpr:!0,isAssign:!0}),assign:new M("_=",{beforeExpr:!0,isAssign:!0}),incDec:new M("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new M("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:j("||",1),logicalAND:j("&&",2),bitwiseOR:j("|",3),bitwiseXOR:j("^",4),bitwiseAND:j("&",5),equality:j("==/!=/===/!==",6),relational:j("</>/<=/>=",7),bitShift:j("<</>>/>>>",8),plusMin:new M("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:j("%",10),star:j("*",10),slash:j("/",10),starstar:new M("**",{beforeExpr:!0}),coalesce:j("??",1),_break:F("break"),_case:F("case",q),_catch:F("catch"),_continue:F("continue"),_debugger:F("debugger"),_default:F("default",q),_do:F("do",{isLoop:!0,beforeExpr:!0}),_else:F("else",q),_finally:F("finally"),_for:F("for",{isLoop:!0}),_function:F("function",z),_if:F("if"),_return:F("return",q),_switch:F("switch"),_throw:F("throw",q),_try:F("try"),_var:F("var"),_const:F("const"),_while:F("while",{isLoop:!0}),_with:F("with"),_new:F("new",{beforeExpr:!0,startsExpr:!0}),_this:F("this",z),_super:F("super",z),_class:F("class",z),_extends:F("extends",q),_export:F("export"),_import:F("import",z),_null:F("null",z),_true:F("true",z),_false:F("false",z),_in:F("in",{beforeExpr:!0,binop:7}),_instanceof:F("instanceof",{beforeExpr:!0,binop:7}),_typeof:F("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:F("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:F("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},te=/\r\n?|\n|\u2028|\u2029/,ne=new RegExp(te.source,"g");function ae(V){return V===10||V===13||V===8232||V===8233}function ge(V,se,Oe){Oe===void 0&&(Oe=V.length);for(var Be=se;Be<Oe;Be++){var Ge=V.charCodeAt(Be);if(ae(Ge))return Be<Oe-1&&Ge===13&&V.charCodeAt(Be+1)===10?Be+2:Be+1}return-1}var oe=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Ae=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Ne=Object.prototype,je=Ne.hasOwnProperty,$e=Ne.toString,Le=Object.hasOwn||function(V,se){return je.call(V,se)},ze=Array.isArray||function(V){return $e.call(V)==="[object Array]"},Ve=Object.create(null);function Fe(V){return Ve[V]||(Ve[V]=new RegExp("^(?:"+V.replace(/ /g,"|")+")$"))}function qe(V){return V<=65535?String.fromCharCode(V):(V-=65536,String.fromCharCode((V>>10)+55296,(V&1023)+56320))}var Ke=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,He=function(se,Oe){this.line=se,this.column=Oe};He.prototype.offset=function(se){return new He(this.line,this.column+se)};var Xe=function(se,Oe,Be){this.start=Oe,this.end=Be,se.sourceFile!==null&&(this.source=se.sourceFile)};function tt(V,se){for(var Oe=1,Be=0;;){var Ge=ge(V,Be,se);if(Ge<0)return new He(Oe,se-Be);++Oe,Be=Ge}}var Ye={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},et=!1;function Ze(V){var se={};for(var Oe in Ye)se[Oe]=V&&Le(V,Oe)?V[Oe]:Ye[Oe];if(se.ecmaVersion==="latest"?se.ecmaVersion=1e8:se.ecmaVersion==null?(!et&&typeof console=="object"&&console.warn&&(et=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
1047
1047
  Defaulting to 2020, but this will stop working in the future.`)),se.ecmaVersion=11):se.ecmaVersion>=2015&&(se.ecmaVersion-=2009),se.allowReserved==null&&(se.allowReserved=se.ecmaVersion<5),(!V||V.allowHashBang==null)&&(se.allowHashBang=se.ecmaVersion>=14),ze(se.onToken)){var Be=se.onToken;se.onToken=function(Ge){return Be.push(Ge)}}return ze(se.onComment)&&(se.onComment=at(se,se.onComment)),se}function at(V,se){return function(Oe,Be,Ge,ot,lt,Ct){var It={type:Oe?"Block":"Line",value:Be,start:Ge,end:ot};V.locations&&(It.loc=new Xe(this,lt,Ct)),V.ranges&&(It.range=[Ge,ot]),se.push(It)}}var rt=1,it=2,st=4,Ue=8,Rt=16,Je=32,mt=64,$t=128,Dt=256,Ht=rt|it|Dt;function Vt(V,se){return it|(V?st:0)|(se?Ue:0)}var We=0,nt=1,Qe=2,dt=3,pt=4,ft=5,ct=function(se,Oe,Be){this.options=se=Ze(se),this.sourceFile=se.sourceFile,this.keywords=Fe(_[se.ecmaVersion>=6?6:se.sourceType==="module"?"5module":5]);var Ge="";se.allowReserved!==!0&&(Ge=g[se.ecmaVersion>=6?6:se.ecmaVersion===5?5:3],se.sourceType==="module"&&(Ge+=" await")),this.reservedWords=Fe(Ge);var ot=(Ge?Ge+" ":"")+g.strict;this.reservedWordsStrict=Fe(ot),this.reservedWordsStrictBind=Fe(ot+" "+g.strictBind),this.input=String(Oe),this.containsEsc=!1,Be?(this.pos=Be,this.lineStart=this.input.lastIndexOf(`
1048
1048
  `,Be-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(te).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=O.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=se.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&se.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(rt),this.regexpState=null,this.privateNameStack=[]},qt={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};ct.prototype.parse=function(){var se=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(se)},qt.inFunction.get=function(){return(this.currentVarScope().flags&it)>0},qt.inGenerator.get=function(){return(this.currentVarScope().flags&Ue)>0&&!this.currentVarScope().inClassFieldInit},qt.inAsync.get=function(){return(this.currentVarScope().flags&st)>0&&!this.currentVarScope().inClassFieldInit},qt.canAwait.get=function(){for(var V=this.scopeStack.length-1;V>=0;V--){var se=this.scopeStack[V];if(se.inClassFieldInit||se.flags&Dt)return!1;if(se.flags&it)return(se.flags&st)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},qt.allowSuper.get=function(){var V=this.currentThisScope(),se=V.flags,Oe=V.inClassFieldInit;return(se&mt)>0||Oe||this.options.allowSuperOutsideMethod},qt.allowDirectSuper.get=function(){return(this.currentThisScope().flags&$t)>0},qt.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},qt.allowNewDotTarget.get=function(){var V=this.currentThisScope(),se=V.flags,Oe=V.inClassFieldInit;return(se&(it|Dt))>0||Oe},qt.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Dt)>0},ct.extend=function(){for(var se=[],Oe=arguments.length;Oe--;)se[Oe]=arguments[Oe];for(var Be=this,Ge=0;Ge<se.length;Ge++)Be=se[Ge](Be);return Be},ct.parse=function(se,Oe){return new this(Oe,se).parse()},ct.parseExpressionAt=function(se,Oe,Be){var Ge=new this(Be,se,Oe);return Ge.nextToken(),Ge.parseExpression()},ct.tokenizer=function(se,Oe){return new this(Oe,se)},Object.defineProperties(ct.prototype,qt);var ut=ct.prototype,Mt=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;ut.strictDirective=function(V){if(this.options.ecmaVersion<5)return!1;for(;;){Ae.lastIndex=V,V+=Ae.exec(this.input)[0].length;var se=Mt.exec(this.input.slice(V));if(!se)return!1;if((se[1]||se[2])==="use strict"){Ae.lastIndex=V+se[0].length;var Oe=Ae.exec(this.input),Be=Oe.index+Oe[0].length,Ge=this.input.charAt(Be);return Ge===";"||Ge==="}"||te.test(Oe[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(Ge)||Ge==="!"&&this.input.charAt(Be+1)==="=")}V+=se[0].length,Ae.lastIndex=V,V+=Ae.exec(this.input)[0].length,this.input[V]===";"&&V++}},ut.eat=function(V){return this.type===V?(this.next(),!0):!1},ut.isContextual=function(V){return this.type===O.name&&this.value===V&&!this.containsEsc},ut.eatContextual=function(V){return this.isContextual(V)?(this.next(),!0):!1},ut.expectContextual=function(V){this.eatContextual(V)||this.unexpected()},ut.canInsertSemicolon=function(){return this.type===O.eof||this.type===O.braceR||te.test(this.input.slice(this.lastTokEnd,this.start))},ut.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},ut.semicolon=function(){!this.eat(O.semi)&&!this.insertSemicolon()&&this.unexpected()},ut.afterTrailingComma=function(V,se){if(this.type===V)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),se||this.next(),!0},ut.expect=function(V){this.eat(V)||this.unexpected()},ut.unexpected=function(V){this.raise(V??this.start,"Unexpected token")};var Ut=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};ut.checkPatternErrors=function(V,se){if(V){V.trailingComma>-1&&this.raiseRecoverable(V.trailingComma,"Comma is not permitted after the rest element");var Oe=se?V.parenthesizedAssign:V.parenthesizedBind;Oe>-1&&this.raiseRecoverable(Oe,se?"Assigning to rvalue":"Parenthesized pattern")}},ut.checkExpressionErrors=function(V,se){if(!V)return!1;var Oe=V.shorthandAssign,Be=V.doubleProto;if(!se)return Oe>=0||Be>=0;Oe>=0&&this.raise(Oe,"Shorthand property assignments are valid only in destructuring patterns"),Be>=0&&this.raiseRecoverable(Be,"Redefinition of __proto__ property")},ut.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},ut.isSimpleAssignTarget=function(V){return V.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(V.expression):V.type==="Identifier"||V.type==="MemberExpression"};var yt=ct.prototype;yt.parseTopLevel=function(V){var se=Object.create(null);for(V.body||(V.body=[]);this.type!==O.eof;){var Oe=this.parseStatement(null,!0,se);V.body.push(Oe)}if(this.inModule)for(var Be=0,Ge=Object.keys(this.undefinedExports);Be<Ge.length;Be+=1){var ot=Ge[Be];this.raiseRecoverable(this.undefinedExports[ot].start,"Export '"+ot+"' is not defined")}return this.adaptDirectivePrologue(V.body),this.next(),V.sourceType=this.options.sourceType,this.finishNode(V,"Program")};var nr={kind:"loop"},er={kind:"switch"};yt.isLet=function(V){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;Ae.lastIndex=this.pos;var se=Ae.exec(this.input),Oe=this.pos+se[0].length,Be=this.input.charCodeAt(Oe);if(Be===91||Be===92)return!0;if(V)return!1;if(Be===123||Be>55295&&Be<56320)return!0;if(A(Be,!0)){for(var Ge=Oe+1;I(Be=this.input.charCodeAt(Ge),!0);)++Ge;if(Be===92||Be>55295&&Be<56320)return!0;var ot=this.input.slice(Oe,Ge);if(!S.test(ot))return!0}return!1},yt.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Ae.lastIndex=this.pos;var V=Ae.exec(this.input),se=this.pos+V[0].length,Oe;return!te.test(this.input.slice(this.pos,se))&&this.input.slice(se,se+8)==="function"&&(se+8===this.input.length||!(I(Oe=this.input.charCodeAt(se+8))||Oe>55295&&Oe<56320))},yt.parseStatement=function(V,se,Oe){var Be=this.type,Ge=this.startNode(),ot;switch(this.isLet(V)&&(Be=O._var,ot="let"),Be){case O._break:case O._continue:return this.parseBreakContinueStatement(Ge,Be.keyword);case O._debugger:return this.parseDebuggerStatement(Ge);case O._do:return this.parseDoStatement(Ge);case O._for:return this.parseForStatement(Ge);case O._function:return V&&(this.strict||V!=="if"&&V!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(Ge,!1,!V);case O._class:return V&&this.unexpected(),this.parseClass(Ge,!0);case O._if:return this.parseIfStatement(Ge);case O._return:return this.parseReturnStatement(Ge);case O._switch:return this.parseSwitchStatement(Ge);case O._throw:return this.parseThrowStatement(Ge);case O._try:return this.parseTryStatement(Ge);case O._const:case O._var:return ot=ot||this.value,V&&ot!=="var"&&this.unexpected(),this.parseVarStatement(Ge,ot);case O._while:return this.parseWhileStatement(Ge);case O._with:return this.parseWithStatement(Ge);case O.braceL:return this.parseBlock(!0,Ge);case O.semi:return this.parseEmptyStatement(Ge);case O._export:case O._import:if(this.options.ecmaVersion>10&&Be===O._import){Ae.lastIndex=this.pos;var lt=Ae.exec(this.input),Ct=this.pos+lt[0].length,It=this.input.charCodeAt(Ct);if(It===40||It===46)return this.parseExpressionStatement(Ge,this.parseExpression())}return this.options.allowImportExportEverywhere||(se||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),Be===O._import?this.parseImport(Ge):this.parseExport(Ge,Oe);default:if(this.isAsyncFunction())return V&&this.unexpected(),this.next(),this.parseFunctionStatement(Ge,!0,!V);var Kt=this.value,Wt=this.parseExpression();return Be===O.name&&Wt.type==="Identifier"&&this.eat(O.colon)?this.parseLabeledStatement(Ge,Kt,Wt,V):this.parseExpressionStatement(Ge,Wt)}},yt.parseBreakContinueStatement=function(V,se){var Oe=se==="break";this.next(),this.eat(O.semi)||this.insertSemicolon()?V.label=null:this.type!==O.name?this.unexpected():(V.label=this.parseIdent(),this.semicolon());for(var Be=0;Be<this.labels.length;++Be){var Ge=this.labels[Be];if((V.label==null||Ge.name===V.label.name)&&(Ge.kind!=null&&(Oe||Ge.kind==="loop")||V.label&&Oe))break}return Be===this.labels.length&&this.raise(V.start,"Unsyntactic "+se),this.finishNode(V,Oe?"BreakStatement":"ContinueStatement")},yt.parseDebuggerStatement=function(V){return this.next(),this.semicolon(),this.finishNode(V,"DebuggerStatement")},yt.parseDoStatement=function(V){return this.next(),this.labels.push(nr),V.body=this.parseStatement("do"),this.labels.pop(),this.expect(O._while),V.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(O.semi):this.semicolon(),this.finishNode(V,"DoWhileStatement")},yt.parseForStatement=function(V){this.next();var se=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(nr),this.enterScope(0),this.expect(O.parenL),this.type===O.semi)return se>-1&&this.unexpected(se),this.parseFor(V,null);var Oe=this.isLet();if(this.type===O._var||this.type===O._const||Oe){var Be=this.startNode(),Ge=Oe?"let":this.value;return this.next(),this.parseVar(Be,!0,Ge),this.finishNode(Be,"VariableDeclaration"),(this.type===O._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&Be.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===O._in?se>-1&&this.unexpected(se):V.await=se>-1),this.parseForIn(V,Be)):(se>-1&&this.unexpected(se),this.parseFor(V,Be))}var ot=this.isContextual("let"),lt=!1,Ct=this.containsEsc,It=new Ut,Kt=this.start,Wt=se>-1?this.parseExprSubscripts(It,"await"):this.parseExpression(!0,It);return this.type===O._in||(lt=this.options.ecmaVersion>=6&&this.isContextual("of"))?(se>-1?(this.type===O._in&&this.unexpected(se),V.await=!0):lt&&this.options.ecmaVersion>=8&&(Wt.start===Kt&&!Ct&&Wt.type==="Identifier"&&Wt.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(V.await=!1)),ot&&lt&&this.raise(Wt.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(Wt,!1,It),this.checkLValPattern(Wt),this.parseForIn(V,Wt)):(this.checkExpressionErrors(It,!0),se>-1&&this.unexpected(se),this.parseFor(V,Wt))},yt.parseFunctionStatement=function(V,se,Oe){return this.next(),this.parseFunction(V,cr|(Oe?0:vr),!1,se)},yt.parseIfStatement=function(V){return this.next(),V.test=this.parseParenExpression(),V.consequent=this.parseStatement("if"),V.alternate=this.eat(O._else)?this.parseStatement("if"):null,this.finishNode(V,"IfStatement")},yt.parseReturnStatement=function(V){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(O.semi)||this.insertSemicolon()?V.argument=null:(V.argument=this.parseExpression(),this.semicolon()),this.finishNode(V,"ReturnStatement")},yt.parseSwitchStatement=function(V){this.next(),V.discriminant=this.parseParenExpression(),V.cases=[],this.expect(O.braceL),this.labels.push(er),this.enterScope(0);for(var se,Oe=!1;this.type!==O.braceR;)if(this.type===O._case||this.type===O._default){var Be=this.type===O._case;se&&this.finishNode(se,"SwitchCase"),V.cases.push(se=this.startNode()),se.consequent=[],this.next(),Be?se.test=this.parseExpression():(Oe&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),Oe=!0,se.test=null),this.expect(O.colon)}else se||this.unexpected(),se.consequent.push(this.parseStatement(null));return this.exitScope(),se&&this.finishNode(se,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(V,"SwitchStatement")},yt.parseThrowStatement=function(V){return this.next(),te.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),V.argument=this.parseExpression(),this.semicolon(),this.finishNode(V,"ThrowStatement")};var lr=[];yt.parseCatchClauseParam=function(){var V=this.parseBindingAtom(),se=V.type==="Identifier";return this.enterScope(se?Je:0),this.checkLValPattern(V,se?pt:Qe),this.expect(O.parenR),V},yt.parseTryStatement=function(V){if(this.next(),V.block=this.parseBlock(),V.handler=null,this.type===O._catch){var se=this.startNode();this.next(),this.eat(O.parenL)?se.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),se.param=null,this.enterScope(0)),se.body=this.parseBlock(!1),this.exitScope(),V.handler=this.finishNode(se,"CatchClause")}return V.finalizer=this.eat(O._finally)?this.parseBlock():null,!V.handler&&!V.finalizer&&this.raise(V.start,"Missing catch or finally clause"),this.finishNode(V,"TryStatement")},yt.parseVarStatement=function(V,se,Oe){return this.next(),this.parseVar(V,!1,se,Oe),this.semicolon(),this.finishNode(V,"VariableDeclaration")},yt.parseWhileStatement=function(V){return this.next(),V.test=this.parseParenExpression(),this.labels.push(nr),V.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(V,"WhileStatement")},yt.parseWithStatement=function(V){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),V.object=this.parseParenExpression(),V.body=this.parseStatement("with"),this.finishNode(V,"WithStatement")},yt.parseEmptyStatement=function(V){return this.next(),this.finishNode(V,"EmptyStatement")},yt.parseLabeledStatement=function(V,se,Oe,Be){for(var Ge=0,ot=this.labels;Ge<ot.length;Ge+=1){var lt=ot[Ge];lt.name===se&&this.raise(Oe.start,"Label '"+se+"' is already declared")}for(var Ct=this.type.isLoop?"loop":this.type===O._switch?"switch":null,It=this.labels.length-1;It>=0;It--){var Kt=this.labels[It];if(Kt.statementStart===V.start)Kt.statementStart=this.start,Kt.kind=Ct;else break}return this.labels.push({name:se,kind:Ct,statementStart:this.start}),V.body=this.parseStatement(Be?Be.indexOf("label")===-1?Be+"label":Be:"label"),this.labels.pop(),V.label=Oe,this.finishNode(V,"LabeledStatement")},yt.parseExpressionStatement=function(V,se){return V.expression=se,this.semicolon(),this.finishNode(V,"ExpressionStatement")},yt.parseBlock=function(V,se,Oe){for(V===void 0&&(V=!0),se===void 0&&(se=this.startNode()),se.body=[],this.expect(O.braceL),V&&this.enterScope(0);this.type!==O.braceR;){var Be=this.parseStatement(null);se.body.push(Be)}return Oe&&(this.strict=!1),this.next(),V&&this.exitScope(),this.finishNode(se,"BlockStatement")},yt.parseFor=function(V,se){return V.init=se,this.expect(O.semi),V.test=this.type===O.semi?null:this.parseExpression(),this.expect(O.semi),V.update=this.type===O.parenR?null:this.parseExpression(),this.expect(O.parenR),V.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(V,"ForStatement")},yt.parseForIn=function(V,se){var Oe=this.type===O._in;return this.next(),se.type==="VariableDeclaration"&&se.declarations[0].init!=null&&(!Oe||this.options.ecmaVersion<8||this.strict||se.kind!=="var"||se.declarations[0].id.type!=="Identifier")&&this.raise(se.start,(Oe?"for-in":"for-of")+" loop variable declaration may not have an initializer"),V.left=se,V.right=Oe?this.parseExpression():this.parseMaybeAssign(),this.expect(O.parenR),V.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(V,Oe?"ForInStatement":"ForOfStatement")},yt.parseVar=function(V,se,Oe,Be){for(V.declarations=[],V.kind=Oe;;){var Ge=this.startNode();if(this.parseVarId(Ge,Oe),this.eat(O.eq)?Ge.init=this.parseMaybeAssign(se):!Be&&Oe==="const"&&!(this.type===O._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!Be&&Ge.id.type!=="Identifier"&&!(se&&(this.type===O._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):Ge.init=null,V.declarations.push(this.finishNode(Ge,"VariableDeclarator")),!this.eat(O.comma))break}return V},yt.parseVarId=function(V,se){V.id=this.parseBindingAtom(),this.checkLValPattern(V.id,se==="var"?nt:Qe,!1)};var cr=1,vr=2,Ir=4;yt.parseFunction=function(V,se,Oe,Be,Ge){this.initFunction(V),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!Be)&&(this.type===O.star&&se&vr&&this.unexpected(),V.generator=this.eat(O.star)),this.options.ecmaVersion>=8&&(V.async=!!Be),se&cr&&(V.id=se&Ir&&this.type!==O.name?null:this.parseIdent(),V.id&&!(se&vr)&&this.checkLValSimple(V.id,this.strict||V.generator||V.async?this.treatFunctionsAsVar?nt:Qe:dt));var ot=this.yieldPos,lt=this.awaitPos,Ct=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Vt(V.async,V.generator)),se&cr||(V.id=this.type===O.name?this.parseIdent():null),this.parseFunctionParams(V),this.parseFunctionBody(V,Oe,!1,Ge),this.yieldPos=ot,this.awaitPos=lt,this.awaitIdentPos=Ct,this.finishNode(V,se&cr?"FunctionDeclaration":"FunctionExpression")},yt.parseFunctionParams=function(V){this.expect(O.parenL),V.params=this.parseBindingList(O.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},yt.parseClass=function(V,se){this.next();var Oe=this.strict;this.strict=!0,this.parseClassId(V,se),this.parseClassSuper(V);var Be=this.enterClassBody(),Ge=this.startNode(),ot=!1;for(Ge.body=[],this.expect(O.braceL);this.type!==O.braceR;){var lt=this.parseClassElement(V.superClass!==null);lt&&(Ge.body.push(lt),lt.type==="MethodDefinition"&&lt.kind==="constructor"?(ot&&this.raiseRecoverable(lt.start,"Duplicate constructor in the same class"),ot=!0):lt.key&&lt.key.type==="PrivateIdentifier"&&Nr(Be,lt)&&this.raiseRecoverable(lt.key.start,"Identifier '#"+lt.key.name+"' has already been declared"))}return this.strict=Oe,this.next(),V.body=this.finishNode(Ge,"ClassBody"),this.exitClassBody(),this.finishNode(V,se?"ClassDeclaration":"ClassExpression")},yt.parseClassElement=function(V){if(this.eat(O.semi))return null;var se=this.options.ecmaVersion,Oe=this.startNode(),Be="",Ge=!1,ot=!1,lt="method",Ct=!1;if(this.eatContextual("static")){if(se>=13&&this.eat(O.braceL))return this.parseClassStaticBlock(Oe),Oe;this.isClassElementNameStart()||this.type===O.star?Ct=!0:Be="static"}if(Oe.static=Ct,!Be&&se>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===O.star)&&!this.canInsertSemicolon()?ot=!0:Be="async"),!Be&&(se>=9||!ot)&&this.eat(O.star)&&(Ge=!0),!Be&&!ot&&!Ge){var It=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?lt=It:Be=It)}if(Be?(Oe.computed=!1,Oe.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),Oe.key.name=Be,this.finishNode(Oe.key,"Identifier")):this.parseClassElementName(Oe),se<13||this.type===O.parenL||lt!=="method"||Ge||ot){var Kt=!Oe.static&&Mr(Oe,"constructor"),Wt=Kt&&V;Kt&&lt!=="method"&&this.raise(Oe.key.start,"Constructor can't have get/set modifier"),Oe.kind=Kt?"constructor":lt,this.parseClassMethod(Oe,Ge,ot,Wt)}else this.parseClassField(Oe);return Oe},yt.isClassElementNameStart=function(){return this.type===O.name||this.type===O.privateId||this.type===O.num||this.type===O.string||this.type===O.bracketL||this.type.keyword},yt.parseClassElementName=function(V){this.type===O.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),V.computed=!1,V.key=this.parsePrivateIdent()):this.parsePropertyName(V)},yt.parseClassMethod=function(V,se,Oe,Be){var Ge=V.key;V.kind==="constructor"?(se&&this.raise(Ge.start,"Constructor can't be a generator"),Oe&&this.raise(Ge.start,"Constructor can't be an async method")):V.static&&Mr(V,"prototype")&&this.raise(Ge.start,"Classes may not have a static property named prototype");var ot=V.value=this.parseMethod(se,Oe,Be);return V.kind==="get"&&ot.params.length!==0&&this.raiseRecoverable(ot.start,"getter should have no params"),V.kind==="set"&&ot.params.length!==1&&this.raiseRecoverable(ot.start,"setter should have exactly one param"),V.kind==="set"&&ot.params[0].type==="RestElement"&&this.raiseRecoverable(ot.params[0].start,"Setter cannot use rest params"),this.finishNode(V,"MethodDefinition")},yt.parseClassField=function(V){if(Mr(V,"constructor")?this.raise(V.key.start,"Classes can't have a field named 'constructor'"):V.static&&Mr(V,"prototype")&&this.raise(V.key.start,"Classes can't have a static field named 'prototype'"),this.eat(O.eq)){var se=this.currentThisScope(),Oe=se.inClassFieldInit;se.inClassFieldInit=!0,V.value=this.parseMaybeAssign(),se.inClassFieldInit=Oe}else V.value=null;return this.semicolon(),this.finishNode(V,"PropertyDefinition")},yt.parseClassStaticBlock=function(V){V.body=[];var se=this.labels;for(this.labels=[],this.enterScope(Dt|mt);this.type!==O.braceR;){var Oe=this.parseStatement(null);V.body.push(Oe)}return this.next(),this.exitScope(),this.labels=se,this.finishNode(V,"StaticBlock")},yt.parseClassId=function(V,se){this.type===O.name?(V.id=this.parseIdent(),se&&this.checkLValSimple(V.id,Qe,!1)):(se===!0&&this.unexpected(),V.id=null)},yt.parseClassSuper=function(V){V.superClass=this.eat(O._extends)?this.parseExprSubscripts(null,!1):null},yt.enterClassBody=function(){var V={declared:Object.create(null),used:[]};return this.privateNameStack.push(V),V.declared},yt.exitClassBody=function(){var V=this.privateNameStack.pop(),se=V.declared,Oe=V.used;if(this.options.checkPrivateFields)for(var Be=this.privateNameStack.length,Ge=Be===0?null:this.privateNameStack[Be-1],ot=0;ot<Oe.length;++ot){var lt=Oe[ot];Le(se,lt.name)||(Ge?Ge.used.push(lt):this.raiseRecoverable(lt.start,"Private field '#"+lt.name+"' must be declared in an enclosing class"))}};function Nr(V,se){var Oe=se.key.name,Be=V[Oe],Ge="true";return se.type==="MethodDefinition"&&(se.kind==="get"||se.kind==="set")&&(Ge=(se.static?"s":"i")+se.kind),Be==="iget"&&Ge==="iset"||Be==="iset"&&Ge==="iget"||Be==="sget"&&Ge==="sset"||Be==="sset"&&Ge==="sget"?(V[Oe]="true",!1):Be?!0:(V[Oe]=Ge,!1)}function Mr(V,se){var Oe=V.computed,Be=V.key;return!Oe&&(Be.type==="Identifier"&&Be.name===se||Be.type==="Literal"&&Be.value===se)}yt.parseExportAllDeclaration=function(V,se){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(V.exported=this.parseModuleExportName(),this.checkExport(se,V.exported,this.lastTokStart)):V.exported=null),this.expectContextual("from"),this.type!==O.string&&this.unexpected(),V.source=this.parseExprAtom(),this.semicolon(),this.finishNode(V,"ExportAllDeclaration")},yt.parseExport=function(V,se){if(this.next(),this.eat(O.star))return this.parseExportAllDeclaration(V,se);if(this.eat(O._default))return this.checkExport(se,"default",this.lastTokStart),V.declaration=this.parseExportDefaultDeclaration(),this.finishNode(V,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())V.declaration=this.parseExportDeclaration(V),V.declaration.type==="VariableDeclaration"?this.checkVariableExport(se,V.declaration.declarations):this.checkExport(se,V.declaration.id,V.declaration.id.start),V.specifiers=[],V.source=null;else{if(V.declaration=null,V.specifiers=this.parseExportSpecifiers(se),this.eatContextual("from"))this.type!==O.string&&this.unexpected(),V.source=this.parseExprAtom();else{for(var Oe=0,Be=V.specifiers;Oe<Be.length;Oe+=1){var Ge=Be[Oe];this.checkUnreserved(Ge.local),this.checkLocalExport(Ge.local),Ge.local.type==="Literal"&&this.raise(Ge.local.start,"A string literal cannot be used as an exported binding without `from`.")}V.source=null}this.semicolon()}return this.finishNode(V,"ExportNamedDeclaration")},yt.parseExportDeclaration=function(V){return this.parseStatement(null)},yt.parseExportDefaultDeclaration=function(){var V;if(this.type===O._function||(V=this.isAsyncFunction())){var se=this.startNode();return this.next(),V&&this.next(),this.parseFunction(se,cr|Ir,!1,V)}else if(this.type===O._class){var Oe=this.startNode();return this.parseClass(Oe,"nullableID")}else{var Be=this.parseMaybeAssign();return this.semicolon(),Be}},yt.checkExport=function(V,se,Oe){V&&(typeof se!="string"&&(se=se.type==="Identifier"?se.name:se.value),Le(V,se)&&this.raiseRecoverable(Oe,"Duplicate export '"+se+"'"),V[se]=!0)},yt.checkPatternExport=function(V,se){var Oe=se.type;if(Oe==="Identifier")this.checkExport(V,se,se.start);else if(Oe==="ObjectPattern")for(var Be=0,Ge=se.properties;Be<Ge.length;Be+=1){var ot=Ge[Be];this.checkPatternExport(V,ot)}else if(Oe==="ArrayPattern")for(var lt=0,Ct=se.elements;lt<Ct.length;lt+=1){var It=Ct[lt];It&&this.checkPatternExport(V,It)}else Oe==="Property"?this.checkPatternExport(V,se.value):Oe==="AssignmentPattern"?this.checkPatternExport(V,se.left):Oe==="RestElement"&&this.checkPatternExport(V,se.argument)},yt.checkVariableExport=function(V,se){if(V)for(var Oe=0,Be=se;Oe<Be.length;Oe+=1){var Ge=Be[Oe];this.checkPatternExport(V,Ge.id)}},yt.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()},yt.parseExportSpecifier=function(V){var se=this.startNode();return se.local=this.parseModuleExportName(),se.exported=this.eatContextual("as")?this.parseModuleExportName():se.local,this.checkExport(V,se.exported,se.exported.start),this.finishNode(se,"ExportSpecifier")},yt.parseExportSpecifiers=function(V){var se=[],Oe=!0;for(this.expect(O.braceL);!this.eat(O.braceR);){if(Oe)Oe=!1;else if(this.expect(O.comma),this.afterTrailingComma(O.braceR))break;se.push(this.parseExportSpecifier(V))}return se},yt.parseImport=function(V){return this.next(),this.type===O.string?(V.specifiers=lr,V.source=this.parseExprAtom()):(V.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),V.source=this.type===O.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(V,"ImportDeclaration")},yt.parseImportSpecifier=function(){var V=this.startNode();return V.imported=this.parseModuleExportName(),this.eatContextual("as")?V.local=this.parseIdent():(this.checkUnreserved(V.imported),V.local=V.imported),this.checkLValSimple(V.local,Qe),this.finishNode(V,"ImportSpecifier")},yt.parseImportDefaultSpecifier=function(){var V=this.startNode();return V.local=this.parseIdent(),this.checkLValSimple(V.local,Qe),this.finishNode(V,"ImportDefaultSpecifier")},yt.parseImportNamespaceSpecifier=function(){var V=this.startNode();return this.next(),this.expectContextual("as"),V.local=this.parseIdent(),this.checkLValSimple(V.local,Qe),this.finishNode(V,"ImportNamespaceSpecifier")},yt.parseImportSpecifiers=function(){var V=[],se=!0;if(this.type===O.name&&(V.push(this.parseImportDefaultSpecifier()),!this.eat(O.comma)))return V;if(this.type===O.star)return V.push(this.parseImportNamespaceSpecifier()),V;for(this.expect(O.braceL);!this.eat(O.braceR);){if(se)se=!1;else if(this.expect(O.comma),this.afterTrailingComma(O.braceR))break;V.push(this.parseImportSpecifier())}return V},yt.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===O.string){var V=this.parseLiteral(this.value);return Ke.test(V.value)&&this.raise(V.start,"An export name cannot include a lone surrogate."),V}return this.parseIdent(!0)},yt.adaptDirectivePrologue=function(V){for(var se=0;se<V.length&&this.isDirectiveCandidate(V[se]);++se)V[se].directive=V[se].expression.raw.slice(1,-1)},yt.isDirectiveCandidate=function(V){return this.options.ecmaVersion>=5&&V.type==="ExpressionStatement"&&V.expression.type==="Literal"&&typeof V.expression.value=="string"&&(this.input[V.start]==='"'||this.input[V.start]==="'")};var ar=ct.prototype;ar.toAssignable=function(V,se,Oe){if(this.options.ecmaVersion>=6&&V)switch(V.type){case"Identifier":this.inAsync&&V.name==="await"&&this.raise(V.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":V.type="ObjectPattern",Oe&&this.checkPatternErrors(Oe,!0);for(var Be=0,Ge=V.properties;Be<Ge.length;Be+=1){var ot=Ge[Be];this.toAssignable(ot,se),ot.type==="RestElement"&&(ot.argument.type==="ArrayPattern"||ot.argument.type==="ObjectPattern")&&this.raise(ot.argument.start,"Unexpected token")}break;case"Property":V.kind!=="init"&&this.raise(V.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(V.value,se);break;case"ArrayExpression":V.type="ArrayPattern",Oe&&this.checkPatternErrors(Oe,!0),this.toAssignableList(V.elements,se);break;case"SpreadElement":V.type="RestElement",this.toAssignable(V.argument,se),V.argument.type==="AssignmentPattern"&&this.raise(V.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":V.operator!=="="&&this.raise(V.left.end,"Only '=' operator can be used for specifying default value."),V.type="AssignmentPattern",delete V.operator,this.toAssignable(V.left,se);break;case"ParenthesizedExpression":this.toAssignable(V.expression,se,Oe);break;case"ChainExpression":this.raiseRecoverable(V.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!se)break;default:this.raise(V.start,"Assigning to rvalue")}else Oe&&this.checkPatternErrors(Oe,!0);return V},ar.toAssignableList=function(V,se){for(var Oe=V.length,Be=0;Be<Oe;Be++){var Ge=V[Be];Ge&&this.toAssignable(Ge,se)}if(Oe){var ot=V[Oe-1];this.options.ecmaVersion===6&&se&&ot&&ot.type==="RestElement"&&ot.argument.type!=="Identifier"&&this.unexpected(ot.argument.start)}return V},ar.parseSpread=function(V){var se=this.startNode();return this.next(),se.argument=this.parseMaybeAssign(!1,V),this.finishNode(se,"SpreadElement")},ar.parseRestBinding=function(){var V=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==O.name&&this.unexpected(),V.argument=this.parseBindingAtom(),this.finishNode(V,"RestElement")},ar.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case O.bracketL:var V=this.startNode();return this.next(),V.elements=this.parseBindingList(O.bracketR,!0,!0),this.finishNode(V,"ArrayPattern");case O.braceL:return this.parseObj(!0)}return this.parseIdent()},ar.parseBindingList=function(V,se,Oe,Be){for(var Ge=[],ot=!0;!this.eat(V);)if(ot?ot=!1:this.expect(O.comma),se&&this.type===O.comma)Ge.push(null);else{if(Oe&&this.afterTrailingComma(V))break;if(this.type===O.ellipsis){var lt=this.parseRestBinding();this.parseBindingListItem(lt),Ge.push(lt),this.type===O.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(V);break}else Ge.push(this.parseAssignableListItem(Be))}return Ge},ar.parseAssignableListItem=function(V){var se=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(se),se},ar.parseBindingListItem=function(V){return V},ar.parseMaybeDefault=function(V,se,Oe){if(Oe=Oe||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(O.eq))return Oe;var Be=this.startNodeAt(V,se);return Be.left=Oe,Be.right=this.parseMaybeAssign(),this.finishNode(Be,"AssignmentPattern")},ar.checkLValSimple=function(V,se,Oe){se===void 0&&(se=We);var Be=se!==We;switch(V.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(V.name)&&this.raiseRecoverable(V.start,(Be?"Binding ":"Assigning to ")+V.name+" in strict mode"),Be&&(se===Qe&&V.name==="let"&&this.raiseRecoverable(V.start,"let is disallowed as a lexically bound name"),Oe&&(Le(Oe,V.name)&&this.raiseRecoverable(V.start,"Argument name clash"),Oe[V.name]=!0),se!==ft&&this.declareName(V.name,se,V.start));break;case"ChainExpression":this.raiseRecoverable(V.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":Be&&this.raiseRecoverable(V.start,"Binding member expression");break;case"ParenthesizedExpression":return Be&&this.raiseRecoverable(V.start,"Binding parenthesized expression"),this.checkLValSimple(V.expression,se,Oe);default:this.raise(V.start,(Be?"Binding":"Assigning to")+" rvalue")}},ar.checkLValPattern=function(V,se,Oe){switch(se===void 0&&(se=We),V.type){case"ObjectPattern":for(var Be=0,Ge=V.properties;Be<Ge.length;Be+=1){var ot=Ge[Be];this.checkLValInnerPattern(ot,se,Oe)}break;case"ArrayPattern":for(var lt=0,Ct=V.elements;lt<Ct.length;lt+=1){var It=Ct[lt];It&&this.checkLValInnerPattern(It,se,Oe)}break;default:this.checkLValSimple(V,se,Oe)}},ar.checkLValInnerPattern=function(V,se,Oe){switch(se===void 0&&(se=We),V.type){case"Property":this.checkLValInnerPattern(V.value,se,Oe);break;case"AssignmentPattern":this.checkLValPattern(V.left,se,Oe);break;case"RestElement":this.checkLValPattern(V.argument,se,Oe);break;default:this.checkLValPattern(V,se,Oe)}};var sr=function(se,Oe,Be,Ge,ot){this.token=se,this.isExpr=!!Oe,this.preserveSpace=!!Be,this.override=Ge,this.generator=!!ot},rr={b_stat:new sr("{",!1),b_expr:new sr("{",!0),b_tmpl:new sr("${",!1),p_stat:new sr("(",!1),p_expr:new sr("(",!0),q_tmpl:new sr("`",!0,!0,function(V){return V.tryReadTemplateToken()}),f_stat:new sr("function",!1),f_expr:new sr("function",!0),f_expr_gen:new sr("function",!0,!1,null,!0),f_gen:new sr("function",!1,!1,null,!0)},xr=ct.prototype;xr.initialContext=function(){return[rr.b_stat]},xr.curContext=function(){return this.context[this.context.length-1]},xr.braceIsBlock=function(V){var se=this.curContext();return se===rr.f_expr||se===rr.f_stat?!0:V===O.colon&&(se===rr.b_stat||se===rr.b_expr)?!se.isExpr:V===O._return||V===O.name&&this.exprAllowed?te.test(this.input.slice(this.lastTokEnd,this.start)):V===O._else||V===O.semi||V===O.eof||V===O.parenR||V===O.arrow?!0:V===O.braceL?se===rr.b_stat:V===O._var||V===O._const||V===O.name?!1:!this.exprAllowed},xr.inGeneratorContext=function(){for(var V=this.context.length-1;V>=1;V--){var se=this.context[V];if(se.token==="function")return se.generator}return!1},xr.updateContext=function(V){var se,Oe=this.type;Oe.keyword&&V===O.dot?this.exprAllowed=!1:(se=Oe.updateContext)?se.call(this,V):this.exprAllowed=Oe.beforeExpr},xr.overrideContext=function(V){this.curContext()!==V&&(this.context[this.context.length-1]=V)},O.parenR.updateContext=O.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var V=this.context.pop();V===rr.b_stat&&this.curContext().token==="function"&&(V=this.context.pop()),this.exprAllowed=!V.isExpr},O.braceL.updateContext=function(V){this.context.push(this.braceIsBlock(V)?rr.b_stat:rr.b_expr),this.exprAllowed=!0},O.dollarBraceL.updateContext=function(){this.context.push(rr.b_tmpl),this.exprAllowed=!0},O.parenL.updateContext=function(V){var se=V===O._if||V===O._for||V===O._with||V===O._while;this.context.push(se?rr.p_stat:rr.p_expr),this.exprAllowed=!0},O.incDec.updateContext=function(){},O._function.updateContext=O._class.updateContext=function(V){V.beforeExpr&&V!==O._else&&!(V===O.semi&&this.curContext()!==rr.p_stat)&&!(V===O._return&&te.test(this.input.slice(this.lastTokEnd,this.start)))&&!((V===O.colon||V===O.braceL)&&this.curContext()===rr.b_stat)?this.context.push(rr.f_expr):this.context.push(rr.f_stat),this.exprAllowed=!1},O.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0},O.backQuote.updateContext=function(){this.curContext()===rr.q_tmpl?this.context.pop():this.context.push(rr.q_tmpl),this.exprAllowed=!1},O.star.updateContext=function(V){if(V===O._function){var se=this.context.length-1;this.context[se]===rr.f_expr?this.context[se]=rr.f_expr_gen:this.context[se]=rr.f_gen}this.exprAllowed=!0},O.name.updateContext=function(V){var se=!1;this.options.ecmaVersion>=6&&V!==O.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(se=!0),this.exprAllowed=se};var zt=ct.prototype;zt.checkPropClash=function(V,se,Oe){if(!(this.options.ecmaVersion>=9&&V.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(V.computed||V.method||V.shorthand))){var Be=V.key,Ge;switch(Be.type){case"Identifier":Ge=Be.name;break;case"Literal":Ge=String(Be.value);break;default:return}var ot=V.kind;if(this.options.ecmaVersion>=6){Ge==="__proto__"&&ot==="init"&&(se.proto&&(Oe?Oe.doubleProto<0&&(Oe.doubleProto=Be.start):this.raiseRecoverable(Be.start,"Redefinition of __proto__ property")),se.proto=!0);return}Ge="$"+Ge;var lt=se[Ge];if(lt){var Ct;ot==="init"?Ct=this.strict&&lt.init||lt.get||lt.set:Ct=lt.init||lt[ot],Ct&&this.raiseRecoverable(Be.start,"Redefinition of property")}else lt=se[Ge]={init:!1,get:!1,set:!1};lt[ot]=!0}},zt.parseExpression=function(V,se){var Oe=this.start,Be=this.startLoc,Ge=this.parseMaybeAssign(V,se);if(this.type===O.comma){var ot=this.startNodeAt(Oe,Be);for(ot.expressions=[Ge];this.eat(O.comma);)ot.expressions.push(this.parseMaybeAssign(V,se));return this.finishNode(ot,"SequenceExpression")}return Ge},zt.parseMaybeAssign=function(V,se,Oe){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(V);this.exprAllowed=!1}var Be=!1,Ge=-1,ot=-1,lt=-1;se?(Ge=se.parenthesizedAssign,ot=se.trailingComma,lt=se.doubleProto,se.parenthesizedAssign=se.trailingComma=-1):(se=new Ut,Be=!0);var Ct=this.start,It=this.startLoc;(this.type===O.parenL||this.type===O.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=V==="await");var Kt=this.parseMaybeConditional(V,se);if(Oe&&(Kt=Oe.call(this,Kt,Ct,It)),this.type.isAssign){var Wt=this.startNodeAt(Ct,It);return Wt.operator=this.value,this.type===O.eq&&(Kt=this.toAssignable(Kt,!1,se)),Be||(se.parenthesizedAssign=se.trailingComma=se.doubleProto=-1),se.shorthandAssign>=Kt.start&&(se.shorthandAssign=-1),this.type===O.eq?this.checkLValPattern(Kt):this.checkLValSimple(Kt),Wt.left=Kt,this.next(),Wt.right=this.parseMaybeAssign(V),lt>-1&&(se.doubleProto=lt),this.finishNode(Wt,"AssignmentExpression")}else Be&&this.checkExpressionErrors(se,!0);return Ge>-1&&(se.parenthesizedAssign=Ge),ot>-1&&(se.trailingComma=ot),Kt},zt.parseMaybeConditional=function(V,se){var Oe=this.start,Be=this.startLoc,Ge=this.parseExprOps(V,se);if(this.checkExpressionErrors(se))return Ge;if(this.eat(O.question)){var ot=this.startNodeAt(Oe,Be);return ot.test=Ge,ot.consequent=this.parseMaybeAssign(),this.expect(O.colon),ot.alternate=this.parseMaybeAssign(V),this.finishNode(ot,"ConditionalExpression")}return Ge},zt.parseExprOps=function(V,se){var Oe=this.start,Be=this.startLoc,Ge=this.parseMaybeUnary(se,!1,!1,V);return this.checkExpressionErrors(se)||Ge.start===Oe&&Ge.type==="ArrowFunctionExpression"?Ge:this.parseExprOp(Ge,Oe,Be,-1,V)},zt.parseExprOp=function(V,se,Oe,Be,Ge){var ot=this.type.binop;if(ot!=null&&(!Ge||this.type!==O._in)&&ot>Be){var lt=this.type===O.logicalOR||this.type===O.logicalAND,Ct=this.type===O.coalesce;Ct&&(ot=O.logicalAND.binop);var It=this.value;this.next();var Kt=this.start,Wt=this.startLoc,ir=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,Ge),Kt,Wt,ot,Ge),mr=this.buildBinary(se,Oe,V,ir,It,lt||Ct);return(lt&&this.type===O.coalesce||Ct&&(this.type===O.logicalOR||this.type===O.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(mr,se,Oe,Be,Ge)}return V},zt.buildBinary=function(V,se,Oe,Be,Ge,ot){Be.type==="PrivateIdentifier"&&this.raise(Be.start,"Private identifier can only be left side of binary expression");var lt=this.startNodeAt(V,se);return lt.left=Oe,lt.operator=Ge,lt.right=Be,this.finishNode(lt,ot?"LogicalExpression":"BinaryExpression")},zt.parseMaybeUnary=function(V,se,Oe,Be){var Ge=this.start,ot=this.startLoc,lt;if(this.isContextual("await")&&this.canAwait)lt=this.parseAwait(Be),se=!0;else if(this.type.prefix){var Ct=this.startNode(),It=this.type===O.incDec;Ct.operator=this.value,Ct.prefix=!0,this.next(),Ct.argument=this.parseMaybeUnary(null,!0,It,Be),this.checkExpressionErrors(V,!0),It?this.checkLValSimple(Ct.argument):this.strict&&Ct.operator==="delete"&&Wr(Ct.argument)?this.raiseRecoverable(Ct.start,"Deleting local variable in strict mode"):Ct.operator==="delete"&&Br(Ct.argument)?this.raiseRecoverable(Ct.start,"Private fields can not be deleted"):se=!0,lt=this.finishNode(Ct,It?"UpdateExpression":"UnaryExpression")}else if(!se&&this.type===O.privateId)(Be||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),lt=this.parsePrivateIdent(),this.type!==O._in&&this.unexpected();else{if(lt=this.parseExprSubscripts(V,Be),this.checkExpressionErrors(V))return lt;for(;this.type.postfix&&!this.canInsertSemicolon();){var Kt=this.startNodeAt(Ge,ot);Kt.operator=this.value,Kt.prefix=!1,Kt.argument=lt,this.checkLValSimple(lt),this.next(),lt=this.finishNode(Kt,"UpdateExpression")}}if(!Oe&&this.eat(O.starstar))if(se)this.unexpected(this.lastTokStart);else return this.buildBinary(Ge,ot,lt,this.parseMaybeUnary(null,!1,!1,Be),"**",!1);else return lt};function Wr(V){return V.type==="Identifier"||V.type==="ParenthesizedExpression"&&Wr(V.expression)}function Br(V){return V.type==="MemberExpression"&&V.property.type==="PrivateIdentifier"||V.type==="ChainExpression"&&Br(V.expression)||V.type==="ParenthesizedExpression"&&Br(V.expression)}zt.parseExprSubscripts=function(V,se){var Oe=this.start,Be=this.startLoc,Ge=this.parseExprAtom(V,se);if(Ge.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return Ge;var ot=this.parseSubscripts(Ge,Oe,Be,!1,se);return V&&ot.type==="MemberExpression"&&(V.parenthesizedAssign>=ot.start&&(V.parenthesizedAssign=-1),V.parenthesizedBind>=ot.start&&(V.parenthesizedBind=-1),V.trailingComma>=ot.start&&(V.trailingComma=-1)),ot},zt.parseSubscripts=function(V,se,Oe,Be,Ge){for(var ot=this.options.ecmaVersion>=8&&V.type==="Identifier"&&V.name==="async"&&this.lastTokEnd===V.end&&!this.canInsertSemicolon()&&V.end-V.start===5&&this.potentialArrowAt===V.start,lt=!1;;){var Ct=this.parseSubscript(V,se,Oe,Be,ot,lt,Ge);if(Ct.optional&&(lt=!0),Ct===V||Ct.type==="ArrowFunctionExpression"){if(lt){var It=this.startNodeAt(se,Oe);It.expression=Ct,Ct=this.finishNode(It,"ChainExpression")}return Ct}V=Ct}},zt.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(O.arrow)},zt.parseSubscriptAsyncArrow=function(V,se,Oe,Be){return this.parseArrowExpression(this.startNodeAt(V,se),Oe,!0,Be)},zt.parseSubscript=function(V,se,Oe,Be,Ge,ot,lt){var Ct=this.options.ecmaVersion>=11,It=Ct&&this.eat(O.questionDot);Be&&It&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var Kt=this.eat(O.bracketL);if(Kt||It&&this.type!==O.parenL&&this.type!==O.backQuote||this.eat(O.dot)){var Wt=this.startNodeAt(se,Oe);Wt.object=V,Kt?(Wt.property=this.parseExpression(),this.expect(O.bracketR)):this.type===O.privateId&&V.type!=="Super"?Wt.property=this.parsePrivateIdent():Wt.property=this.parseIdent(this.options.allowReserved!=="never"),Wt.computed=!!Kt,Ct&&(Wt.optional=It),V=this.finishNode(Wt,"MemberExpression")}else if(!Be&&this.eat(O.parenL)){var ir=new Ut,mr=this.yieldPos,Tr=this.awaitPos,_r=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var Dr=this.parseExprList(O.parenR,this.options.ecmaVersion>=8,!1,ir);if(Ge&&!It&&this.shouldParseAsyncArrow())return this.checkPatternErrors(ir,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=mr,this.awaitPos=Tr,this.awaitIdentPos=_r,this.parseSubscriptAsyncArrow(se,Oe,Dr,lt);this.checkExpressionErrors(ir,!0),this.yieldPos=mr||this.yieldPos,this.awaitPos=Tr||this.awaitPos,this.awaitIdentPos=_r||this.awaitIdentPos;var Sr=this.startNodeAt(se,Oe);Sr.callee=V,Sr.arguments=Dr,Ct&&(Sr.optional=It),V=this.finishNode(Sr,"CallExpression")}else if(this.type===O.backQuote){(It||ot)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var Rr=this.startNodeAt(se,Oe);Rr.tag=V,Rr.quasi=this.parseTemplate({isTagged:!0}),V=this.finishNode(Rr,"TaggedTemplateExpression")}return V},zt.parseExprAtom=function(V,se,Oe){this.type===O.slash&&this.readRegexp();var Be,Ge=this.potentialArrowAt===this.start;switch(this.type){case O._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),Be=this.startNode(),this.next(),this.type===O.parenL&&!this.allowDirectSuper&&this.raise(Be.start,"super() call outside constructor of a subclass"),this.type!==O.dot&&this.type!==O.bracketL&&this.type!==O.parenL&&this.unexpected(),this.finishNode(Be,"Super");case O._this:return Be=this.startNode(),this.next(),this.finishNode(Be,"ThisExpression");case O.name:var ot=this.start,lt=this.startLoc,Ct=this.containsEsc,It=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!Ct&&It.name==="async"&&!this.canInsertSemicolon()&&this.eat(O._function))return this.overrideContext(rr.f_expr),this.parseFunction(this.startNodeAt(ot,lt),0,!1,!0,se);if(Ge&&!this.canInsertSemicolon()){if(this.eat(O.arrow))return this.parseArrowExpression(this.startNodeAt(ot,lt),[It],!1,se);if(this.options.ecmaVersion>=8&&It.name==="async"&&this.type===O.name&&!Ct&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return It=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(O.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(ot,lt),[It],!0,se)}return It;case O.regexp:var Kt=this.value;return Be=this.parseLiteral(Kt.value),Be.regex={pattern:Kt.pattern,flags:Kt.flags},Be;case O.num:case O.string:return this.parseLiteral(this.value);case O._null:case O._true:case O._false:return Be=this.startNode(),Be.value=this.type===O._null?null:this.type===O._true,Be.raw=this.type.keyword,this.next(),this.finishNode(Be,"Literal");case O.parenL:var Wt=this.start,ir=this.parseParenAndDistinguishExpression(Ge,se);return V&&(V.parenthesizedAssign<0&&!this.isSimpleAssignTarget(ir)&&(V.parenthesizedAssign=Wt),V.parenthesizedBind<0&&(V.parenthesizedBind=Wt)),ir;case O.bracketL:return Be=this.startNode(),this.next(),Be.elements=this.parseExprList(O.bracketR,!0,!0,V),this.finishNode(Be,"ArrayExpression");case O.braceL:return this.overrideContext(rr.b_expr),this.parseObj(!1,V);case O._function:return Be=this.startNode(),this.next(),this.parseFunction(Be,0);case O._class:return this.parseClass(this.startNode(),!1);case O._new:return this.parseNew();case O.backQuote:return this.parseTemplate();case O._import:return this.options.ecmaVersion>=11?this.parseExprImport(Oe):this.unexpected();default:return this.parseExprAtomDefault()}},zt.parseExprAtomDefault=function(){this.unexpected()},zt.parseExprImport=function(V){var se=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===O.parenL&&!V)return this.parseDynamicImport(se);if(this.type===O.dot){var Oe=this.startNodeAt(se.start,se.loc&&se.loc.start);return Oe.name="import",se.meta=this.finishNode(Oe,"Identifier"),this.parseImportMeta(se)}else this.unexpected()},zt.parseDynamicImport=function(V){if(this.next(),V.source=this.parseMaybeAssign(),!this.eat(O.parenR)){var se=this.start;this.eat(O.comma)&&this.eat(O.parenR)?this.raiseRecoverable(se,"Trailing comma is not allowed in import()"):this.unexpected(se)}return this.finishNode(V,"ImportExpression")},zt.parseImportMeta=function(V){this.next();var se=this.containsEsc;return V.property=this.parseIdent(!0),V.property.name!=="meta"&&this.raiseRecoverable(V.property.start,"The only valid meta property for import is 'import.meta'"),se&&this.raiseRecoverable(V.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(V.start,"Cannot use 'import.meta' outside a module"),this.finishNode(V,"MetaProperty")},zt.parseLiteral=function(V){var se=this.startNode();return se.value=V,se.raw=this.input.slice(this.start,this.end),se.raw.charCodeAt(se.raw.length-1)===110&&(se.bigint=se.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(se,"Literal")},zt.parseParenExpression=function(){this.expect(O.parenL);var V=this.parseExpression();return this.expect(O.parenR),V},zt.shouldParseArrow=function(V){return!this.canInsertSemicolon()},zt.parseParenAndDistinguishExpression=function(V,se){var Oe=this.start,Be=this.startLoc,Ge,ot=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var lt=this.start,Ct=this.startLoc,It=[],Kt=!0,Wt=!1,ir=new Ut,mr=this.yieldPos,Tr=this.awaitPos,_r;for(this.yieldPos=0,this.awaitPos=0;this.type!==O.parenR;)if(Kt?Kt=!1:this.expect(O.comma),ot&&this.afterTrailingComma(O.parenR,!0)){Wt=!0;break}else if(this.type===O.ellipsis){_r=this.start,It.push(this.parseParenItem(this.parseRestBinding())),this.type===O.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else It.push(this.parseMaybeAssign(!1,ir,this.parseParenItem));var Dr=this.lastTokEnd,Sr=this.lastTokEndLoc;if(this.expect(O.parenR),V&&this.shouldParseArrow(It)&&this.eat(O.arrow))return this.checkPatternErrors(ir,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=mr,this.awaitPos=Tr,this.parseParenArrowList(Oe,Be,It,se);(!It.length||Wt)&&this.unexpected(this.lastTokStart),_r&&this.unexpected(_r),this.checkExpressionErrors(ir,!0),this.yieldPos=mr||this.yieldPos,this.awaitPos=Tr||this.awaitPos,It.length>1?(Ge=this.startNodeAt(lt,Ct),Ge.expressions=It,this.finishNodeAt(Ge,"SequenceExpression",Dr,Sr)):Ge=It[0]}else Ge=this.parseParenExpression();if(this.options.preserveParens){var Rr=this.startNodeAt(Oe,Be);return Rr.expression=Ge,this.finishNode(Rr,"ParenthesizedExpression")}else return Ge},zt.parseParenItem=function(V){return V},zt.parseParenArrowList=function(V,se,Oe,Be){return this.parseArrowExpression(this.startNodeAt(V,se),Oe,!1,Be)};var Rn=[];zt.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var V=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===O.dot){var se=this.startNodeAt(V.start,V.loc&&V.loc.start);se.name="new",V.meta=this.finishNode(se,"Identifier"),this.next();var Oe=this.containsEsc;return V.property=this.parseIdent(!0),V.property.name!=="target"&&this.raiseRecoverable(V.property.start,"The only valid meta property for new is 'new.target'"),Oe&&this.raiseRecoverable(V.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(V.start,"'new.target' can only be used in functions and class static block"),this.finishNode(V,"MetaProperty")}var Be=this.start,Ge=this.startLoc;return V.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),Be,Ge,!0,!1),this.eat(O.parenL)?V.arguments=this.parseExprList(O.parenR,this.options.ecmaVersion>=8,!1):V.arguments=Rn,this.finishNode(V,"NewExpression")},zt.parseTemplateElement=function(V){var se=V.isTagged,Oe=this.startNode();return this.type===O.invalidTemplate?(se||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),Oe.value={raw:this.value.replace(/\r\n?/g,`
1049
1049
  `),cooked:null}):Oe.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "randmarcomps",
3
3
  "private": false,
4
- "version": "1.264.0",
4
+ "version": "1.265.0",
5
5
  "description": "The UI library enabling speed and consistency in Randmar frontends.",
6
6
  "type": "module",
7
7
  "files": [