@flarehr/superhero-pba-support-admin 1.0.870 → 1.0.872
Sign up to get free protection for your applications and to get access to all the features.
- package/build/bundle.js +1 -1
- package/package.json +1 -1
package/build/bundle.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var e,t,r,n,i,o,a,s,l,c,d={},u=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,m=Array.isArray;function h(e,t){for(var r in t)e[r]=t[r];return e}function f(e){var t=e.parentNode;t&&t.removeChild(e)}function g(t,r,n){var i,o,a,s={};for(a in r)"key"==a?i=r[a]:"ref"==a?o=r[a]:s[a]=r[a];if(arguments.length>2&&(s.children=arguments.length>3?e.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(a in t.defaultProps)void 0===s[a]&&(s[a]=t.defaultProps[a]);return y(t,s,i,o,null)}function y(e,n,i,o,a){var s={type:e,props:n,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++r:a,__i:-1,__u:0};return null==a&&null!=t.vnode&&t.vnode(s),s}function b(e){return e.children}function w(e,t){this.props=e,this.context=t}function _(e,t){if(null==t)return e.__?_(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?_(e):null}function v(e){var t,r;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e){e.__e=e.__c.base=r.__e;break}return v(e)}}function x(e){(!e.__d&&(e.__d=!0)&&n.push(e)&&!k.__r++||i!==t.debounceRendering)&&((i=t.debounceRendering)||o)(k)}function k(){var e,r,i,o,s,l,c,d;for(n.sort(a);e=n.shift();)e.__d&&(r=n.length,o=void 0,l=(s=(i=e).__v).__e,c=[],d=[],i.__P&&((o=h({},s)).__v=s.__v+1,t.vnode&&t.vnode(o),R(i.__P,o,s,i.__n,i.__P.namespaceURI,32&s.__u?[l]:null,c,null==l?_(s):l,!!(32&s.__u),d),o.__v=s.__v,o.__.__k[o.__i]=o,P(c,o,d),o.__e!=l&&v(o)),n.length>r&&n.sort(a));k.__r=0}function N(e,t,r,n,i,o,a,s,l,c,p){var h,f,g,w,v,x=n&&n.__k||u,k=t.length;for(r.__d=l,function(e,t,r){var n,i,o,a,s,l=t.length,c=r.length,d=c,u=0;for(e.__k=[],n=0;n<l;n++)a=n+u,null!=(i=e.__k[n]=null==(i=t[n])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?y(null,i,null,null,null):m(i)?y(b,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?y(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=e,i.__b=e.__b+1,s=A(i,r,a,d),i.__i=s,o=null,-1!==s&&(d--,(o=r[s])&&(o.__u|=131072)),null==o||null===o.__v?(-1==s&&u--,"function"!=typeof i.type&&(i.__u|=65536)):s!==a&&(s===a+1?u++:s>a?d>l-a?u+=s-a:u--:s<a?s==a-1&&(u=s-a):u=0,s!==n+u&&(i.__u|=65536))):(o=r[a])&&null==o.key&&o.__e&&!(131072&o.__u)&&(o.__e==e.__d&&(e.__d=_(o)),j(o,o,!1),r[a]=null,d--);if(d)for(n=0;n<c;n++)null!=(o=r[n])&&!(131072&o.__u)&&(o.__e==e.__d&&(e.__d=_(o)),j(o,o))}(r,t,x),l=r.__d,h=0;h<k;h++)null!=(g=r.__k[h])&&"boolean"!=typeof g&&"function"!=typeof g&&(f=-1===g.__i?d:x[g.__i]||d,g.__i=h,R(e,g,f,i,o,a,s,l,c,p),w=g.__e,g.ref&&f.ref!=g.ref&&(f.ref&&U(f.ref,null,g),p.push(g.ref,g.__c||w,g)),null==v&&null!=w&&(v=w),65536&g.__u||f.__k===g.__k?(l&&!l.isConnected&&(l=_(f)),l=C(g,l,e)):"function"==typeof g.type&&void 0!==g.__d?l=g.__d:w&&(l=w.nextSibling),g.__d=void 0,g.__u&=-196609);r.__d=l,r.__e=v}function C(e,t,r){var n,i;if("function"==typeof e.type){for(n=e.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=e,t=C(n[i],t,r));return t}e.__e!=t&&(r.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8===t.nodeType);return t}function E(e,t){return t=t||[],null==e||"boolean"==typeof e||(m(e)?e.some((function(e){E(e,t)})):t.push(e)),t}function A(e,t,r,n){var i=e.key,o=e.type,a=r-1,s=r+1,l=t[r];if(null===l||l&&i==l.key&&o===l.type&&!(131072&l.__u))return r;if(n>(null==l||131072&l.__u?0:1))for(;a>=0||s<t.length;){if(a>=0){if((l=t[a])&&!(131072&l.__u)&&i==l.key&&o===l.type)return a;a--}if(s<t.length){if((l=t[s])&&!(131072&l.__u)&&i==l.key&&o===l.type)return s;s++}}return-1}function S(e,t,r){"-"===t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||p.test(t)?r:r+"px"}function T(e,t,r,n,i){var o;e:if("style"===t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||S(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||S(e.style,t,r[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||"onFocusOut"===t||"onFocusIn"===t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n?r.u=n.u:(r.u=s,e.addEventListener(t,o?c:l,o)):e.removeEventListener(t,o?c:l,o);else{if("http://www.w3.org/2000/svg"==i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&t in e)try{e[t]=null==r?"":r;break e}catch(a){}"function"==typeof r||(null==r||!1===r&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,r))}}function O(e){return function(r){if(this.l){var n=this.l[r.type+e];if(null==r.t)r.t=s++;else if(r.t<n.u)return;return n(t.event?t.event(r):r)}}}function R(r,n,i,o,a,s,l,c,u,p){var g,y,v,x,k,C,E,A,S,O,R,P,U,j,M,F=n.type;if(void 0!==n.constructor)return null;128&i.__u&&(u=!!(32&i.__u),s=[c=n.__e=i.__e]),(g=t.__b)&&g(n);e:if("function"==typeof F)try{if(A=n.props,S=(g=F.contextType)&&o[g.__c],O=g?S?S.props.value:g.__:o,i.__c?E=(y=n.__c=i.__c).__=y.__E:("prototype"in F&&F.prototype.render?n.__c=y=new F(A,O):(n.__c=y=new w(A,O),y.constructor=F,y.render=L),S&&S.sub(y),y.props=A,y.state||(y.state={}),y.context=O,y.__n=o,v=y.__d=!0,y.__h=[],y._sb=[]),null==y.__s&&(y.__s=y.state),null!=F.getDerivedStateFromProps&&(y.__s==y.state&&(y.__s=h({},y.__s)),h(y.__s,F.getDerivedStateFromProps(A,y.__s))),x=y.props,k=y.state,y.__v=n,v)null==F.getDerivedStateFromProps&&null!=y.componentWillMount&&y.componentWillMount(),null!=y.componentDidMount&&y.__h.push(y.componentDidMount);else{if(null==F.getDerivedStateFromProps&&A!==x&&null!=y.componentWillReceiveProps&&y.componentWillReceiveProps(A,O),!y.__e&&(null!=y.shouldComponentUpdate&&!1===y.shouldComponentUpdate(A,y.__s,O)||n.__v===i.__v)){for(n.__v!==i.__v&&(y.props=A,y.state=y.__s,y.__d=!1),n.__e=i.__e,n.__k=i.__k,n.__k.forEach((function(e){e&&(e.__=n)})),R=0;R<y._sb.length;R++)y.__h.push(y._sb[R]);y._sb=[],y.__h.length&&l.push(y);break e}null!=y.componentWillUpdate&&y.componentWillUpdate(A,y.__s,O),null!=y.componentDidUpdate&&y.__h.push((function(){y.componentDidUpdate(x,k,C)}))}if(y.context=O,y.props=A,y.__P=r,y.__e=!1,P=t.__r,U=0,"prototype"in F&&F.prototype.render){for(y.state=y.__s,y.__d=!1,P&&P(n),g=y.render(y.props,y.state,y.context),j=0;j<y._sb.length;j++)y.__h.push(y._sb[j]);y._sb=[]}else do{y.__d=!1,P&&P(n),g=y.render(y.props,y.state,y.context),y.state=y.__s}while(y.__d&&++U<25);y.state=y.__s,null!=y.getChildContext&&(o=h(h({},o),y.getChildContext())),v||null==y.getSnapshotBeforeUpdate||(C=y.getSnapshotBeforeUpdate(x,k)),N(r,m(M=null!=g&&g.type===b&&null==g.key?g.props.children:g)?M:[M],n,i,o,a,s,l,c,u,p),y.base=n.__e,n.__u&=-161,y.__h.length&&l.push(y),E&&(y.__E=y.__=null)}catch(I){n.__v=null,u||null!=s?(n.__e=c,n.__u|=u?160:32,s[s.indexOf(c)]=null):(n.__e=i.__e,n.__k=i.__k),t.__e(I,n,i)}else null==s&&n.__v===i.__v?(n.__k=i.__k,n.__e=i.__e):n.__e=function(t,r,n,i,o,a,s,l,c){var u,p,h,g,y,b,w,v=n.props,x=r.props,k=r.type;if("svg"===k?o="http://www.w3.org/2000/svg":"math"===k?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=a)for(u=0;u<a.length;u++)if((y=a[u])&&"setAttribute"in y==!!k&&(k?y.localName===k:3===y.nodeType)){t=y,a[u]=null;break}if(null==t){if(null===k)return document.createTextNode(x);t=document.createElementNS(o,k,x.is&&x),a=null,l=!1}if(null===k)v===x||l&&t.data===x||(t.data=x);else{if(a=a&&e.call(t.childNodes),v=n.props||d,!l&&null!=a)for(v={},u=0;u<t.attributes.length;u++)v[(y=t.attributes[u]).name]=y.value;for(u in v)if(y=v[u],"children"==u);else if("dangerouslySetInnerHTML"==u)h=y;else if("key"!==u&&!(u in x)){if("value"==u&&"defaultValue"in x||"checked"==u&&"defaultChecked"in x)continue;T(t,u,null,y,o)}for(u in x)y=x[u],"children"==u?g=y:"dangerouslySetInnerHTML"==u?p=y:"value"==u?b=y:"checked"==u?w=y:"key"===u||l&&"function"!=typeof y||v[u]===y||T(t,u,y,v[u],o);if(p)l||h&&(p.__html===h.__html||p.__html===t.innerHTML)||(t.innerHTML=p.__html),r.__k=[];else if(h&&(t.innerHTML=""),N(t,m(g)?g:[g],r,n,i,"foreignObject"===k?"http://www.w3.org/1999/xhtml":o,a,s,a?a[0]:n.__k&&_(n,0),l,c),null!=a)for(u=a.length;u--;)null!=a[u]&&f(a[u]);l||(u="value",void 0!==b&&(b!==t[u]||"progress"===k&&!b||"option"===k&&b!==v[u])&&T(t,u,b,v[u],o),u="checked",void 0!==w&&w!==t[u]&&T(t,u,w,v[u],o))}return t}(i.__e,n,i,o,a,s,l,u,p);(g=t.diffed)&&g(n)}function P(e,r,n){r.__d=void 0;for(var i=0;i<n.length;i++)U(n[i],n[++i],n[++i]);t.__c&&t.__c(r,e),e.some((function(r){try{e=r.__h,r.__h=[],e.some((function(e){e.call(r)}))}catch(n){t.__e(n,r.__v)}}))}function U(e,r,n){try{"function"==typeof e?e(r):e.current=r}catch(i){t.__e(i,n)}}function j(e,r,n){var i,o;if(t.unmount&&t.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||U(i,null,r)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(a){t.__e(a,r)}i.base=i.__P=null}if(i=e.__k)for(o=0;o<i.length;o++)i[o]&&j(i[o],r,n||"function"!=typeof e.type);n||null==e.__e||f(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function L(e,t,r){return this.constructor(e,r)}function M(r,n,i){var o,a,s,l;t.__&&t.__(r,n),a=(o="function"==typeof i)?null:i&&i.__k||n.__k,s=[],l=[],R(n,r=(!o&&i||n).__k=g(b,null,[r]),a||d,d,n.namespaceURI,!o&&i?[i]:a?null:n.firstChild?e.call(n.childNodes):null,s,!o&&i?i:a?a.__e:n.firstChild,o,l),P(s,r,l)}function F(e,t){M(e,t,F)}function I(t,r,n){var i,o,a,s,l=h({},t.props);for(a in t.type&&t.type.defaultProps&&(s=t.type.defaultProps),r)"key"==a?i=r[a]:"ref"==a?o=r[a]:l[a]=void 0===r[a]&&void 0!==s?s[a]:r[a];return arguments.length>2&&(l.children=arguments.length>3?e.call(arguments,2):n),y(t.type,l,i||t.key,o||t.ref,null)}e=u.slice,t={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(s){e=s}throw e}},r=0,w.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=h({},this.state),"function"==typeof e&&(e=e(h({},r),this.props)),e&&h(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),x(this))},w.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),x(this))},w.prototype.render=b,n=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,a=function(e,t){return e.__v.__b-t.__v.__b},k.__r=0,s=0,l=O(!1),c=O(!0);var B,D,z,H,q=0,V=[],$=[],W=t,J=W.__b,K=W.__r,G=W.diffed,X=W.__c,Z=W.unmount,Y=W.__;function Q(e,t){W.__h&&W.__h(D,e,q||t),q=0;var r=D.__H||(D.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:$}),r.__[e]}function ee(e){return q=1,function(e,t,r){var n=Q(B++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):ue(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],r=n.t(t,e);t!==r&&(n.__N=[r,n.__[1]],n.__c.setState({}))}],n.__c=D,!D.u)){var i=function(e,t,r){if(!n.__c.__H)return!0;var i=n.__c.__H.__.filter((function(e){return!!e.__c}));if(i.every((function(e){return!e.__N})))return!o||o.call(this,e,t,r);var a=!1;return i.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),!(!a&&n.__c.props===e)&&(!o||o.call(this,e,t,r))};D.u=!0;var o=D.shouldComponentUpdate,a=D.componentWillUpdate;D.componentWillUpdate=function(e,t,r){if(this.__e){var n=o;o=void 0,i(e,t,r),o=n}a&&a.call(this,e,t,r)},D.shouldComponentUpdate=i}return n.__N||n.__}(ue,e)}function te(e,t){var r=Q(B++,3);!W.__s&&de(r.__H,t)&&(r.__=e,r.i=t,D.__H.__h.push(r))}function re(e){return q=5,ne((function(){return{current:e}}),[])}function ne(e,t){var r=Q(B++,7);return de(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function ie(e,t){return q=8,ne((function(){return e}),t)}function oe(){for(var e;e=V.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(le),e.__H.__h.forEach(ce),e.__H.__h=[]}catch(t){e.__H.__h=[],W.__e(t,e.__v)}}W.__b=function(e){D=null,J&&J(e)},W.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Y&&Y(e,t)},W.__r=function(e){K&&K(e),B=0;var t=(D=e.__c).__H;t&&(z===D?(t.__h=[],D.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=$,e.__N=e.i=void 0}))):(t.__h.forEach(le),t.__h.forEach(ce),t.__h=[],B=0)),z=D},W.diffed=function(e){G&&G(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==V.push(t)&&H===W.requestAnimationFrame||((H=W.requestAnimationFrame)||se)(oe)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==$&&(e.__=e.__V),e.i=void 0,e.__V=$}))),z=D=null},W.__c=function(e,t){t.some((function(e){try{e.__h.forEach(le),e.__h=e.__h.filter((function(e){return!e.__||ce(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],W.__e(r,e.__v)}})),X&&X(e,t)},W.unmount=function(e){Z&&Z(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{le(e)}catch(r){t=r}})),r.__H=void 0,t&&W.__e(t,r.__v))};var ae="function"==typeof requestAnimationFrame;function se(e){var t,r=function(){clearTimeout(n),ae&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);ae&&(t=requestAnimationFrame(r))}function le(e){var t=D,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),D=t}function ce(e){var t=D;e.__c=e.__(),D=t}function de(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function ue(e,t){return"function"==typeof t?t(e):t}function pe(e,t){return function(){return e.apply(t,arguments)}}const{toString:me}=Object.prototype,{getPrototypeOf:he}=Object,fe=(ge=Object.create(null),e=>{const t=me.call(e);return ge[t]||(ge[t]=t.slice(8,-1).toLowerCase())});var ge;const ye=e=>(e=e.toLowerCase(),t=>fe(t)===e),be=e=>t=>typeof t===e,{isArray:we}=Array,_e=be("undefined");const ve=ye("ArrayBuffer");const xe=be("string"),ke=be("function"),Ne=be("number"),Ce=e=>null!==e&&"object"==typeof e,Ee=e=>{if("object"!==fe(e))return!1;const t=he(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},Ae=ye("Date"),Se=ye("File"),Te=ye("Blob"),Oe=ye("FileList"),Re=ye("URLSearchParams"),[Pe,Ue,je,Le]=["ReadableStream","Request","Response","Headers"].map(ye);function Me(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,i;if("object"!=typeof e&&(e=[e]),we(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{const i=r?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let a;for(n=0;n<o;n++)a=i[n],t.call(null,e[a],a,e)}}function Fe(e,t){t=t.toLowerCase();const r=Object.keys(e);let n,i=r.length;for(;i-- >0;)if(n=r[i],t===n.toLowerCase())return n;return null}const Ie="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Be=e=>!_e(e)&&e!==Ie;const De=(ze="undefined"!=typeof Uint8Array&&he(Uint8Array),e=>ze&&e instanceof ze);var ze;const He=ye("HTMLFormElement"),qe=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Ve=ye("RegExp"),$e=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Me(r,((r,i)=>{let o;!1!==(o=t(r,i,e))&&(n[i]=o||r)})),Object.defineProperties(e,n)},We="abcdefghijklmnopqrstuvwxyz",Je="0123456789",Ke={DIGIT:Je,ALPHA:We,ALPHA_DIGIT:We+We.toUpperCase()+Je};const Ge=ye("AsyncFunction"),Xe={isArray:we,isArrayBuffer:ve,isBuffer:function(e){return null!==e&&!_e(e)&&null!==e.constructor&&!_e(e.constructor)&&ke(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||ke(e.append)&&("formdata"===(t=fe(e))||"object"===t&&ke(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&ve(e.buffer),t},isString:xe,isNumber:Ne,isBoolean:e=>!0===e||!1===e,isObject:Ce,isPlainObject:Ee,isReadableStream:Pe,isRequest:Ue,isResponse:je,isHeaders:Le,isUndefined:_e,isDate:Ae,isFile:Se,isBlob:Te,isRegExp:Ve,isFunction:ke,isStream:e=>Ce(e)&&ke(e.pipe),isURLSearchParams:Re,isTypedArray:De,isFileList:Oe,forEach:Me,merge:function e(){const{caseless:t}=Be(this)&&this||{},r={},n=(n,i)=>{const o=t&&Fe(r,i)||i;Ee(r[o])&&Ee(n)?r[o]=e(r[o],n):Ee(n)?r[o]=e({},n):we(n)?r[o]=n.slice():r[o]=n};for(let i=0,o=arguments.length;i<o;i++)arguments[i]&&Me(arguments[i],n);return r},extend:(e,t,r,{allOwnKeys:n}={})=>(Me(t,((t,n)=>{r&&ke(t)?e[n]=pe(t,r):e[n]=t}),{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let i,o,a;const s={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],n&&!n(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==r&&he(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:fe,kindOfTest:ye,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(we(e))return e;let t=e.length;if(!Ne(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:He,hasOwnProperty:qe,hasOwnProp:qe,reduceDescriptors:$e,freezeMethods:e=>{$e(e,((t,r)=>{if(ke(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];ke(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return we(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:Fe,global:Ie,isContextDefined:Be,ALPHABET:Ke,generateString:(e=16,t=Ke.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&ke(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(Ce(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const i=we(e)?[]:{};return Me(e,((e,t)=>{const o=r(e,n+1);!_e(o)&&(i[t]=o)})),t[n]=void 0,i}}return e};return r(e,0)},isAsyncFn:Ge,isThenable:e=>e&&(Ce(e)||ke(e))&&ke(e.then)&&ke(e.catch)};function Ze(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}Xe.inherits(Ze,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Xe.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Ye=Ze.prototype,Qe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Qe[e]={value:e}})),Object.defineProperties(Ze,Qe),Object.defineProperty(Ye,"isAxiosError",{value:!0}),Ze.from=(e,t,r,n,i,o)=>{const a=Object.create(Ye);return Xe.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),Ze.call(a,e.message,t,r,n,i),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};function et(e){return Xe.isPlainObject(e)||Xe.isArray(e)}function tt(e){return Xe.endsWith(e,"[]")?e.slice(0,-2):e}function rt(e,t,r){return e?e.concat(t).map((function(e,t){return e=tt(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const nt=Xe.toFlatObject(Xe,{},null,(function(e){return/^is[A-Z]/.test(e)}));function it(e,t,r){if(!Xe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=Xe.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Xe.isUndefined(t[e])}))).metaTokens,i=r.visitor||c,o=r.dots,a=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&Xe.isSpecCompliantForm(t);if(!Xe.isFunction(i))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(Xe.isDate(e))return e.toISOString();if(!s&&Xe.isBlob(e))throw new Ze("Blob is not supported. Use a Buffer instead.");return Xe.isArrayBuffer(e)||Xe.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,r,i){let s=e;if(e&&!i&&"object"==typeof e)if(Xe.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(Xe.isArray(e)&&function(e){return Xe.isArray(e)&&!e.some(et)}(e)||(Xe.isFileList(e)||Xe.endsWith(r,"[]"))&&(s=Xe.toArray(e)))return r=tt(r),s.forEach((function(e,n){!Xe.isUndefined(e)&&null!==e&&t.append(!0===a?rt([r],n,o):null===a?r:r+"[]",l(e))})),!1;return!!et(e)||(t.append(rt(i,r,o),l(e)),!1)}const d=[],u=Object.assign(nt,{defaultVisitor:c,convertValue:l,isVisitable:et});if(!Xe.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!Xe.isUndefined(r)){if(-1!==d.indexOf(r))throw Error("Circular reference detected in "+n.join("."));d.push(r),Xe.forEach(r,(function(r,o){!0===(!(Xe.isUndefined(r)||null===r)&&i.call(t,r,Xe.isString(o)?o.trim():o,n,u))&&e(r,n?n.concat(o):[o])})),d.pop()}}(e),t}function ot(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function at(e,t){this._pairs=[],e&&it(e,this,t)}const st=at.prototype;function lt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ct(e,t,r){if(!t)return e;const n=r&&r.encode||lt,i=r&&r.serialize;let o;if(o=i?i(t,r):Xe.isURLSearchParams(t)?t.toString():new at(t,r).toString(n),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}st.append=function(e,t){this._pairs.push([e,t])},st.toString=function(e){const t=e?function(t){return e.call(this,t,ot)}:ot;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const dt=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Xe.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ut={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},pt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:at,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},mt="undefined"!=typeof window&&"undefined"!=typeof document,ht=(ft="undefined"!=typeof navigator&&navigator.product,mt&&["ReactNative","NativeScript","NS"].indexOf(ft)<0);var ft;const gt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,yt=mt&&window.location.href||"http://localhost",bt={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:mt,hasStandardBrowserEnv:ht,hasStandardBrowserWebWorkerEnv:gt,origin:yt},Symbol.toStringTag,{value:"Module"})),...pt};function wt(e){function t(e,r,n,i){let o=e[i++];if("__proto__"===o)return!0;const a=Number.isFinite(+o),s=i>=e.length;if(o=!o&&Xe.isArray(n)?n.length:o,s)return Xe.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!a;n[o]&&Xe.isObject(n[o])||(n[o]=[]);return t(e,r,n[o],i)&&Xe.isArray(n[o])&&(n[o]=function(e){const t={},r=Object.keys(e);let n;const i=r.length;let o;for(n=0;n<i;n++)o=r[n],t[o]=e[o];return t}(n[o])),!a}if(Xe.isFormData(e)&&Xe.isFunction(e.entries)){const r={};return Xe.forEachEntry(e,((e,n)=>{t(function(e){return Xe.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null}const _t={transitional:ut,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=Xe.isObject(e);i&&Xe.isHTMLForm(e)&&(e=new FormData(e));if(Xe.isFormData(e))return n?JSON.stringify(wt(e)):e;if(Xe.isArrayBuffer(e)||Xe.isBuffer(e)||Xe.isStream(e)||Xe.isFile(e)||Xe.isBlob(e)||Xe.isReadableStream(e))return e;if(Xe.isArrayBufferView(e))return e.buffer;if(Xe.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return it(e,new bt.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return bt.isNode&&Xe.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((o=Xe.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return it(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),function(e,t,r){if(Xe.isString(e))try{return(t||JSON.parse)(e),Xe.trim(e)}catch(n){if("SyntaxError"!==n.name)throw n}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||_t.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(Xe.isResponse(e)||Xe.isReadableStream(e))return e;if(e&&Xe.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(i){if(r){if("SyntaxError"===i.name)throw Ze.from(i,Ze.ERR_BAD_RESPONSE,this,null,this.response);throw i}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:bt.classes.FormData,Blob:bt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Xe.forEach(["delete","get","head","post","put","patch"],(e=>{_t.headers[e]={}}));const vt=_t,xt=Xe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),kt=Symbol("internals");function Nt(e){return e&&String(e).trim().toLowerCase()}function Ct(e){return!1===e||null==e?e:Xe.isArray(e)?e.map(Ct):String(e)}function Et(e,t,r,n,i){return Xe.isFunction(n)?n.call(this,t,r):(i&&(t=r),Xe.isString(t)?Xe.isString(n)?-1!==t.indexOf(n):Xe.isRegExp(n)?n.test(t):void 0:void 0)}let At=class{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function i(e,t,r){const i=Nt(t);if(!i)throw new Error("header name must be a non-empty string");const o=Xe.findKey(n,i);(!o||void 0===n[o]||!0===r||void 0===r&&!1!==n[o])&&(n[o||t]=Ct(e))}const o=(e,t)=>Xe.forEach(e,((e,r)=>i(e,r,t)));if(Xe.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(Xe.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let r,n,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),r=e.substring(0,i).trim().toLowerCase(),n=e.substring(i+1).trim(),!r||t[r]&&xt[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t);else if(Xe.isHeaders(e))for(const[a,s]of e.entries())i(s,a,r);else null!=e&&i(t,e,r);return this}get(e,t){if(e=Nt(e)){const r=Xe.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(Xe.isFunction(t))return t.call(this,e,r);if(Xe.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Nt(e)){const r=Xe.findKey(this,e);return!(!r||void 0===this[r]||t&&!Et(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function i(e){if(e=Nt(e)){const i=Xe.findKey(r,e);!i||t&&!Et(0,r[i],i,t)||(delete r[i],n=!0)}}return Xe.isArray(e)?e.forEach(i):i(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const i=t[r];e&&!Et(0,this[i],i,e,!0)||(delete this[i],n=!0)}return n}normalize(e){const t=this,r={};return Xe.forEach(this,((n,i)=>{const o=Xe.findKey(r,i);if(o)return t[o]=Ct(n),void delete t[i];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(i):String(i).trim();a!==i&&delete t[i],t[a]=Ct(n),r[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Xe.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&Xe.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[kt]=this[kt]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=Nt(e);t[n]||(!function(e,t){const r=Xe.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:!0})}))}(r,e),t[n]=!0)}return Xe.isArray(e)?e.forEach(n):n(e),this}};At.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Xe.reduceDescriptors(At.prototype,(({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}})),Xe.freezeMethods(At);const St=At;function Tt(e,t){const r=this||vt,n=t||r,i=St.from(n.headers);let o=n.data;return Xe.forEach(e,(function(e){o=e.call(r,o,i.normalize(),t?t.status:void 0)})),i.normalize(),o}function Ot(e){return!(!e||!e.__CANCEL__)}function Rt(e,t,r){Ze.call(this,null==e?"canceled":e,Ze.ERR_CANCELED,t,r),this.name="CanceledError"}function Pt(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new Ze("Request failed with status code "+r.status,[Ze.ERR_BAD_REQUEST,Ze.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}Xe.inherits(Rt,Ze,{__CANCEL__:!0});const Ut=(e,t,r=3)=>{let n=0;const i=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i,o=0,a=0;return t=void 0!==t?t:1e3,function(s){const l=Date.now(),c=n[a];i||(i=l),r[o]=s,n[o]=l;let d=a,u=0;for(;d!==o;)u+=r[d++],d%=e;if(o=(o+1)%e,o===a&&(a=(a+1)%e),l-i<t)return;const p=c&&l-c;return p?Math.round(1e3*u/p):void 0}}(50,250);return function(e,t){let r=0;const n=1e3/t;let i=null;return function(){const t=!0===this,o=Date.now();if(t||o-r>n)return i&&(clearTimeout(i),i=null),r=o,e.apply(null,arguments);i||(i=setTimeout((()=>(i=null,r=Date.now(),e.apply(null,arguments))),n-(o-r)))}}((r=>{const o=r.loaded,a=r.lengthComputable?r.total:void 0,s=o-n,l=i(s);n=o;const c={loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:l||void 0,estimated:l&&a&&o<=a?(a-o)/l:void 0,event:r,lengthComputable:null!=a};c[t?"download":"upload"]=!0,e(c)}),r)},jt=bt.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(e){const t=Xe.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0},Lt=bt.hasStandardBrowserEnv?{write(e,t,r,n,i,o){const a=[e+"="+encodeURIComponent(t)];Xe.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),Xe.isString(n)&&a.push("path="+n),Xe.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Mt(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Ft=e=>e instanceof St?{...e}:e;function It(e,t){t=t||{};const r={};function n(e,t,r){return Xe.isPlainObject(e)&&Xe.isPlainObject(t)?Xe.merge.call({caseless:r},e,t):Xe.isPlainObject(t)?Xe.merge({},t):Xe.isArray(t)?t.slice():t}function i(e,t,r){return Xe.isUndefined(t)?Xe.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function o(e,t){if(!Xe.isUndefined(t))return n(void 0,t)}function a(e,t){return Xe.isUndefined(t)?Xe.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,i,o){return o in t?n(r,i):o in e?n(void 0,r):void 0}const l={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t)=>i(Ft(e),Ft(t),!0)};return Xe.forEach(Object.keys(Object.assign({},e,t)),(function(n){const o=l[n]||i,a=o(e[n],t[n],n);Xe.isUndefined(a)&&o!==s||(r[n]=a)})),r}const Bt=e=>{const t=It({},e);let r,{data:n,withXSRFToken:i,xsrfHeaderName:o,xsrfCookieName:a,headers:s,auth:l}=t;if(t.headers=s=St.from(s),t.url=ct(Mt(t.baseURL,t.url),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),Xe.isFormData(n))if(bt.hasStandardBrowserEnv||bt.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(r=s.getContentType())){const[e,...t]=r?r.split(";").map((e=>e.trim())).filter(Boolean):[];s.setContentType([e||"multipart/form-data",...t].join("; "))}if(bt.hasStandardBrowserEnv&&(i&&Xe.isFunction(i)&&(i=i(t)),i||!1!==i&&jt(t.url))){const e=o&&a&&Lt.read(a);e&&s.set(o,e)}return t},Dt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){const n=Bt(e);let i=n.data;const o=St.from(n.headers).normalize();let a,{responseType:s}=n;function l(){n.cancelToken&&n.cancelToken.unsubscribe(a),n.signal&&n.signal.removeEventListener("abort",a)}let c=new XMLHttpRequest;function d(){if(!c)return;const n=St.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());Pt((function(e){t(e),l()}),(function(e){r(e),l()}),{data:s&&"text"!==s&&"json"!==s?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:n,config:e,request:c}),c=null}c.open(n.method.toUpperCase(),n.url,!0),c.timeout=n.timeout,"onloadend"in c?c.onloadend=d:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(d)},c.onabort=function(){c&&(r(new Ze("Request aborted",Ze.ECONNABORTED,n,c)),c=null)},c.onerror=function(){r(new Ze("Network Error",Ze.ERR_NETWORK,n,c)),c=null},c.ontimeout=function(){let e=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const t=n.transitional||ut;n.timeoutErrorMessage&&(e=n.timeoutErrorMessage),r(new Ze(e,t.clarifyTimeoutError?Ze.ETIMEDOUT:Ze.ECONNABORTED,n,c)),c=null},void 0===i&&o.setContentType(null),"setRequestHeader"in c&&Xe.forEach(o.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),Xe.isUndefined(n.withCredentials)||(c.withCredentials=!!n.withCredentials),s&&"json"!==s&&(c.responseType=n.responseType),"function"==typeof n.onDownloadProgress&&c.addEventListener("progress",Ut(n.onDownloadProgress,!0)),"function"==typeof n.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",Ut(n.onUploadProgress)),(n.cancelToken||n.signal)&&(a=t=>{c&&(r(!t||t.type?new Rt(null,e,c):t),c.abort(),c=null)},n.cancelToken&&n.cancelToken.subscribe(a),n.signal&&(n.signal.aborted?a():n.signal.addEventListener("abort",a)));const u=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);u&&-1===bt.protocols.indexOf(u)?r(new Ze("Unsupported protocol "+u+":",Ze.ERR_BAD_REQUEST,e)):c.send(i||null)}))},zt=(e,t)=>{let r,n=new AbortController;const i=function(e){if(!r){r=!0,a();const t=e instanceof Error?e:this.reason;n.abort(t instanceof Ze?t:new Rt(t instanceof Error?t.message:t))}};let o=t&&setTimeout((()=>{i(new Ze(`timeout ${t} of ms exceeded`,Ze.ETIMEDOUT))}),t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach((e=>{e&&(e.removeEventListener?e.removeEventListener("abort",i):e.unsubscribe(i))})),e=null)};e.forEach((e=>e&&e.addEventListener&&e.addEventListener("abort",i)));const{signal:s}=n;return s.unsubscribe=a,[s,()=>{o&&clearTimeout(o),o=null}]},Ht=function*(e,t){let r=e.byteLength;if(!t||r<t)return void(yield e);let n,i=0;for(;i<r;)n=i+t,yield e.slice(i,n),i=n},qt=(e,t,r,n,i)=>{const o=async function*(e,t,r){for await(const n of e)yield*Ht(ArrayBuffer.isView(n)?n:await r(String(n)),t)}(e,t,i);let a=0;return new ReadableStream({type:"bytes",async pull(e){const{done:t,value:i}=await o.next();if(t)return e.close(),void n();let s=i.byteLength;r&&r(a+=s),e.enqueue(new Uint8Array(i))},cancel:e=>(n(e),o.return())},{highWaterMark:2})},Vt=(e,t)=>{const r=null!=e;return n=>setTimeout((()=>t({lengthComputable:r,total:e,loaded:n})))},$t="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Wt=$t&&"function"==typeof ReadableStream,Jt=$t&&("function"==typeof TextEncoder?(Kt=new TextEncoder,e=>Kt.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Kt;const Gt=Wt&&(()=>{let e=!1;const t=new Request(bt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})(),Xt=Wt&&!!(()=>{try{return Xe.isReadableStream(new Response("").body)}catch(e){}})(),Zt={stream:Xt&&(e=>e.body)};var Yt;$t&&(Yt=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!Zt[e]&&(Zt[e]=Xe.isFunction(Yt[e])?t=>t[e]():(t,r)=>{throw new Ze(`Response type '${e}' is not supported`,Ze.ERR_NOT_SUPPORT,r)})})));const Qt=async(e,t)=>{const r=Xe.toFiniteNumber(e.getContentLength());return null==r?(async e=>null==e?0:Xe.isBlob(e)?e.size:Xe.isSpecCompliantForm(e)?(await new Request(e).arrayBuffer()).byteLength:Xe.isArrayBufferView(e)?e.byteLength:(Xe.isURLSearchParams(e)&&(e+=""),Xe.isString(e)?(await Jt(e)).byteLength:void 0))(t):r},er={http:null,xhr:Dt,fetch:$t&&(async e=>{let{url:t,method:r,data:n,signal:i,cancelToken:o,timeout:a,onDownloadProgress:s,onUploadProgress:l,responseType:c,headers:d,withCredentials:u="same-origin",fetchOptions:p}=Bt(e);c=c?(c+"").toLowerCase():"text";let m,h,[f,g]=i||o||a?zt([i,o],a):[];const y=()=>{!m&&setTimeout((()=>{f&&f.unsubscribe()})),m=!0};let b;try{if(l&&Gt&&"get"!==r&&"head"!==r&&0!==(b=await Qt(d,n))){let e,r=new Request(t,{method:"POST",body:n,duplex:"half"});Xe.isFormData(n)&&(e=r.headers.get("content-type"))&&d.setContentType(e),r.body&&(n=qt(r.body,65536,Vt(b,Ut(l)),null,Jt))}Xe.isString(u)||(u=u?"cors":"omit"),h=new Request(t,{...p,signal:f,method:r.toUpperCase(),headers:d.normalize().toJSON(),body:n,duplex:"half",withCredentials:u});let i=await fetch(h);const o=Xt&&("stream"===c||"response"===c);if(Xt&&(s||o)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=i[t]}));const t=Xe.toFiniteNumber(i.headers.get("content-length"));i=new Response(qt(i.body,65536,s&&Vt(t,Ut(s,!0)),o&&y,Jt),e)}c=c||"text";let a=await Zt[Xe.findKey(Zt,c)||"text"](i,e);return!o&&y(),g&&g(),await new Promise(((t,r)=>{Pt(t,r,{data:a,headers:St.from(i.headers),status:i.status,statusText:i.statusText,config:e,request:h})}))}catch(w){if(y(),w&&"TypeError"===w.name&&/fetch/i.test(w.message))throw Object.assign(new Ze("Network Error",Ze.ERR_NETWORK,e,h),{cause:w.cause||w});throw Ze.from(w,w&&w.code,e,h)}})};Xe.forEach(er,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(r){}Object.defineProperty(e,"adapterName",{value:t})}}));const tr=e=>`- ${e}`,rr=e=>Xe.isFunction(e)||null===e||!1===e,nr=e=>{e=Xe.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let o=0;o<t;o++){let t;if(r=e[o],n=r,!rr(r)&&(n=er[(t=String(r)).toLowerCase()],void 0===n))throw new Ze(`Unknown adapter '${t}'`);if(n)break;i[t||"#"+o]=n}if(!n){const e=Object.entries(i).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new Ze("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(tr).join("\n"):" "+tr(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n};function ir(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Rt(null,e)}function or(e){ir(e),e.headers=St.from(e.headers),e.data=Tt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return nr(e.adapter||vt.adapter)(e).then((function(t){return ir(e),t.data=Tt.call(e,e.transformResponse,t),t.headers=St.from(t.headers),t}),(function(t){return Ot(t)||(ir(e),t&&t.response&&(t.response.data=Tt.call(e,e.transformResponse,t.response),t.response.headers=St.from(t.response.headers))),Promise.reject(t)}))}const ar="1.7.2",sr={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{sr[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const lr={};sr.transitional=function(e,t,r){function n(e,t){return"[Axios v1.7.2] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,i,o)=>{if(!1===e)throw new Ze(n(i," has been removed"+(t?" in "+t:"")),Ze.ERR_DEPRECATED);return t&&!lr[i]&&(lr[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,o)}};const cr={assertOptions:function(e,t,r){if("object"!=typeof e)throw new Ze("options must be an object",Ze.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const o=n[i],a=t[o];if(a){const t=e[o],r=void 0===t||a(t,o,e);if(!0!==r)throw new Ze("option "+o+" must be "+r,Ze.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new Ze("Unknown option "+o,Ze.ERR_BAD_OPTION)}},validators:sr},dr=cr.validators;let ur=class{constructor(e){this.defaults=e,this.interceptors={request:new dt,response:new dt}}async request(e,t){try{return await this._request(e,t)}catch(r){if(r instanceof Error){let e;Error.captureStackTrace?Error.captureStackTrace(e={}):e=new Error;const t=e.stack?e.stack.replace(/^.+\n/,""):"";try{r.stack?t&&!String(r.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(r.stack+="\n"+t):r.stack=t}catch(n){}}throw r}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=It(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:i}=t;void 0!==r&&cr.assertOptions(r,{silentJSONParsing:dr.transitional(dr.boolean),forcedJSONParsing:dr.transitional(dr.boolean),clarifyTimeoutError:dr.transitional(dr.boolean)},!1),null!=n&&(Xe.isFunction(n)?t.paramsSerializer={serialize:n}:cr.assertOptions(n,{encode:dr.function,serialize:dr.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&Xe.merge(i.common,i[t.method]);i&&Xe.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=St.concat(o,i);const a=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const l=[];let c;this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)}));let d,u=0;if(!s){const e=[or.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,l),d=e.length,c=Promise.resolve(t);u<d;)c=c.then(e[u++],e[u++]);return c}d=a.length;let p=t;for(u=0;u<d;){const e=a[u++],t=a[u++];try{p=e(p)}catch(m){t.call(this,m);break}}try{c=or.call(this,p)}catch(m){return Promise.reject(m)}for(u=0,d=l.length;u<d;)c=c.then(l[u++],l[u++]);return c}getUri(e){return ct(Mt((e=It(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}};Xe.forEach(["delete","get","head","options"],(function(e){ur.prototype[e]=function(t,r){return this.request(It(r||{},{method:e,url:t,data:(r||{}).data}))}})),Xe.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,i){return this.request(It(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}ur.prototype[e]=t(),ur.prototype[e+"Form"]=t(!0)}));const pr=ur;const mr=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,i){r.reason||(r.reason=new Rt(e,n,i),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let t;return{token:new e((function(e){t=e})),cancel:t}}};const hr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(hr).forEach((([e,t])=>{hr[t]=e}));const fr=hr;const gr=function e(t){const r=new pr(t),n=pe(pr.prototype.request,r);return Xe.extend(n,pr.prototype,r,{allOwnKeys:!0}),Xe.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(It(t,r))},n}(vt);gr.Axios=pr,gr.CanceledError=Rt,gr.CancelToken=mr,gr.isCancel=Ot,gr.VERSION=ar,gr.toFormData=it,gr.AxiosError=Ze,gr.Cancel=gr.CanceledError,gr.all=function(e){return Promise.all(e)},gr.spread=function(e){return function(t){return e.apply(null,t)}},gr.isAxiosError=function(e){return Xe.isObject(e)&&!0===e.isAxiosError},gr.mergeConfig=It,gr.AxiosHeaders=St,gr.formToJSON=e=>wt(Xe.isHTMLForm(e)?new FormData(e):e),gr.getAdapter=nr,gr.HttpStatusCode=fr,gr.default=gr;const yr=gr,{Axios:br,AxiosError:wr,CanceledError:_r,isCancel:vr,CancelToken:xr,VERSION:kr,all:Nr,Cancel:Cr,isAxiosError:Er,spread:Ar,toFormData:Sr,AxiosHeaders:Tr,HttpStatusCode:Or,formToJSON:Rr,getAdapter:Pr,mergeConfig:Ur}=yr;var jr=(e=>(e.EmailAddress="EmailAddress",e.MobileNumber="MobileNumber",e.CustomerId="CustomerId",e))(jr||{});const Lr=[{searchType:"EmailAddress",name:"Email Address",label:"emailAddress"},{searchType:"MobileNumber",name:"Mobile Number",label:"mobileNumber"},{searchType:"CustomerId",name:"PBA Customer Id",label:"customerId"}];var Mr=(e=>(e.Established="Established",e.Unestablished="Unestablished",e))(Mr||{});const Fr=e=>!!/\+\d{1,14}$/.test(e);let Ir;let Br;var Dr=(e=>(e.Assessment="Assessment",e.Quiz="Quiz",e.Poll="Poll",e.Trivia="Trivia",e.Article="Article",e.Url="Url",e.Contact="Contact",e.Deeplink="Deeplink",e.Advertisement="Advertisement",e))(Dr||{}),zr=(e=>(e.Cars="Cars",e.Health="Health",e.Everyday="Everyday",e.Devices="Devices",e.Energy="Energy",e.SavingsAccount="Savings Account*",e.HomeLoan="Home Loan*",e.MobileAndInternet="Mobile & Internet",e))(zr||{});const Hr=e=>{var t;const r=e,n=(null==(t=r.response)?void 0:t.data)?r.response.data:void 0;return(null==n?void 0:n.message)??r.message},qr=(e,t=3)=>{const r=e.split(" ");return r.length>t?`${r.slice(0,t).join(" ")}...`:e},Vr=(e,t)=>{switch(e){case Dr.Trivia:return"Trivia";case Dr.Assessment:switch(t){case zr.Cars:return"SalaryPackagingCars";case zr.HomeLoan:return"HomeLoan"}return t.replace(/\s+/g,"");default:return"None"}},$r=e=>{switch(e){case zr.SavingsAccount:return["Banking"];case zr.Cars:return["Cars"];case zr.Devices:case zr.Health:case zr.Energy:case zr.Everyday:return[e];case"None":return["Miscellaneous"];case zr.HomeLoan:case zr.MobileAndInternet:default:return[]}},Wr=e=>{switch(e){case zr.Cars:return["NovatedLease"];case zr.Health:return["HealthInsurance"];case zr.SavingsAccount:return["SavingsAccount"];case zr.Devices:case zr.Energy:return[e];case zr.HomeLoan:return["HomeLoan"];case zr.MobileAndInternet:case zr.Everyday:default:return[]}},Jr=(e,t,r)=>{const n=e.products[0],i=Kr(e,t);i?i.isFeatured=r??!1:n.activities.push({id:t,isFeatured:r??!1})},Kr=(e,t)=>e.products[0].activities.find((e=>e.id===t));let Gr;const Xr=async(e,t)=>{if(!Gr)throw new Error("Api has not been initialized");return await Gr.put(`/_admin/v1.0/categories/${e}`,t)},Zr=async(e,t,r,n)=>{if(!Gr)throw new Error("Api has not been initialized");try{if(await Gr.put(`/_admin/v1.0/activities/${e}`,t),r){const t=Kr(r,e);if((null==t?void 0:t.isFeatured)!==n){Jr(r,e,n??!1);const t=r;await Xr(r.id,t)}}}catch(i){throw new Error(`${Hr(i)}`)}},Yr=(e,t)=>{te((()=>{((e,t)=>{Ir=yr.create({baseURL:`${e}/customer-profile`,headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}})})(e,t),((e,t)=>{Br=yr.create({baseURL:`${e}/flare-app-identity`,headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}})})(e,t),((e,t)=>{Gr=yr.create({baseURL:`${e}/benefits-plan`,headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}})})(e,t)}),[e,t])},Qr="*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: \"\"}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol,\"Noto Color Emoji\";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}[type=text],input:where(:not([type])),[type=email],[type=url],[type=password],[type=number],[type=date],[type=datetime-local],[type=month],[type=search],[type=tel],[type=time],[type=week],[multiple],textarea,select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#6b7280;border-width:1px;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem;--tw-shadow: 0 0 #0000}[type=text]:focus,input:where(:not([type])):focus,[type=email]:focus,[type=url]:focus,[type=password]:focus,[type=number]:focus,[type=date]:focus,[type=datetime-local]:focus,[type=month]:focus,[type=search]:focus,[type=tel]:focus,[type=time]:focus,[type=week]:focus,[multiple]:focus,textarea:focus,select:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: #2563eb;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#2563eb}input::-moz-placeholder,textarea::-moz-placeholder{color:#6b7280;opacity:1}input::placeholder,textarea::placeholder{color:#6b7280;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-top:0;padding-bottom:0}select{background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e\");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem;-webkit-print-color-adjust:exact;print-color-adjust:exact}[multiple],[size]:where(select:not([size=\"1\"])){background-image:initial;background-position:initial;background-repeat:unset;background-size:initial;padding-right:.75rem;-webkit-print-color-adjust:unset;print-color-adjust:unset}[type=checkbox],[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;-webkit-print-color-adjust:exact;print-color-adjust:exact;display:inline-block;vertical-align:middle;background-origin:border-box;-webkit-user-select:none;-moz-user-select:none;user-select:none;flex-shrink:0;height:1rem;width:1rem;color:#2563eb;background-color:#fff;border-color:#6b7280;border-width:1px;--tw-shadow: 0 0 #0000}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 2px;--tw-ring-offset-color: #fff;--tw-ring-color: #2563eb;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}[type=checkbox]:checked,[type=radio]:checked{border-color:transparent;background-color:currentColor;background-size:100% 100%;background-position:center;background-repeat:no-repeat}[type=checkbox]:checked{background-image:url(\"data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e\")}@media (forced-colors: active){[type=checkbox]:checked{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}}[type=radio]:checked{background-image:url(\"data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e\")}@media (forced-colors: active){[type=radio]:checked{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}}[type=checkbox]:checked:hover,[type=checkbox]:checked:focus,[type=radio]:checked:hover,[type=radio]:checked:focus{border-color:transparent;background-color:currentColor}[type=checkbox]:indeterminate{background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e\");border-color:transparent;background-color:currentColor;background-size:100% 100%;background-position:center;background-repeat:no-repeat}@media (forced-colors: active){[type=checkbox]:indeterminate{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}}[type=checkbox]:indeterminate:hover,[type=checkbox]:indeterminate:focus{border-color:transparent;background-color:currentColor}[type=file]{background:unset;border-color:inherit;border-width:0;border-radius:0;padding:0;font-size:unset;line-height:inherit}[type=file]:focus{outline:1px solid ButtonText;outline:1px auto -webkit-focus-ring-color}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.\\!visible{visibility:visible!important}.visible{visibility:visible}.fixed{position:fixed}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.z-10{z-index:10}.col-span-2{grid-column:span 2 / span 2}.col-span-3{grid-column:span 3 / span 3}.col-start-1{grid-column-start:1}.col-start-2{grid-column-start:2}.col-start-4{grid-column-start:4}.row-span-3{grid-row:span 3 / span 3}.m-4{margin:1rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.mx-auto{margin-left:auto;margin-right:auto}.ml-1{margin-left:.25rem}.ml-16{margin-left:4rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.mt-0{margin-top:0}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-8{margin-top:2rem}.mt-9{margin-top:2.25rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.hidden{display:none}.h-10{height:2.5rem}.h-4{height:1rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-full{height:100%}.min-h-full{min-height:100%}.w-1\\/2{width:50%}.w-1\\/3{width:33.333333%}.w-12{width:3rem}.w-3\\/4{width:75%}.w-4{width:1rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-full{width:100%}.w-screen{width:100vw}.min-w-full{min-width:100%}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.flex-shrink-0{flex-shrink:0}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-normal{justify-content:normal}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2rem * var(--tw-space-x-reverse));margin-left:calc(2rem * calc(1 - var(--tw-space-x-reverse)))}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(1px * var(--tw-divide-x-reverse));border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(229 231 235 / var(--tw-divide-opacity))}.divide-gray-500>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(107 114 128 / var(--tw-divide-opacity))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.border-0{border-width:0px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-indigo-500{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity))}.border-transparent{border-color:transparent}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}.bg-indigo-500{--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-opacity-75{--tw-bg-opacity: .75}.p-2{padding:.5rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-4{padding-bottom:1rem}.pl-3{padding-left:.75rem}.pl-4{padding-left:1rem}.pr-10{padding-right:2.5rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-0\\.5{padding-top:.125rem}.pt-5{padding-top:1.25rem}.text-left{text-align:left}.text-center{text-align:center}.align-middle{vertical-align:middle}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-6{line-height:1.5rem}.tracking-wider{letter-spacing:.05em}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity))}.text-indigo-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.opacity-50{opacity:.5}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-inset{--tw-ring-inset: inset}.ring-black{--tw-ring-opacity: 1;--tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity))}.ring-gray-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity))}.ring-opacity-5{--tw-ring-opacity: .05}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\\:border-gray-300:hover{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.hover\\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.hover\\:bg-indigo-900:hover{--tw-bg-opacity: 1;background-color:rgb(49 46 129 / var(--tw-bg-opacity))}.hover\\:bg-red-500:hover{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.hover\\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.focus\\:border-indigo-500:focus{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-indigo-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity))}.focus\\:ring-indigo-600:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(79 70 229 / var(--tw-ring-opacity))}.focus-visible\\:outline:focus-visible{outline-style:solid}.focus-visible\\:outline-2:focus-visible{outline-width:2px}.focus-visible\\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\\:outline-indigo-600:focus-visible{outline-color:#4f46e5}@media (min-width: 640px){.sm\\:col-span-2{grid-column:span 2 / span 2}.sm\\:col-span-3{grid-column:span 3 / span 3}.sm\\:col-start-1{grid-column-start:1}.sm\\:col-start-2{grid-column-start:2}.sm\\:col-start-3{grid-column-start:3}.sm\\:col-start-4{grid-column-start:4}.sm\\:row-start-1{grid-row-start:1}.sm\\:-mx-4{margin-left:-1rem;margin-right:-1rem}.sm\\:-mx-6{margin-left:-1.5rem;margin-right:-1.5rem}.sm\\:mx-0{margin-left:0;margin-right:0}.sm\\:my-8{margin-top:2rem;margin-bottom:2rem}.sm\\:ml-12{margin-left:3rem}.sm\\:ml-3{margin-left:.75rem}.sm\\:ml-4{margin-left:1rem}.sm\\:mt-0{margin-top:0}.sm\\:mt-6{margin-top:1.5rem}.sm\\:flex{display:flex}.sm\\:table-cell{display:table-cell}.sm\\:grid{display:grid}.sm\\:h-10{height:2.5rem}.sm\\:w-1\\/2{width:50%}.sm\\:w-10{width:2.5rem}.sm\\:w-3\\/5{width:60%}.sm\\:w-auto{width:auto}.sm\\:w-full{width:100%}.sm\\:max-w-lg{max-width:32rem}.sm\\:max-w-xs{max-width:20rem}.sm\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.sm\\:flex-row-reverse{flex-direction:row-reverse}.sm\\:items-start{align-items:flex-start}.sm\\:items-center{align-items:center}.sm\\:items-baseline{align-items:baseline}.sm\\:justify-center{justify-content:center}.sm\\:gap-10{gap:2.5rem}.sm\\:gap-4{gap:1rem}.sm\\:rounded-lg{border-radius:.5rem}.sm\\:p-0{padding:0}.sm\\:p-6{padding:1.5rem}.sm\\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\\:pb-4{padding-bottom:1rem}.sm\\:pr-6{padding-right:1.5rem}.sm\\:text-left{text-align:left}.sm\\:text-right{text-align:right}.sm\\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 768px){.md\\:mx-0{margin-left:0;margin-right:0}.md\\:rounded-lg{border-radius:.5rem}}@media (min-width: 1024px){.lg\\:table-cell{display:table-cell}}@media (min-width: 1280px){.xl\\:table-cell{display:table-cell}}@media (min-width: 1536px){.\\32xl\\:table-cell{display:table-cell}}\n";var en=0;function tn(e,r,n,i,o,a){r||(r={});var s,l,c=r;if("ref"in c)for(l in c={},r)"ref"==l?s=r[l]:c[l]=r[l];var d={type:e,props:c,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--en,__i:-1,__u:0,__source:o,__self:a};if("function"==typeof e&&(s=e.defaultProps))for(l in s)void 0===c[l]&&(c[l]=s[l]);return t.vnode&&t.vnode(d),d}const rn=function({tabTitles:e,currentTab:t,onChange:r}){const[n,i]=ee(t),o=ie((e=>{i(e),r(e)}),[r]);return tn("div",{class:"border-b border-gray-200",children:tn("nav",{"aria-label":"Tabs",class:"flex space-x-8 ml-2",children:e.map((e=>tn("a",{class:"cursor-pointer border-transparent text-gray-500 whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm "+(n===e?"border-b-2 border-indigo-500 text-indigo-600":"hover:text-gray-700 hover:border-gray-300 "),onClick:()=>o(e),children:e},e)))})})};for(var nn,on=[],an=0;an<256;++an)on.push((an+256).toString(16).slice(1));var sn=new Uint8Array(16);function ln(){if(!nn&&!(nn="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return nn(sn)}const cn={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function dn(e,t,r){if(cn.randomUUID&&!t&&!e)return cn.randomUUID();var n=(e=e||{}).random||(e.rng||ln)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return function(e,t=0){return(on[e[t+0]]+on[e[t+1]]+on[e[t+2]]+on[e[t+3]]+"-"+on[e[t+4]]+on[e[t+5]]+"-"+on[e[t+6]]+on[e[t+7]]+"-"+on[e[t+8]]+on[e[t+9]]+"-"+on[e[t+10]]+on[e[t+11]]+on[e[t+12]]+on[e[t+13]]+on[e[t+14]]+on[e[t+15]]).toLowerCase()}(n)}const un=({disabled:e,children:t,onClick:r,...n})=>{const[i,o]=ee(!1);return tn("button",{disabled:e||i,onClick:async()=>{if(r&&!i){o(!0);try{await r()}catch(e){console.error("Error executing promise:",e)}finally{o(!1)}}},type:"submit",...n,children:t})};function pn(e,t){for(var r in e)if("__source"!==r&&!(r in t))return!0;for(var n in t)if("__source"!==n&&e[n]!==t[n])return!0;return!1}function mn(e,t){this.props=e,this.context=t}(mn.prototype=new w).isPureReactComponent=!0,mn.prototype.shouldComponentUpdate=function(e,t){return pn(this.props,e)||pn(this.state,t)};var hn=t.__b;t.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),hn&&hn(e)};var fn=t.__e;t.__e=function(e,t,r,n){if(e.then)for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return null==t.__e&&(t.__e=r.__e,t.__k=r.__k),i.__c(e,t);fn(e,t,r,n)};var gn=t.unmount;function yn(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=function(e,t){for(var r in t)e[r]=t[r];return e}({},e)).__c&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return yn(e,t,r)}))),e}function bn(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return bn(e,t,r)})),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function wn(){this.__u=0,this.t=null,this.__b=null}function _n(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function vn(){this.u=null,this.o=null}t.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),gn&&gn(e)},(wn.prototype=new w).__c=function(e,t){var r=t.__c,n=this;null==n.t&&(n.t=[]),n.t.push(r);var i=_n(n.__v),o=!1,a=function(){o||(o=!0,r.__R=null,i?i(s):s())};r.__R=a;var s=function(){if(! --n.__u){if(n.state.__a){var e=n.state.__a;n.__v.__k[0]=bn(e,e.__c.__P,e.__c.__O)}var t;for(n.setState({__a:n.__b=null});t=n.t.pop();)t.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(a,a)},wn.prototype.componentWillUnmount=function(){this.t=[]},wn.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=yn(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__a&&g(b,null,e.fallback);return i&&(i.__u&=-33),[g(b,null,t.__a?null:e.children),i]};var xn=function(e,t,r){if(++r[1]===r[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(r=e.u;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.u=r=r[2]}};(vn.prototype=new w).__a=function(e){var t=this,r=_n(t.__v),n=t.o.get(e);return n[0]++,function(i){var o=function(){t.props.revealOrder?(n.push(i),xn(t,e,n)):i()};r?r(o):o()}},vn.prototype.render=function(e){this.u=null,this.o=new Map;var t=E(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var r=t.length;r--;)this.o.set(t[r],this.u=[1,0,this.u]);return e.children},vn.prototype.componentDidUpdate=vn.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,r){xn(e,r,t)}))};var kn="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Nn=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Cn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,En=/[A-Z0-9]/g,An="undefined"!=typeof document,Sn=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};w.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(w.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var Tn=t.event;function On(){}function Rn(){return this.cancelBubble}function Pn(){return this.defaultPrevented}t.event=function(e){return Tn&&(e=Tn(e)),e.persist=On,e.isPropagationStopped=Rn,e.isDefaultPrevented=Pn,e.nativeEvent=e};var Un={enumerable:!1,configurable:!0,get:function(){return this.class}},jn=t.vnode;t.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,r=e.type,n={};for(var i in t){var o=t[i];if(!("value"===i&&"defaultValue"in t&&null==o||An&&"children"===i&&"noscript"===r||"class"===i||"className"===i)){var a=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===o?o="":"translate"===a&&"no"===o?o=!1:"ondoubleclick"===a?i="ondblclick":"onchange"!==a||"input"!==r&&"textarea"!==r||Sn(t.type)?"onfocus"===a?i="onfocusin":"onblur"===a?i="onfocusout":Cn.test(i)?i=a:-1===r.indexOf("-")&&Nn.test(i)?i=i.replace(En,"-$&").toLowerCase():null===o&&(o=void 0):a=i="oninput","oninput"===a&&n[i=a]&&(i="oninputCapture"),n[i]=o}}"select"==r&&n.multiple&&Array.isArray(n.value)&&(n.value=E(t.children).forEach((function(e){e.props.selected=-1!=n.value.indexOf(e.props.value)}))),"select"==r&&null!=n.defaultValue&&(n.value=E(t.children).forEach((function(e){e.props.selected=n.multiple?-1!=n.defaultValue.indexOf(e.props.value):n.defaultValue==e.props.value}))),t.class&&!t.className?(n.class=t.class,Object.defineProperty(n,"className",Un)):(t.className&&!t.class||t.class&&t.className)&&(n.class=n.className=t.className),e.props=n}(e),e.$$typeof=kn,jn&&jn(e)};var Ln=t.__r;t.__r=function(e){Ln&&Ln(e),e.__c};var Mn=t.diffed;t.diffed=function(e){Mn&&Mn(e);var t=e.props,r=e.__e;null!=r&&"textarea"===e.type&&"value"in t&&t.value!==r.value&&(r.value=null==t.value?"":t.value)};const Fn=e=>g("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6",...e},g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})),In=({isOpen:e,heading:t,message:r,onConfirm:n,onCancel:i})=>e?tn("div",{className:"relative z-10","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",children:[tn("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"}),tn("div",{className:"fixed inset-0 z-10 w-screen overflow-y-auto",children:tn("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:tn("div",{className:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg",children:[tn("div",{className:"bg-white px-4 pb-4 pt-5 sm:p-6 sm:pb-4",children:tn("div",{className:"sm:flex sm:items-start",children:[tn("div",{className:"mx-auto flex h-10 w-12 flex-shrink-0 items-center justify-center rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10",children:tn(Fn,{className:"h-6 w-6 text-red-600"})}),tn("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[tn("h1",{className:"text-base font-semibold leading-6 text-gray-900",id:"modal-title",children:t}),tn("div",{className:"mt-2",children:tn("p",{className:"text-sm text-gray-500",children:r})})]})]})}),tn("div",{className:"bg-gray-50 px-4 py-3 sm:flex sm:flex-row-reverse sm:px-6",children:[tn(un,{onClick:n,className:"inline-flex w-full justify-center rounded-md bg-red-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-red-500 sm:ml-3 sm:w-auto cursor-pointer",children:"Confirm"}),tn("button",{className:"mt-3 inline-flex w-full justify-center rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 sm:mt-0 sm:w-auto cursor-pointer",onClick:i,children:"Cancel"})]})]})})})]}):null,Bn=({headers:e})=>tn("thead",{className:"bg-gray-50",children:tn("tr",{className:"divide-x divide-gray-20",children:e.map((e=>tn("th",{scope:"col",className:e.className,children:e.name},e.name)))})}),Dn=({headers:e,renderTableRows:t})=>tn("div",{className:"-mx-4 mt-8 sm:-mx-4",children:tn("div",{className:"inline-block min-w-full overflow-x-auto shadow border-b border-gray-200 align-middle sm:rounded-lg",children:tn("table",{className:"min-w-full divide-y divide-gray-500",children:[tn(Bn,{headers:e}),tn("tbody",{className:"divide-y divide-gray-200 bg-white",children:t()})]})})}),zn=()=>{const[e,t]=ee(!1),[r,n]=ee([]),[i,o]=ee(null),[a,s]=ee(!1),[l,c]=ee(""),[d,u]=ee(""),[p,m]=ee({mode:"view"}),h=re(),f=ie((async()=>{t(!0),o(null);try{const e=(await(async()=>{if(!Gr)throw new Error("Api has not been initialized");return(await Gr.get("/_admin/v1.0/categories")).data})()).categories.sort(((e,t)=>e.displayOrder-t.displayOrder));n(e)}catch(e){console.error(e),o("Failed to load categories")}finally{t(!1)}}),[]),g=ie((async e=>{t(!0),o(null);try{const t=r.find((t=>t.id===e));if(!t)return void o("Category not found");const n={title:t.title,subtitle:t.subtitle,iconUrl:t.iconUrl,enabled:!t.enabled,displayOrder:t.displayOrder,products:t.products};await Xr(e,n),await f()}catch(n){o("Failed to update category visibility")}finally{t(!1)}}),[r,f]),y=ie((async e=>{try{await(async e=>{if(!Gr)throw new Error("Api has not been initialized");return await Gr.post("/_admin/v1.0/categories",e)})(e),await f()}catch(t){throw new Error(`${Hr(t)}`)}}),[f]),b=ie((async(e,t)=>{try{await Xr(e,t),await f()}catch(r){throw new Error(`${Hr(r)}`)}}),[f]),w=ie((async e=>{switch(e.type){case"updateVisibility":h.current=e.categoryId,s(!0),c("Warning!"),u("Are you sure you want to change the visibility of this category in the app?");break;case"updateCategory":await b(e.categoryId,e.category);break;case"createCategory":await y(e.category);break;default:console.error(`Unhandled action type: ${e}`)}}),[y,b]),_=ie((async()=>{h.current&&(await g(h.current),s(!1))}),[g]),v=ie((()=>{s(!1)}),[]);return{screenMode:p,isLoading:e,categories:r,error:i,isModalOpen:a,modalHeading:l,modalTitle:d,setScreenMode:m,loadCategories:f,handleAction:w,handleModalConfirm:_,handleModalCancel:v}},Hn=({message:e,className:t,onClick:r})=>tn("div",{className:t,onClick:r,children:e}),qn=({labelText:e,name:t,type:r,value:n,pattern:i,className:o,allowedKeyPattern:a,required:s,onClick:l,onChange:c,...d})=>{const u=ie((e=>{a&&!a.test(e.key)&&e.preventDefault()}),[a]);return tn(b,{children:[e&&tn("label",{className:"block text-sm font-bold text-gray-700",children:e}),tn("input",{required:s??!1,className:`block rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm ${o}`,name:t,type:r,value:n,onKeyPress:u,pattern:i,onClick:l,onChange:c,...d})]})},Vn=({formMode:e,handleAction:t})=>{const[r,n]=ee(""),[i,o]=ee(""),[a,s]=ee(""),[l,c]=ee(""),[d,u]=ee(0),[p,m]=ee(!1),[h,f]=ee([]),g=(e,t)=>{f((r=>[...r,{text:e,type:t}]))};te((()=>{"update"===e.mode&&(n(e.initialCategory.id),o(e.initialCategory.title),s(e.initialCategory.subtitle),c(e.initialCategory.iconUrl),u(e.initialCategory.displayOrder))}),[e]);const y=()=>{f([])};return tn("div",{className:"mt-2",children:[tn("div",{className:"mt-9",children:tn("h1",{className:"text-2xl font-semibold text-gray-900",children:"create"===e.mode?"New Benefits Plan Category":"Update Benefits Plan Category"})}),tn("div",{className:"w-1/2",children:tn("form",{onSubmit:async n=>{n.preventDefault(),m(!0);const p=(()=>{const t={title:i,subtitle:a,iconUrl:l,displayOrder:d};switch(e.mode){case"create":return{...t,enabled:!1,products:[{id:dn(),title:i,description:a,enabled:!0,iconUrl:l,activities:[]}]};case"update":return{...t,enabled:e.initialCategory.enabled,products:e.initialCategory.products};default:throw new Error("Invalid form mode")}})();try{await t({type:"create"===e.mode?"createCategory":"updateCategory",categoryId:r,category:p}),g(`Category successfully ${"create"===e.mode?"created":"updated"}.`,"success"),o(""),s(""),c(""),u(0)}catch(h){g(`Error ${"create"===e.mode?"adding":"updating"} category: ${h}`,"error")}finally{m(!1)}},children:tn("div",{className:"sm:grid sm:grid-cols-4 sm:items-baseline sm:gap-10 mt-8",children:[tn("label",{className:"sm:col-start-1 ",children:"Title"}),tn(qn,{name:"title",placeholder:"",type:"text",value:i,className:"sm:col-start-2 sm:col-span-3",onClick:()=>{f([])},onChange:e=>o(e.currentTarget.value)}),tn("label",{className:"sm:col-start-1",children:"SubTitle"}),tn(qn,{name:"subTitle",placeholder:"",type:"text",value:a,className:"sm:col-start-2 sm:col-span-3",onClick:()=>{f([])},onChange:e=>s(e.currentTarget.value)}),tn("label",{className:"sm:col-start-1",children:"Icon Url"}),tn(qn,{name:"iconUrl",placeholder:"",type:"text",value:l,className:"sm:col-start-2 sm:col-span-3",onClick:()=>{f([])},onChange:e=>c(e.currentTarget.value)}),tn("label",{className:"sm:col-start-1",children:"Display order"}),tn("input",{className:"sm:col-start-2 sm:col-span-3 block rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm",type:"number",name:"displayOrder",value:d,onChange:e=>u(Number(e.currentTarget.value))}),tn("div",{className:"sm:col-start-4 flex justify-end",children:tn("button",{className:" bg-indigo-500 hover:bg-indigo-900 text-white font-bold py-1 px-4 rounded focus:outline-none",type:"submit",disabled:p,children:"create"==e.mode?"Create":"Update"})}),tn("div",{className:"sm:col-start-1 sm:col-span-3 text-left",children:h.map(((e,t)=>tn(Hn,{message:e.text,className:"text-sm text-left font-semibold "+("error"===e.type?"text-red-600":"text-green-600 cursor-pointer"),onClick:y},t)))})]})})})]})},$n=e=>g("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2.5,stroke:"#6366F1",className:"size-6",...e},g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"})),Wn=({onClick:e,children:t})=>tn("div",{className:"mt-4",children:tn("div",{className:"flex justify-normal",children:[tn("span",{onClick:e,children:tn($n,{className:"h-6 w-6 border-0 cursor-pointer"})}),tn("label",{className:"block text-sm font-bold text-gray-700 pt-0.5 ml-1",children:t})]})}),Jn=[{name:"Id",className:"px-3 py-3.5 pl-4 text-left text-sm font-semibold text-gray-900"},{name:"Icon",className:"hidden px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:table-cell"},{name:"Title",className:"hidden px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:table-cell"},{name:"Subtitle",className:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900"},{name:"Activities",className:"hidden px-3 py-3.5 text-left text-sm font-semibold text-gray-900 lg:table-cell"},{name:"Order",className:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900"},{name:"Enabled",className:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900"},{name:"Update",className:"px-3 py-3.5 text-center text-sm font-semibold text-gray-900"},{name:"Visibility",className:"px-3 py-3.5 text-center text-sm font-semibold text-gray-900"}],Kn=e=>{const{screenMode:t,isLoading:r,categories:n,error:i,isModalOpen:o,modalHeading:a,modalTitle:s,setScreenMode:l,loadCategories:c,handleAction:d,handleModalConfirm:u,handleModalCancel:p}=zn();te((()=>{c()}),[c]),te((()=>{e.onChange(n)}),[n,e]);return tn(b,{children:["view"===t.mode&&tn(b,{children:[r&&tn("p",{className:"p-5",children:"Loading..."}),tn("div",{className:"p-4 text-red-700",children:i}),!r&&!i&&tn("div",{className:"m-4",children:[tn("div",{className:"flex items-center",children:[tn("div",{className:"flex-auto",children:tn("h1",{className:"text-base font-semibold leading-6 text-gray-900",children:"Benefits Plan Categories"})}),tn("div",{className:"ml-16 mt-0 flex-none",children:tn("button",{type:"button",className:"block rounded-md bg-indigo-500 px-3 py-2 text-center text-sm font-semibold text-white shadow-sm hover:bg-indigo-900 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600",onClick:()=>l({mode:"create"}),children:"New Category"})})]}),tn(Dn,{headers:Jn,renderTableRows:()=>tn(b,{children:n.map((e=>{const t=e.products.reduce(((e,t)=>e+t.activities.length),0);return tn("tr",{className:"divide-x divide-gray-200",children:[tn("td",{className:"whitespace-nowrap px-3 py-4 text-sm font-medium text-gray-900",children:e.id}),tn("td",{className:"hidden whitespace-nowrap px-3 py-4 items-center justify-center sm:table-cell",children:tn("img",{src:e.iconUrl,alt:e.title,className:"h-8 w-8"})}),tn("td",{className:"hidden whitespace-nowrap px-3 py-4 text-sm text-gray-500 sm:table-cell",children:e.title}),tn("td",{className:"hidden whitespace-nowrap px-3 py-4 text-sm text-gray-500 lg:table-cell",children:e.subtitle}),tn("td",{className:"hidden whitespace-nowrap px-3 py-4 text-sm text-gray-500 lg:table-cell",children:t}),tn("td",{className:"hidden whitespace-nowrap px-3 py-4 text-sm text-gray-500 sm:table-cell",children:e.displayOrder}),tn("td",{className:"hidden whitespace-nowrap px-3 py-4 text-sm text-gray-500 sm:table-cell",children:e.enabled?"Yes":"No"}),tn("td",{className:"whitespace-nowrap px-3 py-4 sm:table-cell",children:tn("div",{className:"flex justify-center",children:tn("button",{type:"button",className:"rounded-md bg-white px-2 py-1.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50",onClick:()=>{l({mode:"update",itemId:e.id})},children:"Edit"})})}),tn("td",{className:"whitespace-nowrap px-3 py-4 sm:table-cell",children:tn("div",{className:"flex justify-center",children:tn("button",{type:"button",className:"rounded-md bg-white px-2 py-1.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50",onClick:()=>d({type:"updateVisibility",categoryId:e.id}),children:e.enabled?"Disable":"Enable"})})})]},e.id)}))})})]}),tn(In,{isOpen:o,heading:a,message:s,onConfirm:u,onCancel:p})," "]}),("create"===t.mode||"update"===t.mode)&&tn(Wn,{onClick:()=>{l({mode:"view"})},children:"Benefits Plan"}),"create"===t.mode&&tn(Vn,{formMode:{mode:"create"},handleAction:d}),"update"===t.mode&&tn(Vn,{formMode:{mode:"update",initialCategory:n.find((e=>e.id===t.itemId))},handleAction:d})]})},Gn=({visible:e,children:t})=>{const r=re(e);return e&&!r.current&&(r.current=!0),r.current?tn("div",{hidden:!e,children:t}):null},Xn=e=>g("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2.5,stroke:"black",height:32,width:32,...e},g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"})),Zn=()=>{const[e,t]=ee(!1),[r,n]=ee(null),[i,o]=ee([]),[a,s]=ee(!1),[l,c]=ee(""),[d,u]=ee(""),[p,m]=ee({mode:"view"}),h=re([]),f=re(),g=ie((async e=>{t(!0),n(null),h.current=e;try{const t=await(async()=>{if(!Gr)throw new Error("Api has not been initialized");return(await Gr.get("/_admin/v1.0/activities")).data})(),r=Yn(e,t);o(r)}catch(r){console.error(r),n("Failed to load activities")}finally{t(!1)}}),[]),y=ie((async e=>{t(!0),n(null);try{const t=await(async e=>{if(!Gr)throw new Error("Api has not been initialized");return(await Gr.get(`/_admin/v1.0/activities/${e}`)).data})(e);t.enabled=!t.enabled,await Zr(e,t),await g(h.current)}catch(r){n(`Failed to update activity visibility. ${(null==r?void 0:r.message)??""}`)}finally{t(!1)}}),[g]),b=ie((async e=>{switch(e.type){case"updateVisibility":f.current=e.activityId,s(!0),c("Warning!"),u("Are you sure you want to change the visibility of this activity in the app?");break;case"updateActivity":await Zr(e.activityId,e.activity,e.selectedCategory,e.isFeaturedActivity),await g(h.current);break;case"createActivity":await(async(e,t,r)=>{if(!Gr)throw new Error("Api has not been initialized");try{const n=await Gr.post("/_admin/v1.0/activities",e);if(t){Jr(t,n.data.id,r??!1);const e=t;await Xr(t.id,e)}return n.data.id}catch(n){throw new Error(`${Hr(n)}`)}})(e.activity,e.selectedCategory,e.isFeaturedActivity);break;default:console.error(`Unhandled action type: ${e}`)}}),[g]),w=ie((async()=>{f.current&&(await y(f.current),s(!1))}),[y]),_=ie((()=>{s(!1)}),[]);return{activities:i,isLoading:e,error:r,isModalOpen:a,modalHeading:l,modalTitle:d,screenMode:p,loadActivities:g,handleAction:b,handleModalConfirm:w,handleModalCancel:_,setScreenMode:m}},Yn=(e,t)=>{const r=Qn(e);return t.map((e=>{var t;return{...e,category:null==(t=r.get(e.id))?void 0:t.find((()=>!0))}}))},Qn=e=>{const t=ei(e),r=new Map;return t.forEach((({activity:e,categoryId:t,categoryTitle:n})=>{const i=e.id;r.has(i)||r.set(i,[]);const o=r.get(i);o.some((e=>e.id===t))||o.push({id:t,title:n,isFeatured:e.isFeatured})})),r},ei=e=>e.flatMap((e=>e.products.flatMap((t=>t.activities.map((t=>({activity:t,categoryId:e.id,categoryTitle:e.title}))))))),ti="None",ri=[{name:"title",isRequired:!0,label:"Title",type:"text",display:()=>!0},{name:"description",isRequired:!0,label:"Sub Title",type:"text",display:()=>!0},{name:"points",isRequired:!0,label:"Points",type:"number",display:()=>!0},{name:"iconUrl",isRequired:!0,label:"Icon Url",type:"text",display:()=>!0},{name:"isFeatured",isRequired:!1,label:"Is Featured",type:"checkbox",display:e=>e!==ti}],ni=[{activityType:Dr.Advertisement,formFields:[{name:"bannerUrl",isRequired:!0,label:"Banner Url",type:"text",display:()=>!0},{name:"articleId",isRequired:!0,label:"Article Id",type:"text",display:()=>!0}]},{activityType:Dr.Article,formFields:[{name:"articleId",isRequired:!0,label:"Article Id",type:"text",display:()=>!0}]},{activityType:Dr.Assessment,formFields:[{name:"bannerUrl",isRequired:!0,label:"Banner Url",type:"text",display:()=>!0},{name:"buttonText",isRequired:!0,label:"Button Text",type:"text",display:()=>!0},{name:"primaryLabel",isRequired:!0,label:"Primary Label",type:"text",display:()=>!0},{name:"secondaryLabel",isRequired:!0,label:"Secondary label",type:"text",display:()=>!0}]},{activityType:Dr.Url,formFields:[{name:"url",isRequired:!0,label:"Url",type:"text",display:()=>!0}]},{activityType:Dr.Deeplink,formFields:[{name:"url",isRequired:!0,label:"Url",type:"text",display:()=>!0}]}],ii={title:"",description:"",points:0,iconUrl:"",url:"",articleId:"",bannerUrl:"",buttonText:"",primaryLabel:"",secondaryLabel:"",isFeatured:!1},oi=({formMode:e,categories:t,handleAction:r})=>{const[n,i]=ee(Dr.Article),[o,a]=ee({id:ti,title:ti}),[s,l]=ee([]),[c,d]=ee(!1),[u,p]=ee(ii),m=ne((()=>{var e;return[...ri,...(null==(e=ni.find((e=>e.activityType===n)))?void 0:e.formFields)||[]]}),[n]),h=(e,t)=>{l((r=>[...r,{text:e,type:t}]))};te((()=>{var t,r,n;if("update"===e.mode){const o=e.initialActivity,s={...o,primaryLabel:null==(t=o.estimateLabel)?void 0:t.primaryLabel,secondaryLabel:null==(r=o.estimateLabel)?void 0:r.secondaryLabel,isFeatured:null==(n=o.category)?void 0:n.isFeatured};p({...s}),i(o.activityType),a(o.category??{id:ti,title:ti})}}),[e]);const f=e=>{const t=e.target,{name:r,value:n,type:i}=t;p((e=>({...e,[r]:"checkbox"===i?t.checked:"number"===i?Number(n):n})))},g=async()=>{const{url:e,articleId:s,bannerUrl:l,buttonText:c,primaryLabel:d,secondaryLabel:m,isFeatured:f}=u,g={...u,activityType:n,calculationType:Vr(n,o.title),enabled:!1,savingsInCents:0,configurationTags:Wr(o.title),tags:$r(o.title),estimateLabel:d?{primaryLabel:d,secondaryLabel:m}:void 0,url:e||void 0,articleId:s||void 0,bannerUrl:l||void 0,buttonText:c||void 0};let y;o.title!==ti&&(y=t.find((e=>e.id===o.id)));try{await r({type:"createActivity",activity:g,selectedCategory:y,isFeaturedActivity:f}),h("Activity successfully created.","success"),p({...ii}),i(Dr.Article),a({id:ti,title:ti})}catch(b){throw h(`Error creating activity: ${b}`,"error"),b}},y=async e=>{const{primaryLabel:i,secondaryLabel:a,isFeatured:s}=u,l={...e,...u,activityType:n,estimateLabel:i?{primaryLabel:i,secondaryLabel:a}:void 0};let c;o.title!==ti&&(c=t.find((e=>e.id===o.id)));try{await r({type:"updateActivity",activityId:e.id,activity:l,selectedCategory:c,isFeaturedActivity:s}),h("Activity successfully updated.","success")}catch(d){throw h(`Error updating activity: ${d}`,"error"),d}};return tn(b,{children:tn("div",{className:"mt-2",children:[tn("div",{className:"mt-9",children:tn("h1",{className:"text-2xl font-semibold text-gray-900",children:"create"===e.mode?"New Benefits Plan Activities":"Update Benefits Plan Activities"})}),tn("div",{className:"w-1/2",children:tn("form",{onSubmit:async t=>{t.preventDefault(),d(!0),l([]);try{"create"===e.mode?await g():"update"===e.mode&&await y(e.initialActivity)}finally{d(!1)}},children:[tn("div",{className:"sm:grid sm:grid-cols-4 sm:items-baseline mt-8",children:[tn("label",{className:"sm:col-start-1",children:"Type"}),tn("select",{className:"sm:col-start-2 sm:col-span-2 focus:ring-indigo-500 focus:border-indigo-500 shadow-sm sm:max-w-xs border-gray-300 rounded-md",value:n,disabled:"update"===e.mode,onChange:e=>{const t=e.target.value;i(t)},children:Object.values(Dr).map((e=>tn("option",{value:e,children:e},e)))})]}),tn("div",{className:"sm:grid sm:grid-cols-3 sm:items-baseline sm:gap-10 mt-8 sm:ml-12",children:[tn("label",{className:"sm:col-start-1",children:"Category"}),tn("select",{className:"sm:col-start-2 sm:col-span-3 focus:ring-indigo-500 focus:border-indigo-500 shadow-sm sm:max-w-xs border-gray-300 rounded-md",value:o.id,disabled:"update"===e.mode,onChange:e=>{const r=e.target.value;if(r===ti)a({id:ti,title:ti});else{const e=t.find((e=>e.id===r));e&&a({id:e.id,title:e.title})}},children:[tn("option",{value:ti,children:ti}),t.map((e=>tn("option",{value:e.id,children:e.title},e.id)))]}),null==m?void 0:m.map((e=>e.display&&!e.display(o.id)?null:tn(b,{children:[tn("label",{className:"sm:col-start-1",children:e.label}),tn("input",{className:"sm:col-start-2 sm:col-span-3 block rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm "+("checkbox"===e.type?"w-6 h-full":""),type:e.type,name:e.name,value:(e.type,u[e.name]),checked:"checkbox"===e.type?!!u[e.name]:void 0,required:e.isRequired,onChange:f})]},e.name))),tn("div",{className:"sm:col-start-4 flex justify-end",children:tn("button",{className:" bg-indigo-500 hover:bg-indigo-900 text-white font-bold py-1 px-4 rounded focus:outline-none",type:"submit",disabled:c,children:"create"==e.mode?"Create":"Update"})}),tn("div",{className:"sm:col-start-1 sm:col-span-3 text-left",children:s.map(((e,t)=>tn(Hn,{message:e.text,className:"text-sm text-left font-semibold "+("error"===e.type?"text-red-600":"text-green-600 cursor-pointer")},t)))})]})]})})]})})},ai=[{name:"Id",className:"px-3 py-3.5 pl-4 text-left text-sm font-semibold text-gray-900"},{name:"Icon",className:"hidden px-3 py-3.5 text-left text-sm font-semibold text-gray-900 lg:table-cell"},{name:"Title",className:"hidden px-3 py-3.5 text-left text-sm font-semibold text-gray-900 lg:table-cell"},{name:"Subtitle",className:"hidden px-3 py-3.5 text-left text-sm font-semibold text-gray-900 2xl:table-cell"},{name:"Type",className:"hidden px-3 py-3.5 text-left text-sm font-semibold text-gray-900 xl:table-cell"},{name:"Points",className:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900"},{name:"Category",className:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900"},{name:"Enabled",className:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900"},{name:"Update",className:"px-3 py-3.5 text-center text-sm font-semibold text-gray-900"},{name:"Visibility",className:"px-3 py-3.5 text-center text-sm font-semibold text-gray-900"}],si="All",li=({categories:e,onChange:t})=>{const{isLoading:r,activities:n,error:i,isModalOpen:o,modalHeading:a,modalTitle:s,screenMode:l,loadActivities:c,handleAction:d,handleModalConfirm:u,handleModalCancel:p,setScreenMode:m}=Zn(),[h,f]=ee({id:si,title:si}),[g,y]=ee([]);te((()=>{c(e)}),[e,c]),te((()=>{y(h.title===si?n:n.filter((e=>{var t;return(null==(t=e.category)?void 0:t.id)===h.id})))}),[n,h]);const w=async e=>{await d(e),e.selectedCategory&&t()};return tn(b,{children:["view"===l.mode&&tn(b,{children:[r&&tn("p",{className:"p-5",children:"Loading..."}),tn("div",{className:"p-4 text-red-700",children:i}),!r&&tn("div",{className:"m-4",children:[tn("div",{className:"flex items-center",children:[tn("div",{className:"flex-auto",children:tn("h1",{className:"text-base font-semibold leading-6 text-gray-900",children:"Benefits Plan Activities"})}),tn("div",{className:"ml-16 mt-0 flex-none",children:tn("button",{type:"button",className:"block rounded-md bg-indigo-500 px-3 py-2 text-center text-sm font-semibold text-white shadow-sm hover:bg-indigo-900 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600",onClick:()=>m({mode:"create"}),children:"New Activity"})})]}),tn("div",{className:"flex items-center space-x-2 mt-4",children:[tn(Xn,{}),tn("select",{className:"focus:ring-indigo-500 focus:border-indigo-500 shadow-sm sm:max-w-xs border-gray-300 rounded-md",value:h.id,onChange:t=>{const r=t.target.value;if(r===si)f({id:si,title:si});else{const t=e.find((e=>e.id===r));t&&f({id:t.id,title:t.title})}},children:[tn("option",{value:si,children:si}),e.map((e=>tn("option",{value:e.id,children:e.title},e.id)))]})]}),g.length>0&&tn(Dn,{headers:ai,renderTableRows:()=>tn(b,{children:g.map((e=>{var t;return tn("tr",{className:"divide-x divide-gray-200",children:[tn("td",{className:"whitespace-nowrap px-3 py-4 text-sm font-medium text-gray-900",children:e.id}),tn("td",{className:"hidden whitespace-nowrap px-3 py-4 xl:table-cell",children:tn("span",{className:"flex justify-center",children:tn("img",{src:e.iconUrl,alt:e.title,className:"h-8 w-8"})})}),tn("td",{className:"hidden whitespace-nowrap px-3 py-4 text-sm text-gray-500 lg:table-cell",children:qr(e.title)}),tn("td",{className:"hidden whitespace-nowrap px-3 py-4 text-sm text-gray-500 2xl:table-cell",children:qr(e.description)}),tn("td",{className:"hidden whitespace-nowrap px-3 py-4 text-sm text-gray-500 xl:table-cell",children:e.activityType}),tn("td",{className:"hidden whitespace-nowrap px-3 py-4 text-sm text-gray-500 sm:table-cell",children:e.points}),tn("td",{className:"hidden whitespace-nowrap px-3 py-4 text-sm text-gray-500 sm:table-cell",children:(null==(t=e.category)?void 0:t.title)??"None"}),tn("td",{className:"hidden whitespace-nowrap px-3 py-4 text-sm text-gray-500 sm:table-cell",children:e.enabled?"Yes":"No"}),tn("td",{className:"whitespace-nowrap px-3 py-4 sm:table-cell",children:tn("div",{className:"flex justify-center",children:tn("button",{type:"button",className:"rounded-md bg-white px-2 py-1.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50",onClick:()=>{m({mode:"update",itemId:e.id})},children:"Edit"})})}),tn("td",{className:"whitespace-nowrap px-3 py-4 sm:table-cell",children:tn("div",{className:"flex justify-center",children:tn("button",{type:"button",className:"rounded-md bg-white px-2 py-1.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50",onClick:()=>d({type:"updateVisibility",activityId:e.id}),children:e.enabled?"Disable":"Enable"})})})]},e.id)}))})})]}),tn(In,{isOpen:o,heading:a,message:s,onConfirm:u,onCancel:p})]}),("create"===l.mode||"update"===l.mode)&&tn(Wn,{onClick:()=>{m({mode:"view"})},children:"Benefits Plan"}),"create"===l.mode&&tn(oi,{categories:e,formMode:{mode:"create"},handleAction:w}),"update"===l.mode&&tn(oi,{categories:e,formMode:{mode:"update",initialActivity:n.find((e=>e.id===l.itemId))},handleAction:w})]})};var ci=(e=>(e.Categories="Categories",e.Activities="Activities",e))(ci||{});const di=()=>{const[e,t]=ee("Categories"),[r,n]=ee([]),[i,o]=ee(dn()),a=ie((t=>t===e),[e]);return tn(b,{children:[tn(rn,{tabTitles:Object.entries(ci).map((([,e])=>e)),currentTab:e,onChange:t}),tn(Gn,{visible:a("Categories"),children:tn(Kn,{onChange:e=>{n(e)}},i)}),tn(Gn,{visible:a("Activities"),children:tn(li,{categories:r,onChange:()=>o(dn())})})]})},ui=()=>{const[e,t]=ee([]),[r,n]=ee(!1),[i,o]=ee(""),[a,s]=ee(!1),[l,c]=ee(!1),d=re(),u=re(),p=re({searchType:jr.MobileNumber,searchValue:""}),m=ie((async(e,r)=>{let i;if(p.current={searchType:e,searchValue:r},n(!0),s(!1),o(""),e===jr.EmailAddress)i=(async e=>{if(!Ir)throw new Error("Api has not been initialized");const t=(e=>({emailAddress:e}))(e);return(await Ir.post("/_admin/v1.0/customers/emailAddress",JSON.stringify(t))).data})(r);else if(e===jr.MobileNumber)i=(async e=>{if(!Ir)throw new Error("Api has not been initialized");const t={mobileNumber:e},r=[],n=await Ir.post("/_admin/v1.0/customer/mobileNumber",JSON.stringify(t));return r.push(n.data),r})(r);else{if(e!==jr.CustomerId)return n(!1),void o("Invalid search type.");i=(async e=>{if(!Ir)throw new Error("Api has not been initialized");const t=[],r=await Ir.get(`/_admin/v1.0/customer/${e}`);return t.push(r.data),t})(r)}i.then((e=>{t(e),n(!1),e.length>0?(d.current=e[0].id,s(!0)):o("No results found!")})).catch((()=>{o("Error: Unable to Retrieve Customer Information."),n(!1)}))}),[]),h=async(e,t)=>{d.current&&await(async(e,t,r)=>{if(!Br)throw new Error("Api has not been initialized");const n={mobileNumber:t,reason:r};await Br.put(`/_admin/v1.0/customers/${e}/mobileNumber`,JSON.stringify(n))})(d.current,e,t)};return{searchFilter:p,searchCustomerResult:e,isLoading:r,isModalOpen:l,error:i,showCustomerDetails:a,searchCustomer:m,handleAction:async t=>{const{action:r}=t;switch(r){case"workplaceUnlink":await(async t=>{e.find((e=>e.apolloProfiles.find((e=>e.profileId===t&&e.status===Mr.Established))))&&(c(!0),u.current=t)})(t.profileId);break;case"updateMobileNumber":await h(t.mobileNumber,t.reason);break;default:console.error(`Unhandled action type: ${r}`)}},handleModalConfirm:async()=>{u.current&&(async e=>{if(!Ir)throw new Error("Api has not been initialized");await Ir.put(`/_admin/v1.0/workplace-link/${e}/unestablish`)})(u.current).then((async()=>{await(async()=>{await m(p.current.searchType,p.current.searchValue)})()})).catch((()=>{o("Error: Unable to Unlink Profile.")})).finally((()=>{c(!1)}))},handleModalCancel:async()=>{c(!1)}}},pi=()=>{const[e,t]=ee(jr.MobileNumber),[r,n]=ee(""),[i,o]=ee({emailAddress:"",mobileNumber:"",customerId:""}),a=ie((()=>{o({emailAddress:"",mobileNumber:"",customerId:""})}),[]),s=ie((e=>!!Fr(e)||(o((e=>({...e,mobileNumber:"Invalid Mobile Number!"}))),!1)),[]),l=ie(((e,t)=>{if(e.trim())return!0;const{label:r,name:n}=(e=>{const t=Lr.find((t=>jr[t.searchType]===jr[e]));return t?{name:t.name,label:t.label}:{name:"",label:""}})(t),i=`Empty ${n}`;return o((e=>({...e,[r]:i}))),!1}),[]);return{searchType:e,searchValue:r,errors:i,setSearchType:t,setSearchValue:n,clearErrors:a,isValidSearch:ie(((e,t)=>{switch(e){case jr.EmailAddress:case jr.CustomerId:return l(t,e);case jr.MobileNumber:return s(t);default:return!1}}),[l,s])}},mi=e=>{const{searchType:t,searchValue:r,errors:n,setSearchType:i,setSearchValue:o,clearErrors:a,isValidSearch:s}=pi(),[l,c]=ee(!0),d=()=>{a(),c(!1)},u=e=>{const t=e.currentTarget;c(!1),o(t.value),a()};return tn(b,{children:tn("div",{className:"flex flex-col p-2",children:[tn("label",{className:"block text-sm font-bold text-gray-700",children:"Search for PBA Customer with Email Address, Mobile Number or CustomerId :"}),tn("form",{className:"w-1/3",onSubmit:n=>{n.preventDefault(),s(t,r)&&(c(!0),e.onSubmit(t,r))},children:[tn("select",{className:"mt-2 block sm:w-1/2 rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-indigo-600 text-sm leading-6",name:"searchType",id:"searchtype",value:t,onChange:e=>{a();const t=e.currentTarget.value;i(t),o("")},"data-testid":"select",children:Lr.map((e=>tn("option",{value:e.searchType,children:e.name},e.searchType)))}),tn("div",{className:"sm:flex justify-between sm:mt-6 mt-2",children:[t===jr.EmailAddress&&tn(qn,{labelText:"Email Address",name:"emailAddress",placeholder:"users@email.com",type:"text",value:r,className:"sm:w-3/5",onClick:d,onChange:u}),t===jr.MobileNumber&&tn(qn,{allowedKeyPattern:/[0-9+]/,labelText:"Mobile Number",name:"mobileNumber",placeholder:"+619999999999",type:"tel",value:r,className:"sm:w-3/5",onClick:d,onChange:u}),t===jr.CustomerId&&tn(qn,{labelText:"PBA Customer Id",name:"customerId",placeholder:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",type:"text",value:r,className:"sm:w-3/5",onClick:d,onChange:u})]}),tn("div",{className:"mt-2",children:Object.values(n).map(((e,t)=>tn(Hn,{message:e,className:"text-sm text-red-600 sm:text-right"},t)))}),tn("div",{className:"sm:flex justify-end sm:mt-6",children:tn("button",{type:"submit",className:"bg-indigo-500 hover:bg-indigo-900 text-white font-bold py-1 px-4 rounded focus:outline-none "+(l?"bg-gray-400 cursor-not-allowed":""),disabled:l,children:"Search"})})]})]})})},hi=e=>g("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,...e},g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})),fi=e=>g("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,...e},g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})),gi=e=>g("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,...e},g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"})),yi=e=>g("svg",{fill:"#000000",width:"800px",height:"800px",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",...e},g("path",{d:"M304.083 405.907c4.686 4.686 4.686 12.284 0 16.971l-44.674 44.674c-59.263 59.262-155.693 59.266-214.961 0-59.264-59.265-59.264-155.696 0-214.96l44.675-44.675c4.686-4.686 12.284-4.686 16.971 0l39.598 39.598c4.686 4.686 4.686 12.284 0 16.971l-44.675 44.674c-28.072 28.073-28.072 73.75 0 101.823 28.072 28.072 73.75 28.073 101.824 0l44.674-44.674c4.686-4.686 12.284-4.686 16.971 0l39.597 39.598zm-56.568-260.216c4.686 4.686 12.284 4.686 16.971 0l44.674-44.674c28.072-28.075 73.75-28.073 101.824 0 28.072 28.073 28.072 73.75 0 101.823l-44.675 44.674c-4.686 4.686-4.686 12.284 0 16.971l39.598 39.598c4.686 4.686 12.284 4.686 16.971 0l44.675-44.675c59.265-59.265 59.265-155.695 0-214.96-59.266-59.264-155.695-59.264-214.961 0l-44.674 44.674c-4.686 4.686-4.686 12.284 0 16.971l39.597 39.598zm234.828 359.28l22.627-22.627c9.373-9.373 9.373-24.569 0-33.941L63.598 7.029c-9.373-9.373-24.569-9.373-33.941 0L7.029 29.657c-9.373 9.373-9.373 24.569 0 33.941l441.373 441.373c9.373 9.372 24.569 9.372 33.941 0z"})),bi=e=>{var t,r,n,i,o,a;const[s,l]=ee(e.data.apolloProfiles.length>0),c=e.data.apolloProfiles.length>0,d=ne((()=>e.data.apolloProfiles.slice().sort(((e,t)=>{const r=e.status.localeCompare(t.status);return 0!==r?r:e.profileId.localeCompare(t.profileId)}))),[e.data.apolloProfiles]);return tn(b,{children:[tn("tr",{className:"divide-x divide-gray-200",children:[tn("td",{className:"whitespace-nowrap px-2 text-sm",children:tn("span",{onClick:()=>{c&&l(!s)},children:[!c&&tn(gi,{className:"h-6 w-6 border-0"}),c&&tn((()=>tn(b,{children:tn(s?fi:hi,{className:"h-6 w-6 border-0 cursor-pointer"})})),{})]})}),tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:e.data.id}),tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:null==(t=e.data.name)?void 0:t.firstName}),tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:null==(r=e.data.name)?void 0:r.lastName}),tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:null==(n=e.data.email)?void 0:n.value}),tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:e.data.mobileNumber}),tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:null==(i=e.data.kyc)?void 0:i.address.countryCode}),tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:null==(o=e.data.kyc)?void 0:o.address.state}),tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:null==(a=e.data.kyc)?void 0:a.dateOfBirth.substring(0,10)}),tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:e.data.kyc?"True":"False"})]},e.key),s&&tn(b,{children:tn("tr",{className:"divide-x divide-gray-200",children:tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",colspan:10,children:[tn("label",{className:"block text-sm font-bold text-gray-700",children:"Apollo Profiles"}),tn("div",{className:"-mx-4 mt-4 overflow-hidden shadow ring-1 ring-black ring-opacity-5 sm:-mx-6 md:mx-0 md:rounded-lg",children:tn("table",{className:"min-w-full divide-y divide-gray-500",children:[tn("thead",{className:"bg-gray-50",children:tn("tr",{className:"divide-x divide-gray-200",children:[tn("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 uppercase tracking-wider",children:"Profile ID"}),tn("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 uppercase tracking-wider",children:"Account ID"}),tn("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 uppercase tracking-wider",children:"Status"}),tn("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 uppercase tracking-wider",children:"Account Name"}),tn("th",{className:"relative py-3.5 pl-3 pr-4 sm:pr-6",children:tn("span",{className:"sr-only",children:"Action"})})]})}),tn("tbody",{className:"divide-y divide-gray-200 bg-white",children:d.map(((t,r)=>tn("tr",{className:"divide-x divide-gray-200",children:[tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:t.profileId}),tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:t.accountId}),tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:t.status}),tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:t.accountName}),tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:[tn("span",{onClick:()=>e.onAction({action:"workplaceUnlink",profileId:t.profileId}),children:tn(yi,{className:"h-6 w-6 border-0 "+(t.status===Mr.Established?"cursor-pointer":"cursor-not-allowed opacity-50")})})," "]})]},r)))})]})})]})})})]})},wi=e=>tn("div",{className:"-mx-4 mt-8 sm:-mx-4",children:tn("div",{className:"inline-block min-w-full overflow-x-auto shadow border-b border-gray-200 align-middle sm:rounded-lg",children:tn("table",{className:"min-w-full divide-y divide-gray-500",children:[tn("thead",{className:"bg-gray-50",children:tn("tr",{className:"divide-x divide-gray-200",children:[tn("th",{className:"relative py-3.5 pl-3 pr-4 sm:pr-6",children:tn("span",{className:"sr-only",children:"Action"})}),tn("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 uppercase tracking-wider",children:"Customer ID"}),tn("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 uppercase tracking-wider",children:"First Name"}),tn("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 uppercase tracking-wider",children:"Last Name"}),tn("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 uppercase tracking-wider",children:"Email"}),tn("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 uppercase tracking-wider",children:"Mobile"}),tn("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 uppercase tracking-wider",children:"Country Code"}),tn("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 uppercase tracking-wider",children:"State"}),tn("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 uppercase tracking-wider",children:"DOB"}),tn("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 uppercase tracking-wider",children:"KYC Check"})]})}),tn("tbody",{className:"divide-y divide-gray-200 bg-white",children:e.data.map(((t,r)=>tn(bi,{title:"Apollo Profiles",data:t,onAction:e.onAction},r)))})]})})}),_i=e=>{const{mobileNumber:t,reason:r,isCustomerIdentityVerified:n,messages:i,isSubmitting:o,setMobileNumber:a,setReason:s,setIsVerifiedCustomerIdentity:l,clearMessages:c,handleSubmit:d}=(e=>{const[t,r]=ee(""),[n,i]=ee(!1),[o,a]=ee(""),[s,l]=ee([]),[c,d]=ee(!1),u=ie((()=>{l([])}),[]),p=ie((()=>{i(!1),a("")}),[]),m=ie(((e,t)=>{l((r=>[...r,{text:e,type:t}]))}),[]),h=ie((()=>!!Fr(t)||(m("Invalid Mobile Number!","error"),!1)),[t,m]),f=ie((()=>!!o.trim()||(m("Reason cannot be empty.","error"),!1)),[o,m]),g=ie((e=>{var t,r;if(e instanceof wr){const n=(null==(r=null==(t=e.response)?void 0:t.data)?void 0:r.message)||"Failed to update mobile number.";m(n,"error")}else m("An unexpected error occurred.","error")}),[m]),y=ie((async()=>{if(u(),h()&&f()&&n){d(!0);try{await e({action:"updateMobileNumber",mobileNumber:t,reason:o}),m("Mobile Number Updated.","success"),p()}catch(r){g(r)}finally{d(!1)}}}),[n,t,o,m,p,u,g,h,f,e]);return{mobileNumber:t,reason:o,isCustomerIdentityVerified:n,messages:s,isSubmitting:c,setIsSubmitting:d,setMobileNumber:r,setReason:a,setIsVerifiedCustomerIdentity:i,clearMessages:u,handleSubmit:y}})(e.onSubmit);return tn(b,{children:tn("div",{className:"flex flex-row",children:tn("div",{className:"w-3/4 mt-9 ml-4",children:tn("form",{onSubmit:async e=>{e.preventDefault(),await d()},children:[tn("label",{className:"block text-sm font-bold text-gray-700",children:"Update Mobile Number:"}),tn("div",{className:"sm:grid sm:grid-cols-6 sm:items-baseline sm:gap-4 mt-4",children:[tn("label",{className:"col-start-1 block text-sm font-bold text-gray-700",children:"New Mobile Number"}),tn("div",{className:"sm:col-start-2",children:tn(qn,{allowedKeyPattern:/[0-9+]/,name:"newMobileNumber",placeholder:"",type:"tel",value:t,className:"w-full",onClick:c,pattern:"[0-9+]*",onChange:e=>{const t=e.currentTarget;a(t.value),c()}})}),tn("div",{className:"col-start-4 col-span-3 row-span-3 flex-col text-left",children:i.map(((e,t)=>tn(Hn,{message:e.text,className:"text-sm text-left font-semibold "+("error"===e.type?"text-red-600":"text-green-600")},t)))}),tn("div",{className:"col-start-2 col-span-2 relative flex items-start",children:[tn("div",{className:"flex h-6 items-center",children:tn("input",{id:"verifiedCheckbox","aria-describedby":"verified-customer-identity",name:"verifiedCheckbox",type:"checkbox",checked:n,onChange:e=>{const t=e.currentTarget;l(t.checked),c()},className:"h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600",required:!0})}),tn("div",{className:"ml-2 text-sm leading-6",children:tn("label",{className:"font-medium text-gray-900",children:"Verified Customer Identity"})})]}),tn("div",{className:"col-start-2",children:tn(qn,{name:"reason",placeholder:"Zendesk Ticket ID",type:"text",value:r,className:"w-full",onClick:c,onChange:e=>{const t=e.currentTarget;s(t.value),c()}})}),tn("div",{className:"sm:row-start-1 sm:col-start-3 sm:flex sm:justify-center sm:mt-0 mt-2",children:tn("button",{type:"submit",className:"bg-indigo-500 hover:bg-indigo-900 text-white font-bold py-1 px-4 rounded focus:outline-none",disabled:o,children:"Update"})})]})]})})})})},vi=()=>{const{searchCustomerResult:e,isLoading:t,error:r,showCustomerDetails:n,isModalOpen:i,searchFilter:o,searchCustomer:a,handleAction:s,handleModalConfirm:l,handleModalCancel:c}=ui();return tn(b,{children:[tn(mi,{onSubmit:a}),t&&tn("p",{children:"Loading..."}),tn("div",{className:"p-4 mt-2 text-red-700",children:r}),!t&&n&&tn(b,{children:[tn(wi,{data:e,onAction:s}),o.current.searchType!==jr.EmailAddress&&tn(_i,{onSubmit:s})]}),tn(In,{isOpen:i,heading:"Warning",message:"Are you sure you want to remove workplace access?",onConfirm:l,onCancel:c})]})};var xi=(e=>(e.Search="Search",e.BenefitsPlan="Benefits Plan",e))(xi||{});function ki(){return(ki=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var Ni=["context","children"];function Ci(e){return this.getChildContext=function(){return e.context},I(e.children,function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)t.indexOf(r=o[n])>=0||(i[r]=e[r]);return i}(e,Ni))}function Ei(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=g(Ci,ki({},this._props,{context:e.detail.context}),function e(t,r){if(3===t.nodeType)return t.data;if(1!==t.nodeType)return null;var n=[],i={},o=0,a=t.attributes,s=t.childNodes;for(o=a.length;o--;)"slot"!==a[o].name&&(i[a[o].name]=a[o].value,i[Ai(a[o].name)]=a[o].value);for(o=s.length;o--;){var l=e(s[o],null),c=s[o].slot;c?i[c]=g(Oi,{name:c},l):n[o]=l}var d=r?g(Oi,null,n):n;return g(r||t.nodeName.toLowerCase(),i,d)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?F:M)(this._vdom,this._root)}function Ai(e){return e.replace(/-(\w)/g,(function(e,t){return t?t.toUpperCase():""}))}function Si(e,t,r){if(this._vdom){var n={};n[e]=r=null==r?void 0:r,n[Ai(e)]=r,this._vdom=I(this._vdom,n),M(this._vdom,this._root)}}function Ti(){M(this._vdom=null,this._root)}function Oi(e,t){var r=this;return g("slot",ki({},e,{ref:function(e){e?(r.ref=e,r._listener||(r._listener=function(e){e.stopPropagation(),e.detail.context=t},e.addEventListener("_preact",r._listener))):r.ref.removeEventListener("_preact",r._listener)}}))}!function(e,t,r,n){function i(){var t=Reflect.construct(HTMLElement,[],i);return t._vdomComponent=e,t._root=n&&n.shadow?t.attachShadow({mode:n.mode||"open"}):t,t}(i.prototype=Object.create(HTMLElement.prototype)).constructor=i,i.prototype.connectedCallback=Ei,i.prototype.attributeChangedCallback=Si,i.prototype.disconnectedCallback=Ti,r=r||e.observedAttributes||Object.keys(e.propTypes||{}),i.observedAttributes=r,r.forEach((function(e){Object.defineProperty(i.prototype,e,{get:function(){return this._vdom.props[e]},set:function(t){this._vdom?this.attributeChangedCallback(e,null,t):(this._props||(this._props={}),this._props[e]=t,this.connectedCallback());var r=typeof t;null!=t&&"string"!==r&&"boolean"!==r&&"number"!==r||this.setAttribute(e,t)}})})),customElements.define(t||e.tagName||e.displayName||e.name,i)}((e=>{const t={backendUrl:e["backend-url"],accessToken:e["access-token"]};Yr(t.backendUrl,t.accessToken);const[r,n]=ee("Search"),i=ie((e=>e===r),[r]);return tn(b,{children:[tn("style",{children:Qr.toString()}),tn(rn,{tabTitles:Object.entries(xi).map((([,e])=>e)),currentTab:r,onChange:n}),tn(Gn,{visible:i("Search"),children:tn(vi,{})}),tn(Gn,{visible:i("Benefits Plan"),children:tn(di,{})})]})}),"superhero-pba-support-admin",["backend-url","access-token"]);
|
1
|
+
var e,t,r,n,i,o,a,s,l,c,d={},u=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,m=Array.isArray;function h(e,t){for(var r in t)e[r]=t[r];return e}function f(e){var t=e.parentNode;t&&t.removeChild(e)}function g(t,r,n){var i,o,a,s={};for(a in r)"key"==a?i=r[a]:"ref"==a?o=r[a]:s[a]=r[a];if(arguments.length>2&&(s.children=arguments.length>3?e.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(a in t.defaultProps)void 0===s[a]&&(s[a]=t.defaultProps[a]);return b(t,s,i,o,null)}function b(e,n,i,o,a){var s={type:e,props:n,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++r:a,__i:-1,__u:0};return null==a&&null!=t.vnode&&t.vnode(s),s}function y(e){return e.children}function w(e,t){this.props=e,this.context=t}function _(e,t){if(null==t)return e.__?_(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?_(e):null}function v(e){var t,r;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e){e.__e=e.__c.base=r.__e;break}return v(e)}}function x(e){(!e.__d&&(e.__d=!0)&&n.push(e)&&!k.__r++||i!==t.debounceRendering)&&((i=t.debounceRendering)||o)(k)}function k(){var e,r,i,o,s,l,c,d;for(n.sort(a);e=n.shift();)e.__d&&(r=n.length,o=void 0,l=(s=(i=e).__v).__e,c=[],d=[],i.__P&&((o=h({},s)).__v=s.__v+1,t.vnode&&t.vnode(o),R(i.__P,o,s,i.__n,i.__P.namespaceURI,32&s.__u?[l]:null,c,null==l?_(s):l,!!(32&s.__u),d),o.__v=s.__v,o.__.__k[o.__i]=o,U(c,o,d),o.__e!=l&&v(o)),n.length>r&&n.sort(a));k.__r=0}function N(e,t,r,n,i,o,a,s,l,c,p){var h,f,g,w,v,x=n&&n.__k||u,k=t.length;for(r.__d=l,function(e,t,r){var n,i,o,a,s,l=t.length,c=r.length,d=c,u=0;for(e.__k=[],n=0;n<l;n++)a=n+u,null!=(i=e.__k[n]=null==(i=t[n])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?b(null,i,null,null,null):m(i)?b(y,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?b(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=e,i.__b=e.__b+1,s=A(i,r,a,d),i.__i=s,o=null,-1!==s&&(d--,(o=r[s])&&(o.__u|=131072)),null==o||null===o.__v?(-1==s&&u--,"function"!=typeof i.type&&(i.__u|=65536)):s!==a&&(s===a+1?u++:s>a?d>l-a?u+=s-a:u--:s<a?s==a-1&&(u=s-a):u=0,s!==n+u&&(i.__u|=65536))):(o=r[a])&&null==o.key&&o.__e&&!(131072&o.__u)&&(o.__e==e.__d&&(e.__d=_(o)),j(o,o,!1),r[a]=null,d--);if(d)for(n=0;n<c;n++)null!=(o=r[n])&&!(131072&o.__u)&&(o.__e==e.__d&&(e.__d=_(o)),j(o,o))}(r,t,x),l=r.__d,h=0;h<k;h++)null!=(g=r.__k[h])&&"boolean"!=typeof g&&"function"!=typeof g&&(f=-1===g.__i?d:x[g.__i]||d,g.__i=h,R(e,g,f,i,o,a,s,l,c,p),w=g.__e,g.ref&&f.ref!=g.ref&&(f.ref&&P(f.ref,null,g),p.push(g.ref,g.__c||w,g)),null==v&&null!=w&&(v=w),65536&g.__u||f.__k===g.__k?(l&&!l.isConnected&&(l=_(f)),l=C(g,l,e)):"function"==typeof g.type&&void 0!==g.__d?l=g.__d:w&&(l=w.nextSibling),g.__d=void 0,g.__u&=-196609);r.__d=l,r.__e=v}function C(e,t,r){var n,i;if("function"==typeof e.type){for(n=e.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=e,t=C(n[i],t,r));return t}e.__e!=t&&(r.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8===t.nodeType);return t}function E(e,t){return t=t||[],null==e||"boolean"==typeof e||(m(e)?e.some((function(e){E(e,t)})):t.push(e)),t}function A(e,t,r,n){var i=e.key,o=e.type,a=r-1,s=r+1,l=t[r];if(null===l||l&&i==l.key&&o===l.type&&!(131072&l.__u))return r;if(n>(null==l||131072&l.__u?0:1))for(;a>=0||s<t.length;){if(a>=0){if((l=t[a])&&!(131072&l.__u)&&i==l.key&&o===l.type)return a;a--}if(s<t.length){if((l=t[s])&&!(131072&l.__u)&&i==l.key&&o===l.type)return s;s++}}return-1}function S(e,t,r){"-"===t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||p.test(t)?r:r+"px"}function T(e,t,r,n,i){var o;e:if("style"===t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||S(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||S(e.style,t,r[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||"onFocusOut"===t||"onFocusIn"===t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n?r.u=n.u:(r.u=s,e.addEventListener(t,o?c:l,o)):e.removeEventListener(t,o?c:l,o);else{if("http://www.w3.org/2000/svg"==i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&t in e)try{e[t]=null==r?"":r;break e}catch(a){}"function"==typeof r||(null==r||!1===r&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,r))}}function O(e){return function(r){if(this.l){var n=this.l[r.type+e];if(null==r.t)r.t=s++;else if(r.t<n.u)return;return n(t.event?t.event(r):r)}}}function R(r,n,i,o,a,s,l,c,u,p){var g,b,v,x,k,C,E,A,S,O,R,U,P,j,M,I=n.type;if(void 0!==n.constructor)return null;128&i.__u&&(u=!!(32&i.__u),s=[c=n.__e=i.__e]),(g=t.__b)&&g(n);e:if("function"==typeof I)try{if(A=n.props,S=(g=I.contextType)&&o[g.__c],O=g?S?S.props.value:g.__:o,i.__c?E=(b=n.__c=i.__c).__=b.__E:("prototype"in I&&I.prototype.render?n.__c=b=new I(A,O):(n.__c=b=new w(A,O),b.constructor=I,b.render=L),S&&S.sub(b),b.props=A,b.state||(b.state={}),b.context=O,b.__n=o,v=b.__d=!0,b.__h=[],b._sb=[]),null==b.__s&&(b.__s=b.state),null!=I.getDerivedStateFromProps&&(b.__s==b.state&&(b.__s=h({},b.__s)),h(b.__s,I.getDerivedStateFromProps(A,b.__s))),x=b.props,k=b.state,b.__v=n,v)null==I.getDerivedStateFromProps&&null!=b.componentWillMount&&b.componentWillMount(),null!=b.componentDidMount&&b.__h.push(b.componentDidMount);else{if(null==I.getDerivedStateFromProps&&A!==x&&null!=b.componentWillReceiveProps&&b.componentWillReceiveProps(A,O),!b.__e&&(null!=b.shouldComponentUpdate&&!1===b.shouldComponentUpdate(A,b.__s,O)||n.__v===i.__v)){for(n.__v!==i.__v&&(b.props=A,b.state=b.__s,b.__d=!1),n.__e=i.__e,n.__k=i.__k,n.__k.forEach((function(e){e&&(e.__=n)})),R=0;R<b._sb.length;R++)b.__h.push(b._sb[R]);b._sb=[],b.__h.length&&l.push(b);break e}null!=b.componentWillUpdate&&b.componentWillUpdate(A,b.__s,O),null!=b.componentDidUpdate&&b.__h.push((function(){b.componentDidUpdate(x,k,C)}))}if(b.context=O,b.props=A,b.__P=r,b.__e=!1,U=t.__r,P=0,"prototype"in I&&I.prototype.render){for(b.state=b.__s,b.__d=!1,U&&U(n),g=b.render(b.props,b.state,b.context),j=0;j<b._sb.length;j++)b.__h.push(b._sb[j]);b._sb=[]}else do{b.__d=!1,U&&U(n),g=b.render(b.props,b.state,b.context),b.state=b.__s}while(b.__d&&++P<25);b.state=b.__s,null!=b.getChildContext&&(o=h(h({},o),b.getChildContext())),v||null==b.getSnapshotBeforeUpdate||(C=b.getSnapshotBeforeUpdate(x,k)),N(r,m(M=null!=g&&g.type===y&&null==g.key?g.props.children:g)?M:[M],n,i,o,a,s,l,c,u,p),b.base=n.__e,n.__u&=-161,b.__h.length&&l.push(b),E&&(b.__E=b.__=null)}catch(F){n.__v=null,u||null!=s?(n.__e=c,n.__u|=u?160:32,s[s.indexOf(c)]=null):(n.__e=i.__e,n.__k=i.__k),t.__e(F,n,i)}else null==s&&n.__v===i.__v?(n.__k=i.__k,n.__e=i.__e):n.__e=function(t,r,n,i,o,a,s,l,c){var u,p,h,g,b,y,w,v=n.props,x=r.props,k=r.type;if("svg"===k?o="http://www.w3.org/2000/svg":"math"===k?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=a)for(u=0;u<a.length;u++)if((b=a[u])&&"setAttribute"in b==!!k&&(k?b.localName===k:3===b.nodeType)){t=b,a[u]=null;break}if(null==t){if(null===k)return document.createTextNode(x);t=document.createElementNS(o,k,x.is&&x),a=null,l=!1}if(null===k)v===x||l&&t.data===x||(t.data=x);else{if(a=a&&e.call(t.childNodes),v=n.props||d,!l&&null!=a)for(v={},u=0;u<t.attributes.length;u++)v[(b=t.attributes[u]).name]=b.value;for(u in v)if(b=v[u],"children"==u);else if("dangerouslySetInnerHTML"==u)h=b;else if("key"!==u&&!(u in x)){if("value"==u&&"defaultValue"in x||"checked"==u&&"defaultChecked"in x)continue;T(t,u,null,b,o)}for(u in x)b=x[u],"children"==u?g=b:"dangerouslySetInnerHTML"==u?p=b:"value"==u?y=b:"checked"==u?w=b:"key"===u||l&&"function"!=typeof b||v[u]===b||T(t,u,b,v[u],o);if(p)l||h&&(p.__html===h.__html||p.__html===t.innerHTML)||(t.innerHTML=p.__html),r.__k=[];else if(h&&(t.innerHTML=""),N(t,m(g)?g:[g],r,n,i,"foreignObject"===k?"http://www.w3.org/1999/xhtml":o,a,s,a?a[0]:n.__k&&_(n,0),l,c),null!=a)for(u=a.length;u--;)null!=a[u]&&f(a[u]);l||(u="value",void 0!==y&&(y!==t[u]||"progress"===k&&!y||"option"===k&&y!==v[u])&&T(t,u,y,v[u],o),u="checked",void 0!==w&&w!==t[u]&&T(t,u,w,v[u],o))}return t}(i.__e,n,i,o,a,s,l,u,p);(g=t.diffed)&&g(n)}function U(e,r,n){r.__d=void 0;for(var i=0;i<n.length;i++)P(n[i],n[++i],n[++i]);t.__c&&t.__c(r,e),e.some((function(r){try{e=r.__h,r.__h=[],e.some((function(e){e.call(r)}))}catch(n){t.__e(n,r.__v)}}))}function P(e,r,n){try{"function"==typeof e?e(r):e.current=r}catch(i){t.__e(i,n)}}function j(e,r,n){var i,o;if(t.unmount&&t.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||P(i,null,r)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(a){t.__e(a,r)}i.base=i.__P=null}if(i=e.__k)for(o=0;o<i.length;o++)i[o]&&j(i[o],r,n||"function"!=typeof e.type);n||null==e.__e||f(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function L(e,t,r){return this.constructor(e,r)}function M(r,n,i){var o,a,s,l;t.__&&t.__(r,n),a=(o="function"==typeof i)?null:i&&i.__k||n.__k,s=[],l=[],R(n,r=(!o&&i||n).__k=g(y,null,[r]),a||d,d,n.namespaceURI,!o&&i?[i]:a?null:n.firstChild?e.call(n.childNodes):null,s,!o&&i?i:a?a.__e:n.firstChild,o,l),U(s,r,l)}function I(e,t){M(e,t,I)}function F(t,r,n){var i,o,a,s,l=h({},t.props);for(a in t.type&&t.type.defaultProps&&(s=t.type.defaultProps),r)"key"==a?i=r[a]:"ref"==a?o=r[a]:l[a]=void 0===r[a]&&void 0!==s?s[a]:r[a];return arguments.length>2&&(l.children=arguments.length>3?e.call(arguments,2):n),b(t.type,l,i||t.key,o||t.ref,null)}e=u.slice,t={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(s){e=s}throw e}},r=0,w.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=h({},this.state),"function"==typeof e&&(e=e(h({},r),this.props)),e&&h(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),x(this))},w.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),x(this))},w.prototype.render=y,n=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,a=function(e,t){return e.__v.__b-t.__v.__b},k.__r=0,s=0,l=O(!1),c=O(!0);var D,B,z,H,q=0,V=[],$=[],W=t,J=W.__b,K=W.__r,G=W.diffed,X=W.__c,Z=W.unmount,Y=W.__;function Q(e,t){W.__h&&W.__h(B,e,q||t),q=0;var r=B.__H||(B.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:$}),r.__[e]}function ee(e){return q=1,function(e,t,r){var n=Q(D++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):ue(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],r=n.t(t,e);t!==r&&(n.__N=[r,n.__[1]],n.__c.setState({}))}],n.__c=B,!B.u)){var i=function(e,t,r){if(!n.__c.__H)return!0;var i=n.__c.__H.__.filter((function(e){return!!e.__c}));if(i.every((function(e){return!e.__N})))return!o||o.call(this,e,t,r);var a=!1;return i.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),!(!a&&n.__c.props===e)&&(!o||o.call(this,e,t,r))};B.u=!0;var o=B.shouldComponentUpdate,a=B.componentWillUpdate;B.componentWillUpdate=function(e,t,r){if(this.__e){var n=o;o=void 0,i(e,t,r),o=n}a&&a.call(this,e,t,r)},B.shouldComponentUpdate=i}return n.__N||n.__}(ue,e)}function te(e,t){var r=Q(D++,3);!W.__s&&de(r.__H,t)&&(r.__=e,r.i=t,B.__H.__h.push(r))}function re(e){return q=5,ne((function(){return{current:e}}),[])}function ne(e,t){var r=Q(D++,7);return de(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function ie(e,t){return q=8,ne((function(){return e}),t)}function oe(){for(var e;e=V.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(le),e.__H.__h.forEach(ce),e.__H.__h=[]}catch(t){e.__H.__h=[],W.__e(t,e.__v)}}W.__b=function(e){B=null,J&&J(e)},W.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Y&&Y(e,t)},W.__r=function(e){K&&K(e),D=0;var t=(B=e.__c).__H;t&&(z===B?(t.__h=[],B.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=$,e.__N=e.i=void 0}))):(t.__h.forEach(le),t.__h.forEach(ce),t.__h=[],D=0)),z=B},W.diffed=function(e){G&&G(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==V.push(t)&&H===W.requestAnimationFrame||((H=W.requestAnimationFrame)||se)(oe)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==$&&(e.__=e.__V),e.i=void 0,e.__V=$}))),z=B=null},W.__c=function(e,t){t.some((function(e){try{e.__h.forEach(le),e.__h=e.__h.filter((function(e){return!e.__||ce(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],W.__e(r,e.__v)}})),X&&X(e,t)},W.unmount=function(e){Z&&Z(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{le(e)}catch(r){t=r}})),r.__H=void 0,t&&W.__e(t,r.__v))};var ae="function"==typeof requestAnimationFrame;function se(e){var t,r=function(){clearTimeout(n),ae&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);ae&&(t=requestAnimationFrame(r))}function le(e){var t=B,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),B=t}function ce(e){var t=B;e.__c=e.__(),B=t}function de(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function ue(e,t){return"function"==typeof t?t(e):t}function pe(e,t){return function(){return e.apply(t,arguments)}}const{toString:me}=Object.prototype,{getPrototypeOf:he}=Object,fe=(ge=Object.create(null),e=>{const t=me.call(e);return ge[t]||(ge[t]=t.slice(8,-1).toLowerCase())});var ge;const be=e=>(e=e.toLowerCase(),t=>fe(t)===e),ye=e=>t=>typeof t===e,{isArray:we}=Array,_e=ye("undefined");const ve=be("ArrayBuffer");const xe=ye("string"),ke=ye("function"),Ne=ye("number"),Ce=e=>null!==e&&"object"==typeof e,Ee=e=>{if("object"!==fe(e))return!1;const t=he(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},Ae=be("Date"),Se=be("File"),Te=be("Blob"),Oe=be("FileList"),Re=be("URLSearchParams"),[Ue,Pe,je,Le]=["ReadableStream","Request","Response","Headers"].map(be);function Me(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,i;if("object"!=typeof e&&(e=[e]),we(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{const i=r?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let a;for(n=0;n<o;n++)a=i[n],t.call(null,e[a],a,e)}}function Ie(e,t){t=t.toLowerCase();const r=Object.keys(e);let n,i=r.length;for(;i-- >0;)if(n=r[i],t===n.toLowerCase())return n;return null}const Fe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,De=e=>!_e(e)&&e!==Fe;const Be=(ze="undefined"!=typeof Uint8Array&&he(Uint8Array),e=>ze&&e instanceof ze);var ze;const He=be("HTMLFormElement"),qe=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Ve=be("RegExp"),$e=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Me(r,((r,i)=>{let o;!1!==(o=t(r,i,e))&&(n[i]=o||r)})),Object.defineProperties(e,n)},We="abcdefghijklmnopqrstuvwxyz",Je="0123456789",Ke={DIGIT:Je,ALPHA:We,ALPHA_DIGIT:We+We.toUpperCase()+Je};const Ge=be("AsyncFunction"),Xe={isArray:we,isArrayBuffer:ve,isBuffer:function(e){return null!==e&&!_e(e)&&null!==e.constructor&&!_e(e.constructor)&&ke(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||ke(e.append)&&("formdata"===(t=fe(e))||"object"===t&&ke(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&ve(e.buffer),t},isString:xe,isNumber:Ne,isBoolean:e=>!0===e||!1===e,isObject:Ce,isPlainObject:Ee,isReadableStream:Ue,isRequest:Pe,isResponse:je,isHeaders:Le,isUndefined:_e,isDate:Ae,isFile:Se,isBlob:Te,isRegExp:Ve,isFunction:ke,isStream:e=>Ce(e)&&ke(e.pipe),isURLSearchParams:Re,isTypedArray:Be,isFileList:Oe,forEach:Me,merge:function e(){const{caseless:t}=De(this)&&this||{},r={},n=(n,i)=>{const o=t&&Ie(r,i)||i;Ee(r[o])&&Ee(n)?r[o]=e(r[o],n):Ee(n)?r[o]=e({},n):we(n)?r[o]=n.slice():r[o]=n};for(let i=0,o=arguments.length;i<o;i++)arguments[i]&&Me(arguments[i],n);return r},extend:(e,t,r,{allOwnKeys:n}={})=>(Me(t,((t,n)=>{r&&ke(t)?e[n]=pe(t,r):e[n]=t}),{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let i,o,a;const s={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],n&&!n(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==r&&he(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:fe,kindOfTest:be,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(we(e))return e;let t=e.length;if(!Ne(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:He,hasOwnProperty:qe,hasOwnProp:qe,reduceDescriptors:$e,freezeMethods:e=>{$e(e,((t,r)=>{if(ke(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];ke(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return we(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:Ie,global:Fe,isContextDefined:De,ALPHABET:Ke,generateString:(e=16,t=Ke.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&ke(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(Ce(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const i=we(e)?[]:{};return Me(e,((e,t)=>{const o=r(e,n+1);!_e(o)&&(i[t]=o)})),t[n]=void 0,i}}return e};return r(e,0)},isAsyncFn:Ge,isThenable:e=>e&&(Ce(e)||ke(e))&&ke(e.then)&&ke(e.catch)};function Ze(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}Xe.inherits(Ze,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Xe.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Ye=Ze.prototype,Qe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Qe[e]={value:e}})),Object.defineProperties(Ze,Qe),Object.defineProperty(Ye,"isAxiosError",{value:!0}),Ze.from=(e,t,r,n,i,o)=>{const a=Object.create(Ye);return Xe.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),Ze.call(a,e.message,t,r,n,i),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};function et(e){return Xe.isPlainObject(e)||Xe.isArray(e)}function tt(e){return Xe.endsWith(e,"[]")?e.slice(0,-2):e}function rt(e,t,r){return e?e.concat(t).map((function(e,t){return e=tt(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const nt=Xe.toFlatObject(Xe,{},null,(function(e){return/^is[A-Z]/.test(e)}));function it(e,t,r){if(!Xe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=Xe.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Xe.isUndefined(t[e])}))).metaTokens,i=r.visitor||c,o=r.dots,a=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&Xe.isSpecCompliantForm(t);if(!Xe.isFunction(i))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(Xe.isDate(e))return e.toISOString();if(!s&&Xe.isBlob(e))throw new Ze("Blob is not supported. Use a Buffer instead.");return Xe.isArrayBuffer(e)||Xe.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,r,i){let s=e;if(e&&!i&&"object"==typeof e)if(Xe.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(Xe.isArray(e)&&function(e){return Xe.isArray(e)&&!e.some(et)}(e)||(Xe.isFileList(e)||Xe.endsWith(r,"[]"))&&(s=Xe.toArray(e)))return r=tt(r),s.forEach((function(e,n){!Xe.isUndefined(e)&&null!==e&&t.append(!0===a?rt([r],n,o):null===a?r:r+"[]",l(e))})),!1;return!!et(e)||(t.append(rt(i,r,o),l(e)),!1)}const d=[],u=Object.assign(nt,{defaultVisitor:c,convertValue:l,isVisitable:et});if(!Xe.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!Xe.isUndefined(r)){if(-1!==d.indexOf(r))throw Error("Circular reference detected in "+n.join("."));d.push(r),Xe.forEach(r,(function(r,o){!0===(!(Xe.isUndefined(r)||null===r)&&i.call(t,r,Xe.isString(o)?o.trim():o,n,u))&&e(r,n?n.concat(o):[o])})),d.pop()}}(e),t}function ot(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function at(e,t){this._pairs=[],e&&it(e,this,t)}const st=at.prototype;function lt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ct(e,t,r){if(!t)return e;const n=r&&r.encode||lt,i=r&&r.serialize;let o;if(o=i?i(t,r):Xe.isURLSearchParams(t)?t.toString():new at(t,r).toString(n),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}st.append=function(e,t){this._pairs.push([e,t])},st.toString=function(e){const t=e?function(t){return e.call(this,t,ot)}:ot;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const dt=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Xe.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ut={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},pt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:at,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},mt="undefined"!=typeof window&&"undefined"!=typeof document,ht=(ft="undefined"!=typeof navigator&&navigator.product,mt&&["ReactNative","NativeScript","NS"].indexOf(ft)<0);var ft;const gt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,bt=mt&&window.location.href||"http://localhost",yt={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:mt,hasStandardBrowserEnv:ht,hasStandardBrowserWebWorkerEnv:gt,origin:bt},Symbol.toStringTag,{value:"Module"})),...pt};function wt(e){function t(e,r,n,i){let o=e[i++];if("__proto__"===o)return!0;const a=Number.isFinite(+o),s=i>=e.length;if(o=!o&&Xe.isArray(n)?n.length:o,s)return Xe.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!a;n[o]&&Xe.isObject(n[o])||(n[o]=[]);return t(e,r,n[o],i)&&Xe.isArray(n[o])&&(n[o]=function(e){const t={},r=Object.keys(e);let n;const i=r.length;let o;for(n=0;n<i;n++)o=r[n],t[o]=e[o];return t}(n[o])),!a}if(Xe.isFormData(e)&&Xe.isFunction(e.entries)){const r={};return Xe.forEachEntry(e,((e,n)=>{t(function(e){return Xe.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null}const _t={transitional:ut,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=Xe.isObject(e);i&&Xe.isHTMLForm(e)&&(e=new FormData(e));if(Xe.isFormData(e))return n?JSON.stringify(wt(e)):e;if(Xe.isArrayBuffer(e)||Xe.isBuffer(e)||Xe.isStream(e)||Xe.isFile(e)||Xe.isBlob(e)||Xe.isReadableStream(e))return e;if(Xe.isArrayBufferView(e))return e.buffer;if(Xe.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return it(e,new yt.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return yt.isNode&&Xe.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((o=Xe.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return it(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),function(e,t,r){if(Xe.isString(e))try{return(t||JSON.parse)(e),Xe.trim(e)}catch(n){if("SyntaxError"!==n.name)throw n}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||_t.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(Xe.isResponse(e)||Xe.isReadableStream(e))return e;if(e&&Xe.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(i){if(r){if("SyntaxError"===i.name)throw Ze.from(i,Ze.ERR_BAD_RESPONSE,this,null,this.response);throw i}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:yt.classes.FormData,Blob:yt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Xe.forEach(["delete","get","head","post","put","patch"],(e=>{_t.headers[e]={}}));const vt=_t,xt=Xe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),kt=Symbol("internals");function Nt(e){return e&&String(e).trim().toLowerCase()}function Ct(e){return!1===e||null==e?e:Xe.isArray(e)?e.map(Ct):String(e)}function Et(e,t,r,n,i){return Xe.isFunction(n)?n.call(this,t,r):(i&&(t=r),Xe.isString(t)?Xe.isString(n)?-1!==t.indexOf(n):Xe.isRegExp(n)?n.test(t):void 0:void 0)}let At=class{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function i(e,t,r){const i=Nt(t);if(!i)throw new Error("header name must be a non-empty string");const o=Xe.findKey(n,i);(!o||void 0===n[o]||!0===r||void 0===r&&!1!==n[o])&&(n[o||t]=Ct(e))}const o=(e,t)=>Xe.forEach(e,((e,r)=>i(e,r,t)));if(Xe.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(Xe.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let r,n,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),r=e.substring(0,i).trim().toLowerCase(),n=e.substring(i+1).trim(),!r||t[r]&&xt[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t);else if(Xe.isHeaders(e))for(const[a,s]of e.entries())i(s,a,r);else null!=e&&i(t,e,r);return this}get(e,t){if(e=Nt(e)){const r=Xe.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(Xe.isFunction(t))return t.call(this,e,r);if(Xe.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Nt(e)){const r=Xe.findKey(this,e);return!(!r||void 0===this[r]||t&&!Et(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function i(e){if(e=Nt(e)){const i=Xe.findKey(r,e);!i||t&&!Et(0,r[i],i,t)||(delete r[i],n=!0)}}return Xe.isArray(e)?e.forEach(i):i(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const i=t[r];e&&!Et(0,this[i],i,e,!0)||(delete this[i],n=!0)}return n}normalize(e){const t=this,r={};return Xe.forEach(this,((n,i)=>{const o=Xe.findKey(r,i);if(o)return t[o]=Ct(n),void delete t[i];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(i):String(i).trim();a!==i&&delete t[i],t[a]=Ct(n),r[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Xe.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&Xe.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[kt]=this[kt]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=Nt(e);t[n]||(!function(e,t){const r=Xe.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:!0})}))}(r,e),t[n]=!0)}return Xe.isArray(e)?e.forEach(n):n(e),this}};At.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Xe.reduceDescriptors(At.prototype,(({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}})),Xe.freezeMethods(At);const St=At;function Tt(e,t){const r=this||vt,n=t||r,i=St.from(n.headers);let o=n.data;return Xe.forEach(e,(function(e){o=e.call(r,o,i.normalize(),t?t.status:void 0)})),i.normalize(),o}function Ot(e){return!(!e||!e.__CANCEL__)}function Rt(e,t,r){Ze.call(this,null==e?"canceled":e,Ze.ERR_CANCELED,t,r),this.name="CanceledError"}function Ut(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new Ze("Request failed with status code "+r.status,[Ze.ERR_BAD_REQUEST,Ze.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}Xe.inherits(Rt,Ze,{__CANCEL__:!0});const Pt=(e,t,r=3)=>{let n=0;const i=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i,o=0,a=0;return t=void 0!==t?t:1e3,function(s){const l=Date.now(),c=n[a];i||(i=l),r[o]=s,n[o]=l;let d=a,u=0;for(;d!==o;)u+=r[d++],d%=e;if(o=(o+1)%e,o===a&&(a=(a+1)%e),l-i<t)return;const p=c&&l-c;return p?Math.round(1e3*u/p):void 0}}(50,250);return function(e,t){let r=0;const n=1e3/t;let i=null;return function(){const t=!0===this,o=Date.now();if(t||o-r>n)return i&&(clearTimeout(i),i=null),r=o,e.apply(null,arguments);i||(i=setTimeout((()=>(i=null,r=Date.now(),e.apply(null,arguments))),n-(o-r)))}}((r=>{const o=r.loaded,a=r.lengthComputable?r.total:void 0,s=o-n,l=i(s);n=o;const c={loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:l||void 0,estimated:l&&a&&o<=a?(a-o)/l:void 0,event:r,lengthComputable:null!=a};c[t?"download":"upload"]=!0,e(c)}),r)},jt=yt.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(e){const t=Xe.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0},Lt=yt.hasStandardBrowserEnv?{write(e,t,r,n,i,o){const a=[e+"="+encodeURIComponent(t)];Xe.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),Xe.isString(n)&&a.push("path="+n),Xe.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Mt(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const It=e=>e instanceof St?{...e}:e;function Ft(e,t){t=t||{};const r={};function n(e,t,r){return Xe.isPlainObject(e)&&Xe.isPlainObject(t)?Xe.merge.call({caseless:r},e,t):Xe.isPlainObject(t)?Xe.merge({},t):Xe.isArray(t)?t.slice():t}function i(e,t,r){return Xe.isUndefined(t)?Xe.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function o(e,t){if(!Xe.isUndefined(t))return n(void 0,t)}function a(e,t){return Xe.isUndefined(t)?Xe.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,i,o){return o in t?n(r,i):o in e?n(void 0,r):void 0}const l={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t)=>i(It(e),It(t),!0)};return Xe.forEach(Object.keys(Object.assign({},e,t)),(function(n){const o=l[n]||i,a=o(e[n],t[n],n);Xe.isUndefined(a)&&o!==s||(r[n]=a)})),r}const Dt=e=>{const t=Ft({},e);let r,{data:n,withXSRFToken:i,xsrfHeaderName:o,xsrfCookieName:a,headers:s,auth:l}=t;if(t.headers=s=St.from(s),t.url=ct(Mt(t.baseURL,t.url),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),Xe.isFormData(n))if(yt.hasStandardBrowserEnv||yt.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(r=s.getContentType())){const[e,...t]=r?r.split(";").map((e=>e.trim())).filter(Boolean):[];s.setContentType([e||"multipart/form-data",...t].join("; "))}if(yt.hasStandardBrowserEnv&&(i&&Xe.isFunction(i)&&(i=i(t)),i||!1!==i&&jt(t.url))){const e=o&&a&&Lt.read(a);e&&s.set(o,e)}return t},Bt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){const n=Dt(e);let i=n.data;const o=St.from(n.headers).normalize();let a,{responseType:s}=n;function l(){n.cancelToken&&n.cancelToken.unsubscribe(a),n.signal&&n.signal.removeEventListener("abort",a)}let c=new XMLHttpRequest;function d(){if(!c)return;const n=St.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());Ut((function(e){t(e),l()}),(function(e){r(e),l()}),{data:s&&"text"!==s&&"json"!==s?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:n,config:e,request:c}),c=null}c.open(n.method.toUpperCase(),n.url,!0),c.timeout=n.timeout,"onloadend"in c?c.onloadend=d:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(d)},c.onabort=function(){c&&(r(new Ze("Request aborted",Ze.ECONNABORTED,n,c)),c=null)},c.onerror=function(){r(new Ze("Network Error",Ze.ERR_NETWORK,n,c)),c=null},c.ontimeout=function(){let e=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const t=n.transitional||ut;n.timeoutErrorMessage&&(e=n.timeoutErrorMessage),r(new Ze(e,t.clarifyTimeoutError?Ze.ETIMEDOUT:Ze.ECONNABORTED,n,c)),c=null},void 0===i&&o.setContentType(null),"setRequestHeader"in c&&Xe.forEach(o.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),Xe.isUndefined(n.withCredentials)||(c.withCredentials=!!n.withCredentials),s&&"json"!==s&&(c.responseType=n.responseType),"function"==typeof n.onDownloadProgress&&c.addEventListener("progress",Pt(n.onDownloadProgress,!0)),"function"==typeof n.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",Pt(n.onUploadProgress)),(n.cancelToken||n.signal)&&(a=t=>{c&&(r(!t||t.type?new Rt(null,e,c):t),c.abort(),c=null)},n.cancelToken&&n.cancelToken.subscribe(a),n.signal&&(n.signal.aborted?a():n.signal.addEventListener("abort",a)));const u=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);u&&-1===yt.protocols.indexOf(u)?r(new Ze("Unsupported protocol "+u+":",Ze.ERR_BAD_REQUEST,e)):c.send(i||null)}))},zt=(e,t)=>{let r,n=new AbortController;const i=function(e){if(!r){r=!0,a();const t=e instanceof Error?e:this.reason;n.abort(t instanceof Ze?t:new Rt(t instanceof Error?t.message:t))}};let o=t&&setTimeout((()=>{i(new Ze(`timeout ${t} of ms exceeded`,Ze.ETIMEDOUT))}),t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach((e=>{e&&(e.removeEventListener?e.removeEventListener("abort",i):e.unsubscribe(i))})),e=null)};e.forEach((e=>e&&e.addEventListener&&e.addEventListener("abort",i)));const{signal:s}=n;return s.unsubscribe=a,[s,()=>{o&&clearTimeout(o),o=null}]},Ht=function*(e,t){let r=e.byteLength;if(!t||r<t)return void(yield e);let n,i=0;for(;i<r;)n=i+t,yield e.slice(i,n),i=n},qt=(e,t,r,n,i)=>{const o=async function*(e,t,r){for await(const n of e)yield*Ht(ArrayBuffer.isView(n)?n:await r(String(n)),t)}(e,t,i);let a=0;return new ReadableStream({type:"bytes",async pull(e){const{done:t,value:i}=await o.next();if(t)return e.close(),void n();let s=i.byteLength;r&&r(a+=s),e.enqueue(new Uint8Array(i))},cancel:e=>(n(e),o.return())},{highWaterMark:2})},Vt=(e,t)=>{const r=null!=e;return n=>setTimeout((()=>t({lengthComputable:r,total:e,loaded:n})))},$t="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Wt=$t&&"function"==typeof ReadableStream,Jt=$t&&("function"==typeof TextEncoder?(Kt=new TextEncoder,e=>Kt.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Kt;const Gt=Wt&&(()=>{let e=!1;const t=new Request(yt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})(),Xt=Wt&&!!(()=>{try{return Xe.isReadableStream(new Response("").body)}catch(e){}})(),Zt={stream:Xt&&(e=>e.body)};var Yt;$t&&(Yt=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!Zt[e]&&(Zt[e]=Xe.isFunction(Yt[e])?t=>t[e]():(t,r)=>{throw new Ze(`Response type '${e}' is not supported`,Ze.ERR_NOT_SUPPORT,r)})})));const Qt=async(e,t)=>{const r=Xe.toFiniteNumber(e.getContentLength());return null==r?(async e=>null==e?0:Xe.isBlob(e)?e.size:Xe.isSpecCompliantForm(e)?(await new Request(e).arrayBuffer()).byteLength:Xe.isArrayBufferView(e)?e.byteLength:(Xe.isURLSearchParams(e)&&(e+=""),Xe.isString(e)?(await Jt(e)).byteLength:void 0))(t):r},er={http:null,xhr:Bt,fetch:$t&&(async e=>{let{url:t,method:r,data:n,signal:i,cancelToken:o,timeout:a,onDownloadProgress:s,onUploadProgress:l,responseType:c,headers:d,withCredentials:u="same-origin",fetchOptions:p}=Dt(e);c=c?(c+"").toLowerCase():"text";let m,h,[f,g]=i||o||a?zt([i,o],a):[];const b=()=>{!m&&setTimeout((()=>{f&&f.unsubscribe()})),m=!0};let y;try{if(l&&Gt&&"get"!==r&&"head"!==r&&0!==(y=await Qt(d,n))){let e,r=new Request(t,{method:"POST",body:n,duplex:"half"});Xe.isFormData(n)&&(e=r.headers.get("content-type"))&&d.setContentType(e),r.body&&(n=qt(r.body,65536,Vt(y,Pt(l)),null,Jt))}Xe.isString(u)||(u=u?"cors":"omit"),h=new Request(t,{...p,signal:f,method:r.toUpperCase(),headers:d.normalize().toJSON(),body:n,duplex:"half",withCredentials:u});let i=await fetch(h);const o=Xt&&("stream"===c||"response"===c);if(Xt&&(s||o)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=i[t]}));const t=Xe.toFiniteNumber(i.headers.get("content-length"));i=new Response(qt(i.body,65536,s&&Vt(t,Pt(s,!0)),o&&b,Jt),e)}c=c||"text";let a=await Zt[Xe.findKey(Zt,c)||"text"](i,e);return!o&&b(),g&&g(),await new Promise(((t,r)=>{Ut(t,r,{data:a,headers:St.from(i.headers),status:i.status,statusText:i.statusText,config:e,request:h})}))}catch(w){if(b(),w&&"TypeError"===w.name&&/fetch/i.test(w.message))throw Object.assign(new Ze("Network Error",Ze.ERR_NETWORK,e,h),{cause:w.cause||w});throw Ze.from(w,w&&w.code,e,h)}})};Xe.forEach(er,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(r){}Object.defineProperty(e,"adapterName",{value:t})}}));const tr=e=>`- ${e}`,rr=e=>Xe.isFunction(e)||null===e||!1===e,nr=e=>{e=Xe.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let o=0;o<t;o++){let t;if(r=e[o],n=r,!rr(r)&&(n=er[(t=String(r)).toLowerCase()],void 0===n))throw new Ze(`Unknown adapter '${t}'`);if(n)break;i[t||"#"+o]=n}if(!n){const e=Object.entries(i).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new Ze("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(tr).join("\n"):" "+tr(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n};function ir(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Rt(null,e)}function or(e){ir(e),e.headers=St.from(e.headers),e.data=Tt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return nr(e.adapter||vt.adapter)(e).then((function(t){return ir(e),t.data=Tt.call(e,e.transformResponse,t),t.headers=St.from(t.headers),t}),(function(t){return Ot(t)||(ir(e),t&&t.response&&(t.response.data=Tt.call(e,e.transformResponse,t.response),t.response.headers=St.from(t.response.headers))),Promise.reject(t)}))}const ar="1.7.2",sr={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{sr[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const lr={};sr.transitional=function(e,t,r){function n(e,t){return"[Axios v1.7.2] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,i,o)=>{if(!1===e)throw new Ze(n(i," has been removed"+(t?" in "+t:"")),Ze.ERR_DEPRECATED);return t&&!lr[i]&&(lr[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,o)}};const cr={assertOptions:function(e,t,r){if("object"!=typeof e)throw new Ze("options must be an object",Ze.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const o=n[i],a=t[o];if(a){const t=e[o],r=void 0===t||a(t,o,e);if(!0!==r)throw new Ze("option "+o+" must be "+r,Ze.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new Ze("Unknown option "+o,Ze.ERR_BAD_OPTION)}},validators:sr},dr=cr.validators;let ur=class{constructor(e){this.defaults=e,this.interceptors={request:new dt,response:new dt}}async request(e,t){try{return await this._request(e,t)}catch(r){if(r instanceof Error){let e;Error.captureStackTrace?Error.captureStackTrace(e={}):e=new Error;const t=e.stack?e.stack.replace(/^.+\n/,""):"";try{r.stack?t&&!String(r.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(r.stack+="\n"+t):r.stack=t}catch(n){}}throw r}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ft(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:i}=t;void 0!==r&&cr.assertOptions(r,{silentJSONParsing:dr.transitional(dr.boolean),forcedJSONParsing:dr.transitional(dr.boolean),clarifyTimeoutError:dr.transitional(dr.boolean)},!1),null!=n&&(Xe.isFunction(n)?t.paramsSerializer={serialize:n}:cr.assertOptions(n,{encode:dr.function,serialize:dr.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&Xe.merge(i.common,i[t.method]);i&&Xe.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=St.concat(o,i);const a=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const l=[];let c;this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)}));let d,u=0;if(!s){const e=[or.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,l),d=e.length,c=Promise.resolve(t);u<d;)c=c.then(e[u++],e[u++]);return c}d=a.length;let p=t;for(u=0;u<d;){const e=a[u++],t=a[u++];try{p=e(p)}catch(m){t.call(this,m);break}}try{c=or.call(this,p)}catch(m){return Promise.reject(m)}for(u=0,d=l.length;u<d;)c=c.then(l[u++],l[u++]);return c}getUri(e){return ct(Mt((e=Ft(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}};Xe.forEach(["delete","get","head","options"],(function(e){ur.prototype[e]=function(t,r){return this.request(Ft(r||{},{method:e,url:t,data:(r||{}).data}))}})),Xe.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,i){return this.request(Ft(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}ur.prototype[e]=t(),ur.prototype[e+"Form"]=t(!0)}));const pr=ur;const mr=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,i){r.reason||(r.reason=new Rt(e,n,i),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let t;return{token:new e((function(e){t=e})),cancel:t}}};const hr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(hr).forEach((([e,t])=>{hr[t]=e}));const fr=hr;const gr=function e(t){const r=new pr(t),n=pe(pr.prototype.request,r);return Xe.extend(n,pr.prototype,r,{allOwnKeys:!0}),Xe.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(Ft(t,r))},n}(vt);gr.Axios=pr,gr.CanceledError=Rt,gr.CancelToken=mr,gr.isCancel=Ot,gr.VERSION=ar,gr.toFormData=it,gr.AxiosError=Ze,gr.Cancel=gr.CanceledError,gr.all=function(e){return Promise.all(e)},gr.spread=function(e){return function(t){return e.apply(null,t)}},gr.isAxiosError=function(e){return Xe.isObject(e)&&!0===e.isAxiosError},gr.mergeConfig=Ft,gr.AxiosHeaders=St,gr.formToJSON=e=>wt(Xe.isHTMLForm(e)?new FormData(e):e),gr.getAdapter=nr,gr.HttpStatusCode=fr,gr.default=gr;const br=gr,{Axios:yr,AxiosError:wr,CanceledError:_r,isCancel:vr,CancelToken:xr,VERSION:kr,all:Nr,Cancel:Cr,isAxiosError:Er,spread:Ar,toFormData:Sr,AxiosHeaders:Tr,HttpStatusCode:Or,formToJSON:Rr,getAdapter:Ur,mergeConfig:Pr}=br;var jr=(e=>(e.EmailAddress="EmailAddress",e.MobileNumber="MobileNumber",e.CustomerId="CustomerId",e))(jr||{});const Lr=[{searchType:"EmailAddress",name:"Email Address",label:"emailAddress"},{searchType:"MobileNumber",name:"Mobile Number",label:"mobileNumber"},{searchType:"CustomerId",name:"PBA Customer Id",label:"customerId"}];var Mr=(e=>(e.Established="Established",e.Unestablished="Unestablished",e))(Mr||{});const Ir=e=>!!/\+\d{1,14}$/.test(e);let Fr;let Dr;var Br=(e=>(e.Assessment="Assessment",e.Quiz="Quiz",e.Poll="Poll",e.Trivia="Trivia",e.Article="Article",e.Url="Url",e.Contact="Contact",e.Deeplink="Deeplink",e.Advertisement="Advertisement",e))(Br||{}),zr=(e=>(e.Cars="Cars",e.Health="Health",e.Everyday="Everyday",e.Devices="Devices",e.Energy="Energy",e.SavingsAccount="Savings Account*",e.HomeLoan="Home Loan*",e.MobileAndInternet="Mobile & Internet",e))(zr||{});const Hr=e=>{var t;const r=e,n=(null==(t=r.response)?void 0:t.data)?r.response.data:void 0;return(null==n?void 0:n.message)??r.message},qr=(e,t=3)=>{const r=e.split(" ");return r.length>t?`${r.slice(0,t).join(" ")}...`:e},Vr=(e,t)=>{switch(e){case Br.Trivia:return"Trivia";case Br.Assessment:switch(t){case zr.Cars:return"SalaryPackagingCars";case zr.HomeLoan:return"HomeLoan"}return t.replace(/\s+/g,"");default:return"None"}},$r=e=>{switch(e){case zr.SavingsAccount:return["Banking"];case zr.Cars:return["Cars"];case zr.Devices:case zr.Health:case zr.Energy:case zr.Everyday:return[e];case"None":return["Miscellaneous"];case zr.HomeLoan:case zr.MobileAndInternet:default:return[]}},Wr=e=>{switch(e){case zr.Cars:return["NovatedLease"];case zr.Health:return["HealthInsurance"];case zr.SavingsAccount:return["SavingsAccount"];case zr.Devices:case zr.Energy:return[e];case zr.HomeLoan:return["HomeLoan"];case zr.MobileAndInternet:case zr.Everyday:default:return[]}},Jr=(e,t,r)=>{const n=e.products[0],i=Kr(e,t);i?i.isFeatured=r??!1:n.activities.push({id:t,isFeatured:r??!1})},Kr=(e,t)=>e.products[0].activities.find((e=>e.id===t));let Gr;const Xr=async(e,t)=>{if(!Gr)throw new Error("Api has not been initialized");return await Gr.put(`/_admin/v1.0/categories/${e}`,t)},Zr=async(e,t,r,n)=>{if(!Gr)throw new Error("Api has not been initialized");try{if(await Gr.put(`/_admin/v1.0/activities/${e}`,t),r){const t=Kr(r,e);if((null==t?void 0:t.isFeatured)!==n){Jr(r,e,n??!1);const t=r;await Xr(r.id,t)}}}catch(i){throw new Error(`${Hr(i)}`)}},Yr=(e,t)=>{te((()=>{((e,t)=>{Fr=br.create({baseURL:`${e}/customer-profile`,headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}})})(e,t),((e,t)=>{Dr=br.create({baseURL:`${e}/flare-app-identity`,headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}})})(e,t),((e,t)=>{Gr=br.create({baseURL:`${e}/benefits-plan`,headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}})})(e,t)}),[e,t])},Qr="*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: \"\"}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol,\"Noto Color Emoji\";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}[type=text],input:where(:not([type])),[type=email],[type=url],[type=password],[type=number],[type=date],[type=datetime-local],[type=month],[type=search],[type=tel],[type=time],[type=week],[multiple],textarea,select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#6b7280;border-width:1px;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem;--tw-shadow: 0 0 #0000}[type=text]:focus,input:where(:not([type])):focus,[type=email]:focus,[type=url]:focus,[type=password]:focus,[type=number]:focus,[type=date]:focus,[type=datetime-local]:focus,[type=month]:focus,[type=search]:focus,[type=tel]:focus,[type=time]:focus,[type=week]:focus,[multiple]:focus,textarea:focus,select:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: #2563eb;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#2563eb}input::-moz-placeholder,textarea::-moz-placeholder{color:#6b7280;opacity:1}input::placeholder,textarea::placeholder{color:#6b7280;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-top:0;padding-bottom:0}select{background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e\");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem;-webkit-print-color-adjust:exact;print-color-adjust:exact}[multiple],[size]:where(select:not([size=\"1\"])){background-image:initial;background-position:initial;background-repeat:unset;background-size:initial;padding-right:.75rem;-webkit-print-color-adjust:unset;print-color-adjust:unset}[type=checkbox],[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;-webkit-print-color-adjust:exact;print-color-adjust:exact;display:inline-block;vertical-align:middle;background-origin:border-box;-webkit-user-select:none;-moz-user-select:none;user-select:none;flex-shrink:0;height:1rem;width:1rem;color:#2563eb;background-color:#fff;border-color:#6b7280;border-width:1px;--tw-shadow: 0 0 #0000}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 2px;--tw-ring-offset-color: #fff;--tw-ring-color: #2563eb;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}[type=checkbox]:checked,[type=radio]:checked{border-color:transparent;background-color:currentColor;background-size:100% 100%;background-position:center;background-repeat:no-repeat}[type=checkbox]:checked{background-image:url(\"data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e\")}@media (forced-colors: active){[type=checkbox]:checked{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}}[type=radio]:checked{background-image:url(\"data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e\")}@media (forced-colors: active){[type=radio]:checked{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}}[type=checkbox]:checked:hover,[type=checkbox]:checked:focus,[type=radio]:checked:hover,[type=radio]:checked:focus{border-color:transparent;background-color:currentColor}[type=checkbox]:indeterminate{background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e\");border-color:transparent;background-color:currentColor;background-size:100% 100%;background-position:center;background-repeat:no-repeat}@media (forced-colors: active){[type=checkbox]:indeterminate{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}}[type=checkbox]:indeterminate:hover,[type=checkbox]:indeterminate:focus{border-color:transparent;background-color:currentColor}[type=file]{background:unset;border-color:inherit;border-width:0;border-radius:0;padding:0;font-size:unset;line-height:inherit}[type=file]:focus{outline:1px solid ButtonText;outline:1px auto -webkit-focus-ring-color}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.\\!visible{visibility:visible!important}.visible{visibility:visible}.fixed{position:fixed}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.z-10{z-index:10}.col-span-2{grid-column:span 2 / span 2}.col-span-3{grid-column:span 3 / span 3}.col-start-1{grid-column-start:1}.col-start-2{grid-column-start:2}.col-start-4{grid-column-start:4}.row-span-3{grid-row:span 3 / span 3}.m-4{margin:1rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.mx-auto{margin-left:auto;margin-right:auto}.ml-1{margin-left:.25rem}.ml-16{margin-left:4rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.mt-0{margin-top:0}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-8{margin-top:2rem}.mt-9{margin-top:2.25rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.hidden{display:none}.h-10{height:2.5rem}.h-4{height:1rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-full{height:100%}.min-h-full{min-height:100%}.w-1\\/2{width:50%}.w-1\\/3{width:33.333333%}.w-12{width:3rem}.w-3\\/4{width:75%}.w-4{width:1rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-full{width:100%}.w-screen{width:100vw}.min-w-full{min-width:100%}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.flex-shrink-0{flex-shrink:0}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-normal{justify-content:normal}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2rem * var(--tw-space-x-reverse));margin-left:calc(2rem * calc(1 - var(--tw-space-x-reverse)))}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(1px * var(--tw-divide-x-reverse));border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(229 231 235 / var(--tw-divide-opacity))}.divide-gray-500>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(107 114 128 / var(--tw-divide-opacity))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.border-0{border-width:0px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-indigo-500{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity))}.border-transparent{border-color:transparent}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}.bg-indigo-500{--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-opacity-75{--tw-bg-opacity: .75}.p-2{padding:.5rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-4{padding-bottom:1rem}.pl-3{padding-left:.75rem}.pl-4{padding-left:1rem}.pr-10{padding-right:2.5rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-0\\.5{padding-top:.125rem}.pt-5{padding-top:1.25rem}.text-left{text-align:left}.text-center{text-align:center}.align-middle{vertical-align:middle}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-6{line-height:1.5rem}.tracking-wider{letter-spacing:.05em}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity))}.text-indigo-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.opacity-50{opacity:.5}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-inset{--tw-ring-inset: inset}.ring-black{--tw-ring-opacity: 1;--tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity))}.ring-gray-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity))}.ring-opacity-5{--tw-ring-opacity: .05}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\\:border-gray-300:hover{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.hover\\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.hover\\:bg-indigo-900:hover{--tw-bg-opacity: 1;background-color:rgb(49 46 129 / var(--tw-bg-opacity))}.hover\\:bg-red-500:hover{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.hover\\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.focus\\:border-indigo-500:focus{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-indigo-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity))}.focus\\:ring-indigo-600:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(79 70 229 / var(--tw-ring-opacity))}.focus-visible\\:outline:focus-visible{outline-style:solid}.focus-visible\\:outline-2:focus-visible{outline-width:2px}.focus-visible\\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\\:outline-indigo-600:focus-visible{outline-color:#4f46e5}@media (min-width: 640px){.sm\\:col-span-2{grid-column:span 2 / span 2}.sm\\:col-span-3{grid-column:span 3 / span 3}.sm\\:col-start-1{grid-column-start:1}.sm\\:col-start-2{grid-column-start:2}.sm\\:col-start-3{grid-column-start:3}.sm\\:col-start-4{grid-column-start:4}.sm\\:row-start-1{grid-row-start:1}.sm\\:-mx-4{margin-left:-1rem;margin-right:-1rem}.sm\\:-mx-6{margin-left:-1.5rem;margin-right:-1.5rem}.sm\\:mx-0{margin-left:0;margin-right:0}.sm\\:my-8{margin-top:2rem;margin-bottom:2rem}.sm\\:ml-12{margin-left:3rem}.sm\\:ml-3{margin-left:.75rem}.sm\\:ml-4{margin-left:1rem}.sm\\:mt-0{margin-top:0}.sm\\:mt-6{margin-top:1.5rem}.sm\\:flex{display:flex}.sm\\:table-cell{display:table-cell}.sm\\:grid{display:grid}.sm\\:h-10{height:2.5rem}.sm\\:w-1\\/2{width:50%}.sm\\:w-10{width:2.5rem}.sm\\:w-3\\/5{width:60%}.sm\\:w-auto{width:auto}.sm\\:w-full{width:100%}.sm\\:max-w-lg{max-width:32rem}.sm\\:max-w-xs{max-width:20rem}.sm\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.sm\\:flex-row-reverse{flex-direction:row-reverse}.sm\\:items-start{align-items:flex-start}.sm\\:items-center{align-items:center}.sm\\:items-baseline{align-items:baseline}.sm\\:justify-center{justify-content:center}.sm\\:gap-10{gap:2.5rem}.sm\\:gap-4{gap:1rem}.sm\\:rounded-lg{border-radius:.5rem}.sm\\:p-0{padding:0}.sm\\:p-6{padding:1.5rem}.sm\\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\\:pb-4{padding-bottom:1rem}.sm\\:pr-6{padding-right:1.5rem}.sm\\:text-left{text-align:left}.sm\\:text-right{text-align:right}.sm\\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 768px){.md\\:mx-0{margin-left:0;margin-right:0}.md\\:rounded-lg{border-radius:.5rem}}@media (min-width: 1024px){.lg\\:table-cell{display:table-cell}}@media (min-width: 1280px){.xl\\:table-cell{display:table-cell}}@media (min-width: 1536px){.\\32xl\\:table-cell{display:table-cell}}\n";var en=0;function tn(e,r,n,i,o,a){r||(r={});var s,l,c=r;if("ref"in c)for(l in c={},r)"ref"==l?s=r[l]:c[l]=r[l];var d={type:e,props:c,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--en,__i:-1,__u:0,__source:o,__self:a};if("function"==typeof e&&(s=e.defaultProps))for(l in s)void 0===c[l]&&(c[l]=s[l]);return t.vnode&&t.vnode(d),d}const rn=function({tabTitles:e,currentTab:t,onChange:r}){const[n,i]=ee(t),o=ie((e=>{i(e),r(e)}),[r]);return tn("div",{class:"border-b border-gray-200",children:tn("nav",{"aria-label":"Tabs",class:"flex space-x-8 ml-2",children:e.map((e=>tn("a",{class:"cursor-pointer border-transparent text-gray-500 whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm "+(n===e?"border-b-2 border-indigo-500 text-indigo-600":"hover:text-gray-700 hover:border-gray-300 "),onClick:()=>o(e),children:e},e)))})})},nn=e=>{const[t,r]=ee(!1),n=re(),i=ie((async t=>{try{const r=e.find((e=>e.id===t));if(!r)throw new Error("Category not found");const n={title:r.title,subtitle:r.subtitle,iconUrl:r.iconUrl,enabled:!r.enabled,displayOrder:r.displayOrder,products:r.products};await Xr(t,n)}catch(n){throw new Error(`Failed to update category visibility. Error: ${Hr(n)}`)}finally{r(!1)}}),[e]),o=ie((async e=>{try{await(async e=>{if(!Gr)throw new Error("Api has not been initialized");return await Gr.post("/_admin/v1.0/categories",e)})(e)}catch(t){throw new Error(`${Hr(t)}`)}}),[]),a=ie((async(e,t)=>{try{await Xr(e,t)}catch(r){throw new Error(`${Hr(r)}`)}}),[]);return{isModalOpen:t,handleAction:ie((async e=>{switch(e.type){case"updateVisibility":n.current=e.categoryId,r(!0);break;case"updateCategory":await a(e.categoryId,e.category);break;case"createCategory":await o(e.category);break;default:console.error(`Unhandled action type: ${e}`)}}),[o,a]),handleModalConfirm:ie((async()=>{n.current&&await i(n.current)}),[i]),handleModalCancel:ie((()=>{r(!1)}),[])}};for(var on,an=[],sn=0;sn<256;++sn)an.push((sn+256).toString(16).slice(1));var ln=new Uint8Array(16);function cn(){if(!on&&!(on="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return on(ln)}const dn={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function un(e,t,r){if(dn.randomUUID&&!t&&!e)return dn.randomUUID();var n=(e=e||{}).random||(e.rng||cn)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return function(e,t=0){return(an[e[t+0]]+an[e[t+1]]+an[e[t+2]]+an[e[t+3]]+"-"+an[e[t+4]]+an[e[t+5]]+"-"+an[e[t+6]]+an[e[t+7]]+"-"+an[e[t+8]]+an[e[t+9]]+"-"+an[e[t+10]]+an[e[t+11]]+an[e[t+12]]+an[e[t+13]]+an[e[t+14]]+an[e[t+15]]).toLowerCase()}(n)}const pn=({title:e,children:t})=>tn("div",{className:"mt-2",children:[tn("div",{className:"mt-9",children:tn("h1",{className:"text-2xl font-semibold text-gray-900",children:e})}),tn("div",{className:"w-1/2",children:t})]}),mn=({FormFields:e,formData:t,isSubmitting:r,formMode:n,messages:i,categoryId:o,handleInputChange:a})=>tn(y,{children:[e.map((e=>e.display&&!e.display(o)?null:tn(y,{children:[tn("label",{className:"sm:col-start-1",children:e.label}),tn("input",{className:"sm:col-start-2 sm:col-span-3 block rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm "+("checkbox"===e.type?"w-6 h-full":""),type:e.type,name:e.name,value:(e.type,t[e.name]),checked:"checkbox"===e.type?!!t[e.name]:void 0,required:e.isRequired,onChange:a})]},e.name))),tn("div",{className:"sm:col-start-4 flex justify-end",children:tn("button",{className:"bg-indigo-500 hover:bg-indigo-900 text-white font-bold py-1 px-4 rounded focus:outline-none",type:"submit",disabled:r,children:"create"===n.mode?"Create":"Update"})}),tn("div",{className:"sm:col-start-1 sm:col-span-3 text-left",children:i.map(((e,t)=>tn("div",{className:"text-sm text-left font-semibold "+("error"===e.type?"text-red-600":"text-green-600 cursor-pointer"),children:e.text},t)))})]}),hn={title:"",subtitle:"",iconUrl:"",displayOrder:0},fn=[{name:"title",isRequired:!0,label:"Title",type:"text"},{name:"subtitle",isRequired:!0,label:"Sub Title",type:"text"},{name:"iconUrl",isRequired:!0,label:"Icon Url",type:"text"},{name:"displayOrder",isRequired:!1,label:"Display Order",type:"number"}],gn=({formMode:e,onChange:t})=>{const{isSubmitting:r,messages:n,formData:i,handleSubmit:o,handleInputChange:a}=((e,t)=>{const[r,n]=ee(!1),[i,o]=ee([]),[a,s]=ee(hn),{handleAction:l}=nn([]);te((()=>{if("update"===e.mode){const t={title:e.initialCategory.title,subtitle:e.initialCategory.subtitle,iconUrl:e.initialCategory.iconUrl,displayOrder:e.initialCategory.displayOrder};s(t)}}),[e]);const c=ie(((e,t)=>{o((r=>[...r,{text:e,type:t}]))}),[]),d=ie((()=>{s({...hn})}),[]),u=ie((()=>{let e=!0;for(const t of fn)!t.isRequired||"text"!==t.type||a[t.name]&&""!==a[t.name].toString().trim()||(c(`${t.label} is required.`,"error"),e=!1);return e}),[a,c]),p=ie((()=>{switch(e.mode){case"create":return{...a,enabled:!1,products:[{id:un(),title:a.title,description:a.subtitle,enabled:!0,iconUrl:a.iconUrl,activities:[]}]};case"update":return{...a,enabled:e.initialCategory.enabled,products:e.initialCategory.products};default:throw new Error("Invalid form mode")}}),[e,a]);return{isSubmitting:r,messages:i,formData:a,setMessages:o,handleSubmit:async r=>{if(r.preventDefault(),n(!0),o([]),!u())return void n(!1);const i=p();try{"create"===e.mode&&await l({type:"createCategory",category:i}),"update"===e.mode&&await l({type:"updateCategory",categoryId:e.initialCategory.id,category:i}),c(`Category successfully ${"create"===e.mode?"created":"updated"}.`,"success"),d(),t()}catch(a){c(`Error ${"create"===e.mode?"adding":"updating"} category: ${a}`,"error")}finally{n(!1)}},handleInputChange:e=>{const t=e.target,{name:r,value:n,type:i}=t;s((e=>({...e,[r]:"number"===i?Number(n):n})))}}})(e,t),s="create"===e.mode?"New Benefits Plan Category":"Update Benefits Plan Category";return tn(pn,{title:s,children:tn("form",{onSubmit:o,children:tn("div",{className:"sm:grid sm:grid-cols-4 sm:items-baseline sm:gap-10 mt-8",children:tn(mn,{formMode:e,FormFields:fn,formData:i,isSubmitting:r,messages:n,handleInputChange:a})})})})},bn=({disabled:e,children:t,onClick:r,...n})=>{const[i,o]=ee(!1);return tn("button",{disabled:e||i,onClick:async()=>{if(r&&!i){o(!0);try{await r()}catch(e){console.error("Error executing promise:",e)}finally{o(!1)}}},type:"submit",...n,children:t})};function yn(e,t){for(var r in e)if("__source"!==r&&!(r in t))return!0;for(var n in t)if("__source"!==n&&e[n]!==t[n])return!0;return!1}function wn(e,t){this.props=e,this.context=t}(wn.prototype=new w).isPureReactComponent=!0,wn.prototype.shouldComponentUpdate=function(e,t){return yn(this.props,e)||yn(this.state,t)};var _n=t.__b;t.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),_n&&_n(e)};var vn=t.__e;t.__e=function(e,t,r,n){if(e.then)for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return null==t.__e&&(t.__e=r.__e,t.__k=r.__k),i.__c(e,t);vn(e,t,r,n)};var xn=t.unmount;function kn(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=function(e,t){for(var r in t)e[r]=t[r];return e}({},e)).__c&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return kn(e,t,r)}))),e}function Nn(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return Nn(e,t,r)})),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function Cn(){this.__u=0,this.t=null,this.__b=null}function En(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function An(){this.u=null,this.o=null}t.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),xn&&xn(e)},(Cn.prototype=new w).__c=function(e,t){var r=t.__c,n=this;null==n.t&&(n.t=[]),n.t.push(r);var i=En(n.__v),o=!1,a=function(){o||(o=!0,r.__R=null,i?i(s):s())};r.__R=a;var s=function(){if(! --n.__u){if(n.state.__a){var e=n.state.__a;n.__v.__k[0]=Nn(e,e.__c.__P,e.__c.__O)}var t;for(n.setState({__a:n.__b=null});t=n.t.pop();)t.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(a,a)},Cn.prototype.componentWillUnmount=function(){this.t=[]},Cn.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=kn(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__a&&g(y,null,e.fallback);return i&&(i.__u&=-33),[g(y,null,t.__a?null:e.children),i]};var Sn=function(e,t,r){if(++r[1]===r[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(r=e.u;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.u=r=r[2]}};(An.prototype=new w).__a=function(e){var t=this,r=En(t.__v),n=t.o.get(e);return n[0]++,function(i){var o=function(){t.props.revealOrder?(n.push(i),Sn(t,e,n)):i()};r?r(o):o()}},An.prototype.render=function(e){this.u=null,this.o=new Map;var t=E(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var r=t.length;r--;)this.o.set(t[r],this.u=[1,0,this.u]);return e.children},An.prototype.componentDidUpdate=An.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,r){Sn(e,r,t)}))};var Tn="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,On=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Rn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Un=/[A-Z0-9]/g,Pn="undefined"!=typeof document,jn=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};w.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(w.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var Ln=t.event;function Mn(){}function In(){return this.cancelBubble}function Fn(){return this.defaultPrevented}t.event=function(e){return Ln&&(e=Ln(e)),e.persist=Mn,e.isPropagationStopped=In,e.isDefaultPrevented=Fn,e.nativeEvent=e};var Dn={enumerable:!1,configurable:!0,get:function(){return this.class}},Bn=t.vnode;t.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,r=e.type,n={};for(var i in t){var o=t[i];if(!("value"===i&&"defaultValue"in t&&null==o||Pn&&"children"===i&&"noscript"===r||"class"===i||"className"===i)){var a=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===o?o="":"translate"===a&&"no"===o?o=!1:"ondoubleclick"===a?i="ondblclick":"onchange"!==a||"input"!==r&&"textarea"!==r||jn(t.type)?"onfocus"===a?i="onfocusin":"onblur"===a?i="onfocusout":Rn.test(i)?i=a:-1===r.indexOf("-")&&On.test(i)?i=i.replace(Un,"-$&").toLowerCase():null===o&&(o=void 0):a=i="oninput","oninput"===a&&n[i=a]&&(i="oninputCapture"),n[i]=o}}"select"==r&&n.multiple&&Array.isArray(n.value)&&(n.value=E(t.children).forEach((function(e){e.props.selected=-1!=n.value.indexOf(e.props.value)}))),"select"==r&&null!=n.defaultValue&&(n.value=E(t.children).forEach((function(e){e.props.selected=n.multiple?-1!=n.defaultValue.indexOf(e.props.value):n.defaultValue==e.props.value}))),t.class&&!t.className?(n.class=t.class,Object.defineProperty(n,"className",Dn)):(t.className&&!t.class||t.class&&t.className)&&(n.class=n.className=t.className),e.props=n}(e),e.$$typeof=Tn,Bn&&Bn(e)};var zn=t.__r;t.__r=function(e){zn&&zn(e),e.__c};var Hn=t.diffed;t.diffed=function(e){Hn&&Hn(e);var t=e.props,r=e.__e;null!=r&&"textarea"===e.type&&"value"in t&&t.value!==r.value&&(r.value=null==t.value?"":t.value)};const qn=e=>g("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6",...e},g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})),Vn=({isOpen:e,heading:t,message:r,onConfirm:n,onCancel:i})=>e?tn("div",{className:"relative z-10","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",children:[tn("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"}),tn("div",{className:"fixed inset-0 z-10 w-screen overflow-y-auto",children:tn("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:tn("div",{className:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg",children:[tn("div",{className:"bg-white px-4 pb-4 pt-5 sm:p-6 sm:pb-4",children:tn("div",{className:"sm:flex sm:items-start",children:[tn("div",{className:"mx-auto flex h-10 w-12 flex-shrink-0 items-center justify-center rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10",children:tn(qn,{className:"h-6 w-6 text-red-600"})}),tn("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[tn("h1",{className:"text-base font-semibold leading-6 text-gray-900",id:"modal-title",children:t}),tn("div",{className:"mt-2",children:tn("p",{className:"text-sm text-gray-500",children:r})})]})]})}),tn("div",{className:"bg-gray-50 px-4 py-3 sm:flex sm:flex-row-reverse sm:px-6",children:[tn(bn,{onClick:n,className:"inline-flex w-full justify-center rounded-md bg-red-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-red-500 sm:ml-3 sm:w-auto cursor-pointer",children:"Confirm"}),tn("button",{className:"mt-3 inline-flex w-full justify-center rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 sm:mt-0 sm:w-auto cursor-pointer",onClick:i,children:"Cancel"})]})]})})})]}):null,$n=({headers:e,renderTableRows:t})=>tn("div",{className:"-mx-4 mt-8 sm:-mx-4",children:tn("div",{className:"inline-block min-w-full overflow-x-auto shadow border-b border-gray-200 align-middle sm:rounded-lg",children:tn("table",{className:"min-w-full divide-y divide-gray-500",children:[tn("thead",{className:"bg-gray-50",children:tn("tr",{className:"divide-x divide-gray-20",children:e.map((e=>tn("th",{scope:"col",className:e.className,children:e.name},e.name)))})}),tn("tbody",{className:"divide-y divide-gray-200 bg-white",children:t()})]})})}),Wn=({error:e,isModalOpen:t,modalHeading:r,modalTitle:n,tableHeaders:i,headingText:o,buttonText:a,filterElement:s,onCreateButton:l,onModalConfirm:c,renderTableRows:d,handleModalCancel:u})=>tn(y,{children:[tn("div",{className:"p-4 text-red-700",children:e}),!e&&tn("div",{className:"m-4",children:[tn("div",{className:"flex items-center",children:[tn("div",{className:"flex-auto",children:tn("h1",{className:"text-base font-semibold leading-6 text-gray-900",children:o})}),tn("div",{className:"ml-16 mt-0 flex-none",children:tn("button",{type:"button",className:"block rounded-md bg-indigo-500 px-3 py-2 text-center text-sm font-semibold text-white shadow-sm hover:bg-indigo-900 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600",onClick:l,children:a})})]}),s,tn($n,{headers:i,renderTableRows:d})]}),tn(Vn,{isOpen:t,heading:r,message:n,onConfirm:c,onCancel:u})]}),Jn=e=>g("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2.5,stroke:"#6366F1",className:"size-6",...e},g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"})),Kn=({onClick:e,children:t})=>tn("div",{className:"mt-4",children:tn("div",{className:"flex justify-normal",children:[tn("span",{onClick:e,children:tn(Jn,{className:"h-6 w-6 border-0 cursor-pointer"})}),tn("label",{className:"block text-sm font-bold text-gray-700 pt-0.5 ml-1",children:t})]})}),Gn=({onClick:e,children:t})=>tn(y,{children:[tn(Kn,{onClick:e,children:"Benefits Plan"}),t]}),Xn=[{name:"Id",className:"px-3 py-3.5 pl-4 text-left text-sm font-semibold text-gray-900"},{name:"Icon",className:"hidden px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:table-cell"},{name:"Title",className:"hidden px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:table-cell"},{name:"Subtitle",className:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900"},{name:"Activities",className:"hidden px-3 py-3.5 text-left text-sm font-semibold text-gray-900 lg:table-cell"},{name:"Order",className:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900"},{name:"Enabled",className:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900"},{name:"Update",className:"px-3 py-3.5 text-center text-sm font-semibold text-gray-900"},{name:"Visibility",className:"px-3 py-3.5 text-center text-sm font-semibold text-gray-900"}],Zn=e=>{const[t,r]=ee(null),[n,i]=ee({mode:"view"}),{isModalOpen:o,handleAction:a,handleModalConfirm:s,handleModalCancel:l}=nn(e.categories);return tn(y,{children:["view"===n.mode&&tn(Wn,{error:t,isModalOpen:o,modalHeading:"Warning!",modalTitle:"Are you sure you want to change the visibility of this category in the app?",tableHeaders:Xn,headingText:"Benefits Plan Categories",buttonText:"New Category",onModalConfirm:async()=>{try{await s(),e.onChange()}catch(t){r(`${t}`)}},handleModalCancel:l,renderTableRows:()=>tn(y,{children:e.categories.map((e=>{const t=e.products.reduce(((e,t)=>e+t.activities.length),0);return tn("tr",{className:"divide-x divide-gray-200",children:[tn("td",{className:"whitespace-nowrap px-3 py-4 text-sm font-medium text-gray-900",children:e.id}),tn("td",{className:"hidden whitespace-nowrap px-3 py-4 items-center justify-center sm:table-cell",children:tn("img",{src:e.iconUrl,alt:e.title,className:"h-8 w-8"})}),tn("td",{className:"hidden whitespace-nowrap px-3 py-4 text-sm text-gray-500 sm:table-cell",children:e.title}),tn("td",{className:"hidden whitespace-nowrap px-3 py-4 text-sm text-gray-500 lg:table-cell",children:e.subtitle}),tn("td",{className:"hidden whitespace-nowrap px-3 py-4 text-sm text-gray-500 lg:table-cell",children:t}),tn("td",{className:"hidden whitespace-nowrap px-3 py-4 text-sm text-gray-500 sm:table-cell",children:e.displayOrder}),tn("td",{className:"hidden whitespace-nowrap px-3 py-4 text-sm text-gray-500 sm:table-cell",children:e.enabled?"Yes":"No"}),tn("td",{className:"whitespace-nowrap px-3 py-4 sm:table-cell",children:tn("div",{className:"flex justify-center",children:tn("button",{type:"button",className:"rounded-md bg-white px-2 py-1.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50",onClick:()=>{i({mode:"update",itemId:e.id})},children:"Edit"})})}),tn("td",{className:"whitespace-nowrap px-3 py-4 sm:table-cell",children:tn("div",{className:"flex justify-center",children:tn("button",{type:"button",className:"rounded-md bg-white px-2 py-1.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50",onClick:()=>(async e=>{await a({type:"updateVisibility",categoryId:e})})(e.id),children:e.enabled?"Disable":"Enable"})})})]},e.id)}))}),onCreateButton:()=>i({mode:"create"})}),"view"!==n.mode&&tn(Gn,{onClick:()=>{i({mode:"view"})},children:tn(gn,{formMode:"create"===n.mode?{mode:"create"}:{mode:"update",initialCategory:e.categories.find((e=>e.id===n.itemId))},onChange:e.onChange})})]})},Yn=({visible:e,children:t})=>{const r=re(e);return e&&!r.current&&(r.current=!0),r.current?tn("div",{hidden:!e,children:t}):null},Qn=e=>g("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2.5,stroke:"black",height:32,width:32,...e},g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"})),ei=()=>{const[e,t]=ee(!1),[r,n]=ee([]),[i,o]=ee(!1),a=re([]),s=re(),l=ie((async e=>{t(!0),a.current=e;try{const t=await(async()=>{if(!Gr)throw new Error("Api has not been initialized");return(await Gr.get("/_admin/v1.0/activities")).data})(),r=ti(e,t);n(r)}catch(r){throw new Error(`Failed to load activities. Error: ${Hr(r)}`)}finally{t(!1)}}),[]),c=ie((async e=>{t(!0);try{const t=await(async e=>{if(!Gr)throw new Error("Api has not been initialized");return(await Gr.get(`/_admin/v1.0/activities/${e}`)).data})(e);t.enabled=!t.enabled,await Zr(e,t)}catch(r){throw new Error(`Failed to update activity visibility. Error: ${Hr(r)}`)}finally{t(!1)}}),[]);return{activities:r,isLoading:e,isModalOpen:i,loadActivities:l,handleAction:ie((async e=>{switch(e.type){case"updateVisibility":s.current=e.activityId,o(!0);break;case"updateActivity":await Zr(e.activityId,e.activity,e.selectedCategory,e.isFeaturedActivity);break;case"createActivity":await(async(e,t,r)=>{if(!Gr)throw new Error("Api has not been initialized");try{const n=await Gr.post("/_admin/v1.0/activities",e);if(t){Jr(t,n.data.id,r??!1);const e=t;await Xr(t.id,e)}}catch(n){throw new Error(`${Hr(n)}`)}})(e.activity,e.selectedCategory,e.isFeaturedActivity);break;default:console.error(`Unhandled action type: ${e}`)}}),[]),handleModalConfirm:ie((async()=>{s.current&&(await c(s.current),o(!1))}),[c]),handleModalCancel:ie((()=>{o(!1)}),[])}},ti=(e,t)=>{const r=ri(e);return t.map((e=>{var t;return{...e,category:null==(t=r.get(e.id))?void 0:t.find((()=>!0))}}))},ri=e=>{const t=ni(e),r=new Map;return t.forEach((({activity:e,categoryId:t,categoryTitle:n})=>{const i=e.id;r.has(i)||r.set(i,[]);const o=r.get(i);o.some((e=>e.id===t))||o.push({id:t,title:n,isFeatured:e.isFeatured})})),r},ni=e=>e.flatMap((e=>e.products.flatMap((t=>t.activities.map((t=>({activity:t,categoryId:e.id,categoryTitle:e.title}))))))),ii="None",oi=[{name:"title",isRequired:!0,label:"Title",type:"text"},{name:"description",isRequired:!0,label:"Sub Title",type:"text"},{name:"points",isRequired:!0,label:"Points",type:"number"},{name:"iconUrl",isRequired:!0,label:"Icon Url",type:"text"},{name:"isFeatured",isRequired:!1,label:"Is Featured",type:"checkbox",display:e=>e!==ii}],ai=[{activityType:Br.Advertisement,formFields:[{name:"bannerUrl",isRequired:!0,label:"Banner Url",type:"text"},{name:"articleId",isRequired:!0,label:"Article Id",type:"text"}]},{activityType:Br.Article,formFields:[{name:"articleId",isRequired:!0,label:"Article Id",type:"text"}]},{activityType:Br.Assessment,formFields:[{name:"bannerUrl",isRequired:!0,label:"Banner Url",type:"text"},{name:"buttonText",isRequired:!0,label:"Button Text",type:"text"},{name:"primaryLabel",isRequired:!0,label:"Primary Label",type:"text"},{name:"secondaryLabel",isRequired:!0,label:"Secondary label",type:"text"}]},{activityType:Br.Url,formFields:[{name:"url",isRequired:!0,label:"Url",type:"text"}]},{activityType:Br.Deeplink,formFields:[{name:"url",isRequired:!0,label:"Url",type:"text"}]}],si={title:"",description:"",points:0,iconUrl:"",url:"",articleId:"",bannerUrl:"",buttonText:"",primaryLabel:"",secondaryLabel:"",isFeatured:!1},li=({formMode:e,categories:t,onChange:r})=>{const[n,i]=ee(Br.Article),[o,a]=ee({id:ii,title:ii}),[s,l]=ee([]),[c,d]=ee(!1),[u,p]=ee(si),{handleAction:m}=ei(),h=ne((()=>{var e;return[...oi,...(null==(e=ai.find((e=>e.activityType===n)))?void 0:e.formFields)||[]]}),[n]),f=(e,t)=>{l((r=>[...r,{text:e,type:t}]))};te((()=>{var t,r,n;if("update"===e.mode){const o=e.initialActivity,s={title:o.title,points:o.points,description:o.description,iconUrl:o.iconUrl,url:o.url,articleId:o.articleId,bannerUrl:o.bannerUrl,buttonText:o.buttonText,primaryLabel:null==(t=o.estimateLabel)?void 0:t.primaryLabel,secondaryLabel:null==(r=o.estimateLabel)?void 0:r.secondaryLabel,isFeatured:null==(n=o.category)?void 0:n.isFeatured};p({...s}),i(o.activityType),a(o.category??{id:ii,title:ii})}}),[e]);const g=async()=>{const{url:e,articleId:r,bannerUrl:s,buttonText:l,primaryLabel:c,secondaryLabel:d,isFeatured:h}=u,g={...u,activityType:n,calculationType:Vr(n,o.title),enabled:!1,savingsInCents:0,configurationTags:Wr(o.title),tags:$r(o.title),estimateLabel:c?{primaryLabel:c,secondaryLabel:d}:void 0,url:e||void 0,articleId:r||void 0,bannerUrl:s||void 0,buttonText:l||void 0};let b;o.title!==ii&&(b=t.find((e=>e.id===o.id)));try{await m({type:"createActivity",activity:g,selectedCategory:b,isFeaturedActivity:h}),f("Activity successfully created.","success"),p({...si}),i(Br.Article),a({id:ii,title:ii})}catch(y){throw f(`Error creating activity: ${y}`,"error"),y}},b=async e=>{const{primaryLabel:r,secondaryLabel:i,isFeatured:a}=u,s={...e,...u,activityType:n,estimateLabel:r?{primaryLabel:r,secondaryLabel:i}:void 0};let l;o.title!==ii&&(l=t.find((e=>e.id===o.id)));try{await m({type:"updateActivity",activityId:e.id,activity:s,selectedCategory:l,isFeaturedActivity:a}),f("Activity successfully updated.","success")}catch(c){throw f(`Error updating activity: ${c}`,"error"),c}},y="create"===e.mode?"New Benefits Plan Activities":"Update Benefits Plan Activities";return tn(pn,{title:y,children:tn("form",{onSubmit:async t=>{if(t.preventDefault(),d(!0),l([]),(()=>{let e=!0;for(const t of h){const r=u[t.name];!t.isRequired||"text"!==t.type||r&&""!==r.toString().trim()||(f(`${t.label} is required.`,"error"),e=!1)}return e})())try{"create"===e.mode?await g():"update"===e.mode&&await b(e.initialActivity),r()}finally{d(!1)}else d(!1)},children:[tn("div",{className:"sm:grid sm:grid-cols-4 sm:items-baseline mt-8",children:[tn("label",{className:"sm:col-start-1",children:"Type"}),tn("select",{className:"sm:col-start-2 sm:col-span-2 focus:ring-indigo-500 focus:border-indigo-500 shadow-sm sm:max-w-xs border-gray-300 rounded-md",value:n,disabled:"update"===e.mode,onChange:e=>{const t=e.target;i(t.value)},children:Object.values(Br).map((e=>tn("option",{value:e,children:e},e)))})]}),tn("div",{className:"sm:grid sm:grid-cols-3 sm:items-baseline sm:gap-10 mt-8 sm:ml-12",children:[tn("label",{className:"sm:col-start-1",children:"Category"}),tn("select",{className:"sm:col-start-2 sm:col-span-3 focus:ring-indigo-500 focus:border-indigo-500 shadow-sm sm:max-w-xs border-gray-300 rounded-md",value:o.id,disabled:"update"===e.mode,onChange:e=>{const r=e.target.value;if(r===ii)a({id:ii,title:ii});else{const e=t.find((e=>e.id===r));e&&a({id:e.id,title:e.title})}},children:[tn("option",{value:ii,children:ii}),t.map((e=>tn("option",{value:e.id,children:e.title},e.id)))]}),tn(mn,{formMode:e,FormFields:h,formData:u,isSubmitting:c,messages:s,categoryId:o.id,handleInputChange:e=>{const t=e.target,{name:r,value:n,type:i}=t;p((e=>({...e,[r]:"checkbox"===i?t.checked:"number"===i?Number(n):n})))}})]})]})})},ci=[{name:"Id",className:"px-3 py-3.5 pl-4 text-left text-sm font-semibold text-gray-900"},{name:"Icon",className:"hidden px-3 py-3.5 text-left text-sm font-semibold text-gray-900 lg:table-cell"},{name:"Title",className:"hidden px-3 py-3.5 text-left text-sm font-semibold text-gray-900 lg:table-cell"},{name:"Subtitle",className:"hidden px-3 py-3.5 text-left text-sm font-semibold text-gray-900 2xl:table-cell"},{name:"Type",className:"hidden px-3 py-3.5 text-left text-sm font-semibold text-gray-900 xl:table-cell"},{name:"Points",className:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900"},{name:"Category",className:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900"},{name:"Enabled",className:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900"},{name:"Update",className:"px-3 py-3.5 text-center text-sm font-semibold text-gray-900"},{name:"Visibility",className:"px-3 py-3.5 text-center text-sm font-semibold text-gray-900"}],di="All",ui=({categories:e,onChange:t})=>{const[r,n]=ee(null),[i,o]=ee({mode:"view"}),[a,s]=ee({id:di,title:di}),[l,c]=ee([]),{isLoading:d,activities:u,isModalOpen:p,loadActivities:m,handleAction:h,handleModalConfirm:f,handleModalCancel:g}=ei();te((()=>{(async()=>{try{await m(e)}catch(t){n(`${t}`)}})()}),[e,m]),te((()=>{c(a.title===di?u:u.filter((e=>{var t;return(null==(t=e.category)?void 0:t.id)===a.id})))}),[u,a]);const b=tn("div",{className:"flex items-center space-x-2 mt-4",children:[tn(Qn,{}),tn("select",{className:"focus:ring-indigo-500 focus:border-indigo-500 shadow-sm sm:max-w-xs border-gray-300 rounded-md",value:a.id,onChange:t=>{const r=t.target.value;if(r===di)s({id:di,title:di});else{const t=e.find((e=>e.id===r));t&&s({id:t.id,title:t.title})}},children:[tn("option",{value:di,children:di}),e.map((e=>tn("option",{value:e.id,children:e.title},e.id)))]})]});return tn(y,{children:["view"===i.mode&&tn(y,{children:[d&&tn("p",{className:"p-5",children:"Loading..."}),!d&&tn(Wn,{error:r,isModalOpen:p,modalHeading:"Warning!",modalTitle:"Are you sure you want to change the visibility of this activity in the app?",tableHeaders:ci,headingText:"Benefits Plan Activities",buttonText:"New Activity",filterElement:b,onModalConfirm:async()=>{try{await f(),t()}catch(e){n(`${e}`)}},handleModalCancel:g,renderTableRows:()=>tn(y,{children:l.map((e=>{var t;return tn("tr",{className:"divide-x divide-gray-200",children:[tn("td",{className:"whitespace-nowrap px-3 py-4 text-sm font-medium text-gray-900",children:e.id}),tn("td",{className:"hidden whitespace-nowrap px-3 py-4 xl:table-cell",children:tn("span",{className:"flex justify-center",children:tn("img",{src:e.iconUrl,alt:e.title,className:"h-8 w-8"})})}),tn("td",{className:"hidden whitespace-nowrap px-3 py-4 text-sm text-gray-500 lg:table-cell",children:qr(e.title)}),tn("td",{className:"hidden whitespace-nowrap px-3 py-4 text-sm text-gray-500 2xl:table-cell",children:qr(e.description)}),tn("td",{className:"hidden whitespace-nowrap px-3 py-4 text-sm text-gray-500 xl:table-cell",children:e.activityType}),tn("td",{className:"hidden whitespace-nowrap px-3 py-4 text-sm text-gray-500 sm:table-cell",children:e.points}),tn("td",{className:"hidden whitespace-nowrap px-3 py-4 text-sm text-gray-500 sm:table-cell",children:(null==(t=e.category)?void 0:t.title)??"None"}),tn("td",{className:"hidden whitespace-nowrap px-3 py-4 text-sm text-gray-500 sm:table-cell",children:e.enabled?"Yes":"No"}),tn("td",{className:"whitespace-nowrap px-3 py-4 sm:table-cell",children:tn("div",{className:"flex justify-center",children:tn("button",{type:"button",className:"rounded-md bg-white px-2 py-1.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50",onClick:()=>{o({mode:"update",itemId:e.id})},children:"Edit"})})}),tn("td",{className:"whitespace-nowrap px-3 py-4 sm:table-cell",children:tn("div",{className:"flex justify-center",children:tn("button",{type:"button",className:"rounded-md bg-white px-2 py-1.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50",onClick:()=>h({type:"updateVisibility",activityId:e.id}),children:e.enabled?"Disable":"Enable"})})})]},e.id)}))}),onCreateButton:()=>o({mode:"create"})})]}),"view"!==i.mode&&tn(Gn,{onClick:()=>{o({mode:"view"})},children:tn(li,{categories:e,formMode:"create"===i.mode?{mode:"create"}:{mode:"update",initialActivity:u.find((e=>e.id===i.itemId))},onChange:t})})]})};var pi=(e=>(e.Categories="Categories",e.Activities="Activities",e))(pi||{});const mi=()=>{const[e,t]=ee("Categories"),[r,n]=ee([]),[i,o]=ee(!1),[a,s]=ee(null),l=ie((t=>t===e),[e]),c=ie((async()=>{o(!0),s(null);try{const e=(await(async()=>{if(!Gr)throw new Error("Api has not been initialized");return(await Gr.get("/_admin/v1.0/categories")).data})()).categories.sort(((e,t)=>e.displayOrder-t.displayOrder));n(e)}catch(e){console.error(e),s("Failed to load categories.")}finally{o(!1)}}),[]);te((()=>{c()}),[c]);const d=async()=>{await c()};return tn(y,{children:[tn(rn,{tabTitles:Object.entries(pi).map((([,e])=>e)),currentTab:e,onChange:t}),i&&tn("p",{className:"p-5",children:"Loading..."}),a&&tn("div",{className:"p-4 text-red-700",children:a}),!i&&tn(y,{children:[tn(Yn,{visible:l("Categories"),children:tn(Zn,{categories:r,onChange:d})}),tn(Yn,{visible:l("Activities"),children:tn(ui,{categories:r,onChange:d})})]})]})},hi=()=>{const[e,t]=ee([]),[r,n]=ee(!1),[i,o]=ee(""),[a,s]=ee(!1),[l,c]=ee(!1),d=re(),u=re(),p=re({searchType:jr.MobileNumber,searchValue:""}),m=ie((async(e,r)=>{let i;if(p.current={searchType:e,searchValue:r},n(!0),s(!1),o(""),e===jr.EmailAddress)i=(async e=>{if(!Fr)throw new Error("Api has not been initialized");const t=(e=>({emailAddress:e}))(e);return(await Fr.post("/_admin/v1.0/customers/emailAddress",JSON.stringify(t))).data})(r);else if(e===jr.MobileNumber)i=(async e=>{if(!Fr)throw new Error("Api has not been initialized");const t={mobileNumber:e},r=[],n=await Fr.post("/_admin/v1.0/customer/mobileNumber",JSON.stringify(t));return r.push(n.data),r})(r);else{if(e!==jr.CustomerId)return n(!1),void o("Invalid search type.");i=(async e=>{if(!Fr)throw new Error("Api has not been initialized");const t=[],r=await Fr.get(`/_admin/v1.0/customer/${e}`);return t.push(r.data),t})(r)}i.then((e=>{t(e),n(!1),e.length>0?(d.current=e[0].id,s(!0)):o("No results found!")})).catch((()=>{o("Error: Unable to Retrieve Customer Information."),n(!1)}))}),[]),h=async(e,t)=>{d.current&&await(async(e,t,r)=>{if(!Dr)throw new Error("Api has not been initialized");const n={mobileNumber:t,reason:r};await Dr.put(`/_admin/v1.0/customers/${e}/mobileNumber`,JSON.stringify(n))})(d.current,e,t)};return{searchFilter:p,searchCustomerResult:e,isLoading:r,isModalOpen:l,error:i,showCustomerDetails:a,searchCustomer:m,handleAction:async t=>{const{action:r}=t;switch(r){case"workplaceUnlink":await(async t=>{e.find((e=>e.apolloProfiles.find((e=>e.profileId===t&&e.status===Mr.Established))))&&(c(!0),u.current=t)})(t.profileId);break;case"updateMobileNumber":await h(t.mobileNumber,t.reason);break;default:console.error(`Unhandled action type: ${r}`)}},handleModalConfirm:async()=>{u.current&&(async e=>{if(!Fr)throw new Error("Api has not been initialized");await Fr.put(`/_admin/v1.0/workplace-link/${e}/unestablish`)})(u.current).then((async()=>{await(async()=>{await m(p.current.searchType,p.current.searchValue)})()})).catch((()=>{o("Error: Unable to Unlink Profile.")})).finally((()=>{c(!1)}))},handleModalCancel:async()=>{c(!1)}}},fi=()=>{const[e,t]=ee(jr.MobileNumber),[r,n]=ee(""),[i,o]=ee({emailAddress:"",mobileNumber:"",customerId:""}),a=ie((()=>{o({emailAddress:"",mobileNumber:"",customerId:""})}),[]),s=ie((e=>!!Ir(e)||(o((e=>({...e,mobileNumber:"Invalid Mobile Number!"}))),!1)),[]),l=ie(((e,t)=>{if(e.trim())return!0;const{label:r,name:n}=(e=>{const t=Lr.find((t=>jr[t.searchType]===jr[e]));return t?{name:t.name,label:t.label}:{name:"",label:""}})(t),i=`Empty ${n}`;return o((e=>({...e,[r]:i}))),!1}),[]);return{searchType:e,searchValue:r,errors:i,setSearchType:t,setSearchValue:n,clearErrors:a,isValidSearch:ie(((e,t)=>{switch(e){case jr.EmailAddress:case jr.CustomerId:return l(t,e);case jr.MobileNumber:return s(t);default:return!1}}),[l,s])}},gi=({labelText:e,name:t,type:r,value:n,pattern:i,className:o,allowedKeyPattern:a,required:s,onClick:l,onChange:c,...d})=>{const u=ie((e=>{a&&!a.test(e.key)&&e.preventDefault()}),[a]);return tn(y,{children:[e&&tn("label",{className:"block text-sm font-bold text-gray-700",children:e}),tn("input",{required:s??!1,className:`block rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm ${o}`,name:t,type:r,value:n,onKeyPress:u,pattern:i,onClick:l,onChange:c,...d})]})},bi=({message:e,className:t,onClick:r})=>tn("div",{className:t,onClick:r,children:e}),yi=e=>{const{searchType:t,searchValue:r,errors:n,setSearchType:i,setSearchValue:o,clearErrors:a,isValidSearch:s}=fi(),[l,c]=ee(!0),d=()=>{a(),c(!1)},u=e=>{const t=e.currentTarget;c(!1),o(t.value),a()};return tn(y,{children:tn("div",{className:"flex flex-col p-2",children:[tn("label",{className:"block text-sm font-bold text-gray-700",children:"Search for PBA Customer with Email Address, Mobile Number or CustomerId :"}),tn("form",{className:"w-1/3",onSubmit:n=>{n.preventDefault(),s(t,r)&&(c(!0),e.onSubmit(t,r))},children:[tn("select",{className:"mt-2 block sm:w-1/2 rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-indigo-600 text-sm leading-6",name:"searchType",id:"searchtype",value:t,onChange:e=>{a();const t=e.currentTarget.value;i(t),o("")},"data-testid":"select",children:Lr.map((e=>tn("option",{value:e.searchType,children:e.name},e.searchType)))}),tn("div",{className:"sm:flex justify-between sm:mt-6 mt-2",children:[t===jr.EmailAddress&&tn(gi,{labelText:"Email Address",name:"emailAddress",placeholder:"users@email.com",type:"text",value:r,className:"sm:w-3/5",onClick:d,onChange:u}),t===jr.MobileNumber&&tn(gi,{allowedKeyPattern:/[0-9+]/,labelText:"Mobile Number",name:"mobileNumber",placeholder:"+619999999999",type:"tel",value:r,className:"sm:w-3/5",onClick:d,onChange:u}),t===jr.CustomerId&&tn(gi,{labelText:"PBA Customer Id",name:"customerId",placeholder:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",type:"text",value:r,className:"sm:w-3/5",onClick:d,onChange:u})]}),tn("div",{className:"mt-2",children:Object.values(n).map(((e,t)=>tn(bi,{message:e,className:"text-sm text-red-600 sm:text-right"},t)))}),tn("div",{className:"sm:flex justify-end sm:mt-6",children:tn("button",{type:"submit",className:"bg-indigo-500 hover:bg-indigo-900 text-white font-bold py-1 px-4 rounded focus:outline-none "+(l?"bg-gray-400 cursor-not-allowed":""),disabled:l,children:"Search"})})]})]})})},wi=e=>g("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,...e},g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})),_i=e=>g("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,...e},g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})),vi=e=>g("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,...e},g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"})),xi=e=>g("svg",{fill:"#000000",width:"800px",height:"800px",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",...e},g("path",{d:"M304.083 405.907c4.686 4.686 4.686 12.284 0 16.971l-44.674 44.674c-59.263 59.262-155.693 59.266-214.961 0-59.264-59.265-59.264-155.696 0-214.96l44.675-44.675c4.686-4.686 12.284-4.686 16.971 0l39.598 39.598c4.686 4.686 4.686 12.284 0 16.971l-44.675 44.674c-28.072 28.073-28.072 73.75 0 101.823 28.072 28.072 73.75 28.073 101.824 0l44.674-44.674c4.686-4.686 12.284-4.686 16.971 0l39.597 39.598zm-56.568-260.216c4.686 4.686 12.284 4.686 16.971 0l44.674-44.674c28.072-28.075 73.75-28.073 101.824 0 28.072 28.073 28.072 73.75 0 101.823l-44.675 44.674c-4.686 4.686-4.686 12.284 0 16.971l39.598 39.598c4.686 4.686 12.284 4.686 16.971 0l44.675-44.675c59.265-59.265 59.265-155.695 0-214.96-59.266-59.264-155.695-59.264-214.961 0l-44.674 44.674c-4.686 4.686-4.686 12.284 0 16.971l39.597 39.598zm234.828 359.28l22.627-22.627c9.373-9.373 9.373-24.569 0-33.941L63.598 7.029c-9.373-9.373-24.569-9.373-33.941 0L7.029 29.657c-9.373 9.373-9.373 24.569 0 33.941l441.373 441.373c9.373 9.372 24.569 9.372 33.941 0z"})),ki=e=>{var t,r,n,i,o,a;const[s,l]=ee(e.data.apolloProfiles.length>0),c=e.data.apolloProfiles.length>0,d=ne((()=>e.data.apolloProfiles.slice().sort(((e,t)=>{const r=e.status.localeCompare(t.status);return 0!==r?r:e.profileId.localeCompare(t.profileId)}))),[e.data.apolloProfiles]);return tn(y,{children:[tn("tr",{className:"divide-x divide-gray-200",children:[tn("td",{className:"whitespace-nowrap px-2 text-sm",children:tn("span",{onClick:()=>{c&&l(!s)},children:[!c&&tn(vi,{className:"h-6 w-6 border-0"}),c&&tn((()=>tn(y,{children:tn(s?_i:wi,{className:"h-6 w-6 border-0 cursor-pointer"})})),{})]})}),tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:e.data.id}),tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:null==(t=e.data.name)?void 0:t.firstName}),tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:null==(r=e.data.name)?void 0:r.lastName}),tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:null==(n=e.data.email)?void 0:n.value}),tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:e.data.mobileNumber}),tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:null==(i=e.data.kyc)?void 0:i.address.countryCode}),tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:null==(o=e.data.kyc)?void 0:o.address.state}),tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:null==(a=e.data.kyc)?void 0:a.dateOfBirth.substring(0,10)}),tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:e.data.kyc?"True":"False"})]},e.key),s&&tn(y,{children:tn("tr",{className:"divide-x divide-gray-200",children:tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",colspan:10,children:[tn("label",{className:"block text-sm font-bold text-gray-700",children:"Apollo Profiles"}),tn("div",{className:"-mx-4 mt-4 overflow-hidden shadow ring-1 ring-black ring-opacity-5 sm:-mx-6 md:mx-0 md:rounded-lg",children:tn("table",{className:"min-w-full divide-y divide-gray-500",children:[tn("thead",{className:"bg-gray-50",children:tn("tr",{className:"divide-x divide-gray-200",children:[tn("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 uppercase tracking-wider",children:"Profile ID"}),tn("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 uppercase tracking-wider",children:"Account ID"}),tn("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 uppercase tracking-wider",children:"Status"}),tn("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 uppercase tracking-wider",children:"Account Name"}),tn("th",{className:"relative py-3.5 pl-3 pr-4 sm:pr-6",children:tn("span",{className:"sr-only",children:"Action"})})]})}),tn("tbody",{className:"divide-y divide-gray-200 bg-white",children:d.map(((t,r)=>tn("tr",{className:"divide-x divide-gray-200",children:[tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:t.profileId}),tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:t.accountId}),tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:t.status}),tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:t.accountName}),tn("td",{className:"text-gray-500 px-6 py-4 whitespace-nowrap text-sm",children:[tn("span",{onClick:()=>e.onAction({action:"workplaceUnlink",profileId:t.profileId}),children:tn(xi,{className:"h-6 w-6 border-0 "+(t.status===Mr.Established?"cursor-pointer":"cursor-not-allowed opacity-50")})})," "]})]},r)))})]})})]})})})]})},Ni=e=>tn("div",{className:"-mx-4 mt-8 sm:-mx-4",children:tn("div",{className:"inline-block min-w-full overflow-x-auto shadow border-b border-gray-200 align-middle sm:rounded-lg",children:tn("table",{className:"min-w-full divide-y divide-gray-500",children:[tn("thead",{className:"bg-gray-50",children:tn("tr",{className:"divide-x divide-gray-200",children:[tn("th",{className:"relative py-3.5 pl-3 pr-4 sm:pr-6",children:tn("span",{className:"sr-only",children:"Action"})}),tn("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 uppercase tracking-wider",children:"Customer ID"}),tn("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 uppercase tracking-wider",children:"First Name"}),tn("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 uppercase tracking-wider",children:"Last Name"}),tn("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 uppercase tracking-wider",children:"Email"}),tn("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 uppercase tracking-wider",children:"Mobile"}),tn("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 uppercase tracking-wider",children:"Country Code"}),tn("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 uppercase tracking-wider",children:"State"}),tn("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 uppercase tracking-wider",children:"DOB"}),tn("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 uppercase tracking-wider",children:"KYC Check"})]})}),tn("tbody",{className:"divide-y divide-gray-200 bg-white",children:e.data.map(((t,r)=>tn(ki,{title:"Apollo Profiles",data:t,onAction:e.onAction},r)))})]})})}),Ci=e=>{const{mobileNumber:t,reason:r,isCustomerIdentityVerified:n,messages:i,isSubmitting:o,setMobileNumber:a,setReason:s,setIsVerifiedCustomerIdentity:l,clearMessages:c,handleSubmit:d}=(e=>{const[t,r]=ee(""),[n,i]=ee(!1),[o,a]=ee(""),[s,l]=ee([]),[c,d]=ee(!1),u=ie((()=>{l([])}),[]),p=ie((()=>{i(!1),a("")}),[]),m=ie(((e,t)=>{l((r=>[...r,{text:e,type:t}]))}),[]),h=ie((()=>!!Ir(t)||(m("Invalid Mobile Number!","error"),!1)),[t,m]),f=ie((()=>!!o.trim()||(m("Reason cannot be empty.","error"),!1)),[o,m]),g=ie((e=>{var t,r;if(e instanceof wr){const n=(null==(r=null==(t=e.response)?void 0:t.data)?void 0:r.message)||"Failed to update mobile number.";m(n,"error")}else m("An unexpected error occurred.","error")}),[m]),b=ie((async()=>{if(u(),h()&&f()&&n){d(!0);try{await e({action:"updateMobileNumber",mobileNumber:t,reason:o}),m("Mobile Number Updated.","success"),p()}catch(r){g(r)}finally{d(!1)}}}),[n,t,o,m,p,u,g,h,f,e]);return{mobileNumber:t,reason:o,isCustomerIdentityVerified:n,messages:s,isSubmitting:c,setIsSubmitting:d,setMobileNumber:r,setReason:a,setIsVerifiedCustomerIdentity:i,clearMessages:u,handleSubmit:b}})(e.onSubmit);return tn(y,{children:tn("div",{className:"flex flex-row",children:tn("div",{className:"w-3/4 mt-9 ml-4",children:tn("form",{onSubmit:async e=>{e.preventDefault(),await d()},children:[tn("label",{className:"block text-sm font-bold text-gray-700",children:"Update Mobile Number:"}),tn("div",{className:"sm:grid sm:grid-cols-6 sm:items-baseline sm:gap-4 mt-4",children:[tn("label",{className:"col-start-1 block text-sm font-bold text-gray-700",children:"New Mobile Number"}),tn("div",{className:"sm:col-start-2",children:tn(gi,{allowedKeyPattern:/[0-9+]/,name:"newMobileNumber",placeholder:"",type:"tel",value:t,className:"w-full",onClick:c,pattern:"[0-9+]*",onChange:e=>{const t=e.currentTarget;a(t.value),c()}})}),tn("div",{className:"col-start-4 col-span-3 row-span-3 flex-col text-left",children:i.map(((e,t)=>tn(bi,{message:e.text,className:"text-sm text-left font-semibold "+("error"===e.type?"text-red-600":"text-green-600")},t)))}),tn("div",{className:"col-start-2 col-span-2 relative flex items-start",children:[tn("div",{className:"flex h-6 items-center",children:tn("input",{id:"verifiedCheckbox","aria-describedby":"verified-customer-identity",name:"verifiedCheckbox",type:"checkbox",checked:n,onChange:e=>{const t=e.currentTarget;l(t.checked),c()},className:"h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600",required:!0})}),tn("div",{className:"ml-2 text-sm leading-6",children:tn("label",{className:"font-medium text-gray-900",children:"Verified Customer Identity"})})]}),tn("div",{className:"col-start-2",children:tn(gi,{name:"reason",placeholder:"Zendesk Ticket ID",type:"text",value:r,className:"w-full",onClick:c,onChange:e=>{const t=e.currentTarget;s(t.value),c()}})}),tn("div",{className:"sm:row-start-1 sm:col-start-3 sm:flex sm:justify-center sm:mt-0 mt-2",children:tn("button",{type:"submit",className:"bg-indigo-500 hover:bg-indigo-900 text-white font-bold py-1 px-4 rounded focus:outline-none",disabled:o,children:"Update"})})]})]})})})})},Ei=()=>{const{searchCustomerResult:e,isLoading:t,error:r,showCustomerDetails:n,isModalOpen:i,searchFilter:o,searchCustomer:a,handleAction:s,handleModalConfirm:l,handleModalCancel:c}=hi();return tn(y,{children:[tn(yi,{onSubmit:a}),t&&tn("p",{children:"Loading..."}),tn("div",{className:"p-4 mt-2 text-red-700",children:r}),!t&&n&&tn(y,{children:[tn(Ni,{data:e,onAction:s}),o.current.searchType!==jr.EmailAddress&&tn(Ci,{onSubmit:s})]}),tn(Vn,{isOpen:i,heading:"Warning",message:"Are you sure you want to remove workplace access?",onConfirm:l,onCancel:c})]})};var Ai=(e=>(e.Search="Search",e.BenefitsPlan="Benefits Plan",e))(Ai||{});function Si(){return(Si=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var Ti=["context","children"];function Oi(e){return this.getChildContext=function(){return e.context},F(e.children,function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)t.indexOf(r=o[n])>=0||(i[r]=e[r]);return i}(e,Ti))}function Ri(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=g(Oi,Si({},this._props,{context:e.detail.context}),function e(t,r){if(3===t.nodeType)return t.data;if(1!==t.nodeType)return null;var n=[],i={},o=0,a=t.attributes,s=t.childNodes;for(o=a.length;o--;)"slot"!==a[o].name&&(i[a[o].name]=a[o].value,i[Ui(a[o].name)]=a[o].value);for(o=s.length;o--;){var l=e(s[o],null),c=s[o].slot;c?i[c]=g(Li,{name:c},l):n[o]=l}var d=r?g(Li,null,n):n;return g(r||t.nodeName.toLowerCase(),i,d)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?I:M)(this._vdom,this._root)}function Ui(e){return e.replace(/-(\w)/g,(function(e,t){return t?t.toUpperCase():""}))}function Pi(e,t,r){if(this._vdom){var n={};n[e]=r=null==r?void 0:r,n[Ui(e)]=r,this._vdom=F(this._vdom,n),M(this._vdom,this._root)}}function ji(){M(this._vdom=null,this._root)}function Li(e,t){var r=this;return g("slot",Si({},e,{ref:function(e){e?(r.ref=e,r._listener||(r._listener=function(e){e.stopPropagation(),e.detail.context=t},e.addEventListener("_preact",r._listener))):r.ref.removeEventListener("_preact",r._listener)}}))}!function(e,t,r,n){function i(){var t=Reflect.construct(HTMLElement,[],i);return t._vdomComponent=e,t._root=n&&n.shadow?t.attachShadow({mode:n.mode||"open"}):t,t}(i.prototype=Object.create(HTMLElement.prototype)).constructor=i,i.prototype.connectedCallback=Ri,i.prototype.attributeChangedCallback=Pi,i.prototype.disconnectedCallback=ji,r=r||e.observedAttributes||Object.keys(e.propTypes||{}),i.observedAttributes=r,r.forEach((function(e){Object.defineProperty(i.prototype,e,{get:function(){return this._vdom.props[e]},set:function(t){this._vdom?this.attributeChangedCallback(e,null,t):(this._props||(this._props={}),this._props[e]=t,this.connectedCallback());var r=typeof t;null!=t&&"string"!==r&&"boolean"!==r&&"number"!==r||this.setAttribute(e,t)}})})),customElements.define(t||e.tagName||e.displayName||e.name,i)}((e=>{const t={backendUrl:e["backend-url"],accessToken:e["access-token"]};Yr(t.backendUrl,t.accessToken);const[r,n]=ee("Search"),i=ie((e=>e===r),[r]);return tn(y,{children:[tn("style",{children:Qr.toString()}),tn(rn,{tabTitles:Object.entries(Ai).map((([,e])=>e)),currentTab:r,onChange:n}),tn(Yn,{visible:i("Search"),children:tn(Ei,{})}),tn(Yn,{visible:i("Benefits Plan"),children:tn(mi,{})})]})}),"superhero-pba-support-admin",["backend-url","access-token"]);
|