@dashx/react 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,45 +1,36 @@
1
- (function(ee,M){typeof exports=="object"&&typeof module<"u"?M(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],M):(ee=typeof globalThis<"u"?globalThis:ee||self,M(ee["ui-library"]={},ee.React))})(this,function(ee,M){"use strict";function ft(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function lt(s){if(s.__esModule)return s;var o=s.default;if(typeof o=="function"){var r=function t(){return this instanceof t?Reflect.construct(o,arguments,this.constructor):o.apply(this,arguments)};r.prototype=o.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(s).forEach(function(t){var a=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:function(){return s[t]}})}),r}var Re={exports:{}},fe={};/**
2
- * @license React
3
- * react-jsx-runtime.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Fe;function dt(){if(Fe)return fe;Fe=1;var s=M,o=Symbol.for("react.element"),r=Symbol.for("react.fragment"),t=Object.prototype.hasOwnProperty,a=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function p(c,f,n){var m,b={},E=null,O=null;n!==void 0&&(E=""+n),f.key!==void 0&&(E=""+f.key),f.ref!==void 0&&(O=f.ref);for(m in f)t.call(f,m)&&!d.hasOwnProperty(m)&&(b[m]=f[m]);if(c&&c.defaultProps)for(m in f=c.defaultProps,f)b[m]===void 0&&(b[m]=f[m]);return{$$typeof:o,type:c,key:E,ref:O,props:b,_owner:a.current}}return fe.Fragment=r,fe.jsx=p,fe.jsxs=p,fe}var le={};/**
10
- * @license React
11
- * react-jsx-runtime.development.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Me;function pt(){return Me||(Me=1,process.env.NODE_ENV!=="production"&&function(){var s=M,o=Symbol.for("react.element"),r=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),p=Symbol.for("react.provider"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),n=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),Z=Symbol.iterator,G="@@iterator";function Q(e){if(e===null||typeof e!="object")return null;var u=Z&&e[Z]||e[G];return typeof u=="function"?u:null}var q=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function j(e){{for(var u=arguments.length,h=new Array(u>1?u-1:0),w=1;w<u;w++)h[w-1]=arguments[w];te("error",e,h)}}function te(e,u,h){{var w=q.ReactDebugCurrentFrame,P=w.getStackAddendum();P!==""&&(u+="%s",h=h.concat([P]));var A=h.map(function(R){return String(R)});A.unshift("Warning: "+u),Function.prototype.apply.call(console[e],console,A)}}var pe=!1,K=!1,ie=!1,ne=!1,re=!1,ae;ae=Symbol.for("react.module.reference");function l(e){return!!(typeof e=="string"||typeof e=="function"||e===t||e===d||re||e===a||e===n||e===m||ne||e===O||pe||K||ie||typeof e=="object"&&e!==null&&(e.$$typeof===E||e.$$typeof===b||e.$$typeof===p||e.$$typeof===c||e.$$typeof===f||e.$$typeof===ae||e.getModuleId!==void 0))}function i(e,u,h){var w=e.displayName;if(w)return w;var P=u.displayName||u.name||"";return P!==""?h+"("+P+")":h}function y(e){return e.displayName||"Context"}function g(e){if(e==null)return null;if(typeof e.tag=="number"&&j("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case t:return"Fragment";case r:return"Portal";case d:return"Profiler";case a:return"StrictMode";case n:return"Suspense";case m:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case c:var u=e;return y(u)+".Consumer";case p:var h=e;return y(h._context)+".Provider";case f:return i(e,e.render,"ForwardRef");case b:var w=e.displayName||null;return w!==null?w:g(e.type)||"Memo";case E:{var P=e,A=P._payload,R=P._init;try{return g(R(A))}catch{return null}}}return null}var v=Object.assign,I=0,L,W,J,T,F,X,he;function ve(){}ve.__reactDisabledLog=!0;function me(){{if(I===0){L=console.log,W=console.info,J=console.warn,T=console.error,F=console.group,X=console.groupCollapsed,he=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ve,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}I++}}function oe(){{if(I--,I===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:v({},e,{value:L}),info:v({},e,{value:W}),warn:v({},e,{value:J}),error:v({},e,{value:T}),group:v({},e,{value:F}),groupCollapsed:v({},e,{value:X}),groupEnd:v({},e,{value:he})})}I<0&&j("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Oe=q.ReactCurrentDispatcher,je;function we(e,u,h){{if(je===void 0)try{throw Error()}catch(P){var w=P.stack.trim().match(/\n( *(at )?)/);je=w&&w[1]||""}return`
18
- `+je+e}}var Ie=!1,be;{var pr=typeof WeakMap=="function"?WeakMap:Map;be=new pr}function Je(e,u){if(!e||Ie)return"";{var h=be.get(e);if(h!==void 0)return h}var w;Ie=!0;var P=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var A;A=Oe.current,Oe.current=null,me();try{if(u){var R=function(){throw Error()};if(Object.defineProperty(R.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(R,[])}catch(Y){w=Y}Reflect.construct(e,[],R)}else{try{R.call()}catch(Y){w=Y}e.call(R.prototype)}}else{try{throw Error()}catch(Y){w=Y}e()}}catch(Y){if(Y&&w&&typeof Y.stack=="string"){for(var C=Y.stack.split(`
19
- `),H=w.stack.split(`
20
- `),$=C.length-1,x=H.length-1;$>=1&&x>=0&&C[$]!==H[x];)x--;for(;$>=1&&x>=0;$--,x--)if(C[$]!==H[x]){if($!==1||x!==1)do if($--,x--,x<0||C[$]!==H[x]){var z=`
21
- `+C[$].replace(" at new "," at ");return e.displayName&&z.includes("<anonymous>")&&(z=z.replace("<anonymous>",e.displayName)),typeof e=="function"&&be.set(e,z),z}while($>=1&&x>=0);break}}}finally{Ie=!1,Oe.current=A,oe(),Error.prepareStackTrace=P}var ce=e?e.displayName||e.name:"",ue=ce?we(ce):"";return typeof e=="function"&&be.set(e,ue),ue}function hr(e,u,h){return Je(e,!1)}function vr(e){var u=e.prototype;return!!(u&&u.isReactComponent)}function Ce(e,u,h){if(e==null)return"";if(typeof e=="function")return Je(e,vr(e));if(typeof e=="string")return we(e);switch(e){case n:return we("Suspense");case m:return we("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return hr(e.render);case b:return Ce(e.type,u,h);case E:{var w=e,P=w._payload,A=w._init;try{return Ce(A(P),u,h)}catch{}}}return""}var ye=Object.prototype.hasOwnProperty,ze={},Ze=q.ReactDebugCurrentFrame;function Ee(e){if(e){var u=e._owner,h=Ce(e.type,e._source,u?u.type:null);Ze.setExtraStackFrame(h)}else Ze.setExtraStackFrame(null)}function mr(e,u,h,w,P){{var A=Function.call.bind(ye);for(var R in e)if(A(e,R)){var C=void 0;try{if(typeof e[R]!="function"){var H=Error((w||"React class")+": "+h+" type `"+R+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[R]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw H.name="Invariant Violation",H}C=e[R](u,R,w,h,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch($){C=$}C&&!(C instanceof Error)&&(Ee(P),j("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",w||"React class",h,R,typeof C),Ee(null)),C instanceof Error&&!(C.message in ze)&&(ze[C.message]=!0,Ee(P),j("Failed %s type: %s",h,C.message),Ee(null))}}}var yr=Array.isArray;function $e(e){return yr(e)}function gr(e){{var u=typeof Symbol=="function"&&Symbol.toStringTag,h=u&&e[Symbol.toStringTag]||e.constructor.name||"Object";return h}}function wr(e){try{return Qe(e),!1}catch{return!0}}function Qe(e){return""+e}function et(e){if(wr(e))return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",gr(e)),Qe(e)}var ge=q.ReactCurrentOwner,br={key:!0,ref:!0,__self:!0,__source:!0},tt,rt,xe;xe={};function Cr(e){if(ye.call(e,"ref")){var u=Object.getOwnPropertyDescriptor(e,"ref").get;if(u&&u.isReactWarning)return!1}return e.ref!==void 0}function Er(e){if(ye.call(e,"key")){var u=Object.getOwnPropertyDescriptor(e,"key").get;if(u&&u.isReactWarning)return!1}return e.key!==void 0}function Rr(e,u){if(typeof e.ref=="string"&&ge.current&&u&&ge.current.stateNode!==u){var h=g(ge.current.type);xe[h]||(j('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',g(ge.current.type),e.ref),xe[h]=!0)}}function _r(e,u){{var h=function(){tt||(tt=!0,j("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",u))};h.isReactWarning=!0,Object.defineProperty(e,"key",{get:h,configurable:!0})}}function Tr(e,u){{var h=function(){rt||(rt=!0,j("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",u))};h.isReactWarning=!0,Object.defineProperty(e,"ref",{get:h,configurable:!0})}}var Pr=function(e,u,h,w,P,A,R){var C={$$typeof:o,type:e,key:u,ref:h,props:R,_owner:A};return C._store={},Object.defineProperty(C._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(C,"_self",{configurable:!1,enumerable:!1,writable:!1,value:w}),Object.defineProperty(C,"_source",{configurable:!1,enumerable:!1,writable:!1,value:P}),Object.freeze&&(Object.freeze(C.props),Object.freeze(C)),C};function Sr(e,u,h,w,P){{var A,R={},C=null,H=null;h!==void 0&&(et(h),C=""+h),Er(u)&&(et(u.key),C=""+u.key),Cr(u)&&(H=u.ref,Rr(u,P));for(A in u)ye.call(u,A)&&!br.hasOwnProperty(A)&&(R[A]=u[A]);if(e&&e.defaultProps){var $=e.defaultProps;for(A in $)R[A]===void 0&&(R[A]=$[A])}if(C||H){var x=typeof e=="function"?e.displayName||e.name||"Unknown":e;C&&_r(R,x),H&&Tr(R,x)}return Pr(e,C,H,P,w,ge.current,R)}}var Ue=q.ReactCurrentOwner,nt=q.ReactDebugCurrentFrame;function se(e){if(e){var u=e._owner,h=Ce(e.type,e._source,u?u.type:null);nt.setExtraStackFrame(h)}else nt.setExtraStackFrame(null)}var De;De=!1;function Le(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function at(){{if(Ue.current){var e=g(Ue.current.type);if(e)return`
22
-
23
- Check the render method of \``+e+"`."}return""}}function kr(e){return""}var it={};function Ar(e){{var u=at();if(!u){var h=typeof e=="string"?e:e.displayName||e.name;h&&(u=`
24
-
25
- Check the top-level render call using <`+h+">.")}return u}}function ot(e,u){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var h=Ar(u);if(it[h])return;it[h]=!0;var w="";e&&e._owner&&e._owner!==Ue.current&&(w=" It was passed a child from "+g(e._owner.type)+"."),se(e),j('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',h,w),se(null)}}function ut(e,u){{if(typeof e!="object")return;if($e(e))for(var h=0;h<e.length;h++){var w=e[h];Le(w)&&ot(w,u)}else if(Le(e))e._store&&(e._store.validated=!0);else if(e){var P=Q(e);if(typeof P=="function"&&P!==e.entries)for(var A=P.call(e),R;!(R=A.next()).done;)Le(R.value)&&ot(R.value,u)}}}function Or(e){{var u=e.type;if(u==null||typeof u=="string")return;var h;if(typeof u=="function")h=u.propTypes;else if(typeof u=="object"&&(u.$$typeof===f||u.$$typeof===b))h=u.propTypes;else return;if(h){var w=g(u);mr(h,e.props,"prop",w,e)}else if(u.PropTypes!==void 0&&!De){De=!0;var P=g(u);j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",P||"Unknown")}typeof u.getDefaultProps=="function"&&!u.getDefaultProps.isReactClassApproved&&j("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function jr(e){{for(var u=Object.keys(e.props),h=0;h<u.length;h++){var w=u[h];if(w!=="children"&&w!=="key"){se(e),j("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",w),se(null);break}}e.ref!==null&&(se(e),j("Invalid attribute `ref` supplied to `React.Fragment`."),se(null))}}var st={};function ct(e,u,h,w,P,A){{var R=l(e);if(!R){var C="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(C+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var H=kr();H?C+=H:C+=at();var $;e===null?$="null":$e(e)?$="array":e!==void 0&&e.$$typeof===o?($="<"+(g(e.type)||"Unknown")+" />",C=" Did you accidentally export a JSX literal instead of a component?"):$=typeof e,j("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",$,C)}var x=Sr(e,u,h,P,A);if(x==null)return x;if(R){var z=u.children;if(z!==void 0)if(w)if($e(z)){for(var ce=0;ce<z.length;ce++)ut(z[ce],e);Object.freeze&&Object.freeze(z)}else j("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ut(z,e)}if(ye.call(u,"key")){var ue=g(e),Y=Object.keys(u).filter(function(Lr){return Lr!=="key"}),qe=Y.length>0?"{key: someKey, "+Y.join(": ..., ")+": ...}":"{key: someKey}";if(!st[ue+qe]){var Dr=Y.length>0?"{"+Y.join(": ..., ")+": ...}":"{}";j(`A props object containing a "key" prop is being spread into JSX:
26
- let props = %s;
27
- <%s {...props} />
28
- React keys must be passed directly to JSX without using spread:
29
- let props = %s;
30
- <%s key={someKey} {...props} />`,qe,ue,Dr,ue),st[ue+qe]=!0}}return e===t?jr(x):Or(x),x}}function Ir(e,u,h){return ct(e,u,h,!0)}function $r(e,u,h){return ct(e,u,h,!1)}var xr=$r,Ur=Ir;le.Fragment=t,le.jsx=xr,le.jsxs=Ur}()),le}process.env.NODE_ENV==="production"?Re.exports=dt():Re.exports=pt();var U=Re.exports;function Be(s,o){return o=o||{},new Promise(function(r,t){var a=new XMLHttpRequest,d=[],p=[],c={},f=function(){return{ok:(a.status/100|0)==2,statusText:a.statusText,status:a.status,url:a.responseURL,text:function(){return Promise.resolve(a.responseText)},json:function(){return Promise.resolve(a.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([a.response]))},clone:f,headers:{keys:function(){return d},entries:function(){return p},get:function(m){return c[m.toLowerCase()]},has:function(m){return m.toLowerCase()in c}}}};for(var n in a.open(o.method||"get",s,!0),a.onload=function(){a.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(m,b,E){d.push(b=b.toLowerCase()),p.push([b,E]),c[b]=c[b]?c[b]+","+E:E}),r(f())},a.onerror=t,a.withCredentials=o.credentials=="include",o.headers)a.setRequestHeader(n,o.headers[n]);a.send(o.body||null)})}function ht(s){throw new Error('Could not dynamically require "'+s+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ne={exports:{}};const vt=lt(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));(function(s){(function(){var o,r=0,t=[],a;for(a=0;a<256;a++)t[a]=(a+256).toString(16).substr(1);f.BUFFER_SIZE=4096,f.bin=c,f.clearBuffer=function(){o=null,r=0},f.test=function(n){return typeof n=="string"?/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(n):!1};var d;typeof crypto<"u"?d=crypto:typeof window<"u"&&typeof window.msCrypto<"u"&&(d=window.msCrypto),typeof ht=="function"?(d=d||vt,s.exports=f):typeof window<"u"&&(window.uuid=f),f.randomBytes=function(){if(d){if(d.randomBytes)return d.randomBytes;if(d.getRandomValues)return typeof Uint8Array.prototype.slice!="function"?function(n){var m=new Uint8Array(n);return d.getRandomValues(m),Array.from(m)}:function(n){var m=new Uint8Array(n);return d.getRandomValues(m),m}}return function(n){var m,b=[];for(m=0;m<n;m++)b.push(Math.floor(Math.random()*256));return b}}();function p(n){return(!o||r+n>f.BUFFER_SIZE)&&(r=0,o=f.randomBytes(f.BUFFER_SIZE)),o.slice(r,r+=n)}function c(){var n=p(16);return n[6]=n[6]&15|64,n[8]=n[8]&63|128,n}function f(){var n=c();return t[n[0]]+t[n[1]]+t[n[2]]+t[n[3]]+"-"+t[n[4]]+t[n[5]]+"-"+t[n[6]]+t[n[7]]+"-"+t[n[8]]+t[n[9]]+"-"+t[n[10]]+t[n[11]]+t[n[12]]+t[n[13]]+t[n[14]]+t[n[15]]}})()})(Ne);var mt=Ne.exports;const _e=ft(mt);function _(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_=function(){return s};var s={},o=Object.prototype,r=o.hasOwnProperty,t=typeof Symbol=="function"?Symbol:{},a=t.iterator||"@@iterator",d=t.asyncIterator||"@@asyncIterator",p=t.toStringTag||"@@toStringTag";function c(l,i,y){return Object.defineProperty(l,i,{value:y,enumerable:!0,configurable:!0,writable:!0}),l[i]}try{c({},"")}catch{c=function(i,y,g){return i[y]=g}}function f(l,i,y,g){var v=i&&i.prototype instanceof b?i:b,I=Object.create(v.prototype),L=new ne(g||[]);return I._invoke=function(W,J,T){var F="suspendedStart";return function(X,he){if(F==="executing")throw new Error("Generator is already running");if(F==="completed"){if(X==="throw")throw he;return ae()}for(T.method=X,T.arg=he;;){var ve=T.delegate;if(ve){var me=pe(ve,T);if(me){if(me===m)continue;return me}}if(T.method==="next")T.sent=T._sent=T.arg;else if(T.method==="throw"){if(F==="suspendedStart")throw F="completed",T.arg;T.dispatchException(T.arg)}else T.method==="return"&&T.abrupt("return",T.arg);F="executing";var oe=n(W,J,T);if(oe.type==="normal"){if(F=T.done?"completed":"suspendedYield",oe.arg===m)continue;return{value:oe.arg,done:T.done}}oe.type==="throw"&&(F="completed",T.method="throw",T.arg=oe.arg)}}}(l,y,L),I}function n(l,i,y){try{return{type:"normal",arg:l.call(i,y)}}catch(g){return{type:"throw",arg:g}}}s.wrap=f;var m={};function b(){}function E(){}function O(){}var Z={};c(Z,a,function(){return this});var G=Object.getPrototypeOf,Q=G&&G(G(re([])));Q&&Q!==o&&r.call(Q,a)&&(Z=Q);var q=O.prototype=b.prototype=Object.create(Z);function j(l){["next","throw","return"].forEach(function(i){c(l,i,function(y){return this._invoke(i,y)})})}function te(l,i){function y(v,I,L,W){var J=n(l[v],l,I);if(J.type!=="throw"){var T=J.arg,F=T.value;return F&&typeof F=="object"&&r.call(F,"__await")?i.resolve(F.__await).then(function(X){y("next",X,L,W)},function(X){y("throw",X,L,W)}):i.resolve(F).then(function(X){T.value=X,L(T)},function(X){return y("throw",X,L,W)})}W(J.arg)}var g;this._invoke=function(v,I){function L(){return new i(function(W,J){y(v,I,W,J)})}return g=g?g.then(L,L):L()}}function pe(l,i){var y=l.iterator[i.method];if(y===void 0){if(i.delegate=null,i.method==="throw"){if(l.iterator.return&&(i.method="return",i.arg=void 0,pe(l,i),i.method==="throw"))return m;i.method="throw",i.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var g=n(y,l.iterator,i.arg);if(g.type==="throw")return i.method="throw",i.arg=g.arg,i.delegate=null,m;var v=g.arg;return v?v.done?(i[l.resultName]=v.value,i.next=l.nextLoc,i.method!=="return"&&(i.method="next",i.arg=void 0),i.delegate=null,m):v:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,m)}function K(l){var i={tryLoc:l[0]};1 in l&&(i.catchLoc=l[1]),2 in l&&(i.finallyLoc=l[2],i.afterLoc=l[3]),this.tryEntries.push(i)}function ie(l){var i=l.completion||{};i.type="normal",delete i.arg,l.completion=i}function ne(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(K,this),this.reset(!0)}function re(l){if(l){var i=l[a];if(i)return i.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var y=-1,g=function v(){for(;++y<l.length;)if(r.call(l,y))return v.value=l[y],v.done=!1,v;return v.value=void 0,v.done=!0,v};return g.next=g}}return{next:ae}}function ae(){return{value:void 0,done:!0}}return E.prototype=O,c(q,"constructor",O),c(O,"constructor",E),E.displayName=c(O,p,"GeneratorFunction"),s.isGeneratorFunction=function(l){var i=typeof l=="function"&&l.constructor;return!!i&&(i===E||(i.displayName||i.name)==="GeneratorFunction")},s.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,O):(l.__proto__=O,c(l,p,"GeneratorFunction")),l.prototype=Object.create(q),l},s.awrap=function(l){return{__await:l}},j(te.prototype),c(te.prototype,d,function(){return this}),s.AsyncIterator=te,s.async=function(l,i,y,g,v){v===void 0&&(v=Promise);var I=new te(f(l,i,y,g),v);return s.isGeneratorFunction(i)?I:I.next().then(function(L){return L.done?L.value:I.next()})},j(q),c(q,p,"Generator"),c(q,a,function(){return this}),c(q,"toString",function(){return"[object Generator]"}),s.keys=function(l){var i=[];for(var y in l)i.push(y);return i.reverse(),function g(){for(;i.length;){var v=i.pop();if(v in l)return g.value=v,g.done=!1,g}return g.done=!0,g}},s.values=re,ne.prototype={constructor:ne,reset:function(l){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(ie),!l)for(var i in this)i.charAt(0)==="t"&&r.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=void 0)},stop:function(){this.done=!0;var l=this.tryEntries[0].completion;if(l.type==="throw")throw l.arg;return this.rval},dispatchException:function(l){if(this.done)throw l;var i=this;function y(J,T){return I.type="throw",I.arg=l,i.next=J,T&&(i.method="next",i.arg=void 0),!!T}for(var g=this.tryEntries.length-1;g>=0;--g){var v=this.tryEntries[g],I=v.completion;if(v.tryLoc==="root")return y("end");if(v.tryLoc<=this.prev){var L=r.call(v,"catchLoc"),W=r.call(v,"finallyLoc");if(L&&W){if(this.prev<v.catchLoc)return y(v.catchLoc,!0);if(this.prev<v.finallyLoc)return y(v.finallyLoc)}else if(L){if(this.prev<v.catchLoc)return y(v.catchLoc,!0)}else{if(!W)throw new Error("try statement without catch or finally");if(this.prev<v.finallyLoc)return y(v.finallyLoc)}}}},abrupt:function(l,i){for(var y=this.tryEntries.length-1;y>=0;--y){var g=this.tryEntries[y];if(g.tryLoc<=this.prev&&r.call(g,"finallyLoc")&&this.prev<g.finallyLoc){var v=g;break}}v&&(l==="break"||l==="continue")&&v.tryLoc<=i&&i<=v.finallyLoc&&(v=null);var I=v?v.completion:{};return I.type=l,I.arg=i,v?(this.method="next",this.next=v.finallyLoc,m):this.complete(I)},complete:function(l,i){if(l.type==="throw")throw l.arg;return l.type==="break"||l.type==="continue"?this.next=l.arg:l.type==="return"?(this.rval=this.arg=l.arg,this.method="return",this.next="end"):l.type==="normal"&&i&&(this.next=i),m},finish:function(l){for(var i=this.tryEntries.length-1;i>=0;--i){var y=this.tryEntries[i];if(y.finallyLoc===l)return this.complete(y.completion,y.afterLoc),ie(y),m}},catch:function(l){for(var i=this.tryEntries.length-1;i>=0;--i){var y=this.tryEntries[i];if(y.tryLoc===l){var g=y.completion;if(g.type==="throw"){var v=g.arg;ie(y)}return v}}throw new Error("illegal catch attempt")},delegateYield:function(l,i,y){return this.delegate={iterator:re(l),resultName:i,nextLoc:y},this.method==="next"&&(this.arg=void 0),m}},s}function He(s,o,r,t,a,d,p){try{var c=s[d](p),f=c.value}catch(n){r(n);return}c.done?o(f):Promise.resolve(f).then(t,a)}function B(s){return function(){var o=this,r=arguments;return new Promise(function(t,a){var d=s.apply(o,r);function p(f){He(d,t,a,p,c,"next",f)}function c(f){He(d,t,a,p,c,"throw",f)}p(void 0)})}}function yt(s,o){for(var r=0;r<o.length;r++){var t=o[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(s,t.key,t)}}function gt(s,o,r){return o&&yt(s.prototype,o),Object.defineProperty(s,"prototype",{writable:!1}),s}function N(){return N=Object.assign?Object.assign.bind():function(s){for(var o=1;o<arguments.length;o++){var r=arguments[o];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(s[t]=r[t])}return s},N.apply(this,arguments)}function wt(s,o){if(s==null)return{};var r={},t=Object.keys(s),a,d;for(d=0;d<t.length;d++)a=t[d],!(o.indexOf(a)>=0)&&(r[a]=s[a]);return r}var bt=0;function Te(s){return"__private_"+bt+++"_"+s}function S(s,o){if(!Object.prototype.hasOwnProperty.call(s,o))throw new TypeError("attempted to use private field on non-instance");return s}var Ct=`
1
+ (function(U,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],y):(U=typeof globalThis<"u"?globalThis:U||self,y(U["dashx-react"]={},U.React,U.ReactDOM))})(this,function(U,y,Ht){"use strict";function qt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const C=qt(y),Br=qt(Ht);var Hr=Object.defineProperty,qr=(e,t,r)=>t in e?Hr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,we=(e,t,r)=>(qr(e,typeof t!="symbol"?t+"":t,r),r),Vt=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},T=(e,t,r)=>(Vt(e,t,"read from private field"),r?r.call(e):t.get(e)),He=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},oe=(e,t,r,n)=>(Vt(e,t,"write to private field"),t.set(e,r),r);function Jt(e,t){return t=t||{},new Promise(function(r,n){var a=new XMLHttpRequest,o=[],c=[],u={},s=function(){return{ok:(a.status/100|0)==2,statusText:a.statusText,status:a.status,url:a.responseURL,text:function(){return Promise.resolve(a.responseText)},json:function(){return Promise.resolve(a.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([a.response]))},clone:s,headers:{keys:function(){return o},entries:function(){return c},get:function(l){return u[l.toLowerCase()]},has:function(l){return l.toLowerCase()in u}}}};for(var i in a.open(t.method||"get",e,!0),a.onload=function(){a.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(l,d,f){o.push(d=d.toLowerCase()),c.push([d,f]),u[d]=u[d]?u[d]+","+f:f}),r(s())},a.onerror=n,a.withCredentials=t.credentials=="include",t.headers)a.setRequestHeader(i,t.headers[i]);a.send(t.body||null)})}function Vr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Jr(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}),r}function zr(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var zt={exports:{}};const Xr={},Gr=Object.freeze(Object.defineProperty({__proto__:null,default:Xr},Symbol.toStringTag,{value:"Module"})),Yr=Jr(Gr);(function(e){(function(){var t,r=0,n=[],a;for(a=0;a<256;a++)n[a]=(a+256).toString(16).substr(1);s.BUFFER_SIZE=4096,s.bin=u,s.clearBuffer=function(){t=null,r=0},s.test=function(i){return typeof i=="string"?/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(i):!1};var o;typeof crypto<"u"?o=crypto:typeof window<"u"&&typeof window.msCrypto<"u"&&(o=window.msCrypto),typeof zr=="function"?(o=o||Yr,e.exports=s):typeof window<"u"&&(window.uuid=s),s.randomBytes=function(){if(o){if(o.randomBytes)return o.randomBytes;if(o.getRandomValues)return typeof Uint8Array.prototype.slice!="function"?function(i){var l=new Uint8Array(i);return o.getRandomValues(l),Array.from(l)}:function(i){var l=new Uint8Array(i);return o.getRandomValues(l),l}}return function(i){var l,d=[];for(l=0;l<i;l++)d.push(Math.floor(Math.random()*256));return d}}();function c(i){return(!t||r+i>s.BUFFER_SIZE)&&(r=0,t=s.randomBytes(s.BUFFER_SIZE)),t.slice(r,r+=i)}function u(){var i=c(16);return i[6]=i[6]&15|64,i[8]=i[8]&63|128,i}function s(){var i=u();return n[i[0]]+n[i[1]]+n[i[2]]+n[i[3]]+"-"+n[i[4]]+n[i[5]]+"-"+n[i[6]]+n[i[7]]+"-"+n[i[8]]+n[i[9]]+"-"+n[i[10]]+n[i[11]]+n[i[12]]+n[i[13]]+n[i[14]]+n[i[15]]}})()})(zt);var Kr=zt.exports;const gt=Vr(Kr),Qr=`
31
2
  mutation TrackEvent($input: TrackEventInput!) {
32
3
  trackEvent(input: $input) {
33
4
  success
34
5
  }
35
6
  }
36
- `,Et=`
7
+ `,Zr=`
8
+ mutation TrackNotification($input: TrackNotificationInput!) {
9
+ trackNotification(input: $input) {
10
+ success
11
+ }
12
+ }
13
+ `,en=`
14
+ query NotificationRecipientsList($filter: JSON!) {
15
+ notificationRecipientsList(filter: $filter) {
16
+ id
17
+ notificationId
18
+ contact
19
+ readAt
20
+
21
+ notification {
22
+ id
23
+ renderedContent
24
+ }
25
+ }
26
+ }
27
+ `,tn=`
37
28
  mutation IdentifyAccount($input: IdentifyAccountInput!) {
38
29
  identifyAccount(input: $input) {
39
30
  id
40
31
  }
41
32
  }
42
- `,Rt=`
33
+ `,rn=`
43
34
  mutation AddContent($input: AddContentInput!) {
44
35
  addContent(input: $input) {
45
36
  id
@@ -50,7 +41,7 @@ React keys must be passed directly to JSX without using spread:
50
41
  updatedAt
51
42
  }
52
43
  }
53
- `,_t=`
44
+ `,nn=`
54
45
  mutation EditContent($input: EditContentInput!) {
55
46
  editContent(input: $input) {
56
47
  id
@@ -61,15 +52,15 @@ React keys must be passed directly to JSX without using spread:
61
52
  updatedAt
62
53
  }
63
54
  }
64
- `,We=`
55
+ `,Xt=`
65
56
  query SearchContent($input: SearchContentInput!) {
66
57
  searchContent(input: $input)
67
58
  }
68
- `,Tt=`
59
+ `,an=`
69
60
  query FetchContent($input: FetchContentInput!) {
70
61
  fetchContent(input: $input)
71
62
  }
72
- `,Pt=`
63
+ `,on=`
73
64
  id
74
65
  name
75
66
  identifier
@@ -90,7 +81,7 @@ React keys must be passed directly to JSX without using spread:
90
81
  createdAt
91
82
  updatedAt
92
83
  }
93
- `,de=`
84
+ `,Pe=`
94
85
  id
95
86
  status
96
87
  subtotal
@@ -112,7 +103,7 @@ React keys must be passed directly to JSX without using spread:
112
103
  currencyCode
113
104
 
114
105
  item {
115
- `+Pt+`
106
+ ${on}
116
107
  }
117
108
  }
118
109
 
@@ -126,49 +117,49 @@ React keys must be passed directly to JSX without using spread:
126
117
  expiresAt
127
118
  }
128
119
  }
129
- `,St=`
120
+ `,sn=`
130
121
  mutation AddItemToCart($input: AddItemToCartInput) {
131
122
  addItemToCart(input:$input) {
132
- `+de+`
123
+ ${Pe}
133
124
  }
134
125
  }
135
- `,kt=`
126
+ `,un=`
136
127
  mutation ApplyCouponToCart($input: ApplyCouponToCartInput) {
137
128
  applyCouponToCart(input:$input) {
138
- `+de+`
129
+ ${Pe}
139
130
  }
140
131
  }
141
- `,At=`
132
+ `,cn=`
142
133
  mutation RemoveCouponFromCart($input: RemoveCouponFromCartInput) {
143
134
  removeCouponFromCart(input:$input) {
144
- `+de+`
135
+ ${Pe}
145
136
  }
146
137
  }
147
- `,Ot=`
138
+ `,ln=`
148
139
  query FetchCart($input: FetchCartInput!) {
149
140
  fetchCart(input: $input) {
150
- `+de+`
141
+ ${Pe}
151
142
  }
152
143
  }
153
- `,jt=`
144
+ `,fn=`
154
145
  mutation TransferCart($input: TransferCartInput!) {
155
146
  transferCart(input: $input) {
156
- `+de+`
147
+ ${Pe}
157
148
  }
158
149
  }
159
- `,It=`
150
+ `,dn=`
160
151
  query FetchStoredPreferences($input: FetchStoredPreferencesInput!) {
161
152
  fetchStoredPreferences(input: $input) {
162
153
  preferenceData
163
154
  }
164
155
  }
165
- `,$t=`
156
+ `,pn=`
166
157
  mutation SaveStoredPreferences($input: SaveStoredPreferencesInput!) {
167
158
  saveStoredPreferences(input: $input) {
168
159
  success
169
160
  }
170
161
  }
171
- `,xt=`
162
+ `,vn=`
172
163
  query FetchContacts($input: FetchContactsInput!) {
173
164
  fetchContacts(input: $input) {
174
165
  contacts {
@@ -186,7 +177,7 @@ React keys must be passed directly to JSX without using spread:
186
177
  }
187
178
  }
188
179
  }
189
- `,Ut=`
180
+ `,hn=`
190
181
  mutation SaveContacts($input: SaveContactsInput!) {
191
182
  saveContacts(input: $input) {
192
183
  contacts {
@@ -204,7 +195,7 @@ React keys must be passed directly to JSX without using spread:
204
195
  }
205
196
  }
206
197
  }
207
- `,Dt=`
198
+ `,mn=`
208
199
  mutation prepareAsset($input: PrepareAssetInput!) {
209
200
  prepareAsset(input: $input) {
210
201
  attributeId
@@ -224,7 +215,7 @@ React keys must be passed directly to JSX without using spread:
224
215
  workspaceId
225
216
  }
226
217
  }
227
- `,Lt=`
218
+ `,yn=`
228
219
  query Asset($id: ID!) {
229
220
  asset(id: $id) {
230
221
  attributeId
@@ -244,4 +235,180 @@ React keys must be passed directly to JSX without using spread:
244
235
  workspaceId
245
236
  }
246
237
  }
247
- `,qt="@dashx/browser",Ft="dashx-browser",Mt="0.1.29",Bt="DashX SDK for Browser",Nt="dist/index.js",Ht="dist/browser.esm.js",Wt=["dist"],Yt={build:"tsdx build --tsconfig tsconfig.json",start:"tsdx watch --tsconfig tsconfig.json --verbose --noClean",release:"yarn build && npm publish"},Vt={type:"git",url:"git+https://github.com/dashxhq/dashx-browser"},Gt=["dashx"],Xt="MIT",Kt={unfetch:"^4.2.0","uuid-random":"^1.3.2"},Jt={"@typescript-eslint/eslint-plugin":"^5.29.0","@typescript-eslint/parser":"^5.29.0",eslint:"^8.18.0","eslint-config-airbnb-typescript":"^17.0.0","eslint-plugin-import":"^2.26.0",tsdx:"^0.14.1",typescript:"^4.7.4"},Ye={name:qt,title:Ft,version:Mt,description:Bt,main:Nt,module:Ht,files:Wt,scripts:Yt,repository:Vt,keywords:Gt,license:Xt,dependencies:Kt,devDependencies:Jt};function zt(){return{height:window.screen.height,width:window.screen.width}}function Zt(){return{name:Ye.name,version:Ye.version}}function Qt(){return navigator.language}function er(){return{path:window.location.pathname,search:window.location.search,title:window.document.title,url:window.location.href}}function tr(){return Intl.DateTimeFormat().resolvedOptions().timeZone}function rr(){return{displayMetrics:zt(),library:Zt(),locale:Qt(),page:er(),timezone:tr()}}function Ve(s){s===void 0&&(s={});var o={};return Object.keys(s).forEach(function(r){var t;if(r.startsWith("_")){o[r.substring(1)]=s[r];return}o.data=N((t={},t[r]=s[r],t),o.data)}),o}var nr=function(){function s(r){this.options={},this.callback=r}var o=s.prototype;return o.limit=function(t){return this.options.limit=t,this},o.filter=function(t){return this.options.filter=Ve(t),this},o.order=function(t){return this.options.order=t,this},o.language=function(t){return this.options.language=t,this},o.fields=function(t){return this.options.fields=t,this},o.include=function(t){return this.options.include=t,this},o.exclude=function(t){return this.options.exclude=t,this},o.preview=function(t){return t===void 0&&(t=!0),this.options.preview=t,this},o.all=function(t){return this.options=N({},this.options,t,{returnType:"all"}),this.callback(this.options)},o.one=function(){var r=B(_().mark(function a(d){var p;return _().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return this.options=N({},this.options,d,{returnType:"one"}),f.next=3,this.callback(this.options);case 3:return p=f.sent,f.abrupt("return",Array.isArray(p)?p[0]:null);case 5:case"end":return f.stop()}},a,this)}));function t(a){return r.apply(this,arguments)}return t}(),s}(),Pe="dashx-sdk";function Se(s){var o=window.localStorage.getItem(Pe);if(!o)return null;var r=JSON.parse(o);return r[s]}function ke(s,o){var r=window.localStorage.getItem(Pe),t=r?JSON.parse(r):{};t[s]=o,window.localStorage.setItem(Pe,JSON.stringify(t))}var ar=["custom"],ir=5,or=3e3,D=Te("accountAnonymousUid"),k=Te("accountUid"),V=Te("identityToken"),ur=function(){function s(r){var t=r.publicKey,a=r.baseUri,d=a===void 0?"https://api.dashx.com/graphql":a,p=r.targetEnvironment;Object.defineProperty(this,D,{writable:!0,value:void 0}),Object.defineProperty(this,k,{writable:!0,value:void 0}),Object.defineProperty(this,V,{writable:!0,value:void 0}),S(this,k)[k]=null,S(this,V)[V]=null,this.baseUri=d,this.publicKey=t,this.targetEnvironment=p,this.context=rr(),this.loadIdentity()}var o=s.prototype;return o.makeHttpRequest=function(){var r=B(_().mark(function a(d,p){var c;return _().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Be(this.baseUri,{method:"POST",headers:N({"Content-Type":"application/json","X-Public-Key":this.publicKey},this.targetEnvironment?{"X-Target-Environment":this.targetEnvironment}:{},S(this,V)[V]?{"X-Identity-Token":S(this,V)[V]}:{}),body:JSON.stringify({query:d,variables:p})}).then(function(m){return m.json()});case 2:if(c=n.sent,!c.data){n.next=5;break}return n.abrupt("return",Promise.resolve(c.data));case 5:return n.abrupt("return",Promise.reject(c.errors));case 6:case"end":return n.stop()}},a,this)}));function t(a,d){return r.apply(this,arguments)}return t}(),o.loadIdentity=function(){this.accountAnonymousUid=Se("accountAnonymousUid")||_e(),this.accountUid=Se("accountUid")||null,this.identityToken=Se("identityToken")||null},o.identify=function(t){if(typeof t=="string"){this.accountUid=t;return}this.accountUid=t==null?void 0:t.uid;var a=N({uid:t==null?void 0:t.uid,anonymousUid:S(this,D)[D]},t);return this.makeHttpRequest(Et,{input:a}).then(function(d){return d==null?void 0:d.identifyAccount})},o.setIdentity=function(t,a){this.accountUid=t,this.identityToken=a},o.setAnonymousIdentity=function(t){this.accountAnonymousUid=t},o.reset=function(){this.accountAnonymousUid=_e(),this.accountUid=null,this.identityToken=null},o.track=function(t,a){var d={event:t,data:a,accountUid:S(this,k)[k],accountAnonymousUid:S(this,D)[D]};return this.makeHttpRequest(Ct,{input:d})},o.addContent=function(t,a){var d,p;if(t.includes("/")){var c=t.split("/");p=c[0],d=c[1]}else p=t;var f={content:d,contentType:p,data:a};return this.makeHttpRequest(Rt,{input:f})},o.editContent=function(t,a){var d,p;if(t.includes("/")){var c=t.split("/");p=c[0],d=c[1]}else p=t;var f={content:d,contentType:p,data:a};return this.makeHttpRequest(_t,{input:f})},o.searchContent=function(t,a){var d=this;if(!a)return new nr(function(f){return d.makeHttpRequest(We,{input:N({},f,{contentType:t})}).then(function(n){return n==null?void 0:n.searchContent})});var p=Ve(a.filter),c=this.makeHttpRequest(We,{input:N({},a,{contentType:t,filter:p})}).then(function(f){return f==null?void 0:f.searchContent});return a.returnType==="all"?c:c.then(function(f){return Array.isArray(f)?f[0]:null})},o.fetchContent=function(){var r=B(_().mark(function a(d,p){var c,f,n,m,b;return _().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:if(d.includes("/")){O.next=2;break}throw new Error("URN must be of form: {contentType}/{content}");case 2:return c=d.split("/"),f=c[0],n=c[1],m=N({content:n,contentType:f},p),O.next=6,this.makeHttpRequest(Tt,{input:m});case 6:return b=O.sent,O.abrupt("return",b==null?void 0:b.fetchContent);case 8:case"end":return O.stop()}},a,this)}));function t(a,d){return r.apply(this,arguments)}return t}(),o.addItemToCart=function(){var r=B(_().mark(function a(d){var p,c,f,n,m;return _().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return p=d.custom,c=p===void 0?{}:p,f=wt(d,ar),n=N({custom:c},f,{accountUid:S(this,k)[k],accountAnonymousUid:S(this,D)[D]}),E.next=4,this.makeHttpRequest(St,{input:n});case 4:return m=E.sent,E.abrupt("return",m==null?void 0:m.addItemToCart);case 6:case"end":return E.stop()}},a,this)}));function t(a){return r.apply(this,arguments)}return t}(),o.applyCouponToCart=function(){var r=B(_().mark(function a(d){var p,c;return _().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return p=N({},d,{accountUid:S(this,k)[k],accountAnonymousUid:S(this,D)[D]}),n.next=3,this.makeHttpRequest(kt,{input:p});case 3:return c=n.sent,n.abrupt("return",c==null?void 0:c.applyCouponToCart);case 5:case"end":return n.stop()}},a,this)}));function t(a){return r.apply(this,arguments)}return t}(),o.removeCouponFromCart=function(){var r=B(_().mark(function a(d){var p,c;return _().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return p=N({},d,{accountUid:S(this,k)[k],accountAnonymousUid:S(this,D)[D]}),n.next=3,this.makeHttpRequest(At,{input:p});case 3:return c=n.sent,n.abrupt("return",c==null?void 0:c.removeCouponFromCart);case 5:case"end":return n.stop()}},a,this)}));function t(a){return r.apply(this,arguments)}return t}(),o.fetchCart=function(){var r=B(_().mark(function a(d){var p,c;return _().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return p=N({},d,{accountUid:S(this,k)[k],accountAnonymousUid:S(this,D)[D]}),n.next=3,this.makeHttpRequest(Ot,{input:p});case 3:return c=n.sent,n.abrupt("return",c==null?void 0:c.fetchCart);case 5:case"end":return n.stop()}},a,this)}));function t(a){return r.apply(this,arguments)}return t}(),o.transferCart=function(){var r=B(_().mark(function a(d){var p,c;return _().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return p=N({},d,{accountUid:S(this,k)[k],accountAnonymousUid:S(this,D)[D]}),n.next=3,this.makeHttpRequest(jt,{input:p});case 3:return c=n.sent,n.abrupt("return",c==null?void 0:c.transferCart);case 5:case"end":return n.stop()}},a,this)}));function t(a){return r.apply(this,arguments)}return t}(),o.fetchStoredPreferences=function(){var r=B(_().mark(function a(){var d,p;return _().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return d={accountUid:S(this,k)[k]},f.next=3,this.makeHttpRequest(It,{input:d});case 3:return p=f.sent,f.abrupt("return",p==null?void 0:p.fetchStoredPreferences.preferenceData);case 5:case"end":return f.stop()}},a,this)}));function t(){return r.apply(this,arguments)}return t}(),o.saveStoredPreferences=function(){var r=B(_().mark(function a(d){var p,c;return _().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return p={accountUid:S(this,k)[k],preferenceData:d},n.next=3,this.makeHttpRequest($t,{input:p});case 3:return c=n.sent,n.abrupt("return",c==null?void 0:c.saveStoredPreferences);case 5:case"end":return n.stop()}},a,this)}));function t(a){return r.apply(this,arguments)}return t}(),o.fetchContacts=function(){var r=B(_().mark(function a(){var d,p;return _().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return d={uid:S(this,k)[k]},f.next=3,this.makeHttpRequest(xt,{input:d});case 3:return p=f.sent,f.abrupt("return",p==null?void 0:p.fetchContacts.contacts);case 5:case"end":return f.stop()}},a,this)}));function t(){return r.apply(this,arguments)}return t}(),o.saveContacts=function(){var r=B(_().mark(function a(d){var p,c;return _().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return p={uid:S(this,k)[k],contacts:d},n.next=3,this.makeHttpRequest(Ut,{input:p});case 3:return c=n.sent,n.abrupt("return",c==null?void 0:c.saveContacts);case 5:case"end":return n.stop()}},a,this)}));function t(a){return r.apply(this,arguments)}return t}(),o.upload=function(){var r=B(_().mark(function a(d){var p,c,f,n,m=this,b,E,O,Z,G,Q,q,j,te;return _().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:return b=d.file,E=d.attribute,O=d.resource,Z={name:b.name,size:b.size,mimeType:b.type,attribute:E,resource:O,targetEnvironment:this.targetEnvironment},K.next=4,this.makeHttpRequest(Dt,{input:Z});case 4:if(G=K.sent,Q=G==null||(p=G.prepareAsset)==null?void 0:p.id,q=G==null||(c=G.prepareAsset)==null||(f=c.data)==null||(n=f.upload)==null?void 0:n.url,!(!q||!Q)){K.next=9;break}throw new Error("Something went wrong");case 9:return K.next=11,Be(q,{method:"PUT",body:b,headers:{"Content-Type":b.type,"x-goog-meta-origin-id":Q}});case 11:return j=ir,te=function(){var ie=B(_().mark(function ne(){var re,ae;return _().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,m.getAsset({id:Q});case 2:if(re=i.sent,ae=re==null?void 0:re.uploadStatus,ae!=="UPLOADED"){i.next=6;break}return i.abrupt("return",Promise.resolve(re));case 6:return i.next=8,new Promise(function(y){return setTimeout(y,or)});case 8:if(j--,j){i.next=11;break}return i.abrupt("return",Promise.reject("Something went wrong."));case 11:return i.abrupt("return",te());case 12:case"end":return i.stop()}},ne)}));return function(){return ie.apply(this,arguments)}}(),K.abrupt("return",te());case 14:case"end":return K.stop()}},a,this)}));function t(a){return r.apply(this,arguments)}return t}(),o.getAsset=function(){var r=B(_().mark(function a(d){var p,c;return _().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return p=d.id,n.next=3,this.makeHttpRequest(Lt,{id:p});case 3:return c=n.sent,n.abrupt("return",c==null?void 0:c.asset);case 5:case"end":return n.stop()}},a,this)}));function t(a){return r.apply(this,arguments)}return t}(),gt(s,[{key:"accountAnonymousUid",set:function(t){if(!_e.test(t))throw new Error("Anonymous UID must be a valid UUID");S(this,D)[D]=t,ke("accountAnonymousUid",S(this,D)[D])}},{key:"accountUid",set:function(t){t==null?S(this,k)[k]=t:S(this,k)[k]=String(t),ke("accountUid",S(this,k)[k])}},{key:"identityToken",set:function(t){t==null?S(this,V)[V]=t:S(this,V)[V]=String(t),ke("identityToken",S(this,V)[V])}}]),s}(),sr=function(s){return new ur(s)},Ae={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Ge=M.createContext(null);function cr({children:s,publicKey:o,baseUri:r,targetEnvironment:t}){const a=M.useMemo(()=>sr({publicKey:o||Ae.REACT_APP_DASHX_PUBLIC_KEY,baseUri:r||Ae.REACT_APP_DASHX_BASE_URI,targetEnvironment:t||Ae.REACT_APP_TARGET_ENVIRONMENT}),[o,r,t]);return U.jsx(Ge.Provider,{value:a,children:s})}const Xe=()=>{const s=M.useContext(Ge);if(!s)throw new Error("DashXProvider not initialized. Make sure your app is wrapped in DashXProvider.");return s},fr=({preference:s,onChange:o})=>{const r=t=>{o(t,s)};return U.jsxs("div",{children:[U.jsx("p",{children:s[0]}),U.jsxs("label",{children:["Email",U.jsx("input",{name:"email",type:"checkbox",defaultChecked:s[1].email,onChange:r})]}),U.jsxs("label",{children:["Push",U.jsx("input",{name:"push",type:"checkbox",defaultChecked:s[1].push,onChange:r})]}),U.jsxs("label",{children:["SMS",U.jsx("input",{name:"sms",type:"checkbox",defaultChecked:s[1].sms,onChange:r})]}),U.jsxs("label",{children:["Whatsapp",U.jsx("input",{name:"whatsapp",type:"checkbox",defaultChecked:s[1].whatsapp,onChange:r})]}),U.jsx("br",{})]})};function Ke({preference:s,onChange:o,renderPreference:r=fr}){return r({preference:s,onChange:o})}const lr=({preferences:s,onChange:o,loading:r})=>s?U.jsx(U.Fragment,{children:s.map(t=>U.jsx(Ke,{preference:t,onChange:o},t[0]))}):r?U.jsx(U.Fragment,{children:"Loading..."}):U.jsx(U.Fragment,{children:"An unexpected error ocurred"});function dr({renderPreferences:s=lr}){const o=Xe(),[r,t]=M.useState(null),[a,d]=M.useState(!0),[p,c]=M.useState(null),[f,n]=M.useState(!1),m=(b,E)=>{n(!0);const[O,Z]=E;t(G=>({...G||{},[O]:{...Z,[b.target.name]:b.target.checked}}))};return M.useEffect(()=>{if(!f)return;const b=setTimeout(async()=>{await o.saveStoredPreferences(r),n(!1)},100);return()=>clearTimeout(b)},[r,f,o]),M.useEffect(()=>{async function b(){d(!0);try{const E=await o.fetchStoredPreferences();t(E)}catch(E){c(E)}finally{d(!1)}}b()},[o]),s({preferences:r&&Object.entries(r).map(([b,E])=>[b,E]),onChange:m,loading:a,error:p})}ee.DashXProvider=cr,ee.Preference=Ke,ee.Preferences=dr,ee.useDashXProvider=Xe,Object.defineProperty(ee,Symbol.toStringTag,{value:"Module"})});
238
+ `;function Gt(e={}){const t={};return Object.keys(e).forEach(r=>{if(r.startsWith("_")){t[r.substring(1)]=e[r];return}t.data={[r]:e[r],...t.data}}),t}class gn{constructor(t){we(this,"options"),we(this,"callback"),this.options={},this.callback=t}limit(t){return this.options.limit=t,this}filter(t){return this.options.filter=Gt(t),this}order(t){return this.options.order=t,this}language(t){return this.options.language=t,this}fields(t){return this.options.fields=t,this}include(t){return this.options.include=t,this}exclude(t){return this.options.exclude=t,this}preview(t=!0){return this.options.preview=t,this}all(t){return this.options={...this.options,...t,returnType:"all"},this.callback(this.options)}async one(t){this.options={...this.options,...t,returnType:"one"};const r=await this.callback(this.options);return Array.isArray(r)?r[0]:null}}const bn="@dashx/browser",wn="dashx-browser",Sn="0.1.30",En="DashX SDK for Browser",On="module",Cn=["dist"],_n="./dist/index.umd.js",Tn="./dist/index.es.js",An="./dist/index.es.d.ts",Pn={".":{import:"./dist/index.es.js",require:"./dist/index.umd.c.jsjs",types:"./dist/index.es.d.ts"}},kn={dev:"vite",build:"tsc && vite build",preview:"vite preview"},In={type:"git",url:"git+https://github.com/dashxhq/dashx-browser"},xn=["dashx"],Nn="MIT",Mn={unfetch:"4.2.0","uuid-random":"^1.3.2"},Dn={"@types/node":"^20.12.12","@typescript-eslint/eslint-plugin":"^7.9.0","@typescript-eslint/parser":"^7.9.0",eslint:"^9.2.0","eslint-config-airbnb-typescript":"^18.0.0","eslint-plugin-import":"^2.29.1",typescript:"^5.4.5",vite:"^5.2.0","vite-plugin-dts":"^3.9.1"},Yt={name:bn,title:wn,version:Sn,description:En,type:On,files:Cn,main:_n,module:Tn,types:An,exports:Pn,scripts:kn,repository:In,keywords:xn,license:Nn,dependencies:Mn,devDependencies:Dn};function jn(){return{height:window.screen.height,width:window.screen.width}}function Un(){return{name:Yt.name,version:Yt.version}}function $n(){return navigator.language}function Ln(){return{path:window.location.pathname,search:window.location.search,title:window.document.title,url:window.location.href}}function Rn(){return Intl.DateTimeFormat().resolvedOptions().timeZone}function Wn(){return{displayMetrics:jn(),library:Un(),locale:$n(),page:Ln(),timezone:Rn()}}const bt="dashx-sdk";function wt(e){const t=window.localStorage.getItem(bt);return t?JSON.parse(t)[e]:null}function St(e,t){const r=window.localStorage.getItem(bt),n=r?JSON.parse(r):{};n[e]=t,window.localStorage.setItem(bt,JSON.stringify(n))}const Fn=5,Bn=3e3;var ke=(e=>(e.SUBSCRIBE="SUBSCRIBE",e.IN_APP_NOTIFICATION="IN_APP_NOTIFICATION",e.INVALID="INVALID",e))(ke||{}),H,D,ee,Se;class Hn{constructor({publicKey:t,baseUri:r="https://api.dashx.com/graphql",targetEnvironment:n}){He(this,H,void 0),He(this,D,null),He(this,ee,null),He(this,Se,null),we(this,"targetEnvironment"),we(this,"context"),we(this,"publicKey"),we(this,"baseUri"),this.baseUri=r,this.publicKey=t,this.targetEnvironment=n,this.context=Wn(),this.loadIdentity()}get accountAnonymousUid(){return T(this,H)}set accountAnonymousUid(t){if(!gt.test(t))throw new Error("Anonymous UID must be a valid UUID");oe(this,H,t),St("accountAnonymousUid",T(this,H))}get accountUid(){return T(this,D)}set accountUid(t){t==null?oe(this,D,t):oe(this,D,String(t)),St("accountUid",T(this,D))}get identityToken(){return T(this,ee)}set identityToken(t){t==null?oe(this,ee,t):oe(this,ee,String(t)),St("identityToken",T(this,ee))}get inAppChannel(){return T(this,Se)}set inAppChannel(t){t==null?oe(this,Se,t):oe(this,ee,String(t))}async makeHttpRequest(t,r){const n=await Jt(this.baseUri,{method:"POST",headers:{"Content-Type":"application/json","X-Public-Key":this.publicKey,...this.targetEnvironment?{"X-Target-Environment":this.targetEnvironment}:{},...T(this,ee)?{"X-Identity-Token":T(this,ee)}:{}},body:JSON.stringify({query:t,variables:r})}).then(a=>a.json());return n.data?Promise.resolve(n.data):Promise.reject(n.errors)}loadIdentity(){this.accountAnonymousUid=wt("accountAnonymousUid")||gt(),this.accountUid=wt("accountUid")||null,this.identityToken=wt("identityToken")||null}identify(t){if(typeof t=="string"){this.accountUid=t;return}this.accountUid=t==null?void 0:t.uid;const r={uid:t==null?void 0:t.uid,anonymousUid:T(this,H),...t};return this.makeHttpRequest(tn,{input:r}).then(n=>n==null?void 0:n.identifyAccount)}setIdentity(t,r){this.accountUid=t,this.identityToken=r,this.inAppChannel=`dashx:account:${r}`}setAnonymousIdentity(t){this.accountAnonymousUid=t}reset(){this.accountAnonymousUid=gt(),this.accountUid=null,this.identityToken=null,oe(this,Se,null)}track(t,r){const n={event:t,data:r,accountUid:T(this,D),accountAnonymousUid:T(this,H)};return this.makeHttpRequest(Qr,{input:n})}trackNotification({id:t,status:r,timestamp:n}){return this.makeHttpRequest(Zr,{input:{id:t,status:r,timestamp:n||new Date}})}listInAppNotifications(){return this.inAppChannel?this.makeHttpRequest(en,{filter:{channel:T(this,Se)}}):(console.error("InApp notifications can be fetched only for identified users."),Promise.resolve([]))}addContent(t,r){let n,a;t.includes("/")?[a,n]=t.split("/"):a=t;const o={content:n,contentType:a,data:r};return this.makeHttpRequest(rn,{input:o})}editContent(t,r){let n,a;t.includes("/")?[a,n]=t.split("/"):a=t;const o={content:n,contentType:a,data:r};return this.makeHttpRequest(nn,{input:o})}searchContent(t,r){if(!r)return new gn(o=>this.makeHttpRequest(Xt,{input:{...o,contentType:t}}).then(c=>c==null?void 0:c.searchContent));const n=Gt(r.filter),a=this.makeHttpRequest(Xt,{input:{...r,contentType:t,filter:n}}).then(o=>o==null?void 0:o.searchContent);return r.returnType==="all"?a:a.then(o=>Array.isArray(o)?o[0]:null)}async fetchContent(t,r){if(!t.includes("/"))throw new Error("URN must be of form: {contentType}/{content}");const[n,a]=t.split("/"),o={content:a,contentType:n,...r},c=await this.makeHttpRequest(an,{input:o});return c==null?void 0:c.fetchContent}async addItemToCart({custom:t={},...r}){const n={custom:t,...r,accountUid:T(this,D),accountAnonymousUid:T(this,H)},a=await this.makeHttpRequest(sn,{input:n});return a==null?void 0:a.addItemToCart}async applyCouponToCart(t){const r={...t,accountUid:T(this,D),accountAnonymousUid:T(this,H)},n=await this.makeHttpRequest(un,{input:r});return n==null?void 0:n.applyCouponToCart}async removeCouponFromCart(t){const r={...t,accountUid:T(this,D),accountAnonymousUid:T(this,H)},n=await this.makeHttpRequest(cn,{input:r});return n==null?void 0:n.removeCouponFromCart}async fetchCart(t){const r={...t,accountUid:T(this,D),accountAnonymousUid:T(this,H)},n=await this.makeHttpRequest(ln,{input:r});return n==null?void 0:n.fetchCart}async transferCart(t){const r={...t,accountUid:T(this,D),accountAnonymousUid:T(this,H)},n=await this.makeHttpRequest(fn,{input:r});return n==null?void 0:n.transferCart}async fetchStoredPreferences(){const t={accountUid:T(this,D)},r=await this.makeHttpRequest(dn,{input:t});return r==null?void 0:r.fetchStoredPreferences.preferenceData}async saveStoredPreferences(t){const r={accountUid:T(this,D),preferenceData:t},n=await this.makeHttpRequest(pn,{input:r});return n==null?void 0:n.saveStoredPreferences}async fetchContacts(){const t={uid:T(this,D)},r=await this.makeHttpRequest(vn,{input:t});return r==null?void 0:r.fetchContacts.contacts}async saveContacts(t){const r={uid:T(this,D),contacts:t},n=await this.makeHttpRequest(hn,{input:r});return n==null?void 0:n.saveContacts}async upload(t){var r,n,a,o;const{file:c,attribute:u,resource:s}=t,i={name:c.name,size:c.size,mimeType:c.type,attribute:u,resource:s,targetEnvironment:this.targetEnvironment},l=await this.makeHttpRequest(mn,{input:i}),d=(r=l==null?void 0:l.prepareAsset)==null?void 0:r.id,f=(o=(a=(n=l==null?void 0:l.prepareAsset)==null?void 0:n.data)==null?void 0:a.upload)==null?void 0:o.url;if(!f||!d)throw new Error("Something went wrong");await Jt(f,{method:"PUT",body:c,headers:{"Content-Type":c.type,"x-goog-meta-origin-id":d}});let p=Fn;const m=async()=>{const h=await this.getAsset({id:d});return(h==null?void 0:h.uploadStatus)==="UPLOADED"?Promise.resolve(h):(await new Promise(v=>setTimeout(v,Bn)),p--,p?m():Promise.reject("Something went wrong."))};return m()}async getAsset(t){const{id:r}=t,n=await this.makeHttpRequest(yn,{id:r});return n==null?void 0:n.asset}}H=new WeakMap,D=new WeakMap,ee=new WeakMap,Se=new WeakMap;const qn=e=>new Hn(e),Kt=y.createContext(null);function Vn({children:e,publicKey:t,baseUri:r,targetEnvironment:n}){const a=y.useMemo(()=>qn({publicKey:t,baseUri:r,targetEnvironment:n}),[t,r,n]);return y.createElement(Kt.Provider,{value:a},e)}const Et=()=>{const e=y.useContext(Kt);if(!e)throw new Error("DashXProvider not initialized. Make sure your app is wrapped in DashXProvider.");return e},Qt=()=>{let e=Et();const[t,r]=y.useState([]);return y.useEffect(()=>{e.listInAppNotifications().then(n=>r(n)).catch(n=>console.error(n))},[e]),{client:e,notifications:t}};let Jn={data:""},zn=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||Jn,Xn=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Gn=/\/\*[^]*?\*\/| +/g,Zt=/\n+/g,ie=(e,t)=>{let r="",n="",a="";for(let o in e){let c=e[o];o[0]=="@"?o[1]=="i"?r=o+" "+c+";":n+=o[1]=="f"?ie(c,o):o+"{"+ie(c,o[1]=="k"?"":t)+"}":typeof c=="object"?n+=ie(c,t?t.replace(/([^,])+/g,u=>o.replace(/(^:.*)|([^,])+/g,s=>/&/.test(s)?s.replace(/&/g,u):u?u+" "+s:s)):o):c!=null&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),a+=ie.p?ie.p(o,c):o+":"+c+";")}return r+(t&&a?t+"{"+a+"}":a)+n},te={},er=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+er(e[r]);return t}return e},Yn=(e,t,r,n,a)=>{let o=er(e),c=te[o]||(te[o]=(s=>{let i=0,l=11;for(;i<s.length;)l=101*l+s.charCodeAt(i++)>>>0;return"go"+l})(o));if(!te[c]){let s=o!==e?e:(i=>{let l,d,f=[{}];for(;l=Xn.exec(i.replace(Gn,""));)l[4]?f.shift():l[3]?(d=l[3].replace(Zt," ").trim(),f.unshift(f[0][d]=f[0][d]||{})):f[0][l[1]]=l[2].replace(Zt," ").trim();return f[0]})(e);te[c]=ie(a?{["@keyframes "+c]:s}:s,r?"":"."+c)}let u=r&&te.g?te.g:null;return r&&(te.g=te[c]),((s,i,l,d)=>{d?i.data=i.data.replace(d,s):i.data.indexOf(s)===-1&&(i.data=l?s+i.data:i.data+s)})(te[c],t,n,u),c},Kn=(e,t,r)=>e.reduce((n,a,o)=>{let c=t[o];if(c&&c.call){let u=c(r),s=u&&u.props&&u.props.className||/^go/.test(u)&&u;c=s?"."+s:u&&typeof u=="object"?u.props?"":ie(u,""):u===!1?"":u}return n+a+(c??"")},"");function qe(e){let t=this||{},r=e.call?e(t.p):e;return Yn(r.unshift?r.raw?Kn(r,[].slice.call(arguments,1),t.p):r.reduce((n,a)=>Object.assign(n,a&&a.call?a(t.p):a),{}):r,zn(t.target),t.g,t.o,t.k)}let tr,Ot,Ct;qe.bind({g:1});let re=qe.bind({k:1});function Qn(e,t,r,n){ie.p=t,tr=e,Ot=r,Ct=n}function se(e,t){let r=this||{};return function(){let n=arguments;function a(o,c){let u=Object.assign({},o),s=u.className||a.className;r.p=Object.assign({theme:Ot&&Ot()},u),r.o=/ *go\d+/.test(s),u.className=qe.apply(r,n)+(s?" "+s:"");let i=e;return e[0]&&(i=u.as||e,delete u.as),Ct&&i[0]&&Ct(u),tr(i,u)}return a}}var Zn=e=>typeof e=="function",Ve=(e,t)=>Zn(e)?e(t):e,ea=(()=>{let e=0;return()=>(++e).toString()})(),rr=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),ta=20,Je=new Map,ra=1e3,nr=e=>{if(Je.has(e))return;let t=setTimeout(()=>{Je.delete(e),pe({type:4,toastId:e})},ra);Je.set(e,t)},na=e=>{let t=Je.get(e);t&&clearTimeout(t)},_t=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,ta)};case 1:return t.toast.id&&na(t.toast.id),{...e,toasts:e.toasts.map(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case 2:let{toast:r}=t;return e.toasts.find(o=>o.id===r.id)?_t(e,{type:1,toast:r}):_t(e,{type:0,toast:r});case 3:let{toastId:n}=t;return n?nr(n):e.toasts.forEach(o=>{nr(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===n||n===void 0?{...o,visible:!1}:o)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let a=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(o=>({...o,pauseDuration:o.pauseDuration+a}))}}},ze=[],Xe={toasts:[],pausedAt:void 0},pe=e=>{Xe=_t(Xe,e),ze.forEach(t=>{t(Xe)})},aa={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},oa=(e={})=>{let[t,r]=y.useState(Xe);y.useEffect(()=>(ze.push(r),()=>{let a=ze.indexOf(r);a>-1&&ze.splice(a,1)}),[t]);let n=t.toasts.map(a=>{var o,c;return{...e,...e[a.type],...a,duration:a.duration||((o=e[a.type])==null?void 0:o.duration)||(e==null?void 0:e.duration)||aa[a.type],style:{...e.style,...(c=e[a.type])==null?void 0:c.style,...a.style}}});return{...t,toasts:n}},ia=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:(r==null?void 0:r.id)||ea()}),Ie=e=>(t,r)=>{let n=ia(t,e,r);return pe({type:2,toast:n}),n.id},W=(e,t)=>Ie("blank")(e,t);W.error=Ie("error"),W.success=Ie("success"),W.loading=Ie("loading"),W.custom=Ie("custom"),W.dismiss=e=>{pe({type:3,toastId:e})},W.remove=e=>pe({type:4,toastId:e}),W.promise=(e,t,r)=>{let n=W.loading(t.loading,{...r,...r==null?void 0:r.loading});return e.then(a=>(W.success(Ve(t.success,a),{id:n,...r,...r==null?void 0:r.success}),a)).catch(a=>{W.error(Ve(t.error,a),{id:n,...r,...r==null?void 0:r.error})}),e};var sa=(e,t)=>{pe({type:1,toast:{id:e,height:t}})},ua=()=>{pe({type:5,time:Date.now()})},ca=e=>{let{toasts:t,pausedAt:r}=oa(e);y.useEffect(()=>{if(r)return;let o=Date.now(),c=t.map(u=>{if(u.duration===1/0)return;let s=(u.duration||0)+u.pauseDuration-(o-u.createdAt);if(s<0){u.visible&&W.dismiss(u.id);return}return setTimeout(()=>W.dismiss(u.id),s)});return()=>{c.forEach(u=>u&&clearTimeout(u))}},[t,r]);let n=y.useCallback(()=>{r&&pe({type:6,time:Date.now()})},[r]),a=y.useCallback((o,c)=>{let{reverseOrder:u=!1,gutter:s=8,defaultPosition:i}=c||{},l=t.filter(p=>(p.position||i)===(o.position||i)&&p.height),d=l.findIndex(p=>p.id===o.id),f=l.filter((p,m)=>m<d&&p.visible).length;return l.filter(p=>p.visible).slice(...u?[f+1]:[0,f]).reduce((p,m)=>p+(m.height||0)+s,0)},[t]);return{toasts:t,handlers:{updateHeight:sa,startPause:ua,endPause:n,calculateOffset:a}}},la=re`
239
+ from {
240
+ transform: scale(0) rotate(45deg);
241
+ opacity: 0;
242
+ }
243
+ to {
244
+ transform: scale(1) rotate(45deg);
245
+ opacity: 1;
246
+ }`,fa=re`
247
+ from {
248
+ transform: scale(0);
249
+ opacity: 0;
250
+ }
251
+ to {
252
+ transform: scale(1);
253
+ opacity: 1;
254
+ }`,da=re`
255
+ from {
256
+ transform: scale(0) rotate(90deg);
257
+ opacity: 0;
258
+ }
259
+ to {
260
+ transform: scale(1) rotate(90deg);
261
+ opacity: 1;
262
+ }`,pa=se("div")`
263
+ width: 20px;
264
+ opacity: 0;
265
+ height: 20px;
266
+ border-radius: 10px;
267
+ background: ${e=>e.primary||"#ff4b4b"};
268
+ position: relative;
269
+ transform: rotate(45deg);
270
+
271
+ animation: ${la} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
272
+ forwards;
273
+ animation-delay: 100ms;
274
+
275
+ &:after,
276
+ &:before {
277
+ content: '';
278
+ animation: ${fa} 0.15s ease-out forwards;
279
+ animation-delay: 150ms;
280
+ position: absolute;
281
+ border-radius: 3px;
282
+ opacity: 0;
283
+ background: ${e=>e.secondary||"#fff"};
284
+ bottom: 9px;
285
+ left: 4px;
286
+ height: 2px;
287
+ width: 12px;
288
+ }
289
+
290
+ &:before {
291
+ animation: ${da} 0.15s ease-out forwards;
292
+ animation-delay: 180ms;
293
+ transform: rotate(90deg);
294
+ }
295
+ `,va=re`
296
+ from {
297
+ transform: rotate(0deg);
298
+ }
299
+ to {
300
+ transform: rotate(360deg);
301
+ }
302
+ `,ha=se("div")`
303
+ width: 12px;
304
+ height: 12px;
305
+ box-sizing: border-box;
306
+ border: 2px solid;
307
+ border-radius: 100%;
308
+ border-color: ${e=>e.secondary||"#e0e0e0"};
309
+ border-right-color: ${e=>e.primary||"#616161"};
310
+ animation: ${va} 1s linear infinite;
311
+ `,ma=re`
312
+ from {
313
+ transform: scale(0) rotate(45deg);
314
+ opacity: 0;
315
+ }
316
+ to {
317
+ transform: scale(1) rotate(45deg);
318
+ opacity: 1;
319
+ }`,ya=re`
320
+ 0% {
321
+ height: 0;
322
+ width: 0;
323
+ opacity: 0;
324
+ }
325
+ 40% {
326
+ height: 0;
327
+ width: 6px;
328
+ opacity: 1;
329
+ }
330
+ 100% {
331
+ opacity: 1;
332
+ height: 10px;
333
+ }`,ga=se("div")`
334
+ width: 20px;
335
+ opacity: 0;
336
+ height: 20px;
337
+ border-radius: 10px;
338
+ background: ${e=>e.primary||"#61d345"};
339
+ position: relative;
340
+ transform: rotate(45deg);
341
+
342
+ animation: ${ma} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
343
+ forwards;
344
+ animation-delay: 100ms;
345
+ &:after {
346
+ content: '';
347
+ box-sizing: border-box;
348
+ animation: ${ya} 0.2s ease-out forwards;
349
+ opacity: 0;
350
+ animation-delay: 200ms;
351
+ position: absolute;
352
+ border-right: 2px solid;
353
+ border-bottom: 2px solid;
354
+ border-color: ${e=>e.secondary||"#fff"};
355
+ bottom: 6px;
356
+ left: 6px;
357
+ height: 10px;
358
+ width: 6px;
359
+ }
360
+ `,ba=se("div")`
361
+ position: absolute;
362
+ `,wa=se("div")`
363
+ position: relative;
364
+ display: flex;
365
+ justify-content: center;
366
+ align-items: center;
367
+ min-width: 20px;
368
+ min-height: 20px;
369
+ `,Sa=re`
370
+ from {
371
+ transform: scale(0.6);
372
+ opacity: 0.4;
373
+ }
374
+ to {
375
+ transform: scale(1);
376
+ opacity: 1;
377
+ }`,Ea=se("div")`
378
+ position: relative;
379
+ transform: scale(0.6);
380
+ opacity: 0.4;
381
+ min-width: 20px;
382
+ animation: ${Sa} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
383
+ forwards;
384
+ `,Oa=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?C.createElement(Ea,null,t):t:r==="blank"?null:C.createElement(wa,null,C.createElement(ha,{...n}),r!=="loading"&&C.createElement(ba,null,r==="error"?C.createElement(pa,{...n}):C.createElement(ga,{...n})))},Ca=e=>`
385
+ 0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
386
+ 100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
387
+ `,_a=e=>`
388
+ 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
389
+ 100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
390
+ `,Ta="0%{opacity:0;} 100%{opacity:1;}",Aa="0%{opacity:1;} 100%{opacity:0;}",Pa=se("div")`
391
+ display: flex;
392
+ align-items: center;
393
+ background: #fff;
394
+ color: #363636;
395
+ line-height: 1.3;
396
+ will-change: transform;
397
+ box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
398
+ max-width: 350px;
399
+ pointer-events: auto;
400
+ padding: 8px 10px;
401
+ border-radius: 8px;
402
+ `,ka=se("div")`
403
+ display: flex;
404
+ justify-content: center;
405
+ margin: 4px 10px;
406
+ color: inherit;
407
+ flex: 1 1 auto;
408
+ white-space: pre-line;
409
+ `,Ia=(e,t)=>{let r=e.includes("top")?1:-1,[n,a]=rr()?[Ta,Aa]:[Ca(r),_a(r)];return{animation:t?`${re(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${re(a)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},xa=C.memo(({toast:e,position:t,style:r,children:n})=>{let a=e.height?Ia(e.position||t||"top-center",e.visible):{opacity:0},o=C.createElement(Oa,{toast:e}),c=C.createElement(ka,{...e.ariaProps},Ve(e.message,e));return C.createElement(Pa,{className:e.className,style:{...a,...r,...e.style}},typeof n=="function"?n({icon:o,message:c}):C.createElement(C.Fragment,null,o,c))});Qn(C.createElement);var Na=({id:e,className:t,style:r,onHeightUpdate:n,children:a})=>{let o=C.useCallback(c=>{if(c){let u=()=>{let s=c.getBoundingClientRect().height;n(e,s)};u(),new MutationObserver(u).observe(c,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return C.createElement("div",{ref:o,className:t,style:r},a)},Ma=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},a=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:rr()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...a}},Da=qe`
410
+ z-index: 9999;
411
+ > * {
412
+ pointer-events: auto;
413
+ }
414
+ `,Ge=16,ja=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:a,containerStyle:o,containerClassName:c})=>{let{toasts:u,handlers:s}=ca(r);return C.createElement("div",{style:{position:"fixed",zIndex:9999,top:Ge,left:Ge,right:Ge,bottom:Ge,pointerEvents:"none",...o},className:c,onMouseEnter:s.startPause,onMouseLeave:s.endPause},u.map(i=>{let l=i.position||t,d=s.calculateOffset(i,{reverseOrder:e,gutter:n,defaultPosition:t}),f=Ma(l,d);return C.createElement(Na,{id:i.id,key:i.id,onHeightUpdate:s.updateHeight,className:i.visible?Da:"",style:f},i.type==="custom"?Ve(i.message,i):a?a(i):C.createElement(xa,{toast:i,position:l}))}))},Ua=W,I=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ar(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var or={},Ee={},z={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isEventSourceSupported=e.isReactNative=e.ReadyState=e.DEFAULT_HEARTBEAT=e.UNPARSABLE_JSON_OBJECT=e.DEFAULT_RECONNECT_INTERVAL_MS=e.DEFAULT_RECONNECT_LIMIT=e.SOCKET_IO_PING_CODE=e.SOCKET_IO_PATH=e.SOCKET_IO_PING_INTERVAL=e.DEFAULT_EVENT_SOURCE_OPTIONS=e.EMPTY_EVENT_HANDLERS=e.DEFAULT_OPTIONS=void 0;var t=1,r=1e3*t;e.DEFAULT_OPTIONS={},e.EMPTY_EVENT_HANDLERS={},e.DEFAULT_EVENT_SOURCE_OPTIONS={withCredentials:!1,events:e.EMPTY_EVENT_HANDLERS},e.SOCKET_IO_PING_INTERVAL=25*r,e.SOCKET_IO_PATH="/socket.io/?EIO=3&transport=websocket",e.SOCKET_IO_PING_CODE="2",e.DEFAULT_RECONNECT_LIMIT=20,e.DEFAULT_RECONNECT_INTERVAL_MS=5e3,e.UNPARSABLE_JSON_OBJECT={},e.DEFAULT_HEARTBEAT={message:"ping",timeout:6e4,interval:25e3},function(a){a[a.UNINSTANTIATED=-1]="UNINSTANTIATED",a[a.CONNECTING=0]="CONNECTING",a[a.OPEN=1]="OPEN",a[a.CLOSING=2]="CLOSING",a[a.CLOSED=3]="CLOSED"}(e.ReadyState||(e.ReadyState={}));var n=function(){try{return"EventSource"in globalThis}catch{return!1}};e.isReactNative=typeof navigator<"u"&&navigator.product==="ReactNative",e.isEventSourceSupported=!e.isReactNative&&n()})(z);var Ye={},Ke={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.resetWebSockets=e.sharedWebSockets=void 0,e.sharedWebSockets={};var t=function(r){if(r&&e.sharedWebSockets.hasOwnProperty(r))delete e.sharedWebSockets[r];else for(var n in e.sharedWebSockets)e.sharedWebSockets.hasOwnProperty(n)&&delete e.sharedWebSockets[n]};e.resetWebSockets=t})(Ke);var Qe={},G={};Object.defineProperty(G,"__esModule",{value:!0}),G.setUpSocketIOPing=G.appendQueryParams=G.parseSocketIOUrl=void 0;var Ze=z,$a=function(e){if(e){var t=/^https|wss/.test(e),r=e.replace(/^(https?|wss?)(:\/\/)?/,""),n=r.replace(/\/$/,""),a=t?"wss":"ws";return"".concat(a,"://").concat(n).concat(Ze.SOCKET_IO_PATH)}else if(e===""){var t=/^https/.test(window.location.protocol),a=t?"wss":"ws",o=window.location.port?":".concat(window.location.port):"";return"".concat(a,"://").concat(window.location.hostname).concat(o).concat(Ze.SOCKET_IO_PATH)}return e};G.parseSocketIOUrl=$a;var La=function(e,t){t===void 0&&(t={});var r=/\?([\w]+=[\w]+)/,n=r.test(e),a="".concat(Object.entries(t).reduce(function(o,c){var u=c[0],s=c[1];return o+"".concat(u,"=").concat(s,"&")},"").slice(0,-1));return"".concat(e).concat(n?"&":"?").concat(a)};G.appendQueryParams=La;var Ra=function(e,t){t===void 0&&(t=Ze.SOCKET_IO_PING_INTERVAL);var r=function(){return e(Ze.SOCKET_IO_PING_CODE)};return window.setInterval(r,t)};G.setUpSocketIOPing=Ra;var xe={};Object.defineProperty(xe,"__esModule",{value:!0}),xe.heartbeat=void 0;var Tt=z;function Wa(e,t){var r=t||{},n=r.interval,a=n===void 0?Tt.DEFAULT_HEARTBEAT.interval:n,o=r.timeout,c=o===void 0?Tt.DEFAULT_HEARTBEAT.timeout:o,u=r.message,s=u===void 0?Tt.DEFAULT_HEARTBEAT.message:u,i=!1,l=setInterval(function(){try{typeof s=="function"?e.send(s()):e.send(s)}catch{}},a),d=setInterval(function(){i?i=!1:e.close()},c);return e.addEventListener("close",function(){clearInterval(l),clearInterval(d)}),function(){i=!0}}xe.heartbeat=Wa;var ue={},et={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.resetSubscribers=e.removeSubscriber=e.addSubscriber=e.hasSubscribers=e.getSubscribers=void 0;var t={},r=[],n=function(s){return(0,e.hasSubscribers)(s)?Array.from(t[s]):r};e.getSubscribers=n;var a=function(s){var i;return((i=t[s])===null||i===void 0?void 0:i.size)>0};e.hasSubscribers=a;var o=function(s,i){t[s]=t[s]||new Set,t[s].add(i)};e.addSubscriber=o;var c=function(s,i){t[s].delete(i)};e.removeSubscriber=c;var u=function(s){if(s&&t.hasOwnProperty(s))delete t[s];else for(var i in t)t.hasOwnProperty(i)&&delete t[i]};e.resetSubscribers=u})(et),Object.defineProperty(ue,"__esModule",{value:!0}),ue.resetGlobalState=ue.assertIsWebSocket=void 0;var Fa=Ke,Ba=et;function Ha(e,t){if(!t&&!(e instanceof WebSocket))throw new Error("")}ue.assertIsWebSocket=Ha;function qa(e){(0,Ba.resetSubscribers)(e),(0,Fa.resetWebSockets)(e)}ue.resetGlobalState=qa;var tt=I&&I.__assign||function(){return tt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},tt.apply(this,arguments)};Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.attachListeners=void 0;var Va=G,Ja=xe,Y=z,za=ue,Xa=function(e,t,r){var n;if(t.current.heartbeat&&e instanceof WebSocket){var a=typeof t.current.heartbeat=="boolean"?void 0:t.current.heartbeat;n=(0,Ja.heartbeat)(e,a)}e.onmessage=function(o){var c;n==null||n(),t.current.onMessage&&t.current.onMessage(o),!(typeof t.current.filter=="function"&&t.current.filter(o)!==!0)&&(t.current.heartbeat&&typeof t.current.heartbeat!="boolean"&&((c=t.current.heartbeat)===null||c===void 0?void 0:c.returnMessage)===o.data||r(o))}},Ga=function(e,t,r,n){e.onopen=function(a){t.current.onOpen&&t.current.onOpen(a),n.current=0,r(Y.ReadyState.OPEN)}},Ya=function(e,t,r,n,a){if(Y.isEventSourceSupported&&e instanceof EventSource)return function(){};(0,za.assertIsWebSocket)(e,t.current.skipAssert);var o;return e.onclose=function(c){var u;if(t.current.onClose&&t.current.onClose(c),r(Y.ReadyState.CLOSED),t.current.shouldReconnect&&t.current.shouldReconnect(c)){var s=(u=t.current.reconnectAttempts)!==null&&u!==void 0?u:Y.DEFAULT_RECONNECT_LIMIT;if(a.current<s){var i=typeof t.current.reconnectInterval=="function"?t.current.reconnectInterval(a.current):t.current.reconnectInterval;o=window.setTimeout(function(){a.current++,n()},i??Y.DEFAULT_RECONNECT_INTERVAL_MS)}else t.current.onReconnectStop&&t.current.onReconnectStop(s),console.warn("Max reconnect attempts of ".concat(s," exceeded"))}},function(){return o&&window.clearTimeout(o)}},Ka=function(e,t,r,n,a){var o;return e.onerror=function(c){var u;if(t.current.onError&&t.current.onError(c),Y.isEventSourceSupported&&e instanceof EventSource&&(t.current.onClose&&t.current.onClose(tt(tt({},c),{code:1006,reason:"An error occurred with the EventSource: ".concat(c),wasClean:!1})),r(Y.ReadyState.CLOSED),e.close()),t.current.retryOnError)if(a.current<((u=t.current.reconnectAttempts)!==null&&u!==void 0?u:Y.DEFAULT_RECONNECT_LIMIT)){var s=typeof t.current.reconnectInterval=="function"?t.current.reconnectInterval(a.current):t.current.reconnectInterval;o=window.setTimeout(function(){a.current++,n()},s??Y.DEFAULT_RECONNECT_INTERVAL_MS)}else t.current.onReconnectStop&&t.current.onReconnectStop(t.current.reconnectAttempts),console.warn("Max reconnect attempts of ".concat(t.current.reconnectAttempts," exceeded"))},function(){return o&&window.clearTimeout(o)}},Qa=function(e,t,r,n,a,o){var c=t.setLastMessage,u=t.setReadyState,s,i,l;return r.current.fromSocketIO&&(s=(0,Va.setUpSocketIOPing)(o)),Xa(e,r,c),Ga(e,r,u,a),i=Ya(e,r,u,n,a),l=Ka(e,r,u,n,a),function(){u(Y.ReadyState.CLOSING),i(),l(),e.close(),s&&clearInterval(s)}};Qe.attachListeners=Qa;var rt={},nt=I&&I.__assign||function(){return nt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},nt.apply(this,arguments)};Object.defineProperty(rt,"__esModule",{value:!0}),rt.attachSharedListeners=void 0;var Za=Ke,ve=z,Ne=et,eo=G,to=xe,ro=function(e,t,r){var n;r&&e instanceof WebSocket&&(n=(0,to.heartbeat)(e,typeof r=="boolean"?void 0:r)),e.onmessage=function(a){n==null||n(),(0,Ne.getSubscribers)(t).forEach(function(o){o.optionsRef.current.onMessage&&o.optionsRef.current.onMessage(a),!(typeof o.optionsRef.current.filter=="function"&&o.optionsRef.current.filter(a)!==!0)&&(r&&typeof r!="boolean"&&(r==null?void 0:r.returnMessage)===a.data||o.setLastMessage(a))})}},no=function(e,t){e.onopen=function(r){(0,Ne.getSubscribers)(t).forEach(function(n){n.reconnectCount.current=0,n.optionsRef.current.onOpen&&n.optionsRef.current.onOpen(r),n.setReadyState(ve.ReadyState.OPEN)})}},ao=function(e,t){e instanceof WebSocket&&(e.onclose=function(r){(0,Ne.getSubscribers)(t).forEach(function(n){n.optionsRef.current.onClose&&n.optionsRef.current.onClose(r),n.setReadyState(ve.ReadyState.CLOSED)}),delete Za.sharedWebSockets[t],(0,Ne.getSubscribers)(t).forEach(function(n){var a;if(n.optionsRef.current.shouldReconnect&&n.optionsRef.current.shouldReconnect(r)){var o=(a=n.optionsRef.current.reconnectAttempts)!==null&&a!==void 0?a:ve.DEFAULT_RECONNECT_LIMIT;if(n.reconnectCount.current<o){var c=typeof n.optionsRef.current.reconnectInterval=="function"?n.optionsRef.current.reconnectInterval(n.reconnectCount.current):n.optionsRef.current.reconnectInterval;setTimeout(function(){n.reconnectCount.current++,n.reconnect.current()},c??ve.DEFAULT_RECONNECT_INTERVAL_MS)}else n.optionsRef.current.onReconnectStop&&n.optionsRef.current.onReconnectStop(n.optionsRef.current.reconnectAttempts),console.warn("Max reconnect attempts of ".concat(o," exceeded"))}})})},oo=function(e,t){e.onerror=function(r){(0,Ne.getSubscribers)(t).forEach(function(n){n.optionsRef.current.onError&&n.optionsRef.current.onError(r),ve.isEventSourceSupported&&e instanceof EventSource&&(n.optionsRef.current.onClose&&n.optionsRef.current.onClose(nt(nt({},r),{code:1006,reason:"An error occurred with the EventSource: ".concat(r),wasClean:!1})),n.setReadyState(ve.ReadyState.CLOSED))}),ve.isEventSourceSupported&&e instanceof EventSource&&e.close()}},io=function(e,t,r,n){var a;return r.current.fromSocketIO&&(a=(0,eo.setUpSocketIOPing)(n)),ro(e,t,r.current.heartbeat),ao(e,t),no(e,t),oo(e,t),function(){a&&clearInterval(a)}};rt.attachSharedListeners=io,Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.createOrJoinSocket=void 0;var ce=Ke,Me=z,so=Qe,uo=rt,At=et,co=function(e,t,r,n,a){return function(){if((0,At.removeSubscriber)(e,t),!(0,At.hasSubscribers)(e)){try{var o=ce.sharedWebSockets[e];o instanceof WebSocket&&(o.onclose=function(c){r.current.onClose&&r.current.onClose(c),n(Me.ReadyState.CLOSED)}),o.close()}catch{}a&&a(),delete ce.sharedWebSockets[e]}}},lo=function(e,t,r,n,a,o,c,u){if(!Me.isEventSourceSupported&&n.current.eventSourceOptions)throw Me.isReactNative?new Error("EventSource is not supported in ReactNative"):new Error("EventSource is not supported");if(n.current.share){var s=null;ce.sharedWebSockets[t]===void 0?(ce.sharedWebSockets[t]=n.current.eventSourceOptions?new EventSource(t,n.current.eventSourceOptions):new WebSocket(t,n.current.protocols),e.current=ce.sharedWebSockets[t],r(Me.ReadyState.CONNECTING),s=(0,uo.attachSharedListeners)(ce.sharedWebSockets[t],t,n,u)):(e.current=ce.sharedWebSockets[t],r(ce.sharedWebSockets[t].readyState));var i={setLastMessage:a,setReadyState:r,optionsRef:n,reconnectCount:c,reconnect:o};return(0,At.addSubscriber)(t,i),co(t,i,n,r,s)}else{if(e.current=n.current.eventSourceOptions?new EventSource(t,n.current.eventSourceOptions):new WebSocket(t,n.current.protocols),r(Me.ReadyState.CONNECTING),!e.current)throw new Error("WebSocket failed to be created");return(0,so.attachListeners)(e.current,{setLastMessage:a,setReadyState:r},n,o.current,c,u)}};Ye.createOrJoinSocket=lo;var ir={};(function(e){var t=I&&I.__awaiter||function(u,s,i,l){function d(f){return f instanceof i?f:new i(function(p){p(f)})}return new(i||(i=Promise))(function(f,p){function m(g){try{v(l.next(g))}catch(S){p(S)}}function h(g){try{v(l.throw(g))}catch(S){p(S)}}function v(g){g.done?f(g.value):d(g.value).then(m,h)}v((l=l.apply(u,s||[])).next())})},r=I&&I.__generator||function(u,s){var i={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},l,d,f,p;return p={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function m(v){return function(g){return h([v,g])}}function h(v){if(l)throw new TypeError("Generator is already executing.");for(;i;)try{if(l=1,d&&(f=v[0]&2?d.return:v[0]?d.throw||((f=d.return)&&f.call(d),0):d.next)&&!(f=f.call(d,v[1])).done)return f;switch(d=0,f&&(v=[v[0]&2,f.value]),v[0]){case 0:case 1:f=v;break;case 4:return i.label++,{value:v[1],done:!1};case 5:i.label++,d=v[1],v=[0];continue;case 7:v=i.ops.pop(),i.trys.pop();continue;default:if(f=i.trys,!(f=f.length>0&&f[f.length-1])&&(v[0]===6||v[0]===2)){i=0;continue}if(v[0]===3&&(!f||v[1]>f[0]&&v[1]<f[3])){i.label=v[1];break}if(v[0]===6&&i.label<f[1]){i.label=f[1],f=v;break}if(f&&i.label<f[2]){i.label=f[2],i.ops.push(v);break}f[2]&&i.ops.pop(),i.trys.pop();continue}v=s.call(u,i)}catch(g){v=[6,g],d=0}finally{l=f=0}if(v[0]&5)throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0}),e.getUrl=void 0;var n=G,a=z,o=function(u){return new Promise(function(s){return window.setTimeout(s,u)})},c=function(u,s,i){return i===void 0&&(i=0),t(void 0,void 0,void 0,function(){var l,d,f,p,m,h,v,g;return r(this,function(S){switch(S.label){case 0:if(typeof u!="function")return[3,10];S.label=1;case 1:return S.trys.push([1,3,,9]),[4,u()];case 2:return l=S.sent(),[3,9];case 3:return S.sent(),s.current.retryOnError?(d=(h=s.current.reconnectAttempts)!==null&&h!==void 0?h:a.DEFAULT_RECONNECT_LIMIT,i<d?(f=typeof s.current.reconnectInterval=="function"?s.current.reconnectInterval(i):s.current.reconnectInterval,[4,o(f??a.DEFAULT_RECONNECT_INTERVAL_MS)]):[3,5]):[3,7];case 4:return S.sent(),[2,(0,e.getUrl)(u,s,i+1)];case 5:return(g=(v=s.current).onReconnectStop)===null||g===void 0||g.call(v,i),[2,null];case 6:return[3,8];case 7:return[2,null];case 8:return[3,9];case 9:return[3,11];case 10:l=u,S.label=11;case 11:return p=s.current.fromSocketIO?(0,n.parseSocketIOUrl)(l):l,m=s.current.queryParams?(0,n.appendQueryParams)(p,s.current.queryParams):p,[2,m]}})})};e.getUrl=c})(ir);var sr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.websocketWrapper=void 0;var t=function(r,n){return new Proxy(r,{get:function(a,o){var c=a[o];return o==="reconnect"?n:typeof c=="function"?(console.error("Calling methods directly on the websocket is not supported at this moment. You must use the methods returned by useWebSocket."),function(){}):c},set:function(a,o,c){return/^on/.test(o)?(console.warn("The websocket's event handlers should be defined through the options object passed into useWebSocket."),!1):(a[o]=c,!0)}})};e.websocketWrapper=t,e.default=e.websocketWrapper})(sr);var le=I&&I.__assign||function(){return le=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},le.apply(this,arguments)},fo=I&&I.__awaiter||function(e,t,r,n){function a(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function u(l){try{i(n.next(l))}catch(d){c(d)}}function s(l){try{i(n.throw(l))}catch(d){c(d)}}function i(l){l.done?o(l.value):a(l.value).then(u,s)}i((n=n.apply(e,t||[])).next())})},po=I&&I.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,a,o,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(i){return function(l){return s([i,l])}}function s(i){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,a&&(o=i[0]&2?a.return:i[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,i[1])).done)return o;switch(a=0,o&&(i=[i[0]&2,o.value]),i[0]){case 0:case 1:o=i;break;case 4:return r.label++,{value:i[1],done:!1};case 5:r.label++,a=i[1],i=[0];continue;case 7:i=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){r=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){r.label=i[1];break}if(i[0]===6&&r.label<o[1]){r.label=o[1],o=i;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(i);break}o[2]&&r.ops.pop(),r.trys.pop();continue}i=t.call(e,r)}catch(l){i=[6,l],a=0}finally{n=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}},vo=I&&I.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.useWebSocket=void 0;var j=y,Pt=Ht,K=z,ho=Ye,mo=ir,yo=vo(sr),ur=ue,go=function(e,t,r){t===void 0&&(t=K.DEFAULT_OPTIONS),r===void 0&&(r=!0);var n=(0,j.useState)(null),a=n[0],o=n[1],c=(0,j.useState)({}),u=c[0],s=c[1],i=(0,j.useMemo)(function(){if(a)try{return JSON.parse(a.data)}catch{return K.UNPARSABLE_JSON_OBJECT}return null},[a]),l=(0,j.useRef)(null),d=(0,j.useRef)(null),f=(0,j.useRef)(function(){}),p=(0,j.useRef)(0),m=(0,j.useRef)([]),h=(0,j.useRef)(null),v=(0,j.useRef)(t);v.current=t;var g=l.current&&u[l.current]!==void 0?u[l.current]:e!==null&&r===!0?K.ReadyState.CONNECTING:K.ReadyState.UNINSTANTIATED,S=t.queryParams?JSON.stringify(t.queryParams):null,_=(0,j.useCallback)(function(b,E){var A;if(E===void 0&&(E=!0),K.isEventSourceSupported&&d.current instanceof EventSource){console.warn("Unable to send a message from an eventSource");return}((A=d.current)===null||A===void 0?void 0:A.readyState)===K.ReadyState.OPEN?((0,ur.assertIsWebSocket)(d.current,v.current.skipAssert),d.current.send(b)):E&&m.current.push(b)},[]),w=(0,j.useCallback)(function(b,E){E===void 0&&(E=!0),_(JSON.stringify(b),E)},[_]),O=(0,j.useCallback)(function(){return v.current.share!==!0||K.isEventSourceSupported&&d.current instanceof EventSource?d.current:(h.current===null&&d.current&&((0,ur.assertIsWebSocket)(d.current,v.current.skipAssert),h.current=(0,yo.default)(d.current,f)),h.current)},[]);return(0,j.useEffect)(function(){if(e!==null&&r===!0){var b,E=!1,A=!0,x=function(){return fo(void 0,void 0,void 0,function(){var P,k,R;return po(this,function(N){switch(N.label){case 0:return P=l,[4,(0,mo.getUrl)(e,v)];case 1:return P.current=N.sent(),l.current===null?(console.error("Failed to get a valid URL. WebSocket connection aborted."),l.current="ABORTED",(0,Pt.flushSync)(function(){return s(function(B){return le(le({},B),{ABORTED:K.ReadyState.CLOSED})})}),[2]):(k=function(B){E||(0,Pt.flushSync)(function(){return o(B)})},R=function(B){E||(0,Pt.flushSync)(function(){return s(function(ae){var M;return le(le({},ae),l.current&&(M={},M[l.current]=B,M))})})},A&&(b=(0,ho.createOrJoinSocket)(d,l.current,R,v,k,f,p,_)),[2])}})})};return f.current=function(){E||(h.current&&(h.current=null),b==null||b(),x())},x(),function(){E=!0,A=!1,h.current&&(h.current=null),b==null||b(),o(null)}}else(e===null||r===!1)&&(p.current=0,s(function(P){var k;return le(le({},P),l.current&&(k={},k[l.current]=K.ReadyState.CLOSED,k))}))},[e,r,S,_]),(0,j.useEffect)(function(){g===K.ReadyState.OPEN&&m.current.splice(0).forEach(function(b){_(b)})},[g]),{sendMessage:_,sendJsonMessage:w,lastMessage:a,lastJsonMessage:i,readyState:g,getWebSocket:O}};Ee.useWebSocket=go;var at={},ot=I&&I.__assign||function(){return ot=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},ot.apply(this,arguments)};Object.defineProperty(at,"__esModule",{value:!0}),at.useSocketIO=void 0;var cr=y,bo=Ee,wo=z,kt={type:"empty",payload:null},So=function(e){if(!e||!e.data)return kt;var t=e.data.match(/\[.*]/);if(!t)return kt;var r=JSON.parse(t);return!Array.isArray(r)||!r[1]?kt:{type:r[0],payload:r[1]}},Eo=function(e,t,r){t===void 0&&(t=wo.DEFAULT_OPTIONS),r===void 0&&(r=!0);var n=(0,cr.useMemo)(function(){return ot(ot({},t),{fromSocketIO:!0})},[]),a=(0,bo.useWebSocket)(e,n,r),o=a.sendMessage,c=a.sendJsonMessage,u=a.lastMessage,s=a.readyState,i=a.getWebSocket,l=(0,cr.useMemo)(function(){return So(u)},[u]);return{sendMessage:o,sendJsonMessage:c,lastMessage:l,lastJsonMessage:l,readyState:s,getWebSocket:i}};at.useSocketIO=Eo;var it={},st=I&&I.__assign||function(){return st=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},st.apply(this,arguments)},Oo=I&&I.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r};Object.defineProperty(it,"__esModule",{value:!0}),it.useEventSource=void 0;var lr=y,Co=Ee,fr=z,_o=function(e,t,r){t===void 0&&(t=fr.DEFAULT_EVENT_SOURCE_OPTIONS);var n=t.withCredentials,a=t.events,o=Oo(t,["withCredentials","events"]);r===void 0&&(r=!0);var c=st(st({},o),{eventSourceOptions:{withCredentials:n}}),u=(0,lr.useRef)(fr.EMPTY_EVENT_HANDLERS);a&&(u.current=a);var s=(0,Co.useWebSocket)(e,c,r),i=s.lastMessage,l=s.readyState,d=s.getWebSocket;return(0,lr.useEffect)(function(){i!=null&&i.type&&Object.entries(u.current).forEach(function(f){var p=f[0],m=f[1];p===i.type&&m(i)})},[i]),{lastEvent:i,readyState:l,getEventSource:d}};it.useEventSource=_o,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.resetGlobalState=e.useEventSource=e.ReadyState=e.useSocketIO=e.default=void 0;var t=Ee;Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.useWebSocket}});var r=at;Object.defineProperty(e,"useSocketIO",{enumerable:!0,get:function(){return r.useSocketIO}});var n=z;Object.defineProperty(e,"ReadyState",{enumerable:!0,get:function(){return n.ReadyState}});var a=it;Object.defineProperty(e,"useEventSource",{enumerable:!0,get:function(){return a.useEventSource}});var o=ue;Object.defineProperty(e,"resetGlobalState",{enumerable:!0,get:function(){return o.resetGlobalState}})}(or);const To=ar(or);function Ao({title:e,titleId:t,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?C.createElement("title",{id:t},e):null,C.createElement("path",{fillRule:"evenodd",d:"M5.25 9a6.75 6.75 0 0 1 13.5 0v.75c0 2.123.8 4.057 2.118 5.52a.75.75 0 0 1-.297 1.206c-1.544.57-3.16.99-4.831 1.243a3.75 3.75 0 1 1-7.48 0 24.585 24.585 0 0 1-4.831-1.244.75.75 0 0 1-.298-1.205A8.217 8.217 0 0 0 5.25 9.75V9Zm4.502 8.9a2.25 2.25 0 1 0 4.496 0 25.057 25.057 0 0 1-4.496 0Z",clipRule:"evenodd"}))}const Po=C.forwardRef(Ao);var dr=function(t){return t.reduce(function(r,n){var a=n[0],o=n[1];return r[a]=o,r},{})},pr=typeof window<"u"&&window.document&&window.document.createElement?C.useLayoutEffect:C.useEffect,$="top",q="bottom",V="right",L="left",It="auto",De=[$,q,V,L],Oe="start",je="end",ko="clippingParents",vr="viewport",Ue="popper",Io="reference",hr=De.reduce(function(e,t){return e.concat([t+"-"+Oe,t+"-"+je])},[]),mr=[].concat(De,[It]).reduce(function(e,t){return e.concat([t,t+"-"+Oe,t+"-"+je])},[]),xo="beforeRead",No="read",Mo="afterRead",Do="beforeMain",jo="main",Uo="afterMain",$o="beforeWrite",Lo="write",Ro="afterWrite",Wo=[xo,No,Mo,Do,jo,Uo,$o,Lo,Ro];function Q(e){return e?(e.nodeName||"").toLowerCase():null}function F(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function he(e){var t=F(e).Element;return e instanceof t||e instanceof Element}function J(e){var t=F(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function xt(e){if(typeof ShadowRoot>"u")return!1;var t=F(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Fo(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},a=t.attributes[r]||{},o=t.elements[r];!J(o)||!Q(o)||(Object.assign(o.style,n),Object.keys(a).forEach(function(c){var u=a[c];u===!1?o.removeAttribute(c):o.setAttribute(c,u===!0?"":u)}))})}function Bo(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(n){var a=t.elements[n],o=t.attributes[n]||{},c=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),u=c.reduce(function(s,i){return s[i]="",s},{});!J(a)||!Q(a)||(Object.assign(a.style,u),Object.keys(o).forEach(function(s){a.removeAttribute(s)}))})}}const Ho={name:"applyStyles",enabled:!0,phase:"write",fn:Fo,effect:Bo,requires:["computeStyles"]};function Z(e){return e.split("-")[0]}var me=Math.max,ut=Math.min,Ce=Math.round;function Nt(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function yr(){return!/^((?!chrome|android).)*safari/i.test(Nt())}function _e(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=e.getBoundingClientRect(),a=1,o=1;t&&J(e)&&(a=e.offsetWidth>0&&Ce(n.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Ce(n.height)/e.offsetHeight||1);var c=he(e)?F(e):window,u=c.visualViewport,s=!yr()&&r,i=(n.left+(s&&u?u.offsetLeft:0))/a,l=(n.top+(s&&u?u.offsetTop:0))/o,d=n.width/a,f=n.height/o;return{width:d,height:f,top:l,right:i+d,bottom:l+f,left:i,x:i,y:l}}function Mt(e){var t=_e(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function gr(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&xt(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function ne(e){return F(e).getComputedStyle(e)}function qo(e){return["table","td","th"].indexOf(Q(e))>=0}function fe(e){return((he(e)?e.ownerDocument:e.document)||window.document).documentElement}function ct(e){return Q(e)==="html"?e:e.assignedSlot||e.parentNode||(xt(e)?e.host:null)||fe(e)}function br(e){return!J(e)||ne(e).position==="fixed"?null:e.offsetParent}function Vo(e){var t=/firefox/i.test(Nt()),r=/Trident/i.test(Nt());if(r&&J(e)){var n=ne(e);if(n.position==="fixed")return null}var a=ct(e);for(xt(a)&&(a=a.host);J(a)&&["html","body"].indexOf(Q(a))<0;){var o=ne(a);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return a;a=a.parentNode}return null}function $e(e){for(var t=F(e),r=br(e);r&&qo(r)&&ne(r).position==="static";)r=br(r);return r&&(Q(r)==="html"||Q(r)==="body"&&ne(r).position==="static")?t:r||Vo(e)||t}function Dt(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Le(e,t,r){return me(e,ut(t,r))}function Jo(e,t,r){var n=Le(e,t,r);return n>r?r:n}function wr(){return{top:0,right:0,bottom:0,left:0}}function Sr(e){return Object.assign({},wr(),e)}function Er(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var zo=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,Sr(typeof t!="number"?t:Er(t,De))};function Xo(e){var t,r=e.state,n=e.name,a=e.options,o=r.elements.arrow,c=r.modifiersData.popperOffsets,u=Z(r.placement),s=Dt(u),i=[L,V].indexOf(u)>=0,l=i?"height":"width";if(!(!o||!c)){var d=zo(a.padding,r),f=Mt(o),p=s==="y"?$:L,m=s==="y"?q:V,h=r.rects.reference[l]+r.rects.reference[s]-c[s]-r.rects.popper[l],v=c[s]-r.rects.reference[s],g=$e(o),S=g?s==="y"?g.clientHeight||0:g.clientWidth||0:0,_=h/2-v/2,w=d[p],O=S-f[l]-d[m],b=S/2-f[l]/2+_,E=Le(w,b,O),A=s;r.modifiersData[n]=(t={},t[A]=E,t.centerOffset=E-b,t)}}function Go(e){var t=e.state,r=e.options,n=r.element,a=n===void 0?"[data-popper-arrow]":n;a!=null&&(typeof a=="string"&&(a=t.elements.popper.querySelector(a),!a)||gr(t.elements.popper,a)&&(t.elements.arrow=a))}const Yo={name:"arrow",enabled:!0,phase:"main",fn:Xo,effect:Go,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Te(e){return e.split("-")[1]}var Ko={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Qo(e,t){var r=e.x,n=e.y,a=t.devicePixelRatio||1;return{x:Ce(r*a)/a||0,y:Ce(n*a)/a||0}}function Or(e){var t,r=e.popper,n=e.popperRect,a=e.placement,o=e.variation,c=e.offsets,u=e.position,s=e.gpuAcceleration,i=e.adaptive,l=e.roundOffsets,d=e.isFixed,f=c.x,p=f===void 0?0:f,m=c.y,h=m===void 0?0:m,v=typeof l=="function"?l({x:p,y:h}):{x:p,y:h};p=v.x,h=v.y;var g=c.hasOwnProperty("x"),S=c.hasOwnProperty("y"),_=L,w=$,O=window;if(i){var b=$e(r),E="clientHeight",A="clientWidth";if(b===F(r)&&(b=fe(r),ne(b).position!=="static"&&u==="absolute"&&(E="scrollHeight",A="scrollWidth")),b=b,a===$||(a===L||a===V)&&o===je){w=q;var x=d&&b===O&&O.visualViewport?O.visualViewport.height:b[E];h-=x-n.height,h*=s?1:-1}if(a===L||(a===$||a===q)&&o===je){_=V;var P=d&&b===O&&O.visualViewport?O.visualViewport.width:b[A];p-=P-n.width,p*=s?1:-1}}var k=Object.assign({position:u},i&&Ko),R=l===!0?Qo({x:p,y:h},F(r)):{x:p,y:h};if(p=R.x,h=R.y,s){var N;return Object.assign({},k,(N={},N[w]=S?"0":"",N[_]=g?"0":"",N.transform=(O.devicePixelRatio||1)<=1?"translate("+p+"px, "+h+"px)":"translate3d("+p+"px, "+h+"px, 0)",N))}return Object.assign({},k,(t={},t[w]=S?h+"px":"",t[_]=g?p+"px":"",t.transform="",t))}function Zo(e){var t=e.state,r=e.options,n=r.gpuAcceleration,a=n===void 0?!0:n,o=r.adaptive,c=o===void 0?!0:o,u=r.roundOffsets,s=u===void 0?!0:u,i={placement:Z(t.placement),variation:Te(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:a,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Or(Object.assign({},i,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:c,roundOffsets:s})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Or(Object.assign({},i,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:s})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const ei={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Zo,data:{}};var lt={passive:!0};function ti(e){var t=e.state,r=e.instance,n=e.options,a=n.scroll,o=a===void 0?!0:a,c=n.resize,u=c===void 0?!0:c,s=F(t.elements.popper),i=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&i.forEach(function(l){l.addEventListener("scroll",r.update,lt)}),u&&s.addEventListener("resize",r.update,lt),function(){o&&i.forEach(function(l){l.removeEventListener("scroll",r.update,lt)}),u&&s.removeEventListener("resize",r.update,lt)}}const ri={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:ti,data:{}};var ni={left:"right",right:"left",bottom:"top",top:"bottom"};function ft(e){return e.replace(/left|right|bottom|top/g,function(t){return ni[t]})}var ai={start:"end",end:"start"};function Cr(e){return e.replace(/start|end/g,function(t){return ai[t]})}function jt(e){var t=F(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function Ut(e){return _e(fe(e)).left+jt(e).scrollLeft}function oi(e,t){var r=F(e),n=fe(e),a=r.visualViewport,o=n.clientWidth,c=n.clientHeight,u=0,s=0;if(a){o=a.width,c=a.height;var i=yr();(i||!i&&t==="fixed")&&(u=a.offsetLeft,s=a.offsetTop)}return{width:o,height:c,x:u+Ut(e),y:s}}function ii(e){var t,r=fe(e),n=jt(e),a=(t=e.ownerDocument)==null?void 0:t.body,o=me(r.scrollWidth,r.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),c=me(r.scrollHeight,r.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),u=-n.scrollLeft+Ut(e),s=-n.scrollTop;return ne(a||r).direction==="rtl"&&(u+=me(r.clientWidth,a?a.clientWidth:0)-o),{width:o,height:c,x:u,y:s}}function $t(e){var t=ne(e),r=t.overflow,n=t.overflowX,a=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+a+n)}function _r(e){return["html","body","#document"].indexOf(Q(e))>=0?e.ownerDocument.body:J(e)&&$t(e)?e:_r(ct(e))}function Re(e,t){var r;t===void 0&&(t=[]);var n=_r(e),a=n===((r=e.ownerDocument)==null?void 0:r.body),o=F(n),c=a?[o].concat(o.visualViewport||[],$t(n)?n:[]):n,u=t.concat(c);return a?u:u.concat(Re(ct(c)))}function Lt(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function si(e,t){var r=_e(e,!1,t==="fixed");return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}function Tr(e,t,r){return t===vr?Lt(oi(e,r)):he(t)?si(t,r):Lt(ii(fe(e)))}function ui(e){var t=Re(ct(e)),r=["absolute","fixed"].indexOf(ne(e).position)>=0,n=r&&J(e)?$e(e):e;return he(n)?t.filter(function(a){return he(a)&&gr(a,n)&&Q(a)!=="body"}):[]}function ci(e,t,r,n){var a=t==="clippingParents"?ui(e):[].concat(t),o=[].concat(a,[r]),c=o[0],u=o.reduce(function(s,i){var l=Tr(e,i,n);return s.top=me(l.top,s.top),s.right=ut(l.right,s.right),s.bottom=ut(l.bottom,s.bottom),s.left=me(l.left,s.left),s},Tr(e,c,n));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function Ar(e){var t=e.reference,r=e.element,n=e.placement,a=n?Z(n):null,o=n?Te(n):null,c=t.x+t.width/2-r.width/2,u=t.y+t.height/2-r.height/2,s;switch(a){case $:s={x:c,y:t.y-r.height};break;case q:s={x:c,y:t.y+t.height};break;case V:s={x:t.x+t.width,y:u};break;case L:s={x:t.x-r.width,y:u};break;default:s={x:t.x,y:t.y}}var i=a?Dt(a):null;if(i!=null){var l=i==="y"?"height":"width";switch(o){case Oe:s[i]=s[i]-(t[l]/2-r[l]/2);break;case je:s[i]=s[i]+(t[l]/2-r[l]/2);break}}return s}function We(e,t){t===void 0&&(t={});var r=t,n=r.placement,a=n===void 0?e.placement:n,o=r.strategy,c=o===void 0?e.strategy:o,u=r.boundary,s=u===void 0?ko:u,i=r.rootBoundary,l=i===void 0?vr:i,d=r.elementContext,f=d===void 0?Ue:d,p=r.altBoundary,m=p===void 0?!1:p,h=r.padding,v=h===void 0?0:h,g=Sr(typeof v!="number"?v:Er(v,De)),S=f===Ue?Io:Ue,_=e.rects.popper,w=e.elements[m?S:f],O=ci(he(w)?w:w.contextElement||fe(e.elements.popper),s,l,c),b=_e(e.elements.reference),E=Ar({reference:b,element:_,strategy:"absolute",placement:a}),A=Lt(Object.assign({},_,E)),x=f===Ue?A:b,P={top:O.top-x.top+g.top,bottom:x.bottom-O.bottom+g.bottom,left:O.left-x.left+g.left,right:x.right-O.right+g.right},k=e.modifiersData.offset;if(f===Ue&&k){var R=k[a];Object.keys(P).forEach(function(N){var B=[V,q].indexOf(N)>=0?1:-1,ae=[$,q].indexOf(N)>=0?"y":"x";P[N]+=R[ae]*B})}return P}function li(e,t){t===void 0&&(t={});var r=t,n=r.placement,a=r.boundary,o=r.rootBoundary,c=r.padding,u=r.flipVariations,s=r.allowedAutoPlacements,i=s===void 0?mr:s,l=Te(n),d=l?u?hr:hr.filter(function(m){return Te(m)===l}):De,f=d.filter(function(m){return i.indexOf(m)>=0});f.length===0&&(f=d);var p=f.reduce(function(m,h){return m[h]=We(e,{placement:h,boundary:a,rootBoundary:o,padding:c})[Z(h)],m},{});return Object.keys(p).sort(function(m,h){return p[m]-p[h]})}function fi(e){if(Z(e)===It)return[];var t=ft(e);return[Cr(e),t,Cr(t)]}function di(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var a=r.mainAxis,o=a===void 0?!0:a,c=r.altAxis,u=c===void 0?!0:c,s=r.fallbackPlacements,i=r.padding,l=r.boundary,d=r.rootBoundary,f=r.altBoundary,p=r.flipVariations,m=p===void 0?!0:p,h=r.allowedAutoPlacements,v=t.options.placement,g=Z(v),S=g===v,_=s||(S||!m?[ft(v)]:fi(v)),w=[v].concat(_).reduce(function(Ae,de){return Ae.concat(Z(de)===It?li(t,{placement:de,boundary:l,rootBoundary:d,padding:i,flipVariations:m,allowedAutoPlacements:h}):de)},[]),O=t.rects.reference,b=t.rects.popper,E=new Map,A=!0,x=w[0],P=0;P<w.length;P++){var k=w[P],R=Z(k),N=Te(k)===Oe,B=[$,q].indexOf(R)>=0,ae=B?"width":"height",M=We(t,{placement:k,boundary:l,rootBoundary:d,altBoundary:f,padding:i}),X=B?N?V:L:N?q:$;O[ae]>b[ae]&&(X=ft(X));var pt=ft(X),ye=[];if(o&&ye.push(M[R]<=0),u&&ye.push(M[X]<=0,M[pt]<=0),ye.every(function(Ae){return Ae})){x=k,A=!1;break}E.set(k,ye)}if(A)for(var vt=m?3:1,Rt=function(de){var Be=w.find(function(mt){var ge=E.get(mt);if(ge)return ge.slice(0,de).every(function(Wt){return Wt})});if(Be)return x=Be,"break"},Fe=vt;Fe>0;Fe--){var ht=Rt(Fe);if(ht==="break")break}t.placement!==x&&(t.modifiersData[n]._skip=!0,t.placement=x,t.reset=!0)}}const pi={name:"flip",enabled:!0,phase:"main",fn:di,requiresIfExists:["offset"],data:{_skip:!1}};function Pr(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function kr(e){return[$,V,q,L].some(function(t){return e[t]>=0})}function vi(e){var t=e.state,r=e.name,n=t.rects.reference,a=t.rects.popper,o=t.modifiersData.preventOverflow,c=We(t,{elementContext:"reference"}),u=We(t,{altBoundary:!0}),s=Pr(c,n),i=Pr(u,a,o),l=kr(s),d=kr(i);t.modifiersData[r]={referenceClippingOffsets:s,popperEscapeOffsets:i,isReferenceHidden:l,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":d})}const hi={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:vi};function mi(e,t,r){var n=Z(e),a=[L,$].indexOf(n)>=0?-1:1,o=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,c=o[0],u=o[1];return c=c||0,u=(u||0)*a,[L,V].indexOf(n)>=0?{x:u,y:c}:{x:c,y:u}}function yi(e){var t=e.state,r=e.options,n=e.name,a=r.offset,o=a===void 0?[0,0]:a,c=mr.reduce(function(l,d){return l[d]=mi(d,t.rects,o),l},{}),u=c[t.placement],s=u.x,i=u.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=s,t.modifiersData.popperOffsets.y+=i),t.modifiersData[n]=c}const gi={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:yi};function bi(e){var t=e.state,r=e.name;t.modifiersData[r]=Ar({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const wi={name:"popperOffsets",enabled:!0,phase:"read",fn:bi,data:{}};function Si(e){return e==="x"?"y":"x"}function Ei(e){var t=e.state,r=e.options,n=e.name,a=r.mainAxis,o=a===void 0?!0:a,c=r.altAxis,u=c===void 0?!1:c,s=r.boundary,i=r.rootBoundary,l=r.altBoundary,d=r.padding,f=r.tether,p=f===void 0?!0:f,m=r.tetherOffset,h=m===void 0?0:m,v=We(t,{boundary:s,rootBoundary:i,padding:d,altBoundary:l}),g=Z(t.placement),S=Te(t.placement),_=!S,w=Dt(g),O=Si(w),b=t.modifiersData.popperOffsets,E=t.rects.reference,A=t.rects.popper,x=typeof h=="function"?h(Object.assign({},t.rects,{placement:t.placement})):h,P=typeof x=="number"?{mainAxis:x,altAxis:x}:Object.assign({mainAxis:0,altAxis:0},x),k=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,R={x:0,y:0};if(b){if(o){var N,B=w==="y"?$:L,ae=w==="y"?q:V,M=w==="y"?"height":"width",X=b[w],pt=X+v[B],ye=X-v[ae],vt=p?-A[M]/2:0,Rt=S===Oe?E[M]:A[M],Fe=S===Oe?-A[M]:-E[M],ht=t.elements.arrow,Ae=p&&ht?Mt(ht):{width:0,height:0},de=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:wr(),Be=de[B],mt=de[ae],ge=Le(0,E[M],Ae[M]),Wt=_?E[M]/2-vt-ge-Be-P.mainAxis:Rt-ge-Be-P.mainAxis,Gi=_?-E[M]/2+vt+ge+mt+P.mainAxis:Fe+ge+mt+P.mainAxis,Ft=t.elements.arrow&&$e(t.elements.arrow),Yi=Ft?w==="y"?Ft.clientTop||0:Ft.clientLeft||0:0,Mr=(N=k==null?void 0:k[w])!=null?N:0,Ki=X+Wt-Mr-Yi,Qi=X+Gi-Mr,Dr=Le(p?ut(pt,Ki):pt,X,p?me(ye,Qi):ye);b[w]=Dr,R[w]=Dr-X}if(u){var jr,Zi=w==="x"?$:L,es=w==="x"?q:V,be=b[O],yt=O==="y"?"height":"width",Ur=be+v[Zi],$r=be-v[es],Bt=[$,L].indexOf(g)!==-1,Lr=(jr=k==null?void 0:k[O])!=null?jr:0,Rr=Bt?Ur:be-E[yt]-A[yt]-Lr+P.altAxis,Wr=Bt?be+E[yt]+A[yt]-Lr-P.altAxis:$r,Fr=p&&Bt?Jo(Rr,be,Wr):Le(p?Rr:Ur,be,p?Wr:$r);b[O]=Fr,R[O]=Fr-be}t.modifiersData[n]=R}}const Oi={name:"preventOverflow",enabled:!0,phase:"main",fn:Ei,requiresIfExists:["offset"]};function Ci(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function _i(e){return e===F(e)||!J(e)?jt(e):Ci(e)}function Ti(e){var t=e.getBoundingClientRect(),r=Ce(t.width)/e.offsetWidth||1,n=Ce(t.height)/e.offsetHeight||1;return r!==1||n!==1}function Ai(e,t,r){r===void 0&&(r=!1);var n=J(t),a=J(t)&&Ti(t),o=fe(t),c=_e(e,a,r),u={scrollLeft:0,scrollTop:0},s={x:0,y:0};return(n||!n&&!r)&&((Q(t)!=="body"||$t(o))&&(u=_i(t)),J(t)?(s=_e(t,!0),s.x+=t.clientLeft,s.y+=t.clientTop):o&&(s.x=Ut(o))),{x:c.left+u.scrollLeft-s.x,y:c.top+u.scrollTop-s.y,width:c.width,height:c.height}}function Pi(e){var t=new Map,r=new Set,n=[];e.forEach(function(o){t.set(o.name,o)});function a(o){r.add(o.name);var c=[].concat(o.requires||[],o.requiresIfExists||[]);c.forEach(function(u){if(!r.has(u)){var s=t.get(u);s&&a(s)}}),n.push(o)}return e.forEach(function(o){r.has(o.name)||a(o)}),n}function ki(e){var t=Pi(e);return Wo.reduce(function(r,n){return r.concat(t.filter(function(a){return a.phase===n}))},[])}function Ii(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function xi(e){var t=e.reduce(function(r,n){var a=r[n.name];return r[n.name]=a?Object.assign({},a,n,{options:Object.assign({},a.options,n.options),data:Object.assign({},a.data,n.data)}):n,r},{});return Object.keys(t).map(function(r){return t[r]})}var Ir={placement:"bottom",modifiers:[],strategy:"absolute"};function xr(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return!t.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function Ni(e){e===void 0&&(e={});var t=e,r=t.defaultModifiers,n=r===void 0?[]:r,a=t.defaultOptions,o=a===void 0?Ir:a;return function(u,s,i){i===void 0&&(i=o);var l={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ir,o),modifiersData:{},elements:{reference:u,popper:s},attributes:{},styles:{}},d=[],f=!1,p={state:l,setOptions:function(g){var S=typeof g=="function"?g(l.options):g;h(),l.options=Object.assign({},o,l.options,S),l.scrollParents={reference:he(u)?Re(u):u.contextElement?Re(u.contextElement):[],popper:Re(s)};var _=ki(xi([].concat(n,l.options.modifiers)));return l.orderedModifiers=_.filter(function(w){return w.enabled}),m(),p.update()},forceUpdate:function(){if(!f){var g=l.elements,S=g.reference,_=g.popper;if(xr(S,_)){l.rects={reference:Ai(S,$e(_),l.options.strategy==="fixed"),popper:Mt(_)},l.reset=!1,l.placement=l.options.placement,l.orderedModifiers.forEach(function(P){return l.modifiersData[P.name]=Object.assign({},P.data)});for(var w=0;w<l.orderedModifiers.length;w++){if(l.reset===!0){l.reset=!1,w=-1;continue}var O=l.orderedModifiers[w],b=O.fn,E=O.options,A=E===void 0?{}:E,x=O.name;typeof b=="function"&&(l=b({state:l,options:A,name:x,instance:p})||l)}}}},update:Ii(function(){return new Promise(function(v){p.forceUpdate(),v(l)})}),destroy:function(){h(),f=!0}};if(!xr(u,s))return p;p.setOptions(i).then(function(v){!f&&i.onFirstUpdate&&i.onFirstUpdate(v)});function m(){l.orderedModifiers.forEach(function(v){var g=v.name,S=v.options,_=S===void 0?{}:S,w=v.effect;if(typeof w=="function"){var O=w({state:l,name:g,instance:p,options:_}),b=function(){};d.push(O||b)}})}function h(){d.forEach(function(v){return v()}),d=[]}return p}}var Mi=[ri,wi,ei,Ho,gi,pi,Oi,Yo,hi],Di=Ni({defaultModifiers:Mi}),ji=typeof Element<"u",Ui=typeof Map=="function",$i=typeof Set=="function",Li=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function dt(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,a;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!dt(e[n],t[n]))return!1;return!0}var o;if(Ui&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(n=o.next()).done;)if(!t.has(n.value[0]))return!1;for(o=e.entries();!(n=o.next()).done;)if(!dt(n.value[1],t.get(n.value[0])))return!1;return!0}if($i&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(n=o.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(Li&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,a[n]))return!1;if(ji&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((a[n]==="_owner"||a[n]==="__v"||a[n]==="__o")&&e.$$typeof)&&!dt(e[a[n]],t[a[n]]))return!1;return!0}return e!==e&&t!==t}var Ri=function(t,r){try{return dt(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const Wi=ar(Ri);var Fi=[],Bi=function(t,r,n){n===void 0&&(n={});var a=C.useRef(null),o={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||Fi},c=C.useState({styles:{popper:{position:o.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),u=c[0],s=c[1],i=C.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(p){var m=p.state,h=Object.keys(m.elements);Br.flushSync(function(){s({styles:dr(h.map(function(v){return[v,m.styles[v]||{}]})),attributes:dr(h.map(function(v){return[v,m.attributes[v]]}))})})},requires:["computeStyles"]}},[]),l=C.useMemo(function(){var f={onFirstUpdate:o.onFirstUpdate,placement:o.placement,strategy:o.strategy,modifiers:[].concat(o.modifiers,[i,{name:"applyStyles",enabled:!1}])};return Wi(a.current,f)?a.current||f:(a.current=f,f)},[o.onFirstUpdate,o.placement,o.strategy,o.modifiers,i]),d=C.useRef();return pr(function(){d.current&&d.current.setOptions(l)},[l]),pr(function(){if(!(t==null||r==null)){var f=n.createPopper||Di,p=f(t,r,l);return d.current=p,function(){p.destroy(),d.current=null}}},[t,r,n.createPopper]),{state:d.current?d.current.state:null,styles:u.styles,attributes:u.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}},Hi=new Proxy({},{get:(e,t)=>{if(t==="__esModule")return{};throw new Error(`You're trying to import \`@heroicons/react/solid/${t}\` from Heroicons v1 but have installed Heroicons v2. Install \`@heroicons/react@v1\` to resolve this error.`)}});const qi=()=>{let{client:e}=Qt();const[t,r]=y.useState(null),[n,a]=y.useState(null),{styles:o,attributes:c}=Bi(t,n,{placement:"bottom-end"}),[u,s]=y.useState(!1),[i,l]=y.useState(!1);let{sendJsonMessage:d}=To("ws://localhost:8082/websocket",{queryParams:{publicKey:e.publicKey,...e.targetEnvironment&&{targetEnvironment:e.targetEnvironment}},shouldReconnect:f=>!0,onError:f=>console.error({errorEvent:f}),onClose:f=>console.log({closeEvent:f}),onMessage:f=>{let p={};try{p=JSON.parse(f.data)}catch(m){console.error(m)}switch(p==null?void 0:p.type){case ke.SUBSCRIBE:break;case ke.IN_APP_NOTIFICATION:e.trackNotification({id:p.data.notificationId,status:"DELIVERED"}),Ua(p.data.body);break;case ke.INVALID:console.error(p.data.message);break;default:console.error("Unknown message type")}},onOpen:f=>{let p={type:ke.SUBSCRIBE,data:{accountUid:e.accountUid}};d(p)}},i);return y.useEffect(()=>{l(!0)},[]),y.createElement(y.Fragment,null,y.createElement(Po,{"aria-hidden":"true",className:"h-6 w-6",onClick:()=>s(!u),ref:r}),u&&y.createElement("div",{ref:a,style:o.popper,...c.popper,className:"bg-gray-800 rounded-xl text-white w-96 h-96"},y.createElement("div",{className:"flex justify-between items-center border-y-2 border-white px-4 py-4"},y.createElement("p",null,"Notifications"),y.createElement(Hi.XIcon,{height:20,width:20,onClick:()=>s(!1)}))))},Vi=({preference:e,onChange:t})=>{const r=n=>{t(n,e)};return React.createElement("div",null,React.createElement("p",null,e[0]),React.createElement("label",null,"Email",React.createElement("input",{name:"email",type:"checkbox",defaultChecked:e[1].email,onChange:r})),React.createElement("label",null,"Push",React.createElement("input",{name:"push",type:"checkbox",defaultChecked:e[1].push,onChange:r})),React.createElement("label",null,"SMS",React.createElement("input",{name:"sms",type:"checkbox",defaultChecked:e[1].sms,onChange:r})),React.createElement("label",null,"Whatsapp",React.createElement("input",{name:"whatsapp",type:"checkbox",defaultChecked:e[1].whatsapp,onChange:r})),React.createElement("br",null))};function Nr({preference:e,onChange:t,renderPreference:r=Vi}){return r({preference:e,onChange:t})}const Ji=({preferences:e,onChange:t,loading:r})=>e?y.createElement(y.Fragment,null,e.map(n=>y.createElement(Nr,{key:n[0],preference:n,onChange:t}))):r?y.createElement(y.Fragment,null,"Loading..."):y.createElement(y.Fragment,null,"An unexpected error ocurred");function zi({renderPreferences:e=Ji}){const t=Et(),[r,n]=y.useState(null),[a,o]=y.useState(!0),[c,u]=y.useState(null),[s,i]=y.useState(!1),l=(d,f)=>{i(!0);const[p,m]=f;n(h=>({...h||{},[p]:{...m,[d.target.name]:d.target.checked}}))};return y.useEffect(()=>{if(!s)return;const d=setTimeout(async()=>{await t.saveStoredPreferences(r),i(!1)},100);return()=>clearTimeout(d)},[r,s,t]),y.useEffect(()=>{async function d(){o(!0);try{const f=await t.fetchStoredPreferences();n(f)}catch(f){u(f)}finally{o(!1)}}d()},[t]),e({preferences:r&&Object.entries(r).map(([d,f])=>[d,f]),onChange:l,loading:a,error:c})}const Xi=e=>y.createElement(y.Fragment,null,y.createElement(ja,{position:"top-right",...e}));U.DashXProvider=Vn,U.NotificationBell=qi,U.Preference=Nr,U.Preferences=zi,U.Toast=Xi,U.useDashXProvider=Et,U.useInApp=Qt,Object.defineProperty(U,Symbol.toStringTag,{value:"Module"})});