randmarcomps 1.162.0 → 1.164.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/randmarcomps.d.ts +5 -3
- package/dist/randmarcomps.js +123 -81
- package/dist/randmarcomps.umd.cjs +8 -3
- package/package.json +1 -1
|
@@ -42,6 +42,11 @@
|
|
|
42
42
|
*
|
|
43
43
|
* This source code is licensed under the ISC license.
|
|
44
44
|
* See the LICENSE file in the root directory of this source tree.
|
|
45
|
+
*/const __iconNode$I=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],BadgeCheck=createLucideIcon("BadgeCheck",__iconNode$I);/**
|
|
46
|
+
* @license lucide-react v0.479.0 - ISC
|
|
47
|
+
*
|
|
48
|
+
* This source code is licensed under the ISC license.
|
|
49
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
45
50
|
*/const __iconNode$H=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Bot=createLucideIcon("Bot",__iconNode$H);/**
|
|
46
51
|
* @license lucide-react v0.479.0 - ISC
|
|
47
52
|
*
|
|
@@ -395,7 +400,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
395
400
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$2(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray$2(e,t)}}function _arrayLikeToArray$2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function _iterableToArrayLimit$1(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o,l,u,p,d=[],f=!0,m=!1;try{if(u=(n=n.call(e)).next,t!==0)for(;!(f=(o=u.call(n)).done)&&(d.push(o.value),d.length!==t);f=!0);}catch(g){m=!0,l=g}finally{try{if(!f&&n.return!=null&&(p=n.return(),Object(p)!==p))return}finally{if(m)throw l}}return d}}function _arrayWithHoles$1(e){if(Array.isArray(e))return e}function _extends$8(){return _extends$8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},_extends$8.apply(this,arguments)}var renderLine=function(t,n){var o;return React.isValidElement(t)?o=React.cloneElement(t,n):isFunction$1(t)?o=t(n):o=React.createElement("line",_extends$8({},n,{className:"recharts-reference-line-line"})),o},getEndPoints=function(t,n,o,l,u,p,d,f,m){var g=u.x,b=u.y,_=u.width,S=u.height;if(o){var E=m.y,C=t.y.apply(E,{position:p});if(ifOverflowMatches(m,"discard")&&!t.y.isInRange(C))return null;var R=[{x:g+_,y:C},{x:g,y:C}];return f==="left"?R.reverse():R}if(n){var A=m.x,N=t.x.apply(A,{position:p});if(ifOverflowMatches(m,"discard")&&!t.x.isInRange(N))return null;var O=[{x:N,y:b+S},{x:N,y:b}];return d==="top"?O.reverse():O}if(l){var V=m.segment,M=V.map(function(I){return t.apply(I,{position:p})});return ifOverflowMatches(m,"discard")&&some(M,function(I){return!t.isInRange(I)})?null:M}return null};function ReferenceLineImpl(e){var t=e.x,n=e.y,o=e.segment,l=e.xAxisId,u=e.yAxisId,p=e.shape,d=e.className,f=e.alwaysShow,m=useClipPathId(),g=useXAxisOrThrow(l),b=useYAxisOrThrow(u),_=useViewBox();if(!m||!_)return null;warn$1(f===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var S=createLabeledScales({x:g.scale,y:b.scale}),E=isNumOrStr(t),C=isNumOrStr(n),R=o&&o.length===2,A=getEndPoints(S,E,C,R,_,e.position,g.orientation,b.orientation,e);if(!A)return null;var N=_slicedToArray$1(A,2),O=N[0],V=O.x,M=O.y,I=N[1],j=I.x,B=I.y,L=ifOverflowMatches(e,"hidden")?"url(#".concat(m,")"):void 0,q=_objectSpread$8(_objectSpread$8({clipPath:L},filterProps(e,!0)),{},{x1:V,y1:M,x2:j,y2:B});return React.createElement(Layer,{className:clsx("recharts-reference-line",d)},renderLine(p,q),Label$1.renderCallByParent(e,rectWithCoords({x1:V,y1:M,x2:j,y2:B})))}var ReferenceLine=function(e){function t(){return _classCallCheck$8(this,t),_callSuper$7(this,t,arguments)}return _inherits$7(t,e),_createClass$8(t,[{key:"render",value:function(){return React.createElement(ReferenceLineImpl,this.props)}}])}(React.Component);_defineProperty$b(ReferenceLine,"displayName","ReferenceLine"),_defineProperty$b(ReferenceLine,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function _extends$7(){return _extends$7=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},_extends$7.apply(this,arguments)}function _typeof$a(e){"@babel/helpers - typeof";return _typeof$a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof$a(e)}function ownKeys$7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,o)}return n}function _objectSpread$7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ownKeys$7(Object(n),!0).forEach(function(o){_defineProperty$a(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$7(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function _classCallCheck$7(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$7(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey$a(o.key),o)}}function _createClass$7(e,t,n){return t&&_defineProperties$7(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _callSuper$6(e,t,n){return t=_getPrototypeOf$6(t),_possibleConstructorReturn$6(e,_isNativeReflectConstruct$6()?Reflect.construct(t,n||[],_getPrototypeOf$6(e).constructor):t.apply(e,n))}function _possibleConstructorReturn$6(e,t){if(t&&(_typeof$a(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$6(e)}function _assertThisInitialized$6(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct$6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_isNativeReflectConstruct$6=function(){return!!e})()}function _getPrototypeOf$6(e){return _getPrototypeOf$6=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_getPrototypeOf$6(e)}function _inherits$6(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf$6(e,t)}function _setPrototypeOf$6(e,t){return _setPrototypeOf$6=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,l){return o.__proto__=l,o},_setPrototypeOf$6(e,t)}function _defineProperty$a(e,t,n){return t=_toPropertyKey$a(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey$a(e){var t=_toPrimitive$a(e,"string");return _typeof$a(t)=="symbol"?t:t+""}function _toPrimitive$a(e,t){if(_typeof$a(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(_typeof$a(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var getCoordinate=function(t){var n=t.x,o=t.y,l=t.xAxis,u=t.yAxis,p=createLabeledScales({x:l.scale,y:u.scale}),d=p.apply({x:n,y:o},{bandAware:!0});return ifOverflowMatches(t,"discard")&&!p.isInRange(d)?null:d},ReferenceDot=function(e){function t(){return _classCallCheck$7(this,t),_callSuper$6(this,t,arguments)}return _inherits$6(t,e),_createClass$7(t,[{key:"render",value:function(){var o=this.props,l=o.x,u=o.y,p=o.r,d=o.alwaysShow,f=o.clipPathId,m=isNumOrStr(l),g=isNumOrStr(u);if(warn$1(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!m||!g)return null;var b=getCoordinate(this.props);if(!b)return null;var _=b.x,S=b.y,E=this.props,C=E.shape,R=E.className,A=ifOverflowMatches(this.props,"hidden")?"url(#".concat(f,")"):void 0,N=_objectSpread$7(_objectSpread$7({clipPath:A},filterProps(this.props,!0)),{},{cx:_,cy:S});return React.createElement(Layer,{className:clsx("recharts-reference-dot",R)},t.renderDot(C,N),Label$1.renderCallByParent(this.props,{x:_-p,y:S-p,width:2*p,height:2*p}))}}])}(React.Component);_defineProperty$a(ReferenceDot,"displayName","ReferenceDot"),_defineProperty$a(ReferenceDot,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1}),_defineProperty$a(ReferenceDot,"renderDot",function(e,t){var n;return React.isValidElement(e)?n=React.cloneElement(e,t):isFunction$1(e)?n=e(t):n=React.createElement(Dot,_extends$7({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function _extends$6(){return _extends$6=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},_extends$6.apply(this,arguments)}function _typeof$9(e){"@babel/helpers - typeof";return _typeof$9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof$9(e)}function ownKeys$6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,o)}return n}function _objectSpread$6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ownKeys$6(Object(n),!0).forEach(function(o){_defineProperty$9(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$6(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function _classCallCheck$6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$6(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey$9(o.key),o)}}function _createClass$6(e,t,n){return t&&_defineProperties$6(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _callSuper$5(e,t,n){return t=_getPrototypeOf$5(t),_possibleConstructorReturn$5(e,_isNativeReflectConstruct$5()?Reflect.construct(t,n||[],_getPrototypeOf$5(e).constructor):t.apply(e,n))}function _possibleConstructorReturn$5(e,t){if(t&&(_typeof$9(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$5(e)}function _assertThisInitialized$5(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct$5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_isNativeReflectConstruct$5=function(){return!!e})()}function _getPrototypeOf$5(e){return _getPrototypeOf$5=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_getPrototypeOf$5(e)}function _inherits$5(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf$5(e,t)}function _setPrototypeOf$5(e,t){return _setPrototypeOf$5=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,l){return o.__proto__=l,o},_setPrototypeOf$5(e,t)}function _defineProperty$9(e,t,n){return t=_toPropertyKey$9(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey$9(e){var t=_toPrimitive$9(e,"string");return _typeof$9(t)=="symbol"?t:t+""}function _toPrimitive$9(e,t){if(_typeof$9(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(_typeof$9(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var getRect=function(t,n,o,l,u){var p=u.x1,d=u.x2,f=u.y1,m=u.y2,g=u.xAxis,b=u.yAxis;if(!g||!b)return null;var _=createLabeledScales({x:g.scale,y:b.scale}),S={x:t?_.x.apply(p,{position:"start"}):_.x.rangeMin,y:o?_.y.apply(f,{position:"start"}):_.y.rangeMin},E={x:n?_.x.apply(d,{position:"end"}):_.x.rangeMax,y:l?_.y.apply(m,{position:"end"}):_.y.rangeMax};return ifOverflowMatches(u,"discard")&&(!_.isInRange(S)||!_.isInRange(E))?null:rectWithPoints(S,E)},ReferenceArea=function(e){function t(){return _classCallCheck$6(this,t),_callSuper$5(this,t,arguments)}return _inherits$5(t,e),_createClass$6(t,[{key:"render",value:function(){var o=this.props,l=o.x1,u=o.x2,p=o.y1,d=o.y2,f=o.className,m=o.alwaysShow,g=o.clipPathId;warn$1(m===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var b=isNumOrStr(l),_=isNumOrStr(u),S=isNumOrStr(p),E=isNumOrStr(d),C=this.props.shape;if(!b&&!_&&!S&&!E&&!C)return null;var R=getRect(b,_,S,E,this.props);if(!R&&!C)return null;var A=ifOverflowMatches(this.props,"hidden")?"url(#".concat(g,")"):void 0;return React.createElement(Layer,{className:clsx("recharts-reference-area",f)},t.renderRect(C,_objectSpread$6(_objectSpread$6({clipPath:A},filterProps(this.props,!0)),R)),Label$1.renderCallByParent(this.props,R))}}])}(React.Component);_defineProperty$9(ReferenceArea,"displayName","ReferenceArea"),_defineProperty$9(ReferenceArea,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1}),_defineProperty$9(ReferenceArea,"renderRect",function(e,t){var n;return React.isValidElement(e)?n=React.cloneElement(e,t):isFunction$1(e)?n=e(t):n=React.createElement(Rectangle,_extends$6({},t,{className:"recharts-reference-area-rect"})),n});function getEveryNthWithCondition(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var o=[],l=0;l<e.length;l+=t)o.push(e[l]);return o}function getAngledTickWidth(e,t,n){var o={width:e.width+t.width,height:e.height+t.height};return getAngledRectangleWidth(o,n)}function getTickBoundaries(e,t,n){var o=n==="width",l=e.x,u=e.y,p=e.width,d=e.height;return t===1?{start:o?l:u,end:o?l+p:u+d}:{start:o?l+p:u+d,end:o?l:u}}function isVisible(e,t,n,o,l){if(e*t<e*o||e*t>e*l)return!1;var u=n();return e*(t-e*u/2-o)>=0&&e*(t+e*u/2-l)<=0}function getNumberIntervalTicks(e,t){return getEveryNthWithCondition(e,t+1)}function getEquidistantTicks(e,t,n,o,l){for(var u=(o||[]).slice(),p=t.start,d=t.end,f=0,m=1,g=p,b=function(){var E=o==null?void 0:o[f];if(E===void 0)return{v:getEveryNthWithCondition(o,m)};var C=f,R,A=function(){return R===void 0&&(R=n(E,C)),R},N=E.coordinate,O=f===0||isVisible(e,N,A,g,d);O||(f=0,g=p,m+=1),O&&(g=N+e*(A()/2+l),f+=m)},_;m<=u.length;)if(_=b(),_)return _.v;return[]}function _typeof$8(e){"@babel/helpers - typeof";return _typeof$8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof$8(e)}function ownKeys$5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,o)}return n}function _objectSpread$5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ownKeys$5(Object(n),!0).forEach(function(o){_defineProperty$8(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$5(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function _defineProperty$8(e,t,n){return t=_toPropertyKey$8(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey$8(e){var t=_toPrimitive$8(e,"string");return _typeof$8(t)=="symbol"?t:t+""}function _toPrimitive$8(e,t){if(_typeof$8(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(_typeof$8(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function getTicksEnd(e,t,n,o,l){for(var u=(o||[]).slice(),p=u.length,d=t.start,f=t.end,m=function(_){var S=u[_],E,C=function(){return E===void 0&&(E=n(S,_)),E};if(_===p-1){var R=e*(S.coordinate+e*C()/2-f);u[_]=S=_objectSpread$5(_objectSpread$5({},S),{},{tickCoord:R>0?S.coordinate-R*e:S.coordinate})}else u[_]=S=_objectSpread$5(_objectSpread$5({},S),{},{tickCoord:S.coordinate});var A=isVisible(e,S.tickCoord,C,d,f);A&&(f=S.tickCoord-e*(C()/2+l),u[_]=_objectSpread$5(_objectSpread$5({},S),{},{isShow:!0}))},g=p-1;g>=0;g--)m(g);return u}function getTicksStart(e,t,n,o,l,u){var p=(o||[]).slice(),d=p.length,f=t.start,m=t.end;if(u){var g=o[d-1],b=n(g,d-1),_=e*(g.coordinate+e*b/2-m);p[d-1]=g=_objectSpread$5(_objectSpread$5({},g),{},{tickCoord:_>0?g.coordinate-_*e:g.coordinate});var S=isVisible(e,g.tickCoord,function(){return b},f,m);S&&(m=g.tickCoord-e*(b/2+l),p[d-1]=_objectSpread$5(_objectSpread$5({},g),{},{isShow:!0}))}for(var E=u?d-1:d,C=function(N){var O=p[N],V,M=function(){return V===void 0&&(V=n(O,N)),V};if(N===0){var I=e*(O.coordinate-e*M()/2-f);p[N]=O=_objectSpread$5(_objectSpread$5({},O),{},{tickCoord:I<0?O.coordinate-I*e:O.coordinate})}else p[N]=O=_objectSpread$5(_objectSpread$5({},O),{},{tickCoord:O.coordinate});var j=isVisible(e,O.tickCoord,M,f,m);j&&(f=O.tickCoord+e*(M()/2+l),p[N]=_objectSpread$5(_objectSpread$5({},O),{},{isShow:!0}))},R=0;R<E;R++)C(R);return p}function getTicks(e,t,n){var o=e.tick,l=e.ticks,u=e.viewBox,p=e.minTickGap,d=e.orientation,f=e.interval,m=e.tickFormatter,g=e.unit,b=e.angle;if(!l||!l.length||!o)return[];if(isNumber(f)||Global.isSsr)return getNumberIntervalTicks(l,typeof f=="number"&&isNumber(f)?f:0);var _=[],S=d==="top"||d==="bottom"?"width":"height",E=g&&S==="width"?getStringSize(g,{fontSize:t,letterSpacing:n}):{width:0,height:0},C=function(O,V){var M=isFunction$1(m)?m(O.value,V):O.value;return S==="width"?getAngledTickWidth(getStringSize(M,{fontSize:t,letterSpacing:n}),E,b):getStringSize(M,{fontSize:t,letterSpacing:n})[S]},R=l.length>=2?mathSign(l[1].coordinate-l[0].coordinate):1,A=getTickBoundaries(u,R,S);return f==="equidistantPreserveStart"?getEquidistantTicks(R,A,C,l,p):(f==="preserveStart"||f==="preserveStartEnd"?_=getTicksStart(R,A,C,l,p,f==="preserveStartEnd"):_=getTicksEnd(R,A,C,l,p),_.filter(function(N){return N.isShow}))}var _excluded$3=["viewBox"],_excluded2$3=["viewBox"],_excluded3=["ticks"];function _typeof$7(e){"@babel/helpers - typeof";return _typeof$7=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof$7(e)}function _extends$5(){return _extends$5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},_extends$5.apply(this,arguments)}function ownKeys$4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,o)}return n}function _objectSpread$4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ownKeys$4(Object(n),!0).forEach(function(o){_defineProperty$7(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$4(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function _objectWithoutProperties$3(e,t){if(e==null)return{};var n=_objectWithoutPropertiesLoose$3(e,t),o,l;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(l=0;l<u.length;l++)o=u[l],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function _objectWithoutPropertiesLoose$3(e,t){if(e==null)return{};var n={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(t.indexOf(o)>=0)continue;n[o]=e[o]}return n}function _classCallCheck$5(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$5(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey$7(o.key),o)}}function _createClass$5(e,t,n){return t&&_defineProperties$5(e.prototype,t),n&&_defineProperties$5(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _callSuper$4(e,t,n){return t=_getPrototypeOf$4(t),_possibleConstructorReturn$4(e,_isNativeReflectConstruct$4()?Reflect.construct(t,n||[],_getPrototypeOf$4(e).constructor):t.apply(e,n))}function _possibleConstructorReturn$4(e,t){if(t&&(_typeof$7(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$4(e)}function _assertThisInitialized$4(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct$4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_isNativeReflectConstruct$4=function(){return!!e})()}function _getPrototypeOf$4(e){return _getPrototypeOf$4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_getPrototypeOf$4(e)}function _inherits$4(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf$4(e,t)}function _setPrototypeOf$4(e,t){return _setPrototypeOf$4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,l){return o.__proto__=l,o},_setPrototypeOf$4(e,t)}function _defineProperty$7(e,t,n){return t=_toPropertyKey$7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey$7(e){var t=_toPrimitive$7(e,"string");return _typeof$7(t)=="symbol"?t:t+""}function _toPrimitive$7(e,t){if(_typeof$7(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(_typeof$7(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var CartesianAxis=function(e){function t(n){var o;return _classCallCheck$5(this,t),o=_callSuper$4(this,t,[n]),o.state={fontSize:"",letterSpacing:""},o}return _inherits$4(t,e),_createClass$5(t,[{key:"shouldComponentUpdate",value:function(o,l){var u=o.viewBox,p=_objectWithoutProperties$3(o,_excluded$3),d=this.props,f=d.viewBox,m=_objectWithoutProperties$3(d,_excluded2$3);return!shallowEqual$1(u,f)||!shallowEqual$1(p,m)||!shallowEqual$1(l,this.state)}},{key:"componentDidMount",value:function(){var o=this.layerReference;if(o){var l=o.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];l&&this.setState({fontSize:window.getComputedStyle(l).fontSize,letterSpacing:window.getComputedStyle(l).letterSpacing})}}},{key:"getTickLineCoord",value:function(o){var l=this.props,u=l.x,p=l.y,d=l.width,f=l.height,m=l.orientation,g=l.tickSize,b=l.mirror,_=l.tickMargin,S,E,C,R,A,N,O=b?-1:1,V=o.tickSize||g,M=isNumber(o.tickCoord)?o.tickCoord:o.coordinate;switch(m){case"top":S=E=o.coordinate,R=p+ +!b*f,C=R-O*V,N=C-O*_,A=M;break;case"left":C=R=o.coordinate,E=u+ +!b*d,S=E-O*V,A=S-O*_,N=M;break;case"right":C=R=o.coordinate,E=u+ +b*d,S=E+O*V,A=S+O*_,N=M;break;default:S=E=o.coordinate,R=p+ +b*f,C=R+O*V,N=C+O*_,A=M;break}return{line:{x1:S,y1:C,x2:E,y2:R},tick:{x:A,y:N}}}},{key:"getTickTextAnchor",value:function(){var o=this.props,l=o.orientation,u=o.mirror,p;switch(l){case"left":p=u?"start":"end";break;case"right":p=u?"end":"start";break;default:p="middle";break}return p}},{key:"getTickVerticalAnchor",value:function(){var o=this.props,l=o.orientation,u=o.mirror,p="end";switch(l){case"left":case"right":p="middle";break;case"top":p=u?"start":"end";break;default:p=u?"end":"start";break}return p}},{key:"renderAxisLine",value:function(){var o=this.props,l=o.x,u=o.y,p=o.width,d=o.height,f=o.orientation,m=o.mirror,g=o.axisLine,b=_objectSpread$4(_objectSpread$4(_objectSpread$4({},filterProps(this.props,!1)),filterProps(g,!1)),{},{fill:"none"});if(f==="top"||f==="bottom"){var _=+(f==="top"&&!m||f==="bottom"&&m);b=_objectSpread$4(_objectSpread$4({},b),{},{x1:l,y1:u+_*d,x2:l+p,y2:u+_*d})}else{var S=+(f==="left"&&!m||f==="right"&&m);b=_objectSpread$4(_objectSpread$4({},b),{},{x1:l+S*p,y1:u,x2:l+S*p,y2:u+d})}return React.createElement("line",_extends$5({},b,{className:clsx("recharts-cartesian-axis-line",get$1(g,"className"))}))}},{key:"renderTicks",value:function(o,l,u){var p=this,d=this.props,f=d.tickLine,m=d.stroke,g=d.tick,b=d.tickFormatter,_=d.unit,S=getTicks(_objectSpread$4(_objectSpread$4({},this.props),{},{ticks:o}),l,u),E=this.getTickTextAnchor(),C=this.getTickVerticalAnchor(),R=filterProps(this.props,!1),A=filterProps(g,!1),N=_objectSpread$4(_objectSpread$4({},R),{},{fill:"none"},filterProps(f,!1)),O=S.map(function(V,M){var I=p.getTickLineCoord(V),j=I.line,B=I.tick,L=_objectSpread$4(_objectSpread$4(_objectSpread$4(_objectSpread$4({textAnchor:E,verticalAnchor:C},R),{},{stroke:"none",fill:m},A),B),{},{index:M,payload:V,visibleTicksCount:S.length,tickFormatter:b});return React.createElement(Layer,_extends$5({className:"recharts-cartesian-axis-tick",key:"tick-".concat(V.value,"-").concat(V.coordinate,"-").concat(V.tickCoord)},adaptEventsOfChild(p.props,V,M)),f&&React.createElement("line",_extends$5({},N,j,{className:clsx("recharts-cartesian-axis-tick-line",get$1(f,"className"))})),g&&t.renderTickItem(g,L,"".concat(isFunction$1(b)?b(V.value,M):V.value).concat(_||"")))});return React.createElement("g",{className:"recharts-cartesian-axis-ticks"},O)}},{key:"render",value:function(){var o=this,l=this.props,u=l.axisLine,p=l.width,d=l.height,f=l.ticksGenerator,m=l.className,g=l.hide;if(g)return null;var b=this.props,_=b.ticks,S=_objectWithoutProperties$3(b,_excluded3),E=_;return isFunction$1(f)&&(E=_&&_.length>0?f(this.props):f(S)),p<=0||d<=0||!E||!E.length?null:React.createElement(Layer,{className:clsx("recharts-cartesian-axis",m),ref:function(R){o.layerReference=R}},u&&this.renderAxisLine(),this.renderTicks(E,this.state.fontSize,this.state.letterSpacing),Label$1.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(o,l,u){var p;return React.isValidElement(o)?p=React.cloneElement(o,l):isFunction$1(o)?p=o(l):p=React.createElement(Text,_extends$5({},l,{className:"recharts-cartesian-axis-tick-value"}),u),p}}])}(React.Component);_defineProperty$7(CartesianAxis,"displayName","CartesianAxis"),_defineProperty$7(CartesianAxis,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var _excluded$2=["x1","y1","x2","y2","key"],_excluded2$2=["offset"];function _typeof$6(e){"@babel/helpers - typeof";return _typeof$6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof$6(e)}function ownKeys$3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,o)}return n}function _objectSpread$3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ownKeys$3(Object(n),!0).forEach(function(o){_defineProperty$6(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$3(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function _defineProperty$6(e,t,n){return t=_toPropertyKey$6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey$6(e){var t=_toPrimitive$6(e,"string");return _typeof$6(t)=="symbol"?t:t+""}function _toPrimitive$6(e,t){if(_typeof$6(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(_typeof$6(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _extends$4(){return _extends$4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},_extends$4.apply(this,arguments)}function _objectWithoutProperties$2(e,t){if(e==null)return{};var n=_objectWithoutPropertiesLoose$2(e,t),o,l;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(l=0;l<u.length;l++)o=u[l],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function _objectWithoutPropertiesLoose$2(e,t){if(e==null)return{};var n={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(t.indexOf(o)>=0)continue;n[o]=e[o]}return n}var Background=function(t){var n=t.fill;if(!n||n==="none")return null;var o=t.fillOpacity,l=t.x,u=t.y,p=t.width,d=t.height,f=t.ry;return React.createElement("rect",{x:l,y:u,ry:f,width:p,height:d,stroke:"none",fill:n,fillOpacity:o,className:"recharts-cartesian-grid-bg"})};function renderLineItem(e,t){var n;if(React.isValidElement(e))n=React.cloneElement(e,t);else if(isFunction$1(e))n=e(t);else{var o=t.x1,l=t.y1,u=t.x2,p=t.y2,d=t.key,f=_objectWithoutProperties$2(t,_excluded$2),m=filterProps(f,!1);m.offset;var g=_objectWithoutProperties$2(m,_excluded2$2);n=React.createElement("line",_extends$4({},g,{x1:o,y1:l,x2:u,y2:p,fill:"none",key:d}))}return n}function HorizontalGridLines(e){var t=e.x,n=e.width,o=e.horizontal,l=o===void 0?!0:o,u=e.horizontalPoints;if(!l||!u||!u.length)return null;var p=u.map(function(d,f){var m=_objectSpread$3(_objectSpread$3({},e),{},{x1:t,y1:d,x2:t+n,y2:d,key:"line-".concat(f),index:f});return renderLineItem(l,m)});return React.createElement("g",{className:"recharts-cartesian-grid-horizontal"},p)}function VerticalGridLines(e){var t=e.y,n=e.height,o=e.vertical,l=o===void 0?!0:o,u=e.verticalPoints;if(!l||!u||!u.length)return null;var p=u.map(function(d,f){var m=_objectSpread$3(_objectSpread$3({},e),{},{x1:d,y1:t,x2:d,y2:t+n,key:"line-".concat(f),index:f});return renderLineItem(l,m)});return React.createElement("g",{className:"recharts-cartesian-grid-vertical"},p)}function HorizontalStripes(e){var t=e.horizontalFill,n=e.fillOpacity,o=e.x,l=e.y,u=e.width,p=e.height,d=e.horizontalPoints,f=e.horizontal,m=f===void 0?!0:f;if(!m||!t||!t.length)return null;var g=d.map(function(_){return Math.round(_+l-l)}).sort(function(_,S){return _-S});l!==g[0]&&g.unshift(0);var b=g.map(function(_,S){var E=!g[S+1],C=E?l+p-_:g[S+1]-_;if(C<=0)return null;var R=S%t.length;return React.createElement("rect",{key:"react-".concat(S),y:_,x:o,height:C,width:u,stroke:"none",fill:t[R],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return React.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},b)}function VerticalStripes(e){var t=e.vertical,n=t===void 0?!0:t,o=e.verticalFill,l=e.fillOpacity,u=e.x,p=e.y,d=e.width,f=e.height,m=e.verticalPoints;if(!n||!o||!o.length)return null;var g=m.map(function(_){return Math.round(_+u-u)}).sort(function(_,S){return _-S});u!==g[0]&&g.unshift(0);var b=g.map(function(_,S){var E=!g[S+1],C=E?u+d-_:g[S+1]-_;if(C<=0)return null;var R=S%o.length;return React.createElement("rect",{key:"react-".concat(S),x:_,y:p,width:C,height:f,stroke:"none",fill:o[R],fillOpacity:l,className:"recharts-cartesian-grid-bg"})});return React.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},b)}var defaultVerticalCoordinatesGenerator=function(t,n){var o=t.xAxis,l=t.width,u=t.height,p=t.offset;return getCoordinatesOfGrid(getTicks(_objectSpread$3(_objectSpread$3(_objectSpread$3({},CartesianAxis.defaultProps),o),{},{ticks:getTicksOfAxis(o,!0),viewBox:{x:0,y:0,width:l,height:u}})),p.left,p.left+p.width,n)},defaultHorizontalCoordinatesGenerator=function(t,n){var o=t.yAxis,l=t.width,u=t.height,p=t.offset;return getCoordinatesOfGrid(getTicks(_objectSpread$3(_objectSpread$3(_objectSpread$3({},CartesianAxis.defaultProps),o),{},{ticks:getTicksOfAxis(o,!0),viewBox:{x:0,y:0,width:l,height:u}})),p.top,p.top+p.height,n)},defaultProps={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function CartesianGrid(e){var t,n,o,l,u,p,d=useChartWidth(),f=useChartHeight(),m=useOffset(),g=_objectSpread$3(_objectSpread$3({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:defaultProps.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:defaultProps.fill,horizontal:(o=e.horizontal)!==null&&o!==void 0?o:defaultProps.horizontal,horizontalFill:(l=e.horizontalFill)!==null&&l!==void 0?l:defaultProps.horizontalFill,vertical:(u=e.vertical)!==null&&u!==void 0?u:defaultProps.vertical,verticalFill:(p=e.verticalFill)!==null&&p!==void 0?p:defaultProps.verticalFill,x:isNumber(e.x)?e.x:m.left,y:isNumber(e.y)?e.y:m.top,width:isNumber(e.width)?e.width:m.width,height:isNumber(e.height)?e.height:m.height}),b=g.x,_=g.y,S=g.width,E=g.height,C=g.syncWithTicks,R=g.horizontalValues,A=g.verticalValues,N=useArbitraryXAxis(),O=useYAxisWithFiniteDomainOrRandom();if(!isNumber(S)||S<=0||!isNumber(E)||E<=0||!isNumber(b)||b!==+b||!isNumber(_)||_!==+_)return null;var V=g.verticalCoordinatesGenerator||defaultVerticalCoordinatesGenerator,M=g.horizontalCoordinatesGenerator||defaultHorizontalCoordinatesGenerator,I=g.horizontalPoints,j=g.verticalPoints;if((!I||!I.length)&&isFunction$1(M)){var B=R&&R.length,L=M({yAxis:O?_objectSpread$3(_objectSpread$3({},O),{},{ticks:B?R:O.ticks}):void 0,width:d,height:f,offset:m},B?!0:C);warn$1(Array.isArray(L),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(_typeof$6(L),"]")),Array.isArray(L)&&(I=L)}if((!j||!j.length)&&isFunction$1(V)){var q=A&&A.length,F=V({xAxis:N?_objectSpread$3(_objectSpread$3({},N),{},{ticks:q?A:N.ticks}):void 0,width:d,height:f,offset:m},q?!0:C);warn$1(Array.isArray(F),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(_typeof$6(F),"]")),Array.isArray(F)&&(j=F)}return React.createElement("g",{className:"recharts-cartesian-grid"},React.createElement(Background,{fill:g.fill,fillOpacity:g.fillOpacity,x:g.x,y:g.y,width:g.width,height:g.height,ry:g.ry}),React.createElement(HorizontalGridLines,_extends$4({},g,{offset:m,horizontalPoints:I,xAxis:N,yAxis:O})),React.createElement(VerticalGridLines,_extends$4({},g,{offset:m,verticalPoints:j,xAxis:N,yAxis:O})),React.createElement(HorizontalStripes,_extends$4({},g,{horizontalPoints:I})),React.createElement(VerticalStripes,_extends$4({},g,{verticalPoints:j})))}CartesianGrid.displayName="CartesianGrid";var _excluded$1=["layout","type","stroke","connectNulls","isRange","ref"],_excluded2$1=["key"],_Area;function _typeof$5(e){"@babel/helpers - typeof";return _typeof$5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof$5(e)}function _objectWithoutProperties$1(e,t){if(e==null)return{};var n=_objectWithoutPropertiesLoose$1(e,t),o,l;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(l=0;l<u.length;l++)o=u[l],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function _objectWithoutPropertiesLoose$1(e,t){if(e==null)return{};var n={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(t.indexOf(o)>=0)continue;n[o]=e[o]}return n}function _extends$3(){return _extends$3=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},_extends$3.apply(this,arguments)}function ownKeys$2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,o)}return n}function _objectSpread$2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ownKeys$2(Object(n),!0).forEach(function(o){_defineProperty$5(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$2(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function _classCallCheck$4(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$4(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey$5(o.key),o)}}function _createClass$4(e,t,n){return t&&_defineProperties$4(e.prototype,t),n&&_defineProperties$4(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _callSuper$3(e,t,n){return t=_getPrototypeOf$3(t),_possibleConstructorReturn$3(e,_isNativeReflectConstruct$3()?Reflect.construct(t,n||[],_getPrototypeOf$3(e).constructor):t.apply(e,n))}function _possibleConstructorReturn$3(e,t){if(t&&(_typeof$5(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$3(e)}function _assertThisInitialized$3(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct$3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_isNativeReflectConstruct$3=function(){return!!e})()}function _getPrototypeOf$3(e){return _getPrototypeOf$3=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_getPrototypeOf$3(e)}function _inherits$3(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf$3(e,t)}function _setPrototypeOf$3(e,t){return _setPrototypeOf$3=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,l){return o.__proto__=l,o},_setPrototypeOf$3(e,t)}function _defineProperty$5(e,t,n){return t=_toPropertyKey$5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey$5(e){var t=_toPrimitive$5(e,"string");return _typeof$5(t)=="symbol"?t:t+""}function _toPrimitive$5(e,t){if(_typeof$5(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(_typeof$5(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Area=function(e){function t(){var n;_classCallCheck$4(this,t);for(var o=arguments.length,l=new Array(o),u=0;u<o;u++)l[u]=arguments[u];return n=_callSuper$3(this,t,[].concat(l)),_defineProperty$5(n,"state",{isAnimationFinished:!0}),_defineProperty$5(n,"id",uniqueId("recharts-area-")),_defineProperty$5(n,"handleAnimationEnd",function(){var p=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),isFunction$1(p)&&p()}),_defineProperty$5(n,"handleAnimationStart",function(){var p=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),isFunction$1(p)&&p()}),n}return _inherits$3(t,e),_createClass$4(t,[{key:"renderDots",value:function(o,l,u){var p=this.props.isAnimationActive,d=this.state.isAnimationFinished;if(p&&!d)return null;var f=this.props,m=f.dot,g=f.points,b=f.dataKey,_=filterProps(this.props,!1),S=filterProps(m,!0),E=g.map(function(R,A){var N=_objectSpread$2(_objectSpread$2(_objectSpread$2({key:"dot-".concat(A),r:3},_),S),{},{index:A,cx:R.x,cy:R.y,dataKey:b,value:R.value,payload:R.payload,points:g});return t.renderDotItem(m,N)}),C={clipPath:o?"url(#clipPath-".concat(l?"":"dots-").concat(u,")"):null};return React.createElement(Layer,_extends$3({className:"recharts-area-dots"},C),E)}},{key:"renderHorizontalRect",value:function(o){var l=this.props,u=l.baseLine,p=l.points,d=l.strokeWidth,f=p[0].x,m=p[p.length-1].x,g=o*Math.abs(f-m),b=max(p.map(function(_){return _.y||0}));return isNumber(u)&&typeof u=="number"?b=Math.max(u,b):u&&Array.isArray(u)&&u.length&&(b=Math.max(max(u.map(function(_){return _.y||0})),b)),isNumber(b)?React.createElement("rect",{x:f<m?f:f-g,y:0,width:g,height:Math.floor(b+(d?parseInt("".concat(d),10):1))}):null}},{key:"renderVerticalRect",value:function(o){var l=this.props,u=l.baseLine,p=l.points,d=l.strokeWidth,f=p[0].y,m=p[p.length-1].y,g=o*Math.abs(f-m),b=max(p.map(function(_){return _.x||0}));return isNumber(u)&&typeof u=="number"?b=Math.max(u,b):u&&Array.isArray(u)&&u.length&&(b=Math.max(max(u.map(function(_){return _.x||0})),b)),isNumber(b)?React.createElement("rect",{x:0,y:f<m?f:f-g,width:b+(d?parseInt("".concat(d),10):1),height:Math.floor(g)}):null}},{key:"renderClipRect",value:function(o){var l=this.props.layout;return l==="vertical"?this.renderVerticalRect(o):this.renderHorizontalRect(o)}},{key:"renderAreaStatically",value:function(o,l,u,p){var d=this.props,f=d.layout,m=d.type,g=d.stroke,b=d.connectNulls,_=d.isRange;d.ref;var S=_objectWithoutProperties$1(d,_excluded$1);return React.createElement(Layer,{clipPath:u?"url(#clipPath-".concat(p,")"):null},React.createElement(Curve,_extends$3({},filterProps(S,!0),{points:o,connectNulls:b,type:m,baseLine:l,layout:f,stroke:"none",className:"recharts-area-area"})),g!=="none"&&React.createElement(Curve,_extends$3({},filterProps(this.props,!1),{className:"recharts-area-curve",layout:f,type:m,connectNulls:b,fill:"none",points:o})),g!=="none"&&_&&React.createElement(Curve,_extends$3({},filterProps(this.props,!1),{className:"recharts-area-curve",layout:f,type:m,connectNulls:b,fill:"none",points:l})))}},{key:"renderAreaWithAnimation",value:function(o,l){var u=this,p=this.props,d=p.points,f=p.baseLine,m=p.isAnimationActive,g=p.animationBegin,b=p.animationDuration,_=p.animationEasing,S=p.animationId,E=this.state,C=E.prevPoints,R=E.prevBaseLine;return React.createElement(Animate,{begin:g,duration:b,isActive:m,easing:_,from:{t:0},to:{t:1},key:"area-".concat(S),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(A){var N=A.t;if(C){var O=C.length/d.length,V=d.map(function(B,L){var q=Math.floor(L*O);if(C[q]){var F=C[q],H=interpolateNumber$2(F.x,B.x),U=interpolateNumber$2(F.y,B.y);return _objectSpread$2(_objectSpread$2({},B),{},{x:H(N),y:U(N)})}return B}),M;if(isNumber(f)&&typeof f=="number"){var I=interpolateNumber$2(R,f);M=I(N)}else if(isNil(f)||isNan(f)){var j=interpolateNumber$2(R,0);M=j(N)}else M=f.map(function(B,L){var q=Math.floor(L*O);if(R[q]){var F=R[q],H=interpolateNumber$2(F.x,B.x),U=interpolateNumber$2(F.y,B.y);return _objectSpread$2(_objectSpread$2({},B),{},{x:H(N),y:U(N)})}return B});return u.renderAreaStatically(V,M,o,l)}return React.createElement(Layer,null,React.createElement("defs",null,React.createElement("clipPath",{id:"animationClipPath-".concat(l)},u.renderClipRect(N))),React.createElement(Layer,{clipPath:"url(#animationClipPath-".concat(l,")")},u.renderAreaStatically(d,f,o,l)))})}},{key:"renderArea",value:function(o,l){var u=this.props,p=u.points,d=u.baseLine,f=u.isAnimationActive,m=this.state,g=m.prevPoints,b=m.prevBaseLine,_=m.totalLength;return f&&p&&p.length&&(!g&&_>0||!isEqual(g,p)||!isEqual(b,d))?this.renderAreaWithAnimation(o,l):this.renderAreaStatically(p,d,o,l)}},{key:"render",value:function(){var o,l=this.props,u=l.hide,p=l.dot,d=l.points,f=l.className,m=l.top,g=l.left,b=l.xAxis,_=l.yAxis,S=l.width,E=l.height,C=l.isAnimationActive,R=l.id;if(u||!d||!d.length)return null;var A=this.state.isAnimationFinished,N=d.length===1,O=clsx("recharts-area",f),V=b&&b.allowDataOverflow,M=_&&_.allowDataOverflow,I=V||M,j=isNil(R)?this.id:R,B=(o=filterProps(p,!1))!==null&&o!==void 0?o:{r:3,strokeWidth:2},L=B.r,q=L===void 0?3:L,F=B.strokeWidth,H=F===void 0?2:F,U=hasClipDot(p)?p:{},G=U.clipDot,J=G===void 0?!0:G,ee=q*2+H;return React.createElement(Layer,{className:O},V||M?React.createElement("defs",null,React.createElement("clipPath",{id:"clipPath-".concat(j)},React.createElement("rect",{x:V?g:g-S/2,y:M?m:m-E/2,width:V?S:S*2,height:M?E:E*2})),!J&&React.createElement("clipPath",{id:"clipPath-dots-".concat(j)},React.createElement("rect",{x:g-ee/2,y:m-ee/2,width:S+ee,height:E+ee}))):null,N?null:this.renderArea(I,j),(p||N)&&this.renderDots(I,J,j),(!C||A)&&LabelList.renderCallByParent(this.props,d))}}],[{key:"getDerivedStateFromProps",value:function(o,l){return o.animationId!==l.prevAnimationId?{prevAnimationId:o.animationId,curPoints:o.points,curBaseLine:o.baseLine,prevPoints:l.curPoints,prevBaseLine:l.curBaseLine}:o.points!==l.curPoints||o.baseLine!==l.curBaseLine?{curPoints:o.points,curBaseLine:o.baseLine}:null}}])}(React.PureComponent);_Area=Area,_defineProperty$5(Area,"displayName","Area"),_defineProperty$5(Area,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Global.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"}),_defineProperty$5(Area,"getBaseValue",function(e,t,n,o){var l=e.layout,u=e.baseValue,p=t.props.baseValue,d=p??u;if(isNumber(d)&&typeof d=="number")return d;var f=l==="horizontal"?o:n,m=f.scale.domain();if(f.type==="number"){var g=Math.max(m[0],m[1]),b=Math.min(m[0],m[1]);return d==="dataMin"?b:d==="dataMax"||g<0?g:Math.max(Math.min(m[0],m[1]),0)}return d==="dataMin"?m[0]:d==="dataMax"?m[1]:m[0]}),_defineProperty$5(Area,"getComposedData",function(e){var t=e.props,n=e.item,o=e.xAxis,l=e.yAxis,u=e.xAxisTicks,p=e.yAxisTicks,d=e.bandSize,f=e.dataKey,m=e.stackedData,g=e.dataStartIndex,b=e.displayedData,_=e.offset,S=t.layout,E=m&&m.length,C=_Area.getBaseValue(t,n,o,l),R=S==="horizontal",A=!1,N=b.map(function(V,M){var I;E?I=m[g+M]:(I=getValueByDataKey(V,f),Array.isArray(I)?A=!0:I=[C,I]);var j=I[1]==null||E&&getValueByDataKey(V,f)==null;return R?{x:getCateCoordinateOfLine({axis:o,ticks:u,bandSize:d,entry:V,index:M}),y:j?null:l.scale(I[1]),value:I,payload:V}:{x:j?null:o.scale(I[1]),y:getCateCoordinateOfLine({axis:l,ticks:p,bandSize:d,entry:V,index:M}),value:I,payload:V}}),O;return E||A?O=N.map(function(V){var M=Array.isArray(V.value)?V.value[0]:null;return R?{x:V.x,y:M!=null&&V.y!=null?l.scale(M):null}:{x:M!=null?o.scale(M):null,y:V.y}}):O=R?l.scale(C):o.scale(C),_objectSpread$2({points:N,baseLine:O,layout:S,isRange:A},_)}),_defineProperty$5(Area,"renderDotItem",function(e,t){var n;if(React.isValidElement(e))n=React.cloneElement(e,t);else if(isFunction$1(e))n=e(t);else{var o=clsx("recharts-area-dot",typeof e!="boolean"?e.className:""),l=t.key,u=_objectWithoutProperties$1(t,_excluded2$1);n=React.createElement(Dot,_extends$3({},u,{key:l,className:o}))}return n});function _typeof$4(e){"@babel/helpers - typeof";return _typeof$4=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof$4(e)}function _classCallCheck$3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$3(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey$4(o.key),o)}}function _createClass$3(e,t,n){return t&&_defineProperties$3(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _callSuper$2(e,t,n){return t=_getPrototypeOf$2(t),_possibleConstructorReturn$2(e,_isNativeReflectConstruct$2()?Reflect.construct(t,n||[],_getPrototypeOf$2(e).constructor):t.apply(e,n))}function _possibleConstructorReturn$2(e,t){if(t&&(_typeof$4(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$2(e)}function _assertThisInitialized$2(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct$2(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_isNativeReflectConstruct$2=function(){return!!e})()}function _getPrototypeOf$2(e){return _getPrototypeOf$2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_getPrototypeOf$2(e)}function _inherits$2(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf$2(e,t)}function _setPrototypeOf$2(e,t){return _setPrototypeOf$2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,l){return o.__proto__=l,o},_setPrototypeOf$2(e,t)}function _defineProperty$4(e,t,n){return t=_toPropertyKey$4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey$4(e){var t=_toPrimitive$4(e,"string");return _typeof$4(t)=="symbol"?t:t+""}function _toPrimitive$4(e,t){if(_typeof$4(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(_typeof$4(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function _extends$2(){return _extends$2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},_extends$2.apply(this,arguments)}function XAxisImpl(e){var t=e.xAxisId,n=useChartWidth(),o=useChartHeight(),l=useXAxisOrThrow(t);return l==null?null:React.createElement(CartesianAxis,_extends$2({},l,{className:clsx("recharts-".concat(l.axisType," ").concat(l.axisType),l.className),viewBox:{x:0,y:0,width:n,height:o},ticksGenerator:function(p){return getTicksOfAxis(p,!0)}}))}var XAxis=function(e){function t(){return _classCallCheck$3(this,t),_callSuper$2(this,t,arguments)}return _inherits$2(t,e),_createClass$3(t,[{key:"render",value:function(){return React.createElement(XAxisImpl,this.props)}}])}(React.Component);_defineProperty$4(XAxis,"displayName","XAxis"),_defineProperty$4(XAxis,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function _typeof$3(e){"@babel/helpers - typeof";return _typeof$3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof$3(e)}function _classCallCheck$2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$2(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey$3(o.key),o)}}function _createClass$2(e,t,n){return t&&_defineProperties$2(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _callSuper$1(e,t,n){return t=_getPrototypeOf$1(t),_possibleConstructorReturn$1(e,_isNativeReflectConstruct$1()?Reflect.construct(t,n||[],_getPrototypeOf$1(e).constructor):t.apply(e,n))}function _possibleConstructorReturn$1(e,t){if(t&&(_typeof$3(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$1(e)}function _assertThisInitialized$1(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct$1(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_isNativeReflectConstruct$1=function(){return!!e})()}function _getPrototypeOf$1(e){return _getPrototypeOf$1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_getPrototypeOf$1(e)}function _inherits$1(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf$1(e,t)}function _setPrototypeOf$1(e,t){return _setPrototypeOf$1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,l){return o.__proto__=l,o},_setPrototypeOf$1(e,t)}function _defineProperty$3(e,t,n){return t=_toPropertyKey$3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey$3(e){var t=_toPrimitive$3(e,"string");return _typeof$3(t)=="symbol"?t:t+""}function _toPrimitive$3(e,t){if(_typeof$3(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(_typeof$3(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function _extends$1(){return _extends$1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},_extends$1.apply(this,arguments)}var YAxisImpl=function(t){var n=t.yAxisId,o=useChartWidth(),l=useChartHeight(),u=useYAxisOrThrow(n);return u==null?null:React.createElement(CartesianAxis,_extends$1({},u,{className:clsx("recharts-".concat(u.axisType," ").concat(u.axisType),u.className),viewBox:{x:0,y:0,width:o,height:l},ticksGenerator:function(d){return getTicksOfAxis(d,!0)}}))},YAxis=function(e){function t(){return _classCallCheck$2(this,t),_callSuper$1(this,t,arguments)}return _inherits$1(t,e),_createClass$2(t,[{key:"render",value:function(){return React.createElement(YAxisImpl,this.props)}}])}(React.Component);_defineProperty$3(YAxis,"displayName","YAxis"),_defineProperty$3(YAxis,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function _toConsumableArray$1(e){return _arrayWithoutHoles$1(e)||_iterableToArray$1(e)||_unsupportedIterableToArray$1(e)||_nonIterableSpread$1()}function _nonIterableSpread$1(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
396
401
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$1(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray$1(e,t)}}function _iterableToArray$1(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _arrayWithoutHoles$1(e){if(Array.isArray(e))return _arrayLikeToArray$1(e)}function _arrayLikeToArray$1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var detectReferenceElementsDomain=function(t,n,o,l,u){var p=findAllByType(t,ReferenceLine),d=findAllByType(t,ReferenceDot),f=[].concat(_toConsumableArray$1(p),_toConsumableArray$1(d)),m=findAllByType(t,ReferenceArea),g="".concat(l,"Id"),b=l[0],_=n;if(f.length&&(_=f.reduce(function(C,R){if(R.props[g]===o&&ifOverflowMatches(R.props,"extendDomain")&&isNumber(R.props[b])){var A=R.props[b];return[Math.min(C[0],A),Math.max(C[1],A)]}return C},_)),m.length){var S="".concat(b,"1"),E="".concat(b,"2");_=m.reduce(function(C,R){if(R.props[g]===o&&ifOverflowMatches(R.props,"extendDomain")&&isNumber(R.props[S])&&isNumber(R.props[E])){var A=R.props[S],N=R.props[E];return[Math.min(C[0],A,N),Math.max(C[1],A,N)]}return C},_)}return u&&u.length&&(_=u.reduce(function(C,R){return isNumber(R)?[Math.min(C[0],R),Math.max(C[1],R)]:C},_)),_},eventemitter3={exports:{}},hasRequiredEventemitter3;function requireEventemitter3(){return hasRequiredEventemitter3||(hasRequiredEventemitter3=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(n=!1));function l(f,m,g){this.fn=f,this.context=m,this.once=g||!1}function u(f,m,g,b,_){if(typeof g!="function")throw new TypeError("The listener must be a function");var S=new l(g,b||f,_),E=n?n+m:m;return f._events[E]?f._events[E].fn?f._events[E]=[f._events[E],S]:f._events[E].push(S):(f._events[E]=S,f._eventsCount++),f}function p(f,m){--f._eventsCount===0?f._events=new o:delete f._events[m]}function d(){this._events=new o,this._eventsCount=0}d.prototype.eventNames=function(){var m=[],g,b;if(this._eventsCount===0)return m;for(b in g=this._events)t.call(g,b)&&m.push(n?b.slice(1):b);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(g)):m},d.prototype.listeners=function(m){var g=n?n+m:m,b=this._events[g];if(!b)return[];if(b.fn)return[b.fn];for(var _=0,S=b.length,E=new Array(S);_<S;_++)E[_]=b[_].fn;return E},d.prototype.listenerCount=function(m){var g=n?n+m:m,b=this._events[g];return b?b.fn?1:b.length:0},d.prototype.emit=function(m,g,b,_,S,E){var C=n?n+m:m;if(!this._events[C])return!1;var R=this._events[C],A=arguments.length,N,O;if(R.fn){switch(R.once&&this.removeListener(m,R.fn,void 0,!0),A){case 1:return R.fn.call(R.context),!0;case 2:return R.fn.call(R.context,g),!0;case 3:return R.fn.call(R.context,g,b),!0;case 4:return R.fn.call(R.context,g,b,_),!0;case 5:return R.fn.call(R.context,g,b,_,S),!0;case 6:return R.fn.call(R.context,g,b,_,S,E),!0}for(O=1,N=new Array(A-1);O<A;O++)N[O-1]=arguments[O];R.fn.apply(R.context,N)}else{var V=R.length,M;for(O=0;O<V;O++)switch(R[O].once&&this.removeListener(m,R[O].fn,void 0,!0),A){case 1:R[O].fn.call(R[O].context);break;case 2:R[O].fn.call(R[O].context,g);break;case 3:R[O].fn.call(R[O].context,g,b);break;case 4:R[O].fn.call(R[O].context,g,b,_);break;default:if(!N)for(M=1,N=new Array(A-1);M<A;M++)N[M-1]=arguments[M];R[O].fn.apply(R[O].context,N)}}return!0},d.prototype.on=function(m,g,b){return u(this,m,g,b,!1)},d.prototype.once=function(m,g,b){return u(this,m,g,b,!0)},d.prototype.removeListener=function(m,g,b,_){var S=n?n+m:m;if(!this._events[S])return this;if(!g)return p(this,S),this;var E=this._events[S];if(E.fn)E.fn===g&&(!_||E.once)&&(!b||E.context===b)&&p(this,S);else{for(var C=0,R=[],A=E.length;C<A;C++)(E[C].fn!==g||_&&!E[C].once||b&&E[C].context!==b)&&R.push(E[C]);R.length?this._events[S]=R.length===1?R[0]:R:p(this,S)}return this},d.prototype.removeAllListeners=function(m){var g;return m?(g=n?n+m:m,this._events[g]&&p(this,g)):(this._events=new o,this._eventsCount=0),this},d.prototype.off=d.prototype.removeListener,d.prototype.addListener=d.prototype.on,d.prefixed=n,d.EventEmitter=d,e.exports=d}(eventemitter3)),eventemitter3.exports}var eventemitter3Exports=requireEventemitter3();const EventEmitter=getDefaultExportFromCjs(eventemitter3Exports);var eventCenter=new EventEmitter,SYNC_EVENT="recharts.syncMouseEvents";function _typeof$2(e){"@babel/helpers - typeof";return _typeof$2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof$2(e)}function _classCallCheck$1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$1(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey$2(o.key),o)}}function _createClass$1(e,t,n){return t&&_defineProperties$1(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty$2(e,t,n){return t=_toPropertyKey$2(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey$2(e){var t=_toPrimitive$2(e,"string");return _typeof$2(t)=="symbol"?t:t+""}function _toPrimitive$2(e,t){if(_typeof$2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(_typeof$2(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var AccessibilityManager=function(){function e(){_classCallCheck$1(this,e),_defineProperty$2(this,"activeIndex",0),_defineProperty$2(this,"coordinateList",[]),_defineProperty$2(this,"layout","horizontal")}return _createClass$1(e,[{key:"setDetails",value:function(n){var o,l=n.coordinateList,u=l===void 0?null:l,p=n.container,d=p===void 0?null:p,f=n.layout,m=f===void 0?null:f,g=n.offset,b=g===void 0?null:g,_=n.mouseHandlerCallback,S=_===void 0?null:_;this.coordinateList=(o=u??this.coordinateList)!==null&&o!==void 0?o:[],this.container=d??this.container,this.layout=m??this.layout,this.offset=b??this.offset,this.mouseHandlerCallback=S??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,o;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var l=this.container.getBoundingClientRect(),u=l.x,p=l.y,d=l.height,f=this.coordinateList[this.activeIndex].coordinate,m=((n=window)===null||n===void 0?void 0:n.scrollX)||0,g=((o=window)===null||o===void 0?void 0:o.scrollY)||0,b=u+f+m,_=p+this.offset.top+d/2+g;this.mouseHandlerCallback({pageX:b,pageY:_})}}}])}();function isDomainSpecifiedByUser(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var o=e==null?void 0:e[0],l=e==null?void 0:e[1];if(o&&l&&isNumber(o)&&isNumber(l))return!0}return!1}function getCursorRectangle(e,t,n,o){var l=o/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-l:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-l,width:e==="horizontal"?o:n.width-1,height:e==="horizontal"?n.height-1:o}}function getRadialCursorPoints(e){var t=e.cx,n=e.cy,o=e.radius,l=e.startAngle,u=e.endAngle,p=polarToCartesian(t,n,o,l),d=polarToCartesian(t,n,o,u);return{points:[p,d],cx:t,cy:n,radius:o,startAngle:l,endAngle:u}}function getCursorPoints(e,t,n){var o,l,u,p;if(e==="horizontal")o=t.x,u=o,l=n.top,p=n.top+n.height;else if(e==="vertical")l=t.y,p=l,o=n.left,u=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var d=t.cx,f=t.cy,m=t.innerRadius,g=t.outerRadius,b=t.angle,_=polarToCartesian(d,f,m,b),S=polarToCartesian(d,f,g,b);o=_.x,l=_.y,u=S.x,p=S.y}else return getRadialCursorPoints(t);return[{x:o,y:l},{x:u,y:p}]}function _typeof$1(e){"@babel/helpers - typeof";return _typeof$1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof$1(e)}function ownKeys$1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,o)}return n}function _objectSpread$1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ownKeys$1(Object(n),!0).forEach(function(o){_defineProperty$1(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$1(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function _defineProperty$1(e,t,n){return t=_toPropertyKey$1(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey$1(e){var t=_toPrimitive$1(e,"string");return _typeof$1(t)=="symbol"?t:t+""}function _toPrimitive$1(e,t){if(_typeof$1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(_typeof$1(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cursor(e){var t,n,o=e.element,l=e.tooltipEventType,u=e.isActive,p=e.activeCoordinate,d=e.activePayload,f=e.offset,m=e.activeTooltipIndex,g=e.tooltipAxisBandSize,b=e.layout,_=e.chartName,S=(t=o.props.cursor)!==null&&t!==void 0?t:(n=o.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!o||!S||!u||!p||_!=="ScatterChart"&&l!=="axis")return null;var E,C=Curve;if(_==="ScatterChart")E=p,C=Cross;else if(_==="BarChart")E=getCursorRectangle(b,p,f,g),C=Rectangle;else if(b==="radial"){var R=getRadialCursorPoints(p),A=R.cx,N=R.cy,O=R.radius,V=R.startAngle,M=R.endAngle;E={cx:A,cy:N,startAngle:V,endAngle:M,innerRadius:O,outerRadius:O},C=Sector}else E={points:getCursorPoints(b,p,f)},C=Curve;var I=_objectSpread$1(_objectSpread$1(_objectSpread$1(_objectSpread$1({stroke:"#ccc",pointerEvents:"none"},f),E),filterProps(S,!1)),{},{payload:d,payloadIndex:m,className:clsx("recharts-tooltip-cursor",S.className)});return React.isValidElement(S)?React.cloneElement(S,I):React.createElement(C,I)}var _excluded=["item"],_excluded2=["children","className","width","height","style","compact","title","desc"];function _typeof(e){"@babel/helpers - typeof";return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(e)}function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},_extends.apply(this,arguments)}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
397
402
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _iterableToArrayLimit(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o,l,u,p,d=[],f=!0,m=!1;try{if(u=(n=n.call(e)).next,t!==0)for(;!(f=(o=u.call(n)).done)&&(d.push(o.value),d.length!==t);f=!0);}catch(g){m=!0,l=g}finally{try{if(!f&&n.return!=null&&(p=n.return(),Object(p)!==p))return}finally{if(m)throw l}}return d}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _objectWithoutProperties(e,t){if(e==null)return{};var n=_objectWithoutPropertiesLoose(e,t),o,l;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(l=0;l<u.length;l++)o=u[l],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function _objectWithoutPropertiesLoose(e,t){if(e==null)return{};var n={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(t.indexOf(o)>=0)continue;n[o]=e[o]}return n}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _callSuper(e,t,n){return t=_getPrototypeOf(t),_possibleConstructorReturn(e,_isNativeReflectConstruct()?Reflect.construct(t,n||[],_getPrototypeOf(e).constructor):t.apply(e,n))}function _possibleConstructorReturn(e,t){if(t&&(_typeof(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_isNativeReflectConstruct=function(){return!!e})()}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_getPrototypeOf(e)}function _inherits(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,l){return o.__proto__=l,o},_setPrototypeOf(e,t)}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
398
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(e,t)}}function _iterableToArray(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,o)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach(function(o){_defineProperty(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function _defineProperty(e,t,n){return t=_toPropertyKey(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return _typeof(t)=="symbol"?t:t+""}function _toPrimitive(e,t){if(_typeof(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(_typeof(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ORIENT_MAP={xAxis:["bottom","top"],yAxis:["left","right"]},FULL_WIDTH_AND_HEIGHT={width:"100%",height:"100%"},originCoordinate={x:0,y:0};function renderAsIs(e){return e}var calculateTooltipPos=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},getActiveCoordinate=function(t,n,o,l){var u=n.find(function(g){return g&&g.index===o});if(u){if(t==="horizontal")return{x:u.coordinate,y:l.y};if(t==="vertical")return{x:l.x,y:u.coordinate};if(t==="centric"){var p=u.coordinate,d=l.radius;return _objectSpread(_objectSpread(_objectSpread({},l),polarToCartesian(l.cx,l.cy,d,p)),{},{angle:p,radius:d})}var f=u.coordinate,m=l.angle;return _objectSpread(_objectSpread(_objectSpread({},l),polarToCartesian(l.cx,l.cy,f,m)),{},{angle:m,radius:f})}return originCoordinate},getDisplayedData=function(t,n){var o=n.graphicalItems,l=n.dataStartIndex,u=n.dataEndIndex,p=(o??[]).reduce(function(d,f){var m=f.props.data;return m&&m.length?[].concat(_toConsumableArray(d),_toConsumableArray(m)):d},[]);return p.length>0?p:t&&t.length&&isNumber(l)&&isNumber(u)?t.slice(l,u+1):[]};function getDefaultDomainByAxisType(e){return e==="number"?[0,"auto"]:void 0}var getTooltipContent=function(t,n,o,l){var u=t.graphicalItems,p=t.tooltipAxis,d=getDisplayedData(n,t);return o<0||!u||!u.length||o>=d.length?null:u.reduce(function(f,m){var g,b=(g=m.props.data)!==null&&g!==void 0?g:n;b&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=o&&(b=b.slice(t.dataStartIndex,t.dataEndIndex+1));var _;if(p.dataKey&&!p.allowDuplicatedCategory){var S=b===void 0?d:b;_=findEntryInArray(S,p.dataKey,l)}else _=b&&b[o]||d[o];return _?[].concat(_toConsumableArray(f),[getTooltipItem(m,_)]):f},[])},getTooltipData=function(t,n,o,l){var u=l||{x:t.chartX,y:t.chartY},p=calculateTooltipPos(u,o),d=t.orderedTooltipTicks,f=t.tooltipAxis,m=t.tooltipTicks,g=calculateActiveTickIndex(p,d,m,f);if(g>=0&&m){var b=m[g]&&m[g].value,_=getTooltipContent(t,n,g,b),S=getActiveCoordinate(o,d,g,u);return{activeTooltipIndex:g,activeLabel:b,activePayload:_,activeCoordinate:S}}return null},getAxisMapByAxes=function(t,n){var o=n.axes,l=n.graphicalItems,u=n.axisType,p=n.axisIdKey,d=n.stackGroups,f=n.dataStartIndex,m=n.dataEndIndex,g=t.layout,b=t.children,_=t.stackOffset,S=isCategoricalAxis(g,u);return o.reduce(function(E,C){var R,A=C.type.defaultProps!==void 0?_objectSpread(_objectSpread({},C.type.defaultProps),C.props):C.props,N=A.type,O=A.dataKey,V=A.allowDataOverflow,M=A.allowDuplicatedCategory,I=A.scale,j=A.ticks,B=A.includeHidden,L=A[p];if(E[L])return E;var q=getDisplayedData(t.data,{graphicalItems:l.filter(function(ce){var ue,fe=p in ce.props?ce.props[p]:(ue=ce.type.defaultProps)===null||ue===void 0?void 0:ue[p];return fe===L}),dataStartIndex:f,dataEndIndex:m}),F=q.length,H,U,G;isDomainSpecifiedByUser(A.domain,V,N)&&(H=parseSpecifiedDomain(A.domain,null,V),S&&(N==="number"||I!=="auto")&&(G=getDomainOfDataByKey(q,O,"category")));var J=getDefaultDomainByAxisType(N);if(!H||H.length===0){var ee,ae=(ee=A.domain)!==null&&ee!==void 0?ee:J;if(O){if(H=getDomainOfDataByKey(q,O,N),N==="category"&&S){var W=hasDuplicate(H);M&&W?(U=H,H=range(0,F)):M||(H=parseDomainOfCategoryAxis(ae,H,C).reduce(function(ce,ue){return ce.indexOf(ue)>=0?ce:[].concat(_toConsumableArray(ce),[ue])},[]))}else if(N==="category")M?H=H.filter(function(ce){return ce!==""&&!isNil(ce)}):H=parseDomainOfCategoryAxis(ae,H,C).reduce(function(ce,ue){return ce.indexOf(ue)>=0||ue===""||isNil(ue)?ce:[].concat(_toConsumableArray(ce),[ue])},[]);else if(N==="number"){var Q=parseErrorBarsOfAxis(q,l.filter(function(ce){var ue,fe,pe=p in ce.props?ce.props[p]:(ue=ce.type.defaultProps)===null||ue===void 0?void 0:ue[p],ve="hide"in ce.props?ce.props.hide:(fe=ce.type.defaultProps)===null||fe===void 0?void 0:fe.hide;return pe===L&&(B||!ve)}),O,u,g);Q&&(H=Q)}S&&(N==="number"||I!=="auto")&&(G=getDomainOfDataByKey(q,O,"category"))}else S?H=range(0,F):d&&d[L]&&d[L].hasStack&&N==="number"?H=_==="expand"?[0,1]:getDomainOfStackGroups(d[L].stackGroups,f,m):H=getDomainOfItemsWithSameAxis(q,l.filter(function(ce){var ue=p in ce.props?ce.props[p]:ce.type.defaultProps[p],fe="hide"in ce.props?ce.props.hide:ce.type.defaultProps.hide;return ue===L&&(B||!fe)}),N,g,!0);if(N==="number")H=detectReferenceElementsDomain(b,H,L,u,j),ae&&(H=parseSpecifiedDomain(ae,H,V));else if(N==="category"&&ae){var Z=ae,ie=H.every(function(ce){return Z.indexOf(ce)>=0});ie&&(H=Z)}}return _objectSpread(_objectSpread({},E),{},_defineProperty({},L,_objectSpread(_objectSpread({},A),{},{axisType:u,domain:H,categoricalDomain:G,duplicateDomain:U,originalDomain:(R=A.domain)!==null&&R!==void 0?R:J,isCategorical:S,layout:g})))},{})},getAxisMapByItems=function(t,n){var o=n.graphicalItems,l=n.Axis,u=n.axisType,p=n.axisIdKey,d=n.stackGroups,f=n.dataStartIndex,m=n.dataEndIndex,g=t.layout,b=t.children,_=getDisplayedData(t.data,{graphicalItems:o,dataStartIndex:f,dataEndIndex:m}),S=_.length,E=isCategoricalAxis(g,u),C=-1;return o.reduce(function(R,A){var N=A.type.defaultProps!==void 0?_objectSpread(_objectSpread({},A.type.defaultProps),A.props):A.props,O=N[p],V=getDefaultDomainByAxisType("number");if(!R[O]){C++;var M;return E?M=range(0,S):d&&d[O]&&d[O].hasStack?(M=getDomainOfStackGroups(d[O].stackGroups,f,m),M=detectReferenceElementsDomain(b,M,O,u)):(M=parseSpecifiedDomain(V,getDomainOfItemsWithSameAxis(_,o.filter(function(I){var j,B,L=p in I.props?I.props[p]:(j=I.type.defaultProps)===null||j===void 0?void 0:j[p],q="hide"in I.props?I.props.hide:(B=I.type.defaultProps)===null||B===void 0?void 0:B.hide;return L===O&&!q}),"number",g),l.defaultProps.allowDataOverflow),M=detectReferenceElementsDomain(b,M,O,u)),_objectSpread(_objectSpread({},R),{},_defineProperty({},O,_objectSpread(_objectSpread({axisType:u},l.defaultProps),{},{hide:!0,orientation:get$1(ORIENT_MAP,"".concat(u,".").concat(C%2),null),domain:M,originalDomain:V,isCategorical:E,layout:g})))}return R},{})},getAxisMap=function(t,n){var o=n.axisType,l=o===void 0?"xAxis":o,u=n.AxisComp,p=n.graphicalItems,d=n.stackGroups,f=n.dataStartIndex,m=n.dataEndIndex,g=t.children,b="".concat(l,"Id"),_=findAllByType(g,u),S={};return _&&_.length?S=getAxisMapByAxes(t,{axes:_,graphicalItems:p,axisType:l,axisIdKey:b,stackGroups:d,dataStartIndex:f,dataEndIndex:m}):p&&p.length&&(S=getAxisMapByItems(t,{Axis:u,graphicalItems:p,axisType:l,axisIdKey:b,stackGroups:d,dataStartIndex:f,dataEndIndex:m})),S},tooltipTicksGenerator=function(t){var n=getAnyElementOfObject(t),o=getTicksOfAxis(n,!1,!0);return{tooltipTicks:o,orderedTooltipTicks:sortBy(o,function(l){return l.coordinate}),tooltipAxis:n,tooltipAxisBandSize:getBandSizeOfAxis(n,o)}},createDefaultState=function(t){var n=t.children,o=t.defaultShowTooltip,l=findChildByType(n,Brush),u=0,p=0;return t.data&&t.data.length!==0&&(p=t.data.length-1),l&&l.props&&(l.props.startIndex>=0&&(u=l.props.startIndex),l.props.endIndex>=0&&(p=l.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:u,dataEndIndex:p,activeTooltipIndex:-1,isTooltipActive:!!o}},hasGraphicalBarItem=function(t){return!t||!t.length?!1:t.some(function(n){var o=getDisplayName(n&&n.type);return o&&o.indexOf("Bar")>=0})},getAxisNameByLayout=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},calculateOffset=function(t,n){var o=t.props,l=t.graphicalItems,u=t.xAxisMap,p=u===void 0?{}:u,d=t.yAxisMap,f=d===void 0?{}:d,m=o.width,g=o.height,b=o.children,_=o.margin||{},S=findChildByType(b,Brush),E=findChildByType(b,Legend),C=Object.keys(f).reduce(function(M,I){var j=f[I],B=j.orientation;return!j.mirror&&!j.hide?_objectSpread(_objectSpread({},M),{},_defineProperty({},B,M[B]+j.width)):M},{left:_.left||0,right:_.right||0}),R=Object.keys(p).reduce(function(M,I){var j=p[I],B=j.orientation;return!j.mirror&&!j.hide?_objectSpread(_objectSpread({},M),{},_defineProperty({},B,get$1(M,"".concat(B))+j.height)):M},{top:_.top||0,bottom:_.bottom||0}),A=_objectSpread(_objectSpread({},R),C),N=A.bottom;S&&(A.bottom+=S.props.height||Brush.defaultProps.height),E&&n&&(A=appendOffsetOfLegend(A,l,o,n));var O=m-A.left-A.right,V=g-A.top-A.bottom;return _objectSpread(_objectSpread({brushBottom:N},A),{},{width:Math.max(O,0),height:Math.max(V,0)})},getCartesianAxisSize=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},generateCategoricalChart=function(t){var n=t.chartName,o=t.GraphicalChild,l=t.defaultTooltipEventType,u=l===void 0?"axis":l,p=t.validateTooltipEventTypes,d=p===void 0?["axis"]:p,f=t.axisComponents,m=t.legendContent,g=t.formatAxisMap,b=t.defaultProps,_=function(A,N){var O=N.graphicalItems,V=N.stackGroups,M=N.offset,I=N.updateId,j=N.dataStartIndex,B=N.dataEndIndex,L=A.barSize,q=A.layout,F=A.barGap,H=A.barCategoryGap,U=A.maxBarSize,G=getAxisNameByLayout(q),J=G.numericAxisName,ee=G.cateAxisName,ae=hasGraphicalBarItem(O),W=[];return O.forEach(function(Q,Z){var ie=getDisplayedData(A.data,{graphicalItems:[Q],dataStartIndex:j,dataEndIndex:B}),ce=Q.type.defaultProps!==void 0?_objectSpread(_objectSpread({},Q.type.defaultProps),Q.props):Q.props,ue=ce.dataKey,fe=ce.maxBarSize,pe=ce["".concat(J,"Id")],ve=ce["".concat(ee,"Id")],he={},ye=f.reduce(function(Le,Ne){var qe,Ue,Fe=N["".concat(Ne.axisType,"Map")],$e=ce["".concat(Ne.axisType,"Id")];Fe&&Fe[$e]||Ne.axisType==="zAxis"||(process.env.NODE_ENV!=="production"?invariant(!1,"Specifying a(n) ".concat(Ne.axisType,"Id requires a corresponding ").concat(Ne.axisType,"Id on the targeted graphical component ").concat((qe=Q==null||(Ue=Q.type)===null||Ue===void 0?void 0:Ue.displayName)!==null&&qe!==void 0?qe:"")):invariant());var He=Fe[$e];return _objectSpread(_objectSpread({},Le),{},_defineProperty(_defineProperty({},Ne.axisType,He),"".concat(Ne.axisType,"Ticks"),getTicksOfAxis(He)))},he),de=ye[ee],le=ye["".concat(ee,"Ticks")],se=V&&V[pe]&&V[pe].hasStack&&getStackedDataOfItem(Q,V[pe].stackGroups),te=getDisplayName(Q.type).indexOf("Bar")>=0,xe=getBandSizeOfAxis(de,le),oe=[],be=ae&&getBarSizeList({barSize:L,stackGroups:V,totalSize:getCartesianAxisSize(ye,ee)});if(te){var _e,Ce,Te=isNil(fe)?U:fe,Ee=(_e=(Ce=getBandSizeOfAxis(de,le,!0))!==null&&Ce!==void 0?Ce:Te)!==null&&_e!==void 0?_e:0;oe=getBarPosition({barGap:F,barCategoryGap:H,bandSize:Ee!==xe?Ee:xe,sizeList:be[ve],maxBarSize:Te}),Ee!==xe&&(oe=oe.map(function(Le){return _objectSpread(_objectSpread({},Le),{},{position:_objectSpread(_objectSpread({},Le.position),{},{offset:Le.position.offset-Ee/2})})}))}var Me=Q&&Q.type&&Q.type.getComposedData;Me&&W.push({props:_objectSpread(_objectSpread({},Me(_objectSpread(_objectSpread({},ye),{},{displayedData:ie,props:A,dataKey:ue,item:Q,bandSize:xe,barPosition:oe,offset:M,stackedData:se,layout:q,dataStartIndex:j,dataEndIndex:B}))),{},_defineProperty(_defineProperty(_defineProperty({key:Q.key||"item-".concat(Z)},J,ye[J]),ee,ye[ee]),"animationId",I)),childIndex:parseChildIndex(Q,A.children),item:Q})}),W},S=function(A,N){var O=A.props,V=A.dataStartIndex,M=A.dataEndIndex,I=A.updateId;if(!validateWidthHeight({props:O}))return null;var j=O.children,B=O.layout,L=O.stackOffset,q=O.data,F=O.reverseStackOrder,H=getAxisNameByLayout(B),U=H.numericAxisName,G=H.cateAxisName,J=findAllByType(j,o),ee=getStackGroupsByAxisId(q,J,"".concat(U,"Id"),"".concat(G,"Id"),L,F),ae=f.reduce(function(ce,ue){var fe="".concat(ue.axisType,"Map");return _objectSpread(_objectSpread({},ce),{},_defineProperty({},fe,getAxisMap(O,_objectSpread(_objectSpread({},ue),{},{graphicalItems:J,stackGroups:ue.axisType===U&&ee,dataStartIndex:V,dataEndIndex:M}))))},{}),W=calculateOffset(_objectSpread(_objectSpread({},ae),{},{props:O,graphicalItems:J}),N==null?void 0:N.legendBBox);Object.keys(ae).forEach(function(ce){ae[ce]=g(O,ae[ce],W,ce.replace("Map",""),n)});var Q=ae["".concat(G,"Map")],Z=tooltipTicksGenerator(Q),ie=_(O,_objectSpread(_objectSpread({},ae),{},{dataStartIndex:V,dataEndIndex:M,updateId:I,graphicalItems:J,stackGroups:ee,offset:W}));return _objectSpread(_objectSpread({formattedGraphicalItems:ie,graphicalItems:J,offset:W,stackGroups:ee},Z),ae)},E=function(R){function A(N){var O,V,M;return _classCallCheck(this,A),M=_callSuper(this,A,[N]),_defineProperty(M,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),_defineProperty(M,"accessibilityManager",new AccessibilityManager),_defineProperty(M,"handleLegendBBoxUpdate",function(I){if(I){var j=M.state,B=j.dataStartIndex,L=j.dataEndIndex,q=j.updateId;M.setState(_objectSpread({legendBBox:I},S({props:M.props,dataStartIndex:B,dataEndIndex:L,updateId:q},_objectSpread(_objectSpread({},M.state),{},{legendBBox:I}))))}}),_defineProperty(M,"handleReceiveSyncEvent",function(I,j,B){if(M.props.syncId===I){if(B===M.eventEmitterSymbol&&typeof M.props.syncMethod!="function")return;M.applySyncEvent(j)}}),_defineProperty(M,"handleBrushChange",function(I){var j=I.startIndex,B=I.endIndex;if(j!==M.state.dataStartIndex||B!==M.state.dataEndIndex){var L=M.state.updateId;M.setState(function(){return _objectSpread({dataStartIndex:j,dataEndIndex:B},S({props:M.props,dataStartIndex:j,dataEndIndex:B,updateId:L},M.state))}),M.triggerSyncEvent({dataStartIndex:j,dataEndIndex:B})}}),_defineProperty(M,"handleMouseEnter",function(I){var j=M.getMouseInfo(I);if(j){var B=_objectSpread(_objectSpread({},j),{},{isTooltipActive:!0});M.setState(B),M.triggerSyncEvent(B);var L=M.props.onMouseEnter;isFunction$1(L)&&L(B,I)}}),_defineProperty(M,"triggeredAfterMouseMove",function(I){var j=M.getMouseInfo(I),B=j?_objectSpread(_objectSpread({},j),{},{isTooltipActive:!0}):{isTooltipActive:!1};M.setState(B),M.triggerSyncEvent(B);var L=M.props.onMouseMove;isFunction$1(L)&&L(B,I)}),_defineProperty(M,"handleItemMouseEnter",function(I){M.setState(function(){return{isTooltipActive:!0,activeItem:I,activePayload:I.tooltipPayload,activeCoordinate:I.tooltipPosition||{x:I.cx,y:I.cy}}})}),_defineProperty(M,"handleItemMouseLeave",function(){M.setState(function(){return{isTooltipActive:!1}})}),_defineProperty(M,"handleMouseMove",function(I){I.persist(),M.throttleTriggeredAfterMouseMove(I)}),_defineProperty(M,"handleMouseLeave",function(I){M.throttleTriggeredAfterMouseMove.cancel();var j={isTooltipActive:!1};M.setState(j),M.triggerSyncEvent(j);var B=M.props.onMouseLeave;isFunction$1(B)&&B(j,I)}),_defineProperty(M,"handleOuterEvent",function(I){var j=getReactEventByType(I),B=get$1(M.props,"".concat(j));if(j&&isFunction$1(B)){var L,q;/.*touch.*/i.test(j)?q=M.getMouseInfo(I.changedTouches[0]):q=M.getMouseInfo(I),B((L=q)!==null&&L!==void 0?L:{},I)}}),_defineProperty(M,"handleClick",function(I){var j=M.getMouseInfo(I);if(j){var B=_objectSpread(_objectSpread({},j),{},{isTooltipActive:!0});M.setState(B),M.triggerSyncEvent(B);var L=M.props.onClick;isFunction$1(L)&&L(B,I)}}),_defineProperty(M,"handleMouseDown",function(I){var j=M.props.onMouseDown;if(isFunction$1(j)){var B=M.getMouseInfo(I);j(B,I)}}),_defineProperty(M,"handleMouseUp",function(I){var j=M.props.onMouseUp;if(isFunction$1(j)){var B=M.getMouseInfo(I);j(B,I)}}),_defineProperty(M,"handleTouchMove",function(I){I.changedTouches!=null&&I.changedTouches.length>0&&M.throttleTriggeredAfterMouseMove(I.changedTouches[0])}),_defineProperty(M,"handleTouchStart",function(I){I.changedTouches!=null&&I.changedTouches.length>0&&M.handleMouseDown(I.changedTouches[0])}),_defineProperty(M,"handleTouchEnd",function(I){I.changedTouches!=null&&I.changedTouches.length>0&&M.handleMouseUp(I.changedTouches[0])}),_defineProperty(M,"handleDoubleClick",function(I){var j=M.props.onDoubleClick;if(isFunction$1(j)){var B=M.getMouseInfo(I);j(B,I)}}),_defineProperty(M,"handleContextMenu",function(I){var j=M.props.onContextMenu;if(isFunction$1(j)){var B=M.getMouseInfo(I);j(B,I)}}),_defineProperty(M,"triggerSyncEvent",function(I){M.props.syncId!==void 0&&eventCenter.emit(SYNC_EVENT,M.props.syncId,I,M.eventEmitterSymbol)}),_defineProperty(M,"applySyncEvent",function(I){var j=M.props,B=j.layout,L=j.syncMethod,q=M.state.updateId,F=I.dataStartIndex,H=I.dataEndIndex;if(I.dataStartIndex!==void 0||I.dataEndIndex!==void 0)M.setState(_objectSpread({dataStartIndex:F,dataEndIndex:H},S({props:M.props,dataStartIndex:F,dataEndIndex:H,updateId:q},M.state)));else if(I.activeTooltipIndex!==void 0){var U=I.chartX,G=I.chartY,J=I.activeTooltipIndex,ee=M.state,ae=ee.offset,W=ee.tooltipTicks;if(!ae)return;if(typeof L=="function")J=L(W,I);else if(L==="value"){J=-1;for(var Q=0;Q<W.length;Q++)if(W[Q].value===I.activeLabel){J=Q;break}}var Z=_objectSpread(_objectSpread({},ae),{},{x:ae.left,y:ae.top}),ie=Math.min(U,Z.x+Z.width),ce=Math.min(G,Z.y+Z.height),ue=W[J]&&W[J].value,fe=getTooltipContent(M.state,M.props.data,J),pe=W[J]?{x:B==="horizontal"?W[J].coordinate:ie,y:B==="horizontal"?ce:W[J].coordinate}:originCoordinate;M.setState(_objectSpread(_objectSpread({},I),{},{activeLabel:ue,activeCoordinate:pe,activePayload:fe,activeTooltipIndex:J}))}else M.setState(I)}),_defineProperty(M,"renderCursor",function(I){var j,B=M.state,L=B.isTooltipActive,q=B.activeCoordinate,F=B.activePayload,H=B.offset,U=B.activeTooltipIndex,G=B.tooltipAxisBandSize,J=M.getTooltipEventType(),ee=(j=I.props.active)!==null&&j!==void 0?j:L,ae=M.props.layout,W=I.key||"_recharts-cursor";return React.createElement(Cursor,{key:W,activeCoordinate:q,activePayload:F,activeTooltipIndex:U,chartName:n,element:I,isActive:ee,layout:ae,offset:H,tooltipAxisBandSize:G,tooltipEventType:J})}),_defineProperty(M,"renderPolarAxis",function(I,j,B){var L=get$1(I,"type.axisType"),q=get$1(M.state,"".concat(L,"Map")),F=I.type.defaultProps,H=F!==void 0?_objectSpread(_objectSpread({},F),I.props):I.props,U=q&&q[H["".concat(L,"Id")]];return React.cloneElement(I,_objectSpread(_objectSpread({},U),{},{className:clsx(L,U.className),key:I.key||"".concat(j,"-").concat(B),ticks:getTicksOfAxis(U,!0)}))}),_defineProperty(M,"renderPolarGrid",function(I){var j=I.props,B=j.radialLines,L=j.polarAngles,q=j.polarRadius,F=M.state,H=F.radiusAxisMap,U=F.angleAxisMap,G=getAnyElementOfObject(H),J=getAnyElementOfObject(U),ee=J.cx,ae=J.cy,W=J.innerRadius,Q=J.outerRadius;return React.cloneElement(I,{polarAngles:Array.isArray(L)?L:getTicksOfAxis(J,!0).map(function(Z){return Z.coordinate}),polarRadius:Array.isArray(q)?q:getTicksOfAxis(G,!0).map(function(Z){return Z.coordinate}),cx:ee,cy:ae,innerRadius:W,outerRadius:Q,key:I.key||"polar-grid",radialLines:B})}),_defineProperty(M,"renderLegend",function(){var I=M.state.formattedGraphicalItems,j=M.props,B=j.children,L=j.width,q=j.height,F=M.props.margin||{},H=L-(F.left||0)-(F.right||0),U=getLegendProps({children:B,formattedGraphicalItems:I,legendWidth:H,legendContent:m});if(!U)return null;var G=U.item,J=_objectWithoutProperties(U,_excluded);return React.cloneElement(G,_objectSpread(_objectSpread({},J),{},{chartWidth:L,chartHeight:q,margin:F,onBBoxUpdate:M.handleLegendBBoxUpdate}))}),_defineProperty(M,"renderTooltip",function(){var I,j=M.props,B=j.children,L=j.accessibilityLayer,q=findChildByType(B,Tooltip);if(!q)return null;var F=M.state,H=F.isTooltipActive,U=F.activeCoordinate,G=F.activePayload,J=F.activeLabel,ee=F.offset,ae=(I=q.props.active)!==null&&I!==void 0?I:H;return React.cloneElement(q,{viewBox:_objectSpread(_objectSpread({},ee),{},{x:ee.left,y:ee.top}),active:ae,label:J,payload:ae?G:[],coordinate:U,accessibilityLayer:L})}),_defineProperty(M,"renderBrush",function(I){var j=M.props,B=j.margin,L=j.data,q=M.state,F=q.offset,H=q.dataStartIndex,U=q.dataEndIndex,G=q.updateId;return React.cloneElement(I,{key:I.key||"_recharts-brush",onChange:combineEventHandlers(M.handleBrushChange,I.props.onChange),data:L,x:isNumber(I.props.x)?I.props.x:F.left,y:isNumber(I.props.y)?I.props.y:F.top+F.height+F.brushBottom-(B.bottom||0),width:isNumber(I.props.width)?I.props.width:F.width,startIndex:H,endIndex:U,updateId:"brush-".concat(G)})}),_defineProperty(M,"renderReferenceElement",function(I,j,B){if(!I)return null;var L=M,q=L.clipPathId,F=M.state,H=F.xAxisMap,U=F.yAxisMap,G=F.offset,J=I.type.defaultProps||{},ee=I.props,ae=ee.xAxisId,W=ae===void 0?J.xAxisId:ae,Q=ee.yAxisId,Z=Q===void 0?J.yAxisId:Q;return React.cloneElement(I,{key:I.key||"".concat(j,"-").concat(B),xAxis:H[W],yAxis:U[Z],viewBox:{x:G.left,y:G.top,width:G.width,height:G.height},clipPathId:q})}),_defineProperty(M,"renderActivePoints",function(I){var j=I.item,B=I.activePoint,L=I.basePoint,q=I.childIndex,F=I.isRange,H=[],U=j.props.key,G=j.item.type.defaultProps!==void 0?_objectSpread(_objectSpread({},j.item.type.defaultProps),j.item.props):j.item.props,J=G.activeDot,ee=G.dataKey,ae=_objectSpread(_objectSpread({index:q,dataKey:ee,cx:B.x,cy:B.y,r:4,fill:getMainColorOfGraphicItem(j.item),strokeWidth:2,stroke:"#fff",payload:B.payload,value:B.value},filterProps(J,!1)),adaptEventHandlers(J));return H.push(A.renderActiveDot(J,ae,"".concat(U,"-activePoint-").concat(q))),L?H.push(A.renderActiveDot(J,_objectSpread(_objectSpread({},ae),{},{cx:L.x,cy:L.y}),"".concat(U,"-basePoint-").concat(q))):F&&H.push(null),H}),_defineProperty(M,"renderGraphicChild",function(I,j,B){var L=M.filterFormatItem(I,j,B);if(!L)return null;var q=M.getTooltipEventType(),F=M.state,H=F.isTooltipActive,U=F.tooltipAxis,G=F.activeTooltipIndex,J=F.activeLabel,ee=M.props.children,ae=findChildByType(ee,Tooltip),W=L.props,Q=W.points,Z=W.isRange,ie=W.baseLine,ce=L.item.type.defaultProps!==void 0?_objectSpread(_objectSpread({},L.item.type.defaultProps),L.item.props):L.item.props,ue=ce.activeDot,fe=ce.hide,pe=ce.activeBar,ve=ce.activeShape,he=!!(!fe&&H&&ae&&(ue||pe||ve)),ye={};q!=="axis"&&ae&&ae.props.trigger==="click"?ye={onClick:combineEventHandlers(M.handleItemMouseEnter,I.props.onClick)}:q!=="axis"&&(ye={onMouseLeave:combineEventHandlers(M.handleItemMouseLeave,I.props.onMouseLeave),onMouseEnter:combineEventHandlers(M.handleItemMouseEnter,I.props.onMouseEnter)});var de=React.cloneElement(I,_objectSpread(_objectSpread({},L.props),ye));function le(Ne){return typeof U.dataKey=="function"?U.dataKey(Ne.payload):null}if(he)if(G>=0){var se,te;if(U.dataKey&&!U.allowDuplicatedCategory){var xe=typeof U.dataKey=="function"?le:"payload.".concat(U.dataKey.toString());se=findEntryInArray(Q,xe,J),te=Z&&ie&&findEntryInArray(ie,xe,J)}else se=Q==null?void 0:Q[G],te=Z&&ie&&ie[G];if(ve||pe){var oe=I.props.activeIndex!==void 0?I.props.activeIndex:G;return[React.cloneElement(I,_objectSpread(_objectSpread(_objectSpread({},L.props),ye),{},{activeIndex:oe})),null,null]}if(!isNil(se))return[de].concat(_toConsumableArray(M.renderActivePoints({item:L,activePoint:se,basePoint:te,childIndex:G,isRange:Z})))}else{var be,_e=(be=M.getItemByXY(M.state.activeCoordinate))!==null&&be!==void 0?be:{graphicalItem:de},Ce=_e.graphicalItem,Te=Ce.item,Ee=Te===void 0?I:Te,Me=Ce.childIndex,Le=_objectSpread(_objectSpread(_objectSpread({},L.props),ye),{},{activeIndex:Me});return[React.cloneElement(Ee,Le),null,null]}return Z?[de,null,null]:[de,null]}),_defineProperty(M,"renderCustomized",function(I,j,B){return React.cloneElement(I,_objectSpread(_objectSpread({key:"recharts-customized-".concat(B)},M.props),M.state))}),_defineProperty(M,"renderMap",{CartesianGrid:{handler:renderAsIs,once:!0},ReferenceArea:{handler:M.renderReferenceElement},ReferenceLine:{handler:renderAsIs},ReferenceDot:{handler:M.renderReferenceElement},XAxis:{handler:renderAsIs},YAxis:{handler:renderAsIs},Brush:{handler:M.renderBrush,once:!0},Bar:{handler:M.renderGraphicChild},Line:{handler:M.renderGraphicChild},Area:{handler:M.renderGraphicChild},Radar:{handler:M.renderGraphicChild},RadialBar:{handler:M.renderGraphicChild},Scatter:{handler:M.renderGraphicChild},Pie:{handler:M.renderGraphicChild},Funnel:{handler:M.renderGraphicChild},Tooltip:{handler:M.renderCursor,once:!0},PolarGrid:{handler:M.renderPolarGrid,once:!0},PolarAngleAxis:{handler:M.renderPolarAxis},PolarRadiusAxis:{handler:M.renderPolarAxis},Customized:{handler:M.renderCustomized}}),M.clipPathId="".concat((O=N.id)!==null&&O!==void 0?O:uniqueId("recharts"),"-clip"),M.throttleTriggeredAfterMouseMove=throttle(M.triggeredAfterMouseMove,(V=N.throttleDelay)!==null&&V!==void 0?V:1e3/60),M.state={},M}return _inherits(A,R),_createClass(A,[{key:"componentDidMount",value:function(){var O,V;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(O=this.props.margin.left)!==null&&O!==void 0?O:0,top:(V=this.props.margin.top)!==null&&V!==void 0?V:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var O=this.props,V=O.children,M=O.data,I=O.height,j=O.layout,B=findChildByType(V,Tooltip);if(B){var L=B.props.defaultIndex;if(!(typeof L!="number"||L<0||L>this.state.tooltipTicks.length-1)){var q=this.state.tooltipTicks[L]&&this.state.tooltipTicks[L].value,F=getTooltipContent(this.state,M,L,q),H=this.state.tooltipTicks[L].coordinate,U=(this.state.offset.top+I)/2,G=j==="horizontal",J=G?{x:H,y:U}:{y:H,x:U},ee=this.state.formattedGraphicalItems.find(function(W){var Q=W.item;return Q.type.name==="Scatter"});ee&&(J=_objectSpread(_objectSpread({},J),ee.props.points[L].tooltipPosition),F=ee.props.points[L].tooltipPayload);var ae={activeTooltipIndex:L,isTooltipActive:!0,activeLabel:q,activePayload:F,activeCoordinate:J};this.setState(ae),this.renderCursor(B),this.accessibilityManager.setIndex(L)}}}},{key:"getSnapshotBeforeUpdate",value:function(O,V){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==V.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==O.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==O.margin){var M,I;this.accessibilityManager.setDetails({offset:{left:(M=this.props.margin.left)!==null&&M!==void 0?M:0,top:(I=this.props.margin.top)!==null&&I!==void 0?I:0}})}return null}},{key:"componentDidUpdate",value:function(O){isChildrenEqual([findChildByType(O.children,Tooltip)],[findChildByType(this.props.children,Tooltip)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var O=findChildByType(this.props.children,Tooltip);if(O&&typeof O.props.shared=="boolean"){var V=O.props.shared?"axis":"item";return d.indexOf(V)>=0?V:u}return u}},{key:"getMouseInfo",value:function(O){if(!this.container)return null;var V=this.container,M=V.getBoundingClientRect(),I=getOffset(M),j={chartX:Math.round(O.pageX-I.left),chartY:Math.round(O.pageY-I.top)},B=M.width/V.offsetWidth||1,L=this.inRange(j.chartX,j.chartY,B);if(!L)return null;var q=this.state,F=q.xAxisMap,H=q.yAxisMap,U=this.getTooltipEventType(),G=getTooltipData(this.state,this.props.data,this.props.layout,L);if(U!=="axis"&&F&&H){var J=getAnyElementOfObject(F).scale,ee=getAnyElementOfObject(H).scale,ae=J&&J.invert?J.invert(j.chartX):null,W=ee&&ee.invert?ee.invert(j.chartY):null;return _objectSpread(_objectSpread({},j),{},{xValue:ae,yValue:W},G)}return G?_objectSpread(_objectSpread({},j),G):null}},{key:"inRange",value:function(O,V){var M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,I=this.props.layout,j=O/M,B=V/M;if(I==="horizontal"||I==="vertical"){var L=this.state.offset,q=j>=L.left&&j<=L.left+L.width&&B>=L.top&&B<=L.top+L.height;return q?{x:j,y:B}:null}var F=this.state,H=F.angleAxisMap,U=F.radiusAxisMap;if(H&&U){var G=getAnyElementOfObject(H);return inRangeOfSector({x:j,y:B},G)}return null}},{key:"parseEventsOfWrapper",value:function(){var O=this.props.children,V=this.getTooltipEventType(),M=findChildByType(O,Tooltip),I={};M&&V==="axis"&&(M.props.trigger==="click"?I={onClick:this.handleClick}:I={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var j=adaptEventHandlers(this.props,this.handleOuterEvent);return _objectSpread(_objectSpread({},j),I)}},{key:"addListener",value:function(){eventCenter.on(SYNC_EVENT,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){eventCenter.removeListener(SYNC_EVENT,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(O,V,M){for(var I=this.state.formattedGraphicalItems,j=0,B=I.length;j<B;j++){var L=I[j];if(L.item===O||L.props.key===O.key||V===getDisplayName(L.item.type)&&M===L.childIndex)return L}return null}},{key:"renderClipPath",value:function(){var O=this.clipPathId,V=this.state.offset,M=V.left,I=V.top,j=V.height,B=V.width;return React.createElement("defs",null,React.createElement("clipPath",{id:O},React.createElement("rect",{x:M,y:I,height:j,width:B})))}},{key:"getXScales",value:function(){var O=this.state.xAxisMap;return O?Object.entries(O).reduce(function(V,M){var I=_slicedToArray(M,2),j=I[0],B=I[1];return _objectSpread(_objectSpread({},V),{},_defineProperty({},j,B.scale))},{}):null}},{key:"getYScales",value:function(){var O=this.state.yAxisMap;return O?Object.entries(O).reduce(function(V,M){var I=_slicedToArray(M,2),j=I[0],B=I[1];return _objectSpread(_objectSpread({},V),{},_defineProperty({},j,B.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(O){var V;return(V=this.state.xAxisMap)===null||V===void 0||(V=V[O])===null||V===void 0?void 0:V.scale}},{key:"getYScaleByAxisId",value:function(O){var V;return(V=this.state.yAxisMap)===null||V===void 0||(V=V[O])===null||V===void 0?void 0:V.scale}},{key:"getItemByXY",value:function(O){var V=this.state,M=V.formattedGraphicalItems,I=V.activeItem;if(M&&M.length)for(var j=0,B=M.length;j<B;j++){var L=M[j],q=L.props,F=L.item,H=F.type.defaultProps!==void 0?_objectSpread(_objectSpread({},F.type.defaultProps),F.props):F.props,U=getDisplayName(F.type);if(U==="Bar"){var G=(q.data||[]).find(function(W){return isInRectangle(O,W)});if(G)return{graphicalItem:L,payload:G}}else if(U==="RadialBar"){var J=(q.data||[]).find(function(W){return inRangeOfSector(O,W)});if(J)return{graphicalItem:L,payload:J}}else if(isFunnel(L,I)||isPie(L,I)||isScatter(L,I)){var ee=getActiveShapeIndexForTooltip({graphicalItem:L,activeTooltipItem:I,itemData:H.data}),ae=H.activeIndex===void 0?ee:H.activeIndex;return{graphicalItem:_objectSpread(_objectSpread({},L),{},{childIndex:ae}),payload:isScatter(L,I)?H.data[ee]:L.props.data[ee]}}}return null}},{key:"render",value:function(){var O=this;if(!validateWidthHeight(this))return null;var V=this.props,M=V.children,I=V.className,j=V.width,B=V.height,L=V.style,q=V.compact,F=V.title,H=V.desc,U=_objectWithoutProperties(V,_excluded2),G=filterProps(U,!1);if(q)return React.createElement(ChartLayoutContextProvider,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},React.createElement(Surface,_extends({},G,{width:j,height:B,title:F,desc:H}),this.renderClipPath(),renderByOrder(M,this.renderMap)));if(this.props.accessibilityLayer){var J,ee;G.tabIndex=(J=this.props.tabIndex)!==null&&J!==void 0?J:0,G.role=(ee=this.props.role)!==null&&ee!==void 0?ee:"application",G.onKeyDown=function(W){O.accessibilityManager.keyboardEvent(W)},G.onFocus=function(){O.accessibilityManager.focus()}}var ae=this.parseEventsOfWrapper();return React.createElement(ChartLayoutContextProvider,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},React.createElement("div",_extends({className:clsx("recharts-wrapper",I),style:_objectSpread({position:"relative",cursor:"default",width:j,height:B},L)},ae,{ref:function(Q){O.container=Q}}),React.createElement(Surface,_extends({},G,{width:j,height:B,title:F,desc:H,style:FULL_WIDTH_AND_HEIGHT}),this.renderClipPath(),renderByOrder(M,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(React.Component);_defineProperty(E,"displayName",n),_defineProperty(E,"defaultProps",_objectSpread({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},b)),_defineProperty(E,"getDerivedStateFromProps",function(R,A){var N=R.dataKey,O=R.data,V=R.children,M=R.width,I=R.height,j=R.layout,B=R.stackOffset,L=R.margin,q=A.dataStartIndex,F=A.dataEndIndex;if(A.updateId===void 0){var H=createDefaultState(R);return _objectSpread(_objectSpread(_objectSpread({},H),{},{updateId:0},S(_objectSpread(_objectSpread({props:R},H),{},{updateId:0}),A)),{},{prevDataKey:N,prevData:O,prevWidth:M,prevHeight:I,prevLayout:j,prevStackOffset:B,prevMargin:L,prevChildren:V})}if(N!==A.prevDataKey||O!==A.prevData||M!==A.prevWidth||I!==A.prevHeight||j!==A.prevLayout||B!==A.prevStackOffset||!shallowEqual$1(L,A.prevMargin)){var U=createDefaultState(R),G={chartX:A.chartX,chartY:A.chartY,isTooltipActive:A.isTooltipActive},J=_objectSpread(_objectSpread({},getTooltipData(A,O,j)),{},{updateId:A.updateId+1}),ee=_objectSpread(_objectSpread(_objectSpread({},U),G),J);return _objectSpread(_objectSpread(_objectSpread({},ee),S(_objectSpread({props:R},ee),A)),{},{prevDataKey:N,prevData:O,prevWidth:M,prevHeight:I,prevLayout:j,prevStackOffset:B,prevMargin:L,prevChildren:V})}if(!isChildrenEqual(V,A.prevChildren)){var ae,W,Q,Z,ie=findChildByType(V,Brush),ce=ie&&(ae=(W=ie.props)===null||W===void 0?void 0:W.startIndex)!==null&&ae!==void 0?ae:q,ue=ie&&(Q=(Z=ie.props)===null||Z===void 0?void 0:Z.endIndex)!==null&&Q!==void 0?Q:F,fe=ce!==q||ue!==F,pe=!isNil(O),ve=pe&&!fe?A.updateId:A.updateId+1;return _objectSpread(_objectSpread({updateId:ve},S(_objectSpread(_objectSpread({props:R},A),{},{updateId:ve,dataStartIndex:ce,dataEndIndex:ue}),A)),{},{prevChildren:V,dataStartIndex:ce,dataEndIndex:ue})}return null}),_defineProperty(E,"renderActiveDot",function(R,A,N){var O;return React.isValidElement(R)?O=React.cloneElement(R,A):isFunction$1(R)?O=R(A):O=React.createElement(Dot,A),React.createElement(Layer,{className:"recharts-active-dot",key:N},O)});var C=React.forwardRef(function(A,N){return React.createElement(E,_extends({},A,{ref:N}))});return C.displayName=E.displayName,C},AreaChart$1=generateCategoricalChart({chartName:"AreaChart",GraphicalChild:Area,axisComponents:[{axisType:"xAxis",AxisComp:XAxis},{axisType:"yAxis",AxisComp:YAxis}],formatAxisMap});function ChartTooltipContent({active:e,payload:t,label:n,units:o="",unitsPosition:l="right",className:u}){return!e||!(t!=null&&t.length)?null:jsxRuntime.jsxs("div",{className:cn("bg-background border border-border rounded-md p-3 shadow-md",u),children:[jsxRuntime.jsx("p",{className:"font-medium text-sm mb-2",children:n}),jsxRuntime.jsx("div",{className:"space-y-2",children:t.map((p,d)=>{const f=p.stroke||p.color||"var(--primary, #8884d8)",m=p.value.toLocaleString();return jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx("div",{className:"h-2 w-2 rounded-full",style:{backgroundColor:f}}),jsxRuntime.jsx("span",{className:"capitalize",children:p.dataKey})]}),jsxRuntime.jsxs("p",{className:"text-sm font-medium",children:[l==="left"&&o,m,l==="right"&&o]})]},d)})})]})}function AreaChart({data:e,units:t,unitsPosition:n="right",width:o="100%",height:l=300,className:u}){if(!(e!=null&&e.length))return jsxRuntime.jsx("div",{className:"flex items-center justify-center h-40 text-muted-foreground",children:"No data available"});const p=Object.keys(e[0])[0],d=Object.keys(e[0]).filter(m=>m!==p);if(!d.length)return jsxRuntime.jsx("div",{className:"flex items-center justify-center h-40 text-muted-foreground",children:"Invalid data format"});const f=m=>n==="left"?`${t||""}${m}`:`${m}${t||""}`;return jsxRuntime.jsx("div",{className:cn("w-full",u),children:jsxRuntime.jsx(ResponsiveContainer,{width:o,height:l,children:jsxRuntime.jsxs(AreaChart$1,{data:e,margin:{top:10,right:30,left:0,bottom:0},children:[jsxRuntime.jsx("defs",{children:d.map(m=>jsxRuntime.jsxs("linearGradient",{id:`gradient-${m}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[jsxRuntime.jsx("stop",{offset:"5%",stopColor:"var(--primary, #8884d8)",stopOpacity:.8}),jsxRuntime.jsx("stop",{offset:"95%",stopColor:"var(--primary, #8884d8)",stopOpacity:.1})]},m))}),jsxRuntime.jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-border/50"}),jsxRuntime.jsx(XAxis,{dataKey:p,className:"text-xs text-muted-foreground",tickLine:!1,axisLine:!1}),jsxRuntime.jsx(YAxis,{className:"text-xs text-muted-foreground",tickLine:!1,axisLine:!1,tickFormatter:f}),jsxRuntime.jsx(Tooltip,{content:jsxRuntime.jsx(ChartTooltipContent,{units:t,unitsPosition:n}),cursor:{stroke:"var(--muted)",strokeWidth:1}}),d.map(m=>jsxRuntime.jsx(Area,{type:"monotone",dataKey:m,stroke:"var(--primary, #8884d8)",fillOpacity:.6,fill:`url(#gradient-${m})`,strokeWidth:2},m))]})})})}/*! *****************************************************************************
|
|
403
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(e,t)}}function _iterableToArray(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,o)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach(function(o){_defineProperty(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function _defineProperty(e,t,n){return t=_toPropertyKey(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return _typeof(t)=="symbol"?t:t+""}function _toPrimitive(e,t){if(_typeof(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(_typeof(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ORIENT_MAP={xAxis:["bottom","top"],yAxis:["left","right"]},FULL_WIDTH_AND_HEIGHT={width:"100%",height:"100%"},originCoordinate={x:0,y:0};function renderAsIs(e){return e}var calculateTooltipPos=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},getActiveCoordinate=function(t,n,o,l){var u=n.find(function(g){return g&&g.index===o});if(u){if(t==="horizontal")return{x:u.coordinate,y:l.y};if(t==="vertical")return{x:l.x,y:u.coordinate};if(t==="centric"){var p=u.coordinate,d=l.radius;return _objectSpread(_objectSpread(_objectSpread({},l),polarToCartesian(l.cx,l.cy,d,p)),{},{angle:p,radius:d})}var f=u.coordinate,m=l.angle;return _objectSpread(_objectSpread(_objectSpread({},l),polarToCartesian(l.cx,l.cy,f,m)),{},{angle:m,radius:f})}return originCoordinate},getDisplayedData=function(t,n){var o=n.graphicalItems,l=n.dataStartIndex,u=n.dataEndIndex,p=(o??[]).reduce(function(d,f){var m=f.props.data;return m&&m.length?[].concat(_toConsumableArray(d),_toConsumableArray(m)):d},[]);return p.length>0?p:t&&t.length&&isNumber(l)&&isNumber(u)?t.slice(l,u+1):[]};function getDefaultDomainByAxisType(e){return e==="number"?[0,"auto"]:void 0}var getTooltipContent=function(t,n,o,l){var u=t.graphicalItems,p=t.tooltipAxis,d=getDisplayedData(n,t);return o<0||!u||!u.length||o>=d.length?null:u.reduce(function(f,m){var g,b=(g=m.props.data)!==null&&g!==void 0?g:n;b&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=o&&(b=b.slice(t.dataStartIndex,t.dataEndIndex+1));var _;if(p.dataKey&&!p.allowDuplicatedCategory){var S=b===void 0?d:b;_=findEntryInArray(S,p.dataKey,l)}else _=b&&b[o]||d[o];return _?[].concat(_toConsumableArray(f),[getTooltipItem(m,_)]):f},[])},getTooltipData=function(t,n,o,l){var u=l||{x:t.chartX,y:t.chartY},p=calculateTooltipPos(u,o),d=t.orderedTooltipTicks,f=t.tooltipAxis,m=t.tooltipTicks,g=calculateActiveTickIndex(p,d,m,f);if(g>=0&&m){var b=m[g]&&m[g].value,_=getTooltipContent(t,n,g,b),S=getActiveCoordinate(o,d,g,u);return{activeTooltipIndex:g,activeLabel:b,activePayload:_,activeCoordinate:S}}return null},getAxisMapByAxes=function(t,n){var o=n.axes,l=n.graphicalItems,u=n.axisType,p=n.axisIdKey,d=n.stackGroups,f=n.dataStartIndex,m=n.dataEndIndex,g=t.layout,b=t.children,_=t.stackOffset,S=isCategoricalAxis(g,u);return o.reduce(function(E,C){var R,A=C.type.defaultProps!==void 0?_objectSpread(_objectSpread({},C.type.defaultProps),C.props):C.props,N=A.type,O=A.dataKey,V=A.allowDataOverflow,M=A.allowDuplicatedCategory,I=A.scale,j=A.ticks,B=A.includeHidden,L=A[p];if(E[L])return E;var q=getDisplayedData(t.data,{graphicalItems:l.filter(function(ce){var ue,fe=p in ce.props?ce.props[p]:(ue=ce.type.defaultProps)===null||ue===void 0?void 0:ue[p];return fe===L}),dataStartIndex:f,dataEndIndex:m}),F=q.length,H,U,G;isDomainSpecifiedByUser(A.domain,V,N)&&(H=parseSpecifiedDomain(A.domain,null,V),S&&(N==="number"||I!=="auto")&&(G=getDomainOfDataByKey(q,O,"category")));var J=getDefaultDomainByAxisType(N);if(!H||H.length===0){var ee,ae=(ee=A.domain)!==null&&ee!==void 0?ee:J;if(O){if(H=getDomainOfDataByKey(q,O,N),N==="category"&&S){var W=hasDuplicate(H);M&&W?(U=H,H=range(0,F)):M||(H=parseDomainOfCategoryAxis(ae,H,C).reduce(function(ce,ue){return ce.indexOf(ue)>=0?ce:[].concat(_toConsumableArray(ce),[ue])},[]))}else if(N==="category")M?H=H.filter(function(ce){return ce!==""&&!isNil(ce)}):H=parseDomainOfCategoryAxis(ae,H,C).reduce(function(ce,ue){return ce.indexOf(ue)>=0||ue===""||isNil(ue)?ce:[].concat(_toConsumableArray(ce),[ue])},[]);else if(N==="number"){var Q=parseErrorBarsOfAxis(q,l.filter(function(ce){var ue,fe,pe=p in ce.props?ce.props[p]:(ue=ce.type.defaultProps)===null||ue===void 0?void 0:ue[p],ve="hide"in ce.props?ce.props.hide:(fe=ce.type.defaultProps)===null||fe===void 0?void 0:fe.hide;return pe===L&&(B||!ve)}),O,u,g);Q&&(H=Q)}S&&(N==="number"||I!=="auto")&&(G=getDomainOfDataByKey(q,O,"category"))}else S?H=range(0,F):d&&d[L]&&d[L].hasStack&&N==="number"?H=_==="expand"?[0,1]:getDomainOfStackGroups(d[L].stackGroups,f,m):H=getDomainOfItemsWithSameAxis(q,l.filter(function(ce){var ue=p in ce.props?ce.props[p]:ce.type.defaultProps[p],fe="hide"in ce.props?ce.props.hide:ce.type.defaultProps.hide;return ue===L&&(B||!fe)}),N,g,!0);if(N==="number")H=detectReferenceElementsDomain(b,H,L,u,j),ae&&(H=parseSpecifiedDomain(ae,H,V));else if(N==="category"&&ae){var Z=ae,ie=H.every(function(ce){return Z.indexOf(ce)>=0});ie&&(H=Z)}}return _objectSpread(_objectSpread({},E),{},_defineProperty({},L,_objectSpread(_objectSpread({},A),{},{axisType:u,domain:H,categoricalDomain:G,duplicateDomain:U,originalDomain:(R=A.domain)!==null&&R!==void 0?R:J,isCategorical:S,layout:g})))},{})},getAxisMapByItems=function(t,n){var o=n.graphicalItems,l=n.Axis,u=n.axisType,p=n.axisIdKey,d=n.stackGroups,f=n.dataStartIndex,m=n.dataEndIndex,g=t.layout,b=t.children,_=getDisplayedData(t.data,{graphicalItems:o,dataStartIndex:f,dataEndIndex:m}),S=_.length,E=isCategoricalAxis(g,u),C=-1;return o.reduce(function(R,A){var N=A.type.defaultProps!==void 0?_objectSpread(_objectSpread({},A.type.defaultProps),A.props):A.props,O=N[p],V=getDefaultDomainByAxisType("number");if(!R[O]){C++;var M;return E?M=range(0,S):d&&d[O]&&d[O].hasStack?(M=getDomainOfStackGroups(d[O].stackGroups,f,m),M=detectReferenceElementsDomain(b,M,O,u)):(M=parseSpecifiedDomain(V,getDomainOfItemsWithSameAxis(_,o.filter(function(I){var j,B,L=p in I.props?I.props[p]:(j=I.type.defaultProps)===null||j===void 0?void 0:j[p],q="hide"in I.props?I.props.hide:(B=I.type.defaultProps)===null||B===void 0?void 0:B.hide;return L===O&&!q}),"number",g),l.defaultProps.allowDataOverflow),M=detectReferenceElementsDomain(b,M,O,u)),_objectSpread(_objectSpread({},R),{},_defineProperty({},O,_objectSpread(_objectSpread({axisType:u},l.defaultProps),{},{hide:!0,orientation:get$1(ORIENT_MAP,"".concat(u,".").concat(C%2),null),domain:M,originalDomain:V,isCategorical:E,layout:g})))}return R},{})},getAxisMap=function(t,n){var o=n.axisType,l=o===void 0?"xAxis":o,u=n.AxisComp,p=n.graphicalItems,d=n.stackGroups,f=n.dataStartIndex,m=n.dataEndIndex,g=t.children,b="".concat(l,"Id"),_=findAllByType(g,u),S={};return _&&_.length?S=getAxisMapByAxes(t,{axes:_,graphicalItems:p,axisType:l,axisIdKey:b,stackGroups:d,dataStartIndex:f,dataEndIndex:m}):p&&p.length&&(S=getAxisMapByItems(t,{Axis:u,graphicalItems:p,axisType:l,axisIdKey:b,stackGroups:d,dataStartIndex:f,dataEndIndex:m})),S},tooltipTicksGenerator=function(t){var n=getAnyElementOfObject(t),o=getTicksOfAxis(n,!1,!0);return{tooltipTicks:o,orderedTooltipTicks:sortBy(o,function(l){return l.coordinate}),tooltipAxis:n,tooltipAxisBandSize:getBandSizeOfAxis(n,o)}},createDefaultState=function(t){var n=t.children,o=t.defaultShowTooltip,l=findChildByType(n,Brush),u=0,p=0;return t.data&&t.data.length!==0&&(p=t.data.length-1),l&&l.props&&(l.props.startIndex>=0&&(u=l.props.startIndex),l.props.endIndex>=0&&(p=l.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:u,dataEndIndex:p,activeTooltipIndex:-1,isTooltipActive:!!o}},hasGraphicalBarItem=function(t){return!t||!t.length?!1:t.some(function(n){var o=getDisplayName(n&&n.type);return o&&o.indexOf("Bar")>=0})},getAxisNameByLayout=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},calculateOffset=function(t,n){var o=t.props,l=t.graphicalItems,u=t.xAxisMap,p=u===void 0?{}:u,d=t.yAxisMap,f=d===void 0?{}:d,m=o.width,g=o.height,b=o.children,_=o.margin||{},S=findChildByType(b,Brush),E=findChildByType(b,Legend),C=Object.keys(f).reduce(function(M,I){var j=f[I],B=j.orientation;return!j.mirror&&!j.hide?_objectSpread(_objectSpread({},M),{},_defineProperty({},B,M[B]+j.width)):M},{left:_.left||0,right:_.right||0}),R=Object.keys(p).reduce(function(M,I){var j=p[I],B=j.orientation;return!j.mirror&&!j.hide?_objectSpread(_objectSpread({},M),{},_defineProperty({},B,get$1(M,"".concat(B))+j.height)):M},{top:_.top||0,bottom:_.bottom||0}),A=_objectSpread(_objectSpread({},R),C),N=A.bottom;S&&(A.bottom+=S.props.height||Brush.defaultProps.height),E&&n&&(A=appendOffsetOfLegend(A,l,o,n));var O=m-A.left-A.right,V=g-A.top-A.bottom;return _objectSpread(_objectSpread({brushBottom:N},A),{},{width:Math.max(O,0),height:Math.max(V,0)})},getCartesianAxisSize=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},generateCategoricalChart=function(t){var n=t.chartName,o=t.GraphicalChild,l=t.defaultTooltipEventType,u=l===void 0?"axis":l,p=t.validateTooltipEventTypes,d=p===void 0?["axis"]:p,f=t.axisComponents,m=t.legendContent,g=t.formatAxisMap,b=t.defaultProps,_=function(A,N){var O=N.graphicalItems,V=N.stackGroups,M=N.offset,I=N.updateId,j=N.dataStartIndex,B=N.dataEndIndex,L=A.barSize,q=A.layout,F=A.barGap,H=A.barCategoryGap,U=A.maxBarSize,G=getAxisNameByLayout(q),J=G.numericAxisName,ee=G.cateAxisName,ae=hasGraphicalBarItem(O),W=[];return O.forEach(function(Q,Z){var ie=getDisplayedData(A.data,{graphicalItems:[Q],dataStartIndex:j,dataEndIndex:B}),ce=Q.type.defaultProps!==void 0?_objectSpread(_objectSpread({},Q.type.defaultProps),Q.props):Q.props,ue=ce.dataKey,fe=ce.maxBarSize,pe=ce["".concat(J,"Id")],ve=ce["".concat(ee,"Id")],he={},ye=f.reduce(function(Le,Ne){var qe,Ue,Fe=N["".concat(Ne.axisType,"Map")],$e=ce["".concat(Ne.axisType,"Id")];Fe&&Fe[$e]||Ne.axisType==="zAxis"||(process.env.NODE_ENV!=="production"?invariant(!1,"Specifying a(n) ".concat(Ne.axisType,"Id requires a corresponding ").concat(Ne.axisType,"Id on the targeted graphical component ").concat((qe=Q==null||(Ue=Q.type)===null||Ue===void 0?void 0:Ue.displayName)!==null&&qe!==void 0?qe:"")):invariant());var He=Fe[$e];return _objectSpread(_objectSpread({},Le),{},_defineProperty(_defineProperty({},Ne.axisType,He),"".concat(Ne.axisType,"Ticks"),getTicksOfAxis(He)))},he),de=ye[ee],le=ye["".concat(ee,"Ticks")],se=V&&V[pe]&&V[pe].hasStack&&getStackedDataOfItem(Q,V[pe].stackGroups),te=getDisplayName(Q.type).indexOf("Bar")>=0,xe=getBandSizeOfAxis(de,le),oe=[],be=ae&&getBarSizeList({barSize:L,stackGroups:V,totalSize:getCartesianAxisSize(ye,ee)});if(te){var _e,Ce,Te=isNil(fe)?U:fe,Ee=(_e=(Ce=getBandSizeOfAxis(de,le,!0))!==null&&Ce!==void 0?Ce:Te)!==null&&_e!==void 0?_e:0;oe=getBarPosition({barGap:F,barCategoryGap:H,bandSize:Ee!==xe?Ee:xe,sizeList:be[ve],maxBarSize:Te}),Ee!==xe&&(oe=oe.map(function(Le){return _objectSpread(_objectSpread({},Le),{},{position:_objectSpread(_objectSpread({},Le.position),{},{offset:Le.position.offset-Ee/2})})}))}var Me=Q&&Q.type&&Q.type.getComposedData;Me&&W.push({props:_objectSpread(_objectSpread({},Me(_objectSpread(_objectSpread({},ye),{},{displayedData:ie,props:A,dataKey:ue,item:Q,bandSize:xe,barPosition:oe,offset:M,stackedData:se,layout:q,dataStartIndex:j,dataEndIndex:B}))),{},_defineProperty(_defineProperty(_defineProperty({key:Q.key||"item-".concat(Z)},J,ye[J]),ee,ye[ee]),"animationId",I)),childIndex:parseChildIndex(Q,A.children),item:Q})}),W},S=function(A,N){var O=A.props,V=A.dataStartIndex,M=A.dataEndIndex,I=A.updateId;if(!validateWidthHeight({props:O}))return null;var j=O.children,B=O.layout,L=O.stackOffset,q=O.data,F=O.reverseStackOrder,H=getAxisNameByLayout(B),U=H.numericAxisName,G=H.cateAxisName,J=findAllByType(j,o),ee=getStackGroupsByAxisId(q,J,"".concat(U,"Id"),"".concat(G,"Id"),L,F),ae=f.reduce(function(ce,ue){var fe="".concat(ue.axisType,"Map");return _objectSpread(_objectSpread({},ce),{},_defineProperty({},fe,getAxisMap(O,_objectSpread(_objectSpread({},ue),{},{graphicalItems:J,stackGroups:ue.axisType===U&&ee,dataStartIndex:V,dataEndIndex:M}))))},{}),W=calculateOffset(_objectSpread(_objectSpread({},ae),{},{props:O,graphicalItems:J}),N==null?void 0:N.legendBBox);Object.keys(ae).forEach(function(ce){ae[ce]=g(O,ae[ce],W,ce.replace("Map",""),n)});var Q=ae["".concat(G,"Map")],Z=tooltipTicksGenerator(Q),ie=_(O,_objectSpread(_objectSpread({},ae),{},{dataStartIndex:V,dataEndIndex:M,updateId:I,graphicalItems:J,stackGroups:ee,offset:W}));return _objectSpread(_objectSpread({formattedGraphicalItems:ie,graphicalItems:J,offset:W,stackGroups:ee},Z),ae)},E=function(R){function A(N){var O,V,M;return _classCallCheck(this,A),M=_callSuper(this,A,[N]),_defineProperty(M,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),_defineProperty(M,"accessibilityManager",new AccessibilityManager),_defineProperty(M,"handleLegendBBoxUpdate",function(I){if(I){var j=M.state,B=j.dataStartIndex,L=j.dataEndIndex,q=j.updateId;M.setState(_objectSpread({legendBBox:I},S({props:M.props,dataStartIndex:B,dataEndIndex:L,updateId:q},_objectSpread(_objectSpread({},M.state),{},{legendBBox:I}))))}}),_defineProperty(M,"handleReceiveSyncEvent",function(I,j,B){if(M.props.syncId===I){if(B===M.eventEmitterSymbol&&typeof M.props.syncMethod!="function")return;M.applySyncEvent(j)}}),_defineProperty(M,"handleBrushChange",function(I){var j=I.startIndex,B=I.endIndex;if(j!==M.state.dataStartIndex||B!==M.state.dataEndIndex){var L=M.state.updateId;M.setState(function(){return _objectSpread({dataStartIndex:j,dataEndIndex:B},S({props:M.props,dataStartIndex:j,dataEndIndex:B,updateId:L},M.state))}),M.triggerSyncEvent({dataStartIndex:j,dataEndIndex:B})}}),_defineProperty(M,"handleMouseEnter",function(I){var j=M.getMouseInfo(I);if(j){var B=_objectSpread(_objectSpread({},j),{},{isTooltipActive:!0});M.setState(B),M.triggerSyncEvent(B);var L=M.props.onMouseEnter;isFunction$1(L)&&L(B,I)}}),_defineProperty(M,"triggeredAfterMouseMove",function(I){var j=M.getMouseInfo(I),B=j?_objectSpread(_objectSpread({},j),{},{isTooltipActive:!0}):{isTooltipActive:!1};M.setState(B),M.triggerSyncEvent(B);var L=M.props.onMouseMove;isFunction$1(L)&&L(B,I)}),_defineProperty(M,"handleItemMouseEnter",function(I){M.setState(function(){return{isTooltipActive:!0,activeItem:I,activePayload:I.tooltipPayload,activeCoordinate:I.tooltipPosition||{x:I.cx,y:I.cy}}})}),_defineProperty(M,"handleItemMouseLeave",function(){M.setState(function(){return{isTooltipActive:!1}})}),_defineProperty(M,"handleMouseMove",function(I){I.persist(),M.throttleTriggeredAfterMouseMove(I)}),_defineProperty(M,"handleMouseLeave",function(I){M.throttleTriggeredAfterMouseMove.cancel();var j={isTooltipActive:!1};M.setState(j),M.triggerSyncEvent(j);var B=M.props.onMouseLeave;isFunction$1(B)&&B(j,I)}),_defineProperty(M,"handleOuterEvent",function(I){var j=getReactEventByType(I),B=get$1(M.props,"".concat(j));if(j&&isFunction$1(B)){var L,q;/.*touch.*/i.test(j)?q=M.getMouseInfo(I.changedTouches[0]):q=M.getMouseInfo(I),B((L=q)!==null&&L!==void 0?L:{},I)}}),_defineProperty(M,"handleClick",function(I){var j=M.getMouseInfo(I);if(j){var B=_objectSpread(_objectSpread({},j),{},{isTooltipActive:!0});M.setState(B),M.triggerSyncEvent(B);var L=M.props.onClick;isFunction$1(L)&&L(B,I)}}),_defineProperty(M,"handleMouseDown",function(I){var j=M.props.onMouseDown;if(isFunction$1(j)){var B=M.getMouseInfo(I);j(B,I)}}),_defineProperty(M,"handleMouseUp",function(I){var j=M.props.onMouseUp;if(isFunction$1(j)){var B=M.getMouseInfo(I);j(B,I)}}),_defineProperty(M,"handleTouchMove",function(I){I.changedTouches!=null&&I.changedTouches.length>0&&M.throttleTriggeredAfterMouseMove(I.changedTouches[0])}),_defineProperty(M,"handleTouchStart",function(I){I.changedTouches!=null&&I.changedTouches.length>0&&M.handleMouseDown(I.changedTouches[0])}),_defineProperty(M,"handleTouchEnd",function(I){I.changedTouches!=null&&I.changedTouches.length>0&&M.handleMouseUp(I.changedTouches[0])}),_defineProperty(M,"handleDoubleClick",function(I){var j=M.props.onDoubleClick;if(isFunction$1(j)){var B=M.getMouseInfo(I);j(B,I)}}),_defineProperty(M,"handleContextMenu",function(I){var j=M.props.onContextMenu;if(isFunction$1(j)){var B=M.getMouseInfo(I);j(B,I)}}),_defineProperty(M,"triggerSyncEvent",function(I){M.props.syncId!==void 0&&eventCenter.emit(SYNC_EVENT,M.props.syncId,I,M.eventEmitterSymbol)}),_defineProperty(M,"applySyncEvent",function(I){var j=M.props,B=j.layout,L=j.syncMethod,q=M.state.updateId,F=I.dataStartIndex,H=I.dataEndIndex;if(I.dataStartIndex!==void 0||I.dataEndIndex!==void 0)M.setState(_objectSpread({dataStartIndex:F,dataEndIndex:H},S({props:M.props,dataStartIndex:F,dataEndIndex:H,updateId:q},M.state)));else if(I.activeTooltipIndex!==void 0){var U=I.chartX,G=I.chartY,J=I.activeTooltipIndex,ee=M.state,ae=ee.offset,W=ee.tooltipTicks;if(!ae)return;if(typeof L=="function")J=L(W,I);else if(L==="value"){J=-1;for(var Q=0;Q<W.length;Q++)if(W[Q].value===I.activeLabel){J=Q;break}}var Z=_objectSpread(_objectSpread({},ae),{},{x:ae.left,y:ae.top}),ie=Math.min(U,Z.x+Z.width),ce=Math.min(G,Z.y+Z.height),ue=W[J]&&W[J].value,fe=getTooltipContent(M.state,M.props.data,J),pe=W[J]?{x:B==="horizontal"?W[J].coordinate:ie,y:B==="horizontal"?ce:W[J].coordinate}:originCoordinate;M.setState(_objectSpread(_objectSpread({},I),{},{activeLabel:ue,activeCoordinate:pe,activePayload:fe,activeTooltipIndex:J}))}else M.setState(I)}),_defineProperty(M,"renderCursor",function(I){var j,B=M.state,L=B.isTooltipActive,q=B.activeCoordinate,F=B.activePayload,H=B.offset,U=B.activeTooltipIndex,G=B.tooltipAxisBandSize,J=M.getTooltipEventType(),ee=(j=I.props.active)!==null&&j!==void 0?j:L,ae=M.props.layout,W=I.key||"_recharts-cursor";return React.createElement(Cursor,{key:W,activeCoordinate:q,activePayload:F,activeTooltipIndex:U,chartName:n,element:I,isActive:ee,layout:ae,offset:H,tooltipAxisBandSize:G,tooltipEventType:J})}),_defineProperty(M,"renderPolarAxis",function(I,j,B){var L=get$1(I,"type.axisType"),q=get$1(M.state,"".concat(L,"Map")),F=I.type.defaultProps,H=F!==void 0?_objectSpread(_objectSpread({},F),I.props):I.props,U=q&&q[H["".concat(L,"Id")]];return React.cloneElement(I,_objectSpread(_objectSpread({},U),{},{className:clsx(L,U.className),key:I.key||"".concat(j,"-").concat(B),ticks:getTicksOfAxis(U,!0)}))}),_defineProperty(M,"renderPolarGrid",function(I){var j=I.props,B=j.radialLines,L=j.polarAngles,q=j.polarRadius,F=M.state,H=F.radiusAxisMap,U=F.angleAxisMap,G=getAnyElementOfObject(H),J=getAnyElementOfObject(U),ee=J.cx,ae=J.cy,W=J.innerRadius,Q=J.outerRadius;return React.cloneElement(I,{polarAngles:Array.isArray(L)?L:getTicksOfAxis(J,!0).map(function(Z){return Z.coordinate}),polarRadius:Array.isArray(q)?q:getTicksOfAxis(G,!0).map(function(Z){return Z.coordinate}),cx:ee,cy:ae,innerRadius:W,outerRadius:Q,key:I.key||"polar-grid",radialLines:B})}),_defineProperty(M,"renderLegend",function(){var I=M.state.formattedGraphicalItems,j=M.props,B=j.children,L=j.width,q=j.height,F=M.props.margin||{},H=L-(F.left||0)-(F.right||0),U=getLegendProps({children:B,formattedGraphicalItems:I,legendWidth:H,legendContent:m});if(!U)return null;var G=U.item,J=_objectWithoutProperties(U,_excluded);return React.cloneElement(G,_objectSpread(_objectSpread({},J),{},{chartWidth:L,chartHeight:q,margin:F,onBBoxUpdate:M.handleLegendBBoxUpdate}))}),_defineProperty(M,"renderTooltip",function(){var I,j=M.props,B=j.children,L=j.accessibilityLayer,q=findChildByType(B,Tooltip);if(!q)return null;var F=M.state,H=F.isTooltipActive,U=F.activeCoordinate,G=F.activePayload,J=F.activeLabel,ee=F.offset,ae=(I=q.props.active)!==null&&I!==void 0?I:H;return React.cloneElement(q,{viewBox:_objectSpread(_objectSpread({},ee),{},{x:ee.left,y:ee.top}),active:ae,label:J,payload:ae?G:[],coordinate:U,accessibilityLayer:L})}),_defineProperty(M,"renderBrush",function(I){var j=M.props,B=j.margin,L=j.data,q=M.state,F=q.offset,H=q.dataStartIndex,U=q.dataEndIndex,G=q.updateId;return React.cloneElement(I,{key:I.key||"_recharts-brush",onChange:combineEventHandlers(M.handleBrushChange,I.props.onChange),data:L,x:isNumber(I.props.x)?I.props.x:F.left,y:isNumber(I.props.y)?I.props.y:F.top+F.height+F.brushBottom-(B.bottom||0),width:isNumber(I.props.width)?I.props.width:F.width,startIndex:H,endIndex:U,updateId:"brush-".concat(G)})}),_defineProperty(M,"renderReferenceElement",function(I,j,B){if(!I)return null;var L=M,q=L.clipPathId,F=M.state,H=F.xAxisMap,U=F.yAxisMap,G=F.offset,J=I.type.defaultProps||{},ee=I.props,ae=ee.xAxisId,W=ae===void 0?J.xAxisId:ae,Q=ee.yAxisId,Z=Q===void 0?J.yAxisId:Q;return React.cloneElement(I,{key:I.key||"".concat(j,"-").concat(B),xAxis:H[W],yAxis:U[Z],viewBox:{x:G.left,y:G.top,width:G.width,height:G.height},clipPathId:q})}),_defineProperty(M,"renderActivePoints",function(I){var j=I.item,B=I.activePoint,L=I.basePoint,q=I.childIndex,F=I.isRange,H=[],U=j.props.key,G=j.item.type.defaultProps!==void 0?_objectSpread(_objectSpread({},j.item.type.defaultProps),j.item.props):j.item.props,J=G.activeDot,ee=G.dataKey,ae=_objectSpread(_objectSpread({index:q,dataKey:ee,cx:B.x,cy:B.y,r:4,fill:getMainColorOfGraphicItem(j.item),strokeWidth:2,stroke:"#fff",payload:B.payload,value:B.value},filterProps(J,!1)),adaptEventHandlers(J));return H.push(A.renderActiveDot(J,ae,"".concat(U,"-activePoint-").concat(q))),L?H.push(A.renderActiveDot(J,_objectSpread(_objectSpread({},ae),{},{cx:L.x,cy:L.y}),"".concat(U,"-basePoint-").concat(q))):F&&H.push(null),H}),_defineProperty(M,"renderGraphicChild",function(I,j,B){var L=M.filterFormatItem(I,j,B);if(!L)return null;var q=M.getTooltipEventType(),F=M.state,H=F.isTooltipActive,U=F.tooltipAxis,G=F.activeTooltipIndex,J=F.activeLabel,ee=M.props.children,ae=findChildByType(ee,Tooltip),W=L.props,Q=W.points,Z=W.isRange,ie=W.baseLine,ce=L.item.type.defaultProps!==void 0?_objectSpread(_objectSpread({},L.item.type.defaultProps),L.item.props):L.item.props,ue=ce.activeDot,fe=ce.hide,pe=ce.activeBar,ve=ce.activeShape,he=!!(!fe&&H&&ae&&(ue||pe||ve)),ye={};q!=="axis"&&ae&&ae.props.trigger==="click"?ye={onClick:combineEventHandlers(M.handleItemMouseEnter,I.props.onClick)}:q!=="axis"&&(ye={onMouseLeave:combineEventHandlers(M.handleItemMouseLeave,I.props.onMouseLeave),onMouseEnter:combineEventHandlers(M.handleItemMouseEnter,I.props.onMouseEnter)});var de=React.cloneElement(I,_objectSpread(_objectSpread({},L.props),ye));function le(Ne){return typeof U.dataKey=="function"?U.dataKey(Ne.payload):null}if(he)if(G>=0){var se,te;if(U.dataKey&&!U.allowDuplicatedCategory){var xe=typeof U.dataKey=="function"?le:"payload.".concat(U.dataKey.toString());se=findEntryInArray(Q,xe,J),te=Z&&ie&&findEntryInArray(ie,xe,J)}else se=Q==null?void 0:Q[G],te=Z&&ie&&ie[G];if(ve||pe){var oe=I.props.activeIndex!==void 0?I.props.activeIndex:G;return[React.cloneElement(I,_objectSpread(_objectSpread(_objectSpread({},L.props),ye),{},{activeIndex:oe})),null,null]}if(!isNil(se))return[de].concat(_toConsumableArray(M.renderActivePoints({item:L,activePoint:se,basePoint:te,childIndex:G,isRange:Z})))}else{var be,_e=(be=M.getItemByXY(M.state.activeCoordinate))!==null&&be!==void 0?be:{graphicalItem:de},Ce=_e.graphicalItem,Te=Ce.item,Ee=Te===void 0?I:Te,Me=Ce.childIndex,Le=_objectSpread(_objectSpread(_objectSpread({},L.props),ye),{},{activeIndex:Me});return[React.cloneElement(Ee,Le),null,null]}return Z?[de,null,null]:[de,null]}),_defineProperty(M,"renderCustomized",function(I,j,B){return React.cloneElement(I,_objectSpread(_objectSpread({key:"recharts-customized-".concat(B)},M.props),M.state))}),_defineProperty(M,"renderMap",{CartesianGrid:{handler:renderAsIs,once:!0},ReferenceArea:{handler:M.renderReferenceElement},ReferenceLine:{handler:renderAsIs},ReferenceDot:{handler:M.renderReferenceElement},XAxis:{handler:renderAsIs},YAxis:{handler:renderAsIs},Brush:{handler:M.renderBrush,once:!0},Bar:{handler:M.renderGraphicChild},Line:{handler:M.renderGraphicChild},Area:{handler:M.renderGraphicChild},Radar:{handler:M.renderGraphicChild},RadialBar:{handler:M.renderGraphicChild},Scatter:{handler:M.renderGraphicChild},Pie:{handler:M.renderGraphicChild},Funnel:{handler:M.renderGraphicChild},Tooltip:{handler:M.renderCursor,once:!0},PolarGrid:{handler:M.renderPolarGrid,once:!0},PolarAngleAxis:{handler:M.renderPolarAxis},PolarRadiusAxis:{handler:M.renderPolarAxis},Customized:{handler:M.renderCustomized}}),M.clipPathId="".concat((O=N.id)!==null&&O!==void 0?O:uniqueId("recharts"),"-clip"),M.throttleTriggeredAfterMouseMove=throttle(M.triggeredAfterMouseMove,(V=N.throttleDelay)!==null&&V!==void 0?V:1e3/60),M.state={},M}return _inherits(A,R),_createClass(A,[{key:"componentDidMount",value:function(){var O,V;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(O=this.props.margin.left)!==null&&O!==void 0?O:0,top:(V=this.props.margin.top)!==null&&V!==void 0?V:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var O=this.props,V=O.children,M=O.data,I=O.height,j=O.layout,B=findChildByType(V,Tooltip);if(B){var L=B.props.defaultIndex;if(!(typeof L!="number"||L<0||L>this.state.tooltipTicks.length-1)){var q=this.state.tooltipTicks[L]&&this.state.tooltipTicks[L].value,F=getTooltipContent(this.state,M,L,q),H=this.state.tooltipTicks[L].coordinate,U=(this.state.offset.top+I)/2,G=j==="horizontal",J=G?{x:H,y:U}:{y:H,x:U},ee=this.state.formattedGraphicalItems.find(function(W){var Q=W.item;return Q.type.name==="Scatter"});ee&&(J=_objectSpread(_objectSpread({},J),ee.props.points[L].tooltipPosition),F=ee.props.points[L].tooltipPayload);var ae={activeTooltipIndex:L,isTooltipActive:!0,activeLabel:q,activePayload:F,activeCoordinate:J};this.setState(ae),this.renderCursor(B),this.accessibilityManager.setIndex(L)}}}},{key:"getSnapshotBeforeUpdate",value:function(O,V){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==V.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==O.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==O.margin){var M,I;this.accessibilityManager.setDetails({offset:{left:(M=this.props.margin.left)!==null&&M!==void 0?M:0,top:(I=this.props.margin.top)!==null&&I!==void 0?I:0}})}return null}},{key:"componentDidUpdate",value:function(O){isChildrenEqual([findChildByType(O.children,Tooltip)],[findChildByType(this.props.children,Tooltip)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var O=findChildByType(this.props.children,Tooltip);if(O&&typeof O.props.shared=="boolean"){var V=O.props.shared?"axis":"item";return d.indexOf(V)>=0?V:u}return u}},{key:"getMouseInfo",value:function(O){if(!this.container)return null;var V=this.container,M=V.getBoundingClientRect(),I=getOffset(M),j={chartX:Math.round(O.pageX-I.left),chartY:Math.round(O.pageY-I.top)},B=M.width/V.offsetWidth||1,L=this.inRange(j.chartX,j.chartY,B);if(!L)return null;var q=this.state,F=q.xAxisMap,H=q.yAxisMap,U=this.getTooltipEventType(),G=getTooltipData(this.state,this.props.data,this.props.layout,L);if(U!=="axis"&&F&&H){var J=getAnyElementOfObject(F).scale,ee=getAnyElementOfObject(H).scale,ae=J&&J.invert?J.invert(j.chartX):null,W=ee&&ee.invert?ee.invert(j.chartY):null;return _objectSpread(_objectSpread({},j),{},{xValue:ae,yValue:W},G)}return G?_objectSpread(_objectSpread({},j),G):null}},{key:"inRange",value:function(O,V){var M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,I=this.props.layout,j=O/M,B=V/M;if(I==="horizontal"||I==="vertical"){var L=this.state.offset,q=j>=L.left&&j<=L.left+L.width&&B>=L.top&&B<=L.top+L.height;return q?{x:j,y:B}:null}var F=this.state,H=F.angleAxisMap,U=F.radiusAxisMap;if(H&&U){var G=getAnyElementOfObject(H);return inRangeOfSector({x:j,y:B},G)}return null}},{key:"parseEventsOfWrapper",value:function(){var O=this.props.children,V=this.getTooltipEventType(),M=findChildByType(O,Tooltip),I={};M&&V==="axis"&&(M.props.trigger==="click"?I={onClick:this.handleClick}:I={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var j=adaptEventHandlers(this.props,this.handleOuterEvent);return _objectSpread(_objectSpread({},j),I)}},{key:"addListener",value:function(){eventCenter.on(SYNC_EVENT,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){eventCenter.removeListener(SYNC_EVENT,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(O,V,M){for(var I=this.state.formattedGraphicalItems,j=0,B=I.length;j<B;j++){var L=I[j];if(L.item===O||L.props.key===O.key||V===getDisplayName(L.item.type)&&M===L.childIndex)return L}return null}},{key:"renderClipPath",value:function(){var O=this.clipPathId,V=this.state.offset,M=V.left,I=V.top,j=V.height,B=V.width;return React.createElement("defs",null,React.createElement("clipPath",{id:O},React.createElement("rect",{x:M,y:I,height:j,width:B})))}},{key:"getXScales",value:function(){var O=this.state.xAxisMap;return O?Object.entries(O).reduce(function(V,M){var I=_slicedToArray(M,2),j=I[0],B=I[1];return _objectSpread(_objectSpread({},V),{},_defineProperty({},j,B.scale))},{}):null}},{key:"getYScales",value:function(){var O=this.state.yAxisMap;return O?Object.entries(O).reduce(function(V,M){var I=_slicedToArray(M,2),j=I[0],B=I[1];return _objectSpread(_objectSpread({},V),{},_defineProperty({},j,B.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(O){var V;return(V=this.state.xAxisMap)===null||V===void 0||(V=V[O])===null||V===void 0?void 0:V.scale}},{key:"getYScaleByAxisId",value:function(O){var V;return(V=this.state.yAxisMap)===null||V===void 0||(V=V[O])===null||V===void 0?void 0:V.scale}},{key:"getItemByXY",value:function(O){var V=this.state,M=V.formattedGraphicalItems,I=V.activeItem;if(M&&M.length)for(var j=0,B=M.length;j<B;j++){var L=M[j],q=L.props,F=L.item,H=F.type.defaultProps!==void 0?_objectSpread(_objectSpread({},F.type.defaultProps),F.props):F.props,U=getDisplayName(F.type);if(U==="Bar"){var G=(q.data||[]).find(function(W){return isInRectangle(O,W)});if(G)return{graphicalItem:L,payload:G}}else if(U==="RadialBar"){var J=(q.data||[]).find(function(W){return inRangeOfSector(O,W)});if(J)return{graphicalItem:L,payload:J}}else if(isFunnel(L,I)||isPie(L,I)||isScatter(L,I)){var ee=getActiveShapeIndexForTooltip({graphicalItem:L,activeTooltipItem:I,itemData:H.data}),ae=H.activeIndex===void 0?ee:H.activeIndex;return{graphicalItem:_objectSpread(_objectSpread({},L),{},{childIndex:ae}),payload:isScatter(L,I)?H.data[ee]:L.props.data[ee]}}}return null}},{key:"render",value:function(){var O=this;if(!validateWidthHeight(this))return null;var V=this.props,M=V.children,I=V.className,j=V.width,B=V.height,L=V.style,q=V.compact,F=V.title,H=V.desc,U=_objectWithoutProperties(V,_excluded2),G=filterProps(U,!1);if(q)return React.createElement(ChartLayoutContextProvider,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},React.createElement(Surface,_extends({},G,{width:j,height:B,title:F,desc:H}),this.renderClipPath(),renderByOrder(M,this.renderMap)));if(this.props.accessibilityLayer){var J,ee;G.tabIndex=(J=this.props.tabIndex)!==null&&J!==void 0?J:0,G.role=(ee=this.props.role)!==null&&ee!==void 0?ee:"application",G.onKeyDown=function(W){O.accessibilityManager.keyboardEvent(W)},G.onFocus=function(){O.accessibilityManager.focus()}}var ae=this.parseEventsOfWrapper();return React.createElement(ChartLayoutContextProvider,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},React.createElement("div",_extends({className:clsx("recharts-wrapper",I),style:_objectSpread({position:"relative",cursor:"default",width:j,height:B},L)},ae,{ref:function(Q){O.container=Q}}),React.createElement(Surface,_extends({},G,{width:j,height:B,title:F,desc:H,style:FULL_WIDTH_AND_HEIGHT}),this.renderClipPath(),renderByOrder(M,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(React.Component);_defineProperty(E,"displayName",n),_defineProperty(E,"defaultProps",_objectSpread({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},b)),_defineProperty(E,"getDerivedStateFromProps",function(R,A){var N=R.dataKey,O=R.data,V=R.children,M=R.width,I=R.height,j=R.layout,B=R.stackOffset,L=R.margin,q=A.dataStartIndex,F=A.dataEndIndex;if(A.updateId===void 0){var H=createDefaultState(R);return _objectSpread(_objectSpread(_objectSpread({},H),{},{updateId:0},S(_objectSpread(_objectSpread({props:R},H),{},{updateId:0}),A)),{},{prevDataKey:N,prevData:O,prevWidth:M,prevHeight:I,prevLayout:j,prevStackOffset:B,prevMargin:L,prevChildren:V})}if(N!==A.prevDataKey||O!==A.prevData||M!==A.prevWidth||I!==A.prevHeight||j!==A.prevLayout||B!==A.prevStackOffset||!shallowEqual$1(L,A.prevMargin)){var U=createDefaultState(R),G={chartX:A.chartX,chartY:A.chartY,isTooltipActive:A.isTooltipActive},J=_objectSpread(_objectSpread({},getTooltipData(A,O,j)),{},{updateId:A.updateId+1}),ee=_objectSpread(_objectSpread(_objectSpread({},U),G),J);return _objectSpread(_objectSpread(_objectSpread({},ee),S(_objectSpread({props:R},ee),A)),{},{prevDataKey:N,prevData:O,prevWidth:M,prevHeight:I,prevLayout:j,prevStackOffset:B,prevMargin:L,prevChildren:V})}if(!isChildrenEqual(V,A.prevChildren)){var ae,W,Q,Z,ie=findChildByType(V,Brush),ce=ie&&(ae=(W=ie.props)===null||W===void 0?void 0:W.startIndex)!==null&&ae!==void 0?ae:q,ue=ie&&(Q=(Z=ie.props)===null||Z===void 0?void 0:Z.endIndex)!==null&&Q!==void 0?Q:F,fe=ce!==q||ue!==F,pe=!isNil(O),ve=pe&&!fe?A.updateId:A.updateId+1;return _objectSpread(_objectSpread({updateId:ve},S(_objectSpread(_objectSpread({props:R},A),{},{updateId:ve,dataStartIndex:ce,dataEndIndex:ue}),A)),{},{prevChildren:V,dataStartIndex:ce,dataEndIndex:ue})}return null}),_defineProperty(E,"renderActiveDot",function(R,A,N){var O;return React.isValidElement(R)?O=React.cloneElement(R,A):isFunction$1(R)?O=R(A):O=React.createElement(Dot,A),React.createElement(Layer,{className:"recharts-active-dot",key:N},O)});var C=React.forwardRef(function(A,N){return React.createElement(E,_extends({},A,{ref:N}))});return C.displayName=E.displayName,C},AreaChart$1=generateCategoricalChart({chartName:"AreaChart",GraphicalChild:Area,axisComponents:[{axisType:"xAxis",AxisComp:XAxis},{axisType:"yAxis",AxisComp:YAxis}],formatAxisMap});function ChartTooltipContent({active:e,payload:t,label:n,units:o="",unitsPosition:l="right",className:u}){return!e||!(t!=null&&t.length)?null:jsxRuntime.jsxs("div",{className:cn("bg-background border border-border rounded-md p-3 shadow-md",u),children:[jsxRuntime.jsx("p",{className:"font-medium text-sm mb-2",children:n}),jsxRuntime.jsx("div",{className:"space-y-2",children:t.map((p,d)=>{const f=p.stroke||p.color||"var(--primary, #8884d8)",m=p.value.toLocaleString();return jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx("div",{className:"h-2 w-2 rounded-full",style:{backgroundColor:f}}),jsxRuntime.jsx("span",{className:"capitalize",children:p.dataKey})]}),jsxRuntime.jsxs("p",{className:"text-sm font-medium",children:[l==="left"&&o,m,l==="right"&&o]})]},d)})})]})}function AreaChart({data:e,units:t,unitsPosition:n="right",width:o="100%",height:l=300,className:u,size:p="default"}){if(!(e!=null&&e.length))return jsxRuntime.jsx("div",{className:"flex items-center justify-center h-40 text-muted-foreground",children:"No data available"});const d=Object.keys(e[0])[0],f=Object.keys(e[0]).filter(_=>_!==d);if(!f.length)return jsxRuntime.jsx("div",{className:"flex items-center justify-center h-40 text-muted-foreground",children:"Invalid data format"});const m=_=>n==="left"?`${t||""}${_}`:`${_}${t||""}`,g=p==="mini"?{top:0,right:0,left:0,bottom:0}:{top:10,right:30,left:0,bottom:0},b=p==="mini";return jsxRuntime.jsx("div",{className:cn("w-full",u),children:jsxRuntime.jsx(ResponsiveContainer,{width:o,height:b?l||100:l,children:jsxRuntime.jsxs(AreaChart$1,{data:e,margin:g,children:[jsxRuntime.jsx("defs",{children:f.map(_=>jsxRuntime.jsxs("linearGradient",{id:`gradient-${_}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[jsxRuntime.jsx("stop",{offset:"5%",stopColor:"var(--primary, #8884d8)",stopOpacity:.8}),jsxRuntime.jsx("stop",{offset:"95%",stopColor:"var(--primary, #8884d8)",stopOpacity:.1})]},_))}),!b&&jsxRuntime.jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-border/50"}),!b&&jsxRuntime.jsx(XAxis,{dataKey:d,className:"text-xs text-muted-foreground",tickLine:!1,axisLine:!1}),!b&&jsxRuntime.jsx(YAxis,{className:"text-xs text-muted-foreground",tickLine:!1,axisLine:!1,tickFormatter:m}),!b&&jsxRuntime.jsx(Tooltip,{content:jsxRuntime.jsx(ChartTooltipContent,{units:t,unitsPosition:n}),cursor:{stroke:"var(--muted)",strokeWidth:1}}),f.map(_=>jsxRuntime.jsx(Area,{type:"monotone",dataKey:_,stroke:"var(--primary, #8884d8)",fillOpacity:.6,fill:`url(#gradient-${_})`,strokeWidth:b?1:2},_))]})})})}/*! *****************************************************************************
|
|
399
404
|
Copyright (c) Microsoft Corporation.
|
|
400
405
|
|
|
401
406
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -852,7 +857,7 @@ Please report this to https://github.com/markedjs/marked.`,t){const l="<p>An err
|
|
|
852
857
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
853
858
|
* @license MIT
|
|
854
859
|
*/var isBuffer_1,hasRequiredIsBuffer;function requireIsBuffer(){if(hasRequiredIsBuffer)return isBuffer_1;hasRequiredIsBuffer=1,isBuffer_1=function(n){return n!=null&&(e(n)||t(n)||!!n._isBuffer)};function e(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function t(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&e(n.slice(0,0))}return isBuffer_1}var hasRequiredMd5;function requireMd5(){return hasRequiredMd5||(hasRequiredMd5=1,function(){var e=requireCrypt(),t=requireCharenc().utf8,n=requireIsBuffer(),o=requireCharenc().bin,l=function(u,p){u.constructor==String?p&&p.encoding==="binary"?u=o.stringToBytes(u):u=t.stringToBytes(u):n(u)?u=Array.prototype.slice.call(u,0):!Array.isArray(u)&&u.constructor!==Uint8Array&&(u=u.toString());for(var d=e.bytesToWords(u),f=u.length*8,m=1732584193,g=-271733879,b=-1732584194,_=271733878,S=0;S<d.length;S++)d[S]=(d[S]<<8|d[S]>>>24)&16711935|(d[S]<<24|d[S]>>>8)&4278255360;d[f>>>5]|=128<<f%32,d[(f+64>>>9<<4)+14]=f;for(var E=l._ff,C=l._gg,R=l._hh,A=l._ii,S=0;S<d.length;S+=16){var N=m,O=g,V=b,M=_;m=E(m,g,b,_,d[S+0],7,-680876936),_=E(_,m,g,b,d[S+1],12,-389564586),b=E(b,_,m,g,d[S+2],17,606105819),g=E(g,b,_,m,d[S+3],22,-1044525330),m=E(m,g,b,_,d[S+4],7,-176418897),_=E(_,m,g,b,d[S+5],12,1200080426),b=E(b,_,m,g,d[S+6],17,-1473231341),g=E(g,b,_,m,d[S+7],22,-45705983),m=E(m,g,b,_,d[S+8],7,1770035416),_=E(_,m,g,b,d[S+9],12,-1958414417),b=E(b,_,m,g,d[S+10],17,-42063),g=E(g,b,_,m,d[S+11],22,-1990404162),m=E(m,g,b,_,d[S+12],7,1804603682),_=E(_,m,g,b,d[S+13],12,-40341101),b=E(b,_,m,g,d[S+14],17,-1502002290),g=E(g,b,_,m,d[S+15],22,1236535329),m=C(m,g,b,_,d[S+1],5,-165796510),_=C(_,m,g,b,d[S+6],9,-1069501632),b=C(b,_,m,g,d[S+11],14,643717713),g=C(g,b,_,m,d[S+0],20,-373897302),m=C(m,g,b,_,d[S+5],5,-701558691),_=C(_,m,g,b,d[S+10],9,38016083),b=C(b,_,m,g,d[S+15],14,-660478335),g=C(g,b,_,m,d[S+4],20,-405537848),m=C(m,g,b,_,d[S+9],5,568446438),_=C(_,m,g,b,d[S+14],9,-1019803690),b=C(b,_,m,g,d[S+3],14,-187363961),g=C(g,b,_,m,d[S+8],20,1163531501),m=C(m,g,b,_,d[S+13],5,-1444681467),_=C(_,m,g,b,d[S+2],9,-51403784),b=C(b,_,m,g,d[S+7],14,1735328473),g=C(g,b,_,m,d[S+12],20,-1926607734),m=R(m,g,b,_,d[S+5],4,-378558),_=R(_,m,g,b,d[S+8],11,-2022574463),b=R(b,_,m,g,d[S+11],16,1839030562),g=R(g,b,_,m,d[S+14],23,-35309556),m=R(m,g,b,_,d[S+1],4,-1530992060),_=R(_,m,g,b,d[S+4],11,1272893353),b=R(b,_,m,g,d[S+7],16,-155497632),g=R(g,b,_,m,d[S+10],23,-1094730640),m=R(m,g,b,_,d[S+13],4,681279174),_=R(_,m,g,b,d[S+0],11,-358537222),b=R(b,_,m,g,d[S+3],16,-722521979),g=R(g,b,_,m,d[S+6],23,76029189),m=R(m,g,b,_,d[S+9],4,-640364487),_=R(_,m,g,b,d[S+12],11,-421815835),b=R(b,_,m,g,d[S+15],16,530742520),g=R(g,b,_,m,d[S+2],23,-995338651),m=A(m,g,b,_,d[S+0],6,-198630844),_=A(_,m,g,b,d[S+7],10,1126891415),b=A(b,_,m,g,d[S+14],15,-1416354905),g=A(g,b,_,m,d[S+5],21,-57434055),m=A(m,g,b,_,d[S+12],6,1700485571),_=A(_,m,g,b,d[S+3],10,-1894986606),b=A(b,_,m,g,d[S+10],15,-1051523),g=A(g,b,_,m,d[S+1],21,-2054922799),m=A(m,g,b,_,d[S+8],6,1873313359),_=A(_,m,g,b,d[S+15],10,-30611744),b=A(b,_,m,g,d[S+6],15,-1560198380),g=A(g,b,_,m,d[S+13],21,1309151649),m=A(m,g,b,_,d[S+4],6,-145523070),_=A(_,m,g,b,d[S+11],10,-1120210379),b=A(b,_,m,g,d[S+2],15,718787259),g=A(g,b,_,m,d[S+9],21,-343485551),m=m+N>>>0,g=g+O>>>0,b=b+V>>>0,_=_+M>>>0}return e.endian([m,g,b,_])};l._ff=function(u,p,d,f,m,g,b){var _=u+(p&d|~p&f)+(m>>>0)+b;return(_<<g|_>>>32-g)+p},l._gg=function(u,p,d,f,m,g,b){var _=u+(p&f|d&~f)+(m>>>0)+b;return(_<<g|_>>>32-g)+p},l._hh=function(u,p,d,f,m,g,b){var _=u+(p^d^f)+(m>>>0)+b;return(_<<g|_>>>32-g)+p},l._ii=function(u,p,d,f,m,g,b){var _=u+(d^(p|~f))+(m>>>0)+b;return(_<<g|_>>>32-g)+p},l._blocksize=16,l._digestsize=16,md5$1.exports=function(u,p){if(u==null)throw new Error("Illegal argument "+u);var d=e.wordsToBytes(l(u,p));return p&&p.asBytes?d:p&&p.asString?o.bytesToString(d):e.bytesToHex(d)}}()),md5$1.exports}var md5Exports=requireMd5();const md5=getDefaultExportFromCjs(md5Exports),constructFromSymbol=Symbol.for("constructDateFrom");function constructFrom(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&constructFromSymbol in e?e[constructFromSymbol](t):e instanceof Date?new e.constructor(t):new Date(t)}function toDate(e,t){return constructFrom(e,e)}function addDays(e,t,n){const o=toDate(e);return isNaN(t)?constructFrom(e,NaN):(o.setDate(o.getDate()+t),o)}function normalizeDates(e,...t){const n=constructFrom.bind(null,t.find(o=>typeof o=="object"));return t.map(n)}function startOfDay(e,t){const n=toDate(e);return n.setHours(0,0,0,0),n}function constructNow(e){return constructFrom(e,Date.now())}function isSameDay(e,t,n){const[o,l]=normalizeDates(n==null?void 0:n.in,e,t);return+startOfDay(o)==+startOfDay(l)}function isToday(e,t){return isSameDay(constructFrom(e,e),constructNow(e))}function subDays(e,t,n){return addDays(e,-1)}function isYesterday(e,t){return isSameDay(constructFrom(e,e),subDays(constructNow(e)))}var lib$3={},htmlToDom={},domparser={},utilities$2={},lib$2={},lib$1={},hasRequiredLib$3;function requireLib$3(){return hasRequiredLib$3||(hasRequiredLib$3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Doctype=e.CDATA=e.Tag=e.Style=e.Script=e.Comment=e.Directive=e.Text=e.Root=e.isTag=e.ElementType=void 0;var t;(function(o){o.Root="root",o.Text="text",o.Directive="directive",o.Comment="comment",o.Script="script",o.Style="style",o.Tag="tag",o.CDATA="cdata",o.Doctype="doctype"})(t=e.ElementType||(e.ElementType={}));function n(o){return o.type===t.Tag||o.type===t.Script||o.type===t.Style}e.isTag=n,e.Root=t.Root,e.Text=t.Text,e.Directive=t.Directive,e.Comment=t.Comment,e.Script=t.Script,e.Style=t.Style,e.Tag=t.Tag,e.CDATA=t.CDATA,e.Doctype=t.Doctype}(lib$1)),lib$1}var node={},hasRequiredNode;function requireNode(){if(hasRequiredNode)return node;hasRequiredNode=1;var e=node&&node.__extends||function(){var M=function(I,j){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(B,L){B.__proto__=L}||function(B,L){for(var q in L)Object.prototype.hasOwnProperty.call(L,q)&&(B[q]=L[q])},M(I,j)};return function(I,j){if(typeof j!="function"&&j!==null)throw new TypeError("Class extends value "+String(j)+" is not a constructor or null");M(I,j);function B(){this.constructor=I}I.prototype=j===null?Object.create(j):(B.prototype=j.prototype,new B)}}(),t=node&&node.__assign||function(){return t=Object.assign||function(M){for(var I,j=1,B=arguments.length;j<B;j++){I=arguments[j];for(var L in I)Object.prototype.hasOwnProperty.call(I,L)&&(M[L]=I[L])}return M},t.apply(this,arguments)};Object.defineProperty(node,"__esModule",{value:!0}),node.cloneNode=node.hasChildren=node.isDocument=node.isDirective=node.isComment=node.isText=node.isCDATA=node.isTag=node.Element=node.Document=node.CDATA=node.NodeWithChildren=node.ProcessingInstruction=node.Comment=node.Text=node.DataNode=node.Node=void 0;var n=requireLib$3(),o=function(){function M(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(M.prototype,"parentNode",{get:function(){return this.parent},set:function(I){this.parent=I},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"previousSibling",{get:function(){return this.prev},set:function(I){this.prev=I},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"nextSibling",{get:function(){return this.next},set:function(I){this.next=I},enumerable:!1,configurable:!0}),M.prototype.cloneNode=function(I){return I===void 0&&(I=!1),O(this,I)},M}();node.Node=o;var l=function(M){e(I,M);function I(j){var B=M.call(this)||this;return B.data=j,B}return Object.defineProperty(I.prototype,"nodeValue",{get:function(){return this.data},set:function(j){this.data=j},enumerable:!1,configurable:!0}),I}(o);node.DataNode=l;var u=function(M){e(I,M);function I(){var j=M!==null&&M.apply(this,arguments)||this;return j.type=n.ElementType.Text,j}return Object.defineProperty(I.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),I}(l);node.Text=u;var p=function(M){e(I,M);function I(){var j=M!==null&&M.apply(this,arguments)||this;return j.type=n.ElementType.Comment,j}return Object.defineProperty(I.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),I}(l);node.Comment=p;var d=function(M){e(I,M);function I(j,B){var L=M.call(this,B)||this;return L.name=j,L.type=n.ElementType.Directive,L}return Object.defineProperty(I.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),I}(l);node.ProcessingInstruction=d;var f=function(M){e(I,M);function I(j){var B=M.call(this)||this;return B.children=j,B}return Object.defineProperty(I.prototype,"firstChild",{get:function(){var j;return(j=this.children[0])!==null&&j!==void 0?j:null},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"childNodes",{get:function(){return this.children},set:function(j){this.children=j},enumerable:!1,configurable:!0}),I}(o);node.NodeWithChildren=f;var m=function(M){e(I,M);function I(){var j=M!==null&&M.apply(this,arguments)||this;return j.type=n.ElementType.CDATA,j}return Object.defineProperty(I.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),I}(f);node.CDATA=m;var g=function(M){e(I,M);function I(){var j=M!==null&&M.apply(this,arguments)||this;return j.type=n.ElementType.Root,j}return Object.defineProperty(I.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),I}(f);node.Document=g;var b=function(M){e(I,M);function I(j,B,L,q){L===void 0&&(L=[]),q===void 0&&(q=j==="script"?n.ElementType.Script:j==="style"?n.ElementType.Style:n.ElementType.Tag);var F=M.call(this,L)||this;return F.name=j,F.attribs=B,F.type=q,F}return Object.defineProperty(I.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"tagName",{get:function(){return this.name},set:function(j){this.name=j},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"attributes",{get:function(){var j=this;return Object.keys(this.attribs).map(function(B){var L,q;return{name:B,value:j.attribs[B],namespace:(L=j["x-attribsNamespace"])===null||L===void 0?void 0:L[B],prefix:(q=j["x-attribsPrefix"])===null||q===void 0?void 0:q[B]}})},enumerable:!1,configurable:!0}),I}(f);node.Element=b;function _(M){return(0,n.isTag)(M)}node.isTag=_;function S(M){return M.type===n.ElementType.CDATA}node.isCDATA=S;function E(M){return M.type===n.ElementType.Text}node.isText=E;function C(M){return M.type===n.ElementType.Comment}node.isComment=C;function R(M){return M.type===n.ElementType.Directive}node.isDirective=R;function A(M){return M.type===n.ElementType.Root}node.isDocument=A;function N(M){return Object.prototype.hasOwnProperty.call(M,"children")}node.hasChildren=N;function O(M,I){I===void 0&&(I=!1);var j;if(E(M))j=new u(M.data);else if(C(M))j=new p(M.data);else if(_(M)){var B=I?V(M.children):[],L=new b(M.name,t({},M.attribs),B);B.forEach(function(U){return U.parent=L}),M.namespace!=null&&(L.namespace=M.namespace),M["x-attribsNamespace"]&&(L["x-attribsNamespace"]=t({},M["x-attribsNamespace"])),M["x-attribsPrefix"]&&(L["x-attribsPrefix"]=t({},M["x-attribsPrefix"])),j=L}else if(S(M)){var B=I?V(M.children):[],q=new m(B);B.forEach(function(G){return G.parent=q}),j=q}else if(A(M)){var B=I?V(M.children):[],F=new g(B);B.forEach(function(G){return G.parent=F}),M["x-mode"]&&(F["x-mode"]=M["x-mode"]),j=F}else if(R(M)){var H=new d(M.name,M.data);M["x-name"]!=null&&(H["x-name"]=M["x-name"],H["x-publicId"]=M["x-publicId"],H["x-systemId"]=M["x-systemId"]),j=H}else throw new Error("Not implemented yet: ".concat(M.type));return j.startIndex=M.startIndex,j.endIndex=M.endIndex,M.sourceCodeLocation!=null&&(j.sourceCodeLocation=M.sourceCodeLocation),j}node.cloneNode=O;function V(M){for(var I=M.map(function(B){return O(B,!0)}),j=1;j<I.length;j++)I[j].prev=I[j-1],I[j-1].next=I[j];return I}return node}var hasRequiredLib$2;function requireLib$2(){return hasRequiredLib$2||(hasRequiredLib$2=1,function(e){var t=lib$2&&lib$2.__createBinding||(Object.create?function(d,f,m,g){g===void 0&&(g=m);var b=Object.getOwnPropertyDescriptor(f,m);(!b||("get"in b?!f.__esModule:b.writable||b.configurable))&&(b={enumerable:!0,get:function(){return f[m]}}),Object.defineProperty(d,g,b)}:function(d,f,m,g){g===void 0&&(g=m),d[g]=f[m]}),n=lib$2&&lib$2.__exportStar||function(d,f){for(var m in d)m!=="default"&&!Object.prototype.hasOwnProperty.call(f,m)&&t(f,d,m)};Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=void 0;var o=requireLib$3(),l=requireNode();n(requireNode(),e);var u={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},p=function(){function d(f,m,g){this.dom=[],this.root=new l.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof m=="function"&&(g=m,m=u),typeof f=="object"&&(m=f,f=void 0),this.callback=f??null,this.options=m??u,this.elementCB=g??null}return d.prototype.onparserinit=function(f){this.parser=f},d.prototype.onreset=function(){this.dom=[],this.root=new l.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},d.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},d.prototype.onerror=function(f){this.handleCallback(f)},d.prototype.onclosetag=function(){this.lastNode=null;var f=this.tagStack.pop();this.options.withEndIndices&&(f.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(f)},d.prototype.onopentag=function(f,m){var g=this.options.xmlMode?o.ElementType.Tag:void 0,b=new l.Element(f,m,void 0,g);this.addNode(b),this.tagStack.push(b)},d.prototype.ontext=function(f){var m=this.lastNode;if(m&&m.type===o.ElementType.Text)m.data+=f,this.options.withEndIndices&&(m.endIndex=this.parser.endIndex);else{var g=new l.Text(f);this.addNode(g),this.lastNode=g}},d.prototype.oncomment=function(f){if(this.lastNode&&this.lastNode.type===o.ElementType.Comment){this.lastNode.data+=f;return}var m=new l.Comment(f);this.addNode(m),this.lastNode=m},d.prototype.oncommentend=function(){this.lastNode=null},d.prototype.oncdatastart=function(){var f=new l.Text(""),m=new l.CDATA([f]);this.addNode(m),f.parent=m,this.lastNode=f},d.prototype.oncdataend=function(){this.lastNode=null},d.prototype.onprocessinginstruction=function(f,m){var g=new l.ProcessingInstruction(f,m);this.addNode(g)},d.prototype.handleCallback=function(f){if(typeof this.callback=="function")this.callback(f,this.dom);else if(f)throw f},d.prototype.addNode=function(f){var m=this.tagStack[this.tagStack.length-1],g=m.children[m.children.length-1];this.options.withStartIndices&&(f.startIndex=this.parser.startIndex),this.options.withEndIndices&&(f.endIndex=this.parser.endIndex),m.children.push(f),g&&(f.prev=g,g.next=f),f.parent=m,this.lastNode=null},d}();e.DomHandler=p,e.default=p}(lib$2)),lib$2}var constants={},hasRequiredConstants;function requireConstants(){return hasRequiredConstants||(hasRequiredConstants=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CARRIAGE_RETURN_PLACEHOLDER_REGEX=e.CARRIAGE_RETURN_PLACEHOLDER=e.CARRIAGE_RETURN_REGEX=e.CARRIAGE_RETURN=e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES=void 0,e.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"],e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES.reduce(function(t,n){return t[n.toLowerCase()]=n,t},{}),e.CARRIAGE_RETURN="\r",e.CARRIAGE_RETURN_REGEX=new RegExp(e.CARRIAGE_RETURN,"g"),e.CARRIAGE_RETURN_PLACEHOLDER="__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_".concat(Date.now(),"__"),e.CARRIAGE_RETURN_PLACEHOLDER_REGEX=new RegExp(e.CARRIAGE_RETURN_PLACEHOLDER,"g")}(constants)),constants}var hasRequiredUtilities$2;function requireUtilities$2(){if(hasRequiredUtilities$2)return utilities$2;hasRequiredUtilities$2=1,Object.defineProperty(utilities$2,"__esModule",{value:!0}),utilities$2.formatAttributes=o,utilities$2.escapeSpecialCharacters=u,utilities$2.revertEscapedCharacters=p,utilities$2.formatDOM=d;var e=requireLib$2(),t=requireConstants();function n(f){return t.CASE_SENSITIVE_TAG_NAMES_MAP[f]}function o(f){for(var m={},g=0,b=f.length;g<b;g++){var _=f[g];m[_.name]=_.value}return m}function l(f){f=f.toLowerCase();var m=n(f);return m||f}function u(f){return f.replace(t.CARRIAGE_RETURN_REGEX,t.CARRIAGE_RETURN_PLACEHOLDER)}function p(f){return f.replace(t.CARRIAGE_RETURN_PLACEHOLDER_REGEX,t.CARRIAGE_RETURN)}function d(f,m,g){m===void 0&&(m=null);for(var b=[],_,S=0,E=f.length;S<E;S++){var C=f[S];switch(C.nodeType){case 1:{var R=l(C.nodeName);_=new e.Element(R,o(C.attributes)),_.children=d(R==="template"?C.content.childNodes:C.childNodes,_);break}case 3:_=new e.Text(p(C.nodeValue));break;case 8:_=new e.Comment(C.nodeValue);break;default:continue}var A=b[S-1]||null;A&&(A.next=_),_.parent=m,_.prev=A,_.next=null,b.push(_)}return g&&(_=new e.ProcessingInstruction(g.substring(0,g.indexOf(" ")).toLowerCase(),g),_.next=b[0]||null,_.parent=m,b.unshift(_),b[1]&&(b[1].prev=b[0])),b}return utilities$2}var hasRequiredDomparser;function requireDomparser(){if(hasRequiredDomparser)return domparser;hasRequiredDomparser=1,Object.defineProperty(domparser,"__esModule",{value:!0}),domparser.default=C;var e=requireUtilities$2(),t="html",n="head",o="body",l=/<([a-zA-Z]+[0-9]?)/,u=/<head[^]*>/i,p=/<body[^]*>/i,d=function(R,A){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},f=function(R,A){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},m=typeof window=="object"&&window.DOMParser;if(typeof m=="function"){var g=new m,b="text/html";f=function(R,A){return A&&(R="<".concat(A,">").concat(R,"</").concat(A,">")),g.parseFromString(R,b)},d=f}if(typeof document=="object"&&document.implementation){var _=document.implementation.createHTMLDocument();d=function(R,A){if(A){var N=_.documentElement.querySelector(A);return N&&(N.innerHTML=R),_}return _.documentElement.innerHTML=R,_}}var S=typeof document=="object"&&document.createElement("template"),E;S&&S.content&&(E=function(R){return S.innerHTML=R,S.content.childNodes});function C(R){var A,N;R=(0,e.escapeSpecialCharacters)(R);var O=R.match(l),V=O&&O[1]?O[1].toLowerCase():"";switch(V){case t:{var M=f(R);if(!u.test(R)){var I=M.querySelector(n);(A=I==null?void 0:I.parentNode)===null||A===void 0||A.removeChild(I)}if(!p.test(R)){var I=M.querySelector(o);(N=I==null?void 0:I.parentNode)===null||N===void 0||N.removeChild(I)}return M.querySelectorAll(t)}case n:case o:{var j=d(R).querySelectorAll(V);return p.test(R)&&u.test(R)?j[0].parentNode.childNodes:j}default:{if(E)return E(R);var I=d(R,o).querySelector(o);return I.childNodes}}}return domparser}var hasRequiredHtmlToDom;function requireHtmlToDom(){if(hasRequiredHtmlToDom)return htmlToDom;hasRequiredHtmlToDom=1;var e=htmlToDom&&htmlToDom.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(htmlToDom,"__esModule",{value:!0}),htmlToDom.default=l;var t=e(requireDomparser()),n=requireUtilities$2(),o=/<(![a-zA-Z\s]+)>/;function l(u){if(typeof u!="string")throw new TypeError("First argument must be a string");if(!u)return[];var p=u.match(o),d=p?p[1]:void 0;return(0,n.formatDOM)((0,t.default)(u),null,d)}return htmlToDom}var attributesToProps={},lib={},possibleStandardNamesOptimized={},hasRequiredPossibleStandardNamesOptimized;function requirePossibleStandardNamesOptimized(){if(hasRequiredPossibleStandardNamesOptimized)return possibleStandardNamesOptimized;hasRequiredPossibleStandardNamesOptimized=1;var e=0;possibleStandardNamesOptimized.SAME=e;var t=1;return possibleStandardNamesOptimized.CAMELCASE=t,possibleStandardNamesOptimized.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1},possibleStandardNamesOptimized}var hasRequiredLib$1;function requireLib$1(){if(hasRequiredLib$1)return lib;hasRequiredLib$1=1;const e=0,t=1,n=2,o=3,l=4,u=5,p=6;function d(M){return m.hasOwnProperty(M)?m[M]:null}function f(M,I,j,B,L,q,F){this.acceptsBooleans=I===n||I===o||I===l,this.attributeName=B,this.attributeNamespace=L,this.mustUseProperty=j,this.propertyName=M,this.type=I,this.sanitizeURL=q,this.removeEmptyString=F}const m={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(M=>{m[M]=new f(M,e,!1,M,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([M,I])=>{m[M]=new f(M,t,!1,I,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(M=>{m[M]=new f(M,n,!1,M.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(M=>{m[M]=new f(M,n,!1,M,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(M=>{m[M]=new f(M,o,!1,M.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(M=>{m[M]=new f(M,o,!0,M,null,!1,!1)}),["capture","download"].forEach(M=>{m[M]=new f(M,l,!1,M,null,!1,!1)}),["cols","rows","size","span"].forEach(M=>{m[M]=new f(M,p,!1,M,null,!1,!1)}),["rowSpan","start"].forEach(M=>{m[M]=new f(M,u,!1,M.toLowerCase(),null,!1,!1)});const b=/[\-\:]([a-z])/g,_=M=>M[1].toUpperCase();["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(M=>{const I=M.replace(b,_);m[I]=new f(I,t,!1,M,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(M=>{const I=M.replace(b,_);m[I]=new f(I,t,!1,M,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(M=>{const I=M.replace(b,_);m[I]=new f(I,t,!1,M,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(M=>{m[M]=new f(M,t,!1,M.toLowerCase(),null,!1,!1)});const S="xlinkHref";m[S]=new f("xlinkHref",t,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(M=>{m[M]=new f(M,t,!1,M.toLowerCase(),null,!0,!0)});const{CAMELCASE:E,SAME:C,possibleStandardNames:R}=requirePossibleStandardNamesOptimized(),N=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",O=RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+N+"]*$")),V=Object.keys(R).reduce((M,I)=>{const j=R[I];return j===C?M[I]=I:j===E?M[I.toLowerCase()]=I:M[I]=j,M},{});return lib.BOOLEAN=o,lib.BOOLEANISH_STRING=n,lib.NUMERIC=u,lib.OVERLOADED_BOOLEAN=l,lib.POSITIVE_NUMERIC=p,lib.RESERVED=e,lib.STRING=t,lib.getPropertyInfo=d,lib.isCustomAttribute=O,lib.possibleStandardNames=V,lib}var utilities$1={},cjs$1={},inlineStyleParser,hasRequiredInlineStyleParser;function requireInlineStyleParser(){if(hasRequiredInlineStyleParser)return inlineStyleParser;hasRequiredInlineStyleParser=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,p=/^[;\s]*/,d=/^\s+|\s+$/g,f=`
|
|
855
|
-
`,m="/",g="*",b="",_="comment",S="declaration";inlineStyleParser=function(C,R){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];R=R||{};var A=1,N=1;function O(U){var G=U.match(t);G&&(A+=G.length);var J=U.lastIndexOf(f);N=~J?U.length-J:N+U.length}function V(){var U={line:A,column:N};return function(G){return G.position=new M(U),B(),G}}function M(U){this.start=U,this.end={line:A,column:N},this.source=R.source}M.prototype.content=C;function I(U){var G=new Error(R.source+":"+A+":"+N+": "+U);if(G.reason=U,G.filename=R.source,G.line=A,G.column=N,G.source=C,!R.silent)throw G}function j(U){var G=U.exec(C);if(G){var J=G[0];return O(J),C=C.slice(J.length),G}}function B(){j(n)}function L(U){var G;for(U=U||[];G=q();)G!==!1&&U.push(G);return U}function q(){var U=V();if(!(m!=C.charAt(0)||g!=C.charAt(1))){for(var G=2;b!=C.charAt(G)&&(g!=C.charAt(G)||m!=C.charAt(G+1));)++G;if(G+=2,b===C.charAt(G-1))return I("End of comment missing");var J=C.slice(2,G-2);return N+=2,O(J),C=C.slice(G),N+=2,U({type:_,comment:J})}}function F(){var U=V(),G=j(o);if(G){if(q(),!j(l))return I("property missing ':'");var J=j(u),ee=U({type:S,property:E(G[0].replace(e,b)),value:J?E(J[0].replace(e,b)):b});return j(p),ee}}function H(){var U=[];L(U);for(var G;G=F();)G!==!1&&(U.push(G),L(U));return U}return B(),H()};function E(C){return C?C.replace(d,b):b}return inlineStyleParser}var hasRequiredCjs$1;function requireCjs$1(){if(hasRequiredCjs$1)return cjs$1;hasRequiredCjs$1=1;var e=cjs$1&&cjs$1.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(cjs$1,"__esModule",{value:!0}),cjs$1.default=n;var t=e(requireInlineStyleParser());function n(o,l){var u=null;if(!o||typeof o!="string")return u;var p=(0,t.default)(o),d=typeof l=="function";return p.forEach(function(f){if(f.type==="declaration"){var m=f.property,g=f.value;d?l(m,g,f):g&&(u=u||{},u[m]=g)}}),u}return cjs$1}var utilities={},hasRequiredUtilities$1;function requireUtilities$1(){if(hasRequiredUtilities$1)return utilities;hasRequiredUtilities$1=1,Object.defineProperty(utilities,"__esModule",{value:!0}),utilities.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,u=function(m){return!m||n.test(m)||e.test(m)},p=function(m,g){return g.toUpperCase()},d=function(m,g){return"".concat(g,"-")},f=function(m,g){return g===void 0&&(g={}),u(m)?m:(m=m.toLowerCase(),g.reactCompat?m=m.replace(l,d):m=m.replace(o,d),m.replace(t,p))};return utilities.camelCase=f,utilities}var cjs,hasRequiredCjs;function requireCjs(){if(hasRequiredCjs)return cjs;hasRequiredCjs=1;var e=cjs&&cjs.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(requireCjs$1()),n=requireUtilities$1();function o(l,u){var p={};return!l||typeof l!="string"||(0,t.default)(l,function(d,f){d&&f&&(p[(0,n.camelCase)(d,u)]=f)}),p}return o.default=o,cjs=o,cjs}var hasRequiredUtilities;function requireUtilities(){return hasRequiredUtilities||(hasRequiredUtilities=1,function(e){var t=utilities$1&&utilities$1.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(e,"__esModule",{value:!0}),e.returnFirstArg=e.canTextBeChildOfNode=e.ELEMENTS_WITH_NO_TEXT_CHILDREN=e.PRESERVE_CUSTOM_ATTRIBUTES=void 0,e.isCustomComponent=u,e.setStyleProp=d;var n=React,o=t(requireCjs()),l=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function u(g,b){return g.includes("-")?!l.has(g):!!(b&&typeof b.is=="string")}var p={reactCompat:!0};function d(g,b){if(typeof g=="string"){if(!g.trim()){b.style={};return}try{b.style=(0,o.default)(g,p)}catch{b.style={}}}}e.PRESERVE_CUSTOM_ATTRIBUTES=Number(n.version.split(".")[0])>=16,e.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);var f=function(g){return!e.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(g.name)};e.canTextBeChildOfNode=f;var m=function(g){return g};e.returnFirstArg=m}(utilities$1)),utilities$1}var hasRequiredAttributesToProps;function requireAttributesToProps(){if(hasRequiredAttributesToProps)return attributesToProps;hasRequiredAttributesToProps=1,Object.defineProperty(attributesToProps,"__esModule",{value:!0}),attributesToProps.default=u;var e=requireLib$1(),t=requireUtilities(),n=["checked","value"],o=["input","select","textarea"],l={reset:!0,submit:!0};function u(d,f){d===void 0&&(d={});var m={},g=!!(d.type&&l[d.type]);for(var b in d){var _=d[b];if((0,e.isCustomAttribute)(b)){m[b]=_;continue}var S=b.toLowerCase(),E=p(S);if(E){var C=(0,e.getPropertyInfo)(E);switch(n.includes(E)&&o.includes(f)&&!g&&(E=p("default"+S)),m[E]=_,C&&C.type){case e.BOOLEAN:m[E]=!0;break;case e.OVERLOADED_BOOLEAN:_===""&&(m[E]=!0);break}continue}t.PRESERVE_CUSTOM_ATTRIBUTES&&(m[b]=_)}return(0,t.setStyleProp)(d.style,m),m}function p(d){return e.possibleStandardNames[d]}return attributesToProps}var domToReact={},hasRequiredDomToReact;function requireDomToReact(){if(hasRequiredDomToReact)return domToReact;hasRequiredDomToReact=1;var e=domToReact&&domToReact.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(domToReact,"__esModule",{value:!0}),domToReact.default=u;var t=React,n=e(requireAttributesToProps()),o=requireUtilities(),l={cloneElement:t.cloneElement,createElement:t.createElement,isValidElement:t.isValidElement};function u(d,f){f===void 0&&(f={});for(var m=[],g=typeof f.replace=="function",b=f.transform||o.returnFirstArg,_=f.library||l,S=_.cloneElement,E=_.createElement,C=_.isValidElement,R=d.length,A=0;A<R;A++){var N=d[A];if(g){var O=f.replace(N,A);if(C(O)){R>1&&(O=S(O,{key:O.key||A})),m.push(b(O,N,A));continue}}if(N.type==="text"){var V=!N.data.trim().length;if(V&&N.parent&&!(0,o.canTextBeChildOfNode)(N.parent)||f.trim&&V)continue;m.push(b(N.data,N,A));continue}var M=N,I={};p(M)?((0,o.setStyleProp)(M.attribs.style,M.attribs),I=M.attribs):M.attribs&&(I=(0,n.default)(M.attribs,M.name));var j=void 0;switch(N.type){case"script":case"style":N.children[0]&&(I.dangerouslySetInnerHTML={__html:N.children[0].data});break;case"tag":N.name==="textarea"&&N.children[0]?I.defaultValue=N.children[0].data:N.children&&N.children.length&&(j=u(N.children,f));break;default:continue}R>1&&(I.key=A),m.push(b(E(N.name,I,j),N,A))}return m.length===1?m[0]:m}function p(d){return o.PRESERVE_CUSTOM_ATTRIBUTES&&d.type==="tag"&&(0,o.isCustomComponent)(d.name,d.attribs)}return domToReact}var hasRequiredLib;function requireLib(){return hasRequiredLib||(hasRequiredLib=1,function(e){var t=lib$3&&lib$3.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToDOM=e.domToReact=e.attributesToProps=e.Text=e.ProcessingInstruction=e.Element=e.Comment=void 0,e.default=d;var n=t(requireHtmlToDom());e.htmlToDOM=n.default;var o=t(requireAttributesToProps());e.attributesToProps=o.default;var l=t(requireDomToReact());e.domToReact=l.default;var u=requireLib$2();Object.defineProperty(e,"Comment",{enumerable:!0,get:function(){return u.Comment}}),Object.defineProperty(e,"Element",{enumerable:!0,get:function(){return u.Element}}),Object.defineProperty(e,"ProcessingInstruction",{enumerable:!0,get:function(){return u.ProcessingInstruction}}),Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return u.Text}});var p={lowerCaseAttributeNames:!1};function d(f,m){if(typeof f!="string")throw new TypeError("First argument must be a string");return f?(0,l.default)((0,n.default)(f,(m==null?void 0:m.htmlparser2)||p),m):[]}}(lib$3)),lib$3}var libExports=requireLib();const HTMLReactParser=getDefaultExportFromCjs(libExports),parser=HTMLReactParser.default||HTMLReactParser;function SkeletonMessage({botStatus:e}){return jsxRuntime.jsxs("div",{className:"flex items-start gap-2",children:[jsxRuntime.jsx("div",{className:"h-8 w-8 mt-1 rounded-full bg-gray-300 animate-pulse flex-shrink-0"}),jsxRuntime.jsxs("div",{className:"flex flex-col max-w-[70%]",children:[jsxRuntime.jsxs("p",{className:"mb-1",children:["Assistant",jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground mt-1 ml-3",children:new Date().toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})})]}),jsxRuntime.jsx("div",{className:"rounded-md p-3 break-words bg-white border rounded-tl-none",children:jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("div",{className:"h-2 w-2 rounded-full bg-primary animate-pulse"}),jsxRuntime.jsx("div",{className:"h-2 w-2 rounded-full bg-primary animate-pulse delay-150"}),jsxRuntime.jsx("div",{className:"h-2 w-2 rounded-full bg-primary animate-pulse delay-300"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground ml-1",children:e})]})})]})]})}function ChatMessages({messages:e,currentUserId:t,botStatus:n,isAssistantChat:o}){return jsxRuntime.jsxs("div",{children:[e.map(l=>{const u=l.fromPartnerID===t;return jsxRuntime.jsxs("div",{className:cn("flex items-start gap-2 mt-2 mb-2",u&&"flex-row-reverse"),children:[jsxRuntime.jsx(Avatar,{className:"h-8 w-8 mt-1",children:jsxRuntime.jsx(AvatarImage,{src:`https://api.dicebear.com/9.x/thumbs/svg?seed=${md5(l.senderName+l.fromPartnerID)}&flip=${u}`})}),jsxRuntime.jsxs("div",{className:"flex flex-col max-w-[70%]",children:[jsxRuntime.jsxs("p",{className:"mb-1",children:[l.senderName,jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground mt-1 ml-3",children:(()=>{const p=new Date(l.timestamp);return isToday(p)?p.toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0}):isYesterday(p)?`Yesterday, ${p.toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})}`:`${p.toLocaleDateString([],{month:"short",day:"numeric"})} ${p.toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})}`})()})]}),jsxRuntime.jsx("div",{className:cn("rounded-md p-3 break-words [&_li]:ml-6 [&_li]:list-disc [&_h1]:text-lg [&_h1]:font-bold [&_h1]:mt-4 [&_h2]:font-bold [&_h2]:mt-4 [&_h3]:mt-4 ",u?"bg-primary text-white rounded-tr-none":"bg-white border rounded-tl-none"),children:l.fromPartnerID===ASSISTANT_ID?parser(l.content):l.content})]})]},l.id)}),n!==""&&jsxRuntime.jsx(SkeletonMessage,{botStatus:n}),e.length===0&&!o&&jsxRuntime.jsx("div",{className:"text-center text-muted-foreground py-8",children:"No messages yet"}),e.length===0&&n===""&&o&&jsxRuntime.jsxs("div",{className:"text-center py-8",children:[jsxRuntime.jsx("p",{children:"The Randmar Assistant is ready to help you. Ask anything about products, orders, carts, shipments and tracking numbers."}),jsxRuntime.jsx("p",{children:jsxRuntime.jsx("strong",{children:'Try it now, type "my open orders"!'})})]})]})}const ASSISTANT_ID="RandmarAIChatAssistant",ChatLayout=React.forwardRef(({userId:e,userName:t,apiKey:n,inputRef:o},l)=>{var ye,de,le;const{data:u}=useGetV4PartnerByApplicationIdBusinessDevelopmentConversationsQuery({applicationId:e}),[p]=useLazyGetV4PartnerByApplicationIdAccountQuery(),[d]=usePostV4PartnerByApplicationIdAccountDebugFeedbackMutation(),[f]=useLazyGetV4PartnerByApplicationIdBusinessDevelopmentConversationAndConversationIdMessagesQuery(),{handleSubmitToBot:m,botMessages:g,clearBotMessages:b,botReady:_,debugMessages:S,botStatus:E,reset:C}=useAIAssistant({userId:e,apiKey:n});React.useEffect(()=>{if(!u)return;const se={partner1:[e,ASSISTANT_ID].sort()[0],partner2:[e,ASSISTANT_ID].sort()[1],name:"Randmar Assistant",unread:0,pending:!1,historyFetched:!0,messages:[],conversationID:-1},te=u.map(xe=>{var oe;return{partner1:[xe.Participant1,xe.Participant2].sort()[0],partner2:[xe.Participant1,xe.Participant2].sort()[1],name:((oe=xe.Participant)==null?void 0:oe.PublicName)??"missing public name",unread:0,pending:xe.Status!="Approved",historyFetched:!1,messages:[],conversationID:xe.ConversationId}});setTimeout(()=>{var xe;return(xe=Z.current)==null?void 0:xe.focus()},50),L([se,...te])},[u]);const[R,A]=React.useState("all"),[N,O]=React.useState([[e,ASSISTANT_ID].sort()[0],[e,ASSISTANT_ID].sort()[1]]),[V,M]=React.useState(""),[I,j]=React.useState(null),[B,L]=React.useState([]),[q,F]=React.useState(""),[H,U]=React.useState(null),[G,J]=React.useState([]),[ee,ae]=React.useState(0),W=React.useRef(null),Q=React.useRef(null),Z=o||Q,ie=B.filter(se=>{const te=se.name.toLowerCase().includes(q.toLowerCase());return R==="all"?te:R==="approved"?te&&!se.pending:R==="pending"?te&&se.pending:te});React.useEffect(()=>{g.length!==0&&(g.forEach(se=>{if(!se||se.role!="assistant")return;if(se.isComponent){J(xe=>[...xe,se.content]),ae(0);return}const te={id:se.timestamp.toString(),fromPartnerID:ASSISTANT_ID,toPartnerID:e,senderName:"Assistant",timestamp:se.timestamp.getTime(),content:se.content};te.content=marked(te.content??"Please ask again.",{async:!1}),ce(te)}),b())},[g]);function ce(se){const te=[se.fromPartnerID,se.toPartnerID];te.sort(),L(xe=>{let oe=!1;const be=xe.map(_e=>_e.partner1!==te[0]||_e.partner2!==te[1]||_e.messages.findIndex(Ce=>Ce.id==se.id)!==-1?_e:(oe=!0,{..._e,unread:_e.unread+1,messages:[..._e.messages,se]}));return oe&&j([te[0],te[1]]),be})}React.useEffect(()=>{const se=new HubConnectionBuilder().withUrl("https://api.randmar.io/hub",{accessTokenFactory:()=>localStorage.getItem("access_token"),headers:{"X-Impersonated-Id":e}}).configureLogging(LogLevel.Information).withAutomaticReconnect().withHubProtocol(new JsonHubProtocol).build();return se.on("ReceiveMessage",ce),se.start().catch(te=>console.error("Error connecting to SignalR hub:",te)),U(se),()=>{se&&se.stop()}},[e]),React.useEffect(()=>{(I==null?void 0:I[0])!==(N==null?void 0:N[0])||(I==null?void 0:I[1])!==(N==null?void 0:N[1])||(L(se=>se.map(te=>te.partner1===(N==null?void 0:N[0])&&te.partner2===(N==null?void 0:N[1])?{...te,unread:0}:te)),setTimeout(()=>{var se;return(se=W.current)==null?void 0:se.scrollIntoView({behavior:"smooth"})},50))},[I,N]),React.useEffect(()=>{var te;if(!N)return;const se=getActiveChatObject(B,N);se&&((te=Z.current)==null||te.focus(),ae(G.length),p({applicationId:se.partner1===e?se.partner2:se.partner1}).then(xe=>{xe.data&&(J(oe=>[...oe,jsxRuntime.jsx("div",{className:"mt-2",children:jsxRuntime.jsx(PartnerCard,{account:xe.data,action:jsxRuntime.jsx(jsxRuntime.Fragment,{}),withVoice:!1})})]),ae(0))}),se.historyFetched?(L(xe=>xe.map(oe=>oe.partner1===N[0]&&oe.partner2===N[1]?{...oe,unread:0}:oe)),setTimeout(()=>{var xe;return(xe=W.current)==null?void 0:xe.scrollIntoView({behavior:"smooth"})},50)):f({applicationId:e,conversationId:se.conversationID}).unwrap().then(xe=>{const oe=xe.map(be=>({id:"history"+be.MessageId,fromPartnerID:be.SenderId,toPartnerID:be.SenderId==N[0]?N[1]:N[0],senderName:be.SenderName??"missing name",timestamp:new Date(be.SentDate+"Z").getTime(),content:be.Content??"no content"}));L(be=>be.map(_e=>_e.partner1===N[0]&&_e.partner2===N[1]?{..._e,messages:oe,historyFetched:!0}:_e)),setTimeout(()=>{var be;return(be=W.current)==null?void 0:be.scrollIntoView({behavior:"smooth"})},100)}).catch(xe=>{console.error("Error fetching conversation messages:",xe)}))},[N,f,e]);const ue=(se,te,xe)=>{const oe={id:crypto.randomUUID(),senderName:t,fromPartnerID:e,toPartnerID:te[0]===e?te[1]:te[0],content:se,timestamp:Date.now()};L(be=>be.map(_e=>_e.partner1===te[0]&&_e.partner2===te[1]?{..._e,messages:[..._e.messages,oe]}:_e)),j([te[0],te[1]]),oe.toPartnerID==ASSISTANT_ID?m(oe.content):xe.invoke("NewMessage",oe).catch(be=>console.error("Error sending message:",be)),M("")},fe=(se,te)=>{if(!B.length||!H||!_)return!1;const xe=B.find(oe=>oe.conversationID===se);return xe?(O([xe.partner1,xe.partner2]),te&&setTimeout(()=>ue(te,[xe.partner1,xe.partner2],H),100),!0):!1};if(React.useImperativeHandle(l,()=>({setActiveChatAndSendMessage:fe})),!_)return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),jsxRuntime.jsx("p",{children:"Loading API functions..."})]})})});const pe=()=>{!V.trim()||!N||!H||(ae(G.length),ue(V,N,H))},ve=()=>{const te={messages:B.find(xe=>xe.partner1===ASSISTANT_ID||xe.partner2===ASSISTANT_ID),debug:S};d({applicationId:e,emailAddress:t,body:te})},he=()=>{L(se=>se.map(xe=>xe.partner1!==ASSISTANT_ID&&xe.partner2!==ASSISTANT_ID?xe:{...xe,messages:[]})),C()};return jsxRuntime.jsxs("div",{className:"flex h-[85vh] overflow-hidden",children:[jsxRuntime.jsxs("div",{className:"w-[260px] p-4 pt-3 flex flex-col border-r",children:[jsxRuntime.jsx("div",{className:"p-4 font-semibold border-b",children:"Communications"}),B.length>1&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"p-2",children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(Search,{className:"absolute left-2 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),jsxRuntime.jsx(Input,{placeholder:"Search chats...",className:"pl-8 h-9",value:q,onChange:se=>F(se.target.value)})]})}),jsxRuntime.jsx(Tabs,{value:R,onValueChange:A,className:"w-full mb-1",children:jsxRuntime.jsxs(TabsList,{className:"grid grid-cols-8 h-9 mx-2",children:[jsxRuntime.jsx(TabsTrigger,{value:"all",className:"text-xs col-span-2",children:"All"}),jsxRuntime.jsx(TabsTrigger,{value:"approved",className:"text-xs col-span-3",children:"Approved"}),jsxRuntime.jsx(TabsTrigger,{value:"pending",className:"text-xs col-span-3",children:"Pending"})]})})]}),jsxRuntime.jsx(ScrollArea,{className:"flex-1",children:B.length&&jsxRuntime.jsx(ChatList,{userId:e,chats:ie.filter(se=>se.partner1!=ASSISTANT_ID&&se.partner2!=ASSISTANT_ID),activeChat:getActiveChatObject(B,N)??null,onSelectChat:O,assistantChat:B.find(se=>se.partner1==ASSISTANT_ID||se.partner2==ASSISTANT_ID)})})]}),jsxRuntime.jsx("div",{className:"flex-1 flex flex-col",children:N?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"flex items-center p-4 border-b",children:N[0]==ASSISTANT_ID||N[1]==ASSISTANT_ID?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Avatar,{className:"h-8 w-8 flex-shrink-0 rounded-none",children:jsxRuntime.jsx(Bot,{className:"text-primary fill-white min-h-full"})}),jsxRuntime.jsx("div",{className:"ml-3 font-medium",children:"Randmar Assistant"}),jsxRuntime.jsx(Button,{variant:"ghost",size:"icon",className:"ml-auto",onClick:()=>he(),children:jsxRuntime.jsx(MessageCircleX,{className:"h-5 w-5"})}),jsxRuntime.jsx(Button,{variant:"ghost",size:"icon",className:"ml-1",confirmationDialog:{title:"Report Issue",content:"This action will send a copy of your chat to Randmar. Send it?",onConfirm:()=>ve()},children:jsxRuntime.jsx(MessageSquareShare,{className:"h-5 w-5"})})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Avatar,{className:"h-8 w-8 flex-shrink-0 rounded-none",children:[jsxRuntime.jsx(AvatarImage,{src:`https://api.randmar.io/v4/Partner/${N[0]===e?N[1]:N[0]}/Account/Logo?height=72&width=72`,className:" object-contain "}),jsxRuntime.jsx(AvatarFallback,{children:jsxRuntime.jsx(Handshake,{className:"text-primary fill-white min-h-full"})})]}),jsxRuntime.jsx("div",{className:"ml-3 font-medium",children:(ye=getActiveChatObject(B,N))==null?void 0:ye.name})]})}),(de=getActiveChatObject(B,N))!=null&&de.pending?jsxRuntime.jsx("p",{className:"mt-8 p-2 mx-auto",children:"This conversation is still awaiting approval — please check back later."}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(ScrollArea,{className:"flex-1 pl-2 pr-2 bg-slate-50",children:[jsxRuntime.jsx(ChatMessages,{messages:((le=getActiveChatObject(B,N))==null?void 0:le.messages)??[],currentUserId:e,isAssistantChat:isAssistantChat(N),botStatus:isAssistantChat(N)?E:""}),jsxRuntime.jsx("div",{ref:W})]}),jsxRuntime.jsxs("div",{className:"p-4 border-t flex",children:[jsxRuntime.jsx(Textarea,{ref:Z,placeholder:"Type a message...",value:V,onChange:se=>M(se.target.value),onKeyDown:se=>{se.key!=="Enter"||se.shiftKey||(se.preventDefault(),pe())},className:"flex-1 resize-none"}),jsxRuntime.jsx(Button,{size:"icon",variant:"default",className:"ml-2 h-15 w-15",disabled:E!=="",onClick:pe,children:jsxRuntime.jsx(Send,{className:"h-6 w-6"})})]})]})]}):jsxRuntime.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Select a chat to start messaging"})}),jsxRuntime.jsxs("div",{className:"w-[480px] flex flex-1 flex-col border-l",children:[jsxRuntime.jsx("div",{className:"flex items-center p-4 border-b",children:jsxRuntime.jsx("p",{className:"h-9 text-base/9",children:"Visuals and System Info"})}),jsxRuntime.jsx(ScrollArea,{className:"flex-4 pl-2 pr-2 bg-slate-50",children:ee>=0&&G.length>ee&&G[G.length-(1+ee)]}),jsxRuntime.jsxs("div",{className:"flex bg-slate-50 border-t pt-1 pb-1 justify-center gap-4",children:[jsxRuntime.jsx(Button,{size:"icon",onClick:()=>ae(se=>se+1),children:jsxRuntime.jsx(ChevronLeft,{})}),jsxRuntime.jsx(Button,{size:"icon",onClick:()=>ae(se=>se-1),children:jsxRuntime.jsx(ChevronRight,{})})]}),jsxRuntime.jsx(ScrollArea,{className:"flex-1 border-t pl-2 pr-2 bg-slate-50",children:jsxRuntime.jsx("div",{className:"space-y-2",children:S.map(se=>jsxRuntime.jsx("p",{className:"text-slate-600",children:se}))})})]})]})});function getActiveChatObject(e,t){return e.find(n=>n.partner1==(t==null?void 0:t[0])&&n.partner2==(t==null?void 0:t[1]))}function isAssistantChat(e){return(e==null?void 0:e[0])==ASSISTANT_ID||(e==null?void 0:e[1])==ASSISTANT_ID}function QualificationBadge({qualification:e}){return!e.QualificationId||e.QualificationId==="Suspended"?null:e.QualificationId==="Do Not Sell"?jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs(Badge,{variant:"destructive",children:[jsxRuntime.jsx(X,{className:"h-3 w-3 mr-1"}),"Do Not Sell"]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Qualification"})})]})}):jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs(Badge,{variant:"success",children:[jsxRuntime.jsx(Check,{className:"h-3 w-3 mr-1"}),e.QualificationId,e.DefaultOpportunityNumber&&` | ${e.DefaultOpportunityNumber}`]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Qualification"})})]})})}function ManufacturerCard({manufacturer:e,link:t,linkNewTab:n=!0,actions:o,loading:l=!1}){var b,_,S;if(l||!e)return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-12 rounded-md"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-24 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-40 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-48"})]})]})}),jsxRuntime.jsx(CardContent,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex flex-col space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-16 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-14 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-40"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-36"})]})]})]})}),jsxRuntime.jsxs(CardFooter,{className:"flex justify-between pt-2 gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-40"})]})]});const u=e.ManufacturerId||"N/A",p=e.PublicName||"N/A",d=[e.City,e.Province,e.Country].filter(Boolean),f=d.length>0?d.join(", "):"",m=((b=e.Tags)==null?void 0:b.split(",").map(E=>E.trim()).filter(Boolean))||[],g=E=>E===void 0?"n/a":new Intl.NumberFormat("en-CA",{style:"currency",currency:"CAD",minimumFractionDigits:0,maximumFractionDigits:0}).format(E);return jsxRuntime.jsxs(Card,{className:"manufacturer-theme",children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:"h-12 w-12 overflow-hidden rounded-md",children:jsxRuntime.jsx("img",{src:`https://api.randmar.io/V4/Partner/${u}/Account/Logo?width=64&height=64`,alt:`${p}'s logo`,className:"max-h-10 w-auto object-contain"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs text-primary",children:"Manufacturer"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:"|"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:u})]}),jsxRuntime.jsx("h3",{className:"font-semibold",children:e.PublicName||"N/A"}),e.Name&&jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:e.Name}),f&&jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:f})]})]}),!!e.OnHold&&e.OnHold!==0&&jsxRuntime.jsx(Badge,{variant:"warning",children:"On Hold"})]}),jsxRuntime.jsx(CardContent,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex",children:[jsxRuntime.jsxs("div",{className:"flex flex-col flex-1 space-y-2",children:[(!!((_=e.Qualification)!=null&&_.QualificationId)&&((S=e.Qualification)==null?void 0:S.QualificationId)!=="Suspended"||!!e.OpenToWork||m.length>0)&&jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(QualificationBadge,{qualification:e.Qualification??{}}),!!e.OpenToWork&&jsxRuntime.jsxs(Badge,{variant:"success",children:[jsxRuntime.jsx(HardHat,{className:"h-3 w-3 mr-1"}),"Open To Work"]}),m.map((E,C)=>jsxRuntime.jsx(Badge,{variant:"outline",children:E},C))]}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[e.Phone&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Phone,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.Phone})]}),e.PublicEmail&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Mail,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.PublicEmail})]}),e.Website&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Globe,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.Website})]}),e.CurrencyCode&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(DollarSign,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.CurrencyCode})]})]})]}),e.SalesData&&jsxRuntime.jsxs("div",{className:"border-l pl-2 ml-2 flex flex-col text-sm",children:[jsxRuntime.jsx("strong",{className:"",children:"YTD"}),jsxRuntime.jsx("p",{children:g(e.SalesData.SalesYearToDay)}),jsxRuntime.jsx("strong",{className:"mt-2",children:"3 mo."}),jsxRuntime.jsx("p",{children:g(e.SalesData.SalesLast3Months)}),jsxRuntime.jsx("strong",{className:"mt-2",children:"30 days"}),jsxRuntime.jsx("p",{children:g(e.SalesData.SalesLast30Days)})]})]})}),(o||t)&&jsxRuntime.jsxs(CardFooter,{className:`flex pt-2 gap-2 ${o?"justify-between":"justify-end"}`,children:[o&&o,t&&jsxRuntime.jsx(Button,{className:"flex items-center gap-1",asChild:!0,children:n?jsxRuntime.jsxs(reactRouterDom.Link,{to:t,target:"_blank",children:[jsxRuntime.jsx(ExternalLink,{className:"h-4 w-4"}),"Go to Manufacturer"]}):jsxRuntime.jsx(reactRouterDom.Link,{to:t,children:"Go to Manufacturer"})})]})]})}function ResellerCard({reseller:e,link:t,actions:n,loading:o=!1}){var m,g;const l=b=>b===void 0?"n/a":new Intl.NumberFormat("en-CA",{style:"currency",currency:"CAD",minimumFractionDigits:0,maximumFractionDigits:0}).format(b);if(o||!e)return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-12 rounded-md"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-24 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-40 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-48"})]})]})}),jsxRuntime.jsx(CardContent,{className:"pb-2",children:jsxRuntime.jsx("div",{className:"flex",children:jsxRuntime.jsxs("div",{className:"flex flex-col flex-1 space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-16 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-14 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-40"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-36"})]})]})]})})}),jsxRuntime.jsxs(CardFooter,{className:"flex justify-between pt-2 gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-40"})]})]});const u=e.ResellerId||"N/A",p=e.PublicName||"N/A",d=[e.City,e.Province,e.Country].filter(Boolean),f=d.length>0?d.join(", "):"Location not provided";return jsxRuntime.jsxs(Card,{className:"reseller-theme",children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:"h-12 w-12 overflow-hidden rounded-md",children:jsxRuntime.jsx("img",{src:`https://api.randmar.io/V4/Partner/${u}/Account/Logo?width=64&height=64`,alt:`${p}'s logo`,className:"max-h-10 w-auto object-contain"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs text-primary",children:"Reseller"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:"|"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:u})]}),jsxRuntime.jsx("h3",{className:"font-semibold",children:e.PublicName||"N/A"}),e.Name&&jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:e.Name}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:f})]})]}),!!e.OnHold&&e.OnHold!==0&&jsxRuntime.jsx(Badge,{variant:"warning",children:"On Hold"})]}),jsxRuntime.jsx(CardContent,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex",children:[jsxRuntime.jsxs("div",{className:"flex flex-col flex-1 space-y-2",children:[!!((m=e.Qualification)!=null&&m.QualificationId)&&((g=e.Qualification)==null?void 0:g.QualificationId)!=="Suspended"&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2",children:jsxRuntime.jsx(QualificationBadge,{qualification:e.Qualification??{}})}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[e.Phone&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Phone,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.Phone})]}),e.PublicEmail&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Mail,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.PublicEmail})]}),e.Website&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Globe,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.Website})]}),e.CurrencyCode&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(DollarSign,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.CurrencyCode})]})]})]}),(e==null?void 0:e.SalesData)&&jsxRuntime.jsxs("div",{className:"border-l pl-2 ml-2 flex flex-col text-sm",children:[jsxRuntime.jsx("strong",{className:"",children:"YTD"}),jsxRuntime.jsx("p",{children:l(e==null?void 0:e.SalesData.SalesYearToDay)}),jsxRuntime.jsx("strong",{className:"mt-2",children:"3 mo."}),jsxRuntime.jsx("p",{children:l(e==null?void 0:e.SalesData.SalesLast3Months)}),jsxRuntime.jsx("strong",{className:"mt-2",children:"30 days"}),jsxRuntime.jsx("p",{children:l(e==null?void 0:e.SalesData.SalesLast30Days)})]})]})}),(n||t)&&jsxRuntime.jsxs(CardFooter,{className:`flex pt-2 gap-2 ${n?"justify-between":"justify-end"}`,children:[n&&n,t&&jsxRuntime.jsx(Button,{className:"flex items-center gap-1",asChild:!0,children:jsxRuntime.jsxs(reactRouterDom.Link,{to:t,target:"_blank",children:[jsxRuntime.jsx(ExternalLink,{className:"h-4 w-4"}),"Go to Reseller"]})})]})]})}const Topbar=React.forwardRef(({onSignOut:e,handleValidSearch:t,rightMenu:n,searchPlaceholder:o},l)=>{const[u,p]=React.useState(""),d=reactRouterDom.useLocation(),{toast:f}=useToast();React.useEffect(()=>{const _=new URLSearchParams(d.search).get("q");_&&p(_)},[d.search]);const m=()=>{const b=u.trim();if(!b||b.length<2){f({title:"Enter more characters to search",description:"At least 2 characters are needed to search products.",variant:"destructive",duration:5e3});return}t(b)},g=b=>{b.key==="Enter"&&m()};return jsxRuntime.jsxs("header",{className:"flex h-16 items-center gap-4 border-b sidebar-foreground bg-sidebar px-6 fixed top-0 right-0 z-50 lg:left-64 left-0 border-sidebar-border",children:[jsxRuntime.jsx(SidebarTrigger,{className:"lg:hidden",children:jsxRuntime.jsx(Menu$1,{className:"h-6 w-6"})}),jsxRuntime.jsx("div",{className:"flex flex-1 items-center gap-4",children:jsxRuntime.jsx("div",{className:"relative w-full max-w-sm",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("button",{type:"button",className:"absolute left-2 top-1/2 -translate-y-1/2",onClick:m,"aria-label":"Search",children:jsxRuntime.jsx(Search,{className:"h-4 w-4 text-muted-foreground"})}),jsxRuntime.jsx(Input,{placeholder:o??"Search...",className:"w-full pl-8 bg-white text-black",value:u,onChange:b=>p(b.target.value),onKeyDown:g,ref:l},"topbar-search")]})})}),n||jsxRuntime.jsx(jsxRuntime.Fragment,{}),e&&jsxRuntime.jsx("div",{className:"flex items-center gap-4",children:jsxRuntime.jsxs(Button,{variant:"ghost",size:"icon",className:"h-9 w-9",onClick:e,children:[jsxRuntime.jsx(LogOut,{className:"h-4 w-4 text-sidebar-foreground"}),jsxRuntime.jsx("span",{className:"sr-only",children:"Sign out"})]})})]})});Topbar.displayName="Topbar";function ActiveOrdersCard({orders:e,loading:t=!1}){const n=u=>new Intl.NumberFormat("en-CA",{style:"currency",currency:"CAD",minimumFractionDigits:2,maximumFractionDigits:2}).format(u),o=React.useMemo(()=>{if(!e||e.length===0)return{all:{orders:0,amount:0},processing:{orders:0,amount:0},shipped:{orders:0,amount:0},delayed:{orders:0,amount:0}};const u=e.filter(A=>A.DocumentType==="Order"),p=e.filter(A=>A.DocumentType==="Shipment"),d=u.filter(A=>A.WarehouseCode!=="3PLE"),f=d.reduce((A,N)=>A+(N.Quantity||0),0),m=d.reduce((A,N)=>A+(N.ExtendedPrice||0),0),g=u.filter(A=>A.WarehouseCode==="3PLE"),b=g.reduce((A,N)=>A+(N.Quantity||0),0),_=g.reduce((A,N)=>A+(N.ExtendedPrice||0),0),S=p.length,E=p.reduce((A,N)=>A+(N.ExtendedPrice||0),0),C=f+b+S,R=m+_+E;return{all:{orders:C,amount:R},processing:{orders:f,amount:m},shipped:{orders:S,amount:E},delayed:{orders:b,amount:_}}},[e]),l=[{name:"All",icon:Package,color:"bg-blue-500",textColor:"text-blue-600",orders:o.all.orders,amount:o.all.amount},{name:"Processing",icon:RefreshCcw,color:"bg-yellow-500",textColor:"text-yellow-600",orders:o.processing.orders,amount:o.processing.amount},{name:"Shipped",icon:Truck,color:"bg-green-500",textColor:"text-green-600",orders:o.shipped.orders,amount:o.shipped.amount},{name:"Delayed",icon:CircleAlert,color:"bg-red-500",textColor:"text-red-600",orders:o.delayed.orders,amount:o.delayed.amount}];return t?jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{className:"pb-0",children:jsxRuntime.jsx(CardTitle,{className:"text-lg font-bold",children:"Active Orders"})}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 p-4",children:[1,2,3,4].map(u=>jsxRuntime.jsxs("div",{className:"overflow-hidden rounded-md border",children:[jsxRuntime.jsx("div",{className:"bg-slate-200 dark:bg-slate-700 h-[3px]"}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-16 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-7 w-12"})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-16 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]})]})]})]},u))})]}):jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{className:"pb-0",children:jsxRuntime.jsx(CardTitle,{className:"text-lg font-bold",children:"Active Orders"})}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 p-4",children:l.map(u=>jsxRuntime.jsxs("div",{className:"overflow-hidden rounded-md border",children:[jsxRuntime.jsx("div",{className:`${u.color} bg-opacity-60 h-[3px]`}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-base",children:u.name}),jsxRuntime.jsx("div",{className:`${u.color} bg-opacity-90 p-2 rounded-full`,children:jsxRuntime.jsx(u.icon,{className:"size-4 shrink-0 text-white"})})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Orders"}),jsxRuntime.jsx("p",{className:"text-xl font-bold",children:u.orders})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Amount"}),jsxRuntime.jsx("p",{className:"text-base font-semibold",children:n(u.amount)})]})]})]})]},u.name))})]})}var __create=Object.create,__getProtoOf=Object.getPrototypeOf,__defProp=Object.defineProperty,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__toESM=(e,t,n)=>{n=e!=null?__create(__getProtoOf(e)):{};const o=t||!e||!e.__esModule?__defProp(n,"default",{value:e,enumerable:!0}):n;for(let l of __getOwnPropNames(e))__hasOwnProp.call(o,l)||__defProp(o,l,{get:()=>e[l],enumerable:!0});return o},__commonJS=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),require_xhtml=__commonJS((e,t)=>{t.exports={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}}),require_acorn=__commonJS((e,t)=>{(function(n,o){typeof e=="object"&&typeof t<"u"?o(e):typeof define=="function"&&define.amd?define(["exports"],o):(n=typeof globalThis<"u"?globalThis:n||self,o(n.acorn={}))})(e,function(n){var o=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],l=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],u="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",p="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",d={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},f="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",m={5:f,"5module":f+" export import",6:f+" const class extends export import super"},g=/^in(stanceof)?$/,b=new RegExp("["+p+"]"),_=new RegExp("["+p+u+"]");function S(T,D){for(var z=65536,K=0;K<D.length;K+=2){if(z+=D[K],z>T)return!1;if(z+=D[K+1],z>=T)return!0}return!1}function E(T,D){return T<65?T===36:T<91?!0:T<97?T===95:T<123?!0:T<=65535?T>=170&&b.test(String.fromCharCode(T)):D===!1?!1:S(T,l)}function C(T,D){return T<48?T===36:T<58?!0:T<65?!1:T<91?!0:T<97?T===95:T<123?!0:T<=65535?T>=170&&_.test(String.fromCharCode(T)):D===!1?!1:S(T,l)||S(T,o)}var R=function(D,z){z===void 0&&(z={}),this.label=D,this.keyword=z.keyword,this.beforeExpr=!!z.beforeExpr,this.startsExpr=!!z.startsExpr,this.isLoop=!!z.isLoop,this.isAssign=!!z.isAssign,this.prefix=!!z.prefix,this.postfix=!!z.postfix,this.binop=z.binop||null,this.updateContext=null};function A(T,D){return new R(T,{beforeExpr:!0,binop:D})}var N={beforeExpr:!0},O={startsExpr:!0},V={};function M(T,D){return D===void 0&&(D={}),D.keyword=T,V[T]=new R(T,D)}var I={num:new R("num",O),regexp:new R("regexp",O),string:new R("string",O),name:new R("name",O),privateId:new R("privateId",O),eof:new R("eof"),bracketL:new R("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new R("]"),braceL:new R("{",{beforeExpr:!0,startsExpr:!0}),braceR:new R("}"),parenL:new R("(",{beforeExpr:!0,startsExpr:!0}),parenR:new R(")"),comma:new R(",",N),semi:new R(";",N),colon:new R(":",N),dot:new R("."),question:new R("?",N),questionDot:new R("?."),arrow:new R("=>",N),template:new R("template"),invalidTemplate:new R("invalidTemplate"),ellipsis:new R("...",N),backQuote:new R("`",O),dollarBraceL:new R("${",{beforeExpr:!0,startsExpr:!0}),eq:new R("=",{beforeExpr:!0,isAssign:!0}),assign:new R("_=",{beforeExpr:!0,isAssign:!0}),incDec:new R("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new R("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:A("||",1),logicalAND:A("&&",2),bitwiseOR:A("|",3),bitwiseXOR:A("^",4),bitwiseAND:A("&",5),equality:A("==/!=/===/!==",6),relational:A("</>/<=/>=",7),bitShift:A("<</>>/>>>",8),plusMin:new R("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:A("%",10),star:A("*",10),slash:A("/",10),starstar:new R("**",{beforeExpr:!0}),coalesce:A("??",1),_break:M("break"),_case:M("case",N),_catch:M("catch"),_continue:M("continue"),_debugger:M("debugger"),_default:M("default",N),_do:M("do",{isLoop:!0,beforeExpr:!0}),_else:M("else",N),_finally:M("finally"),_for:M("for",{isLoop:!0}),_function:M("function",O),_if:M("if"),_return:M("return",N),_switch:M("switch"),_throw:M("throw",N),_try:M("try"),_var:M("var"),_const:M("const"),_while:M("while",{isLoop:!0}),_with:M("with"),_new:M("new",{beforeExpr:!0,startsExpr:!0}),_this:M("this",O),_super:M("super",O),_class:M("class",O),_extends:M("extends",N),_export:M("export"),_import:M("import",O),_null:M("null",O),_true:M("true",O),_false:M("false",O),_in:M("in",{beforeExpr:!0,binop:7}),_instanceof:M("instanceof",{beforeExpr:!0,binop:7}),_typeof:M("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:M("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:M("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},j=/\r\n?|\n|\u2028|\u2029/,B=new RegExp(j.source,"g");function L(T){return T===10||T===13||T===8232||T===8233}function q(T,D,z){z===void 0&&(z=T.length);for(var K=D;K<z;K++){var ne=T.charCodeAt(K);if(L(ne))return K<z-1&&ne===13&&T.charCodeAt(K+1)===10?K+2:K+1}return-1}var F=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,H=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,U=Object.prototype,G=U.hasOwnProperty,J=U.toString,ee=Object.hasOwn||function(T,D){return G.call(T,D)},ae=Array.isArray||function(T){return J.call(T)==="[object Array]"},W=Object.create(null);function Q(T){return W[T]||(W[T]=new RegExp("^(?:"+T.replace(/ /g,"|")+")$"))}function Z(T){return T<=65535?String.fromCharCode(T):(T-=65536,String.fromCharCode((T>>10)+55296,(T&1023)+56320))}var ie=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,ce=function(D,z){this.line=D,this.column=z};ce.prototype.offset=function(D){return new ce(this.line,this.column+D)};var ue=function(D,z,K){this.start=z,this.end=K,D.sourceFile!==null&&(this.source=D.sourceFile)};function fe(T,D){for(var z=1,K=0;;){var ne=q(T,K,D);if(ne<0)return new ce(z,D-K);++z,K=ne}}var pe={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},ve=!1;function he(T){var D={};for(var z in pe)D[z]=T&&ee(T,z)?T[z]:pe[z];if(D.ecmaVersion==="latest"?D.ecmaVersion=1e8:D.ecmaVersion==null?(!ve&&typeof console=="object"&&console.warn&&(ve=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
860
|
+
`,m="/",g="*",b="",_="comment",S="declaration";inlineStyleParser=function(C,R){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];R=R||{};var A=1,N=1;function O(U){var G=U.match(t);G&&(A+=G.length);var J=U.lastIndexOf(f);N=~J?U.length-J:N+U.length}function V(){var U={line:A,column:N};return function(G){return G.position=new M(U),B(),G}}function M(U){this.start=U,this.end={line:A,column:N},this.source=R.source}M.prototype.content=C;function I(U){var G=new Error(R.source+":"+A+":"+N+": "+U);if(G.reason=U,G.filename=R.source,G.line=A,G.column=N,G.source=C,!R.silent)throw G}function j(U){var G=U.exec(C);if(G){var J=G[0];return O(J),C=C.slice(J.length),G}}function B(){j(n)}function L(U){var G;for(U=U||[];G=q();)G!==!1&&U.push(G);return U}function q(){var U=V();if(!(m!=C.charAt(0)||g!=C.charAt(1))){for(var G=2;b!=C.charAt(G)&&(g!=C.charAt(G)||m!=C.charAt(G+1));)++G;if(G+=2,b===C.charAt(G-1))return I("End of comment missing");var J=C.slice(2,G-2);return N+=2,O(J),C=C.slice(G),N+=2,U({type:_,comment:J})}}function F(){var U=V(),G=j(o);if(G){if(q(),!j(l))return I("property missing ':'");var J=j(u),ee=U({type:S,property:E(G[0].replace(e,b)),value:J?E(J[0].replace(e,b)):b});return j(p),ee}}function H(){var U=[];L(U);for(var G;G=F();)G!==!1&&(U.push(G),L(U));return U}return B(),H()};function E(C){return C?C.replace(d,b):b}return inlineStyleParser}var hasRequiredCjs$1;function requireCjs$1(){if(hasRequiredCjs$1)return cjs$1;hasRequiredCjs$1=1;var e=cjs$1&&cjs$1.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(cjs$1,"__esModule",{value:!0}),cjs$1.default=n;var t=e(requireInlineStyleParser());function n(o,l){var u=null;if(!o||typeof o!="string")return u;var p=(0,t.default)(o),d=typeof l=="function";return p.forEach(function(f){if(f.type==="declaration"){var m=f.property,g=f.value;d?l(m,g,f):g&&(u=u||{},u[m]=g)}}),u}return cjs$1}var utilities={},hasRequiredUtilities$1;function requireUtilities$1(){if(hasRequiredUtilities$1)return utilities;hasRequiredUtilities$1=1,Object.defineProperty(utilities,"__esModule",{value:!0}),utilities.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,u=function(m){return!m||n.test(m)||e.test(m)},p=function(m,g){return g.toUpperCase()},d=function(m,g){return"".concat(g,"-")},f=function(m,g){return g===void 0&&(g={}),u(m)?m:(m=m.toLowerCase(),g.reactCompat?m=m.replace(l,d):m=m.replace(o,d),m.replace(t,p))};return utilities.camelCase=f,utilities}var cjs,hasRequiredCjs;function requireCjs(){if(hasRequiredCjs)return cjs;hasRequiredCjs=1;var e=cjs&&cjs.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(requireCjs$1()),n=requireUtilities$1();function o(l,u){var p={};return!l||typeof l!="string"||(0,t.default)(l,function(d,f){d&&f&&(p[(0,n.camelCase)(d,u)]=f)}),p}return o.default=o,cjs=o,cjs}var hasRequiredUtilities;function requireUtilities(){return hasRequiredUtilities||(hasRequiredUtilities=1,function(e){var t=utilities$1&&utilities$1.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(e,"__esModule",{value:!0}),e.returnFirstArg=e.canTextBeChildOfNode=e.ELEMENTS_WITH_NO_TEXT_CHILDREN=e.PRESERVE_CUSTOM_ATTRIBUTES=void 0,e.isCustomComponent=u,e.setStyleProp=d;var n=React,o=t(requireCjs()),l=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function u(g,b){return g.includes("-")?!l.has(g):!!(b&&typeof b.is=="string")}var p={reactCompat:!0};function d(g,b){if(typeof g=="string"){if(!g.trim()){b.style={};return}try{b.style=(0,o.default)(g,p)}catch{b.style={}}}}e.PRESERVE_CUSTOM_ATTRIBUTES=Number(n.version.split(".")[0])>=16,e.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);var f=function(g){return!e.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(g.name)};e.canTextBeChildOfNode=f;var m=function(g){return g};e.returnFirstArg=m}(utilities$1)),utilities$1}var hasRequiredAttributesToProps;function requireAttributesToProps(){if(hasRequiredAttributesToProps)return attributesToProps;hasRequiredAttributesToProps=1,Object.defineProperty(attributesToProps,"__esModule",{value:!0}),attributesToProps.default=u;var e=requireLib$1(),t=requireUtilities(),n=["checked","value"],o=["input","select","textarea"],l={reset:!0,submit:!0};function u(d,f){d===void 0&&(d={});var m={},g=!!(d.type&&l[d.type]);for(var b in d){var _=d[b];if((0,e.isCustomAttribute)(b)){m[b]=_;continue}var S=b.toLowerCase(),E=p(S);if(E){var C=(0,e.getPropertyInfo)(E);switch(n.includes(E)&&o.includes(f)&&!g&&(E=p("default"+S)),m[E]=_,C&&C.type){case e.BOOLEAN:m[E]=!0;break;case e.OVERLOADED_BOOLEAN:_===""&&(m[E]=!0);break}continue}t.PRESERVE_CUSTOM_ATTRIBUTES&&(m[b]=_)}return(0,t.setStyleProp)(d.style,m),m}function p(d){return e.possibleStandardNames[d]}return attributesToProps}var domToReact={},hasRequiredDomToReact;function requireDomToReact(){if(hasRequiredDomToReact)return domToReact;hasRequiredDomToReact=1;var e=domToReact&&domToReact.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(domToReact,"__esModule",{value:!0}),domToReact.default=u;var t=React,n=e(requireAttributesToProps()),o=requireUtilities(),l={cloneElement:t.cloneElement,createElement:t.createElement,isValidElement:t.isValidElement};function u(d,f){f===void 0&&(f={});for(var m=[],g=typeof f.replace=="function",b=f.transform||o.returnFirstArg,_=f.library||l,S=_.cloneElement,E=_.createElement,C=_.isValidElement,R=d.length,A=0;A<R;A++){var N=d[A];if(g){var O=f.replace(N,A);if(C(O)){R>1&&(O=S(O,{key:O.key||A})),m.push(b(O,N,A));continue}}if(N.type==="text"){var V=!N.data.trim().length;if(V&&N.parent&&!(0,o.canTextBeChildOfNode)(N.parent)||f.trim&&V)continue;m.push(b(N.data,N,A));continue}var M=N,I={};p(M)?((0,o.setStyleProp)(M.attribs.style,M.attribs),I=M.attribs):M.attribs&&(I=(0,n.default)(M.attribs,M.name));var j=void 0;switch(N.type){case"script":case"style":N.children[0]&&(I.dangerouslySetInnerHTML={__html:N.children[0].data});break;case"tag":N.name==="textarea"&&N.children[0]?I.defaultValue=N.children[0].data:N.children&&N.children.length&&(j=u(N.children,f));break;default:continue}R>1&&(I.key=A),m.push(b(E(N.name,I,j),N,A))}return m.length===1?m[0]:m}function p(d){return o.PRESERVE_CUSTOM_ATTRIBUTES&&d.type==="tag"&&(0,o.isCustomComponent)(d.name,d.attribs)}return domToReact}var hasRequiredLib;function requireLib(){return hasRequiredLib||(hasRequiredLib=1,function(e){var t=lib$3&&lib$3.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToDOM=e.domToReact=e.attributesToProps=e.Text=e.ProcessingInstruction=e.Element=e.Comment=void 0,e.default=d;var n=t(requireHtmlToDom());e.htmlToDOM=n.default;var o=t(requireAttributesToProps());e.attributesToProps=o.default;var l=t(requireDomToReact());e.domToReact=l.default;var u=requireLib$2();Object.defineProperty(e,"Comment",{enumerable:!0,get:function(){return u.Comment}}),Object.defineProperty(e,"Element",{enumerable:!0,get:function(){return u.Element}}),Object.defineProperty(e,"ProcessingInstruction",{enumerable:!0,get:function(){return u.ProcessingInstruction}}),Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return u.Text}});var p={lowerCaseAttributeNames:!1};function d(f,m){if(typeof f!="string")throw new TypeError("First argument must be a string");return f?(0,l.default)((0,n.default)(f,(m==null?void 0:m.htmlparser2)||p),m):[]}}(lib$3)),lib$3}var libExports=requireLib();const HTMLReactParser=getDefaultExportFromCjs(libExports),parser=HTMLReactParser.default||HTMLReactParser;function SkeletonMessage({botStatus:e}){return jsxRuntime.jsxs("div",{className:"flex items-start gap-2",children:[jsxRuntime.jsx("div",{className:"h-8 w-8 mt-1 rounded-full bg-gray-300 animate-pulse flex-shrink-0"}),jsxRuntime.jsxs("div",{className:"flex flex-col max-w-[70%]",children:[jsxRuntime.jsxs("p",{className:"mb-1",children:["Assistant",jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground mt-1 ml-3",children:new Date().toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})})]}),jsxRuntime.jsx("div",{className:"rounded-md p-3 break-words bg-white border rounded-tl-none",children:jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("div",{className:"h-2 w-2 rounded-full bg-primary animate-pulse"}),jsxRuntime.jsx("div",{className:"h-2 w-2 rounded-full bg-primary animate-pulse delay-150"}),jsxRuntime.jsx("div",{className:"h-2 w-2 rounded-full bg-primary animate-pulse delay-300"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground ml-1",children:e})]})})]})]})}function ChatMessages({messages:e,currentUserId:t,botStatus:n,isAssistantChat:o}){return jsxRuntime.jsxs("div",{children:[e.map(l=>{const u=l.fromPartnerID===t;return jsxRuntime.jsxs("div",{className:cn("flex items-start gap-2 mt-2 mb-2",u&&"flex-row-reverse"),children:[jsxRuntime.jsx(Avatar,{className:"h-8 w-8 mt-1",children:jsxRuntime.jsx(AvatarImage,{src:`https://api.dicebear.com/9.x/thumbs/svg?seed=${md5(l.senderName+l.fromPartnerID)}&flip=${u}`})}),jsxRuntime.jsxs("div",{className:"flex flex-col max-w-[70%]",children:[jsxRuntime.jsxs("p",{className:"mb-1",children:[l.senderName,jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground mt-1 ml-3",children:(()=>{const p=new Date(l.timestamp);return isToday(p)?p.toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0}):isYesterday(p)?`Yesterday, ${p.toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})}`:`${p.toLocaleDateString([],{month:"short",day:"numeric"})} ${p.toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})}`})()})]}),jsxRuntime.jsx("div",{className:cn("rounded-md p-3 break-words [&_li]:ml-6 [&_li]:list-disc [&_h1]:text-lg [&_h1]:font-bold [&_h1]:mt-4 [&_h2]:font-bold [&_h2]:mt-4 [&_h3]:mt-4 ",u?"bg-primary text-white rounded-tr-none":"bg-white border rounded-tl-none"),children:l.fromPartnerID===ASSISTANT_ID?parser(l.content):l.content})]})]},l.id)}),n!==""&&jsxRuntime.jsx(SkeletonMessage,{botStatus:n}),e.length===0&&!o&&jsxRuntime.jsx("div",{className:"text-center text-muted-foreground py-8",children:"No messages yet"}),e.length===0&&n===""&&o&&jsxRuntime.jsxs("div",{className:"text-center py-8",children:[jsxRuntime.jsx("p",{children:"The Randmar Assistant is ready to help you. Ask anything about products, orders, carts, shipments and tracking numbers."}),jsxRuntime.jsx("p",{children:jsxRuntime.jsx("strong",{children:'Try it now, type "my open orders"!'})})]})]})}const ASSISTANT_ID="RandmarAIChatAssistant",ChatLayout=React.forwardRef(({userId:e,userName:t,apiKey:n,inputRef:o},l)=>{var ye,de,le;const{data:u}=useGetV4PartnerByApplicationIdBusinessDevelopmentConversationsQuery({applicationId:e}),[p]=useLazyGetV4PartnerByApplicationIdAccountQuery(),[d]=usePostV4PartnerByApplicationIdAccountDebugFeedbackMutation(),[f]=useLazyGetV4PartnerByApplicationIdBusinessDevelopmentConversationAndConversationIdMessagesQuery(),{handleSubmitToBot:m,botMessages:g,clearBotMessages:b,botReady:_,debugMessages:S,botStatus:E,reset:C}=useAIAssistant({userId:e,apiKey:n});React.useEffect(()=>{if(!u)return;const se={partner1:[e,ASSISTANT_ID].sort()[0],partner2:[e,ASSISTANT_ID].sort()[1],name:"Randmar Assistant",unread:0,pending:!1,historyFetched:!0,messages:[],conversationID:-1},te=u.map(xe=>{var oe;return{partner1:[xe.Participant1,xe.Participant2].sort()[0],partner2:[xe.Participant1,xe.Participant2].sort()[1],name:((oe=xe.Participant)==null?void 0:oe.PublicName)??"missing public name",unread:0,pending:xe.Status!="Approved",historyFetched:!1,messages:[],conversationID:xe.ConversationId}});setTimeout(()=>{var xe;return(xe=Z.current)==null?void 0:xe.focus()},50),L([se,...te])},[u]);const[R,A]=React.useState("all"),[N,O]=React.useState([[e,ASSISTANT_ID].sort()[0],[e,ASSISTANT_ID].sort()[1]]),[V,M]=React.useState(""),[I,j]=React.useState(null),[B,L]=React.useState([]),[q,F]=React.useState(""),[H,U]=React.useState(null),[G,J]=React.useState([]),[ee,ae]=React.useState(0),W=React.useRef(null),Q=React.useRef(null),Z=o||Q,ie=B.filter(se=>{const te=se.name.toLowerCase().includes(q.toLowerCase());return R==="all"?te:R==="approved"?te&&!se.pending:R==="pending"?te&&se.pending:te});React.useEffect(()=>{g.length!==0&&(g.forEach(se=>{if(!se||se.role!="assistant")return;if(se.isComponent){J(xe=>[...xe,se.content]),ae(0);return}const te={id:se.timestamp.toString(),fromPartnerID:ASSISTANT_ID,toPartnerID:e,senderName:"Assistant",timestamp:se.timestamp.getTime(),content:se.content};te.content=marked(te.content??"Please ask again.",{async:!1}),ce(te)}),b())},[g]);function ce(se){const te=[se.fromPartnerID,se.toPartnerID];te.sort(),L(xe=>{let oe=!1;const be=xe.map(_e=>_e.partner1!==te[0]||_e.partner2!==te[1]||_e.messages.findIndex(Ce=>Ce.id==se.id)!==-1?_e:(oe=!0,{..._e,unread:_e.unread+1,messages:[..._e.messages,se]}));return oe&&j([te[0],te[1]]),be})}React.useEffect(()=>{const se=new HubConnectionBuilder().withUrl("https://api.randmar.io/hub",{accessTokenFactory:()=>localStorage.getItem("access_token"),headers:{"X-Impersonated-Id":e}}).configureLogging(LogLevel.Information).withAutomaticReconnect().withHubProtocol(new JsonHubProtocol).build();return se.on("ReceiveMessage",ce),se.start().catch(te=>console.error("Error connecting to SignalR hub:",te)),U(se),()=>{se&&se.stop()}},[e]),React.useEffect(()=>{(I==null?void 0:I[0])!==(N==null?void 0:N[0])||(I==null?void 0:I[1])!==(N==null?void 0:N[1])||(L(se=>se.map(te=>te.partner1===(N==null?void 0:N[0])&&te.partner2===(N==null?void 0:N[1])?{...te,unread:0}:te)),setTimeout(()=>{var se;return(se=W.current)==null?void 0:se.scrollIntoView({behavior:"smooth"})},50))},[I,N]),React.useEffect(()=>{var te;if(!N)return;const se=getActiveChatObject(B,N);se&&((te=Z.current)==null||te.focus(),ae(G.length),p({applicationId:se.partner1===e?se.partner2:se.partner1}).then(xe=>{xe.data&&(J(oe=>[...oe,jsxRuntime.jsx("div",{className:"mt-2",children:jsxRuntime.jsx(PartnerCard,{account:xe.data,action:jsxRuntime.jsx(jsxRuntime.Fragment,{}),withVoice:!1})})]),ae(0))}),se.historyFetched?(L(xe=>xe.map(oe=>oe.partner1===N[0]&&oe.partner2===N[1]?{...oe,unread:0}:oe)),setTimeout(()=>{var xe;return(xe=W.current)==null?void 0:xe.scrollIntoView({behavior:"smooth"})},50)):f({applicationId:e,conversationId:se.conversationID}).unwrap().then(xe=>{const oe=xe.map(be=>({id:"history"+be.MessageId,fromPartnerID:be.SenderId,toPartnerID:be.SenderId==N[0]?N[1]:N[0],senderName:be.SenderName??"missing name",timestamp:new Date(be.SentDate+"Z").getTime(),content:be.Content??"no content"}));L(be=>be.map(_e=>_e.partner1===N[0]&&_e.partner2===N[1]?{..._e,messages:oe,historyFetched:!0}:_e)),setTimeout(()=>{var be;return(be=W.current)==null?void 0:be.scrollIntoView({behavior:"smooth"})},100)}).catch(xe=>{console.error("Error fetching conversation messages:",xe)}))},[N,f,e]);const ue=(se,te,xe)=>{const oe={id:crypto.randomUUID(),senderName:t,fromPartnerID:e,toPartnerID:te[0]===e?te[1]:te[0],content:se,timestamp:Date.now()};L(be=>be.map(_e=>_e.partner1===te[0]&&_e.partner2===te[1]?{..._e,messages:[..._e.messages,oe]}:_e)),j([te[0],te[1]]),oe.toPartnerID==ASSISTANT_ID?m(oe.content):xe.invoke("NewMessage",oe).catch(be=>console.error("Error sending message:",be)),M("")},fe=(se,te)=>{if(!B.length||!H||!_)return!1;const xe=B.find(oe=>oe.conversationID===se);return xe?(O([xe.partner1,xe.partner2]),te&&setTimeout(()=>ue(te,[xe.partner1,xe.partner2],H),100),!0):!1};if(React.useImperativeHandle(l,()=>({setActiveChatAndSendMessage:fe})),!_)return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),jsxRuntime.jsx("p",{children:"Loading API functions..."})]})})});const pe=()=>{!V.trim()||!N||!H||(ae(G.length),ue(V,N,H))},ve=()=>{const te={messages:B.find(xe=>xe.partner1===ASSISTANT_ID||xe.partner2===ASSISTANT_ID),debug:S};d({applicationId:e,emailAddress:t,body:te})},he=()=>{L(se=>se.map(xe=>xe.partner1!==ASSISTANT_ID&&xe.partner2!==ASSISTANT_ID?xe:{...xe,messages:[]})),C()};return jsxRuntime.jsxs("div",{className:"flex h-[85vh] overflow-hidden",children:[jsxRuntime.jsxs("div",{className:"w-[260px] p-4 pt-3 flex flex-col border-r",children:[jsxRuntime.jsx("div",{className:"p-4 font-semibold border-b",children:"Communications"}),B.length>1&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"p-2",children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(Search,{className:"absolute left-2 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),jsxRuntime.jsx(Input,{placeholder:"Search chats...",className:"pl-8 h-9",value:q,onChange:se=>F(se.target.value)})]})}),jsxRuntime.jsx(Tabs,{value:R,onValueChange:A,className:"w-full mb-1",children:jsxRuntime.jsxs(TabsList,{className:"grid grid-cols-8 h-9 mx-2",children:[jsxRuntime.jsx(TabsTrigger,{value:"all",className:"text-xs col-span-2",children:"All"}),jsxRuntime.jsx(TabsTrigger,{value:"approved",className:"text-xs col-span-3",children:"Approved"}),jsxRuntime.jsx(TabsTrigger,{value:"pending",className:"text-xs col-span-3",children:"Pending"})]})})]}),jsxRuntime.jsx(ScrollArea,{className:"flex-1",children:B.length&&jsxRuntime.jsx(ChatList,{userId:e,chats:ie.filter(se=>se.partner1!=ASSISTANT_ID&&se.partner2!=ASSISTANT_ID),activeChat:getActiveChatObject(B,N)??null,onSelectChat:O,assistantChat:B.find(se=>se.partner1==ASSISTANT_ID||se.partner2==ASSISTANT_ID)})})]}),jsxRuntime.jsx("div",{className:"flex-1 flex flex-col",children:N?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"flex items-center p-4 border-b",children:N[0]==ASSISTANT_ID||N[1]==ASSISTANT_ID?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Avatar,{className:"h-8 w-8 flex-shrink-0 rounded-none",children:jsxRuntime.jsx(Bot,{className:"text-primary fill-white min-h-full"})}),jsxRuntime.jsx("div",{className:"ml-3 font-medium",children:"Randmar Assistant"}),jsxRuntime.jsx(Button,{variant:"ghost",size:"icon",className:"ml-auto",onClick:()=>he(),children:jsxRuntime.jsx(MessageCircleX,{className:"h-5 w-5"})}),jsxRuntime.jsx(Button,{variant:"ghost",size:"icon",className:"ml-1",confirmationDialog:{title:"Report Issue",content:"This action will send a copy of your chat to Randmar. Send it?",onConfirm:()=>ve()},children:jsxRuntime.jsx(MessageSquareShare,{className:"h-5 w-5"})})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Avatar,{className:"h-8 w-8 flex-shrink-0 rounded-none",children:[jsxRuntime.jsx(AvatarImage,{src:`https://api.randmar.io/v4/Partner/${N[0]===e?N[1]:N[0]}/Account/Logo?height=72&width=72`,className:" object-contain "}),jsxRuntime.jsx(AvatarFallback,{children:jsxRuntime.jsx(Handshake,{className:"text-primary fill-white min-h-full"})})]}),jsxRuntime.jsx("div",{className:"ml-3 font-medium",children:(ye=getActiveChatObject(B,N))==null?void 0:ye.name})]})}),(de=getActiveChatObject(B,N))!=null&&de.pending?jsxRuntime.jsx("p",{className:"mt-8 p-2 mx-auto",children:"This conversation is still awaiting approval — please check back later."}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(ScrollArea,{className:"flex-1 pl-2 pr-2 bg-slate-50",children:[jsxRuntime.jsx(ChatMessages,{messages:((le=getActiveChatObject(B,N))==null?void 0:le.messages)??[],currentUserId:e,isAssistantChat:isAssistantChat(N),botStatus:isAssistantChat(N)?E:""}),jsxRuntime.jsx("div",{ref:W})]}),jsxRuntime.jsxs("div",{className:"p-4 border-t flex",children:[jsxRuntime.jsx(Textarea,{ref:Z,placeholder:"Type a message...",value:V,onChange:se=>M(se.target.value),onKeyDown:se=>{se.key!=="Enter"||se.shiftKey||(se.preventDefault(),pe())},className:"flex-1 resize-none"}),jsxRuntime.jsx(Button,{size:"icon",variant:"default",className:"ml-2 h-15 w-15",disabled:E!=="",onClick:pe,children:jsxRuntime.jsx(Send,{className:"h-6 w-6"})})]})]})]}):jsxRuntime.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Select a chat to start messaging"})}),jsxRuntime.jsxs("div",{className:"w-[480px] flex flex-1 flex-col border-l",children:[jsxRuntime.jsx("div",{className:"flex items-center p-4 border-b",children:jsxRuntime.jsx("p",{className:"h-9 text-base/9",children:"Visuals and System Info"})}),jsxRuntime.jsx(ScrollArea,{className:"flex-4 pl-2 pr-2 bg-slate-50",children:ee>=0&&G.length>ee&&G[G.length-(1+ee)]}),jsxRuntime.jsxs("div",{className:"flex bg-slate-50 border-t pt-1 pb-1 justify-center gap-4",children:[jsxRuntime.jsx(Button,{size:"icon",onClick:()=>ae(se=>se+1),children:jsxRuntime.jsx(ChevronLeft,{})}),jsxRuntime.jsx(Button,{size:"icon",onClick:()=>ae(se=>se-1),children:jsxRuntime.jsx(ChevronRight,{})})]}),jsxRuntime.jsx(ScrollArea,{className:"flex-1 border-t pl-2 pr-2 bg-slate-50",children:jsxRuntime.jsx("div",{className:"space-y-2",children:S.map(se=>jsxRuntime.jsx("p",{className:"text-slate-600",children:se}))})})]})]})});function getActiveChatObject(e,t){return e.find(n=>n.partner1==(t==null?void 0:t[0])&&n.partner2==(t==null?void 0:t[1]))}function isAssistantChat(e){return(e==null?void 0:e[0])==ASSISTANT_ID||(e==null?void 0:e[1])==ASSISTANT_ID}function QualificationBadge({qualification:e}){return!e.QualificationId||e.QualificationId==="Suspended"?null:e.QualificationId==="Do Not Sell"?jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs(Badge,{variant:"destructive",children:[jsxRuntime.jsx(X,{className:"h-3 w-3 mr-1"}),"Do Not Sell"]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Qualification"})})]})}):jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs(Badge,{variant:"info",className:"pr-1",children:[jsxRuntime.jsx(BadgeCheck,{className:"h-3 w-3 mr-1"}),e.QualificationId,e.DefaultOpportunityNumber&&jsxRuntime.jsx(Badge,{variant:"secondary",size:"sm",className:"ml-1",children:e.DefaultOpportunityNumber})]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Qualification"})})]})})}function ManufacturerCard({manufacturer:e,link:t,linkNewTab:n=!0,actions:o,mainAction:l,loading:u=!1}){var E,C,R;if(u||!e)return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-12 rounded-md"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-24 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-40 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-48"})]})]}),jsxRuntime.jsx(Skeleton,{className:"h-16 w-24"})]}),jsxRuntime.jsx(CardContent,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex flex-col space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-16 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-14 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-40"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-36"})]})]})]})}),jsxRuntime.jsxs(CardFooter,{className:"flex justify-between pt-2 gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-40"})]})]});const p=e.ManufacturerId||"N/A",d=e.PublicName||"N/A",f=[e.City,e.Province,e.Country].filter(Boolean),m=f.length>0?f.join(", "):"",g=((E=e.Tags)==null?void 0:E.split(",").map(A=>A.trim()).filter(Boolean))||[],b=A=>A===void 0?"n/a":new Intl.NumberFormat("en-CA",{style:"currency",currency:"CAD",minimumFractionDigits:0,maximumFractionDigits:0}).format(A),S=(A=>!A||A.length===0?[]:[...A].sort((N,O)=>(N.Day||0)-(O.Day||0)).map(N=>({date:N.Day||0,amount:N.ExtendedPrice||0})))(e.SalesStatistics);return jsxRuntime.jsxs(Card,{className:"manufacturer-theme flex flex-col h-full",children:[jsxRuntime.jsx(reactRouterDom.Link,{to:t??"#",target:t&&n?"_blank":"_self",children:jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:"h-12 w-12 overflow-hidden rounded-md",children:jsxRuntime.jsx("img",{src:`https://api.randmar.io/V4/Partner/${p}/Account/Logo?width=64&height=64`,alt:`${d}'s logo`,className:"max-h-10 w-auto object-contain"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs text-primary",children:"Manufacturer"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:"|"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:p})]}),jsxRuntime.jsx("h3",{className:"font-semibold",children:e.PublicName||"N/A"}),e.Name&&jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:e.Name}),m&&jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:m})]})]}),jsxRuntime.jsx("div",{className:"flex flex-col items-end gap-2",children:S.length>0&&jsxRuntime.jsx("div",{className:"h-16 w-24",children:jsxRuntime.jsx(AreaChart,{data:S,height:60,size:"mini"})})})]})}),jsxRuntime.jsx(CardContent,{className:"pb-2 flex-grow",children:jsxRuntime.jsxs("div",{className:"flex",children:[jsxRuntime.jsxs("div",{className:"flex flex-col flex-1 space-y-2",children:[(!!((C=e.Qualification)!=null&&C.QualificationId)&&((R=e.Qualification)==null?void 0:R.QualificationId)!=="Suspended"||!!e.OpenToWork||g.length>0)&&jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(QualificationBadge,{qualification:e.Qualification??{}}),!!e.OpenToWork&&jsxRuntime.jsxs(Badge,{variant:"success",children:[jsxRuntime.jsx(HardHat,{className:"h-3 w-3 mr-1"}),"Open To Work"]}),!!e.OnHold&&e.OnHold!==0&&jsxRuntime.jsx(Badge,{variant:"warning",children:"On Hold"}),g.map((A,N)=>jsxRuntime.jsx(Badge,{variant:"outline",children:A},N))]}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[e.Phone&&jsxRuntime.jsxs(reactRouterDom.Link,{to:`tel:${e.Phone}`,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Phone,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.Phone})]}),e.PublicEmail&&jsxRuntime.jsxs(reactRouterDom.Link,{to:`mailto:${e.PublicEmail}`,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Mail,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.PublicEmail})]}),e.Website&&jsxRuntime.jsxs(reactRouterDom.Link,{to:e.Website,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Globe,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.Website})]}),e.CurrencyCode&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(DollarSign,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.CurrencyCode})]})]})]}),e.SalesData&&jsxRuntime.jsxs("div",{className:"border-l pl-2 ml-2 flex flex-col text-sm",children:[jsxRuntime.jsx("strong",{className:"",children:"YTD"}),jsxRuntime.jsx("p",{children:b(e.SalesData.SalesYearToDay)}),jsxRuntime.jsx("strong",{className:"mt-2",children:"3 mo."}),jsxRuntime.jsx("p",{children:b(e.SalesData.SalesLast3Months)}),jsxRuntime.jsx("strong",{className:"mt-2",children:"30 days"}),jsxRuntime.jsx("p",{children:b(e.SalesData.SalesLast30Days)})]})]})}),(o||t||l)&&jsxRuntime.jsxs(CardFooter,{className:"flex pt-2 gap-2 justify-between mt-auto",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[t&&jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(Button,{size:"icon",asChild:!0,children:jsxRuntime.jsxs(reactRouterDom.Link,{to:t,target:n?"_blank":"_self",children:[jsxRuntime.jsx(Eye,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{className:"sr-only",children:"View Manufacturer"})]})})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"View Manufacturer"})})]})}),o&&o]}),l&&jsxRuntime.jsx("div",{children:l})]})]})}function ResellerCard({reseller:e,link:t,actions:n,loading:o=!1}){var m,g;const l=b=>b===void 0?"n/a":new Intl.NumberFormat("en-CA",{style:"currency",currency:"CAD",minimumFractionDigits:0,maximumFractionDigits:0}).format(b);if(o||!e)return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-12 rounded-md"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-24 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-40 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-48"})]})]})}),jsxRuntime.jsx(CardContent,{className:"pb-2",children:jsxRuntime.jsx("div",{className:"flex",children:jsxRuntime.jsxs("div",{className:"flex flex-col flex-1 space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-16 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-14 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-40"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-36"})]})]})]})})}),jsxRuntime.jsxs(CardFooter,{className:"flex justify-between pt-2 gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-40"})]})]});const u=e.ResellerId||"N/A",p=e.PublicName||"N/A",d=[e.City,e.Province,e.Country].filter(Boolean),f=d.length>0?d.join(", "):"Location not provided";return jsxRuntime.jsxs(Card,{className:"reseller-theme",children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:"h-12 w-12 overflow-hidden rounded-md",children:jsxRuntime.jsx("img",{src:`https://api.randmar.io/V4/Partner/${u}/Account/Logo?width=64&height=64`,alt:`${p}'s logo`,className:"max-h-10 w-auto object-contain"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs text-primary",children:"Reseller"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:"|"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:u})]}),jsxRuntime.jsx("h3",{className:"font-semibold",children:e.PublicName||"N/A"}),e.Name&&jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:e.Name}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:f})]})]}),!!e.OnHold&&e.OnHold!==0&&jsxRuntime.jsx(Badge,{variant:"warning",children:"On Hold"})]}),jsxRuntime.jsx(CardContent,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex",children:[jsxRuntime.jsxs("div",{className:"flex flex-col flex-1 space-y-2",children:[!!((m=e.Qualification)!=null&&m.QualificationId)&&((g=e.Qualification)==null?void 0:g.QualificationId)!=="Suspended"&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2",children:jsxRuntime.jsx(QualificationBadge,{qualification:e.Qualification??{}})}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[e.Phone&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Phone,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.Phone})]}),e.PublicEmail&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Mail,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.PublicEmail})]}),e.Website&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Globe,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.Website})]}),e.CurrencyCode&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(DollarSign,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.CurrencyCode})]})]})]}),(e==null?void 0:e.SalesData)&&jsxRuntime.jsxs("div",{className:"border-l pl-2 ml-2 flex flex-col text-sm",children:[jsxRuntime.jsx("strong",{className:"",children:"YTD"}),jsxRuntime.jsx("p",{children:l(e==null?void 0:e.SalesData.SalesYearToDay)}),jsxRuntime.jsx("strong",{className:"mt-2",children:"3 mo."}),jsxRuntime.jsx("p",{children:l(e==null?void 0:e.SalesData.SalesLast3Months)}),jsxRuntime.jsx("strong",{className:"mt-2",children:"30 days"}),jsxRuntime.jsx("p",{children:l(e==null?void 0:e.SalesData.SalesLast30Days)})]})]})}),(n||t)&&jsxRuntime.jsxs(CardFooter,{className:`flex pt-2 gap-2 ${n?"justify-between":"justify-end"}`,children:[n&&n,t&&jsxRuntime.jsx(Button,{className:"flex items-center gap-1",asChild:!0,children:jsxRuntime.jsxs(reactRouterDom.Link,{to:t,target:"_blank",children:[jsxRuntime.jsx(ExternalLink,{className:"h-4 w-4"}),"Go to Reseller"]})})]})]})}const Topbar=React.forwardRef(({onSignOut:e,handleValidSearch:t,rightMenu:n,searchPlaceholder:o},l)=>{const[u,p]=React.useState(""),d=reactRouterDom.useLocation(),{toast:f}=useToast();React.useEffect(()=>{const _=new URLSearchParams(d.search).get("q");_&&p(_)},[d.search]);const m=()=>{const b=u.trim();if(!b||b.length<2){f({title:"Enter more characters to search",description:"At least 2 characters are needed to search products.",variant:"destructive",duration:5e3});return}t(b)},g=b=>{b.key==="Enter"&&m()};return jsxRuntime.jsxs("header",{className:"flex h-16 items-center gap-4 border-b sidebar-foreground bg-sidebar px-6 fixed top-0 right-0 z-50 lg:left-64 left-0 border-sidebar-border",children:[jsxRuntime.jsx(SidebarTrigger,{className:"lg:hidden",children:jsxRuntime.jsx(Menu$1,{className:"h-6 w-6"})}),jsxRuntime.jsx("div",{className:"flex flex-1 items-center gap-4",children:jsxRuntime.jsx("div",{className:"relative w-full max-w-sm",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("button",{type:"button",className:"absolute left-2 top-1/2 -translate-y-1/2",onClick:m,"aria-label":"Search",children:jsxRuntime.jsx(Search,{className:"h-4 w-4 text-muted-foreground"})}),jsxRuntime.jsx(Input,{placeholder:o??"Search...",className:"w-full pl-8 bg-white text-black",value:u,onChange:b=>p(b.target.value),onKeyDown:g,ref:l},"topbar-search")]})})}),n||jsxRuntime.jsx(jsxRuntime.Fragment,{}),e&&jsxRuntime.jsx("div",{className:"flex items-center gap-4",children:jsxRuntime.jsxs(Button,{variant:"ghost",size:"icon",className:"h-9 w-9",onClick:e,children:[jsxRuntime.jsx(LogOut,{className:"h-4 w-4 text-sidebar-foreground"}),jsxRuntime.jsx("span",{className:"sr-only",children:"Sign out"})]})})]})});Topbar.displayName="Topbar";function ActiveOrdersCard({orders:e,loading:t=!1}){const n=u=>new Intl.NumberFormat("en-CA",{style:"currency",currency:"CAD",minimumFractionDigits:2,maximumFractionDigits:2}).format(u),o=React.useMemo(()=>{if(!e||e.length===0)return{all:{orders:0,amount:0},processing:{orders:0,amount:0},shipped:{orders:0,amount:0},delayed:{orders:0,amount:0}};const u=e.filter(A=>A.DocumentType==="Order"),p=e.filter(A=>A.DocumentType==="Shipment"),d=u.filter(A=>A.WarehouseCode!=="3PLE"),f=d.reduce((A,N)=>A+(N.Quantity||0),0),m=d.reduce((A,N)=>A+(N.ExtendedPrice||0),0),g=u.filter(A=>A.WarehouseCode==="3PLE"),b=g.reduce((A,N)=>A+(N.Quantity||0),0),_=g.reduce((A,N)=>A+(N.ExtendedPrice||0),0),S=p.length,E=p.reduce((A,N)=>A+(N.ExtendedPrice||0),0),C=f+b+S,R=m+_+E;return{all:{orders:C,amount:R},processing:{orders:f,amount:m},shipped:{orders:S,amount:E},delayed:{orders:b,amount:_}}},[e]),l=[{name:"All",icon:Package,color:"bg-blue-500",textColor:"text-blue-600",orders:o.all.orders,amount:o.all.amount},{name:"Processing",icon:RefreshCcw,color:"bg-yellow-500",textColor:"text-yellow-600",orders:o.processing.orders,amount:o.processing.amount},{name:"Shipped",icon:Truck,color:"bg-green-500",textColor:"text-green-600",orders:o.shipped.orders,amount:o.shipped.amount},{name:"Delayed",icon:CircleAlert,color:"bg-red-500",textColor:"text-red-600",orders:o.delayed.orders,amount:o.delayed.amount}];return t?jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{className:"pb-0",children:jsxRuntime.jsx(CardTitle,{className:"text-lg font-bold",children:"Active Orders"})}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 p-4",children:[1,2,3,4].map(u=>jsxRuntime.jsxs("div",{className:"overflow-hidden rounded-md border",children:[jsxRuntime.jsx("div",{className:"bg-slate-200 dark:bg-slate-700 h-[3px]"}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-16 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-7 w-12"})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-16 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]})]})]})]},u))})]}):jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{className:"pb-0",children:jsxRuntime.jsx(CardTitle,{className:"text-lg font-bold",children:"Active Orders"})}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 p-4",children:l.map(u=>jsxRuntime.jsxs("div",{className:"overflow-hidden rounded-md border",children:[jsxRuntime.jsx("div",{className:`${u.color} bg-opacity-60 h-[3px]`}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-base",children:u.name}),jsxRuntime.jsx("div",{className:`${u.color} bg-opacity-90 p-2 rounded-full`,children:jsxRuntime.jsx(u.icon,{className:"size-4 shrink-0 text-white"})})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Orders"}),jsxRuntime.jsx("p",{className:"text-xl font-bold",children:u.orders})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Amount"}),jsxRuntime.jsx("p",{className:"text-base font-semibold",children:n(u.amount)})]})]})]})]},u.name))})]})}var __create=Object.create,__getProtoOf=Object.getPrototypeOf,__defProp=Object.defineProperty,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__toESM=(e,t,n)=>{n=e!=null?__create(__getProtoOf(e)):{};const o=t||!e||!e.__esModule?__defProp(n,"default",{value:e,enumerable:!0}):n;for(let l of __getOwnPropNames(e))__hasOwnProp.call(o,l)||__defProp(o,l,{get:()=>e[l],enumerable:!0});return o},__commonJS=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),require_xhtml=__commonJS((e,t)=>{t.exports={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}}),require_acorn=__commonJS((e,t)=>{(function(n,o){typeof e=="object"&&typeof t<"u"?o(e):typeof define=="function"&&define.amd?define(["exports"],o):(n=typeof globalThis<"u"?globalThis:n||self,o(n.acorn={}))})(e,function(n){var o=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],l=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],u="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",p="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",d={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},f="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",m={5:f,"5module":f+" export import",6:f+" const class extends export import super"},g=/^in(stanceof)?$/,b=new RegExp("["+p+"]"),_=new RegExp("["+p+u+"]");function S(T,D){for(var z=65536,K=0;K<D.length;K+=2){if(z+=D[K],z>T)return!1;if(z+=D[K+1],z>=T)return!0}return!1}function E(T,D){return T<65?T===36:T<91?!0:T<97?T===95:T<123?!0:T<=65535?T>=170&&b.test(String.fromCharCode(T)):D===!1?!1:S(T,l)}function C(T,D){return T<48?T===36:T<58?!0:T<65?!1:T<91?!0:T<97?T===95:T<123?!0:T<=65535?T>=170&&_.test(String.fromCharCode(T)):D===!1?!1:S(T,l)||S(T,o)}var R=function(D,z){z===void 0&&(z={}),this.label=D,this.keyword=z.keyword,this.beforeExpr=!!z.beforeExpr,this.startsExpr=!!z.startsExpr,this.isLoop=!!z.isLoop,this.isAssign=!!z.isAssign,this.prefix=!!z.prefix,this.postfix=!!z.postfix,this.binop=z.binop||null,this.updateContext=null};function A(T,D){return new R(T,{beforeExpr:!0,binop:D})}var N={beforeExpr:!0},O={startsExpr:!0},V={};function M(T,D){return D===void 0&&(D={}),D.keyword=T,V[T]=new R(T,D)}var I={num:new R("num",O),regexp:new R("regexp",O),string:new R("string",O),name:new R("name",O),privateId:new R("privateId",O),eof:new R("eof"),bracketL:new R("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new R("]"),braceL:new R("{",{beforeExpr:!0,startsExpr:!0}),braceR:new R("}"),parenL:new R("(",{beforeExpr:!0,startsExpr:!0}),parenR:new R(")"),comma:new R(",",N),semi:new R(";",N),colon:new R(":",N),dot:new R("."),question:new R("?",N),questionDot:new R("?."),arrow:new R("=>",N),template:new R("template"),invalidTemplate:new R("invalidTemplate"),ellipsis:new R("...",N),backQuote:new R("`",O),dollarBraceL:new R("${",{beforeExpr:!0,startsExpr:!0}),eq:new R("=",{beforeExpr:!0,isAssign:!0}),assign:new R("_=",{beforeExpr:!0,isAssign:!0}),incDec:new R("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new R("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:A("||",1),logicalAND:A("&&",2),bitwiseOR:A("|",3),bitwiseXOR:A("^",4),bitwiseAND:A("&",5),equality:A("==/!=/===/!==",6),relational:A("</>/<=/>=",7),bitShift:A("<</>>/>>>",8),plusMin:new R("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:A("%",10),star:A("*",10),slash:A("/",10),starstar:new R("**",{beforeExpr:!0}),coalesce:A("??",1),_break:M("break"),_case:M("case",N),_catch:M("catch"),_continue:M("continue"),_debugger:M("debugger"),_default:M("default",N),_do:M("do",{isLoop:!0,beforeExpr:!0}),_else:M("else",N),_finally:M("finally"),_for:M("for",{isLoop:!0}),_function:M("function",O),_if:M("if"),_return:M("return",N),_switch:M("switch"),_throw:M("throw",N),_try:M("try"),_var:M("var"),_const:M("const"),_while:M("while",{isLoop:!0}),_with:M("with"),_new:M("new",{beforeExpr:!0,startsExpr:!0}),_this:M("this",O),_super:M("super",O),_class:M("class",O),_extends:M("extends",N),_export:M("export"),_import:M("import",O),_null:M("null",O),_true:M("true",O),_false:M("false",O),_in:M("in",{beforeExpr:!0,binop:7}),_instanceof:M("instanceof",{beforeExpr:!0,binop:7}),_typeof:M("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:M("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:M("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},j=/\r\n?|\n|\u2028|\u2029/,B=new RegExp(j.source,"g");function L(T){return T===10||T===13||T===8232||T===8233}function q(T,D,z){z===void 0&&(z=T.length);for(var K=D;K<z;K++){var ne=T.charCodeAt(K);if(L(ne))return K<z-1&&ne===13&&T.charCodeAt(K+1)===10?K+2:K+1}return-1}var F=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,H=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,U=Object.prototype,G=U.hasOwnProperty,J=U.toString,ee=Object.hasOwn||function(T,D){return G.call(T,D)},ae=Array.isArray||function(T){return J.call(T)==="[object Array]"},W=Object.create(null);function Q(T){return W[T]||(W[T]=new RegExp("^(?:"+T.replace(/ /g,"|")+")$"))}function Z(T){return T<=65535?String.fromCharCode(T):(T-=65536,String.fromCharCode((T>>10)+55296,(T&1023)+56320))}var ie=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,ce=function(D,z){this.line=D,this.column=z};ce.prototype.offset=function(D){return new ce(this.line,this.column+D)};var ue=function(D,z,K){this.start=z,this.end=K,D.sourceFile!==null&&(this.source=D.sourceFile)};function fe(T,D){for(var z=1,K=0;;){var ne=q(T,K,D);if(ne<0)return new ce(z,D-K);++z,K=ne}}var pe={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},ve=!1;function he(T){var D={};for(var z in pe)D[z]=T&&ee(T,z)?T[z]:pe[z];if(D.ecmaVersion==="latest"?D.ecmaVersion=1e8:D.ecmaVersion==null?(!ve&&typeof console=="object"&&console.warn&&(ve=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
856
861
|
Defaulting to 2020, but this will stop working in the future.`)),D.ecmaVersion=11):D.ecmaVersion>=2015&&(D.ecmaVersion-=2009),D.allowReserved==null&&(D.allowReserved=D.ecmaVersion<5),(!T||T.allowHashBang==null)&&(D.allowHashBang=D.ecmaVersion>=14),ae(D.onToken)){var K=D.onToken;D.onToken=function(ne){return K.push(ne)}}return ae(D.onComment)&&(D.onComment=ye(D,D.onComment)),D}function ye(T,D){return function(z,K,ne,me,ge,Se){var Pe={type:z?"Block":"Line",value:K,start:ne,end:me};T.locations&&(Pe.loc=new ue(this,ge,Se)),T.ranges&&(Pe.range=[ne,me]),D.push(Pe)}}var de=1,le=2,se=4,te=8,xe=16,oe=32,be=64,_e=128,Ce=256,Te=de|le|Ce;function Ee(T,D){return le|(T?se:0)|(D?te:0)}var Me=0,Le=1,Ne=2,qe=3,Ue=4,Fe=5,$e=function(D,z,K){this.options=D=he(D),this.sourceFile=D.sourceFile,this.keywords=Q(m[D.ecmaVersion>=6?6:D.sourceType==="module"?"5module":5]);var ne="";D.allowReserved!==!0&&(ne=d[D.ecmaVersion>=6?6:D.ecmaVersion===5?5:3],D.sourceType==="module"&&(ne+=" await")),this.reservedWords=Q(ne);var me=(ne?ne+" ":"")+d.strict;this.reservedWordsStrict=Q(me),this.reservedWordsStrictBind=Q(me+" "+d.strictBind),this.input=String(z),this.containsEsc=!1,K?(this.pos=K,this.lineStart=this.input.lastIndexOf(`
|
|
857
862
|
`,K-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(j).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=I.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=D.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&D.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(de),this.regexpState=null,this.privateNameStack=[]},He={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};$e.prototype.parse=function(){var D=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(D)},He.inFunction.get=function(){return(this.currentVarScope().flags&le)>0},He.inGenerator.get=function(){return(this.currentVarScope().flags&te)>0&&!this.currentVarScope().inClassFieldInit},He.inAsync.get=function(){return(this.currentVarScope().flags&se)>0&&!this.currentVarScope().inClassFieldInit},He.canAwait.get=function(){for(var T=this.scopeStack.length-1;T>=0;T--){var D=this.scopeStack[T];if(D.inClassFieldInit||D.flags&Ce)return!1;if(D.flags&le)return(D.flags&se)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},He.allowSuper.get=function(){var T=this.currentThisScope(),D=T.flags,z=T.inClassFieldInit;return(D&be)>0||z||this.options.allowSuperOutsideMethod},He.allowDirectSuper.get=function(){return(this.currentThisScope().flags&_e)>0},He.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},He.allowNewDotTarget.get=function(){var T=this.currentThisScope(),D=T.flags,z=T.inClassFieldInit;return(D&(le|Ce))>0||z},He.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Ce)>0},$e.extend=function(){for(var D=[],z=arguments.length;z--;)D[z]=arguments[z];for(var K=this,ne=0;ne<D.length;ne++)K=D[ne](K);return K},$e.parse=function(D,z){return new this(z,D).parse()},$e.parseExpressionAt=function(D,z,K){var ne=new this(K,D,z);return ne.nextToken(),ne.parseExpression()},$e.tokenizer=function(D,z){return new this(z,D)},Object.defineProperties($e.prototype,He);var ze=$e.prototype,et=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;ze.strictDirective=function(T){if(this.options.ecmaVersion<5)return!1;for(;;){H.lastIndex=T,T+=H.exec(this.input)[0].length;var D=et.exec(this.input.slice(T));if(!D)return!1;if((D[1]||D[2])==="use strict"){H.lastIndex=T+D[0].length;var z=H.exec(this.input),K=z.index+z[0].length,ne=this.input.charAt(K);return ne===";"||ne==="}"||j.test(z[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(ne)||ne==="!"&&this.input.charAt(K+1)==="=")}T+=D[0].length,H.lastIndex=T,T+=H.exec(this.input)[0].length,this.input[T]===";"&&T++}},ze.eat=function(T){return this.type===T?(this.next(),!0):!1},ze.isContextual=function(T){return this.type===I.name&&this.value===T&&!this.containsEsc},ze.eatContextual=function(T){return this.isContextual(T)?(this.next(),!0):!1},ze.expectContextual=function(T){this.eatContextual(T)||this.unexpected()},ze.canInsertSemicolon=function(){return this.type===I.eof||this.type===I.braceR||j.test(this.input.slice(this.lastTokEnd,this.start))},ze.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},ze.semicolon=function(){!this.eat(I.semi)&&!this.insertSemicolon()&&this.unexpected()},ze.afterTrailingComma=function(T,D){if(this.type===T)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),D||this.next(),!0},ze.expect=function(T){this.eat(T)||this.unexpected()},ze.unexpected=function(T){this.raise(T??this.start,"Unexpected token")};var Je=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};ze.checkPatternErrors=function(T,D){if(T){T.trailingComma>-1&&this.raiseRecoverable(T.trailingComma,"Comma is not permitted after the rest element");var z=D?T.parenthesizedAssign:T.parenthesizedBind;z>-1&&this.raiseRecoverable(z,D?"Assigning to rvalue":"Parenthesized pattern")}},ze.checkExpressionErrors=function(T,D){if(!T)return!1;var z=T.shorthandAssign,K=T.doubleProto;if(!D)return z>=0||K>=0;z>=0&&this.raise(z,"Shorthand property assignments are valid only in destructuring patterns"),K>=0&&this.raiseRecoverable(K,"Redefinition of __proto__ property")},ze.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},ze.isSimpleAssignTarget=function(T){return T.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(T.expression):T.type==="Identifier"||T.type==="MemberExpression"};var we=$e.prototype;we.parseTopLevel=function(T){var D=Object.create(null);for(T.body||(T.body=[]);this.type!==I.eof;){var z=this.parseStatement(null,!0,D);T.body.push(z)}if(this.inModule)for(var K=0,ne=Object.keys(this.undefinedExports);K<ne.length;K+=1){var me=ne[K];this.raiseRecoverable(this.undefinedExports[me].start,"Export '"+me+"' is not defined")}return this.adaptDirectivePrologue(T.body),this.next(),T.sourceType=this.options.sourceType,this.finishNode(T,"Program")};var ft={kind:"loop"},tt={kind:"switch"};we.isLet=function(T){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;H.lastIndex=this.pos;var D=H.exec(this.input),z=this.pos+D[0].length,K=this.input.charCodeAt(z);if(K===91||K===92)return!0;if(T)return!1;if(K===123||K>55295&&K<56320)return!0;if(E(K,!0)){for(var ne=z+1;C(K=this.input.charCodeAt(ne),!0);)++ne;if(K===92||K>55295&&K<56320)return!0;var me=this.input.slice(z,ne);if(!g.test(me))return!0}return!1},we.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;H.lastIndex=this.pos;var T=H.exec(this.input),D=this.pos+T[0].length,z;return!j.test(this.input.slice(this.pos,D))&&this.input.slice(D,D+8)==="function"&&(D+8===this.input.length||!(C(z=this.input.charCodeAt(D+8))||z>55295&&z<56320))},we.parseStatement=function(T,D,z){var K=this.type,ne=this.startNode(),me;switch(this.isLet(T)&&(K=I._var,me="let"),K){case I._break:case I._continue:return this.parseBreakContinueStatement(ne,K.keyword);case I._debugger:return this.parseDebuggerStatement(ne);case I._do:return this.parseDoStatement(ne);case I._for:return this.parseForStatement(ne);case I._function:return T&&(this.strict||T!=="if"&&T!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(ne,!1,!T);case I._class:return T&&this.unexpected(),this.parseClass(ne,!0);case I._if:return this.parseIfStatement(ne);case I._return:return this.parseReturnStatement(ne);case I._switch:return this.parseSwitchStatement(ne);case I._throw:return this.parseThrowStatement(ne);case I._try:return this.parseTryStatement(ne);case I._const:case I._var:return me=me||this.value,T&&me!=="var"&&this.unexpected(),this.parseVarStatement(ne,me);case I._while:return this.parseWhileStatement(ne);case I._with:return this.parseWithStatement(ne);case I.braceL:return this.parseBlock(!0,ne);case I.semi:return this.parseEmptyStatement(ne);case I._export:case I._import:if(this.options.ecmaVersion>10&&K===I._import){H.lastIndex=this.pos;var ge=H.exec(this.input),Se=this.pos+ge[0].length,Pe=this.input.charCodeAt(Se);if(Pe===40||Pe===46)return this.parseExpressionStatement(ne,this.parseExpression())}return this.options.allowImportExportEverywhere||(D||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),K===I._import?this.parseImport(ne):this.parseExport(ne,z);default:if(this.isAsyncFunction())return T&&this.unexpected(),this.next(),this.parseFunctionStatement(ne,!0,!T);var Oe=this.value,ke=this.parseExpression();return K===I.name&&ke.type==="Identifier"&&this.eat(I.colon)?this.parseLabeledStatement(ne,Oe,ke,T):this.parseExpressionStatement(ne,ke)}},we.parseBreakContinueStatement=function(T,D){var z=D==="break";this.next(),this.eat(I.semi)||this.insertSemicolon()?T.label=null:this.type!==I.name?this.unexpected():(T.label=this.parseIdent(),this.semicolon());for(var K=0;K<this.labels.length;++K){var ne=this.labels[K];if((T.label==null||ne.name===T.label.name)&&(ne.kind!=null&&(z||ne.kind==="loop")||T.label&&z))break}return K===this.labels.length&&this.raise(T.start,"Unsyntactic "+D),this.finishNode(T,z?"BreakStatement":"ContinueStatement")},we.parseDebuggerStatement=function(T){return this.next(),this.semicolon(),this.finishNode(T,"DebuggerStatement")},we.parseDoStatement=function(T){return this.next(),this.labels.push(ft),T.body=this.parseStatement("do"),this.labels.pop(),this.expect(I._while),T.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(I.semi):this.semicolon(),this.finishNode(T,"DoWhileStatement")},we.parseForStatement=function(T){this.next();var D=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(ft),this.enterScope(0),this.expect(I.parenL),this.type===I.semi)return D>-1&&this.unexpected(D),this.parseFor(T,null);var z=this.isLet();if(this.type===I._var||this.type===I._const||z){var K=this.startNode(),ne=z?"let":this.value;return this.next(),this.parseVar(K,!0,ne),this.finishNode(K,"VariableDeclaration"),(this.type===I._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&K.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===I._in?D>-1&&this.unexpected(D):T.await=D>-1),this.parseForIn(T,K)):(D>-1&&this.unexpected(D),this.parseFor(T,K))}var me=this.isContextual("let"),ge=!1,Se=this.containsEsc,Pe=new Je,Oe=this.start,ke=D>-1?this.parseExprSubscripts(Pe,"await"):this.parseExpression(!0,Pe);return this.type===I._in||(ge=this.options.ecmaVersion>=6&&this.isContextual("of"))?(D>-1?(this.type===I._in&&this.unexpected(D),T.await=!0):ge&&this.options.ecmaVersion>=8&&(ke.start===Oe&&!Se&&ke.type==="Identifier"&&ke.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(T.await=!1)),me&&ge&&this.raise(ke.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(ke,!1,Pe),this.checkLValPattern(ke),this.parseForIn(T,ke)):(this.checkExpressionErrors(Pe,!0),D>-1&&this.unexpected(D),this.parseFor(T,ke))},we.parseFunctionStatement=function(T,D,z){return this.next(),this.parseFunction(T,at|(z?0:Ht),!1,D)},we.parseIfStatement=function(T){return this.next(),T.test=this.parseParenExpression(),T.consequent=this.parseStatement("if"),T.alternate=this.eat(I._else)?this.parseStatement("if"):null,this.finishNode(T,"IfStatement")},we.parseReturnStatement=function(T){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(I.semi)||this.insertSemicolon()?T.argument=null:(T.argument=this.parseExpression(),this.semicolon()),this.finishNode(T,"ReturnStatement")},we.parseSwitchStatement=function(T){this.next(),T.discriminant=this.parseParenExpression(),T.cases=[],this.expect(I.braceL),this.labels.push(tt),this.enterScope(0);for(var D,z=!1;this.type!==I.braceR;)if(this.type===I._case||this.type===I._default){var K=this.type===I._case;D&&this.finishNode(D,"SwitchCase"),T.cases.push(D=this.startNode()),D.consequent=[],this.next(),K?D.test=this.parseExpression():(z&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),z=!0,D.test=null),this.expect(I.colon)}else D||this.unexpected(),D.consequent.push(this.parseStatement(null));return this.exitScope(),D&&this.finishNode(D,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(T,"SwitchStatement")},we.parseThrowStatement=function(T){return this.next(),j.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),T.argument=this.parseExpression(),this.semicolon(),this.finishNode(T,"ThrowStatement")};var mt=[];we.parseCatchClauseParam=function(){var T=this.parseBindingAtom(),D=T.type==="Identifier";return this.enterScope(D?oe:0),this.checkLValPattern(T,D?Ue:Ne),this.expect(I.parenR),T},we.parseTryStatement=function(T){if(this.next(),T.block=this.parseBlock(),T.handler=null,this.type===I._catch){var D=this.startNode();this.next(),this.eat(I.parenL)?D.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),D.param=null,this.enterScope(0)),D.body=this.parseBlock(!1),this.exitScope(),T.handler=this.finishNode(D,"CatchClause")}return T.finalizer=this.eat(I._finally)?this.parseBlock():null,!T.handler&&!T.finalizer&&this.raise(T.start,"Missing catch or finally clause"),this.finishNode(T,"TryStatement")},we.parseVarStatement=function(T,D,z){return this.next(),this.parseVar(T,!1,D,z),this.semicolon(),this.finishNode(T,"VariableDeclaration")},we.parseWhileStatement=function(T){return this.next(),T.test=this.parseParenExpression(),this.labels.push(ft),T.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(T,"WhileStatement")},we.parseWithStatement=function(T){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),T.object=this.parseParenExpression(),T.body=this.parseStatement("with"),this.finishNode(T,"WithStatement")},we.parseEmptyStatement=function(T){return this.next(),this.finishNode(T,"EmptyStatement")},we.parseLabeledStatement=function(T,D,z,K){for(var ne=0,me=this.labels;ne<me.length;ne+=1){var ge=me[ne];ge.name===D&&this.raise(z.start,"Label '"+D+"' is already declared")}for(var Se=this.type.isLoop?"loop":this.type===I._switch?"switch":null,Pe=this.labels.length-1;Pe>=0;Pe--){var Oe=this.labels[Pe];if(Oe.statementStart===T.start)Oe.statementStart=this.start,Oe.kind=Se;else break}return this.labels.push({name:D,kind:Se,statementStart:this.start}),T.body=this.parseStatement(K?K.indexOf("label")===-1?K+"label":K:"label"),this.labels.pop(),T.label=z,this.finishNode(T,"LabeledStatement")},we.parseExpressionStatement=function(T,D){return T.expression=D,this.semicolon(),this.finishNode(T,"ExpressionStatement")},we.parseBlock=function(T,D,z){for(T===void 0&&(T=!0),D===void 0&&(D=this.startNode()),D.body=[],this.expect(I.braceL),T&&this.enterScope(0);this.type!==I.braceR;){var K=this.parseStatement(null);D.body.push(K)}return z&&(this.strict=!1),this.next(),T&&this.exitScope(),this.finishNode(D,"BlockStatement")},we.parseFor=function(T,D){return T.init=D,this.expect(I.semi),T.test=this.type===I.semi?null:this.parseExpression(),this.expect(I.semi),T.update=this.type===I.parenR?null:this.parseExpression(),this.expect(I.parenR),T.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(T,"ForStatement")},we.parseForIn=function(T,D){var z=this.type===I._in;return this.next(),D.type==="VariableDeclaration"&&D.declarations[0].init!=null&&(!z||this.options.ecmaVersion<8||this.strict||D.kind!=="var"||D.declarations[0].id.type!=="Identifier")&&this.raise(D.start,(z?"for-in":"for-of")+" loop variable declaration may not have an initializer"),T.left=D,T.right=z?this.parseExpression():this.parseMaybeAssign(),this.expect(I.parenR),T.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(T,z?"ForInStatement":"ForOfStatement")},we.parseVar=function(T,D,z,K){for(T.declarations=[],T.kind=z;;){var ne=this.startNode();if(this.parseVarId(ne,z),this.eat(I.eq)?ne.init=this.parseMaybeAssign(D):!K&&z==="const"&&!(this.type===I._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!K&&ne.id.type!=="Identifier"&&!(D&&(this.type===I._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):ne.init=null,T.declarations.push(this.finishNode(ne,"VariableDeclarator")),!this.eat(I.comma))break}return T},we.parseVarId=function(T,D){T.id=this.parseBindingAtom(),this.checkLValPattern(T.id,D==="var"?Le:Ne,!1)};var at=1,Ht=2,Wt=4;we.parseFunction=function(T,D,z,K,ne){this.initFunction(T),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!K)&&(this.type===I.star&&D&Ht&&this.unexpected(),T.generator=this.eat(I.star)),this.options.ecmaVersion>=8&&(T.async=!!K),D&at&&(T.id=D&Wt&&this.type!==I.name?null:this.parseIdent(),T.id&&!(D&Ht)&&this.checkLValSimple(T.id,this.strict||T.generator||T.async?this.treatFunctionsAsVar?Le:Ne:qe));var me=this.yieldPos,ge=this.awaitPos,Se=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ee(T.async,T.generator)),D&at||(T.id=this.type===I.name?this.parseIdent():null),this.parseFunctionParams(T),this.parseFunctionBody(T,z,!1,ne),this.yieldPos=me,this.awaitPos=ge,this.awaitIdentPos=Se,this.finishNode(T,D&at?"FunctionDeclaration":"FunctionExpression")},we.parseFunctionParams=function(T){this.expect(I.parenL),T.params=this.parseBindingList(I.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},we.parseClass=function(T,D){this.next();var z=this.strict;this.strict=!0,this.parseClassId(T,D),this.parseClassSuper(T);var K=this.enterClassBody(),ne=this.startNode(),me=!1;for(ne.body=[],this.expect(I.braceL);this.type!==I.braceR;){var ge=this.parseClassElement(T.superClass!==null);ge&&(ne.body.push(ge),ge.type==="MethodDefinition"&&ge.kind==="constructor"?(me&&this.raiseRecoverable(ge.start,"Duplicate constructor in the same class"),me=!0):ge.key&&ge.key.type==="PrivateIdentifier"&&Pr(K,ge)&&this.raiseRecoverable(ge.key.start,"Identifier '#"+ge.key.name+"' has already been declared"))}return this.strict=z,this.next(),T.body=this.finishNode(ne,"ClassBody"),this.exitClassBody(),this.finishNode(T,D?"ClassDeclaration":"ClassExpression")},we.parseClassElement=function(T){if(this.eat(I.semi))return null;var D=this.options.ecmaVersion,z=this.startNode(),K="",ne=!1,me=!1,ge="method",Se=!1;if(this.eatContextual("static")){if(D>=13&&this.eat(I.braceL))return this.parseClassStaticBlock(z),z;this.isClassElementNameStart()||this.type===I.star?Se=!0:K="static"}if(z.static=Se,!K&&D>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===I.star)&&!this.canInsertSemicolon()?me=!0:K="async"),!K&&(D>=9||!me)&&this.eat(I.star)&&(ne=!0),!K&&!me&&!ne){var Pe=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?ge=Pe:K=Pe)}if(K?(z.computed=!1,z.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),z.key.name=K,this.finishNode(z.key,"Identifier")):this.parseClassElementName(z),D<13||this.type===I.parenL||ge!=="method"||ne||me){var Oe=!z.static&&Mt(z,"constructor"),ke=Oe&&T;Oe&&ge!=="method"&&this.raise(z.key.start,"Constructor can't have get/set modifier"),z.kind=Oe?"constructor":ge,this.parseClassMethod(z,ne,me,ke)}else this.parseClassField(z);return z},we.isClassElementNameStart=function(){return this.type===I.name||this.type===I.privateId||this.type===I.num||this.type===I.string||this.type===I.bracketL||this.type.keyword},we.parseClassElementName=function(T){this.type===I.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),T.computed=!1,T.key=this.parsePrivateIdent()):this.parsePropertyName(T)},we.parseClassMethod=function(T,D,z,K){var ne=T.key;T.kind==="constructor"?(D&&this.raise(ne.start,"Constructor can't be a generator"),z&&this.raise(ne.start,"Constructor can't be an async method")):T.static&&Mt(T,"prototype")&&this.raise(ne.start,"Classes may not have a static property named prototype");var me=T.value=this.parseMethod(D,z,K);return T.kind==="get"&&me.params.length!==0&&this.raiseRecoverable(me.start,"getter should have no params"),T.kind==="set"&&me.params.length!==1&&this.raiseRecoverable(me.start,"setter should have exactly one param"),T.kind==="set"&&me.params[0].type==="RestElement"&&this.raiseRecoverable(me.params[0].start,"Setter cannot use rest params"),this.finishNode(T,"MethodDefinition")},we.parseClassField=function(T){if(Mt(T,"constructor")?this.raise(T.key.start,"Classes can't have a field named 'constructor'"):T.static&&Mt(T,"prototype")&&this.raise(T.key.start,"Classes can't have a static field named 'prototype'"),this.eat(I.eq)){var D=this.currentThisScope(),z=D.inClassFieldInit;D.inClassFieldInit=!0,T.value=this.parseMaybeAssign(),D.inClassFieldInit=z}else T.value=null;return this.semicolon(),this.finishNode(T,"PropertyDefinition")},we.parseClassStaticBlock=function(T){T.body=[];var D=this.labels;for(this.labels=[],this.enterScope(Ce|be);this.type!==I.braceR;){var z=this.parseStatement(null);T.body.push(z)}return this.next(),this.exitScope(),this.labels=D,this.finishNode(T,"StaticBlock")},we.parseClassId=function(T,D){this.type===I.name?(T.id=this.parseIdent(),D&&this.checkLValSimple(T.id,Ne,!1)):(D===!0&&this.unexpected(),T.id=null)},we.parseClassSuper=function(T){T.superClass=this.eat(I._extends)?this.parseExprSubscripts(null,!1):null},we.enterClassBody=function(){var T={declared:Object.create(null),used:[]};return this.privateNameStack.push(T),T.declared},we.exitClassBody=function(){var T=this.privateNameStack.pop(),D=T.declared,z=T.used;if(this.options.checkPrivateFields)for(var K=this.privateNameStack.length,ne=K===0?null:this.privateNameStack[K-1],me=0;me<z.length;++me){var ge=z[me];ee(D,ge.name)||(ne?ne.used.push(ge):this.raiseRecoverable(ge.start,"Private field '#"+ge.name+"' must be declared in an enclosing class"))}};function Pr(T,D){var z=D.key.name,K=T[z],ne="true";return D.type==="MethodDefinition"&&(D.kind==="get"||D.kind==="set")&&(ne=(D.static?"s":"i")+D.kind),K==="iget"&&ne==="iset"||K==="iset"&&ne==="iget"||K==="sget"&&ne==="sset"||K==="sset"&&ne==="sget"?(T[z]="true",!1):K?!0:(T[z]=ne,!1)}function Mt(T,D){var z=T.computed,K=T.key;return!z&&(K.type==="Identifier"&&K.name===D||K.type==="Literal"&&K.value===D)}we.parseExportAllDeclaration=function(T,D){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(T.exported=this.parseModuleExportName(),this.checkExport(D,T.exported,this.lastTokStart)):T.exported=null),this.expectContextual("from"),this.type!==I.string&&this.unexpected(),T.source=this.parseExprAtom(),this.semicolon(),this.finishNode(T,"ExportAllDeclaration")},we.parseExport=function(T,D){if(this.next(),this.eat(I.star))return this.parseExportAllDeclaration(T,D);if(this.eat(I._default))return this.checkExport(D,"default",this.lastTokStart),T.declaration=this.parseExportDefaultDeclaration(),this.finishNode(T,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())T.declaration=this.parseExportDeclaration(T),T.declaration.type==="VariableDeclaration"?this.checkVariableExport(D,T.declaration.declarations):this.checkExport(D,T.declaration.id,T.declaration.id.start),T.specifiers=[],T.source=null;else{if(T.declaration=null,T.specifiers=this.parseExportSpecifiers(D),this.eatContextual("from"))this.type!==I.string&&this.unexpected(),T.source=this.parseExprAtom();else{for(var z=0,K=T.specifiers;z<K.length;z+=1){var ne=K[z];this.checkUnreserved(ne.local),this.checkLocalExport(ne.local),ne.local.type==="Literal"&&this.raise(ne.local.start,"A string literal cannot be used as an exported binding without `from`.")}T.source=null}this.semicolon()}return this.finishNode(T,"ExportNamedDeclaration")},we.parseExportDeclaration=function(T){return this.parseStatement(null)},we.parseExportDefaultDeclaration=function(){var T;if(this.type===I._function||(T=this.isAsyncFunction())){var D=this.startNode();return this.next(),T&&this.next(),this.parseFunction(D,at|Wt,!1,T)}else if(this.type===I._class){var z=this.startNode();return this.parseClass(z,"nullableID")}else{var K=this.parseMaybeAssign();return this.semicolon(),K}},we.checkExport=function(T,D,z){T&&(typeof D!="string"&&(D=D.type==="Identifier"?D.name:D.value),ee(T,D)&&this.raiseRecoverable(z,"Duplicate export '"+D+"'"),T[D]=!0)},we.checkPatternExport=function(T,D){var z=D.type;if(z==="Identifier")this.checkExport(T,D,D.start);else if(z==="ObjectPattern")for(var K=0,ne=D.properties;K<ne.length;K+=1){var me=ne[K];this.checkPatternExport(T,me)}else if(z==="ArrayPattern")for(var ge=0,Se=D.elements;ge<Se.length;ge+=1){var Pe=Se[ge];Pe&&this.checkPatternExport(T,Pe)}else z==="Property"?this.checkPatternExport(T,D.value):z==="AssignmentPattern"?this.checkPatternExport(T,D.left):z==="RestElement"&&this.checkPatternExport(T,D.argument)},we.checkVariableExport=function(T,D){if(T)for(var z=0,K=D;z<K.length;z+=1){var ne=K[z];this.checkPatternExport(T,ne.id)}},we.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()},we.parseExportSpecifier=function(T){var D=this.startNode();return D.local=this.parseModuleExportName(),D.exported=this.eatContextual("as")?this.parseModuleExportName():D.local,this.checkExport(T,D.exported,D.exported.start),this.finishNode(D,"ExportSpecifier")},we.parseExportSpecifiers=function(T){var D=[],z=!0;for(this.expect(I.braceL);!this.eat(I.braceR);){if(z)z=!1;else if(this.expect(I.comma),this.afterTrailingComma(I.braceR))break;D.push(this.parseExportSpecifier(T))}return D},we.parseImport=function(T){return this.next(),this.type===I.string?(T.specifiers=mt,T.source=this.parseExprAtom()):(T.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),T.source=this.type===I.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(T,"ImportDeclaration")},we.parseImportSpecifier=function(){var T=this.startNode();return T.imported=this.parseModuleExportName(),this.eatContextual("as")?T.local=this.parseIdent():(this.checkUnreserved(T.imported),T.local=T.imported),this.checkLValSimple(T.local,Ne),this.finishNode(T,"ImportSpecifier")},we.parseImportDefaultSpecifier=function(){var T=this.startNode();return T.local=this.parseIdent(),this.checkLValSimple(T.local,Ne),this.finishNode(T,"ImportDefaultSpecifier")},we.parseImportNamespaceSpecifier=function(){var T=this.startNode();return this.next(),this.expectContextual("as"),T.local=this.parseIdent(),this.checkLValSimple(T.local,Ne),this.finishNode(T,"ImportNamespaceSpecifier")},we.parseImportSpecifiers=function(){var T=[],D=!0;if(this.type===I.name&&(T.push(this.parseImportDefaultSpecifier()),!this.eat(I.comma)))return T;if(this.type===I.star)return T.push(this.parseImportNamespaceSpecifier()),T;for(this.expect(I.braceL);!this.eat(I.braceR);){if(D)D=!1;else if(this.expect(I.comma),this.afterTrailingComma(I.braceR))break;T.push(this.parseImportSpecifier())}return T},we.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===I.string){var T=this.parseLiteral(this.value);return ie.test(T.value)&&this.raise(T.start,"An export name cannot include a lone surrogate."),T}return this.parseIdent(!0)},we.adaptDirectivePrologue=function(T){for(var D=0;D<T.length&&this.isDirectiveCandidate(T[D]);++D)T[D].directive=T[D].expression.raw.slice(1,-1)},we.isDirectiveCandidate=function(T){return this.options.ecmaVersion>=5&&T.type==="ExpressionStatement"&&T.expression.type==="Literal"&&typeof T.expression.value=="string"&&(this.input[T.start]==='"'||this.input[T.start]==="'")};var Ye=$e.prototype;Ye.toAssignable=function(T,D,z){if(this.options.ecmaVersion>=6&&T)switch(T.type){case"Identifier":this.inAsync&&T.name==="await"&&this.raise(T.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":T.type="ObjectPattern",z&&this.checkPatternErrors(z,!0);for(var K=0,ne=T.properties;K<ne.length;K+=1){var me=ne[K];this.toAssignable(me,D),me.type==="RestElement"&&(me.argument.type==="ArrayPattern"||me.argument.type==="ObjectPattern")&&this.raise(me.argument.start,"Unexpected token")}break;case"Property":T.kind!=="init"&&this.raise(T.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(T.value,D);break;case"ArrayExpression":T.type="ArrayPattern",z&&this.checkPatternErrors(z,!0),this.toAssignableList(T.elements,D);break;case"SpreadElement":T.type="RestElement",this.toAssignable(T.argument,D),T.argument.type==="AssignmentPattern"&&this.raise(T.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":T.operator!=="="&&this.raise(T.left.end,"Only '=' operator can be used for specifying default value."),T.type="AssignmentPattern",delete T.operator,this.toAssignable(T.left,D);break;case"ParenthesizedExpression":this.toAssignable(T.expression,D,z);break;case"ChainExpression":this.raiseRecoverable(T.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!D)break;default:this.raise(T.start,"Assigning to rvalue")}else z&&this.checkPatternErrors(z,!0);return T},Ye.toAssignableList=function(T,D){for(var z=T.length,K=0;K<z;K++){var ne=T[K];ne&&this.toAssignable(ne,D)}if(z){var me=T[z-1];this.options.ecmaVersion===6&&D&&me&&me.type==="RestElement"&&me.argument.type!=="Identifier"&&this.unexpected(me.argument.start)}return T},Ye.parseSpread=function(T){var D=this.startNode();return this.next(),D.argument=this.parseMaybeAssign(!1,T),this.finishNode(D,"SpreadElement")},Ye.parseRestBinding=function(){var T=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==I.name&&this.unexpected(),T.argument=this.parseBindingAtom(),this.finishNode(T,"RestElement")},Ye.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case I.bracketL:var T=this.startNode();return this.next(),T.elements=this.parseBindingList(I.bracketR,!0,!0),this.finishNode(T,"ArrayPattern");case I.braceL:return this.parseObj(!0)}return this.parseIdent()},Ye.parseBindingList=function(T,D,z,K){for(var ne=[],me=!0;!this.eat(T);)if(me?me=!1:this.expect(I.comma),D&&this.type===I.comma)ne.push(null);else{if(z&&this.afterTrailingComma(T))break;if(this.type===I.ellipsis){var ge=this.parseRestBinding();this.parseBindingListItem(ge),ne.push(ge),this.type===I.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(T);break}else ne.push(this.parseAssignableListItem(K))}return ne},Ye.parseAssignableListItem=function(T){var D=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(D),D},Ye.parseBindingListItem=function(T){return T},Ye.parseMaybeDefault=function(T,D,z){if(z=z||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(I.eq))return z;var K=this.startNodeAt(T,D);return K.left=z,K.right=this.parseMaybeAssign(),this.finishNode(K,"AssignmentPattern")},Ye.checkLValSimple=function(T,D,z){D===void 0&&(D=Me);var K=D!==Me;switch(T.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(T.name)&&this.raiseRecoverable(T.start,(K?"Binding ":"Assigning to ")+T.name+" in strict mode"),K&&(D===Ne&&T.name==="let"&&this.raiseRecoverable(T.start,"let is disallowed as a lexically bound name"),z&&(ee(z,T.name)&&this.raiseRecoverable(T.start,"Argument name clash"),z[T.name]=!0),D!==Fe&&this.declareName(T.name,D,T.start));break;case"ChainExpression":this.raiseRecoverable(T.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":K&&this.raiseRecoverable(T.start,"Binding member expression");break;case"ParenthesizedExpression":return K&&this.raiseRecoverable(T.start,"Binding parenthesized expression"),this.checkLValSimple(T.expression,D,z);default:this.raise(T.start,(K?"Binding":"Assigning to")+" rvalue")}},Ye.checkLValPattern=function(T,D,z){switch(D===void 0&&(D=Me),T.type){case"ObjectPattern":for(var K=0,ne=T.properties;K<ne.length;K+=1){var me=ne[K];this.checkLValInnerPattern(me,D,z)}break;case"ArrayPattern":for(var ge=0,Se=T.elements;ge<Se.length;ge+=1){var Pe=Se[ge];Pe&&this.checkLValInnerPattern(Pe,D,z)}break;default:this.checkLValSimple(T,D,z)}},Ye.checkLValInnerPattern=function(T,D,z){switch(D===void 0&&(D=Me),T.type){case"Property":this.checkLValInnerPattern(T.value,D,z);break;case"AssignmentPattern":this.checkLValPattern(T.left,D,z);break;case"RestElement":this.checkLValPattern(T.argument,D,z);break;default:this.checkLValPattern(T,D,z)}};var Xe=function(D,z,K,ne,me){this.token=D,this.isExpr=!!z,this.preserveSpace=!!K,this.override=ne,this.generator=!!me},Ge={b_stat:new Xe("{",!1),b_expr:new Xe("{",!0),b_tmpl:new Xe("${",!1),p_stat:new Xe("(",!1),p_expr:new Xe("(",!0),q_tmpl:new Xe("`",!0,!0,function(T){return T.tryReadTemplateToken()}),f_stat:new Xe("function",!1),f_expr:new Xe("function",!0),f_expr_gen:new Xe("function",!0,!1,null,!0),f_gen:new Xe("function",!1,!1,null,!0)},lt=$e.prototype;lt.initialContext=function(){return[Ge.b_stat]},lt.curContext=function(){return this.context[this.context.length-1]},lt.braceIsBlock=function(T){var D=this.curContext();return D===Ge.f_expr||D===Ge.f_stat?!0:T===I.colon&&(D===Ge.b_stat||D===Ge.b_expr)?!D.isExpr:T===I._return||T===I.name&&this.exprAllowed?j.test(this.input.slice(this.lastTokEnd,this.start)):T===I._else||T===I.semi||T===I.eof||T===I.parenR||T===I.arrow?!0:T===I.braceL?D===Ge.b_stat:T===I._var||T===I._const||T===I.name?!1:!this.exprAllowed},lt.inGeneratorContext=function(){for(var T=this.context.length-1;T>=1;T--){var D=this.context[T];if(D.token==="function")return D.generator}return!1},lt.updateContext=function(T){var D,z=this.type;z.keyword&&T===I.dot?this.exprAllowed=!1:(D=z.updateContext)?D.call(this,T):this.exprAllowed=z.beforeExpr},lt.overrideContext=function(T){this.curContext()!==T&&(this.context[this.context.length-1]=T)},I.parenR.updateContext=I.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var T=this.context.pop();T===Ge.b_stat&&this.curContext().token==="function"&&(T=this.context.pop()),this.exprAllowed=!T.isExpr},I.braceL.updateContext=function(T){this.context.push(this.braceIsBlock(T)?Ge.b_stat:Ge.b_expr),this.exprAllowed=!0},I.dollarBraceL.updateContext=function(){this.context.push(Ge.b_tmpl),this.exprAllowed=!0},I.parenL.updateContext=function(T){var D=T===I._if||T===I._for||T===I._with||T===I._while;this.context.push(D?Ge.p_stat:Ge.p_expr),this.exprAllowed=!0},I.incDec.updateContext=function(){},I._function.updateContext=I._class.updateContext=function(T){T.beforeExpr&&T!==I._else&&!(T===I.semi&&this.curContext()!==Ge.p_stat)&&!(T===I._return&&j.test(this.input.slice(this.lastTokEnd,this.start)))&&!((T===I.colon||T===I.braceL)&&this.curContext()===Ge.b_stat)?this.context.push(Ge.f_expr):this.context.push(Ge.f_stat),this.exprAllowed=!1},I.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0},I.backQuote.updateContext=function(){this.curContext()===Ge.q_tmpl?this.context.pop():this.context.push(Ge.q_tmpl),this.exprAllowed=!1},I.star.updateContext=function(T){if(T===I._function){var D=this.context.length-1;this.context[D]===Ge.f_expr?this.context[D]=Ge.f_expr_gen:this.context[D]=Ge.f_gen}this.exprAllowed=!0},I.name.updateContext=function(T){var D=!1;this.options.ecmaVersion>=6&&T!==I.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(D=!0),this.exprAllowed=D};var Ie=$e.prototype;Ie.checkPropClash=function(T,D,z){if(!(this.options.ecmaVersion>=9&&T.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(T.computed||T.method||T.shorthand))){var K=T.key,ne;switch(K.type){case"Identifier":ne=K.name;break;case"Literal":ne=String(K.value);break;default:return}var me=T.kind;if(this.options.ecmaVersion>=6){ne==="__proto__"&&me==="init"&&(D.proto&&(z?z.doubleProto<0&&(z.doubleProto=K.start):this.raiseRecoverable(K.start,"Redefinition of __proto__ property")),D.proto=!0);return}ne="$"+ne;var ge=D[ne];if(ge){var Se;me==="init"?Se=this.strict&&ge.init||ge.get||ge.set:Se=ge.init||ge[me],Se&&this.raiseRecoverable(K.start,"Redefinition of property")}else ge=D[ne]={init:!1,get:!1,set:!1};ge[me]=!0}},Ie.parseExpression=function(T,D){var z=this.start,K=this.startLoc,ne=this.parseMaybeAssign(T,D);if(this.type===I.comma){var me=this.startNodeAt(z,K);for(me.expressions=[ne];this.eat(I.comma);)me.expressions.push(this.parseMaybeAssign(T,D));return this.finishNode(me,"SequenceExpression")}return ne},Ie.parseMaybeAssign=function(T,D,z){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(T);this.exprAllowed=!1}var K=!1,ne=-1,me=-1,ge=-1;D?(ne=D.parenthesizedAssign,me=D.trailingComma,ge=D.doubleProto,D.parenthesizedAssign=D.trailingComma=-1):(D=new Je,K=!0);var Se=this.start,Pe=this.startLoc;(this.type===I.parenL||this.type===I.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=T==="await");var Oe=this.parseMaybeConditional(T,D);if(z&&(Oe=z.call(this,Oe,Se,Pe)),this.type.isAssign){var ke=this.startNodeAt(Se,Pe);return ke.operator=this.value,this.type===I.eq&&(Oe=this.toAssignable(Oe,!1,D)),K||(D.parenthesizedAssign=D.trailingComma=D.doubleProto=-1),D.shorthandAssign>=Oe.start&&(D.shorthandAssign=-1),this.type===I.eq?this.checkLValPattern(Oe):this.checkLValSimple(Oe),ke.left=Oe,this.next(),ke.right=this.parseMaybeAssign(T),ge>-1&&(D.doubleProto=ge),this.finishNode(ke,"AssignmentExpression")}else K&&this.checkExpressionErrors(D,!0);return ne>-1&&(D.parenthesizedAssign=ne),me>-1&&(D.trailingComma=me),Oe},Ie.parseMaybeConditional=function(T,D){var z=this.start,K=this.startLoc,ne=this.parseExprOps(T,D);if(this.checkExpressionErrors(D))return ne;if(this.eat(I.question)){var me=this.startNodeAt(z,K);return me.test=ne,me.consequent=this.parseMaybeAssign(),this.expect(I.colon),me.alternate=this.parseMaybeAssign(T),this.finishNode(me,"ConditionalExpression")}return ne},Ie.parseExprOps=function(T,D){var z=this.start,K=this.startLoc,ne=this.parseMaybeUnary(D,!1,!1,T);return this.checkExpressionErrors(D)||ne.start===z&&ne.type==="ArrowFunctionExpression"?ne:this.parseExprOp(ne,z,K,-1,T)},Ie.parseExprOp=function(T,D,z,K,ne){var me=this.type.binop;if(me!=null&&(!ne||this.type!==I._in)&&me>K){var ge=this.type===I.logicalOR||this.type===I.logicalAND,Se=this.type===I.coalesce;Se&&(me=I.logicalAND.binop);var Pe=this.value;this.next();var Oe=this.start,ke=this.startLoc,We=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,ne),Oe,ke,me,ne),it=this.buildBinary(D,z,T,We,Pe,ge||Se);return(ge&&this.type===I.coalesce||Se&&(this.type===I.logicalOR||this.type===I.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(it,D,z,K,ne)}return T},Ie.buildBinary=function(T,D,z,K,ne,me){K.type==="PrivateIdentifier"&&this.raise(K.start,"Private identifier can only be left side of binary expression");var ge=this.startNodeAt(T,D);return ge.left=z,ge.operator=ne,ge.right=K,this.finishNode(ge,me?"LogicalExpression":"BinaryExpression")},Ie.parseMaybeUnary=function(T,D,z,K){var ne=this.start,me=this.startLoc,ge;if(this.isContextual("await")&&this.canAwait)ge=this.parseAwait(K),D=!0;else if(this.type.prefix){var Se=this.startNode(),Pe=this.type===I.incDec;Se.operator=this.value,Se.prefix=!0,this.next(),Se.argument=this.parseMaybeUnary(null,!0,Pe,K),this.checkExpressionErrors(T,!0),Pe?this.checkLValSimple(Se.argument):this.strict&&Se.operator==="delete"&&Kt(Se.argument)?this.raiseRecoverable(Se.start,"Deleting local variable in strict mode"):Se.operator==="delete"&&Ut(Se.argument)?this.raiseRecoverable(Se.start,"Private fields can not be deleted"):D=!0,ge=this.finishNode(Se,Pe?"UpdateExpression":"UnaryExpression")}else if(!D&&this.type===I.privateId)(K||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),ge=this.parsePrivateIdent(),this.type!==I._in&&this.unexpected();else{if(ge=this.parseExprSubscripts(T,K),this.checkExpressionErrors(T))return ge;for(;this.type.postfix&&!this.canInsertSemicolon();){var Oe=this.startNodeAt(ne,me);Oe.operator=this.value,Oe.prefix=!1,Oe.argument=ge,this.checkLValSimple(ge),this.next(),ge=this.finishNode(Oe,"UpdateExpression")}}if(!z&&this.eat(I.starstar))if(D)this.unexpected(this.lastTokStart);else return this.buildBinary(ne,me,ge,this.parseMaybeUnary(null,!1,!1,K),"**",!1);else return ge};function Kt(T){return T.type==="Identifier"||T.type==="ParenthesizedExpression"&&Kt(T.expression)}function Ut(T){return T.type==="MemberExpression"&&T.property.type==="PrivateIdentifier"||T.type==="ChainExpression"&&Ut(T.expression)||T.type==="ParenthesizedExpression"&&Ut(T.expression)}Ie.parseExprSubscripts=function(T,D){var z=this.start,K=this.startLoc,ne=this.parseExprAtom(T,D);if(ne.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return ne;var me=this.parseSubscripts(ne,z,K,!1,D);return T&&me.type==="MemberExpression"&&(T.parenthesizedAssign>=me.start&&(T.parenthesizedAssign=-1),T.parenthesizedBind>=me.start&&(T.parenthesizedBind=-1),T.trailingComma>=me.start&&(T.trailingComma=-1)),me},Ie.parseSubscripts=function(T,D,z,K,ne){for(var me=this.options.ecmaVersion>=8&&T.type==="Identifier"&&T.name==="async"&&this.lastTokEnd===T.end&&!this.canInsertSemicolon()&&T.end-T.start===5&&this.potentialArrowAt===T.start,ge=!1;;){var Se=this.parseSubscript(T,D,z,K,me,ge,ne);if(Se.optional&&(ge=!0),Se===T||Se.type==="ArrowFunctionExpression"){if(ge){var Pe=this.startNodeAt(D,z);Pe.expression=Se,Se=this.finishNode(Pe,"ChainExpression")}return Se}T=Se}},Ie.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(I.arrow)},Ie.parseSubscriptAsyncArrow=function(T,D,z,K){return this.parseArrowExpression(this.startNodeAt(T,D),z,!0,K)},Ie.parseSubscript=function(T,D,z,K,ne,me,ge){var Se=this.options.ecmaVersion>=11,Pe=Se&&this.eat(I.questionDot);K&&Pe&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var Oe=this.eat(I.bracketL);if(Oe||Pe&&this.type!==I.parenL&&this.type!==I.backQuote||this.eat(I.dot)){var ke=this.startNodeAt(D,z);ke.object=T,Oe?(ke.property=this.parseExpression(),this.expect(I.bracketR)):this.type===I.privateId&&T.type!=="Super"?ke.property=this.parsePrivateIdent():ke.property=this.parseIdent(this.options.allowReserved!=="never"),ke.computed=!!Oe,Se&&(ke.optional=Pe),T=this.finishNode(ke,"MemberExpression")}else if(!K&&this.eat(I.parenL)){var We=new Je,it=this.yieldPos,Ct=this.awaitPos,ct=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var qt=this.parseExprList(I.parenR,this.options.ecmaVersion>=8,!1,We);if(ne&&!Pe&&this.shouldParseAsyncArrow())return this.checkPatternErrors(We,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=it,this.awaitPos=Ct,this.awaitIdentPos=ct,this.parseSubscriptAsyncArrow(D,z,qt,ge);this.checkExpressionErrors(We,!0),this.yieldPos=it||this.yieldPos,this.awaitPos=Ct||this.awaitPos,this.awaitIdentPos=ct||this.awaitIdentPos;var ut=this.startNodeAt(D,z);ut.callee=T,ut.arguments=qt,Se&&(ut.optional=Pe),T=this.finishNode(ut,"CallExpression")}else if(this.type===I.backQuote){(Pe||me)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var pt=this.startNodeAt(D,z);pt.tag=T,pt.quasi=this.parseTemplate({isTagged:!0}),T=this.finishNode(pt,"TaggedTemplateExpression")}return T},Ie.parseExprAtom=function(T,D,z){this.type===I.slash&&this.readRegexp();var K,ne=this.potentialArrowAt===this.start;switch(this.type){case I._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),K=this.startNode(),this.next(),this.type===I.parenL&&!this.allowDirectSuper&&this.raise(K.start,"super() call outside constructor of a subclass"),this.type!==I.dot&&this.type!==I.bracketL&&this.type!==I.parenL&&this.unexpected(),this.finishNode(K,"Super");case I._this:return K=this.startNode(),this.next(),this.finishNode(K,"ThisExpression");case I.name:var me=this.start,ge=this.startLoc,Se=this.containsEsc,Pe=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!Se&&Pe.name==="async"&&!this.canInsertSemicolon()&&this.eat(I._function))return this.overrideContext(Ge.f_expr),this.parseFunction(this.startNodeAt(me,ge),0,!1,!0,D);if(ne&&!this.canInsertSemicolon()){if(this.eat(I.arrow))return this.parseArrowExpression(this.startNodeAt(me,ge),[Pe],!1,D);if(this.options.ecmaVersion>=8&&Pe.name==="async"&&this.type===I.name&&!Se&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return Pe=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(I.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(me,ge),[Pe],!0,D)}return Pe;case I.regexp:var Oe=this.value;return K=this.parseLiteral(Oe.value),K.regex={pattern:Oe.pattern,flags:Oe.flags},K;case I.num:case I.string:return this.parseLiteral(this.value);case I._null:case I._true:case I._false:return K=this.startNode(),K.value=this.type===I._null?null:this.type===I._true,K.raw=this.type.keyword,this.next(),this.finishNode(K,"Literal");case I.parenL:var ke=this.start,We=this.parseParenAndDistinguishExpression(ne,D);return T&&(T.parenthesizedAssign<0&&!this.isSimpleAssignTarget(We)&&(T.parenthesizedAssign=ke),T.parenthesizedBind<0&&(T.parenthesizedBind=ke)),We;case I.bracketL:return K=this.startNode(),this.next(),K.elements=this.parseExprList(I.bracketR,!0,!0,T),this.finishNode(K,"ArrayExpression");case I.braceL:return this.overrideContext(Ge.b_expr),this.parseObj(!1,T);case I._function:return K=this.startNode(),this.next(),this.parseFunction(K,0);case I._class:return this.parseClass(this.startNode(),!1);case I._new:return this.parseNew();case I.backQuote:return this.parseTemplate();case I._import:return this.options.ecmaVersion>=11?this.parseExprImport(z):this.unexpected();default:return this.parseExprAtomDefault()}},Ie.parseExprAtomDefault=function(){this.unexpected()},Ie.parseExprImport=function(T){var D=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===I.parenL&&!T)return this.parseDynamicImport(D);if(this.type===I.dot){var z=this.startNodeAt(D.start,D.loc&&D.loc.start);return z.name="import",D.meta=this.finishNode(z,"Identifier"),this.parseImportMeta(D)}else this.unexpected()},Ie.parseDynamicImport=function(T){if(this.next(),T.source=this.parseMaybeAssign(),!this.eat(I.parenR)){var D=this.start;this.eat(I.comma)&&this.eat(I.parenR)?this.raiseRecoverable(D,"Trailing comma is not allowed in import()"):this.unexpected(D)}return this.finishNode(T,"ImportExpression")},Ie.parseImportMeta=function(T){this.next();var D=this.containsEsc;return T.property=this.parseIdent(!0),T.property.name!=="meta"&&this.raiseRecoverable(T.property.start,"The only valid meta property for import is 'import.meta'"),D&&this.raiseRecoverable(T.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(T.start,"Cannot use 'import.meta' outside a module"),this.finishNode(T,"MetaProperty")},Ie.parseLiteral=function(T){var D=this.startNode();return D.value=T,D.raw=this.input.slice(this.start,this.end),D.raw.charCodeAt(D.raw.length-1)===110&&(D.bigint=D.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(D,"Literal")},Ie.parseParenExpression=function(){this.expect(I.parenL);var T=this.parseExpression();return this.expect(I.parenR),T},Ie.shouldParseArrow=function(T){return!this.canInsertSemicolon()},Ie.parseParenAndDistinguishExpression=function(T,D){var z=this.start,K=this.startLoc,ne,me=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var ge=this.start,Se=this.startLoc,Pe=[],Oe=!0,ke=!1,We=new Je,it=this.yieldPos,Ct=this.awaitPos,ct;for(this.yieldPos=0,this.awaitPos=0;this.type!==I.parenR;)if(Oe?Oe=!1:this.expect(I.comma),me&&this.afterTrailingComma(I.parenR,!0)){ke=!0;break}else if(this.type===I.ellipsis){ct=this.start,Pe.push(this.parseParenItem(this.parseRestBinding())),this.type===I.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else Pe.push(this.parseMaybeAssign(!1,We,this.parseParenItem));var qt=this.lastTokEnd,ut=this.lastTokEndLoc;if(this.expect(I.parenR),T&&this.shouldParseArrow(Pe)&&this.eat(I.arrow))return this.checkPatternErrors(We,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=it,this.awaitPos=Ct,this.parseParenArrowList(z,K,Pe,D);(!Pe.length||ke)&&this.unexpected(this.lastTokStart),ct&&this.unexpected(ct),this.checkExpressionErrors(We,!0),this.yieldPos=it||this.yieldPos,this.awaitPos=Ct||this.awaitPos,Pe.length>1?(ne=this.startNodeAt(ge,Se),ne.expressions=Pe,this.finishNodeAt(ne,"SequenceExpression",qt,ut)):ne=Pe[0]}else ne=this.parseParenExpression();if(this.options.preserveParens){var pt=this.startNodeAt(z,K);return pt.expression=ne,this.finishNode(pt,"ParenthesizedExpression")}else return ne},Ie.parseParenItem=function(T){return T},Ie.parseParenArrowList=function(T,D,z,K){return this.parseArrowExpression(this.startNodeAt(T,D),z,!1,K)};var Rr=[];Ie.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var T=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===I.dot){var D=this.startNodeAt(T.start,T.loc&&T.loc.start);D.name="new",T.meta=this.finishNode(D,"Identifier"),this.next();var z=this.containsEsc;return T.property=this.parseIdent(!0),T.property.name!=="target"&&this.raiseRecoverable(T.property.start,"The only valid meta property for new is 'new.target'"),z&&this.raiseRecoverable(T.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(T.start,"'new.target' can only be used in functions and class static block"),this.finishNode(T,"MetaProperty")}var K=this.start,ne=this.startLoc;return T.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),K,ne,!0,!1),this.eat(I.parenL)?T.arguments=this.parseExprList(I.parenR,this.options.ecmaVersion>=8,!1):T.arguments=Rr,this.finishNode(T,"NewExpression")},Ie.parseTemplateElement=function(T){var D=T.isTagged,z=this.startNode();return this.type===I.invalidTemplate?(D||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),z.value={raw:this.value.replace(/\r\n?/g,`
|
|
858
863
|
`),cooked:null}):z.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
@@ -887,5 +892,5 @@ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=1
|
|
|
887
892
|
Use both <PartnerCard account={data} action={<></>}> and <ManufacturerCard manufacturer={data.Manufacturer}>`,`----
|
|
888
893
|
ProductCard, for data that fits this shape:
|
|
889
894
|
{ "RandmarSKU": "3007864", "RandmarTitle": "CTTN450 COMPATIBLE TN450 TONER", "Category": "CT", "UnitWeight": 1.5500, "UPC": "628277000035", "ManufacturerName": "Balloon Brand", "ProductType": "Toners", "AutoUpdate": 1, "CreatedBy": "", "LastMaintainedDate": 20190314.0, "Title": "CTTN450 COMPATIBLE TN450 TONER", "BodyHTML": "<p>CTTN450 COMPATIBLE TN450 TONER</p>", "MAP": 17.5500, "ManufacturerId": "90200", "State": "Active", "MPN": "CTTN450", "MasterCarton": 12, "SkidQuantity": null, "SerialNumber": true, "OpportunityOnly": false, "VoiceoverCaption": "example...", "SceneName": "Top of Clouds", "Require3DScan": false, "TransparencyCode": false, "CountryCodeOfOrigin": null, "UnitLength": null, "UnitWidth": null, "UnitHeight": null, "Distribution": { "Price": 14.29, "RegularPrice": 14.29, "MAP": 17.55, "Currency": "CAD", "ExchangeRate": 1.000000000, "Inventory": [ { "RandmarSKU": "3007864", "WarehouseId": "EDM", "WarehouseType": "Fulfillment Center", "Name": "Randmar Edmonton", "City": "Edmonton", "Province": "AB", "Country": "CA", "AvailableQuantity": 7, "PurchaseOrderQuantity": 0, "BinLocation": "" }, { "RandmarSKU": "3007864", "WarehouseId": "MTL", "WarehouseType": "Fulfillment Center", "Name": "Randmar Montreal", "City": "Pierrefonds", "Province": "QC", "Country": "CA", "AvailableQuantity": 45, "PurchaseOrderQuantity": 0, "BinLocation": "C3EB" }, { "RandmarSKU": "3007864", "WarehouseId": "TOR", "WarehouseType": "Fulfillment Center", "Name": "Randmar Toronto", "City": "Mississauga", "Province": "ON", "Country": "CA", "AvailableQuantity": 15, "PurchaseOrderQuantity": 0, "BinLocation": "A6A" }, { "RandmarSKU": "3007864", "WarehouseId": "VAN", "WarehouseType": "Fulfillment Center", "Name": "Randmar Vancouver", "City": "Richmond", "Province": "BC", "Country": "CA", "AvailableQuantity": 8, "PurchaseOrderQuantity": 0, "BinLocation": "" } ] }, "ManufacturerCategory": { "ManufacturerId": "90200", "CategoryCode": "CT", "CategoryName": "Toners", "Starred": false, "AutoReorder": true, "QualificationRequired": false, "Niche": "Print" }, "InstantRebate": null, "Opportunities": null, "AvailableToBuy": true }
|
|
890
|
-
Use <ProductCard item={data}>`],basicComponents=["<Card> <CardHeader> <CardTitle>...</CardTitle> <CardDescription>...</CardDescription> </CardHeader> <CardContent> ... </CardContent> </Card>","<Badge>...</Badge>",'<Tabs defaultValue="eg1"> <TabsList> <TabsTrigger value="eg1">Example1</TabsTrigger> <TabsTrigger value="eg2">Example2</TabsTrigger> </TabsList> <TabsContent value="eg1"> ... </TabsContent> <TabsContent value="eg2"> ... </TabsContent> </Tabs>',"<ScrollArea>...</ScrollArea>","<ScrollArea orientation='horizontal'>...</ScrollArea>"],GetJSXFromAI=async(e,t,n,o,l=3)=>{const u="In addition to basic html tags, You have access to these beautiful Handmade Components:",p="You also have access to these few Shadcn UI components:",d='Here is the data to display to the user (If a Handmade Component is a good fit for the data, use it. Otherwise, use regular html tags) (You have access to this data object in React via the data variable. Do not use JSON.parse, it is already parsed. For example, if data is an array, you can use {data.map(item, idx => <>...</>)} directly. CAUTION: when using map, you must use implicit return rather than a block body, as shown before. AGAIN: never use JSON.parse - data is already parsed and never a block body with arrow functions such as: (item => { return "EXAMPLE - DO NOT DO THIS" }):',f="Only output a single JSX code snippet. Start with <> and end with </>. All other code will be ignored, so make sure to place all CSS styles inline. Use CSS flex layouts when there is a lot of stuff to display.",m=JSON.stringify(n),g=[t,u,...complexComponents,p,...basicComponents,f,d,m,f].join(`\r
|
|
895
|
+
Use <ProductCard item={data}>`],basicComponents=["<Card> <CardHeader> <CardTitle>...</CardTitle> <CardDescription>...</CardDescription> </CardHeader> <CardContent> ... </CardContent> </Card>","<Badge>...</Badge>",'<Tabs defaultValue="eg1"> <TabsList> <TabsTrigger value="eg1">Example1</TabsTrigger> <TabsTrigger value="eg2">Example2</TabsTrigger> </TabsList> <TabsContent value="eg1"> ... </TabsContent> <TabsContent value="eg2"> ... </TabsContent> </Tabs>',"<ScrollArea>...</ScrollArea>","<ScrollArea orientation='horizontal'>...</ScrollArea>"],GetJSXFromAI=async(e,t,n,o,l=3)=>{const u="In addition to basic html tags, You have access to these beautiful Handmade Components. Try to use them even when you get an array of search results. For example, use ProductCard when ContentType is Product:",p="You also have access to these few Shadcn UI components:",d='Here is the data to display to the user (If a Handmade Component is a good fit for the data, use it. Otherwise, use regular html tags) (You have access to this data object in React via the data variable. Do not use JSON.parse, it is already parsed. For example, if data is an array, you can use {data.map(item, idx => <>...</>)} directly. CAUTION: when using map, you must use implicit return rather than a block body, as shown before. AGAIN: never use JSON.parse - data is already parsed and never a block body with arrow functions such as: (item => { return "EXAMPLE - DO NOT DO THIS" }):',f="Only output a single JSX code snippet. Start with <> and end with </>. All other code will be ignored, so make sure to place all CSS styles inline. Use CSS flex layouts when there is a lot of stuff to display.",m=JSON.stringify(n),g=[t,u,...complexComponents,p,...basicComponents,f,d,m,f].join(`\r
|
|
891
896
|
`),S=await new GoogleGenAI({apiKey:e}).chats.create({model:o?"gemini-2.5-pro-preview-03-25":"gemini-2.0-flash-lite"}).sendMessage({message:g}),E=trimJSXString(S.text??"");return E&&!containsBlockArrowFunc(E)?E:l==0?"<p>Could not generate visuals for this data.</p>":await GetJSXFromAI(e,t,n,o,l-1)};function containsBlockArrowFunc(e){return e.replace(/\s+/g,"").indexOf("=>{")>=0}function trimJSXString(e){const t=e.indexOf("<"),n=e.lastIndexOf("</");return t===-1||n===-1?"":e.slice(t,e.indexOf(">",n)+1)}function AiGeneratedContent(e){const[t,n]=React.useState(""),{apiKey:o}=useApiKey();return React.useEffect(()=>{if(!o||!e.prompt||!e.data)return;n("");let l=!1;return GetJSXFromAI(o,e.prompt,e.data,e.smartAndSlow===!0).then(u=>{l||n(u)}),()=>{l=!0}},[e.prompt,e.data,n,o,e.smartAndSlow]),t?jsxRuntime.jsx(source_default,{bindings:{data:e.data},components:{ResellerCard,ManufacturerCard,PartnerCard,ProductCard,Card,CardHeader,CardTitle,CardContent,CardDescription,Badge,Tabs,TabsList,TabsContent,TabsTrigger,ScrollArea},jsx:t}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(Skeleton,{className:"h-32 w-32",children:jsxRuntime.jsx(Bot,{className:"m-auto align-middle h-full"})})})}function GeneralDocumentCard({document:e,loading:t=!1}){return t?jsxRuntime.jsx("div",{children:"loading..."}):jsxRuntime.jsxs("div",{children:["GENERAL DOCUMENT CARD - ",e==null?void 0:e.OrderNumber," for P.O. ",e==null?void 0:e.PONumber]})}const Navbar=React.forwardRef(({routes:e,footer:t,dashboardTitle:n,withRandmarAssistant:o,chatUserName:l,chatApiKey:u},p)=>{const{appID:d}=reactRouterDom.useParams(),f=e.filter(_=>_.showInNav),m=React.useRef(null),g=React.useRef(null),b=React.useRef(null);return React.useImperativeHandle(p,()=>({setActiveChatAndSendMessage:(_,S)=>{var E;return(E=b.current)==null||E.click(),setTimeout(()=>{var C;(C=m.current)==null||C.focus(),g.current&&g.current.setActiveChatAndSendMessage(_,S)},100),!0}})),jsxRuntime.jsxs(Sidebar,{className:"border-r border-sidebar-border",children:[jsxRuntime.jsx(SidebarHeader,{className:"border-b border-sidebar-border px-6 h-16 justify-center bg-sidebar text-sidebar-foreground",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center",children:jsxRuntime.jsx("img",{src:"https://api.randmar.io/images/RandmarIcon.svg",alt:"Randmar Icon",className:"h-4 w-4 filter brightness-0 saturate-100 invert"})}),jsxRuntime.jsx("span",{className:"font-semibold text-lg",children:n})]})}),jsxRuntime.jsx(SidebarContent,{className:"py-4 bg-sidebar text-sidebar-foreground",children:jsxRuntime.jsx(SidebarMenu,{children:f.map(_=>{const S=_.icon,E=`/${_.path.replace(":appID",d??"")}`;return jsxRuntime.jsx(SidebarMenuItem,{children:jsxRuntime.jsx(SidebarMenuButton,{asChild:!0,children:jsxRuntime.jsxs(reactRouterDom.Link,{to:E,className:"transition-colors hover:bg-muted px-6",children:[S&&jsxRuntime.jsx(S,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:_.label})]})})},_.key)})})}),jsxRuntime.jsxs(SidebarFooter,{className:"border-t border-sidebar-border p-4 bg-sidebar-background text-sidebar-foreground",children:[o===!0&&jsxRuntime.jsxs(Dialog,{children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button,{ref:b,size:"lg",className:"collapse md:visible",onClick:()=>setTimeout(()=>{var _;return(_=m.current)==null?void 0:_.focus()},50),children:[jsxRuntime.jsx(Bot,{}),"Assistant"]})}),jsxRuntime.jsx(DialogContent,{className:"max-w-[85vw] p-0 data-[state=open]:visible data-[state=closed]:invisible",forceMount:!0,animateExit:!1,children:jsxRuntime.jsx(ChatLayout,{ref:g,inputRef:m,userId:d??"2",userName:l??"Unknown user",apiKey:u??""})})]}),t]})]})}),Layout=React.forwardRef(({children:e,rightMenu:t,routes:n,footer:o,handleValidSearch:l,dashboardTitle:u,onSignOut:p,searchPlaceholder:d,withRandmarAssistant:f,chatUserName:m,chatApiKey:g,chatRef:b},_)=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(SidebarProvider,{children:jsxRuntime.jsxs("div",{className:"flex grow",children:[jsxRuntime.jsx(Navbar,{routes:n,footer:o,dashboardTitle:u,withRandmarAssistant:f,chatUserName:m,chatApiKey:g,ref:b}),jsxRuntime.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[jsxRuntime.jsx(Topbar,{ref:_,onSignOut:p,rightMenu:t,handleValidSearch:l,searchPlaceholder:d}),jsxRuntime.jsx("main",{className:"flex-1 overflow-auto mt-16",children:e}),jsxRuntime.jsx(Toaster,{})]})]})})}));Layout.displayName="Layout";function usePrevious(e){const t=React__namespace.useRef({value:e,previous:e});return React__namespace.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var OPEN_KEYS=[" ","Enter","ArrowUp","ArrowDown"],SELECTION_KEYS=[" ","Enter"],SELECT_NAME="Select",[Collection,useCollection,createCollectionScope]=createCollection(SELECT_NAME),[createSelectContext,createSelectScope]=createContextScope(SELECT_NAME,[createCollectionScope,createPopperScope]),usePopperScope=createPopperScope(),[SelectProvider,useSelectContext]=createSelectContext(SELECT_NAME),[SelectNativeOptionsProvider,useSelectNativeOptionsContext]=createSelectContext(SELECT_NAME),Select$1=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:l,onOpenChange:u,value:p,defaultValue:d,onValueChange:f,dir:m,name:g,autoComplete:b,disabled:_,required:S,form:E}=e,C=usePopperScope(t),[R,A]=React__namespace.useState(null),[N,O]=React__namespace.useState(null),[V,M]=React__namespace.useState(!1),I=useDirection(m),[j,B]=useControllableState({prop:o,defaultProp:l??!1,onChange:u,caller:SELECT_NAME}),[L,q]=useControllableState({prop:p,defaultProp:d,onChange:f,caller:SELECT_NAME}),F=React__namespace.useRef(null),H=R?E||!!R.closest("form"):!0,[U,G]=React__namespace.useState(new Set),J=Array.from(U).map(ee=>ee.props.value).join(";");return jsxRuntime.jsx(Root2$4,{...C,children:jsxRuntime.jsxs(SelectProvider,{required:S,scope:t,trigger:R,onTriggerChange:A,valueNode:N,onValueNodeChange:O,valueNodeHasChildren:V,onValueNodeHasChildrenChange:M,contentId:useId(),value:L,onValueChange:q,open:j,onOpenChange:B,dir:I,triggerPointerDownPosRef:F,disabled:_,children:[jsxRuntime.jsx(Collection.Provider,{scope:t,children:jsxRuntime.jsx(SelectNativeOptionsProvider,{scope:e.__scopeSelect,onNativeOptionAdd:React__namespace.useCallback(ee=>{G(ae=>new Set(ae).add(ee))},[]),onNativeOptionRemove:React__namespace.useCallback(ee=>{G(ae=>{const W=new Set(ae);return W.delete(ee),W})},[]),children:n})}),H?jsxRuntime.jsxs(SelectBubbleInput,{"aria-hidden":!0,required:S,tabIndex:-1,name:g,autoComplete:b,value:L,onChange:ee=>q(ee.target.value),disabled:_,form:E,children:[L===void 0?jsxRuntime.jsx("option",{value:""}):null,Array.from(U)]},J):null]})})};Select$1.displayName=SELECT_NAME;var TRIGGER_NAME="SelectTrigger",SelectTrigger$1=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...l}=e,u=usePopperScope(n),p=useSelectContext(TRIGGER_NAME,n),d=p.disabled||o,f=useComposedRefs(t,p.onTriggerChange),m=useCollection(n),g=React__namespace.useRef("touch"),[b,_,S]=useTypeaheadSearch(C=>{const R=m().filter(O=>!O.disabled),A=R.find(O=>O.value===p.value),N=findNextItem(R,C,A);N!==void 0&&p.onValueChange(N.value)}),E=C=>{d||(p.onOpenChange(!0),S()),C&&(p.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})};return jsxRuntime.jsx(Anchor,{asChild:!0,...u,children:jsxRuntime.jsx(Primitive.button,{type:"button",role:"combobox","aria-controls":p.contentId,"aria-expanded":p.open,"aria-required":p.required,"aria-autocomplete":"none",dir:p.dir,"data-state":p.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":shouldShowPlaceholder(p.value)?"":void 0,...l,ref:f,onClick:composeEventHandlers(l.onClick,C=>{C.currentTarget.focus(),g.current!=="mouse"&&E(C)}),onPointerDown:composeEventHandlers(l.onPointerDown,C=>{g.current=C.pointerType;const R=C.target;R.hasPointerCapture(C.pointerId)&&R.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(E(C),C.preventDefault())}),onKeyDown:composeEventHandlers(l.onKeyDown,C=>{const R=b.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&_(C.key),!(R&&C.key===" ")&&OPEN_KEYS.includes(C.key)&&(E(),C.preventDefault())})})})});SelectTrigger$1.displayName=TRIGGER_NAME;var VALUE_NAME="SelectValue",SelectValue$1=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:l,children:u,placeholder:p="",...d}=e,f=useSelectContext(VALUE_NAME,n),{onValueNodeHasChildrenChange:m}=f,g=u!==void 0,b=useComposedRefs(t,f.onValueNodeChange);return useLayoutEffect2(()=>{m(g)},[m,g]),jsxRuntime.jsx(Primitive.span,{...d,ref:b,style:{pointerEvents:"none"},children:shouldShowPlaceholder(f.value)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:p}):u})});SelectValue$1.displayName=VALUE_NAME;var ICON_NAME="SelectIcon",SelectIcon=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...l}=e;return jsxRuntime.jsx(Primitive.span,{"aria-hidden":!0,...l,ref:t,children:o||"▼"})});SelectIcon.displayName=ICON_NAME;var PORTAL_NAME="SelectPortal",SelectPortal=e=>jsxRuntime.jsx(Portal$4,{asChild:!0,...e});SelectPortal.displayName=PORTAL_NAME;var CONTENT_NAME="SelectContent",SelectContent$1=React__namespace.forwardRef((e,t)=>{const n=useSelectContext(CONTENT_NAME,e.__scopeSelect),[o,l]=React__namespace.useState();if(useLayoutEffect2(()=>{l(new DocumentFragment)},[]),!n.open){const u=o;return u?ReactDOM__namespace.createPortal(jsxRuntime.jsx(SelectContentProvider,{scope:e.__scopeSelect,children:jsxRuntime.jsx(Collection.Slot,{scope:e.__scopeSelect,children:jsxRuntime.jsx("div",{children:e.children})})}),u):null}return jsxRuntime.jsx(SelectContentImpl,{...e,ref:t})});SelectContent$1.displayName=CONTENT_NAME;var CONTENT_MARGIN=10,[SelectContentProvider,useSelectContentContext]=createSelectContext(CONTENT_NAME),CONTENT_IMPL_NAME="SelectContentImpl",Slot=createSlot("SelectContent.RemoveScroll"),SelectContentImpl=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:u,onPointerDownOutside:p,side:d,sideOffset:f,align:m,alignOffset:g,arrowPadding:b,collisionBoundary:_,collisionPadding:S,sticky:E,hideWhenDetached:C,avoidCollisions:R,...A}=e,N=useSelectContext(CONTENT_NAME,n),[O,V]=React__namespace.useState(null),[M,I]=React__namespace.useState(null),j=useComposedRefs(t,he=>V(he)),[B,L]=React__namespace.useState(null),[q,F]=React__namespace.useState(null),H=useCollection(n),[U,G]=React__namespace.useState(!1),J=React__namespace.useRef(!1);React__namespace.useEffect(()=>{if(O)return hideOthers(O)},[O]),useFocusGuards();const ee=React__namespace.useCallback(he=>{const[ye,...de]=H().map(te=>te.ref.current),[le]=de.slice(-1),se=document.activeElement;for(const te of he)if(te===se||(te==null||te.scrollIntoView({block:"nearest"}),te===ye&&M&&(M.scrollTop=0),te===le&&M&&(M.scrollTop=M.scrollHeight),te==null||te.focus(),document.activeElement!==se))return},[H,M]),ae=React__namespace.useCallback(()=>ee([B,O]),[ee,B,O]);React__namespace.useEffect(()=>{U&&ae()},[U,ae]);const{onOpenChange:W,triggerPointerDownPosRef:Q}=N;React__namespace.useEffect(()=>{if(O){let he={x:0,y:0};const ye=le=>{var se,te;he={x:Math.abs(Math.round(le.pageX)-(((se=Q.current)==null?void 0:se.x)??0)),y:Math.abs(Math.round(le.pageY)-(((te=Q.current)==null?void 0:te.y)??0))}},de=le=>{he.x<=10&&he.y<=10?le.preventDefault():O.contains(le.target)||W(!1),document.removeEventListener("pointermove",ye),Q.current=null};return Q.current!==null&&(document.addEventListener("pointermove",ye),document.addEventListener("pointerup",de,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ye),document.removeEventListener("pointerup",de,{capture:!0})}}},[O,W,Q]),React__namespace.useEffect(()=>{const he=()=>W(!1);return window.addEventListener("blur",he),window.addEventListener("resize",he),()=>{window.removeEventListener("blur",he),window.removeEventListener("resize",he)}},[W]);const[Z,ie]=useTypeaheadSearch(he=>{const ye=H().filter(se=>!se.disabled),de=ye.find(se=>se.ref.current===document.activeElement),le=findNextItem(ye,he,de);le&&setTimeout(()=>le.ref.current.focus())}),ce=React__namespace.useCallback((he,ye,de)=>{const le=!J.current&&!de;(N.value!==void 0&&N.value===ye||le)&&(L(he),le&&(J.current=!0))},[N.value]),ue=React__namespace.useCallback(()=>O==null?void 0:O.focus(),[O]),fe=React__namespace.useCallback((he,ye,de)=>{const le=!J.current&&!de;(N.value!==void 0&&N.value===ye||le)&&F(he)},[N.value]),pe=o==="popper"?SelectPopperPosition:SelectItemAlignedPosition,ve=pe===SelectPopperPosition?{side:d,sideOffset:f,align:m,alignOffset:g,arrowPadding:b,collisionBoundary:_,collisionPadding:S,sticky:E,hideWhenDetached:C,avoidCollisions:R}:{};return jsxRuntime.jsx(SelectContentProvider,{scope:n,content:O,viewport:M,onViewportChange:I,itemRefCallback:ce,selectedItem:B,onItemLeave:ue,itemTextRefCallback:fe,focusSelectedItem:ae,selectedItemText:q,position:o,isPositioned:U,searchRef:Z,children:jsxRuntime.jsx(ReactRemoveScroll,{as:Slot,allowPinchZoom:!0,children:jsxRuntime.jsx(FocusScope,{asChild:!0,trapped:N.open,onMountAutoFocus:he=>{he.preventDefault()},onUnmountAutoFocus:composeEventHandlers(l,he=>{var ye;(ye=N.trigger)==null||ye.focus({preventScroll:!0}),he.preventDefault()}),children:jsxRuntime.jsx(DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:he=>he.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:jsxRuntime.jsx(pe,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:he=>he.preventDefault(),...A,...ve,onPlaced:()=>G(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...A.style},onKeyDown:composeEventHandlers(A.onKeyDown,he=>{const ye=he.ctrlKey||he.altKey||he.metaKey;if(he.key==="Tab"&&he.preventDefault(),!ye&&he.key.length===1&&ie(he.key),["ArrowUp","ArrowDown","Home","End"].includes(he.key)){let le=H().filter(se=>!se.disabled).map(se=>se.ref.current);if(["ArrowUp","End"].includes(he.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(he.key)){const se=he.target,te=le.indexOf(se);le=le.slice(te+1)}setTimeout(()=>ee(le)),he.preventDefault()}})})})})})})});SelectContentImpl.displayName=CONTENT_IMPL_NAME;var ITEM_ALIGNED_POSITION_NAME="SelectItemAlignedPosition",SelectItemAlignedPosition=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...l}=e,u=useSelectContext(CONTENT_NAME,n),p=useSelectContentContext(CONTENT_NAME,n),[d,f]=React__namespace.useState(null),[m,g]=React__namespace.useState(null),b=useComposedRefs(t,j=>g(j)),_=useCollection(n),S=React__namespace.useRef(!1),E=React__namespace.useRef(!0),{viewport:C,selectedItem:R,selectedItemText:A,focusSelectedItem:N}=p,O=React__namespace.useCallback(()=>{if(u.trigger&&u.valueNode&&d&&m&&C&&R&&A){const j=u.trigger.getBoundingClientRect(),B=m.getBoundingClientRect(),L=u.valueNode.getBoundingClientRect(),q=A.getBoundingClientRect();if(u.dir!=="rtl"){const se=q.left-B.left,te=L.left-se,xe=j.left-te,oe=j.width+xe,be=Math.max(oe,B.width),_e=window.innerWidth-CONTENT_MARGIN,Ce=clamp(te,[CONTENT_MARGIN,Math.max(CONTENT_MARGIN,_e-be)]);d.style.minWidth=oe+"px",d.style.left=Ce+"px"}else{const se=B.right-q.right,te=window.innerWidth-L.right-se,xe=window.innerWidth-j.right-te,oe=j.width+xe,be=Math.max(oe,B.width),_e=window.innerWidth-CONTENT_MARGIN,Ce=clamp(te,[CONTENT_MARGIN,Math.max(CONTENT_MARGIN,_e-be)]);d.style.minWidth=oe+"px",d.style.right=Ce+"px"}const F=_(),H=window.innerHeight-CONTENT_MARGIN*2,U=C.scrollHeight,G=window.getComputedStyle(m),J=parseInt(G.borderTopWidth,10),ee=parseInt(G.paddingTop,10),ae=parseInt(G.borderBottomWidth,10),W=parseInt(G.paddingBottom,10),Q=J+ee+U+W+ae,Z=Math.min(R.offsetHeight*5,Q),ie=window.getComputedStyle(C),ce=parseInt(ie.paddingTop,10),ue=parseInt(ie.paddingBottom,10),fe=j.top+j.height/2-CONTENT_MARGIN,pe=H-fe,ve=R.offsetHeight/2,he=R.offsetTop+ve,ye=J+ee+he,de=Q-ye;if(ye<=fe){const se=F.length>0&&R===F[F.length-1].ref.current;d.style.bottom="0px";const te=m.clientHeight-C.offsetTop-C.offsetHeight,xe=Math.max(pe,ve+(se?ue:0)+te+ae),oe=ye+xe;d.style.height=oe+"px"}else{const se=F.length>0&&R===F[0].ref.current;d.style.top="0px";const xe=Math.max(fe,J+C.offsetTop+(se?ce:0)+ve)+de;d.style.height=xe+"px",C.scrollTop=ye-fe+C.offsetTop}d.style.margin=`${CONTENT_MARGIN}px 0`,d.style.minHeight=Z+"px",d.style.maxHeight=H+"px",o==null||o(),requestAnimationFrame(()=>S.current=!0)}},[_,u.trigger,u.valueNode,d,m,C,R,A,u.dir,o]);useLayoutEffect2(()=>O(),[O]);const[V,M]=React__namespace.useState();useLayoutEffect2(()=>{m&&M(window.getComputedStyle(m).zIndex)},[m]);const I=React__namespace.useCallback(j=>{j&&E.current===!0&&(O(),N==null||N(),E.current=!1)},[O,N]);return jsxRuntime.jsx(SelectViewportProvider,{scope:n,contentWrapper:d,shouldExpandOnScrollRef:S,onScrollButtonChange:I,children:jsxRuntime.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:V},children:jsxRuntime.jsx(Primitive.div,{...l,ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})});SelectItemAlignedPosition.displayName=ITEM_ALIGNED_POSITION_NAME;var POPPER_POSITION_NAME="SelectPopperPosition",SelectPopperPosition=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:l=CONTENT_MARGIN,...u}=e,p=usePopperScope(n);return jsxRuntime.jsx(Content$1,{...p,...u,ref:t,align:o,collisionPadding:l,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});SelectPopperPosition.displayName=POPPER_POSITION_NAME;var[SelectViewportProvider,useSelectViewportContext]=createSelectContext(CONTENT_NAME,{}),VIEWPORT_NAME="SelectViewport",SelectViewport=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...l}=e,u=useSelectContentContext(VIEWPORT_NAME,n),p=useSelectViewportContext(VIEWPORT_NAME,n),d=useComposedRefs(t,u.onViewportChange),f=React__namespace.useRef(0);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),jsxRuntime.jsx(Collection.Slot,{scope:n,children:jsxRuntime.jsx(Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:composeEventHandlers(l.onScroll,m=>{const g=m.currentTarget,{contentWrapper:b,shouldExpandOnScrollRef:_}=p;if(_!=null&&_.current&&b){const S=Math.abs(f.current-g.scrollTop);if(S>0){const E=window.innerHeight-CONTENT_MARGIN*2,C=parseFloat(b.style.minHeight),R=parseFloat(b.style.height),A=Math.max(C,R);if(A<E){const N=A+S,O=Math.min(E,N),V=N-O;b.style.height=O+"px",b.style.bottom==="0px"&&(g.scrollTop=V>0?V:0,b.style.justifyContent="flex-end")}}}f.current=g.scrollTop})})})]})});SelectViewport.displayName=VIEWPORT_NAME;var GROUP_NAME="SelectGroup",[SelectGroupContextProvider,useSelectGroupContext]=createSelectContext(GROUP_NAME),SelectGroup=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,l=useId();return jsxRuntime.jsx(SelectGroupContextProvider,{scope:n,id:l,children:jsxRuntime.jsx(Primitive.div,{role:"group","aria-labelledby":l,...o,ref:t})})});SelectGroup.displayName=GROUP_NAME;var LABEL_NAME="SelectLabel",SelectLabel$1=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,l=useSelectGroupContext(LABEL_NAME,n);return jsxRuntime.jsx(Primitive.div,{id:l.id,...o,ref:t})});SelectLabel$1.displayName=LABEL_NAME;var ITEM_NAME="SelectItem",[SelectItemContextProvider,useSelectItemContext]=createSelectContext(ITEM_NAME),SelectItem$1=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:l=!1,textValue:u,...p}=e,d=useSelectContext(ITEM_NAME,n),f=useSelectContentContext(ITEM_NAME,n),m=d.value===o,[g,b]=React__namespace.useState(u??""),[_,S]=React__namespace.useState(!1),E=useComposedRefs(t,N=>{var O;return(O=f.itemRefCallback)==null?void 0:O.call(f,N,o,l)}),C=useId(),R=React__namespace.useRef("touch"),A=()=>{l||(d.onValueChange(o),d.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return jsxRuntime.jsx(SelectItemContextProvider,{scope:n,value:o,disabled:l,textId:C,isSelected:m,onItemTextChange:React__namespace.useCallback(N=>{b(O=>O||((N==null?void 0:N.textContent)??"").trim())},[]),children:jsxRuntime.jsx(Collection.ItemSlot,{scope:n,value:o,disabled:l,textValue:g,children:jsxRuntime.jsx(Primitive.div,{role:"option","aria-labelledby":C,"data-highlighted":_?"":void 0,"aria-selected":m&&_,"data-state":m?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...p,ref:E,onFocus:composeEventHandlers(p.onFocus,()=>S(!0)),onBlur:composeEventHandlers(p.onBlur,()=>S(!1)),onClick:composeEventHandlers(p.onClick,()=>{R.current!=="mouse"&&A()}),onPointerUp:composeEventHandlers(p.onPointerUp,()=>{R.current==="mouse"&&A()}),onPointerDown:composeEventHandlers(p.onPointerDown,N=>{R.current=N.pointerType}),onPointerMove:composeEventHandlers(p.onPointerMove,N=>{var O;R.current=N.pointerType,l?(O=f.onItemLeave)==null||O.call(f):R.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:composeEventHandlers(p.onPointerLeave,N=>{var O;N.currentTarget===document.activeElement&&((O=f.onItemLeave)==null||O.call(f))}),onKeyDown:composeEventHandlers(p.onKeyDown,N=>{var V;((V=f.searchRef)==null?void 0:V.current)!==""&&N.key===" "||(SELECTION_KEYS.includes(N.key)&&A(),N.key===" "&&N.preventDefault())})})})})});SelectItem$1.displayName=ITEM_NAME;var ITEM_TEXT_NAME="SelectItemText",SelectItemText=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:l,...u}=e,p=useSelectContext(ITEM_TEXT_NAME,n),d=useSelectContentContext(ITEM_TEXT_NAME,n),f=useSelectItemContext(ITEM_TEXT_NAME,n),m=useSelectNativeOptionsContext(ITEM_TEXT_NAME,n),[g,b]=React__namespace.useState(null),_=useComposedRefs(t,A=>b(A),f.onItemTextChange,A=>{var N;return(N=d.itemTextRefCallback)==null?void 0:N.call(d,A,f.value,f.disabled)}),S=g==null?void 0:g.textContent,E=React__namespace.useMemo(()=>jsxRuntime.jsx("option",{value:f.value,disabled:f.disabled,children:S},f.value),[f.disabled,f.value,S]),{onNativeOptionAdd:C,onNativeOptionRemove:R}=m;return useLayoutEffect2(()=>(C(E),()=>R(E)),[C,R,E]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Primitive.span,{id:f.textId,...u,ref:_}),f.isSelected&&p.valueNode&&!p.valueNodeHasChildren?ReactDOM__namespace.createPortal(u.children,p.valueNode):null]})});SelectItemText.displayName=ITEM_TEXT_NAME;var ITEM_INDICATOR_NAME="SelectItemIndicator",SelectItemIndicator=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return useSelectItemContext(ITEM_INDICATOR_NAME,n).isSelected?jsxRuntime.jsx(Primitive.span,{"aria-hidden":!0,...o,ref:t}):null});SelectItemIndicator.displayName=ITEM_INDICATOR_NAME;var SCROLL_UP_BUTTON_NAME="SelectScrollUpButton",SelectScrollUpButton$1=React__namespace.forwardRef((e,t)=>{const n=useSelectContentContext(SCROLL_UP_BUTTON_NAME,e.__scopeSelect),o=useSelectViewportContext(SCROLL_UP_BUTTON_NAME,e.__scopeSelect),[l,u]=React__namespace.useState(!1),p=useComposedRefs(t,o.onScrollButtonChange);return useLayoutEffect2(()=>{if(n.viewport&&n.isPositioned){let d=function(){const m=f.scrollTop>0;u(m)};const f=n.viewport;return d(),f.addEventListener("scroll",d),()=>f.removeEventListener("scroll",d)}},[n.viewport,n.isPositioned]),l?jsxRuntime.jsx(SelectScrollButtonImpl,{...e,ref:p,onAutoScroll:()=>{const{viewport:d,selectedItem:f}=n;d&&f&&(d.scrollTop=d.scrollTop-f.offsetHeight)}}):null});SelectScrollUpButton$1.displayName=SCROLL_UP_BUTTON_NAME;var SCROLL_DOWN_BUTTON_NAME="SelectScrollDownButton",SelectScrollDownButton$1=React__namespace.forwardRef((e,t)=>{const n=useSelectContentContext(SCROLL_DOWN_BUTTON_NAME,e.__scopeSelect),o=useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME,e.__scopeSelect),[l,u]=React__namespace.useState(!1),p=useComposedRefs(t,o.onScrollButtonChange);return useLayoutEffect2(()=>{if(n.viewport&&n.isPositioned){let d=function(){const m=f.scrollHeight-f.clientHeight,g=Math.ceil(f.scrollTop)<m;u(g)};const f=n.viewport;return d(),f.addEventListener("scroll",d),()=>f.removeEventListener("scroll",d)}},[n.viewport,n.isPositioned]),l?jsxRuntime.jsx(SelectScrollButtonImpl,{...e,ref:p,onAutoScroll:()=>{const{viewport:d,selectedItem:f}=n;d&&f&&(d.scrollTop=d.scrollTop+f.offsetHeight)}}):null});SelectScrollDownButton$1.displayName=SCROLL_DOWN_BUTTON_NAME;var SelectScrollButtonImpl=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...l}=e,u=useSelectContentContext("SelectScrollButton",n),p=React__namespace.useRef(null),d=useCollection(n),f=React__namespace.useCallback(()=>{p.current!==null&&(window.clearInterval(p.current),p.current=null)},[]);return React__namespace.useEffect(()=>()=>f(),[f]),useLayoutEffect2(()=>{var g;const m=d().find(b=>b.ref.current===document.activeElement);(g=m==null?void 0:m.ref.current)==null||g.scrollIntoView({block:"nearest"})},[d]),jsxRuntime.jsx(Primitive.div,{"aria-hidden":!0,...l,ref:t,style:{flexShrink:0,...l.style},onPointerDown:composeEventHandlers(l.onPointerDown,()=>{p.current===null&&(p.current=window.setInterval(o,50))}),onPointerMove:composeEventHandlers(l.onPointerMove,()=>{var m;(m=u.onItemLeave)==null||m.call(u),p.current===null&&(p.current=window.setInterval(o,50))}),onPointerLeave:composeEventHandlers(l.onPointerLeave,()=>{f()})})}),SEPARATOR_NAME="SelectSeparator",SelectSeparator$1=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return jsxRuntime.jsx(Primitive.div,{"aria-hidden":!0,...o,ref:t})});SelectSeparator$1.displayName=SEPARATOR_NAME;var ARROW_NAME="SelectArrow",SelectArrow=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,l=usePopperScope(n),u=useSelectContext(ARROW_NAME,n),p=useSelectContentContext(ARROW_NAME,n);return u.open&&p.position==="popper"?jsxRuntime.jsx(Arrow,{...l,...o,ref:t}):null});SelectArrow.displayName=ARROW_NAME;var BUBBLE_INPUT_NAME$1="SelectBubbleInput",SelectBubbleInput=React__namespace.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const l=React__namespace.useRef(null),u=useComposedRefs(o,l),p=usePrevious(t);return React__namespace.useEffect(()=>{const d=l.current;if(!d)return;const f=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(f,"value").set;if(p!==t&&g){const b=new Event("change",{bubbles:!0});g.call(d,t),d.dispatchEvent(b)}},[p,t]),jsxRuntime.jsx(Primitive.select,{...n,style:{...VISUALLY_HIDDEN_STYLES,...n.style},ref:u,defaultValue:t})});SelectBubbleInput.displayName=BUBBLE_INPUT_NAME$1;function shouldShowPlaceholder(e){return e===""||e===void 0}function useTypeaheadSearch(e){const t=useCallbackRef$1(e),n=React__namespace.useRef(""),o=React__namespace.useRef(0),l=React__namespace.useCallback(p=>{const d=n.current+p;t(d),function f(m){n.current=m,window.clearTimeout(o.current),m!==""&&(o.current=window.setTimeout(()=>f(""),1e3))}(d)},[t]),u=React__namespace.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return React__namespace.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,l,u]}function findNextItem(e,t,n){const l=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,u=n?e.indexOf(n):-1;let p=wrapArray(e,Math.max(u,0));l.length===1&&(p=p.filter(m=>m!==n));const f=p.find(m=>m.textValue.toLowerCase().startsWith(l.toLowerCase()));return f!==n?f:void 0}function wrapArray(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var Root2=Select$1,Trigger=SelectTrigger$1,Value=SelectValue$1,Icon=SelectIcon,Portal=SelectPortal,Content2=SelectContent$1,Viewport=SelectViewport,Label=SelectLabel$1,Item=SelectItem$1,ItemText=SelectItemText,ItemIndicator=SelectItemIndicator,ScrollUpButton=SelectScrollUpButton$1,ScrollDownButton=SelectScrollDownButton$1,Separator=SelectSeparator$1;const Select=Root2,SelectValue=Value,SelectTrigger=React__namespace.forwardRef(({className:e,children:t,...n},o)=>jsxRuntime.jsxs(Trigger,{ref:o,className:cn("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,jsxRuntime.jsx(Icon,{asChild:!0,children:jsxRuntime.jsx(ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));SelectTrigger.displayName=Trigger.displayName;const SelectScrollUpButton=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(ScrollUpButton,{ref:n,className:cn("flex cursor-default items-center justify-center py-1",e),...t,children:jsxRuntime.jsx(ChevronUp,{className:"h-4 w-4"})}));SelectScrollUpButton.displayName=ScrollUpButton.displayName;const SelectScrollDownButton=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(ScrollDownButton,{ref:n,className:cn("flex cursor-default items-center justify-center py-1",e),...t,children:jsxRuntime.jsx(ChevronDown,{className:"h-4 w-4"})}));SelectScrollDownButton.displayName=ScrollDownButton.displayName;const SelectContent=React__namespace.forwardRef(({className:e,children:t,position:n="popper",...o},l)=>jsxRuntime.jsx(Portal,{children:jsxRuntime.jsxs(Content2,{ref:l,className:cn("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...o,children:[jsxRuntime.jsx(SelectScrollUpButton,{}),jsxRuntime.jsx(Viewport,{className:cn("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),jsxRuntime.jsx(SelectScrollDownButton,{})]})}));SelectContent.displayName=Content2.displayName;const SelectLabel=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Label,{ref:n,className:cn("px-2 py-1.5 text-sm font-semibold",e),...t}));SelectLabel.displayName=Label.displayName;const SelectItem=React__namespace.forwardRef(({className:e,children:t,...n},o)=>jsxRuntime.jsxs(Item,{ref:o,className:cn("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[jsxRuntime.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(ItemIndicator,{children:jsxRuntime.jsx(Check,{className:"h-4 w-4"})})}),jsxRuntime.jsx(ItemText,{children:t})]}));SelectItem.displayName=Item.displayName;const SelectSeparator=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Separator,{ref:n,className:cn("-mx-1 my-1 h-px bg-muted",e),...t}));SelectSeparator.displayName=Separator.displayName;var SWITCH_NAME="Switch",[createSwitchContext,createSwitchScope]=createContextScope(SWITCH_NAME),[SwitchProvider,useSwitchContext]=createSwitchContext(SWITCH_NAME),Switch$1=React__namespace.forwardRef((e,t)=>{const{__scopeSwitch:n,name:o,checked:l,defaultChecked:u,required:p,disabled:d,value:f="on",onCheckedChange:m,form:g,...b}=e,[_,S]=React__namespace.useState(null),E=useComposedRefs(t,O=>S(O)),C=React__namespace.useRef(!1),R=_?g||!!_.closest("form"):!0,[A,N]=useControllableState({prop:l,defaultProp:u??!1,onChange:m,caller:SWITCH_NAME});return jsxRuntime.jsxs(SwitchProvider,{scope:n,checked:A,disabled:d,children:[jsxRuntime.jsx(Primitive.button,{type:"button",role:"switch","aria-checked":A,"aria-required":p,"data-state":getState(A),"data-disabled":d?"":void 0,disabled:d,value:f,...b,ref:E,onClick:composeEventHandlers(e.onClick,O=>{N(V=>!V),R&&(C.current=O.isPropagationStopped(),C.current||O.stopPropagation())})}),R&&jsxRuntime.jsx(SwitchBubbleInput,{control:_,bubbles:!C.current,name:o,value:f,checked:A,required:p,disabled:d,form:g,style:{transform:"translateX(-100%)"}})]})});Switch$1.displayName=SWITCH_NAME;var THUMB_NAME="SwitchThumb",SwitchThumb=React__namespace.forwardRef((e,t)=>{const{__scopeSwitch:n,...o}=e,l=useSwitchContext(THUMB_NAME,n);return jsxRuntime.jsx(Primitive.span,{"data-state":getState(l.checked),"data-disabled":l.disabled?"":void 0,...o,ref:t})});SwitchThumb.displayName=THUMB_NAME;var BUBBLE_INPUT_NAME="SwitchBubbleInput",SwitchBubbleInput=React__namespace.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:o=!0,...l},u)=>{const p=React__namespace.useRef(null),d=useComposedRefs(p,u),f=usePrevious(n),m=useSize(t);return React__namespace.useEffect(()=>{const g=p.current;if(!g)return;const b=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(b,"checked").set;if(f!==n&&S){const E=new Event("click",{bubbles:o});S.call(g,n),g.dispatchEvent(E)}},[f,n,o]),jsxRuntime.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...l,tabIndex:-1,ref:d,style:{...l.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});SwitchBubbleInput.displayName=BUBBLE_INPUT_NAME;function getState(e){return e?"checked":"unchecked"}var Root=Switch$1,Thumb=SwitchThumb;const Switch=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Root,{className:cn("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:jsxRuntime.jsx(Thumb,{className:cn("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Switch.displayName=Root.displayName;const DAYS_OF_WEEK=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function ManufacturerReorderingCard({manufacturer:e,onSave:t,loading:n=!1,saving:o=!1}){const[l,u]=React.useState({...e}),p=(_,S)=>{u(E=>({...E,[_]:S}))},d=(_,S)=>{u(E=>({...E,[_]:S}))},f=(_,S)=>{u(E=>({...E,[_]:S}))},m=()=>{o||t(l)},g=_=>_===-1?"ASAP":_===void 0||_<0||_>6?"Sunday":DAYS_OF_WEEK[_],b=_=>_==="ASAP"?-1:DAYS_OF_WEEK.indexOf(_);return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{children:[n?jsxRuntime.jsx(Skeleton,{className:"h-8 w-32"}):jsxRuntime.jsx(CardTitle,{className:"text-lg font-bold",children:"Reordering"}),n?jsxRuntime.jsx(Skeleton,{className:"h-4 w-full mt-2"}):jsxRuntime.jsx(CardDescription,{className:"text-sm",children:"Adjust your reordering settings to control lead times, stocking weeks, minimum orders, and reorder dates, enhancing efficiency in restocking processes."})]}),jsxRuntime.jsx(CardContent,{className:"space-y-6",children:n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-10"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"}),jsxRuntime.jsx("div",{className:"ml-2 w-12"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"}),jsxRuntime.jsx("div",{className:"ml-2 w-12"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Switch,{id:"automatic-reordering",checked:l.AutoUpdate,onCheckedChange:_=>p("AutoUpdate",_),disabled:o}),jsxRuntime.jsx(Label$2,{htmlFor:"automatic-reordering",children:"Automatic Reordering"})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"reorder-date",children:"Automatic Reorder Date"}),jsxRuntime.jsxs(Select,{value:g(l.AutoReorderDate),onValueChange:_=>d("AutoReorderDate",b(_)),disabled:o,children:[jsxRuntime.jsx(SelectTrigger,{id:"reorder-date",children:jsxRuntime.jsx(SelectValue,{placeholder:"Select day"})}),jsxRuntime.jsxs(SelectContent,{children:[jsxRuntime.jsx(SelectItem,{value:"ASAP",children:"ASAP"}),DAYS_OF_WEEK.map(_=>jsxRuntime.jsx(SelectItem,{value:_,children:_},_))]})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"weeks-stocking",children:"Default Weeks of Stocking"}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx(Input,{id:"weeks-stocking",type:"number",value:l.DefaultWeeksOfStocking||"",onChange:_=>d("DefaultWeeksOfStocking",Number(_.target.value)),disabled:o}),jsxRuntime.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"weeks"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"minimum-order",children:"Default Minimum Order"}),jsxRuntime.jsxs("div",{className:"flex items-center relative",children:[jsxRuntime.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2",children:"$"}),jsxRuntime.jsx(Input,{id:"minimum-order",type:"number",className:"pl-6",value:l.DefaultMinimumOrder||"",onChange:_=>d("DefaultMinimumOrder",Number(_.target.value)),disabled:o})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"lead-time",children:"Default Lead Time"}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx(Input,{id:"lead-time",type:"number",value:l.DefaultLeadTime||"",onChange:_=>d("DefaultLeadTime",Number(_.target.value)),disabled:o}),jsxRuntime.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"days"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"maximum-inventory-value",children:"Default Maximum Inventory Value"}),jsxRuntime.jsxs("div",{className:"flex items-center relative",children:[jsxRuntime.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2",children:"$"}),jsxRuntime.jsx(Input,{id:"maximum-inventory-value",type:"number",className:"pl-6",value:l.DefaultMaxInventoryValue||"",onChange:_=>d("DefaultMaxInventoryValue",Number(_.target.value)),disabled:o})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"order-confirmations",children:"Send Order Confirmations To"}),jsxRuntime.jsx(Input,{id:"order-confirmations",type:"email",value:l.POEmail||"",onChange:_=>f("POEmail",_.target.value),placeholder:"email@example.com",disabled:o})]})]})]})}),jsxRuntime.jsx(CardFooter,{className:"flex justify-end",children:n?jsxRuntime.jsx(Skeleton,{className:"h-10 w-20"}):jsxRuntime.jsxs(Button,{onClick:m,disabled:o,children:[o&&jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Save"]})})]})}function ResellerBillingOverviewCard({reseller:e,actions:t,loading:n=!1}){return n||!e?jsxRuntime.jsx(ResellerBillingOverviewSkeleton,{}):jsxRuntime.jsx(ResellerBillingOverviewData,{reseller:e,actions:t})}function ResellerBillingOverviewSkeleton(){return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:jsxRuntime.jsx(Skeleton,{className:"h-6 w-40"})})}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsx("div",{className:"space-y-4",children:Array(3).fill(0).map((e,t)=>jsxRuntime.jsxs("div",{className:"border rounded-lg p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-9 rounded-full"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-7 w-28"})]})]},t))}),jsxRuntime.jsx("div",{className:"space-y-4",children:Array(2).fill(0).map((e,t)=>jsxRuntime.jsxs("div",{className:"border rounded-lg p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-9 rounded-full"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-7 w-28"})]})]},t))})]}),jsxRuntime.jsx("div",{className:"flex justify-end mt-4",children:jsxRuntime.jsx(Skeleton,{className:"h-10 w-28 rounded-md"})})]})]})}function ResellerBillingOverviewData({reseller:e,actions:t}){const n=p=>p===void 0?"$0.00":new Intl.NumberFormat("en-CA",{style:"currency",currency:"CAD",minimumFractionDigits:2,maximumFractionDigits:2}).format(p),o=e.Statement||{},l=[{title:"0 - 30 Days",amount:o.Over0||0,icon:jsxRuntime.jsx(Calendar,{className:"h-5 w-5 text-white"}),color:"bg-primary"},{title:"31 - 45 Days",amount:o.Over30||0,icon:jsxRuntime.jsx(Calendar,{className:"h-5 w-5 text-white"}),color:"bg-primary"},{title:"45+ Days",amount:o.Over45||0,icon:jsxRuntime.jsx(Calendar,{className:"h-5 w-5 text-white"}),color:"bg-primary"}],u=[{title:"Total",amount:o.Total||0,icon:jsxRuntime.jsx(DollarSign,{className:"h-5 w-5 text-white"}),color:"bg-green-500"},{title:"Credit Limit",amount:e.CreditLimit||0,icon:jsxRuntime.jsx(CreditCard,{className:"h-5 w-5 text-white"}),color:"bg-blue-500"}];return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:"Billing Overview"})}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsx("div",{className:"space-y-4",children:l.map((p,d)=>jsxRuntime.jsxs("div",{className:"border rounded-lg p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[jsxRuntime.jsx("h3",{className:"text-sm sm:text-base font-medium",children:p.title}),jsxRuntime.jsx("div",{className:`p-2 rounded-full ${p.color}`,children:p.icon})]}),jsxRuntime.jsx("div",{children:jsxRuntime.jsx("p",{className:"text-base sm:text-lg font-bold",children:n(p.amount)})})]},d))}),jsxRuntime.jsx("div",{className:"space-y-4",children:u.map((p,d)=>jsxRuntime.jsxs("div",{className:"border rounded-lg p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[jsxRuntime.jsx("h3",{className:"text-sm sm:text-base font-medium",children:p.title}),jsxRuntime.jsx("div",{className:`p-2 rounded-full ${p.color}`,children:p.icon})]}),jsxRuntime.jsx("div",{children:jsxRuntime.jsx("p",{className:"text-base sm:text-lg font-bold",children:n(p.amount)})})]},d))})]}),t&&jsxRuntime.jsx("div",{className:"flex justify-end mt-4",children:t})]})]})}function ResellerQualificationsCard({qualifications:e=[],loading:t=!1}){return t?jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:"Qualifications"})}),jsxRuntime.jsx(CardContent,{className:"p-6",children:jsxRuntime.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4 gap-y-8",children:Array.from({length:10}).map((n,o)=>jsxRuntime.jsxs("div",{className:"flex flex-col items-center",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-24 rounded-md mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-16 rounded-full"})]},o))})})]}):jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:"Qualifications"})}),jsxRuntime.jsx(CardContent,{className:"p-6",children:jsxRuntime.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4 gap-y-8",children:e.map((n,o)=>jsxRuntime.jsx(ManufacturerLogo,{manufacturerId:n.ManufacturerId,opportunityNumber:n.DefaultOpportunityNumber},`${n.ManufacturerId}-${o}`))})})]})}function ManufacturerLogo({manufacturerId:e,opportunityNumber:t}){const[n,o]=React.useState(null),[l,u]=React.useState(!0),[p,d]=React.useState(!1),[f,m]=React.useState(null),g=React.useMemo(()=>e?{logoUrl:`https://api.randmar.io/V4/Partner/${e}/Account/Logo?width=96&height=48`,logoExistsUrl:`https://api.randmar.io/V4/Partner/${e}/Account/Logo/Exists`}:null,[e]);return React.useEffect(()=>{if(!g)return;let b=!0;m(null);const _=async()=>{try{const C=await fetch(g.logoExistsUrl);if(C.ok){const A=(await C.text()).toLowerCase()==="true";return b&&d(A),A}return!1}catch(C){return console.error("Failed to check if logo exists:",C),b&&d(!1),!1}},S=async()=>{b&&u(!0);try{const C=await fetch(g.logoUrl);if(C.ok){const R=await C.blob();b&&(n&&URL.revokeObjectURL(n),o(URL.createObjectURL(R)))}else throw new Error(`Failed to load logo: ${C.status}`)}catch(C){console.error("Failed to load logo:",C),b&&m("Failed to load manufacturer logo")}finally{b&&u(!1)}};return(async()=>{await _()?S():u(!1)})(),()=>{b=!1,n&&URL.revokeObjectURL(n)}},[g]),jsxRuntime.jsxs("div",{className:"flex flex-col items-center",children:[jsxRuntime.jsx("div",{className:"h-12 flex items-center justify-center mb-2",children:l?jsxRuntime.jsx(Skeleton,{className:"h-12 w-24 rounded-md"}):p&&n?jsxRuntime.jsx("img",{src:n,alt:"Manufacturer logo",className:"max-h-12 max-w-24 object-contain",onError:()=>m("Failed to load logo")}):jsxRuntime.jsx("div",{className:"h-12 w-24 flex items-center justify-center bg-slate-100 rounded-md text-xs text-slate-500",children:e?e.substring(0,8):"No ID"})}),t&&jsxRuntime.jsx(Badge,{variant:"outline",className:"text-xs",children:t}),f&&jsxRuntime.jsx("div",{className:"text-red-500 text-xs mt-1",role:"alert",children:f})]})}function SalesOverviewCard({salesData:e,salesStatistics:t=[],loading:n=!1}){return n||!e?jsxRuntime.jsx(SalesOverviewSkeleton,{}):jsxRuntime.jsx(SalesOverviewData,{salesData:e,salesStatistics:t})}function SalesOverviewSkeleton(){return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{className:"pb-0",children:jsxRuntime.jsx(CardTitle,{className:"text-lg sm:text-xl",children:jsxRuntime.jsx(Skeleton,{className:"h-7 w-40"})})}),jsxRuntime.jsxs(CardContent,{className:"pt-4 px-3 sm:px-6",children:[jsxRuntime.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Array(3).fill(0).map((e,t)=>jsxRuntime.jsxs("div",{className:"border rounded-lg p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-9 rounded-full"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-7 w-28"})]})]},t))}),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-32"}),jsxRuntime.jsx(Skeleton,{className:"h-[250px] w-full rounded-lg"})]})})]})]})}function SalesOverviewData({salesData:e,salesStatistics:t=[]}){const n=u=>new Intl.NumberFormat("en-CA",{style:"currency",currency:"CAD",minimumFractionDigits:2,maximumFractionDigits:2}).format(u),o=[{title:"Last 30 days",amount:e.SalesLast30Days||0,icon:jsxRuntime.jsx(Calendar,{className:"h-5 w-5 text-white"}),color:"bg-blue-500"},{title:"Last 3 months",amount:e.SalesLast3Months||0,icon:jsxRuntime.jsx(Calendar,{className:"h-5 w-5 text-white"}),color:"bg-amber-500"},{title:"Year to date",amount:e.SalesYearToDay||0,icon:jsxRuntime.jsx(Calendar,{className:"h-5 w-5 text-white"}),color:"bg-emerald-500"}],l=React.useMemo(()=>{const u=new Map;return t.forEach(p=>{var f;const d=((f=p.Day)==null?void 0:f.toString())||"";if(d.length===8){const m=parseInt(d.substring(0,4),10),g=parseInt(d.substring(4,6),10)-1,b=parseInt(d.substring(6,8),10),_=new Date(m,g,b),S=new Date(_),E=_.getDay();S.setDate(_.getDate()-E);const C=`${S.getFullYear()}-${String(S.getMonth()+1).padStart(2,"0")}-${String(S.getDate()).padStart(2,"0")}`,R=p.ExtendedPrice||0;u.has(C)?u.set(C,u.get(C)+R):u.set(C,R)}}),Array.from(u).sort(([p],[d])=>p.localeCompare(d)).map(([p,d])=>({date:`${p.substring(5,7)}/${p.substring(8,10)}`,amount:d}))},[t]);return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{className:"pb-0",children:jsxRuntime.jsx(CardTitle,{className:"text-lg sm:text-xl",children:"Sales Overview"})}),jsxRuntime.jsxs(CardContent,{className:"pt-4 px-3 sm:px-6",children:[jsxRuntime.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:o.map((u,p)=>jsxRuntime.jsxs("div",{className:"border rounded-lg p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx("h3",{className:"text-sm sm:text-base font-medium",children:u.title}),jsxRuntime.jsx("div",{className:`p-2 rounded-full ${u.color}`,children:u.icon})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Amount"}),jsxRuntime.jsx("p",{className:"text-base sm:text-lg font-bold",children:n(u.amount)})]})]},p))}),jsxRuntime.jsx("div",{className:"mt-6",children:t&&t.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("h3",{className:"text-sm font-medium mb-4",children:"Sales Trend"}),jsxRuntime.jsx("div",{className:"space-y-6",children:jsxRuntime.jsx(AreaChart,{data:l,units:"$",unitsPosition:"left",height:200})})]})})]})]})}exports.ActiveOrdersCard=ActiveOrdersCard,exports.AiGeneratedContent=AiGeneratedContent,exports.ApiKeyProvider=ApiKeyProvider,exports.AreaChart=AreaChart,exports.Avatar=Avatar,exports.AvatarFallback=AvatarFallback,exports.AvatarFooter=AvatarFooter,exports.AvatarImage=AvatarImage,exports.Badge=Badge,exports.Button=Button,exports.Card=Card,exports.CardContent=CardContent,exports.CardDescription=CardDescription,exports.CardFooter=CardFooter,exports.CardHeader=CardHeader,exports.CardTitle=CardTitle,exports.ChatLayout=ChatLayout,exports.CountryFlag=CountryFlag,exports.Dialog=Dialog,exports.DialogClose=DialogClose,exports.DialogContent=DialogContent,exports.DialogDescription=DialogDescription,exports.DialogFooter=DialogFooter,exports.DialogHeader=DialogHeader,exports.DialogOverlay=DialogOverlay,exports.DialogPortal=DialogPortal,exports.DialogTitle=DialogTitle,exports.DialogTrigger=DialogTrigger,exports.DropdownMenu=DropdownMenu,exports.DropdownMenuCheckboxItem=DropdownMenuCheckboxItem,exports.DropdownMenuContent=DropdownMenuContent,exports.DropdownMenuGroup=DropdownMenuGroup,exports.DropdownMenuItem=DropdownMenuItem,exports.DropdownMenuLabel=DropdownMenuLabel,exports.DropdownMenuPortal=DropdownMenuPortal,exports.DropdownMenuRadioGroup=DropdownMenuRadioGroup,exports.DropdownMenuRadioItem=DropdownMenuRadioItem,exports.DropdownMenuSeparator=DropdownMenuSeparator,exports.DropdownMenuShortcut=DropdownMenuShortcut,exports.DropdownMenuSub=DropdownMenuSub,exports.DropdownMenuSubContent=DropdownMenuSubContent,exports.DropdownMenuSubTrigger=DropdownMenuSubTrigger,exports.DropdownMenuTrigger=DropdownMenuTrigger,exports.GeneralDocumentCard=GeneralDocumentCard,exports.Input=Input,exports.InputOTP=InputOTP,exports.InputOTPGroup=InputOTPGroup,exports.InputOTPSeparator=InputOTPSeparator,exports.InputOTPSlot=InputOTPSlot,exports.Label=Label$2,exports.Layout=Layout,exports.ManufacturerCard=ManufacturerCard,exports.ManufacturerReorderingCard=ManufacturerReorderingCard,exports.Navbar=Navbar,exports.PartnerCard=PartnerCard,exports.Preloader=Preloader,exports.ProductCard=ProductCard,exports.ProductImage=ProductImage,exports.ProductInventoryGrid=ProductInventoryGrid,exports.ResellerBillingOverviewCard=ResellerBillingOverviewCard,exports.ResellerCard=ResellerCard,exports.ResellerQualificationsCard=ResellerQualificationsCard,exports.SalesOverviewCard=SalesOverviewCard,exports.ScrollArea=ScrollArea,exports.ScrollBar=ScrollBar,exports.Select=Select,exports.SelectScrollDownButton=SelectScrollDownButton,exports.SelectScrollUpButton=SelectScrollUpButton,exports.Separator=Separator$1,exports.Sheet=Sheet,exports.SheetClose=SheetClose,exports.SheetContent=SheetContent,exports.SheetDescription=SheetDescription,exports.SheetFooter=SheetFooter,exports.SheetHeader=SheetHeader,exports.SheetOverlay=SheetOverlay,exports.SheetPortal=SheetPortal,exports.SheetTitle=SheetTitle,exports.SheetTrigger=SheetTrigger,exports.Sidebar=Sidebar,exports.SidebarContent=SidebarContent,exports.SidebarFooter=SidebarFooter,exports.SidebarGroup=SidebarGroup,exports.SidebarGroupAction=SidebarGroupAction,exports.SidebarGroupContent=SidebarGroupContent,exports.SidebarGroupLabel=SidebarGroupLabel,exports.SidebarHeader=SidebarHeader,exports.SidebarInput=SidebarInput,exports.SidebarInset=SidebarInset,exports.SidebarMenu=SidebarMenu,exports.SidebarMenuAction=SidebarMenuAction,exports.SidebarMenuBadge=SidebarMenuBadge,exports.SidebarMenuButton=SidebarMenuButton,exports.SidebarMenuItem=SidebarMenuItem,exports.SidebarMenuSkeleton=SidebarMenuSkeleton,exports.SidebarMenuSub=SidebarMenuSub,exports.SidebarMenuSubButton=SidebarMenuSubButton,exports.SidebarMenuSubItem=SidebarMenuSubItem,exports.SidebarProvider=SidebarProvider,exports.SidebarRail=SidebarRail,exports.SidebarSeparator=SidebarSeparator,exports.SidebarTrigger=SidebarTrigger,exports.Skeleton=Skeleton,exports.Switch=Switch,exports.Tabs=Tabs,exports.TabsContent=TabsContent,exports.TabsList=TabsList,exports.TabsTrigger=TabsTrigger,exports.Textarea=Textarea,exports.Toast=Toast,exports.ToastAction=ToastAction,exports.ToastClose=ToastClose,exports.ToastDescription=ToastDescription,exports.ToastProvider=ToastProvider,exports.ToastTitle=ToastTitle,exports.ToastViewport=ToastViewport,exports.Toaster=Toaster,exports.Tooltip=Tooltip$1,exports.TooltipContent=TooltipContent,exports.TooltipProvider=TooltipProvider,exports.TooltipTrigger=TooltipTrigger,exports.Topbar=Topbar,exports.badgeVariants=badgeVariants,exports.buttonVariants=buttonVariants,exports.toast=toast,exports.useApiKey=useApiKey,exports.useIsMobile=useIsMobile,exports.useSidebar=useSidebar,exports.useToast=useToast,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
|