recaho-print-react 0.0.148 → 0.0.151

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.
@@ -1,4 +1,4 @@
1
- (function(Ie,ye){typeof exports=="object"&&typeof module<"u"?ye(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],ye):(Ie=typeof globalThis<"u"?globalThis:Ie||self,ye(Ie["recaho-print-react"]={},Ie.React,Ie.ReactDOM))})(this,function(Ie,ye,si){"use strict";function yr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Cs={exports:{}},Jt={};/**
1
+ (function(we,ge){typeof exports=="object"&&typeof module<"u"?ge(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],ge):(we=typeof globalThis<"u"?globalThis:we||self,ge(we["recaho-print-react"]={},we.React,we.ReactDOM))})(this,function(we,ge,si){"use strict";function yr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Cs={exports:{}},Xt={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var gr;function ni(){if(gr)return Jt;gr=1;var e=ye,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function u(f,o,l){var c,h={},p=null,m=null;l!==void 0&&(p=""+l),o.key!==void 0&&(p=""+o.key),o.ref!==void 0&&(m=o.ref);for(c in o)r.call(o,c)&&!a.hasOwnProperty(c)&&(h[c]=o[c]);if(f&&f.defaultProps)for(c in o=f.defaultProps,o)h[c]===void 0&&(h[c]=o[c]);return{$$typeof:t,type:f,key:p,ref:m,props:h,_owner:i.current}}return Jt.Fragment=n,Jt.jsx=u,Jt.jsxs=u,Jt}var Xt={};/**
9
+ */var gr;function ni(){if(gr)return Xt;gr=1;var e=ge,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,l=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(m,u,i){var c,h={},f=null,y=null;i!==void 0&&(f=""+i),u.key!==void 0&&(f=""+u.key),u.ref!==void 0&&(y=u.ref);for(c in u)r.call(u,c)&&!o.hasOwnProperty(c)&&(h[c]=u[c]);if(m&&m.defaultProps)for(c in u=m.defaultProps,u)h[c]===void 0&&(h[c]=u[c]);return{$$typeof:t,type:m,key:f,ref:y,props:h,_owner:l.current}}return Xt.Fragment=n,Xt.jsx=a,Xt.jsxs=a,Xt}var es={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,41 +14,41 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var xr;function ri(){return xr||(xr=1,process.env.NODE_ENV!=="production"&&function(){var e=ye,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),f=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),g=Symbol.iterator,v="@@iterator";function _(x){if(x===null||typeof x!="object")return null;var M=g&&x[g]||x[v];return typeof M=="function"?M:null}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(x){{for(var M=arguments.length,C=new Array(M>1?M-1:0),N=1;N<M;N++)C[N-1]=arguments[N];w("error",x,C)}}function w(x,M,C){{var N=E.ReactDebugCurrentFrame,Y=N.getStackAddendum();Y!==""&&(M+="%s",C=C.concat([Y]));var V=C.map(function(R){return String(R)});V.unshift("Warning: "+M),Function.prototype.apply.call(console[x],console,V)}}var D=!1,$=!1,P=!1,Z=!1,ne=!1,te;te=Symbol.for("react.module.reference");function le(x){return!!(typeof x=="string"||typeof x=="function"||x===r||x===a||ne||x===i||x===l||x===c||Z||x===m||D||$||P||typeof x=="object"&&x!==null&&(x.$$typeof===p||x.$$typeof===h||x.$$typeof===u||x.$$typeof===f||x.$$typeof===o||x.$$typeof===te||x.getModuleId!==void 0))}function Se(x,M,C){var N=x.displayName;if(N)return N;var Y=M.displayName||M.name||"";return Y!==""?C+"("+Y+")":C}function Q(x){return x.displayName||"Context"}function J(x){if(x==null)return null;if(typeof x.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof x=="function")return x.displayName||x.name||null;if(typeof x=="string")return x;switch(x){case r:return"Fragment";case n:return"Portal";case a:return"Profiler";case i:return"StrictMode";case l:return"Suspense";case c:return"SuspenseList"}if(typeof x=="object")switch(x.$$typeof){case f:var M=x;return Q(M)+".Consumer";case u:var C=x;return Q(C._context)+".Provider";case o:return Se(x,x.render,"ForwardRef");case h:var N=x.displayName||null;return N!==null?N:J(x.type)||"Memo";case p:{var Y=x,V=Y._payload,R=Y._init;try{return J(R(V))}catch{return null}}}return null}var z=Object.assign,de=0,G,X,tt,st,Ot,nt,Mt;function ee(){}ee.__reactDisabledLog=!0;function be(){{if(de===0){G=console.log,X=console.info,tt=console.warn,st=console.error,Ot=console.group,nt=console.groupCollapsed,Mt=console.groupEnd;var x={configurable:!0,enumerable:!0,value:ee,writable:!0};Object.defineProperties(console,{info:x,log:x,warn:x,error:x,group:x,groupCollapsed:x,groupEnd:x})}de++}}function pt(){{if(de--,de===0){var x={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:z({},x,{value:G}),info:z({},x,{value:X}),warn:z({},x,{value:tt}),error:z({},x,{value:st}),group:z({},x,{value:Ot}),groupCollapsed:z({},x,{value:nt}),groupEnd:z({},x,{value:Mt})})}de<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var y=E.ReactCurrentDispatcher,d;function O(x,M,C){{if(d===void 0)try{throw Error()}catch(Y){var N=Y.stack.trim().match(/\n( *(at )?)/);d=N&&N[1]||""}return`
18
- `+d+x}}var j=!1,I;{var U=typeof WeakMap=="function"?WeakMap:Map;I=new U}function b(x,M){if(!x||j)return"";{var C=I.get(x);if(C!==void 0)return C}var N;j=!0;var Y=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var V;V=y.current,y.current=null,be();try{if(M){var R=function(){throw Error()};if(Object.defineProperty(R.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(R,[])}catch(ke){N=ke}Reflect.construct(x,[],R)}else{try{R.call()}catch(ke){N=ke}x.call(R.prototype)}}else{try{throw Error()}catch(ke){N=ke}x()}}catch(ke){if(ke&&N&&typeof ke.stack=="string"){for(var T=ke.stack.split(`
19
- `),xe=N.stack.split(`
20
- `),pe=T.length-1,Ne=xe.length-1;pe>=1&&Ne>=0&&T[pe]!==xe[Ne];)Ne--;for(;pe>=1&&Ne>=0;pe--,Ne--)if(T[pe]!==xe[Ne]){if(pe!==1||Ne!==1)do if(pe--,Ne--,Ne<0||T[pe]!==xe[Ne]){var we=`
21
- `+T[pe].replace(" at new "," at ");return x.displayName&&we.includes("<anonymous>")&&(we=we.replace("<anonymous>",x.displayName)),typeof x=="function"&&I.set(x,we),we}while(pe>=1&&Ne>=0);break}}}finally{j=!1,y.current=V,pt(),Error.prepareStackTrace=Y}var Zt=x?x.displayName||x.name:"",Et=Zt?O(Zt):"";return typeof x=="function"&&I.set(x,Et),Et}function F(x,M,C){return b(x,!1)}function W(x){var M=x.prototype;return!!(M&&M.isReactComponent)}function he(x,M,C){if(x==null)return"";if(typeof x=="function")return b(x,W(x));if(typeof x=="string")return O(x);switch(x){case l:return O("Suspense");case c:return O("SuspenseList")}if(typeof x=="object")switch(x.$$typeof){case o:return F(x.render);case h:return he(x.type,M,C);case p:{var N=x,Y=N._payload,V=N._init;try{return he(V(Y),M,C)}catch{}}}return""}var Ae=Object.prototype.hasOwnProperty,He={},Le=E.ReactDebugCurrentFrame;function Oe(x){if(x){var M=x._owner,C=he(x.type,x._source,M?M.type:null);Le.setExtraStackFrame(C)}else Le.setExtraStackFrame(null)}function De(x,M,C,N,Y){{var V=Function.call.bind(Ae);for(var R in x)if(V(x,R)){var T=void 0;try{if(typeof x[R]!="function"){var xe=Error((N||"React class")+": "+C+" type `"+R+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof x[R]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw xe.name="Invariant Violation",xe}T=x[R](M,R,N,C,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(pe){T=pe}T&&!(T instanceof Error)&&(Oe(Y),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",N||"React class",C,R,typeof T),Oe(null)),T instanceof Error&&!(T.message in He)&&(He[T.message]=!0,Oe(Y),S("Failed %s type: %s",C,T.message),Oe(null))}}}var Ke=Array.isArray;function yt(x){return Ke(x)}function K(x){{var M=typeof Symbol=="function"&&Symbol.toStringTag,C=M&&x[Symbol.toStringTag]||x.constructor.name||"Object";return C}}function At(x){try{return rt(x),!1}catch{return!0}}function rt(x){return""+x}function gs(x){if(At(x))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",K(x)),rt(x)}var xs=E.ReactCurrentOwner,an={key:!0,ref:!0,__self:!0,__source:!0},Ns,js;function ln(x){if(Ae.call(x,"ref")){var M=Object.getOwnPropertyDescriptor(x,"ref").get;if(M&&M.isReactWarning)return!1}return x.ref!==void 0}function on(x){if(Ae.call(x,"key")){var M=Object.getOwnPropertyDescriptor(x,"key").get;if(M&&M.isReactWarning)return!1}return x.key!==void 0}function cn(x,M){typeof x.ref=="string"&&xs.current}function dn(x,M){{var C=function(){Ns||(Ns=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",M))};C.isReactWarning=!0,Object.defineProperty(x,"key",{get:C,configurable:!0})}}function hn(x,M){{var C=function(){js||(js=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",M))};C.isReactWarning=!0,Object.defineProperty(x,"ref",{get:C,configurable:!0})}}var un=function(x,M,C,N,Y,V,R){var T={$$typeof:t,type:x,key:M,ref:C,props:R,_owner:V};return T._store={},Object.defineProperty(T._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(T,"_self",{configurable:!1,enumerable:!1,writable:!1,value:N}),Object.defineProperty(T,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Y}),Object.freeze&&(Object.freeze(T.props),Object.freeze(T)),T};function mn(x,M,C,N,Y){{var V,R={},T=null,xe=null;C!==void 0&&(gs(C),T=""+C),on(M)&&(gs(M.key),T=""+M.key),ln(M)&&(xe=M.ref,cn(M,Y));for(V in M)Ae.call(M,V)&&!an.hasOwnProperty(V)&&(R[V]=M[V]);if(x&&x.defaultProps){var pe=x.defaultProps;for(V in pe)R[V]===void 0&&(R[V]=pe[V])}if(T||xe){var Ne=typeof x=="function"?x.displayName||x.name||"Unknown":x;T&&dn(R,Ne),xe&&hn(R,Ne)}return un(x,T,xe,Y,N,xs.current,R)}}var qt=E.ReactCurrentOwner,vs=E.ReactDebugCurrentFrame;function gt(x){if(x){var M=x._owner,C=he(x.type,x._source,M?M.type:null);vs.setExtraStackFrame(C)}else vs.setExtraStackFrame(null)}var Kt;Kt=!1;function Qt(x){return typeof x=="object"&&x!==null&&x.$$typeof===t}function _s(){{if(qt.current){var x=J(qt.current.type);if(x)return`
17
+ */var xr;function ri(){return xr||(xr=1,process.env.NODE_ENV!=="production"&&function(){var e=ge,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),m=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),p=Symbol.iterator,v="@@iterator";function _(x){if(x===null||typeof x!="object")return null;var O=p&&x[p]||x[v];return typeof O=="function"?O:null}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(x){{for(var O=arguments.length,U=new Array(O>1?O-1:0),P=1;P<O;P++)U[P-1]=arguments[P];T("error",x,U)}}function T(x,O,U){{var P=E.ReactDebugCurrentFrame,N=P.getStackAddendum();N!==""&&(O+="%s",U=U.concat([N]));var H=U.map(function(W){return String(W)});H.unshift("Warning: "+O),Function.prototype.apply.call(console[x],console,H)}}var D=!1,$=!1,k=!1,J=!1,re=!1,te;te=Symbol.for("react.module.reference");function de(x){return!!(typeof x=="string"||typeof x=="function"||x===r||x===o||re||x===l||x===i||x===c||J||x===y||D||$||k||typeof x=="object"&&x!==null&&(x.$$typeof===f||x.$$typeof===h||x.$$typeof===a||x.$$typeof===m||x.$$typeof===u||x.$$typeof===te||x.getModuleId!==void 0))}function be(x,O,U){var P=x.displayName;if(P)return P;var N=O.displayName||O.name||"";return N!==""?U+"("+N+")":U}function Z(x){return x.displayName||"Context"}function X(x){if(x==null)return null;if(typeof x.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof x=="function")return x.displayName||x.name||null;if(typeof x=="string")return x;switch(x){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case l:return"StrictMode";case i:return"Suspense";case c:return"SuspenseList"}if(typeof x=="object")switch(x.$$typeof){case m:var O=x;return Z(O)+".Consumer";case a:var U=x;return Z(U._context)+".Provider";case u:return be(x,x.render,"ForwardRef");case h:var P=x.displayName||null;return P!==null?P:X(x.type)||"Memo";case f:{var N=x,H=N._payload,W=N._init;try{return X(W(H))}catch{return null}}}return null}var q=Object.assign,ue=0,z,ee,De,nt,At,pt,Et;function se(){}se.__reactDisabledLog=!0;function Se(){{if(ue===0){z=console.log,ee=console.info,De=console.warn,nt=console.error,At=console.group,pt=console.groupCollapsed,Et=console.groupEnd;var x={configurable:!0,enumerable:!0,value:se,writable:!0};Object.defineProperties(console,{info:x,log:x,warn:x,error:x,group:x,groupCollapsed:x,groupEnd:x})}ue++}}function yt(){{if(ue--,ue===0){var x={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:q({},x,{value:z}),info:q({},x,{value:ee}),warn:q({},x,{value:De}),error:q({},x,{value:nt}),group:q({},x,{value:At}),groupCollapsed:q({},x,{value:pt}),groupEnd:q({},x,{value:Et})})}ue<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ke=E.ReactCurrentDispatcher,g;function d(x,O,U){{if(g===void 0)try{throw Error()}catch(N){var P=N.stack.trim().match(/\n( *(at )?)/);g=P&&P[1]||""}return`
18
+ `+g+x}}var C=!1,j;{var w=typeof WeakMap=="function"?WeakMap:Map;j=new w}function Y(x,O){if(!x||C)return"";{var U=j.get(x);if(U!==void 0)return U}var P;C=!0;var N=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var H;H=Ke.current,Ke.current=null,Se();try{if(O){var W=function(){throw Error()};if(Object.defineProperty(W.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(W,[])}catch(ke){P=ke}Reflect.construct(x,[],W)}else{try{W.call()}catch(ke){P=ke}x.call(W.prototype)}}else{try{throw Error()}catch(ke){P=ke}x()}}catch(ke){if(ke&&P&&typeof ke.stack=="string"){for(var A=ke.stack.split(`
19
+ `),I=P.stack.split(`
20
+ `),he=A.length-1,Ne=I.length-1;he>=1&&Ne>=0&&A[he]!==I[Ne];)Ne--;for(;he>=1&&Ne>=0;he--,Ne--)if(A[he]!==I[Ne]){if(he!==1||Ne!==1)do if(he--,Ne--,Ne<0||A[he]!==I[Ne]){var Ae=`
21
+ `+A[he].replace(" at new "," at ");return x.displayName&&Ae.includes("<anonymous>")&&(Ae=Ae.replace("<anonymous>",x.displayName)),typeof x=="function"&&j.set(x,Ae),Ae}while(he>=1&&Ne>=0);break}}}finally{C=!1,Ke.current=H,yt(),Error.prepareStackTrace=N}var Ze=x?x.displayName||x.name:"",Lt=Ze?d(Ze):"";return typeof x=="function"&&j.set(x,Lt),Lt}function b(x,O,U){return Y(x,!1)}function F(x){var O=x.prototype;return!!(O&&O.isReactComponent)}function V(x,O,U){if(x==null)return"";if(typeof x=="function")return Y(x,F(x));if(typeof x=="string")return d(x);switch(x){case i:return d("Suspense");case c:return d("SuspenseList")}if(typeof x=="object")switch(x.$$typeof){case u:return b(x.render);case h:return V(x.type,O,U);case f:{var P=x,N=P._payload,H=P._init;try{return V(H(N),O,U)}catch{}}}return""}var fe=Object.prototype.hasOwnProperty,Me={},Le=E.ReactDebugCurrentFrame;function Ce(x){if(x){var O=x._owner,U=V(x.type,x._source,O?O.type:null);Le.setExtraStackFrame(U)}else Le.setExtraStackFrame(null)}function Ye(x,O,U,P,N){{var H=Function.call.bind(fe);for(var W in x)if(H(x,W)){var A=void 0;try{if(typeof x[W]!="function"){var I=Error((P||"React class")+": "+U+" type `"+W+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof x[W]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw I.name="Invariant Violation",I}A=x[W](O,W,P,U,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(he){A=he}A&&!(A instanceof Error)&&(Ce(N),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",P||"React class",U,W,typeof A),Ce(null)),A instanceof Error&&!(A.message in Me)&&(Me[A.message]=!0,Ce(N),S("Failed %s type: %s",U,A.message),Ce(null))}}}var Qe=Array.isArray;function gt(x){return Qe(x)}function Rt(x){{var O=typeof Symbol=="function"&&Symbol.toStringTag,U=O&&x[Symbol.toStringTag]||x.constructor.name||"Object";return U}}function Q(x){try{return St(x),!1}catch{return!0}}function St(x){return""+x}function rt(x){if(Q(x))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Rt(x)),St(x)}var xs=E.ReactCurrentOwner,an={key:!0,ref:!0,__self:!0,__source:!0},Ns,js;function ln(x){if(fe.call(x,"ref")){var O=Object.getOwnPropertyDescriptor(x,"ref").get;if(O&&O.isReactWarning)return!1}return x.ref!==void 0}function on(x){if(fe.call(x,"key")){var O=Object.getOwnPropertyDescriptor(x,"key").get;if(O&&O.isReactWarning)return!1}return x.key!==void 0}function cn(x,O){typeof x.ref=="string"&&xs.current}function dn(x,O){{var U=function(){Ns||(Ns=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",O))};U.isReactWarning=!0,Object.defineProperty(x,"key",{get:U,configurable:!0})}}function hn(x,O){{var U=function(){js||(js=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",O))};U.isReactWarning=!0,Object.defineProperty(x,"ref",{get:U,configurable:!0})}}var un=function(x,O,U,P,N,H,W){var A={$$typeof:t,type:x,key:O,ref:U,props:W,_owner:H};return A._store={},Object.defineProperty(A._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(A,"_self",{configurable:!1,enumerable:!1,writable:!1,value:P}),Object.defineProperty(A,"_source",{configurable:!1,enumerable:!1,writable:!1,value:N}),Object.freeze&&(Object.freeze(A.props),Object.freeze(A)),A};function mn(x,O,U,P,N){{var H,W={},A=null,I=null;U!==void 0&&(rt(U),A=""+U),on(O)&&(rt(O.key),A=""+O.key),ln(O)&&(I=O.ref,cn(O,N));for(H in O)fe.call(O,H)&&!an.hasOwnProperty(H)&&(W[H]=O[H]);if(x&&x.defaultProps){var he=x.defaultProps;for(H in he)W[H]===void 0&&(W[H]=he[H])}if(A||I){var Ne=typeof x=="function"?x.displayName||x.name||"Unknown":x;A&&dn(W,Ne),I&&hn(W,Ne)}return un(x,A,I,N,P,xs.current,W)}}var Qt=E.ReactCurrentOwner,vs=E.ReactDebugCurrentFrame;function xt(x){if(x){var O=x._owner,U=V(x.type,x._source,O?O.type:null);vs.setExtraStackFrame(U)}else vs.setExtraStackFrame(null)}var Zt;Zt=!1;function Jt(x){return typeof x=="object"&&x!==null&&x.$$typeof===t}function _s(){{if(Qt.current){var x=X(Qt.current.type);if(x)return`
22
22
 
23
- Check the render method of \``+x+"`."}return""}}function fn(x){return""}var bs={};function pn(x){{var M=_s();if(!M){var C=typeof x=="string"?x:x.displayName||x.name;C&&(M=`
23
+ Check the render method of \``+x+"`."}return""}}function fn(x){return""}var bs={};function pn(x){{var O=_s();if(!O){var U=typeof x=="string"?x:x.displayName||x.name;U&&(O=`
24
24
 
25
- Check the top-level render call using <`+C+">.")}return M}}function Ss(x,M){{if(!x._store||x._store.validated||x.key!=null)return;x._store.validated=!0;var C=pn(M);if(bs[C])return;bs[C]=!0;var N="";x&&x._owner&&x._owner!==qt.current&&(N=" It was passed a child from "+J(x._owner.type)+"."),gt(x),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',C,N),gt(null)}}function Ts(x,M){{if(typeof x!="object")return;if(yt(x))for(var C=0;C<x.length;C++){var N=x[C];Qt(N)&&Ss(N,M)}else if(Qt(x))x._store&&(x._store.validated=!0);else if(x){var Y=_(x);if(typeof Y=="function"&&Y!==x.entries)for(var V=Y.call(x),R;!(R=V.next()).done;)Qt(R.value)&&Ss(R.value,M)}}}function yn(x){{var M=x.type;if(M==null||typeof M=="string")return;var C;if(typeof M=="function")C=M.propTypes;else if(typeof M=="object"&&(M.$$typeof===o||M.$$typeof===h))C=M.propTypes;else return;if(C){var N=J(M);De(C,x.props,"prop",N,x)}else if(M.PropTypes!==void 0&&!Kt){Kt=!0;var Y=J(M);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Y||"Unknown")}typeof M.getDefaultProps=="function"&&!M.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function gn(x){{for(var M=Object.keys(x.props),C=0;C<M.length;C++){var N=M[C];if(N!=="children"&&N!=="key"){gt(x),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",N),gt(null);break}}x.ref!==null&&(gt(x),S("Invalid attribute `ref` supplied to `React.Fragment`."),gt(null))}}var ws={};function Is(x,M,C,N,Y,V){{var R=le(x);if(!R){var T="";(x===void 0||typeof x=="object"&&x!==null&&Object.keys(x).length===0)&&(T+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var xe=fn();xe?T+=xe:T+=_s();var pe;x===null?pe="null":yt(x)?pe="array":x!==void 0&&x.$$typeof===t?(pe="<"+(J(x.type)||"Unknown")+" />",T=" Did you accidentally export a JSX literal instead of a component?"):pe=typeof x,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",pe,T)}var Ne=mn(x,M,C,Y,V);if(Ne==null)return Ne;if(R){var we=M.children;if(we!==void 0)if(N)if(yt(we)){for(var Zt=0;Zt<we.length;Zt++)Ts(we[Zt],x);Object.freeze&&Object.freeze(we)}else S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ts(we,x)}if(Ae.call(M,"key")){var Et=J(x),ke=Object.keys(M).filter(function($h){return $h!=="key"}),pr=ke.length>0?"{key: someKey, "+ke.join(": ..., ")+": ...}":"{key: someKey}";if(!ws[Et+pr]){var Uh=ke.length>0?"{"+ke.join(": ..., ")+": ...}":"{}";S(`A props object containing a "key" prop is being spread into JSX:
25
+ Check the top-level render call using <`+U+">.")}return O}}function Ss(x,O){{if(!x._store||x._store.validated||x.key!=null)return;x._store.validated=!0;var U=pn(O);if(bs[U])return;bs[U]=!0;var P="";x&&x._owner&&x._owner!==Qt.current&&(P=" It was passed a child from "+X(x._owner.type)+"."),xt(x),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',U,P),xt(null)}}function Ts(x,O){{if(typeof x!="object")return;if(gt(x))for(var U=0;U<x.length;U++){var P=x[U];Jt(P)&&Ss(P,O)}else if(Jt(x))x._store&&(x._store.validated=!0);else if(x){var N=_(x);if(typeof N=="function"&&N!==x.entries)for(var H=N.call(x),W;!(W=H.next()).done;)Jt(W.value)&&Ss(W.value,O)}}}function yn(x){{var O=x.type;if(O==null||typeof O=="string")return;var U;if(typeof O=="function")U=O.propTypes;else if(typeof O=="object"&&(O.$$typeof===u||O.$$typeof===h))U=O.propTypes;else return;if(U){var P=X(O);Ye(U,x.props,"prop",P,x)}else if(O.PropTypes!==void 0&&!Zt){Zt=!0;var N=X(O);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",N||"Unknown")}typeof O.getDefaultProps=="function"&&!O.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function gn(x){{for(var O=Object.keys(x.props),U=0;U<O.length;U++){var P=O[U];if(P!=="children"&&P!=="key"){xt(x),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",P),xt(null);break}}x.ref!==null&&(xt(x),S("Invalid attribute `ref` supplied to `React.Fragment`."),xt(null))}}var ws={};function Is(x,O,U,P,N,H){{var W=de(x);if(!W){var A="";(x===void 0||typeof x=="object"&&x!==null&&Object.keys(x).length===0)&&(A+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var I=fn();I?A+=I:A+=_s();var he;x===null?he="null":gt(x)?he="array":x!==void 0&&x.$$typeof===t?(he="<"+(X(x.type)||"Unknown")+" />",A=" Did you accidentally export a JSX literal instead of a component?"):he=typeof x,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",he,A)}var Ne=mn(x,O,U,N,H);if(Ne==null)return Ne;if(W){var Ae=O.children;if(Ae!==void 0)if(P)if(gt(Ae)){for(var Ze=0;Ze<Ae.length;Ze++)Ts(Ae[Ze],x);Object.freeze&&Object.freeze(Ae)}else S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ts(Ae,x)}if(fe.call(O,"key")){var Lt=X(x),ke=Object.keys(O).filter(function($h){return $h!=="key"}),pr=ke.length>0?"{key: someKey, "+ke.join(": ..., ")+": ...}":"{key: someKey}";if(!ws[Lt+pr]){var Uh=ke.length>0?"{"+ke.join(": ..., ")+": ...}":"{}";S(`A props object containing a "key" prop is being spread into JSX:
26
26
  let props = %s;
27
27
  <%s {...props} />
28
28
  React keys must be passed directly to JSX without using spread:
29
29
  let props = %s;
30
- <%s key={someKey} {...props} />`,pr,Et,Uh,Et),ws[Et+pr]=!0}}return x===r?gn(Ne):yn(Ne),Ne}}function xn(x,M,C){return Is(x,M,C,!0)}function Nn(x,M,C){return Is(x,M,C,!1)}var jn=Nn,vn=xn;Xt.Fragment=r,Xt.jsx=jn,Xt.jsxs=vn}()),Xt}var Nr;function ai(){return Nr||(Nr=1,process.env.NODE_ENV==="production"?Cs.exports=ni():Cs.exports=ri()),Cs.exports}var s=ai(),Rt={},jr;function ii(){if(jr)return Rt;jr=1;var e=si;if(process.env.NODE_ENV==="production")Rt.createRoot=e.createRoot,Rt.hydrateRoot=e.hydrateRoot;else{var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Rt.createRoot=function(n,r){t.usingClientEntryPoint=!0;try{return e.createRoot(n,r)}finally{t.usingClientEntryPoint=!1}},Rt.hydrateRoot=function(n,r,i){t.usingClientEntryPoint=!0;try{return e.hydrateRoot(n,r,i)}finally{t.usingClientEntryPoint=!1}}}return Rt}var li=ii();const vr=yr(li),es=e=>e.replace(/\-/g," ").replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase());//! moment.js
30
+ <%s key={someKey} {...props} />`,pr,Lt,Uh,Lt),ws[Lt+pr]=!0}}return x===r?gn(Ne):yn(Ne),Ne}}function xn(x,O,U){return Is(x,O,U,!0)}function Nn(x,O,U){return Is(x,O,U,!1)}var jn=Nn,vn=xn;es.Fragment=r,es.jsx=jn,es.jsxs=vn}()),es}var Nr;function ai(){return Nr||(Nr=1,process.env.NODE_ENV==="production"?Cs.exports=ni():Cs.exports=ri()),Cs.exports}var s=ai(),kt={},jr;function ii(){if(jr)return kt;jr=1;var e=si;if(process.env.NODE_ENV==="production")kt.createRoot=e.createRoot,kt.hydrateRoot=e.hydrateRoot;else{var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;kt.createRoot=function(n,r){t.usingClientEntryPoint=!0;try{return e.createRoot(n,r)}finally{t.usingClientEntryPoint=!1}},kt.hydrateRoot=function(n,r,l){t.usingClientEntryPoint=!0;try{return e.hydrateRoot(n,r,l)}finally{t.usingClientEntryPoint=!1}}}return kt}var li=ii();const vr=yr(li),ts=e=>e.replace(/\-/g," ").replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase());//! moment.js
31
31
  //! version : 2.30.1
32
32
  //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
33
33
  //! license : MIT
34
34
  //! momentjs.com
35
- var _r;function L(){return _r.apply(null,arguments)}function oi(e){_r=e}function Be(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function bt(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function oe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _n(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(oe(e,t))return!1;return!0}function Ee(e){return e===void 0}function at(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function ts(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function br(e,t){var n=[],r,i=e.length;for(r=0;r<i;++r)n.push(t(e[r],r));return n}function xt(e,t){for(var n in t)oe(t,n)&&(e[n]=t[n]);return oe(t,"toString")&&(e.toString=t.toString),oe(t,"valueOf")&&(e.valueOf=t.valueOf),e}function Qe(e,t,n,r){return Qr(e,t,n,r,!0).utc()}function ci(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function se(e){return e._pf==null&&(e._pf=ci()),e._pf}var bn;Array.prototype.some?bn=Array.prototype.some:bn=function(e){var t=Object(this),n=t.length>>>0,r;for(r=0;r<n;r++)if(r in t&&e.call(this,t[r],r,t))return!0;return!1};function Sn(e){var t=null,n=!1,r=e._d&&!isNaN(e._d.getTime());if(r&&(t=se(e),n=bn.call(t.parsedDateParts,function(i){return i!=null}),r=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),e._strict&&(r=r&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(e))e._isValid=r;else return r;return e._isValid}function Os(e){var t=Qe(NaN);return e!=null?xt(se(t),e):se(t).userInvalidated=!0,t}var Sr=L.momentProperties=[],Tn=!1;function wn(e,t){var n,r,i,a=Sr.length;if(Ee(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),Ee(t._i)||(e._i=t._i),Ee(t._f)||(e._f=t._f),Ee(t._l)||(e._l=t._l),Ee(t._strict)||(e._strict=t._strict),Ee(t._tzm)||(e._tzm=t._tzm),Ee(t._isUTC)||(e._isUTC=t._isUTC),Ee(t._offset)||(e._offset=t._offset),Ee(t._pf)||(e._pf=se(t)),Ee(t._locale)||(e._locale=t._locale),a>0)for(n=0;n<a;n++)r=Sr[n],i=t[r],Ee(i)||(e[r]=i);return e}function ss(e){wn(this,e),this._d=new Date(e._d!=null?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Tn===!1&&(Tn=!0,L.updateOffset(this),Tn=!1)}function Ge(e){return e instanceof ss||e!=null&&e._isAMomentObject!=null}function Tr(e){L.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+e)}function Ye(e,t){var n=!0;return xt(function(){if(L.deprecationHandler!=null&&L.deprecationHandler(null,e),n){var r=[],i,a,u,f=arguments.length;for(a=0;a<f;a++){if(i="",typeof arguments[a]=="object"){i+=`
36
- [`+a+"] ";for(u in arguments[0])oe(arguments[0],u)&&(i+=u+": "+arguments[0][u]+", ");i=i.slice(0,-2)}else i=arguments[a];r.push(i)}Tr(e+`
35
+ var _r;function R(){return _r.apply(null,arguments)}function oi(e){_r=e}function Be(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function Tt(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function oe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _n(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(oe(e,t))return!1;return!0}function Ee(e){return e===void 0}function at(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function ss(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function br(e,t){var n=[],r,l=e.length;for(r=0;r<l;++r)n.push(t(e[r],r));return n}function Nt(e,t){for(var n in t)oe(t,n)&&(e[n]=t[n]);return oe(t,"toString")&&(e.toString=t.toString),oe(t,"valueOf")&&(e.valueOf=t.valueOf),e}function Je(e,t,n,r){return Qr(e,t,n,r,!0).utc()}function ci(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function ne(e){return e._pf==null&&(e._pf=ci()),e._pf}var bn;Array.prototype.some?bn=Array.prototype.some:bn=function(e){var t=Object(this),n=t.length>>>0,r;for(r=0;r<n;r++)if(r in t&&e.call(this,t[r],r,t))return!0;return!1};function Sn(e){var t=null,n=!1,r=e._d&&!isNaN(e._d.getTime());if(r&&(t=ne(e),n=bn.call(t.parsedDateParts,function(l){return l!=null}),r=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),e._strict&&(r=r&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(e))e._isValid=r;else return r;return e._isValid}function Os(e){var t=Je(NaN);return e!=null?Nt(ne(t),e):ne(t).userInvalidated=!0,t}var Sr=R.momentProperties=[],Tn=!1;function wn(e,t){var n,r,l,o=Sr.length;if(Ee(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),Ee(t._i)||(e._i=t._i),Ee(t._f)||(e._f=t._f),Ee(t._l)||(e._l=t._l),Ee(t._strict)||(e._strict=t._strict),Ee(t._tzm)||(e._tzm=t._tzm),Ee(t._isUTC)||(e._isUTC=t._isUTC),Ee(t._offset)||(e._offset=t._offset),Ee(t._pf)||(e._pf=ne(t)),Ee(t._locale)||(e._locale=t._locale),o>0)for(n=0;n<o;n++)r=Sr[n],l=t[r],Ee(l)||(e[r]=l);return e}function ns(e){wn(this,e),this._d=new Date(e._d!=null?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Tn===!1&&(Tn=!0,R.updateOffset(this),Tn=!1)}function Ge(e){return e instanceof ns||e!=null&&e._isAMomentObject!=null}function Tr(e){R.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+e)}function Ue(e,t){var n=!0;return Nt(function(){if(R.deprecationHandler!=null&&R.deprecationHandler(null,e),n){var r=[],l,o,a,m=arguments.length;for(o=0;o<m;o++){if(l="",typeof arguments[o]=="object"){l+=`
36
+ [`+o+"] ";for(a in arguments[0])oe(arguments[0],a)&&(l+=a+": "+arguments[0][a]+", ");l=l.slice(0,-2)}else l=arguments[o];r.push(l)}Tr(e+`
37
37
  Arguments: `+Array.prototype.slice.call(r).join("")+`
38
- `+new Error().stack),n=!1}return t.apply(this,arguments)},t)}var wr={};function Ir(e,t){L.deprecationHandler!=null&&L.deprecationHandler(e,t),wr[e]||(Tr(t),wr[e]=!0)}L.suppressDeprecationWarnings=!1,L.deprecationHandler=null;function Ze(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function di(e){var t,n;for(n in e)oe(e,n)&&(t=e[n],Ze(t)?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function In(e,t){var n=xt({},e),r;for(r in t)oe(t,r)&&(bt(e[r])&&bt(t[r])?(n[r]={},xt(n[r],e[r]),xt(n[r],t[r])):t[r]!=null?n[r]=t[r]:delete n[r]);for(r in e)oe(e,r)&&!oe(t,r)&&bt(e[r])&&(n[r]=xt({},n[r]));return n}function Cn(e){e!=null&&this.set(e)}var On;Object.keys?On=Object.keys:On=function(e){var t,n=[];for(t in e)oe(e,t)&&n.push(t);return n};var hi={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function ui(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return Ze(r)?r.call(t,n):r}function Je(e,t,n){var r=""+Math.abs(e),i=t-r.length,a=e>=0;return(a?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var Mn=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Ms=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,An={},Lt={};function q(e,t,n,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),e&&(Lt[e]=i),t&&(Lt[t[0]]=function(){return Je(i.apply(this,arguments),t[1],t[2])}),n&&(Lt[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function mi(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function fi(e){var t=e.match(Mn),n,r;for(n=0,r=t.length;n<r;n++)Lt[t[n]]?t[n]=Lt[t[n]]:t[n]=mi(t[n]);return function(i){var a="",u;for(u=0;u<r;u++)a+=Ze(t[u])?t[u].call(i,e):t[u];return a}}function As(e,t){return e.isValid()?(t=Cr(t,e.localeData()),An[t]=An[t]||fi(t),An[t](e)):e.localeData().invalidDate()}function Cr(e,t){var n=5;function r(i){return t.longDateFormat(i)||i}for(Ms.lastIndex=0;n>=0&&Ms.test(e);)e=e.replace(Ms,r),Ms.lastIndex=0,n-=1;return e}var pi={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function yi(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(Mn).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[e])}var gi="Invalid date";function xi(){return this._invalidDate}var Ni="%d",ji=/\d{1,2}/;function vi(e){return this._ordinal.replace("%d",e)}var _i={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function bi(e,t,n,r){var i=this._relativeTime[n];return Ze(i)?i(e,t,n,r):i.replace(/%d/i,e)}function Si(e,t){var n=this._relativeTime[e>0?"future":"past"];return Ze(n)?n(t):n.replace(/%s/i,t)}var Or={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Ue(e){return typeof e=="string"?Or[e]||Or[e.toLowerCase()]:void 0}function En(e){var t={},n,r;for(r in e)oe(e,r)&&(n=Ue(r),n&&(t[n]=e[r]));return t}var Ti={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function wi(e){var t=[],n;for(n in e)oe(e,n)&&t.push({unit:n,priority:Ti[n]});return t.sort(function(r,i){return r.priority-i.priority}),t}var Mr=/\d/,Pe=/\d\d/,Ar=/\d{3}/,Rn=/\d{4}/,Es=/[+-]?\d{6}/,me=/\d\d?/,Er=/\d\d\d\d?/,Rr=/\d\d\d\d\d\d?/,Rs=/\d{1,3}/,Ln=/\d{1,4}/,Ls=/[+-]?\d{1,6}/,kt=/\d+/,ks=/[+-]?\d+/,Ii=/Z|[+-]\d\d:?\d\d/gi,Ps=/Z|[+-]\d\d(?::?\d\d)?/gi,Ci=/[+-]?\d+(\.\d{1,3})?/,ns=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Pt=/^[1-9]\d?/,kn=/^([1-9]\d|\d)/,Fs;Fs={};function H(e,t,n){Fs[e]=Ze(t)?t:function(r,i){return r&&n?n:t}}function Oi(e,t){return oe(Fs,e)?Fs[e](t._strict,t._locale):new RegExp(Mi(e))}function Mi(e){return it(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,r,i,a){return n||r||i||a}))}function it(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function $e(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function re(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=$e(t)),n}var Pn={};function ue(e,t){var n,r=t,i;for(typeof e=="string"&&(e=[e]),at(t)&&(r=function(a,u){u[t]=re(a)}),i=e.length,n=0;n<i;n++)Pn[e[n]]=r}function rs(e,t){ue(e,function(n,r,i,a){i._w=i._w||{},t(n,i._w,i,a)})}function Ai(e,t,n){t!=null&&oe(Pn,e)&&Pn[e](t,n._a,n,e)}function Ds(e){return e%4===0&&e%100!==0||e%400===0}var Ce=0,lt=1,Xe=2,Te=3,We=4,ot=5,St=6,Ei=7,Ri=8;q("Y",0,0,function(){var e=this.year();return e<=9999?Je(e,4):"+"+e}),q(0,["YY",2],0,function(){return this.year()%100}),q(0,["YYYY",4],0,"year"),q(0,["YYYYY",5],0,"year"),q(0,["YYYYYY",6,!0],0,"year"),H("Y",ks),H("YY",me,Pe),H("YYYY",Ln,Rn),H("YYYYY",Ls,Es),H("YYYYYY",Ls,Es),ue(["YYYYY","YYYYYY"],Ce),ue("YYYY",function(e,t){t[Ce]=e.length===2?L.parseTwoDigitYear(e):re(e)}),ue("YY",function(e,t){t[Ce]=L.parseTwoDigitYear(e)}),ue("Y",function(e,t){t[Ce]=parseInt(e,10)});function as(e){return Ds(e)?366:365}L.parseTwoDigitYear=function(e){return re(e)+(re(e)>68?1900:2e3)};var Lr=Ft("FullYear",!0);function Li(){return Ds(this.year())}function Ft(e,t){return function(n){return n!=null?(kr(this,e,n),L.updateOffset(this,t),this):is(this,e)}}function is(e,t){if(!e.isValid())return NaN;var n=e._d,r=e._isUTC;switch(t){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function kr(e,t,n){var r,i,a,u,f;if(!(!e.isValid()||isNaN(n))){switch(r=e._d,i=e._isUTC,t){case"Milliseconds":return void(i?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(i?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(i?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(i?r.setUTCHours(n):r.setHours(n));case"Date":return void(i?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}a=n,u=e.month(),f=e.date(),f=f===29&&u===1&&!Ds(a)?28:f,i?r.setUTCFullYear(a,u,f):r.setFullYear(a,u,f)}}function ki(e){return e=Ue(e),Ze(this[e])?this[e]():this}function Pi(e,t){if(typeof e=="object"){e=En(e);var n=wi(e),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](e[n[r].unit])}else if(e=Ue(e),Ze(this[e]))return this[e](t);return this}function Fi(e,t){return(e%t+t)%t}var je;Array.prototype.indexOf?je=Array.prototype.indexOf:je=function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function Fn(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=Fi(t,12);return e+=(t-n)/12,n===1?Ds(e)?29:28:31-n%7%2}q("M",["MM",2],"Mo",function(){return this.month()+1}),q("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),q("MMMM",0,0,function(e){return this.localeData().months(this,e)}),H("M",me,Pt),H("MM",me,Pe),H("MMM",function(e,t){return t.monthsShortRegex(e)}),H("MMMM",function(e,t){return t.monthsRegex(e)}),ue(["M","MM"],function(e,t){t[lt]=re(e)-1}),ue(["MMM","MMMM"],function(e,t,n,r){var i=n._locale.monthsParse(e,r,n._strict);i!=null?t[lt]=i:se(n).invalidMonth=e});var Di="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Pr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Fr=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Yi=ns,Ui=ns;function $i(e,t){return e?Be(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Fr).test(t)?"format":"standalone"][e.month()]:Be(this._months)?this._months:this._months.standalone}function Hi(e,t){return e?Be(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Fr.test(t)?"format":"standalone"][e.month()]:Be(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Bi(e,t,n){var r,i,a,u=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)a=Qe([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(a,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(a,"").toLocaleLowerCase();return n?t==="MMM"?(i=je.call(this._shortMonthsParse,u),i!==-1?i:null):(i=je.call(this._longMonthsParse,u),i!==-1?i:null):t==="MMM"?(i=je.call(this._shortMonthsParse,u),i!==-1?i:(i=je.call(this._longMonthsParse,u),i!==-1?i:null)):(i=je.call(this._longMonthsParse,u),i!==-1?i:(i=je.call(this._shortMonthsParse,u),i!==-1?i:null))}function Gi(e,t,n){var r,i,a;if(this._monthsParseExact)return Bi.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=Qe([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!n&&!this._monthsParse[r]&&(a="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(a.replace(".",""),"i")),n&&t==="MMMM"&&this._longMonthsParse[r].test(e))return r;if(n&&t==="MMM"&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}}function Dr(e,t){if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=re(t);else if(t=e.localeData().monthsParse(t),!at(t))return e}var n=t,r=e.date();return r=r<29?r:Math.min(r,Fn(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,r):e._d.setMonth(n,r),e}function Yr(e){return e!=null?(Dr(this,e),L.updateOffset(this,!0),this):is(this,"Month")}function Wi(){return Fn(this.year(),this.month())}function zi(e){return this._monthsParseExact?(oe(this,"_monthsRegex")||Ur.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(oe(this,"_monthsShortRegex")||(this._monthsShortRegex=Yi),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function Vi(e){return this._monthsParseExact?(oe(this,"_monthsRegex")||Ur.call(this),e?this._monthsStrictRegex:this._monthsRegex):(oe(this,"_monthsRegex")||(this._monthsRegex=Ui),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function Ur(){function e(o,l){return l.length-o.length}var t=[],n=[],r=[],i,a,u,f;for(i=0;i<12;i++)a=Qe([2e3,i]),u=it(this.monthsShort(a,"")),f=it(this.months(a,"")),t.push(u),n.push(f),r.push(f),r.push(u);t.sort(e),n.sort(e),r.sort(e),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function qi(e,t,n,r,i,a,u){var f;return e<100&&e>=0?(f=new Date(e+400,t,n,r,i,a,u),isFinite(f.getFullYear())&&f.setFullYear(e)):f=new Date(e,t,n,r,i,a,u),f}function ls(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Ys(e,t,n){var r=7+t-n,i=(7+ls(e,0,r).getUTCDay()-t)%7;return-i+r-1}function $r(e,t,n,r,i){var a=(7+n-r)%7,u=Ys(e,r,i),f=1+7*(t-1)+a+u,o,l;return f<=0?(o=e-1,l=as(o)+f):f>as(e)?(o=e+1,l=f-as(e)):(o=e,l=f),{year:o,dayOfYear:l}}function os(e,t,n){var r=Ys(e.year(),t,n),i=Math.floor((e.dayOfYear()-r-1)/7)+1,a,u;return i<1?(u=e.year()-1,a=i+ct(u,t,n)):i>ct(e.year(),t,n)?(a=i-ct(e.year(),t,n),u=e.year()+1):(u=e.year(),a=i),{week:a,year:u}}function ct(e,t,n){var r=Ys(e,t,n),i=Ys(e+1,t,n);return(as(e)-r+i)/7}q("w",["ww",2],"wo","week"),q("W",["WW",2],"Wo","isoWeek"),H("w",me,Pt),H("ww",me,Pe),H("W",me,Pt),H("WW",me,Pe),rs(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=re(e)});function Ki(e){return os(e,this._week.dow,this._week.doy).week}var Qi={dow:0,doy:6};function Zi(){return this._week.dow}function Ji(){return this._week.doy}function Xi(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function el(e){var t=os(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}q("d",0,"do","day"),q("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),q("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),q("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),q("e",0,0,"weekday"),q("E",0,0,"isoWeekday"),H("d",me),H("e",me),H("E",me),H("dd",function(e,t){return t.weekdaysMinRegex(e)}),H("ddd",function(e,t){return t.weekdaysShortRegex(e)}),H("dddd",function(e,t){return t.weekdaysRegex(e)}),rs(["dd","ddd","dddd"],function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);i!=null?t.d=i:se(n).invalidWeekday=e}),rs(["d","e","E"],function(e,t,n,r){t[r]=re(e)});function tl(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function sl(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Dn(e,t){return e.slice(t,7).concat(e.slice(0,t))}var nl="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Hr="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),rl="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),al=ns,il=ns,ll=ns;function ol(e,t){var n=Be(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Dn(n,this._week.dow):e?n[e.day()]:n}function cl(e){return e===!0?Dn(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function dl(e){return e===!0?Dn(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function hl(e,t,n){var r,i,a,u=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)a=Qe([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(a,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(a,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(a,"").toLocaleLowerCase();return n?t==="dddd"?(i=je.call(this._weekdaysParse,u),i!==-1?i:null):t==="ddd"?(i=je.call(this._shortWeekdaysParse,u),i!==-1?i:null):(i=je.call(this._minWeekdaysParse,u),i!==-1?i:null):t==="dddd"?(i=je.call(this._weekdaysParse,u),i!==-1||(i=je.call(this._shortWeekdaysParse,u),i!==-1)?i:(i=je.call(this._minWeekdaysParse,u),i!==-1?i:null)):t==="ddd"?(i=je.call(this._shortWeekdaysParse,u),i!==-1||(i=je.call(this._weekdaysParse,u),i!==-1)?i:(i=je.call(this._minWeekdaysParse,u),i!==-1?i:null)):(i=je.call(this._minWeekdaysParse,u),i!==-1||(i=je.call(this._weekdaysParse,u),i!==-1)?i:(i=je.call(this._shortWeekdaysParse,u),i!==-1?i:null))}function ul(e,t,n){var r,i,a;if(this._weekdaysParseExact)return hl.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=Qe([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(a="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(a.replace(".",""),"i")),n&&t==="dddd"&&this._fullWeekdaysParse[r].test(e))return r;if(n&&t==="ddd"&&this._shortWeekdaysParse[r].test(e))return r;if(n&&t==="dd"&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function ml(e){if(!this.isValid())return e!=null?this:NaN;var t=is(this,"Day");return e!=null?(e=tl(e,this.localeData()),this.add(e-t,"d")):t}function fl(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function pl(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=sl(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function yl(e){return this._weekdaysParseExact?(oe(this,"_weekdaysRegex")||Yn.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(oe(this,"_weekdaysRegex")||(this._weekdaysRegex=al),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function gl(e){return this._weekdaysParseExact?(oe(this,"_weekdaysRegex")||Yn.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(oe(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=il),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function xl(e){return this._weekdaysParseExact?(oe(this,"_weekdaysRegex")||Yn.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(oe(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ll),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Yn(){function e(c,h){return h.length-c.length}var t=[],n=[],r=[],i=[],a,u,f,o,l;for(a=0;a<7;a++)u=Qe([2e3,1]).day(a),f=it(this.weekdaysMin(u,"")),o=it(this.weekdaysShort(u,"")),l=it(this.weekdays(u,"")),t.push(f),n.push(o),r.push(l),i.push(f),i.push(o),i.push(l);t.sort(e),n.sort(e),r.sort(e),i.sort(e),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Un(){return this.hours()%12||12}function Nl(){return this.hours()||24}q("H",["HH",2],0,"hour"),q("h",["hh",2],0,Un),q("k",["kk",2],0,Nl),q("hmm",0,0,function(){return""+Un.apply(this)+Je(this.minutes(),2)}),q("hmmss",0,0,function(){return""+Un.apply(this)+Je(this.minutes(),2)+Je(this.seconds(),2)}),q("Hmm",0,0,function(){return""+this.hours()+Je(this.minutes(),2)}),q("Hmmss",0,0,function(){return""+this.hours()+Je(this.minutes(),2)+Je(this.seconds(),2)});function Br(e,t){q(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}Br("a",!0),Br("A",!1);function Gr(e,t){return t._meridiemParse}H("a",Gr),H("A",Gr),H("H",me,kn),H("h",me,Pt),H("k",me,Pt),H("HH",me,Pe),H("hh",me,Pe),H("kk",me,Pe),H("hmm",Er),H("hmmss",Rr),H("Hmm",Er),H("Hmmss",Rr),ue(["H","HH"],Te),ue(["k","kk"],function(e,t,n){var r=re(e);t[Te]=r===24?0:r}),ue(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ue(["h","hh"],function(e,t,n){t[Te]=re(e),se(n).bigHour=!0}),ue("hmm",function(e,t,n){var r=e.length-2;t[Te]=re(e.substr(0,r)),t[We]=re(e.substr(r)),se(n).bigHour=!0}),ue("hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[Te]=re(e.substr(0,r)),t[We]=re(e.substr(r,2)),t[ot]=re(e.substr(i)),se(n).bigHour=!0}),ue("Hmm",function(e,t,n){var r=e.length-2;t[Te]=re(e.substr(0,r)),t[We]=re(e.substr(r))}),ue("Hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[Te]=re(e.substr(0,r)),t[We]=re(e.substr(r,2)),t[ot]=re(e.substr(i))});function jl(e){return(e+"").toLowerCase().charAt(0)==="p"}var vl=/[ap]\.?m?\.?/i,_l=Ft("Hours",!0);function bl(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var Wr={calendar:hi,longDateFormat:pi,invalidDate:gi,ordinal:Ni,dayOfMonthOrdinalParse:ji,relativeTime:_i,months:Di,monthsShort:Pr,week:Qi,weekdays:nl,weekdaysMin:rl,weekdaysShort:Hr,meridiemParse:vl},ge={},cs={},ds;function Sl(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n+=1)if(e[n]!==t[n])return n;return r}function zr(e){return e&&e.toLowerCase().replace("_","-")}function Tl(e){for(var t=0,n,r,i,a;t<e.length;){for(a=zr(e[t]).split("-"),n=a.length,r=zr(e[t+1]),r=r?r.split("-"):null;n>0;){if(i=Us(a.slice(0,n).join("-")),i)return i;if(r&&r.length>=n&&Sl(a,r)>=n-1)break;n--}t++}return ds}function wl(e){return!!(e&&e.match("^[^/\\\\]*$"))}function Us(e){var t=null,n;if(ge[e]===void 0&&typeof module<"u"&&module&&module.exports&&wl(e))try{t=ds._abbr,n=require,n("./locale/"+e),Nt(t)}catch{ge[e]=null}return ge[e]}function Nt(e,t){var n;return e&&(Ee(t)?n=dt(e):n=$n(e,t),n?ds=n:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),ds._abbr}function $n(e,t){if(t!==null){var n,r=Wr;if(t.abbr=e,ge[e]!=null)Ir("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=ge[e]._config;else if(t.parentLocale!=null)if(ge[t.parentLocale]!=null)r=ge[t.parentLocale]._config;else if(n=Us(t.parentLocale),n!=null)r=n._config;else return cs[t.parentLocale]||(cs[t.parentLocale]=[]),cs[t.parentLocale].push({name:e,config:t}),null;return ge[e]=new Cn(In(r,t)),cs[e]&&cs[e].forEach(function(i){$n(i.name,i.config)}),Nt(e),ge[e]}else return delete ge[e],null}function Il(e,t){if(t!=null){var n,r,i=Wr;ge[e]!=null&&ge[e].parentLocale!=null?ge[e].set(In(ge[e]._config,t)):(r=Us(e),r!=null&&(i=r._config),t=In(i,t),r==null&&(t.abbr=e),n=new Cn(t),n.parentLocale=ge[e],ge[e]=n),Nt(e)}else ge[e]!=null&&(ge[e].parentLocale!=null?(ge[e]=ge[e].parentLocale,e===Nt()&&Nt(e)):ge[e]!=null&&delete ge[e]);return ge[e]}function dt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return ds;if(!Be(e)){if(t=Us(e),t)return t;e=[e]}return Tl(e)}function Cl(){return On(ge)}function Hn(e){var t,n=e._a;return n&&se(e).overflow===-2&&(t=n[lt]<0||n[lt]>11?lt:n[Xe]<1||n[Xe]>Fn(n[Ce],n[lt])?Xe:n[Te]<0||n[Te]>24||n[Te]===24&&(n[We]!==0||n[ot]!==0||n[St]!==0)?Te:n[We]<0||n[We]>59?We:n[ot]<0||n[ot]>59?ot:n[St]<0||n[St]>999?St:-1,se(e)._overflowDayOfYear&&(t<Ce||t>Xe)&&(t=Xe),se(e)._overflowWeeks&&t===-1&&(t=Ei),se(e)._overflowWeekday&&t===-1&&(t=Ri),se(e).overflow=t),e}var Ol=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ml=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Al=/Z|[+-]\d\d(?::?\d\d)?/,$s=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Bn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],El=/^\/?Date\((-?\d+)/i,Rl=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Ll={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Vr(e){var t,n,r=e._i,i=Ol.exec(r)||Ml.exec(r),a,u,f,o,l=$s.length,c=Bn.length;if(i){for(se(e).iso=!0,t=0,n=l;t<n;t++)if($s[t][1].exec(i[1])){u=$s[t][0],a=$s[t][2]!==!1;break}if(u==null){e._isValid=!1;return}if(i[3]){for(t=0,n=c;t<n;t++)if(Bn[t][1].exec(i[3])){f=(i[2]||" ")+Bn[t][0];break}if(f==null){e._isValid=!1;return}}if(!a&&f!=null){e._isValid=!1;return}if(i[4])if(Al.exec(i[4]))o="Z";else{e._isValid=!1;return}e._f=u+(f||"")+(o||""),Wn(e)}else e._isValid=!1}function kl(e,t,n,r,i,a){var u=[Pl(e),Pr.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return a&&u.push(parseInt(a,10)),u}function Pl(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function Fl(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Dl(e,t,n){if(e){var r=Hr.indexOf(e),i=new Date(t[0],t[1],t[2]).getDay();if(r!==i)return se(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function Yl(e,t,n){if(e)return Ll[e];if(t)return 0;var r=parseInt(n,10),i=r%100,a=(r-i)/100;return a*60+i}function qr(e){var t=Rl.exec(Fl(e._i)),n;if(t){if(n=kl(t[4],t[3],t[2],t[5],t[6],t[7]),!Dl(t[1],n,e))return;e._a=n,e._tzm=Yl(t[8],t[9],t[10]),e._d=ls.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),se(e).rfc2822=!0}else e._isValid=!1}function Ul(e){var t=El.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(Vr(e),e._isValid===!1)delete e._isValid;else return;if(qr(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:L.createFromInputFallback(e)}L.createFromInputFallback=Ye("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))});function Dt(e,t,n){return e??t??n}function $l(e){var t=new Date(L.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Gn(e){var t,n,r=[],i,a,u;if(!e._d){for(i=$l(e),e._w&&e._a[Xe]==null&&e._a[lt]==null&&Hl(e),e._dayOfYear!=null&&(u=Dt(e._a[Ce],i[Ce]),(e._dayOfYear>as(u)||e._dayOfYear===0)&&(se(e)._overflowDayOfYear=!0),n=ls(u,0,e._dayOfYear),e._a[lt]=n.getUTCMonth(),e._a[Xe]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=i[t];for(;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[Te]===24&&e._a[We]===0&&e._a[ot]===0&&e._a[St]===0&&(e._nextDay=!0,e._a[Te]=0),e._d=(e._useUTC?ls:qi).apply(null,r),a=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Te]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==a&&(se(e).weekdayMismatch=!0)}}function Hl(e){var t,n,r,i,a,u,f,o,l;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(a=1,u=4,n=Dt(t.GG,e._a[Ce],os(fe(),1,4).year),r=Dt(t.W,1),i=Dt(t.E,1),(i<1||i>7)&&(o=!0)):(a=e._locale._week.dow,u=e._locale._week.doy,l=os(fe(),a,u),n=Dt(t.gg,e._a[Ce],l.year),r=Dt(t.w,l.week),t.d!=null?(i=t.d,(i<0||i>6)&&(o=!0)):t.e!=null?(i=t.e+a,(t.e<0||t.e>6)&&(o=!0)):i=a),r<1||r>ct(n,a,u)?se(e)._overflowWeeks=!0:o!=null?se(e)._overflowWeekday=!0:(f=$r(n,r,i,a,u),e._a[Ce]=f.year,e._dayOfYear=f.dayOfYear)}L.ISO_8601=function(){},L.RFC_2822=function(){};function Wn(e){if(e._f===L.ISO_8601){Vr(e);return}if(e._f===L.RFC_2822){qr(e);return}e._a=[],se(e).empty=!0;var t=""+e._i,n,r,i,a,u,f=t.length,o=0,l,c;for(i=Cr(e._f,e._locale).match(Mn)||[],c=i.length,n=0;n<c;n++)a=i[n],r=(t.match(Oi(a,e))||[])[0],r&&(u=t.substr(0,t.indexOf(r)),u.length>0&&se(e).unusedInput.push(u),t=t.slice(t.indexOf(r)+r.length),o+=r.length),Lt[a]?(r?se(e).empty=!1:se(e).unusedTokens.push(a),Ai(a,r,e)):e._strict&&!r&&se(e).unusedTokens.push(a);se(e).charsLeftOver=f-o,t.length>0&&se(e).unusedInput.push(t),e._a[Te]<=12&&se(e).bigHour===!0&&e._a[Te]>0&&(se(e).bigHour=void 0),se(e).parsedDateParts=e._a.slice(0),se(e).meridiem=e._meridiem,e._a[Te]=Bl(e._locale,e._a[Te],e._meridiem),l=se(e).era,l!==null&&(e._a[Ce]=e._locale.erasConvertYear(l,e._a[Ce])),Gn(e),Hn(e)}function Bl(e,t,n){var r;return n==null?t:e.meridiemHour!=null?e.meridiemHour(t,n):(e.isPM!=null&&(r=e.isPM(n),r&&t<12&&(t+=12),!r&&t===12&&(t=0)),t)}function Gl(e){var t,n,r,i,a,u,f=!1,o=e._f.length;if(o===0){se(e).invalidFormat=!0,e._d=new Date(NaN);return}for(i=0;i<o;i++)a=0,u=!1,t=wn({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[i],Wn(t),Sn(t)&&(u=!0),a+=se(t).charsLeftOver,a+=se(t).unusedTokens.length*10,se(t).score=a,f?a<r&&(r=a,n=t):(r==null||a<r||u)&&(r=a,n=t,u&&(f=!0));xt(e,n||t)}function Wl(e){if(!e._d){var t=En(e._i),n=t.day===void 0?t.date:t.day;e._a=br([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(r){return r&&parseInt(r,10)}),Gn(e)}}function zl(e){var t=new ss(Hn(Kr(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Kr(e){var t=e._i,n=e._f;return e._locale=e._locale||dt(e._l),t===null||n===void 0&&t===""?Os({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),Ge(t)?new ss(Hn(t)):(ts(t)?e._d=t:Be(n)?Gl(e):n?Wn(e):Vl(e),Sn(e)||(e._d=null),e))}function Vl(e){var t=e._i;Ee(t)?e._d=new Date(L.now()):ts(t)?e._d=new Date(t.valueOf()):typeof t=="string"?Ul(e):Be(t)?(e._a=br(t.slice(0),function(n){return parseInt(n,10)}),Gn(e)):bt(t)?Wl(e):at(t)?e._d=new Date(t):L.createFromInputFallback(e)}function Qr(e,t,n,r,i){var a={};return(t===!0||t===!1)&&(r=t,t=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(bt(e)&&_n(e)||Be(e)&&e.length===0)&&(e=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=e,a._f=t,a._strict=r,zl(a)}function fe(e,t,n,r){return Qr(e,t,n,r,!1)}var ql=Ye("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=fe.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:Os()}),Kl=Ye("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=fe.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:Os()});function Zr(e,t){var n,r;if(t.length===1&&Be(t[0])&&(t=t[0]),!t.length)return fe();for(n=t[0],r=1;r<t.length;++r)(!t[r].isValid()||t[r][e](n))&&(n=t[r]);return n}function Ql(){var e=[].slice.call(arguments,0);return Zr("isBefore",e)}function Zl(){var e=[].slice.call(arguments,0);return Zr("isAfter",e)}var Jl=function(){return Date.now?Date.now():+new Date},hs=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Xl(e){var t,n=!1,r,i=hs.length;for(t in e)if(oe(e,t)&&!(je.call(hs,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(r=0;r<i;++r)if(e[hs[r]]){if(n)return!1;parseFloat(e[hs[r]])!==re(e[hs[r]])&&(n=!0)}return!0}function eo(){return this._isValid}function to(){return ze(NaN)}function Hs(e){var t=En(e),n=t.year||0,r=t.quarter||0,i=t.month||0,a=t.week||t.isoWeek||0,u=t.day||0,f=t.hour||0,o=t.minute||0,l=t.second||0,c=t.millisecond||0;this._isValid=Xl(t),this._milliseconds=+c+l*1e3+o*6e4+f*1e3*60*60,this._days=+u+a*7,this._months=+i+r*3+n*12,this._data={},this._locale=dt(),this._bubble()}function Bs(e){return e instanceof Hs}function zn(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function so(e,t,n){var r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),a=0,u;for(u=0;u<r;u++)re(e[u])!==re(t[u])&&a++;return a+i}function Jr(e,t){q(e,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+Je(~~(n/60),2)+t+Je(~~n%60,2)})}Jr("Z",":"),Jr("ZZ",""),H("Z",Ps),H("ZZ",Ps),ue(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Vn(Ps,e)});var no=/([\+\-]|\d\d)/gi;function Vn(e,t){var n=(t||"").match(e),r,i,a;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(no)||["-",0,0],a=+(i[1]*60)+re(i[2]),a===0?0:i[0]==="+"?a:-a)}function qn(e,t){var n,r;return t._isUTC?(n=t.clone(),r=(Ge(e)||ts(e)?e.valueOf():fe(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),L.updateOffset(n,!1),n):fe(e).local()}function Kn(e){return-Math.round(e._d.getTimezoneOffset())}L.updateOffset=function(){};function ro(e,t,n){var r=this._offset||0,i;if(!this.isValid())return e!=null?this:NaN;if(e!=null){if(typeof e=="string"){if(e=Vn(Ps,e),e===null)return this}else Math.abs(e)<16&&!n&&(e=e*60);return!this._isUTC&&t&&(i=Kn(this)),this._offset=e,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==e&&(!t||this._changeInProgress?sa(this,ze(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,L.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:Kn(this)}function ao(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function io(e){return this.utcOffset(0,e)}function lo(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Kn(this),"m")),this}function oo(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=Vn(Ii,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function co(e){return this.isValid()?(e=e?fe(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function ho(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function uo(){if(!Ee(this._isDSTShifted))return this._isDSTShifted;var e={},t;return wn(e,this),e=Kr(e),e._a?(t=e._isUTC?Qe(e._a):fe(e._a),this._isDSTShifted=this.isValid()&&so(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function mo(){return this.isValid()?!this._isUTC:!1}function fo(){return this.isValid()?this._isUTC:!1}function Xr(){return this.isValid()?this._isUTC&&this._offset===0:!1}var po=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,yo=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ze(e,t){var n=e,r=null,i,a,u;return Bs(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:at(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(r=po.exec(e))?(i=r[1]==="-"?-1:1,n={y:0,d:re(r[Xe])*i,h:re(r[Te])*i,m:re(r[We])*i,s:re(r[ot])*i,ms:re(zn(r[St]*1e3))*i}):(r=yo.exec(e))?(i=r[1]==="-"?-1:1,n={y:Tt(r[2],i),M:Tt(r[3],i),w:Tt(r[4],i),d:Tt(r[5],i),h:Tt(r[6],i),m:Tt(r[7],i),s:Tt(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(u=go(fe(n.from),fe(n.to)),n={},n.ms=u.milliseconds,n.M=u.months),a=new Hs(n),Bs(e)&&oe(e,"_locale")&&(a._locale=e._locale),Bs(e)&&oe(e,"_isValid")&&(a._isValid=e._isValid),a}ze.fn=Hs.prototype,ze.invalid=to;function Tt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function ea(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function go(e,t){var n;return e.isValid()&&t.isValid()?(t=qn(t,e),e.isBefore(t)?n=ea(e,t):(n=ea(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function ta(e,t){return function(n,r){var i,a;return r!==null&&!isNaN(+r)&&(Ir(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=n,n=r,r=a),i=ze(n,r),sa(this,i,e),this}}function sa(e,t,n,r){var i=t._milliseconds,a=zn(t._days),u=zn(t._months);e.isValid()&&(r=r??!0,u&&Dr(e,is(e,"Month")+u*n),a&&kr(e,"Date",is(e,"Date")+a*n),i&&e._d.setTime(e._d.valueOf()+i*n),r&&L.updateOffset(e,a||u))}var xo=ta(1,"add"),No=ta(-1,"subtract");function na(e){return typeof e=="string"||e instanceof String}function jo(e){return Ge(e)||ts(e)||na(e)||at(e)||_o(e)||vo(e)||e===null||e===void 0}function vo(e){var t=bt(e)&&!_n(e),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,a,u=r.length;for(i=0;i<u;i+=1)a=r[i],n=n||oe(e,a);return t&&n}function _o(e){var t=Be(e),n=!1;return t&&(n=e.filter(function(r){return!at(r)&&na(e)}).length===0),t&&n}function bo(e){var t=bt(e)&&!_n(e),n=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,a;for(i=0;i<r.length;i+=1)a=r[i],n=n||oe(e,a);return t&&n}function So(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function To(e,t){arguments.length===1&&(arguments[0]?jo(arguments[0])?(e=arguments[0],t=void 0):bo(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||fe(),r=qn(n,this).startOf("day"),i=L.calendarFormat(this,r)||"sameElse",a=t&&(Ze(t[i])?t[i].call(this,n):t[i]);return this.format(a||this.localeData().calendar(i,this,fe(n)))}function wo(){return new ss(this)}function Io(e,t){var n=Ge(e)?e:fe(e);return this.isValid()&&n.isValid()?(t=Ue(t)||"millisecond",t==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function Co(e,t){var n=Ge(e)?e:fe(e);return this.isValid()&&n.isValid()?(t=Ue(t)||"millisecond",t==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function Oo(e,t,n,r){var i=Ge(e)?e:fe(e),a=Ge(t)?t:fe(t);return this.isValid()&&i.isValid()&&a.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(i,n):!this.isBefore(i,n))&&(r[1]===")"?this.isBefore(a,n):!this.isAfter(a,n))):!1}function Mo(e,t){var n=Ge(e)?e:fe(e),r;return this.isValid()&&n.isValid()?(t=Ue(t)||"millisecond",t==="millisecond"?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(t).valueOf()<=r&&r<=this.clone().endOf(t).valueOf())):!1}function Ao(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Eo(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Ro(e,t,n){var r,i,a;if(!this.isValid())return NaN;if(r=qn(e,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,t=Ue(t),t){case"year":a=Gs(this,r)/12;break;case"month":a=Gs(this,r);break;case"quarter":a=Gs(this,r)/3;break;case"second":a=(this-r)/1e3;break;case"minute":a=(this-r)/6e4;break;case"hour":a=(this-r)/36e5;break;case"day":a=(this-r-i)/864e5;break;case"week":a=(this-r-i)/6048e5;break;default:a=this-r}return n?a:$e(a)}function Gs(e,t){if(e.date()<t.date())return-Gs(t,e);var n=(t.year()-e.year())*12+(t.month()-e.month()),r=e.clone().add(n,"months"),i,a;return t-r<0?(i=e.clone().add(n-1,"months"),a=(t-r)/(r-i)):(i=e.clone().add(n+1,"months"),a=(t-r)/(i-r)),-(n+a)||0}L.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",L.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Lo(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ko(e){if(!this.isValid())return null;var t=e!==!0,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?As(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Ze(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",As(n,"Z")):As(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Po(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",n,r,i,a;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",a=t+'[")]',this.format(n+r+i+a)}function Fo(e){e||(e=this.isUtc()?L.defaultFormatUtc:L.defaultFormat);var t=As(this,e);return this.localeData().postformat(t)}function Do(e,t){return this.isValid()&&(Ge(e)&&e.isValid()||fe(e).isValid())?ze({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Yo(e){return this.from(fe(),e)}function Uo(e,t){return this.isValid()&&(Ge(e)&&e.isValid()||fe(e).isValid())?ze({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function $o(e){return this.to(fe(),e)}function ra(e){var t;return e===void 0?this._locale._abbr:(t=dt(e),t!=null&&(this._locale=t),this)}var aa=Ye("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function ia(){return this._locale}var Ws=1e3,Yt=60*Ws,zs=60*Yt,la=(365*400+97)*24*zs;function Ut(e,t){return(e%t+t)%t}function oa(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-la:new Date(e,t,n).valueOf()}function ca(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-la:Date.UTC(e,t,n)}function Ho(e){var t,n;if(e=Ue(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?ca:oa,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=Ut(t+(this._isUTC?0:this.utcOffset()*Yt),zs);break;case"minute":t=this._d.valueOf(),t-=Ut(t,Yt);break;case"second":t=this._d.valueOf(),t-=Ut(t,Ws);break}return this._d.setTime(t),L.updateOffset(this,!0),this}function Bo(e){var t,n;if(e=Ue(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?ca:oa,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=zs-Ut(t+(this._isUTC?0:this.utcOffset()*Yt),zs)-1;break;case"minute":t=this._d.valueOf(),t+=Yt-Ut(t,Yt)-1;break;case"second":t=this._d.valueOf(),t+=Ws-Ut(t,Ws)-1;break}return this._d.setTime(t),L.updateOffset(this,!0),this}function Go(){return this._d.valueOf()-(this._offset||0)*6e4}function Wo(){return Math.floor(this.valueOf()/1e3)}function zo(){return new Date(this.valueOf())}function Vo(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function qo(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Ko(){return this.isValid()?this.toISOString():null}function Qo(){return Sn(this)}function Zo(){return xt({},se(this))}function Jo(){return se(this).overflow}function Xo(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}q("N",0,0,"eraAbbr"),q("NN",0,0,"eraAbbr"),q("NNN",0,0,"eraAbbr"),q("NNNN",0,0,"eraName"),q("NNNNN",0,0,"eraNarrow"),q("y",["y",1],"yo","eraYear"),q("y",["yy",2],0,"eraYear"),q("y",["yyy",3],0,"eraYear"),q("y",["yyyy",4],0,"eraYear"),H("N",Qn),H("NN",Qn),H("NNN",Qn),H("NNNN",dc),H("NNNNN",hc),ue(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var i=n._locale.erasParse(e,r,n._strict);i?se(n).era=i:se(n).invalidEra=e}),H("y",kt),H("yy",kt),H("yyy",kt),H("yyyy",kt),H("yo",uc),ue(["y","yy","yyy","yyyy"],Ce),ue(["yo"],function(e,t,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Ce]=n._locale.eraYearOrdinalParse(e,i):t[Ce]=parseInt(e,10)});function ec(e,t){var n,r,i,a=this._eras||dt("en")._eras;for(n=0,r=a.length;n<r;++n){switch(typeof a[n].since){case"string":i=L(a[n].since).startOf("day"),a[n].since=i.valueOf();break}switch(typeof a[n].until){case"undefined":a[n].until=1/0;break;case"string":i=L(a[n].until).startOf("day").valueOf(),a[n].until=i.valueOf();break}}return a}function tc(e,t,n){var r,i,a=this.eras(),u,f,o;for(e=e.toUpperCase(),r=0,i=a.length;r<i;++r)if(u=a[r].name.toUpperCase(),f=a[r].abbr.toUpperCase(),o=a[r].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(f===e)return a[r];break;case"NNNN":if(u===e)return a[r];break;case"NNNNN":if(o===e)return a[r];break}else if([u,f,o].indexOf(e)>=0)return a[r]}function sc(e,t){var n=e.since<=e.until?1:-1;return t===void 0?L(e.since).year():L(e.since).year()+(t-e.offset)*n}function nc(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].name;return""}function rc(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].narrow;return""}function ac(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].abbr;return""}function ic(){var e,t,n,r,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e)if(n=i[e].since<=i[e].until?1:-1,r=this.clone().startOf("day").valueOf(),i[e].since<=r&&r<=i[e].until||i[e].until<=r&&r<=i[e].since)return(this.year()-L(i[e].since).year())*n+i[e].offset;return this.year()}function lc(e){return oe(this,"_erasNameRegex")||Zn.call(this),e?this._erasNameRegex:this._erasRegex}function oc(e){return oe(this,"_erasAbbrRegex")||Zn.call(this),e?this._erasAbbrRegex:this._erasRegex}function cc(e){return oe(this,"_erasNarrowRegex")||Zn.call(this),e?this._erasNarrowRegex:this._erasRegex}function Qn(e,t){return t.erasAbbrRegex(e)}function dc(e,t){return t.erasNameRegex(e)}function hc(e,t){return t.erasNarrowRegex(e)}function uc(e,t){return t._eraYearOrdinalRegex||kt}function Zn(){var e=[],t=[],n=[],r=[],i,a,u,f,o,l=this.eras();for(i=0,a=l.length;i<a;++i)u=it(l[i].name),f=it(l[i].abbr),o=it(l[i].narrow),t.push(u),e.push(f),n.push(o),r.push(u),r.push(f),r.push(o);this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}q(0,["gg",2],0,function(){return this.weekYear()%100}),q(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Vs(e,t){q(0,[e,e.length],0,t)}Vs("gggg","weekYear"),Vs("ggggg","weekYear"),Vs("GGGG","isoWeekYear"),Vs("GGGGG","isoWeekYear"),H("G",ks),H("g",ks),H("GG",me,Pe),H("gg",me,Pe),H("GGGG",Ln,Rn),H("gggg",Ln,Rn),H("GGGGG",Ls,Es),H("ggggg",Ls,Es),rs(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=re(e)}),rs(["gg","GG"],function(e,t,n,r){t[r]=L.parseTwoDigitYear(e)});function mc(e){return da.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function fc(e){return da.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function pc(){return ct(this.year(),1,4)}function yc(){return ct(this.isoWeekYear(),1,4)}function gc(){var e=this.localeData()._week;return ct(this.year(),e.dow,e.doy)}function xc(){var e=this.localeData()._week;return ct(this.weekYear(),e.dow,e.doy)}function da(e,t,n,r,i){var a;return e==null?os(this,r,i).year:(a=ct(e,r,i),t>a&&(t=a),Nc.call(this,e,t,n,r,i))}function Nc(e,t,n,r,i){var a=$r(e,t,n,r,i),u=ls(a.year,0,a.dayOfYear);return this.year(u.getUTCFullYear()),this.month(u.getUTCMonth()),this.date(u.getUTCDate()),this}q("Q",0,"Qo","quarter"),H("Q",Mr),ue("Q",function(e,t){t[lt]=(re(e)-1)*3});function jc(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}q("D",["DD",2],"Do","date"),H("D",me,Pt),H("DD",me,Pe),H("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ue(["D","DD"],Xe),ue("Do",function(e,t){t[Xe]=re(e.match(me)[0])});var ha=Ft("Date",!0);q("DDD",["DDDD",3],"DDDo","dayOfYear"),H("DDD",Rs),H("DDDD",Ar),ue(["DDD","DDDD"],function(e,t,n){n._dayOfYear=re(e)});function vc(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}q("m",["mm",2],0,"minute"),H("m",me,kn),H("mm",me,Pe),ue(["m","mm"],We);var _c=Ft("Minutes",!1);q("s",["ss",2],0,"second"),H("s",me,kn),H("ss",me,Pe),ue(["s","ss"],ot);var bc=Ft("Seconds",!1);q("S",0,0,function(){return~~(this.millisecond()/100)}),q(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),q(0,["SSS",3],0,"millisecond"),q(0,["SSSS",4],0,function(){return this.millisecond()*10}),q(0,["SSSSS",5],0,function(){return this.millisecond()*100}),q(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),q(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),q(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),q(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),H("S",Rs,Mr),H("SS",Rs,Pe),H("SSS",Rs,Ar);var jt,ua;for(jt="SSSS";jt.length<=9;jt+="S")H(jt,kt);function Sc(e,t){t[St]=re(("0."+e)*1e3)}for(jt="S";jt.length<=9;jt+="S")ue(jt,Sc);ua=Ft("Milliseconds",!1),q("z",0,0,"zoneAbbr"),q("zz",0,0,"zoneName");function Tc(){return this._isUTC?"UTC":""}function wc(){return this._isUTC?"Coordinated Universal Time":""}var A=ss.prototype;A.add=xo,A.calendar=To,A.clone=wo,A.diff=Ro,A.endOf=Bo,A.format=Fo,A.from=Do,A.fromNow=Yo,A.to=Uo,A.toNow=$o,A.get=ki,A.invalidAt=Jo,A.isAfter=Io,A.isBefore=Co,A.isBetween=Oo,A.isSame=Mo,A.isSameOrAfter=Ao,A.isSameOrBefore=Eo,A.isValid=Qo,A.lang=aa,A.locale=ra,A.localeData=ia,A.max=Kl,A.min=ql,A.parsingFlags=Zo,A.set=Pi,A.startOf=Ho,A.subtract=No,A.toArray=Vo,A.toObject=qo,A.toDate=zo,A.toISOString=ko,A.inspect=Po,typeof Symbol<"u"&&Symbol.for!=null&&(A[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),A.toJSON=Ko,A.toString=Lo,A.unix=Wo,A.valueOf=Go,A.creationData=Xo,A.eraName=nc,A.eraNarrow=rc,A.eraAbbr=ac,A.eraYear=ic,A.year=Lr,A.isLeapYear=Li,A.weekYear=mc,A.isoWeekYear=fc,A.quarter=A.quarters=jc,A.month=Yr,A.daysInMonth=Wi,A.week=A.weeks=Xi,A.isoWeek=A.isoWeeks=el,A.weeksInYear=gc,A.weeksInWeekYear=xc,A.isoWeeksInYear=pc,A.isoWeeksInISOWeekYear=yc,A.date=ha,A.day=A.days=ml,A.weekday=fl,A.isoWeekday=pl,A.dayOfYear=vc,A.hour=A.hours=_l,A.minute=A.minutes=_c,A.second=A.seconds=bc,A.millisecond=A.milliseconds=ua,A.utcOffset=ro,A.utc=io,A.local=lo,A.parseZone=oo,A.hasAlignedHourOffset=co,A.isDST=ho,A.isLocal=mo,A.isUtcOffset=fo,A.isUtc=Xr,A.isUTC=Xr,A.zoneAbbr=Tc,A.zoneName=wc,A.dates=Ye("dates accessor is deprecated. Use date instead.",ha),A.months=Ye("months accessor is deprecated. Use month instead",Yr),A.years=Ye("years accessor is deprecated. Use year instead",Lr),A.zone=Ye("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",ao),A.isDSTShifted=Ye("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",uo);function Ic(e){return fe(e*1e3)}function Cc(){return fe.apply(null,arguments).parseZone()}function ma(e){return e}var ce=Cn.prototype;ce.calendar=ui,ce.longDateFormat=yi,ce.invalidDate=xi,ce.ordinal=vi,ce.preparse=ma,ce.postformat=ma,ce.relativeTime=bi,ce.pastFuture=Si,ce.set=di,ce.eras=ec,ce.erasParse=tc,ce.erasConvertYear=sc,ce.erasAbbrRegex=oc,ce.erasNameRegex=lc,ce.erasNarrowRegex=cc,ce.months=$i,ce.monthsShort=Hi,ce.monthsParse=Gi,ce.monthsRegex=Vi,ce.monthsShortRegex=zi,ce.week=Ki,ce.firstDayOfYear=Ji,ce.firstDayOfWeek=Zi,ce.weekdays=ol,ce.weekdaysMin=dl,ce.weekdaysShort=cl,ce.weekdaysParse=ul,ce.weekdaysRegex=yl,ce.weekdaysShortRegex=gl,ce.weekdaysMinRegex=xl,ce.isPM=jl,ce.meridiem=bl;function qs(e,t,n,r){var i=dt(),a=Qe().set(r,t);return i[n](a,e)}function fa(e,t,n){if(at(e)&&(t=e,e=void 0),e=e||"",t!=null)return qs(e,t,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=qs(e,r,n,"month");return i}function Jn(e,t,n,r){typeof e=="boolean"?(at(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,at(t)&&(n=t,t=void 0),t=t||"");var i=dt(),a=e?i._week.dow:0,u,f=[];if(n!=null)return qs(t,(n+a)%7,r,"day");for(u=0;u<7;u++)f[u]=qs(t,(u+a)%7,r,"day");return f}function Oc(e,t){return fa(e,t,"months")}function Mc(e,t){return fa(e,t,"monthsShort")}function Ac(e,t,n){return Jn(e,t,n,"weekdays")}function Ec(e,t,n){return Jn(e,t,n,"weekdaysShort")}function Rc(e,t,n){return Jn(e,t,n,"weekdaysMin")}Nt("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=re(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}}),L.lang=Ye("moment.lang is deprecated. Use moment.locale instead.",Nt),L.langData=Ye("moment.langData is deprecated. Use moment.localeData instead.",dt);var ht=Math.abs;function Lc(){var e=this._data;return this._milliseconds=ht(this._milliseconds),this._days=ht(this._days),this._months=ht(this._months),e.milliseconds=ht(e.milliseconds),e.seconds=ht(e.seconds),e.minutes=ht(e.minutes),e.hours=ht(e.hours),e.months=ht(e.months),e.years=ht(e.years),this}function pa(e,t,n,r){var i=ze(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function kc(e,t){return pa(this,e,t,1)}function Pc(e,t){return pa(this,e,t,-1)}function ya(e){return e<0?Math.floor(e):Math.ceil(e)}function Fc(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,i,a,u,f,o;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=ya(Xn(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,i=$e(e/1e3),r.seconds=i%60,a=$e(i/60),r.minutes=a%60,u=$e(a/60),r.hours=u%24,t+=$e(u/24),o=$e(ga(t)),n+=o,t-=ya(Xn(o)),f=$e(n/12),n%=12,r.days=t,r.months=n,r.years=f,this}function ga(e){return e*4800/146097}function Xn(e){return e*146097/4800}function Dc(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=Ue(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+r/864e5,n=this._months+ga(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Xn(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return t*24+r/36e5;case"minute":return t*1440+r/6e4;case"second":return t*86400+r/1e3;case"millisecond":return Math.floor(t*864e5)+r;default:throw new Error("Unknown unit "+e)}}function ut(e){return function(){return this.as(e)}}var xa=ut("ms"),Yc=ut("s"),Uc=ut("m"),$c=ut("h"),Hc=ut("d"),Bc=ut("w"),Gc=ut("M"),Wc=ut("Q"),zc=ut("y"),Vc=xa;function qc(){return ze(this)}function Kc(e){return e=Ue(e),this.isValid()?this[e+"s"]():NaN}function wt(e){return function(){return this.isValid()?this._data[e]:NaN}}var Qc=wt("milliseconds"),Zc=wt("seconds"),Jc=wt("minutes"),Xc=wt("hours"),ed=wt("days"),td=wt("months"),sd=wt("years");function nd(){return $e(this.days()/7)}var mt=Math.round,$t={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function rd(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function ad(e,t,n,r){var i=ze(e).abs(),a=mt(i.as("s")),u=mt(i.as("m")),f=mt(i.as("h")),o=mt(i.as("d")),l=mt(i.as("M")),c=mt(i.as("w")),h=mt(i.as("y")),p=a<=n.ss&&["s",a]||a<n.s&&["ss",a]||u<=1&&["m"]||u<n.m&&["mm",u]||f<=1&&["h"]||f<n.h&&["hh",f]||o<=1&&["d"]||o<n.d&&["dd",o];return n.w!=null&&(p=p||c<=1&&["w"]||c<n.w&&["ww",c]),p=p||l<=1&&["M"]||l<n.M&&["MM",l]||h<=1&&["y"]||["yy",h],p[2]=t,p[3]=+e>0,p[4]=r,rd.apply(null,p)}function id(e){return e===void 0?mt:typeof e=="function"?(mt=e,!0):!1}function ld(e,t){return $t[e]===void 0?!1:t===void 0?$t[e]:($t[e]=t,e==="s"&&($t.ss=t-1),!0)}function od(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=$t,i,a;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(n=e),typeof t=="object"&&(r=Object.assign({},$t,t),t.s!=null&&t.ss==null&&(r.ss=t.s-1)),i=this.localeData(),a=ad(this,!n,r,i),n&&(a=i.pastFuture(+this,a)),i.postformat(a)}var er=Math.abs;function Ht(e){return(e>0)-(e<0)||+e}function Ks(){if(!this.isValid())return this.localeData().invalidDate();var e=er(this._milliseconds)/1e3,t=er(this._days),n=er(this._months),r,i,a,u,f=this.asSeconds(),o,l,c,h;return f?(r=$e(e/60),i=$e(r/60),e%=60,r%=60,a=$e(n/12),n%=12,u=e?e.toFixed(3).replace(/\.?0+$/,""):"",o=f<0?"-":"",l=Ht(this._months)!==Ht(f)?"-":"",c=Ht(this._days)!==Ht(f)?"-":"",h=Ht(this._milliseconds)!==Ht(f)?"-":"",o+"P"+(a?l+a+"Y":"")+(n?l+n+"M":"")+(t?c+t+"D":"")+(i||r||e?"T":"")+(i?h+i+"H":"")+(r?h+r+"M":"")+(e?h+u+"S":"")):"P0D"}var ae=Hs.prototype;ae.isValid=eo,ae.abs=Lc,ae.add=kc,ae.subtract=Pc,ae.as=Dc,ae.asMilliseconds=xa,ae.asSeconds=Yc,ae.asMinutes=Uc,ae.asHours=$c,ae.asDays=Hc,ae.asWeeks=Bc,ae.asMonths=Gc,ae.asQuarters=Wc,ae.asYears=zc,ae.valueOf=Vc,ae._bubble=Fc,ae.clone=qc,ae.get=Kc,ae.milliseconds=Qc,ae.seconds=Zc,ae.minutes=Jc,ae.hours=Xc,ae.days=ed,ae.weeks=nd,ae.months=td,ae.years=sd,ae.humanize=od,ae.toISOString=Ks,ae.toString=Ks,ae.toJSON=Ks,ae.locale=ra,ae.localeData=ia,ae.toIsoString=Ye("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ks),ae.lang=aa,q("X",0,0,"unix"),q("x",0,0,"valueOf"),H("x",ks),H("X",Ci),ue("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)}),ue("x",function(e,t,n){n._d=new Date(re(e))});//! moment.js
39
- L.version="2.30.1",oi(fe),L.fn=A,L.min=Ql,L.max=Zl,L.now=Jl,L.utc=Qe,L.unix=Ic,L.months=Oc,L.isDate=ts,L.locale=Nt,L.invalid=Os,L.duration=ze,L.isMoment=Ge,L.weekdays=Ac,L.parseZone=Cc,L.localeData=dt,L.isDuration=Bs,L.monthsShort=Mc,L.weekdaysMin=Rc,L.defineLocale=$n,L.updateLocale=Il,L.locales=Cl,L.weekdaysShort=Ec,L.normalizeUnits=Ue,L.relativeTimeRounding=id,L.relativeTimeThreshold=ld,L.calendarFormat=So,L.prototype=A,L.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const ft=(e,t,n)=>{let r;for(let i=0;i<(e==null?void 0:e.length);i++)if(r=e[i],r[n]==t)return r;return new Object},Ve=e=>{if(!e)return"";e=e.toLowerCase();let t=e.split(" ");for(let n=0;n<t.length;n++)t[n]=t[n].charAt(0).toUpperCase()+t[n].slice(1);return t.join(" ")},us=(e,t)=>{let n,r=new Object;if(e&&e.length>0)for(let i=0;i<e.length;i++)n=e[i],r[n[t]]=n;return r},cd=e=>{let t,n=new Object;for(let r=0;r<e.length;r++)t=e[r],n[t]=t;return n},dd=(e,t)=>(e.sort((n,r)=>r[t]-n[t]),e);var Qs={exports:{}};/*! @preserve
38
+ `+new Error().stack),n=!1}return t.apply(this,arguments)},t)}var wr={};function Ir(e,t){R.deprecationHandler!=null&&R.deprecationHandler(e,t),wr[e]||(Tr(t),wr[e]=!0)}R.suppressDeprecationWarnings=!1,R.deprecationHandler=null;function Xe(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function di(e){var t,n;for(n in e)oe(e,n)&&(t=e[n],Xe(t)?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function In(e,t){var n=Nt({},e),r;for(r in t)oe(t,r)&&(Tt(e[r])&&Tt(t[r])?(n[r]={},Nt(n[r],e[r]),Nt(n[r],t[r])):t[r]!=null?n[r]=t[r]:delete n[r]);for(r in e)oe(e,r)&&!oe(t,r)&&Tt(e[r])&&(n[r]=Nt({},n[r]));return n}function Cn(e){e!=null&&this.set(e)}var On;Object.keys?On=Object.keys:On=function(e){var t,n=[];for(t in e)oe(e,t)&&n.push(t);return n};var hi={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function ui(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return Xe(r)?r.call(t,n):r}function et(e,t,n){var r=""+Math.abs(e),l=t-r.length,o=e>=0;return(o?n?"+":"":"-")+Math.pow(10,Math.max(0,l)).toString().substr(1)+r}var Mn=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Ms=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,An={},Pt={};function K(e,t,n,r){var l=r;typeof r=="string"&&(l=function(){return this[r]()}),e&&(Pt[e]=l),t&&(Pt[t[0]]=function(){return et(l.apply(this,arguments),t[1],t[2])}),n&&(Pt[n]=function(){return this.localeData().ordinal(l.apply(this,arguments),e)})}function mi(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function fi(e){var t=e.match(Mn),n,r;for(n=0,r=t.length;n<r;n++)Pt[t[n]]?t[n]=Pt[t[n]]:t[n]=mi(t[n]);return function(l){var o="",a;for(a=0;a<r;a++)o+=Xe(t[a])?t[a].call(l,e):t[a];return o}}function As(e,t){return e.isValid()?(t=Cr(t,e.localeData()),An[t]=An[t]||fi(t),An[t](e)):e.localeData().invalidDate()}function Cr(e,t){var n=5;function r(l){return t.longDateFormat(l)||l}for(Ms.lastIndex=0;n>=0&&Ms.test(e);)e=e.replace(Ms,r),Ms.lastIndex=0,n-=1;return e}var pi={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function yi(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(Mn).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[e])}var gi="Invalid date";function xi(){return this._invalidDate}var Ni="%d",ji=/\d{1,2}/;function vi(e){return this._ordinal.replace("%d",e)}var _i={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function bi(e,t,n,r){var l=this._relativeTime[n];return Xe(l)?l(e,t,n,r):l.replace(/%d/i,e)}function Si(e,t){var n=this._relativeTime[e>0?"future":"past"];return Xe(n)?n(t):n.replace(/%s/i,t)}var Or={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function $e(e){return typeof e=="string"?Or[e]||Or[e.toLowerCase()]:void 0}function En(e){var t={},n,r;for(r in e)oe(e,r)&&(n=$e(r),n&&(t[n]=e[r]));return t}var Ti={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function wi(e){var t=[],n;for(n in e)oe(e,n)&&t.push({unit:n,priority:Ti[n]});return t.sort(function(r,l){return r.priority-l.priority}),t}var Mr=/\d/,Pe=/\d\d/,Ar=/\d{3}/,Rn=/\d{4}/,Es=/[+-]?\d{6}/,pe=/\d\d?/,Er=/\d\d\d\d?/,Rr=/\d\d\d\d\d\d?/,Rs=/\d{1,3}/,Ln=/\d{1,4}/,Ls=/[+-]?\d{1,6}/,Ft=/\d+/,ks=/[+-]?\d+/,Ii=/Z|[+-]\d\d:?\d\d/gi,Ps=/Z|[+-]\d\d(?::?\d\d)?/gi,Ci=/[+-]?\d+(\.\d{1,3})?/,rs=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Dt=/^[1-9]\d?/,kn=/^([1-9]\d|\d)/,Fs;Fs={};function B(e,t,n){Fs[e]=Xe(t)?t:function(r,l){return r&&n?n:t}}function Oi(e,t){return oe(Fs,e)?Fs[e](t._strict,t._locale):new RegExp(Mi(e))}function Mi(e){return it(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,r,l,o){return n||r||l||o}))}function it(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function He(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function ae(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=He(t)),n}var Pn={};function me(e,t){var n,r=t,l;for(typeof e=="string"&&(e=[e]),at(t)&&(r=function(o,a){a[t]=ae(o)}),l=e.length,n=0;n<l;n++)Pn[e[n]]=r}function as(e,t){me(e,function(n,r,l,o){l._w=l._w||{},t(n,l._w,l,o)})}function Ai(e,t,n){t!=null&&oe(Pn,e)&&Pn[e](t,n._a,n,e)}function Ds(e){return e%4===0&&e%100!==0||e%400===0}var Ie=0,lt=1,tt=2,Te=3,We=4,ot=5,wt=6,Ei=7,Ri=8;K("Y",0,0,function(){var e=this.year();return e<=9999?et(e,4):"+"+e}),K(0,["YY",2],0,function(){return this.year()%100}),K(0,["YYYY",4],0,"year"),K(0,["YYYYY",5],0,"year"),K(0,["YYYYYY",6,!0],0,"year"),B("Y",ks),B("YY",pe,Pe),B("YYYY",Ln,Rn),B("YYYYY",Ls,Es),B("YYYYYY",Ls,Es),me(["YYYYY","YYYYYY"],Ie),me("YYYY",function(e,t){t[Ie]=e.length===2?R.parseTwoDigitYear(e):ae(e)}),me("YY",function(e,t){t[Ie]=R.parseTwoDigitYear(e)}),me("Y",function(e,t){t[Ie]=parseInt(e,10)});function is(e){return Ds(e)?366:365}R.parseTwoDigitYear=function(e){return ae(e)+(ae(e)>68?1900:2e3)};var Lr=Yt("FullYear",!0);function Li(){return Ds(this.year())}function Yt(e,t){return function(n){return n!=null?(kr(this,e,n),R.updateOffset(this,t),this):ls(this,e)}}function ls(e,t){if(!e.isValid())return NaN;var n=e._d,r=e._isUTC;switch(t){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function kr(e,t,n){var r,l,o,a,m;if(!(!e.isValid()||isNaN(n))){switch(r=e._d,l=e._isUTC,t){case"Milliseconds":return void(l?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(l?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(l?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(l?r.setUTCHours(n):r.setHours(n));case"Date":return void(l?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}o=n,a=e.month(),m=e.date(),m=m===29&&a===1&&!Ds(o)?28:m,l?r.setUTCFullYear(o,a,m):r.setFullYear(o,a,m)}}function ki(e){return e=$e(e),Xe(this[e])?this[e]():this}function Pi(e,t){if(typeof e=="object"){e=En(e);var n=wi(e),r,l=n.length;for(r=0;r<l;r++)this[n[r].unit](e[n[r].unit])}else if(e=$e(e),Xe(this[e]))return this[e](t);return this}function Fi(e,t){return(e%t+t)%t}var je;Array.prototype.indexOf?je=Array.prototype.indexOf:je=function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function Fn(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=Fi(t,12);return e+=(t-n)/12,n===1?Ds(e)?29:28:31-n%7%2}K("M",["MM",2],"Mo",function(){return this.month()+1}),K("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),K("MMMM",0,0,function(e){return this.localeData().months(this,e)}),B("M",pe,Dt),B("MM",pe,Pe),B("MMM",function(e,t){return t.monthsShortRegex(e)}),B("MMMM",function(e,t){return t.monthsRegex(e)}),me(["M","MM"],function(e,t){t[lt]=ae(e)-1}),me(["MMM","MMMM"],function(e,t,n,r){var l=n._locale.monthsParse(e,r,n._strict);l!=null?t[lt]=l:ne(n).invalidMonth=e});var Di="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Pr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Fr=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Yi=rs,Ui=rs;function $i(e,t){return e?Be(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Fr).test(t)?"format":"standalone"][e.month()]:Be(this._months)?this._months:this._months.standalone}function Hi(e,t){return e?Be(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Fr.test(t)?"format":"standalone"][e.month()]:Be(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Bi(e,t,n){var r,l,o,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)o=Je([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(o,"").toLocaleLowerCase();return n?t==="MMM"?(l=je.call(this._shortMonthsParse,a),l!==-1?l:null):(l=je.call(this._longMonthsParse,a),l!==-1?l:null):t==="MMM"?(l=je.call(this._shortMonthsParse,a),l!==-1?l:(l=je.call(this._longMonthsParse,a),l!==-1?l:null)):(l=je.call(this._longMonthsParse,a),l!==-1?l:(l=je.call(this._shortMonthsParse,a),l!==-1?l:null))}function Gi(e,t,n){var r,l,o;if(this._monthsParseExact)return Bi.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(l=Je([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(l,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(l,"").replace(".","")+"$","i")),!n&&!this._monthsParse[r]&&(o="^"+this.months(l,"")+"|^"+this.monthsShort(l,""),this._monthsParse[r]=new RegExp(o.replace(".",""),"i")),n&&t==="MMMM"&&this._longMonthsParse[r].test(e))return r;if(n&&t==="MMM"&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}}function Dr(e,t){if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=ae(t);else if(t=e.localeData().monthsParse(t),!at(t))return e}var n=t,r=e.date();return r=r<29?r:Math.min(r,Fn(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,r):e._d.setMonth(n,r),e}function Yr(e){return e!=null?(Dr(this,e),R.updateOffset(this,!0),this):ls(this,"Month")}function Wi(){return Fn(this.year(),this.month())}function zi(e){return this._monthsParseExact?(oe(this,"_monthsRegex")||Ur.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(oe(this,"_monthsShortRegex")||(this._monthsShortRegex=Yi),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function Vi(e){return this._monthsParseExact?(oe(this,"_monthsRegex")||Ur.call(this),e?this._monthsStrictRegex:this._monthsRegex):(oe(this,"_monthsRegex")||(this._monthsRegex=Ui),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function Ur(){function e(u,i){return i.length-u.length}var t=[],n=[],r=[],l,o,a,m;for(l=0;l<12;l++)o=Je([2e3,l]),a=it(this.monthsShort(o,"")),m=it(this.months(o,"")),t.push(a),n.push(m),r.push(m),r.push(a);t.sort(e),n.sort(e),r.sort(e),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function qi(e,t,n,r,l,o,a){var m;return e<100&&e>=0?(m=new Date(e+400,t,n,r,l,o,a),isFinite(m.getFullYear())&&m.setFullYear(e)):m=new Date(e,t,n,r,l,o,a),m}function os(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Ys(e,t,n){var r=7+t-n,l=(7+os(e,0,r).getUTCDay()-t)%7;return-l+r-1}function $r(e,t,n,r,l){var o=(7+n-r)%7,a=Ys(e,r,l),m=1+7*(t-1)+o+a,u,i;return m<=0?(u=e-1,i=is(u)+m):m>is(e)?(u=e+1,i=m-is(e)):(u=e,i=m),{year:u,dayOfYear:i}}function cs(e,t,n){var r=Ys(e.year(),t,n),l=Math.floor((e.dayOfYear()-r-1)/7)+1,o,a;return l<1?(a=e.year()-1,o=l+ct(a,t,n)):l>ct(e.year(),t,n)?(o=l-ct(e.year(),t,n),a=e.year()+1):(a=e.year(),o=l),{week:o,year:a}}function ct(e,t,n){var r=Ys(e,t,n),l=Ys(e+1,t,n);return(is(e)-r+l)/7}K("w",["ww",2],"wo","week"),K("W",["WW",2],"Wo","isoWeek"),B("w",pe,Dt),B("ww",pe,Pe),B("W",pe,Dt),B("WW",pe,Pe),as(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=ae(e)});function Ki(e){return cs(e,this._week.dow,this._week.doy).week}var Qi={dow:0,doy:6};function Zi(){return this._week.dow}function Ji(){return this._week.doy}function Xi(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function el(e){var t=cs(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}K("d",0,"do","day"),K("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),K("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),K("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),K("e",0,0,"weekday"),K("E",0,0,"isoWeekday"),B("d",pe),B("e",pe),B("E",pe),B("dd",function(e,t){return t.weekdaysMinRegex(e)}),B("ddd",function(e,t){return t.weekdaysShortRegex(e)}),B("dddd",function(e,t){return t.weekdaysRegex(e)}),as(["dd","ddd","dddd"],function(e,t,n,r){var l=n._locale.weekdaysParse(e,r,n._strict);l!=null?t.d=l:ne(n).invalidWeekday=e}),as(["d","e","E"],function(e,t,n,r){t[r]=ae(e)});function tl(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function sl(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Dn(e,t){return e.slice(t,7).concat(e.slice(0,t))}var nl="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Hr="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),rl="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),al=rs,il=rs,ll=rs;function ol(e,t){var n=Be(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Dn(n,this._week.dow):e?n[e.day()]:n}function cl(e){return e===!0?Dn(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function dl(e){return e===!0?Dn(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function hl(e,t,n){var r,l,o,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)o=Je([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(o,"").toLocaleLowerCase();return n?t==="dddd"?(l=je.call(this._weekdaysParse,a),l!==-1?l:null):t==="ddd"?(l=je.call(this._shortWeekdaysParse,a),l!==-1?l:null):(l=je.call(this._minWeekdaysParse,a),l!==-1?l:null):t==="dddd"?(l=je.call(this._weekdaysParse,a),l!==-1||(l=je.call(this._shortWeekdaysParse,a),l!==-1)?l:(l=je.call(this._minWeekdaysParse,a),l!==-1?l:null)):t==="ddd"?(l=je.call(this._shortWeekdaysParse,a),l!==-1||(l=je.call(this._weekdaysParse,a),l!==-1)?l:(l=je.call(this._minWeekdaysParse,a),l!==-1?l:null)):(l=je.call(this._minWeekdaysParse,a),l!==-1||(l=je.call(this._weekdaysParse,a),l!==-1)?l:(l=je.call(this._shortWeekdaysParse,a),l!==-1?l:null))}function ul(e,t,n){var r,l,o;if(this._weekdaysParseExact)return hl.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(l=Je([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(l,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(l,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(l,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(l,"")+"|^"+this.weekdaysShort(l,"")+"|^"+this.weekdaysMin(l,""),this._weekdaysParse[r]=new RegExp(o.replace(".",""),"i")),n&&t==="dddd"&&this._fullWeekdaysParse[r].test(e))return r;if(n&&t==="ddd"&&this._shortWeekdaysParse[r].test(e))return r;if(n&&t==="dd"&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function ml(e){if(!this.isValid())return e!=null?this:NaN;var t=ls(this,"Day");return e!=null?(e=tl(e,this.localeData()),this.add(e-t,"d")):t}function fl(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function pl(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=sl(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function yl(e){return this._weekdaysParseExact?(oe(this,"_weekdaysRegex")||Yn.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(oe(this,"_weekdaysRegex")||(this._weekdaysRegex=al),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function gl(e){return this._weekdaysParseExact?(oe(this,"_weekdaysRegex")||Yn.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(oe(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=il),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function xl(e){return this._weekdaysParseExact?(oe(this,"_weekdaysRegex")||Yn.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(oe(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ll),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Yn(){function e(c,h){return h.length-c.length}var t=[],n=[],r=[],l=[],o,a,m,u,i;for(o=0;o<7;o++)a=Je([2e3,1]).day(o),m=it(this.weekdaysMin(a,"")),u=it(this.weekdaysShort(a,"")),i=it(this.weekdays(a,"")),t.push(m),n.push(u),r.push(i),l.push(m),l.push(u),l.push(i);t.sort(e),n.sort(e),r.sort(e),l.sort(e),this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Un(){return this.hours()%12||12}function Nl(){return this.hours()||24}K("H",["HH",2],0,"hour"),K("h",["hh",2],0,Un),K("k",["kk",2],0,Nl),K("hmm",0,0,function(){return""+Un.apply(this)+et(this.minutes(),2)}),K("hmmss",0,0,function(){return""+Un.apply(this)+et(this.minutes(),2)+et(this.seconds(),2)}),K("Hmm",0,0,function(){return""+this.hours()+et(this.minutes(),2)}),K("Hmmss",0,0,function(){return""+this.hours()+et(this.minutes(),2)+et(this.seconds(),2)});function Br(e,t){K(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}Br("a",!0),Br("A",!1);function Gr(e,t){return t._meridiemParse}B("a",Gr),B("A",Gr),B("H",pe,kn),B("h",pe,Dt),B("k",pe,Dt),B("HH",pe,Pe),B("hh",pe,Pe),B("kk",pe,Pe),B("hmm",Er),B("hmmss",Rr),B("Hmm",Er),B("Hmmss",Rr),me(["H","HH"],Te),me(["k","kk"],function(e,t,n){var r=ae(e);t[Te]=r===24?0:r}),me(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),me(["h","hh"],function(e,t,n){t[Te]=ae(e),ne(n).bigHour=!0}),me("hmm",function(e,t,n){var r=e.length-2;t[Te]=ae(e.substr(0,r)),t[We]=ae(e.substr(r)),ne(n).bigHour=!0}),me("hmmss",function(e,t,n){var r=e.length-4,l=e.length-2;t[Te]=ae(e.substr(0,r)),t[We]=ae(e.substr(r,2)),t[ot]=ae(e.substr(l)),ne(n).bigHour=!0}),me("Hmm",function(e,t,n){var r=e.length-2;t[Te]=ae(e.substr(0,r)),t[We]=ae(e.substr(r))}),me("Hmmss",function(e,t,n){var r=e.length-4,l=e.length-2;t[Te]=ae(e.substr(0,r)),t[We]=ae(e.substr(r,2)),t[ot]=ae(e.substr(l))});function jl(e){return(e+"").toLowerCase().charAt(0)==="p"}var vl=/[ap]\.?m?\.?/i,_l=Yt("Hours",!0);function bl(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var Wr={calendar:hi,longDateFormat:pi,invalidDate:gi,ordinal:Ni,dayOfMonthOrdinalParse:ji,relativeTime:_i,months:Di,monthsShort:Pr,week:Qi,weekdays:nl,weekdaysMin:rl,weekdaysShort:Hr,meridiemParse:vl},xe={},ds={},hs;function Sl(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n+=1)if(e[n]!==t[n])return n;return r}function zr(e){return e&&e.toLowerCase().replace("_","-")}function Tl(e){for(var t=0,n,r,l,o;t<e.length;){for(o=zr(e[t]).split("-"),n=o.length,r=zr(e[t+1]),r=r?r.split("-"):null;n>0;){if(l=Us(o.slice(0,n).join("-")),l)return l;if(r&&r.length>=n&&Sl(o,r)>=n-1)break;n--}t++}return hs}function wl(e){return!!(e&&e.match("^[^/\\\\]*$"))}function Us(e){var t=null,n;if(xe[e]===void 0&&typeof module<"u"&&module&&module.exports&&wl(e))try{t=hs._abbr,n=require,n("./locale/"+e),jt(t)}catch{xe[e]=null}return xe[e]}function jt(e,t){var n;return e&&(Ee(t)?n=dt(e):n=$n(e,t),n?hs=n:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),hs._abbr}function $n(e,t){if(t!==null){var n,r=Wr;if(t.abbr=e,xe[e]!=null)Ir("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=xe[e]._config;else if(t.parentLocale!=null)if(xe[t.parentLocale]!=null)r=xe[t.parentLocale]._config;else if(n=Us(t.parentLocale),n!=null)r=n._config;else return ds[t.parentLocale]||(ds[t.parentLocale]=[]),ds[t.parentLocale].push({name:e,config:t}),null;return xe[e]=new Cn(In(r,t)),ds[e]&&ds[e].forEach(function(l){$n(l.name,l.config)}),jt(e),xe[e]}else return delete xe[e],null}function Il(e,t){if(t!=null){var n,r,l=Wr;xe[e]!=null&&xe[e].parentLocale!=null?xe[e].set(In(xe[e]._config,t)):(r=Us(e),r!=null&&(l=r._config),t=In(l,t),r==null&&(t.abbr=e),n=new Cn(t),n.parentLocale=xe[e],xe[e]=n),jt(e)}else xe[e]!=null&&(xe[e].parentLocale!=null?(xe[e]=xe[e].parentLocale,e===jt()&&jt(e)):xe[e]!=null&&delete xe[e]);return xe[e]}function dt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return hs;if(!Be(e)){if(t=Us(e),t)return t;e=[e]}return Tl(e)}function Cl(){return On(xe)}function Hn(e){var t,n=e._a;return n&&ne(e).overflow===-2&&(t=n[lt]<0||n[lt]>11?lt:n[tt]<1||n[tt]>Fn(n[Ie],n[lt])?tt:n[Te]<0||n[Te]>24||n[Te]===24&&(n[We]!==0||n[ot]!==0||n[wt]!==0)?Te:n[We]<0||n[We]>59?We:n[ot]<0||n[ot]>59?ot:n[wt]<0||n[wt]>999?wt:-1,ne(e)._overflowDayOfYear&&(t<Ie||t>tt)&&(t=tt),ne(e)._overflowWeeks&&t===-1&&(t=Ei),ne(e)._overflowWeekday&&t===-1&&(t=Ri),ne(e).overflow=t),e}var Ol=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ml=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Al=/Z|[+-]\d\d(?::?\d\d)?/,$s=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Bn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],El=/^\/?Date\((-?\d+)/i,Rl=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Ll={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Vr(e){var t,n,r=e._i,l=Ol.exec(r)||Ml.exec(r),o,a,m,u,i=$s.length,c=Bn.length;if(l){for(ne(e).iso=!0,t=0,n=i;t<n;t++)if($s[t][1].exec(l[1])){a=$s[t][0],o=$s[t][2]!==!1;break}if(a==null){e._isValid=!1;return}if(l[3]){for(t=0,n=c;t<n;t++)if(Bn[t][1].exec(l[3])){m=(l[2]||" ")+Bn[t][0];break}if(m==null){e._isValid=!1;return}}if(!o&&m!=null){e._isValid=!1;return}if(l[4])if(Al.exec(l[4]))u="Z";else{e._isValid=!1;return}e._f=a+(m||"")+(u||""),Wn(e)}else e._isValid=!1}function kl(e,t,n,r,l,o){var a=[Pl(e),Pr.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(l,10)];return o&&a.push(parseInt(o,10)),a}function Pl(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function Fl(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Dl(e,t,n){if(e){var r=Hr.indexOf(e),l=new Date(t[0],t[1],t[2]).getDay();if(r!==l)return ne(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function Yl(e,t,n){if(e)return Ll[e];if(t)return 0;var r=parseInt(n,10),l=r%100,o=(r-l)/100;return o*60+l}function qr(e){var t=Rl.exec(Fl(e._i)),n;if(t){if(n=kl(t[4],t[3],t[2],t[5],t[6],t[7]),!Dl(t[1],n,e))return;e._a=n,e._tzm=Yl(t[8],t[9],t[10]),e._d=os.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),ne(e).rfc2822=!0}else e._isValid=!1}function Ul(e){var t=El.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(Vr(e),e._isValid===!1)delete e._isValid;else return;if(qr(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:R.createFromInputFallback(e)}R.createFromInputFallback=Ue("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))});function Ut(e,t,n){return e??t??n}function $l(e){var t=new Date(R.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Gn(e){var t,n,r=[],l,o,a;if(!e._d){for(l=$l(e),e._w&&e._a[tt]==null&&e._a[lt]==null&&Hl(e),e._dayOfYear!=null&&(a=Ut(e._a[Ie],l[Ie]),(e._dayOfYear>is(a)||e._dayOfYear===0)&&(ne(e)._overflowDayOfYear=!0),n=os(a,0,e._dayOfYear),e._a[lt]=n.getUTCMonth(),e._a[tt]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=l[t];for(;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[Te]===24&&e._a[We]===0&&e._a[ot]===0&&e._a[wt]===0&&(e._nextDay=!0,e._a[Te]=0),e._d=(e._useUTC?os:qi).apply(null,r),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Te]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==o&&(ne(e).weekdayMismatch=!0)}}function Hl(e){var t,n,r,l,o,a,m,u,i;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(o=1,a=4,n=Ut(t.GG,e._a[Ie],cs(ye(),1,4).year),r=Ut(t.W,1),l=Ut(t.E,1),(l<1||l>7)&&(u=!0)):(o=e._locale._week.dow,a=e._locale._week.doy,i=cs(ye(),o,a),n=Ut(t.gg,e._a[Ie],i.year),r=Ut(t.w,i.week),t.d!=null?(l=t.d,(l<0||l>6)&&(u=!0)):t.e!=null?(l=t.e+o,(t.e<0||t.e>6)&&(u=!0)):l=o),r<1||r>ct(n,o,a)?ne(e)._overflowWeeks=!0:u!=null?ne(e)._overflowWeekday=!0:(m=$r(n,r,l,o,a),e._a[Ie]=m.year,e._dayOfYear=m.dayOfYear)}R.ISO_8601=function(){},R.RFC_2822=function(){};function Wn(e){if(e._f===R.ISO_8601){Vr(e);return}if(e._f===R.RFC_2822){qr(e);return}e._a=[],ne(e).empty=!0;var t=""+e._i,n,r,l,o,a,m=t.length,u=0,i,c;for(l=Cr(e._f,e._locale).match(Mn)||[],c=l.length,n=0;n<c;n++)o=l[n],r=(t.match(Oi(o,e))||[])[0],r&&(a=t.substr(0,t.indexOf(r)),a.length>0&&ne(e).unusedInput.push(a),t=t.slice(t.indexOf(r)+r.length),u+=r.length),Pt[o]?(r?ne(e).empty=!1:ne(e).unusedTokens.push(o),Ai(o,r,e)):e._strict&&!r&&ne(e).unusedTokens.push(o);ne(e).charsLeftOver=m-u,t.length>0&&ne(e).unusedInput.push(t),e._a[Te]<=12&&ne(e).bigHour===!0&&e._a[Te]>0&&(ne(e).bigHour=void 0),ne(e).parsedDateParts=e._a.slice(0),ne(e).meridiem=e._meridiem,e._a[Te]=Bl(e._locale,e._a[Te],e._meridiem),i=ne(e).era,i!==null&&(e._a[Ie]=e._locale.erasConvertYear(i,e._a[Ie])),Gn(e),Hn(e)}function Bl(e,t,n){var r;return n==null?t:e.meridiemHour!=null?e.meridiemHour(t,n):(e.isPM!=null&&(r=e.isPM(n),r&&t<12&&(t+=12),!r&&t===12&&(t=0)),t)}function Gl(e){var t,n,r,l,o,a,m=!1,u=e._f.length;if(u===0){ne(e).invalidFormat=!0,e._d=new Date(NaN);return}for(l=0;l<u;l++)o=0,a=!1,t=wn({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[l],Wn(t),Sn(t)&&(a=!0),o+=ne(t).charsLeftOver,o+=ne(t).unusedTokens.length*10,ne(t).score=o,m?o<r&&(r=o,n=t):(r==null||o<r||a)&&(r=o,n=t,a&&(m=!0));Nt(e,n||t)}function Wl(e){if(!e._d){var t=En(e._i),n=t.day===void 0?t.date:t.day;e._a=br([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(r){return r&&parseInt(r,10)}),Gn(e)}}function zl(e){var t=new ns(Hn(Kr(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Kr(e){var t=e._i,n=e._f;return e._locale=e._locale||dt(e._l),t===null||n===void 0&&t===""?Os({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),Ge(t)?new ns(Hn(t)):(ss(t)?e._d=t:Be(n)?Gl(e):n?Wn(e):Vl(e),Sn(e)||(e._d=null),e))}function Vl(e){var t=e._i;Ee(t)?e._d=new Date(R.now()):ss(t)?e._d=new Date(t.valueOf()):typeof t=="string"?Ul(e):Be(t)?(e._a=br(t.slice(0),function(n){return parseInt(n,10)}),Gn(e)):Tt(t)?Wl(e):at(t)?e._d=new Date(t):R.createFromInputFallback(e)}function Qr(e,t,n,r,l){var o={};return(t===!0||t===!1)&&(r=t,t=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(Tt(e)&&_n(e)||Be(e)&&e.length===0)&&(e=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=l,o._l=n,o._i=e,o._f=t,o._strict=r,zl(o)}function ye(e,t,n,r){return Qr(e,t,n,r,!1)}var ql=Ue("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=ye.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:Os()}),Kl=Ue("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=ye.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:Os()});function Zr(e,t){var n,r;if(t.length===1&&Be(t[0])&&(t=t[0]),!t.length)return ye();for(n=t[0],r=1;r<t.length;++r)(!t[r].isValid()||t[r][e](n))&&(n=t[r]);return n}function Ql(){var e=[].slice.call(arguments,0);return Zr("isBefore",e)}function Zl(){var e=[].slice.call(arguments,0);return Zr("isAfter",e)}var Jl=function(){return Date.now?Date.now():+new Date},us=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Xl(e){var t,n=!1,r,l=us.length;for(t in e)if(oe(e,t)&&!(je.call(us,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(r=0;r<l;++r)if(e[us[r]]){if(n)return!1;parseFloat(e[us[r]])!==ae(e[us[r]])&&(n=!0)}return!0}function eo(){return this._isValid}function to(){return ze(NaN)}function Hs(e){var t=En(e),n=t.year||0,r=t.quarter||0,l=t.month||0,o=t.week||t.isoWeek||0,a=t.day||0,m=t.hour||0,u=t.minute||0,i=t.second||0,c=t.millisecond||0;this._isValid=Xl(t),this._milliseconds=+c+i*1e3+u*6e4+m*1e3*60*60,this._days=+a+o*7,this._months=+l+r*3+n*12,this._data={},this._locale=dt(),this._bubble()}function Bs(e){return e instanceof Hs}function zn(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function so(e,t,n){var r=Math.min(e.length,t.length),l=Math.abs(e.length-t.length),o=0,a;for(a=0;a<r;a++)ae(e[a])!==ae(t[a])&&o++;return o+l}function Jr(e,t){K(e,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+et(~~(n/60),2)+t+et(~~n%60,2)})}Jr("Z",":"),Jr("ZZ",""),B("Z",Ps),B("ZZ",Ps),me(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Vn(Ps,e)});var no=/([\+\-]|\d\d)/gi;function Vn(e,t){var n=(t||"").match(e),r,l,o;return n===null?null:(r=n[n.length-1]||[],l=(r+"").match(no)||["-",0,0],o=+(l[1]*60)+ae(l[2]),o===0?0:l[0]==="+"?o:-o)}function qn(e,t){var n,r;return t._isUTC?(n=t.clone(),r=(Ge(e)||ss(e)?e.valueOf():ye(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),R.updateOffset(n,!1),n):ye(e).local()}function Kn(e){return-Math.round(e._d.getTimezoneOffset())}R.updateOffset=function(){};function ro(e,t,n){var r=this._offset||0,l;if(!this.isValid())return e!=null?this:NaN;if(e!=null){if(typeof e=="string"){if(e=Vn(Ps,e),e===null)return this}else Math.abs(e)<16&&!n&&(e=e*60);return!this._isUTC&&t&&(l=Kn(this)),this._offset=e,this._isUTC=!0,l!=null&&this.add(l,"m"),r!==e&&(!t||this._changeInProgress?sa(this,ze(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,R.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:Kn(this)}function ao(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function io(e){return this.utcOffset(0,e)}function lo(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Kn(this),"m")),this}function oo(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=Vn(Ii,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function co(e){return this.isValid()?(e=e?ye(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function ho(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function uo(){if(!Ee(this._isDSTShifted))return this._isDSTShifted;var e={},t;return wn(e,this),e=Kr(e),e._a?(t=e._isUTC?Je(e._a):ye(e._a),this._isDSTShifted=this.isValid()&&so(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function mo(){return this.isValid()?!this._isUTC:!1}function fo(){return this.isValid()?this._isUTC:!1}function Xr(){return this.isValid()?this._isUTC&&this._offset===0:!1}var po=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,yo=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ze(e,t){var n=e,r=null,l,o,a;return Bs(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:at(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(r=po.exec(e))?(l=r[1]==="-"?-1:1,n={y:0,d:ae(r[tt])*l,h:ae(r[Te])*l,m:ae(r[We])*l,s:ae(r[ot])*l,ms:ae(zn(r[wt]*1e3))*l}):(r=yo.exec(e))?(l=r[1]==="-"?-1:1,n={y:It(r[2],l),M:It(r[3],l),w:It(r[4],l),d:It(r[5],l),h:It(r[6],l),m:It(r[7],l),s:It(r[8],l)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(a=go(ye(n.from),ye(n.to)),n={},n.ms=a.milliseconds,n.M=a.months),o=new Hs(n),Bs(e)&&oe(e,"_locale")&&(o._locale=e._locale),Bs(e)&&oe(e,"_isValid")&&(o._isValid=e._isValid),o}ze.fn=Hs.prototype,ze.invalid=to;function It(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function ea(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function go(e,t){var n;return e.isValid()&&t.isValid()?(t=qn(t,e),e.isBefore(t)?n=ea(e,t):(n=ea(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function ta(e,t){return function(n,r){var l,o;return r!==null&&!isNaN(+r)&&(Ir(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=n,n=r,r=o),l=ze(n,r),sa(this,l,e),this}}function sa(e,t,n,r){var l=t._milliseconds,o=zn(t._days),a=zn(t._months);e.isValid()&&(r=r??!0,a&&Dr(e,ls(e,"Month")+a*n),o&&kr(e,"Date",ls(e,"Date")+o*n),l&&e._d.setTime(e._d.valueOf()+l*n),r&&R.updateOffset(e,o||a))}var xo=ta(1,"add"),No=ta(-1,"subtract");function na(e){return typeof e=="string"||e instanceof String}function jo(e){return Ge(e)||ss(e)||na(e)||at(e)||_o(e)||vo(e)||e===null||e===void 0}function vo(e){var t=Tt(e)&&!_n(e),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],l,o,a=r.length;for(l=0;l<a;l+=1)o=r[l],n=n||oe(e,o);return t&&n}function _o(e){var t=Be(e),n=!1;return t&&(n=e.filter(function(r){return!at(r)&&na(e)}).length===0),t&&n}function bo(e){var t=Tt(e)&&!_n(e),n=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],l,o;for(l=0;l<r.length;l+=1)o=r[l],n=n||oe(e,o);return t&&n}function So(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function To(e,t){arguments.length===1&&(arguments[0]?jo(arguments[0])?(e=arguments[0],t=void 0):bo(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||ye(),r=qn(n,this).startOf("day"),l=R.calendarFormat(this,r)||"sameElse",o=t&&(Xe(t[l])?t[l].call(this,n):t[l]);return this.format(o||this.localeData().calendar(l,this,ye(n)))}function wo(){return new ns(this)}function Io(e,t){var n=Ge(e)?e:ye(e);return this.isValid()&&n.isValid()?(t=$e(t)||"millisecond",t==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function Co(e,t){var n=Ge(e)?e:ye(e);return this.isValid()&&n.isValid()?(t=$e(t)||"millisecond",t==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function Oo(e,t,n,r){var l=Ge(e)?e:ye(e),o=Ge(t)?t:ye(t);return this.isValid()&&l.isValid()&&o.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(l,n):!this.isBefore(l,n))&&(r[1]===")"?this.isBefore(o,n):!this.isAfter(o,n))):!1}function Mo(e,t){var n=Ge(e)?e:ye(e),r;return this.isValid()&&n.isValid()?(t=$e(t)||"millisecond",t==="millisecond"?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(t).valueOf()<=r&&r<=this.clone().endOf(t).valueOf())):!1}function Ao(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Eo(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Ro(e,t,n){var r,l,o;if(!this.isValid())return NaN;if(r=qn(e,this),!r.isValid())return NaN;switch(l=(r.utcOffset()-this.utcOffset())*6e4,t=$e(t),t){case"year":o=Gs(this,r)/12;break;case"month":o=Gs(this,r);break;case"quarter":o=Gs(this,r)/3;break;case"second":o=(this-r)/1e3;break;case"minute":o=(this-r)/6e4;break;case"hour":o=(this-r)/36e5;break;case"day":o=(this-r-l)/864e5;break;case"week":o=(this-r-l)/6048e5;break;default:o=this-r}return n?o:He(o)}function Gs(e,t){if(e.date()<t.date())return-Gs(t,e);var n=(t.year()-e.year())*12+(t.month()-e.month()),r=e.clone().add(n,"months"),l,o;return t-r<0?(l=e.clone().add(n-1,"months"),o=(t-r)/(r-l)):(l=e.clone().add(n+1,"months"),o=(t-r)/(l-r)),-(n+o)||0}R.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",R.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Lo(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ko(e){if(!this.isValid())return null;var t=e!==!0,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?As(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Xe(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",As(n,"Z")):As(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Po(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",n,r,l,o;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",l="-MM-DD[T]HH:mm:ss.SSS",o=t+'[")]',this.format(n+r+l+o)}function Fo(e){e||(e=this.isUtc()?R.defaultFormatUtc:R.defaultFormat);var t=As(this,e);return this.localeData().postformat(t)}function Do(e,t){return this.isValid()&&(Ge(e)&&e.isValid()||ye(e).isValid())?ze({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Yo(e){return this.from(ye(),e)}function Uo(e,t){return this.isValid()&&(Ge(e)&&e.isValid()||ye(e).isValid())?ze({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function $o(e){return this.to(ye(),e)}function ra(e){var t;return e===void 0?this._locale._abbr:(t=dt(e),t!=null&&(this._locale=t),this)}var aa=Ue("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function ia(){return this._locale}var Ws=1e3,$t=60*Ws,zs=60*$t,la=(365*400+97)*24*zs;function Ht(e,t){return(e%t+t)%t}function oa(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-la:new Date(e,t,n).valueOf()}function ca(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-la:Date.UTC(e,t,n)}function Ho(e){var t,n;if(e=$e(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?ca:oa,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=Ht(t+(this._isUTC?0:this.utcOffset()*$t),zs);break;case"minute":t=this._d.valueOf(),t-=Ht(t,$t);break;case"second":t=this._d.valueOf(),t-=Ht(t,Ws);break}return this._d.setTime(t),R.updateOffset(this,!0),this}function Bo(e){var t,n;if(e=$e(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?ca:oa,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=zs-Ht(t+(this._isUTC?0:this.utcOffset()*$t),zs)-1;break;case"minute":t=this._d.valueOf(),t+=$t-Ht(t,$t)-1;break;case"second":t=this._d.valueOf(),t+=Ws-Ht(t,Ws)-1;break}return this._d.setTime(t),R.updateOffset(this,!0),this}function Go(){return this._d.valueOf()-(this._offset||0)*6e4}function Wo(){return Math.floor(this.valueOf()/1e3)}function zo(){return new Date(this.valueOf())}function Vo(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function qo(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Ko(){return this.isValid()?this.toISOString():null}function Qo(){return Sn(this)}function Zo(){return Nt({},ne(this))}function Jo(){return ne(this).overflow}function Xo(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}K("N",0,0,"eraAbbr"),K("NN",0,0,"eraAbbr"),K("NNN",0,0,"eraAbbr"),K("NNNN",0,0,"eraName"),K("NNNNN",0,0,"eraNarrow"),K("y",["y",1],"yo","eraYear"),K("y",["yy",2],0,"eraYear"),K("y",["yyy",3],0,"eraYear"),K("y",["yyyy",4],0,"eraYear"),B("N",Qn),B("NN",Qn),B("NNN",Qn),B("NNNN",dc),B("NNNNN",hc),me(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var l=n._locale.erasParse(e,r,n._strict);l?ne(n).era=l:ne(n).invalidEra=e}),B("y",Ft),B("yy",Ft),B("yyy",Ft),B("yyyy",Ft),B("yo",uc),me(["y","yy","yyy","yyyy"],Ie),me(["yo"],function(e,t,n,r){var l;n._locale._eraYearOrdinalRegex&&(l=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Ie]=n._locale.eraYearOrdinalParse(e,l):t[Ie]=parseInt(e,10)});function ec(e,t){var n,r,l,o=this._eras||dt("en")._eras;for(n=0,r=o.length;n<r;++n){switch(typeof o[n].since){case"string":l=R(o[n].since).startOf("day"),o[n].since=l.valueOf();break}switch(typeof o[n].until){case"undefined":o[n].until=1/0;break;case"string":l=R(o[n].until).startOf("day").valueOf(),o[n].until=l.valueOf();break}}return o}function tc(e,t,n){var r,l,o=this.eras(),a,m,u;for(e=e.toUpperCase(),r=0,l=o.length;r<l;++r)if(a=o[r].name.toUpperCase(),m=o[r].abbr.toUpperCase(),u=o[r].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(m===e)return o[r];break;case"NNNN":if(a===e)return o[r];break;case"NNNNN":if(u===e)return o[r];break}else if([a,m,u].indexOf(e)>=0)return o[r]}function sc(e,t){var n=e.since<=e.until?1:-1;return t===void 0?R(e.since).year():R(e.since).year()+(t-e.offset)*n}function nc(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].name;return""}function rc(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].narrow;return""}function ac(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].abbr;return""}function ic(){var e,t,n,r,l=this.localeData().eras();for(e=0,t=l.length;e<t;++e)if(n=l[e].since<=l[e].until?1:-1,r=this.clone().startOf("day").valueOf(),l[e].since<=r&&r<=l[e].until||l[e].until<=r&&r<=l[e].since)return(this.year()-R(l[e].since).year())*n+l[e].offset;return this.year()}function lc(e){return oe(this,"_erasNameRegex")||Zn.call(this),e?this._erasNameRegex:this._erasRegex}function oc(e){return oe(this,"_erasAbbrRegex")||Zn.call(this),e?this._erasAbbrRegex:this._erasRegex}function cc(e){return oe(this,"_erasNarrowRegex")||Zn.call(this),e?this._erasNarrowRegex:this._erasRegex}function Qn(e,t){return t.erasAbbrRegex(e)}function dc(e,t){return t.erasNameRegex(e)}function hc(e,t){return t.erasNarrowRegex(e)}function uc(e,t){return t._eraYearOrdinalRegex||Ft}function Zn(){var e=[],t=[],n=[],r=[],l,o,a,m,u,i=this.eras();for(l=0,o=i.length;l<o;++l)a=it(i[l].name),m=it(i[l].abbr),u=it(i[l].narrow),t.push(a),e.push(m),n.push(u),r.push(a),r.push(m),r.push(u);this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}K(0,["gg",2],0,function(){return this.weekYear()%100}),K(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Vs(e,t){K(0,[e,e.length],0,t)}Vs("gggg","weekYear"),Vs("ggggg","weekYear"),Vs("GGGG","isoWeekYear"),Vs("GGGGG","isoWeekYear"),B("G",ks),B("g",ks),B("GG",pe,Pe),B("gg",pe,Pe),B("GGGG",Ln,Rn),B("gggg",Ln,Rn),B("GGGGG",Ls,Es),B("ggggg",Ls,Es),as(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=ae(e)}),as(["gg","GG"],function(e,t,n,r){t[r]=R.parseTwoDigitYear(e)});function mc(e){return da.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function fc(e){return da.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function pc(){return ct(this.year(),1,4)}function yc(){return ct(this.isoWeekYear(),1,4)}function gc(){var e=this.localeData()._week;return ct(this.year(),e.dow,e.doy)}function xc(){var e=this.localeData()._week;return ct(this.weekYear(),e.dow,e.doy)}function da(e,t,n,r,l){var o;return e==null?cs(this,r,l).year:(o=ct(e,r,l),t>o&&(t=o),Nc.call(this,e,t,n,r,l))}function Nc(e,t,n,r,l){var o=$r(e,t,n,r,l),a=os(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}K("Q",0,"Qo","quarter"),B("Q",Mr),me("Q",function(e,t){t[lt]=(ae(e)-1)*3});function jc(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}K("D",["DD",2],"Do","date"),B("D",pe,Dt),B("DD",pe,Pe),B("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),me(["D","DD"],tt),me("Do",function(e,t){t[tt]=ae(e.match(pe)[0])});var ha=Yt("Date",!0);K("DDD",["DDDD",3],"DDDo","dayOfYear"),B("DDD",Rs),B("DDDD",Ar),me(["DDD","DDDD"],function(e,t,n){n._dayOfYear=ae(e)});function vc(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}K("m",["mm",2],0,"minute"),B("m",pe,kn),B("mm",pe,Pe),me(["m","mm"],We);var _c=Yt("Minutes",!1);K("s",["ss",2],0,"second"),B("s",pe,kn),B("ss",pe,Pe),me(["s","ss"],ot);var bc=Yt("Seconds",!1);K("S",0,0,function(){return~~(this.millisecond()/100)}),K(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),K(0,["SSS",3],0,"millisecond"),K(0,["SSSS",4],0,function(){return this.millisecond()*10}),K(0,["SSSSS",5],0,function(){return this.millisecond()*100}),K(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),K(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),K(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),K(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),B("S",Rs,Mr),B("SS",Rs,Pe),B("SSS",Rs,Ar);var vt,ua;for(vt="SSSS";vt.length<=9;vt+="S")B(vt,Ft);function Sc(e,t){t[wt]=ae(("0."+e)*1e3)}for(vt="S";vt.length<=9;vt+="S")me(vt,Sc);ua=Yt("Milliseconds",!1),K("z",0,0,"zoneAbbr"),K("zz",0,0,"zoneName");function Tc(){return this._isUTC?"UTC":""}function wc(){return this._isUTC?"Coordinated Universal Time":""}var M=ns.prototype;M.add=xo,M.calendar=To,M.clone=wo,M.diff=Ro,M.endOf=Bo,M.format=Fo,M.from=Do,M.fromNow=Yo,M.to=Uo,M.toNow=$o,M.get=ki,M.invalidAt=Jo,M.isAfter=Io,M.isBefore=Co,M.isBetween=Oo,M.isSame=Mo,M.isSameOrAfter=Ao,M.isSameOrBefore=Eo,M.isValid=Qo,M.lang=aa,M.locale=ra,M.localeData=ia,M.max=Kl,M.min=ql,M.parsingFlags=Zo,M.set=Pi,M.startOf=Ho,M.subtract=No,M.toArray=Vo,M.toObject=qo,M.toDate=zo,M.toISOString=ko,M.inspect=Po,typeof Symbol<"u"&&Symbol.for!=null&&(M[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),M.toJSON=Ko,M.toString=Lo,M.unix=Wo,M.valueOf=Go,M.creationData=Xo,M.eraName=nc,M.eraNarrow=rc,M.eraAbbr=ac,M.eraYear=ic,M.year=Lr,M.isLeapYear=Li,M.weekYear=mc,M.isoWeekYear=fc,M.quarter=M.quarters=jc,M.month=Yr,M.daysInMonth=Wi,M.week=M.weeks=Xi,M.isoWeek=M.isoWeeks=el,M.weeksInYear=gc,M.weeksInWeekYear=xc,M.isoWeeksInYear=pc,M.isoWeeksInISOWeekYear=yc,M.date=ha,M.day=M.days=ml,M.weekday=fl,M.isoWeekday=pl,M.dayOfYear=vc,M.hour=M.hours=_l,M.minute=M.minutes=_c,M.second=M.seconds=bc,M.millisecond=M.milliseconds=ua,M.utcOffset=ro,M.utc=io,M.local=lo,M.parseZone=oo,M.hasAlignedHourOffset=co,M.isDST=ho,M.isLocal=mo,M.isUtcOffset=fo,M.isUtc=Xr,M.isUTC=Xr,M.zoneAbbr=Tc,M.zoneName=wc,M.dates=Ue("dates accessor is deprecated. Use date instead.",ha),M.months=Ue("months accessor is deprecated. Use month instead",Yr),M.years=Ue("years accessor is deprecated. Use year instead",Lr),M.zone=Ue("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",ao),M.isDSTShifted=Ue("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",uo);function Ic(e){return ye(e*1e3)}function Cc(){return ye.apply(null,arguments).parseZone()}function ma(e){return e}var ce=Cn.prototype;ce.calendar=ui,ce.longDateFormat=yi,ce.invalidDate=xi,ce.ordinal=vi,ce.preparse=ma,ce.postformat=ma,ce.relativeTime=bi,ce.pastFuture=Si,ce.set=di,ce.eras=ec,ce.erasParse=tc,ce.erasConvertYear=sc,ce.erasAbbrRegex=oc,ce.erasNameRegex=lc,ce.erasNarrowRegex=cc,ce.months=$i,ce.monthsShort=Hi,ce.monthsParse=Gi,ce.monthsRegex=Vi,ce.monthsShortRegex=zi,ce.week=Ki,ce.firstDayOfYear=Ji,ce.firstDayOfWeek=Zi,ce.weekdays=ol,ce.weekdaysMin=dl,ce.weekdaysShort=cl,ce.weekdaysParse=ul,ce.weekdaysRegex=yl,ce.weekdaysShortRegex=gl,ce.weekdaysMinRegex=xl,ce.isPM=jl,ce.meridiem=bl;function qs(e,t,n,r){var l=dt(),o=Je().set(r,t);return l[n](o,e)}function fa(e,t,n){if(at(e)&&(t=e,e=void 0),e=e||"",t!=null)return qs(e,t,n,"month");var r,l=[];for(r=0;r<12;r++)l[r]=qs(e,r,n,"month");return l}function Jn(e,t,n,r){typeof e=="boolean"?(at(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,at(t)&&(n=t,t=void 0),t=t||"");var l=dt(),o=e?l._week.dow:0,a,m=[];if(n!=null)return qs(t,(n+o)%7,r,"day");for(a=0;a<7;a++)m[a]=qs(t,(a+o)%7,r,"day");return m}function Oc(e,t){return fa(e,t,"months")}function Mc(e,t){return fa(e,t,"monthsShort")}function Ac(e,t,n){return Jn(e,t,n,"weekdays")}function Ec(e,t,n){return Jn(e,t,n,"weekdaysShort")}function Rc(e,t,n){return Jn(e,t,n,"weekdaysMin")}jt("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=ae(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}}),R.lang=Ue("moment.lang is deprecated. Use moment.locale instead.",jt),R.langData=Ue("moment.langData is deprecated. Use moment.localeData instead.",dt);var ht=Math.abs;function Lc(){var e=this._data;return this._milliseconds=ht(this._milliseconds),this._days=ht(this._days),this._months=ht(this._months),e.milliseconds=ht(e.milliseconds),e.seconds=ht(e.seconds),e.minutes=ht(e.minutes),e.hours=ht(e.hours),e.months=ht(e.months),e.years=ht(e.years),this}function pa(e,t,n,r){var l=ze(t,n);return e._milliseconds+=r*l._milliseconds,e._days+=r*l._days,e._months+=r*l._months,e._bubble()}function kc(e,t){return pa(this,e,t,1)}function Pc(e,t){return pa(this,e,t,-1)}function ya(e){return e<0?Math.floor(e):Math.ceil(e)}function Fc(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,l,o,a,m,u;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=ya(Xn(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,l=He(e/1e3),r.seconds=l%60,o=He(l/60),r.minutes=o%60,a=He(o/60),r.hours=a%24,t+=He(a/24),u=He(ga(t)),n+=u,t-=ya(Xn(u)),m=He(n/12),n%=12,r.days=t,r.months=n,r.years=m,this}function ga(e){return e*4800/146097}function Xn(e){return e*146097/4800}function Dc(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=$e(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+r/864e5,n=this._months+ga(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Xn(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return t*24+r/36e5;case"minute":return t*1440+r/6e4;case"second":return t*86400+r/1e3;case"millisecond":return Math.floor(t*864e5)+r;default:throw new Error("Unknown unit "+e)}}function ut(e){return function(){return this.as(e)}}var xa=ut("ms"),Yc=ut("s"),Uc=ut("m"),$c=ut("h"),Hc=ut("d"),Bc=ut("w"),Gc=ut("M"),Wc=ut("Q"),zc=ut("y"),Vc=xa;function qc(){return ze(this)}function Kc(e){return e=$e(e),this.isValid()?this[e+"s"]():NaN}function Ct(e){return function(){return this.isValid()?this._data[e]:NaN}}var Qc=Ct("milliseconds"),Zc=Ct("seconds"),Jc=Ct("minutes"),Xc=Ct("hours"),ed=Ct("days"),td=Ct("months"),sd=Ct("years");function nd(){return He(this.days()/7)}var mt=Math.round,Bt={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function rd(e,t,n,r,l){return l.relativeTime(t||1,!!n,e,r)}function ad(e,t,n,r){var l=ze(e).abs(),o=mt(l.as("s")),a=mt(l.as("m")),m=mt(l.as("h")),u=mt(l.as("d")),i=mt(l.as("M")),c=mt(l.as("w")),h=mt(l.as("y")),f=o<=n.ss&&["s",o]||o<n.s&&["ss",o]||a<=1&&["m"]||a<n.m&&["mm",a]||m<=1&&["h"]||m<n.h&&["hh",m]||u<=1&&["d"]||u<n.d&&["dd",u];return n.w!=null&&(f=f||c<=1&&["w"]||c<n.w&&["ww",c]),f=f||i<=1&&["M"]||i<n.M&&["MM",i]||h<=1&&["y"]||["yy",h],f[2]=t,f[3]=+e>0,f[4]=r,rd.apply(null,f)}function id(e){return e===void 0?mt:typeof e=="function"?(mt=e,!0):!1}function ld(e,t){return Bt[e]===void 0?!1:t===void 0?Bt[e]:(Bt[e]=t,e==="s"&&(Bt.ss=t-1),!0)}function od(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=Bt,l,o;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(n=e),typeof t=="object"&&(r=Object.assign({},Bt,t),t.s!=null&&t.ss==null&&(r.ss=t.s-1)),l=this.localeData(),o=ad(this,!n,r,l),n&&(o=l.pastFuture(+this,o)),l.postformat(o)}var er=Math.abs;function Gt(e){return(e>0)-(e<0)||+e}function Ks(){if(!this.isValid())return this.localeData().invalidDate();var e=er(this._milliseconds)/1e3,t=er(this._days),n=er(this._months),r,l,o,a,m=this.asSeconds(),u,i,c,h;return m?(r=He(e/60),l=He(r/60),e%=60,r%=60,o=He(n/12),n%=12,a=e?e.toFixed(3).replace(/\.?0+$/,""):"",u=m<0?"-":"",i=Gt(this._months)!==Gt(m)?"-":"",c=Gt(this._days)!==Gt(m)?"-":"",h=Gt(this._milliseconds)!==Gt(m)?"-":"",u+"P"+(o?i+o+"Y":"")+(n?i+n+"M":"")+(t?c+t+"D":"")+(l||r||e?"T":"")+(l?h+l+"H":"")+(r?h+r+"M":"")+(e?h+a+"S":"")):"P0D"}var ie=Hs.prototype;ie.isValid=eo,ie.abs=Lc,ie.add=kc,ie.subtract=Pc,ie.as=Dc,ie.asMilliseconds=xa,ie.asSeconds=Yc,ie.asMinutes=Uc,ie.asHours=$c,ie.asDays=Hc,ie.asWeeks=Bc,ie.asMonths=Gc,ie.asQuarters=Wc,ie.asYears=zc,ie.valueOf=Vc,ie._bubble=Fc,ie.clone=qc,ie.get=Kc,ie.milliseconds=Qc,ie.seconds=Zc,ie.minutes=Jc,ie.hours=Xc,ie.days=ed,ie.weeks=nd,ie.months=td,ie.years=sd,ie.humanize=od,ie.toISOString=Ks,ie.toString=Ks,ie.toJSON=Ks,ie.locale=ra,ie.localeData=ia,ie.toIsoString=Ue("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ks),ie.lang=aa,K("X",0,0,"unix"),K("x",0,0,"valueOf"),B("x",ks),B("X",Ci),me("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)}),me("x",function(e,t,n){n._d=new Date(ae(e))});//! moment.js
39
+ R.version="2.30.1",oi(ye),R.fn=M,R.min=Ql,R.max=Zl,R.now=Jl,R.utc=Je,R.unix=Ic,R.months=Oc,R.isDate=ss,R.locale=jt,R.invalid=Os,R.duration=ze,R.isMoment=Ge,R.weekdays=Ac,R.parseZone=Cc,R.localeData=dt,R.isDuration=Bs,R.monthsShort=Mc,R.weekdaysMin=Rc,R.defineLocale=$n,R.updateLocale=Il,R.locales=Cl,R.weekdaysShort=Ec,R.normalizeUnits=$e,R.relativeTimeRounding=id,R.relativeTimeThreshold=ld,R.calendarFormat=So,R.prototype=M,R.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const ft=(e,t,n)=>{let r;for(let l=0;l<(e==null?void 0:e.length);l++)if(r=e[l],r[n]==t)return r;return new Object},Ve=e=>{if(!e)return"";e=e.toLowerCase();let t=e.split(" ");for(let n=0;n<t.length;n++)t[n]=t[n].charAt(0).toUpperCase()+t[n].slice(1);return t.join(" ")},ms=(e,t)=>{let n,r=new Object;if(e&&e.length>0)for(let l=0;l<e.length;l++)n=e[l],r[n[t]]=n;return r},cd=e=>{let t,n=new Object;for(let r=0;r<e.length;r++)t=e[r],n[t]=t;return n},dd=(e,t)=>(e.sort((n,r)=>r[t]-n[t]),e);var Qs={exports:{}};/*! @preserve
40
40
  * numeral.js
41
41
  * version : 2.0.6
42
42
  * author : Adam Draper
43
43
  * license : MIT
44
44
  * http://adamwdraper.github.com/Numeral-js/
45
- */var hd=Qs.exports,Na;function ud(){return Na||(Na=1,function(e){(function(t,n){e.exports?e.exports=n():t.numeral=n()})(hd,function(){var t,n,r="2.0.6",i={},a={},u={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},f={currentLocale:u.currentLocale,zeroFormat:u.zeroFormat,nullFormat:u.nullFormat,defaultFormat:u.defaultFormat,scalePercentBy100:u.scalePercentBy100};function o(l,c){this._input=l,this._value=c}return t=function(l){var c,h,p,m;if(t.isNumeral(l))c=l.value();else if(l===0||typeof l>"u")c=0;else if(l===null||n.isNaN(l))c=null;else if(typeof l=="string")if(f.zeroFormat&&l===f.zeroFormat)c=0;else if(f.nullFormat&&l===f.nullFormat||!l.replace(/[^0-9]+/g,"").length)c=null;else{for(h in i)if(m=typeof i[h].regexps.unformat=="function"?i[h].regexps.unformat():i[h].regexps.unformat,m&&l.match(m)){p=i[h].unformat;break}p=p||t._.stringToNumber,c=p(l)}else c=Number(l)||null;return new o(l,c)},t.version=r,t.isNumeral=function(l){return l instanceof o},t._=n={numberToFormat:function(l,c,h){var p=a[t.options.currentLocale],m=!1,g=!1,v=0,_="",E=1e12,S=1e9,w=1e6,D=1e3,$="",P=!1,Z,ne,te,le,Se,Q,J;if(l=l||0,ne=Math.abs(l),t._.includes(c,"(")?(m=!0,c=c.replace(/[\(|\)]/g,"")):(t._.includes(c,"+")||t._.includes(c,"-"))&&(Se=t._.includes(c,"+")?c.indexOf("+"):l<0?c.indexOf("-"):-1,c=c.replace(/[\+|\-]/g,"")),t._.includes(c,"a")&&(Z=c.match(/a(k|m|b|t)?/),Z=Z?Z[1]:!1,t._.includes(c," a")&&(_=" "),c=c.replace(new RegExp(_+"a[kmbt]?"),""),ne>=E&&!Z||Z==="t"?(_+=p.abbreviations.trillion,l=l/E):ne<E&&ne>=S&&!Z||Z==="b"?(_+=p.abbreviations.billion,l=l/S):ne<S&&ne>=w&&!Z||Z==="m"?(_+=p.abbreviations.million,l=l/w):(ne<w&&ne>=D&&!Z||Z==="k")&&(_+=p.abbreviations.thousand,l=l/D)),t._.includes(c,"[.]")&&(g=!0,c=c.replace("[.]",".")),te=l.toString().split(".")[0],le=c.split(".")[1],Q=c.indexOf(","),v=(c.split(".")[0].split(",")[0].match(/0/g)||[]).length,le?(t._.includes(le,"[")?(le=le.replace("]",""),le=le.split("["),$=t._.toFixed(l,le[0].length+le[1].length,h,le[1].length)):$=t._.toFixed(l,le.length,h),te=$.split(".")[0],t._.includes($,".")?$=p.delimiters.decimal+$.split(".")[1]:$="",g&&Number($.slice(1))===0&&($="")):te=t._.toFixed(l,0,h),_&&!Z&&Number(te)>=1e3&&_!==p.abbreviations.trillion)switch(te=String(Number(te)/1e3),_){case p.abbreviations.thousand:_=p.abbreviations.million;break;case p.abbreviations.million:_=p.abbreviations.billion;break;case p.abbreviations.billion:_=p.abbreviations.trillion;break}if(t._.includes(te,"-")&&(te=te.slice(1),P=!0),te.length<v)for(var z=v-te.length;z>0;z--)te="0"+te;return Q>-1&&(te=te.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+p.delimiters.thousands)),c.indexOf(".")===0&&(te=""),J=te+$+(_||""),m?J=(m&&P?"(":"")+J+(m&&P?")":""):Se>=0?J=Se===0?(P?"-":"+")+J:J+(P?"-":"+"):P&&(J="-"+J),J},stringToNumber:function(l){var c=a[f.currentLocale],h=l,p={thousand:3,million:6,billion:9,trillion:12},m,g,v;if(f.zeroFormat&&l===f.zeroFormat)g=0;else if(f.nullFormat&&l===f.nullFormat||!l.replace(/[^0-9]+/g,"").length)g=null;else{g=1,c.delimiters.decimal!=="."&&(l=l.replace(/\./g,"").replace(c.delimiters.decimal,"."));for(m in p)if(v=new RegExp("[^a-zA-Z]"+c.abbreviations[m]+"(?:\\)|(\\"+c.currency.symbol+")?(?:\\))?)?$"),h.match(v)){g*=Math.pow(10,p[m]);break}g*=(l.split("-").length+Math.min(l.split("(").length-1,l.split(")").length-1))%2?1:-1,l=l.replace(/[^0-9\.]+/g,""),g*=Number(l)}return g},isNaN:function(l){return typeof l=="number"&&isNaN(l)},includes:function(l,c){return l.indexOf(c)!==-1},insert:function(l,c,h){return l.slice(0,h)+c+l.slice(h)},reduce:function(l,c){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof c!="function")throw new TypeError(c+" is not a function");var h=Object(l),p=h.length>>>0,m=0,g;if(arguments.length===3)g=arguments[2];else{for(;m<p&&!(m in h);)m++;if(m>=p)throw new TypeError("Reduce of empty array with no initial value");g=h[m++]}for(;m<p;m++)m in h&&(g=c(g,h[m],m,h));return g},multiplier:function(l){var c=l.toString().split(".");return c.length<2?1:Math.pow(10,c[1].length)},correctionFactor:function(){var l=Array.prototype.slice.call(arguments);return l.reduce(function(c,h){var p=n.multiplier(h);return c>p?c:p},1)},toFixed:function(l,c,h,p){var m=l.toString().split("."),g=c-(p||0),v,_,E,S;return m.length===2?v=Math.min(Math.max(m[1].length,g),c):v=g,E=Math.pow(10,v),S=(h(l+"e+"+v)/E).toFixed(v),p>c-v&&(_=new RegExp("\\.?0{1,"+(p-(c-v))+"}$"),S=S.replace(_,"")),S}},t.options=f,t.formats=i,t.locales=a,t.locale=function(l){return l&&(f.currentLocale=l.toLowerCase()),f.currentLocale},t.localeData=function(l){if(!l)return a[f.currentLocale];if(l=l.toLowerCase(),!a[l])throw new Error("Unknown locale : "+l);return a[l]},t.reset=function(){for(var l in u)f[l]=u[l]},t.zeroFormat=function(l){f.zeroFormat=typeof l=="string"?l:null},t.nullFormat=function(l){f.nullFormat=typeof l=="string"?l:null},t.defaultFormat=function(l){f.defaultFormat=typeof l=="string"?l:"0.0"},t.register=function(l,c,h){if(c=c.toLowerCase(),this[l+"s"][c])throw new TypeError(c+" "+l+" already registered.");return this[l+"s"][c]=h,h},t.validate=function(l,c){var h,p,m,g,v,_,E,S;if(typeof l!="string"&&(l+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",l)),l=l.trim(),l.match(/^\d+$/))return!0;if(l==="")return!1;try{E=t.localeData(c)}catch{E=t.localeData(t.locale())}return m=E.currency.symbol,v=E.abbreviations,h=E.delimiters.decimal,E.delimiters.thousands==="."?p="\\.":p=E.delimiters.thousands,S=l.match(/^[^\d]+/),S!==null&&(l=l.substr(1),S[0]!==m)||(S=l.match(/[^\d]+$/),S!==null&&(l=l.slice(0,-1),S[0]!==v.thousand&&S[0]!==v.million&&S[0]!==v.billion&&S[0]!==v.trillion))?!1:(_=new RegExp(p+"{2}"),l.match(/[^\d.,]/g)?!1:(g=l.split(h),g.length>2?!1:g.length<2?!!g[0].match(/^\d+.*\d$/)&&!g[0].match(_):g[0].length===1?!!g[0].match(/^\d+$/)&&!g[0].match(_)&&!!g[1].match(/^\d+$/):!!g[0].match(/^\d+.*\d$/)&&!g[0].match(_)&&!!g[1].match(/^\d+$/)))},t.fn=o.prototype={clone:function(){return t(this)},format:function(l,c){var h=this._value,p=l||f.defaultFormat,m,g,v;if(c=c||Math.round,h===0&&f.zeroFormat!==null)g=f.zeroFormat;else if(h===null&&f.nullFormat!==null)g=f.nullFormat;else{for(m in i)if(p.match(i[m].regexps.format)){v=i[m].format;break}v=v||t._.numberToFormat,g=v(h,p,c)}return g},value:function(){return this._value},input:function(){return this._input},set:function(l){return this._value=Number(l),this},add:function(l){var c=n.correctionFactor.call(null,this._value,l);function h(p,m,g,v){return p+Math.round(c*m)}return this._value=n.reduce([this._value,l],h,0)/c,this},subtract:function(l){var c=n.correctionFactor.call(null,this._value,l);function h(p,m,g,v){return p-Math.round(c*m)}return this._value=n.reduce([l],h,Math.round(this._value*c))/c,this},multiply:function(l){function c(h,p,m,g){var v=n.correctionFactor(h,p);return Math.round(h*v)*Math.round(p*v)/Math.round(v*v)}return this._value=n.reduce([this._value,l],c,1),this},divide:function(l){function c(h,p,m,g){var v=n.correctionFactor(h,p);return Math.round(h*v)/Math.round(p*v)}return this._value=n.reduce([this._value,l],c),this},difference:function(l){return Math.abs(t(this._value).subtract(l).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(l){var c=l%10;return~~(l%100/10)===1?"th":c===1?"st":c===2?"nd":c===3?"rd":"th"},currency:{symbol:"$"}}),function(){t.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(l,c,h){var p=t._.includes(c," BPS")?" ":"",m;return l=l*1e4,c=c.replace(/\s?BPS/,""),m=t._.numberToFormat(l,c,h),t._.includes(m,")")?(m=m.split(""),m.splice(-1,0,p+"BPS"),m=m.join("")):m=m+p+"BPS",m},unformat:function(l){return+(t._.stringToNumber(l)*1e-4).toFixed(15)}})}(),function(){var l={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},c={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},h=l.suffixes.concat(c.suffixes.filter(function(m){return l.suffixes.indexOf(m)<0})),p=h.join("|");p="("+p.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(p)},format:function(m,g,v){var _,E=t._.includes(g,"ib")?c:l,S=t._.includes(g," b")||t._.includes(g," ib")?" ":"",w,D,$;for(g=g.replace(/\s?i?b/,""),w=0;w<=E.suffixes.length;w++)if(D=Math.pow(E.base,w),$=Math.pow(E.base,w+1),m===null||m===0||m>=D&&m<$){S+=E.suffixes[w],D>0&&(m=m/D);break}return _=t._.numberToFormat(m,g,v),_+S},unformat:function(m){var g=t._.stringToNumber(m),v,_;if(g){for(v=l.suffixes.length-1;v>=0;v--){if(t._.includes(m,l.suffixes[v])){_=Math.pow(l.base,v);break}if(t._.includes(m,c.suffixes[v])){_=Math.pow(c.base,v);break}}g*=_||1}return g}})}(),function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(l,c,h){var p=t.locales[t.options.currentLocale],m={before:c.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:c.match(/([\+|\-|\)|\s|\$]*)$/)[0]},g,v,_;for(c=c.replace(/\s?\$\s?/,""),g=t._.numberToFormat(l,c,h),l>=0?(m.before=m.before.replace(/[\-\(]/,""),m.after=m.after.replace(/[\-\)]/,"")):l<0&&!t._.includes(m.before,"-")&&!t._.includes(m.before,"(")&&(m.before="-"+m.before),_=0;_<m.before.length;_++)switch(v=m.before[_],v){case"$":g=t._.insert(g,p.currency.symbol,_);break;case" ":g=t._.insert(g," ",_+p.currency.symbol.length-1);break}for(_=m.after.length-1;_>=0;_--)switch(v=m.after[_],v){case"$":g=_===m.after.length-1?g+p.currency.symbol:t._.insert(g,p.currency.symbol,-(m.after.length-(1+_)));break;case" ":g=_===m.after.length-1?g+" ":t._.insert(g," ",-(m.after.length-(1+_)+p.currency.symbol.length-1));break}return g}})}(),function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(l,c,h){var p,m=typeof l=="number"&&!t._.isNaN(l)?l.toExponential():"0e+0",g=m.split("e");return c=c.replace(/e[\+|\-]{1}0/,""),p=t._.numberToFormat(Number(g[0]),c,h),p+"e"+g[1]},unformat:function(l){var c=t._.includes(l,"e+")?l.split("e+"):l.split("e-"),h=Number(c[0]),p=Number(c[1]);p=t._.includes(l,"e-")?p*=-1:p;function m(g,v,_,E){var S=t._.correctionFactor(g,v),w=g*S*(v*S)/(S*S);return w}return t._.reduce([h,Math.pow(10,p)],m,1)}})}(),function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(l,c,h){var p=t.locales[t.options.currentLocale],m,g=t._.includes(c," o")?" ":"";return c=c.replace(/\s?o/,""),g+=p.ordinal(l),m=t._.numberToFormat(l,c,h),m+g}})}(),function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(l,c,h){var p=t._.includes(c," %")?" ":"",m;return t.options.scalePercentBy100&&(l=l*100),c=c.replace(/\s?\%/,""),m=t._.numberToFormat(l,c,h),t._.includes(m,")")?(m=m.split(""),m.splice(-1,0,p+"%"),m=m.join("")):m=m+p+"%",m},unformat:function(l){var c=t._.stringToNumber(l);return t.options.scalePercentBy100?c*.01:c}})}(),function(){t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(l,c,h){var p=Math.floor(l/60/60),m=Math.floor((l-p*60*60)/60),g=Math.round(l-p*60*60-m*60);return p+":"+(m<10?"0"+m:m)+":"+(g<10?"0"+g:g)},unformat:function(l){var c=l.split(":"),h=0;return c.length===3?(h=h+Number(c[0])*60*60,h=h+Number(c[1])*60,h=h+Number(c[2])):c.length===2&&(h=h+Number(c[0])*60,h=h+Number(c[1])),Number(h)}})}(),t})}(Qs)),Qs.exports}var md=ud();const Zs=yr(md),ve=e=>+(Math.round(parseFloat(e)+"e+3")+"e-3"),et=e=>+(Math.round(parseFloat(e)+"e+2")+"e-2"),fd={_2:{reg:/^\d+(\.\d{1,2})?$/,message:"Only Positive value upto 2 decimals is allowed",roundUpto:et},_3:{reg:/^\d+(\.\d{1,3})?$/,message:"Only Positive value upto 3 decimals is allowed",roundUpto:ve}},Me=(e,t)=>{const n=fd[`_${Bt[t].minimumFractionDigits??2}`].roundUpto;return n(e)},Js=e=>({INR:"Rs",USD:"USD",GBP:"GBP",AED:"AE",ZMW:"ZM",SAR:"SAR",QAR:"QAR",BHD:"BHD",NPR:"NPR",KWD:"KWD",OMR:"OMR",KES:"KES",SGD:"SGD",MVR:"MVR",IDR:"IDR",THB:"THB",MYR:"MYR",TZS:"TZS",BWP:"BWP"})[e]||"Rs",Bt={USD:{symbol:"$"},EUR:{symbol:"€"},GBP:{symbol:"£"},AED:{symbol:"AE",contactValidation:8},JPY:{symbol:"¥"},AUD:{symbol:"A$"},CAD:{symbol:"CA$",contactValidation:7},INR:{symbol:"₹",round:Math.round},CNY:{symbol:"CN¥",contactValidation:8},BRL:{symbol:"R$",contactValidation:9},QAR:{symbol:"QAR",contactValidation:8},SAR:{symbol:"SAR",contactValidation:7},BHD:{symbol:"BHD",minimumFractionDigits:3,contactValidation:7},NPR:{symbol:"NPR",contactValidation:10},KWD:{symbol:"KWD",minimumFractionDigits:3,contactValidation:8},ZMW:{symbol:"ZK",contactValidation:9},OMR:{symbol:"OMR",minimumFractionDigits:3,contactValidation:8},KES:{symbol:"KSh",contactValidation:9},SGD:{symbol:"S$",contactValidation:9},MVR:{symbol:"MVR",contactValidation:7,displayType:"code"},IDR:{symbol:"Rp",contactValidation:13,displayType:"code",round:Math.round},THB:{symbol:"฿",contactValidation:8,displayType:"code"},MYR:{symbol:"RM",displayType:"code"},PKR:{symbol:"₨",round:Math.round},GHS:{symbol:"₵",contactValidation:9},LKR:{symbol:"₨",displayType:"code"},TZS:{symbol:"TZS",contactValidation:9},BWP:{symbol:"P",contactValidation:8,displayType:"code"}};function ja(e,t){switch(t){case"BHD":case"KWD":case"OMR":return Zs(e).format("0,00.000");default:return Zs(e).format("0,00.00")}}function pd(e){const t=["","One","Two","Three","Four","Five","Six","Seven","Eight","Nine"],n=["Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],r=["","Ten","Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"];function i(p){if(p<10)return t[p];if(p<20)return n[p-11];{const m=p%10,g=Math.floor(p/10);return`${r[g]}${m?" "+t[m]:""}`}}function a(p){var m=p.toString(),g,v,_,E,S,w,D,$,P,Z,ne,te,le="and";if(m=m.replace(/[, ]/g,""),parseInt(m)===0)return"zero";for(g=["","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],v=["","","Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"],_=["","Thousand","Million","Billion","Trillion","Quadrillion","Quintillion","Sextillion","Septillion","Octillion","Nonillion","Decillion","Undecillion","Duodecillion","Tredecillion","Quatttuor-Decillion","quindecillion","sexdecillion","septen-decillion","octodecillion","novemdecillion","vigintillion","centillion"],E=m.length,w=[];E>0;)S=E,w.push(m.slice(E=Math.max(0,E-3),S));if(D=w.length,D>_.length)return"";for(te=[],Z=0;Z<D;Z++)$=parseInt(w[Z]),$&&(P=w[Z].split("").reverse().map(parseFloat),P[1]===1&&(P[0]+=10),(ne=_[Z])&&te.push(ne),(ne=g[P[0]])&&te.push(ne),(ne=v[P[1]])&&te.push(ne),(P[0]||P[1])&&(P[2]||Z+1>D)&&te.push(le),(ne=g[P[2]])&&te.push(ne+" Hundred"));return te.reverse().join(" ")}const[u,f]=e.toString().split("."),o=a(parseInt(u,10)),l=i(parseInt(f,10)),c=l?`${l} Paise`:"";return`${o} Rupees ${c&&"And "+c?c:""} Only`}const ie=(e,t)=>{var n;return((n=Bt[t])==null?void 0:n.displayType)=="code"?`${t} ${Me(e||0,t)}`:`${Bt[t].symbol} ${Me(e||0,t)}`},B=(e,t)=>{var n;return((n=Bt[t])==null?void 0:n.displayType)=="code"?`${t} ${ja(e||0,t)}`:`${Bt[t].symbol} ${ja(e||0,t)}`},tr=()=>{var e="Unknown OS";return navigator.userAgent.indexOf("Win")!=-1&&(e="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(e="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(e="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(e="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(e="iOS"),e},yd=e=>+(Math.round(parseFloat(e)*1e3)/1e3).toFixed(3),sr=(e,t="type",n)=>{const r={},i=n==null?void 0:n.separateItemsDisc;return e.forEach(u=>{var f;(f=u.discounts)==null||f.forEach(o=>{if(o.type){let l=`${o[t]}`;o.type==="DISCOUNT_ITEMS"&&i&&(l=`${o[t]}::${o.discountType}::${o.discountValue}`),r[l]?r[l].discountAmt+=o.discountAmt:r[l]={type:o.type,discountType:o.discountType,discountValue:o.discountValue,discountAmt:yd(o.discountAmt),discountName:o.discountName}}})}),Object.values(r)},nr=(e,t="type")=>{const n={};return e.forEach(i=>{var a;(a=i.dish_charges)==null||a.forEach(u=>{const f=`${u[t]}`;n[f]?(n[f].amt+=u.amt,n[f].taxAmt+=u.taxAmt):n[f]={amt:u.amt,chargeType:u.chargeType?u.chargeType:u.type,defaultSelcted:u.defaultSelcted,rate:u.rate,tax:u.tax,taxAmt:u.taxAmt,name:u.name,type:u.type}})}),Object.values(n)},rr=e=>{const t=e==null?void 0:e.split("-");return(t==null?void 0:t.length)===3?`${t[2]}-${t[1]}-${t[0]}`:null};function ms(e,t){const n=Buffer.from([e],"utf8"),r=Buffer.from([t.length],"utf8"),i=Buffer.from(t,"utf8"),a=[n,r,i];return Buffer.concat(a)}function gd(e,t,n,r,i){const a=ms("1",e),u=ms("2",t),f=ms("3",n),o=ms("4",r),l=ms("5",i);var c=Buffer.concat([a,u,f,o,l]);return c.toString("base64")}const xd=e=>({Station:"Station",Chef:"Chef",Area:"Areas",Waiter:"Waiter",Captain:"Captain",Table:"Table",KOT:"KOT",Table_View:"Table View",Manage_Dine_In:"Manage Dine-In",Counter:"Counter"}),Nd=e=>{let t;return e!=null&&e.length?t=JSON.parse(JSON.stringify(e)):t=[{internalName:"CASH",displayName:"Cash",paymentState:"PAID_OFFLINE"},{internalName:"CREDIT_CARD",displayName:"Credit Card",paymentState:"PAID_ONLINE"},{internalName:"DEBIT_CARD",displayName:"Debit Card",paymentState:"PAID_ONLINE"},{internalName:"UPI",displayName:"UPI",paymentState:"PAID_ONLINE"}],t},fs=tr(),jd=e=>{let t=e||0;var n=Math.floor(t/60),r=`${n} min`,i=parseInt(r);if(i>60){var a=Math.floor(t/3600),u=Math.floor(t%3600/60),f=`${a} hr ${u} min`;return f}else return r},vd=(e,t)=>{let n=new Array,r={WRITE_OFF:"WRITE_OFF",CASH_CARD:"CASH_CARD"};const i=[...t,{internalName:"swiggy",displayName:"Swiggy"},{internalName:"zomato",displayName:"Zomato"}],a=us(i,"internalName");let u;for(let f in e.paymentModes)!r[f]&&e.paymentModes[f]&&(u=a[f],n.push({displayName:u?u.displayName:Ve(f.replace("_"," ")),value:et(e.paymentModes[f])}));return n},_d=(e,t)=>e>0&&t>0?e/t:0;function Gt(e){return new Promise((t,n)=>{try{var r=new Image;r.src=e,r.setAttribute("crossOrigin","anonymous"),r.onload=()=>{var i=document.createElement("canvas");i.width=r.width,i.height=r.height;var a=i.getContext("2d");a.drawImage(r,0,0);var u=i.toDataURL("image/png");t(u)},r.onerror=i=>{t(null)}}catch{t(null)}})}const Xs=(e,t,n)=>{if(e&&e.length>0)if(t!=null&&t.name){let r=[];return e.map(i=>{i.serverName&&i.serverName.includes(t==null?void 0:t.name)&&r.push({...i,value:i[n]})}),r}else return e;else return!0},ar=e=>{let t={},n;for(let r=0;r<e.length;r++)switch(n=e[r],n.type){case"ORDER_DISCOUNT":t.ORDER_DISCOUNT=[n];break;case"DISCOUNT_ITEMS":t.DISCOUNT_ITEMS?t.DISCOUNT_ITEMS.push(n):t.DISCOUNT_ITEMS=[n];break;case"CATEGORY_DISCOUNT":t.CATEGORY_DISCOUNT?t.CATEGORY_DISCOUNT.push(n):t.CATEGORY_DISCOUNT=[n];break;case"ITEM_DISCOUNT":t.ITEM_DISCOUNT?t.ITEM_DISCOUNT.push(n):t.ITEM_DISCOUNT=[n];break;case"COUPON_DISCOUNT":t.COUPON_DISCOUNT=[n];break;case"SEGMENT_DISCOUNT":t.SEGMENT_DISCOUNT=[n];break}return t},ir=(e,t)=>{var c,h,p,m;let n,r,i,a,u;const f={},{itemInstructionOnBill:o,printZeroPriceAddons:l}=t;for(let g=0;g<e.length;g++)if(n=e[g],n.status!=="CANCELLED"){if((c=n.addons)!=null&&c.length&&!l)for(i=[],u=0;u<n.addons.length;u++)a=n.addons[u],a.serviceRate&&i.push(a);else i=n.addons;if(o?r=`${n.serviceId}::${n.serviceRate}::${n.instruction}::${n.taxType??"GST"}`:r=`${n.serviceId}::${n.serviceRate}::${n.taxType??"GST"}`,f[r]){if(f[r].qty+=n.qty,f[r].sub_total+=n.sub_total,(h=f[r].addons)!=null&&h.length&&((p=n.addons)!=null&&p.length)){const v=us(n.addons,"serviceId"),_=[];let E;for(let S=0;S<f[r].addons.length;S++)a=f[r].addons[S],(m=v[a.serviceId])!=null&&m.serviceId&&(E=v[a.serviceId],a.sub_total+=E.sub_total??0),_.push(a);f[r].addons=_}}else f[r]=JSON.parse(JSON.stringify({...n,addons:i}))}return Object.values(f)},en=e=>{var f;let t,n,r,i,a={},u=0;for(let o=0;o<e.length;o++)if(t=e[o],(f=t.taxation)!=null&&f.length)for(n=0;n<t.taxation.length;n++)r=t.taxation[n],i=`${r.tax}::${r.taxType??"GST"}`,a[i]?(a[i].taxableAmt=a[i].taxableAmt+(r.taxableAmt??0),a[i].taxAmt=a[i].taxAmt+(r.taxAmt??0),u+=r.taxAmt):(a[i]=JSON.parse(JSON.stringify(r)),u+=r.taxAmt);return{obj:Object.values(a),sum:u}},lr=(e,t,n)=>{var a,u,f,o;let r=n.occupiedServer,i;try{i=r?JSON.parse(r):void 0}catch(l){console.error("Failed to parse serverData:",l),i=void 0}if(t.type=="BILL"||t.type=="AGGREGATOR_BILL")return Xs((a=t.siteSetting)==null?void 0:a.billPrinters,i,"label");if(t.type=="PACKAGING_SLIP"){let l=Xs((u=t.siteSetting)==null?void 0:u.packagingSlipPrinters,i,"value");if(fs=="Android OS"){let c=l&&l.length>0?l.findIndex(h=>h.value==e.value):-1;return c!=-1?[l[c]]:null}else{let c=l&&l.length>0?l.findIndex(h=>h.value==e):-1;return c!=-1?[l[c]]:null}}else{if(t.type=="ITEMWISE_SALES_COUNTER"||t.type=="PRINT_DASHBOARD"||t.type=="COUNTER_OPERATION"||t.type=="CARD_RECHARGE_DETAILS"||t.type==="ORDER_AGGREGATED_PRINT")return Xs((f=t.siteSetting)==null?void 0:f.billPrinters,i,"value");{let l=Xs((o=t.siteSetting)==null?void 0:o.printers,i,"value");if(l===!0)return l;if(fs=="Android OS"){let c=l&&l.length>0?l.findIndex(h=>h.value==(e==null?void 0:e.value)):-1;return c!=-1?[l[c]]:null}else{let c=l&&l.length>0?l.findIndex(h=>h.value==e):-1;return c!=-1?[l[c]]:null}}}},bd=(e,t,n={})=>{var E;const{usersObj:r,stationList:i}=n;let a={},u,f;const{cancelledKOT:o,onlyCancelledItems:l,kotStatus:c="KOT_GENERATED"}=n,h=ft(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((E=e.customFeilds)!=null&&E.length){let S=ft(e.customFeilds,"INSTRUCTION","customType");S!=null&&S.customValue&&(f=[{customName:S.customName,customValue:S.customValue}])}e.orderList.filter(S=>{u=S.services.sort(w=>w.status==="CANCELLED"?-1:0),u.forEach((w,D)=>{var Q,J,z;let $=w.station?w.station.split("::"):"",P=$&&$.length>1?$[1]:$[0],Z=e.tableNo?e.tableNo.split("::"):null,ne=Z&&Z.length>0?Z[0]:e.orderFrom,te=e.tableName?e.tableName:e.tableNo?ne:e.orderFrom,le;(Q=r==null?void 0:r[S.createdBy])!=null&&Q.name&&(le=r[S.createdBy].name);let Se=!1;(o||P&&w.status==c)&&(Se=!0),Se&&or(P,i)&&(a[P]||(a[P]={},a[P].station=P,a[P].services=[],a[P].tableName=te,a[P].customerName=e.name==t.companyName?null:e.name,a[P].time=L().format("DD-MM-YYYY hh:mm a"),a[P].type=e.orderFrom,a[P].subOrderFrom=e.subOrderFrom,a[P].orderId=e.externalOrderId||e.offlineOrderId?e.orderId:S.subOrderId,a[P].orderId=new Set([a[P].orderId]),a[P].instruction=e.instruction,a[P].orderSource=e.orderSource,a[P].deliveryTimestamp=e.deliveryTimestamp?L.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A"):null,a[P].aggregatorOrderId=e.externalOrderId,a[P].otp=e.otp,a[P].totalQty=0,a[P].tokenId=e.tokenId,a[P].kotId=w.kotId?new Set([w.kotId]):null,a[P].waiterName=e.waiterName,a[P].duplicate=o,a[P].createdBy=le,a[P].zomatoInstant=h,f&&(a[P].customFields=f),l&&(a[P].onlyCancelledItems=l),e.preparationTime&&(a[P].prepareBy=L().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A"))),a[P]?(a[P].services.push({serviceName:w.serviceName,qty:w.qty,instruction:w.isUrgent&&w.instruction?`(URGENT -${w.instruction})`:w.instruction?`(${w.instruction})`:w.isUrgent?"(URGENT)":"",subOrderId:S.subOrderId,isUrgent:w.isUrgent,index:D,status:w.status,addons:w.addons}),a[P].totalQty+=ve(w.qty),(J=a[P].kotId)==null||J.add(w.kotId),e.externalOrderId||e.offlineOrderId||(z=a[P].orderId)==null||z.add(S.subOrderId)):(a[P]=[],a[P].services.push({serviceName:w.serviceName,qty:w.qty,instruction:w.instruction?w.instruction:"",subOrderId:S.subOrderId,index:D,status:w.status}),a[P].totalQty+=ve(w.qty)))})});let p={},m="2INCH";tr();let g,v=[],_={};for(const S in a)if(Object.hasOwnProperty.call(a,S)){const w=a[S];try{t.printers&&t.printers.map(D=>{D.label.toUpperCase()==w.station.toUpperCase()&&(g=fs=="Android OS"?D:D.value??void 0,m=D.paperSize?D.paperSize:t.printerSize,v.push({printer:g,paperSize:m}))}),v.length==0&&v.push({printer:g,paperSize:t.printerSize||m});for(let D=0;D<w.services.length;D++){let $=w.services[D],P=e.orderList.find(ne=>ne.subOrderId==$.subOrderId),Z=p[$.subOrderId];P&&(Z?Z.services.push(P.services[$.index]):(p[$.subOrderId]={},p[$.subOrderId].subOrderId=P.subOrderId,p[$.subOrderId].services=[P.services[$.index]]))}}catch(D){console.log(D)}_[S]=v,v=[],g=null}for(const S in p)Object.hasOwnProperty.call(p,S)&&p[S];return{obj:a,paperSize:m,printer:g,printersMap:_}},Sd=(e,t,n)=>{var i,a;const{kotStatus:r="KOT_GENERATED"}=n;try{let u="2INCH",f,o=[],l,c;const h=ft(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((i=e.customFeilds)!=null&&i.length){let p=ft(e.customFeilds,"INSTRUCTION","customType");p!=null&&p.customValue&&(c=[{customName:p.customName,customValue:p.customValue}])}for(let p=0;p<t.packagingSlipPrinters.length;p++)if(l=t.packagingSlipPrinters[p],l.label==e.subOrderFrom&&(f=fs=="Android OS"?l:l.value??void 0,u=l.paperSize?l.paperSize:u,l.paperSize)){let m,g,v,_,E,S={orderFrom:e.orderFrom,subOrderFrom:e.subOrderFrom,companyInfo:{companyName:t.companyName},tokenId:e.tokenId,orderId:e.orderId,customerInfo:{custName:e.name,custContact:e.mobile},paymentMethods:e.paymentMethods,newId:Math.random(),date:L().format("DD-MM-YYYY hh:mm a"),tableName:e.tableName,tableName:e.tableName,waiterName:e.waiterName,paymentStatus:e.paymentStatus??"UNPAID",aggregatorOrderId:e.externalOrderId,orderSource:e.orderSource,otp:e.otp,zomatoInstant:h},w={},D=!1,$,P=0;for(e.preparationTime&&(S.prepareBy=L().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A")),c&&(S.customFields=c),v=0;v<e.orderList.length;v++)for(m=e.orderList[v],_=0;_<m.services.length;_++)g=m.services[_],g={...g,instruction:g.isUrgent&&g.instruction?`(URGENT -${g.instruction})`:g.instruction?`(${g.instruction})`:g.isUrgent?"(URGENT)":null},D=!1,g.status===r&&((a=l.stations)!=null&&a.length?($=cd(l.stations),$[g.station]&&(D=!0)):D=!0),D&&g.kotId&&g.station&&(E=g.station.split("::")[1],P+=g.qty,w[`${E}/${g.kotId}`]?w[`${E}/${g.kotId}`].push(g):w[`${E}/${g.kotId}`]=[g]);Object.keys(w).length&&(S.services=w,S.totalQty=et(P),o.push({printer:f,paperSize:u,obj:S}))}return{printers:o}}catch(u){console.log(u)}},Td=(e,t,n={})=>{let r={};if(n.action==="SWITCH_TABLE")e.orderList.forEach(o=>{o.services.forEach(l=>{var c;if((l.status==="KOT_GENERATED"||l.status==="IN_PROCESS")&&l.station){let h=(c=l.station.split("::"))==null?void 0:c[1];h&&or(h,n.stationList)&&(r[h]?r[h].activeKots[l.kotId]=l.kotId:r[h]={from:[n.from],to:[n.to],station:h,activeKots:{[l.kotId]:l.kotId},type:"UPDATE_TABLE",action:"SWITCH_TABLE",orderId:l.id})}})});else{let o,l,c,h,p={},m=[];for(l=0;l<n.sources.length;l++)for(o=n.sources[l],m.push(o.tableNo),c=0;c<o.ids.length;c++)h=o.ids[c],p[h]=h;for(let g=0;g<n.orderData.length;g++)o=n.orderData[g],p[o.id]&&o.orderList.forEach(v=>{v.services.forEach(_=>{var E;if((_.status==="KOT_GENERATED"||_.status==="IN_PROCESS")&&_.station){let S=(E=_.station.split("::"))==null?void 0:E[1];S&&or(S,n.stationList)&&(r[S]?r[S].activeKots[_.kotId]=_.kotId:r[S]={from:m,to:[n.to],station:S,activeKots:{[_.kotId]:_.kotId},type:"UPDATE_TABLE",action:"MERGE_TABLE",orderId:_.id})}})})}let i="2INCH",a,u=[],f={};for(const o in r)if(Object.hasOwnProperty.call(r,o)){const l=r[o];try{t.printers&&t.printers.map(c=>{c.label.toUpperCase()==l.station.toUpperCase()&&(a=c.value?fs=="Android OS"?c:c.value:void 0,i=c.paperSize?c.paperSize:t.printerSize,u.push({printer:a,paperSize:i}))}),u.length==0&&u.push({printer:a,paperSize:t.printerSize||i})}catch(c){console.log(c)}f[o]=u,u=[],a=null}return{obj:r,paperSize:i,printersMap:f}},wd=(e,t)=>{var w,D;let{serviceTypeConfig:n,salesCollection:r,todayCollection:i,dailyExpanse:a,collectionDate:u,rangeDate:f}=t,o={},l;const c=!!ft(n,"dine-in","slugName").slugName;if(i!=null&&i.AGGREGATOR_PAYMENT){const{AGGREGATOR_PAYMENT:$,...P}=i;i={...P,swiggy:r.swiggy_collection??0,zomato:r.zomato_collection??0}}let h=c&&(n==null?void 0:n.length)&&n.some($=>$.slugName==="online-menu")&&e.isAggregatorEnabled==!0,p=h?r.aggregator_collection:void 0,m=h?r.zomato_collection:void 0,g=h?r.swiggy_collection:void 0,v=c?jd(r.avgTableTime):void 0;l={};let _=0;if(r!=null&&r.menuWiseSales){const $=r.menuWiseSales;for(const P in $)P.endsWith("collection")?l[es(P)]=et($[P]):l[es(P)]=$[P]}if(r.swiggy_aggregator&&(l.Swiggy=r.swiggy_aggregator,l.Swiggy_collection=r.swiggy_collection),r.zomato_aggregator&&(l.Zomato=r.zomato_aggregator,l.Zomato_collection=r.zomato_collection),r.itemTypeList&&((w=Object.keys(r.itemTypeList))!=null&&w.length))for(let $ in r.itemTypeList)_+=r.itemTypeList[$];let E=u;return f.toDate!==f.fromDate&&(E=`${rr(f.fromDate)} - ${rr(f.toDate)}`),{salesCollection:c?{...r,totalCollection:et(r.totalCollection),totalOrders:r.totalOrders,online_aggregator:r.aggregator,zomato_aggregator:r.zomato_aggregator,swiggy_aggregator:r.swiggy_aggregator,online_aggregator_collection:p,zomato_aggregator_collection:m,swiggy_aggregator_collection:g,itemTypes:o}:void 0,todayCollection:vd(i,e.paymentModes),totalCollection:et(i.totalCollection),averageCollection:{avgTableTime:v,avgorderValue:_d(r.totalCollection,r.totalOrders).toFixed(2),todayExpense:a&&((D=a.DEBIT)!=null&&D.total)?et(a.DEBIT.total):0,totalDiscountAmt:r&&r.totalDiscountAmt?et(r.totalDiscountAmt):0,totalBalanceAmt:r&&r.totalBalanceAmt?et(r.totalBalanceAmt):0,dailyExpanse:a,noOfGuest:r.noOfGuest,avgPerCover:r.avgPerCover,refundAmt:i.refundAmt,writeOffAmt:i.writeOffAmt,rewardAmt:r.rewardAmt},menusCollection:{...l},selectedDate:E,id:Math.random(),otherFields:{salesCollection:i.salesCollection?et(i.salesCollection):0,outstandingAmt:i.outstandingAmt,totalDiscountAmt:r.totalDiscountAmt,discountList:r.discountList,totalOtherCharges:r.totalOtherCharges,otherChargesList:r.otherChargesList,totalTax:r.totalTax,taxList:r.taxList,totalItemType:_,itemTypeList:r.itemTypeList}}},Id=(e,t,n={})=>new Promise(async(r,i)=>{var h,p,m;const{invoiceFormat:a,userData:u}=n;let f,o,l=[],c;try{if((h=e.appliedDiscounts)!=null&&h.length){c=0;for(let J=0;J<e.appliedDiscounts.length;J++)f=e.appliedDiscounts[J],c+=f.discountAmt}const g=ft(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((p=e.customFeilds)!=null&&p.length){const J=ft(e.customFeilds,"INSTRUCTION","customType");J!=null&&J.customValue&&(l=[{customName:J.customName,customValue:J.customValue}])}f={};let v=(m=t==null?void 0:t.footerAddress)!=null&&m.addressLineOne?t==null?void 0:t.footerAddress.addressLineOne:"",_=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",E=t.footerAddress.city?t.footerAddress.city:"",S=t.footerAddress.zip?t.footerAddress.zip:"",w=(v!=""?v+",":"")+(_!=""?_+",":"")+(E!=""?E+",":"")+(S!=""?S+",":""),D=t.gstNo,$={companyName:t.companyName,companyAddress:w,companyContact:t.contactNumber,companyEmail:t.contactEmail},Z={orderStatus:"COMPLETED",orderDate:e&&e.timestamp?L.unix(e.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:e&&e.orderId?e.orderId:null,timestamp:e.timestamp},ne={custName:e.name??null,custAddress:e.custAddress??null,custContact:e.mobile??null},te=Js(t.curr),le={...e,companyInfo:$,orderInfo:Z,customerInfo:ne,gst:D,curr:te},Se=null,Q=null;a.companyLogo&&(Se=await Gt(`https://${a.companyLogo.bucket}.s3.amazonaws.com/${a.companyLogo.key}`)),a.qrcode&&(Q=await Gt(`https://${a.qrcode.bucket}.s3.amazonaws.com/${a.qrcode.key}`)),e.orderList.filter(J=>{J.services.forEach(async(z,de)=>{var tt,st;let G="kitchen",X=e.tableName?e.tableName:e.orderFrom;G&&(f[G]||(f[G]={},f[G].station=G,f[G].services=[],f[G].tableName=X,f[G].customerName=e.name,f[G].time=L.unix(e.timestamp).format("DD-MM-YYYY hh:mm a"),f[G].type=e.orderFrom,f[G].orderId=e.orderId,f[G].instruction=e.instruction,f[G].totalQty=0,f[G].tokenId=e.tokenId,f[G].orderSource=e.orderSource,f[G].aggregatorOrderId=e.externalOrderId,f[G].otp=e.otp,f[G].paymentState=e.paymentState,f[G].discountAmt=c,f[G].otherCharges=e.otherCharges,f[G].taxAmt=e.taxAmt,f[G].customFeilds=l,f[G].curr=t.curr??"INR",f[G].zomatoInstant=g),f[G]?(o={serviceName:z.serviceName,qty:z.qty,instruction:z.isUrgent&&z.instruction?`(URGENT -${z.instruction})`:z.instruction?`(${z.instruction})`:z.isUrgent?"(URGENT)":"",subOrderId:J.subOrderId,isUrgent:z.isUrgent,index:de},(tt=z.addons)!=null&&tt.length&&(o.addons=z.addons),f[G].services.push(o),f[G].totalQty+=z.qty):(f[G]=[],f[G].services.push({serviceName:z.serviceName,qty:z.qty,instruction:z.instruction?z.instruction:"",subOrderId:J.subOrderId,index:de}),f[G].totalQty+=z.qty),f[G]={...f[G],companyInfo:$,orderInfo:Z,customerInfo:ne,gst:D,curr:te},f[G].domain=a.siteURL,f[G].paymentMethods=a.paymentMode?le.paymentMethods:null,f[G].companyInfo.companyName=a.companyName,f[G].companyInfo.companyEmail=a.email,f[G].companyInfo.companyAddress=a.address,f[G].companyInfo.companyContact=a.mobile,f[G].tokenId=a.token?le.tokenId:null,a.isPayQR&&a.upiId&&a.upiId!==""&&(le.upiId=a.upiId),f[G].gstNo=a.gst?le.gst:null,f[G].footerMessage=a.footerMessage,f[G].orderFrom=(st=e.subOrderFrom)==null?void 0:st.toUpperCase(),f[G].fssai=t.fssai,f[G].vatNo=t.vatNo,f[G].printOperatorInfo=a.printOperatorInfo===null||a.printOperatorInfo===!0,f[G].disabledPoweredBy=t.disabledPoweredBy===!0,f[G].printTime=L().format("DD-MM-YYYY hh:mm A"),f[G].printedBy=u.userRole=="admin"?"Admin":u.name,e.deliveryTimestamp&&(f[G].deliveryTimestamp=L.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),f[G].itemInstructionOnBill=a.itemInstructionOnBill,f[G]={...f[G],companyLogo:Se,companyQrCode:Q})})});for(const J in f)if(Object.hasOwnProperty.call(f,J)){const z=f[J];try{let de=t.printerSize??"2inch";r(new Object({obj:new Object({...z,paperSize:de}),orderList:e.orderList}));return}catch(de){console.log(de)}}}catch(g){console.log("err::",g)}}),Cd=async e=>{let t=[];for(let h=0;h<e.length;h++)for(let p=0;p<e[h].orderList.length;p++)t.push(e[h].orderList[p]);let n=[];if(t.length>0)for(let h=0;h<t.length;h++)for(let p=0;p<t[h].services.length;p++)t[h].services[p].status!="CANCELLED"&&t[h].services[p].status!="RETURNED"&&t[h].services[p].status!="SHIFTED"&&n.push(t[h].services[p]);let r={},i=[];for(let h=0;h<n.length;h++)if(n[h].addons&&n[h].addons.length>0)for(let p=0;p<n[h].addons.length;p++){let m={...n[h].addons[p]};m.qty=n[h].qty,i.push(m)}n.forEach(h=>{let{attachedCat:p,serviceId:m}=h;r[p]||(r[p]=[]);let g=r[p].findIndex(v=>v.serviceId===m);g!==-1?r[p][g].qty=r[p][g].qty+h.qty:r[p].push({serviceName:h.serviceName,qty:h.qty,status:h.status,serviceId:h.serviceId,attachedCat:h.attachedCat,station:h.station})});const a=Object.keys(r).sort(),u={};a.forEach(h=>{u[h]=r[h]});for(let h in u)u[h].sort((p,m)=>p.serviceName.localeCompare(m.serviceName));let f={Category:u},o={};i.forEach(h=>{let{attachedAddonCat:p,serviceId:m}=h;o[p]||(o[p]=[]);let g=o[p].findIndex(v=>v.serviceId===m);g!==-1?o[p][g].qty=o[p][g].qty+h.qty:o[p].push({serviceName:h.serviceName,qty:h.qty,status:h.status,serviceId:h.serviceId,attachedCat:h.attachedAddonCat,station:h.station})});const l=Object.keys(o).sort(),c={};l.forEach(h=>{c[h]=o[h]});for(let h in c)c[h].sort((p,m)=>p.serviceName.localeCompare(m.serviceName));return f.Addon=c,f},va={"Andaman and Nicobar Islands":"UTGST",Chandigarh:"UTGST","Dadra and Nagar Haveli and Daman and Diu":"UTGST","Jammu & Kashmir":"UTGST",Ladakh:"UTGST",Lakshadweep:"UTGST",Puducherry:"UTGST"},_a=e=>{let t=e&&e.footerAddress&&e.footerAddress.state&&e.footerAddress.state?e.footerAddress.state:null;return va[t]?va[t]:"SGST"},ba=(e,t,n={})=>new Promise(async(r,i)=>{var u,f,o,l,c,h,p;try{const{invoiceFormat:m,custName:g,custMobile:v,custAddress:_,userData:E={}}=n,{itemList:S}=e;let w=E==null?void 0:E.userRole;if(E.userRole=="admin"?w="ADMIN":w=E==null?void 0:E.name,!(S!=null&&S.length))return;let D=t.printerSize,$=lr(null,{type:"BILL",siteSetting:t},{occupiedServer:n.occupiedServer});D=$?(u=$[0])!=null&&u.paperSize?(f=$[0])==null?void 0:f.paperSize:D||"2INCH":D;let P=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",Z=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",ne=t.footerAddress.city?t.footerAddress.city:"",te=t.footerAddress.zip?t.footerAddress.zip:"",le=(P!=""?P+",":"")+(Z!=""?Z+",":"")+(ne!=""?ne+",":"")+(te!=""?te+",":""),Se=t.gstNo,Q={companyName:t.companyName,companyAddress:le,companyContact:t.contactNumber,companyEmail:t.contactEmail},z={orderStatus:"COMPLETED",orderDate:e&&e.timestamp?L.unix(e.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:e&&e.orderId?e.orderId:null,timestamp:e.timestamp},de={custName:m&&m.custName?g==t.companyName?null:g:null,custAddress:m&&m.custAddress&&_||null,custContact:m&&m.custMobile?v:null,custEmail:"ajaybaglane7@gmail.com"},G=Js(t.curr),X={...e,companyInfo:Q,orderInfo:z,customerInfo:de,gst:Se,curr:G};if(m){if(X.domain=m.siteURL,X.paymentMethods=m.paymentMode?X.paymentMethods:null,X.companyInfo.companyName=m.companyName,X.companyInfo.companyEmail=m.email,X.companyInfo.companyAddress=m.address,X.companyInfo.companyContact=m.mobile,X.customerInfo.custName=m.custName?g:null,X.tokenId=m.token?X.tokenId:null,m.isPayQR&&m.upiId&&m.upiId!==""&&(X.upiId=m.upiId),X.gstNo=m.gst?X.gst:null,X.footerMessage=m.footerMessage,X.orderFrom=(o=e.subOrderFrom)==null?void 0:o.toUpperCase(),X.fssai=t.fssai,X.vatNo=t.vatNo,X.invoiceType=t.invoiceType,X.taxLabel=_a(t),X.printOperatorInfo=m.printOperatorInfo===null||m.printOperatorInfo===!0,X.disabledPoweredBy=t.disabledPoweredBy===!0,X.printTime=L().format("DD-MM-YYYY hh:mm A"),e.deliveryTimestamp&&(X.deliveryTimestamp=L.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),X.itemInstructionOnBill=m.itemInstructionOnBill,X.printHSNCodeOnBill=m.printHSNCodeOnBill,X.noOfInvoice=m.noOfInvoice,X.printby=w,X.newFormat=!0,!(m.itemInstructionOnBill||m.printHSNCodeOnBill)&&((l=X.itemList)!=null&&l.length)){let ee;for(let be=0;be<X.itemList.length;be++)ee=X.itemList[be],ee.instruction&&delete ee.instruction,ee.hsnCode&&delete ee.hsnCode}t.enabledOutstandingOnPay&&((c=e.custoutStandingData)!=null&&c.balanceAmt)&&(X.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let tt=[];if((h=e.customFeilds)!=null&&h.length){let ee;for(let be=0;be<e.customFeilds.length;be++)ee=e.customFeilds[be],ee!=null&&ee.customValue&&((p=ee.availability)!=null&&p.includes("BILL"))&&tt.push({customName:ee.customName,customValue:ee.customValue});X.customFields=tt}let st=null,Ot=null;m.companyLogo&&(st=await Gt(`https://${m.companyLogo.bucket}.s3.amazonaws.com/${m.companyLogo.key}`)),m.qrcode&&(Ot=await Gt(`https://${m.qrcode.bucket}.s3.amazonaws.com/${m.qrcode.key}`));var a="Unknown OS";navigator.userAgent.indexOf("Win")!=-1&&(a="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(a="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(a="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(a="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(a="iOS");let nt={};(function(){let ee,be,pt=0,y=0,d=0,O=0,j=0,I=0,U=0,b=0,F=[],W=[],he=0,Ae;if(D==="A4"||D==="A5"){for(be=0;be<S.length;be++)ee=S[be],y+=ee.sub_total,d+=ee.afterdiscAmt,O+=ee.afterdiscAmt+(ee.total_charges??0),pt+=ee.afterdiscAmt+(ee.total_charges??0),he+=ee.qty;let He=sr(S,"discountName",{separateItemsDisc:!0});const Le=ar(He);let{obj:Oe,sum:De}=en(S);nt={itemList:ir(S,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Le,charges:nr(S,"name"),taxation:Oe,subTotal:ve(y),afterDisc:ve(d),afterCharges:ve(O),total:ve(pt+De),qty:he}}else{let{obj:He}=en(S);for(X.taxation=He,be=0;be<S.length;be++)ee=S[be],ee.taxType==="VAT"?(W.push(ee),b+=ee.sub_total,I+=ee.afterdiscAmt,j+=ee.afterdiscAmt+(ee.total_charges??0),U+=ee.afterdiscAmt+(ee.total_charges??0)):(F.push(ee),y+=ee.sub_total,d+=ee.afterdiscAmt,O+=ee.afterdiscAmt+(ee.total_charges??0),pt+=ee.afterdiscAmt+(ee.total_charges??0));if(F.length){let Le=sr(F,"discountName",{separateItemsDisc:!0});const Oe=ar(Le);let{obj:De,sum:Ke}=en(F);nt.GST={itemList:ir(F,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Oe,charges:nr(F,"name"),taxation:De,subTotal:ve(y),afterDisc:ve(d),afterCharges:ve(O),total:ve(pt+Ke)}}if(W.length){let Le=sr(W,"discountName",{separateItemsDisc:!0});const Oe=ar(Le);let{obj:De,sum:Ke}=en(W);nt.VAT={itemList:ir(W,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Oe,charges:nr(W,"name"),taxation:De,subTotal:ve(b),afterDisc:ve(I),afterCharges:ve(j),total:ve(U+Ke)}}}})(),X.distributedData=nt;let Mt={obj:X,companyLogo:st,companyQrCode:Ot,paperSize:t.printerSize,Name:a};r(Mt)}}catch(m){console.log("err",m),i(m)}}),Od=(e,t,n={})=>new Promise(async(r,i)=>{var u,f,o,l,c;try{const{invoiceFormat:h,custName:p,custMobile:m,custAddress:g,orderData:v}=n;let _=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",E=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",S=t.footerAddress.city?t.footerAddress.city:"",w=t.footerAddress.zip?t.footerAddress.zip:"",D=(_!=""?_+",":"")+(E!=""?E+",":"")+(S!=""?S+",":"")+(w!=""?w+",":""),$=t.gstNo,P={companyName:t.companyName,companyAddress:D,companyContact:t.contactNumber,companyEmail:t.contactEmail},ne={orderStatus:"COMPLETED",orderDate:v&&v.timestamp?L.unix(v.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:v&&v.orderId?v.orderId:null,timestamp:v.timestamp},te={custName:h&&h.custName?p==t.companyName?null:p:null,custAddress:h&&h.custAddress&&g||null,custContact:h&&h.custMobile?m:null,custEmail:"ajaybaglane7@gmail.com"},le=Js(t.curr),Se="",Q={...e,companyInfo:P,orderInfo:ne,customerInfo:te,gst:$,curr:le};if(h){if(Q.domain=h.siteURL,Q.paymentMethods=h.paymentMode?Q.paymentMethods:null,Q.companyInfo.companyName=h.companyName,Q.companyInfo.companyEmail=h.email,Q.companyInfo.companyAddress=h.address,Q.companyInfo.companyContact=h.mobile,Q.customerInfo.custName=h.custName?p:null,Q.tokenId=h.token?Q.tokenId:null,h.isPayQR&&h.upiId&&h.upiId!==""&&(Q.upiId=h.upiId),Q.gstNo=h.gst?Q.gst:null,Q.footerMessage=h.footerMessage,Q.orderFrom=(u=v.subOrderFrom)==null?void 0:u.toUpperCase(),Q.fssai=t.fssai,Q.vatNo=t.vatNo,Q.taxLabel=_a(t),Q.printOperatorInfo=h.printOperatorInfo===null||h.printOperatorInfo===!0,Q.disabledPoweredBy=t.disabledPoweredBy===!0,Q.printTime=L().format("DD-MM-YYYY hh:mm A"),v.deliveryTimestamp&&(Q.deliveryTimestamp=L.unix(v.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),Q.itemInstructionOnBill=h.itemInstructionOnBill,Q.printHSNCodeOnBill=h.printHSNCodeOnBill,Q.noOfInvoice=h.noOfInvoice,Q.area=v.area,Q.captainName=v.captainName,!(h.itemInstructionOnBill||h.printHSNCodeOnBill)&&((f=Q.itemList)!=null&&f.length)){let z;for(let de=0;de<Q.itemList.length;de++)z=Q.itemList[de],z.instruction&&delete z.instruction,z.hsnCode&&delete z.hsnCode}t.enabledOutstandingOnPay&&((o=e.custoutStandingData)!=null&&o.balanceAmt)&&(Q.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let J=[];if((l=v.customFeilds)!=null&&l.length){let z;for(let de=0;de<v.customFeilds.length;de++)z=v.customFeilds[de],z!=null&&z.customValue&&((c=z.availability)!=null&&c.includes("BILL"))&&J.push({customName:z.customName,customValue:z.customValue});Q.customFields=J}if(t&&t.isOld&&t.isOld==!0){let z=null,de=null;h.companyLogo&&(z=await Gt(`https://${h.companyLogo.bucket}.s3.amazonaws.com/${h.companyLogo.key}`)),h.qrcode&&(de=await Gt(`https://${h.qrcode.bucket}.s3.amazonaws.com/${h.qrcode.key}`));var a="Unknown OS";navigator.userAgent.indexOf("Win")!=-1&&(a="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(a="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(a="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(a="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(a="iOS");let G={obj:Q,companyLogo:z,companyQrCode:de,paperSize:t.printerSize,Name:a};r(G)}}}catch(h){console.log("err",h)}}),Md=(e,t)=>new Promise(async(n,r)=>{var w;let i;(w=t.siteLogo)!=null&&w.key;let a=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",u=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",f=t.footerAddress.city?t.footerAddress.city:"",o=t.footerAddress.zip?t.footerAddress.zip:"",l=(a!=""?a+",":"")+(u!=""?u+",":"")+(f!=""?f+",":"")+(o!=""?o+",":""),c=[],h,p=0,m=0,g=0,v=[],_,E;const S=us(t.paymentModes??defaultPaymentModes,"internalName");for(let D=0;D<e.length;D++)for(h=e[D],c.push({date:h.date,orderId:h.orderId,finalAmount:h.finalAmount}),p+=h.finalAmount,m+=h.paidAmt,g+=h.balanceAmt,_=0;_<h.orderTransactions.length;_++)E=h.orderTransactions[_],E.paidAmt&&v.push({date:L.unix(E.createdAt).format("DD-MM-YYYY"),paymentMode:S[E.paymentMode].displayName,amount:ve(E.paidAmt)});n({logo:i,companyAddress:l,companyName:t.companyName,companyContact:t.contactNumber,gst:t.gstNo,vatNo:t.vatNo,fssai:t.fssai,orders:c,totalAmount:p,totalPaid:m,totalPayable:g,paperSize:t.printerSize,curr:Js(t.curr),transactions:v})}),Ad=e=>new Promise(async(t,n)=>{let r={...e};r.orderObj=JSON.parse(e.orderObj),r.settingData=JSON.parse(e.settingData),r.invoiceFormat=JSON.parse(e.invoiceFormat),r.orderData=JSON.parse(e.orderObj);let i;r.newFormat?i=await ba({...r.orderObj,itemList:r.orderObj.orderList},r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress}):i=await Od(r.orderObj,r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress,orderData:r.orderData}),t(i)}),Sa=e=>{let t=new Array;for(const n in e)if(Object.hasOwnProperty.call(e,n)){const r=`${n}::${e[n].orderId}::${Math.random()}`,i=e[n];i.newId=r,t.push(i)}return t},or=(e,t)=>{var r,i;if(!(t!=null&&t.length))return!0;let n=t.findIndex(a=>a.typeValue=="station::"+e);return((r=t[n])==null?void 0:r.printKot)==null?!0:(i=t[n])==null?void 0:i.printKot};function Ed(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}const Rd=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function vt(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}let Wt=null;function Ta(e={}){return Wt||(e.includeStyleProperties?(Wt=e.includeStyleProperties,Wt):(Wt=vt(window.getComputedStyle(document.documentElement)),Wt))}function tn(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Ld(e){const t=tn(e,"border-left-width"),n=tn(e,"border-right-width");return e.clientWidth+t+n}function kd(e){const t=tn(e,"border-top-width"),n=tn(e,"border-bottom-width");return e.clientHeight+t+n}function wa(e,t={}){const n=t.width||Ld(e),r=t.height||kd(e);return{width:n,height:r}}function Pd(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const Fe=16384;function Fd(e){(e.width>Fe||e.height>Fe)&&(e.width>Fe&&e.height>Fe?e.width>e.height?(e.height*=Fe/e.width,e.width=Fe):(e.width*=Fe/e.height,e.height=Fe):e.width>Fe?(e.height*=Fe/e.width,e.width=Fe):(e.width*=Fe/e.height,e.height=Fe))}function sn(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function Dd(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Yd(e,t,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),a=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${t} ${n}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),i.appendChild(a),a.appendChild(e),Dd(i)}const Re=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||Re(n,t)};function Ud(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function $d(e,t){return Ta(t).map(n=>{const r=e.getPropertyValue(n),i=e.getPropertyPriority(n);return`${n}: ${r}${i?" !important":""};`}).join(" ")}function Hd(e,t,n,r){const i=`.${e}:${t}`,a=n.cssText?Ud(n):$d(n,r);return document.createTextNode(`${i}{${a}}`)}function Ia(e,t,n,r){const i=window.getComputedStyle(e,n),a=i.getPropertyValue("content");if(a===""||a==="none")return;const u=Rd();try{t.className=`${t.className} ${u}`}catch{return}const f=document.createElement("style");f.appendChild(Hd(u,n,i,r)),t.appendChild(f)}function Bd(e,t,n){Ia(e,t,":before",n),Ia(e,t,":after",n)}const Ca="application/font-woff",Oa="image/jpeg",Gd={woff:Ca,woff2:Ca,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Oa,jpeg:Oa,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Wd(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function cr(e){const t=Wd(e).toLowerCase();return Gd[t]||""}function zd(e){return e.split(/,/)[1]}function dr(e){return e.search(/^(data:)/)!==-1}function Vd(e,t){return`data:${t};base64,${e}`}async function Ma(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const i=await r.blob();return new Promise((a,u)=>{const f=new FileReader;f.onerror=u,f.onloadend=()=>{try{a(n({res:r,result:f.result}))}catch(o){u(o)}},f.readAsDataURL(i)})}const hr={};function qd(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function ur(e,t,n){const r=qd(e,t,n.includeQueryParams);if(hr[r]!=null)return hr[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const a=await Ma(e,n.fetchRequestInit,({res:u,result:f})=>(t||(t=u.headers.get("Content-Type")||""),zd(f)));i=Vd(a,t)}catch(a){i=n.imagePlaceholder||"";let u=`Failed to fetch resource: ${e}`;a&&(u=typeof a=="string"?a:a.message),u&&console.warn(u)}return hr[r]=i,i}async function Kd(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):sn(t)}async function Qd(e,t){if(e.currentSrc){const a=document.createElement("canvas"),u=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,u==null||u.drawImage(e,0,0,a.width,a.height);const f=a.toDataURL();return sn(f)}const n=e.poster,r=cr(n),i=await ur(n,r,t);return sn(i)}async function Zd(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await nn(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Jd(e,t){return Re(e,HTMLCanvasElement)?Kd(e):Re(e,HTMLVideoElement)?Qd(e,t):Re(e,HTMLIFrameElement)?Zd(e,t):e.cloneNode(Aa(e))}const Xd=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Aa=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function eh(e,t,n){var r,i;if(Aa(t))return t;let a=[];return Xd(e)&&e.assignedNodes?a=vt(e.assignedNodes()):Re(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?a=vt(e.contentDocument.body.childNodes):a=vt(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),a.length===0||Re(e,HTMLVideoElement)||await a.reduce((u,f)=>u.then(()=>nn(f,n)).then(o=>{o&&t.appendChild(o)}),Promise.resolve()),t}function th(e,t,n){const r=t.style;if(!r)return;const i=window.getComputedStyle(e);i.cssText?(r.cssText=i.cssText,r.transformOrigin=i.transformOrigin):Ta(n).forEach(a=>{let u=i.getPropertyValue(a);a==="font-size"&&u.endsWith("px")&&(u=`${Math.floor(parseFloat(u.substring(0,u.length-2)))-.1}px`),Re(e,HTMLIFrameElement)&&a==="display"&&u==="inline"&&(u="block"),a==="d"&&t.getAttribute("d")&&(u=`path(${t.getAttribute("d")})`),r.setProperty(a,u,i.getPropertyPriority(a))})}function sh(e,t){Re(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),Re(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function nh(e,t){if(Re(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function rh(e,t,n){return Re(t,Element)&&(th(e,t,n),Bd(e,t,n),sh(e,t),nh(e,t)),t}async function ah(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let a=0;a<n.length;a++){const f=n[a].getAttribute("xlink:href");if(f){const o=e.querySelector(f),l=document.querySelector(f);!o&&l&&!r[f]&&(r[f]=await nn(l,t,!0))}}const i=Object.values(r);if(i.length){const a="http://www.w3.org/1999/xhtml",u=document.createElementNS(a,"svg");u.setAttribute("xmlns",a),u.style.position="absolute",u.style.width="0",u.style.height="0",u.style.overflow="hidden",u.style.display="none";const f=document.createElementNS(a,"defs");u.appendChild(f);for(let o=0;o<i.length;o++)f.appendChild(i[o]);e.appendChild(u)}return e}async function nn(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>Jd(r,t)).then(r=>eh(e,r,t)).then(r=>rh(e,r,t)).then(r=>ah(r,t))}const Ea=/url\((['"]?)([^'"]+?)\1\)/g,ih=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,lh=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function oh(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function ch(e){const t=[];return e.replace(Ea,(n,r,i)=>(t.push(i),n)),t.filter(n=>!dr(n))}async function dh(e,t,n,r,i){try{const a=n?Ed(t,n):t,u=cr(t);let f;return i||(f=await ur(a,u,r)),e.replace(oh(t),`$1${f}$3`)}catch{}return e}function hh(e,{preferredFontFormat:t}){return t?e.replace(lh,n=>{for(;;){const[r,,i]=ih.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Ra(e){return e.search(Ea)!==-1}async function La(e,t,n){if(!Ra(e))return e;const r=hh(e,n);return ch(r).reduce((a,u)=>a.then(f=>dh(f,u,t,n)),Promise.resolve(r))}async function zt(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const a=await La(i,null,n);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function uh(e,t){await zt("background",e,t)||await zt("background-image",e,t),await zt("mask",e,t)||await zt("-webkit-mask",e,t)||await zt("mask-image",e,t)||await zt("-webkit-mask-image",e,t)}async function mh(e,t){const n=Re(e,HTMLImageElement);if(!(n&&!dr(e.src))&&!(Re(e,SVGImageElement)&&!dr(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await ur(r,cr(r),t);await new Promise((a,u)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...o)=>{try{a(t.onImageErrorHandler(...o))}catch(l){u(l)}}:u;const f=e;f.decode&&(f.decode=a),f.loading==="lazy"&&(f.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function fh(e,t){const r=vt(e.childNodes).map(i=>ka(i,t));await Promise.all(r).then(()=>e)}async function ka(e,t){Re(e,Element)&&(await uh(e,t),await mh(e,t),await fh(e,t))}function ph(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),e}const Pa={};async function Fa(e){let t=Pa[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},Pa[e]=t,t}async function Da(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,a=(n.match(/url\([^)]+\)/g)||[]).map(async u=>{let f=u.replace(r,"$1");return f.startsWith("https://")||(f=new URL(f,e.url).href),Ma(f,t.fetchRequestInit,({result:o})=>(n=n.replace(u,`url(${o})`),[u,o]))});return Promise.all(a).then(()=>n)}function Ya(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const o=i.exec(r);if(o===null)break;t.push(o[0])}r=r.replace(i,"");const a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,u="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",f=new RegExp(u,"gi");for(;;){let o=a.exec(r);if(o===null){if(o=f.exec(r),o===null)break;a.lastIndex=f.lastIndex}else f.lastIndex=a.lastIndex;t.push(o[0])}return t}async function yh(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{vt(i.cssRules||[]).forEach((a,u)=>{if(a.type===CSSRule.IMPORT_RULE){let f=u+1;const o=a.href,l=Fa(o).then(c=>Da(c,t)).then(c=>Ya(c).forEach(h=>{try{i.insertRule(h,h.startsWith("@import")?f+=1:i.cssRules.length)}catch(p){console.error("Error inserting rule from remote css",{rule:h,error:p})}})).catch(c=>{console.error("Error loading remote css",c.toString())});r.push(l)}})}catch(a){const u=e.find(f=>f.href==null)||document.styleSheets[0];i.href!=null&&r.push(Fa(i.href).then(f=>Da(f,t)).then(f=>Ya(f).forEach(o=>{u.insertRule(o,u.cssRules.length)})).catch(f=>{console.error("Error loading remote stylesheet",f)})),console.error("Error inlining remote css file",a)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{vt(i.cssRules||[]).forEach(a=>{n.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${i.href}`,a)}}),n))}function gh(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Ra(t.style.getPropertyValue("src")))}async function xh(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=vt(e.ownerDocument.styleSheets),r=await yh(n,t);return gh(r)}function Ua(e){return e.trim().replace(/["']/g,"")}function Nh(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(a=>{t.add(Ua(a))}),Array.from(r.children).forEach(a=>{a instanceof HTMLElement&&n(a)})}return n(e),t}async function jh(e,t){const n=await xh(e,t),r=Nh(e);return(await Promise.all(n.filter(a=>r.has(Ua(a.style.fontFamily))).map(a=>{const u=a.parentStyleSheet?a.parentStyleSheet.href:null;return La(a.cssText,u,t)}))).join(`
46
- `)}async function vh(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await jh(e,t);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function $a(e,t={}){const{width:n,height:r}=wa(e,t),i=await nn(e,t,!0);return await vh(i,t),await ka(i,t),ph(i,t),await Yd(i,n,r)}async function _h(e,t={}){const{width:n,height:r}=wa(e,t),i=await $a(e,t),a=await sn(i),u=document.createElement("canvas"),f=u.getContext("2d"),o=t.pixelRatio||Pd(),l=t.canvasWidth||n,c=t.canvasHeight||r;return u.width=l*o,u.height=c*o,t.skipAutoScale||Fd(u),u.style.width=`${l}`,u.style.height=`${c}`,t.backgroundColor&&(f.fillStyle=t.backgroundColor,f.fillRect(0,0,u.width,u.height)),f.drawImage(a,0,0,u.width,u.height),u}async function bh(e,t={}){return(await _h(e,t)).toDataURL("image/jpeg",t.quality||1)}var Sh=Object.defineProperty,rn=Object.getOwnPropertySymbols,Ha=Object.prototype.hasOwnProperty,Ba=Object.prototype.propertyIsEnumerable,Ga=(e,t,n)=>t in e?Sh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ps=(e,t)=>{for(var n in t||(t={}))Ha.call(t,n)&&Ga(e,n,t[n]);if(rn)for(var n of rn(t))Ba.call(t,n)&&Ga(e,n,t[n]);return e},mr=(e,t)=>{var n={};for(var r in e)Ha.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&rn)for(var r of rn(e))t.indexOf(r)<0&&Ba.call(e,r)&&(n[r]=e[r]);return n};/**
45
+ */var hd=Qs.exports,Na;function ud(){return Na||(Na=1,function(e){(function(t,n){e.exports?e.exports=n():t.numeral=n()})(hd,function(){var t,n,r="2.0.6",l={},o={},a={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},m={currentLocale:a.currentLocale,zeroFormat:a.zeroFormat,nullFormat:a.nullFormat,defaultFormat:a.defaultFormat,scalePercentBy100:a.scalePercentBy100};function u(i,c){this._input=i,this._value=c}return t=function(i){var c,h,f,y;if(t.isNumeral(i))c=i.value();else if(i===0||typeof i>"u")c=0;else if(i===null||n.isNaN(i))c=null;else if(typeof i=="string")if(m.zeroFormat&&i===m.zeroFormat)c=0;else if(m.nullFormat&&i===m.nullFormat||!i.replace(/[^0-9]+/g,"").length)c=null;else{for(h in l)if(y=typeof l[h].regexps.unformat=="function"?l[h].regexps.unformat():l[h].regexps.unformat,y&&i.match(y)){f=l[h].unformat;break}f=f||t._.stringToNumber,c=f(i)}else c=Number(i)||null;return new u(i,c)},t.version=r,t.isNumeral=function(i){return i instanceof u},t._=n={numberToFormat:function(i,c,h){var f=o[t.options.currentLocale],y=!1,p=!1,v=0,_="",E=1e12,S=1e9,T=1e6,D=1e3,$="",k=!1,J,re,te,de,be,Z,X;if(i=i||0,re=Math.abs(i),t._.includes(c,"(")?(y=!0,c=c.replace(/[\(|\)]/g,"")):(t._.includes(c,"+")||t._.includes(c,"-"))&&(be=t._.includes(c,"+")?c.indexOf("+"):i<0?c.indexOf("-"):-1,c=c.replace(/[\+|\-]/g,"")),t._.includes(c,"a")&&(J=c.match(/a(k|m|b|t)?/),J=J?J[1]:!1,t._.includes(c," a")&&(_=" "),c=c.replace(new RegExp(_+"a[kmbt]?"),""),re>=E&&!J||J==="t"?(_+=f.abbreviations.trillion,i=i/E):re<E&&re>=S&&!J||J==="b"?(_+=f.abbreviations.billion,i=i/S):re<S&&re>=T&&!J||J==="m"?(_+=f.abbreviations.million,i=i/T):(re<T&&re>=D&&!J||J==="k")&&(_+=f.abbreviations.thousand,i=i/D)),t._.includes(c,"[.]")&&(p=!0,c=c.replace("[.]",".")),te=i.toString().split(".")[0],de=c.split(".")[1],Z=c.indexOf(","),v=(c.split(".")[0].split(",")[0].match(/0/g)||[]).length,de?(t._.includes(de,"[")?(de=de.replace("]",""),de=de.split("["),$=t._.toFixed(i,de[0].length+de[1].length,h,de[1].length)):$=t._.toFixed(i,de.length,h),te=$.split(".")[0],t._.includes($,".")?$=f.delimiters.decimal+$.split(".")[1]:$="",p&&Number($.slice(1))===0&&($="")):te=t._.toFixed(i,0,h),_&&!J&&Number(te)>=1e3&&_!==f.abbreviations.trillion)switch(te=String(Number(te)/1e3),_){case f.abbreviations.thousand:_=f.abbreviations.million;break;case f.abbreviations.million:_=f.abbreviations.billion;break;case f.abbreviations.billion:_=f.abbreviations.trillion;break}if(t._.includes(te,"-")&&(te=te.slice(1),k=!0),te.length<v)for(var q=v-te.length;q>0;q--)te="0"+te;return Z>-1&&(te=te.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+f.delimiters.thousands)),c.indexOf(".")===0&&(te=""),X=te+$+(_||""),y?X=(y&&k?"(":"")+X+(y&&k?")":""):be>=0?X=be===0?(k?"-":"+")+X:X+(k?"-":"+"):k&&(X="-"+X),X},stringToNumber:function(i){var c=o[m.currentLocale],h=i,f={thousand:3,million:6,billion:9,trillion:12},y,p,v;if(m.zeroFormat&&i===m.zeroFormat)p=0;else if(m.nullFormat&&i===m.nullFormat||!i.replace(/[^0-9]+/g,"").length)p=null;else{p=1,c.delimiters.decimal!=="."&&(i=i.replace(/\./g,"").replace(c.delimiters.decimal,"."));for(y in f)if(v=new RegExp("[^a-zA-Z]"+c.abbreviations[y]+"(?:\\)|(\\"+c.currency.symbol+")?(?:\\))?)?$"),h.match(v)){p*=Math.pow(10,f[y]);break}p*=(i.split("-").length+Math.min(i.split("(").length-1,i.split(")").length-1))%2?1:-1,i=i.replace(/[^0-9\.]+/g,""),p*=Number(i)}return p},isNaN:function(i){return typeof i=="number"&&isNaN(i)},includes:function(i,c){return i.indexOf(c)!==-1},insert:function(i,c,h){return i.slice(0,h)+c+i.slice(h)},reduce:function(i,c){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof c!="function")throw new TypeError(c+" is not a function");var h=Object(i),f=h.length>>>0,y=0,p;if(arguments.length===3)p=arguments[2];else{for(;y<f&&!(y in h);)y++;if(y>=f)throw new TypeError("Reduce of empty array with no initial value");p=h[y++]}for(;y<f;y++)y in h&&(p=c(p,h[y],y,h));return p},multiplier:function(i){var c=i.toString().split(".");return c.length<2?1:Math.pow(10,c[1].length)},correctionFactor:function(){var i=Array.prototype.slice.call(arguments);return i.reduce(function(c,h){var f=n.multiplier(h);return c>f?c:f},1)},toFixed:function(i,c,h,f){var y=i.toString().split("."),p=c-(f||0),v,_,E,S;return y.length===2?v=Math.min(Math.max(y[1].length,p),c):v=p,E=Math.pow(10,v),S=(h(i+"e+"+v)/E).toFixed(v),f>c-v&&(_=new RegExp("\\.?0{1,"+(f-(c-v))+"}$"),S=S.replace(_,"")),S}},t.options=m,t.formats=l,t.locales=o,t.locale=function(i){return i&&(m.currentLocale=i.toLowerCase()),m.currentLocale},t.localeData=function(i){if(!i)return o[m.currentLocale];if(i=i.toLowerCase(),!o[i])throw new Error("Unknown locale : "+i);return o[i]},t.reset=function(){for(var i in a)m[i]=a[i]},t.zeroFormat=function(i){m.zeroFormat=typeof i=="string"?i:null},t.nullFormat=function(i){m.nullFormat=typeof i=="string"?i:null},t.defaultFormat=function(i){m.defaultFormat=typeof i=="string"?i:"0.0"},t.register=function(i,c,h){if(c=c.toLowerCase(),this[i+"s"][c])throw new TypeError(c+" "+i+" already registered.");return this[i+"s"][c]=h,h},t.validate=function(i,c){var h,f,y,p,v,_,E,S;if(typeof i!="string"&&(i+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",i)),i=i.trim(),i.match(/^\d+$/))return!0;if(i==="")return!1;try{E=t.localeData(c)}catch{E=t.localeData(t.locale())}return y=E.currency.symbol,v=E.abbreviations,h=E.delimiters.decimal,E.delimiters.thousands==="."?f="\\.":f=E.delimiters.thousands,S=i.match(/^[^\d]+/),S!==null&&(i=i.substr(1),S[0]!==y)||(S=i.match(/[^\d]+$/),S!==null&&(i=i.slice(0,-1),S[0]!==v.thousand&&S[0]!==v.million&&S[0]!==v.billion&&S[0]!==v.trillion))?!1:(_=new RegExp(f+"{2}"),i.match(/[^\d.,]/g)?!1:(p=i.split(h),p.length>2?!1:p.length<2?!!p[0].match(/^\d+.*\d$/)&&!p[0].match(_):p[0].length===1?!!p[0].match(/^\d+$/)&&!p[0].match(_)&&!!p[1].match(/^\d+$/):!!p[0].match(/^\d+.*\d$/)&&!p[0].match(_)&&!!p[1].match(/^\d+$/)))},t.fn=u.prototype={clone:function(){return t(this)},format:function(i,c){var h=this._value,f=i||m.defaultFormat,y,p,v;if(c=c||Math.round,h===0&&m.zeroFormat!==null)p=m.zeroFormat;else if(h===null&&m.nullFormat!==null)p=m.nullFormat;else{for(y in l)if(f.match(l[y].regexps.format)){v=l[y].format;break}v=v||t._.numberToFormat,p=v(h,f,c)}return p},value:function(){return this._value},input:function(){return this._input},set:function(i){return this._value=Number(i),this},add:function(i){var c=n.correctionFactor.call(null,this._value,i);function h(f,y,p,v){return f+Math.round(c*y)}return this._value=n.reduce([this._value,i],h,0)/c,this},subtract:function(i){var c=n.correctionFactor.call(null,this._value,i);function h(f,y,p,v){return f-Math.round(c*y)}return this._value=n.reduce([i],h,Math.round(this._value*c))/c,this},multiply:function(i){function c(h,f,y,p){var v=n.correctionFactor(h,f);return Math.round(h*v)*Math.round(f*v)/Math.round(v*v)}return this._value=n.reduce([this._value,i],c,1),this},divide:function(i){function c(h,f,y,p){var v=n.correctionFactor(h,f);return Math.round(h*v)/Math.round(f*v)}return this._value=n.reduce([this._value,i],c),this},difference:function(i){return Math.abs(t(this._value).subtract(i).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(i){var c=i%10;return~~(i%100/10)===1?"th":c===1?"st":c===2?"nd":c===3?"rd":"th"},currency:{symbol:"$"}}),function(){t.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(i,c,h){var f=t._.includes(c," BPS")?" ":"",y;return i=i*1e4,c=c.replace(/\s?BPS/,""),y=t._.numberToFormat(i,c,h),t._.includes(y,")")?(y=y.split(""),y.splice(-1,0,f+"BPS"),y=y.join("")):y=y+f+"BPS",y},unformat:function(i){return+(t._.stringToNumber(i)*1e-4).toFixed(15)}})}(),function(){var i={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},c={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},h=i.suffixes.concat(c.suffixes.filter(function(y){return i.suffixes.indexOf(y)<0})),f=h.join("|");f="("+f.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(f)},format:function(y,p,v){var _,E=t._.includes(p,"ib")?c:i,S=t._.includes(p," b")||t._.includes(p," ib")?" ":"",T,D,$;for(p=p.replace(/\s?i?b/,""),T=0;T<=E.suffixes.length;T++)if(D=Math.pow(E.base,T),$=Math.pow(E.base,T+1),y===null||y===0||y>=D&&y<$){S+=E.suffixes[T],D>0&&(y=y/D);break}return _=t._.numberToFormat(y,p,v),_+S},unformat:function(y){var p=t._.stringToNumber(y),v,_;if(p){for(v=i.suffixes.length-1;v>=0;v--){if(t._.includes(y,i.suffixes[v])){_=Math.pow(i.base,v);break}if(t._.includes(y,c.suffixes[v])){_=Math.pow(c.base,v);break}}p*=_||1}return p}})}(),function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(i,c,h){var f=t.locales[t.options.currentLocale],y={before:c.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:c.match(/([\+|\-|\)|\s|\$]*)$/)[0]},p,v,_;for(c=c.replace(/\s?\$\s?/,""),p=t._.numberToFormat(i,c,h),i>=0?(y.before=y.before.replace(/[\-\(]/,""),y.after=y.after.replace(/[\-\)]/,"")):i<0&&!t._.includes(y.before,"-")&&!t._.includes(y.before,"(")&&(y.before="-"+y.before),_=0;_<y.before.length;_++)switch(v=y.before[_],v){case"$":p=t._.insert(p,f.currency.symbol,_);break;case" ":p=t._.insert(p," ",_+f.currency.symbol.length-1);break}for(_=y.after.length-1;_>=0;_--)switch(v=y.after[_],v){case"$":p=_===y.after.length-1?p+f.currency.symbol:t._.insert(p,f.currency.symbol,-(y.after.length-(1+_)));break;case" ":p=_===y.after.length-1?p+" ":t._.insert(p," ",-(y.after.length-(1+_)+f.currency.symbol.length-1));break}return p}})}(),function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(i,c,h){var f,y=typeof i=="number"&&!t._.isNaN(i)?i.toExponential():"0e+0",p=y.split("e");return c=c.replace(/e[\+|\-]{1}0/,""),f=t._.numberToFormat(Number(p[0]),c,h),f+"e"+p[1]},unformat:function(i){var c=t._.includes(i,"e+")?i.split("e+"):i.split("e-"),h=Number(c[0]),f=Number(c[1]);f=t._.includes(i,"e-")?f*=-1:f;function y(p,v,_,E){var S=t._.correctionFactor(p,v),T=p*S*(v*S)/(S*S);return T}return t._.reduce([h,Math.pow(10,f)],y,1)}})}(),function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(i,c,h){var f=t.locales[t.options.currentLocale],y,p=t._.includes(c," o")?" ":"";return c=c.replace(/\s?o/,""),p+=f.ordinal(i),y=t._.numberToFormat(i,c,h),y+p}})}(),function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(i,c,h){var f=t._.includes(c," %")?" ":"",y;return t.options.scalePercentBy100&&(i=i*100),c=c.replace(/\s?\%/,""),y=t._.numberToFormat(i,c,h),t._.includes(y,")")?(y=y.split(""),y.splice(-1,0,f+"%"),y=y.join("")):y=y+f+"%",y},unformat:function(i){var c=t._.stringToNumber(i);return t.options.scalePercentBy100?c*.01:c}})}(),function(){t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(i,c,h){var f=Math.floor(i/60/60),y=Math.floor((i-f*60*60)/60),p=Math.round(i-f*60*60-y*60);return f+":"+(y<10?"0"+y:y)+":"+(p<10?"0"+p:p)},unformat:function(i){var c=i.split(":"),h=0;return c.length===3?(h=h+Number(c[0])*60*60,h=h+Number(c[1])*60,h=h+Number(c[2])):c.length===2&&(h=h+Number(c[0])*60,h=h+Number(c[1])),Number(h)}})}(),t})}(Qs)),Qs.exports}var md=ud();const Zs=yr(md),ve=e=>+(Math.round(parseFloat(e)+"e+3")+"e-3"),st=e=>+(Math.round(parseFloat(e)+"e+2")+"e-2"),fd={_2:{reg:/^\d+(\.\d{1,2})?$/,message:"Only Positive value upto 2 decimals is allowed",roundUpto:st},_3:{reg:/^\d+(\.\d{1,3})?$/,message:"Only Positive value upto 3 decimals is allowed",roundUpto:ve}},Oe=(e,t)=>{const n=fd[`_${Wt[t].minimumFractionDigits??2}`].roundUpto;return n(e)},Js=e=>({INR:"Rs",USD:"USD",GBP:"GBP",AED:"AE",ZMW:"ZM",SAR:"SAR",QAR:"QAR",BHD:"BHD",NPR:"NPR",KWD:"KWD",OMR:"OMR",KES:"KES",SGD:"SGD",MVR:"MVR",IDR:"IDR",THB:"THB",MYR:"MYR",TZS:"TZS",BWP:"BWP"})[e]||"Rs",Wt={USD:{symbol:"$"},EUR:{symbol:"€"},GBP:{symbol:"£"},AED:{symbol:"AE",contactValidation:8},JPY:{symbol:"¥"},AUD:{symbol:"A$"},CAD:{symbol:"CA$",contactValidation:7},INR:{symbol:"₹",round:Math.round},CNY:{symbol:"CN¥",contactValidation:8},BRL:{symbol:"R$",contactValidation:9},QAR:{symbol:"QAR",contactValidation:8},SAR:{symbol:"SAR",contactValidation:7},BHD:{symbol:"BHD",minimumFractionDigits:3,contactValidation:7},NPR:{symbol:"NPR",contactValidation:10},KWD:{symbol:"KWD",minimumFractionDigits:3,contactValidation:8},ZMW:{symbol:"ZK",contactValidation:9},OMR:{symbol:"OMR",minimumFractionDigits:3,contactValidation:8},KES:{symbol:"KSh",contactValidation:9},SGD:{symbol:"S$",contactValidation:9},MVR:{symbol:"MVR",contactValidation:7,displayType:"code"},IDR:{symbol:"Rp",contactValidation:13,displayType:"code",round:Math.round},THB:{symbol:"฿",contactValidation:8,displayType:"code"},MYR:{symbol:"RM",displayType:"code"},PKR:{symbol:"₨",round:Math.round},GHS:{symbol:"₵",contactValidation:9},LKR:{symbol:"₨",displayType:"code"},TZS:{symbol:"TZS",contactValidation:9},BWP:{symbol:"P",contactValidation:8,displayType:"code"}};function ja(e,t){switch(t){case"BHD":case"KWD":case"OMR":return Zs(e).format("0,00.000");default:return Zs(e).format("0,00.00")}}function pd(e){const t=["","One","Two","Three","Four","Five","Six","Seven","Eight","Nine"],n=["Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],r=["","Ten","Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"];function l(f){if(f<10)return t[f];if(f<20)return n[f-11];{const y=f%10,p=Math.floor(f/10);return`${r[p]}${y?" "+t[y]:""}`}}function o(f){var y=f.toString(),p,v,_,E,S,T,D,$,k,J,re,te,de="and";if(y=y.replace(/[, ]/g,""),parseInt(y)===0)return"zero";for(p=["","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],v=["","","Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"],_=["","Thousand","Million","Billion","Trillion","Quadrillion","Quintillion","Sextillion","Septillion","Octillion","Nonillion","Decillion","Undecillion","Duodecillion","Tredecillion","Quatttuor-Decillion","quindecillion","sexdecillion","septen-decillion","octodecillion","novemdecillion","vigintillion","centillion"],E=y.length,T=[];E>0;)S=E,T.push(y.slice(E=Math.max(0,E-3),S));if(D=T.length,D>_.length)return"";for(te=[],J=0;J<D;J++)$=parseInt(T[J]),$&&(k=T[J].split("").reverse().map(parseFloat),k[1]===1&&(k[0]+=10),(re=_[J])&&te.push(re),(re=p[k[0]])&&te.push(re),(re=v[k[1]])&&te.push(re),(k[0]||k[1])&&(k[2]||J+1>D)&&te.push(de),(re=p[k[2]])&&te.push(re+" Hundred"));return te.reverse().join(" ")}const[a,m]=e.toString().split("."),u=o(parseInt(a,10)),i=l(parseInt(m,10)),c=i?`${i} Paise`:"";return`${u} Rupees ${c&&"And "+c?c:""} Only`}const le=(e,t)=>{var n;return((n=Wt[t])==null?void 0:n.displayType)=="code"?`${t} ${Oe(e||0,t)}`:`${Wt[t].symbol} ${Oe(e||0,t)}`},G=(e,t)=>{var n;return((n=Wt[t])==null?void 0:n.displayType)=="code"?`${t} ${ja(e||0,t)}`:`${Wt[t].symbol} ${ja(e||0,t)}`},tr=()=>{var e="Unknown OS";return navigator.userAgent.indexOf("Win")!=-1&&(e="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(e="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(e="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(e="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(e="iOS"),e},yd=e=>+(Math.round(parseFloat(e)*1e3)/1e3).toFixed(3),sr=(e,t="type",n)=>{const r={},l=n==null?void 0:n.separateItemsDisc;return e.forEach(a=>{var m;(m=a.discounts)==null||m.forEach(u=>{if(u.type){let i=`${u[t]}`;u.type==="DISCOUNT_ITEMS"&&l&&(i=`${u[t]}::${u.discountType}::${u.discountValue}`),r[i]?r[i].discountAmt+=u.discountAmt:r[i]={type:u.type,discountType:u.discountType,discountValue:u.discountValue,discountAmt:yd(u.discountAmt),discountName:u.discountName}}})}),Object.values(r)},nr=(e,t="type")=>{const n={};return e.forEach(l=>{var o;(o=l.dish_charges)==null||o.forEach(a=>{const m=`${a[t]}`;n[m]?(n[m].amt+=a.amt,n[m].taxAmt+=a.taxAmt):n[m]={amt:a.amt,chargeType:a.chargeType?a.chargeType:a.type,defaultSelcted:a.defaultSelcted,rate:a.rate,tax:a.tax,taxAmt:a.taxAmt,name:a.name,type:a.type}})}),Object.values(n)},rr=e=>{const t=e==null?void 0:e.split("-");return(t==null?void 0:t.length)===3?`${t[2]}-${t[1]}-${t[0]}`:null};function fs(e,t){const n=Buffer.from([e],"utf8"),r=Buffer.from([t.length],"utf8"),l=Buffer.from(t,"utf8"),o=[n,r,l];return Buffer.concat(o)}function gd(e,t,n,r,l){const o=fs("1",e),a=fs("2",t),m=fs("3",n),u=fs("4",r),i=fs("5",l);var c=Buffer.concat([o,a,m,u,i]);return c.toString("base64")}const xd=e=>({Station:"Station",Chef:"Chef",Area:"Areas",Waiter:"Waiter",Captain:"Captain",Table:"Table",KOT:"KOT",Table_View:"Table View",Manage_Dine_In:"Manage Dine-In",Counter:"Counter"}),Nd=e=>{let t;return e!=null&&e.length?t=JSON.parse(JSON.stringify(e)):t=[{internalName:"CASH",displayName:"Cash",paymentState:"PAID_OFFLINE"},{internalName:"CREDIT_CARD",displayName:"Credit Card",paymentState:"PAID_ONLINE"},{internalName:"DEBIT_CARD",displayName:"Debit Card",paymentState:"PAID_ONLINE"},{internalName:"UPI",displayName:"UPI",paymentState:"PAID_ONLINE"}],t},ps=tr(),jd=e=>{let t=e||0;var n=Math.floor(t/60),r=`${n} min`,l=parseInt(r);if(l>60){var o=Math.floor(t/3600),a=Math.floor(t%3600/60),m=`${o} hr ${a} min`;return m}else return r},vd=(e,t)=>{let n=new Array,r={WRITE_OFF:"WRITE_OFF",CASH_CARD:"CASH_CARD"};const l=[...t,{internalName:"swiggy",displayName:"Swiggy"},{internalName:"zomato",displayName:"Zomato"}],o=ms(l,"internalName");let a;for(let m in e.paymentModes)!r[m]&&e.paymentModes[m]&&(a=o[m],n.push({displayName:a?a.displayName:Ve(m.replace("_"," ")),value:st(e.paymentModes[m])}));return n},_d=(e,t)=>e>0&&t>0?e/t:0;function zt(e){return new Promise((t,n)=>{try{var r=new Image;r.src=e,r.setAttribute("crossOrigin","anonymous"),r.onload=()=>{var l=document.createElement("canvas");l.width=r.width,l.height=r.height;var o=l.getContext("2d");o.drawImage(r,0,0);var a=l.toDataURL("image/png");t(a)},r.onerror=l=>{t(null)}}catch{t(null)}})}const Xs=(e,t,n)=>{if(e&&e.length>0)if(t!=null&&t.name){let r=[];return e.map(l=>{l.serverName&&l.serverName.includes(t==null?void 0:t.name)&&r.push({...l,value:l[n]})}),r}else return e;else return!0},ar=e=>{let t={},n;for(let r=0;r<e.length;r++)switch(n=e[r],n.type){case"ORDER_DISCOUNT":t.ORDER_DISCOUNT=[n];break;case"DISCOUNT_ITEMS":t.DISCOUNT_ITEMS?t.DISCOUNT_ITEMS.push(n):t.DISCOUNT_ITEMS=[n];break;case"CATEGORY_DISCOUNT":t.CATEGORY_DISCOUNT?t.CATEGORY_DISCOUNT.push(n):t.CATEGORY_DISCOUNT=[n];break;case"ITEM_DISCOUNT":t.ITEM_DISCOUNT?t.ITEM_DISCOUNT.push(n):t.ITEM_DISCOUNT=[n];break;case"COUPON_DISCOUNT":t.COUPON_DISCOUNT=[n];break;case"SEGMENT_DISCOUNT":t.SEGMENT_DISCOUNT=[n];break}return t},ir=(e,t)=>{var c,h,f,y;let n,r,l,o,a;const m={},{itemInstructionOnBill:u,printZeroPriceAddons:i}=t;for(let p=0;p<e.length;p++)if(n=e[p],n.status!=="CANCELLED"){if((c=n.addons)!=null&&c.length&&!i)for(l=[],a=0;a<n.addons.length;a++)o=n.addons[a],o.serviceRate&&l.push(o);else l=n.addons;if(u?r=`${n.serviceId}::${n.serviceRate}::${n.instruction}::${n.taxType??"GST"}`:r=`${n.serviceId}::${n.serviceRate}::${n.taxType??"GST"}`,m[r]){if(m[r].qty+=n.qty,m[r].sub_total+=n.sub_total,(h=m[r].addons)!=null&&h.length&&((f=n.addons)!=null&&f.length)){const v=ms(n.addons,"serviceId"),_=[];let E;for(let S=0;S<m[r].addons.length;S++)o=m[r].addons[S],(y=v[o.serviceId])!=null&&y.serviceId&&(E=v[o.serviceId],o.sub_total+=E.sub_total??0),_.push(o);m[r].addons=_}}else m[r]=JSON.parse(JSON.stringify({...n,addons:l}))}return Object.values(m)},en=e=>{var m;let t,n,r,l,o={},a=0;for(let u=0;u<e.length;u++)if(t=e[u],(m=t.taxation)!=null&&m.length)for(n=0;n<t.taxation.length;n++)r=t.taxation[n],l=`${r.tax}::${r.taxType??"GST"}`,o[l]?(o[l].taxableAmt=o[l].taxableAmt+(r.taxableAmt??0),o[l].taxAmt=o[l].taxAmt+(r.taxAmt??0),a+=r.taxAmt):(o[l]=JSON.parse(JSON.stringify(r)),a+=r.taxAmt);return{obj:Object.values(o),sum:a}},lr=(e,t,n)=>{var o,a,m,u;let r=n.occupiedServer,l;try{l=r?JSON.parse(r):void 0}catch(i){console.error("Failed to parse serverData:",i),l=void 0}if(t.type=="BILL"||t.type=="AGGREGATOR_BILL")return Xs((o=t.siteSetting)==null?void 0:o.billPrinters,l,"label");if(t.type=="PACKAGING_SLIP"){let i=Xs((a=t.siteSetting)==null?void 0:a.packagingSlipPrinters,l,"value");if(ps=="Android OS"){let c=i&&i.length>0?i.findIndex(h=>h.value==e.value):-1;return c!=-1?[i[c]]:null}else{let c=i&&i.length>0?i.findIndex(h=>h.value==e):-1;return c!=-1?[i[c]]:null}}else{if(t.type=="ITEMWISE_SALES_COUNTER"||t.type=="PRINT_DASHBOARD"||t.type=="COUNTER_OPERATION"||t.type=="CARD_RECHARGE_DETAILS"||t.type==="ORDER_AGGREGATED_PRINT")return Xs((m=t.siteSetting)==null?void 0:m.billPrinters,l,"value");{let i=Xs((u=t.siteSetting)==null?void 0:u.printers,l,"value");if(i===!0)return i;if(ps=="Android OS"){let c=i&&i.length>0?i.findIndex(h=>h.value==(e==null?void 0:e.value)):-1;return c!=-1?[i[c]]:null}else{let c=i&&i.length>0?i.findIndex(h=>h.value==e):-1;return c!=-1?[i[c]]:null}}}},bd=(e,t,n={})=>{var E;const{usersObj:r,stationList:l}=n;let o={},a,m;const{cancelledKOT:u,onlyCancelledItems:i,kotStatus:c="KOT_GENERATED"}=n,h=ft(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((E=e.customFeilds)!=null&&E.length){let S=ft(e.customFeilds,"INSTRUCTION","customType");S!=null&&S.customValue&&(m=[{customName:S.customName,customValue:S.customValue}])}e.orderList.filter(S=>{a=S.services.sort(T=>T.status==="CANCELLED"?-1:0),a.forEach((T,D)=>{var Z,X,q;let $=T.station?T.station.split("::"):"",k=$&&$.length>1?$[1]:$[0],J=e.tableNo?e.tableNo.split("::"):null,re=J&&J.length>0?J[0]:e.orderFrom,te=e.tableName?e.tableName:e.tableNo?re:e.orderFrom,de;(Z=r==null?void 0:r[S.createdBy])!=null&&Z.name&&(de=r[S.createdBy].name);let be=!1;(u||k&&T.status==c)&&(be=!0),be&&or(k,l)&&(o[k]||(o[k]={},o[k].station=k,o[k].services=[],o[k].tableName=te,o[k].customerName=e.name==t.companyName?null:e.name,o[k].time=R().format("DD-MM-YYYY hh:mm a"),o[k].type=e.orderFrom,o[k].subOrderFrom=e.subOrderFrom,o[k].orderId=e.externalOrderId||e.offlineOrderId?e.orderId:S.subOrderId,o[k].orderId=new Set([o[k].orderId]),o[k].instruction=e.instruction,o[k].orderSource=e.orderSource,o[k].deliveryTimestamp=e.deliveryTimestamp?R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A"):null,o[k].aggregatorOrderId=e.externalOrderId,o[k].otp=e.otp,o[k].totalQty=0,o[k].tokenId=e.tokenId,o[k].kotId=T.kotId?new Set([T.kotId]):null,o[k].waiterName=e.waiterName,o[k].duplicate=u,o[k].createdBy=de,o[k].zomatoInstant=h,m&&(o[k].customFields=m),i&&(o[k].onlyCancelledItems=i),e.preparationTime&&(o[k].prepareBy=R().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A"))),o[k]?(o[k].services.push({serviceName:T.serviceName,qty:T.qty,instruction:T.isUrgent&&T.instruction?`(URGENT -${T.instruction})`:T.instruction?`(${T.instruction})`:T.isUrgent?"(URGENT)":"",subOrderId:S.subOrderId,isUrgent:T.isUrgent,index:D,status:T.status,addons:T.addons}),o[k].totalQty+=ve(T.qty),(X=o[k].kotId)==null||X.add(T.kotId),e.externalOrderId||e.offlineOrderId||(q=o[k].orderId)==null||q.add(S.subOrderId)):(o[k]=[],o[k].services.push({serviceName:T.serviceName,qty:T.qty,instruction:T.instruction?T.instruction:"",subOrderId:S.subOrderId,index:D,status:T.status}),o[k].totalQty+=ve(T.qty)))})});let f={},y="2INCH";tr();let p,v=[],_={};for(const S in o)if(Object.hasOwnProperty.call(o,S)){const T=o[S];try{t.printers&&t.printers.map(D=>{D.label.toUpperCase()==T.station.toUpperCase()&&(p=ps=="Android OS"?D:D.value??void 0,y=D.paperSize?D.paperSize:t.printerSize,v.push({printer:p,paperSize:y}))}),v.length==0&&v.push({printer:p,paperSize:t.printerSize||y});for(let D=0;D<T.services.length;D++){let $=T.services[D],k=e.orderList.find(re=>re.subOrderId==$.subOrderId),J=f[$.subOrderId];k&&(J?J.services.push(k.services[$.index]):(f[$.subOrderId]={},f[$.subOrderId].subOrderId=k.subOrderId,f[$.subOrderId].services=[k.services[$.index]]))}}catch(D){console.log(D)}_[S]=v,v=[],p=null}for(const S in f)Object.hasOwnProperty.call(f,S)&&f[S];return{obj:o,paperSize:y,printer:p,printersMap:_}},Sd=(e,t,n)=>{var l,o;const{kotStatus:r="KOT_GENERATED"}=n;try{let a="2INCH",m,u=[],i,c;const h=ft(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((l=e.customFeilds)!=null&&l.length){let f=ft(e.customFeilds,"INSTRUCTION","customType");f!=null&&f.customValue&&(c=[{customName:f.customName,customValue:f.customValue}])}for(let f=0;f<t.packagingSlipPrinters.length;f++)if(i=t.packagingSlipPrinters[f],i.label==e.subOrderFrom&&(m=ps=="Android OS"?i:i.value??void 0,a=i.paperSize?i.paperSize:a,i.paperSize)){let y,p,v,_,E,S={orderFrom:e.orderFrom,subOrderFrom:e.subOrderFrom,companyInfo:{companyName:t.companyName},tokenId:e.tokenId,orderId:e.orderId,customerInfo:{custName:e.name,custContact:e.mobile},paymentMethods:e.paymentMethods,newId:Math.random(),date:R().format("DD-MM-YYYY hh:mm a"),tableName:e.tableName,tableName:e.tableName,waiterName:e.waiterName,paymentStatus:e.paymentStatus??"UNPAID",aggregatorOrderId:e.externalOrderId,orderSource:e.orderSource,otp:e.otp,zomatoInstant:h},T={},D=!1,$,k=0;for(e.preparationTime&&(S.prepareBy=R().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A")),c&&(S.customFields=c),v=0;v<e.orderList.length;v++)for(y=e.orderList[v],_=0;_<y.services.length;_++)p=y.services[_],p={...p,instruction:p.isUrgent&&p.instruction?`(URGENT -${p.instruction})`:p.instruction?`(${p.instruction})`:p.isUrgent?"(URGENT)":null},D=!1,p.status===r&&((o=i.stations)!=null&&o.length?($=cd(i.stations),$[p.station]&&(D=!0)):D=!0),D&&p.kotId&&p.station&&(E=p.station.split("::")[1],k+=p.qty,T[`${E}/${p.kotId}`]?T[`${E}/${p.kotId}`].push(p):T[`${E}/${p.kotId}`]=[p]);Object.keys(T).length&&(S.services=T,S.totalQty=st(k),u.push({printer:m,paperSize:a,obj:S}))}return{printers:u}}catch(a){console.log(a)}},Td=(e,t,n={})=>{let r={};if(n.action==="SWITCH_TABLE")e.orderList.forEach(u=>{u.services.forEach(i=>{var c;if((i.status==="KOT_GENERATED"||i.status==="IN_PROCESS")&&i.station){let h=(c=i.station.split("::"))==null?void 0:c[1];h&&or(h,n.stationList)&&(r[h]?r[h].activeKots[i.kotId]=i.kotId:r[h]={from:[n.from],to:[n.to],station:h,activeKots:{[i.kotId]:i.kotId},type:"UPDATE_TABLE",action:"SWITCH_TABLE",orderId:i.id})}})});else{let u,i,c,h,f={},y=[];for(i=0;i<n.sources.length;i++)for(u=n.sources[i],y.push(u.tableNo),c=0;c<u.ids.length;c++)h=u.ids[c],f[h]=h;for(let p=0;p<n.orderData.length;p++)u=n.orderData[p],f[u.id]&&u.orderList.forEach(v=>{v.services.forEach(_=>{var E;if((_.status==="KOT_GENERATED"||_.status==="IN_PROCESS")&&_.station){let S=(E=_.station.split("::"))==null?void 0:E[1];S&&or(S,n.stationList)&&(r[S]?r[S].activeKots[_.kotId]=_.kotId:r[S]={from:y,to:[n.to],station:S,activeKots:{[_.kotId]:_.kotId},type:"UPDATE_TABLE",action:"MERGE_TABLE",orderId:_.id})}})})}let l="2INCH",o,a=[],m={};for(const u in r)if(Object.hasOwnProperty.call(r,u)){const i=r[u];try{t.printers&&t.printers.map(c=>{c.label.toUpperCase()==i.station.toUpperCase()&&(o=c.value?ps=="Android OS"?c:c.value:void 0,l=c.paperSize?c.paperSize:t.printerSize,a.push({printer:o,paperSize:l}))}),a.length==0&&a.push({printer:o,paperSize:t.printerSize||l})}catch(c){console.log(c)}m[u]=a,a=[],o=null}return{obj:r,paperSize:l,printersMap:m}},wd=(e,t)=>{var T,D;let{serviceTypeConfig:n,salesCollection:r,todayCollection:l,dailyExpanse:o,collectionDate:a,rangeDate:m}=t,u={},i;const c=!!ft(n,"dine-in","slugName").slugName;if(l!=null&&l.AGGREGATOR_PAYMENT){const{AGGREGATOR_PAYMENT:$,...k}=l;l={...k,swiggy:r.swiggy_collection??0,zomato:r.zomato_collection??0}}let h=c&&(n==null?void 0:n.length)&&n.some($=>$.slugName==="online-menu")&&e.isAggregatorEnabled==!0,f=h?r.aggregator_collection:void 0,y=h?r.zomato_collection:void 0,p=h?r.swiggy_collection:void 0,v=c?jd(r.avgTableTime):void 0;i={};let _=0;if(r!=null&&r.menuWiseSales){const $=r.menuWiseSales;for(const k in $)k.endsWith("collection")?i[ts(k)]=st($[k]):i[ts(k)]=$[k]}if(r.swiggy_aggregator&&(i.Swiggy=r.swiggy_aggregator,i.Swiggy_collection=r.swiggy_collection),r.zomato_aggregator&&(i.Zomato=r.zomato_aggregator,i.Zomato_collection=r.zomato_collection),r.itemTypeList&&((T=Object.keys(r.itemTypeList))!=null&&T.length))for(let $ in r.itemTypeList)_+=r.itemTypeList[$];let E=a;return m.toDate!==m.fromDate&&(E=`${rr(m.fromDate)} - ${rr(m.toDate)}`),{salesCollection:c?{...r,totalCollection:st(r.totalCollection),totalOrders:r.totalOrders,online_aggregator:r.aggregator,zomato_aggregator:r.zomato_aggregator,swiggy_aggregator:r.swiggy_aggregator,online_aggregator_collection:f,zomato_aggregator_collection:y,swiggy_aggregator_collection:p,itemTypes:u}:void 0,todayCollection:vd(l,e.paymentModes),totalCollection:st(l.totalCollection),averageCollection:{avgTableTime:v,avgorderValue:_d(r.totalCollection,r.totalOrders).toFixed(2),todayExpense:o&&((D=o.DEBIT)!=null&&D.total)?st(o.DEBIT.total):0,totalDiscountAmt:r&&r.totalDiscountAmt?st(r.totalDiscountAmt):0,totalBalanceAmt:r&&r.totalBalanceAmt?st(r.totalBalanceAmt):0,dailyExpanse:o,noOfGuest:r.noOfGuest,avgPerCover:r.avgPerCover,refundAmt:l.refundAmt,writeOffAmt:l.writeOffAmt,rewardAmt:r.rewardAmt},menusCollection:{...i},selectedDate:E,id:Math.random(),otherFields:{salesCollection:l.salesCollection?st(l.salesCollection):0,outstandingAmt:l.outstandingAmt,totalDiscountAmt:r.totalDiscountAmt,discountList:r.discountList,totalOtherCharges:r.totalOtherCharges,otherChargesList:r.otherChargesList,totalTax:r.totalTax,taxList:r.taxList,totalItemType:_,itemTypeList:r.itemTypeList}}},Id=(e,t,n={})=>new Promise(async(r,l)=>{var h,f,y;const{invoiceFormat:o,userData:a}=n;let m,u,i=[],c;try{if((h=e.appliedDiscounts)!=null&&h.length){c=0;for(let X=0;X<e.appliedDiscounts.length;X++)m=e.appliedDiscounts[X],c+=m.discountAmt}const p=ft(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((f=e.customFeilds)!=null&&f.length){const X=ft(e.customFeilds,"INSTRUCTION","customType");X!=null&&X.customValue&&(i=[{customName:X.customName,customValue:X.customValue}])}m={};let v=(y=t==null?void 0:t.footerAddress)!=null&&y.addressLineOne?t==null?void 0:t.footerAddress.addressLineOne:"",_=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",E=t.footerAddress.city?t.footerAddress.city:"",S=t.footerAddress.zip?t.footerAddress.zip:"",T=(v!=""?v+",":"")+(_!=""?_+",":"")+(E!=""?E+",":"")+(S!=""?S+",":""),D=t.gstNo,$={companyName:t.companyName,companyAddress:T,companyContact:t.contactNumber,companyEmail:t.contactEmail},J={orderStatus:"COMPLETED",orderDate:e&&e.timestamp?R.unix(e.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:e&&e.orderId?e.orderId:null,timestamp:e.timestamp},re={custName:e.name??null,custAddress:e.custAddress??null,custContact:e.mobile??null},te=Js(t.curr),de={...e,companyInfo:$,orderInfo:J,customerInfo:re,gst:D,curr:te},be=null,Z=null;o.companyLogo&&(be=await zt(`https://${o.companyLogo.bucket}.s3.amazonaws.com/${o.companyLogo.key}`)),o.qrcode&&(Z=await zt(`https://${o.qrcode.bucket}.s3.amazonaws.com/${o.qrcode.key}`)),e.orderList.filter(X=>{X.services.forEach(async(q,ue)=>{var De,nt;let z="kitchen",ee=e.tableName?e.tableName:e.orderFrom;z&&(m[z]||(m[z]={},m[z].station=z,m[z].services=[],m[z].tableName=ee,m[z].customerName=e.name,m[z].time=R.unix(e.timestamp).format("DD-MM-YYYY hh:mm a"),m[z].type=e.orderFrom,m[z].orderId=e.orderId,m[z].instruction=e.instruction,m[z].totalQty=0,m[z].tokenId=e.tokenId,m[z].orderSource=e.orderSource,m[z].aggregatorOrderId=e.externalOrderId,m[z].otp=e.otp,m[z].paymentState=e.paymentState,m[z].discountAmt=c,m[z].otherCharges=e.otherCharges,m[z].taxAmt=e.taxAmt,m[z].customFeilds=i,m[z].curr=t.curr??"INR",m[z].zomatoInstant=p),m[z]?(u={serviceName:q.serviceName,qty:q.qty,instruction:q.isUrgent&&q.instruction?`(URGENT -${q.instruction})`:q.instruction?`(${q.instruction})`:q.isUrgent?"(URGENT)":"",subOrderId:X.subOrderId,isUrgent:q.isUrgent,index:ue},(De=q.addons)!=null&&De.length&&(u.addons=q.addons),m[z].services.push(u),m[z].totalQty+=q.qty):(m[z]=[],m[z].services.push({serviceName:q.serviceName,qty:q.qty,instruction:q.instruction?q.instruction:"",subOrderId:X.subOrderId,index:ue}),m[z].totalQty+=q.qty),m[z]={...m[z],companyInfo:$,orderInfo:J,customerInfo:re,gst:D,curr:te},m[z].domain=o.siteURL,m[z].paymentMethods=o.paymentMode?de.paymentMethods:null,m[z].companyInfo.companyName=o.companyName,m[z].companyInfo.companyEmail=o.email,m[z].companyInfo.companyAddress=o.address,m[z].companyInfo.companyContact=o.mobile,m[z].tokenId=o.token?de.tokenId:null,o.isPayQR&&o.upiId&&o.upiId!==""&&(de.upiId=o.upiId),m[z].gstNo=o.gst?de.gst:null,m[z].footerMessage=o.footerMessage,m[z].orderFrom=(nt=e.subOrderFrom)==null?void 0:nt.toUpperCase(),m[z].fssai=t.fssai,m[z].vatNo=t.vatNo,m[z].printOperatorInfo=o.printOperatorInfo===null||o.printOperatorInfo===!0,m[z].disabledPoweredBy=t.disabledPoweredBy===!0,m[z].printTime=R().format("DD-MM-YYYY hh:mm A"),m[z].printedBy=a.userRole=="admin"?"Admin":a.name,e.deliveryTimestamp&&(m[z].deliveryTimestamp=R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),m[z].itemInstructionOnBill=o.itemInstructionOnBill,m[z]={...m[z],companyLogo:be,companyQrCode:Z})})});for(const X in m)if(Object.hasOwnProperty.call(m,X)){const q=m[X];try{let ue=t.printerSize??"2inch";r(new Object({obj:new Object({...q,paperSize:ue}),orderList:e.orderList}));return}catch(ue){console.log(ue)}}}catch(p){console.log("err::",p)}}),Cd=async e=>{let t=[];for(let h=0;h<e.length;h++)for(let f=0;f<e[h].orderList.length;f++)t.push(e[h].orderList[f]);let n=[];if(t.length>0)for(let h=0;h<t.length;h++)for(let f=0;f<t[h].services.length;f++)t[h].services[f].status!="CANCELLED"&&t[h].services[f].status!="RETURNED"&&t[h].services[f].status!="SHIFTED"&&n.push(t[h].services[f]);let r={},l=[];for(let h=0;h<n.length;h++)if(n[h].addons&&n[h].addons.length>0)for(let f=0;f<n[h].addons.length;f++){let y={...n[h].addons[f]};y.qty=n[h].qty,l.push(y)}n.forEach(h=>{let{attachedCat:f,serviceId:y}=h;r[f]||(r[f]=[]);let p=r[f].findIndex(v=>v.serviceId===y);p!==-1?r[f][p].qty=r[f][p].qty+h.qty:r[f].push({serviceName:h.serviceName,qty:h.qty,status:h.status,serviceId:h.serviceId,attachedCat:h.attachedCat,station:h.station})});const o=Object.keys(r).sort(),a={};o.forEach(h=>{a[h]=r[h]});for(let h in a)a[h].sort((f,y)=>f.serviceName.localeCompare(y.serviceName));let m={Category:a},u={};l.forEach(h=>{let{attachedAddonCat:f,serviceId:y}=h;u[f]||(u[f]=[]);let p=u[f].findIndex(v=>v.serviceId===y);p!==-1?u[f][p].qty=u[f][p].qty+h.qty:u[f].push({serviceName:h.serviceName,qty:h.qty,status:h.status,serviceId:h.serviceId,attachedCat:h.attachedAddonCat,station:h.station})});const i=Object.keys(u).sort(),c={};i.forEach(h=>{c[h]=u[h]});for(let h in c)c[h].sort((f,y)=>f.serviceName.localeCompare(y.serviceName));return m.Addon=c,m},va={"Andaman and Nicobar Islands":"UTGST",Chandigarh:"UTGST","Dadra and Nagar Haveli and Daman and Diu":"UTGST","Jammu & Kashmir":"UTGST",Ladakh:"UTGST",Lakshadweep:"UTGST",Puducherry:"UTGST"},_a=e=>{let t=e&&e.footerAddress&&e.footerAddress.state&&e.footerAddress.state?e.footerAddress.state:null;return va[t]?va[t]:"SGST"},ba=(e,t,n={})=>new Promise(async(r,l)=>{var a,m,u,i,c,h,f;try{const{invoiceFormat:y,custName:p,custMobile:v,custAddress:_,userData:E={}}=n,{itemList:S}=e;let T=E==null?void 0:E.userRole;if(E.userRole=="admin"?T="ADMIN":T=E==null?void 0:E.name,!(S!=null&&S.length))return;let D=t.printerSize,$=lr(null,{type:"BILL",siteSetting:t},{occupiedServer:n.occupiedServer});D=$?(a=$[0])!=null&&a.paperSize?(m=$[0])==null?void 0:m.paperSize:D||"2INCH":D;let k=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",J=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",re=t.footerAddress.city?t.footerAddress.city:"",te=t.footerAddress.zip?t.footerAddress.zip:"",de=(k!=""?k+",":"")+(J!=""?J+",":"")+(re!=""?re+",":"")+(te!=""?te+",":""),be=t.gstNo,Z={companyName:t.companyName,companyAddress:de,companyContact:t.contactNumber,companyEmail:t.contactEmail},q={orderStatus:"COMPLETED",orderDate:e&&e.timestamp?R.unix(e.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:e&&e.orderId?e.orderId:null,timestamp:e.timestamp},ue={custName:y&&y.custName?p==t.companyName?null:p:null,custAddress:y&&y.custAddress&&_||null,custContact:y&&y.custMobile?v:null,custEmail:"ajaybaglane7@gmail.com"},z=Js(t.curr),ee={...e,companyInfo:Z,orderInfo:q,customerInfo:ue,gst:be,curr:z};if(y){if(ee.domain=y.siteURL,ee.paymentMethods=y.paymentMode?ee.paymentMethods:null,ee.companyInfo.companyName=y.companyName,ee.companyInfo.companyEmail=y.email,ee.companyInfo.companyAddress=y.address,ee.companyInfo.companyContact=y.mobile,ee.customerInfo.custName=y.custName?p:null,ee.tokenId=y.token?ee.tokenId:null,y.isPayQR&&y.upiId&&y.upiId!==""&&(ee.upiId=y.upiId),ee.gstNo=y.gst?ee.gst:null,ee.footerMessage=y.footerMessage,ee.orderFrom=(u=e.subOrderFrom)==null?void 0:u.toUpperCase(),ee.fssai=t.fssai,ee.vatNo=t.vatNo,ee.invoiceType=t.invoiceType,ee.taxLabel=_a(t),ee.printOperatorInfo=y.printOperatorInfo===null||y.printOperatorInfo===!0,ee.disabledPoweredBy=t.disabledPoweredBy===!0,ee.printTime=R().format("DD-MM-YYYY hh:mm A"),e.deliveryTimestamp&&(ee.deliveryTimestamp=R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),ee.itemInstructionOnBill=y.itemInstructionOnBill,ee.printHSNCodeOnBill=y.printHSNCodeOnBill,ee.noOfInvoice=y.noOfInvoice,ee.printby=T,ee.newFormat=!0,!(y.itemInstructionOnBill||y.printHSNCodeOnBill)&&((i=ee.itemList)!=null&&i.length)){let se;for(let Se=0;Se<ee.itemList.length;Se++)se=ee.itemList[Se],se.instruction&&delete se.instruction,se.hsnCode&&delete se.hsnCode}t.enabledOutstandingOnPay&&((c=e.custoutStandingData)!=null&&c.balanceAmt)&&(ee.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let De=[];if((h=e.customFeilds)!=null&&h.length){let se;for(let Se=0;Se<e.customFeilds.length;Se++)se=e.customFeilds[Se],se!=null&&se.customValue&&((f=se.availability)!=null&&f.includes("BILL"))&&De.push({customName:se.customName,customValue:se.customValue});ee.customFields=De}let nt=null,At=null;y.companyLogo&&(nt=await zt(`https://${y.companyLogo.bucket}.s3.amazonaws.com/${y.companyLogo.key}`)),y.qrcode&&(At=await zt(`https://${y.qrcode.bucket}.s3.amazonaws.com/${y.qrcode.key}`));var o="Unknown OS";navigator.userAgent.indexOf("Win")!=-1&&(o="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(o="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(o="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(o="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(o="iOS");let pt={};(function(){let se,Se,yt=0,Ke=0,g=0,d=0,C=0,j=0,w=0,Y=0,b=[],F=[],V=0,fe;if(D==="A4"||D==="A5"){for(Se=0;Se<S.length;Se++)se=S[Se],Ke+=se.sub_total,g+=se.afterdiscAmt,d+=se.afterdiscAmt+(se.total_charges??0),yt+=se.afterdiscAmt+(se.total_charges??0),V+=se.qty;let Me=sr(S,"discountName",{separateItemsDisc:!0});const Le=ar(Me);let{obj:Ce,sum:Ye}=en(S);pt={itemList:ir(S,{itemInstructionOnBill:y.itemInstructionOnBill,printZeroPriceAddons:y.printZeroPriceAddons}),discounts:Le,charges:nr(S,"name"),taxation:Ce,subTotal:ve(Ke),afterDisc:ve(g),afterCharges:ve(d),total:ve(yt+Ye),qty:V}}else{let{obj:Me}=en(S);for(ee.taxation=Me,Se=0;Se<S.length;Se++)se=S[Se],se.taxType==="VAT"?(F.push(se),Y+=se.sub_total,j+=se.afterdiscAmt,C+=se.afterdiscAmt+(se.total_charges??0),w+=se.afterdiscAmt+(se.total_charges??0)):(b.push(se),Ke+=se.sub_total,g+=se.afterdiscAmt,d+=se.afterdiscAmt+(se.total_charges??0),yt+=se.afterdiscAmt+(se.total_charges??0));if(b.length){let Le=sr(b,"discountName",{separateItemsDisc:!0});const Ce=ar(Le);let{obj:Ye,sum:Qe}=en(b);pt.GST={itemList:ir(b,{itemInstructionOnBill:y.itemInstructionOnBill,printZeroPriceAddons:y.printZeroPriceAddons}),discounts:Ce,charges:nr(b,"name"),taxation:Ye,subTotal:ve(Ke),afterDisc:ve(g),afterCharges:ve(d),total:ve(yt+Qe)}}if(F.length){let Le=sr(F,"discountName",{separateItemsDisc:!0});const Ce=ar(Le);let{obj:Ye,sum:Qe}=en(F);pt.VAT={itemList:ir(F,{itemInstructionOnBill:y.itemInstructionOnBill,printZeroPriceAddons:y.printZeroPriceAddons}),discounts:Ce,charges:nr(F,"name"),taxation:Ye,subTotal:ve(Y),afterDisc:ve(j),afterCharges:ve(C),total:ve(w+Qe)}}}})(),ee.distributedData=pt;let Et={obj:ee,companyLogo:nt,companyQrCode:At,paperSize:t.printerSize,Name:o};r(Et)}}catch(y){console.log("err",y),l(y)}}),Od=(e,t,n={})=>new Promise(async(r,l)=>{var a,m,u,i,c;try{const{invoiceFormat:h,custName:f,custMobile:y,custAddress:p,orderData:v}=n;let _=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",E=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",S=t.footerAddress.city?t.footerAddress.city:"",T=t.footerAddress.zip?t.footerAddress.zip:"",D=(_!=""?_+",":"")+(E!=""?E+",":"")+(S!=""?S+",":"")+(T!=""?T+",":""),$=t.gstNo,k={companyName:t.companyName,companyAddress:D,companyContact:t.contactNumber,companyEmail:t.contactEmail},re={orderStatus:"COMPLETED",orderDate:v&&v.timestamp?R.unix(v.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:v&&v.orderId?v.orderId:null,timestamp:v.timestamp},te={custName:h&&h.custName?f==t.companyName?null:f:null,custAddress:h&&h.custAddress&&p||null,custContact:h&&h.custMobile?y:null,custEmail:"ajaybaglane7@gmail.com"},de=Js(t.curr),be="",Z={...e,companyInfo:k,orderInfo:re,customerInfo:te,gst:$,curr:de};if(h){if(Z.domain=h.siteURL,Z.paymentMethods=h.paymentMode?Z.paymentMethods:null,Z.companyInfo.companyName=h.companyName,Z.companyInfo.companyEmail=h.email,Z.companyInfo.companyAddress=h.address,Z.companyInfo.companyContact=h.mobile,Z.customerInfo.custName=h.custName?f:null,Z.tokenId=h.token?Z.tokenId:null,h.isPayQR&&h.upiId&&h.upiId!==""&&(Z.upiId=h.upiId),Z.gstNo=h.gst?Z.gst:null,Z.footerMessage=h.footerMessage,Z.orderFrom=(a=v.subOrderFrom)==null?void 0:a.toUpperCase(),Z.fssai=t.fssai,Z.vatNo=t.vatNo,Z.taxLabel=_a(t),Z.printOperatorInfo=h.printOperatorInfo===null||h.printOperatorInfo===!0,Z.disabledPoweredBy=t.disabledPoweredBy===!0,Z.printTime=R().format("DD-MM-YYYY hh:mm A"),v.deliveryTimestamp&&(Z.deliveryTimestamp=R.unix(v.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),Z.itemInstructionOnBill=h.itemInstructionOnBill,Z.printHSNCodeOnBill=h.printHSNCodeOnBill,Z.noOfInvoice=h.noOfInvoice,Z.area=v.area,Z.captainName=v.captainName,!(h.itemInstructionOnBill||h.printHSNCodeOnBill)&&((m=Z.itemList)!=null&&m.length)){let q;for(let ue=0;ue<Z.itemList.length;ue++)q=Z.itemList[ue],q.instruction&&delete q.instruction,q.hsnCode&&delete q.hsnCode}t.enabledOutstandingOnPay&&((u=e.custoutStandingData)!=null&&u.balanceAmt)&&(Z.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let X=[];if((i=v.customFeilds)!=null&&i.length){let q;for(let ue=0;ue<v.customFeilds.length;ue++)q=v.customFeilds[ue],q!=null&&q.customValue&&((c=q.availability)!=null&&c.includes("BILL"))&&X.push({customName:q.customName,customValue:q.customValue});Z.customFields=X}if(t&&t.isOld&&t.isOld==!0){let q=null,ue=null;h.companyLogo&&(q=await zt(`https://${h.companyLogo.bucket}.s3.amazonaws.com/${h.companyLogo.key}`)),h.qrcode&&(ue=await zt(`https://${h.qrcode.bucket}.s3.amazonaws.com/${h.qrcode.key}`));var o="Unknown OS";navigator.userAgent.indexOf("Win")!=-1&&(o="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(o="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(o="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(o="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(o="iOS");let z={obj:Z,companyLogo:q,companyQrCode:ue,paperSize:t.printerSize,Name:o};r(z)}}}catch(h){console.log("err",h)}}),Md=(e,t)=>new Promise(async(n,r)=>{var T;let l;(T=t.siteLogo)!=null&&T.key;let o=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",a=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",m=t.footerAddress.city?t.footerAddress.city:"",u=t.footerAddress.zip?t.footerAddress.zip:"",i=(o!=""?o+",":"")+(a!=""?a+",":"")+(m!=""?m+",":"")+(u!=""?u+",":""),c=[],h,f=0,y=0,p=0,v=[],_,E;const S=ms(t.paymentModes??defaultPaymentModes,"internalName");for(let D=0;D<e.length;D++)for(h=e[D],c.push({date:h.date,orderId:h.orderId,finalAmount:h.finalAmount}),f+=h.finalAmount,y+=h.paidAmt,p+=h.balanceAmt,_=0;_<h.orderTransactions.length;_++)E=h.orderTransactions[_],E.paidAmt&&v.push({date:R.unix(E.createdAt).format("DD-MM-YYYY"),paymentMode:S[E.paymentMode].displayName,amount:ve(E.paidAmt)});n({logo:l,companyAddress:i,companyName:t.companyName,companyContact:t.contactNumber,gst:t.gstNo,vatNo:t.vatNo,fssai:t.fssai,orders:c,totalAmount:f,totalPaid:y,totalPayable:p,paperSize:t.printerSize,curr:Js(t.curr),transactions:v})}),Ad=e=>new Promise(async(t,n)=>{let r={...e};r.orderObj=JSON.parse(e.orderObj),r.settingData=JSON.parse(e.settingData),r.invoiceFormat=JSON.parse(e.invoiceFormat),r.orderData=JSON.parse(e.orderObj);let l;r.newFormat?l=await ba({...r.orderObj,itemList:r.orderObj.orderList},r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress}):l=await Od(r.orderObj,r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress,orderData:r.orderData}),t(l)}),Sa=e=>{let t=new Array;for(const n in e)if(Object.hasOwnProperty.call(e,n)){const r=`${n}::${e[n].orderId}::${Math.random()}`,l=e[n];l.newId=r,t.push(l)}return t},or=(e,t)=>{var r,l;if(!(t!=null&&t.length))return!0;let n=t.findIndex(o=>o.typeValue=="station::"+e);return((r=t[n])==null?void 0:r.printKot)==null?!0:(l=t[n])==null?void 0:l.printKot};function Ed(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),l=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(l),t&&(r.href=t),l.href=e,l.href}const Rd=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function _t(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}let Vt=null;function Ta(e={}){return Vt||(e.includeStyleProperties?(Vt=e.includeStyleProperties,Vt):(Vt=_t(window.getComputedStyle(document.documentElement)),Vt))}function tn(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Ld(e){const t=tn(e,"border-left-width"),n=tn(e,"border-right-width");return e.clientWidth+t+n}function kd(e){const t=tn(e,"border-top-width"),n=tn(e,"border-bottom-width");return e.clientHeight+t+n}function wa(e,t={}){const n=t.width||Ld(e),r=t.height||kd(e);return{width:n,height:r}}function Pd(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const Fe=16384;function Fd(e){(e.width>Fe||e.height>Fe)&&(e.width>Fe&&e.height>Fe?e.width>e.height?(e.height*=Fe/e.width,e.width=Fe):(e.width*=Fe/e.height,e.height=Fe):e.width>Fe?(e.height*=Fe/e.width,e.width=Fe):(e.width*=Fe/e.height,e.height=Fe))}function sn(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function Dd(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Yd(e,t,n){const r="http://www.w3.org/2000/svg",l=document.createElementNS(r,"svg"),o=document.createElementNS(r,"foreignObject");return l.setAttribute("width",`${t}`),l.setAttribute("height",`${n}`),l.setAttribute("viewBox",`0 0 ${t} ${n}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),l.appendChild(o),o.appendChild(e),Dd(l)}const Re=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||Re(n,t)};function Ud(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function $d(e,t){return Ta(t).map(n=>{const r=e.getPropertyValue(n),l=e.getPropertyPriority(n);return`${n}: ${r}${l?" !important":""};`}).join(" ")}function Hd(e,t,n,r){const l=`.${e}:${t}`,o=n.cssText?Ud(n):$d(n,r);return document.createTextNode(`${l}{${o}}`)}function Ia(e,t,n,r){const l=window.getComputedStyle(e,n),o=l.getPropertyValue("content");if(o===""||o==="none")return;const a=Rd();try{t.className=`${t.className} ${a}`}catch{return}const m=document.createElement("style");m.appendChild(Hd(a,n,l,r)),t.appendChild(m)}function Bd(e,t,n){Ia(e,t,":before",n),Ia(e,t,":after",n)}const Ca="application/font-woff",Oa="image/jpeg",Gd={woff:Ca,woff2:Ca,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Oa,jpeg:Oa,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Wd(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function cr(e){const t=Wd(e).toLowerCase();return Gd[t]||""}function zd(e){return e.split(/,/)[1]}function dr(e){return e.search(/^(data:)/)!==-1}function Vd(e,t){return`data:${t};base64,${e}`}async function Ma(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const l=await r.blob();return new Promise((o,a)=>{const m=new FileReader;m.onerror=a,m.onloadend=()=>{try{o(n({res:r,result:m.result}))}catch(u){a(u)}},m.readAsDataURL(l)})}const hr={};function qd(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function ur(e,t,n){const r=qd(e,t,n.includeQueryParams);if(hr[r]!=null)return hr[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let l;try{const o=await Ma(e,n.fetchRequestInit,({res:a,result:m})=>(t||(t=a.headers.get("Content-Type")||""),zd(m)));l=Vd(o,t)}catch(o){l=n.imagePlaceholder||"";let a=`Failed to fetch resource: ${e}`;o&&(a=typeof o=="string"?o:o.message),a&&console.warn(a)}return hr[r]=l,l}async function Kd(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):sn(t)}async function Qd(e,t){if(e.currentSrc){const o=document.createElement("canvas"),a=o.getContext("2d");o.width=e.clientWidth,o.height=e.clientHeight,a==null||a.drawImage(e,0,0,o.width,o.height);const m=o.toDataURL();return sn(m)}const n=e.poster,r=cr(n),l=await ur(n,r,t);return sn(l)}async function Zd(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await nn(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Jd(e,t){return Re(e,HTMLCanvasElement)?Kd(e):Re(e,HTMLVideoElement)?Qd(e,t):Re(e,HTMLIFrameElement)?Zd(e,t):e.cloneNode(Aa(e))}const Xd=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Aa=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function eh(e,t,n){var r,l;if(Aa(t))return t;let o=[];return Xd(e)&&e.assignedNodes?o=_t(e.assignedNodes()):Re(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?o=_t(e.contentDocument.body.childNodes):o=_t(((l=e.shadowRoot)!==null&&l!==void 0?l:e).childNodes),o.length===0||Re(e,HTMLVideoElement)||await o.reduce((a,m)=>a.then(()=>nn(m,n)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function th(e,t,n){const r=t.style;if(!r)return;const l=window.getComputedStyle(e);l.cssText?(r.cssText=l.cssText,r.transformOrigin=l.transformOrigin):Ta(n).forEach(o=>{let a=l.getPropertyValue(o);o==="font-size"&&a.endsWith("px")&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),Re(e,HTMLIFrameElement)&&o==="display"&&a==="inline"&&(a="block"),o==="d"&&t.getAttribute("d")&&(a=`path(${t.getAttribute("d")})`),r.setProperty(o,a,l.getPropertyPriority(o))})}function sh(e,t){Re(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),Re(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function nh(e,t){if(Re(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(l=>e.value===l.getAttribute("value"));r&&r.setAttribute("selected","")}}function rh(e,t,n){return Re(t,Element)&&(th(e,t,n),Bd(e,t,n),sh(e,t),nh(e,t)),t}async function ah(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let o=0;o<n.length;o++){const m=n[o].getAttribute("xlink:href");if(m){const u=e.querySelector(m),i=document.querySelector(m);!u&&i&&!r[m]&&(r[m]=await nn(i,t,!0))}}const l=Object.values(r);if(l.length){const o="http://www.w3.org/1999/xhtml",a=document.createElementNS(o,"svg");a.setAttribute("xmlns",o),a.style.position="absolute",a.style.width="0",a.style.height="0",a.style.overflow="hidden",a.style.display="none";const m=document.createElementNS(o,"defs");a.appendChild(m);for(let u=0;u<l.length;u++)m.appendChild(l[u]);e.appendChild(a)}return e}async function nn(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>Jd(r,t)).then(r=>eh(e,r,t)).then(r=>rh(e,r,t)).then(r=>ah(r,t))}const Ea=/url\((['"]?)([^'"]+?)\1\)/g,ih=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,lh=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function oh(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function ch(e){const t=[];return e.replace(Ea,(n,r,l)=>(t.push(l),n)),t.filter(n=>!dr(n))}async function dh(e,t,n,r,l){try{const o=n?Ed(t,n):t,a=cr(t);let m;return l||(m=await ur(o,a,r)),e.replace(oh(t),`$1${m}$3`)}catch{}return e}function hh(e,{preferredFontFormat:t}){return t?e.replace(lh,n=>{for(;;){const[r,,l]=ih.exec(n)||[];if(!l)return"";if(l===t)return`src: ${r};`}}):e}function Ra(e){return e.search(Ea)!==-1}async function La(e,t,n){if(!Ra(e))return e;const r=hh(e,n);return ch(r).reduce((o,a)=>o.then(m=>dh(m,a,t,n)),Promise.resolve(r))}async function qt(e,t,n){var r;const l=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(l){const o=await La(l,null,n);return t.style.setProperty(e,o,t.style.getPropertyPriority(e)),!0}return!1}async function uh(e,t){await qt("background",e,t)||await qt("background-image",e,t),await qt("mask",e,t)||await qt("-webkit-mask",e,t)||await qt("mask-image",e,t)||await qt("-webkit-mask-image",e,t)}async function mh(e,t){const n=Re(e,HTMLImageElement);if(!(n&&!dr(e.src))&&!(Re(e,SVGImageElement)&&!dr(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,l=await ur(r,cr(r),t);await new Promise((o,a)=>{e.onload=o,e.onerror=t.onImageErrorHandler?(...u)=>{try{o(t.onImageErrorHandler(...u))}catch(i){a(i)}}:a;const m=e;m.decode&&(m.decode=o),m.loading==="lazy"&&(m.loading="eager"),n?(e.srcset="",e.src=l):e.href.baseVal=l})}async function fh(e,t){const r=_t(e.childNodes).map(l=>ka(l,t));await Promise.all(r).then(()=>e)}async function ka(e,t){Re(e,Element)&&(await uh(e,t),await mh(e,t),await fh(e,t))}function ph(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(l=>{n[l]=r[l]}),e}const Pa={};async function Fa(e){let t=Pa[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},Pa[e]=t,t}async function Da(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,o=(n.match(/url\([^)]+\)/g)||[]).map(async a=>{let m=a.replace(r,"$1");return m.startsWith("https://")||(m=new URL(m,e.url).href),Ma(m,t.fetchRequestInit,({result:u})=>(n=n.replace(a,`url(${u})`),[a,u]))});return Promise.all(o).then(()=>n)}function Ya(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const l=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=l.exec(r);if(u===null)break;t.push(u[0])}r=r.replace(l,"");const o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",m=new RegExp(a,"gi");for(;;){let u=o.exec(r);if(u===null){if(u=m.exec(r),u===null)break;o.lastIndex=m.lastIndex}else m.lastIndex=o.lastIndex;t.push(u[0])}return t}async function yh(e,t){const n=[],r=[];return e.forEach(l=>{if("cssRules"in l)try{_t(l.cssRules||[]).forEach((o,a)=>{if(o.type===CSSRule.IMPORT_RULE){let m=a+1;const u=o.href,i=Fa(u).then(c=>Da(c,t)).then(c=>Ya(c).forEach(h=>{try{l.insertRule(h,h.startsWith("@import")?m+=1:l.cssRules.length)}catch(f){console.error("Error inserting rule from remote css",{rule:h,error:f})}})).catch(c=>{console.error("Error loading remote css",c.toString())});r.push(i)}})}catch(o){const a=e.find(m=>m.href==null)||document.styleSheets[0];l.href!=null&&r.push(Fa(l.href).then(m=>Da(m,t)).then(m=>Ya(m).forEach(u=>{a.insertRule(u,a.cssRules.length)})).catch(m=>{console.error("Error loading remote stylesheet",m)})),console.error("Error inlining remote css file",o)}}),Promise.all(r).then(()=>(e.forEach(l=>{if("cssRules"in l)try{_t(l.cssRules||[]).forEach(o=>{n.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${l.href}`,o)}}),n))}function gh(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Ra(t.style.getPropertyValue("src")))}async function xh(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=_t(e.ownerDocument.styleSheets),r=await yh(n,t);return gh(r)}function Ua(e){return e.trim().replace(/["']/g,"")}function Nh(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(o=>{t.add(Ua(o))}),Array.from(r.children).forEach(o=>{o instanceof HTMLElement&&n(o)})}return n(e),t}async function jh(e,t){const n=await xh(e,t),r=Nh(e);return(await Promise.all(n.filter(o=>r.has(Ua(o.style.fontFamily))).map(o=>{const a=o.parentStyleSheet?o.parentStyleSheet.href:null;return La(o.cssText,a,t)}))).join(`
46
+ `)}async function vh(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await jh(e,t);if(n){const r=document.createElement("style"),l=document.createTextNode(n);r.appendChild(l),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function $a(e,t={}){const{width:n,height:r}=wa(e,t),l=await nn(e,t,!0);return await vh(l,t),await ka(l,t),ph(l,t),await Yd(l,n,r)}async function _h(e,t={}){const{width:n,height:r}=wa(e,t),l=await $a(e,t),o=await sn(l),a=document.createElement("canvas"),m=a.getContext("2d"),u=t.pixelRatio||Pd(),i=t.canvasWidth||n,c=t.canvasHeight||r;return a.width=i*u,a.height=c*u,t.skipAutoScale||Fd(a),a.style.width=`${i}`,a.style.height=`${c}`,t.backgroundColor&&(m.fillStyle=t.backgroundColor,m.fillRect(0,0,a.width,a.height)),m.drawImage(o,0,0,a.width,a.height),a}async function bh(e,t={}){return(await _h(e,t)).toDataURL("image/jpeg",t.quality||1)}var Sh=Object.defineProperty,rn=Object.getOwnPropertySymbols,Ha=Object.prototype.hasOwnProperty,Ba=Object.prototype.propertyIsEnumerable,Ga=(e,t,n)=>t in e?Sh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ys=(e,t)=>{for(var n in t||(t={}))Ha.call(t,n)&&Ga(e,n,t[n]);if(rn)for(var n of rn(t))Ba.call(t,n)&&Ga(e,n,t[n]);return e},mr=(e,t)=>{var n={};for(var r in e)Ha.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&rn)for(var r of rn(e))t.indexOf(r)<0&&Ba.call(e,r)&&(n[r]=e[r]);return n};/**
47
47
  * @license QR Code generator library (TypeScript)
48
48
  * Copyright (c) Project Nayuki.
49
49
  * SPDX-License-Identifier: MIT
50
- */var It;(e=>{const t=class{constructor(o,l,c,h){if(this.version=o,this.errorCorrectionLevel=l,this.modules=[],this.isFunction=[],o<t.MIN_VERSION||o>t.MAX_VERSION)throw new RangeError("Version value out of range");if(h<-1||h>7)throw new RangeError("Mask value out of range");this.size=o*4+17;let p=[];for(let g=0;g<this.size;g++)p.push(!1);for(let g=0;g<this.size;g++)this.modules.push(p.slice()),this.isFunction.push(p.slice());this.drawFunctionPatterns();const m=this.addEccAndInterleave(c);if(this.drawCodewords(m),h==-1){let g=1e9;for(let v=0;v<8;v++){this.applyMask(v),this.drawFormatBits(v);const _=this.getPenaltyScore();_<g&&(h=v,g=_),this.applyMask(v)}}a(0<=h&&h<=7),this.mask=h,this.applyMask(h),this.drawFormatBits(h),this.isFunction=[]}static encodeText(o,l){const c=e.QrSegment.makeSegments(o);return t.encodeSegments(c,l)}static encodeBinary(o,l){const c=e.QrSegment.makeBytes(o);return t.encodeSegments([c],l)}static encodeSegments(o,l,c=1,h=40,p=-1,m=!0){if(!(t.MIN_VERSION<=c&&c<=h&&h<=t.MAX_VERSION)||p<-1||p>7)throw new RangeError("Invalid value");let g,v;for(g=c;;g++){const w=t.getNumDataCodewords(g,l)*8,D=f.getTotalBits(o,g);if(D<=w){v=D;break}if(g>=h)throw new RangeError("Data too long")}for(const w of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])m&&v<=t.getNumDataCodewords(g,w)*8&&(l=w);let _=[];for(const w of o){r(w.mode.modeBits,4,_),r(w.numChars,w.mode.numCharCountBits(g),_);for(const D of w.getData())_.push(D)}a(_.length==v);const E=t.getNumDataCodewords(g,l)*8;a(_.length<=E),r(0,Math.min(4,E-_.length),_),r(0,(8-_.length%8)%8,_),a(_.length%8==0);for(let w=236;_.length<E;w^=253)r(w,8,_);let S=[];for(;S.length*8<_.length;)S.push(0);return _.forEach((w,D)=>S[D>>>3]|=w<<7-(D&7)),new t(g,l,S,p)}getModule(o,l){return 0<=o&&o<this.size&&0<=l&&l<this.size&&this.modules[l][o]}getModules(){return this.modules}drawFunctionPatterns(){for(let c=0;c<this.size;c++)this.setFunctionModule(6,c,c%2==0),this.setFunctionModule(c,6,c%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const o=this.getAlignmentPatternPositions(),l=o.length;for(let c=0;c<l;c++)for(let h=0;h<l;h++)c==0&&h==0||c==0&&h==l-1||c==l-1&&h==0||this.drawAlignmentPattern(o[c],o[h]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(o){const l=this.errorCorrectionLevel.formatBits<<3|o;let c=l;for(let p=0;p<10;p++)c=c<<1^(c>>>9)*1335;const h=(l<<10|c)^21522;a(h>>>15==0);for(let p=0;p<=5;p++)this.setFunctionModule(8,p,i(h,p));this.setFunctionModule(8,7,i(h,6)),this.setFunctionModule(8,8,i(h,7)),this.setFunctionModule(7,8,i(h,8));for(let p=9;p<15;p++)this.setFunctionModule(14-p,8,i(h,p));for(let p=0;p<8;p++)this.setFunctionModule(this.size-1-p,8,i(h,p));for(let p=8;p<15;p++)this.setFunctionModule(8,this.size-15+p,i(h,p));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let o=this.version;for(let c=0;c<12;c++)o=o<<1^(o>>>11)*7973;const l=this.version<<12|o;a(l>>>18==0);for(let c=0;c<18;c++){const h=i(l,c),p=this.size-11+c%3,m=Math.floor(c/3);this.setFunctionModule(p,m,h),this.setFunctionModule(m,p,h)}}drawFinderPattern(o,l){for(let c=-4;c<=4;c++)for(let h=-4;h<=4;h++){const p=Math.max(Math.abs(h),Math.abs(c)),m=o+h,g=l+c;0<=m&&m<this.size&&0<=g&&g<this.size&&this.setFunctionModule(m,g,p!=2&&p!=4)}}drawAlignmentPattern(o,l){for(let c=-2;c<=2;c++)for(let h=-2;h<=2;h++)this.setFunctionModule(o+h,l+c,Math.max(Math.abs(h),Math.abs(c))!=1)}setFunctionModule(o,l,c){this.modules[l][o]=c,this.isFunction[l][o]=!0}addEccAndInterleave(o){const l=this.version,c=this.errorCorrectionLevel;if(o.length!=t.getNumDataCodewords(l,c))throw new RangeError("Invalid argument");const h=t.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][l],p=t.ECC_CODEWORDS_PER_BLOCK[c.ordinal][l],m=Math.floor(t.getNumRawDataModules(l)/8),g=h-m%h,v=Math.floor(m/h);let _=[];const E=t.reedSolomonComputeDivisor(p);for(let w=0,D=0;w<h;w++){let $=o.slice(D,D+v-p+(w<g?0:1));D+=$.length;const P=t.reedSolomonComputeRemainder($,E);w<g&&$.push(0),_.push($.concat(P))}let S=[];for(let w=0;w<_[0].length;w++)_.forEach((D,$)=>{(w!=v-p||$>=g)&&S.push(D[w])});return a(S.length==m),S}drawCodewords(o){if(o.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let h=0;h<this.size;h++)for(let p=0;p<2;p++){const m=c-p,v=(c+1&2)==0?this.size-1-h:h;!this.isFunction[v][m]&&l<o.length*8&&(this.modules[v][m]=i(o[l>>>3],7-(l&7)),l++)}}a(l==o.length*8)}applyMask(o){if(o<0||o>7)throw new RangeError("Mask value out of range");for(let l=0;l<this.size;l++)for(let c=0;c<this.size;c++){let h;switch(o){case 0:h=(c+l)%2==0;break;case 1:h=l%2==0;break;case 2:h=c%3==0;break;case 3:h=(c+l)%3==0;break;case 4:h=(Math.floor(c/3)+Math.floor(l/2))%2==0;break;case 5:h=c*l%2+c*l%3==0;break;case 6:h=(c*l%2+c*l%3)%2==0;break;case 7:h=((c+l)%2+c*l%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[l][c]&&h&&(this.modules[l][c]=!this.modules[l][c])}}getPenaltyScore(){let o=0;for(let p=0;p<this.size;p++){let m=!1,g=0,v=[0,0,0,0,0,0,0];for(let _=0;_<this.size;_++)this.modules[p][_]==m?(g++,g==5?o+=t.PENALTY_N1:g>5&&o++):(this.finderPenaltyAddHistory(g,v),m||(o+=this.finderPenaltyCountPatterns(v)*t.PENALTY_N3),m=this.modules[p][_],g=1);o+=this.finderPenaltyTerminateAndCount(m,g,v)*t.PENALTY_N3}for(let p=0;p<this.size;p++){let m=!1,g=0,v=[0,0,0,0,0,0,0];for(let _=0;_<this.size;_++)this.modules[_][p]==m?(g++,g==5?o+=t.PENALTY_N1:g>5&&o++):(this.finderPenaltyAddHistory(g,v),m||(o+=this.finderPenaltyCountPatterns(v)*t.PENALTY_N3),m=this.modules[_][p],g=1);o+=this.finderPenaltyTerminateAndCount(m,g,v)*t.PENALTY_N3}for(let p=0;p<this.size-1;p++)for(let m=0;m<this.size-1;m++){const g=this.modules[p][m];g==this.modules[p][m+1]&&g==this.modules[p+1][m]&&g==this.modules[p+1][m+1]&&(o+=t.PENALTY_N2)}let l=0;for(const p of this.modules)l=p.reduce((m,g)=>m+(g?1:0),l);const c=this.size*this.size,h=Math.ceil(Math.abs(l*20-c*10)/c)-1;return a(0<=h&&h<=9),o+=h*t.PENALTY_N4,a(0<=o&&o<=2568888),o}getAlignmentPatternPositions(){if(this.version==1)return[];{const o=Math.floor(this.version/7)+2,l=this.version==32?26:Math.ceil((this.version*4+4)/(o*2-2))*2;let c=[6];for(let h=this.size-7;c.length<o;h-=l)c.splice(1,0,h);return c}}static getNumRawDataModules(o){if(o<t.MIN_VERSION||o>t.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*o+128)*o+64;if(o>=2){const c=Math.floor(o/7)+2;l-=(25*c-10)*c-55,o>=7&&(l-=36)}return a(208<=l&&l<=29648),l}static getNumDataCodewords(o,l){return Math.floor(t.getNumRawDataModules(o)/8)-t.ECC_CODEWORDS_PER_BLOCK[l.ordinal][o]*t.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][o]}static reedSolomonComputeDivisor(o){if(o<1||o>255)throw new RangeError("Degree out of range");let l=[];for(let h=0;h<o-1;h++)l.push(0);l.push(1);let c=1;for(let h=0;h<o;h++){for(let p=0;p<l.length;p++)l[p]=t.reedSolomonMultiply(l[p],c),p+1<l.length&&(l[p]^=l[p+1]);c=t.reedSolomonMultiply(c,2)}return l}static reedSolomonComputeRemainder(o,l){let c=l.map(h=>0);for(const h of o){const p=h^c.shift();c.push(0),l.forEach((m,g)=>c[g]^=t.reedSolomonMultiply(m,p))}return c}static reedSolomonMultiply(o,l){if(o>>>8||l>>>8)throw new RangeError("Byte out of range");let c=0;for(let h=7;h>=0;h--)c=c<<1^(c>>>7)*285,c^=(l>>>h&1)*o;return a(c>>>8==0),c}finderPenaltyCountPatterns(o){const l=o[1];a(l<=this.size*3);const c=l>0&&o[2]==l&&o[3]==l*3&&o[4]==l&&o[5]==l;return(c&&o[0]>=l*4&&o[6]>=l?1:0)+(c&&o[6]>=l*4&&o[0]>=l?1:0)}finderPenaltyTerminateAndCount(o,l,c){return o&&(this.finderPenaltyAddHistory(l,c),l=0),l+=this.size,this.finderPenaltyAddHistory(l,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(o,l){l[0]==0&&(o+=this.size),l.pop(),l.unshift(o)}};let n=t;n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=n;function r(o,l,c){if(l<0||l>31||o>>>l)throw new RangeError("Value out of range");for(let h=l-1;h>=0;h--)c.push(o>>>h&1)}function i(o,l){return(o>>>l&1)!=0}function a(o){if(!o)throw new Error("Assertion error")}const u=class{constructor(o,l,c){if(this.mode=o,this.numChars=l,this.bitData=c,l<0)throw new RangeError("Invalid argument");this.bitData=c.slice()}static makeBytes(o){let l=[];for(const c of o)r(c,8,l);return new u(u.Mode.BYTE,o.length,l)}static makeNumeric(o){if(!u.isNumeric(o))throw new RangeError("String contains non-numeric characters");let l=[];for(let c=0;c<o.length;){const h=Math.min(o.length-c,3);r(parseInt(o.substr(c,h),10),h*3+1,l),c+=h}return new u(u.Mode.NUMERIC,o.length,l)}static makeAlphanumeric(o){if(!u.isAlphanumeric(o))throw new RangeError("String contains unencodable characters in alphanumeric mode");let l=[],c;for(c=0;c+2<=o.length;c+=2){let h=u.ALPHANUMERIC_CHARSET.indexOf(o.charAt(c))*45;h+=u.ALPHANUMERIC_CHARSET.indexOf(o.charAt(c+1)),r(h,11,l)}return c<o.length&&r(u.ALPHANUMERIC_CHARSET.indexOf(o.charAt(c)),6,l),new u(u.Mode.ALPHANUMERIC,o.length,l)}static makeSegments(o){return o==""?[]:u.isNumeric(o)?[u.makeNumeric(o)]:u.isAlphanumeric(o)?[u.makeAlphanumeric(o)]:[u.makeBytes(u.toUtf8ByteArray(o))]}static makeEci(o){let l=[];if(o<0)throw new RangeError("ECI assignment value out of range");if(o<128)r(o,8,l);else if(o<16384)r(2,2,l),r(o,14,l);else if(o<1e6)r(6,3,l),r(o,21,l);else throw new RangeError("ECI assignment value out of range");return new u(u.Mode.ECI,0,l)}static isNumeric(o){return u.NUMERIC_REGEX.test(o)}static isAlphanumeric(o){return u.ALPHANUMERIC_REGEX.test(o)}getData(){return this.bitData.slice()}static getTotalBits(o,l){let c=0;for(const h of o){const p=h.mode.numCharCountBits(l);if(h.numChars>=1<<p)return 1/0;c+=4+p+h.bitData.length}return c}static toUtf8ByteArray(o){o=encodeURI(o);let l=[];for(let c=0;c<o.length;c++)o.charAt(c)!="%"?l.push(o.charCodeAt(c)):(l.push(parseInt(o.substr(c+1,2),16)),c+=2);return l}};let f=u;f.NUMERIC_REGEX=/^[0-9]*$/,f.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,f.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=f})(It||(It={})),(e=>{(t=>{const n=class{constructor(i,a){this.ordinal=i,this.formatBits=a}};let r=n;r.LOW=new n(0,1),r.MEDIUM=new n(1,0),r.QUARTILE=new n(2,3),r.HIGH=new n(3,2),t.Ecc=r})(e.QrCode||(e.QrCode={}))})(It||(It={})),(e=>{(t=>{const n=class{constructor(i,a){this.modeBits=i,this.numBitsCharCount=a}numCharCountBits(i){return this.numBitsCharCount[Math.floor((i+7)/17)]}};let r=n;r.NUMERIC=new n(1,[10,12,14]),r.ALPHANUMERIC=new n(2,[9,11,13]),r.BYTE=new n(4,[8,16,16]),r.KANJI=new n(8,[8,10,12]),r.ECI=new n(7,[0,0,0]),t.Mode=r})(e.QrSegment||(e.QrSegment={}))})(It||(It={}));var Vt=It;/**
50
+ */var Ot;(e=>{const t=class{constructor(u,i,c,h){if(this.version=u,this.errorCorrectionLevel=i,this.modules=[],this.isFunction=[],u<t.MIN_VERSION||u>t.MAX_VERSION)throw new RangeError("Version value out of range");if(h<-1||h>7)throw new RangeError("Mask value out of range");this.size=u*4+17;let f=[];for(let p=0;p<this.size;p++)f.push(!1);for(let p=0;p<this.size;p++)this.modules.push(f.slice()),this.isFunction.push(f.slice());this.drawFunctionPatterns();const y=this.addEccAndInterleave(c);if(this.drawCodewords(y),h==-1){let p=1e9;for(let v=0;v<8;v++){this.applyMask(v),this.drawFormatBits(v);const _=this.getPenaltyScore();_<p&&(h=v,p=_),this.applyMask(v)}}o(0<=h&&h<=7),this.mask=h,this.applyMask(h),this.drawFormatBits(h),this.isFunction=[]}static encodeText(u,i){const c=e.QrSegment.makeSegments(u);return t.encodeSegments(c,i)}static encodeBinary(u,i){const c=e.QrSegment.makeBytes(u);return t.encodeSegments([c],i)}static encodeSegments(u,i,c=1,h=40,f=-1,y=!0){if(!(t.MIN_VERSION<=c&&c<=h&&h<=t.MAX_VERSION)||f<-1||f>7)throw new RangeError("Invalid value");let p,v;for(p=c;;p++){const T=t.getNumDataCodewords(p,i)*8,D=m.getTotalBits(u,p);if(D<=T){v=D;break}if(p>=h)throw new RangeError("Data too long")}for(const T of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])y&&v<=t.getNumDataCodewords(p,T)*8&&(i=T);let _=[];for(const T of u){r(T.mode.modeBits,4,_),r(T.numChars,T.mode.numCharCountBits(p),_);for(const D of T.getData())_.push(D)}o(_.length==v);const E=t.getNumDataCodewords(p,i)*8;o(_.length<=E),r(0,Math.min(4,E-_.length),_),r(0,(8-_.length%8)%8,_),o(_.length%8==0);for(let T=236;_.length<E;T^=253)r(T,8,_);let S=[];for(;S.length*8<_.length;)S.push(0);return _.forEach((T,D)=>S[D>>>3]|=T<<7-(D&7)),new t(p,i,S,f)}getModule(u,i){return 0<=u&&u<this.size&&0<=i&&i<this.size&&this.modules[i][u]}getModules(){return this.modules}drawFunctionPatterns(){for(let c=0;c<this.size;c++)this.setFunctionModule(6,c,c%2==0),this.setFunctionModule(c,6,c%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const u=this.getAlignmentPatternPositions(),i=u.length;for(let c=0;c<i;c++)for(let h=0;h<i;h++)c==0&&h==0||c==0&&h==i-1||c==i-1&&h==0||this.drawAlignmentPattern(u[c],u[h]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(u){const i=this.errorCorrectionLevel.formatBits<<3|u;let c=i;for(let f=0;f<10;f++)c=c<<1^(c>>>9)*1335;const h=(i<<10|c)^21522;o(h>>>15==0);for(let f=0;f<=5;f++)this.setFunctionModule(8,f,l(h,f));this.setFunctionModule(8,7,l(h,6)),this.setFunctionModule(8,8,l(h,7)),this.setFunctionModule(7,8,l(h,8));for(let f=9;f<15;f++)this.setFunctionModule(14-f,8,l(h,f));for(let f=0;f<8;f++)this.setFunctionModule(this.size-1-f,8,l(h,f));for(let f=8;f<15;f++)this.setFunctionModule(8,this.size-15+f,l(h,f));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let u=this.version;for(let c=0;c<12;c++)u=u<<1^(u>>>11)*7973;const i=this.version<<12|u;o(i>>>18==0);for(let c=0;c<18;c++){const h=l(i,c),f=this.size-11+c%3,y=Math.floor(c/3);this.setFunctionModule(f,y,h),this.setFunctionModule(y,f,h)}}drawFinderPattern(u,i){for(let c=-4;c<=4;c++)for(let h=-4;h<=4;h++){const f=Math.max(Math.abs(h),Math.abs(c)),y=u+h,p=i+c;0<=y&&y<this.size&&0<=p&&p<this.size&&this.setFunctionModule(y,p,f!=2&&f!=4)}}drawAlignmentPattern(u,i){for(let c=-2;c<=2;c++)for(let h=-2;h<=2;h++)this.setFunctionModule(u+h,i+c,Math.max(Math.abs(h),Math.abs(c))!=1)}setFunctionModule(u,i,c){this.modules[i][u]=c,this.isFunction[i][u]=!0}addEccAndInterleave(u){const i=this.version,c=this.errorCorrectionLevel;if(u.length!=t.getNumDataCodewords(i,c))throw new RangeError("Invalid argument");const h=t.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][i],f=t.ECC_CODEWORDS_PER_BLOCK[c.ordinal][i],y=Math.floor(t.getNumRawDataModules(i)/8),p=h-y%h,v=Math.floor(y/h);let _=[];const E=t.reedSolomonComputeDivisor(f);for(let T=0,D=0;T<h;T++){let $=u.slice(D,D+v-f+(T<p?0:1));D+=$.length;const k=t.reedSolomonComputeRemainder($,E);T<p&&$.push(0),_.push($.concat(k))}let S=[];for(let T=0;T<_[0].length;T++)_.forEach((D,$)=>{(T!=v-f||$>=p)&&S.push(D[T])});return o(S.length==y),S}drawCodewords(u){if(u.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let i=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let h=0;h<this.size;h++)for(let f=0;f<2;f++){const y=c-f,v=(c+1&2)==0?this.size-1-h:h;!this.isFunction[v][y]&&i<u.length*8&&(this.modules[v][y]=l(u[i>>>3],7-(i&7)),i++)}}o(i==u.length*8)}applyMask(u){if(u<0||u>7)throw new RangeError("Mask value out of range");for(let i=0;i<this.size;i++)for(let c=0;c<this.size;c++){let h;switch(u){case 0:h=(c+i)%2==0;break;case 1:h=i%2==0;break;case 2:h=c%3==0;break;case 3:h=(c+i)%3==0;break;case 4:h=(Math.floor(c/3)+Math.floor(i/2))%2==0;break;case 5:h=c*i%2+c*i%3==0;break;case 6:h=(c*i%2+c*i%3)%2==0;break;case 7:h=((c+i)%2+c*i%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[i][c]&&h&&(this.modules[i][c]=!this.modules[i][c])}}getPenaltyScore(){let u=0;for(let f=0;f<this.size;f++){let y=!1,p=0,v=[0,0,0,0,0,0,0];for(let _=0;_<this.size;_++)this.modules[f][_]==y?(p++,p==5?u+=t.PENALTY_N1:p>5&&u++):(this.finderPenaltyAddHistory(p,v),y||(u+=this.finderPenaltyCountPatterns(v)*t.PENALTY_N3),y=this.modules[f][_],p=1);u+=this.finderPenaltyTerminateAndCount(y,p,v)*t.PENALTY_N3}for(let f=0;f<this.size;f++){let y=!1,p=0,v=[0,0,0,0,0,0,0];for(let _=0;_<this.size;_++)this.modules[_][f]==y?(p++,p==5?u+=t.PENALTY_N1:p>5&&u++):(this.finderPenaltyAddHistory(p,v),y||(u+=this.finderPenaltyCountPatterns(v)*t.PENALTY_N3),y=this.modules[_][f],p=1);u+=this.finderPenaltyTerminateAndCount(y,p,v)*t.PENALTY_N3}for(let f=0;f<this.size-1;f++)for(let y=0;y<this.size-1;y++){const p=this.modules[f][y];p==this.modules[f][y+1]&&p==this.modules[f+1][y]&&p==this.modules[f+1][y+1]&&(u+=t.PENALTY_N2)}let i=0;for(const f of this.modules)i=f.reduce((y,p)=>y+(p?1:0),i);const c=this.size*this.size,h=Math.ceil(Math.abs(i*20-c*10)/c)-1;return o(0<=h&&h<=9),u+=h*t.PENALTY_N4,o(0<=u&&u<=2568888),u}getAlignmentPatternPositions(){if(this.version==1)return[];{const u=Math.floor(this.version/7)+2,i=this.version==32?26:Math.ceil((this.version*4+4)/(u*2-2))*2;let c=[6];for(let h=this.size-7;c.length<u;h-=i)c.splice(1,0,h);return c}}static getNumRawDataModules(u){if(u<t.MIN_VERSION||u>t.MAX_VERSION)throw new RangeError("Version number out of range");let i=(16*u+128)*u+64;if(u>=2){const c=Math.floor(u/7)+2;i-=(25*c-10)*c-55,u>=7&&(i-=36)}return o(208<=i&&i<=29648),i}static getNumDataCodewords(u,i){return Math.floor(t.getNumRawDataModules(u)/8)-t.ECC_CODEWORDS_PER_BLOCK[i.ordinal][u]*t.NUM_ERROR_CORRECTION_BLOCKS[i.ordinal][u]}static reedSolomonComputeDivisor(u){if(u<1||u>255)throw new RangeError("Degree out of range");let i=[];for(let h=0;h<u-1;h++)i.push(0);i.push(1);let c=1;for(let h=0;h<u;h++){for(let f=0;f<i.length;f++)i[f]=t.reedSolomonMultiply(i[f],c),f+1<i.length&&(i[f]^=i[f+1]);c=t.reedSolomonMultiply(c,2)}return i}static reedSolomonComputeRemainder(u,i){let c=i.map(h=>0);for(const h of u){const f=h^c.shift();c.push(0),i.forEach((y,p)=>c[p]^=t.reedSolomonMultiply(y,f))}return c}static reedSolomonMultiply(u,i){if(u>>>8||i>>>8)throw new RangeError("Byte out of range");let c=0;for(let h=7;h>=0;h--)c=c<<1^(c>>>7)*285,c^=(i>>>h&1)*u;return o(c>>>8==0),c}finderPenaltyCountPatterns(u){const i=u[1];o(i<=this.size*3);const c=i>0&&u[2]==i&&u[3]==i*3&&u[4]==i&&u[5]==i;return(c&&u[0]>=i*4&&u[6]>=i?1:0)+(c&&u[6]>=i*4&&u[0]>=i?1:0)}finderPenaltyTerminateAndCount(u,i,c){return u&&(this.finderPenaltyAddHistory(i,c),i=0),i+=this.size,this.finderPenaltyAddHistory(i,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(u,i){i[0]==0&&(u+=this.size),i.pop(),i.unshift(u)}};let n=t;n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=n;function r(u,i,c){if(i<0||i>31||u>>>i)throw new RangeError("Value out of range");for(let h=i-1;h>=0;h--)c.push(u>>>h&1)}function l(u,i){return(u>>>i&1)!=0}function o(u){if(!u)throw new Error("Assertion error")}const a=class{constructor(u,i,c){if(this.mode=u,this.numChars=i,this.bitData=c,i<0)throw new RangeError("Invalid argument");this.bitData=c.slice()}static makeBytes(u){let i=[];for(const c of u)r(c,8,i);return new a(a.Mode.BYTE,u.length,i)}static makeNumeric(u){if(!a.isNumeric(u))throw new RangeError("String contains non-numeric characters");let i=[];for(let c=0;c<u.length;){const h=Math.min(u.length-c,3);r(parseInt(u.substr(c,h),10),h*3+1,i),c+=h}return new a(a.Mode.NUMERIC,u.length,i)}static makeAlphanumeric(u){if(!a.isAlphanumeric(u))throw new RangeError("String contains unencodable characters in alphanumeric mode");let i=[],c;for(c=0;c+2<=u.length;c+=2){let h=a.ALPHANUMERIC_CHARSET.indexOf(u.charAt(c))*45;h+=a.ALPHANUMERIC_CHARSET.indexOf(u.charAt(c+1)),r(h,11,i)}return c<u.length&&r(a.ALPHANUMERIC_CHARSET.indexOf(u.charAt(c)),6,i),new a(a.Mode.ALPHANUMERIC,u.length,i)}static makeSegments(u){return u==""?[]:a.isNumeric(u)?[a.makeNumeric(u)]:a.isAlphanumeric(u)?[a.makeAlphanumeric(u)]:[a.makeBytes(a.toUtf8ByteArray(u))]}static makeEci(u){let i=[];if(u<0)throw new RangeError("ECI assignment value out of range");if(u<128)r(u,8,i);else if(u<16384)r(2,2,i),r(u,14,i);else if(u<1e6)r(6,3,i),r(u,21,i);else throw new RangeError("ECI assignment value out of range");return new a(a.Mode.ECI,0,i)}static isNumeric(u){return a.NUMERIC_REGEX.test(u)}static isAlphanumeric(u){return a.ALPHANUMERIC_REGEX.test(u)}getData(){return this.bitData.slice()}static getTotalBits(u,i){let c=0;for(const h of u){const f=h.mode.numCharCountBits(i);if(h.numChars>=1<<f)return 1/0;c+=4+f+h.bitData.length}return c}static toUtf8ByteArray(u){u=encodeURI(u);let i=[];for(let c=0;c<u.length;c++)u.charAt(c)!="%"?i.push(u.charCodeAt(c)):(i.push(parseInt(u.substr(c+1,2),16)),c+=2);return i}};let m=a;m.NUMERIC_REGEX=/^[0-9]*$/,m.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,m.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=m})(Ot||(Ot={})),(e=>{(t=>{const n=class{constructor(l,o){this.ordinal=l,this.formatBits=o}};let r=n;r.LOW=new n(0,1),r.MEDIUM=new n(1,0),r.QUARTILE=new n(2,3),r.HIGH=new n(3,2),t.Ecc=r})(e.QrCode||(e.QrCode={}))})(Ot||(Ot={})),(e=>{(t=>{const n=class{constructor(l,o){this.modeBits=l,this.numBitsCharCount=o}numCharCountBits(l){return this.numBitsCharCount[Math.floor((l+7)/17)]}};let r=n;r.NUMERIC=new n(1,[10,12,14]),r.ALPHANUMERIC=new n(2,[9,11,13]),r.BYTE=new n(4,[8,16,16]),r.KANJI=new n(8,[8,10,12]),r.ECI=new n(7,[0,0,0]),t.Mode=r})(e.QrSegment||(e.QrSegment={}))})(Ot||(Ot={}));var Kt=Ot;/**
51
51
  * @license qrcode.react
52
52
  * Copyright (c) Paul O'Shannessy
53
53
  * SPDX-License-Identifier: ISC
54
- */var Wa={L:Vt.QrCode.Ecc.LOW,M:Vt.QrCode.Ecc.MEDIUM,Q:Vt.QrCode.Ecc.QUARTILE,H:Vt.QrCode.Ecc.HIGH},za=128,Va="L",qa="#FFFFFF",Ka="#000000",Qa=!1,fr=4,Th=.1;function Za(e,t=0){const n=[];return e.forEach(function(r,i){let a=null;r.forEach(function(u,f){if(!u&&a!==null){n.push(`M${a+t} ${i+t}h${f-a}v1H${a+t}z`),a=null;return}if(f===r.length-1){if(!u)return;a===null?n.push(`M${f+t},${i+t} h1v1H${f+t}z`):n.push(`M${a+t},${i+t} h${f+1-a}v1H${a+t}z`);return}u&&a===null&&(a=f)})}),n.join("")}function Ja(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((i,a)=>a<t.x||a>=t.x+t.w?i:!1))}function Xa(e,t,n,r){if(r==null)return null;const i=n?fr:0,a=e.length+i*2,u=Math.floor(t*Th),f=a/t,o=(r.width||u)*f,l=(r.height||u)*f,c=r.x==null?e.length/2-o/2:r.x*f,h=r.y==null?e.length/2-l/2:r.y*f;let p=null;if(r.excavate){let m=Math.floor(c),g=Math.floor(h),v=Math.ceil(o+c-m),_=Math.ceil(l+h-g);p={x:m,y:g,w:v,h:_}}return{x:c,y:h,h:l,w:o,excavation:p}}var wh=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function Ih(e){const t=e,{value:n,size:r=za,level:i=Va,bgColor:a=qa,fgColor:u=Ka,includeMargin:f=Qa,style:o,imageSettings:l}=t,c=mr(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),h=l==null?void 0:l.src,p=ye.useRef(null),m=ye.useRef(null),[g,v]=ye.useState(!1);ye.useEffect(()=>{if(p.current!=null){const S=p.current,w=S.getContext("2d");if(!w)return;let D=Vt.QrCode.encodeText(n,Wa[i]).getModules();const $=f?fr:0,P=D.length+$*2,Z=Xa(D,r,f,l),ne=m.current,te=Z!=null&&ne!==null&&ne.complete&&ne.naturalHeight!==0&&ne.naturalWidth!==0;te&&Z.excavation!=null&&(D=Ja(D,Z.excavation));const le=window.devicePixelRatio||1;S.height=S.width=r*le;const Se=r/P*le;w.scale(Se,Se),w.fillStyle=a,w.fillRect(0,0,P,P),w.fillStyle=u,wh?w.fill(new Path2D(Za(D,$))):D.forEach(function(Q,J){Q.forEach(function(z,de){z&&w.fillRect(de+$,J+$,1,1)})}),te&&w.drawImage(ne,Z.x+$,Z.y+$,Z.w,Z.h)}}),ye.useEffect(()=>{v(!1)},[h]);const _=ps({height:r,width:r},o);let E=null;return h!=null&&(E=ye.createElement("img",{src:h,key:h,style:{display:"none"},onLoad:()=>{v(!0)},ref:m})),ye.createElement(ye.Fragment,null,ye.createElement("canvas",ps({style:_,height:r,width:r,ref:p},c)),E)}function Ch(e){const t=e,{value:n,size:r=za,level:i=Va,bgColor:a=qa,fgColor:u=Ka,includeMargin:f=Qa,imageSettings:o}=t,l=mr(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let c=Vt.QrCode.encodeText(n,Wa[i]).getModules();const h=f?fr:0,p=c.length+h*2,m=Xa(c,r,f,o);let g=null;o!=null&&m!=null&&(m.excavation!=null&&(c=Ja(c,m.excavation)),g=ye.createElement("image",{xlinkHref:o.src,height:m.h,width:m.w,x:m.x+h,y:m.y+h,preserveAspectRatio:"none"}));const v=Za(c,h);return ye.createElement("svg",ps({height:r,width:r,viewBox:`0 0 ${p} ${p}`},l),ye.createElement("path",{fill:a,d:`M0,0 h${p}v${p}H0z`,shapeRendering:"crispEdges"}),ye.createElement("path",{fill:u,d:v,shapeRendering:"crispEdges"}),g)}var ei=e=>{const t=e,{renderAs:n}=t,r=mr(t,["renderAs"]);return n==="svg"?ye.createElement(Ch,ps({},r)):ye.createElement(Ih,ps({},r))};const ys=(e,t)=>t*100/e,Oh=e=>!!(e||e===0),Mh={ABSOLUTE:"AMT",RELATIVE:"%",COMPLIMENTARY:"COMPLIMENTARY",NON_CHARGEABLE:"NON CHARGEABLE"},k=new Object({"3INCH":{lines:"- - - - - - - - - - - - - - - - - - - - - - - - - - - - -",paperSize:"36rem",itemName:"Item Name ",dynamicClassname:"size-3inch",textSize:19},"2INCH":{lines:"- - - - - - - - - - - - - - - - - - - -",paperSize:"23rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},"2.5INCH":{paperSize:"28rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},"2.7INCH":{paperSize:"30.6rem",itemName:"Item Name ",dynamicClassname:"size-3inch",textSize:19},"1.8INCH":{paperSize:"20.7rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},A4:{paperSize:"297mm",itemName:"Item Name ",dynamicClassname:"size-a4",textSize:13},A5:{paperSize:"148mm",itemName:"Item Name ",dynamicClassname:"size-a5",textSize:9}});var Ct=tr(),_e="normal-class";(Ct=="Android OS"||Ct==="iOS")&&(_e="bold-class");const qe=e=>{var nt,Mt,ee,be,pt;const t=e.additionalActions??{},n=ye.useRef(null),r=e.settingData?e.settingData:e.value.settingData,i=localStorage.getItem("siteId"),{staticDataKOT:a,printer:u,type:f}=e.printerDataObject,o=((Mt=(nt=e.value)==null?void 0:nt.settingData)==null?void 0:Mt.curr)??((ee=e.settingData)==null?void 0:ee.curr)??"INR";r==null||r.fontTheme;let l=e.printerDataObject.paperSize,c=lr(u,{type:f,siteSetting:e.settingData?e.settingData:e.value.settingData},t);const h=r.customLabels??xd();l=c?(be=c[0])!=null&&be.paperSize?(pt=c[0])==null?void 0:pt.paperSize:l||"3INCH":e.printerDataObject.paperSize;function p(y){const d=Math.abs(parseFloat(y));return m(d)}function m(y){switch(o){case"BHD":case"KWD":case"MUR":case"OMR":return Zs(y).format("0,00.000");default:return Zs(y).format("0,00.00")}}ye.useEffect(()=>{E()},[e.newId]);const g=()=>new Promise(async(y,d)=>{if(Ct=="Android OS"||Ct==="iOS"){let O=await bh(n.current);if(O){const j=await _(O);y(j)}}else{let O=await $a(n.current);O&&y(O)}}),v=()=>new Promise(async(y,d)=>{const O=await g();y(O)}),_=y=>new Promise((d,O)=>{let j=new Image;j.src=y,j.onload=()=>{let I=document.createElement("canvas");const U=600,b=j.height;let F=j.width,W=j.height;F>W?F>U&&(W*=U/F,F=U):W>b&&(F*=b/W,W=b),I.width=F,I.height=W,I.getContext("2d").drawImage(j,0,0,F,W),d(I.toDataURL())}}),E=async()=>{if(n&&n.current){const y=await v();e.onImageGenerated(y)}},S=y=>{let d=new Array;for(const O in y.menusCollection)O.endsWith("collection")||(y.menusCollection[`${O}_collection`]||y.menusCollection[O])&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${O.replace("_"," ")}(${y.menusCollection[O]}):`}),s.jsx("span",{children:ie(y.menusCollection[`${O}_collection`],o)}),s.jsx("span",{children:m(ys(y.salesCollection.totalCollection,y.menusCollection[`${O}_collection`]??0))+"%"})]}));return y.salesCollection.online_aggregator_collection&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Aggregator(${y.salesCollection.online_aggregator}):`}),s.jsx("span",{children:ie(y.salesCollection.online_aggregator_collection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Zomato(${y.salesCollection.zomato_aggregator??0}):`}),s.jsx("span",{children:ie(y.salesCollection.zomato_aggregator_collection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Swiggy(${y.salesCollection.swiggy_aggregator??0}):`}),s.jsx("span",{children:ie(y.salesCollection.swiggy_aggregator_collection,o)})]})),d},w=y=>{let d=new Array,O=new Object;for(let j=0;j<y.todayCollection.length;j++)O=y.todayCollection[j],d.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${O.displayName}:`}),s.jsx("span",{children:ie(O.value,o)}),s.jsx("span",{children:m(ys(y.totalCollection,O.value))+"%"})]}));return d},D=(y,d,O,j,I={})=>{let U=y.includes("upi://");const b=`upi://pay?pa=${y}&pn=${O}&cu=INR&am=${j}&tr=${d}`;return s.jsx(ei,{value:U?y:b,renderAs:"canvas",size:I.size??250})},$=(y,d)=>{var U,b;let O=0;if((U=d.taxObj)!=null&&U.VAT.length){let F,W,he;for(W=0;W<((b=d.taxObj)==null?void 0:b.VAT.length);W++){F=d.taxObj.VAT[W];for(he in F)O+=ve(F[he])}}const j={sellerName:d.companyInfo.companyName,vatRegistrationNumber:y,invoiceTimestamp:new Date(d.orderInfo.timestamp*1e3).toISOString(),invoiceTotal:d.finalAmount,invoiceVatTotal:O},I=gd(j.sellerName,j.vatRegistrationNumber,j.invoiceTimestamp,j.invoiceTotal,j.invoiceVatTotal.toFixed(2));return s.jsx(ei,{value:I,renderAs:"canvas",size:250})},P=y=>{const d=[];return(y.totalBalanceAmt||y.refundAmt||y.writeOffAmt||y.rewardAmt||y.cashCard)&&(d.push(s.jsx("hr",{})),y.rewardAmt&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"REWARDS:"}),s.jsx("span",{children:ie(y.rewardAmt,o)})]})),y.totalBalanceAmt&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"OUTSTANDING AMOUNT:"}),s.jsx("span",{children:ie(y.totalBalanceAmt,o)})]})),y.writeOffAmt&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"WRITE OFF AMOUNT:"}),s.jsx("span",{children:ie(y.writeOffAmt,o)})]})),y.refundAmt&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"REFUND AMOUNT:"}),s.jsx("span",{children:ie(y.refundAmt,o)})]})),y.cashCard&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"CASH CARD:"}),s.jsx("span",{children:ie(y.cashCard,o)})]}))),d},Z=(y,d)=>{if(d&&d.length){for(let O=0;O<d.length;O++)if(d[O].slugName===y)return d[O]}return!1},ne=(y,d)=>{if(d&&d.length){for(let O=0;O<d.length;O++)if(d[O].itemType===y)return d[O]}return!1},te=new Object({CREDIT:"Other Income",DEBIT:"Expense"}),le=y=>y.discountType==="COMPLIMENTARY"?"@ COMPLIMENTARY":y.discountType==="NON_CHARGEABLE"?"@ NON CHARGEABLE":`@ ${y.discountValue}${Mh[y.discountType]}`,Se=y=>{const d=new Array;if(y&&Object.keys(y).length!==0){d.push(s.jsx("h4",{className:"single-entity-and-center",children:"ACCOUNTS"}));for(const O in y)if(d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:`Total ${te[O]}:`}),s.jsx("span",{children:ie(y[O].total,o)})]})),O&&Object.keys(O).length!==0)for(const j in y[O])j!=="total"&&y[O][j]&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- ${Ve(j)}:`}),s.jsx("span",{children:ie(y[O][j],o)})]}))}return d},Q=(y,d)=>{let O=!1;y.totalValue&&(O=Object.keys(y.totalValue).length>1);let j=new Object;return s.jsxs(s.Fragment,{children:[y.totalValue&&Object.keys(y.totalValue).map(U=>{if(j=y.totalValue[U],U==="GST")return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.qty}}),s.jsx("h4",{className:`items products-heading-rate ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.rate}}),s.jsx("h4",{className:`items products-heading-amt ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[y.itemList&&y.itemList.length&&y.itemList.length>0&&y.itemList.map(b=>{if(b.taxType===U||!b.taxType)return s.jsxs("div",{style:b.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{fontWeight:"lighter",lineHeight:1.2},children:[b.status==="RETURNED"?"(R) ":"",b.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:[b.status==="RETURNED"?"-":"",b.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:b.rate?p(b.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:b.status==="RETURNED"?b.serviceAmount?m(b.serviceAmount):"":b.price?m(b.price):""})]}),b.addons&&b.addons.length&&b.addons.map(F=>s.jsx("h6",{className:`items products-heading-addon-kot ${k[l].dynamicClassname}`,children:"- "+Ve(F.serviceName)})),b.instruction&&y.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+b.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${k[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.subtotal}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.gstTTL)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):"",j&&j.cat&&Object.keys(j.cat).length>0?Object.keys(j.cat).map(b=>{const F=Z(b,y.discArr);if(F&&j.cat[b]!==0&&F.serviceName)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:d[`disc_${F.serviceName.toLowerCase()}`]??"DISC-"+F.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+F.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.cat[b])})]})}):"",y.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(b=>{const F=ne(b,y.itemTypeDiscObj);if(F&&j.itemTypes[b]!==0&&F.itemType&&F.value)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:d[`disc_${F.itemType.toLowerCase()}`]??"DISC-"+F.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+F.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.itemTypes[b])})]})}):"",y.segMentDisc&&j&&j.segDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:d[`segment_disc${y.segMentObj.segmentName.toLowerCase()}`]??y.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+y.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.segDisc)})]}):"",j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:y.couponCode?d.coupon_disc??"COUPON DISC":d.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[y.couponCode?`(${y.couponCode.toUpperCase()})`:"",m(y.dicsEnterValue)?`@${y.dicsEnterValue}${y.discountType=="RELATIVE"||y.discountType=="COMPLIMENTARY"||y.discountType=="NON_CHARGEABLE"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.orderDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:["  ",y.couponCode?"COUPON DISC":"خصم الطلب",y.couponCode?`(${y.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(b=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d[`charges_${b.name.toLowerCase()}`]??b.name}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b.amt)})]})})):"",j&&j.aftDisc&&j.gstTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.aftDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.aftDisc&&j.gstTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",y.taxObj&&y.taxObj[U]&&j?s.jsx(s.Fragment,{children:U==="GST"?y.taxObj[U].map(b=>{let F=new Array;for(const W in b)if(b[W]&&b[W]!=0){let he=W/2;F.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d.cgst}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[W]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d[y.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[W]/2)})]})]}))}return F}):y.taxObj[U].map(b=>{let F=new Array;for(const W in b)if(b[W]&&b[W]!=0){let he=W;F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d.vat}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[W])})]})}))}return F})}):"",j.gstTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.total}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m((j.total||0)+(j.aftDisc||0)+j.taxOnCharges)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j.gstTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع"}),s.jsx("h5",{className:"actual-qty"})]}),y.totalValue&&(Object.keys(y.totalValue).length||0)>1?s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}):"",O&&s.jsx("div",{className:"space-2rem"})]})]})}),y.totalValue&&Object.keys(y.totalValue).map(U=>{if(j=y.totalValue[U],U==="VAT")return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.item_name}}),s.jsx("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.qty}}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.rate}}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[y.itemList&&y.itemList.length&&y.itemList.length>0&&y.itemList.map(b=>{if(b.taxType===U)return s.jsxs("div",{style:b.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,children:[b.status==="RETURNED"?"(R) ":"",b.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,children:[b.status==="RETURNED"?"-":"",b.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`,children:b.rate?p(b.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`,children:b.status==="RETURNED"?b.serviceAmount?m(b.serviceAmount):"":b.price?m(b.price):""})]}),b.addons&&b.addons.length&&b.addons.map(F=>s.jsx("h6",{className:`items products-heading-addon-kot ${k[l].dynamicClassname}`,children:"- "+Ve(F.serviceName)})),b.instruction&&y.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+b.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${k[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.subtotal}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.vatTTL)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):"",j&&j.cat&&Object.keys(j.cat).length>0?Object.keys(j.cat).map(b=>{const F=Z(b,y.discArr);if(F&&j.cat[b]!==0&&F.serviceName)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:d[`disc_${F.serviceName.toLowerCase()}`]??"DISC-"+F.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+F.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.cat[b])})]})}):"",y.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(b=>{const F=ne(b,y.itemTypeDiscObj);if(F&&j.itemTypes[b]!==0&&F.itemType&&F.value)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:d[`disc_${F.itemType.toLowerCase()}`]??"DISC-"+F.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+F.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.itemTypes[b])})]})}):"",y.segMentDisc&&j&&j.segDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:d[`segment_disc${y.segMentObj.segmentName.toLowerCase()}`]??y.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+y.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.segDisc)})]}):"",j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:y.couponCode?d.coupon_disc??"COUPON DISC":d.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[y.couponCode?`(${y.couponCode.toUpperCase()})`:"",m(y.dicsEnterValue)?`@${y.dicsEnterValue}${y.discountType=="RELATIVE"||y.discountType=="COMPLIMENTARY"||y.discountType=="NON_CHARGEABLE"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.orderDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:["  ",y.couponCode?"COUPON DISC":"خصم الطلب",y.couponCode?`(${y.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(b=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d[`charges_${b.name.toLowerCase()}`]??b.name}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b.amt)})]})})):"",j&&j.aftDisc&&j.vatTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.aftDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.aftDisc&&j.vatTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(b=>s.jsx(s.Fragment,{children:b.taxOnAmount&&b.taxOnAmount!=0?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d.cgst}}),s.jsx("span",{children:" @"+b.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b.taxOnAmount/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d[y.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+b.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b.taxOnAmount/2)})]})]}):""})):"",y.taxObj&&y.taxObj[U]&&j?s.jsx(s.Fragment,{children:U==="GST"?y.taxObj[U].map(b=>{let F=new Array;for(const W in b)if(b[W]&&b[W]!=0){let he=W/2;F.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d.cgst}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[W]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d[y.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[W]/2)})]})]}))}return F}):y.taxObj[U].map(b=>{let F=new Array;for(const W in b)if(b[W]&&b[W]!=0){let he=W;F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d.vat}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[W])})]})}))}return F})}):"",j.vatTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.total}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m((j.total||0)+(j.aftDisc||0)+j.taxOnCharges)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j.vatTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع"}),s.jsx("h5",{className:"actual-qty"})]})]})]})})]})},J=(y,d,{labels:O,doMultipleTax:j,type:I})=>{var b,F,W,he,Ae,He,Le,Oe,De,Ke,yt;const U=y.discounts;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:O.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:O.qty}}),s.jsx("h4",{className:`items products-heading-rate ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:O.rate}}),s.jsx("h4",{className:`items products-heading-amt ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:O.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[y.itemList.map(K=>{var At;return s.jsxs("div",{style:K.serviceName.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{lineHeight:1.2},children:[K.status==="RETURNED"?"(R) ":"",K.serviceName.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,children:[K.status==="RETURNED"?"-":"",K.qty]}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`,children:K.serviceRate?p(K.serviceRate):""}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`,children:K.sub_total?m(K.sub_total):""})]}),K.hsnCode&&d.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",K.hsnCode]}),(At=K.addons)!=null&&At.length?K.addons.map(rt=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{lineHeight:1.2},children:"+ "+Ve(rt.serviceName)}),s.jsxs("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,children:[K.status==="RETURNED"?"-":"",rt.qty*K.qty]}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`})]}),s.jsx("div",{children:rt.hsnCode&&d.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",rt.hsnCode]})})]})):"",K.instruction&&d.itemInstructionOnBill?s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+K.instruction+")"})}):""]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${k[l].dynamicClassname} ${_e}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:O.subtotal}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(y.subTotal)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):""]}),(b=U.DISCOUNT_ITEMS)!=null&&b.length?U.DISCOUNT_ITEMS.map(K=>s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O[`disc_${K.discountName.toLowerCase()}`]??"DISC-"+K.discountName.toUpperCase()}}),s.jsx("span",{children:le(K)})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.discountAmt)})]})):"",(F=U.CATEGORY_DISCOUNT)!=null&&F.length?U.CATEGORY_DISCOUNT.map(K=>s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O[`disc_${K.discountName.toLowerCase()}`]??"DISC-"+K.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+K.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.discountAmt)})]})):"",(W=U.ITEM_DISCOUNT)!=null&&W.length?U.ITEM_DISCOUNT.map(K=>s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O[`disc_${K.discountName.toLowerCase()}`]??"DISC-"+es(K.discountName).toUpperCase()}}),s.jsx("span",{children:" @"+K.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.discountAmt)})]})):"",(Ae=(he=U.SEGMENT_DISCOUNT)==null?void 0:he[0])!=null&&Ae.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O[`segment_disc${U.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+U.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),":",s.jsx("span",{children:" @"+U.SEGMENT_DISCOUNT[0].discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(U.SEGMENT_DISCOUNT[0].discountAmt)})]}):"",(Le=(He=U.COUPON_DISCOUNT)==null?void 0:He[0])!=null&&Le.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:"COUPON DISC"}}),":",s.jsx("span",{children:`(${U.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${U.COUPON_DISCOUNT[0].discountValue}${U.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(U.COUPON_DISCOUNT[0].discountAmt)})]}):"",(De=(Oe=U.ORDER_DISCOUNT)==null?void 0:Oe[0])!=null&&De.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O.order_disc??"ORDER DISC"}}),":",s.jsx("span",{children:m(U.ORDER_DISCOUNT[0].discountValue)?`@${U.ORDER_DISCOUNT[0].discountValue}${U.ORDER_DISCOUNT[0].discountType=="RELATIVE"||U.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"||U.ORDER_DISCOUNT[0].discountType=="NON_CHARGEABLE"?"%":"AMT"}`:""})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(U.ORDER_DISCOUNT[0].discountAmt)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&y&&y.orderDisc?s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsxs("h5",{className:"total-qty",children:["  ",d.couponCode?"COUPON DISC":"خصم الطلب",d.couponCode?`(${d.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",(Ke=y.charges)!=null&&Ke.length?y.charges.map(K=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:O[`charges_${K.name.toLowerCase()}`]??K.name}})}),d.invoiceType=="INCLUSIVE_SIMPLIFIED"?s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.amt+K.taxAmt)}):s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.amt)})]})})):"",y.subTotal!==y.afterCharges&&y.afterCharges!==y.total&&d.invoiceType!=="INCLUSIVE_SIMPLIFIED"?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:O.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(y.afterCharges)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&y.subTotal!==y.afterCharges?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",d.invoiceType!=="INCLUSIVE_SIMPLIFIED"&&((yt=y.taxation)!=null&&yt.length)?y.taxation.map(K=>{if(K.taxAmt)return K.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.cgst}}),s.jsx("span",{children:"@"+K.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.taxAmt/2)})]}),s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O[d.taxLabel.toLowerCase()]}}),s.jsx("span",{children:"@"+K.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.taxAmt/2)})]})]}):s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.vat}}),s.jsx("span",{children:"@"+K.tax+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.taxAmt)})]})}):"",s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:O.total}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(y.total)})]}),j?s.jsx(s.Fragment,{children:I==="GST"?s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}),s.jsx("div",{className:"space-2rem"})]}):""}):""]})},z=(y,d)=>{var U,b;let O=!1;const j=y.distributedData;return y.distributedData&&(O=Object.keys(y.distributedData).length>1),s.jsxs(s.Fragment,{children:[((U=j.GST)==null?void 0:U.itemList)&&J(j.GST,y,{labels:d,doMultipleTax:O,type:"GST"}),((b=j.VAT)==null?void 0:b.itemList)&&J(j.VAT,y,{labels:d,doMultipleTax:O,type:"VAT"})]})},de=y=>{const d=y.services,O=Object.keys(y.services),j=O.length;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${_e}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:k[l].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",children:[j&&O.map((U,b)=>s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"left-align-entity level3-bold",children:s.jsxs("u",{children:[U.toUpperCase(),":"]})}),d[U].map(F=>{var W;return s.jsxs("div",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name-kot ${k[l].dynamicClassname}`,children:Ve(F.serviceName)}),s.jsx("h4",{className:`items products-heading-qty-kot ${k[l].dynamicClassname}`,children:F.qty})]}),((W=F.addons)==null?void 0:W.length)&&F.addons.map(he=>{var Ae;return s.jsx("h5",{className:"items products-heading-addon-kot",children:"- "+((Ae=he.serviceName)==null?void 0:Ae.toUpperCase())})}),F.instruction&&s.jsx("h5",{className:"left-align-entity",children:s.jsx("h5",{className:"items products-heading-addon-kot",children:" ("+F.instruction+")"})})]})}),j!==b+1&&s.jsx("br",{})]})),s.jsx("hr",{})]})]})},G=y=>{const d=y.slice(0,-4),O=y.slice(-4);return{firstDigits:d,last4Dgits:O}},X=(y,d,O,j={})=>{const I=Object.keys(d??{});let U=[],b,F="flex-two-items";if(j.action==="addCharges"&&(F="display-percentage"),y&&I.length){U.push(s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",children:`${O.toUpperCase()} BREAK-UP`}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Total ",O,":"]}),s.jsx("span",{children:ie(y,o)})]})]}));for(let W=0;W<I.length;W++)b=I[W],d[b]&&U.push(s.jsxs("h5",{className:`left-align-entity level3-bold ${F} second-span-right`,children:[s.jsx("span",{children:` -- ${b.replaceAll("_"," ")}:`}),s.jsx("span",{children:ie(d[b],o)}),j.action==="addCharges"?s.jsx("span",{children:m(ys(y,d[b]))+"%"}):""]}));U.push(s.jsx("hr",{}))}return U},tt=y=>{const d=Object.keys(y.Category),O=Object.keys(y.Addon);let j=new Array;return j.push(s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"left-align-entity level3-bold",children:"Product Category"}),s.jsx("hr",{className:"dashed"})]})),d.forEach((I,U)=>{const b=y.Category[I];let F=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",es(I)]}),s.jsxs("section",{className:"products-section",children:[b.forEach(W=>{F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${k["3INCH"].dynamicClassname}`,children:W.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${k["3INCH"].dynamicClassname}`,children:parseFloat(W.qty.toFixed(2))})]})}))}),F,U!=d.length-1&&s.jsx("hr",{})]})]}))}),O.length>0&&(j.push(s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsx("h3",{className:"left-align-entity level3-bold",children:"Addon Category"}),s.jsx("hr",{className:"dashed"})]})),O.forEach((I,U)=>{const b=y.Addon[I];let F=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",es(I)]}),s.jsxs("section",{className:"products-section",children:[b.forEach(W=>{F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${k["3INCH"].dynamicClassname}`,children:W.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${k["3INCH"].dynamicClassname}`,children:parseFloat(W.qty.toFixed(2))})]})}))}),F,U!=O.length-1&&s.jsx("hr",{className:"dashed"})]})]}))})),j},st=y=>{var O;const d={company_mobile:"Mob",company_Email:"Email",company_GST:"GST",company_VAT:"VAT",company_FSSAI:"FSSAI",name:"Name",mobile:"Mobile",address:"Address",email:"Email",token_no:"Token No",order_no:"Order No",date:"Date",delivery_date:"Delivery Date",item_name:"Item Name",qty:"Qty",rate:"Rate",amt:"Amt",subtotal:"SUB TOTAL",order_disc:"ORDER DISC",coupon_disc:"COUPON DISC",complementary_disc:"COMPLIMENTARY BILL",nonChargeable_disc:"NON CHARGEABLE BILL",amt_before_tax:"AMT BEFORE TAX",total:"TOTAL",grand_total:"GRAND TOTAL",reward_point_balance:"REWARD POINT BALANCE",balance_amt:"BALANCE AMOUNT",rewards_redeemed:"REWARDS REDEEMED",vat:"VAT",sgst:"SGST",cgst:"CGST",utgst:"UTGST",igst:"IGST",previous_outstanding:"PREVIOUS OUTSTANDING",total_payable:"TOTAL PAYABLE",delivery_code:"Delivery Code",online_order_id:"Online Order ID",area_name:"Area Name",table_name:"Table Name",captain_name:"Captain Name"};if((O=y==null?void 0:y.customBillLabels)!=null&&O.length){let j;for(let I=0;I<y.customBillLabels.length;I++)j=y.customBillLabels[I],d[j.defaultName]=j.displayName}return d},Ot=(y,d,O,j)=>{var W,he,Ae,He,Le,Oe,De,Ke,yt,K,At,rt,gs,xs,an,Ns,js,ln,on,cn,dn,hn,un,mn,qt,vs,gt,Kt,Qt,_s,fn,bs,pn,Ss,Ts,yn,gn,ws,Is,xn,Nn,jn,vn,x,M;const I=st(r.customLabelsMap),U=us(Nd(r.paymentModes),"internalName"),b=C=>{var N;return(N=U[C])!=null&&N.displayName?U[C].displayName.toUpperCase():C};if(y==="BILL"){let C;if(l==="A4"||l==="A5"){let N={...d},Y=0,V=N.distributedData;const R=V.discounts;C=s.jsx("div",{className:`invoiceContainer main-div ${k[l].dynamicClassname}`,children:s.jsxs("div",{id:"page-wrap",children:[s.jsx("table",{width:"100%",className:"custom-table custom-table-bordered",children:s.jsxs("tbody",{children:[s.jsxs("tr",{children:[s.jsxs("td",{colSpan:9,children:[s.jsx("tr",{className:"subtotalTr",children:s.jsx("td",{colSpan:12,style:{borderBottom:"1px solid black",width:"100%"},children:s.jsx("h5",{children:s.jsxs("strong",{children:[N.companyInfo.companyName,":"]})})})}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.order_no}:`},className:"font-weight-bold"}),s.jsx("span",{children:N.orderId})]}),s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.date}:`},className:"font-weight-bold"}),s.jsx("span",{children:N.orderInfo.orderDate})]})]})]}),s.jsx("td",{colSpan:3,className:"text-right",children:s.jsx("div",{className:"d-flex justify-content-center",children:O&&s.jsx("img",{src:O,width:90})})})]}),s.jsx("tr",{children:s.jsx("td",{colSpan:12,className:"text-center border-right",style:{padding:"0px 1.4rem"},children:s.jsx("h6",{children:s.jsx("strong",{children:"Tax Invoice"})})})}),s.jsxs("tr",{children:[s.jsx("td",{colSpan:6,className:"v-align-baseline col-6",children:s.jsxs("div",{className:"divPadding",children:[(N.customerInfo.custName||((W=N.customFields)==null?void 0:W.length))&&s.jsx("tr",{children:s.jsx("td",{colSpan:"2",className:"text-center border-right",children:s.jsx("strong",{children:"Bill To"})})}),N.customerInfo.custName&&N.customerInfo.custName!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.customerInfo.custName})}),N.customerInfo.custContact&&N.customerInfo.custContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.customerInfo.custContact})}),N.customerInfo.custAddress&&N.customerInfo.custAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.customerInfo.custAddress})}),N.deliveryTimestamp&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.deliveryTimestamp})}),(he=N.customFields)!=null&&he.length?N.customFields.map(T=>s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[T.customName,": ",T.customValue]})})):""]})}),s.jsx("td",{colSpan:6,className:"v-align-baseline",children:s.jsxs("div",{className:"divPadding",children:[s.jsx("tr",{children:s.jsx("td",{colSpan:"2",className:"text-center border-right",children:s.jsx("strong",{children:"Bill From"})})}),s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.companyInfo.companyName})}),N.companyInfo.companyAddress&&N.companyInfo.companyAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.companyInfo.companyAddress})}),N.companyInfo.companyEmail&&N.companyInfo.companyEmail!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.companyInfo.companyEmail})}),N.companyInfo.companyContact&&N.companyInfo.companyContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.companyInfo.companyContact})}),N.fssai&&N.fssai!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_FSSAI}:`}}),s.jsx("span",{children:N.fssai})]})}),N.gst&&N.gst!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_GST}:`}}),s.jsx("span",{children:N.gst})]})}),N.vatNo&&N.vatNo!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_VAT}:`}}),s.jsx("span",{children:N.vatNo})]})})]})})]}),s.jsx("tr",{children:s.jsx("td",{colSpan:12,children:s.jsxs("table",{width:"100%",className:"custom-table productTable ",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-right",style:{lineHeight:"10px"},children:[s.jsx("th",{className:"text-align-left",children:"Sr No"}),s.jsx("th",{className:"text-align-left",style:{width:"40%"},children:"Item Name"}),s.jsx("th",{className:"text-align-left",children:"Quantity"}),s.jsx("th",{className:"text-align-right",children:"Price/Unit"}),s.jsx("th",{className:"text-align-right",children:"Amount"})]})}),s.jsxs("tbody",{children:[N.itemList.map(T=>{var Ne;let xe="",pe=[];return Y++,pe.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:xe,children:[s.jsx("td",{className:"text-align-left",children:T.serviceRate?Y:""}),s.jsx("td",{style:{width:"40%"},className:"text-align-left",children:T.serviceName.toUpperCase()}),s.jsx("td",{className:"text-align-left",children:T.qty}),s.jsx("td",{className:"text-align-right",children:T.serviceRate?B(T.serviceRate,o):""}),s.jsx("td",{className:"text-align-right",children:T.sub_total?B(T.sub_total,o):""})]}),T.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+T.instruction+")"})]})]})),(Ne=T.addons)!=null&&Ne.length&&T.addons.map(we=>{pe.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:"fs-8",children:[s.jsx("td",{}),s.jsxs("td",{style:{width:"40%"},children:["+ ",we.serviceName.toUpperCase()]}),s.jsx("td",{children:we.qty*T.qty})]}),we.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+we.instruction+")"})]})]}))}),pe}),s.jsx("tr",{style:{lineHeight:"10px",fontSize:"14px"},children:s.jsx("td",{colSpan:5,children:s.jsx("strong",{className:"font-weight-bold",children:`Total ${Y} Items and ${ve(V.qty)} Quantity`})})})]})]})})}),s.jsxs("tr",{className:"avoid-page-break",children:[s.jsx("td",{colSpan:6,style:{verticalAlign:"top"},children:s.jsx("div",{children:s.jsxs("div",{width:"100%",children:[s.jsx("tr",{children:s.jsxs("td",{colSpan:"2",children:[s.jsx("strong",{className:"font-weight-bold",children:"Amount in words"}),s.jsx("br",{}),pd(Me(N.finalAmount,o).toFixed(Bt[o].minimumFractionDigits??2))]})}),s.jsx("hr",{}),N.upiId&&d.companyInfo.companyName&&d.paymentStatus!=="PAID"&&(!d.splitDetails||((Ae=d.splitDetails)==null?void 0:Ae.length)==0)(s.jsxs(s.Fragment,{children:[s.jsx("tr",{children:s.jsx("td",{width:"50%",className:"font-weight-bold",children:"Scan To Pay"})}),s.jsx("tr",{children:s.jsx("td",{width:"50%",children:s.jsx("div",{className:"image-bill",children:D(d.upiId,d.orderId,d.companyInfo.companyName,d.paidAmt,{size:100})})})})]})),N.footerMessage?s.jsx("tr",{children:s.jsx("td",{colSpan:"2",children:s.jsx("div",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:N.footerMessage}})})}):""]})})}),s.jsx("td",{colSpan:6,style:{verticalAlign:"top"},children:s.jsx(s.Fragment,{children:s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:I.subtotal}})})}),s.jsx("td",{width:"50%",className:"text-align-right",children:B(V.subTotal,o)})]}),(He=R==null?void 0:R.DISCOUNT_ITEMS)!=null&&He.length?R.DISCOUNT_ITEMS.map(T=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${T.discountName.toLowerCase()}`]??"DISC-"+T.discountName.toUpperCase()}}),s.jsx("span",{children:le(T)})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.discountAmt,o)})]})):"",(Le=R==null?void 0:R.CATEGORY_DISCOUNT)!=null&&Le.length?R.CATEGORY_DISCOUNT.map(T=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${T.discountName.toLowerCase()}`]??"DISC-"+T.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+T.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.discountAmt,o)})]})):"",(Oe=R==null?void 0:R.ITEM_DISCOUNT)!=null&&Oe.length?R.ITEM_DISCOUNT.map(T=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${T.discountName.toLowerCase()}`]??"DISC-"+T.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+T.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.discountAmt,o)})]})):"",(Ke=(De=R==null?void 0:R.SEGMENT_DISCOUNT)==null?void 0:De[0])!=null&&Ke.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`segment_disc${R.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+R.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),s.jsx("span",{children:" @"+R.SEGMENT_DISCOUNT[0].discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(R.SEGMENT_DISCOUNT[0].discountAmt,o)})]}):"",(K=(yt=R==null?void 0:R.COUPON_DISCOUNT)==null?void 0:yt[0])!=null&&K.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:"COUPON DISC"}}),s.jsx("span",{children:`(${R.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${R.COUPON_DISCOUNT[0].discountValue}${R.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(R.COUPON_DISCOUNT[0].discountAmt,o)})]}):"",(rt=(At=R==null?void 0:R.ORDER_DISCOUNT)==null?void 0:At[0])!=null&&rt.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I.order_disc??"ORDER DISC"}}),s.jsx("span",{children:m(R.ORDER_DISCOUNT[0].discountValue)?`@${R.ORDER_DISCOUNT[0].discountValue}${R.ORDER_DISCOUNT[0].discountType=="RELATIVE"||R.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"||R.ORDER_DISCOUNT[0].discountType=="NON_CHARGEABLE"?"%":"AMT"}`:""})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(R.ORDER_DISCOUNT[0].discountAmt,o)})]}):"",(gs=V.charges)!=null&&gs.length?V.charges.map(T=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`charges_${T.name.toLowerCase()}`]??T.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.amt,o)})]})):"",V.subTotal!==V.afterCharges?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.amt_before_tax}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(V.afterCharges,o)})]}):"",(xs=V.taxation)!=null&&xs.length?V.taxation.map(T=>T.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.cgst}}),s.jsx("span",{children:" @"+T.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.taxAmt/2,o)})]}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.sgst}}),s.jsx("span",{children:" @"+T.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.taxAmt/2,o)})]})]}):s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.vat}}),s.jsx("span",{children:" @"+T.tax+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.taxAmt,o)})]})):"",s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:I.grand_total}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(N.finalAmount,o)})]}),(an=d==null?void 0:d.custoutStandingData)!=null&&an.balanceAmt?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.previous_outstanding}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B((Ns=N==null?void 0:N.custoutStandingData)==null?void 0:Ns.balanceAmt,o)})]}),s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:I.total_payable}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(N.grandTotal+((js=N==null?void 0:N.custoutStandingData)==null?void 0:js.balanceAmt),o)})]})]}):"",N.rewardAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.rewards_redeemed}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(N.rewardAmt,o)})]}):"",(ln=d.paymentMethods)!=null&&ln.length?d.paymentMethods.map(T=>{var xe;if(T.paidAmt)return s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:["-"," ",s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`${(xe=T.paymentMode)==null?void 0:xe.toLowerCase()}`]??b(T.paymentMode)??"CASH"}}),s.jsx("span",{children:T.isRefund?"(Refund)":""})]}),T.isRefund?s.jsx("td",{className:"text-align-right",width:"50%",children:"("+B(T.paidAmt,o)+")"}):s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.paidAmt,o)})]})}):"",N.balanceAmt&&d.balanceAmt!=0?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.balance_amt}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(d.balanceAmt,o)})]}):"",d.balPoint&&!Number.isNaN(d.balPoint)?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.reward_point_balance}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:d.balPoint})]}):"",(on=d.splitDetails)!=null&&on.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{marginTop:"6px"},children:s.jsx("h7",{className:"level2-bold",children:"Split Bill by Guest Details:"})}),d.splitDetails.map(T=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:T.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:d.curr+" "+T.amount})]}))]}):"",s.jsx("tr",{className:"subtotalTr",children:s.jsxs("td",{className:"text-center",width:"100%",children:[s.jsx("hr",{}),s.jsx("strong",{children:"Authorised Signatory"})]})}),s.jsx("tr",{className:"subtotalTr",children:s.jsx("td",{colSpan:2,width:"50%",children:s.jsx("div",{className:"p-4"})})})]})})})]})]})}),s.jsx("p",{className:"single-entity-and-center f-12 mt-2 avoid-page-break",style:{marginTop:"10px"},children:`Printed By :${N.printby} Printed On: ${N.printTime}`}),N.disabledPoweredBy?"":s.jsx("p",{className:"single-entity-and-center f-12 mt-2 avoid-page-break",children:"Powered By: www.recaho.com"})]})})}else C=s.jsx("div",{className:"main-div bill",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[d.duplicateBill?s.jsx("h4",{className:"single-entity-and-center",children:"DUPLICATE BILL"}):"",s.jsx("br",{}),O&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:O,className:"single-entity-and-center",style:{width:k[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[!O&&d.companyInfo.companyName&&d.companyInfo.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:d.companyInfo.companyName}),d.companyInfo.companyAddress&&d.companyInfo.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:d.companyInfo.companyAddress}}),d.companyInfo.companyContact&&d.companyInfo.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_mobile}}),": ",s.jsx("span",{children:d.companyInfo.companyContact})]})}),d.companyInfo.companyEmail&&d.companyInfo.companyEmail!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_Email}}),": ",s.jsx("span",{children:d.companyInfo.companyEmail})]})}),d.fssai&&d.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_FSSAI}}),": ",s.jsx("span",{children:d.fssai})]})}),d.gst&&d.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_GST}}),": ",s.jsx("span",{children:d.gst})]})}),d.vatNo&&d.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_VAT}}),": ",s.jsx("span",{children:d.vatNo})]})}),s.jsx("hr",{}),d.orderFrom&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:d.menuDisplayName?d.menuDisplayName:d.orderFrom}),d.area&&s.jsxs("h3",{className:"single-entity-and-center level2-bold",children:[d.area," : ",d.tableName?d.tableName:d.tableNo]}),d.tokenId&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.token_no}})," ",s.jsx("span",{children:d.tokenId})]})}),d.parentOrderRef&&s.jsx("h4",{className:"single-entity-and-center",children:"RETURN/EXCHANGE"})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname} ${_e}`,children:[d.customerInfo.custName&&d.customerInfo.custName!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.name}}),": ",s.jsx("span",{children:d.customerInfo.custName})]})}),d.customerInfo.custContact&&d.customerInfo.custContact!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.mobile}}),": ",s.jsx("span",{children:d.customerInfo.custContact})]})}),d.customerInfo.custAddress&&d.customerInfo.custAddress!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.address}}),": ",s.jsx("span",{children:d.customerInfo.custAddress})]})}),ft(d.appliedDiscounts??[],"COMPLIMENTARY","discountType").discountType&&s.jsx("h5",{className:"left-align-entity level2-bold",dangerouslySetInnerHTML:{__html:I.complementary_disc}}),ft(d.appliedDiscounts??[],"NON_CHARGEABLE","discountType").discountType&&s.jsx("h5",{className:"left-align-entity level2-bold",dangerouslySetInnerHTML:{__html:I.nonChargeable_disc}}),d.orderId&&s.jsx("h5",{className:"left-align-entity",style:{flexShrink:0},children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.order_no}}),": ",s.jsx("span",{children:d.orderId})]})}),d.orderInfo.orderDate&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.date}}),":",s.jsx("span",{children:d.orderInfo.orderDate})]})}),d.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.delivery_date}}),":",s.jsx("span",{children:d.deliveryTimestamp})]})}),d.captainName&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.captain_name}}),":",s.jsx("span",{children:d.captainName})]})})]}),(cn=d.customFields)!=null&&cn.length?s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[s.jsx("hr",{}),d.customFields.map(N=>s.jsx("h4",{className:"left-align-entity",children:N.customName+": "+N.customValue}))]}):"",d.newFormat?z(d,I):Q(d,I),s.jsx("br",{}),s.jsxs("div",{className:`bottom-section ${k[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:`total-qty ${(dn=d.custoutStandingData)!=null&&dn.balanceAmt||d.rewardAmt&&d.paymentMethods&&d.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:I.grand_total}}),s.jsx("h6",{className:`actual-qty ${(hn=d.custoutStandingData)!=null&&hn.balanceAmt||d.rewardAmt&&d.paymentMethods&&d.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+m(d.finalAmount)})]}),(un=d.custoutStandingData)!=null&&un.balanceAmt?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.previous_outstanding}})}),s.jsx("h5",{children:d.curr+" "+m(d.custoutStandingData.balanceAmt)})]}),!d.rewardAmt&&!d.paymentMethods?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:I.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+m(d.finalAmount+d.custoutStandingData.balanceAmt)})]}):""]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},children:"المجموع الإجمالي"}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"}})]}):"",d.rewardAmt?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsxs("h5",{children:["- ",s.jsx("span",{dangerouslySetInnerHTML:{__html:I.rewards_redeemed}}),s.jsx("span",{children:"("+d.usedPoints+" Points)"})]}),s.jsx("h5",{children:d.curr+" "+d.rewardAmt})]}):"",d.paymentMethods&&d.paymentMethods.length?d.paymentMethods.map(N=>{var Y;if(N.paidAmt)return s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsxs("h5",{children:["-",s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`${(Y=N.paymentMode)==null?void 0:Y.toLowerCase()}`]??b(N.paymentMode)??"CASH"}}),s.jsx("span",{children:N.isRefund?"(Refund)":""})]}),s.jsx("h5",{children:N.isRefund?s.jsx(s.Fragment,{children:d.curr+" ("+m(N.paidAmt)+")"}):s.jsx(s.Fragment,{children:d.curr+" "+m(N.paidAmt)})})]})}):"",d.rewardAmt&&!d.paymentMethods?s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:I.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+m(d.finalAmount+(((mn=d==null?void 0:d.custoutStandingData)==null?void 0:mn.balanceAmt)||0)-d.rewardAmt)})]})}):"",Oh((qt=d.convertedCurrValue)==null?void 0:qt.value)?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty"}),s.jsx("h5",{className:"actual-qty",children:`(${B(d.convertedCurrValue.value,d.convertedCurrValue.curr)})`})]}):"",d.balanceAmt&&d.balanceAmt!=0?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{dangerouslySetInnerHTML:{__html:I.balance_amt}}),s.jsx("h5",{children:d.curr+" "+m(d.balanceAmt)})]}):"",s.jsx("hr",{})]}),d.earnPoints&&d.paymentMethods?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",children:"EARN POINTS"}),s.jsx("h6",{className:"actual-qty",children:d.earnPoints})]}):"",(d.balPoint||d.earnPoints)&&!Number.isNaN(d.balPoint||d.earnPoints)?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",dangerouslySetInnerHTML:{__html:I.reward_point_balance}}),s.jsx("h6",{className:"actual-qty",children:d.balPoint+d.earnPoints||0})]}):"",(vs=d.splitDetails)!=null&&vs.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{marginTop:"6px"},children:s.jsx("h5",{className:"level2-bold",children:"Split Bill by Guest Details:"})}),d.splitDetails.map(N=>s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty line-gaps level3-bold",dangerouslySetInnerHTML:{__html:N.name}}),s.jsx("h5",{className:"actual-qty level3-bold",children:d.curr+" "+N.amount})]}))]}):"",d.invoiceType==="INCLUSIVE_SIMPLIFIED"&&((gt=d.taxation)!=null&&gt.length)?s.jsxs("div",{children:[s.jsx("div",{className:"single-entity-and-center",style:{marginTop:"6px"},children:s.jsx("h6",{className:"level2-bold",children:"Tax Summary"})}),s.jsx("div",{className:"single-entity-and-center",style:{marginTop:"6px"},children:s.jsxs("table",{border:"1",style:{textAlign:"center",margin:"0 auto",marginBottom:"6px",width:"100%"},children:[s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("th",{children:"Tax Name"}),s.jsx("th",{children:"Taxable Amt"}),s.jsx("th",{children:"Tax Amt"})]}),d.taxation.map(N=>{if(N.taxAmt)return Ct==="Android OS"||Ct==="iOS"?N.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${I.cgst} ${N.tax/2}%`}}),s.jsx("th",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("th",{children:d.curr+" "+Me(N.taxAmt/2,o)})]}),s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${I[d.taxLabel.toLowerCase()]} ${N.tax/2}%`}}),s.jsx("th",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("th",{children:d.curr+" "+Me(N.taxAmt/2,o)})]})]}):s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${I.vat} ${N.tax}%`}}),s.jsx("th",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("th",{children:d.curr+" "+Me(N.taxAmt,o)})]}):N.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${I.cgst} ${N.tax/2}%`}}),s.jsx("td",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("td",{children:d.curr+" "+Me(N.taxAmt/2,o)})]}),s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${I[d.taxLabel.toLowerCase()]} ${N.tax/2}%`}}),s.jsx("td",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("td",{children:d.curr+" "+Me(N.taxAmt/2,o)})]})]}):s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${I.vat} ${N.tax}%`}}),s.jsx("td",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("td",{children:d.curr+" "+Me(N.taxAmt,o)})]})})]})})]}):"",d.upiId&&d.companyInfo.companyName&&(!d.splitDetails||((Kt=d.splitDetails)==null?void 0:Kt.length)==0)&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan this QRCode to Pay"}),D(d.upiId,d.orderId,d.companyInfo.companyName,d.paidAmount)]}),d.curr==="SAR"&&r.vatNo&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan with ZATCA app for invoice details."}),$(r.vatNo,d)]}),j?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${j}`,className:"single-entity-and-center",style:{width:k[l].logoWidth}})}):"",d.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:d.footerMessage}}):"",d.printby&&d.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By:${d.printby}`}):"",d.printTime&&d.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On:${d.printTime}`}):"",d.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})});return C}else if(y==="PRINT_DASHBOARD"&&d.salesCollection){const C=d.salesCollection.totalDiscountAmt?ys(d.salesCollection.grandTotal,d.salesCollection.totalDiscountAmt):null,N=d.salesCollection.totalCollection-d.salesCollection.totalTax;var F=L().format("DD/MM/YYYY LT");const Y=(Qt=d.monthTillDateSalesColl)!=null&&Qt.totalDiscountAmt?ys(d.monthTillDateSalesColl.grandTotal,d.monthTillDateSalesColl.totalDiscountAmt):null;return s.jsxs("div",{className:`main-div ${k[l].dynamicClassname}`,style:{width:k[l].paperSize},children:[s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("div",{children:[s.jsx("p",{className:"single-entity-and-left-align",children:`Printed On:- ${F}`}),s.jsx("br",{}),s.jsx("h1",{className:"single-entity-and-center level2-bold",children:"Sales Report"}),s.jsx("p",{className:"single-entity-and-center",children:d.selectedDate})]}),s.jsx("hr",{}),d.monthTillDateSalesColl?s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center flex-two-items",children:"MTD Sales Breakup"}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"Gross Sales:"}),s.jsx("span",{children:ie(d.monthTillDateSalesColl.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${ie(d.monthTillDateSalesColl.totalDiscountAmt,o)}${Y?`(${m(Y)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:ie(d.monthTillDateSalesColl.totalOtherCharges,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:ie(d.monthTillDateSalesColl.totalCollection-d.monthTillDateSalesColl.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:ie(d.monthTillDateSalesColl.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:ie(d.monthTillDateSalesColl.totalCollection,o)})]})]}),s.jsx("hr",{})]}):"",s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center flex-two-items",children:"SALES BREAK-UP"}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"Gross Sales:"}),s.jsx("span",{children:ie(d.salesCollection.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${ie(d.salesCollection.totalDiscountAmt,o)}${C?`(${m(C)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:ie(d.salesCollection.totalOtherCharges,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:ie(N,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:ie(d.salesCollection.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:ie(d.salesCollection.totalCollection,o)})]})]}),s.jsx("hr",{}),X(d.otherFields.totalDiscountAmt,d.otherFields.discountList,"Discount",{action:"addCharges"}),X(d.otherFields.totalOtherCharges,d.otherFields.otherChargesList,"Charges"),X(d.otherFields.totalTax,d.otherFields.taxList,"Tax"),s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"BY BUSINESS"}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Sales:"}),s.jsx("span",{children:ie(d.salesCollection.totalCollection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Orders:"}),s.jsx("span",{children:d.salesCollection.totalOrders})]}),S(d)]}),s.jsx("hr",{}),d.otherFields.totalItemType?s.jsx("div",{children:X(d.otherFields.totalItemType,d.otherFields.itemTypeList,"Item Type",{action:"addCharges"})}):"",d.averageCollection.avgTableTime||d.averageCollection.avgorderValue||d.averageCollection.noOfGuest?s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"PERFORMANCE METRICS"}),d.averageCollection.avgTableTime?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Average ",r.customLabels.Table," Time:"]}),s.jsx("span",{children:d.averageCollection.avgTableTime})]}):"",d.averageCollection.avgorderValue?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Average Order Value:"}),s.jsx("span",{children:ie(d.averageCollection.avgorderValue,o)})]}):"",d.averageCollection.noOfGuest?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Covers:"}),s.jsx("span",{children:d.averageCollection.noOfGuest})]}):"",d.averageCollection.avgPerCover?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Average Per Cover:"}),s.jsx("span",{children:ie(d.averageCollection.avgPerCover,o)})]}):"",s.jsx("hr",{})]}):"",s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"BY PAYMENT CATEGORY"}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Collection:"}),s.jsx("span",{children:ie(d.totalCollection,o)})]}),w(d)]}),P(d.averageCollection),d.otherFields.outstandingAmt?s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"BY PAYMENT STATUS"}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:" -- Sales:"}),s.jsx("span",{children:ie(d.otherFields.salesCollection,o)})]}),d.otherFields.outstandingAmt?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:" -- Outstanding Payment Received:"}),s.jsx("span",{children:ie(d.otherFields.outstandingAmt,o)})]}):""]})]}):"",s.jsx("hr",{}),Se(d.averageCollection.dailyExpanse)]}),s.jsx("br",{}),Ct=="Android OS"&&s.jsx("div",{className:"space-3rem"})]})}else if(y==="AGGREGATOR_BILL"){let C;return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(C=G(a.aggregatorOrderId)),s.jsx("div",{className:"main-div bill",style:{width:k[l].paperSize},children:s.jsxs("div",{children:[s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),O&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:O,className:"single-entity-and-center",style:{width:k[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[!O&&a.companyInfo.companyName&&a.companyInfo.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:a.companyInfo.companyName}),a.companyInfo.companyAddress&&a.companyInfo.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.companyInfo.companyAddress}}),a.companyInfo.companyContact&&a.companyInfo.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_mobile}}),": ",s.jsx("span",{children:a.companyInfo.companyContact})]})}),a.companyInfo.companyEmail&&a.companyInfo.companyEmail!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_Email}}),": ",s.jsx("span",{children:a.companyInfo.companyEmail})]})}),a.fssai&&a.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_FSSAI}}),": ",s.jsx("span",{children:a.fssai})]})}),a.gst&&a.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_GST}}),": ",s.jsx("span",{children:a.gst})]})}),a.vatNo&&a.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_VAT}}),": ",s.jsx("span",{children:a.vatNo})]})}),a.orderFrom&&s.jsx("h3",{className:"single-entity-and-center level2-bold",children:a.menuDisplayName?a.menuDisplayName:a.orderFrom}),a.orderSource&&C&&s.jsxs("h4",{className:"single-entity-and-center",children:[`${a.orderSource}: ${C.firstDigits||""}`,s.jsxs("span",{style:{fontSize:"2rem"},children:["-",C.last4Dgits||""]})]}),a.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center",children:a.zomatoInstant}),a.otp&&a.otp!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.delivery_code}}),": ",s.jsx("span",{children:a.otp})]})}),a.tokenId&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.token_no}})," ",s.jsx("span",{children:a.tokenId})]})})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[a.customerInfo.custName&&a.customerInfo.custName!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.name}}),": ",s.jsx("span",{children:a.customerInfo.custName})]})}),a.customerInfo.custContact&&a.customerInfo.custContact!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.mobile}}),": ",s.jsx("span",{children:a.customerInfo.custContact})]})}),a.customerInfo.custAddress&&a.customerInfo.custAddress!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.address}}),": ",s.jsx("span",{children:a.customerInfo.custAddress})]})}),s.jsxs("div",{className:"flex-two-items",children:[a.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",style:{flexShrink:0},children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.order_no}}),": ",s.jsx("span",{children:a.orderId})]})}),a.orderFrom&&s.jsx("h5",{className:"single-entity-and-center",children:a.menuDisplayName?a.menuDisplayName:a.orderFrom})]}),a.orderInfo.orderDate&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.date}}),":",s.jsx("span",{children:a.orderInfo.orderDate})]})}),a.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.delivery_date}}),":",s.jsx("span",{children:a.deliveryTimestamp})]})})]})]}),s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:"items products-heading-name-kot",children:k[l].itemName}),s.jsx("h6",{className:"items products-heading-qty-kot",children:"Qty"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[((_s=a.services)==null?void 0:_s.length)&&a.services.map(Y=>{var V;return s.jsxs("div",{style:Y.serviceName.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:"items products-heading-name-kot",style:{lineHeight:1.2},children:Y.serviceName.toUpperCase()}),s.jsx("h6",{className:"items products-heading-qty-kot",children:Y.qty})]}),((V=Y.addons)==null?void 0:V.length)&&Y.addons.map(R=>s.jsx("h6",{className:"items products-heading-addon-kot",children:"- "+Ve(R.serviceName)})),Y.instruction&&a.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:Y.instruction})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:"bottom-section-div flex-two-items",style:{paddingBottom:"3rem"},children:[s.jsxs("h5",{children:["TOTAL ITEMS: ",a.services.length]}),s.jsxs("h5",{children:["TOTAL QTY: ",ve(a.totalQty)]})]}),a&&a.discountAmt?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:"DISCOUNT AMOUNT"}),s.jsx("h5",{children:ie(a.discountAmt,o)})]}):"",a.otherCharges&&a.otherCharges.length>0?a.otherCharges.map(Y=>{if(Y.amt)return s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:Y.name}),s.jsx("h5",{children:a.curr+" "+m(Y.amt)})]})}):"",a.taxObj&&a.taxObj.GST?s.jsx(s.Fragment,{children:a.taxObj.GST.map(Y=>{let V=new Array;for(const R in Y)if(Y[R]&&Y[R]!=0){let T=R/2;V.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:["CGST @",T]}),s.jsx("h5",{children:a.curr+" "+m(Y[R]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:[d.taxLabel+" "," @",T,"%"]}),s.jsx("h5",{children:a.curr+" "+m(Y[R]/2)})]})]}))}return V})}):"",s.jsx("div",{style:{marginTop:"6px"},children:(fn=a.customFeilds)==null?void 0:fn.map(Y=>s.jsx("h4",{className:"left-align-entity",children:Y.customName+": "+Y.customValue}))}),a.paymentState&&s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"6px"},children:`Payment Status: ${a.paymentState=="PAID_ONLINE"?"Online paid":"COD"}`}),j?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${j}`,className:"single-entity-and-center",style:{width:k[l].logoWidth}})}):"",a.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.footerMessage}}):"",a.printedBy&&a.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${a.printedBy}`}):"",a.printTime&&a.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${a.printTime}`}):"",a.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})})}else if(y==="UPDATE_TABLE"){let C="";return a.action==="SWITCH_TABLE"?C=s.jsx("div",{className:"main-div",style:{width:"100%",height:"auto"},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["**",(bs=h.Table)==null?void 0:bs.toUpperCase()," SWITCH**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(pn=a.from)==null?void 0:pn.map((N,Y)=>{var V,R,T;return`${(R=(V=e.tableData[N])==null?void 0:V.attachedArea)==null?void 0:R.toUpperCase()} - ${(T=e.tableData[N])==null?void 0:T.tableName}${Y+1===a.from.length?"":", "} `})}),s.jsx("br",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"To"}),s.jsx("h2",{className:"left-align-entity level2-bold",children:`${(Ts=(Ss=e.tableData[a.to[0]])==null?void 0:Ss.attachedArea)==null?void 0:Ts.toUpperCase()} - ${(yn=e.tableData[a.to[0]])==null?void 0:yn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${h.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}):C=s.jsx("div",{className:"main-div",style:{width:"100%",height:"auto"},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["**MERGE ",(gn=h.Table)==null?void 0:gn.toUpperCase(),"**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(ws=a.from)==null?void 0:ws.map((N,Y)=>{var V,R,T;return`${(R=(V=e.tableData[N])==null?void 0:V.attachedArea)==null?void 0:R.toUpperCase()} - ${(T=e.tableData[N])==null?void 0:T.tableName}${Y+1===a.from.length?"":", "} `})}),s.jsx("br",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"To"}),s.jsx("h2",{className:"left-align-entity level2-bold",children:`${(xn=(Is=e.tableData[a.to[0]])==null?void 0:Is.attachedArea)==null?void 0:xn.toUpperCase()} - ${(Nn=e.tableData[a.to[0]])==null?void 0:Nn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${h.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}),C}else if(y==="COUNTER_OPERATION"){let C;return l=="2INCH"||l=="1.8INCH"?C=s.jsx("div",{className:"main-div",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:[a.counterName," Report"]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed By: ",a.printedBy," "]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed On: ",a.printedOn," "]}),s.jsx("hr",{}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" Total Sales: ",B(a.totalSale,o)," "]}),a.totalSale>0&&s.jsxs(s.Fragment,{children:[(a.cashSale>0||a.cashSale<0)&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash: ",B(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(N=>{if(N.value>0||N.value<0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",N.displayName," : ",B(N.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",B(a.closingActualBalance,o)]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Opening Counter Operation"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opened By : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",a.openedBy]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Date/Time : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",a.openingDateTime]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- System Opening Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",B(a.openingBalance,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Opening Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",B(a.actualOpeningBalance,o)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opening Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",B(a.openingShort,o)," "]}),a.openingShortReason&&s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opening Difference Reason : "}),a.openingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",a.openingShortReason]}),a.openingTotalDenomations>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.openingDenominations&&a.openingDenominations.length>0&&a.openingDenominations.map(N=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:["   ",o=="INR"?B(N.denomination,o):N.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",N.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(N.total,o)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:B(a.openingTotalDenomations,o)})]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Closing Counter Operation"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closed By : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",a.closedBy," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Date/Time :"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",a.closingDateTime]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Cash Sale : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",B(a.cashSale,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- System Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",B(a.closingBalance,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["   ",B(a.closingActualBalance,o)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closing Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",B(a.closingShort,o)," "]}),a.closingShortReason&&s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closing Difference Reason : "}),a.closingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",a.closingShortReason," "]}),a.debitEntry>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Other Cash Expense : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    -",B(a.debitEntry,o)," "]})]}),a.creditEntry>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Other Cash Income : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    +",B(a.creditEntry,o)," "]})]}),a.internalTransferDebit>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Internal Transfer(cash to bank): "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["   -",B(a.internalTransferDebit,o)]})]}),a.internalTransferCredit>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Internal Transfer(bank to cash) : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["   +",B(a.internalTransferCredit,o)]})]}),a.TotalDenomationsAmount>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.denomations&&a.denomations.length>0&&a.denomations.map(N=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:["  ",o=="INR"?B(N.denomination,o):N.curr+" "+N.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",N.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(N.total,o)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:B(a.TotalDenomationsAmount,o)})]})]})}):C=s.jsx("div",{className:"main-div",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:[a.counterName," Report"]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed By: ",a.printedBy," "]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed On: ",a.printedOn," "]}),s.jsx("hr",{}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" Total Sales: ",B(a.totalSale,o)," "]}),a.totalSale>0&&s.jsxs(s.Fragment,{children:[a.cashSale>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash: ",B(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(N=>{if(N.value>0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",N.displayName," : ",B(N.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",B(a.closingActualBalance,o)]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Opening Counter Operation"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Opened By : ",a.openedBy]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Date/Time : ",a.openingDateTime]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Opening Balance : ",B(a.openingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Opening Balance : ",B(a.actualOpeningBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Opening Difference Amt : ",B(a.openingShort,o)]}),a.openingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Opening Difference Reason : ",a.openingShortReason]}),a.openingTotalDenomations>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.openingDenominations&&a.openingDenominations.length>0&&a.openingDenominations.map(N=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:["   ",o=="INR"?B(N.denomination,o):N.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",N.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(N.total,o)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:B(a.openingTotalDenomations,o)})]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Closing Counter Operation"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Closed By : ",a.closedBy," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Date/Time : ",a.closingDateTime]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash Sale : ",B(a.cashSale,o)," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Closing Balance : ",B(a.closingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Closing Balance : ",B(a.closingActualBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Closing Difference Amt : ",B(a.closingShort,o)]}),a.closingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Closing Difference Reason : ",a.closingShortReason," "]}),a.debitEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Expense : -",B(a.debitEntry,o)]}),a.creditEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Income : +",B(a.creditEntry,o)]}),a.internalTransferDebit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(cash to bank): -",B(a.internalTransferDebit,o)]}),a.internalTransferCredit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(bank to cash): +",B(a.internalTransferCredit,o)]}),a.TotalDenomationsAmount>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"--Currency Denominations"})}),a.denomations&&a.denomations.length>0&&a.denomations.map(N=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:["  ",o=="INR"?B(N.denomination,o):N.curr+" "+N.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",N.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(N.total,o)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:B(a.TotalDenomationsAmount,o)})]})]})}),C}else if(y==="ITEMWISE_SALES_COUNTER"){let C,{counterDetails:N}=e.printerDataObject;return C=s.jsx("div",{className:"main-div",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("h2",{className:"single-entity-and-center level2-bold",children:"Item Wise Sales Report"}),s.jsx("h5",{className:"single-entity-and-center level3-bold",children:N.currentDate}),s.jsx("hr",{}),N.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Counter Name: ",N.CounterName]}),N.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["UserName: ",N.openedBy]}),N.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Login Time: ",N.loginTime]}),N.logoutTime&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Logout Time: ",N.logoutTime]}),N.CounterName&&s.jsx("hr",{}),tt(a),s.jsx("hr",{}),s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${N.openedBy}`}),s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${N.printedOn}`})]})}),C}else if(y==="CARD_RECHARGE_DETAILS"){let{staticDataKOT:C}=e.printerDataObject;return getRechargeDetails(C)}else if(y==="PACKAGING_SLIP"){let C,N=0;d.aggregatorOrderId&&d.aggregatorOrderId!==""&&(C=G(d.aggregatorOrderId));const Y=d.services;for(let R in Y)N+=Y[R].length;return s.jsx("div",{className:"main-div",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[d.subOrderFrom&&s.jsx("h4",{className:"single-entity-and-center",children:d.subOrderFrom.toUpperCase()}),d.orderFrom!=="dine-in"&&s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["Token No ",d.tokenId]}),d.tableName&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:d.tableName}),d.otp&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:"OTP: "+d.otp}),d.orderSource&&C&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${d.orderSource}: ${C.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:C.last4Dgits||""})]}),d.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:d.zomatoInstant}),s.jsx("hr",{}),d.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Order Id: "+d.orderId}),d.date&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Printed On: ",d.date]}),d.prepareBy?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Prepare By : "+d.prepareBy}):"",d.waiterName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${h.Waiter} Name: `+d.waiterName})]}),de(d),s.jsx("br",{}),s.jsxs("div",{className:"bottom-section-div flex-two-items space-3rem",children:[s.jsxs("h5",{children:["TOTAL ITEMS: ",N]}),s.jsxs("h5",{children:["TOTAL QTY: ",ve(d.totalQty)]})]}),(jn=d.customFields)==null?void 0:jn.map(R=>s.jsx("h4",{className:"left-align-entity",children:R.customName+": "+R.customValue})),s.jsx("br",{}),d.orderFrom!=="dine-in"&&s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Payment Status: ",d.paymentStatus.replace("_"," ")]})]})})}else{if(y==="ORDER_AGGREGATED_PRINT")return s.jsx("div",{className:"main-div",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[a.logo&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:a.logo,className:"single-entity-and-center"})}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[!a.logo&&a.companyName&&a.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:a.companyName}),a.companyAddress&&a.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.companyAddress}}),a.companyContact&&a.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_mobile}}),": ",s.jsx("span",{children:a.companyContact})]})}),a.fssai&&a.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_FSSAI}}),": ",s.jsx("span",{children:a.fssai})]})}),a.gst&&a.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_GST}}),": ",s.jsx("span",{children:a.gst})]})}),a.vatNo&&a.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_VAT}}),": ",s.jsx("span",{children:a.vatNo})]})})]}),s.jsx("hr",{}),s.jsx("h3",{className:"single-entity-and-center",children:"Outstanding Bill Summary"}),s.jsx("hr",{}),s.jsx("hr",{}),a.name&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.name}}),": ",s.jsx("span",{children:a.name})]}),a.mobile&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.mobile}}),": ",s.jsx("span",{children:a.mobile})]}),s.jsxs("div",{className:"mt-2",children:[s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:`items products-heading-name ${k[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${k[l].dynamicClassname}`,children:"Order Id"}),s.jsx("h5",{className:`items products-heading-amount ${k[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.orders.map(N=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,children:rr(N.date)}),s.jsx("h6",{className:`items products-heading-orderId ${k[l].dynamicClassname}`,children:N.orderId}),s.jsx("h6",{className:`items products-heading-amount ${k[l].dynamicClassname}`,children:a.curr+" "+m(N.finalAmount)})]})},N.orderId))})]}),s.jsxs("div",{children:[s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:"Total Bill Amount"}),s.jsx("h5",{className:"actual-qty",children:a.curr+" "+m(a.totalAmount)})]}),s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:"Total Amount Paid"}),s.jsx("h5",{className:"actual-qty",children:a.curr+" "+m(a.totalPaid)})]})]}),(vn=a.transactions)!=null&&vn.length?s.jsxs("div",{children:[s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:`items products-heading-name ${k[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${k[l].dynamicClassname}`,children:"Payment Mode"}),s.jsx("h5",{className:`items products-heading-amount ${k[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.transactions.map(N=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,children:N.date}),s.jsx("h6",{className:`items products-heading-orderId ${k[l].dynamicClassname}`,children:N.paymentMode}),s.jsx("h6",{className:`items products-heading-amount ${k[l].dynamicClassname}`,children:a.curr+" "+m(N.amount)})]})},N.id))})]}):"",s.jsxs("div",{className:"mt-2 pb-2rem",children:[s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h4",{className:"total-qty-other",children:"Total Payable"}),s.jsx("h4",{className:"actual-qty-other",children:a.curr+" "+m(a.totalPayable)})]})]})]})});{let C,N=0,Y,V;for(let T=0;T<(((x=a.services)==null?void 0:x.length)||0);T++)V=a.services[T],V.status==="CANCELLED"&&!a.onlyCancelledItems&&(N+=V.qty);return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(C=G(a.aggregatorOrderId)),s.jsx("div",{className:"main-div",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{maxWidth:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:"main-div",children:[a.duplicate&&!a.onlyCancelledItems?s.jsx("h4",{className:"single-entity-and-center",children:"DUPLICATE KOT"}):"",N||a.onlyCancelledItems?s.jsx("h4",{className:"single-entity-and-center",children:"EDITED KOT - ITEM CANCELLED"}):"",a.station&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:a.station.toUpperCase()}),a.subOrderFrom&&s.jsx("h4",{className:"single-entity-and-center",children:a.subOrderFrom.toUpperCase()}),a.type!="dine-in"&&a.tokenId&&s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["Token No ",a.tokenId]}),a.type=="dine-in"&&a.type&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:a.type==="dine-in"?a.tableName?a.tableName:"-":""}),s.jsx("hr",{}),a.otp&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:"OTP: "+a.otp}),a.orderSource&&C&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${a.orderSource}: ${C.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:C.last4Dgits||""})]}),a.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:a.zomatoInstant}),s.jsxs("div",{className:"details-section",children:[a.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Order Id: "+Array.from(a.orderId).join(", ")}),s.jsxs("div",{className:"flex-container-kot",children:[a.kotId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${h.KOT} Id: `+Array.from(a.kotId).join(", ")}),a.type&&a.type!="dine-in"&&s.jsx("h2",{className:"left-align-entity",children:a.type==="dine-in"?a.tableName?a.tableName:"-":""})]}),a.customerName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:a.customerName}),a.time?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Printed On : "+a.time}):"",a.prepareBy?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Prepare By : "+a.prepareBy}):""]}),a.createdBy&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Printed By: "+a.createdBy}),a.waiterName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${h.Waiter} Name: `+a.waiterName})]}),s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${_e}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:k[l].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:`products-section ${_e}`,style:{paddingTop:"12px"},children:[a.services&&a.services.length&&a.services.length>0&&a.services.reverse().map(T=>(T.status==="CANCELLED"?Y=s.jsxs("strike",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ve(T.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:T.qty})]}),T.addons&&T.addons.length&&T.addons.map(xe=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ve(xe.serviceName)})),T.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+T.instruction})})]}):Y=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ve(T.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:T.qty})]}),T.addons&&T.addons.length&&T.addons.map(xe=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ve(xe.serviceName)})),T.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+T.instruction})})]}),s.jsx("div",{children:Y}))),s.jsx("hr",{})]}),s.jsxs("div",{className:"bottom-section-div flex-two-items",style:{paddingBottom:"3rem"},children:[s.jsxs("h5",{className:"level3-bold",children:["TOTAL ITEMS: ",a.services.length]}),s.jsxs("h5",{className:"level3-bold",children:["TOTAL QTY: ",ve(a.totalQty-N)]})]}),(M=a.customFields)==null?void 0:M.map(T=>s.jsx("h4",{className:"left-align-entity",children:T.customName+": "+T.customValue})),a.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Delivery Date: "+a.deliveryTimestamp})]})})}}};return s.jsx("div",{children:a&&Object.keys(a).length!==0&&s.jsx("div",{id:"domEl",ref:n,className:"html-bill-print",style:{maxWidth:k[l].paperSize,zIndex:"-10",backgroundColor:"#fff"},children:Ot(f,a.obj,a.companyLogo,a.companyQrCode)})})},Ah=async(e,t,n,r={})=>new Promise(async(i,a)=>{var u,f,o;try{const{needPackagingSlip:l=!0}=r;e.primaryWaiter&&n&&(e.primaryWaiter=((u=n[e.primaryWaiter])==null?void 0:u.name)||null);const{obj:c,printersMap:h}=bd(e,t,r);let p=[],m=[];const g=[];if(Sa(c).flatMap(v=>{(h[v.station]||[]).forEach(E=>{const S=new Promise(w=>{g.push(s.jsx(qe,{printerDataObject:{staticDataKOT:v,paperSize:E.paperSize,printer:E.printer},newId:v.newId,value:{settingData:t},onImageGenerated:D=>{p.push({paperSize:E.paperSize,printer:E.printer,image:D,type:"KOT"}),w()},additionalActions:r},v.newId+"::"+E.printer))});m.push(S)})}),l&&((f=t.packagingSlipPrinters)!=null&&f.length)){const v=Sd(e,t,r);(o=v.printers)!=null&&o.length&&v.printers.forEach(_=>{m.push(new Promise(E=>{g.push(s.jsx(qe,{printerDataObject:{staticDataKOT:{obj:_.obj},paperSize:_.paperSize,printer:_.printer,type:"PACKAGING_SLIP"},newId:_.obj.newId,value:{settingData:t},onImageGenerated:S=>{p.push({paperSize:_.paperSize,printer:_.printer,image:S,type:"PACKAGING_SLIP"}),E()},additionalActions:r},_.obj.newId))}))})}g.length&&_t("root2",g),await Promise.all(m),i(p)}catch(l){a(l)}}),Eh=(e,t,n)=>new Promise(async(r,i)=>{try{const{tableData:a}=n;let u=[],f=[];if(n!=null&&n.action){const{obj:o,paperSize:l,printersMap:c}=Td(e,t,n),h=Sa(o).flatMap(p=>{var m;return(m=c[p.station])==null?void 0:m.map(g=>new Promise(v=>{const _=s.jsx(qe,{printerDataObject:{staticDataKOT:p,paperSize:l,printer:g.printer,type:p.type},newId:p.newId,settingData:t,tableData:us(a,"typeValue"),onImageGenerated:E=>{u.push({paperSize:g.paperSize,printer:g.printer,image:E,type:"UPDATE_TABLE"}),v()},additionalActions:n});return f.push(v),_}))});h.length&&_t("root1",h),await Promise.all(f.map(p=>new Promise(p)))}r(u)}catch(a){i(a)}}),Rh=(e,t)=>new Promise(async(n,r)=>{try{const i=wd(e,t);let a=[];await new Promise(f=>{const o=s.jsx(qe,{printerDataObject:{staticDataKOT:{obj:i},paperSize:e.printerSize,type:"PRINT_DASHBOARD"},newId:i.id,settingData:e,onImageGenerated:l=>{a.push({paperSize:e.printerSize,image:l,type:"PRINT_DASHBOARD"}),f()},additionalActions:t});_t("root1",o)}),n(a)}catch(i){r(i)}}),Lh=async(e,t,n)=>new Promise(async(r,i)=>{try{const{obj:a}=await Id(e,t,n);let u=[];await new Promise(o=>{const l=s.jsx(qe,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"AGGREGATOR_BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{u.push({paperSize:a.paperSize,image:c,type:"AGGREGATOR_BILL"}),o()},additionalActions:n});_t("root1",l)}),r(u)}catch(a){i(a)}}),kh=async(e,t,n)=>new Promise(async(r,i)=>{try{let a=await ba(e,t,n),u=[];await new Promise(async o=>{if(n.isSplitBill&&a.obj.splitDetails&&a.obj.splitDetails.length){const l=a.obj.splitDetails.map((c,h)=>new Promise(p=>{let m=JSON.parse(JSON.stringify(a));m.obj.splitDetails=[c];const g=s.jsx(qe,{printerDataObject:{staticDataKOT:m,paperSize:m.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:v=>{u.push({paperSize:m.paperSize,image:v,type:"BILL"}),p()},additionalActions:n});ti(g)}));await Promise.all(l),o()}else{const l=s.jsx(qe,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{u.push({paperSize:a.paperSize,image:c,type:"BILL"}),o()},additionalActions:n});ti(l)}}),r(u)}catch(a){i(a)}}),Ph=async(e,t,n,r)=>new Promise(async(i,a)=>{try{let u=await Cd(e);if(u&&Object.keys(u.Category).length!==0){let o=`ItemWiseSales:::${Math.floor(Math.random()*1e3)}`,l=[];await new Promise(h=>{const p=s.jsx(qe,{printerDataObject:{staticDataKOT:u,paperSize:t.printerSize,type:"ITEMWISE_SALES_COUNTER",counterDetails:n},newId:o,settingData:t,onImageGenerated:m=>{l.push({paperSize:t.printerSize,image:m,type:"ITEMWISE_SALES_COUNTER"}),h()},additionalActions:r});_t("root1",p)}),i(l)}else i([])}catch(u){a(u)}}),Fh=async(e,t,n)=>new Promise(async(r,i)=>{try{let u=`counterDetailsPrint:::${Math.floor(Math.random()*1e3)}`,f=[];await new Promise(l=>{const c=s.jsx(qe,{printerDataObject:{staticDataKOT:e,paperSize:t.printerSize,type:"COUNTER_OPERATION"},newId:u,settingData:t,onImageGenerated:h=>{f.push({paperSize:t.printerSize,image:h,type:"COUNTER_OPERATION"}),l()},additionalActions:n});_t("root1",c)}),r(f)}catch(a){i(a)}}),Dh=async(e,t,n={},r={})=>new Promise(async(i,a)=>{var u;try{const f=await Md(e,t);let o=[],l=lr(null,{fontTheme:t.fontTheme,type:"ORDER_AGGREGATED_PRINT",siteSetting:t}),c=l?(u=l[0])==null?void 0:u.paperSize:t.printerSize;await new Promise(p=>{const m=s.jsx(qe,{printerDataObject:{staticDataKOT:{...f,name:n.name,mobile:n.mobile},paperSize:c,type:"ORDER_AGGREGATED_PRINT"},newId:Math.random(),settingData:t,onImageGenerated:g=>{o.push({paperSize:c,image:g,type:"ORDER_AGGREGATED_PRINT"}),p()},additionalActions:r});_t("root1",m)}),i(o)}catch(f){a(f)}}),Yh=async(e,t,n={})=>new Promise(async(r,i)=>{var a;try{const u=[];let f=[];for(let o=0;o<e.length;o++){let l=e[o];if((a=l.invoiceFormats)!=null&&a.length){let c=dd(l.invoiceFormats,"createdAt")[0],h=await Ad(c);await new Promise(m=>{const g=s.jsx(qe,{printerDataObject:{staticDataKOT:h,paperSize:h.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:v=>{f.push({paperSize:h.paperSize,image:v,type:"BILL"}),m()},additionalActions:n});u.push(g)})}}u.length&&_t("root1",u),r(f)}catch(u){i(u)}}),_t=(e,t)=>{const n=document.getElementById(e);n&&vr.createRoot(n).render(t)},ti=e=>{try{const t=Object.assign(document.createElement("div"),{id:`react-root-${Math.random().toString(36).slice(2,11)}`,style:"position:absolute; top:-9999px; left:-9999px;"});document.body.appendChild(t);const n=vr.createRoot(t),r=()=>{n.unmount(),t.remove()};n.render(ye.cloneElement(e,{handleUnmount:r}))}catch(t){console.log("renderComponentsV2 err :::",t)}};Ie.counterDetailsPrint=Fh,Ie.handleAggregatorBillPrint=Lh,Ie.handleBillPrint=kh,Ie.handleDashboardPrint=Rh,Ie.handleItemWisePrint=Ph,Ie.handleKOTPrint=Ah,Ie.handleOldBillPrints=Yh,Ie.handleSummaryPrint=Dh,Ie.handleUpdateTablePrint=Eh,Object.defineProperty(Ie,Symbol.toStringTag,{value:"Module"})});
54
+ */var Wa={L:Kt.QrCode.Ecc.LOW,M:Kt.QrCode.Ecc.MEDIUM,Q:Kt.QrCode.Ecc.QUARTILE,H:Kt.QrCode.Ecc.HIGH},za=128,Va="L",qa="#FFFFFF",Ka="#000000",Qa=!1,fr=4,Th=.1;function Za(e,t=0){const n=[];return e.forEach(function(r,l){let o=null;r.forEach(function(a,m){if(!a&&o!==null){n.push(`M${o+t} ${l+t}h${m-o}v1H${o+t}z`),o=null;return}if(m===r.length-1){if(!a)return;o===null?n.push(`M${m+t},${l+t} h1v1H${m+t}z`):n.push(`M${o+t},${l+t} h${m+1-o}v1H${o+t}z`);return}a&&o===null&&(o=m)})}),n.join("")}function Ja(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((l,o)=>o<t.x||o>=t.x+t.w?l:!1))}function Xa(e,t,n,r){if(r==null)return null;const l=n?fr:0,o=e.length+l*2,a=Math.floor(t*Th),m=o/t,u=(r.width||a)*m,i=(r.height||a)*m,c=r.x==null?e.length/2-u/2:r.x*m,h=r.y==null?e.length/2-i/2:r.y*m;let f=null;if(r.excavate){let y=Math.floor(c),p=Math.floor(h),v=Math.ceil(u+c-y),_=Math.ceil(i+h-p);f={x:y,y:p,w:v,h:_}}return{x:c,y:h,h:i,w:u,excavation:f}}var wh=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function Ih(e){const t=e,{value:n,size:r=za,level:l=Va,bgColor:o=qa,fgColor:a=Ka,includeMargin:m=Qa,style:u,imageSettings:i}=t,c=mr(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),h=i==null?void 0:i.src,f=ge.useRef(null),y=ge.useRef(null),[p,v]=ge.useState(!1);ge.useEffect(()=>{if(f.current!=null){const S=f.current,T=S.getContext("2d");if(!T)return;let D=Kt.QrCode.encodeText(n,Wa[l]).getModules();const $=m?fr:0,k=D.length+$*2,J=Xa(D,r,m,i),re=y.current,te=J!=null&&re!==null&&re.complete&&re.naturalHeight!==0&&re.naturalWidth!==0;te&&J.excavation!=null&&(D=Ja(D,J.excavation));const de=window.devicePixelRatio||1;S.height=S.width=r*de;const be=r/k*de;T.scale(be,be),T.fillStyle=o,T.fillRect(0,0,k,k),T.fillStyle=a,wh?T.fill(new Path2D(Za(D,$))):D.forEach(function(Z,X){Z.forEach(function(q,ue){q&&T.fillRect(ue+$,X+$,1,1)})}),te&&T.drawImage(re,J.x+$,J.y+$,J.w,J.h)}}),ge.useEffect(()=>{v(!1)},[h]);const _=ys({height:r,width:r},u);let E=null;return h!=null&&(E=ge.createElement("img",{src:h,key:h,style:{display:"none"},onLoad:()=>{v(!0)},ref:y})),ge.createElement(ge.Fragment,null,ge.createElement("canvas",ys({style:_,height:r,width:r,ref:f},c)),E)}function Ch(e){const t=e,{value:n,size:r=za,level:l=Va,bgColor:o=qa,fgColor:a=Ka,includeMargin:m=Qa,imageSettings:u}=t,i=mr(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let c=Kt.QrCode.encodeText(n,Wa[l]).getModules();const h=m?fr:0,f=c.length+h*2,y=Xa(c,r,m,u);let p=null;u!=null&&y!=null&&(y.excavation!=null&&(c=Ja(c,y.excavation)),p=ge.createElement("image",{xlinkHref:u.src,height:y.h,width:y.w,x:y.x+h,y:y.y+h,preserveAspectRatio:"none"}));const v=Za(c,h);return ge.createElement("svg",ys({height:r,width:r,viewBox:`0 0 ${f} ${f}`},i),ge.createElement("path",{fill:o,d:`M0,0 h${f}v${f}H0z`,shapeRendering:"crispEdges"}),ge.createElement("path",{fill:a,d:v,shapeRendering:"crispEdges"}),p)}var ei=e=>{const t=e,{renderAs:n}=t,r=mr(t,["renderAs"]);return n==="svg"?ge.createElement(Ch,ys({},r)):ge.createElement(Ih,ys({},r))};const gs=(e,t)=>t*100/e,Oh=e=>!!(e||e===0),Mh={ABSOLUTE:"AMT",RELATIVE:"%",COMPLIMENTARY:"COMPLIMENTARY",NON_CHARGEABLE:"NON CHARGEABLE"},L=new Object({"3INCH":{lines:"- - - - - - - - - - - - - - - - - - - - - - - - - - - - -",paperSize:"36rem",itemName:"Item Name ",dynamicClassname:"size-3inch",textSize:19},"2INCH":{lines:"- - - - - - - - - - - - - - - - - - - -",paperSize:"23rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},"2.5INCH":{paperSize:"28rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},"2.7INCH":{paperSize:"30.6rem",itemName:"Item Name ",dynamicClassname:"size-3inch",textSize:19},"1.8INCH":{paperSize:"20.7rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},A4:{paperSize:"297mm",itemName:"Item Name ",dynamicClassname:"size-a4",textSize:13},A5:{paperSize:"148mm",itemName:"Item Name ",dynamicClassname:"size-a5",textSize:9}});var Mt=tr(),_e="normal-class";(Mt=="Android OS"||Mt==="iOS")&&(_e="bold-class");const qe=e=>{var Et,se,Se,yt,Ke;const t=e.additionalActions??{},{invoiceFormat:n={}}=e,r=ge.useRef(null),l=e.settingData?e.settingData:e.value.settingData,o=localStorage.getItem("siteId"),{staticDataKOT:a,printer:m,type:u}=e.printerDataObject,i=((se=(Et=e.value)==null?void 0:Et.settingData)==null?void 0:se.curr)??((Se=e.settingData)==null?void 0:Se.curr)??"INR";l==null||l.fontTheme;let c=e.printerDataObject.paperSize,h=lr(m,{type:u,siteSetting:e.settingData?e.settingData:e.value.settingData},t);const f=l.customLabels??xd();c=h?(yt=h[0])!=null&&yt.paperSize?(Ke=h[0])==null?void 0:Ke.paperSize:c||"3INCH":e.printerDataObject.paperSize;function y(g){const d=Math.abs(parseFloat(g));return p(d)}function p(g){switch(i){case"BHD":case"KWD":case"MUR":case"OMR":return Zs(g).format("0,00.000");default:return Zs(g).format("0,00.00")}}ge.useEffect(()=>{S()},[e.newId]);const v=()=>new Promise(async(g,d)=>{if(Mt=="Android OS"||Mt==="iOS"){let C=await bh(r.current);if(C){const j=await E(C);g(j)}}else{let C=await $a(r.current);C&&g(C)}}),_=()=>new Promise(async(g,d)=>{const C=await v();g(C)}),E=g=>new Promise((d,C)=>{let j=new Image;j.src=g,j.onload=()=>{let w=document.createElement("canvas");const Y=600,b=j.height;let F=j.width,V=j.height;F>V?F>Y&&(V*=Y/F,F=Y):V>b&&(F*=b/V,V=b),w.width=F,w.height=V,w.getContext("2d").drawImage(j,0,0,F,V),d(w.toDataURL())}}),S=async()=>{if(r&&r.current){const g=await _();e.onImageGenerated(g)}},T=g=>{let d=new Array;for(const C in g.menusCollection)C.endsWith("collection")||(g.menusCollection[`${C}_collection`]||g.menusCollection[C])&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${C.replace("_"," ")}(${g.menusCollection[C]}):`}),s.jsx("span",{children:le(g.menusCollection[`${C}_collection`],i)}),s.jsx("span",{children:p(gs(g.salesCollection.totalCollection,g.menusCollection[`${C}_collection`]??0))+"%"})]}));return g.salesCollection.online_aggregator_collection&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Aggregator(${g.salesCollection.online_aggregator}):`}),s.jsx("span",{children:le(g.salesCollection.online_aggregator_collection,i)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Zomato(${g.salesCollection.zomato_aggregator??0}):`}),s.jsx("span",{children:le(g.salesCollection.zomato_aggregator_collection,i)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Swiggy(${g.salesCollection.swiggy_aggregator??0}):`}),s.jsx("span",{children:le(g.salesCollection.swiggy_aggregator_collection,i)})]})),d},D=g=>{let d=new Array,C=new Object;for(let j=0;j<g.todayCollection.length;j++)C=g.todayCollection[j],d.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${C.displayName}:`}),s.jsx("span",{children:le(C.value,i)}),s.jsx("span",{children:p(gs(g.totalCollection,C.value))+"%"})]}));return d},$=(g,d,C,j,w={})=>{let Y=g.includes("upi://");const b=`upi://pay?pa=${g}&pn=${C}&cu=INR&am=${j}&tr=${d}`;return s.jsx(ei,{value:Y?g:b,renderAs:"canvas",size:w.size??250})},k=(g,d)=>{var Y,b;let C=0;if((Y=d.taxObj)!=null&&Y.VAT.length){let F,V,fe;for(V=0;V<((b=d.taxObj)==null?void 0:b.VAT.length);V++){F=d.taxObj.VAT[V];for(fe in F)C+=ve(F[fe])}}const j={sellerName:d.companyInfo.companyName,vatRegistrationNumber:g,invoiceTimestamp:new Date(d.orderInfo.timestamp*1e3).toISOString(),invoiceTotal:d.finalAmount,invoiceVatTotal:C},w=gd(j.sellerName,j.vatRegistrationNumber,j.invoiceTimestamp,j.invoiceTotal,j.invoiceVatTotal.toFixed(2));return s.jsx(ei,{value:w,renderAs:"canvas",size:250})},J=g=>{const d=[];return(g.totalBalanceAmt||g.refundAmt||g.writeOffAmt||g.rewardAmt||g.cashCard)&&(d.push(s.jsx("hr",{})),g.rewardAmt&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"REWARDS:"}),s.jsx("span",{children:le(g.rewardAmt,i)})]})),g.totalBalanceAmt&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"OUTSTANDING AMOUNT:"}),s.jsx("span",{children:le(g.totalBalanceAmt,i)})]})),g.writeOffAmt&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"WRITE OFF AMOUNT:"}),s.jsx("span",{children:le(g.writeOffAmt,i)})]})),g.refundAmt&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"REFUND AMOUNT:"}),s.jsx("span",{children:le(g.refundAmt,i)})]})),g.cashCard&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"CASH CARD:"}),s.jsx("span",{children:le(g.cashCard,i)})]}))),d},re=(g,d)=>{if(d&&d.length){for(let C=0;C<d.length;C++)if(d[C].slugName===g)return d[C]}return!1},te=(g,d)=>{if(d&&d.length){for(let C=0;C<d.length;C++)if(d[C].itemType===g)return d[C]}return!1},de=new Object({CREDIT:"Other Income",DEBIT:"Expense"}),be=g=>g.discountType==="COMPLIMENTARY"?"@ COMPLIMENTARY":g.discountType==="NON_CHARGEABLE"?"@ NON CHARGEABLE":`@ ${g.discountValue}${Mh[g.discountType]}`,Z=g=>{const d=new Array;if(g&&Object.keys(g).length!==0){d.push(s.jsx("h4",{className:"single-entity-and-center",children:"ACCOUNTS"}));for(const C in g)if(d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:`Total ${de[C]}:`}),s.jsx("span",{children:le(g[C].total,i)})]})),C&&Object.keys(C).length!==0)for(const j in g[C])j!=="total"&&g[C][j]&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- ${Ve(j)}:`}),s.jsx("span",{children:le(g[C][j],i)})]}))}return d},X=(g,d)=>{let C=!1;g.totalValue&&(C=Object.keys(g.totalValue).length>1);let j=new Object;return s.jsxs(s.Fragment,{children:[g.totalValue&&Object.keys(g.totalValue).map(Y=>{if(j=g.totalValue[Y],Y==="GST")return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.qty}}),s.jsx("h4",{className:`items products-heading-rate ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.rate}}),s.jsx("h4",{className:`items products-heading-amt ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList&&g.itemList.length&&g.itemList.length>0&&g.itemList.map(b=>{if(b.taxType===Y||!b.taxType)return s.jsxs("div",{style:b.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,style:{fontWeight:"lighter",lineHeight:1.2},children:[b.status==="RETURNED"?"(R) ":"",b.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[c].dynamicClassname}`,style:{fontWeight:"lighter"},children:[b.status==="RETURNED"?"-":"",b.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${L[c].dynamicClassname}`,style:{fontWeight:"lighter"},children:b.rate?y(b.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[c].dynamicClassname}`,style:{fontWeight:"lighter"},children:b.status==="RETURNED"?b.serviceAmount?p(b.serviceAmount):"":b.price?p(b.price):""})]}),b.addons&&b.addons.length&&b.addons.map(F=>s.jsx("h6",{className:`items products-heading-addon-kot ${L[c].dynamicClassname}`,children:"- "+Ve(F.serviceName)})),b.instruction&&g.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+b.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[c].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.subtotal}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.gstTTL)})]}),o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):"",j&&j.cat&&Object.keys(j.cat).length>0?Object.keys(j.cat).map(b=>{const F=re(b,g.discArr);if(F&&j.cat[b]!==0&&F.serviceName)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:d[`disc_${F.serviceName.toLowerCase()}`]??"DISC-"+F.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+F.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.cat[b])})]})}):"",g.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(b=>{const F=te(b,g.itemTypeDiscObj);if(F&&j.itemTypes[b]!==0&&F.itemType&&F.value)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:d[`disc_${F.itemType.toLowerCase()}`]??"DISC-"+F.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+F.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.itemTypes[b])})]})}):"",g.segMentDisc&&j&&j.segDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:d[`segment_disc${g.segMentObj.segmentName.toLowerCase()}`]??g.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+g.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.segDisc)})]}):"",j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:g.couponCode?d.coupon_disc??"COUPON DISC":d.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[g.couponCode?`(${g.couponCode.toUpperCase()})`:"",p(g.dicsEnterValue)?`@${g.dicsEnterValue}${g.discountType=="RELATIVE"||g.discountType=="COMPLIMENTARY"||g.discountType=="NON_CHARGEABLE"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.orderDisc)})]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:["  ",g.couponCode?"COUPON DISC":"خصم الطلب",g.couponCode?`(${g.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(b=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d[`charges_${b.name.toLowerCase()}`]??b.name}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b.amt)})]})})):"",j&&j.aftDisc&&j.gstTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.aftDisc)})]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.aftDisc&&j.gstTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",g.taxObj&&g.taxObj[Y]&&j?s.jsx(s.Fragment,{children:Y==="GST"?g.taxObj[Y].map(b=>{let F=new Array;for(const V in b)if(b[V]&&b[V]!=0){let fe=V/2;F.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d.cgst}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V]/2)})]})]}))}return F}):g.taxObj[Y].map(b=>{let F=new Array;for(const V in b)if(b[V]&&b[V]!=0){let fe=V;F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d.vat}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V])})]})}))}return F})}):"",j.gstTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.total}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p((j.total||0)+(j.aftDisc||0)+j.taxOnCharges)})]}),o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j.gstTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع"}),s.jsx("h5",{className:"actual-qty"})]}),g.totalValue&&(Object.keys(g.totalValue).length||0)>1?s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}):"",C&&s.jsx("div",{className:"space-2rem"})]})]})}),g.totalValue&&Object.keys(g.totalValue).map(Y=>{if(j=g.totalValue[Y],Y==="VAT")return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.item_name}}),s.jsx("h6",{className:`items products-heading-qty ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.qty}}),s.jsx("h6",{className:`items products-heading-rate ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.rate}}),s.jsx("h6",{className:`items products-heading-amt ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList&&g.itemList.length&&g.itemList.length>0&&g.itemList.map(b=>{if(b.taxType===Y)return s.jsxs("div",{style:b.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,children:[b.status==="RETURNED"?"(R) ":"",b.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[c].dynamicClassname}`,children:[b.status==="RETURNED"?"-":"",b.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${L[c].dynamicClassname}`,children:b.rate?y(b.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[c].dynamicClassname}`,children:b.status==="RETURNED"?b.serviceAmount?p(b.serviceAmount):"":b.price?p(b.price):""})]}),b.addons&&b.addons.length&&b.addons.map(F=>s.jsx("h6",{className:`items products-heading-addon-kot ${L[c].dynamicClassname}`,children:"- "+Ve(F.serviceName)})),b.instruction&&g.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+b.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[c].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.subtotal}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.vatTTL)})]}),o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):"",j&&j.cat&&Object.keys(j.cat).length>0?Object.keys(j.cat).map(b=>{const F=re(b,g.discArr);if(F&&j.cat[b]!==0&&F.serviceName)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:d[`disc_${F.serviceName.toLowerCase()}`]??"DISC-"+F.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+F.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.cat[b])})]})}):"",g.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(b=>{const F=te(b,g.itemTypeDiscObj);if(F&&j.itemTypes[b]!==0&&F.itemType&&F.value)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:d[`disc_${F.itemType.toLowerCase()}`]??"DISC-"+F.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+F.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.itemTypes[b])})]})}):"",g.segMentDisc&&j&&j.segDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:d[`segment_disc${g.segMentObj.segmentName.toLowerCase()}`]??g.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+g.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.segDisc)})]}):"",j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:g.couponCode?d.coupon_disc??"COUPON DISC":d.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[g.couponCode?`(${g.couponCode.toUpperCase()})`:"",p(g.dicsEnterValue)?`@${g.dicsEnterValue}${g.discountType=="RELATIVE"||g.discountType=="COMPLIMENTARY"||g.discountType=="NON_CHARGEABLE"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.orderDisc)})]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:["  ",g.couponCode?"COUPON DISC":"خصم الطلب",g.couponCode?`(${g.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(b=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d[`charges_${b.name.toLowerCase()}`]??b.name}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b.amt)})]})})):"",j&&j.aftDisc&&j.vatTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.aftDisc)})]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.aftDisc&&j.vatTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(b=>s.jsx(s.Fragment,{children:b.taxOnAmount&&b.taxOnAmount!=0?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d.cgst}}),s.jsx("span",{children:" @"+b.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b.taxOnAmount/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+b.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b.taxOnAmount/2)})]})]}):""})):"",g.taxObj&&g.taxObj[Y]&&j?s.jsx(s.Fragment,{children:Y==="GST"?g.taxObj[Y].map(b=>{let F=new Array;for(const V in b)if(b[V]&&b[V]!=0){let fe=V/2;F.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d.cgst}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V]/2)})]})]}))}return F}):g.taxObj[Y].map(b=>{let F=new Array;for(const V in b)if(b[V]&&b[V]!=0){let fe=V;F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d.vat}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V])})]})}))}return F})}):"",j.vatTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.total}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p((j.total||0)+(j.aftDisc||0)+j.taxOnCharges)})]}),o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j.vatTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع"}),s.jsx("h5",{className:"actual-qty"})]})]})]})})]})},q=(g,d,{labels:C,doMultipleTax:j,type:w})=>{var b,F,V,fe,Me,Le,Ce,Ye,Qe,gt,Rt;const Y=g.discounts;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.qty}}),s.jsx("h4",{className:`items products-heading-rate ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.rate}}),s.jsx("h4",{className:`items products-heading-amt ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList.map(Q=>{var St;return s.jsxs("div",{style:Q.serviceName.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,style:{lineHeight:1.2},children:[Q.status==="RETURNED"?"(R) ":"",Q.serviceName.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[c].dynamicClassname}`,children:[Q.status==="RETURNED"?"-":"",Q.qty]}),s.jsx("h6",{className:`items products-heading-rate ${L[c].dynamicClassname}`,children:Q.serviceRate?y(Q.serviceRate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[c].dynamicClassname}`,children:Q.sub_total?p(Q.sub_total):""})]}),Q.hsnCode&&d.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",Q.hsnCode]}),(St=Q.addons)!=null&&St.length?Q.addons.map(rt=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,style:{lineHeight:1.2},children:"+ "+Ve(rt.serviceName)}),s.jsxs("h6",{className:`items products-heading-qty ${L[c].dynamicClassname}`,children:[Q.status==="RETURNED"?"-":"",rt.qty*Q.qty]}),s.jsx("h6",{className:`items products-heading-rate ${L[c].dynamicClassname}`}),s.jsx("h6",{className:`items products-heading-amt ${L[c].dynamicClassname}`})]}),s.jsx("div",{children:rt.hsnCode&&d.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",rt.hsnCode]})})]})):"",Q.instruction&&d.itemInstructionOnBill?s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+Q.instruction+")"})}):""]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[c].dynamicClassname} ${_e}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.subtotal}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(g.subTotal)})]}),o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):""]}),(b=Y.DISCOUNT_ITEMS)!=null&&b.length?Y.DISCOUNT_ITEMS.map(Q=>s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${Q.discountName.toLowerCase()}`]??"DISC-"+Q.discountName.toUpperCase()}}),s.jsx("span",{children:be(Q)})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.discountAmt)})]})):"",(F=Y.CATEGORY_DISCOUNT)!=null&&F.length?Y.CATEGORY_DISCOUNT.map(Q=>s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${Q.discountName.toLowerCase()}`]??"DISC-"+Q.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+Q.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.discountAmt)})]})):"",(V=Y.ITEM_DISCOUNT)!=null&&V.length?Y.ITEM_DISCOUNT.map(Q=>s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${Q.discountName.toLowerCase()}`]??"DISC-"+ts(Q.discountName).toUpperCase()}}),s.jsx("span",{children:" @"+Q.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.discountAmt)})]})):"",(Me=(fe=Y.SEGMENT_DISCOUNT)==null?void 0:fe[0])!=null&&Me.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`segment_disc${Y.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+Y.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),":",s.jsx("span",{children:" @"+Y.SEGMENT_DISCOUNT[0].discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Y.SEGMENT_DISCOUNT[0].discountAmt)})]}):"",(Ce=(Le=Y.COUPON_DISCOUNT)==null?void 0:Le[0])!=null&&Ce.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:"COUPON DISC"}}),":",s.jsx("span",{children:`(${Y.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${Y.COUPON_DISCOUNT[0].discountValue}${Y.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Y.COUPON_DISCOUNT[0].discountAmt)})]}):"",(Qe=(Ye=Y.ORDER_DISCOUNT)==null?void 0:Ye[0])!=null&&Qe.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C.order_disc??"ORDER DISC"}}),":",s.jsx("span",{children:p(Y.ORDER_DISCOUNT[0].discountValue)?`@${Y.ORDER_DISCOUNT[0].discountValue}${Y.ORDER_DISCOUNT[0].discountType=="RELATIVE"||Y.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"||Y.ORDER_DISCOUNT[0].discountType=="NON_CHARGEABLE"?"%":"AMT"}`:""})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Y.ORDER_DISCOUNT[0].discountAmt)})]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&g&&g.orderDisc?s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsxs("h5",{className:"total-qty",children:["  ",d.couponCode?"COUPON DISC":"خصم الطلب",d.couponCode?`(${d.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",(gt=g.charges)!=null&&gt.length?g.charges.map(Q=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:C[`charges_${Q.name.toLowerCase()}`]??Q.name}})}),d.invoiceType=="INCLUSIVE_SIMPLIFIED"?s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.amt+Q.taxAmt)}):s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.amt)})]})})):"",g.subTotal!==g.afterCharges&&g.afterCharges!==g.total&&d.invoiceType!=="INCLUSIVE_SIMPLIFIED"?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(g.afterCharges)})]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&g.subTotal!==g.afterCharges?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",d.invoiceType!=="INCLUSIVE_SIMPLIFIED"&&((Rt=g.taxation)!=null&&Rt.length)?g.taxation.map(Q=>{if(Q.taxAmt)return Q.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.cgst}}),s.jsx("span",{children:"@"+Q.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.taxAmt/2)})]}),s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C[d.taxLabel.toLowerCase()]}}),s.jsx("span",{children:"@"+Q.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.taxAmt/2)})]})]}):s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.vat}}),s.jsx("span",{children:"@"+Q.tax+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.taxAmt)})]})}):"",s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.total}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(g.total)})]}),j?s.jsx(s.Fragment,{children:w==="GST"?s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}),s.jsx("div",{className:"space-2rem"})]}):""}):""]})},ue=(g,d)=>{var Y,b;let C=!1;const j=g.distributedData;return g.distributedData&&(C=Object.keys(g.distributedData).length>1),s.jsxs(s.Fragment,{children:[((Y=j.GST)==null?void 0:Y.itemList)&&q(j.GST,g,{labels:d,doMultipleTax:C,type:"GST"}),((b=j.VAT)==null?void 0:b.itemList)&&q(j.VAT,g,{labels:d,doMultipleTax:C,type:"VAT"})]})},z=g=>{const d=g.services,C=Object.keys(g.services),j=C.length;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${_e}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:L[c].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",children:[j&&C.map((Y,b)=>s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"left-align-entity level3-bold",children:s.jsxs("u",{children:[Y.toUpperCase(),":"]})}),d[Y].map(F=>{var V;return s.jsxs("div",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name-kot ${L[c].dynamicClassname}`,children:Ve(F.serviceName)}),s.jsx("h4",{className:`items products-heading-qty-kot ${L[c].dynamicClassname}`,children:F.qty})]}),((V=F.addons)==null?void 0:V.length)&&F.addons.map(fe=>{var Me;return s.jsx("h5",{className:"items products-heading-addon-kot",children:"- "+((Me=fe.serviceName)==null?void 0:Me.toUpperCase())})}),F.instruction&&s.jsx("h5",{className:"left-align-entity",children:s.jsx("h5",{className:"items products-heading-addon-kot",children:" ("+F.instruction+")"})})]})}),j!==b+1&&s.jsx("br",{})]})),s.jsx("hr",{})]})]})},ee=g=>{const d=g.slice(0,-4),C=g.slice(-4);return{firstDigits:d,last4Dgits:C}},De=(g,d,C,j={})=>{const w=Object.keys(d??{});let Y=[],b,F="flex-two-items";if(j.action==="addCharges"&&(F="display-percentage"),g&&w.length){Y.push(s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",children:`${C.toUpperCase()} BREAK-UP`}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Total ",C,":"]}),s.jsx("span",{children:le(g,i)})]})]}));for(let V=0;V<w.length;V++)b=w[V],d[b]&&Y.push(s.jsxs("h5",{className:`left-align-entity level3-bold ${F} second-span-right`,children:[s.jsx("span",{children:` -- ${b.replaceAll("_"," ")}:`}),s.jsx("span",{children:le(d[b],i)}),j.action==="addCharges"?s.jsx("span",{children:p(gs(g,d[b]))+"%"}):""]}));Y.push(s.jsx("hr",{}))}return Y},nt=g=>{const d=Object.keys(g.Category),C=Object.keys(g.Addon);let j=new Array;return j.push(s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"left-align-entity level3-bold",children:"Product Category"}),s.jsx("hr",{className:"dashed"})]})),d.forEach((w,Y)=>{const b=g.Category[w];let F=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ts(w)]}),s.jsxs("section",{className:"products-section",children:[b.forEach(V=>{F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${L["3INCH"].dynamicClassname}`,children:V.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${L["3INCH"].dynamicClassname}`,children:parseFloat(V.qty.toFixed(2))})]})}))}),F,Y!=d.length-1&&s.jsx("hr",{})]})]}))}),C.length>0&&(j.push(s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsx("h3",{className:"left-align-entity level3-bold",children:"Addon Category"}),s.jsx("hr",{className:"dashed"})]})),C.forEach((w,Y)=>{const b=g.Addon[w];let F=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ts(w)]}),s.jsxs("section",{className:"products-section",children:[b.forEach(V=>{F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${L["3INCH"].dynamicClassname}`,children:V.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${L["3INCH"].dynamicClassname}`,children:parseFloat(V.qty.toFixed(2))})]})}))}),F,Y!=C.length-1&&s.jsx("hr",{className:"dashed"})]})]}))})),j},At=g=>{var C;const d={company_mobile:"Mob",company_Email:"Email",company_GST:"GST",company_VAT:"VAT",company_FSSAI:"FSSAI",name:"Name",mobile:"Mobile",address:"Address",email:"Email",token_no:"Token No",order_no:"Order No",date:"Date",delivery_date:"Delivery Date",item_name:"Item Name",qty:"Qty",rate:"Rate",amt:"Amt",subtotal:"SUB TOTAL",order_disc:"ORDER DISC",coupon_disc:"COUPON DISC",complementary_disc:"COMPLIMENTARY BILL",nonChargeable_disc:"NON CHARGEABLE BILL",amt_before_tax:"AMT BEFORE TAX",total:"TOTAL",grand_total:"GRAND TOTAL",reward_point_balance:"REWARD POINT BALANCE",balance_amt:"BALANCE AMOUNT",rewards_redeemed:"REWARDS REDEEMED",vat:"VAT",sgst:"SGST",cgst:"CGST",utgst:"UTGST",igst:"IGST",previous_outstanding:"PREVIOUS OUTSTANDING",total_payable:"TOTAL PAYABLE",delivery_code:"Delivery Code",online_order_id:"Online Order ID",area_name:"Area Name",table_name:"Table Name",captain_name:"Captain Name"};if((C=g==null?void 0:g.customBillLabels)!=null&&C.length){let j;for(let w=0;w<g.customBillLabels.length;w++)j=g.customBillLabels[w],d[j.defaultName]=j.displayName}return d},pt=(g,d,C,j)=>{var V,fe,Me,Le,Ce,Ye,Qe,gt,Rt,Q,St,rt,xs,an,Ns,js,ln,on,cn,dn,hn,un,mn,Qt,vs,xt,Zt,Jt,_s,fn,bs,pn,Ss,Ts,yn,gn,ws,Is,xn,Nn,jn,vn,x,O,U;const w=At(l.customLabelsMap),Y=ms(Nd(l.paymentModes),"internalName"),b=P=>{var N;return(N=Y[P])!=null&&N.displayName?Y[P].displayName.toUpperCase():P};if(g==="BILL"){let P;if(c==="A4"||c==="A5"){let N={...d},H=0,W=N.distributedData;const A=W.discounts;P=s.jsx("div",{className:`invoiceContainer main-div ${L[c].dynamicClassname}`,children:s.jsxs("div",{id:"page-wrap",children:[s.jsx("table",{width:"100%",className:"custom-table custom-table-bordered",children:s.jsxs("tbody",{children:[s.jsxs("tr",{children:[s.jsxs("td",{colSpan:9,children:[s.jsx("tr",{className:"subtotalTr",children:s.jsx("td",{colSpan:12,style:{borderBottom:"1px solid black",width:"100%"},children:s.jsx("h5",{children:s.jsxs("strong",{children:[N.companyInfo.companyName,":"]})})})}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${w.order_no}:`},className:"font-weight-bold"}),s.jsx("span",{children:N.orderId})]}),s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${w.date}:`},className:"font-weight-bold"}),s.jsx("span",{children:N.orderInfo.orderDate})]})]})]}),s.jsx("td",{colSpan:3,className:"text-right",children:s.jsx("div",{className:"d-flex justify-content-center",children:C&&s.jsx("img",{src:C,width:90})})})]}),s.jsx("tr",{children:s.jsx("td",{colSpan:12,className:"text-center border-right",style:{padding:"0px 1.4rem"},children:s.jsx("h6",{children:s.jsx("strong",{children:"Tax Invoice"})})})}),s.jsxs("tr",{children:[s.jsx("td",{colSpan:6,className:"v-align-baseline col-6",children:s.jsxs("div",{className:"divPadding",children:[(N.customerInfo.custName||((V=N.customFields)==null?void 0:V.length))&&s.jsx("tr",{children:s.jsx("td",{colSpan:"2",className:"text-center border-right",children:s.jsx("strong",{children:"Bill To"})})}),N.customerInfo.custName&&N.customerInfo.custName!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.customerInfo.custName})}),N.customerInfo.custContact&&N.customerInfo.custContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.customerInfo.custContact})}),N.customerInfo.custAddress&&N.customerInfo.custAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.customerInfo.custAddress})}),N.deliveryTimestamp&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.deliveryTimestamp})}),(fe=N.customFields)!=null&&fe.length?N.customFields.map(I=>s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[I.customName,": ",I.customValue]})})):""]})}),s.jsx("td",{colSpan:6,className:"v-align-baseline",children:s.jsxs("div",{className:"divPadding",children:[s.jsx("tr",{children:s.jsx("td",{colSpan:"2",className:"text-center border-right",children:s.jsx("strong",{children:"Bill From"})})}),s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.companyInfo.companyName})}),N.companyInfo.companyAddress&&N.companyInfo.companyAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.companyInfo.companyAddress})}),N.companyInfo.companyEmail&&N.companyInfo.companyEmail!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.companyInfo.companyEmail})}),N.companyInfo.companyContact&&N.companyInfo.companyContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.companyInfo.companyContact})}),N.fssai&&N.fssai!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${w.company_FSSAI}:`}}),s.jsx("span",{children:N.fssai})]})}),N.gst&&N.gst!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${w.company_GST}:`}}),s.jsx("span",{children:N.gst})]})}),N.vatNo&&N.vatNo!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${w.company_VAT}:`}}),s.jsx("span",{children:N.vatNo})]})})]})})]}),s.jsx("tr",{children:s.jsx("td",{colSpan:12,children:s.jsxs("table",{width:"100%",className:"custom-table productTable ",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-right",style:{lineHeight:"10px"},children:[s.jsx("th",{className:"text-align-left",children:"Sr No"}),s.jsx("th",{className:"text-align-left",style:{width:"40%"},children:"Item Name"}),s.jsx("th",{className:"text-align-left",children:"Quantity"}),s.jsx("th",{className:"text-align-right",children:"Price/Unit"}),s.jsx("th",{className:"text-align-right",children:"Amount"})]})}),s.jsxs("tbody",{children:[N.itemList.map(I=>{var Ae;let he="",Ne=[];return H++,Ne.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:he,children:[s.jsx("td",{className:"text-align-left",children:I.serviceRate?H:""}),s.jsx("td",{style:{width:"40%"},className:"text-align-left",children:I.serviceName.toUpperCase()}),s.jsx("td",{className:"text-align-left",children:I.qty}),s.jsx("td",{className:"text-align-right",children:I.serviceRate?G(I.serviceRate,i):""}),s.jsx("td",{className:"text-align-right",children:I.sub_total?G(I.sub_total,i):""})]}),I.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+I.instruction+")"})]})]})),(Ae=I.addons)!=null&&Ae.length&&I.addons.map(Ze=>{Ne.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:"fs-8",children:[s.jsx("td",{}),s.jsxs("td",{style:{width:"40%"},children:["+ ",Ze.serviceName.toUpperCase()]}),s.jsx("td",{children:Ze.qty*I.qty})]}),Ze.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+Ze.instruction+")"})]})]}))}),Ne}),s.jsx("tr",{style:{lineHeight:"10px",fontSize:"14px"},children:s.jsx("td",{colSpan:5,children:s.jsx("strong",{className:"font-weight-bold",children:`Total ${H} Items and ${ve(W.qty)} Quantity`})})})]})]})})}),s.jsxs("tr",{className:"avoid-page-break",children:[s.jsx("td",{colSpan:6,style:{verticalAlign:"top"},children:s.jsx("div",{children:s.jsxs("div",{width:"100%",children:[s.jsx("tr",{children:s.jsxs("td",{colSpan:"2",children:[s.jsx("strong",{className:"font-weight-bold",children:"Amount in words"}),s.jsx("br",{}),pd(Oe(N.finalAmount,i).toFixed(Wt[i].minimumFractionDigits??2))]})}),s.jsx("hr",{}),N.upiId&&d.companyInfo.companyName&&d.paymentStatus!=="PAID"&&(!d.splitDetails||d.splitDetails&&((Me=d.splitDetails)==null?void 0:Me.length)==0)(s.jsxs(s.Fragment,{children:[s.jsx("tr",{children:s.jsx("td",{width:"50%",className:"font-weight-bold",children:"Scan To Pay"})}),s.jsx("tr",{children:s.jsx("td",{width:"50%",children:s.jsx("div",{className:"image-bill",children:$(d.upiId,d.orderId,d.companyInfo.companyName,d.paidAmt,{size:100})})})})]})),N.footerMessage?s.jsx("tr",{children:s.jsx("td",{colSpan:"2",children:s.jsx("div",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:N.footerMessage}})})}):""]})})}),s.jsx("td",{colSpan:6,style:{verticalAlign:"top"},children:s.jsx(s.Fragment,{children:s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:w.subtotal}})})}),s.jsx("td",{width:"50%",className:"text-align-right",children:G(W.subTotal,i)})]}),(Le=A==null?void 0:A.DISCOUNT_ITEMS)!=null&&Le.length?A.DISCOUNT_ITEMS.map(I=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w[`disc_${I.discountName.toLowerCase()}`]??"DISC-"+I.discountName.toUpperCase()}}),s.jsx("span",{children:be(I)})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.discountAmt,i)})]})):"",(Ce=A==null?void 0:A.CATEGORY_DISCOUNT)!=null&&Ce.length?A.CATEGORY_DISCOUNT.map(I=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w[`disc_${I.discountName.toLowerCase()}`]??"DISC-"+I.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+I.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.discountAmt,i)})]})):"",(Ye=A==null?void 0:A.ITEM_DISCOUNT)!=null&&Ye.length?A.ITEM_DISCOUNT.map(I=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w[`disc_${I.discountName.toLowerCase()}`]??"DISC-"+I.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+I.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.discountAmt,i)})]})):"",(gt=(Qe=A==null?void 0:A.SEGMENT_DISCOUNT)==null?void 0:Qe[0])!=null&&gt.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w[`segment_disc${A.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+A.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),s.jsx("span",{children:" @"+A.SEGMENT_DISCOUNT[0].discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(A.SEGMENT_DISCOUNT[0].discountAmt,i)})]}):"",(Q=(Rt=A==null?void 0:A.COUPON_DISCOUNT)==null?void 0:Rt[0])!=null&&Q.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:"COUPON DISC"}}),s.jsx("span",{children:`(${A.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${A.COUPON_DISCOUNT[0].discountValue}${A.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(A.COUPON_DISCOUNT[0].discountAmt,i)})]}):"",(rt=(St=A==null?void 0:A.ORDER_DISCOUNT)==null?void 0:St[0])!=null&&rt.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w.order_disc??"ORDER DISC"}}),s.jsx("span",{children:p(A.ORDER_DISCOUNT[0].discountValue)?`@${A.ORDER_DISCOUNT[0].discountValue}${A.ORDER_DISCOUNT[0].discountType=="RELATIVE"||A.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"||A.ORDER_DISCOUNT[0].discountType=="NON_CHARGEABLE"?"%":"AMT"}`:""})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(A.ORDER_DISCOUNT[0].discountAmt,i)})]}):"",(xs=W.charges)!=null&&xs.length?W.charges.map(I=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w[`charges_${I.name.toLowerCase()}`]??I.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.amt,i)})]})):"",W.subTotal!==W.afterCharges?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w.amt_before_tax}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(W.afterCharges,i)})]}):"",(an=W.taxation)!=null&&an.length?W.taxation.map(I=>I.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.cgst}}),s.jsx("span",{children:" @"+I.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.taxAmt/2,i)})]}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.sgst}}),s.jsx("span",{children:" @"+I.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.taxAmt/2,i)})]})]}):s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.vat}}),s.jsx("span",{children:" @"+I.tax+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.taxAmt,i)})]})):"",s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:w.grand_total}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(N.finalAmount,i)})]}),(Ns=d==null?void 0:d.custoutStandingData)!=null&&Ns.balanceAmt?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w.previous_outstanding}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G((js=N==null?void 0:N.custoutStandingData)==null?void 0:js.balanceAmt,i)})]}),s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:w.total_payable}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(N.grandTotal+((ln=N==null?void 0:N.custoutStandingData)==null?void 0:ln.balanceAmt),i)})]})]}):"",N.rewardAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w.rewards_redeemed}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(N.rewardAmt,i)})]}):"",(on=d.paymentMethods)!=null&&on.length?d.paymentMethods.map(I=>{var he;if(I.paidAmt)return s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:["-"," ",s.jsx("span",{dangerouslySetInnerHTML:{__html:w[`${(he=I.paymentMode)==null?void 0:he.toLowerCase()}`]??b(I.paymentMode)??"CASH"}}),s.jsx("span",{children:I.isRefund?"(Refund)":""})]}),I.isRefund?s.jsx("td",{className:"text-align-right",width:"50%",children:"("+G(I.paidAmt,i)+")"}):s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.paidAmt,i)})]})}):"",N.balanceAmt&&d.balanceAmt!=0?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w.balance_amt}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(d.balanceAmt,i)})]}):"",d.balPoint&&!Number.isNaN(d.balPoint)?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w.reward_point_balance}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:d.balPoint})]}):"",(cn=d.splitDetails)!=null&&cn.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{marginTop:"6px"},children:s.jsx("h7",{className:"level2-bold",children:"Split Bill by Guest Details:"})}),d.splitDetails.map(I=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:d.curr+" "+I.amount})]}))]}):"",s.jsx("tr",{className:"subtotalTr",children:s.jsxs("td",{className:"text-center",width:"100%",children:[s.jsx("hr",{}),s.jsx("strong",{children:"Authorised Signatory"})]})}),s.jsx("tr",{className:"subtotalTr",children:s.jsx("td",{colSpan:2,width:"50%",children:s.jsx("div",{className:"p-4"})})})]})})})]})]})}),s.jsx("p",{className:"single-entity-and-center f-12 mt-2 avoid-page-break",style:{marginTop:"10px"},children:`Printed By :${N.printby} Printed On: ${N.printTime}`}),N.disabledPoweredBy?"":s.jsx("p",{className:"single-entity-and-center f-12 mt-2 avoid-page-break",children:"Powered By: www.recaho.com"})]})})}else P=s.jsx("div",{className:"main-div bill",style:{width:L[c].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[d.duplicateBill?s.jsx("h4",{className:"single-entity-and-center",children:"DUPLICATE BILL"}):"",s.jsx("br",{}),C&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:C,className:"single-entity-and-center",style:{width:L[c].logoWidth}})}),s.jsxs("div",{className:`details-section ${L[c].dynamicClassname}`,children:[!C&&d.companyInfo.companyName&&d.companyInfo.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:d.companyInfo.companyName}),d.companyInfo.companyAddress&&d.companyInfo.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:d.companyInfo.companyAddress}}),d.companyInfo.companyContact&&d.companyInfo.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.company_mobile}}),": ",s.jsx("span",{children:d.companyInfo.companyContact})]})}),d.companyInfo.companyEmail&&d.companyInfo.companyEmail!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.company_Email}}),": ",s.jsx("span",{children:d.companyInfo.companyEmail})]})}),d.fssai&&d.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.company_FSSAI}}),": ",s.jsx("span",{children:d.fssai})]})}),d.gst&&d.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.company_GST}}),": ",s.jsx("span",{children:d.gst})]})}),d.vatNo&&d.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.company_VAT}}),": ",s.jsx("span",{children:d.vatNo})]})}),s.jsx("hr",{}),d.orderFrom&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:d.menuDisplayName?d.menuDisplayName:d.orderFrom}),d.area&&s.jsxs("h3",{className:"single-entity-and-center level2-bold",children:[d.area," : ",d.tableName?d.tableName:d.tableNo]}),d.tokenId&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.token_no}})," ",s.jsx("span",{children:d.tokenId})]})}),d.parentOrderRef&&s.jsx("h4",{className:"single-entity-and-center",children:"RETURN/EXCHANGE"})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${L[c].dynamicClassname} ${_e}`,children:[d.customerInfo.custName&&d.customerInfo.custName!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.name}}),": ",s.jsx("span",{children:d.customerInfo.custName})]})}),d.customerInfo.custContact&&d.customerInfo.custContact!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.mobile}}),": ",s.jsx("span",{children:d.customerInfo.custContact})]})}),d.customerInfo.custAddress&&d.customerInfo.custAddress!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.address}}),": ",s.jsx("span",{children:d.customerInfo.custAddress})]})}),ft(d.appliedDiscounts??[],"COMPLIMENTARY","discountType").discountType&&s.jsx("h5",{className:"left-align-entity level2-bold",dangerouslySetInnerHTML:{__html:w.complementary_disc}}),ft(d.appliedDiscounts??[],"NON_CHARGEABLE","discountType").discountType&&s.jsx("h5",{className:"left-align-entity level2-bold",dangerouslySetInnerHTML:{__html:w.nonChargeable_disc}}),d.orderId&&s.jsx("h5",{className:"left-align-entity",style:{flexShrink:0},children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.order_no}}),": ",s.jsx("span",{children:d.orderId})]})}),d.orderInfo.orderDate&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.date}}),":",s.jsx("span",{children:d.orderInfo.orderDate})]})}),d.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.delivery_date}}),":",s.jsx("span",{children:d.deliveryTimestamp})]})}),d.captainName&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.captain_name}}),":",s.jsx("span",{children:d.captainName})]})})]}),(dn=d.customFields)!=null&&dn.length?s.jsxs("div",{className:`details-section ${L[c].dynamicClassname}`,children:[s.jsx("hr",{}),d.customFields.map(N=>s.jsx("h4",{className:"left-align-entity",children:N.customName+": "+N.customValue}))]}):"",d.newFormat?ue(d,w):X(d,w),s.jsx("br",{}),s.jsxs("div",{className:`bottom-section ${L[c].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:`total-qty ${(hn=d.custoutStandingData)!=null&&hn.balanceAmt||d.rewardAmt&&d.paymentMethods&&d.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:w.grand_total}}),s.jsx("h6",{className:`actual-qty ${(un=d.custoutStandingData)!=null&&un.balanceAmt||d.rewardAmt&&d.paymentMethods&&d.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+p(d.finalAmount)})]}),(mn=d.custoutStandingData)!=null&&mn.balanceAmt?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w.previous_outstanding}})}),s.jsx("h5",{children:d.curr+" "+p(d.custoutStandingData.balanceAmt)})]}),!d.rewardAmt&&!d.paymentMethods?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:w.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+p(d.finalAmount+d.custoutStandingData.balanceAmt)})]}):""]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.50rem":"1.75rem"},children:"المجموع الإجمالي"}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.40rem":"1.75rem"}})]}):"",d.rewardAmt?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsxs("h5",{children:["- ",s.jsx("span",{dangerouslySetInnerHTML:{__html:w.rewards_redeemed}}),s.jsx("span",{children:"("+d.usedPoints+" Points)"})]}),s.jsx("h5",{children:d.curr+" "+d.rewardAmt})]}):"",d.paymentMethods&&d.paymentMethods.length?d.paymentMethods.map(N=>{var H;if(N.paidAmt)return s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsxs("h5",{children:["-",s.jsx("span",{dangerouslySetInnerHTML:{__html:w[`${(H=N.paymentMode)==null?void 0:H.toLowerCase()}`]??b(N.paymentMode)??"CASH"}}),s.jsx("span",{children:N.isRefund?"(Refund)":""})]}),s.jsx("h5",{children:N.isRefund?s.jsx(s.Fragment,{children:d.curr+" ("+p(N.paidAmt)+")"}):s.jsx(s.Fragment,{children:d.curr+" "+p(N.paidAmt)})})]})}):"",d.rewardAmt&&!d.paymentMethods?s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:w.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+p(d.finalAmount+(((Qt=d==null?void 0:d.custoutStandingData)==null?void 0:Qt.balanceAmt)||0)-d.rewardAmt)})]})}):"",Oh((vs=d.convertedCurrValue)==null?void 0:vs.value)?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty"}),s.jsx("h5",{className:"actual-qty",children:`(${G(d.convertedCurrValue.value,d.convertedCurrValue.curr)})`})]}):"",d.balanceAmt&&d.balanceAmt!=0?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{dangerouslySetInnerHTML:{__html:w.balance_amt}}),s.jsx("h5",{children:d.curr+" "+p(d.balanceAmt)})]}):"",s.jsx("hr",{})]}),d.earnPoints&&d.paymentMethods&&!(n!=null&&n.hideRewardPoints)?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",children:"EARN POINTS"}),s.jsx("h6",{className:"actual-qty",children:d.earnPoints})]}):"",(d.balPoint||d.earnPoints)&&!Number.isNaN(d.balPoint||d.earnPoints)&&!(n!=null&&n.hideRewardPoints)?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",dangerouslySetInnerHTML:{__html:w.reward_point_balance}}),s.jsx("h6",{className:"actual-qty",children:d.balPoint+d.earnPoints||0})]}):"",(xt=d.splitDetails)!=null&&xt.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{marginTop:"6px"},children:s.jsx("h5",{className:"level2-bold",children:"Split Bill by Guest Details:"})}),d.splitDetails.map(N=>s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty line-gaps level3-bold",dangerouslySetInnerHTML:{__html:N.name}}),s.jsx("h5",{className:"actual-qty level3-bold",children:d.curr+" "+N.amount})]}))]}):"",d.invoiceType==="INCLUSIVE_SIMPLIFIED"&&((Zt=d.taxation)!=null&&Zt.length)?s.jsxs("div",{children:[s.jsx("div",{className:"single-entity-and-center",style:{marginTop:"6px"},children:s.jsx("h6",{className:"level2-bold",children:"Tax Summary"})}),s.jsx("div",{className:"single-entity-and-center",style:{marginTop:"6px"},children:s.jsxs("table",{border:"1",style:{textAlign:"center",margin:"0 auto",marginBottom:"6px",width:"100%"},children:[s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("th",{children:"Tax Name"}),s.jsx("th",{children:"Taxable Amt"}),s.jsx("th",{children:"Tax Amt"})]}),d.taxation.map(N=>{if(N.taxAmt)return Mt==="Android OS"||Mt==="iOS"?N.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${w.cgst} ${N.tax/2}%`}}),s.jsx("th",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("th",{children:d.curr+" "+Oe(N.taxAmt/2,i)})]}),s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${w[d.taxLabel.toLowerCase()]} ${N.tax/2}%`}}),s.jsx("th",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("th",{children:d.curr+" "+Oe(N.taxAmt/2,i)})]})]}):s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${w.vat} ${N.tax}%`}}),s.jsx("th",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("th",{children:d.curr+" "+Oe(N.taxAmt,i)})]}):N.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${w.cgst} ${N.tax/2}%`}}),s.jsx("td",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("td",{children:d.curr+" "+Oe(N.taxAmt/2,i)})]}),s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${w[d.taxLabel.toLowerCase()]} ${N.tax/2}%`}}),s.jsx("td",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("td",{children:d.curr+" "+Oe(N.taxAmt/2,i)})]})]}):s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${w.vat} ${N.tax}%`}}),s.jsx("td",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("td",{children:d.curr+" "+Oe(N.taxAmt,i)})]})})]})})]}):"",d.upiId&&d.companyInfo.companyName&&(!d.splitDetails||d.splitDetails&&((Jt=d.splitDetails)==null?void 0:Jt.length)==0)&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan this QRCode to Pay"}),$(d.upiId,d.orderId,d.companyInfo.companyName,d.paidAmount)]}),d.curr==="SAR"&&l.vatNo&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan with ZATCA app for invoice details."}),k(l.vatNo,d)]}),j?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${j}`,className:"single-entity-and-center",style:{width:L[c].logoWidth}})}):"",d.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:d.footerMessage}}):"",d.printby&&d.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By:${d.printby}`}):"",d.printTime&&d.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On:${d.printTime}`}):"",d.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})});return P}else if(g==="PRINT_DASHBOARD"&&d.salesCollection){const P=d.salesCollection.totalDiscountAmt?gs(d.salesCollection.grandTotal,d.salesCollection.totalDiscountAmt):null,N=d.salesCollection.totalCollection-d.salesCollection.totalTax;var F=R().format("DD/MM/YYYY LT");const H=(_s=d.monthTillDateSalesColl)!=null&&_s.totalDiscountAmt?gs(d.monthTillDateSalesColl.grandTotal,d.monthTillDateSalesColl.totalDiscountAmt):null;return s.jsxs("div",{className:`main-div ${L[c].dynamicClassname}`,style:{width:L[c].paperSize},children:[s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("div",{children:[s.jsx("p",{className:"single-entity-and-left-align",children:`Printed On:- ${F}`}),s.jsx("br",{}),s.jsx("h1",{className:"single-entity-and-center level2-bold",children:"Sales Report"}),s.jsx("p",{className:"single-entity-and-center",children:d.selectedDate})]}),s.jsx("hr",{}),d.monthTillDateSalesColl?s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center flex-two-items",children:"MTD Sales Breakup"}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"Gross Sales:"}),s.jsx("span",{children:le(d.monthTillDateSalesColl.grandTotal,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${le(d.monthTillDateSalesColl.totalDiscountAmt,i)}${H?`(${p(H)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:le(d.monthTillDateSalesColl.totalOtherCharges,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:le(d.monthTillDateSalesColl.totalCollection-d.monthTillDateSalesColl.totalTax,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:le(d.monthTillDateSalesColl.totalTax,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:le(d.monthTillDateSalesColl.totalCollection,i)})]})]}),s.jsx("hr",{})]}):"",s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center flex-two-items",children:"SALES BREAK-UP"}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"Gross Sales:"}),s.jsx("span",{children:le(d.salesCollection.grandTotal,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${le(d.salesCollection.totalDiscountAmt,i)}${P?`(${p(P)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:le(d.salesCollection.totalOtherCharges,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:le(N,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:le(d.salesCollection.totalTax,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:le(d.salesCollection.totalCollection,i)})]})]}),s.jsx("hr",{}),De(d.otherFields.totalDiscountAmt,d.otherFields.discountList,"Discount",{action:"addCharges"}),De(d.otherFields.totalOtherCharges,d.otherFields.otherChargesList,"Charges"),De(d.otherFields.totalTax,d.otherFields.taxList,"Tax"),s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"BY BUSINESS"}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Sales:"}),s.jsx("span",{children:le(d.salesCollection.totalCollection,i)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Orders:"}),s.jsx("span",{children:d.salesCollection.totalOrders})]}),T(d)]}),s.jsx("hr",{}),d.otherFields.totalItemType?s.jsx("div",{children:De(d.otherFields.totalItemType,d.otherFields.itemTypeList,"Item Type",{action:"addCharges"})}):"",d.averageCollection.avgTableTime||d.averageCollection.avgorderValue||d.averageCollection.noOfGuest?s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"PERFORMANCE METRICS"}),d.averageCollection.avgTableTime?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Average ",l.customLabels.Table," Time:"]}),s.jsx("span",{children:d.averageCollection.avgTableTime})]}):"",d.averageCollection.avgorderValue?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Average Order Value:"}),s.jsx("span",{children:le(d.averageCollection.avgorderValue,i)})]}):"",d.averageCollection.noOfGuest?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Covers:"}),s.jsx("span",{children:d.averageCollection.noOfGuest})]}):"",d.averageCollection.avgPerCover?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Average Per Cover:"}),s.jsx("span",{children:le(d.averageCollection.avgPerCover,i)})]}):"",s.jsx("hr",{})]}):"",s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"BY PAYMENT CATEGORY"}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Collection:"}),s.jsx("span",{children:le(d.totalCollection,i)})]}),D(d)]}),J(d.averageCollection),d.otherFields.outstandingAmt?s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"BY PAYMENT STATUS"}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:" -- Sales:"}),s.jsx("span",{children:le(d.otherFields.salesCollection,i)})]}),d.otherFields.outstandingAmt?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:" -- Outstanding Payment Received:"}),s.jsx("span",{children:le(d.otherFields.outstandingAmt,i)})]}):""]})]}):"",s.jsx("hr",{}),Z(d.averageCollection.dailyExpanse)]}),s.jsx("br",{}),Mt=="Android OS"&&s.jsx("div",{className:"space-3rem"})]})}else if(g==="AGGREGATOR_BILL"){let P;return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(P=ee(a.aggregatorOrderId)),s.jsx("div",{className:"main-div bill",style:{width:L[c].paperSize},children:s.jsxs("div",{children:[s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),C&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:C,className:"single-entity-and-center",style:{width:L[c].logoWidth}})}),s.jsxs("div",{className:`details-section ${L[c].dynamicClassname}`,children:[!C&&a.companyInfo.companyName&&a.companyInfo.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:a.companyInfo.companyName}),a.companyInfo.companyAddress&&a.companyInfo.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.companyInfo.companyAddress}}),a.companyInfo.companyContact&&a.companyInfo.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.company_mobile}}),": ",s.jsx("span",{children:a.companyInfo.companyContact})]})}),a.companyInfo.companyEmail&&a.companyInfo.companyEmail!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.company_Email}}),": ",s.jsx("span",{children:a.companyInfo.companyEmail})]})}),a.fssai&&a.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.company_FSSAI}}),": ",s.jsx("span",{children:a.fssai})]})}),a.gst&&a.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.company_GST}}),": ",s.jsx("span",{children:a.gst})]})}),a.vatNo&&a.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.company_VAT}}),": ",s.jsx("span",{children:a.vatNo})]})}),a.orderFrom&&s.jsx("h3",{className:"single-entity-and-center level2-bold",children:a.menuDisplayName?a.menuDisplayName:a.orderFrom}),a.orderSource&&P&&s.jsxs("h4",{className:"single-entity-and-center",children:[`${a.orderSource}: ${P.firstDigits||""}`,s.jsxs("span",{style:{fontSize:"2rem"},children:["-",P.last4Dgits||""]})]}),a.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center",children:a.zomatoInstant}),a.otp&&a.otp!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.delivery_code}}),": ",s.jsx("span",{children:a.otp})]})}),a.tokenId&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.token_no}})," ",s.jsx("span",{children:a.tokenId})]})})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${L[c].dynamicClassname}`,children:[a.customerInfo.custName&&a.customerInfo.custName!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.name}}),": ",s.jsx("span",{children:a.customerInfo.custName})]})}),a.customerInfo.custContact&&a.customerInfo.custContact!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.mobile}}),": ",s.jsx("span",{children:a.customerInfo.custContact})]})}),a.customerInfo.custAddress&&a.customerInfo.custAddress!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.address}}),": ",s.jsx("span",{children:a.customerInfo.custAddress})]})}),s.jsxs("div",{className:"flex-two-items",children:[a.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",style:{flexShrink:0},children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.order_no}}),": ",s.jsx("span",{children:a.orderId})]})}),a.orderFrom&&s.jsx("h5",{className:"single-entity-and-center",children:a.menuDisplayName?a.menuDisplayName:a.orderFrom})]}),a.orderInfo.orderDate&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.date}}),":",s.jsx("span",{children:a.orderInfo.orderDate})]})}),a.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.delivery_date}}),":",s.jsx("span",{children:a.deliveryTimestamp})]})})]})]}),s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:"items products-heading-name-kot",children:L[c].itemName}),s.jsx("h6",{className:"items products-heading-qty-kot",children:"Qty"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[((fn=a.services)==null?void 0:fn.length)&&a.services.map(H=>{var W;return s.jsxs("div",{style:H.serviceName.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:"items products-heading-name-kot",style:{lineHeight:1.2},children:H.serviceName.toUpperCase()}),s.jsx("h6",{className:"items products-heading-qty-kot",children:H.qty})]}),((W=H.addons)==null?void 0:W.length)&&H.addons.map(A=>s.jsx("h6",{className:"items products-heading-addon-kot",children:"- "+Ve(A.serviceName)})),H.instruction&&a.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:H.instruction})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:"bottom-section-div flex-two-items",style:{paddingBottom:"3rem"},children:[s.jsxs("h5",{children:["TOTAL ITEMS: ",a.services.length]}),s.jsxs("h5",{children:["TOTAL QTY: ",ve(a.totalQty)]})]}),a&&a.discountAmt?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:"DISCOUNT AMOUNT"}),s.jsx("h5",{children:le(a.discountAmt,i)})]}):"",a.otherCharges&&a.otherCharges.length>0?a.otherCharges.map(H=>{if(H.amt)return s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:H.name}),s.jsx("h5",{children:a.curr+" "+p(H.amt)})]})}):"",a.taxObj&&a.taxObj.GST?s.jsx(s.Fragment,{children:a.taxObj.GST.map(H=>{let W=new Array;for(const A in H)if(H[A]&&H[A]!=0){let I=A/2;W.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:["CGST @",I]}),s.jsx("h5",{children:a.curr+" "+p(H[A]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:[d.taxLabel+" "," @",I,"%"]}),s.jsx("h5",{children:a.curr+" "+p(H[A]/2)})]})]}))}return W})}):"",s.jsx("div",{style:{marginTop:"6px"},children:(bs=a.customFeilds)==null?void 0:bs.map(H=>s.jsx("h4",{className:"left-align-entity",children:H.customName+": "+H.customValue}))}),a.paymentState&&s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"6px"},children:`Payment Status: ${a.paymentState=="PAID_ONLINE"?"Online paid":"COD"}`}),j?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${j}`,className:"single-entity-and-center",style:{width:L[c].logoWidth}})}):"",a.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.footerMessage}}):"",a.printedBy&&a.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${a.printedBy}`}):"",a.printTime&&a.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${a.printTime}`}):"",a.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})})}else if(g==="UPDATE_TABLE"){let P="";return a.action==="SWITCH_TABLE"?P=s.jsx("div",{className:"main-div",style:{width:"100%",height:"auto"},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["**",(pn=f.Table)==null?void 0:pn.toUpperCase()," SWITCH**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(Ss=a.from)==null?void 0:Ss.map((N,H)=>{var W,A,I;return`${(A=(W=e.tableData[N])==null?void 0:W.attachedArea)==null?void 0:A.toUpperCase()} - ${(I=e.tableData[N])==null?void 0:I.tableName}${H+1===a.from.length?"":", "} `})}),s.jsx("br",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"To"}),s.jsx("h2",{className:"left-align-entity level2-bold",children:`${(yn=(Ts=e.tableData[a.to[0]])==null?void 0:Ts.attachedArea)==null?void 0:yn.toUpperCase()} - ${(gn=e.tableData[a.to[0]])==null?void 0:gn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${f.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}):P=s.jsx("div",{className:"main-div",style:{width:"100%",height:"auto"},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["**MERGE ",(ws=f.Table)==null?void 0:ws.toUpperCase(),"**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(Is=a.from)==null?void 0:Is.map((N,H)=>{var W,A,I;return`${(A=(W=e.tableData[N])==null?void 0:W.attachedArea)==null?void 0:A.toUpperCase()} - ${(I=e.tableData[N])==null?void 0:I.tableName}${H+1===a.from.length?"":", "} `})}),s.jsx("br",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"To"}),s.jsx("h2",{className:"left-align-entity level2-bold",children:`${(Nn=(xn=e.tableData[a.to[0]])==null?void 0:xn.attachedArea)==null?void 0:Nn.toUpperCase()} - ${(jn=e.tableData[a.to[0]])==null?void 0:jn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${f.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}),P}else if(g==="COUNTER_OPERATION"){let P;return c=="2INCH"||c=="1.8INCH"?P=s.jsx("div",{className:"main-div",style:{width:L[c].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:[a.counterName," Report"]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed By: ",a.printedBy," "]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed On: ",a.printedOn," "]}),s.jsx("hr",{}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" Total Sales: ",G(a.totalSale,i)," "]}),a.totalSale>0&&s.jsxs(s.Fragment,{children:[(a.cashSale>0||a.cashSale<0)&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash: ",G(a.cashSale,i)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(N=>{if(N.value>0||N.value<0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",N.displayName," : ",G(N.value,i)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",G(a.closingActualBalance,i)]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Opening Counter Operation"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opened By : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",a.openedBy]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Date/Time : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",a.openingDateTime]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- System Opening Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",G(a.openingBalance,i)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Opening Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",G(a.actualOpeningBalance,i)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opening Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",G(a.openingShort,i)," "]}),a.openingShortReason&&s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opening Difference Reason : "}),a.openingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",a.openingShortReason]}),a.openingTotalDenomations>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.openingDenominations&&a.openingDenominations.length>0&&a.openingDenominations.map(N=>s.jsxs("div",{class:i=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:["   ",i=="INR"?G(N.denomination,i):N.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",N.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",G(N.total,i)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:i=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:G(a.openingTotalDenomations,i)})]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Closing Counter Operation"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closed By : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",a.closedBy," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Date/Time :"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",a.closingDateTime]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Cash Sale : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",G(a.cashSale,i)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- System Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",G(a.closingBalance,i)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["   ",G(a.closingActualBalance,i)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closing Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",G(a.closingShort,i)," "]}),a.closingShortReason&&s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closing Difference Reason : "}),a.closingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",a.closingShortReason," "]}),a.debitEntry>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Other Cash Expense : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    -",G(a.debitEntry,i)," "]})]}),a.creditEntry>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Other Cash Income : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    +",G(a.creditEntry,i)," "]})]}),a.internalTransferDebit>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Internal Transfer(cash to bank): "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["   -",G(a.internalTransferDebit,i)]})]}),a.internalTransferCredit>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Internal Transfer(bank to cash) : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["   +",G(a.internalTransferCredit,i)]})]}),a.TotalDenomationsAmount>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.denomations&&a.denomations.length>0&&a.denomations.map(N=>s.jsxs("div",{class:i=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:["  ",i=="INR"?G(N.denomination,i):N.curr+" "+N.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",N.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",G(N.total,i)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:i=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:G(a.TotalDenomationsAmount,i)})]})]})}):P=s.jsx("div",{className:"main-div",style:{width:L[c].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:[a.counterName," Report"]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed By: ",a.printedBy," "]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed On: ",a.printedOn," "]}),s.jsx("hr",{}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" Total Sales: ",G(a.totalSale,i)," "]}),a.totalSale>0&&s.jsxs(s.Fragment,{children:[a.cashSale>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash: ",G(a.cashSale,i)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(N=>{if(N.value>0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",N.displayName," : ",G(N.value,i)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",G(a.closingActualBalance,i)]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Opening Counter Operation"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Opened By : ",a.openedBy]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Date/Time : ",a.openingDateTime]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Opening Balance : ",G(a.openingBalance,i)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Opening Balance : ",G(a.actualOpeningBalance,i)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Opening Difference Amt : ",G(a.openingShort,i)]}),a.openingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Opening Difference Reason : ",a.openingShortReason]}),a.openingTotalDenomations>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.openingDenominations&&a.openingDenominations.length>0&&a.openingDenominations.map(N=>s.jsxs("div",{class:i=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:["   ",i=="INR"?G(N.denomination,i):N.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",N.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",G(N.total,i)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:i=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:G(a.openingTotalDenomations,i)})]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Closing Counter Operation"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Closed By : ",a.closedBy," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Date/Time : ",a.closingDateTime]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash Sale : ",G(a.cashSale,i)," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Closing Balance : ",G(a.closingBalance,i)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Closing Balance : ",G(a.closingActualBalance,i)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Closing Difference Amt : ",G(a.closingShort,i)]}),a.closingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Closing Difference Reason : ",a.closingShortReason," "]}),a.debitEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Expense : -",G(a.debitEntry,i)]}),a.creditEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Income : +",G(a.creditEntry,i)]}),a.internalTransferDebit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(cash to bank): -",G(a.internalTransferDebit,i)]}),a.internalTransferCredit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(bank to cash): +",G(a.internalTransferCredit,i)]}),a.TotalDenomationsAmount>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"--Currency Denominations"})}),a.denomations&&a.denomations.length>0&&a.denomations.map(N=>s.jsxs("div",{class:i=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:["  ",i=="INR"?G(N.denomination,i):N.curr+" "+N.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",N.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",G(N.total,i)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:i=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:G(a.TotalDenomationsAmount,i)})]})]})}),P}else if(g==="ITEMWISE_SALES_COUNTER"){let P,{counterDetails:N}=e.printerDataObject;return P=s.jsx("div",{className:"main-div",style:{width:L[c].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("h2",{className:"single-entity-and-center level2-bold",children:"Item Wise Sales Report"}),s.jsx("h5",{className:"single-entity-and-center level3-bold",children:N.currentDate}),s.jsx("hr",{}),N.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Counter Name: ",N.CounterName]}),N.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["UserName: ",N.openedBy]}),N.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Login Time: ",N.loginTime]}),N.logoutTime&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Logout Time: ",N.logoutTime]}),N.CounterName&&s.jsx("hr",{}),nt(a),s.jsx("hr",{}),s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${N.openedBy}`}),s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${N.printedOn}`})]})}),P}else if(g==="CARD_RECHARGE_DETAILS"){let{staticDataKOT:P}=e.printerDataObject;return getRechargeDetails(P)}else if(g==="PACKAGING_SLIP"){let P,N=0;d.aggregatorOrderId&&d.aggregatorOrderId!==""&&(P=ee(d.aggregatorOrderId));const H=d.services;for(let A in H)N+=H[A].length;return s.jsx("div",{className:"main-div",style:{width:L[c].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:`details-section ${L[c].dynamicClassname}`,children:[d.subOrderFrom&&s.jsx("h4",{className:"single-entity-and-center",children:d.subOrderFrom.toUpperCase()}),d.orderFrom!=="dine-in"&&s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["Token No ",d.tokenId]}),d.tableName&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:d.tableName}),d.otp&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:"OTP: "+d.otp}),d.orderSource&&P&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${d.orderSource}: ${P.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:P.last4Dgits||""})]}),d.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:d.zomatoInstant}),s.jsx("hr",{}),d.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Order Id: "+d.orderId}),d.date&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Printed On: ",d.date]}),d.prepareBy?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Prepare By : "+d.prepareBy}):"",d.waiterName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${f.Waiter} Name: `+d.waiterName})]}),z(d),s.jsx("br",{}),s.jsxs("div",{className:"bottom-section-div flex-two-items space-3rem",children:[s.jsxs("h5",{children:["TOTAL ITEMS: ",N]}),s.jsxs("h5",{children:["TOTAL QTY: ",ve(d.totalQty)]})]}),(vn=d.customFields)==null?void 0:vn.map(A=>s.jsx("h4",{className:"left-align-entity",children:A.customName+": "+A.customValue})),s.jsx("br",{}),d.orderFrom!=="dine-in"&&s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Payment Status: ",d.paymentStatus.replace("_"," ")]})]})})}else{if(g==="ORDER_AGGREGATED_PRINT")return s.jsx("div",{className:"main-div",style:{width:L[c].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[a.logo&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:a.logo,className:"single-entity-and-center"})}),s.jsxs("div",{className:`details-section ${L[c].dynamicClassname}`,children:[!a.logo&&a.companyName&&a.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:a.companyName}),a.companyAddress&&a.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.companyAddress}}),a.companyContact&&a.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.company_mobile}}),": ",s.jsx("span",{children:a.companyContact})]})}),a.fssai&&a.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.company_FSSAI}}),": ",s.jsx("span",{children:a.fssai})]})}),a.gst&&a.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.company_GST}}),": ",s.jsx("span",{children:a.gst})]})}),a.vatNo&&a.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.company_VAT}}),": ",s.jsx("span",{children:a.vatNo})]})})]}),s.jsx("hr",{}),s.jsx("h3",{className:"single-entity-and-center",children:"Outstanding Bill Summary"}),s.jsx("hr",{}),s.jsx("hr",{}),a.name&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.name}}),": ",s.jsx("span",{children:a.name})]}),a.mobile&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.mobile}}),": ",s.jsx("span",{children:a.mobile})]}),s.jsxs("div",{className:"mt-2",children:[s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:`items products-heading-name ${L[c].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${L[c].dynamicClassname}`,children:"Order Id"}),s.jsx("h5",{className:`items products-heading-amount ${L[c].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.orders.map(N=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,children:rr(N.date)}),s.jsx("h6",{className:`items products-heading-orderId ${L[c].dynamicClassname}`,children:N.orderId}),s.jsx("h6",{className:`items products-heading-amount ${L[c].dynamicClassname}`,children:a.curr+" "+p(N.finalAmount)})]})},N.orderId))})]}),s.jsxs("div",{children:[s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:"Total Bill Amount"}),s.jsx("h5",{className:"actual-qty",children:a.curr+" "+p(a.totalAmount)})]}),s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:"Total Amount Paid"}),s.jsx("h5",{className:"actual-qty",children:a.curr+" "+p(a.totalPaid)})]})]}),(x=a.transactions)!=null&&x.length?s.jsxs("div",{children:[s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:`items products-heading-name ${L[c].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${L[c].dynamicClassname}`,children:"Payment Mode"}),s.jsx("h5",{className:`items products-heading-amount ${L[c].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.transactions.map(N=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,children:N.date}),s.jsx("h6",{className:`items products-heading-orderId ${L[c].dynamicClassname}`,children:N.paymentMode}),s.jsx("h6",{className:`items products-heading-amount ${L[c].dynamicClassname}`,children:a.curr+" "+p(N.amount)})]})},N.id))})]}):"",s.jsxs("div",{className:"mt-2 pb-2rem",children:[s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h4",{className:"total-qty-other",children:"Total Payable"}),s.jsx("h4",{className:"actual-qty-other",children:a.curr+" "+p(a.totalPayable)})]})]})]})});{let P,N=0,H,W;for(let I=0;I<(((O=a.services)==null?void 0:O.length)||0);I++)W=a.services[I],W.status==="CANCELLED"&&!a.onlyCancelledItems&&(N+=W.qty);return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(P=ee(a.aggregatorOrderId)),s.jsx("div",{className:"main-div",style:{width:L[c].paperSize},children:s.jsxs("div",{style:{maxWidth:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:"main-div",children:[a.duplicate&&!a.onlyCancelledItems?s.jsx("h4",{className:"single-entity-and-center",children:"DUPLICATE KOT"}):"",N||a.onlyCancelledItems?s.jsx("h4",{className:"single-entity-and-center",children:"EDITED KOT - ITEM CANCELLED"}):"",a.station&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:a.station.toUpperCase()}),a.subOrderFrom&&s.jsx("h4",{className:"single-entity-and-center",children:a.subOrderFrom.toUpperCase()}),a.type!="dine-in"&&a.tokenId&&s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["Token No ",a.tokenId]}),a.type=="dine-in"&&a.type&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:a.type==="dine-in"?a.tableName?a.tableName:"-":""}),s.jsx("hr",{}),a.otp&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:"OTP: "+a.otp}),a.orderSource&&P&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${a.orderSource}: ${P.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:P.last4Dgits||""})]}),a.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:a.zomatoInstant}),s.jsxs("div",{className:"details-section",children:[a.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Order Id: "+Array.from(a.orderId).join(", ")}),s.jsxs("div",{className:"flex-container-kot",children:[a.kotId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${f.KOT} Id: `+Array.from(a.kotId).join(", ")}),a.type&&a.type!="dine-in"&&s.jsx("h2",{className:"left-align-entity",children:a.type==="dine-in"?a.tableName?a.tableName:"-":""})]}),a.customerName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:a.customerName}),a.time?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Printed On : "+a.time}):"",a.prepareBy?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Prepare By : "+a.prepareBy}):""]}),a.createdBy&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Printed By: "+a.createdBy}),a.waiterName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${f.Waiter} Name: `+a.waiterName})]}),s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${_e}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:L[c].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:`products-section ${_e}`,style:{paddingTop:"12px"},children:[a.services&&a.services.length&&a.services.length>0&&a.services.reverse().map(I=>(I.status==="CANCELLED"?H=s.jsxs("strike",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ve(I.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:I.qty})]}),I.addons&&I.addons.length&&I.addons.map(he=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ve(he.serviceName)})),I.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+I.instruction})})]}):H=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ve(I.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:I.qty})]}),I.addons&&I.addons.length&&I.addons.map(he=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ve(he.serviceName)})),I.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+I.instruction})})]}),s.jsx("div",{children:H}))),s.jsx("hr",{})]}),s.jsxs("div",{className:"bottom-section-div flex-two-items",style:{paddingBottom:"3rem"},children:[s.jsxs("h5",{className:"level3-bold",children:["TOTAL ITEMS: ",a.services.length]}),s.jsxs("h5",{className:"level3-bold",children:["TOTAL QTY: ",ve(a.totalQty-N)]})]}),(U=a.customFields)==null?void 0:U.map(I=>s.jsx("h4",{className:"left-align-entity",children:I.customName+": "+I.customValue})),a.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Delivery Date: "+a.deliveryTimestamp})]})})}}};return s.jsx("div",{children:a&&Object.keys(a).length!==0&&s.jsx("div",{id:"domEl",ref:r,className:"html-bill-print",style:{maxWidth:L[c].paperSize,zIndex:"-10",backgroundColor:"#fff"},children:pt(u,a.obj,a.companyLogo,a.companyQrCode)})})},Ah=async(e,t,n,r={})=>new Promise(async(l,o)=>{var a,m,u;try{const{needPackagingSlip:i=!0}=r;e.primaryWaiter&&n&&(e.primaryWaiter=((a=n[e.primaryWaiter])==null?void 0:a.name)||null);const{obj:c,printersMap:h}=bd(e,t,r);let f=[],y=[];const p=[];if(Sa(c).flatMap(v=>{(h[v.station]||[]).forEach(E=>{const S=new Promise(T=>{p.push(s.jsx(qe,{printerDataObject:{staticDataKOT:v,paperSize:E.paperSize,printer:E.printer},newId:v.newId,value:{settingData:t},onImageGenerated:D=>{f.push({paperSize:E.paperSize,printer:E.printer,image:D,type:"KOT"}),T()},additionalActions:r},v.newId+"::"+E.printer))});y.push(S)})}),i&&((m=t.packagingSlipPrinters)!=null&&m.length)){const v=Sd(e,t,r);(u=v.printers)!=null&&u.length&&v.printers.forEach(_=>{y.push(new Promise(E=>{p.push(s.jsx(qe,{printerDataObject:{staticDataKOT:{obj:_.obj},paperSize:_.paperSize,printer:_.printer,type:"PACKAGING_SLIP"},newId:_.obj.newId,value:{settingData:t},onImageGenerated:S=>{f.push({paperSize:_.paperSize,printer:_.printer,image:S,type:"PACKAGING_SLIP"}),E()},additionalActions:r},_.obj.newId))}))})}p.length&&bt("root2",p),await Promise.all(y),l(f)}catch(i){o(i)}}),Eh=(e,t,n)=>new Promise(async(r,l)=>{try{const{tableData:o}=n;let a=[],m=[];if(n!=null&&n.action){const{obj:u,paperSize:i,printersMap:c}=Td(e,t,n),h=Sa(u).flatMap(f=>{var y;return(y=c[f.station])==null?void 0:y.map(p=>new Promise(v=>{const _=s.jsx(qe,{printerDataObject:{staticDataKOT:f,paperSize:i,printer:p.printer,type:f.type},newId:f.newId,settingData:t,tableData:ms(o,"typeValue"),onImageGenerated:E=>{a.push({paperSize:p.paperSize,printer:p.printer,image:E,type:"UPDATE_TABLE"}),v()},additionalActions:n});return m.push(v),_}))});h.length&&bt("root1",h),await Promise.all(m.map(f=>new Promise(f)))}r(a)}catch(o){l(o)}}),Rh=(e,t)=>new Promise(async(n,r)=>{try{const l=wd(e,t);let o=[];await new Promise(m=>{const u=s.jsx(qe,{printerDataObject:{staticDataKOT:{obj:l},paperSize:e.printerSize,type:"PRINT_DASHBOARD"},newId:l.id,settingData:e,onImageGenerated:i=>{o.push({paperSize:e.printerSize,image:i,type:"PRINT_DASHBOARD"}),m()},additionalActions:t});bt("root1",u)}),n(o)}catch(l){r(l)}}),Lh=async(e,t,n)=>new Promise(async(r,l)=>{try{const{obj:o}=await Id(e,t,n);let a=[];await new Promise(u=>{const i=s.jsx(qe,{printerDataObject:{staticDataKOT:o,paperSize:o.paperSize,type:"AGGREGATOR_BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{a.push({paperSize:o.paperSize,image:c,type:"AGGREGATOR_BILL"}),u()},additionalActions:n});bt("root1",i)}),r(a)}catch(o){l(o)}}),kh=async(e,t,n)=>new Promise(async(r,l)=>{try{let o=await ba(e,t,n),a=[];await new Promise(async u=>{if(n.isSplitBill&&o.obj.splitDetails&&o.obj.splitDetails.length){const i=o.obj.splitDetails.map((c,h)=>new Promise(f=>{let y=JSON.parse(JSON.stringify(o));y.obj.splitDetails=[c];const p=s.jsx(qe,{printerDataObject:{staticDataKOT:y,paperSize:y.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:v=>{a.push({paperSize:y.paperSize,image:v,type:"BILL"}),f()},additionalActions:n,invoiceFormat:n.invoiceFormat||{}});ti(p)}));await Promise.all(i),u()}else{const i=s.jsx(qe,{printerDataObject:{staticDataKOT:o,paperSize:o.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{a.push({paperSize:o.paperSize,image:c,type:"BILL"}),u()},additionalActions:n});ti(i)}}),r(a)}catch(o){l(o)}}),Ph=async(e,t,n,r)=>new Promise(async(l,o)=>{try{let a=await Cd(e);if(a&&Object.keys(a.Category).length!==0){let u=`ItemWiseSales:::${Math.floor(Math.random()*1e3)}`,i=[];await new Promise(h=>{const f=s.jsx(qe,{printerDataObject:{staticDataKOT:a,paperSize:t.printerSize,type:"ITEMWISE_SALES_COUNTER",counterDetails:n},newId:u,settingData:t,onImageGenerated:y=>{i.push({paperSize:t.printerSize,image:y,type:"ITEMWISE_SALES_COUNTER"}),h()},additionalActions:r});bt("root1",f)}),l(i)}else l([])}catch(a){o(a)}}),Fh=async(e,t,n)=>new Promise(async(r,l)=>{try{let a=`counterDetailsPrint:::${Math.floor(Math.random()*1e3)}`,m=[];await new Promise(i=>{const c=s.jsx(qe,{printerDataObject:{staticDataKOT:e,paperSize:t.printerSize,type:"COUNTER_OPERATION"},newId:a,settingData:t,onImageGenerated:h=>{m.push({paperSize:t.printerSize,image:h,type:"COUNTER_OPERATION"}),i()},additionalActions:n});bt("root1",c)}),r(m)}catch(o){l(o)}}),Dh=async(e,t,n={},r={})=>new Promise(async(l,o)=>{var a;try{const m=await Md(e,t);let u=[],i=lr(null,{fontTheme:t.fontTheme,type:"ORDER_AGGREGATED_PRINT",siteSetting:t}),c=i?(a=i[0])==null?void 0:a.paperSize:t.printerSize;await new Promise(f=>{const y=s.jsx(qe,{printerDataObject:{staticDataKOT:{...m,name:n.name,mobile:n.mobile},paperSize:c,type:"ORDER_AGGREGATED_PRINT"},newId:Math.random(),settingData:t,onImageGenerated:p=>{u.push({paperSize:c,image:p,type:"ORDER_AGGREGATED_PRINT"}),f()},additionalActions:r});bt("root1",y)}),l(u)}catch(m){o(m)}}),Yh=async(e,t,n={})=>new Promise(async(r,l)=>{var o;try{const a=[];let m=[];for(let u=0;u<e.length;u++){let i=e[u];if((o=i.invoiceFormats)!=null&&o.length){let c=dd(i.invoiceFormats,"createdAt")[0],h=await Ad(c);await new Promise(y=>{const p=s.jsx(qe,{printerDataObject:{staticDataKOT:h,paperSize:h.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:v=>{m.push({paperSize:h.paperSize,image:v,type:"BILL"}),y()},additionalActions:n});a.push(p)})}}a.length&&bt("root1",a),r(m)}catch(a){l(a)}}),bt=(e,t)=>{const n=document.getElementById(e);n&&vr.createRoot(n).render(t)},ti=e=>{try{const t=Object.assign(document.createElement("div"),{id:`react-root-${Math.random().toString(36).slice(2,11)}`,style:"position:absolute; top:-9999px; left:-9999px;"});document.body.appendChild(t);const n=vr.createRoot(t),r=()=>{n.unmount(),t.remove()};n.render(ge.cloneElement(e,{handleUnmount:r}))}catch(t){console.log("renderComponentsV2 err :::",t)}};we.counterDetailsPrint=Fh,we.handleAggregatorBillPrint=Lh,we.handleBillPrint=kh,we.handleDashboardPrint=Rh,we.handleItemWisePrint=Ph,we.handleKOTPrint=Ah,we.handleOldBillPrints=Yh,we.handleSummaryPrint=Dh,we.handleUpdateTablePrint=Eh,Object.defineProperty(we,Symbol.toStringTag,{value:"Module"})});